@zyzgroup/core-web 0.0.12 → 0.0.13

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 (180) hide show
  1. package/dist/zyzgroup_core_web.iife.js +14 -12
  2. package/dist/zyzgroup_core_web.iife.js.map +1 -1
  3. package/dist/zyzgroup_core_web.js +17903 -6638
  4. package/dist/zyzgroup_core_web.js.map +1 -1
  5. package/dist/zyzgroup_core_web.umd.cjs +14 -12
  6. package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
  7. package/package.json +2 -1
  8. package/types/animate.d.ts +1 -0
  9. package/types/animate.d.ts.map +1 -1
  10. package/types/canvas/index.d.ts +19 -20
  11. package/types/canvas/index.d.ts.map +1 -1
  12. package/types/canvas/konva/KonvaApp.d.ts +160 -0
  13. package/types/canvas/konva/KonvaApp.d.ts.map +1 -0
  14. package/types/canvas/konva/plugins/AlignmentPlugin.d.ts +37 -0
  15. package/types/canvas/konva/plugins/AlignmentPlugin.d.ts.map +1 -0
  16. package/types/canvas/konva/plugins/HistoryPlugin/HistoryPlugin.d.ts +51 -0
  17. package/types/canvas/konva/plugins/HistoryPlugin/HistoryPlugin.d.ts.map +1 -0
  18. package/types/canvas/konva/plugins/HistoryPlugin/commands/add-object-cmd.d.ts +9 -0
  19. package/types/canvas/konva/plugins/HistoryPlugin/commands/add-object-cmd.d.ts.map +1 -0
  20. package/types/canvas/konva/plugins/HistoryPlugin/commands/base.d.ts +57 -0
  21. package/types/canvas/konva/plugins/HistoryPlugin/commands/base.d.ts.map +1 -0
  22. package/types/canvas/konva/plugins/HistoryPlugin/commands/decompose-group-cmd.d.ts +9 -0
  23. package/types/canvas/konva/plugins/HistoryPlugin/commands/decompose-group-cmd.d.ts.map +1 -0
  24. package/types/canvas/konva/plugins/HistoryPlugin/commands/index.d.ts +8 -0
  25. package/types/canvas/konva/plugins/HistoryPlugin/commands/index.d.ts.map +1 -0
  26. package/types/canvas/konva/plugins/HistoryPlugin/commands/make-group-cmd.d.ts +9 -0
  27. package/types/canvas/konva/plugins/HistoryPlugin/commands/make-group-cmd.d.ts.map +1 -0
  28. package/types/canvas/konva/plugins/HistoryPlugin/commands/modified-object-cmd.d.ts +9 -0
  29. package/types/canvas/konva/plugins/HistoryPlugin/commands/modified-object-cmd.d.ts.map +1 -0
  30. package/types/canvas/konva/plugins/HistoryPlugin/commands/move-zIndex-object-cmd.d.ts +9 -0
  31. package/types/canvas/konva/plugins/HistoryPlugin/commands/move-zIndex-object-cmd.d.ts.map +1 -0
  32. package/types/canvas/konva/plugins/HistoryPlugin/commands/remove-object-cmd.d.ts +9 -0
  33. package/types/canvas/konva/plugins/HistoryPlugin/commands/remove-object-cmd.d.ts.map +1 -0
  34. package/types/canvas/konva/plugins/SelectorPlugin.d.ts +72 -0
  35. package/types/canvas/konva/plugins/SelectorPlugin.d.ts.map +1 -0
  36. package/types/canvas/konva/plugins/index.d.ts +4 -0
  37. package/types/canvas/konva/plugins/index.d.ts.map +1 -0
  38. package/types/canvas/konva/polyfill/ellipse.d.ts +2 -0
  39. package/types/canvas/konva/polyfill/ellipse.d.ts.map +1 -0
  40. package/types/canvas/konva/polyfill/image.d.ts +2 -0
  41. package/types/canvas/konva/polyfill/image.d.ts.map +1 -0
  42. package/types/canvas/konva/polyfill/index.d.ts +8 -0
  43. package/types/canvas/konva/polyfill/index.d.ts.map +1 -0
  44. package/types/canvas/konva/polyfill/line.d.ts +2 -0
  45. package/types/canvas/konva/polyfill/line.d.ts.map +1 -0
  46. package/types/canvas/konva/polyfill/node.d.ts +2 -0
  47. package/types/canvas/konva/polyfill/node.d.ts.map +1 -0
  48. package/types/canvas/konva/polyfill/rect.d.ts +2 -0
  49. package/types/canvas/konva/polyfill/rect.d.ts.map +1 -0
  50. package/types/canvas/konva/polyfill/regular-polygon.d.ts +2 -0
  51. package/types/canvas/konva/polyfill/regular-polygon.d.ts.map +1 -0
  52. package/types/canvas/konva/polyfill/text.d.ts +2 -0
  53. package/types/canvas/konva/polyfill/text.d.ts.map +1 -0
  54. package/types/canvas/konva/services/Mouse.d.ts +16 -0
  55. package/types/canvas/konva/services/Mouse.d.ts.map +1 -0
  56. package/types/canvas/konva/services/Tooler.d.ts +19 -0
  57. package/types/canvas/konva/services/Tooler.d.ts.map +1 -0
  58. package/types/canvas/konva/services/index.d.ts +3 -0
  59. package/types/canvas/konva/services/index.d.ts.map +1 -0
  60. package/types/canvas/konva/services/types.d.ts +7 -0
  61. package/types/canvas/konva/services/types.d.ts.map +1 -0
  62. package/types/canvas/konva/tools/DiamondTool.d.ts +20 -0
  63. package/types/canvas/konva/tools/DiamondTool.d.ts.map +1 -0
  64. package/types/canvas/konva/tools/DrawingTool.d.ts +20 -0
  65. package/types/canvas/konva/tools/DrawingTool.d.ts.map +1 -0
  66. package/types/canvas/konva/tools/EllipseTool.d.ts +20 -0
  67. package/types/canvas/konva/tools/EllipseTool.d.ts.map +1 -0
  68. package/types/canvas/konva/tools/EraserTool.d.ts +16 -0
  69. package/types/canvas/konva/tools/EraserTool.d.ts.map +1 -0
  70. package/types/canvas/konva/tools/ImageTool.d.ts +21 -0
  71. package/types/canvas/konva/tools/ImageTool.d.ts.map +1 -0
  72. package/types/canvas/konva/tools/LineTool.d.ts +21 -0
  73. package/types/canvas/konva/tools/LineTool.d.ts.map +1 -0
  74. package/types/canvas/konva/tools/RectTool.d.ts +21 -0
  75. package/types/canvas/konva/tools/RectTool.d.ts.map +1 -0
  76. package/types/canvas/konva/tools/SelectTool.d.ts +10 -0
  77. package/types/canvas/konva/tools/SelectTool.d.ts.map +1 -0
  78. package/types/canvas/konva/tools/TextTool.d.ts +18 -0
  79. package/types/canvas/konva/tools/TextTool.d.ts.map +1 -0
  80. package/types/canvas/konva/tools/index.d.ts +10 -0
  81. package/types/canvas/konva/tools/index.d.ts.map +1 -0
  82. package/types/canvas/konva/utils/index.d.ts +22 -0
  83. package/types/canvas/konva/utils/index.d.ts.map +1 -0
  84. package/types/canvas/shapes/ball.d.ts +5 -14
  85. package/types/canvas/shapes/ball.d.ts.map +1 -1
  86. package/types/canvas/shapes/ball3d.d.ts +1 -1
  87. package/types/canvas/shapes/ball3d.d.ts.map +1 -1
  88. package/types/canvas/shapes/box.d.ts +2 -1
  89. package/types/canvas/shapes/box.d.ts.map +1 -1
  90. package/types/canvas/shapes/segment.d.ts +2 -2
  91. package/types/canvas/shapes/segment.d.ts.map +1 -1
  92. package/types/canvas/shapes/slider.d.ts.map +1 -1
  93. package/types/canvas/shapes/triangle-light.d.ts +3 -3
  94. package/types/canvas/shapes/triangle-light.d.ts.map +1 -1
  95. package/types/canvas/shapes/triangle.d.ts +2 -2
  96. package/types/canvas/shapes/triangle.d.ts.map +1 -1
  97. package/types/color.d.ts +21 -0
  98. package/types/color.d.ts.map +1 -0
  99. package/types/dom/DOMDetect.d.ts +19 -0
  100. package/types/dom/DOMDetect.d.ts.map +1 -0
  101. package/types/dom/DOMEvent.d.ts +7 -0
  102. package/types/dom/DOMEvent.d.ts.map +1 -0
  103. package/types/dom/DOMKey.d.ts +31 -0
  104. package/types/dom/DOMKey.d.ts.map +1 -0
  105. package/types/dom/DOMMedia.d.ts +6 -0
  106. package/types/dom/DOMMedia.d.ts.map +1 -0
  107. package/types/dom/DOMMouse.d.ts +8 -0
  108. package/types/dom/DOMMouse.d.ts.map +1 -0
  109. package/types/dom/DOMQuery.d.ts +77 -0
  110. package/types/dom/DOMQuery.d.ts.map +1 -0
  111. package/types/dom/DOMScroll.d.ts +7 -0
  112. package/types/dom/DOMScroll.d.ts.map +1 -0
  113. package/types/dom/index.d.ts +7 -0
  114. package/types/dom/index.d.ts.map +1 -0
  115. package/types/dom/zyzui.d.ts +1 -0
  116. package/types/dom/zyzui.d.ts.map +1 -0
  117. package/types/dom.d.ts +6 -5
  118. package/types/dom.d.ts.map +1 -1
  119. package/types/env.d.ts +2 -3
  120. package/types/env.d.ts.map +1 -1
  121. package/types/fetch.d.ts +7 -1
  122. package/types/fetch.d.ts.map +1 -1
  123. package/types/file.d.ts +6 -7
  124. package/types/file.d.ts.map +1 -1
  125. package/types/image-gif.d.ts +7 -0
  126. package/types/image-gif.d.ts.map +1 -0
  127. package/types/image.d.ts +1 -4
  128. package/types/image.d.ts.map +1 -1
  129. package/types/index.d.ts +10 -6
  130. package/types/index.d.ts.map +1 -1
  131. package/types/localstorage.d.ts +1 -2
  132. package/types/localstorage.d.ts.map +1 -1
  133. package/types/math/AnimateShape.d.ts +45 -0
  134. package/types/math/AnimateShape.d.ts.map +1 -0
  135. package/types/{sprite-math/matrix.d.ts → math/Matrix.d.ts} +6 -5
  136. package/types/math/Matrix.d.ts.map +1 -0
  137. package/types/math/Point.d.ts +27 -0
  138. package/types/math/Point.d.ts.map +1 -0
  139. package/types/math/Polygon.d.ts +16 -0
  140. package/types/math/Polygon.d.ts.map +1 -0
  141. package/types/math/Rect.d.ts +14 -0
  142. package/types/math/Rect.d.ts.map +1 -0
  143. package/types/{sprite-math/vector.d.ts → math/Vector.d.ts} +2 -2
  144. package/types/math/Vector.d.ts.map +1 -0
  145. package/types/math/index.d.ts +7 -0
  146. package/types/math/index.d.ts.map +1 -0
  147. package/types/math/math.d.ts +7 -0
  148. package/types/math/math.d.ts.map +1 -0
  149. package/types/patch.d.ts +15 -0
  150. package/types/patch.d.ts.map +1 -0
  151. package/types/position.d.ts +17 -13
  152. package/types/position.d.ts.map +1 -1
  153. package/types/qrcode.d.ts +87 -0
  154. package/types/qrcode.d.ts.map +1 -0
  155. package/types/query.d.ts +65 -0
  156. package/types/query.d.ts.map +1 -0
  157. package/types/url.d.ts +10 -4
  158. package/types/url.d.ts.map +1 -1
  159. package/types/video.d.ts +4 -0
  160. package/types/video.d.ts.map +1 -1
  161. package/types/webgl/index.d.ts +7 -0
  162. package/types/webgl/index.d.ts.map +1 -0
  163. package/types/webrtc/adapter.d.ts +9 -0
  164. package/types/webrtc/adapter.d.ts.map +1 -0
  165. package/types/webrtc/index.d.ts +29 -0
  166. package/types/webrtc/index.d.ts.map +1 -0
  167. package/types/DOMKeyboardKeyCode.d.ts +0 -11
  168. package/types/DOMKeyboardKeyCode.d.ts.map +0 -1
  169. package/types/error.d.ts +0 -15
  170. package/types/error.d.ts.map +0 -1
  171. package/types/patchDOM.d.ts +0 -2
  172. package/types/patchDOM.d.ts.map +0 -1
  173. package/types/scroll.d.ts +0 -6
  174. package/types/scroll.d.ts.map +0 -1
  175. package/types/sprite-math/index.d.ts +0 -4
  176. package/types/sprite-math/index.d.ts.map +0 -1
  177. package/types/sprite-math/matrix.d.ts.map +0 -1
  178. package/types/sprite-math/vector.d.ts.map +0 -1
  179. package/types/visual_util.d.ts +0 -86
  180. package/types/visual_util.d.ts.map +0 -1
@@ -1,18 +1,20 @@
1
- var ZYZGroupCoreWeb=function(w){"use strict";class Me extends Error{cause;constructor(e,n){super(e,n),this.name=this.constructor.name}}class Fi extends Me{constructor(){super("This is not a browser environment")}}class mn extends Me{constructor(){super("Cancel select")}}class zi extends Me{accepts;constructor(e){super(`Please select files in ${e} format`),this.accepts=e}}var Q=(t=>(t.UNKNOWN="",t.HTML="text/html",t.CSS="text/css",t.JPEG="image/jpeg",t.PNG="image/png",t.GIF="image/gif",t.WEBP="image/webp",t.SVG="image/svg+xml",t.MPEG="audio/mpeg",t.OGG="audio/ogg",t.MP4="video/mp4",t.JSON="application/json",t.JAVASCRIPT="application/javascript",t.ECMASCRIPT="application/ecmascript",t.EXCEL="application/vnb.ms-excel",t.CSV="application/x-csv",t.PDF="application/pdf",t.ZIP="application/zip",t.TGZ="application/x-gtar",t.TAR_GZ="application/x-gzip",t.XML="text/xml",t.TEXT="text/plain",t))(Q||{});const wn=t=>{let e=Q.UNKNOWN;switch(new DataView(t).getUint32(0,!1).toString(16).toUpperCase()){case"FFD8FFDB":e=Q.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":e=Q.JPEG;break;case"89504E47":e=Q.PNG;break;case"47494638":e=Q.GIF;break;case"52494646":e=Q.WEBP;break;case"25504446":e=Q.PDF;break;case"504B0304":e=Q.ZIP;break}return e};function Fs(t){return Object.prototype.toString.call(t).match(/\[object (\w+)\]/)[1].toLowerCase()}function zs(t){return Fs(t)==="array"}var yn={exports:{}},Bt=typeof Reflect=="object"?Reflect:null,Bi=Bt&&typeof Bt.apply=="function"?Bt.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)},Re;Bt&&typeof Bt.ownKeys=="function"?Re=Bt.ownKeys:Object.getOwnPropertySymbols?Re=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Re=function(t){return Object.getOwnPropertyNames(t)};function Bs(t){console&&console.warn&&console.warn(t)}var Ni=Number.isNaN||function(t){return t!==t};function F(){F.init.call(this)}yn.exports=F,yn.exports.once=qs,F.EventEmitter=F,F.prototype._events=void 0,F.prototype._eventsCount=0,F.prototype._maxListeners=void 0;var ji=10;function Oe(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(F,"defaultMaxListeners",{enumerable:!0,get:function(){return ji},set:function(t){if(typeof t!="number"||t<0||Ni(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ji=t}}),F.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},F.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Ni(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Hi(t){return t._maxListeners===void 0?F.defaultMaxListeners:t._maxListeners}F.prototype.getMaxListeners=function(){return Hi(this)},F.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i=t==="error",r=this._events;if(r!==void 0)i=i&&r.error===void 0;else if(!i)return!1;if(i){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=r[t];if(a===void 0)return!1;if(typeof a=="function")Bi(a,this,e);else for(var c=a.length,l=$i(a,c),n=0;n<c;++n)Bi(l[n],this,e);return!0};function qi(t,e,n,i){var r,o,s;if(Oe(n),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),s=o[e]),s===void 0)s=o[e]=n,++t._eventsCount;else if(typeof s=="function"?s=o[e]=i?[n,s]:[s,n]:i?s.unshift(n):s.push(n),r=Hi(t),r>0&&s.length>r&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,Bs(a)}return t}F.prototype.addListener=function(t,e){return qi(this,t,e,!1)},F.prototype.on=F.prototype.addListener,F.prototype.prependListener=function(t,e){return qi(this,t,e,!0)};function Ns(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Zi(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=Ns.bind(i);return r.listener=n,i.wrapFn=r,r}F.prototype.once=function(t,e){return Oe(e),this.on(t,Zi(this,t,e)),this},F.prototype.prependOnceListener=function(t,e){return Oe(e),this.prependListener(t,Zi(this,t,e)),this},F.prototype.removeListener=function(t,e){var n,i,r,o,s;if(Oe(e),i=this._events,i===void 0)return this;if(n=i[t],n===void 0)return this;if(n===e||n.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,r=o;break}if(r<0)return this;r===0?n.shift():js(n,r),n.length===1&&(i[t]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",t,s||e)}return this},F.prototype.off=F.prototype.removeListener,F.prototype.removeAllListeners=function(t){var e,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var r=Object.keys(n),o;for(i=0;i<r.length;++i)o=r[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=n[t],typeof e=="function")this.removeListener(t,e);else if(e!==void 0)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this};function Gi(t,e,n){var i=t._events;if(i===void 0)return[];var r=i[e];return r===void 0?[]:typeof r=="function"?n?[r.listener||r]:[r]:n?Hs(r):$i(r,r.length)}F.prototype.listeners=function(t){return Gi(this,t,!0)},F.prototype.rawListeners=function(t){return Gi(this,t,!1)},F.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Xi.call(t,e)},F.prototype.listenerCount=Xi;function Xi(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}F.prototype.eventNames=function(){return this._eventsCount>0?Re(this._events):[]};function $i(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}function js(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Hs(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}function qs(t,e){return new Promise(function(n,i){function r(s){t.removeListener(e,o),i(s)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",r),n([].slice.call(arguments))}Vi(t,e,o,{once:!0}),e!=="error"&&Zs(t,r,{once:!0})})}function Zs(t,e,n){typeof t.on=="function"&&Vi(t,"error",e,n)}function Vi(t,e,n,i){if(typeof t.on=="function")i.once?t.once(e,n):t.on(e,n);else if(typeof t.addEventListener=="function")t.addEventListener(e,function r(o){i.once&&t.removeEventListener(e,r),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var Gs=yn.exports;class F0 extends Gs.EventEmitter{constructor(){super()}on(e,n){return super.on(e,n)}addListener(e,n){return super.on(e,n)}once(e,n){return super.once(e,n)}removeListener(e,n){return super.removeListener(e,n)}off(e,n){return super.off(e,n)}removeAllListeners(e){return super.removeAllListeners(e)}emit(e,n){return super.emit(e,n)}listeners(e){return super.listeners(e)}rawListeners(e){return super.rawListeners(e)}listenerCount(e){return super.listenerCount(e)}prependListener(e,n){return super.prependListener(e,n)}prependOnceListener(e,n){return super.prependOnceListener(e,n)}}function Yi(t,e){return function(){return t.apply(e,arguments)}}const{toString:Xs}=Object.prototype,{getPrototypeOf:vn}=Object,Le=(t=>e=>{const n=Xs.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),tt=t=>(t=t.toLowerCase(),e=>Le(e)===t),Ue=t=>e=>typeof e===t,{isArray:Nt}=Array,te=Ue("undefined");function $s(t){return t!==null&&!te(t)&&t.constructor!==null&&!te(t.constructor)&&V(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Wi=tt("ArrayBuffer");function Vs(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Wi(t.buffer),e}const Ys=Ue("string"),V=Ue("function"),Ki=Ue("number"),Fe=t=>t!==null&&typeof t=="object",Ws=t=>t===!0||t===!1,ze=t=>{if(Le(t)!=="object")return!1;const e=vn(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ks=tt("Date"),Js=tt("File"),Qs=tt("Blob"),ta=tt("FileList"),ea=t=>Fe(t)&&V(t.pipe),na=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||V(t.append)&&((e=Le(t))==="formdata"||e==="object"&&V(t.toString)&&t.toString()==="[object FormData]"))},ia=tt("URLSearchParams"),ra=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ee(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let i,r;if(typeof t!="object"&&(t=[t]),Nt(t))for(i=0,r=t.length;i<r;i++)e.call(null,t[i],i,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(i=0;i<s;i++)a=o[i],e.call(null,t[a],a,t)}}function Ji(t,e){e=e.toLowerCase();const n=Object.keys(t);let i=n.length,r;for(;i-- >0;)if(r=n[i],e===r.toLowerCase())return r;return null}const Qi=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),tr=t=>!te(t)&&t!==Qi;function bn(){const{caseless:t}=tr(this)&&this||{},e={},n=(i,r)=>{const o=t&&Ji(e,r)||r;ze(e[o])&&ze(i)?e[o]=bn(e[o],i):ze(i)?e[o]=bn({},i):Nt(i)?e[o]=i.slice():e[o]=i};for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&ee(arguments[i],n);return e}const oa=(t,e,n,{allOwnKeys:i}={})=>(ee(e,(r,o)=>{n&&V(r)?t[o]=Yi(r,n):t[o]=r},{allOwnKeys:i}),t),sa=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),aa=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},la=(t,e,n,i)=>{let r,o,s;const a={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),o=r.length;o-- >0;)s=r[o],(!i||i(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&vn(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},ca=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},ha=t=>{if(!t)return null;if(Nt(t))return t;let e=t.length;if(!Ki(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},fa=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&vn(Uint8Array)),ua=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=n.next())&&!i.done;){const r=i.value;e.call(t,r[0],r[1])}},da=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},_a=tt("HTMLFormElement"),ga=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,i){return n.toUpperCase()+i}),er=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),pa=tt("RegExp"),nr=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};ee(n,(r,o)=>{let s;(s=e(r,o,t))!==!1&&(i[o]=s||r)}),Object.defineProperties(t,i)},ma=t=>{nr(t,(e,n)=>{if(V(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(V(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wa=(t,e)=>{const n={},i=r=>{r.forEach(o=>{n[o]=!0})};return Nt(t)?i(t):i(String(t).split(e)),n},ya=()=>{},va=(t,e)=>(t=+t,Number.isFinite(t)?t:e),xn="abcdefghijklmnopqrstuvwxyz",ir="0123456789",rr={DIGIT:ir,ALPHA:xn,ALPHA_DIGIT:xn+xn.toUpperCase()+ir},ba=(t=16,e=rr.ALPHA_DIGIT)=>{let n="";const{length:i}=e;for(;t--;)n+=e[Math.random()*i|0];return n};function xa(t){return!!(t&&V(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Ea=t=>{const e=new Array(10),n=(i,r)=>{if(Fe(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[r]=i;const o=Nt(i)?[]:{};return ee(i,(s,a)=>{const c=n(s,r+1);!te(c)&&(o[a]=c)}),e[r]=void 0,o}}return i};return n(t,0)},Sa=tt("AsyncFunction"),Ta=t=>t&&(Fe(t)||V(t))&&V(t.then)&&V(t.catch),T={isArray:Nt,isArrayBuffer:Wi,isBuffer:$s,isFormData:na,isArrayBufferView:Vs,isString:Ys,isNumber:Ki,isBoolean:Ws,isObject:Fe,isPlainObject:ze,isUndefined:te,isDate:Ks,isFile:Js,isBlob:Qs,isRegExp:pa,isFunction:V,isStream:ea,isURLSearchParams:ia,isTypedArray:fa,isFileList:ta,forEach:ee,merge:bn,extend:oa,trim:ra,stripBOM:sa,inherits:aa,toFlatObject:la,kindOf:Le,kindOfTest:tt,endsWith:ca,toArray:ha,forEachEntry:ua,matchAll:da,isHTMLForm:_a,hasOwnProperty:er,hasOwnProp:er,reduceDescriptors:nr,freezeMethods:ma,toObjectSet:wa,toCamelCase:ga,noop:ya,toFiniteNumber:va,findKey:Ji,global:Qi,isContextDefined:tr,ALPHABET:rr,generateString:ba,isSpecCompliantForm:xa,toJSONObject:Ea,isAsyncFn:Sa,isThenable:Ta};function O(t,e,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r)}T.inherits(O,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:T.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const or=O.prototype,sr={};["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(t=>{sr[t]={value:t}}),Object.defineProperties(O,sr),Object.defineProperty(or,"isAxiosError",{value:!0}),O.from=(t,e,n,i,r,o)=>{const s=Object.create(or);return T.toFlatObject(t,s,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),O.call(s,t.message,e,n,i,r),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const ka=null;function En(t){return T.isPlainObject(t)||T.isArray(t)}function ar(t){return T.endsWith(t,"[]")?t.slice(0,-2):t}function lr(t,e,n){return t?t.concat(e).map(function(i,r){return i=ar(i),!n&&r?"["+i+"]":i}).join(n?".":""):e}function Aa(t){return T.isArray(t)&&!t.some(En)}const Ca=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Be(t,e,n){if(!T.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,_){return!T.isUndefined(_[h])});const i=n.metaTokens,r=n.visitor||l,o=n.dots,s=n.indexes,a=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(e);if(!T.isFunction(r))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(T.isDate(h))return h.toISOString();if(!a&&T.isBlob(h))throw new O("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(h)||T.isTypedArray(h)?a&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,_,p){let g=h;if(h&&!p&&typeof h=="object"){if(T.endsWith(_,"{}"))_=i?_:_.slice(0,-2),h=JSON.stringify(h);else if(T.isArray(h)&&Aa(h)||(T.isFileList(h)||T.endsWith(_,"[]"))&&(g=T.toArray(h)))return _=ar(_),g.forEach(function(m,y){!(T.isUndefined(m)||m===null)&&e.append(s===!0?lr([_],y,o):s===null?_:_+"[]",c(m))}),!1}return En(h)?!0:(e.append(lr(p,_,o),c(h)),!1)}const f=[],u=Object.assign(Ca,{defaultVisitor:l,convertValue:c,isVisitable:En});function d(h,_){if(!T.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+_.join("."));f.push(h),T.forEach(h,function(p,g){(!(T.isUndefined(p)||p===null)&&r.call(e,p,T.isString(g)?g.trim():g,_,u))===!0&&d(p,_?_.concat(g):[g])}),f.pop()}}if(!T.isObject(t))throw new TypeError("data must be an object");return d(t),e}function cr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Sn(t,e){this._pairs=[],t&&Be(t,this,e)}const hr=Sn.prototype;hr.append=function(t,e){this._pairs.push([t,e])},hr.toString=function(t){const e=t?function(n){return t.call(this,n,cr)}:cr;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function Ia(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fr(t,e,n){if(!e)return t;const i=n&&n.encode||Ia,r=n&&n.serialize;let o;if(r?o=r(e,n):o=T.isURLSearchParams(e)?e.toString():new Sn(e,n).toString(i),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Da{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){T.forEach(this.handlers,function(n){n!==null&&e(n)})}}const ur=Da,dr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pa=typeof URLSearchParams<"u"?URLSearchParams:Sn,Ma=typeof FormData<"u"?FormData:null,Ra=typeof Blob<"u"?Blob:null,Oa=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),La=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),et={isBrowser:!0,classes:{URLSearchParams:Pa,FormData:Ma,Blob:Ra},isStandardBrowserEnv:Oa,isStandardBrowserWebWorkerEnv:La,protocols:["http","https","file","blob","url","data"]};function Ua(t,e){return Be(t,new et.classes.URLSearchParams,Object.assign({visitor:function(n,i,r,o){return et.isNode&&T.isBuffer(n)?(this.append(i,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function Fa(t){return T.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function za(t){const e={},n=Object.keys(t);let i;const r=n.length;let o;for(i=0;i<r;i++)o=n[i],e[o]=t[o];return e}function _r(t){function e(n,i,r,o){let s=n[o++];const a=Number.isFinite(+s),c=o>=n.length;return s=!s&&T.isArray(r)?r.length:s,c?(T.hasOwnProp(r,s)?r[s]=[r[s],i]:r[s]=i,!a):((!r[s]||!T.isObject(r[s]))&&(r[s]=[]),e(n,i,r[s],o)&&T.isArray(r[s])&&(r[s]=za(r[s])),!a)}if(T.isFormData(t)&&T.isFunction(t.entries)){const n={};return T.forEachEntry(t,(i,r)=>{e(Fa(i),r,n,0)}),n}return null}function Ba(t,e,n){if(T.isString(t))try{return(e||JSON.parse)(t),T.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}const Tn={transitional:dr,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",i=n.indexOf("application/json")>-1,r=T.isObject(t);if(r&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return i&&i?JSON.stringify(_r(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ua(t,this.formSerializer).toString();if((o=T.isFileList(t))||n.indexOf("multipart/form-data")>-1){const s=this.env&&this.env.FormData;return Be(o?{"files[]":t}:t,s&&new s,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Ba(t)):t}],transformResponse:[function(t){const e=this.transitional||Tn.transitional,n=e&&e.forcedJSONParsing,i=this.responseType==="json";if(t&&T.isString(t)&&(n&&!this.responseType||i)){const r=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(r)throw o.name==="SyntaxError"?O.from(o,O.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:et.classes.FormData,Blob:et.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],t=>{Tn.headers[t]={}});const kn=Tn,Na=T.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"]),ja=t=>{const e={};let n,i,r;return t&&t.split(`
2
- `).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!n||e[n]&&Na[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},gr=Symbol("internals");function ne(t){return t&&String(t).trim().toLowerCase()}function Ne(t){return t===!1||t==null?t:T.isArray(t)?t.map(Ne):String(t)}function Ha(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}const qa=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function An(t,e,n,i,r){if(T.isFunction(i))return i.call(this,e,n);if(r&&(e=n),!!T.isString(e)){if(T.isString(i))return e.indexOf(i)!==-1;if(T.isRegExp(i))return i.test(e)}}function Za(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function Ga(t,e){const n=T.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(r,o,s){return this[i].call(this,e,r,o,s)},configurable:!0})})}class je{constructor(e){e&&this.set(e)}set(e,n,i){const r=this;function o(a,c,l){const f=ne(c);if(!f)throw new Error("header name must be a non-empty string");const u=T.findKey(r,f);(!u||r[u]===void 0||l===!0||l===void 0&&r[u]!==!1)&&(r[u||c]=Ne(a))}const s=(a,c)=>T.forEach(a,(l,f)=>o(l,f,c));return T.isPlainObject(e)||e instanceof this.constructor?s(e,n):T.isString(e)&&(e=e.trim())&&!qa(e)?s(ja(e),n):e!=null&&o(n,e,i),this}get(e,n){if(e=ne(e),e){const i=T.findKey(this,e);if(i){const r=this[i];if(!n)return r;if(n===!0)return Ha(r);if(T.isFunction(n))return n.call(this,r,i);if(T.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=ne(e),e){const i=T.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||An(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let r=!1;function o(s){if(s=ne(s),s){const a=T.findKey(i,s);a&&(!n||An(i,i[a],a,n))&&(delete i[a],r=!0)}}return T.isArray(e)?e.forEach(o):o(e),r}clear(e){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const o=n[i];(!e||An(this,this[o],o,e,!0))&&(delete this[o],r=!0)}return r}normalize(e){const n=this,i={};return T.forEach(this,(r,o)=>{const s=T.findKey(i,o);if(s){n[s]=Ne(r),delete n[o];return}const a=e?Za(o):String(o).trim();a!==o&&delete n[o],n[a]=Ne(r),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return T.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=e&&T.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(r=>i.set(r)),i}static accessor(e){const n=(this[gr]=this[gr]={accessors:{}}).accessors,i=this.prototype;function r(o){const s=ne(o);n[s]||(Ga(i,o),n[s]=!0)}return T.isArray(e)?e.forEach(r):r(e),this}}je.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),T.reduceDescriptors(je.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}}),T.freezeMethods(je);const at=je;function Cn(t,e){const n=this||kn,i=e||n,r=at.from(i.headers);let o=i.data;return T.forEach(t,function(s){o=s.call(n,o,r.normalize(),e?e.status:void 0)}),r.normalize(),o}function pr(t){return!!(t&&t.__CANCEL__)}function ie(t,e,n){O.call(this,t??"canceled",O.ERR_CANCELED,e,n),this.name="CanceledError"}T.inherits(ie,O,{__CANCEL__:!0});function Xa(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new O("Request failed with status code "+n.status,[O.ERR_BAD_REQUEST,O.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const $a=et.isStandardBrowserEnv?function(){return{write:function(t,e,n,i,r,o){const s=[];s.push(t+"="+encodeURIComponent(e)),T.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),T.isString(i)&&s.push("path="+i),T.isString(r)&&s.push("domain="+r),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Va(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ya(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function mr(t,e){return t&&!Va(e)?Ya(t,e):e}const Wa=et.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function i(r){let o=r;return t&&(e.setAttribute("href",o),o=e.href),e.setAttribute("href",o),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return n=i(window.location.href),function(r){const o=T.isString(r)?i(r):r;return o.protocol===n.protocol&&o.host===n.host}}():function(){return function(){return!0}}();function Ka(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Ja(t,e){t=t||10;const n=new Array(t),i=new Array(t);let r=0,o=0,s;return e=e!==void 0?e:1e3,function(a){const c=Date.now(),l=i[o];s||(s=c),n[r]=a,i[r]=c;let f=o,u=0;for(;f!==r;)u+=n[f++],f=f%t;if(r=(r+1)%t,r===o&&(o=(o+1)%t),c-s<e)return;const d=l&&c-l;return d?Math.round(u*1e3/d):void 0}}function wr(t,e){let n=0;const i=Ja(50,250);return r=>{const o=r.loaded,s=r.lengthComputable?r.total:void 0,a=o-n,c=i(a),l=o<=s;n=o;const f={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&l?(s-o)/c:void 0,event:r};f[e?"download":"upload"]=!0,t(f)}}const Qa=typeof XMLHttpRequest<"u",tl=Qa&&function(t){return new Promise(function(e,n){let i=t.data;const r=at.from(t.headers).normalize(),o=t.responseType;let s;function a(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}let c;T.isFormData(i)&&(et.isStandardBrowserEnv||et.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?T.isString(c=r.getContentType())&&r.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(t.auth){const h=t.auth.username||"",_=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";r.set("Authorization","Basic "+btoa(h+":"+_))}const f=mr(t.baseURL,t.url);l.open(t.method.toUpperCase(),fr(f,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function u(){if(!l)return;const h=at.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),_={data:!o||o==="text"||o==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:h,config:t,request:l};Xa(function(p){e(p),a()},function(p){n(p),a()},_),l=null}if("onloadend"in l?l.onloadend=u:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(u)},l.onabort=function(){l&&(n(new O("Request aborted",O.ECONNABORTED,t,l)),l=null)},l.onerror=function(){n(new O("Network Error",O.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let h=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const _=t.transitional||dr;t.timeoutErrorMessage&&(h=t.timeoutErrorMessage),n(new O(h,_.clarifyTimeoutError?O.ETIMEDOUT:O.ECONNABORTED,t,l)),l=null},et.isStandardBrowserEnv){const h=(t.withCredentials||Wa(f))&&t.xsrfCookieName&&$a.read(t.xsrfCookieName);h&&r.set(t.xsrfHeaderName,h)}i===void 0&&r.setContentType(null),"setRequestHeader"in l&&T.forEach(r.toJSON(),function(h,_){l.setRequestHeader(_,h)}),T.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),o&&o!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",wr(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",wr(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=h=>{l&&(n(!h||h.type?new ie(null,t,l):h),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const d=Ka(f);if(d&&et.protocols.indexOf(d)===-1){n(new O("Unsupported protocol "+d+":",O.ERR_BAD_REQUEST,t));return}l.send(i||null)})},In={http:ka,xhr:tl};T.forEach(In,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const yr=t=>`- ${t}`,el=t=>T.isFunction(t)||t===null||t===!1,vr={getAdapter:t=>{t=T.isArray(t)?t:[t];const{length:e}=t;let n,i;const r={};for(let o=0;o<e;o++){n=t[o];let s;if(i=n,!el(n)&&(i=In[(s=String(n)).toLowerCase()],i===void 0))throw new O(`Unknown adapter '${s}'`);if(i)break;r[s||"#"+o]=i}if(!i){const o=Object.entries(r).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since :
4
- `+o.map(yr).join(`
5
- `):" "+yr(o[0]):"as no adapter specified";throw new O("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i},adapters:In};function Dn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ie(null,t)}function br(t){return Dn(t),t.headers=at.from(t.headers),t.data=Cn.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),vr.getAdapter(t.adapter||kn.adapter)(t).then(function(e){return Dn(t),e.data=Cn.call(t,t.transformResponse,e),e.headers=at.from(e.headers),e},function(e){return pr(e)||(Dn(t),e&&e.response&&(e.response.data=Cn.call(t,t.transformResponse,e.response),e.response.headers=at.from(e.response.headers))),Promise.reject(e)})}const xr=t=>t instanceof at?t.toJSON():t;function jt(t,e){e=e||{};const n={};function i(l,f,u){return T.isPlainObject(l)&&T.isPlainObject(f)?T.merge.call({caseless:u},l,f):T.isPlainObject(f)?T.merge({},f):T.isArray(f)?f.slice():f}function r(l,f,u){if(T.isUndefined(f)){if(!T.isUndefined(l))return i(void 0,l,u)}else return i(l,f,u)}function o(l,f){if(!T.isUndefined(f))return i(void 0,f)}function s(l,f){if(T.isUndefined(f)){if(!T.isUndefined(l))return i(void 0,l)}else return i(void 0,f)}function a(l,f,u){if(u in e)return i(l,f);if(u in t)return i(void 0,l)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,f)=>r(xr(l),xr(f),!0)};return T.forEach(Object.keys(Object.assign({},t,e)),function(l){const f=c[l]||r,u=f(t[l],e[l],l);T.isUndefined(u)&&f!==a||(n[l]=u)}),n}const Er="1.5.1",Pn={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Pn[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Sr={};Pn.transitional=function(t,e,n){function i(r,o){return"[Axios v"+Er+"] Transitional option '"+r+"'"+o+(n?". "+n:"")}return(r,o,s)=>{if(t===!1)throw new O(i(o," has been removed"+(e?" in "+e:"")),O.ERR_DEPRECATED);return e&&!Sr[o]&&(Sr[o]=!0,console.warn(i(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,o,s):!0}};function nl(t,e,n){if(typeof t!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let r=i.length;for(;r-- >0;){const o=i[r],s=e[o];if(s){const a=t[o],c=a===void 0||s(a,o,t);if(c!==!0)throw new O("option "+o+" must be "+c,O.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new O("Unknown option "+o,O.ERR_BAD_OPTION)}}const Mn={assertOptions:nl,validators:Pn},pt=Mn.validators;class He{constructor(e){this.defaults=e,this.interceptors={request:new ur,response:new ur}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=jt(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:o}=n;i!==void 0&&Mn.assertOptions(i,{silentJSONParsing:pt.transitional(pt.boolean),forcedJSONParsing:pt.transitional(pt.boolean),clarifyTimeoutError:pt.transitional(pt.boolean)},!1),r!=null&&(T.isFunction(r)?n.paramsSerializer={serialize:r}:Mn.assertOptions(r,{encode:pt.function,serialize:pt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&T.merge(o.common,o[n.method]);o&&T.forEach(["delete","get","head","post","put","patch","common"],_=>{delete o[_]}),n.headers=at.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(n)===!1||(c=c&&_.synchronous,a.unshift(_.fulfilled,_.rejected))});const l=[];this.interceptors.response.forEach(function(_){l.push(_.fulfilled,_.rejected)});let f,u=0,d;if(!c){const _=[br.bind(this),void 0];for(_.unshift.apply(_,a),_.push.apply(_,l),d=_.length,f=Promise.resolve(n);u<d;)f=f.then(_[u++],_[u++]);return f}d=a.length;let h=n;for(u=0;u<d;){const _=a[u++],p=a[u++];try{h=_(h)}catch(g){p.call(this,g);break}}try{f=br.call(this,h)}catch(_){return Promise.reject(_)}for(u=0,d=l.length;u<d;)f=f.then(l[u++],l[u++]);return f}getUri(e){e=jt(this.defaults,e);const n=mr(e.baseURL,e.url);return fr(n,e.params,e.paramsSerializer)}}T.forEach(["delete","get","head","options"],function(t){He.prototype[t]=function(e,n){return this.request(jt(n||{},{method:t,url:e,data:(n||{}).data}))}}),T.forEach(["post","put","patch"],function(t){function e(n){return function(i,r,o){return this.request(jt(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}He.prototype[t]=e(),He.prototype[t+"Form"]=e(!0)});const qe=He;class Rn{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const i=this;this.promise.then(r=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](r);i._listeners=null}),this.promise.then=r=>{let o;const s=new Promise(a=>{i.subscribe(a),o=a}).then(r);return s.cancel=function(){i.unsubscribe(o)},s},e(function(r,o,s){i.reason||(i.reason=new ie(r,o,s),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Rn(function(n){e=n}),cancel:e}}}const il=Rn;function rl(t){return function(e){return t.apply(null,e)}}function ol(t){return T.isObject(t)&&t.isAxiosError===!0}const On={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(On).forEach(([t,e])=>{On[e]=t});const sl=On;function Tr(t){const e=new qe(t),n=Yi(qe.prototype.request,e);return T.extend(n,qe.prototype,e,{allOwnKeys:!0}),T.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Tr(jt(t,i))},n}const N=Tr(kn);N.Axios=qe,N.CanceledError=ie,N.CancelToken=il,N.isCancel=pr,N.VERSION=Er,N.toFormData=Be,N.AxiosError=O,N.Cancel=N.CanceledError,N.all=function(t){return Promise.all(t)},N.spread=rl,N.isAxiosError=ol,N.mergeConfig=jt,N.AxiosHeaders=at,N.formToJSON=t=>_r(T.isHTMLForm(t)?new FormData(t):t),N.getAdapter=vr.getAdapter,N.HttpStatusCode=sl,N.default=N;var Ln=function(t,e){return Ln=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},Ln(t,e)};function mt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ln(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function Un(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function re(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var i=n.call(t),r,o=[],s;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return o}function oe(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,o;i<r;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}function lt(t){return typeof t=="function"}function Fn(t){var e=function(i){Error.call(i),i.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var zn=Fn(function(t){return function(e){t(this),this.message=e?e.length+` errors occurred during unsubscription:
6
- `+e.map(function(n,i){return i+1+") "+n.toString()}).join(`
7
- `):"",this.name="UnsubscriptionError",this.errors=e}});function Ze(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var se=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,i,r,o;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=Un(s),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch(p){e={error:p}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}else s.remove(this);var f=this.initialTeardown;if(lt(f))try{f()}catch(p){o=p instanceof zn?p.errors:[p]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=Un(u),h=d.next();!h.done;h=d.next()){var _=h.value;try{Cr(_)}catch(p){o=o??[],p instanceof zn?o=oe(oe([],re(o)),re(p.errors)):o.push(p)}}}catch(p){i={error:p}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(i)throw i.error}}}if(o)throw new zn(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Cr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&Ze(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Ze(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),kr=se.EMPTY;function Ar(t){return t instanceof se||t&&"closed"in t&&lt(t.remove)&&lt(t.add)&&lt(t.unsubscribe)}function Cr(t){lt(t)?t():t.unsubscribe()}var Ir={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},al={setTimeout:function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setTimeout.apply(void 0,oe([t,e],re(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function ll(t){al.setTimeout(function(){throw t})}function Dr(){}function Ge(t){t()}var Bn=function(t){mt(e,t);function e(n){var i=t.call(this)||this;return i.isStopped=!1,n?(i.destination=n,Ar(n)&&n.add(i)):i.destination=ul,i}return e.create=function(n,i,r){return new jn(n,i,r)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(se),cl=Function.prototype.bind;function Nn(t,e){return cl.call(t,e)}var hl=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(i){Xe(i)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(i){Xe(i)}else Xe(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Xe(n)}},t}(),jn=function(t){mt(e,t);function e(n,i,r){var o=t.call(this)||this,s;if(lt(n)||!n)s={next:n??void 0,error:i??void 0,complete:r??void 0};else{var a;o&&Ir.useDeprecatedNextContext?(a=Object.create(n),a.unsubscribe=function(){return o.unsubscribe()},s={next:n.next&&Nn(n.next,a),error:n.error&&Nn(n.error,a),complete:n.complete&&Nn(n.complete,a)}):s=n}return o.destination=new hl(s),o}return e}(Bn);function Xe(t){ll(t)}function fl(t){throw t}var ul={closed:!0,next:Dr,error:fl,complete:Dr},dl=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function _l(t){return t}function gl(t){return t.length===0?_l:t.length===1?t[0]:function(e){return t.reduce(function(n,i){return i(n)},e)}}var Pr=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,i){var r=this,o=ml(e)?e:new jn(e,n,i);return Ge(function(){var s=r,a=s.operator,c=s.source;o.add(a?a.call(o,c):c?r._subscribe(o):r._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var i=this;return n=Mr(n),new n(function(r,o){var s=new jn({next:function(a){try{e(a)}catch(c){o(c),s.unsubscribe()}},error:o,complete:r});i.subscribe(s)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[dl]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return gl(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Mr(e),new e(function(i,r){var o;n.subscribe(function(s){return o=s},function(s){return r(s)},function(){return i(o)})})},t.create=function(e){return new t(e)},t}();function Mr(t){var e;return(e=t??Ir.Promise)!==null&&e!==void 0?e:Promise}function pl(t){return t&&lt(t.next)&&lt(t.error)&&lt(t.complete)}function ml(t){return t&&t instanceof Bn||pl(t)&&Ar(t)}(function(t){mt(e,t);function e(n,i,r,o,s,a){var c=t.call(this,n)||this;return c.onFinalize=s,c.shouldUnsubscribe=a,c._next=i?function(l){try{i(l)}catch(f){n.error(f)}}:t.prototype._next,c._error=o?function(l){try{o(l)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=r?function(){try{r()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;t.prototype.unsubscribe.call(this),!i&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e})(Bn);var wl=Fn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),yl=function(t){mt(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var i=new Rr(this,this);return i.operator=n,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new wl},e.prototype.next=function(n){var i=this;Ge(function(){var r,o;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var s=Un(i.currentObservers),a=s.next();!a.done;a=s.next()){var c=a.value;c.next(n)}}catch(l){r={error:l}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}}})},e.prototype.error=function(n){var i=this;Ge(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=n;for(var r=i.observers;r.length;)r.shift().error(n)}})},e.prototype.complete=function(){var n=this;Ge(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var i=n.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var i=this,r=this,o=r.hasError,s=r.isStopped,a=r.observers;return o||s?kr:(this.currentObservers=null,a.push(n),new se(function(){i.currentObservers=null,Ze(a,n)}))},e.prototype._checkFinalizedStatuses=function(n){var i=this,r=i.hasError,o=i.thrownError,s=i.isStopped;r?n.error(o):s&&n.complete()},e.prototype.asObservable=function(){var n=new Pr;return n.source=this,n},e.create=function(n,i){return new Rr(n,i)},e}(Pr),Rr=function(t){mt(e,t);function e(n,i){var r=t.call(this)||this;return r.destination=n,r.source=i,r}return e.prototype.next=function(n){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,n)},e.prototype.error=function(n){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,n)},e.prototype.complete=function(){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||i===void 0||i.call(n)},e.prototype._subscribe=function(n){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(n))!==null&&r!==void 0?r:kr},e}(yl),vl={now:function(){return Date.now()},delegate:void 0},bl=function(t){mt(e,t);function e(n,i){return t.call(this)||this}return e.prototype.schedule=function(n,i){return this},e}(se),Hn={setInterval:function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var r=Hn.delegate;return r?.setInterval?r.setInterval.apply(r,oe([t,e],re(n))):setInterval.apply(void 0,oe([t,e],re(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},xl=function(t){mt(e,t);function e(n,i){var r=t.call(this,n,i)||this;return r.scheduler=n,r.work=i,r.pending=!1,r}return e.prototype.schedule=function(n,i){var r;if(i===void 0&&(i=0),this.closed)return this;this.state=n;var o=this.id,s=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(s,o,i)),this.pending=!0,this.delay=i,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(s,this.id,i),this},e.prototype.requestAsyncId=function(n,i,r){return r===void 0&&(r=0),Hn.setInterval(n.flush.bind(n,this),r)},e.prototype.recycleAsyncId=function(n,i,r){if(r===void 0&&(r=0),r!=null&&this.delay===r&&this.pending===!1)return i;i!=null&&Hn.clearInterval(i)},e.prototype.execute=function(n,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(n,i);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,i){var r=!1,o;try{this.work(n)}catch(s){r=!0,o=s||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,i=n.id,r=n.scheduler,o=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ze(o,this),i!=null&&(this.id=this.recycleAsyncId(r,i,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(bl),Or=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,i){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(i,n)},t.now=vl.now,t}(),El=function(t){mt(e,t);function e(n,i){i===void 0&&(i=Or.now);var r=t.call(this,n,i)||this;return r.actions=[],r._active=!1,r}return e.prototype.flush=function(n){var i=this.actions;if(this._active){i.push(n);return}var r;this._active=!0;do if(r=n.execute(n.state,n.delay))break;while(n=i.shift());if(this._active=!1,r){for(;n=i.shift();)n.unsubscribe();throw r}},e}(Or);new El(xl);function Sl(t){switch(t.responseType){case"json":{if("response"in t)return t.response;var e=t;return JSON.parse(e.responseText)}case"document":return t.responseXML;case"text":default:{if("response"in t)return t.response;var e=t;return e.responseText}}}var Lr=Fn(function(t){return function(e,n,i){this.message=e,this.name="AjaxError",this.xhr=n,this.request=i,this.status=n.status,this.responseType=n.responseType;var r;try{r=Sl(n)}catch{r=n.responseText}this.response=r}});(function(){function t(e,n){return Lr.call(this,"ajax timeout",e,n),this.name="AjaxTimeoutError",this}return t.prototype=Object.create(Lr.prototype),t})();function Ur(t,e,n){return new Promise((i,r)=>{const o=new FileReader;if(o.onload=()=>i(o.result),o.onerror=s=>r(s),e){const s=t.slice(e,n);o.readAsArrayBuffer(s)}else o.readAsArrayBuffer(t)})}async function Tl(t){const e=await Ur(t,0,4);return wn(e)}const Fr=t=>{let e;return t instanceof File?e=t.name:e=t,e.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function kl(t,e){t.addEventListener("change",function(){e(t.files)},!1)}function Al(t,e){t.addEventListener("dragover",function(n){n.stopPropagation(),n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect="copy")},!1),t.addEventListener("drop",function(n){n.stopPropagation(),n.preventDefault(),n.dataTransfer&&e(n.dataTransfer.files)},!1)}const Cl=(t=["*"],e)=>{if(!globalThis.document||!(globalThis.document instanceof Document))throw new Fi;const n=globalThis.document.createElement("input");return n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),Array.isArray(t)&&t.length>0&&n.setAttribute("accept",t.join(",")),e&&n.setAttribute("multiple","true"),n.click(),new Promise((r,o)=>{globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!n.files||n.files?.length===0)&&o(new mn)},1e3)},{once:!0}),n.addEventListener("change",()=>{if(!n.files||n.files?.length===0)o(new mn);else{const s=Array.from(n.files);i(s)&&o(new zi(t)),r(s)}})});function i(r){return!t.includes("*")&&r.some(o=>!t.includes(`.${Fr(o)}`))}},Il=t=>{const e=new FileReader;return new Promise((n,i)=>{e.addEventListener("progress",r=>{const o="("+Math.floor(r.total/1e3)+" KB)",s=Math.floor(r.loaded/r.total*100)+"%";console.log(`Loading size: ${o} progress: ${s}`)}),e.addEventListener("load",r=>{n(r.target?.result)}),e.addEventListener("error",r=>{i(r)}),t(e)})};function Dl(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}function Pl(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function zr(t,e,n){if(!t){n&&e&&n.appendChild(e);return}if(!t.isEqualNode(e)){if(t.nodeName!==e.nodeName){n.replaceChild(e,t);return}if(t.nodeType===Node.TEXT_NODE){t.textContent!==e.textContent&&(t.textContent=e.textContent);return}for(let i=t.attributes.length-1;i>=0;i--){const r=t.attributes[i].name;!e.hasAttribute(r)&&r!=="open"&&t.removeAttribute(r)}for(let i=0;i<e.attributes.length;i++){const r=e.attributes[i].name,o=e.attributes[i].value;t.setAttribute(r,o)}for(let i=0;i<e.childNodes.length;i++)t.childNodes[i]?zr(t.childNodes[i],e.childNodes[i],t):t.appendChild(e.childNodes[i].cloneNode(!0));for(;t.childNodes.length>e.childNodes.length;)t.lastChild&&t.removeChild(t.lastChild)}}function Ml(t,e,n){var i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3);var r="expires="+i.toGMTString();document.cookie=t+"="+e+"; "+r}function Rl(t){for(var e=t+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){var r=n[i].trim();if(r.indexOf(e)==0)return r.substring(e.length,r.length)}return""}const Ol=()=>document.cookie.split(";").map(t=>t.split("=")).reduce((t,[e,n])=>(t[e.trim().replace('"',"")]=n)&&t,{}),Ll=()=>document.cookie.split(";").forEach(t=>document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));class ae{constructor(e){this.waitingResponse=[],this.messageQueue=[],this.url=e,this.createSocket()}createSocket(){this.socket=new ae(this.url),this.socket.onopen=()=>{this.messageQueue.forEach(e=>this.socket.send(e)),this.messageQueue=[]},this.socket.onclose=e=>{const{code:n,reason:i,wasClean:r}=e;console.log(`ws closed : ${n} ${i} ${r}`)},this.socket.onerror=e=>{console.log(`ws error : ${e}`)},this.socket.onmessage=e=>{this.processMessage(e)}}recreateSocket(e){console.log("Reconnection Attempted"),this.messageQueue.push(e),this.createSocket()}closeSocket(){this.socket.close(),console.log("Socket closed manually.")}openSocket(){this.createSocket(),console.log("Socket opened manually.")}async sendPayload(e){let n=+new Date;const i=this.waitingResponse[n]={sent:n},r={...i,...e};try{this.socket.readyState===ae.OPEN?this.socket.send(JSON.stringify(r)):this.recreateSocket(JSON.stringify(r));const o=await new Promise(function(s,a){i.resolve=s,console.log(i),setTimeout(()=>{a("Timeout")},5e3)});return console.info("Time took",(+new Date-i.sent)/1e3),o}finally{console.log("Exit code ran successfully"),delete this.waitingResponse[n]}}async processMessage(e){try{let n=JSON.parse(e.data);if(Object.prototype.hasOwnProperty.call(n,"requestid")){const i=this.waitingResponse[n.requestid];i?i.resolve(n):console.warn("Got data but found no associated request, already timed out?",n)}else console.warn("Got data without request id",n)}catch{console.log(e.data)}}async sendRequest(e,n,i=r=>{console.log(r)}){this.sendPayload(e).then(function(r){n(r)},function(r){i(r)})}sendMessage(e){const n=(()=>{try{return JSON.stringify(e)}catch{return e}})();this.socket.readyState===ae.OPEN?this.socket.send(n):this.recreateSocket(n)}}function Ht(){return document.compatMode=="BackCompat"?document.body:document.documentElement}function $e(){const t=Ht();return{width:t.clientWidth||window.innerWidth,height:t.clientHeight||window.innerHeight}}function Ul(){const t=Ht(),e=$e();return{width:Math.max(t.scrollWidth,e.width),height:Math.max(t.scrollHeight,e.height)}}function Fl(t){const e=$e(),n=t.getBoundingClientRect();return n.bottom>0&&n.top<e.height&&n.right>0&&n.left<e.width}function qn(){const t=Ht();return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Zn(){const t=Ht();return{clientLeft:t.clientLeft,clientTop:t.clientTop}}function Br(t){const e=t.getBoundingClientRect(),n=qn(),i=Zn();return{x:e.left+n.scrollLeft-i.clientLeft,y:e.top+n.scrollTop-i.clientTop}}function zl(t){return{x:Nr(t),y:jr(t)}}function Nr(t){let e=0;for(;t!==null;)e+=t.offsetLeft,t=t.offsetParent;return e}function jr(t){let e=0;for(;t!==null;)e+=t.offsetTop,t=t.offsetParent;return e}function Bl(t){const e=t.getBoundingClientRect();return{x:e.left,y:e.top}}function Nl(){const t=Ht(),e=t.scrollHeight-t.clientHeight;return e<=0?0:t.scrollTop/e*100}function Hr(t){if(t.pageX&&t.pageY)return{x:t.pageX,y:t.pageY};const e=qn(),n=Zn();return{x:t.clientX+e.scrollLeft-n.clientLeft,y:t.clientY+e.scrollTop-n.clientTop}}function Ve(t,e){const n=Hr(e),i=Br(t);return{x:n.x-i.x,y:n.y-i.y}}function jl(t){return{x:t.clientX,y:t.clientY}}const le=()=>{const t=navigator.userAgent.toLowerCase();let e="Unknown";return t.includes("mac")?e="macOS":t.includes("win")?e="Windows":/android/.test(t)?e="Android":/iphone|ipad|ipod/.test(t)?e="iOS":/linux/.test(t)?e="Linux":/bsd/.test(t)&&(e="BSD"),e.toLowerCase()},Hl=()=>{const t=navigator.userAgent;let e="Unknown";if(/Windows NT/.test(t)){const n=t.match(/Windows NT (\d+\.\d+)/);n&&(e=n[1])}else if(/Mac OS X/.test(t)){const n=t.match(/Mac OS X (\d+_\d+)/);n&&(e=n[1].replace("_","."))}else if(/Android/.test(t)){const n=t.match(/Android (\d+\.\d+)/);n&&(e=n[1])}else if(/iPhone|iPad|iPod/.test(t)){const n=t.match(/OS (\d+_\d+)/);n&&(e=n[1].replace("_","."))}return e.toLowerCase()},ql=()=>{const t=navigator.userAgent.toLowerCase();let e="Unknown";return/chrome/.test(t)?e="Chrome":/firefox/.test(t)?e="Firefox":/safari/.test(t)?e="Safari":/edge/.test(t)?e="Edge":/msie|trident/.test(t)&&(e="IE"),e.toLowerCase()},Zl=()=>{const t=navigator.userAgent;let e="Unknown";if(/Chrome/.test(t)){const n=t.match(/Chrome\/(\d+\.\d+)/);n&&(e=n[1])}else if(/Firefox/.test(t)){const n=t.match(/Firefox\/(\d+\.\d+)/);n&&(e=n[1])}else if(/Safari/.test(t)){const n=t.match(/Version\/(\d+\.\d+)/);n&&(e=n[1])}else if(/Edge/.test(t)){const n=t.match(/Edge\/(\d+\.\d+)/);n&&(e=n[1])}else if(/MSIE|Trident/.test(t)){const n=t.match(/(?:MSIE|rv:)(\d+\.\d+)/);n&&(e=n[1])}return e},Gl=()=>"geolocation"in navigator?new Promise((t,e)=>{navigator.geolocation.getCurrentPosition(n=>{const i=n.coords.latitude,r=n.coords.longitude;t({latitude:i,longitude:r})},n=>{e(n)})}):Promise.reject("Geolocation is not available.");function Xl(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function $l(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function qr(){return le()==="ios"}function Vl(){return le()==="ios"|le()==="macos"}function Zr(){return le()==="android"}function Yl(){return qr()||Zr()}function Wl(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function Gr(){const t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(t.indexOf("Trident/")>0){const r=t.indexOf("rv:");return parseInt(t.substring(r+3,t.indexOf(".",r)),10)}const i=t.indexOf("Edge/");return i>0?parseInt(t.substring(i+5,t.indexOf(".",i)),10):-1}const Kl=Gr()!==-1,Jl=typeof window=="object"&&typeof document=="object",Ql=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,tc=typeof document<"u",Xr=typeof window<"u",ec=typeof history<"u",nc=typeof process<"u",ic=Xr&&window.File&&window.FileReader&&window.FileList&&window.Blob;function rc(t){var e=document.documentElement,n=window.devicePixelRatio;e.dataset.dpr=n;var i=100,r=function(){var o=Math.min(e.clientWidth,t);e.dataset.width=o,e.dataset.rem=i=Math.round(100*(o/t)),e.style.fontSize=i+"px"};r(),window.rem2px=function(o){return o=parseFloat(o),o*i},window.px2rem=function(o){return o=parseFloat(o),o/i},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",r,!1)}function oc(t){return btoa(encodeURIComponent(t)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function sc(t){let e=t.replaceAll("*","+").replaceAll("-","/");const n=e.length%4;return n&&(e=e.padEnd(e.length+(4-n),"=")),decodeURIComponent(atob(e))}function $r(t){return new URL(t)}function ac(t){const e=$r(t);return e.protocol==="http:"||e.protocol==="https:"}const lc=t=>Array.from(new URLSearchParams(t)).reduce((e,[n,i])=>Object.assign({},e,{[n]:e[n]?(Array.isArray(e[n])?e[n]:[e[n]]).concat(i):i}),{});function cc(){const t={};let e=location.search;return e&&(e=e.substring(1,e.length),e.split("&").forEach(i=>{const r=i.split("=");t[r[0]]=decodeURIComponent(r[1])})),t}function hc(t){let e="";new MutationObserver(function(i){window.location.href!==e&&(e=window.location.href,console.log(`URL data changed to ${window.location.href}`),t&&t(location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0})}function fc(t){window.addEventListener("hashchange",()=>{t(location.hash)})}function uc(t){window.addEventListener("popstate",t,!1)}class kt{static getEvent(e){const n=e.keyCode||e.charCode;return{code:n,key:kt.codeToKey(n)}}static keyToCode(e){return Object.prototype.hasOwnProperty.call(kt.keyToCodes,e)?kt.keyToCodes[e]:-1}static codeToKey(e){return Object.prototype.hasOwnProperty.call(kt.codeToKeys,e.toString())?kt.codeToKeys[e.toString()]:""}static keyToCodes={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,command:15,shift:16,ctrl:17,alt:18,pause_break:19,caps_lock:20,numpad:21,escape:27,spacebar:32,page_up:33,page_down:34,end:35,home:36,left_arrow:37,up_arrow:38,right_arrow:39,down_arrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,left_window_key:91,right_window_key:92,select_key:93,numpad_0:96,numpad_1:97,numpad_2:98,numpad_3:99,numpad_4:100,numpad_5:101,numpad_6:102,numpad_7:103,numpad_8:104,numpad_9:105,multiply:106,add:107,subtract:109,decimal_point:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,f13:124,f14:125,f15:126,num_lock:144,scroll_lock:145,semi_colon:186,equal_sign:187,comma:188,dash:189,period:190,forward_slash:191,grave_accent:192,open_bracket:219,back_slash:220,close_braket:221,single_quote:222};static codeToKeys={8:"backspace",9:"tab",13:"enter",15:"command",16:"shift",17:"ctrl",18:"alt",19:"pause_break",20:"caps_lock",21:"numpad",27:"escape",32:"spacebar",33:"page_up",34:"page_down",35:"end",36:"home",37:"left_arrow",38:"up_arrow",39:"right_arrow",40:"down_arrow",45:"insert",46:"delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"left_window_key",92:"right_window_key",93:"select_key",96:"numpad_0",97:"numpad_1",98:"numpad_2",99:"numpad_3",100:"numpad_4",101:"numpad_5",102:"numpad_6",103:"numpad_7",104:"numpad_8",105:"numpad_9",106:"multiply",107:"add",109:"subtract",110:"decimal_point",111:"divide",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",124:"f13",125:"f14",126:"f15",144:"num_lock",145:"scroll_lock",186:"semi_colon",187:"equal_sign",188:"comma",189:"dash",190:"period",191:"forward_slash",192:"grave_accent",219:"open_bracket",220:"back_slash",221:"close_braket",222:"single_quote"}}const dc=t=>navigator.clipboard.writeText(t),_c=()=>window.getSelection()?.toString(),gc=t=>t===document.activeElement,pc=t=>Array.prototype.slice.call(t.parentNode?.children).filter(e=>e!==t),mc=()=>!document.hidden,wc=()=>history.back(),yc=()=>history.go(-1);function vc(t){const e=document.createElement("script");e.type="text/javascript",e.src=t,e.async=!1,document.body.appendChild(e),e.onload=()=>{},e.onerror=()=>{}}function bc(){const t=document.getElementsByTagName("img"),e=$e().height;let n=0;return()=>{for(let i=n;i<t.length;i++)t[i].getBoundingClientRect().top<e&&(t[i].src=t[i].getAttribute("data-src")??"",n=i+1)}}const xc=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let n=document.styleSheets.length??0;const i=()=>n>=e.length?(t(),!0):!1;i()||e.forEach(r=>{r.onload=()=>{n+=1,i()}})}),Ec=(t,e,n=400)=>{const i=document.createElement("span");i.style.visibility="hidden",i.style.padding="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e>12?e+"px":"12px",i.style.fontWeight=n.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth;return document.body.removeChild(i),r},Sc=(t,e,n=12,i=400,r=!0)=>{let o="",s="",a="";if(!t||e<n||typeof t!="string")return o;const c=t.split(""),l=document.createElement("span");l.style.visibility="hidden",l.style.padding="0",l.style.whiteSpace="nowrap",l.style.overflow="visible",l.style.fontSize=n>12?n+"px":"12px",l.style.fontWeight=i.toString(),document.body.appendChild(l);for(let f=0,u=c.length;f<u;f++){const d=c[f];if(s=a,a+=d,o=a,l.innerText=a,l.offsetWidth>e){r?o=s+"...":o=s;break}}return document.body.removeChild(l),o};function Tc(t,e="encode"){const n={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)){const r=new RegExp(e=="decode"?i:n[i],"g");t=t.replace(r,e=="decode"?n[i]:i)}return t}function kc(t){const e=/<%=(.+?)%>/g,n=/<%([\s\S]+?)%>/g;return t=t.replace(e,"`); \n echo( $1 ); \n echo(`").replace(n,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
1
+ var ZYZGroupCoreWeb=function(A){"use strict";typeof process<"u"&&process.versions!=null&&process.versions.node!=null;const ed=(i=12)=>"x".repeat(i).replace(/[x]/g,t=>(Math.random()*16|0).toString(16));function bo(i){let t="";for(let e=0,n=i.length;e<n;e++){const r=i.charCodeAt(e);r>=1&&r<=127?t+=i.charAt(e):r>2047?(t+=String.fromCharCode(224|r>>12&15),t+=String.fromCharCode(128|r>>6&63),t+=String.fromCharCode(128|r>>0&63)):(t+=String.fromCharCode(192|r>>6&31),t+=String.fromCharCode(128|r>>0&63))}return t}var ne=(i=>(i.UNKNOWN="",i.HTML="text/html",i.CSS="text/css",i.JPEG="image/jpeg",i.PNG="image/png",i.GIF="image/gif",i.WEBP="image/webp",i.SVG="image/svg+xml",i.MPEG="audio/mpeg",i.OGG="audio/ogg",i.MP4="video/mp4",i.JSON="application/json",i.JAVASCRIPT="application/javascript",i.ECMASCRIPT="application/ecmascript",i.EXCEL="application/vnb.ms-excel",i.XWWW="application/x-www-form-urlencoded",i.CSV="application/x-csv",i.PDF="application/pdf",i.ZIP="application/zip",i.TGZ="application/x-gtar",i.TAR_GZ="application/x-gzip",i.XML="text/xml",i.TEXT="text/plain",i))(ne||{});const ui=(i,t=16)=>(i=i.toLowerCase(),(i.indexOf("0b")==0||i.indexOf("0x")==0)&&(i=i.slice(2)),parseInt(i,t));function id(){const i=Uint32Array.of(305419896),t=new Uint8Array(i.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const wo=i=>{let t=ne.UNKNOWN;switch(new DataView(i).getUint32(0,id()).toString(16).toUpperCase()){case"FFD8FFDB":t=ne.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=ne.JPEG;break;case"89504E47":t=ne.PNG;break;case"47494638":t=ne.GIF;break;case"52494646":t=ne.WEBP;break;case"25504446":t=ne.PDF;break;case"504B0304":t=ne.ZIP;break}return t},So=function(){const i=[];return{writeByte(t){i.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,n=t.length){for(let r=0;r<n;r++)this.writeByte(t[r+e])},writeString(t){for(let e=0,n=t.length;e<n;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return i},toString(){let t="[";for(let e=0,n=i.length;e<n;e++)e>0&&(t+=","),t+=i[e];return t+="]",t}}},nd=function(){let i=0,t=0,e=0,n="";const r=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},s=function(a){n+=String.fromCharCode(r(a&63))};return{writeByte(a){for(i=i<<8|a&255,t+=8,e+=1;t>=6;)s(i>>>t-6),t-=6},flush(){if(t>0&&(s(i<<6-t),i=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)n+="="}},toString(){return n}}};function Co(i,t){return function(){return i.apply(t,arguments)}}const{toString:rd}=Object.prototype,{getPrototypeOf:xs}=Object,In=(i=>t=>{const e=rd.call(t);return i[e]||(i[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Wt=i=>(i=i.toLowerCase(),t=>In(t)===i),Fn=i=>t=>typeof t===i,{isArray:di}=Array,ji=Fn("undefined");function sd(i){return i!==null&&!ji(i)&&i.constructor!==null&&!ji(i.constructor)&&Ut(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const xo=Wt("ArrayBuffer");function ad(i){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(i):t=i&&i.buffer&&xo(i.buffer),t}const od=Fn("string"),Ut=Fn("function"),Eo=Fn("number"),Nn=i=>i!==null&&typeof i=="object",ld=i=>i===!0||i===!1,Un=i=>{if(In(i)!=="object")return!1;const t=xs(i);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},hd=Wt("Date"),cd=Wt("File"),ud=Wt("Blob"),dd=Wt("FileList"),fd=i=>Nn(i)&&Ut(i.pipe),gd=i=>{let t;return i&&(typeof FormData=="function"&&i instanceof FormData||Ut(i.append)&&((t=In(i))==="formdata"||t==="object"&&Ut(i.toString)&&i.toString()==="[object FormData]"))},pd=Wt("URLSearchParams"),md=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Vi(i,t,{allOwnKeys:e=!1}={}){if(i===null||typeof i>"u")return;let n,r;if(typeof i!="object"&&(i=[i]),di(i))for(n=0,r=i.length;n<r;n++)t.call(null,i[n],n,i);else{const s=e?Object.getOwnPropertyNames(i):Object.keys(i),a=s.length;let o;for(n=0;n<a;n++)o=s[n],t.call(null,i[o],o,i)}}function To(i,t){t=t.toLowerCase();const e=Object.keys(i);let n=e.length,r;for(;n-- >0;)if(r=e[n],t===r.toLowerCase())return r;return null}const ko=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ao=i=>!ji(i)&&i!==ko;function Es(){const{caseless:i}=Ao(this)&&this||{},t={},e=(n,r)=>{const s=i&&To(t,r)||r;Un(t[s])&&Un(n)?t[s]=Es(t[s],n):Un(n)?t[s]=Es({},n):di(n)?t[s]=n.slice():t[s]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&Vi(arguments[n],e);return t}const _d=(i,t,e,{allOwnKeys:n}={})=>(Vi(t,(r,s)=>{e&&Ut(r)?i[s]=Co(r,e):i[s]=r},{allOwnKeys:n}),i),vd=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),yd=(i,t,e,n)=>{i.prototype=Object.create(t.prototype,n),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:t.prototype}),e&&Object.assign(i.prototype,e)},bd=(i,t,e,n)=>{let r,s,a;const o={};if(t=t||{},i==null)return t;do{for(r=Object.getOwnPropertyNames(i),s=r.length;s-- >0;)a=r[s],(!n||n(a,i,t))&&!o[a]&&(t[a]=i[a],o[a]=!0);i=e!==!1&&xs(i)}while(i&&(!e||e(i,t))&&i!==Object.prototype);return t},wd=(i,t,e)=>{i=String(i),(e===void 0||e>i.length)&&(e=i.length),e-=t.length;const n=i.indexOf(t,e);return n!==-1&&n===e},Sd=i=>{if(!i)return null;if(di(i))return i;let t=i.length;if(!Eo(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=i[t];return e},Cd=(i=>t=>i&&t instanceof i)(typeof Uint8Array<"u"&&xs(Uint8Array)),xd=(i,t)=>{const e=(i&&i[Symbol.iterator]).call(i);let n;for(;(n=e.next())&&!n.done;){const r=n.value;t.call(i,r[0],r[1])}},Ed=(i,t)=>{let e;const n=[];for(;(e=i.exec(t))!==null;)n.push(e);return n},Td=Wt("HTMLFormElement"),kd=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,n){return e.toUpperCase()+n}),Po=(({hasOwnProperty:i})=>(t,e)=>i.call(t,e))(Object.prototype),Ad=Wt("RegExp"),Mo=(i,t)=>{const e=Object.getOwnPropertyDescriptors(i),n={};Vi(e,(r,s)=>{let a;(a=t(r,s,i))!==!1&&(n[s]=a||r)}),Object.defineProperties(i,n)},Pd=i=>{Mo(i,(t,e)=>{if(Ut(i)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=i[e];if(Ut(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+"'")})}})},Md=(i,t)=>{const e={},n=r=>{r.forEach(s=>{e[s]=!0})};return di(i)?n(i):n(String(i).split(t)),e},Rd=()=>{},Dd=(i,t)=>(i=+i,Number.isFinite(i)?i:t),Ts="abcdefghijklmnopqrstuvwxyz",Ro="0123456789",Do={DIGIT:Ro,ALPHA:Ts,ALPHA_DIGIT:Ts+Ts.toUpperCase()+Ro},Ld=(i=16,t=Do.ALPHA_DIGIT)=>{let e="";const{length:n}=t;for(;i--;)e+=t[Math.random()*n|0];return e};function Od(i){return!!(i&&Ut(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const Id=i=>{const t=new Array(10),e=(n,r)=>{if(Nn(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;const s=di(n)?[]:{};return Vi(n,(a,o)=>{const h=e(a,r+1);!ji(h)&&(s[o]=h)}),t[r]=void 0,s}}return n};return e(i,0)},Fd=Wt("AsyncFunction"),Nd=i=>i&&(Nn(i)||Ut(i))&&Ut(i.then)&&Ut(i.catch),R={isArray:di,isArrayBuffer:xo,isBuffer:sd,isFormData:gd,isArrayBufferView:ad,isString:od,isNumber:Eo,isBoolean:ld,isObject:Nn,isPlainObject:Un,isUndefined:ji,isDate:hd,isFile:cd,isBlob:ud,isRegExp:Ad,isFunction:Ut,isStream:fd,isURLSearchParams:pd,isTypedArray:Cd,isFileList:dd,forEach:Vi,merge:Es,extend:_d,trim:md,stripBOM:vd,inherits:yd,toFlatObject:bd,kindOf:In,kindOfTest:Wt,endsWith:wd,toArray:Sd,forEachEntry:xd,matchAll:Ed,isHTMLForm:Td,hasOwnProperty:Po,hasOwnProp:Po,reduceDescriptors:Mo,freezeMethods:Pd,toObjectSet:Md,toCamelCase:kd,noop:Rd,toFiniteNumber:Dd,findKey:To,global:ko,isContextDefined:Ao,ALPHABET:Do,generateString:Ld,isSpecCompliantForm:Od,toJSONObject:Id,isAsyncFn:Fd,isThenable:Nd};function Z(i,t,e,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),r&&(this.response=r)}R.inherits(Z,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:R.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Lo=Z.prototype,Oo={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(i=>{Oo[i]={value:i}}),Object.defineProperties(Z,Oo),Object.defineProperty(Lo,"isAxiosError",{value:!0}),Z.from=(i,t,e,n,r,s)=>{const a=Object.create(Lo);return R.toFlatObject(i,a,function(o){return o!==Error.prototype},o=>o!=="isAxiosError"),Z.call(a,i.message,t,e,n,r),a.cause=i,a.name=i.name,s&&Object.assign(a,s),a};const Ud=null;function ks(i){return R.isPlainObject(i)||R.isArray(i)}function Io(i){return R.endsWith(i,"[]")?i.slice(0,-2):i}function Fo(i,t,e){return i?i.concat(t).map(function(n,r){return n=Io(n),!e&&r?"["+n+"]":n}).join(e?".":""):t}function Gd(i){return R.isArray(i)&&!i.some(ks)}const Bd=R.toFlatObject(R,{},null,function(i){return/^is[A-Z]/.test(i)});function Gn(i,t,e){if(!R.isObject(i))throw new TypeError("target must be an object");t=t||new FormData,e=R.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(u,g){return!R.isUndefined(g[u])});const n=e.metaTokens,r=e.visitor||l,s=e.dots,a=e.indexes,o=(e.Blob||typeof Blob<"u"&&Blob)&&R.isSpecCompliantForm(t);if(!R.isFunction(r))throw new TypeError("visitor must be a function");function h(u){if(u===null)return"";if(R.isDate(u))return u.toISOString();if(!o&&R.isBlob(u))throw new Z("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(u)||R.isTypedArray(u)?o&&typeof Blob=="function"?new Blob([u]):Buffer.from(u):u}function l(u,g,p){let _=u;if(u&&!p&&typeof u=="object"){if(R.endsWith(g,"{}"))g=n?g:g.slice(0,-2),u=JSON.stringify(u);else if(R.isArray(u)&&Gd(u)||(R.isFileList(u)||R.endsWith(g,"[]"))&&(_=R.toArray(u)))return g=Io(g),_.forEach(function(y,b){!(R.isUndefined(y)||y===null)&&t.append(a===!0?Fo([g],b,s):a===null?g:g+"[]",h(y))}),!1}return ks(u)?!0:(t.append(Fo(p,g,s),h(u)),!1)}const c=[],d=Object.assign(Bd,{defaultVisitor:l,convertValue:h,isVisitable:ks});function f(u,g){if(!R.isUndefined(u)){if(c.indexOf(u)!==-1)throw Error("Circular reference detected in "+g.join("."));c.push(u),R.forEach(u,function(p,_){(!(R.isUndefined(p)||p===null)&&r.call(t,p,R.isString(_)?_.trim():_,g,d))===!0&&f(p,g?g.concat(_):[_])}),c.pop()}}if(!R.isObject(i))throw new TypeError("data must be an object");return f(i),t}function No(i){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function As(i,t){this._pairs=[],i&&Gn(i,this,t)}const Uo=As.prototype;Uo.append=function(i,t){this._pairs.push([i,t])},Uo.toString=function(i){const t=i?function(e){return i.call(this,e,No)}:No;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};function zd(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Go(i,t,e){if(!t)return i;const n=e&&e.encode||zd,r=e&&e.serialize;let s;if(r?s=r(t,e):s=R.isURLSearchParams(t)?t.toString():new As(t,e).toString(n),s){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+s}return i}class Hd{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){R.forEach(this.handlers,function(e){e!==null&&t(e)})}}const Bo=Hd,zo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},jd=typeof URLSearchParams<"u"?URLSearchParams:As,Vd=typeof FormData<"u"?FormData:null,$d=typeof Blob<"u"?Blob:null,Xd=(()=>{let i;return typeof navigator<"u"&&((i=navigator.product)==="ReactNative"||i==="NativeScript"||i==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Yd=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),qt={isBrowser:!0,classes:{URLSearchParams:jd,FormData:Vd,Blob:$d},isStandardBrowserEnv:Xd,isStandardBrowserWebWorkerEnv:Yd,protocols:["http","https","file","blob","url","data"]};function Wd(i,t){return Gn(i,new qt.classes.URLSearchParams,Object.assign({visitor:function(e,n,r,s){return qt.isNode&&R.isBuffer(e)?(this.append(n,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function qd(i){return R.matchAll(/\w+|\[(\w*)]/g,i).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Kd(i){const t={},e=Object.keys(i);let n;const r=e.length;let s;for(n=0;n<r;n++)s=e[n],t[s]=i[s];return t}function Ho(i){function t(e,n,r,s){let a=e[s++];const o=Number.isFinite(+a),h=s>=e.length;return a=!a&&R.isArray(r)?r.length:a,h?(R.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!R.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],s)&&R.isArray(r[a])&&(r[a]=Kd(r[a])),!o)}if(R.isFormData(i)&&R.isFunction(i.entries)){const e={};return R.forEachEntry(i,(n,r)=>{t(qd(n),r,e,0)}),e}return null}function Zd(i,t,e){if(R.isString(i))try{return(t||JSON.parse)(i),R.trim(i)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(i)}const Ps={transitional:zo,adapter:["xhr","http"],transformRequest:[function(i,t){const e=t.getContentType()||"",n=e.indexOf("application/json")>-1,r=R.isObject(i);if(r&&R.isHTMLForm(i)&&(i=new FormData(i)),R.isFormData(i))return n&&n?JSON.stringify(Ho(i)):i;if(R.isArrayBuffer(i)||R.isBuffer(i)||R.isStream(i)||R.isFile(i)||R.isBlob(i))return i;if(R.isArrayBufferView(i))return i.buffer;if(R.isURLSearchParams(i))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),i.toString();let s;if(r){if(e.indexOf("application/x-www-form-urlencoded")>-1)return Wd(i,this.formSerializer).toString();if((s=R.isFileList(i))||e.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return Gn(s?{"files[]":i}:i,a&&new a,this.formSerializer)}}return r||n?(t.setContentType("application/json",!1),Zd(i)):i}],transformResponse:[function(i){const t=this.transitional||Ps.transitional,e=t&&t.forcedJSONParsing,n=this.responseType==="json";if(i&&R.isString(i)&&(e&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(i)}catch(s){if(r)throw s.name==="SyntaxError"?Z.from(s,Z.ERR_BAD_RESPONSE,this,null,this.response):s}}return i}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qt.classes.FormData,Blob:qt.classes.Blob},validateStatus:function(i){return i>=200&&i<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};R.forEach(["delete","get","head","post","put","patch"],i=>{Ps.headers[i]={}});const Ms=Ps,Jd=R.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"]),Qd=i=>{const t={};let e,n,r;return i&&i.split(`
2
+ `).forEach(function(s){r=s.indexOf(":"),e=s.substring(0,r).trim().toLowerCase(),n=s.substring(r+1).trim(),!(!e||t[e]&&Jd[e])&&(e==="set-cookie"?t[e]?t[e].push(n):t[e]=[n]:t[e]=t[e]?t[e]+", "+n:n)}),t},jo=Symbol("internals");function $i(i){return i&&String(i).trim().toLowerCase()}function Bn(i){return i===!1||i==null?i:R.isArray(i)?i.map(Bn):String(i)}function tf(i){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=e.exec(i);)t[n[1]]=n[2];return t}const ef=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function Rs(i,t,e,n,r){if(R.isFunction(n))return n.call(this,t,e);if(r&&(t=e),!!R.isString(t)){if(R.isString(n))return t.indexOf(n)!==-1;if(R.isRegExp(n))return n.test(t)}}function nf(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}function rf(i,t){const e=R.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(i,n+e,{value:function(r,s,a){return this[n].call(this,t,r,s,a)},configurable:!0})})}class zn{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function s(o,h,l){const c=$i(h);if(!c)throw new Error("header name must be a non-empty string");const d=R.findKey(r,c);(!d||r[d]===void 0||l===!0||l===void 0&&r[d]!==!1)&&(r[d||h]=Bn(o))}const a=(o,h)=>R.forEach(o,(l,c)=>s(l,c,h));return R.isPlainObject(t)||t instanceof this.constructor?a(t,e):R.isString(t)&&(t=t.trim())&&!ef(t)?a(Qd(t),e):t!=null&&s(e,t,n),this}get(t,e){if(t=$i(t),t){const n=R.findKey(this,t);if(n){const r=this[n];if(!e)return r;if(e===!0)return tf(r);if(R.isFunction(e))return e.call(this,r,n);if(R.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=$i(t),t){const n=R.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||Rs(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let r=!1;function s(a){if(a=$i(a),a){const o=R.findKey(n,a);o&&(!e||Rs(n,n[o],o,e))&&(delete n[o],r=!0)}}return R.isArray(t)?t.forEach(s):s(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const s=e[n];(!t||Rs(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){const e=this,n={};return R.forEach(this,(r,s)=>{const a=R.findKey(n,s);if(a){e[a]=Bn(r),delete e[s];return}const o=t?nf(s):String(s).trim();o!==s&&delete e[s],e[o]=Bn(r),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return R.forEach(this,(n,r)=>{n!=null&&n!==!1&&(e[r]=t&&R.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(`
3
+ `)}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(r=>n.set(r)),n}static accessor(t){const e=(this[jo]=this[jo]={accessors:{}}).accessors,n=this.prototype;function r(s){const a=$i(s);e[a]||(rf(n,s),e[a]=!0)}return R.isArray(t)?t.forEach(r):r(t),this}}zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),R.reduceDescriptors(zn.prototype,({value:i},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>i,set(n){this[e]=n}}}),R.freezeMethods(zn);const re=zn;function Ds(i,t){const e=this||Ms,n=t||e,r=re.from(n.headers);let s=n.data;return R.forEach(i,function(a){s=a.call(e,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function Vo(i){return!!(i&&i.__CANCEL__)}function Xi(i,t,e){Z.call(this,i??"canceled",Z.ERR_CANCELED,t,e),this.name="CanceledError"}R.inherits(Xi,Z,{__CANCEL__:!0});function sf(i,t,e){const n=e.config.validateStatus;!e.status||!n||n(e.status)?i(e):t(new Z("Request failed with status code "+e.status,[Z.ERR_BAD_REQUEST,Z.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const af=qt.isStandardBrowserEnv?function(){return{write:function(i,t,e,n,r,s){const a=[];a.push(i+"="+encodeURIComponent(t)),R.isNumber(e)&&a.push("expires="+new Date(e).toGMTString()),R.isString(n)&&a.push("path="+n),R.isString(r)&&a.push("domain="+r),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(i){const t=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(i){this.write(i,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function of(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function lf(i,t){return t?i.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):i}function $o(i,t){return i&&!of(t)?lf(i,t):t}const hf=qt.isStandardBrowserEnv?function(){const i=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let e;function n(r){let s=r;return i&&(t.setAttribute("href",s),s=t.href),t.setAttribute("href",s),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return e=n(window.location.href),function(r){const s=R.isString(r)?n(r):r;return s.protocol===e.protocol&&s.host===e.host}}():function(){return function(){return!0}}();function cf(i){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return t&&t[1]||""}function uf(i,t){i=i||10;const e=new Array(i),n=new Array(i);let r=0,s=0,a;return t=t!==void 0?t:1e3,function(o){const h=Date.now(),l=n[s];a||(a=h),e[r]=o,n[r]=h;let c=s,d=0;for(;c!==r;)d+=e[c++],c=c%i;if(r=(r+1)%i,r===s&&(s=(s+1)%i),h-a<t)return;const f=l&&h-l;return f?Math.round(d*1e3/f):void 0}}function Xo(i,t){let e=0;const n=uf(50,250);return r=>{const s=r.loaded,a=r.lengthComputable?r.total:void 0,o=s-e,h=n(o),l=s<=a;e=s;const c={loaded:s,total:a,progress:a?s/a:void 0,bytes:o,rate:h||void 0,estimated:h&&a&&l?(a-s)/h:void 0,event:r};c[t?"download":"upload"]=!0,i(c)}}const df=typeof XMLHttpRequest<"u",ff=df&&function(i){return new Promise(function(t,e){let n=i.data;const r=re.from(i.headers).normalize(),s=i.responseType;let a;function o(){i.cancelToken&&i.cancelToken.unsubscribe(a),i.signal&&i.signal.removeEventListener("abort",a)}let h;R.isFormData(n)&&(qt.isStandardBrowserEnv||qt.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?R.isString(h=r.getContentType())&&r.setContentType(h.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(i.auth){const u=i.auth.username||"",g=i.auth.password?unescape(encodeURIComponent(i.auth.password)):"";r.set("Authorization","Basic "+btoa(u+":"+g))}const c=$o(i.baseURL,i.url);l.open(i.method.toUpperCase(),Go(c,i.params,i.paramsSerializer),!0),l.timeout=i.timeout;function d(){if(!l)return;const u=re.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),g={data:!s||s==="text"||s==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:u,config:i,request:l};sf(function(p){t(p),o()},function(p){e(p),o()},g),l=null}if("onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(d)},l.onabort=function(){l&&(e(new Z("Request aborted",Z.ECONNABORTED,i,l)),l=null)},l.onerror=function(){e(new Z("Network Error",Z.ERR_NETWORK,i,l)),l=null},l.ontimeout=function(){let u=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const g=i.transitional||zo;i.timeoutErrorMessage&&(u=i.timeoutErrorMessage),e(new Z(u,g.clarifyTimeoutError?Z.ETIMEDOUT:Z.ECONNABORTED,i,l)),l=null},qt.isStandardBrowserEnv){const u=(i.withCredentials||hf(c))&&i.xsrfCookieName&&af.read(i.xsrfCookieName);u&&r.set(i.xsrfHeaderName,u)}n===void 0&&r.setContentType(null),"setRequestHeader"in l&&R.forEach(r.toJSON(),function(u,g){l.setRequestHeader(g,u)}),R.isUndefined(i.withCredentials)||(l.withCredentials=!!i.withCredentials),s&&s!=="json"&&(l.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&l.addEventListener("progress",Xo(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",Xo(i.onUploadProgress)),(i.cancelToken||i.signal)&&(a=u=>{l&&(e(!u||u.type?new Xi(null,i,l):u),l.abort(),l=null)},i.cancelToken&&i.cancelToken.subscribe(a),i.signal&&(i.signal.aborted?a():i.signal.addEventListener("abort",a)));const f=cf(c);if(f&&qt.protocols.indexOf(f)===-1){e(new Z("Unsupported protocol "+f+":",Z.ERR_BAD_REQUEST,i));return}l.send(n||null)})},Ls={http:Ud,xhr:ff};R.forEach(Ls,(i,t)=>{if(i){try{Object.defineProperty(i,"name",{value:t})}catch{}Object.defineProperty(i,"adapterName",{value:t})}});const Yo=i=>`- ${i}`,gf=i=>R.isFunction(i)||i===null||i===!1,Wo={getAdapter:i=>{i=R.isArray(i)?i:[i];const{length:t}=i;let e,n;const r={};for(let s=0;s<t;s++){e=i[s];let a;if(n=e,!gf(e)&&(n=Ls[(a=String(e)).toLowerCase()],n===void 0))throw new Z(`Unknown adapter '${a}'`);if(n)break;r[a||"#"+s]=n}if(!n){const s=Object.entries(r).map(([o,h])=>`adapter ${o} `+(h===!1?"is not supported by the environment":"is not available in the build"));let a=t?s.length>1?`since :
4
+ `+s.map(Yo).join(`
5
+ `):" "+Yo(s[0]):"as no adapter specified";throw new Z("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:Ls};function Os(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new Xi(null,i)}function qo(i){return Os(i),i.headers=re.from(i.headers),i.data=Ds.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),Wo.getAdapter(i.adapter||Ms.adapter)(i).then(function(t){return Os(i),t.data=Ds.call(i,i.transformResponse,t),t.headers=re.from(t.headers),t},function(t){return Vo(t)||(Os(i),t&&t.response&&(t.response.data=Ds.call(i,i.transformResponse,t.response),t.response.headers=re.from(t.response.headers))),Promise.reject(t)})}const Ko=i=>i instanceof re?i.toJSON():i;function fi(i,t){t=t||{};const e={};function n(l,c,d){return R.isPlainObject(l)&&R.isPlainObject(c)?R.merge.call({caseless:d},l,c):R.isPlainObject(c)?R.merge({},c):R.isArray(c)?c.slice():c}function r(l,c,d){if(R.isUndefined(c)){if(!R.isUndefined(l))return n(void 0,l,d)}else return n(l,c,d)}function s(l,c){if(!R.isUndefined(c))return n(void 0,c)}function a(l,c){if(R.isUndefined(c)){if(!R.isUndefined(l))return n(void 0,l)}else return n(void 0,c)}function o(l,c,d){if(d in t)return n(l,c);if(d in i)return n(void 0,l)}const h={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(l,c)=>r(Ko(l),Ko(c),!0)};return R.forEach(Object.keys(Object.assign({},i,t)),function(l){const c=h[l]||r,d=c(i[l],t[l],l);R.isUndefined(d)&&c!==o||(e[l]=d)}),e}const Zo="1.5.1",Is={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{Is[i]=function(e){return typeof e===i||"a"+(t<1?"n ":" ")+i}});const Jo={};Is.transitional=function(i,t,e){function n(r,s){return"[Axios v"+Zo+"] Transitional option '"+r+"'"+s+(e?". "+e:"")}return(r,s,a)=>{if(i===!1)throw new Z(n(s," has been removed"+(t?" in "+t:"")),Z.ERR_DEPRECATED);return t&&!Jo[s]&&(Jo[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),i?i(r,s,a):!0}};function pf(i,t,e){if(typeof i!="object")throw new Z("options must be an object",Z.ERR_BAD_OPTION_VALUE);const n=Object.keys(i);let r=n.length;for(;r-- >0;){const s=n[r],a=t[s];if(a){const o=i[s],h=o===void 0||a(o,s,i);if(h!==!0)throw new Z("option "+s+" must be "+h,Z.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new Z("Unknown option "+s,Z.ERR_BAD_OPTION)}}const Fs={assertOptions:pf,validators:Is},Ce=Fs.validators;class Hn{constructor(t){this.defaults=t,this.interceptors={request:new Bo,response:new Bo}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=fi(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:s}=e;n!==void 0&&Fs.assertOptions(n,{silentJSONParsing:Ce.transitional(Ce.boolean),forcedJSONParsing:Ce.transitional(Ce.boolean),clarifyTimeoutError:Ce.transitional(Ce.boolean)},!1),r!=null&&(R.isFunction(r)?e.paramsSerializer={serialize:r}:Fs.assertOptions(r,{encode:Ce.function,serialize:Ce.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=s&&R.merge(s.common,s[e.method]);s&&R.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),e.headers=re.concat(a,s);const o=[];let h=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(e)===!1||(h=h&&g.synchronous,o.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let c,d=0,f;if(!h){const g=[qo.bind(this),void 0];for(g.unshift.apply(g,o),g.push.apply(g,l),f=g.length,c=Promise.resolve(e);d<f;)c=c.then(g[d++],g[d++]);return c}f=o.length;let u=e;for(d=0;d<f;){const g=o[d++],p=o[d++];try{u=g(u)}catch(_){p.call(this,_);break}}try{c=qo.call(this,u)}catch(g){return Promise.reject(g)}for(d=0,f=l.length;d<f;)c=c.then(l[d++],l[d++]);return c}getUri(t){t=fi(this.defaults,t);const e=$o(t.baseURL,t.url);return Go(e,t.params,t.paramsSerializer)}}R.forEach(["delete","get","head","options"],function(i){Hn.prototype[i]=function(t,e){return this.request(fi(e||{},{method:i,url:t,data:(e||{}).data}))}}),R.forEach(["post","put","patch"],function(i){function t(e){return function(n,r,s){return this.request(fi(s||{},{method:i,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Hn.prototype[i]=t(),Hn.prototype[i+"Form"]=t(!0)});const jn=Hn;class Ns{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(r=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](r);n._listeners=null}),this.promise.then=r=>{let s;const a=new Promise(o=>{n.subscribe(o),s=o}).then(r);return a.cancel=function(){n.unsubscribe(s)},a},t(function(r,s,a){n.reason||(n.reason=new Xi(r,s,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)}static source(){let t;return{token:new Ns(function(e){t=e}),cancel:t}}}const mf=Ns;function _f(i){return function(t){return i.apply(null,t)}}function vf(i){return R.isObject(i)&&i.isAxiosError===!0}const Us={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(Us).forEach(([i,t])=>{Us[t]=i});const yf=Us;function Qo(i){const t=new jn(i),e=Co(jn.prototype.request,t);return R.extend(e,jn.prototype,t,{allOwnKeys:!0}),R.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return Qo(fi(i,n))},e}const wt=Qo(Ms);wt.Axios=jn,wt.CanceledError=Xi,wt.CancelToken=mf,wt.isCancel=Vo,wt.VERSION=Zo,wt.toFormData=Gn,wt.AxiosError=Z,wt.Cancel=wt.CanceledError,wt.all=function(i){return Promise.all(i)},wt.spread=_f,wt.isAxiosError=vf,wt.mergeConfig=fi,wt.AxiosHeaders=re,wt.formToJSON=i=>Ho(R.isHTMLForm(i)?new FormData(i):i),wt.getAdapter=Wo.getAdapter,wt.HttpStatusCode=yf,wt.default=wt;var Gs=function(i,t){return Gs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])},Gs(i,t)};function xe(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Gs(i,t);function e(){this.constructor=i}i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Bs(i){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&i[t],n=0;if(e)return e.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&n>=i.length&&(i=void 0),{value:i&&i[n++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yi(i,t){var e=typeof Symbol=="function"&&i[Symbol.iterator];if(!e)return i;var n=e.call(i),r,s=[],a;try{for(;(t===void 0||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(o){a={error:o}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(a)throw a.error}}return s}function Wi(i,t,e){if(e||arguments.length===2)for(var n=0,r=t.length,s;n<r;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return i.concat(s||Array.prototype.slice.call(t))}function se(i){return typeof i=="function"}function zs(i){var t=function(n){Error.call(n),n.stack=new Error().stack},e=i(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Hs=zs(function(i){return function(t){i(this),this.message=t?t.length+` errors occurred during unsubscription:
6
+ `+t.map(function(e,n){return n+1+") "+e.toString()}).join(`
7
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function Vn(i,t){if(i){var e=i.indexOf(t);0<=e&&i.splice(e,1)}}var qi=function(){function i(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var t,e,n,r,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Bs(a),h=o.next();!h.done;h=o.next()){var l=h.value;l.remove(this)}}catch(p){t={error:p}}finally{try{h&&!h.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}else a.remove(this);var c=this.initialTeardown;if(se(c))try{c()}catch(p){s=p instanceof Hs?p.errors:[p]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=Bs(d),u=f.next();!u.done;u=f.next()){var g=u.value;try{il(g)}catch(p){s=s??[],p instanceof Hs?s=Wi(Wi([],Yi(s)),Yi(p.errors)):s.push(p)}}}catch(p){n={error:p}}finally{try{u&&!u.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}if(s)throw new Hs(s)}},i.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)il(t);else{if(t instanceof i){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},i.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},i.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},i.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Vn(e,t)},i.prototype.remove=function(t){var e=this._finalizers;e&&Vn(e,t),t instanceof i&&t._removeParent(this)},i.EMPTY=function(){var t=new i;return t.closed=!0,t}(),i}(),tl=qi.EMPTY;function el(i){return i instanceof qi||i&&"closed"in i&&se(i.remove)&&se(i.add)&&se(i.unsubscribe)}function il(i){se(i)?i():i.unsubscribe()}var nl={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},bf={setTimeout:function(i,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,Wi([i,t],Yi(e)))},clearTimeout:function(i){return clearTimeout(i)},delegate:void 0};function wf(i){bf.setTimeout(function(){throw i})}function rl(){}function $n(i){i()}var js=function(i){xe(t,i);function t(e){var n=i.call(this)||this;return n.isStopped=!1,e?(n.destination=e,el(e)&&e.add(n)):n.destination=Ef,n}return t.create=function(e,n,r){return new $s(e,n,r)},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,i.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(qi),Sf=Function.prototype.bind;function Vs(i,t){return Sf.call(i,t)}var Cf=function(){function i(t){this.partialObserver=t}return i.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){Xn(n)}},i.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){Xn(n)}else Xn(t)},i.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Xn(e)}},i}(),$s=function(i){xe(t,i);function t(e,n,r){var s=i.call(this)||this,a;if(se(e)||!e)a={next:e??void 0,error:n??void 0,complete:r??void 0};else{var o;s&&nl.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=function(){return s.unsubscribe()},a={next:e.next&&Vs(e.next,o),error:e.error&&Vs(e.error,o),complete:e.complete&&Vs(e.complete,o)}):a=e}return s.destination=new Cf(a),s}return t}(js);function Xn(i){wf(i)}function xf(i){throw i}var Ef={closed:!0,next:rl,error:xf,complete:rl},Tf=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function kf(i){return i}function Af(i){return i.length===0?kf:i.length===1?i[0]:function(t){return i.reduce(function(e,n){return n(e)},t)}}var sl=function(){function i(t){t&&(this._subscribe=t)}return i.prototype.lift=function(t){var e=new i;return e.source=this,e.operator=t,e},i.prototype.subscribe=function(t,e,n){var r=this,s=Mf(t)?t:new $s(t,e,n);return $n(function(){var a=r,o=a.operator,h=a.source;s.add(o?o.call(s,h):h?r._subscribe(s):r._trySubscribe(s))}),s},i.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},i.prototype.forEach=function(t,e){var n=this;return e=al(e),new e(function(r,s){var a=new $s({next:function(o){try{t(o)}catch(h){s(h),a.unsubscribe()}},error:s,complete:r});n.subscribe(a)})},i.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},i.prototype[Tf]=function(){return this},i.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Af(t)(this)},i.prototype.toPromise=function(t){var e=this;return t=al(t),new t(function(n,r){var s;e.subscribe(function(a){return s=a},function(a){return r(a)},function(){return n(s)})})},i.create=function(t){return new i(t)},i}();function al(i){var t;return(t=i??nl.Promise)!==null&&t!==void 0?t:Promise}function Pf(i){return i&&se(i.next)&&se(i.error)&&se(i.complete)}function Mf(i){return i&&i instanceof js||Pf(i)&&el(i)}(function(i){xe(t,i);function t(e,n,r,s,a,o){var h=i.call(this,e)||this;return h.onFinalize=a,h.shouldUnsubscribe=o,h._next=n?function(l){try{n(l)}catch(c){e.error(c)}}:i.prototype._next,h._error=s?function(l){try{s(l)}catch(c){e.error(c)}finally{this.unsubscribe()}}:i.prototype._error,h._complete=r?function(){try{r()}catch(l){e.error(l)}finally{this.unsubscribe()}}:i.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;i.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(js);var Rf=zs(function(i){return function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Df=function(i){xe(t,i);function t(){var e=i.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 ol(this,this);return n.operator=e,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Rf},t.prototype.next=function(e){var n=this;$n(function(){var r,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=Bs(n.currentObservers),o=a.next();!o.done;o=a.next()){var h=o.value;h.next(e)}}catch(l){r={error:l}}finally{try{o&&!o.done&&(s=a.return)&&s.call(a)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var n=this;$n(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var r=n.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;$n(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(),i.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,r=this,s=r.hasError,a=r.isStopped,o=r.observers;return s||a?tl:(this.currentObservers=null,o.push(e),new qi(function(){n.currentObservers=null,Vn(o,e)}))},t.prototype._checkFinalizedStatuses=function(e){var n=this,r=n.hasError,s=n.thrownError,a=n.isStopped;r?e.error(s):a&&e.complete()},t.prototype.asObservable=function(){var e=new sl;return e.source=this,e},t.create=function(e,n){return new ol(e,n)},t}(sl),ol=function(i){xe(t,i);function t(e,n){var r=i.call(this)||this;return r.destination=e,r.source=n,r}return t.prototype.next=function(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.next)===null||r===void 0||r.call(n,e)},t.prototype.error=function(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.error)===null||r===void 0||r.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,r;return(r=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&r!==void 0?r:tl},t}(Df),Lf={now:function(){return Date.now()},delegate:void 0},Of=function(i){xe(t,i);function t(e,n){return i.call(this)||this}return t.prototype.schedule=function(e,n){return this},t}(qi),Xs={setInterval:function(i,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var r=Xs.delegate;return r?.setInterval?r.setInterval.apply(r,Wi([i,t],Yi(e))):setInterval.apply(void 0,Wi([i,t],Yi(e)))},clearInterval:function(i){return clearInterval(i)},delegate:void 0},If=function(i){xe(t,i);function t(e,n){var r=i.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,n){var r;if(n===void 0&&(n=0),this.closed)return this;this.state=e;var s=this.id,a=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(a,s,n)),this.pending=!0,this.delay=n,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(a,this.id,n),this},t.prototype.requestAsyncId=function(e,n,r){return r===void 0&&(r=0),Xs.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,n,r){if(r===void 0&&(r=0),r!=null&&this.delay===r&&this.pending===!1)return n;n!=null&&Xs.clearInterval(n)},t.prototype.execute=function(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,n);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,n){var r=!1,s;try{this.work(e)}catch(a){r=!0,s=a||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),s},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,n=e.id,r=e.scheduler,s=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Vn(s,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,i.prototype.unsubscribe.call(this)}},t}(Of),ll=function(){function i(t,e){e===void 0&&(e=i.now),this.schedulerActionCtor=t,this.now=e}return i.prototype.schedule=function(t,e,n){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},i.now=Lf.now,i}(),Ff=function(i){xe(t,i);function t(e,n){n===void 0&&(n=ll.now);var r=i.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var n=this.actions;if(this._active){n.push(e);return}var r;this._active=!0;do if(r=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,r){for(;e=n.shift();)e.unsubscribe();throw r}},t}(ll);new Ff(If);function Nf(i){switch(i.responseType){case"json":{if("response"in i)return i.response;var t=i;return JSON.parse(t.responseText)}case"document":return i.responseXML;case"text":default:{if("response"in i)return i.response;var t=i;return t.responseText}}}var hl=zs(function(i){return function(t,e,n){this.message=t,this.name="AjaxError",this.xhr=e,this.request=n,this.status=e.status,this.responseType=e.responseType;var r;try{r=Nf(e)}catch{r=e.responseText}this.response=r}});(function(){function i(t,e){return hl.call(this,"ajax timeout",t,e),this.name="AjaxTimeoutError",this}return i.prototype=Object.create(hl.prototype),i})();var Ys={exports:{}},gi=typeof Reflect=="object"?Reflect:null,cl=gi&&typeof gi.apply=="function"?gi.apply:function(i,t,e){return Function.prototype.apply.call(i,t,e)},Yn;gi&&typeof gi.ownKeys=="function"?Yn=gi.ownKeys:Object.getOwnPropertySymbols?Yn=function(i){return Object.getOwnPropertyNames(i).concat(Object.getOwnPropertySymbols(i))}:Yn=function(i){return Object.getOwnPropertyNames(i)};function Uf(i){console&&console.warn&&console.warn(i)}var ul=Number.isNaN||function(i){return i!==i};function nt(){nt.init.call(this)}Ys.exports=nt,Ys.exports.once=Hf,nt.EventEmitter=nt,nt.prototype._events=void 0,nt.prototype._eventsCount=0,nt.prototype._maxListeners=void 0;var dl=10;function Wn(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(nt,"defaultMaxListeners",{enumerable:!0,get:function(){return dl},set:function(i){if(typeof i!="number"||i<0||ul(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");dl=i}}),nt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},nt.prototype.setMaxListeners=function(i){if(typeof i!="number"||i<0||ul(i))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+i+".");return this._maxListeners=i,this};function fl(i){return i._maxListeners===void 0?nt.defaultMaxListeners:i._maxListeners}nt.prototype.getMaxListeners=function(){return fl(this)},nt.prototype.emit=function(i){for(var t=[],e=1;e<arguments.length;e++)t.push(arguments[e]);var n=i==="error",r=this._events;if(r!==void 0)n=n&&r.error===void 0;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var o=r[i];if(o===void 0)return!1;if(typeof o=="function")cl(o,this,t);else for(var h=o.length,l=vl(o,h),e=0;e<h;++e)cl(l[e],this,t);return!0};function gl(i,t,e,n){var r,s,a;if(Wn(e),s=i._events,s===void 0?(s=i._events=Object.create(null),i._eventsCount=0):(s.newListener!==void 0&&(i.emit("newListener",t,e.listener?e.listener:e),s=i._events),a=s[t]),a===void 0)a=s[t]=e,++i._eventsCount;else if(typeof a=="function"?a=s[t]=n?[e,a]:[a,e]:n?a.unshift(e):a.push(e),r=fl(i),r>0&&a.length>r&&!a.warned){a.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=i,o.type=t,o.count=a.length,Uf(o)}return i}nt.prototype.addListener=function(i,t){return gl(this,i,t,!1)},nt.prototype.on=nt.prototype.addListener,nt.prototype.prependListener=function(i,t){return gl(this,i,t,!0)};function Gf(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function pl(i,t,e){var n={fired:!1,wrapFn:void 0,target:i,type:t,listener:e},r=Gf.bind(n);return r.listener=e,n.wrapFn=r,r}nt.prototype.once=function(i,t){return Wn(t),this.on(i,pl(this,i,t)),this},nt.prototype.prependOnceListener=function(i,t){return Wn(t),this.prependListener(i,pl(this,i,t)),this},nt.prototype.removeListener=function(i,t){var e,n,r,s,a;if(Wn(t),n=this._events,n===void 0)return this;if(e=n[i],e===void 0)return this;if(e===t||e.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[i],n.removeListener&&this.emit("removeListener",i,e.listener||t));else if(typeof e!="function"){for(r=-1,s=e.length-1;s>=0;s--)if(e[s]===t||e[s].listener===t){a=e[s].listener,r=s;break}if(r<0)return this;r===0?e.shift():Bf(e,r),e.length===1&&(n[i]=e[0]),n.removeListener!==void 0&&this.emit("removeListener",i,a||t)}return this},nt.prototype.off=nt.prototype.removeListener,nt.prototype.removeAllListeners=function(i){var t,e,n;if(e=this._events,e===void 0)return this;if(e.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):e[i]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete e[i]),this;if(arguments.length===0){var r=Object.keys(e),s;for(n=0;n<r.length;++n)s=r[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=e[i],typeof t=="function")this.removeListener(i,t);else if(t!==void 0)for(n=t.length-1;n>=0;n--)this.removeListener(i,t[n]);return this};function ml(i,t,e){var n=i._events;if(n===void 0)return[];var r=n[t];return r===void 0?[]:typeof r=="function"?e?[r.listener||r]:[r]:e?zf(r):vl(r,r.length)}nt.prototype.listeners=function(i){return ml(this,i,!0)},nt.prototype.rawListeners=function(i){return ml(this,i,!1)},nt.listenerCount=function(i,t){return typeof i.listenerCount=="function"?i.listenerCount(t):_l.call(i,t)},nt.prototype.listenerCount=_l;function _l(i){var t=this._events;if(t!==void 0){var e=t[i];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}nt.prototype.eventNames=function(){return this._eventsCount>0?Yn(this._events):[]};function vl(i,t){for(var e=new Array(t),n=0;n<t;++n)e[n]=i[n];return e}function Bf(i,t){for(;t+1<i.length;t++)i[t]=i[t+1];i.pop()}function zf(i){for(var t=new Array(i.length),e=0;e<t.length;++e)t[e]=i[e].listener||i[e];return t}function Hf(i,t){return new Promise(function(e,n){function r(a){i.removeListener(t,s),n(a)}function s(){typeof i.removeListener=="function"&&i.removeListener("error",r),e([].slice.call(arguments))}yl(i,t,s,{once:!0}),t!=="error"&&jf(i,r,{once:!0})})}function jf(i,t,e){typeof i.on=="function"&&yl(i,"error",t,e)}function yl(i,t,e,n){if(typeof i.on=="function")n.once?i.once(t,e):i.on(t,e);else if(typeof i.addEventListener=="function")i.addEventListener(t,function r(s){n.once&&i.removeEventListener(t,r),e(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i)}var Vf=Ys.exports;class Gv extends Vf.EventEmitter{constructor(){super()}on(t,e){return super.on(t,e)}addListener(t,e){return this.on(t,e)}prependListener(t,e){return super.prependListener(t,e)}once(t,e){return super.once(t,e)}prependOnceListener(t,e){return super.prependOnceListener(t,e)}removeListener(t,e){return super.removeListener(t,e)}off(t,e){return super.off(t,e)}removeAllListeners(t){return super.removeAllListeners(t)}emit(t,...e){return super.emit(t,...e)}listeners(t){return super.listeners(t)}rawListeners(t){return super.rawListeners(t)}listenerCount(t){return super.listenerCount(t)}}class $f{events;constructor(){this.events={}}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)}addListener(t,e){this.on(t,e)}prependListener(t,e){this.events[t]||(this.events[t]=[]),this.events[t].unshift(e)}removeListener(t,e){this.events[t]&&(this.events[t]=this.events[t].filter(n=>n!==e))}off(t,e){this.removeListener(t,e)}removeAllListeners(t){t?this.events[t]=[]:this.events={}}emit(t,...e){this.events[t]&&this.events[t].forEach(n=>{Reflect.apply(n,this,e)})}once(t,e){const n=(()=>{let r=!1;return(...s)=>{r||(r=!0,Reflect.apply(e,this,s),this.off(t,n))}})();this.on(t,n)}}const bl=(i,t="image/svg+xml",e="utf-8")=>new Blob([i],{type:`${t};charset=${e}`}),Xf=(i,t="image/svg+xml",e="utf-8")=>{const n=new XMLSerializer().serializeToString(i);return bl(n,t,e)},Yf=(i,t)=>{const e=document.createElement("a");e.style.visibility="hidden",document.body.appendChild(e),e.download=t,typeof i=="string"?e.href=i:e.href=window.URL.createObjectURL(i),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)};function wl(i=["*"],t){if(!globalThis.document||!(globalThis.document instanceof Document))throw new Error("This is not a browser environment");const e=globalThis.document.createElement("input");return e.setAttribute("type","file"),e.setAttribute("visibility","hidden"),Array.isArray(i)&&i.length>0&&e.setAttribute("accept",i.join(",")),t&&e.setAttribute("multiple","true"),e.click(),new Promise((n,r)=>{globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!e.files||e.files?.length===0)&&r(new Error("Cancel select"))},1e3)},{once:!0}),e.addEventListener("change",()=>{if(!e.files||e.files?.length===0)r(new Error("Cancel select"));else{const s=Array.from(e.files);!i.includes("*")&&s.some(a=>!i.includes(`.${Cl(a)}`))&&r(new Error(`Please select files in ${i} format`)),n(s)}})})}const Ws=(i,t="text",e)=>new Promise((n,r)=>{const s=new FileReader;switch(s.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),s.addEventListener("load",a=>{n(a.target?.result)}),s.addEventListener("error",a=>{r(a)}),t){case"dataURL":s.readAsDataURL(i);break;case"binaryString":s.readAsBinaryString(i);break;case"arrayBuffer":s.readAsArrayBuffer(i);break;default:s.readAsText(i)}});function Sl(i,t,e){return Ws(i.slice(t,e),"arrayBuffer")}async function Wf(i){const t=await Sl(i,0,4);return wo(t)}const Cl=i=>{let t;return i instanceof File?t=i.name:t=i,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function qf(i,t){i.addEventListener("change",function(){t(i.files)},!1)}function Kf(i,t){i.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},!1),i.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&t(e.dataTransfer.files)},!1)}function Zf(i){function t(){document.readyState!=="loading"&&(i(),document.removeEventListener("DOMContentLoaded",t))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}function Jf(i){typeof queueMicrotask=="function"?queueMicrotask(i):Promise.resolve().then(i).catch(t=>setTimeout(()=>{throw t}))}function Qf(i,t={},e=[]){return{tag:i,props:t,children:e}}function Ki(i,t){if(i.el)return;const e=i.el=document.createElement(i.tag);if(i.props)for(const n in i.props){const r=i.props[n];n.startsWith("on")?e.addEventListener(n.slice(2).toLowerCase(),r):e.setAttribute(n,r)}i.children&&(typeof i.children=="string"?e.textContent=i.children:i.children.forEach(n=>{Ki(n,e)})),t.appendChild(e)}function xl(i,t){if(i.tag!==t.tag){if(!i.el)return;const e=i.el.parentElement||document.body;e.removeChild(i.el),Ki(t,e)}else{const e=t.el=i.el;if(!e)return;const n=i.props,r=t.props;for(const o in n)o in r||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),n[o]):e.removeAttribute(o));for(const o in r){const h=n[o],l=r[o];l!=h&&(o.startsWith("on")?e.addEventListener(o.slice(2).toLowerCase(),l):e.setAttribute(o,l))}const s=i.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof s=="string")e.innerHTML="",a.forEach(o=>{Ki(o,e)});else{const o=Math.min(s.length,a.length);for(let h=0;h<o;h++)xl(s[h],a[h]);a.length>s.length&&a.slice(s.length).forEach(h=>{Ki(h,e)}),a.length<s.length&&s.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}}function El(i,t,e){if(!i){e&&t&&e.appendChild(t);return}if(!i.isEqualNode(t)){if(i.nodeName!==t.nodeName){e.replaceChild(t,i);return}if(i.nodeType===Node.TEXT_NODE){i.textContent!==t.textContent&&(i.textContent=t.textContent);return}for(let n=i.attributes.length-1;n>=0;n--){const r=i.attributes[n].name;!t.hasAttribute(r)&&r!=="open"&&i.removeAttribute(r)}for(let n=0;n<t.attributes.length;n++){const r=t.attributes[n].name,s=t.attributes[n].value;i.setAttribute(r,s)}for(let n=0;n<t.childNodes.length;n++)i.childNodes[n]?El(i.childNodes[n],t.childNodes[n],i):i.appendChild(t.childNodes[n].cloneNode(!0));for(;i.childNodes.length>t.childNodes.length;)i.lastChild&&i.removeChild(i.lastChild)}}function t0(i,t,e){var n=new Date;n.setTime(n.getTime()+e*24*60*60*1e3);var r="expires="+n.toGMTString();document.cookie=i+"="+t+"; "+r}function e0(i){for(var t=i+"=",e=document.cookie.split(";"),n=0;n<e.length;n++){var r=e[n].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const i0=()=>document.cookie.split(";").map(i=>i.split("=")).reduce((i,[t,e])=>(i[t.trim().replace('"',"")]=e)&&i,{}),n0=()=>document.cookie.split(";").forEach(i=>document.cookie=i.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));class Zi{constructor(t){this.waitingResponse=[],this.messageQueue=[],this.url=t,this.createSocket()}createSocket(){this.socket=new Zi(this.url),this.socket.onopen=()=>{this.messageQueue.forEach(t=>this.socket.send(t)),this.messageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:n,wasClean:r}=t;console.log(`ws closed : ${e} ${n} ${r}`)},this.socket.onerror=t=>{console.log(`ws error : ${t}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Reconnection Attempted"),this.messageQueue.push(t),this.createSocket()}closeSocket(){this.socket.close(),console.log("Socket closed manually.")}openSocket(){this.createSocket(),console.log("Socket opened manually.")}async sendPayload(t){let e=+new Date;const n=this.waitingResponse[e]={sent:e},r={...n,...t};try{this.socket.readyState===Zi.OPEN?this.socket.send(JSON.stringify(r)):this.recreateSocket(JSON.stringify(r));const s=await new Promise(function(a,o){n.resolve=a,console.log(n),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-n.sent)/1e3),s}finally{console.log("Exit code ran successfully"),delete this.waitingResponse[e]}}async processMessage(t){try{let e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const n=this.waitingResponse[e.requestid];n?n.resolve(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(t.data)}}async sendRequest(t,e,n=r=>{console.log(r)}){this.sendPayload(t).then(function(r){e(r)},function(r){n(r)})}sendMessage(t){const e=(()=>{try{return JSON.stringify(t)}catch{return t}})();this.socket.readyState===Zi.OPEN?this.socket.send(e):this.recreateSocket(e)}}function qs(){return document.compatMode=="BackCompat"?document.body:document.documentElement}function pi(){const i=qs();return{scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight}}function qn(){const i=qs();return{clientTop:i.clientTop,clientLeft:i.clientLeft,clientWidth:i.clientWidth,clientHeight:i.clientHeight}}function Ji(){const{clientWidth:i,clientHeight:t}=qn();return{width:window.innerWidth||i,height:window.innerHeight||t}}function r0(){const{scrollWidth:i,scrollHeight:t}=pi(),{width:e,height:n}=Ji();return{width:Math.max(i,e),height:Math.max(t,n)}}function s0(i){const{width:t,height:e}=Ji(),{top:n,left:r,right:s,bottom:a}=i.getBoundingClientRect();return(n>=0&&n<=e||a>=0&&a<=e)&&(r>=0&&r<=t||s>=0&&s<=t)}function a0(i,t,e){const n={threshold:1},r=function(a,o){const{width:h,height:l}=Ji();a.forEach(c=>{const{top:d,left:f,right:u,bottom:g}=c.boundingClientRect;(d>=0&&d<=l||g>=0&&g<=l)&&(f>=0&&f<=h||u>=0&&u<=h)?t(c.target):e?.(c.target)})};new IntersectionObserver(r,n).observe(i)}function Tl(i){const{top:t,left:e}=i.getBoundingClientRect(),n=pi();return{x:e+n.scrollLeft,y:t+n.scrollTop}}function o0(i){return{x:kl(i),y:Al(i)}}function kl(i){let t=0;for(;i!==null;)t+=i.offsetLeft,i=i.offsetParent;return t}function Al(i){let t=0;for(;i!==null;)t+=i.offsetTop,i=i.offsetParent;return t}function l0(i){const t=i.getBoundingClientRect();return{x:t.left,y:t.top}}function Pl(i){if(i.pageX&&i.pageY)return{x:i.pageX,y:i.pageY};const t=pi();return{x:i.clientX+t.scrollLeft,y:i.clientY+t.scrollTop}}function h0(i){return{x:i.clientX,y:i.clientY}}function Kn(i,t){const e=Pl(t),n=Tl(i);return{x:e.x-n.x,y:e.y-n.y}}const Ve=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return i.includes("mac")?t="macOS":i.includes("win")?t="Windows":/android/.test(i)?t="Android":/iphone|ipad|ipod/.test(i)?t="iOS":/linux/.test(i)?t="Linux":/bsd/.test(i)&&(t="BSD"),t.toLowerCase()},c0=()=>{const i=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(i)){const e=i.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(i)){const e=i.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(i)){const e=i.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(i)){const e=i.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},u0=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/chrome/.test(i)?t="Chrome":/firefox/.test(i)?t="Firefox":/safari/.test(i)?t="Safari":/edge/.test(i)?t="Edge":/msie|trident/.test(i)?t="IE":/MicroMessenger/.test(i)&&(t="Wechat"),t.toLowerCase()},d0=()=>{const i=navigator.userAgent;let t="Unknown";if(/Chrome/.test(i)){const e=i.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(i)){const e=i.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(i)){const e=i.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(i)){const e=i.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(i)){const e=i.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},f0=()=>"geolocation"in navigator?new Promise((i,t)=>{navigator.geolocation.getCurrentPosition(e=>{const n=e.coords.latitude,r=e.coords.longitude;i({latitude:n,longitude:r})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function g0(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function p0(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Ml(){return Ve()==="ios"}function m0(){return Ve()==="ios"|Ve()==="macos"}function Rl(){return Ve()==="macos"}function Dl(){return Ve()==="android"}function _0(){return Ml()||Dl()}function v0(){return Ve()==="wechat"}function y0(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function Ll(){const i=window.navigator.userAgent,t=i.indexOf("MSIE ");if(t>0)return parseInt(i.substring(t+5,i.indexOf(".",t)),10);if(i.indexOf("Trident/")>0){const r=i.indexOf("rv:");return parseInt(i.substring(r+3,i.indexOf(".",r)),10)}const n=i.indexOf("Edge/");return n>0?parseInt(i.substring(n+5,i.indexOf(".",n)),10):-1}const b0=Ll()!==-1,w0=typeof document<"u",Ol=typeof window<"u",S0=typeof history<"u",C0=Ol&&window.File&&window.FileReader&&window.FileList&&window.Blob;function x0(i){var t=document.documentElement,e=window.devicePixelRatio;t.dataset.dpr=e;var n=100,r=function(){var s=Math.min(t.clientWidth,i);t.dataset.width=s,t.dataset.rem=n=Math.round(100*(s/i)),t.style.fontSize=n+"px"};r(),window.rem2px=function(s){return s=parseFloat(s),s*n},window.px2rem=function(s){return s=parseFloat(s),s/n},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",r,!1)}function E0(i){return btoa(encodeURIComponent(i)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function T0(i){let t=i.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(atob(t))}function Il(i){return new URL(i)}function k0(i){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",n="(?<pathname>(?:\\/[^/#?]+)*\\/?)",r="(?<search>(?:\\?[^#]*)?)",s="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${n}${r}${s}$`).exec(i);return o&&o.groups?(o.groups.port=o.groups?.port||"",o.groups):{protocol:"",host:"",hostname:"",port:"",pathname:"",search:"",hash:""}}function A0(i){i=i.replace(/^[#?&]/,"");const t={};if(!i)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let n=e.exec(i);for(;n;)t[n[1]]=n[2],n=e.exec(i);return t}function P0(i){const t=Il(i);return t.protocol==="http:"||t.protocol==="https:"}function M0(i){return new URLSearchParams(i).toString()}function R0(i){let t="";for(const e in i)t&&(t+="&"),t+=`${e}=${i[e]}`;return t}const D0=i=>Array.from(new URLSearchParams(i)).reduce((t,[e,n])=>Object.assign({},t,{[e]:t[e]?(Array.isArray(t[e])?t[e]:[t[e]]).concat(n):n}),{});function L0(){const i={};let t=location.search;return t&&(t=t.substring(1,t.length),t.split("&").forEach(n=>{const r=n.split("=");i[r[0]]=decodeURIComponent(r[1])})),i}function O0(i){let t="";new MutationObserver(function(n){window.location.href!==t&&(t=window.location.href,console.log(`URL data changed to ${window.location.href}`),i&&i(location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0})}function I0(i){window.addEventListener("hashchange",()=>{i(location.hash)})}function F0(i){window.addEventListener("popstate",i,!1)}const N0=new Proxy({},{get(i,t){return function(e={},...n){const r=document.createElement(t);for(const s of Object.keys(e))r.setAttribute(s,e[s]);for(const s of n)typeof s=="string"?r.appendChild(document.createTextNode(s)):r.appendChild(s);return r}}}),U0=i=>navigator.clipboard.writeText(i),G0=()=>window.getSelection()?.toString(),B0=i=>i===document.activeElement,z0=i=>Array.prototype.slice.call(i.parentNode?.children).filter(t=>t!==i),H0=()=>!document.hidden,j0=(i={x:0,y:0})=>window.scrollTo(i.x,i.y),V0=()=>history.back(),$0=()=>history.go(-1);function X0(i){const t=document.createElement("script");t.type="text/javascript",t.src=i,t.async=!1,document.body.appendChild(t),t.onload=()=>{},t.onerror=()=>{}}function Y0(){const i=document.getElementsByTagName("img"),t=Ji().height;let e=0;return()=>{for(let n=e;n<i.length;n++)i[n].getBoundingClientRect().top<t&&(i[n].src=i[n].getAttribute("data-src")??"",e=n+1)}}const W0=()=>new Promise(i=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length??0;const n=()=>e>=t.length?(i(),!0):!1;n()||t.forEach(r=>{r.onload=()=>{e+=1,n()}})}),q0=(i,t,e=400)=>{const n=document.createElement("span");n.style.visibility="hidden",n.style.padding="0",n.style.whiteSpace="nowrap",n.style.overflow="visible",n.style.fontSize=t>12?t+"px":"12px",n.style.fontWeight=e.toString(),n.innerText=i,document.body.appendChild(n);const r=n.offsetWidth;return document.body.removeChild(n),r},K0=(i,t,e=12,n=400,r=!0)=>{let s="",a="",o="";if(!i||t<e||typeof i!="string")return s;const h=i.split(""),l=document.createElement("span");l.style.visibility="hidden",l.style.padding="0",l.style.whiteSpace="nowrap",l.style.overflow="visible",l.style.fontSize=e>12?e+"px":"12px",l.style.fontWeight=n.toString(),document.body.appendChild(l);for(let c=0,d=h.length;c<d;c++){const f=h[c];if(a=o,o+=f,s=o,l.innerText=o,l.offsetWidth>t){r?s=a+"...":s=a;break}}return document.body.removeChild(l),s};function Z0(i,t="encode"){const e={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const r=new RegExp(t=="decode"?n:e[n],"g");i=i.replace(r,t=="decode"?e[n]:n)}return i}const J0=i=>i.replace(/[\u00A0-\u9999<>&](?!#)/gim,t=>"&#"+t.charCodeAt(0)+";").replace(/\u0008/gim,"");function Q0(i){return i=i.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),i="echo(`"+i+"`);",`(function parse(data){
8
8
  let output = "";
9
-
10
9
  function echo(html){
11
10
  output += html;
12
11
  }
13
-
14
- ${t}
15
-
12
+ ${i}
16
13
  return output;
17
- })`}function Ac(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}function Cc(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null}function Ic(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Dc(t){t.preventDefault?t.preventDefault:t.returnValue=!1}function Pc(t){return t.target||t.srcElement}const Mc=typeof document<"u"&&document.ontouchstart?"touchstart":"click";function Rc(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}(function(){let t=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(e){const n=new Date().getTime(),i=Math.max(0,16-(n-t)),r=window.setTimeout(function(){e(n+i)},i);return t=n+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})})();const Vr=t=>{function e(n){const i=window.requestAnimationFrame(e);t(n,i)}window.requestAnimationFrame(e)},Oc=(t,e)=>{const i=document.getElementById(t).getContext("2d");Vr((r,o)=>{e(i,r,o)})};function Lc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yr={exports:{}};(function(t){var e={};t.exports=e,e.parse=function(n,i){for(var r=e.bin.readUshort,o=e.bin.readUint,l=0,s={},a=new Uint8Array(n),c=a.length-4;o(a,c)!=101010256;)c--;var l=c;l+=4,l+=4;var f=r(a,l);l+=2,r(a,l),l+=2;var u=o(a,l);l+=4;var d=o(a,l);l+=4,l=d;for(var h=0;h<f;h++){o(a,l),l+=4,l+=4,l+=4,l+=4,o(a,l),l+=4;var u=o(a,l);l+=4;var _=o(a,l);l+=4;var p=r(a,l),g=r(a,l+2),m=r(a,l+4);l+=6,l+=8;var y=o(a,l);l+=4,l+=p+g+m,e._readLocal(a,y,s,u,_,i)}return s},e._readLocal=function(n,i,r,o,s,a){var c=e.bin.readUshort,l=e.bin.readUint;l(n,i),i+=4,c(n,i),i+=2,c(n,i),i+=2;var f=c(n,i);i+=2,l(n,i),i+=4,l(n,i),i+=4,i+=8;var u=c(n,i);i+=2;var d=c(n,i);i+=2;var h=e.bin.readUTF8(n,i,u);if(i+=u,i+=d,a){r[h]={size:s,csize:o};return}var _=new Uint8Array(n.buffer,i);if(f==0)r[h]=new Uint8Array(_.buffer.slice(i,i+o));else if(f==8){var p=new Uint8Array(s);e.inflateRaw(_,p),r[h]=p}else throw"unknown compression method: "+f},e.inflateRaw=function(n,i){return e.F.inflate(n,i)},e.inflate=function(n,i){return n[0],n[1],e.inflateRaw(new Uint8Array(n.buffer,n.byteOffset+2,n.length-6),i)},e.deflate=function(n,i){i==null&&(i={level:6});var r=0,o=new Uint8Array(50+Math.floor(n.length*1.1));o[r]=120,o[r+1]=156,r+=2,r=e.F.deflateRaw(n,o,r,i.level);var s=e.adler(n,0,n.length);return o[r+0]=s>>>24&255,o[r+1]=s>>>16&255,o[r+2]=s>>>8&255,o[r+3]=s>>>0&255,new Uint8Array(o.buffer,0,r+4)},e.deflateRaw=function(n,i){i==null&&(i={level:6});var r=new Uint8Array(50+Math.floor(n.length*1.1)),o=e.F.deflateRaw(n,r,o,i.level);return new Uint8Array(r.buffer,0,o)},e.encode=function(n,i){i==null&&(i=!1);var r=0,o=e.bin.writeUint,s=e.bin.writeUshort,a={};for(var c in n){var l=!e._noNeed(c)&&!i,f=n[c],u=e.crc.crc(f,0,f.length);a[c]={cpr:l,usize:f.length,crc:u,file:l?e.deflateRaw(f):f}}for(var c in a)r+=a[c].file.length+30+46+2*e.bin.sizeUTF8(c);r+=22;var d=new Uint8Array(r),h=0,_=[];for(var c in a){var p=a[c];_.push(h),h=e._writeHeader(d,h,c,p,0)}var g=0,m=h;for(var c in a){var p=a[c];_.push(h),h=e._writeHeader(d,h,c,p,1,_[g++])}var y=h-m;return o(d,h,101010256),h+=4,h+=4,s(d,h,g),h+=2,s(d,h,g),h+=2,o(d,h,y),h+=4,o(d,h,m),h+=4,h+=2,d.buffer},e._noNeed=function(n){var i=n.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(i)!=-1},e._writeHeader=function(n,i,r,o,s,a){var c=e.bin.writeUint,l=e.bin.writeUshort,f=o.file;c(n,i,s==0?67324752:33639248),i+=4,s==1&&(i+=2),l(n,i,20),i+=2,l(n,i,0),i+=2,l(n,i,o.cpr?8:0),i+=2,c(n,i,0),i+=4,c(n,i,o.crc),i+=4,c(n,i,f.length),i+=4,c(n,i,o.usize),i+=4,l(n,i,e.bin.sizeUTF8(r)),i+=2,l(n,i,0),i+=2,s==1&&(i+=2,i+=2,i+=6,c(n,i,a),i+=4);var u=e.bin.writeUTF8(n,i,r);return i+=u,s==0&&(n.set(f,i),i+=f.length),i},e.crc={table:function(){for(var n=new Uint32Array(256),i=0;i<256;i++){for(var r=i,o=0;o<8;o++)r&1?r=3988292384^r>>>1:r=r>>>1;n[i]=r}return n}(),update:function(n,i,r,o){for(var s=0;s<o;s++)n=e.crc.table[(n^i[r+s])&255]^n>>>8;return n},crc:function(n,i,r){return e.crc.update(4294967295,n,i,r)^4294967295}},e.adler=function(n,i,r){for(var o=1,s=0,a=i,c=i+r;a<c;){for(var l=Math.min(a+5552,c);a<l;)o+=n[a++],s+=o;o=o%65521,s=s%65521}return s<<16|o},e.bin={readUshort:function(n,i){return n[i]|n[i+1]<<8},writeUshort:function(n,i,r){n[i]=r&255,n[i+1]=r>>8&255},readUint:function(n,i){return n[i+3]*16777216+(n[i+2]<<16|n[i+1]<<8|n[i])},writeUint:function(n,i,r){n[i]=r&255,n[i+1]=r>>8&255,n[i+2]=r>>16&255,n[i+3]=r>>24&255},readASCII:function(n,i,r){for(var o="",s=0;s<r;s++)o+=String.fromCharCode(n[i+s]);return o},writeASCII:function(n,i,r){for(var o=0;o<r.length;o++)n[i+o]=r.charCodeAt(o)},pad:function(n){return n.length<2?"0"+n:n},readUTF8:function(n,i,r){for(var o="",s,a=0;a<r;a++)o+="%"+e.bin.pad(n[i+a].toString(16));try{s=decodeURIComponent(o)}catch{return e.bin.readASCII(n,i,r)}return s},writeUTF8:function(n,i,r){for(var o=r.length,s=0,a=0;a<o;a++){var c=r.charCodeAt(a);if(!(c&4294967168))n[i+s]=c,s++;else if(!(c&4294965248))n[i+s]=192|c>>6,n[i+s+1]=128|c>>0&63,s+=2;else if(!(c&4294901760))n[i+s]=224|c>>12,n[i+s+1]=128|c>>6&63,n[i+s+2]=128|c>>0&63,s+=3;else if(!(c&4292870144))n[i+s]=240|c>>18,n[i+s+1]=128|c>>12&63,n[i+s+2]=128|c>>6&63,n[i+s+3]=128|c>>0&63,s+=4;else throw"e"}return s},sizeUTF8:function(n){for(var i=n.length,r=0,o=0;o<i;o++){var s=n.charCodeAt(o);if(!(s&4294967168))r++;else if(!(s&4294965248))r+=2;else if(!(s&4294901760))r+=3;else if(!(s&4292870144))r+=4;else throw"e"}return r}},e.F={},e.F.deflateRaw=function(n,i,r,o){var s=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]],a=s[o],c=e.F.U,l=e.F._goodIndex;e.F._hash;var f=e.F._putsE,u=0,d=r<<3,h=0,_=n.length;if(o==0){for(;u<_;){var p=Math.min(65535,_-u);f(i,d,u+p==_?1:0),d=e.F._copyExact(n,u,p,i,d+8),u+=p}return d>>>3}var g=c.lits,m=c.strt,y=c.prev,b=0,v=0,E=0,x=0,S=0,C=0;for(_>2&&(C=e.F._hash(n,0),m[C]=0),u=0;u<_;u++){if(S=C,u+1<_-2){C=e.F._hash(n,u+1);var k=u+1&32767;y[k]=m[C],m[C]=k}if(h<=u){(b>14e3||v>26697)&&_-u>100&&(h<u&&(g[b]=u-h,b+=2,h=u),d=e.F._writeBlock(u==_-1||h==_?1:0,g,b,x,n,E,u-E,i,d),b=v=x=0,E=u);var A=0;u<_-2&&(A=e.F._bestMatch(n,u,y,S,Math.min(a[2],_-u),a[3]));var p=A>>>16,D=A&65535;if(A!=0){var p=A>>>16,D=A&65535,P=l(p,c.of0);c.lhst[257+P]++;var U=l(D,c.df0);c.dhst[U]++,x+=c.exb[P]+c.dxb[U],g[b]=p<<23|u-h,g[b+1]=D<<16|P<<8|U,b+=2,h=u+p}else c.lhst[n[u]]++;v++}}for((E!=u||n.length==0)&&(h<u&&(g[b]=u-h,b+=2,h=u),d=e.F._writeBlock(1,g,b,x,n,E,u-E,i,d),b=0,v=0,b=v=x=0,E=u);d&7;)d++;return d>>>3},e.F._bestMatch=function(n,i,r,o,s,a){var c=i&32767,l=r[c],f=c-l+32768&32767;if(l==c||o!=e.F._hash(n,i-f))return 0;for(var u=0,d=0,h=Math.min(32767,i);f<=h&&--a!=0&&l!=c;){if(u==0||n[i+u]==n[i+u-f]){var _=e.F._howLong(n,i,f);if(_>u){if(u=_,d=f,u>=s)break;f+2<_&&(_=f+2);for(var p=0,g=0;g<_-2;g++){var m=i-f+g+32768&32767,y=r[m],b=m-y+32768&32767;b>p&&(p=b,l=m)}}}c=l,l=r[c],f+=c-l+32768&32767}return u<<16|d},e.F._howLong=function(n,i,r){if(n[i]!=n[i-r]||n[i+1]!=n[i+1-r]||n[i+2]!=n[i+2-r])return 0;var o=i,s=Math.min(n.length,i+258);for(i+=3;i<s&&n[i]==n[i-r];)i++;return i-o},e.F._hash=function(n,i){return(n[i]<<8|n[i+1])+(n[i+2]<<4)&65535},e.saved=0,e.F._writeBlock=function(n,i,r,o,s,a,c,l,f){var u=e.F.U,d=e.F._putsF,h=e.F._putsE,_,p,g,m,y,b,v,E,x;u.lhst[256]++,_=e.F.getTrees(),p=_[0],g=_[1],m=_[2],y=_[3],b=_[4],v=_[5],E=_[6],x=_[7];var S=(f+3&7?8-(f+3&7):0)+32+(c<<3),C=o+e.F.contSize(u.fltree,u.lhst)+e.F.contSize(u.fdtree,u.dhst),k=o+e.F.contSize(u.ltree,u.lhst)+e.F.contSize(u.dtree,u.dhst);k+=14+3*v+e.F.contSize(u.itree,u.ihst)+(u.ihst[16]*2+u.ihst[17]*3+u.ihst[18]*7);for(var A=0;A<286;A++)u.lhst[A]=0;for(var A=0;A<30;A++)u.dhst[A]=0;for(var A=0;A<19;A++)u.ihst[A]=0;var D=S<C&&S<k?0:C<k?1:2;if(d(l,f,n),d(l,f+1,D),f+=3,D==0){for(;f&7;)f++;f=e.F._copyExact(s,a,c,l,f)}else{var P,U;if(D==1&&(P=u.fltree,U=u.fdtree),D==2){e.F.makeCodes(u.ltree,p),e.F.revCodes(u.ltree,p),e.F.makeCodes(u.dtree,g),e.F.revCodes(u.dtree,g),e.F.makeCodes(u.itree,m),e.F.revCodes(u.itree,m),P=u.ltree,U=u.dtree,h(l,f,y-257),f+=5,h(l,f,b-1),f+=5,h(l,f,v-4),f+=4;for(var z=0;z<v;z++)h(l,f+z*3,u.itree[(u.ordr[z]<<1)+1]);f+=3*v,f=e.F._codeTiny(E,u.itree,l,f),f=e.F._codeTiny(x,u.itree,l,f)}for(var M=a,Ut=0;Ut<r;Ut+=2){for(var gt=i[Ut],Ft=gt>>>23,Pe=M+(gt&(1<<23)-1);M<Pe;)f=e.F._writeLit(s[M++],P,l,f);if(Ft!=0){var Qt=i[Ut+1],Ui=Qt>>16,zt=Qt>>8&255,Tt=Qt&255;f=e.F._writeLit(257+zt,P,l,f),h(l,f,Ft-u.of0[zt]),f+=u.exb[zt],f=e.F._writeLit(Tt,U,l,f),d(l,f,Ui-u.df0[Tt]),f+=u.dxb[Tt],M+=Ft}}f=e.F._writeLit(256,P,l,f)}return f},e.F._copyExact=function(n,i,r,o,s){var a=s>>>3;return o[a]=r,o[a+1]=r>>>8,o[a+2]=255-o[a],o[a+3]=255-o[a+1],a+=4,o.set(new Uint8Array(n.buffer,i,r),a),s+(r+4<<3)},e.F.getTrees=function(){for(var n=e.F.U,i=e.F._hufTree(n.lhst,n.ltree,15),r=e.F._hufTree(n.dhst,n.dtree,15),o=[],s=e.F._lenCodes(n.ltree,o),a=[],c=e.F._lenCodes(n.dtree,a),l=0;l<o.length;l+=2)n.ihst[o[l]]++;for(var l=0;l<a.length;l+=2)n.ihst[a[l]]++;for(var f=e.F._hufTree(n.ihst,n.itree,7),u=19;u>4&&n.itree[(n.ordr[u-1]<<1)+1]==0;)u--;return[i,r,f,s,c,u,o,a]},e.F.getSecond=function(n){for(var i=[],r=0;r<n.length;r+=2)i.push(n[r+1]);return i},e.F.nonZero=function(n){for(var i="",r=0;r<n.length;r+=2)n[r+1]!=0&&(i+=(r>>1)+",");return i},e.F.contSize=function(n,i){for(var r=0,o=0;o<i.length;o++)r+=i[o]*n[(o<<1)+1];return r},e.F._codeTiny=function(n,i,r,o){for(var s=0;s<n.length;s+=2){var a=n[s],c=n[s+1];o=e.F._writeLit(a,i,r,o);var l=a==16?2:a==17?3:7;a>15&&(e.F._putsE(r,o,c,l),o+=l)}return o},e.F._lenCodes=function(n,i){for(var r=n.length;r!=2&&n[r-1]==0;)r-=2;for(var o=0;o<r;o+=2){var s=n[o+1],a=o+3<r?n[o+3]:-1,c=o+5<r?n[o+5]:-1,l=o==0?-1:n[o-1];if(s==0&&a==s&&c==s){for(var f=o+5;f+2<r&&n[f+2]==s;)f+=2;var u=Math.min(f+1-o>>>1,138);u<11?i.push(17,u-3):i.push(18,u-11),o+=u*2-2}else if(s==l&&a==s&&c==s){for(var f=o+5;f+2<r&&n[f+2]==s;)f+=2;var u=Math.min(f+1-o>>>1,6);i.push(16,u-3),o+=u*2-2}else i.push(s,0)}return r>>>1},e.F._hufTree=function(n,i,r){var o=[],s=n.length,a=i.length,c=0;for(c=0;c<a;c+=2)i[c]=0,i[c+1]=0;for(c=0;c<s;c++)n[c]!=0&&o.push({lit:c,f:n[c]});var l=o.length,f=o.slice(0);if(l==0)return 0;if(l==1){var u=o[0].lit,f=u==0?1:0;return i[(u<<1)+1]=1,i[(f<<1)+1]=1,1}o.sort(function(y,b){return y.f-b.f});var d=o[0],h=o[1],_=0,p=1,g=2;for(o[0]={lit:-1,f:d.f+h.f,l:d,r:h,d:0};p!=l-1;)_!=p&&(g==l||o[_].f<o[g].f)?d=o[_++]:d=o[g++],_!=p&&(g==l||o[_].f<o[g].f)?h=o[_++]:h=o[g++],o[p++]={lit:-1,f:d.f+h.f,l:d,r:h};var m=e.F.setDepth(o[p-1],0);for(m>r&&(e.F.restrictDepth(f,r,m),m=r),c=0;c<l;c++)i[(f[c].lit<<1)+1]=f[c].d;return m},e.F.setDepth=function(n,i){return n.lit!=-1?(n.d=i,i):Math.max(e.F.setDepth(n.l,i+1),e.F.setDepth(n.r,i+1))},e.F.restrictDepth=function(n,i,r){var o=0,s=1<<r-i,a=0;for(n.sort(function(l,f){return f.d==l.d?l.f-f.f:f.d-l.d}),o=0;o<n.length&&n[o].d>i;o++){var c=n[o].d;n[o].d=i,a+=s-(1<<r-c)}for(a=a>>>r-i;a>0;){var c=n[o].d;c<i?(n[o].d++,a-=1<<i-c-1):o++}for(;o>=0;o--)n[o].d==i&&a<0&&(n[o].d--,a++);a!=0&&console.log("debt left")},e.F._goodIndex=function(n,i){var r=0;return i[r|16]<=n&&(r|=16),i[r|8]<=n&&(r|=8),i[r|4]<=n&&(r|=4),i[r|2]<=n&&(r|=2),i[r|1]<=n&&(r|=1),r},e.F._writeLit=function(n,i,r,o){return e.F._putsF(r,o,i[n<<1]),o+i[(n<<1)+1]},e.F.inflate=function(n,i){var r=Uint8Array;if(n[0]==3&&n[1]==0)return i||new r(0);var o=e.F,s=o._bitsF,a=o._bitsE,c=o._decodeTiny,l=o.makeCodes,f=o.codes2map,u=o._get17,d=o.U,h=i==null;h&&(i=new r(n.length>>>2<<3));for(var _=0,p=0,g=0,m=0,y=0,b=0,v=0,E=0,x=0,S,C;_==0;){if(_=s(n,x,1),p=s(n,x+1,2),x+=3,p==0){x&7&&(x+=8-(x&7));var k=(x>>>3)+4,A=n[k-4]|n[k-3]<<8;h&&(i=e.F._check(i,E+A)),i.set(new r(n.buffer,n.byteOffset+k,A),E),x=k+A<<3,E+=A;continue}if(h&&(i=e.F._check(i,E+131072)),p==1&&(S=d.flmap,C=d.fdmap,b=511,v=31),p==2){g=a(n,x,5)+257,m=a(n,x+5,5)+1,y=a(n,x+10,4)+4,x+=14;for(var D=0;D<38;D+=2)d.itree[D]=0,d.itree[D+1]=0;for(var P=1,D=0;D<y;D++){var U=a(n,x+D*3,3);d.itree[(d.ordr[D]<<1)+1]=U,U>P&&(P=U)}x+=3*y,l(d.itree,P),f(d.itree,P,d.imap),S=d.lmap,C=d.dmap,x=c(d.imap,(1<<P)-1,g+m,n,x,d.ttree);var z=o._copyOut(d.ttree,0,g,d.ltree);b=(1<<z)-1;var M=o._copyOut(d.ttree,g,m,d.dtree);v=(1<<M)-1,l(d.ltree,z),f(d.ltree,z,S),l(d.dtree,M),f(d.dtree,M,C)}for(;;){var Ut=S[u(n,x)&b];x+=Ut&15;var gt=Ut>>>4;if(!(gt>>>8))i[E++]=gt;else{if(gt==256)break;var Ft=E+gt-254;if(gt>264){var Pe=d.ldef[gt-257];Ft=E+(Pe>>>3)+a(n,x,Pe&7),x+=Pe&7}var Qt=C[u(n,x)&v];x+=Qt&15;var Ui=Qt>>>4,zt=d.ddef[Ui],Tt=(zt>>>4)+s(n,x,zt&15);for(x+=zt&15,h&&(i=e.F._check(i,E+131072));E<Ft;)i[E]=i[E++-Tt],i[E]=i[E++-Tt],i[E]=i[E++-Tt],i[E]=i[E++-Tt];E=Ft}}}return i.length==E?i:i.slice(0,E)},e.F._check=function(n,i){var r=n.length;if(i<=r)return n;var o=new Uint8Array(Math.max(r<<1,i));return o.set(n,0),o},e.F._decodeTiny=function(n,i,r,o,s,a){for(var c=e.F._bitsE,l=e.F._get17,f=0;f<r;){var u=n[l(o,s)&i];s+=u&15;var d=u>>>4;if(d<=15)a[f]=d,f++;else{var h=0,_=0;d==16?(_=3+c(o,s,2),s+=2,h=a[f-1]):d==17?(_=3+c(o,s,3),s+=3):d==18&&(_=11+c(o,s,7),s+=7);for(var p=f+_;f<p;)a[f]=h,f++}}return s},e.F._copyOut=function(n,i,r,o){for(var s=0,a=0,c=o.length>>>1;a<r;){var l=n[a+i];o[a<<1]=0,o[(a<<1)+1]=l,l>s&&(s=l),a++}for(;a<c;)o[a<<1]=0,o[(a<<1)+1]=0,a++;return s},e.F.makeCodes=function(n,i){for(var r=e.F.U,o=n.length,s,a,c,l,f,u=r.bl_count,l=0;l<=i;l++)u[l]=0;for(l=1;l<o;l+=2)u[n[l]]++;var d=r.next_code;for(s=0,u[0]=0,a=1;a<=i;a++)s=s+u[a-1]<<1,d[a]=s;for(c=0;c<o;c+=2)f=n[c+1],f!=0&&(n[c]=d[f],d[f]++)},e.F.codes2map=function(n,i,r){for(var o=n.length,s=e.F.U,a=s.rev15,c=0;c<o;c+=2)if(n[c+1]!=0)for(var l=c>>1,f=n[c+1],u=l<<4|f,d=i-f,h=n[c]<<d,_=h+(1<<d);h!=_;){var p=a[h]>>>15-i;r[p]=u,h++}},e.F.revCodes=function(n,i){for(var r=e.F.U.rev15,o=15-i,s=0;s<n.length;s+=2){var a=n[s]<<i-n[s+1];n[s]=r[a]>>>o}},e.F._putsE=function(n,i,r){r=r<<(i&7);var o=i>>>3;n[o]|=r,n[o+1]|=r>>>8},e.F._putsF=function(n,i,r){r=r<<(i&7);var o=i>>>3;n[o]|=r,n[o+1]|=r>>>8,n[o+2]|=r>>>16},e.F._bitsE=function(n,i,r){return(n[i>>>3]|n[(i>>>3)+1]<<8)>>>(i&7)&(1<<r)-1},e.F._bitsF=function(n,i,r){return(n[i>>>3]|n[(i>>>3)+1]<<8|n[(i>>>3)+2]<<16)>>>(i&7)&(1<<r)-1},e.F._get17=function(n,i){return(n[i>>>3]|n[(i>>>3)+1]<<8|n[(i>>>3)+2]<<16)>>>(i&7)},e.F._get25=function(n,i){return(n[i>>>3]|n[(i>>>3)+1]<<8|n[(i>>>3)+2]<<16|n[(i>>>3)+3]<<24)>>>(i&7)},e.F.U=function(){var n=Uint16Array,i=Uint32Array;return{next_code:new n(16),bl_count:new n(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new n(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new i(32),flmap:new n(512),fltree:[],fdmap:new n(32),fdtree:[],lmap:new n(32768),ltree:[],ttree:[],dmap:new n(32768),dtree:[],imap:new n(512),itree:[],rev15:new n(32768),lhst:new i(286),dhst:new i(30),ihst:new i(19),lits:new i(15e3),strt:new n(65536),prev:new n(32768)}}(),function(){for(var n=e.F.U,i=32768,r=0;r<i;r++){var o=r;o=(o&2863311530)>>>1|(o&1431655765)<<1,o=(o&3435973836)>>>2|(o&858993459)<<2,o=(o&4042322160)>>>4|(o&252645135)<<4,o=(o&4278255360)>>>8|(o&16711935)<<8,n.rev15[r]=(o>>>16|o<<16)>>>17}function s(a,c,l){for(;c--!=0;)a.push(0,l)}for(var r=0;r<32;r++)n.ldef[r]=n.of0[r]<<3|n.exb[r],n.ddef[r]=n.df0[r]<<4|n.dxb[r];s(n.fltree,144,8),s(n.fltree,112,9),s(n.fltree,24,7),s(n.fltree,8,8),e.F.makeCodes(n.fltree,9),e.F.codes2map(n.fltree,9,n.flmap),e.F.revCodes(n.fltree,9),s(n.fdtree,32,5),e.F.makeCodes(n.fdtree,5),e.F.codes2map(n.fdtree,5,n.fdmap),e.F.revCodes(n.fdtree,5),s(n.itree,19,0),s(n.ltree,286,0),s(n.dtree,30,0),s(n.ttree,320,0)}()})(Yr);var Uc=Yr.exports;const Wr=Lc(Uc);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Fc=4,Kr=0,Jr=1,zc=2;function qt(t){let e=t.length;for(;--e>=0;)t[e]=0}const Bc=0,Qr=1,Nc=2,jc=3,Hc=258,Gn=29,ce=256,he=ce+1+Gn,Zt=30,Xn=19,to=2*he+1,At=15,$n=16,qc=7,Vn=256,eo=16,no=17,io=18,Yn=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Ye=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Zc=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ro=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gc=512,ct=new Array((he+2)*2);qt(ct);const fe=new Array(Zt*2);qt(fe);const ue=new Array(Gc);qt(ue);const de=new Array(Hc-jc+1);qt(de);const Wn=new Array(Gn);qt(Wn);const We=new Array(Zt);qt(We);function Kn(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}let oo,so,ao;function Jn(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const lo=t=>t<256?ue[t]:ue[256+(t>>>7)],_e=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},G=(t,e,n)=>{t.bi_valid>$n-n?(t.bi_buf|=e<<t.bi_valid&65535,_e(t,t.bi_buf),t.bi_buf=e>>$n-t.bi_valid,t.bi_valid+=n-$n):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},nt=(t,e,n)=>{G(t,n[e*2],n[e*2+1])},co=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},Xc=t=>{t.bi_valid===16?(_e(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},$c=(t,e)=>{const n=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,c=e.stat_desc.max_length;let l,f,u,d,h,_,p=0;for(d=0;d<=At;d++)t.bl_count[d]=0;for(n[t.heap[t.heap_max]*2+1]=0,l=t.heap_max+1;l<to;l++)f=t.heap[l],d=n[n[f*2+1]*2+1]+1,d>c&&(d=c,p++),n[f*2+1]=d,!(f>i)&&(t.bl_count[d]++,h=0,f>=a&&(h=s[f-a]),_=n[f*2],t.opt_len+=_*(d+h),o&&(t.static_len+=_*(r[f*2+1]+h)));if(p!==0){do{for(d=c-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(d=c;d!==0;d--)for(f=t.bl_count[d];f!==0;)u=t.heap[--l],!(u>i)&&(n[u*2+1]!==d&&(t.opt_len+=(d-n[u*2+1])*n[u*2],n[u*2+1]=d),f--)}},ho=(t,e,n)=>{const i=new Array(At+1);let r=0,o,s;for(o=1;o<=At;o++)r=r+n[o-1]<<1,i[o]=r;for(s=0;s<=e;s++){let a=t[s*2+1];a!==0&&(t[s*2]=co(i[a]++,a))}},Vc=()=>{let t,e,n,i,r;const o=new Array(At+1);for(n=0,i=0;i<Gn-1;i++)for(Wn[i]=n,t=0;t<1<<Yn[i];t++)de[n++]=i;for(de[n-1]=i,r=0,i=0;i<16;i++)for(We[i]=r,t=0;t<1<<Ye[i];t++)ue[r++]=i;for(r>>=7;i<Zt;i++)for(We[i]=r<<7,t=0;t<1<<Ye[i]-7;t++)ue[256+r++]=i;for(e=0;e<=At;e++)o[e]=0;for(t=0;t<=143;)ct[t*2+1]=8,t++,o[8]++;for(;t<=255;)ct[t*2+1]=9,t++,o[9]++;for(;t<=279;)ct[t*2+1]=7,t++,o[7]++;for(;t<=287;)ct[t*2+1]=8,t++,o[8]++;for(ho(ct,he+1,o),t=0;t<Zt;t++)fe[t*2+1]=5,fe[t*2]=co(t,5);oo=new Kn(ct,Yn,ce+1,he,At),so=new Kn(fe,Ye,0,Zt,At),ao=new Kn(new Array(0),Zc,0,Xn,qc)},fo=t=>{let e;for(e=0;e<he;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Zt;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Xn;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Vn*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},uo=t=>{t.bi_valid>8?_e(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},_o=(t,e,n,i)=>{const r=e*2,o=n*2;return t[r]<t[o]||t[r]===t[o]&&i[e]<=i[n]},Qn=(t,e,n)=>{const i=t.heap[n];let r=n<<1;for(;r<=t.heap_len&&(r<t.heap_len&&_o(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!_o(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i},go=(t,e,n)=>{let i,r,o=0,s,a;if(t.sym_next!==0)do i=t.pending_buf[t.sym_buf+o++]&255,i+=(t.pending_buf[t.sym_buf+o++]&255)<<8,r=t.pending_buf[t.sym_buf+o++],i===0?nt(t,r,e):(s=de[r],nt(t,s+ce+1,e),a=Yn[s],a!==0&&(r-=Wn[s],G(t,r,a)),i--,s=lo(i),nt(t,s,n),a=Ye[s],a!==0&&(i-=We[s],G(t,i,a)));while(o<t.sym_next);nt(t,Vn,e)},ti=(t,e)=>{const n=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,o=e.stat_desc.elems;let s,a,c=-1,l;for(t.heap_len=0,t.heap_max=to,s=0;s<o;s++)n[s*2]!==0?(t.heap[++t.heap_len]=c=s,t.depth[s]=0):n[s*2+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=c<2?++c:0,n[l*2]=1,t.depth[l]=0,t.opt_len--,r&&(t.static_len-=i[l*2+1]);for(e.max_code=c,s=t.heap_len>>1;s>=1;s--)Qn(t,n,s);l=o;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Qn(t,n,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,n[l*2]=n[s*2]+n[a*2],t.depth[l]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,n[s*2+1]=n[a*2+1]=l,t.heap[1]=l++,Qn(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],$c(t,e),ho(n,c,t.bl_count)},po=(t,e,n)=>{let i,r=-1,o,s=e[0*2+1],a=0,c=7,l=4;for(s===0&&(c=138,l=3),e[(n+1)*2+1]=65535,i=0;i<=n;i++)o=s,s=e[(i+1)*2+1],!(++a<c&&o===s)&&(a<l?t.bl_tree[o*2]+=a:o!==0?(o!==r&&t.bl_tree[o*2]++,t.bl_tree[eo*2]++):a<=10?t.bl_tree[no*2]++:t.bl_tree[io*2]++,a=0,r=o,s===0?(c=138,l=3):o===s?(c=6,l=3):(c=7,l=4))},mo=(t,e,n)=>{let i,r=-1,o,s=e[0*2+1],a=0,c=7,l=4;for(s===0&&(c=138,l=3),i=0;i<=n;i++)if(o=s,s=e[(i+1)*2+1],!(++a<c&&o===s)){if(a<l)do nt(t,o,t.bl_tree);while(--a!==0);else o!==0?(o!==r&&(nt(t,o,t.bl_tree),a--),nt(t,eo,t.bl_tree),G(t,a-3,2)):a<=10?(nt(t,no,t.bl_tree),G(t,a-3,3)):(nt(t,io,t.bl_tree),G(t,a-11,7));a=0,r=o,s===0?(c=138,l=3):o===s?(c=6,l=3):(c=7,l=4)}},Yc=t=>{let e;for(po(t,t.dyn_ltree,t.l_desc.max_code),po(t,t.dyn_dtree,t.d_desc.max_code),ti(t,t.bl_desc),e=Xn-1;e>=3&&t.bl_tree[ro[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},Wc=(t,e,n,i)=>{let r;for(G(t,e-257,5),G(t,n-1,5),G(t,i-4,4),r=0;r<i;r++)G(t,t.bl_tree[ro[r]*2+1],3);mo(t,t.dyn_ltree,e-1),mo(t,t.dyn_dtree,n-1)},Kc=t=>{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return Kr;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Jr;for(n=32;n<ce;n++)if(t.dyn_ltree[n*2]!==0)return Jr;return Kr};let wo=!1;const Jc=t=>{wo||(Vc(),wo=!0),t.l_desc=new Jn(t.dyn_ltree,oo),t.d_desc=new Jn(t.dyn_dtree,so),t.bl_desc=new Jn(t.bl_tree,ao),t.bi_buf=0,t.bi_valid=0,fo(t)},yo=(t,e,n,i)=>{G(t,(Bc<<1)+(i?1:0),3),uo(t),_e(t,n),_e(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},Qc=t=>{G(t,Qr<<1,3),nt(t,Vn,ct),Xc(t)},th=(t,e,n,i)=>{let r,o,s=0;t.level>0?(t.strm.data_type===zc&&(t.strm.data_type=Kc(t)),ti(t,t.l_desc),ti(t,t.d_desc),s=Yc(t),r=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=r&&(r=o)):r=o=n+5,n+4<=r&&e!==-1?yo(t,e,n,i):t.strategy===Fc||o===r?(G(t,(Qr<<1)+(i?1:0),3),go(t,ct,fe)):(G(t,(Nc<<1)+(i?1:0),3),Wc(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),go(t,t.dyn_ltree,t.dyn_dtree)),fo(t),i&&uo(t)},eh=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(de[n]+ce+1)*2]++,t.dyn_dtree[lo(e)*2]++),t.sym_next===t.sym_end);var nh=Jc,ih=yo,rh=th,oh=eh,sh=Qc,ah={_tr_init:nh,_tr_stored_block:ih,_tr_flush_block:rh,_tr_tally:oh,_tr_align:sh},ge=(t,e,n,i)=>{let r=t&65535|0,o=t>>>16&65535|0,s=0;for(;n!==0;){s=n>2e3?2e3:n,n-=s;do r=r+e[i++]|0,o=o+r|0;while(--s);r%=65521,o%=65521}return r|o<<16|0};const lh=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},ch=new Uint32Array(lh());var j=(t,e,n,i)=>{const r=ch,o=i+n;t^=-1;for(let s=i;s<o;s++)t=t>>>8^r[(t^e[s])&255];return t^-1},Ct={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},It={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:hh,_tr_stored_block:ei,_tr_flush_block:fh,_tr_tally:wt,_tr_align:uh}=ah,{Z_NO_FLUSH:yt,Z_PARTIAL_FLUSH:dh,Z_FULL_FLUSH:_h,Z_FINISH:Y,Z_BLOCK:vo,Z_OK:H,Z_STREAM_END:bo,Z_STREAM_ERROR:it,Z_DATA_ERROR:gh,Z_BUF_ERROR:ni,Z_DEFAULT_COMPRESSION:ph,Z_FILTERED:mh,Z_HUFFMAN_ONLY:Ke,Z_RLE:wh,Z_FIXED:yh,Z_DEFAULT_STRATEGY:vh,Z_UNKNOWN:bh,Z_DEFLATED:Je}=It,xh=9,Eh=15,Sh=8,Th=29,ii=256+1+Th,kh=30,Ah=19,Ch=2*ii+1,Ih=15,R=3,vt=258,rt=vt+R+1,Dh=32,Gt=42,ri=57,oi=69,si=73,ai=91,li=103,Dt=113,pe=666,q=1,Xt=2,Pt=3,$t=4,Ph=3,Mt=(t,e)=>(t.msg=Ct[e],e),xo=t=>t*2-(t>4?9:0),bt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Mh=t=>{let e,n,i,r=t.w_size;e=t.hash_size,i=e;do n=t.head[--i],t.head[i]=n>=r?n-r:0;while(--e);e=r,i=e;do n=t.prev[--i],t.prev[i]=n>=r?n-r:0;while(--e)};let xt=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask;const X=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},$=(t,e)=>{fh(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},L=(t,e)=>{t.pending_buf[t.pending++]=e},me=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},ci=(t,e,n,i)=>{let r=t.avail_in;return r>i&&(r=i),r===0?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),n),t.state.wrap===1?t.adler=ge(t.adler,e,r,n):t.state.wrap===2&&(t.adler=j(t.adler,e,r,n)),t.next_in+=r,t.total_in+=r,r)},Eo=(t,e)=>{let n=t.max_chain_length,i=t.strstart,r,o,s=t.prev_length,a=t.nice_match;const c=t.strstart>t.w_size-rt?t.strstart-(t.w_size-rt):0,l=t.window,f=t.w_mask,u=t.prev,d=t.strstart+vt;let h=l[i+s-1],_=l[i+s];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do if(r=e,!(l[r+s]!==_||l[r+s-1]!==h||l[r]!==l[i]||l[++r]!==l[i+1])){i+=2,r++;do;while(l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&i<d);if(o=vt-(d-i),i=d-vt,o>s){if(t.match_start=e,s=o,o>=a)break;h=l[i+s-1],_=l[i+s]}}while((e=u[e&f])>c&&--n!==0);return s<=t.lookahead?s:t.lookahead},Vt=t=>{const e=t.w_size;let n,i,r;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-rt)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Mh(t),i+=e),t.strm.avail_in===0)break;if(n=ci(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=R)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=xt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=xt(t,t.ins_h,t.window[r+R-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<R)););}while(t.lookahead<rt&&t.strm.avail_in!==0)},So=(t,e)=>{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,i,r,o,s=0,a=t.strm.avail_in;do{if(i=65535,o=t.bi_valid+42>>3,t.strm.avail_out<o||(o=t.strm.avail_out-o,r=t.strstart-t.block_start,i>r+t.strm.avail_in&&(i=r+t.strm.avail_in),i>o&&(i=o),i<n&&(i===0&&e!==Y||e===yt||i!==r+t.strm.avail_in)))break;s=e===Y&&i===r+t.strm.avail_in?1:0,ei(t,0,0,s),t.pending_buf[t.pending-4]=i,t.pending_buf[t.pending-3]=i>>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,X(t.strm),r&&(r>i&&(r=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+r),t.strm.next_out),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r,t.block_start+=r,i-=r),i&&(ci(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i)}while(s===0);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?$t:e!==yt&&e!==Y&&t.strm.avail_in===0&&t.strstart===t.block_start?Xt:(o=t.window_size-t.strstart,t.strm.avail_in>o&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,o+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),o>t.strm.avail_in&&(o=t.strm.avail_in),o&&(ci(t.strm,t.window,t.strstart,o),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.high_water<t.strstart&&(t.high_water=t.strstart),o=t.bi_valid+42>>3,o=t.pending_buf_size-o>65535?65535:t.pending_buf_size-o,n=o>t.w_size?t.w_size:o,r=t.strstart-t.block_start,(r>=n||(r||e===Y)&&e!==yt&&t.strm.avail_in===0&&r<=o)&&(i=r>o?o:r,s=e===Y&&t.strm.avail_in===0&&i===r?1:0,ei(t,t.block_start,i,s),t.block_start+=i,X(t.strm)),s?Pt:q)},hi=(t,e)=>{let n,i;for(;;){if(t.lookahead<rt){if(Vt(t),t.lookahead<rt&&e===yt)return q;if(t.lookahead===0)break}if(n=0,t.lookahead>=R&&(t.ins_h=xt(t,t.ins_h,t.window[t.strstart+R-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-rt&&(t.match_length=Eo(t,n)),t.match_length>=R)if(i=wt(t,t.strstart-t.match_start,t.match_length-R),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=R){t.match_length--;do t.strstart++,t.ins_h=xt(t,t.ins_h,t.window[t.strstart+R-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=xt(t,t.ins_h,t.window[t.strstart+1]);else i=wt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&($(t,!1),t.strm.avail_out===0))return q}return t.insert=t.strstart<R-1?t.strstart:R-1,e===Y?($(t,!0),t.strm.avail_out===0?Pt:$t):t.sym_next&&($(t,!1),t.strm.avail_out===0)?q:Xt},Yt=(t,e)=>{let n,i,r;for(;;){if(t.lookahead<rt){if(Vt(t),t.lookahead<rt&&e===yt)return q;if(t.lookahead===0)break}if(n=0,t.lookahead>=R&&(t.ins_h=xt(t,t.ins_h,t.window[t.strstart+R-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=R-1,n!==0&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-rt&&(t.match_length=Eo(t,n),t.match_length<=5&&(t.strategy===mh||t.match_length===R&&t.strstart-t.match_start>4096)&&(t.match_length=R-1)),t.prev_length>=R&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-R,i=wt(t,t.strstart-1-t.prev_match,t.prev_length-R),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=r&&(t.ins_h=xt(t,t.ins_h,t.window[t.strstart+R-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=R-1,t.strstart++,i&&($(t,!1),t.strm.avail_out===0))return q}else if(t.match_available){if(i=wt(t,0,t.window[t.strstart-1]),i&&$(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return q}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=wt(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<R-1?t.strstart:R-1,e===Y?($(t,!0),t.strm.avail_out===0?Pt:$t):t.sym_next&&($(t,!1),t.strm.avail_out===0)?q:Xt},Rh=(t,e)=>{let n,i,r,o;const s=t.window;for(;;){if(t.lookahead<=vt){if(Vt(t),t.lookahead<=vt&&e===yt)return q;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=R&&t.strstart>0&&(r=t.strstart-1,i=s[r],i===s[++r]&&i===s[++r]&&i===s[++r])){o=t.strstart+vt;do;while(i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&r<o);t.match_length=vt-(o-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=R?(n=wt(t,1,t.match_length-R),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=wt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&($(t,!1),t.strm.avail_out===0))return q}return t.insert=0,e===Y?($(t,!0),t.strm.avail_out===0?Pt:$t):t.sym_next&&($(t,!1),t.strm.avail_out===0)?q:Xt},Oh=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(Vt(t),t.lookahead===0)){if(e===yt)return q;break}if(t.match_length=0,n=wt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&($(t,!1),t.strm.avail_out===0))return q}return t.insert=0,e===Y?($(t,!0),t.strm.avail_out===0?Pt:$t):t.sym_next&&($(t,!1),t.strm.avail_out===0)?q:Xt};function ot(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}const we=[new ot(0,0,0,0,So),new ot(4,4,8,4,hi),new ot(4,5,16,8,hi),new ot(4,6,32,32,hi),new ot(4,4,16,16,Yt),new ot(8,16,32,32,Yt),new ot(8,16,128,128,Yt),new ot(8,32,128,256,Yt),new ot(32,128,258,1024,Yt),new ot(32,258,258,4096,Yt)],Lh=t=>{t.window_size=2*t.w_size,bt(t.head),t.max_lazy_match=we[t.level].max_lazy,t.good_match=we[t.level].good_length,t.nice_match=we[t.level].nice_length,t.max_chain_length=we[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=R-1,t.match_available=0,t.ins_h=0};function Uh(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Je,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ch*2),this.dyn_dtree=new Uint16Array((2*kh+1)*2),this.bl_tree=new Uint16Array((2*Ah+1)*2),bt(this.dyn_ltree),bt(this.dyn_dtree),bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Ih+1),this.heap=new Uint16Array(2*ii+1),bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ii+1),bt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const ye=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Gt&&e.status!==ri&&e.status!==oi&&e.status!==si&&e.status!==ai&&e.status!==li&&e.status!==Dt&&e.status!==pe?1:0},To=t=>{if(ye(t))return Mt(t,it);t.total_in=t.total_out=0,t.data_type=bh;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?ri:e.wrap?Gt:Dt,t.adler=e.wrap===2?0:1,e.last_flush=-2,hh(e),H},ko=t=>{const e=To(t);return e===H&&Lh(t.state),e},Fh=(t,e)=>ye(t)||t.state.wrap!==2?it:(t.state.gzhead=e,H),Ao=(t,e,n,i,r,o)=>{if(!t)return it;let s=1;if(e===ph&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),r<1||r>xh||n!==Je||i<8||i>15||e<0||e>9||o<0||o>yh||i===8&&s!==1)return Mt(t,it);i===8&&(i=9);const a=new Uh;return t.state=a,a.strm=t,a.status=Gt,a.wrap=s,a.gzhead=null,a.w_bits=i,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=r+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+R-1)/R),a.window=new Uint8Array(a.w_size*2),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<r+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=(a.lit_bufsize-1)*3,a.level=e,a.strategy=o,a.method=n,ko(t)},zh=(t,e)=>Ao(t,e,Je,Eh,Sh,vh),Bh=(t,e)=>{if(ye(t)||e>vo||e<0)return t?Mt(t,it):it;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===pe&&e!==Y)return Mt(t,t.avail_out===0?ni:it);const i=n.last_flush;if(n.last_flush=e,n.pending!==0){if(X(t),t.avail_out===0)return n.last_flush=-1,H}else if(t.avail_in===0&&xo(e)<=xo(i)&&e!==Y)return Mt(t,ni);if(n.status===pe&&t.avail_in!==0)return Mt(t,ni);if(n.status===Gt&&n.wrap===0&&(n.status=Dt),n.status===Gt){let r=Je+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=Ke||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,r|=o<<6,n.strstart!==0&&(r|=Dh),r+=31-r%31,me(n,r),n.strstart!==0&&(me(n,t.adler>>>16),me(n,t.adler&65535)),t.adler=1,n.status=Dt,X(t),n.pending!==0)return n.last_flush=-1,H}if(n.status===ri){if(t.adler=0,L(n,31),L(n,139),L(n,8),n.gzhead)L(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),L(n,n.gzhead.time&255),L(n,n.gzhead.time>>8&255),L(n,n.gzhead.time>>16&255),L(n,n.gzhead.time>>24&255),L(n,n.level===9?2:n.strategy>=Ke||n.level<2?4:0),L(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(L(n,n.gzhead.extra.length&255),L(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=j(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=oi;else if(L(n,0),L(n,0),L(n,0),L(n,0),L(n,0),L(n,n.level===9?2:n.strategy>=Ke||n.level<2?4:0),L(n,Ph),n.status=Dt,X(t),n.pending!==0)return n.last_flush=-1,H}if(n.status===oi){if(n.gzhead.extra){let r=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let a=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>r&&(t.adler=j(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex+=a,X(t),n.pending!==0)return n.last_flush=-1,H;r=0,o-=a}let s=new Uint8Array(n.gzhead.extra);n.pending_buf.set(s.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>r&&(t.adler=j(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=si}if(n.status===si){if(n.gzhead.name){let r=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=j(t.adler,n.pending_buf,n.pending-r,r)),X(t),n.pending!==0)return n.last_flush=-1,H;r=0}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,L(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>r&&(t.adler=j(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=ai}if(n.status===ai){if(n.gzhead.comment){let r=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=j(t.adler,n.pending_buf,n.pending-r,r)),X(t),n.pending!==0)return n.last_flush=-1,H;r=0}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,L(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>r&&(t.adler=j(t.adler,n.pending_buf,n.pending-r,r))}n.status=li}if(n.status===li){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(X(t),n.pending!==0))return n.last_flush=-1,H;L(n,t.adler&255),L(n,t.adler>>8&255),t.adler=0}if(n.status=Dt,X(t),n.pending!==0)return n.last_flush=-1,H}if(t.avail_in!==0||n.lookahead!==0||e!==yt&&n.status!==pe){let r=n.level===0?So(n,e):n.strategy===Ke?Oh(n,e):n.strategy===wh?Rh(n,e):we[n.level].func(n,e);if((r===Pt||r===$t)&&(n.status=pe),r===q||r===Pt)return t.avail_out===0&&(n.last_flush=-1),H;if(r===Xt&&(e===dh?uh(n):e!==vo&&(ei(n,0,0,!1),e===_h&&(bt(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),X(t),t.avail_out===0))return n.last_flush=-1,H}return e!==Y?H:n.wrap<=0?bo:(n.wrap===2?(L(n,t.adler&255),L(n,t.adler>>8&255),L(n,t.adler>>16&255),L(n,t.adler>>24&255),L(n,t.total_in&255),L(n,t.total_in>>8&255),L(n,t.total_in>>16&255),L(n,t.total_in>>24&255)):(me(n,t.adler>>>16),me(n,t.adler&65535)),X(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?H:bo)},Nh=t=>{if(ye(t))return it;const e=t.state.status;return t.state=null,e===Dt?Mt(t,gh):H},jh=(t,e)=>{let n=e.length;if(ye(t))return it;const i=t.state,r=i.wrap;if(r===2||r===1&&i.status!==Gt||i.lookahead)return it;if(r===1&&(t.adler=ge(t.adler,e,n,0)),i.wrap=0,n>=i.w_size){r===0&&(bt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let c=new Uint8Array(i.w_size);c.set(e.subarray(n-i.w_size,n),0),e=c,n=i.w_size}const o=t.avail_in,s=t.next_in,a=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,Vt(i);i.lookahead>=R;){let c=i.strstart,l=i.lookahead-(R-1);do i.ins_h=xt(i,i.ins_h,i.window[c+R-1]),i.prev[c&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=c,c++;while(--l);i.strstart=c,i.lookahead=R-1,Vt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=R-1,i.match_available=0,t.next_in=s,t.input=a,t.avail_in=o,i.wrap=r,H};var Hh=zh,qh=Ao,Zh=ko,Gh=To,Xh=Fh,$h=Bh,Vh=Nh,Yh=jh,Wh="pako deflate (from Nodeca project)",ve={deflateInit:Hh,deflateInit2:qh,deflateReset:Zh,deflateResetKeep:Gh,deflateSetHeader:Xh,deflate:$h,deflateEnd:Vh,deflateSetDictionary:Yh,deflateInfo:Wh};const Kh=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Jh=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const i in n)Kh(n,i)&&(t[i]=n[i])}}return t},Qh=t=>{let e=0;for(let i=0,r=t.length;i<r;i++)e+=t[i].length;const n=new Uint8Array(e);for(let i=0,r=0,o=t.length;i<o;i++){let s=t[i];n.set(s,r),r+=s.length}return n},Qe={assign:Jh,flattenChunks:Qh};let Co=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Co=!1}const be=new Uint8Array(256);for(let t=0;t<256;t++)be[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;be[254]=be[254]=1;var tf=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,i,r,o,s=t.length,a=0;for(r=0;r<s;r++)n=t.charCodeAt(r),(n&64512)===55296&&r+1<s&&(i=t.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(a),o=0,r=0;o<a;r++)n=t.charCodeAt(r),(n&64512)===55296&&r+1<s&&(i=t.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?e[o++]=n:n<2048?(e[o++]=192|n>>>6,e[o++]=128|n&63):n<65536?(e[o++]=224|n>>>12,e[o++]=128|n>>>6&63,e[o++]=128|n&63):(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63,e[o++]=128|n>>>6&63,e[o++]=128|n&63);return e};const ef=(t,e)=>{if(e<65534&&t.subarray&&Co)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let i=0;i<e;i++)n+=String.fromCharCode(t[i]);return n};var nf=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let i,r;const o=new Array(n*2);for(r=0,i=0;i<n;){let s=t[i++];if(s<128){o[r++]=s;continue}let a=be[s];if(a>4){o[r++]=65533,i+=a-1;continue}for(s&=a===2?31:a===3?15:7;a>1&&i<n;)s=s<<6|t[i++]&63,a--;if(a>1){o[r++]=65533;continue}s<65536?o[r++]=s:(s-=65536,o[r++]=55296|s>>10&1023,o[r++]=56320|s&1023)}return ef(o,r)},rf=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+be[t[n]]>e?n:e},xe={string2buf:tf,buf2string:nf,utf8border:rf};function of(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Io=of;const Do=Object.prototype.toString,{Z_NO_FLUSH:sf,Z_SYNC_FLUSH:af,Z_FULL_FLUSH:lf,Z_FINISH:cf,Z_OK:tn,Z_STREAM_END:hf,Z_DEFAULT_COMPRESSION:ff,Z_DEFAULT_STRATEGY:uf,Z_DEFLATED:df}=It;function Ee(t){this.options=Qe.assign({level:ff,method:df,chunkSize:16384,windowBits:15,memLevel:8,strategy:uf},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Io,this.strm.avail_out=0;let n=ve.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==tn)throw new Error(Ct[n]);if(e.header&&ve.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=xe.string2buf(e.dictionary):Do.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,n=ve.deflateSetDictionary(this.strm,i),n!==tn)throw new Error(Ct[n]);this._dict_set=!0}}Ee.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize;let r,o;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?cf:sf,typeof t=="string"?n.input=xe.string2buf(t):Do.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(o===af||o===lf)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(r=ve.deflate(n,o),r===hf)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=ve.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===tn;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},Ee.prototype.onData=function(t){this.chunks.push(t)},Ee.prototype.onEnd=function(t){t===tn&&(this.result=Qe.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function fi(t,e){const n=new Ee(e);if(n.push(t,!0),n.err)throw n.msg||Ct[n.err];return n.result}function _f(t,e){return e=e||{},e.raw=!0,fi(t,e)}function gf(t,e){return e=e||{},e.gzip=!0,fi(t,e)}var pf=Ee,mf=fi,wf=_f,yf=gf,vf=It,bf={Deflate:pf,deflate:mf,deflateRaw:wf,gzip:yf,constants:vf};const en=16209,xf=16191;var Ef=function(e,n){let i,r,o,s,a,c,l,f,u,d,h,_,p,g,m,y,b,v,E,x,S,C,k,A;const D=e.state;i=e.next_in,k=e.input,r=i+(e.avail_in-5),o=e.next_out,A=e.output,s=o-(n-e.avail_out),a=o+(e.avail_out-257),c=D.dmax,l=D.wsize,f=D.whave,u=D.wnext,d=D.window,h=D.hold,_=D.bits,p=D.lencode,g=D.distcode,m=(1<<D.lenbits)-1,y=(1<<D.distbits)-1;t:do{_<15&&(h+=k[i++]<<_,_+=8,h+=k[i++]<<_,_+=8),b=p[h&m];e:for(;;){if(v=b>>>24,h>>>=v,_-=v,v=b>>>16&255,v===0)A[o++]=b&65535;else if(v&16){E=b&65535,v&=15,v&&(_<v&&(h+=k[i++]<<_,_+=8),E+=h&(1<<v)-1,h>>>=v,_-=v),_<15&&(h+=k[i++]<<_,_+=8,h+=k[i++]<<_,_+=8),b=g[h&y];n:for(;;){if(v=b>>>24,h>>>=v,_-=v,v=b>>>16&255,v&16){if(x=b&65535,v&=15,_<v&&(h+=k[i++]<<_,_+=8,_<v&&(h+=k[i++]<<_,_+=8)),x+=h&(1<<v)-1,x>c){e.msg="invalid distance too far back",D.mode=en;break t}if(h>>>=v,_-=v,v=o-s,x>v){if(v=x-v,v>f&&D.sane){e.msg="invalid distance too far back",D.mode=en;break t}if(S=0,C=d,u===0){if(S+=l-v,v<E){E-=v;do A[o++]=d[S++];while(--v);S=o-x,C=A}}else if(u<v){if(S+=l+u-v,v-=u,v<E){E-=v;do A[o++]=d[S++];while(--v);if(S=0,u<E){v=u,E-=v;do A[o++]=d[S++];while(--v);S=o-x,C=A}}}else if(S+=u-v,v<E){E-=v;do A[o++]=d[S++];while(--v);S=o-x,C=A}for(;E>2;)A[o++]=C[S++],A[o++]=C[S++],A[o++]=C[S++],E-=3;E&&(A[o++]=C[S++],E>1&&(A[o++]=C[S++]))}else{S=o-x;do A[o++]=A[S++],A[o++]=A[S++],A[o++]=A[S++],E-=3;while(E>2);E&&(A[o++]=A[S++],E>1&&(A[o++]=A[S++]))}}else if(v&64){e.msg="invalid distance code",D.mode=en;break t}else{b=g[(b&65535)+(h&(1<<v)-1)];continue n}break}}else if(v&64)if(v&32){D.mode=xf;break t}else{e.msg="invalid literal/length code",D.mode=en;break t}else{b=p[(b&65535)+(h&(1<<v)-1)];continue e}break}}while(i<r&&o<a);E=_>>3,i-=E,_-=E<<3,h&=(1<<_)-1,e.next_in=i,e.next_out=o,e.avail_in=i<r?5+(r-i):5-(i-r),e.avail_out=o<a?257+(a-o):257-(o-a),D.hold=h,D.bits=_};const Wt=15,Po=852,Mo=592,Ro=0,ui=1,Oo=2,Sf=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Tf=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),kf=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Af=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Se=(t,e,n,i,r,o,s,a)=>{const c=a.bits;let l=0,f=0,u=0,d=0,h=0,_=0,p=0,g=0,m=0,y=0,b,v,E,x,S,C=null,k;const A=new Uint16Array(Wt+1),D=new Uint16Array(Wt+1);let P=null,U,z,M;for(l=0;l<=Wt;l++)A[l]=0;for(f=0;f<i;f++)A[e[n+f]]++;for(h=c,d=Wt;d>=1&&A[d]===0;d--);if(h>d&&(h=d),d===0)return r[o++]=1<<24|64<<16|0,r[o++]=1<<24|64<<16|0,a.bits=1,0;for(u=1;u<d&&A[u]===0;u++);for(h<u&&(h=u),g=1,l=1;l<=Wt;l++)if(g<<=1,g-=A[l],g<0)return-1;if(g>0&&(t===Ro||d!==1))return-1;for(D[1]=0,l=1;l<Wt;l++)D[l+1]=D[l]+A[l];for(f=0;f<i;f++)e[n+f]!==0&&(s[D[e[n+f]]++]=f);if(t===Ro?(C=P=s,k=20):t===ui?(C=Sf,P=Tf,k=257):(C=kf,P=Af,k=0),y=0,f=0,l=u,S=o,_=h,p=0,E=-1,m=1<<h,x=m-1,t===ui&&m>Po||t===Oo&&m>Mo)return 1;for(;;){U=l-p,s[f]+1<k?(z=0,M=s[f]):s[f]>=k?(z=P[s[f]-k],M=C[s[f]-k]):(z=32+64,M=0),b=1<<l-p,v=1<<_,u=v;do v-=b,r[S+(y>>p)+v]=U<<24|z<<16|M|0;while(v!==0);for(b=1<<l-1;y&b;)b>>=1;if(b!==0?(y&=b-1,y+=b):y=0,f++,--A[l]===0){if(l===d)break;l=e[n+s[f]]}if(l>h&&(y&x)!==E){for(p===0&&(p=h),S+=u,_=l-p,g=1<<_;_+p<d&&(g-=A[_+p],!(g<=0));)_++,g<<=1;if(m+=1<<_,t===ui&&m>Po||t===Oo&&m>Mo)return 1;E=y&x,r[E]=h<<24|_<<16|S-o|0}}return y!==0&&(r[S+y]=l-p<<24|64<<16|0),a.bits=h,0};const Cf=0,Lo=1,Uo=2,{Z_FINISH:Fo,Z_BLOCK:If,Z_TREES:nn,Z_OK:Rt,Z_STREAM_END:Df,Z_NEED_DICT:Pf,Z_STREAM_ERROR:W,Z_DATA_ERROR:zo,Z_MEM_ERROR:Bo,Z_BUF_ERROR:Mf,Z_DEFLATED:No}=It,rn=16180,jo=16181,Ho=16182,qo=16183,Zo=16184,Go=16185,Xo=16186,$o=16187,Vo=16188,Yo=16189,on=16190,ht=16191,di=16192,Wo=16193,_i=16194,Ko=16195,Jo=16196,Qo=16197,ts=16198,sn=16199,an=16200,es=16201,ns=16202,is=16203,rs=16204,os=16205,gi=16206,ss=16207,as=16208,B=16209,ls=16210,cs=16211,Rf=852,Of=592,Lf=15,hs=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function Uf(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ot=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<rn||e.mode>cs?1:0},fs=t=>{if(Ot(t))return W;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=rn,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Rf),e.distcode=e.distdyn=new Int32Array(Of),e.sane=1,e.back=-1,Rt},us=t=>{if(Ot(t))return W;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,fs(t)},ds=(t,e)=>{let n;if(Ot(t))return W;const i=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?W:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,us(t))},_s=(t,e)=>{if(!t)return W;const n=new Uf;t.state=n,n.strm=t,n.window=null,n.mode=rn;const i=ds(t,e);return i!==Rt&&(t.state=null),i},Ff=t=>_s(t,Lf);let gs=!0,pi,mi;const zf=t=>{if(gs){pi=new Int32Array(512),mi=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Se(Lo,t.lens,0,288,pi,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Se(Uo,t.lens,0,32,mi,0,t.work,{bits:5}),gs=!1}t.lencode=pi,t.lenbits=9,t.distcode=mi,t.distbits=5},ps=(t,e,n,i)=>{let r;const o=t.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),i>=o.wsize?(o.window.set(e.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>i&&(r=i),o.window.set(e.subarray(n-i,n-i+r),o.wnext),i-=r,i?(o.window.set(e.subarray(n-i,n),0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0},Bf=(t,e)=>{let n,i,r,o,s,a,c,l,f,u,d,h,_,p,g=0,m,y,b,v,E,x,S,C;const k=new Uint8Array(4);let A,D;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ot(t)||!t.output||!t.input&&t.avail_in!==0)return W;n=t.state,n.mode===ht&&(n.mode=di),s=t.next_out,r=t.output,c=t.avail_out,o=t.next_in,i=t.input,a=t.avail_in,l=n.hold,f=n.bits,u=a,d=c,C=Rt;t:for(;;)switch(n.mode){case rn:if(n.wrap===0){n.mode=di;break}for(;f<16;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,k[0]=l&255,k[1]=l>>>8&255,n.check=j(n.check,k,2,0),l=0,f=0,n.mode=jo;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){t.msg="incorrect header check",n.mode=B;break}if((l&15)!==No){t.msg="unknown compression method",n.mode=B;break}if(l>>>=4,f-=4,S=(l&15)+8,n.wbits===0&&(n.wbits=S),S>15||S>n.wbits){t.msg="invalid window size",n.mode=B;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=l&512?Yo:ht,l=0,f=0;break;case jo:for(;f<16;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}if(n.flags=l,(n.flags&255)!==No){t.msg="unknown compression method",n.mode=B;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=B;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(k[0]=l&255,k[1]=l>>>8&255,n.check=j(n.check,k,2,0)),l=0,f=0,n.mode=Ho;case Ho:for(;f<32;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}n.head&&(n.head.time=l),n.flags&512&&n.wrap&4&&(k[0]=l&255,k[1]=l>>>8&255,k[2]=l>>>16&255,k[3]=l>>>24&255,n.check=j(n.check,k,4,0)),l=0,f=0,n.mode=qo;case qo:for(;f<16;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(k[0]=l&255,k[1]=l>>>8&255,n.check=j(n.check,k,2,0)),l=0,f=0,n.mode=Zo;case Zo:if(n.flags&1024){for(;f<16;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(k[0]=l&255,k[1]=l>>>8&255,n.check=j(n.check,k,2,0)),l=0,f=0}else n.head&&(n.head.extra=null);n.mode=Go;case Go:if(n.flags&1024&&(h=n.length,h>a&&(h=a),h&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(o,o+h),S)),n.flags&512&&n.wrap&4&&(n.check=j(n.check,i,h,o)),a-=h,o+=h,n.length-=h),n.length))break t;n.length=0,n.mode=Xo;case Xo:if(n.flags&2048){if(a===0)break t;h=0;do S=i[o+h++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S));while(S&&h<a);if(n.flags&512&&n.wrap&4&&(n.check=j(n.check,i,h,o)),a-=h,o+=h,S)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=$o;case $o:if(n.flags&4096){if(a===0)break t;h=0;do S=i[o+h++],n.head&&S&&n.length<65536&&(n.head.comment+=String.fromCharCode(S));while(S&&h<a);if(n.flags&512&&n.wrap&4&&(n.check=j(n.check,i,h,o)),a-=h,o+=h,S)break t}else n.head&&(n.head.comment=null);n.mode=Vo;case Vo:if(n.flags&512){for(;f<16;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}if(n.wrap&4&&l!==(n.check&65535)){t.msg="header crc mismatch",n.mode=B;break}l=0,f=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=ht;break;case Yo:for(;f<32;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}t.adler=n.check=hs(l),l=0,f=0,n.mode=on;case on:if(n.havedict===0)return t.next_out=s,t.avail_out=c,t.next_in=o,t.avail_in=a,n.hold=l,n.bits=f,Pf;t.adler=n.check=1,n.mode=ht;case ht:if(e===If||e===nn)break t;case di:if(n.last){l>>>=f&7,f-=f&7,n.mode=gi;break}for(;f<3;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}switch(n.last=l&1,l>>>=1,f-=1,l&3){case 0:n.mode=Wo;break;case 1:if(zf(n),n.mode=sn,e===nn){l>>>=2,f-=2;break t}break;case 2:n.mode=Jo;break;case 3:t.msg="invalid block type",n.mode=B}l>>>=2,f-=2;break;case Wo:for(l>>>=f&7,f-=f&7;f<32;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}if((l&65535)!==(l>>>16^65535)){t.msg="invalid stored block lengths",n.mode=B;break}if(n.length=l&65535,l=0,f=0,n.mode=_i,e===nn)break t;case _i:n.mode=Ko;case Ko:if(h=n.length,h){if(h>a&&(h=a),h>c&&(h=c),h===0)break t;r.set(i.subarray(o,o+h),s),a-=h,o+=h,c-=h,s+=h,n.length-=h;break}n.mode=ht;break;case Jo:for(;f<14;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}if(n.nlen=(l&31)+257,l>>>=5,f-=5,n.ndist=(l&31)+1,l>>>=5,f-=5,n.ncode=(l&15)+4,l>>>=4,f-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=B;break}n.have=0,n.mode=Qo;case Qo:for(;n.have<n.ncode;){for(;f<3;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}n.lens[P[n.have++]]=l&7,l>>>=3,f-=3}for(;n.have<19;)n.lens[P[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,A={bits:n.lenbits},C=Se(Cf,n.lens,0,19,n.lencode,0,n.work,A),n.lenbits=A.bits,C){t.msg="invalid code lengths set",n.mode=B;break}n.have=0,n.mode=ts;case ts:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],m=g>>>24,y=g>>>16&255,b=g&65535,!(m<=f);){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}if(b<16)l>>>=m,f-=m,n.lens[n.have++]=b;else{if(b===16){for(D=m+2;f<D;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}if(l>>>=m,f-=m,n.have===0){t.msg="invalid bit length repeat",n.mode=B;break}S=n.lens[n.have-1],h=3+(l&3),l>>>=2,f-=2}else if(b===17){for(D=m+3;f<D;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}l>>>=m,f-=m,S=0,h=3+(l&7),l>>>=3,f-=3}else{for(D=m+7;f<D;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}l>>>=m,f-=m,S=0,h=11+(l&127),l>>>=7,f-=7}if(n.have+h>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=B;break}for(;h--;)n.lens[n.have++]=S}}if(n.mode===B)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=B;break}if(n.lenbits=9,A={bits:n.lenbits},C=Se(Lo,n.lens,0,n.nlen,n.lencode,0,n.work,A),n.lenbits=A.bits,C){t.msg="invalid literal/lengths set",n.mode=B;break}if(n.distbits=6,n.distcode=n.distdyn,A={bits:n.distbits},C=Se(Uo,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,A),n.distbits=A.bits,C){t.msg="invalid distances set",n.mode=B;break}if(n.mode=sn,e===nn)break t;case sn:n.mode=an;case an:if(a>=6&&c>=258){t.next_out=s,t.avail_out=c,t.next_in=o,t.avail_in=a,n.hold=l,n.bits=f,Ef(t,d),s=t.next_out,r=t.output,c=t.avail_out,o=t.next_in,i=t.input,a=t.avail_in,l=n.hold,f=n.bits,n.mode===ht&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],m=g>>>24,y=g>>>16&255,b=g&65535,!(m<=f);){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}if(y&&!(y&240)){for(v=m,E=y,x=b;g=n.lencode[x+((l&(1<<v+E)-1)>>v)],m=g>>>24,y=g>>>16&255,b=g&65535,!(v+m<=f);){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}l>>>=v,f-=v,n.back+=v}if(l>>>=m,f-=m,n.back+=m,n.length=b,y===0){n.mode=os;break}if(y&32){n.back=-1,n.mode=ht;break}if(y&64){t.msg="invalid literal/length code",n.mode=B;break}n.extra=y&15,n.mode=es;case es:if(n.extra){for(D=n.extra;f<D;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,f-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=ns;case ns:for(;g=n.distcode[l&(1<<n.distbits)-1],m=g>>>24,y=g>>>16&255,b=g&65535,!(m<=f);){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}if(!(y&240)){for(v=m,E=y,x=b;g=n.distcode[x+((l&(1<<v+E)-1)>>v)],m=g>>>24,y=g>>>16&255,b=g&65535,!(v+m<=f);){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}l>>>=v,f-=v,n.back+=v}if(l>>>=m,f-=m,n.back+=m,y&64){t.msg="invalid distance code",n.mode=B;break}n.offset=b,n.extra=y&15,n.mode=is;case is:if(n.extra){for(D=n.extra;f<D;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,f-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=B;break}n.mode=rs;case rs:if(c===0)break t;if(h=d-c,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=B;break}h>n.wnext?(h-=n.wnext,_=n.wsize-h):_=n.wnext-h,h>n.length&&(h=n.length),p=n.window}else p=r,_=s-n.offset,h=n.length;h>c&&(h=c),c-=h,n.length-=h;do r[s++]=p[_++];while(--h);n.length===0&&(n.mode=an);break;case os:if(c===0)break t;r[s++]=n.length,c--,n.mode=an;break;case gi:if(n.wrap){for(;f<32;){if(a===0)break t;a--,l|=i[o++]<<f,f+=8}if(d-=c,t.total_out+=d,n.total+=d,n.wrap&4&&d&&(t.adler=n.check=n.flags?j(n.check,r,d,s-d):ge(n.check,r,d,s-d)),d=c,n.wrap&4&&(n.flags?l:hs(l))!==n.check){t.msg="incorrect data check",n.mode=B;break}l=0,f=0}n.mode=ss;case ss:if(n.wrap&&n.flags){for(;f<32;){if(a===0)break t;a--,l+=i[o++]<<f,f+=8}if(n.wrap&4&&l!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=B;break}l=0,f=0}n.mode=as;case as:C=Df;break t;case B:C=zo;break t;case ls:return Bo;case cs:default:return W}return t.next_out=s,t.avail_out=c,t.next_in=o,t.avail_in=a,n.hold=l,n.bits=f,(n.wsize||d!==t.avail_out&&n.mode<B&&(n.mode<gi||e!==Fo))&&ps(t,t.output,t.next_out,d-t.avail_out),u-=t.avail_in,d-=t.avail_out,t.total_in+=u,t.total_out+=d,n.total+=d,n.wrap&4&&d&&(t.adler=n.check=n.flags?j(n.check,r,d,t.next_out-d):ge(n.check,r,d,t.next_out-d)),t.data_type=n.bits+(n.last?64:0)+(n.mode===ht?128:0)+(n.mode===sn||n.mode===_i?256:0),(u===0&&d===0||e===Fo)&&C===Rt&&(C=Mf),C},Nf=t=>{if(Ot(t))return W;let e=t.state;return e.window&&(e.window=null),t.state=null,Rt},jf=(t,e)=>{if(Ot(t))return W;const n=t.state;return n.wrap&2?(n.head=e,e.done=!1,Rt):W},Hf=(t,e)=>{const n=e.length;let i,r,o;return Ot(t)||(i=t.state,i.wrap!==0&&i.mode!==on)?W:i.mode===on&&(r=1,r=ge(r,e,n,0),r!==i.check)?zo:(o=ps(t,e,n,n),o?(i.mode=ls,Bo):(i.havedict=1,Rt))};var qf=us,Zf=ds,Gf=fs,Xf=Ff,$f=_s,Vf=Bf,Yf=Nf,Wf=jf,Kf=Hf,Jf="pako inflate (from Nodeca project)",ft={inflateReset:qf,inflateReset2:Zf,inflateResetKeep:Gf,inflateInit:Xf,inflateInit2:$f,inflate:Vf,inflateEnd:Yf,inflateGetHeader:Wf,inflateSetDictionary:Kf,inflateInfo:Jf};function Qf(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var tu=Qf;const ms=Object.prototype.toString,{Z_NO_FLUSH:eu,Z_FINISH:nu,Z_OK:Te,Z_STREAM_END:wi,Z_NEED_DICT:yi,Z_STREAM_ERROR:iu,Z_DATA_ERROR:ws,Z_MEM_ERROR:ru}=It;function ke(t){this.options=Qe.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Io,this.strm.avail_out=0;let n=ft.inflateInit2(this.strm,e.windowBits);if(n!==Te)throw new Error(Ct[n]);if(this.header=new tu,ft.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=xe.string2buf(e.dictionary):ms.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=ft.inflateSetDictionary(this.strm,e.dictionary),n!==Te)))throw new Error(Ct[n])}ke.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?nu:eu,ms.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),o=ft.inflate(n,s),o===yi&&r&&(o=ft.inflateSetDictionary(n,r),o===Te?o=ft.inflate(n,s):o===ws&&(o=yi));n.avail_in>0&&o===wi&&n.state.wrap>0&&t[n.next_in]!==0;)ft.inflateReset(n),o=ft.inflate(n,s);switch(o){case iu:case ws:case yi:case ru:return this.onEnd(o),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(n.avail_out===0||o===wi))if(this.options.to==="string"){let c=xe.utf8border(n.output,n.next_out),l=n.next_out-c,f=xe.buf2string(n.output,c);n.next_out=l,n.avail_out=i-l,l&&n.output.set(n.output.subarray(c,c+l),0),this.onData(f)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===Te&&a===0)){if(o===wi)return o=ft.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},ke.prototype.onData=function(t){this.chunks.push(t)},ke.prototype.onEnd=function(t){t===Te&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Qe.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function vi(t,e){const n=new ke(e);if(n.push(t),n.err)throw n.msg||Ct[n.err];return n.result}function ou(t,e){return e=e||{},e.raw=!0,vi(t,e)}var su=ke,au=vi,lu=ou,cu=vi,hu=It,fu={Inflate:su,inflate:au,inflateRaw:lu,ungzip:cu,constants:hu};const{Deflate:uu,deflate:du,deflateRaw:_u,gzip:gu}=bf,{Inflate:pu,inflate:mu,inflateRaw:wu,ungzip:yu}=fu;var vu=uu,bu=du,xu=_u,Eu=gu,Su=pu,Tu=mu,ku=wu,Au=yu,Cu=It,Iu={Deflate:vu,deflate:bu,deflateRaw:xu,gzip:Eu,Inflate:Su,inflate:Tu,inflateRaw:ku,ungzip:Au,constants:Cu};const I={};I.toRGBA8=function(t){const e=t.width,n=t.height;if(t.tabs.acTL===null)return[I.toRGBA8.decodeImage(t.data,e,n,t).buffer];const i=[];t.frames[0].data===null&&(t.frames[0].data=t.data);const r=e*n*4,o=new Uint8Array(r),s=new Uint8Array(r),a=new Uint8Array(r);for(let c=0;c<t.frames.length;c++){const l=t.frames[c],f=l.rect.x,u=l.rect.y,d=l.rect.width,h=l.rect.height,_=I.toRGBA8.decodeImage(l.data,d,h,t);if(c!==0)for(let p=0;p<r;p++)a[p]=o[p];if(l.blend===0?I._copyTile(_,d,h,o,e,n,f,u,0):l.blend===1&&I._copyTile(_,d,h,o,e,n,f,u,1),i.push(o.buffer.slice(0)),l.dispose===1)I._copyTile(s,d,h,o,e,n,f,u,0);else if(l.dispose===2)for(let p=0;p<r;p++)o[p]=a[p]}return i},I.toRGBA8.decodeImage=function(t,e,n,i){const r=e*n,o=I.decode._getBPP(i),s=Math.ceil(e*o/8),a=new Uint8Array(r*4),c=new Uint32Array(a.buffer),l=i.ctype,f=i.depth,u=I._bin.readUshort;if(l===6){const d=r<<2;if(f===8)for(let h=0;h<d;h+=4)a[h]=t[h],a[h+1]=t[h+1],a[h+2]=t[h+2],a[h+3]=t[h+3];if(f===16)for(let h=0;h<d;h++)a[h]=t[h<<1]}else if(l===2){const d=i.tabs.tRNS;if(d===null){if(f===8)for(let h=0;h<r;h++){const _=h*3;c[h]=-16777216|t[_+2]<<16|t[_+1]<<8|t[_]}if(f===16)for(let h=0;h<r;h++){const _=h*6;c[h]=-16777216|t[_+4]<<16|t[_+2]<<8|t[_]}}else{const h=d[0],_=d[1],p=d[2];if(f===8)for(let g=0;g<r;g++){const m=g<<2,y=g*3;c[g]=-16777216|t[y+2]<<16|t[y+1]<<8|t[y],t[y]===h&&t[y+1]===_&&t[y+2]===p&&(a[m+3]=0)}if(f===16)for(let g=0;g<r;g++){const m=g<<2,y=g*6;c[g]=-16777216|t[y+4]<<16|t[y+2]<<8|t[y],u(t,y)===h&&u(t,y+2)===_&&u(t,y+4)===p&&(a[m+3]=0)}}}else if(l===3){const d=i.tabs.PLTE,h=i.tabs.tRNS,_=h?h.length:0;if(f===1)for(let p=0;p<n;p++){const g=p*s,m=p*e;for(let y=0;y<e;y++){const b=m+y<<2,v=t[g+(y>>3)]>>7-((y&7)<<0)&1,E=3*v;a[b]=d[E],a[b+1]=d[E+1],a[b+2]=d[E+2],a[b+3]=v<_?h[v]:255}}if(f===2)for(let p=0;p<n;p++){const g=p*s,m=p*e;for(let y=0;y<e;y++){const b=m+y<<2,v=t[g+(y>>2)]>>6-((y&3)<<1)&3,E=3*v;a[b]=d[E],a[b+1]=d[E+1],a[b+2]=d[E+2],a[b+3]=v<_?h[v]:255}}if(f===4)for(let p=0;p<n;p++){const g=p*s,m=p*e;for(let y=0;y<e;y++){const b=m+y<<2,v=t[g+(y>>1)]>>4-((y&1)<<2)&15,E=3*v;a[b]=d[E],a[b+1]=d[E+1],a[b+2]=d[E+2],a[b+3]=v<_?h[v]:255}}if(f===8)for(let p=0;p<r;p++){const g=p<<2,m=t[p],y=3*m;a[g]=d[y],a[g+1]=d[y+1],a[g+2]=d[y+2],a[g+3]=m<_?h[m]:255}}else if(l===4){if(f===8)for(let d=0;d<r;d++){const h=d<<2,_=d<<1,p=t[_];a[h]=p,a[h+1]=p,a[h+2]=p,a[h+3]=t[_+1]}if(f===16)for(let d=0;d<r;d++){const h=d<<2,_=d<<2,p=t[_];a[h]=p,a[h+1]=p,a[h+2]=p,a[h+3]=t[_+2]}}else if(l===0){const d=i.tabs.tRNS?i.tabs.tRNS:-1;for(let h=0;h<n;h++){const _=h*s,p=h*e;if(f===1)for(let g=0;g<e;g++){const m=255*(t[_+(g>>>3)]>>>7-(g&7)&1),y=m===d*255?0:255;c[p+g]=y<<24|m<<16|m<<8|m}else if(f===2)for(let g=0;g<e;g++){const m=85*(t[_+(g>>>2)]>>>6-((g&3)<<1)&3),y=m===d*85?0:255;c[p+g]=y<<24|m<<16|m<<8|m}else if(f===4)for(let g=0;g<e;g++){const m=17*(t[_+(g>>>1)]>>>4-((g&1)<<2)&15),y=m===d*17?0:255;c[p+g]=y<<24|m<<16|m<<8|m}else if(f===8)for(let g=0;g<e;g++){const m=t[_+g],y=m===d?0:255;c[p+g]=y<<24|m<<16|m<<8|m}else if(f===16)for(let g=0;g<e;g++){const m=t[_+(g<<1)],y=u(t,_+(g<<1))===d?0:255;c[p+g]=y<<24|m<<16|m<<8|m}}}return a},I.decode=function(t){const e=new Uint8Array(t);let n=8;const i=I._bin,r=i.readUshort,o=i.readUint,s={tabs:{},frames:[]},a=new Uint8Array(e.length);let c=0,l,f=0;const u=[137,80,78,71,13,10,26,10];for(let d=0;d<8;d++)if(e[d]!==u[d])throw"The input is not a PNG file!";for(;n<e.length;){const d=i.readUint(e,n);n+=4;const h=i.readASCII(e,n,4);if(n+=4,h==="IHDR")I.decode._IHDR(e,n,s);else if(h==="CgBI")s.tabs[h]=e.slice(n,n+4);else if(h==="IDAT"){for(let _=0;_<d;_++)a[c+_]=e[n+_];c+=d}else if(h==="acTL")s.tabs[h]={num_frames:o(e,n),num_plays:o(e,n+4)},l=new Uint8Array(e.length);else if(h==="fcTL"){if(f!==0){const m=s.frames[s.frames.length-1];m.data=I.decode._decompress(s,l.slice(0,f),m.rect.width,m.rect.height),f=0}const _={x:o(e,n+12),y:o(e,n+16),width:o(e,n+4),height:o(e,n+8)};let p=r(e,n+22);p=r(e,n+20)/(p===0?100:p);const g={rect:_,delay:Math.round(p*1e3),dispose:e[n+24],blend:e[n+25]};s.frames.push(g)}else if(h==="fdAT"){for(let _=0;_<d-4;_++)l[f+_]=e[n+_+4];f+=d-4}else if(h==="pHYs")s.tabs[h]=[i.readUint(e,n),i.readUint(e,n+4),e[n+8]];else if(h==="cHRM"){s.tabs[h]=[];for(let _=0;_<8;_++)s.tabs[h].push(i.readUint(e,n+_*4))}else if(h==="tEXt"||h==="zTXt"){s.tabs[h]===null&&(s.tabs[h]={});const _=i.nextZero(e,n),p=i.readASCII(e,n,_-n);let g;const m=n+d-_-1;if(h==="tEXt")g=i.readASCII(e,_+1,m);else{const y=I.decode._inflate(e.slice(_+2,_+2+m));g=i.readUTF8(y,0,y.length)}s.tabs[h][p]=g}else if(h==="iTXt"){s.tabs[h]==null&&(s.tabs[h]={});let _=0,p=n;_=i.nextZero(e,p);const g=i.readASCII(e,p,_-p);p=_+1;const m=e[p];p+=2,_=i.nextZero(e,p),p=_+1,_=i.nextZero(e,p),p=_+1;let y;const b=d-(p-n);if(m===0)y=i.readUTF8(e,p,b);else{const v=I.decode._inflate(e.slice(p,p+b));y=i.readUTF8(v,0,v.length)}s.tabs[h][g]=y}else if(h==="PLTE")s.tabs[h]=i.readBytes(e,n,d);else if(h==="hIST"){const _=s.tabs.PLTE.length/3;s.tabs[h]=[];for(let p=0;p<_;p++)s.tabs[h].push(r(e,n+p*2))}else if(h==="tRNS")s.ctype===3?s.tabs[h]=i.readBytes(e,n,d):s.ctype===0?s.tabs[h]=r(e,n):s.ctype===2&&(s.tabs[h]=[r(e,n),r(e,n+2),r(e,n+4)]);else if(h==="gAMA")s.tabs[h]=i.readUint(e,n)/1e5;else if(h==="sRGB")s.tabs[h]=e[n];else if(h==="bKGD")s.ctype===0||s.ctype===4?s.tabs[h]=[r(e,n)]:s.ctype===2||s.ctype===6?s.tabs[h]=[r(e,n),r(e,n+2),r(e,n+4)]:s.ctype===3&&(s.tabs[h]=e[n]);else if(h==="IEND")break;n+=d,n+=4}if(f!==0){const d=s.frames[s.frames.length-1];d.data=I.decode._decompress(s,l.slice(0,f),d.rect.width,d.rect.height),f=0}return s.data=I.decode._decompress(s,a,s.width,s.height),delete s.compress,delete s.interlace,delete s.filter,s},I.decode._decompress=function(t,e,n,i){const r=I.decode._getBPP(t),o=Math.ceil(n*r/8),s=new Uint8Array((o+1+t.interlace)*i);return t.tabs.CgBI?e=I.inflateRaw(e,s):e=I.decode._inflate(e,s),t.interlace===0?e=I.decode._filterZero(e,t,0,n,i):t.interlace===1&&(e=I.decode._readInterlace(e,t)),e},I.decode._inflate=function(t,e){return I.inflateRaw(new Uint8Array(t.buffer,2,t.length-6),e)},I.inflateRaw=function(){const t={};return t.H={},t.H.N=function(e,n){const i=Uint8Array;let r=0,o=0,s=0,a=0,c=0,l=0,f=0,u=0,d=0,h,_;if(e[0]===3&&e[1]===0)return n||new i(0);const p=t.H,g=p.b,m=p.e,y=p.R,b=p.n,v=p.A,E=p.Z,x=p.m,S=n===null;for(S&&(n=new i(e.length>>>2<<3));r===0;){if(r=g(e,d,1),o=g(e,d+1,2),d+=3,o===0){d&7&&(d+=8-(d&7));const C=(d>>>3)+4,k=e[C-4]|e[C-3]<<8;S&&(n=t.H.W(n,u+k)),n.set(new i(e.buffer,e.byteOffset+C,k),u),d=C+k<<3,u+=k;continue}if(S&&(n=t.H.W(n,u+131072)),o===1&&(h=x.J,_=x.h,l=511,f=31),o===2){s=m(e,d,5)+257,a=m(e,d+5,5)+1,c=m(e,d+10,4)+4,d+=14;let C=1;for(let D=0;D<38;D+=2)x.Q[D]=0,x.Q[D+1]=0;for(let D=0;D<c;D++){const P=m(e,d+D*3,3);x.Q[(x.X[D]<<1)+1]=P,P>C&&(C=P)}d+=3*c,b(x.Q,C),v(x.Q,C,x.u),h=x.w,_=x.d,d=y(x.u,(1<<C)-1,s+a,e,d,x.v);const k=p.V(x.v,0,s,x.C);l=(1<<k)-1;const A=p.V(x.v,s,a,x.D);f=(1<<A)-1,b(x.C,k),v(x.C,k,h),b(x.D,A),v(x.D,A,_)}for(;;){const C=h[E(e,d)&l];d+=C&15;const k=C>>>4;if(!(k>>>8))n[u++]=k;else{if(k===256)break;{let A=u+k-254;if(k>264){const M=x.q[k-257];A=u+(M>>>3)+m(e,d,M&7),d+=M&7}const D=_[E(e,d)&f];d+=D&15;const P=D>>>4,U=x.c[P],z=(U>>>4)+g(e,d,U&15);for(d+=U&15;u<A;)n[u]=n[u++-z],n[u]=n[u++-z],n[u]=n[u++-z],n[u]=n[u++-z];u=A}}}}return n.length===u?n:n.slice(0,u)},t.H.W=function(e,n){const i=e.length;if(n<=i)return e;const r=new Uint8Array(i<<1);return r.set(e,0),r},t.H.R=function(e,n,i,r,o,s){const a=t.H.e,c=t.H.Z;let l=0;for(;l<i;){const f=e[c(r,o)&n];o+=f&15;const u=f>>>4;if(u<=15)s[l]=u,l++;else{let d=0,h=0;u===16?(h=3+a(r,o,2),o+=2,d=s[l-1]):u===17?(h=3+a(r,o,3),o+=3):u===18&&(h=11+a(r,o,7),o+=7);const _=l+h;for(;l<_;)s[l]=d,l++}}return o},t.H.V=function(e,n,i,r){let o=0,s=0;const a=r.length>>>1;for(;s<i;){const c=e[s+n];r[s<<1]=0,r[(s<<1)+1]=c,c>o&&(o=c),s++}for(;s<a;)r[s<<1]=0,r[(s<<1)+1]=0,s++;return o},t.H.n=function(e,n){const i=t.H.m,r=e.length;let o,s,a,c,l;const f=i.j;for(let d=0;d<=n;d++)f[d]=0;for(c=1;c<r;c+=2)f[e[c]]++;const u=i.K;for(o=0,f[0]=0,s=1;s<=n;s++)o=o+f[s-1]<<1,u[s]=o;for(a=0;a<r;a+=2)l=e[a+1],l!==0&&(e[a]=u[l],u[l]++)},t.H.A=function(e,n,i){const r=e.length,s=t.H.m.r;for(let a=0;a<r;a+=2)if(e[a+1]!==0){const c=a>>1,l=e[a+1],f=c<<4|l,u=n-l;let d=e[a]<<u;const h=d+(1<<u);for(;d!==h;){const _=s[d]>>>15-n;i[_]=f,d++}}},t.H.l=function(e,n){const i=t.H.m.r,r=15-n;for(let o=0;o<e.length;o+=2){const s=e[o]<<n-e[o+1];e[o]=i[s]>>>r}},t.H.M=function(e,n,i){i=i<<(n&7);const r=n>>>3;e[r]|=i,e[r+1]|=i>>>8},t.H.I=function(e,n,i){i=i<<(n&7);const r=n>>>3;e[r]|=i,e[r+1]|=i>>>8,e[r+2]|=i>>>16},t.H.e=function(e,n,i){return(e[n>>>3]|e[(n>>>3)+1]<<8)>>>(n&7)&(1<<i)-1},t.H.b=function(e,n,i){return(e[n>>>3]|e[(n>>>3)+1]<<8|e[(n>>>3)+2]<<16)>>>(n&7)&(1<<i)-1},t.H.Z=function(e,n){return(e[n>>>3]|e[(n>>>3)+1]<<8|e[(n>>>3)+2]<<16)>>>(n&7)},t.H.i=function(e,n){return(e[n>>>3]|e[(n>>>3)+1]<<8|e[(n>>>3)+2]<<16|e[(n>>>3)+3]<<24)>>>(n&7)},t.H.m=function(){const e=Uint16Array,n=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new n(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new n(286),Y:new n(30),a:new n(19),t:new n(15e3),k:new e(65536),g:new e(32768)}}(),function(){const e=t.H.m,n=32768;for(let r=0;r<n;r++){let o=r;o=(o&2863311530)>>>1|(o&1431655765)<<1,o=(o&3435973836)>>>2|(o&858993459)<<2,o=(o&4042322160)>>>4|(o&252645135)<<4,o=(o&4278255360)>>>8|(o&16711935)<<8,e.r[r]=(o>>>16|o<<16)>>>17}function i(r,o,s){for(;o--!==0;)r.push(0,s)}for(let r=0;r<32;r++)e.q[r]=e.S[r]<<3|e.T[r],e.c[r]=e.p[r]<<4|e.z[r];i(e._,144,8),i(e._,112,9),i(e._,24,7),i(e._,8,8),t.H.n(e._,9),t.H.A(e._,9,e.J),t.H.l(e._,9),i(e.$,32,5),t.H.n(e.$,5),t.H.A(e.$,5,e.h),t.H.l(e.$,5),i(e.Q,19,0),i(e.C,286,0),i(e.D,30,0),i(e.v,320,0)}(),t.H.N}(),I.decode._readInterlace=function(t,e){const n=e.width,i=e.height,r=I.decode._getBPP(e),o=r>>3,s=Math.ceil(n*r/8),a=new Uint8Array(i*s);let c=0;const l=[0,0,4,0,2,0,1],f=[0,4,0,2,0,1,0],u=[8,8,8,4,4,2,2],d=[8,8,4,4,2,2,1];let h=0;for(;h<7;){const _=u[h],p=d[h];let g=0,m=0,y=l[h];for(;y<i;)y+=_,m++;let b=f[h];for(;b<n;)b+=p,g++;const v=Math.ceil(g*r/8);I.decode._filterZero(t,e,c,g,m);let E=0,x=l[h];for(;x<i;){let S=f[h],C=c+E*v<<3;for(;S<n;){if(r===1){let k=t[C>>3];k=k>>7-(C&7)&1,a[x*s+(S>>3)]|=k<<7-((S&7)<<0)}if(r===2){let k=t[C>>3];k=k>>6-(C&7)&3,a[x*s+(S>>2)]|=k<<6-((S&3)<<1)}if(r===4){let k=t[C>>3];k=k>>4-(C&7)&15,a[x*s+(S>>1)]|=k<<4-((S&1)<<2)}if(r>=8){const k=x*s+S*o;for(let A=0;A<o;A++)a[k+A]=t[(C>>3)+A]}C+=r,S+=p}E++,x+=_}g*m!==0&&(c+=m*(1+v)),h=h+1}return a},I.decode._getBPP=function(t){return[1,null,3,1,2,null,4][t.ctype]*t.depth},I.decode._filterZero=function(t,e,n,i,r){let o=I.decode._getBPP(e);const s=Math.ceil(i*o/8),a=I.decode._paeth;o=Math.ceil(o/8);let c=0,l=1,f=t[n],u=0;if(f>1&&(t[n]=[0,0,1][f-2]),f===3)for(u=o;u<s;u++)t[u+1]=t[u+1]+(t[u+1-o]>>>1)&255;for(let d=0;d<r;d++)if(c=n+d*s,l=c+d+1,f=t[l-1],u=0,f===0)for(;u<s;u++)t[c+u]=t[l+u];else if(f===1){for(;u<o;u++)t[c+u]=t[l+u];for(;u<s;u++)t[c+u]=t[l+u]+t[c+u-o]}else if(f===2)for(;u<s;u++)t[c+u]=t[l+u]+t[c+u-s];else if(f===3){for(;u<o;u++)t[c+u]=t[l+u]+(t[c+u-s]>>>1);for(;u<s;u++)t[c+u]=t[l+u]+(t[c+u-s]+t[c+u-o]>>>1)}else{for(;u<o;u++)t[c+u]=t[l+u]+a(0,t[c+u-s],0);for(;u<s;u++)t[c+u]=t[l+u]+a(t[c+u-o],t[c+u-s],t[c+u-o-s])}return t},I.decode._paeth=function(t,e,n){const i=t+e-n,r=i-t,o=i-e,s=i-n;return r*r<=o*o&&r*r<=s*s?t:o*o<=s*s?e:n},I.decode._IHDR=function(t,e,n){const i=I._bin;n.width=i.readUint(t,e),e+=4,n.height=i.readUint(t,e),e+=4,n.depth=t[e],e++,n.ctype=t[e],e++,n.compress=t[e],e++,n.filter=t[e],e++,n.interlace=t[e],e++},I._bin={nextZero:function(t,e){for(;t[e]!==0;)e++;return e},readUshort:function(t,e){return t[e]<<8|t[e+1]},writeUshort:function(t,e,n){t[e]=n>>8&255,t[e+1]=n&255},readUint:function(t,e){return t[e]*16777216+(t[e+1]<<16|t[e+2]<<8|t[e+3])},writeUint:function(t,e,n){t[e]=n>>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=n&255},readASCII:function(t,e,n){let i="";for(let r=0;r<n;r++)i+=String.fromCharCode(t[e+r]);return i},writeASCII:function(t,e,n){for(let i=0;i<n.length;i++)t[e+i]=n.charCodeAt(i)},readBytes:function(t,e,n){const i=[];for(let r=0;r<n;r++)i.push(t[e+r]);return i},pad:function(t){return t.length<2?"0"+t:t},readUTF8:function(t,e,n){let i="",r;for(let o=0;o<n;o++)i+="%"+I._bin.pad(t[e+o].toString(16));try{r=decodeURIComponent(i)}catch{return I._bin.readASCII(t,e,n)}return r}},I._copyTile=function(t,e,n,i,r,o,s,a,c){const l=Math.min(e,r),f=Math.min(n,o);let u=0,d=0;for(let h=0;h<f;h++)for(let _=0;_<l;_++)if(s>=0&&a>=0?(u=h*e+_<<2,d=(a+h)*r+s+_<<2):(u=(-a+h)*e-s+_<<2,d=h*r+_<<2),c===0)i[d]=t[u],i[d+1]=t[u+1],i[d+2]=t[u+2],i[d+3]=t[u+3];else if(c===1){const p=t[u+3]*.00392156862745098,g=t[u]*p,m=t[u+1]*p,y=t[u+2]*p,b=i[d+3]*(1/255),v=i[d]*b,E=i[d+1]*b,x=i[d+2]*b,S=1-p,C=p+b*S,k=C===0?0:1/C;i[d+3]=255*C,i[d+0]=(g+v*S)*k,i[d+1]=(m+E*S)*k,i[d+2]=(y+x*S)*k}else if(c===2){const p=t[u+3],g=t[u],m=t[u+1],y=t[u+2],b=i[d+3],v=i[d],E=i[d+1],x=i[d+2];p===b&&g===v&&m===E&&y===x?(i[d]=0,i[d+1]=0,i[d+2]=0,i[d+3]=0):(i[d]=g,i[d+1]=m,i[d+2]=y,i[d+3]=p)}else if(c===3){const p=t[u+3],g=t[u],m=t[u+1],y=t[u+2],b=i[d+3],v=i[d],E=i[d+1],x=i[d+2];if(p===b&&g===v&&m===E&&y===x)continue;if(p<220&&b>20)return!1}return!0},I.encode=function(t,e,n,i,r,o,s){i===null&&(i=0),s===null&&(s=!1);const a=I.encode.compress(t,e,n,i,[!1,!1,!1,0,s]);return I.encode.compressPNG(a,-1),I.encode._main(a,e,n,r,o)},I.encodeLL=function(t,e,n,i,r,o,s,a){const c={ctype:0+(i===1?0:2)+(r===0?0:4),depth:o,frames:[]},l=(i+r)*o,f=l*e;for(let d=0;d<t.length;d++)c.frames.push({rect:{x:0,y:0,width:e,height:n},img:new Uint8Array(t[d]),blend:0,dispose:1,bpp:Math.ceil(l/8),bpl:Math.ceil(f/8)});return I.encode.compressPNG(c,0,!0),I.encode._main(c,e,n,s,a)},I.encode._main=function(t,e,n,i,r){r||(r={});const o=I.crc.crc,s=I._bin.writeUint,a=I._bin.writeUshort,c=I._bin.writeASCII;let l=8;const f=t.frames.length>1;let u=!1,d=8+(16+5+4)+(f?20:0);if(r.sRGB!==null&&r.sRGB!==void 0&&(d+=13),r.pHYs!==null&&r.pHYs!==void 0&&(d+=21),t.ctype===3){const g=t.plte.length;for(let m=0;m<g;m++)t.plte[m]>>>24!==255&&(u=!0);d+=8+g*3+4+(u?8+g*1+4:0)}for(let g=0;g<t.frames.length;g++){const m=t.frames[g];f&&(d+=38),d+=m.cimg.length+12,g!==0&&(d+=4)}d+=12;const h=new Uint8Array(d),_=[137,80,78,71,13,10,26,10];for(let g=0;g<8;g++)h[g]=_[g];if(s(h,l,13),l+=4,c(h,l,"IHDR"),l+=4,s(h,l,e),l+=4,s(h,l,n),l+=4,h[l]=t.depth,l++,h[l]=t.ctype,l++,h[l]=0,l++,h[l]=0,l++,h[l]=0,l++,s(h,l,o(h,l-17,17)),l+=4,r.sRGB!==null&&r.sRGB!==void 0&&(s(h,l,1),l+=4,c(h,l,"sRGB"),l+=4,h[l]=r.sRGB,l++,s(h,l,o(h,l-5,5)),l+=4),r.pHYs!==null&&r.pHYs!==void 0&&(s(h,l,9),l+=4,c(h,l,"pHYs"),l+=4,s(h,l,r.pHYs[0]),l+=4,s(h,l,r.pHYs[1]),l+=4,h[l]=r.pHYs[2],l++,s(h,l,o(h,l-13,13)),l+=4),f&&(s(h,l,8),l+=4,c(h,l,"acTL"),l+=4,s(h,l,t.frames.length),l+=4,s(h,l,r.loop!=null?r.loop:0),l+=4,s(h,l,o(h,l-12,12)),l+=4),t.ctype===3){const g=t.plte.length;s(h,l,g*3),l+=4,c(h,l,"PLTE"),l+=4;for(let m=0;m<g;m++){const y=m*3,b=t.plte[m],v=b&255,E=b>>>8&255,x=b>>>16&255;h[l+y+0]=v,h[l+y+1]=E,h[l+y+2]=x}if(l+=g*3,s(h,l,o(h,l-g*3-4,g*3+4)),l+=4,u){s(h,l,g),l+=4,c(h,l,"tRNS"),l+=4;for(let m=0;m<g;m++)h[l+m]=t.plte[m]>>>24&255;l+=g,s(h,l,o(h,l-g-4,g+4)),l+=4}}let p=0;for(let g=0;g<t.frames.length;g++){const m=t.frames[g];f&&(s(h,l,26),l+=4,c(h,l,"fcTL"),l+=4,s(h,l,p++),l+=4,s(h,l,m.rect.width),l+=4,s(h,l,m.rect.height),l+=4,s(h,l,m.rect.x),l+=4,s(h,l,m.rect.y),l+=4,a(h,l,i[g]),l+=2,a(h,l,1e3),l+=2,h[l]=m.dispose,l++,h[l]=m.blend,l++,s(h,l,o(h,l-30,30)),l+=4);const y=m.cimg,b=y.length;s(h,l,b+(g===0?0:4)),l+=4;const v=l;c(h,l,g===0?"IDAT":"fdAT"),l+=4,g!==0&&(s(h,l,p++),l+=4),h.set(y,l),l+=b,s(h,l,o(h,v,l-v)),l+=4}return s(h,l,0),l+=4,c(h,l,"IEND"),l+=4,s(h,l,o(h,l-4,4)),l+=4,h.buffer},I.encode.compressPNG=function(t,e,n){for(let i=0;i<t.frames.length;i++){const r=t.frames[i],o=r.rect.height,s=new Uint8Array(o*r.bpl+o);r.cimg=I.encode._filterZero(r.img,o,r.bpp,r.bpl,s,e,n)}},I.encode.compress=function(t,e,n,i,r){const o=r[0],s=r[1],a=r[2],c=r[3],l=r[4];let f=6,u=8,d=255;for(let b=0;b<t.length;b++){const v=new Uint8Array(t[b]),E=v.length;for(let x=0;x<E;x+=4)d&=v[x+3]}const h=d!==255,_=I.encode.framize(t,e,n,o,s,a),p={},g=[],m=[];if(i!==0){const b=[];for(let C=0;C<_.length;C++)b.push(_[C].img.buffer);const v=I.encode.concatRGBA(b),E=I.quantize(v,i);let x=0;const S=new Uint8Array(E.abuf);for(let C=0;C<_.length;C++){const k=_[C].img,A=k.length;m.push(new Uint8Array(E.inds.buffer,x>>2,A>>2));for(let D=0;D<A;D+=4)k[D]=S[x+D],k[D+1]=S[x+D+1],k[D+2]=S[x+D+2],k[D+3]=S[x+D+3];x+=A}for(let C=0;C<E.plte.length;C++)g.push(E.plte[C].est.rgba)}else for(let b=0;b<_.length;b++){const v=_[b],E=new Uint32Array(v.img.buffer),x=v.rect.width,S=E.length,C=new Uint8Array(S);m.push(C);for(let k=0;k<S;k++){const A=E[k];if(k!==0&&A===E[k-1])C[k]=C[k-1];else if(k>x&&A===E[k-x])C[k]=C[k-x];else{let D=p[A];if(D===null&&(p[A]=D=g.length,g.push(A),g.length>=300))break;C[k]=D}}}const y=g.length;y<=256&&l===!1&&(y<=2?u=1:y<=4?u=2:y<=16?u=4:u=8,u=Math.max(u,c));for(let b=0;b<_.length;b++){const v=_[b],E=v.rect.width,x=v.rect.height;let S=v.img,C=4*E,k=4;if(y<=256&&l===!1){C=Math.ceil(u*E/8);const A=new Uint8Array(C*x),D=m[b];for(let P=0;P<x;P++){const U=P*C,z=P*E;if(u===8)for(let M=0;M<E;M++)A[U+M]=D[z+M];else if(u===4)for(let M=0;M<E;M++)A[U+(M>>1)]|=D[z+M]<<4-(M&1)*4;else if(u===2)for(let M=0;M<E;M++)A[U+(M>>2)]|=D[z+M]<<6-(M&3)*2;else if(u===1)for(let M=0;M<E;M++)A[U+(M>>3)]|=D[z+M]<<7-(M&7)*1}S=A,f=3,k=1}else if(h===!1&&_.length===1){const A=new Uint8Array(E*x*3),D=E*x;for(let P=0;P<D;P++){const U=P*3,z=P*4;A[U]=S[z],A[U+1]=S[z+1],A[U+2]=S[z+2]}S=A,f=2,k=3,C=3*E}v.img=S,v.bpl=C,v.bpp=k}return{ctype:f,depth:u,plte:g,frames:_}},I.encode.framize=function(t,e,n,i,r,o){const s=[];for(let a=0;a<t.length;a++){const c=new Uint8Array(t[a]),l=new Uint32Array(c.buffer);let f,u=0,d=0,h=e,_=n,p=i?1:0;if(a!==0){const g=o||i||a===1||s[a-2].dispose!==0?1:2;let m=0,y=1e9;for(let v=0;v<g;v++){const E=new Uint32Array(t[a-1-v]);let x=e,S=n,C=-1,k=-1;for(let D=0;D<n;D++)for(let P=0;P<e;P++){const U=D*e+P;l[U]!==E[U]&&(P<x&&(x=P),P>C&&(C=P),D<S&&(S=D),D>k&&(k=D))}C===-1&&(x=S=C=k=0),r&&((x&1)===1&&x--,(S&1)===1&&S--);const A=(C-x+1)*(k-S+1);A<y&&(y=A,m=v,u=x,d=S,h=C-x+1,_=k-S+1)}const b=new Uint8Array(t[a-1-m]);m===1&&(s[a-1].dispose=2),f=new Uint8Array(h*_*4),I._copyTile(b,e,n,f,h,_,-u,-d,0),p=I._copyTile(c,e,n,f,h,_,-u,-d,3)?1:0,p===1?I.encode._prepareDiff(c,e,n,f,{x:u,y:d,width:h,height:_}):I._copyTile(c,e,n,f,h,_,-u,-d,0)}else f=c.slice(0);s.push({rect:{x:u,y:d,width:h,height:_},img:f,blend:p,dispose:0})}if(i)for(let a=0;a<s.length;a++){const c=s[a];if(c.blend===1)continue;const l=c.rect,f=s[a-1].rect,u=Math.min(l.x,f.x),d=Math.min(l.y,f.y),h=Math.max(l.x+l.width,f.x+f.width),_=Math.max(l.y+l.height,f.y+f.height),p={x:u,y:d,width:h-u,height:_-d};s[a-1].dispose=1,a-1!==0&&I.encode._updateFrame(t,e,n,s,a-1,p,r),I.encode._updateFrame(t,e,n,s,a,p,r)}return s},I.encode._updateFrame=function(t,e,n,i,r,o,s){const a=Uint8Array,c=Uint32Array,l=new a(t[r-1]),f=new c(t[r-1]),u=r+1<t.length?new a(t[r+1]):null,d=new a(t[r]),h=new c(d.buffer);let _=e,p=n,g=-1,m=-1;for(let b=0;b<o.height;b++)for(let v=0;v<o.width;v++){const E=o.x+v,x=o.y+b,S=x*e+E,C=h[S];C===0||i[r-1].dispose===0&&f[S]===C&&(u===null||u[S*4+3]!==0)||(E<_&&(_=E),E>g&&(g=E),x<p&&(p=x),x>m&&(m=x))}g===-1&&(_=p=g=m=0),s&&((_&1)===1&&_--,(p&1)===1&&p--),o={x:_,y:p,width:g-_+1,height:m-p+1};const y=i[r];y.rect=o,y.blend=1,y.img=new Uint8Array(o.width*o.height*4),i[r-1].dispose===0?(I._copyTile(l,e,n,y.img,o.width,o.height,-o.x,-o.y,0),I.encode._prepareDiff(d,e,n,y.img,o)):I._copyTile(d,e,n,y.img,o.width,o.height,-o.x,-o.y,0)},I.encode._prepareDiff=function(t,e,n,i,r){I._copyTile(t,e,n,i,r.width,r.height,-r.x,-r.y,2)},I.encode._filterZero=function(t,e,n,i,r,o,s){const a=[];let c=[0,1,2,3,4];o!==-1?c=[o]:(e*i>5e5||n===1)&&(c=[0]);let l;s&&(l={level:0});const f=r.length>1e7&&Wr!=null?Wr:Iu;for(let h=0;h<c.length;h++){for(let _=0;_<e;_++)I.encode._filterLine(r,t,_,i,n,c[h]);a.push(f.deflate(r,l))}let u,d=1e9;for(let h=0;h<a.length;h++)a[h].length<d&&(u=h,d=a[h].length);return a[u]},I.encode._filterLine=function(t,e,n,i,r,o){const s=n*i;let a=s+n;const c=I.decode._paeth;if(t[a]=o,a++,o===0)if(i<500)for(let l=0;l<i;l++)t[a+l]=e[s+l];else t.set(new Uint8Array(e.buffer,s,i),a);else if(o===1){for(let l=0;l<r;l++)t[a+l]=e[s+l];for(let l=r;l<i;l++)t[a+l]=e[s+l]-e[s+l-r]+256&255}else if(n===0){for(let l=0;l<r;l++)t[a+l]=e[s+l];if(o===2)for(let l=r;l<i;l++)t[a+l]=e[s+l];if(o===3)for(let l=r;l<i;l++)t[a+l]=e[s+l]-(e[s+l-r]>>1)+256&255;if(o===4)for(let l=r;l<i;l++)t[a+l]=e[s+l]-c(e[s+l-r],0,0)+256&255}else{if(o===2)for(let l=0;l<i;l++)t[a+l]=e[s+l]+256-e[s+l-i]&255;if(o===3){for(let l=0;l<r;l++)t[a+l]=e[s+l]+256-(e[s+l-i]>>1)&255;for(let l=r;l<i;l++)t[a+l]=e[s+l]+256-(e[s+l-i]+e[s+l-r]>>1)&255}if(o===4){for(let l=0;l<r;l++)t[a+l]=e[s+l]+256-c(0,e[s+l-i],0)&255;for(let l=r;l<i;l++)t[a+l]=e[s+l]+256-c(e[s+l-r],e[s+l-i],e[s+l-r-i])&255}}},I.crc={table:function(){const t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let i=0;i<8;i++)n&1?n=3988292384^n>>>1:n=n>>>1;t[e]=n}return t}(),update:function(t,e,n,i){for(let r=0;r<i;r++)t=I.crc.table[(t^e[n+r])&255]^t>>>8;return t},crc:function(t,e,n){return I.crc.update(4294967295,t,e,n)^4294967295}},I.quantize=function(t,e){const n=new Uint8Array(t),i=n.slice(0),r=new Uint32Array(i.buffer),o=I.quantize.getKDtree(i,e),s=o[0],a=o[1],c=I.quantize.planeDst,l=n,f=r,u=l.length,d=new Uint8Array(n.length>>2);let h;if(n.length<2e7)for(let _=0;_<u;_+=4){const p=l[_]*.00392156862745098,g=l[_+1]*(1/255),m=l[_+2]*(1/255),y=l[_+3]*(1/255);h=I.quantize.getNearest(s,p,g,m,y),d[_>>2]=h.ind,f[_>>2]=h.est.rgba}else for(let _=0;_<u;_+=4){const p=l[_]*.00392156862745098,g=l[_+1]*(1/255),m=l[_+2]*(1/255),y=l[_+3]*(1/255);for(h=s;h.left;)h=c(h.est,p,g,m,y)<=0?h.left:h.right;d[_>>2]=h.ind,f[_>>2]=h.est.rgba}return{abuf:i.buffer,inds:d,plte:a}},I.quantize.getKDtree=function(t,e,n){n===null&&(n=1e-4);const i=new Uint32Array(t.buffer),r={i0:0,i1:t.length,bst:null,est:null,tdst:0,left:null,right:null};r.bst=I.quantize.stats(t,r.i0,r.i1),r.est=I.quantize.estats(r.bst);const o=[r];for(;o.length<e;){let s=0,a=0;for(let h=0;h<o.length;h++)o[h].est.L>s&&(s=o[h].est.L,a=h);if(s<n)break;const c=o[a],l=I.quantize.splitPixels(t,i,c.i0,c.i1,c.est.e,c.est.eMq255);if(c.i0>=l||c.i1<=l){c.est.L=0;continue}const u={i0:c.i0,i1:l,bst:null,est:null,tdst:0,left:null,right:null};u.bst=I.quantize.stats(t,u.i0,u.i1),u.est=I.quantize.estats(u.bst);const d={i0:l,i1:c.i1,bst:null,est:null,tdst:0,left:null,right:null};d.bst={R:[],m:[],N:c.bst.N-u.bst.N};for(let h=0;h<16;h++)d.bst.R[h]=c.bst.R[h]-u.bst.R[h];for(let h=0;h<4;h++)d.bst.m[h]=c.bst.m[h]-u.bst.m[h];d.est=I.quantize.estats(d.bst),c.left=u,c.right=d,o[a]=u,o.push(d)}o.sort(function(s,a){return a.bst.N-s.bst.N});for(let s=0;s<o.length;s++)o[s].ind=s;return[r,o]},I.quantize.getNearest=function(t,e,n,i,r){if(t.left==null)return t.tdst=I.quantize.dist(t.est.q,e,n,i,r),t;const o=I.quantize.planeDst(t.est,e,n,i,r);let s=t.left,a=t.right;o>0&&(s=t.right,a=t.left);const c=I.quantize.getNearest(s,e,n,i,r);if(c.tdst<=o*o)return c;const l=I.quantize.getNearest(a,e,n,i,r);return l.tdst<c.tdst?l:c},I.quantize.planeDst=function(t,e,n,i,r){const o=t.e;return o[0]*e+o[1]*n+o[2]*i+o[3]*r-t.eMq},I.quantize.dist=function(t,e,n,i,r){const o=e-t[0],s=n-t[1],a=i-t[2],c=r-t[3];return o*o+s*s+a*a+c*c},I.quantize.splitPixels=function(t,e,n,i,r,o){const s=I.quantize.vecDot;for(i-=4;n<i;){for(;s(t,n,r)<=o;)n+=4;for(;s(t,i,r)>o;)i-=4;if(n>=i)break;const a=e[n>>2];e[n>>2]=e[i>>2],e[i>>2]=a,n+=4,i-=4}for(;s(t,n,r)>o;)n-=4;return n+4},I.quantize.vecDot=function(t,e,n){return t[e]*n[0]+t[e+1]*n[1]+t[e+2]*n[2]+t[e+3]*n[3]},I.quantize.stats=function(t,e,n){const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=[0,0,0,0],o=n-e>>2;for(let s=e;s<n;s+=4){const a=t[s]*.00392156862745098,c=t[s+1]*(1/255),l=t[s+2]*(1/255),f=t[s+3]*(1/255);r[0]+=a,r[1]+=c,r[2]+=l,r[3]+=f,i[0]+=a*a,i[1]+=a*c,i[2]+=a*l,i[3]+=a*f,i[5]+=c*c,i[6]+=c*l,i[7]+=c*f,i[10]+=l*l,i[11]+=l*f,i[15]+=f*f}return i[4]=i[1],i[8]=i[2],i[9]=i[6],i[12]=i[3],i[13]=i[7],i[14]=i[11],{R:i,m:r,N:o}},I.quantize.estats=function(t){const e=t.R,n=t.m,i=t.N,r=n[0],o=n[1],s=n[2],a=n[3],c=i===0?0:1/i,l=[e[0]-r*r*c,e[1]-r*o*c,e[2]-r*s*c,e[3]-r*a*c,e[4]-o*r*c,e[5]-o*o*c,e[6]-o*s*c,e[7]-o*a*c,e[8]-s*r*c,e[9]-s*o*c,e[10]-s*s*c,e[11]-s*a*c,e[12]-a*r*c,e[13]-a*o*c,e[14]-a*s*c,e[15]-a*a*c],f=l,u=I.M4;let d=[Math.random(),Math.random(),Math.random(),Math.random()],h=0,_=0;if(i!==0)for(let m=0;m<16&&(d=u.multVec(f,d),_=Math.sqrt(u.dot(d,d)),d=u.sml(1/_,d),!(m!==0&&Math.abs(_-h)<1e-9));m++)h=_;const p=[r*c,o*c,s*c,a*c],g=u.dot(u.sml(255,p),d);return{Cov:l,q:p,e:d,L:h,eMq255:g,eMq:u.dot(d,p),rgba:(Math.round(255*p[3])<<24|Math.round(255*p[2])<<16|Math.round(255*p[1])<<8|Math.round(255*p[0])<<0)>>>0}},I.M4={multVec:function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3],t[4]*e[0]+t[5]*e[1]+t[6]*e[2]+t[7]*e[3],t[8]*e[0]+t[9]*e[1]+t[10]*e[2]+t[11]*e[3],t[12]*e[0]+t[13]*e[1]+t[14]*e[2]+t[15]*e[3]]},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},sml:function(t,e){return[t*e[0],t*e[1],t*e[2],t*e[3]]}},I.encode.concatRGBA=function(t){let e=0;for(let r=0;r<t.length;r++)e+=t[r].byteLength;const n=new Uint8Array(e);let i=0;for(let r=0;r<t.length;r++){const o=new Uint8Array(t[r]),s=o.length;for(let a=0;a<s;a+=4){let c=o[a],l=o[a+1],f=o[a+2];const u=o[a+3];u===0&&(c=l=f=0),n[i+a]=c,n[i+a+1]=l,n[i+a+2]=f,n[i+a+3]=u}i+=s}return n.buffer};const ln=new Map,bi=(t,e)=>{if(ln.has(t))return e(null,ln.get(t));const n=new Image;n.onload=function(){ln.set(t,{width:n.width,height:n.height,element:n}),e(null,ln.get(t))},n.onerror=function(i){e(i,null)},n.src=t},xi=(t,e)=>{bi(t,(n,i)=>{if(!i)return e(n,null);const r=document.createElement("canvas"),o=r.getContext("2d");return r.width=i.width,r.height=i.height,o.drawImage(i.element,0,0,r.width,r.height),o.getImageData(0,0,r.width,r.height)})},Du=(t,e)=>{for(let n=0,i=t.length;n<i;n++){const r=t[n],{type:o}=r;if(o.split("/")[0]!=="image")return;let a;const c=new FileReader;c.onload=function(l){if(!l.target)return e("no reader target",null);const f=l.target.result;a=wn(f);const d=new Blob([f]);Ei(d,(h,_)=>{if(!_)return e(h,null);bi(_,(p,g)=>{if(!g)return e(p,null);xi(_,(m,y)=>{if(!y)return e(m,null);const b={name:r.name,fileType:a,size:r.size,width:g.width,height:g.height,imgUrl:_,imageData:y,blob:d};return e(null,b)})})})},c.readAsArrayBuffer(r)}},Pu=(t,e=0,n=0)=>{const i=document.createElement("canvas"),r=i.getContext("2d");return i.width=e,i.height=n,r.drawImage(t,0,0,e,n),r.getImageData(0,0,e,n)},Mu=(t,e=0,n=0)=>{const i=document.createElement("canvas"),r=i.getContext("2d");return i.width=e,i.height=n,r.drawImage(t,0,0,e,n),r.getImageData(0,0,e,n)},Ru=t=>{const e=t.width,n=t.height,i=e*n*3,r=i+54,o=[66,77,r&255,r>>8&255,r>>16&255,r>>24&255,0,0,0,0,54,0,0,0],s=[40,0,0,0,e&255,e>>8&255,e>>16&255,e>>24&255,n&255,n>>8&255,n>>16&255,n>>24&255,1,0,24,0,0,0,0,0,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=(4-e*3%4)%4,c=t.data;let l="";const f=e<<2;let u=n;const d=String.fromCharCode;do{const _=f*(u-1);let p="";for(let g=0;g<e;g++){const m=g<<2;p+=d(c[_+m+2])+d(c[_+m+1])+d(c[_+m])}for(let g=0;g<a;g++)p+=String.fromCharCode(0);l+=p}while(--u);function h(_){if(!window.btoa)throw"btoa undefined";let p="";if(typeof _=="string")p=_;else for(let g=0;g<_.length;g++)p+=String.fromCharCode(_[g]);return btoa(p)}return h(o.concat(s))+h(l)},Ou=t=>{const{width:e,height:n}=t,i=document.createElement("canvas"),r=i.getContext("2d");return i.width=e,i.height=n,r.putImageData(t,0,0,0,0,e,n),i.toDataURL("image/png")},Lu=(t,e,n)=>{const{width:i,height:r}=t,o=document.createElement("canvas"),s=o.getContext("2d");o.width=i,o.height=r,s.putImageData(t,0,0,0,0,i,r);const a=`image/${e?e.toLowerCase():"png"}`;o.toBlob(c=>{n?.(null,c)},a,1)},Ei=(t,e)=>{const n=new FileReader;n.onload=function(i){i.target?e(null,i.target.result):e("can't readAsDataURL",null)},n.readAsDataURL(t)},Uu=(t,e)=>{Ei(t,function(n,i){if(i){const r=new Image;r.src=i}else e(n)})},Fu=(t,e)=>{const n=window.URL.createObjectURL(t),i=document.createElement("a");i.style.visibility="hidden",document.body.appendChild(i),i.download=e,i.href=n,i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)},ys=(t,e="image/svg+xml",n="utf-8")=>new Blob([t],{type:`${e};charset=${n}`}),zu=(t,e="image/svg+xml",n="utf-8")=>{const i=new XMLSerializer().serializeToString(t);return ys(i,e,n)};function Bu(t,e){xi(t,(n,i)=>{if(!i)return e(n,null);const r=i.data;let o=0;const s=[],a=[],c=[];for(let d=0;d<r.length;d+=4)s[o]=r[d],a[o]=r[d+1],c[o]=r[d+2],o+=1;const l=Si(s),f=Si(a),u=Si(c);return e(null,"rgb("+l+","+f+","+u+")")})}function Si(t){const e={},n=[],i=[];for(let a=0;a<t.length;a++)e[t[a]]?n.push(t[a]):e[t[a]]=1;let r=0;for(let a=0;a<n.length;a++){r=0;for(let c=0;c<n.length;c++)n[a]===n[c]&&(r+=1),i[a]=r}const o=Math.max.apply(null,i);let s=0;for(;s<i.length;s++)if(i[s]===o)return;return n[s]}const Nu=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;r[c]=e[(s*n+n-a-1)*4],r[c+1]=e[(s*n+n-a-1)*4+1],r[c+2]=e[(s*n+n-a-1)*4+2],r[c+3]=e[(s*n+n-a-1)*4+3]}return new ImageData(r,n,i)},ju=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;r[c]=e[((i-s-1)*n+a)*4],r[c+1]=e[((i-s-1)*n+a)*4+1],r[c+2]=e[((i-s-1)*n+a)*4+2],r[c+3]=e[((i-s-1)*n+a)*4+3]}return new ImageData(r,n,i)},Hu=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<n;s++)for(let a=0;a<i;a++){const c=(s*i+a)*4;r[c]=e[(a*n+n-s-1)*4],r[c+1]=e[(a*n+n-s-1)*4+1],r[c+2]=e[(a*n+n-s-1)*4+2],r[c+3]=e[(a*n+n-s-1)*4+3]}return new ImageData(r,i,n)},qu=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<n;s++)for(let a=0;a<i;a++){const c=(s*i+a)*4;r[c]=e[((i-a-1)*n+s)*4],r[c+1]=e[((i-a-1)*n+s)*4+1],r[c+2]=e[((i-a-1)*n+s)*4+2],r[c+3]=e[((i-a-1)*n+s)*4+3]}return new ImageData(r,i,n)},Zu=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4,l=(e[c]+e[c+1]+e[c+2])/3;r[c]=l,r[c+1]=l,r[c+2]=l,r[c+3]=e[c+3]}return new ImageData(r,n,i)},Gu=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4,l=.2126*e[c]+.7152*e[c+1]+.0722*e[c+2];r[c]=l,r[c+1]=l,r[c+2]=l,r[c+3]=e[c+3]}return new ImageData(r,n,i)},Xu=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4,f=(e[c]+e[c+1]+e[c+2])/3>127?255:0;r[c]=f,r[c+1]=f,r[c+2]=f,r[c+3]=e[c+3]}return new ImageData(r,n,i)},$u=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;r[c]=255-e[c],r[c+1]=255-e[c+1],r[c+2]=255-e[c+2],r[c+3]=e[c+3]}return new ImageData(r,n,i)},Vu=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;r[c]=e[c],r[c+1]=0,r[c+2]=0,r[c+3]=e[c+3]}return new ImageData(r,n,i)},Yu=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;r[c]=0,r[c+1]=e[c+1],r[c+2]=0,r[c+3]=e[c+3]}return new ImageData(r,n,i)},Wu=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;r[c]=0,r[c+1]=0,r[c+2]=e[c+2],r[c+3]=e[c+3]}return new ImageData(r,n,i)},Ku=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;r[c]=e[c],r[c+1]=e[c+1],r[c+2]=0,r[c+3]=e[c+3]}return new ImageData(r,n,i)},Ju=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;r[c]=e[c],r[c+1]=0,r[c+2]=e[c+1],r[c+3]=e[c+3]}return new ImageData(r,n,i)},Qu=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;r[c]=0,r[c+1]=e[c+1],r[c+2]=e[c+1],r[c+3]=e[c+3]}return new ImageData(r,n,i)},td=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4,l=(e[c+1]+e[c+2])/2;r[c]=e[c],r[c+1]=l,r[c+2]=l,r[c+3]=e[c+3]}return new ImageData(r,n,i)},ed=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4,l=(e[c]+e[c+2])/2;r[c]=l,r[c+1]=e[c+1],r[c+2]=l,r[c+3]=e[c+3]}return new ImageData(r,n,i)},nd=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4,l=(e[c]+e[c+1])/2;r[c]=l,r[c+1]=l,r[c+2]=e[c+2],r[c+3]=e[c+3]}return new ImageData(r,n,i)},id=t=>vs(t,[-1,-1,-1,-1,9,-1,-1,-1,-1]),rd=t=>vs(t,[-1,-1,-1,-1,8,-1,-1,-1,-1]),od=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;r[c]=e[c],r[c+1]=e[c+1],r[c+2]=e[c+2],r[c+3]=255}return new ImageData(r,n,i)},sd=t=>{const{data:e,width:n,height:i}=t,r=new Uint8ClampedArray(e.length);for(let s=0;s<i;s++)for(let a=0;a<n;a++){const c=(s*n+a)*4;if(e[c+3]===0)r[c]=255,r[c+1]=255,r[c+2]=255,r[c+3]=255;else{const l=bs([e[c],e[c+1],e[c+2],e[c+3]],[255,255,255,255]);r[c]=l[0],r[c+1]=l[1],r[c+2]=l[2],r[c+3]=l[3]}}return new ImageData(r,n,i)},ad=(t,e,n,i,r,o=!1,s)=>{const{data:a,width:c,height:l}=t;let f=r,u=i,d=e,h=n;if(f<0?f=0:f>c&&(f=c),u<0?u=0:u>l&&(u=l),d<1?d=1:d>c&&(d=c),h<1?h=1:h>l&&(h=l),f+d>c&&(d=c-f),u+h>l&&(h=l-u),o){const _=new Uint8ClampedArray(a.length);for(let g=0;g<l;g++)for(let m=0;m<c;m++){const y=(g*c+m)*4;m>=f&&m<=f+d&&g>=u&&g<=u+h?(_[y]=a[y],_[y+1]=a[y+1],_[y+2]=a[y+2],_[y+3]=a[y+3]):(_[y]=255,_[y+1]=255,_[y+2]=255,_[y+3]=s&&["JPG","JPEG"].includes(s.toUpperCase())?255:0)}return new ImageData(_,c,l)}else{const _=new Uint8ClampedArray(d*h*4);for(let g=u;g<=u+h;g++)for(let m=f;m<=f+d;m++){const y=((g-u)*d+m-f)*4,b=(g*c+m)*4;_[y]=a[b],_[y+1]=a[b+1],_[y+2]=a[b+2],_[y+3]=a[b+3]}return new ImageData(_,d,h)}},ld=(t,e,n,i)=>{const{data:r,width:o,height:s}=t;let a=e;a>Math.floor(o/2)&&(a=Math.floor(o/2)),a>Math.floor(s/2)&&(a=Math.floor(s/2)),a<0&&(a=0);const c=new Uint8ClampedArray(r.length);for(let f=0;f<s;f++)for(let u=0;u<o;u++){const d=(f*o+u)*4;let h=-1;u<a?f<a?h=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(a-f-1,2)):f>s-a-1&&(h=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(f-(s-a),2))):u>o-a-1&&(f<a?h=Math.sqrt(Math.pow(u-(o-a),2)+Math.pow(a-f-1,2)):f>s-a-1&&(h=Math.sqrt(Math.pow(u-(o-a),2)+Math.pow(f-(s-a),2)))),Math.round(h)>a?(c[d]=255,c[d+1]=255,c[d+2]=255,c[d+3]=i||n.toUpperCase()==="PNG"?0:255):(c[d]=r[d],c[d+1]=r[d+1],c[d+2]=r[d+2],c[d+3]=i||n.toUpperCase()==="PNG"?r[d+3]:255)}return new ImageData(c,o,s)},cd=(t,e,n,i,r,o=1e4)=>{const s=new Image;s.src=t;const a=document.createElement("canvas"),c=a.getContext("2d");return a.width=o,a.height=o,c.drawImage(s,0,0,e,n,0,0,i,r),c.getImageData(0,0,i,r)},hd=(t,e)=>{const{data:n,width:i,height:r}=t,o=new Uint8ClampedArray(n.length);for(let a=0;a<r;a++)for(let c=0;c<i;c++){const l=(a*i+c)*4;o[l]=Math.max(Math.min(n[l]+e,255),0),o[l+1]=Math.max(Math.min(n[l+1]+e,255),0),o[l+2]=Math.max(Math.min(n[l+2]+e,255),0),o[l+3]=n[l+3]}return new ImageData(o,i,r)},fd=(t,e,n=!1)=>{const{data:i,width:r,height:o}=t,s=new Uint8ClampedArray(i.length);for(let c=0;c<o;c++)for(let l=0;l<r;l++){const f=(c*r+l)*4;i[f+3]===0?(s[f]=255,s[f+1]=255,s[f+2]=255):(s[f]=i[f],s[f+1]=i[f+1],s[f+2]=i[f+2]);let u=i[f+3];n?u=Math.max(Math.min(Math.floor(255*e),255),0):u=Math.max(Math.min(Math.floor(u+255*e),255),0),s[f+3]=u}return new ImageData(s,r,o)},ud=(t,e,n,i)=>{const{data:r,width:o,height:s}=t,{data:a,width:c,height:l}=e;let f=n,u=i;n+l>s&&(f=s-l),i+c>o&&(u=o-c);const d=new Uint8ClampedArray(r.length);for(let _=0;_<s;_++)for(let p=0;p<o;p++){const g=(_*o+p)*4;if(p<u||p>u+c||_<=f||_>=f+l)d[g]=r[g],d[g+1]=r[g+1],d[g+2]=r[g+2],d[g+3]=r[g+3];else{const m=(_*o+p-((f+1)*o+(_-(f+1))*(o-c))+c-u-1)*4,y=[a[m],a[m+1],a[m+2],a[m+3]],b=[r[g],r[g+1],r[g+2],r[g+3]],v=bs(y,b);d[g]=v[0],d[g+1]=v[1],d[g+2]=v[2],d[g+3]=v[3]}}return new ImageData(d,o,s)},dd=(t,e,n,i,r,o=10)=>{const{data:s,width:a,height:c}=t;let l=r,f=i,u=e,d=n;l<0?l=0:l>a&&(l=a),f<0?f=0:f>c&&(f=c),u<1?u=1:u>a&&(u=a),d<1?d=1:d>c&&(d=c),l+u>a&&(u=a-l),f+d>c&&(d=c-f);const h=new Uint8ClampedArray(s.length);for(let p=0;p<c;p++)for(let g=0;g<a;g++){const m=(p*a+g)*4;if(g>=l&&g<=l+u&&p>=f&&p<=f+d){const y=Math.floor((g-l)/o),b=Math.floor((p-f)/o);let v=Math.floor(o*(y+1)-o/2+l),E=Math.floor(o*(b+1)-o/2+f);v>a-1&&(v=a-1),E>c-1&&(E=c-1);const x=(E*a+v)*4;h[m]=s[x],h[m+1]=s[x+1],h[m+2]=s[x+2],h[m+3]=s[x+3]}else h[m]=s[m],h[m+1]=s[m+1],h[m+2]=s[m+2],h[m+3]=s[m+3]}return new ImageData(h,a,c)},_d=async(t,e,n,i,r,o)=>{const s=r/100;if(["JPG","JPEG"].includes(i.toUpperCase())){const a=new Image;a.src=t;const c=document.createElement("canvas"),l=c.getContext("2d");c.width=e,c.height=n,l.drawImage(a,0,0,e,n),c.toBlob(f=>{o(f)},`image/${i.toLowerCase()}`,s)}else{const a=Math.floor(s*256),c=I.encode([t.data.buffer],e,n,a),l=new Blob([c]);o&&o(l)}},gd=(t,e,n={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(e&&n){const{data:i,width:r,height:o}=t,{data:s}=e,a=new Uint8ClampedArray(i.length),{backgroundColor:c,changeIntoColor:l}=n;for(let u=0;u<o;u++)for(let d=0;d<r;d++){const h=(u*r+d)*4,_=s[h],p=s[h+1],g=s[h+2],m=s[h+3];_===c.r&&p===c.g&&g===c.b&&m===c.a&&l.a!==0?(a[h]=l.r,a[h+1]=l.g,a[h+2]=l.b,a[h+3]=l.a):(a[h]=i[h],a[h+1]=i[h+1],a[h+2]=i[h+2],a[h+3]=i[h+3])}return new ImageData(a,r,o)}return t},vs=(t,e)=>{const{data:n,width:i,height:r}=t,o=new Uint8ClampedArray(n.length);for(let a=0;a<r;a++)for(let c=0;c<i;c++){const l=(a*i+c)*4;for(let f=0;f<3;f++){const u=l+f;c===0||c===i-1||a===0||a===r-1?o[u]=n[u]:o[u]=e[0]*n[u-i*4-4]+e[1]*n[u-i*4]+e[2]*n[u-i*4+4]+e[3]*n[u-4]+e[4]*n[u]+e[5]*n[u+4]+e[6]*n[u+i*4-4]+e[7]*n[u+i*4]+e[8]*n[u+i*4+4]}o[l+3]=n[l+3]}return new ImageData(o,i,r)},bs=(t,e)=>{if(t&&t.length===4&&e&&e.length===4){const n=t[3],i=e[3];if(n===255||i===0)return t;if(n===0)return e;{const r=n/255,o=i/255,s=Math.max(Math.min(Math.floor(t[0]*r+e[0]*o*(1-r)),255),0),a=Math.max(Math.min(Math.floor(t[1]*r+e[1]*o*(1-r)),255),0),c=Math.max(Math.min(Math.floor(t[2]*r+e[2]*o*(1-r)),255),0),l=Math.max(Math.min(Math.floor((r+o*(1-r))*255),255),0);return[s,a,c,l]}}return[255,255,255,255]};function pd(){var t=null;if(window.ActiveXObject)for(var e=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"],n=0;n<e.length;n++)try{t=new window.ActiveXObject(e[n]);break}catch{continue}else t=new XMLHttpRequest;return t}function md(t){if(t.action){if(t.method.toLowerCase()==="post")return{url:t.action,data:new FormData(t)};for(var e="",n=0;n<t.elements.length;n++){var i=t.elements[n];if(i.hasAttribute("name")){var r=i.nodeName.toUpperCase()==="INPUT"?i.getAttribute("type").toUpperCase():"TEXT";if(r==="FILE")for(var o=0;o<i.files.length;e+="&"+escape(i.name)+"="+escape(i.files[o++].name));else(r!=="RADIO"&&r!=="CHECKBOX"||i.checked)&&(e+="&"+escape(i.name)+"="+escape(i.value))}}return{url:t.action.replace(/(?:\?.*)?$/,e.replace(/^&/,"?")),data:null}}}function wd(t,e){return new Promise((n,i)=>{var r=new XMLHttpRequest,o=function(){i("The request for "+t+" is timed out for "+e+".")},s=function(a){r.readyState===4&&(r.status===200?n(r.response):i(r.statusText))};r.open("GET",t),r.onload=s,r.timeout=e,r.ontimeout=o,r.upload.addEventListener("progress",function(a){if(a.lengthComputable){const c=Math.round(a.loaded*100/a.total);console.log(c+"%")}},!1),r.upload.addEventListener("load",function(a){},!1),r.send(null)})}function yd(t,e,n){return fetch(t,Object.assign({method:"POST",headers:{},body:{},mode:"",credentials:"",cache:"",redirect:"follow",referrerPolicy:"no-referrer"},e)).then(i=>i.json())}function vd(t,e){var n=new XMLHttpRequest;n.open("HEAD",t),n.filepath=t,n.callback=e,n.onload=function(){var i=parseFloat(window.localStorage.getItem("lm_"+this.filepath)),r=Date.parse(this.getResponseHeader("Last-Modified"));(isNaN(i)||r>i)&&(window.localStorage.setItem("lm_"+this.filepath,Date.now()),isFinite(i)&&this.callback(r,i))},n.send()}function Ti(t,e){if(e)window.localStorage.setItem(t,typeof e=="string"?e:JSON.stringify(e));else return window.localStorage.getItem(t)}function bd(t=""){t=t||Ti("theme")||"",t||(t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Ti("theme",t),document.documentElement.classList.toggle("dark",t==="dark")}const xd=(t={x:0,y:0})=>window.scrollTo(t.x,t.y);function cn(t){try{window.history.scrollRestoration=t}catch{}}"scrollRestoration"in window.history&&(cn("manual"),window.addEventListener("beforeunload",()=>{cn("auto")}),window.addEventListener("load",()=>{cn("manual")}));let hn;const xs=new WeakMap;function ki(t,e){let n=xs.get(t);n||(n=new Map,xs.set(t,n));let i=n.get(e);return i||(i=new Es,n.set(e,i)),i}class Es{subscribers;constructor(){this.subscribers=new Set}depend(){hn&&this.subscribers.add(hn)}notify(){this.subscribers.forEach(e=>e())}}function Ed(t){hn=t,t(),hn=null}function Sd(t){return Object.keys(t).forEach(e=>{let n=t[e];const i=ki(t,e);Object.defineProperty(t,e,{get(){return i.depend(),n},set(r){r!=n&&(n=r,i.notify())}})}),t}function Td(t){return new Proxy(t,{get(e,n,i){return ki(t,n).depend(),Reflect.get(e,n,i)},set(e,n,i,r){const o=ki(t,n);return t[n]!=i&&(t[n]=i,o.notify()),Reflect.set(e,n,i,r)}})}const kd=t=>t*Math.PI/180,Ad=t=>t*180/Math.PI,Ss=function(t,e){const n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)},Cd=function(t,e){return{x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}},Ai=function(t,e){const n=e.x-t.x,i=e.y-t.y;return Math.atan2(i,n)},Ci=(t,e)=>({x:Math.cos(e)*t,y:Math.sin(e)*t}),Ts=(t,e=0,n=0)=>{if(t.vx+=t.ax??0,t.vy+=t.ay??0,t.vy+=e,n>0){const i=Math.atan2(t.vy,t.vx);let r=Math.sqrt(t.vx*t.vx+t.vy*t.vy);r>n?r-=n:r=0,t.vx=Math.cos(i)*r,t.vy=Math.sin(i)*r}t.x+=t.vx,t.y+=t.vy},Id=(t,e,n=.05,i=1,r=0)=>{const o=e.x-t.x,s=e.y-t.y;t.vx=o*n,t.vy=s*n,t.vy+=r,t.vx*=i,t.vy*=i,t.x+=t.vx,t.y+=t.vy},ks=(t,e,n=.03,i=.95,r=0)=>{(zs(e)?e:[e]).forEach(s=>{const a=s.x-t.x,c=s.y-t.y,l=a*n,f=c*n;t.vx+=l,t.vy+=f}),t.vy+=r,t.vx*=i,t.vy*=i,t.x+=t.vx,t.y+=t.vy},Dd=(t,e,n=100,i=.03,r=.95,o=0)=>{const s=Ai(t,e),a={x:e.x-Math.cos(s)*n,y:e.y-Math.sin(s)*n};ks(t,a,i,r,o)};function Pd(t,e){return{vx:e.x-t.x,vy:e.y-t.y}}const Md=function(t,e){return!(t.x+t.width<e.x||e.x+e.width<t.x||t.y+t.height<e.y||e.y+e.height<t.y)},As=function(t,e){return!(e.x<t.x||e.x>t.x+t.width||e.y<t.y||e.y>t.y+t.height)},Rd=(t,e)=>{const n=e.x,i=e.y,r=t.length;let o=!1;const s=2e-10;for(let a=0,c=r-1;a<r;c=a,a++){const l=t[a].x,f=t[a].y,u=t[c].x,d=t[c].y;if(l===n&&f===i||u===n&&d===i||i===f&&i===d)return!0;if(i>=f&&i<d||i<f&&i>=d){const h=(u-l)/(d-f),_=l+h*(i-f);if(_===n||Math.abs(_-n)<s)return!0;_>n&&(o=!o)}}return o};function Et(t,e,n,i,r=!1){return{x:r?t*i+e*n:t*i-e*n,y:r?e*i-t*n:e*i+t*n}}function Od(t,e){const n=e.x-t.x,i=e.y-t.y;if(Math.sqrt(n*n+i*i)<t.radius+e.radius){const o=Math.atan2(i,n),s=Math.sin(o),a=Math.cos(o),c={x:0,y:0},l=Et(n,i,s,a,!0),f=Et(t.vx,t.vy,s,a,!0),u=Et(e.vx,e.vy,s,a,!0),d=f.x-u.x;f.x=((t.mass-e.mass)*f.x+2*e.mass*u.x)/(t.mass+e.mass),u.x=d+f.x;const h=Math.abs(f.x)+Math.abs(u.x),_=t.radius+e.radius-Math.abs(c.x-l.x);c.x+=f.x/h*_,l.x+=u.x/h*_;const p=Et(c.x,c.y,s,a,!1),g=Et(l.x,l.y,s,a,!1);e.x=t.x+g.x,e.y=t.y+g.y,t.x=t.x+p.x,t.y=t.y+p.y;const m=Et(f.x,f.y,s,a,!1),y=Et(u.x,u.y,s,a,!1);t.vx=m.x,t.vy=m.y,e.vx=y.x,e.vy=y.y}}function Ld(t,e=0,n=0,i,r,o=-1){t.x+t.radius>i?(t.x=i-t.radius,t.vx*=o):t.x-t.radius<e&&(t.x=e+t.radius,t.vx*=o),t.y+t.radius>r?(t.y=r-t.radius,t.vy*=o):t.y-t.radius<n&&(t.y=n+t.radius,t.vy*=o)}const Ud=t=>/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(t),Fd=()=>Math.random()*16777215,zd=()=>`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`,Bd=()=>`#${(~~(Math.random()*(1<<24))).toString(16)}`,st=function(t,e){return e===!0?typeof t=="number"?t|0:(typeof t=="string"&&t[0]==="#"&&(t=t.slice(1)),window.parseInt(t,16)):(typeof t=="number"&&(t="00000"+(t|0).toString(16),t="#"+t.substring(t.length-6)),t)},Ii=function(t,e){typeof t=="string"&&t[0]==="#"&&(t=window.parseInt(t.slice(1),16)),e=e===void 0?1:e;const n=t>>16&255,i=t>>8&255,r=t&255,o=e<0?0:e>1?1:e;return o===1?"rgb("+n+","+i+","+r+")":"rgba("+n+","+i+","+r+","+o+")"},Nd=t=>{const n=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(t);return n?"#"+((1<<24)+(parseInt(n[1])<<16)+(parseInt(n[2])<<8)+parseInt(n[3])).toString(16).slice(1):""},Cs=function(){const t={code:""},e=n=>{t.code=n.code.toLowerCase()};return window.addEventListener("keydown",e,!1),t},Di=function(t){const e={x:0,y:0,isDown:!1},n=o=>{e.isDown=!0,document.addEventListener("mouseup",i,!1),t.style.userSelect="none",t.style.webkitUserSelect="none"},i=o=>{e.isDown=!1,e.x=0,e.y=0,document.removeEventListener("mouseup",i,!1),t.style.userSelect="",t.style.webkitUserSelect=""},r=o=>{const s=Ve(t,o);e.x=s.x,e.y=s.y};return t.addEventListener("mousedown",n,!1),document.addEventListener("mousemove",r,!1),e},jd=function(t){const e={x:0,y:0,isDown:!1},n=o=>{o.preventDefault(),e.isDown=!0},i=o=>{e.isDown=!1,e.x=0,e.y=0},r=o=>{const s=o.changedTouches[0],a=Ve(t,s);e.x=a.x,e.y=a.y};return t.addEventListener("touchstart",n,!1),t.addEventListener("touchend",i,!1),t.addEventListener("touchcancel",i,!1),t.addEventListener("touchmove",r,!1),e},Hd=function(t){const e={x:0,y:0,isDown:!1},n=o=>{e.isDown=!0,t.setPointerCapture(o.pointerId),t.style.userSelect="none",t.style.webkitUserSelect="none"},i=o=>{e.isDown=!1,e.x=0,e.y=0,t.style.userSelect="",t.style.webkitUserSelect=""},r=o=>{const a=Ve(t,o);e.x=a.x,e.y=a.y};return t.addEventListener("pointerdown",n,!1),t.addEventListener("pointerup",i,!1),t.addEventListener("pointercancel",i,!1),t.addEventListener("pointermove",r,!1),e};class ut{m;constructor(e=[1,0,0,1,0,0]){this.m=[e[0],e[1],e[2],e[3],e[4],e[5]]}unit(){return this.m=[1,0,0,1,0,0],this}multiply(e){const n=this.m;let i;e instanceof ut?i=e.m:i=e;const r=n[0]*i[0]+n[2]*i[1],o=n[1]*i[0]+n[3]*i[1],s=n[0]*i[2]+n[2]*i[3],a=n[1]*i[2]+n[3]*i[3],c=n[0]*i[4]+n[2]*i[5]+n[4],l=n[1]*i[4]+n[3]*i[5]+n[5];return n[0]=r,n[1]=o,n[2]=s,n[3]=a,n[4]=c,n[5]=l,this}inverse(){const e=new ut(this.m),n=e.m,i=1/(n[0]*n[3]-n[1]*n[2]),r=n[3]*i,o=-n[1]*i,s=-n[2]*i,a=n[0]*i,c=i*(n[2]*n[5]-n[3]*n[4]),l=i*(n[1]*n[4]-n[0]*n[5]);return n[0]=r,n[1]=o,n[2]=s,n[3]=a,n[4]=c,n[5]=l,e}translate(e,n){return this.multiply([1,0,0,1,e,n])}rotate(e){const n=e*Math.PI/180,i=Math.cos(n),r=Math.sin(n);return this.multiply([i,r,-r,i,0,0])}skew(e,n=0){const i=e*Math.PI/180,r=n*Math.PI/180,o=Math.tan(i),s=Math.tan(r);return this.multiply([1,s,o,1,0,0])}scale(e,n){return this.multiply([e,0,0,n,0,0])}transformPoint(e,n){const i=e,r=n;return e=i*this.m[0]+r*this.m[2]+this.m[4],n=i*this.m[1]+r*this.m[3]+this.m[5],[e,n]}transformVector(e,n){const i=e,r=n;return e=i*this.m[0]+r*this.m[2],n=i*this.m[1]+r*this.m[3],[e,n]}}class fn{x;y;z;constructor(e=[0,0,0],n=[0,0,0]){const[i,r,o]=e,[s,a,c]=n;this.x=i-s,this.y=r-a,this.z=o-c}get length(){const{x:e,y:n,z:i}=this;return Math.sqrt(e*e+n*n+i*i)}unit(){const e=this.length;return new fn([this.x/e,this.y/e,this.z/e])}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){const n=this.x,i=this.y,r=this.z,o=e.x,s=e.y,a=e.z;return new fn([i*a-r*s,r*o-n*a,n*s-o*i])}}const Kt={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return .5*(1-Math.sin(Math.PI*(.5-t)))}},Exponential:{In:function(t){return t===0?0:Math.pow(1024,t-1)},Out:function(t){return t===1?1:1-Math.pow(2,-10*t)},InOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return t===0?0:t===1?1:-Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI)},Out:function(t){return t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t-.1)*5*Math.PI)+1},InOut:function(t){return t===0?0:t===1?1:(t*=2,t<1?-.5*Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin((t-1.1)*5*Math.PI)+1)}},Back:{In:function(t){return t===1?1:t*t*((1.70158+1)*t-1.70158)},Out:function(t){return t===0?0:--t*t*((1.70158+1)*t+1.70158)+1},InOut:function(t){const e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-Kt.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?Kt.Bounce.In(t*2)*.5:Kt.Bounce.Out(t*2-1)*.5+.5}},generatePow:function(t=4){return t=t<Number.EPSILON?Number.EPSILON:t,t=t>1e4?1e4:t,{In:function(e){return e**t},Out:function(e){return 1-(1-e)**t},InOut:function(e){return e<.5?(e*2)**t/2:(1-(2-e*2)**t)/2+.5}}},random:function(t){return Math.random()},createStep:function(t){return function(e){return Math.floor(e*t)/t}},createNoisyEasing:function(t,e=.1){const n=1-e;return function(i){return e*Math.random()+n*t(i)}}};let Ae;typeof self>"u"&&typeof process<"u"&&process.hrtime?Ae=function(){const t=process.hrtime();return t[0]*1e3+t[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?Ae=self.performance.now.bind(self.performance):Date.now!==void 0?Ae=Date.now:Ae=function(){return new Date().getTime()};const Jt=Ae;class Is{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(e=>this._tweens[e])}removeAll(){this._tweens={}}add(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e}remove(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]}update(e=Jt(),n=!1){let i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(let r=0;r<i.length;r++){const o=this._tweens[i[r]],s=!n;o&&o.update(e,s)===!1&&!n&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0}}const Lt={Linear:function(t,e){const n=t.length-1,i=n*e,r=Math.floor(i),o=Lt.Utils.Linear;return e<0?o(t[0],t[1],i):e>1?o(t[n],t[n-1],n-i):o(t[r],t[r+1>n?n:r+1],i-r)},Bezier:function(t,e){let n=0;const i=t.length-1,r=Math.pow,o=Lt.Utils.Bernstein;for(let s=0;s<=i;s++)n+=r(1-e,i-s)*r(e,s)*t[s]*o(i,s);return n},CatmullRom:function(t,e){const n=t.length-1;let i=n*e,r=Math.floor(i);const o=Lt.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(r=Math.floor(i=n*(1+e))),o(t[(r-1+n)%n],t[r],t[(r+1)%n],t[(r+2)%n],i-r)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[n]-(o(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):o(t[r?r-1:0],t[r],t[n<r+1?n:r+1],t[n<r+2?n:r+2],i-r)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Factorial:function(){const t=[1];return function(e){let n=1;if(t[e])return t[e];for(let i=e;i>1;i--)n*=i;return t[e]=n,n}}(),Bernstein:function(t,e){const n=Lt.Utils.Factorial;return n(t)/n(e)/n(t-e)},CatmullRom:function(t,e,n,i,r){const o=(n-t)*.5,s=(i-e)*.5,a=r*r,c=r*a;return(2*e-2*n+o+s)*c+(-3*e+3*n-2*o-s)*a+o*r+e}}};class Ce{static _nextId=0;static nextId(){return Ce._nextId++}}const K=new Is;class qd{constructor(e,n=K){this._object=e,this._group=n}_id=Ce.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=Kt.Linear.None;_interpolationFunction=Lt.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(e,n){return this._valuesEnd=Object.create(e),n!==void 0&&(this._durationTime=n),this}duration(e=1e3){return this._durationTime=e,this}start(e=Jt()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(e,n,i,r){for(const o in i){const s=e[o],a=Array.isArray(s),c=a?"array":typeof s,l=!a&&Array.isArray(i[o]);if(!(c==="undefined"||c==="function")){if(l){let f=i[o];if(f.length===0)continue;f=f.map(this._handleRelativeValue.bind(this,s)),i[o]=[s].concat(f)}if((c==="object"||a)&&s&&!l){n[o]=a?[]:{};for(const f in s)n[o][f]=s[f];r[o]=a?[]:{},this._setupProperties(s,n[o],i[o],r[o])}else typeof n[o]>"u"&&(n[o]=s),a||(n[o]*=1),l?r[o]=i[o].slice().reverse():r[o]=n[o]||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(e=Jt()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=e,this._group&&this._group.remove(this),this)}resume(e=Jt()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let e=0,n=this._chainedTweens.length;e<n;e++)this._chainedTweens[e].stop();return this}group(e=K){return this._group=e,this}delay(e=0){return this._delayTime=e,this}repeat(e=0){return this._initialRepeat=e,this._repeat=e,this}repeatDelay(e){return this._repeatDelayTime=e,this}yoyo(e=!1){return this._yoyo=e,this}easing(e=Kt.Linear.None){return this._easingFunction=e,this}interpolation(e=Lt.Linear){return this._interpolationFunction=e,this}chain(...e){return this._chainedTweens=e,this}onStart(e){return this._onStartCallback=e,this}onEveryStart(e){return this._onEveryStartCallback=e,this}onUpdate(e){return this._onUpdateCallback=e,this}onRepeat(e){return this._onRepeatCallback=e,this}onComplete(e){return this._onCompleteCallback=e,this}onStop(e){return this._onStopCallback=e,this}update(e=Jt(),n=!0){if(this._isPaused)return!0;let i,r;const o=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(e>o)return!1;n&&this.start(e)}if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),r=(e-this._startTime)/this._durationTime,r=this._durationTime===0||r>1?1:r;const s=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let a=0,c=this._chainedTweens.length;a<c;a++)this._chainedTweens[a].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(e,n,i,r){for(const o in i){if(n[o]===void 0)continue;const s=n[o]||0;let a=i[o];const c=Array.isArray(e[o]),l=Array.isArray(a);!c&&l?e[o]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(e[o],s,a,r):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(e[o]=s+(a-s)*r))}}_handleRelativeValue(e,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?e+parseFloat(n):parseFloat(n)}_swapEndStartRepeatValues(e){const n=this._valuesStartRepeat[e],i=this._valuesEnd[e];typeof i=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(i):this._valuesStartRepeat[e]=i,this._valuesEnd[e]=n}}const Zd=Ce.nextId,Gd=K.getAll.bind(K),Xd=K.removeAll.bind(K),$d=K.add.bind(K),Vd=K.remove.bind(K),Yd=K.update.bind(K),Wd={Easing:Kt,Group:Is,Interpolation:Lt,now:Jt,Sequence:Ce,nextId:Zd,Tween:qd,getAll:Gd,removeAll:Xd,add:$d,remove:Vd,update:Yd};function Ds(t){const e=document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttribute("d",t),e}function Kd(t,e){const n=Ds(t),{x:i,y:r}=n.getPointAtLength(e);return[i,r]}function Jd(t,e){return Ds(t).getTotalLength(e)}let J=null;function Qd({d:t},e,n){J||(J=document.createElement("canvas").getContext("2d"));const i=new Path2D(t);return J.isPointInPath(i,e,n)}function Ps({d:t},e,n,{lineWidth:i=1,lineCap:r="butt",lineJoin:o="miter"}){if(J||(J=document.createElement("canvas").getContext("2d")),J.isPointInStroke){J.save(),J.lineWidth=i,J.lineCap=r,J.lineJoin=o;const s=new Path2D(t),a=J.isPointInStroke(s,e,n);return J.restore(),a}}var Pi={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t0=/([astvzqmhlc])([^astvzqmhlc]*)/gi;function e0(t){var e=[];return t.replace(t0,function(n,i,r){var o=i.toLowerCase();for(r=i0(r),o=="m"&&r.length>2&&(e.push([i].concat(r.splice(0,2))),o="l",i=i=="m"?"l":"L");;){if(r.length==Pi[o])return r.unshift(i),e.push(r);if(r.length<Pi[o])throw new Error("malformed path data");e.push([i].concat(r.splice(0,Pi[o])))}}),e}var n0=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function i0(t){var e=t.match(n0);return e?e.map(Number):[]}function r0(t){var e=0,n=0,i=0,r=0;return t.map(function(o){o=o.slice();var s=o[0],a=s.toUpperCase();if(s!=a)switch(o[0]=a,s){case"a":o[6]+=i,o[7]+=r;break;case"v":o[1]+=r;break;case"h":o[1]+=i;break;default:for(var c=1;c<o.length;)o[c++]+=i,o[c++]+=r}switch(a){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})}const Ie=Math.PI*2;function Ms(t,e,n,i){const r=t*i-e*n<0?-1:1;let o=t*n+e*i;return o>1&&(o=1),o<-1&&(o=-1),r*Math.acos(o)}function o0(t,e,n,i,r,o,s,a,c,l){const f=l*(t-n)/2+c*(e-i)/2,u=-c*(t-n)/2+l*(e-i)/2,d=s*s,h=a*a,_=f*f,p=u*u;let g=d*h-d*p-h*_;g<0&&(g=0),g/=d*p+h*_,g=Math.sqrt(g)*(r===o?-1:1);const m=g*s/a*u,y=g*-a/s*f,b=l*m-c*y+(t+n)/2,v=c*m+l*y+(e+i)/2,E=(f-m)/s,x=(u-y)/a,S=(-f-m)/s,C=(-u-y)/a,k=Ms(1,0,E,x);let A=Ms(E,x,S,C);return o===0&&A>0&&(A-=Ie),o===1&&A<0&&(A+=Ie),[b,v,k,A]}function s0(t,e){const n=1.3333333333333333*Math.tan(e/4),i=Math.cos(t),r=Math.sin(t),o=Math.cos(t+e),s=Math.sin(t+e);return[i,r,i-r*n,r+i*n,o+s*n,s-o*n,o,s]}function a0(t,e,n,i,r,o,s,a,c){const l=Math.sin(c*Ie/360),f=Math.cos(c*Ie/360),u=f*(t-n)/2+l*(e-i)/2,d=-l*(t-n)/2+f*(e-i)/2;if(u===0&&d===0)return[];if(s===0||a===0)return[];s=Math.abs(s),a=Math.abs(a);const h=u*u/(s*s)+d*d/(a*a);h>1&&(s*=Math.sqrt(h),a*=Math.sqrt(h));const _=o0(t,e,n,i,r,o,s,a,l,f),p=[];let g=_[2],m=_[3];const y=Math.max(Math.ceil(Math.abs(m)/(Ie/4)),1);m/=y;for(let b=0;b<y;b++)p.push(s0(g,m)),g+=m;return p.map(b=>{for(let v=0;v<b.length;v+=2){let E=b[v+0],x=b[v+1];E*=s,x*=a;const S=f*E-l*x,C=l*E+f*x;b[v+0]=S+_[0],b[v+1]=C+_[1]}return b})}function l0(t){for(var e,n=[],i=0,r=0,o=0,s=0,a=null,c=null,l=0,f=0,u=0,d=t.length;u<d;u++){var h=t[u],_=h[0];switch(_){case"M":o=h[1],s=h[2];break;case"A":var p=a0(l,f,h[6],h[7],h[4],h[5],h[1],h[2],h[3]);if(!p.length)continue;p=p.map(v=>{const[E,x,S,C,k,A,D,P]=v;return{x1:S,y1:C,x2:k,y2:A,x:D,y:P}});for(var g=0,m;g<p.length;g++)m=p[g],h=["C",m.x1,m.y1,m.x2,m.y2,m.x,m.y],g<p.length-1&&n.push(h);break;case"S":var y=l,b=f;(e=="C"||e=="S")&&(y+=y-i,b+=b-r),h=["C",y,b,h[1],h[2],h[3],h[4]];break;case"T":e=="Q"||e=="T"?(a=l*2-a,c=f*2-c):(a=l,c=f),h=Rs(l,f,a,c,h[1],h[2]);break;case"Q":a=h[1],c=h[2],h=Rs(l,f,h[1],h[2],h[3],h[4]);break;case"L":h=un(l,f,h[1],h[2]);break;case"H":h=un(l,f,h[1],f);break;case"V":h=un(l,f,l,h[1]);break;case"Z":h=un(l,f,o,s);break}e=_,l=h[h.length-2],f=h[h.length-1],h.length>4?(i=h[h.length-4],r=h[h.length-3]):(i=l,r=f),n.push(h)}return n}function un(t,e,n,i){return["C",t,e,n,i,n,i]}function Rs(t,e,n,i,r,o){return["C",t/3+.6666666666666666*n,e/3+.6666666666666666*i,r/3+.6666666666666666*n,o/3+.6666666666666666*i,r,o]}function c0(t){return typeof t!="string"?!1:(t=t.trim(),/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4)}const dn=Symbol("initialPath"),dt=Symbol("path"),St=Symbol("bounds"),_n=Symbol("savedPaths"),_t=Symbol("renderProps"),Mi=Symbol("beginPath");class h0{constructor(e){if(!c0(e))throw new Error("Not an SVG path!");this[dn]=r0(e0(e)),this[dt]=l0(this[dn]),this[St]=null,this[_n]=[],this[_t]={},this[Mi]=!1}save(){return this[_n].push({path:this[dt],bounds:this[St],renderProps:Object.assign({},this[_t])}),this}restore(){if(this[_n].length){const{path:e,bounds:n,renderProps:i}=this[_n].pop();this[dt]=e,this[St]=n,this[_t]=i}return this}get bounds(){if(!this[St]){const e=this[dt];if(this[St]=[0,0,0,0],e.length){const n=[1/0,1/0,-1/0,-1/0];for(let i=0,r=e.length;i<r;i++){const o=e[i].slice(1);for(let s=0;s<o.length;s+=2)o[s+0]<n[0]&&(n[0]=o[s+0]),o[s+1]<n[1]&&(n[1]=o[s+1]),o[s+0]>n[2]&&(n[2]=o[s+0]),o[s+1]>n[3]&&(n[3]=o[s+1])}this[St]=n}}return this[St]}get size(){const e=this.bounds;return[e[2]-e[0],e[3]-e[1]]}get center(){const[e,n,i,r]=this.bounds;return[(e+i)/2,(n+r)/2]}get d(){let e=this[dt].map(n=>{const[i,...r]=n;return i+r.join()}).join("");return this.isClosed&&(e+="Z"),e}get path(){return this[dt]}get isClosed(){const e=this[dn][this[dn].length-1];return e&&e[0]==="Z"}isPointInPath(e,n){return Qd(this,e,n)}isPointInStroke(e,n,{lineWidth:i=1,lineCap:r="butt",lineJoin:o="miter"}){if(Ps)return Ps(this,e,n,{lineWidth:i,lineCap:r,lineJoin:o})}getPointAtLength(e){return Kd(this.d,e)}getTotalLength(){return Jd(this.d)}transform(...e){this[St]=null;const n=new ut(e),i=this[dt];return this[dt]=i.map(r=>{const[o,...s]=r,a=[o];for(let c=0;c<s.length;c+=2){const l=s[c],f=s[c+1],[u,d]=n.transformPoint(l,f);a.push(u,d)}return a}),this}translate(e,n){const i=new ut().translate(e,n);return this.transform(...i.m)}rotate(e){const n=new ut().rotate(e);return this.transform(...n.m)}scale(e,n){n==null&&(n=e);const i=new ut().scale(e,n);return this.transform(...i.m)}skew(e,n){const i=new ut().skew(e,n);return this.transform(...i.m)}trim(){const[e,n]=this.bounds;return this.translate(-e,-n),this}beginPath(){return this[Mi]=!0,this}toCanvas(e){const n=this[dt],i=this[_t];return n.length&&(this[Mi]&&e.beginPath(),n.forEach(r=>{const[o,...s]=r;o==="M"?e.moveTo(...s):e.bezierCurveTo(...s)}),this.isClosed&&e.closePath()),Object.assign(e,i),{stroke(){return e.stroke(),this},fill(){return e.fill(),this}}}strokeStyle(e){return this[_t].strokeStyle=e,this}fillStyle(e){return this[_t].fillStyle=e,this}lineWidth(e){return this[_t].lineWidth=e,this}lineCap(e){return this[_t].lineCap=e,this}lineJoin(e){return this[_t].lineJoin=e,this}}const Os=f0("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 f0(t,e=10){const n={},i=t.split(",");for(let r=0;r<i.length;r+=2){const o="&"+i[r+1]+";",s=parseInt(i[r],e);n[o]="&#"+s+";"}return n["\\xa0"]="&#160;",n}function Z(t,e){const n=Object.keys(e);for(let i=0;i<n.length;i++)t=t.replace(new RegExp("{"+n[i]+"}","gi"),""+e[n[i]]);return t}function gn(t){let e,n;if(!t)throw new Error("cannot create a random attribute name for an undefined object");const i="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";e="";do for(e="",n=0;n<12;n++)e+=i[Math.floor(Math.random()*i.length)];while(t[e]);return e}function u0(t){const e={left:"start",right:"end",center:"middle",start:"start",end:"end"};return e[t]||e.start}function d0(t){const e={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return e[t]||e.alphabetic}const De={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class Ri{__root;__ctx;constructor(e,n){this.__root=e,this.__ctx=n}addColorStop(e,n){const i=this.__ctx.__createElement("stop");if(i.setAttribute("offset",""+e),n.indexOf("rgba")!==-1){const o=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(n);o&&(i.setAttribute("stop-color",Z("rgb({r},{g},{b})",{r:o[1],g:o[2],b:o[3]})),i.setAttribute("stop-opacity",o[4]))}else i.setAttribute("stop-color",n);this.__root.appendChild(i)}}class Ls{__root;__ctx;constructor(e,n){this.__root=e,this.__ctx=n}}class pn{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:e,width:n=500,height:i=500,enableMirroring:r=!1}){this.enableMirroring=r,e?(this.__canvas=e,this.__ctx=e.getContext("2d"),this.width=e.width,this.height=e.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=n,this.height=i),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const e=Object.keys(De);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=De[r].canvas}}__getStyleState(){const e={},n=Object.keys(De);for(let i=0,r=n.length;i<r;i++){const o=n[i];e[o]=this[o]}return e}__applyStyleState(e){const n=Object.keys(e);for(let i=0,r=n.length;i<r;i++){const o=n[i];this[o]=e[o]}}__createElement(e,n={},i=!1){const r=this.__document.createElementNS("http://www.w3.org/2000/svg",e),o=Object.keys(n);i&&(r.setAttribute("fill","none"),r.setAttribute("stroke","none"));for(let s=0;s<o.length;s++){const a=o[s];r.setAttribute(a,n[a])}return r}__applyStyleToCurrentElement(e){let n=this.__currentElement;const i=this.__currentElementsToStyle;i&&(n.setAttribute(e,""),n=i.element,i.children.forEach(o=>{o.setAttribute(e,"")}));const r=Object.keys(De);for(let o=0;o<r.length;o++){const s=De[r[o]],a=this[r[o]];if(s.apply){if(a instanceof Ls){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const c=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[c]=c,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}n.setAttribute(s.apply,Z("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof Ri)n.setAttribute(s.apply,Z("url(#{id})",{id:a.__root.getAttribute("id")}));else if(s.apply.indexOf(e)!==-1&&s.svg!==a)if((s.svgAttr==="stroke"||s.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const l=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);n.setAttribute(s.svgAttr,Z("rgb({r},{g},{b})",{r:l[1],g:l[2],b:l[3]}));let f=parseFloat(l[4]);const u=this.globalAlpha;u!=null&&(f*=u),n.setAttribute(s.svgAttr+"-opacity",""+f)}else{let c=s.svgAttr;if(r[o]==="globalAlpha"&&(c=e+"-"+s.svgAttr,n.getAttribute(c)))continue;c&&n.setAttribute(c,a)}}}}__closestGroupOrSvg(e){return e=e||this.__currentElement,e.nodeName==="g"||e.nodeName==="svg"?e:this.__closestGroupOrSvg(e.parentNode)}getSerializedSvg(e){let n=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(n)&&(n=n.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),e){const r=Object.keys(Os);for(let o=0,s=r.length;o<s;o++){const a=r[o],c=Os[a],l=new RegExp(a,"gi");l.test(n)&&(n=n.replace(l,c))}}return n}getSvg(){return this.__rootSVG}save(){const e=this.__createElement("g"),n=this.__closestGroupOrSvg();this.__groupStack.push(n),n.appendChild(e),this.__currentElement=e,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const e=this.__groupStack.pop();e?this.__currentElement=e:this.__currentElement=this.__rootSVG.childNodes[1];const n=this.__styleStack.pop();n&&this.__applyStyleState(n)}__addTransform(e){const n=this.__closestGroupOrSvg();if(n.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:n,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const r=this.__createElement("g");n.appendChild(r),this.__currentElement=r}let i=this.__currentElement.getAttribute("transform");i?i+=" ":i="",i+=e,this.__currentElement.setAttribute("transform",i)}scale(e,n){n===void 0&&(n=e),this.__addTransform(Z("scale({x},{y})",{x:e,y:n}))}rotate(e){const n=e*180/Math.PI;this.__addTransform(Z("rotate({angle},{cx},{cy})",{angle:n,cx:0,cy:0}))}translate(e,n){this.__addTransform(Z("translate({x},{y})",{x:e,y:n}))}transform(e,n,i,r,o,s){this.__addTransform(Z("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:n,c:i,d:r,e:o,f:s}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const e=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(e),this.__currentElement=e}__applyCurrentDefaultPath(){const e=this.__currentElement;e.nodeName==="path"?e.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",e.nodeName)}__addPathCommand(e){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=e}moveTo(e,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:e,y:n},this.__addPathCommand(Z("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(e,n){this.__currentPosition={x:e,y:n},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(Z("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Z("M {x} {y}",this.__currentPosition))}bezierCurveTo(e,n,i,r,o,s){this.__currentPosition={x:o,y:s},this.__addPathCommand(Z("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:n,cp2x:i,cp2y:r,x:o,y:s}))}quadraticCurveTo(e,n,i,r){this.__currentPosition={x:i,y:r},this.__addPathCommand(Z("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:n,x:i,y:r}))}normalize(e){const n=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/n,e[1]/n]}arcTo(e,n,i,r,o){const s=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof s>"u"||typeof a>"u")return;if(o<0)throw new Error("IndexSizeError: The radius provided ("+o+") is negative.");if(s===e&&a===n||e===i&&n===r||o===0){this.lineTo(e,n);return}const c=this.normalize([s-e,a-n]),l=this.normalize([i-e,r-n]);if(c[0]*l[1]===c[1]*l[0]){this.lineTo(e,n);return}const f=c[0]*l[0]+c[1]*l[1],u=Math.acos(Math.abs(f)),d=this.normalize([c[0]+l[0],c[1]+l[1]]),h=o/Math.sin(u/2),_=e+h*d[0],p=n+h*d[1],g=[-c[1],c[0]],m=[l[1],-l[0]],y=function(E){const x=E[0];return E[1]>=0?Math.acos(x):-Math.acos(x)},b=y(g),v=y(m);this.lineTo(_+g[0]*o,p+g[1]*o),this.arc(_,p,o,b,v)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(e,n,i,r){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(e,n),this.lineTo(e+i,n),this.lineTo(e+i,n+r),this.lineTo(e,n+r),this.lineTo(e,n),this.closePath()}fillRect(e,n,i,r){const o=this.__createElement("rect",{x:e,y:n,width:i,height:r},!0);this.__closestGroupOrSvg().appendChild(o),this.__currentElement=o,this.__applyStyleToCurrentElement("fill")}strokeRect(e,n,i,r){const o=this.__createElement("rect",{x:e,y:n,width:i,height:r},!0);this.__closestGroupOrSvg().appendChild(o),this.__currentElement=o,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const n=this.__closestGroupOrSvg().getAttribute("transform"),i=this.__rootSVG.childNodes[1],r=i.childNodes;for(let o=r.length-1;o>=0;o--)r[o]&&i.removeChild(r[o]);this.__currentElement=i,this.__groupStack=[],n&&this.__addTransform(n)}clearRect(e,n,i,r){if(e===0&&n===0&&i===this.width&&r===this.height){this.__clearCanvas();return}const o=this.__closestGroupOrSvg(),s=this.__createElement("rect",{x:e,y:n,width:i,height:r,fill:"#FFFFFF"},!0);o.appendChild(s)}createLinearGradient(e,n,i,r){const o=this.__createElement("linearGradient",{id:gn(this.__ids),x1:e+"px",x2:i+"px",y1:n+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new Ri(o,this)}createRadialGradient(e,n,i,r,o,s){const a=this.__createElement("radialGradient",{id:gn(this.__ids),cx:r+"px",cy:o+"px",r:s+"px",fx:e+"px",fy:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new Ri(a,this)}__parseFont(){const n=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),i={style:n[1]||"normal",size:n[4]||"10px",family:n[6]||"sans-serif",weight:n[3]||"normal",decoration:n[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(i.decoration="underline"),this.__fontHref&&(i.href=this.__fontHref),i}__wrapTextLink(e,n){if(e.href){const i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.href),i.appendChild(n),i}return n}__applyText(e,n,i,r){const o=this.__parseFont(),s=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":o.family,"font-size":o.size,"font-style":o.style,"font-weight":o.weight,"text-decoration":o.decoration,x:n,y:i,"text-anchor":u0(this.textAlign),"dominant-baseline":d0(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(e)),this.__currentElement=a,this.__applyStyleToCurrentElement(r),s.appendChild(this.__wrapTextLink(o,a))}fillText(e,n,i){this.__applyText(e,n,i,"fill")}strokeText(e,n,i){this.__applyText(e,n,i,"stroke")}measureText(e){return this.__ctx.font=this.font,this.__ctx.measureText(e)}arc(e,n,i,r,o,s){if(r===o)return;r=r%(2*Math.PI),o=o%(2*Math.PI),r===o&&(o=(o+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));const a=e+i*Math.cos(o),c=n+i*Math.sin(o),l=e+i*Math.cos(r),f=n+i*Math.sin(r),u=s?0:1;let d=0,h=o-r;h<0&&(h+=2*Math.PI),s?d=h>Math.PI?0:1:d=h>Math.PI?1:0,this.lineTo(l,f),this.__addPathCommand(Z("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:d,sweepFlag:u,endX:a,endY:c})),this.__currentPosition={x:a,y:c}}clip(){const e=this.__closestGroupOrSvg(),n=this.__createElement("clipPath"),i=gn(this.__ids),r=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),n.setAttribute("id",i),n.appendChild(this.__currentElement),this.__SVGdefs.appendChild(n),e.setAttribute("clip-path",Z("url(#{id})",{id:i})),e.appendChild(r),this.__currentElement=r}drawImage(...e){let n=e[0],i,r,o,s,a=0,c=0,l,f,u,d,h,_,p,g;if(e.length===3)i=e[1],r=e[2],l=n.width,f=n.height,o=l,s=f;else if(e.length===5)i=e[1],r=e[2],o=e[3],s=e[4],l=n.width,f=n.height;else if(e.length===9)a=e[1],c=e[2],l=e[3],f=e[4],i=e[5],r=e[6],o=e[7],s=e[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const m=this.__closestGroupOrSvg();this.__currentElement;const y="translate("+i+", "+r+")";if(n instanceof pn){if(u=n.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(d=u.childNodes[0];d.childNodes.length;)g=d.childNodes[0].getAttribute("id"),this.__ids[g]=g,this.__SVGdefs.appendChild(d.childNodes[0]);if(h=u.childNodes[1],h){const b=h.getAttribute("transform");let v;b?v=b+" "+y:v=y,h.setAttribute("transform",v),m.appendChild(h)}}}else(n.nodeName==="CANVAS"||n.nodeName==="IMG")&&(_=this.__createElement("image"),_.setAttribute("width",o),_.setAttribute("height",s),_.setAttribute("preserveAspectRatio","none"),(a||c||l!==n.width||f!==n.height)&&(p=this.__document.createElement("canvas"),p.width=o,p.height=s,p.getContext("2d")?.drawImage(n,a,c,l,f,0,0,o,s),n=p),_.setAttribute("transform",y),_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n.nodeName==="CANVAS"?n.toDataURL():n.getAttribute("src")),m.appendChild(_))}createPattern(e,n){const i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),r=gn(this.__ids);let o;return i.setAttribute("id",r),e.nodeName==="CANVAS"||e.nodeName==="IMG"?(o=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),o.setAttribute("width",""+e.width),o.setAttribute("height",""+e.height),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),i.appendChild(o),this.__SVGdefs.appendChild(i)):e instanceof pn&&(i.setAttribute("width",""+e.width),i.setAttribute("height",""+e.height),i.appendChild(e.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(i)),new Ls(i,this)}setLineDash(e){e&&e.length>0?this.lineDash=e.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}const _0=pn,g0=function(t,e,n,i,r,o){t.beginPath(),t.moveTo(e,n+o),t.lineTo(e,n+r-o),t.quadraticCurveTo(e,n+r,e+o,n+r),t.lineTo(e+i-o,n+r),t.quadraticCurveTo(e+i,n+r,e+i,n+r-o),t.lineTo(e+i,n+o),t.quadraticCurveTo(e+i,n,e+i-o,n),t.lineTo(e+o,n),t.quadraticCurveTo(e,n,e,n+o),t.stroke()},p0=function(t,e,n,i){var r=e-i,o=0,s=1;t.beginPath(),t.moveTo(r,o);do{if(s>2e4)break;var a=(e+n)*Math.cos(s*Math.PI/72)-(n+i)*Math.cos((e+n)/n*(s*Math.PI/72)),c=(e+n)*Math.sin(s*Math.PI/72)-(n+i)*Math.sin((e+n)/n*(s*Math.PI/72));t.lineTo(a,c),r=a,o=c,s++}while(a!=e-i&&c!=0);t.stroke()},m0=function(t,e){t.save(),t.beginPath(),t.moveTo(e,0);for(var n=0;n<9;n++)t.rotate(Math.PI/5),n%2==0?t.lineTo(e/.525731*.200811,0):t.lineTo(e,0);t.closePath(),t.fill(),t.restore()},w0=function(t,e,n,i,r){var o=0;function s(){t.clearRect(e,n,i,r),t.setLineDash([4,2]),t.lineDashOffset=-o,t.strokeRect(e,n,i,r)}function a(){o++,o>16&&(o=0),s(),setTimeout(a,40)}a()},y0=function(t){t.beginPath(),t.arc(75,75,50,0,Math.PI*2,!0),t.moveTo(110,75),t.arc(75,75,35,0,Math.PI,!1),t.moveTo(65,65),t.arc(60,65,5,0,Math.PI*2,!0),t.moveTo(95,65),t.arc(90,65,5,0,Math.PI*2,!0),t.stroke()};class v0{constructor(e=0,n=0,i="#ffff00",r=0){this.x=e,this.y=n,this.color=i,this.rotation=r}draw(e){e.save(),e.translate(this.x,this.y),e.rotate(this.rotation),e.lineWidth=2,e.fillStyle=this.color,e.beginPath(),e.moveTo(-50,-25),e.lineTo(0,-25),e.lineTo(0,-50),e.lineTo(50,0),e.lineTo(0,50),e.lineTo(0,25),e.lineTo(-50,25),e.lineTo(-50,-25),e.closePath(),e.fill(),e.stroke(),e.restore()}}class b0{constructor(e=40,n="#ff0000"){this.x=0,this.y=0,this.radius=e,this.vx=0,this.vy=0,this.mass=1,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=st(n),this.lineWidth=1}draw(e){e.save(),e.translate(this.x,this.y),e.rotate(this.rotation),e.scale(this.scaleX,this.scaleY),e.lineWidth=this.lineWidth,e.fillStyle=this.color,e.beginPath(),e.arc(0,0,this.radius,0,Math.PI*2,!0),e.closePath(),e.fill(),this.lineWidth>0&&e.stroke(),e.restore()}getBounds(){return{x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2}}}class x0{constructor(e=40,n="#ff0000"){this.x=0,this.y=0,this.xpos=0,this.ypos=0,this.zpos=0,this.radius=e,this.vx=0,this.vy=0,this.vz=0,this.mass=1,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=st(n),this.lineWidth=1,this.visible=!0}draw(e){e.save(),e.translate(this.x,this.y),e.rotate(this.rotation),e.scale(this.scaleX,this.scaleY),e.lineWidth=this.lineWidth,e.fillStyle=this.color,e.beginPath(),e.arc(0,0,this.radius,0,Math.PI*2,!0),e.closePath(),e.fill(),this.lineWidth>0&&e.stroke(),e.restore()}}class E0{constructor(e=50,n=50,i="#ff0000"){this.x=0,this.y=0,this.width=e,this.height=n,this.vx=0,this.vy=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=st(i),this.lineWidth=1}draw(e){e.save(),e.translate(this.x,this.y),e.rotate(this.rotation),e.scale(this.scaleX,this.scaleY),e.lineWidth=this.lineWidth,e.fillStyle=this.color,e.beginPath(),e.rect(0,0,this.width,this.height),e.closePath(),e.fill(),this.lineWidth>0&&e.stroke(),e.restore()}}class S0{constructor(e,n,i,r){this.x=e===void 0?-100:e,this.y=n===void 0?-100:n,this.z=i===void 0?-100:i,this.brightness=r===void 0?1:r}setBrightness(e){this.brightness=Math.min(Math.max(e,0),1)}}class T0{constructor(e,n,i,r){this.x=0,this.y=0,this.x1=e===void 0?0:e,this.y1=n===void 0?0:n,this.x2=i===void 0?0:i,this.y2=r===void 0?0:r,this.rotation=0,this.scaleX=1,this.scaleY=1,this.lineWidth=1}draw(e){e.save(),e.translate(this.x,this.y),e.rotate(this.rotation),e.scale(this.scaleX,this.scaleY),e.lineWidth=this.lineWidth,e.beginPath(),e.moveTo(this.x1,this.y1),e.lineTo(this.x2,this.y2),e.closePath(),e.stroke(),e.restore()}getBounds(){if(this.rotation===0){var e=Math.min(this.x1,this.x2),n=Math.min(this.y1,this.y2),i=Math.max(this.x1,this.x2),r=Math.max(this.y1,this.y2);return{x:this.x+e,y:this.y+n,width:i-e,height:r-n}}else{var o=Math.sin(this.rotation),s=Math.cos(this.rotation),a=s*this.x1-o*this.y1,c=s*this.x2-o*this.y2,l=s*this.y1+o*this.x1,f=s*this.y2+o*this.x2;return{x:this.x+Math.min(a,c),y:this.y+Math.min(l,f),width:Math.max(a,c)-Math.min(a,c),height:Math.max(l,f)-Math.min(l,f)}}}}class k0{constructor(e,n,i){this.x=e===void 0?0:e,this.y=n===void 0?0:n,this.z=i===void 0?0:i,this.fl=250,this.vpX=0,this.vpY=0,this.cX=0,this.cY=0,this.cZ=0}setVanishingPoint(e,n){this.vpX=e,this.vpY=n}setCenter(e,n,i){this.cX=e,this.cY=n,this.cZ=i}rotateX(e){var n=Math.cos(e),i=Math.sin(e),r=this.y*n-this.z*i,o=this.z*n+this.y*i;this.y=r,this.z=o}rotateY(e){var n=Math.cos(e),i=Math.sin(e),r=this.x*n-this.z*i,o=this.z*n+this.x*i;this.x=r,this.z=o}rotateZ(e){var n=Math.cos(e),i=Math.sin(e),r=this.x*n-this.y*i,o=this.y*n+this.x*i;this.x=r,this.y=o}getScreenX(){var e=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*e}getScreenY(){var e=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*e}}class A0{constructor(){this.x=0,this.y=0,this.width=25,this.height=20,this.rotation=0,this.showFlame=!1}draw(e){e.save(),e.translate(this.x,this.y),e.rotate(this.rotation),e.lineWidth=1,e.strokeStyle="#ffffff",e.beginPath(),e.moveTo(10,0),e.lineTo(-10,10),e.lineTo(-5,0),e.lineTo(-10,-10),e.lineTo(10,0),e.closePath(),e.stroke(),this.showFlame&&(e.beginPath(),e.moveTo(-7.5,-5),e.lineTo(-15,0),e.lineTo(-7.5,5),e.closePath(),e.stroke()),e.restore()}}class C0{constructor(e,n,i){this.min=e===void 0?0:e,this.max=n===void 0?100:n,this.value=i===void 0?100:i,this.onchange=null,this.x=0,this.y=0,this.width=16,this.height=100,this.backColor="#cccccc",this.backBorderColor="#999999",this.backWidth=4,this.backX=this.width/2-this.backWidth/2,this.handleColor="#eeeeee",this.handleBorderColor="#cccccc",this.handleHeight=6,this.handleY=0,this.updatePosition()}draw(e){e.save(),e.translate(this.x,this.y),e.fillStyle=this.backColor,e.beginPath(),e.fillRect(this.backX,0,this.backWidth,this.height),e.closePath(),e.strokeStyle=this.handleBorderColor,e.fillStyle=this.handleColor,e.beginPath(),e.rect(0,this.handleY,this.width,this.handleHeight),e.closePath(),e.fill(),e.stroke(),e.restore()}updateValue(){var e=this.value,n=this.height-this.handleHeight,i=this.max-this.min;this.value=(n-this.handleY)/n*i+this.min,typeof this.onchange=="function"&&this.value!==e&&this.onchange()}updatePosition(){var e=this.height-this.handleHeight,n=this.max-this.min;this.handleY=e-(this.value-this.min)/n*e}captureMouse(e){var n=this,i=Di(e),r={};a(),e.addEventListener("mousedown",function(){As(r,i.x,i.y)&&(e.addEventListener("mouseup",o,!1),e.addEventListener("mousemove",s,!1))},!1);function o(){e.removeEventListener("mousemove",s,!1),e.removeEventListener("mouseup",o,!1),a()}function s(){var c=i.y-n.y;n.handleY=Math.min(n.height-n.handleHeight,Math.max(c,0)),n.updateValue()}function a(){r.x=n.x,r.y=n.y+n.handleY,r.width=n.width,r.height=n.handleHeight}}}class I0{constructor(e,n,i,r){this.pointA=e,this.pointB=n,this.pointC=i,this.color=r===void 0?"#ff0000":st(r),this.lineWidth=1,this.alpha=1}draw(e){this.isBackface()||(e.save(),e.lineWidth=this.lineWidth,e.fillStyle=e.strokeStyle=Ii(this.color,this.alpha),e.beginPath(),e.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),e.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),e.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),e.closePath(),e.fill(),this.lineWidth>0&&e.stroke(),e.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){var e=this.pointC.getScreenX()-this.pointA.getScreenX(),n=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return e*r>n*i}}class D0{constructor(e,n,i,r){this.pointA=e,this.pointB=n,this.pointC=i,this.color=r===void 0?"#ff0000":st(r),this.lineWidth=1,this.alpha=1,this.light=null}draw(e){this.isBackface()||(e.save(),e.lineWidth=this.lineWidth,e.fillStyle=e.strokeStyle=this.getAdjustedColor(),e.beginPath(),e.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),e.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),e.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),e.closePath(),e.fill(),this.lineWidth>0&&e.stroke(),e.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){var e=this.pointC.getScreenX()-this.pointA.getScreenX(),n=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return e*r>n*i}getAdjustedColor(){var e=st(this.color,!0),n=e>>16,i=e>>8&255,r=e&255,o=this.getLightFactor();return n*=o,i*=o,r*=o,st(n<<16|i<<8|r)}getLightFactor(){var e={x:this.pointA.x-this.pointB.x,y:this.pointA.y-this.pointB.y,z:this.pointA.z-this.pointB.z},n={x:this.pointB.x-this.pointC.x,y:this.pointB.y-this.pointC.y,z:this.pointB.z-this.pointC.z},i={x:e.y*n.z-e.z*n.y,y:-(e.x*n.z-e.z*n.x),z:e.x*n.y-e.y*n.x},r=i.x*this.light.x+i.y*this.light.y+i.z*this.light.z,o=Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.z),s=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(r/(o*s))/Math.PI*this.light.brightness}}class P0{constructor(){this.x=0,this.y=0,this.xpos=0,this.ypos=0,this.zpos=0,this.scaleX=1,this.scaleY=1,this.color="#ffffff",this.alpha=1,this.lineWidth=1,this.branch=[],this.branch[0]=-140-Math.random()*20,this.branch[1]=-30-Math.random()*30,this.branch[2]=Math.random()*80-40,this.branch[3]=-100-Math.random()*40,this.branch[4]=-60-Math.random()*40,this.branch[5]=Math.random()*60-30,this.branch[6]=-110-Math.random()*20}draw(e){e.save(),e.translate(this.x,this.y),e.scale(this.scaleX,this.scaleY),e.lineWidth=this.lineWidth,e.strokeStyle=Ii(this.color,this.alpha),e.beginPath(),e.moveTo(0,0),e.lineTo(0,this.branch[0]),e.moveTo(0,this.branch[1]),e.lineTo(this.branch[2],this.branch[3]),e.moveTo(0,this.branch[4]),e.lineTo(this.branch[5],this.branch[6]),e.stroke(),e.restore()}}class M0{constructor(e,n,i){this.x=0,this.y=0,this.width=e,this.height=n,this.vx=0,this.vy=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=i===void 0?"#ffffff":st(i),this.lineWidth=1}draw(e){var n=this.height,i=this.width+n,r=n/2;e.save(),e.translate(this.x,this.y),e.rotate(this.rotation),e.scale(this.scaleX,this.scaleY),e.lineWidth=this.lineWidth,e.fillStyle=this.color,e.beginPath(),e.moveTo(0,-r),e.lineTo(i-2*r,-r),e.quadraticCurveTo(-r+i,-r,-r+i,0),e.lineTo(-r+i,n-2*r),e.quadraticCurveTo(-r+i,-r+n,i-2*r,-r+n),e.lineTo(0,-r+n),e.quadraticCurveTo(-r,-r+n,-r,n-2*r),e.lineTo(-r,0),e.quadraticCurveTo(-r,-r,0,-r),e.closePath(),e.fill(),this.lineWidth>0&&e.stroke(),e.beginPath(),e.arc(0,0,2,0,Math.PI*2,!0),e.closePath(),e.stroke(),e.beginPath(),e.arc(this.width,0,2,0,Math.PI*2,!0),e.closePath(),e.stroke(),e.restore()}getPin(){return{x:this.x+Math.cos(this.rotation)*this.width,y:this.y+Math.sin(this.rotation)*this.width}}}class R0{canvas;context;mouse;keyboard;constructor(e){this.canvas=e,this.context=e.getContext("2d",{willReadFrequently:!0}),this.mouse=Di(this.canvas),this.keyboard=Cs()}getMouseRotation(e){return Ai(e,this.mouse)}followMouse(e,n){const i=this.getMouseRotation(e),{x:r,y:o}=Ci(n,i);return e.x+=r,e.y+=o,e}followMouseWithAcceleration(e,n=.05){const i=this.getMouseRotation(e),{x:r,y:o}=Ci(n,i);return e.ax=r,e.ay=o,Ts(e),e}getMouseDistance(e){return Ss(e,this.mouse)}clearRect(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}lineWidth(e){return this.context.lineWidth=e,this}fillStyle(e){return this.context.fillStyle=e,this}fill(){return this.context.fill(),this}strokeStyle(e){return this.context.strokeStyle=e,this}stroke(){return this.context.stroke(),this}createLinearGradient(e,n,i){const r=this.context.createLinearGradient(e.x,e.y,n.x,n.y);return Object.keys(i).forEach(o=>r.addColorStop(parseFloat(o),i[parseFloat(o)])),r}createRadialGradient(e,n,i){const r=this.context.createRadialGradient(e.x,e.y,e.radius,n.x,n.y,n.radius);return Object.keys(i).forEach(o=>r.addColorStop(parseFloat(o),i[parseFloat(o)])),r}moveTo(e){this.context.moveTo(e.x,e.y)}closePath(){this.context.closePath()}lineTo(e,n){this.context.save(),this.context.beginPath(),this.context.moveTo(e.x,e.y),this.context.lineTo(n.x,n.y),this.context.stroke(),this.context.restore()}drawMouseMoveLine(){const e=()=>{this.context.lineTo(this.mouse.x,this.mouse.y),this.stroke()};this.canvas.addEventListener("mousedown",()=>{this.context.beginPath(),this.context.moveTo(this.mouse.x,this.mouse.y),this.canvas.addEventListener("mousemove",e,!1)},!1),this.canvas.addEventListener("mouseup",()=>{this.canvas.removeEventListener("mousemove",e,!1)},!1)}drawMouseMoveBrushLine({brush_size:e,brush_density:n,brush_color:i}={brush_size:25,brush_density:50,brush_color:"#000000"}){const r=this.getImageData(),o=r.data,s=st(i,!0),a=()=>{for(let c=0;c<n;c++){const l=Math.random()*Math.PI*2,f=Math.random()*e,u=this.mouse.x+Math.cos(l)*f|0,d=this.mouse.y+Math.sin(l)*f|0,h=(u+d*r.width)*4;o[h]=s>>16&255,o[h+1]=s>>8&255,o[h+2]=s&255,o[h+3]=255}this.putImageData(r)};this.canvas.addEventListener("mousedown",()=>{this.canvas.addEventListener("mousemove",a,!1)},!1),this.canvas.addEventListener("mouseup",()=>{this.canvas.removeEventListener("mousemove",a,!1)},!1)}quadraticCurveTo(e,n,i){this.context.save(),this.context.beginPath(),this.context.moveTo(e.x,e.y),this.context.quadraticCurveTo(n.x,n.y,i.x,i.y),this.context.stroke(),this.context.restore()}drawQuadraticCurveLine(e){const n=e.length;if(n<3)return new Error("points length must >= 3");this.context.beginPath(),this.context.moveTo(e[0].x,e[0].y);for(let i=1;i<n;i+=2)this.context.quadraticCurveTo(e[i].x,e[i].y,e[i+1].x,e[i+1].y);this.context.stroke()}quadraticThroughCurveTo(e,n,i){n.x=n.x*2-(e.x+i.x)/2,n.y=n.y*2-(e.y+i.y)/2,this.quadraticCurveTo(e,n,i)}drawQuadraticThroughCurveLine(e){const n=e.length;if(n<3)return new Error("points length must >= 3");this.context.beginPath(),this.context.moveTo(e[0].x,e[0].y);let i=1;for(;i<n-2;i++)this.context.quadraticCurveTo(e[i].x,e[i].y,(e[i].x+e[i+1].x)/2,(e[i].y+e[i+1].y)/2);this.context.quadraticCurveTo(e[i].x,e[i].y,e[i+1].x,e[i+1].y),this.context.stroke()}drawQuadraticThroughCurveLineBetter(e){const n=e.length;if(n<3)return new Error("points length must >= 3");const i=(e[0].x+e[n-1].x)/2,r=(e[0].y+e[n-1].y)/2;this.context.beginPath(),this.context.moveTo(i,r);let o=0;for(;o<n-1;o++){const s=(e[o].x+e[o+1].x)/2,a=(e[o].y+e[o+1].y)/2;this.context.quadraticCurveTo(e[o].x,e[o].y,s,a)}this.context.quadraticCurveTo(e[o].x,e[o].y,r,r),this.context.stroke()}fillRect(e){this.context.save(),this.context.fillRect(e.x,e.y,e.width,e.height),this.context.stroke(),this.context.restore()}drawImage(e,n=0,i=0){this.context.drawImage(e,n,i)}getImageData(e={x:0,y:0,width:this.canvas.width,height:this.canvas.height},n){return this.context.getImageData(e.x,e.y,e.width,e.height,n)}putImageData(e,n=0,i=0){return this.context.putImageData(e,n,i)}drawShape(e){e.draw(this.context)}}class Oi{static tryAutoPlayOrAutoPlayAfterClick(e){return new Promise(n=>{e.play().then(()=>{e.autoplay=!0,n(!0)}).catch(i=>{Oi.setAutoPlayWhenClick(e),n(!1)})})}static setAutoPlayWhenClick(e){function n(){e.autoplay=!0,e.play(),document.removeEventListener("click",n),document.removeEventListener("touchend",n)}document.addEventListener("click",n),document.addEventListener("touchend",n)}}function Us(t,e){return!t||t.parentElement===null?e:Us(t.parentElement,e.concat([t]))}const Li=function(t,e){return getComputedStyle(t,null).getPropertyValue(e)},O0=function(t){return Li(t,"overflow")+Li(t,"overflow-y")+Li(t,"overflow-x")},L0=function(t){return/(auto|scroll)/.test(O0(t))};function U0(t){if(!(t instanceof HTMLElement||t instanceof SVGElement))return;const e=Us(t.parentElement,[]);for(let n=0;n<e.length;n+=1)if(L0(e[n]))return e[n];return document.scrollingElement||document.documentElement}return w.Arrow=v0,w.Ball=b0,w.Ball3d=x0,w.BaseError=Me,w.Box=E0,w.C2S=_0,w.CanvasPath=R0,w.DOMKeyboardKeyCode=kt,w.Dep=Es,w.EnvironmentError=Fi,w.FileSelectCancelError=mn,w.IllegalFileError=zi,w.Light=S0,w.Line=T0,w.Matrix=ut,w.MimeType=Q,w.Point3d=k0,w.RGBToHex=Nd,w.Segment=M0,w.Ship=A0,w.Slider=C0,w.SvgPath=h0,w.TWEEN=Wd,w.Tree=P0,w.Triangle=I0,w.TriangleLight=D0,w.Vector=fn,w.VideoUtil=Oi,w.WebSocket=ae,w.addEventListener=Ac,w.addWatermark=ud,w.angle2radian=kd,w.animateCanvas=Oc,w.animateInWeb=Vr,w.base64urlDecode=sc,w.base64urlEncode=oc,w.blobToLinkExport=Fu,w.blobToRawImage=Uu,w.captureKeyboard=Cs,w.captureMouse=Di,w.capturePointer=Hd,w.captureTouch=jd,w.changeBrightness=hd,w.changeDiaphaneity=fd,w.changeSize=cd,w.checkAnimatedPointCollision=Od,w.checkAnimatedPointWalls=Ld,w.clearCookies=Ll,w.clickEvent=Mc,w.colorToRGB=Ii,w.compileTemplate=kc,w.compression=_d,w.copyToClipboard=dc,w.createXMLHttpRequest=pd,w.drawSpirograph=p0,w.drawStar=m0,w.dynamicStrokeLine=w0,w.fetchUseFetch=yd,w.fetchUseXMLHttpRequest=wd,w.fileOrBlobToDataURL=Ei,w.fileToArrayBufferPromise=Ur,w.flipSideToSide=Nu,w.flipUpsideDown=ju,w.getBrowserClient=ql,w.getBrowserClientVersion=Zl,w.getBrowserLanguage=Xl,w.getCanvasImageData=xi,w.getCanvasImageDataByBitmap=Mu,w.getCanvasImageDataByVideo=Pu,w.getCookie=Rl,w.getCookieObject=Ol,w.getDocumentElement=Ht,w.getElementLeftInPage=Nr,w.getElementPositionInPage=Br,w.getElementPositionInPage2=zl,w.getElementPositionInViewport=Bl,w.getElementTopInPage=jr,w.getFileExtension=Fr,w.getFileType=wn,w.getFileTypeFromFile=Tl,w.getFilesImageInfo=Du,w.getFixedWidthText=Sc,w.getFormElementData=md,w.getImageDataByAIData=gd,w.getImageMainColor=Bu,w.getInternetExplorerVersion=Gr,w.getMouseButton=Rc,w.getMouseOrTouchPositionInElement=Ve,w.getMouseOrTouchPositionInPage=Hr,w.getMouseOrTouchPositionInViewport=jl,w.getOperatingSystem=le,w.getOperatingSystemVersion=Hl,w.getPageClient=Zn,w.getPageScroll=qn,w.getPageSize=Ul,w.getPageVerticalScrollPercent=Nl,w.getRawImageInfo=bi,w.getScrollParent=U0,w.getSelectedText=_c,w.getTarget=Pc,w.getTextWidth=Ec,w.getTimeZone=$l,w.getURL=$r,w.getUrlParams=lc,w.getUrlParams2=cc,w.getUserGeolocationPromise=Gl,w.getViewportSize=$e,w.handleDragAndDropFiles=Al,w.handleHashChange=fc,w.handleHistoryChange=uc,w.handleInputFiles=kl,w.handleURLChange=hc,w.hasDocument=tc,w.hasHistory=ec,w.hasProcess=nc,w.hasWindow=Xr,w.htmlElementToBlob=zu,w.htmlIncodeOrDecode=Tc,w.ifWebFileHasChanged=vd,w.imageDataToBitmap=Ru,w.imageDataToBlob=Lu,w.imageDataToDataURL=Ou,w.isAndroid=Zr,w.isAppleDevice=Vl,w.isBrowser=Jl,w.isBrowserSupportFileAPI=ic,w.isDarkMode=Wl,w.isElementFocus=gc,w.isElementInViewport=Fl,w.isHexColor=Ud,w.isIE=Kl,w.isIOS=qr,w.isMobile=Yl,w.isNode=Ql,w.isPolygonContainPoint=Rd,w.isRectContainPoint=As,w.isRectIntersectRect=Md,w.isTabInView=mc,w.isURL=ac,w.jpgToPng=od,w.lazyloadImages=bc,w.leftRotate=Hu,w.loadScript=vc,w.localstorage=Ti,w.marginSharpen=rd,w.microTask=Pl,w.mosaic=dd,w.navigateBack=wc,w.navigateBack2=yc,w.newPointDependOnLengthAndRotation=Ci,w.nextFramePoint=Ts,w.nextFramePointEaseToTarget=Id,w.nextFramePointSpringConnect=Dd,w.nextFramePointSpringToTarget=ks,w.onDocumentReady=Dl,w.parseColor=st,w.patchDOM=zr,w.pngToJpg=sd,w.pointDistance=Ss,w.pointMiddle=Cd,w.pointRotationRadian=Ai,w.preventDefault=Dc,w.radian2angle=Ad,w.radiusClip=ld,w.randomColorHex=zd,w.randomColorHex2=Bd,w.randomColorNumber=Fd,w.reactiveVue2=Sd,w.reactiveVue3=Td,w.readeFile=Il,w.rectClip=ad,w.removeEventListener=Cc,w.rightRotate=qu,w.rotate=Et,w.roundedRect=g0,w.scrollTo=xd,w.selectFile=Cl,w.setCookie=Ml,w.setRem=rc,w.setScrollRestoration=cn,w.setTheme=bd,w.sharpen=id,w.siblings=pc,w.smileFace=y0,w.stopPropagation=Ic,w.stringToBlob=ys,w.toBlackAndWhite=Xu,w.toBlue=Wu,w.toBlueAndGreen=Qu,w.toBlueAndGrey=nd,w.toGreen=Yu,w.toGreenAndGrey=ed,w.toGrey=Zu,w.toGrey2=Gu,w.toOpposite=$u,w.toRed=Vu,w.toRedAndBlue=Ju,w.toRedAndGreen=Ku,w.toRedAndGrey=td,w.trackVelocity=Pd,w.waitForStyleSheetsLoaded=xc,w.watchEffect=Ed,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),w}({});
14
+ })`}const t1=typeof document<"u"&&document.ontouchstart?"touchstart":"click";function e1(i){if(document.implementation.hasFeature("MouseEvents","2.0"))return i.button;switch(i.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}function Fl(i,t=document){return new kt(i,t)}class kt{context;nodes;prefixs=["moz","o","ms","webkit"];constructor(t,e=document){if(this.context=e,typeof t=="string"?this.nodes=Array.from(this.context.querySelectorAll(t)):t instanceof HTMLElement?this.nodes=[t]:this.nodes=t,this.nodes.length===0)throw new Error(`can not find ${t}`)}get(t){return this.nodes[t]}concat(t){return new kt(this.nodes.concat(t.nodes),this.context)}then(t){return t(this)??this}each(t){return this.nodes.forEach((e,n)=>{t(e,n)}),this}on(t,e,n){return this.nodes.forEach(r=>{r.addEventListener(t,e,n)}),this}off(t,e,n){return this.nodes.forEach(r=>{r.removeEventListener(t,e,n)}),this}dispatchEvent(t,e){let n;const r=["click","dblclick","mousedown","mouseup","mousemove"],s=["keydown","keyup","keypress"];return typeof t=="string"?r.includes(t)?n=new MouseEvent(t,e):s.includes(t)?n=new KeyboardEvent(t,e):n=new Event(t,e):n=t,this.nodes.forEach(a=>{a.dispatchEvent(n)}),this}change(){return this.dispatchEvent("change")}click(){return this.dispatchEvent("click")}static hasEvent(t,e){return"on"+e in t}static _fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(n=>{const r=kt._scriptConvert(n);r!=n&&e.content.replaceChild(r,n)}),e.content}static _scriptConvert(t){const e=n=>{const s=n.ownerDocument.createElement("script");s.text=n.text;const a=n.attributes;for(let o=0;o<a.length;o++)s.setAttribute(a[o].name,a[o].value);return s};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(n=>{n.parentNode?.replaceChild(e(n),n)}),t}static _fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static isSVG(t){return(t||document.documentElement).nodeName.toLowerCase()==="svg"}static createElement(t){return kt.isSVG()?document.createElementNS.call(document,"http://www.w3.org/2000/svg",t):document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}_insert(t,e){return this.nodes.forEach(n=>{n[t](kt._fragment(e))}),this}append(t){return this._insert("append",t)}prepend(t){return this._insert("prepend",t)}after(t){return this._insert("after",t)}before(t){return this._insert("before",t)}replace(t){return this._insert("replaceWith",t)}remove(){return this.nodes.forEach(t=>{t.remove()}),this}static removeChild(t){t.parentElement?.removeChild(t)}find(t){const e=[];return this.nodes.forEach(n=>{e.push(...Array.from(n.querySelectorAll(t)))}),new kt(e,this.context)}filter(t){const e=[];return this.nodes.forEach(n=>{n.matches&&n.matches(t)&&e.push(n)}),new kt(e,this.context)}next(){const t=[];return this.nodes.forEach(e=>{const n=e.nextElementSibling;n&&t.push(n)}),new kt(t,this.context)}prev(){const t=[];return this.nodes.forEach(e=>{const n=e.previousElementSibling;n&&t.push(n)}),new kt(t,this.context)}closest(t){const e=[];return this.nodes.forEach(n=>{const r=n.closest(t);r&&e.push(r)}),new kt(e,this.context)}shadow(t){const e=[];this.nodes.forEach(r=>{r.shadowRoot&&e.push(r.shadowRoot)});const n=new kt(e,this.context);return t!==void 0?n.find(t):n}parent(t){return this.parents(t,!0)}parents(t,e=!1){const n=[],r=a=>{if(n.indexOf(a)==-1&&n.push(a),!e&&a.parentElement)return r(a.parentElement)};this.nodes.forEach(a=>{a.parentElement&&r(a.parentElement)});const s=new kt(n,this.context);return t!==void 0?s.filter(t):s}static getComputedStyle(t,e,n){let r;const s=t.style.getPropertyPriority(e);return"getComputedStyle"in window?(r=getComputedStyle.call(window,t,n),r=r.getPropertyValue(e)):r=t.style.getPropertyValue(e),r+(s?"!"+s:"")}css(t,e){if((t===void 0||typeof t=="string")&&e===void 0){const n=this.nodes[0].style;if(typeof t=="string"){const r=n.getPropertyPriority(t);return n.getPropertyValue(t)+(r?"!"+r:"")}else return Object.fromEntries(this.nodes[0].style.cssText.split(";").filter(r=>!!r).map(r=>r.split(":").map(s=>s.trim())))}else{let n={};return typeof t=="string"&&e!==void 0?n[t]=e:typeof t=="object"&&(n=t),this.nodes.forEach(r=>{Object.keys(n).forEach(s=>{const a=String(n[s]).toLowerCase().includes("!important")?"important":"";r.style.setProperty(s,String(n[s]).replace(/!important/i,""),a)})}),this}}addClass(t){return this.toggleClass(t,!0)}removeClass(t){return this.toggleClass(t,!1)}toggleClass(t,e){const n=t.split(/[,\s]+/);return this.nodes.forEach(r=>{n.forEach(s=>{if(s.trim()!==""){let a="toggle";e!==void 0&&(a=e?"add":"remove"),r.classList[a](s.trim())}})}),this}hasClass(t){const e=t.split(/[,\s]+/);let n=!1;return this.nodes.forEach(r=>{n=n||e.every(s=>Array.from(r.classList??[]).includes(s.trim()))}),n}attr(t,e){if(e===void 0&&typeof t=="string")return this.nodes[0].getAttribute(t);let n={};return typeof t=="object"?n=t:e!==void 0&&(n[t]=e),this.nodes.forEach(r=>{Object.entries(n).forEach(([s,a])=>{r.setAttribute(s,a)})}),this}removeAttr(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(n=>{e.forEach(r=>{n.removeAttribute(r)})}),this}prop(t,e){if(e===void 0&&typeof t=="string")return this.nodes[0][t];{let n={};return typeof t=="object"?n=t:typeof t=="string"&&e!==void 0&&(n[t]=e),this.nodes.forEach(r=>{Object.entries(n).forEach(([s,a])=>{const o=kt._fixProp(s);r[o]=a,o=="innerHTML"&&kt._scriptConvert(r)})}),this}}removeProp(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(n=>{e.forEach(r=>{delete n[kt._fixProp(r)]})}),this}changeSelected(t){this.nodes.forEach(e=>{if(e instanceof HTMLSelectElement){const n=e.options;for(let r=0,s=n.length;r<s;r++)n[r].value==t?n[r].selected=!0:n[r].selected=!1}})}changeChecked(t){this.nodes.forEach(e=>{e instanceof HTMLInputElement&&(e.value==t?e.checked=!0:e.checked=!1)})}data(t,e){if(typeof t=="string"&&t.indexOf("-")!=-1)throw new Error(`Key "${t}" contains "-" (dash). Dashes are not allowed in property names. Use camelCase instead.`);if((typeof t=="string"||t===void 0)&&e===void 0){const n=Object.assign({},this.nodes[0].dataset);return Object.keys(n).forEach(r=>{if(n[r]?.startsWith("[")||n[r]?.startsWith("{"))try{n[r]=JSON.parse(n[r]??"")}catch{}}),typeof t=="string"?n[t]:n}else{let n={};return typeof t=="object"?n=t:typeof t=="string"&&(n[t]=e),this.nodes.forEach(r=>{Object.entries(n).forEach(([s,a])=>{a!=null?r.dataset[s]=a instanceof Object?JSON.stringify(a):a:delete r.dataset[s]})}),this}}removeData(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(n=>{e.forEach(r=>{delete n.dataset[r]})}),this}show(){return this.toggle(!0)}hide(){return this.toggle(!1)}toggle(t){return this.nodes.forEach(e=>{const n=e.style.display,r=getComputedStyle(e).display,s=n=="none"||r=="none";if(s&&(t===void 0||t===!0)){const a=e instanceof HTMLTableRowElement?"table-row":e instanceof HTMLTableCellElement?"table-cell":"block";e.style.display=a}!s&&(t==null||t===!1)&&e.style.setProperty("display","none")})}empty(){return this.html("")}html(t){return t instanceof HTMLElement?this.empty().append(t.innerHTML):this.prop("innerHTML",t)}text(t){return this.prop("textContent",t)}val(t){return this.prop("value",t)}}class Zn{isMacOS=Rl();constructor(){}capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}getFormatKeys(t){const e=[];return t.ctrl&&e.push(this.isMacOS?"Cmd":"Ctrl"),t.shift&&e.push(this.isMacOS?"Option":"Shift"),t.alt&&e.push("Alt"),typeof t.key=="string"?e.push(this.capitalize(t.key)):Array.isArray(t.key)&&(t.key.map(n=>this.capitalize(n)),e.push(...t.key)),e}matchKeyScheme(t,e){const n=t.ctrl??!1,r=t.shift??!1,s=t.alt??!1;if(t.exact)return(n===e.metaKey||n===e.ctrlKey)&&r===e.shiftKey&&s===e.altKey;const a=[];return n&&a.push(n===e.metaKey||n===e.ctrlKey),r&&a.push(r===e.shiftKey),s&&a.push(s===e.altKey),a.every(o=>o)}on(t,e){const n=t?.target??window;if(t?.key===void 0||t?.key===null)return e;const r=this.getFormatKeys(t);let s=!1;const a=o=>{if(o.stopPropagation(),!s&&o.key!=="Control"&&o.key!=="Shift"&&o.key!=="Alt"&&r.find(h=>h.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const h=e();if(typeof h!="function")return;const l=c=>{c.preventDefault(),h(),n.removeEventListener("keyup",l)};n.addEventListener("keyup",l)}};return n.addEventListener("keydown",a),e.keys=r,e.title=t?.title??"",e.pause=()=>s=!0,e.unpause=()=>s=!1,e.removeListener=()=>n.removeEventListener("keydown",a),e}static getKeyCode(t){const e=t.code||(t.keyCode||t.charCode).toString();return{code:e,key:t.key.toLowerCase()||Zn.codeKeys[e]}}static codeKeys={8:"backspace",9:"tab",13:"enter",15:"command",16:"shift",17:"ctrl",18:"alt",19:"pause_break",20:"caps_lock",21:"numpad",27:"escape",32:"spacebar",33:"page_up",34:"page_down",35:"end",36:"home",37:"left_arrow",38:"up_arrow",39:"right_arrow",40:"down_arrow",45:"insert",46:"delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"left_window_key",92:"right_window_key",93:"select_key",96:"numpad_0",97:"numpad_1",98:"numpad_2",99:"numpad_3",100:"numpad_4",101:"numpad_5",102:"numpad_6",103:"numpad_7",104:"numpad_8",105:"numpad_9",106:"multiply",107:"add",109:"subtract",110:"decimal_point",111:"divide",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",124:"f13",125:"f14",126:"f15",144:"num_lock",145:"scroll_lock",186:"semi_colon",187:"equal_sign",188:"comma",189:"dash",190:"period",191:"forward_slash",192:"grave_accent",219:"open_bracket",220:"back_slash",221:"close_braket",222:"single_quote"}}class Ks{static captureMouse(t){const e={x:0,y:0,isMouseDown:!1},n=a=>{e.isMouseDown=!0,document.addEventListener("mouseup",r,!1),t.style.userSelect="none",t.style.webkitUserSelect=""},r=a=>{e.x=0,e.y=0,e.isMouseDown=!1,document.removeEventListener("mouseup",r,!1),t.style.userSelect="",t.style.webkitUserSelect=""},s=a=>{const o=Kn(t,a);e.x=o.x,e.y=o.y};return t.addEventListener("mousedown",n,!1),document.addEventListener("mousemove",s,!1),e}static captureTouch(t){const e={x:0,y:0,isMouseDown:!1},n=a=>{a.preventDefault(),e.isMouseDown=!0},r=a=>{e.x=0,e.y=0,e.isMouseDown=!1},s=a=>{const o=a.changedTouches[0],h=Kn(t,o);e.x=h.x,e.y=h.y};return t.addEventListener("touchstart",n,!1),t.addEventListener("touchend",r,!1),t.addEventListener("touchcancel",r,!1),t.addEventListener("touchmove",s,!1),e}static capturePointer(t){const e={x:0,y:0,isMouseDown:!1},n=a=>{e.isMouseDown=!0,t.setPointerCapture(a.pointerId),t.style.userSelect="none",t.style.webkitUserSelect=""},r=a=>{e.x=0,e.y=0,e.isMouseDown=!1,t.style.userSelect="",t.style.webkitUserSelect=""},s=a=>{const o=Kn(t,a);e.x=o.x,e.y=o.y};return t.addEventListener("pointerdown",n,!1),t.addEventListener("pointerup",r,!1),t.addEventListener("pointercancel",r,!1),t.addEventListener("pointermove",s,!1),e}}function Zs(i,t){if(t)window.localStorage.setItem(i,t);else return window.localStorage.getItem(i)}class i1{static setTheme(t=""){t=t||Zs("theme")||"",t||(t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Zs("theme",t),document.documentElement.classList.toggle("dark",t==="dark")}on(t,e){window.matchMedia(t).addEventListener("change",e)}}class n1{static addEventListener(t,e,n){t.addEventListener(e,n,!1)}static removeEventListener(t,e,n){t.removeEventListener(e,n,!1)}static getTarget(t){return t.target||t.srcElement}}class r1{static setPageVerticalScrollPercent(t,e="width"){const n=Fl(t);n.css("transition","all linear 30ms");const{clientHeight:r}=qn(),{scrollTop:s,scrollHeight:a}=pi(),o=a-r,h=o<=0?0:s/o*100;n.css(e,h+"%")}static pullDownRefresh(t,e,n=50){let r=0,s=0;t.addEventListener("touchstart",function(a){r=a.touches[0].pageY,t.style.position="relative",t.style.transition="transform 0s"},!1),t.addEventListener("touchmove",function(a){s=a.touches[0].pageY-r,s>0&&s<n&&(t.style.transform="translateY("+s+"px)")},!1),t.addEventListener("touchend",function(a){t.style.transition="transform 0.5s ease 1s",t.style.transform="translateY(0px)",s>=n&&e()},!1)}static pullUpLoading(t,e=50){const{clientHeight:n}=qn(),{scrollTop:r,scrollHeight:s}=pi();r+n>=s-e&&t()}}class ot{static version=.8;constructor(t,e){this.context=e??document;let n=[];if(Array.isArray(t))n=t;else if(t instanceof Node||t instanceof Window)n=[t];else if(t instanceof ot)n=t.nodes;else if(typeof t=="string"){if(typeof this.context.querySelector!="function")throw new Error("Invalid context");n=Array.from(this.context.querySelectorAll(t))}else if(t==null)n=[];else{let r=Array.from(t??[]);if(typeof t=="object"&&Array.isArray(r))n=r;else throw new Error(`Invalid selector "${t}"`)}this.nodes=n,this.length=n.length,this.each((r,s)=>{this[s]=r})}static _fragment(t){let e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(n=>{let r=ot._scriptConvert(n);r!=n&&e.content.replaceChild(r,n)}),e.content}static _scriptConvert(t){let e=n=>{let s=n.ownerDocument.createElement("script");s.text=n.text;let a=n.attributes;for(let o=0;o<a.length;o++)s.setAttribute(a[o].name,a[o].value);return s};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(n=>{n.parentNode.replaceChild(e(n),n)}),t}static _fixProp(t){let e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}_insert(t,e){let n=[],r=this.length;if(r<1)return;let s=this;if(typeof e=="string")this.each(a=>{let o=ot._fragment(e);n.push(...o.childNodes),a[t](o)});else if(e instanceof ot){let a=r==1;e.each(o=>{this.each(h=>{let l=a?o:o.cloneNode(!0);n.push(l),h[t](l),ot._scriptConvert(l)})}),a||e.remove()}else if(e instanceof Node)this.each(a=>{let o=r===1?e:ot._fragment(e.outerHTML);n.push(...r===1?[e]:o.childNodes),a[t](o)}),r>1&&e.remove();else throw new Error(`Incorrect argument for "${t}(html)". It expects one string argument.`);return t=="replaceWith"&&(s=new ot(n,this.context)),s}_save(t,e,n){t._mQuery=t._mQuery??{},Array.isArray(n)?(t._mQuery[e]=t._mQuery[e]??[],t._mQuery[e].push(...n)):n!=null?t._mQuery[e]=n:delete t._mQuery[e]}get(t){t<0&&(t=this.length+t);let e=this[t];return e||(t!=null?null:this.nodes)}eq(t){t<0&&(t=this.length+t);let e=[this[t]];return e[0]==null&&(e=[]),new ot(e,this.context)}then(t){let e=t(this);return e??this}find(t){let e=[];return this.each(n=>{let r=Array.from(n.querySelectorAll(t));r.length>0&&e.push(...r)}),new ot(e,this.context)}filter(t){let e=[];return this.each(n=>{(n===t||typeof t=="string"&&n.matches&&n.matches(t)||typeof t=="function"&&t(n))&&e.push(n)}),new ot(e,this.context)}next(){let t=[];return this.each(e=>{let n=e.nextElementSibling;n&&t.push(n)}),new ot(t,this.context)}prev(){let t=[];return this.each(e=>{let n=e.previousElementSibling;n&&t.push(n)}),new ot(t,this.context)}shadow(t){let e=[];this.each(r=>{r.shadowRoot&&e.push(r.shadowRoot)});let n=new ot(e,this.context);return t?n.find(t):n}closest(t){let e=[];return this.each(n=>{let r=n.closest(t);r&&e.push(r)}),new ot(e,this.context)}host(t){let e=[],n=s=>s.parentNode?n(s.parentNode):s,r=s=>{let a=n(s);e.push(a.host?a.host:a),a.host&&t&&r(a.host)};return this.each(s=>{r(s)}),new ot(e,this.context)}parent(t){return this.parents(t,!0)}parents(t,e){let n=[],r=a=>{if(n.indexOf(a)==-1&&n.push(a),!e&&a.parentNode)return r(a.parentNode)};this.each(a=>{a.parentNode&&r(a.parentNode)});let s=new ot(n,this.context);return t?s.filter(t):s}add(t){let e=t instanceof ot?t.nodes:Array.isArray(t)?t:[t];return new ot(this.nodes.concat(e),this.context)}each(t){return this.nodes.forEach((e,n)=>{t(e,n,this)}),this}append(t){return this._insert("append",t)}prepend(t){return this._insert("prepend",t)}after(t){return this._insert("after",t)}before(t){return this._insert("before",t)}replace(t){return this._insert("replaceWith",t)}remove(){return this.each(t=>{t.remove()}),this}css(t,e){let n=t,r=arguments.length;if(r===0||r===1&&typeof t=="string")if(this[0]){let s=this[0].style;if(typeof t=="string"){let a=s.getPropertyPriority(t);return s.getPropertyValue(t)+(a?"!"+a:"")}else return Object.fromEntries(this[0].style.cssText.split(";").filter(a=>!!a).map(a=>a.split(":").map(o=>o.trim())))}else return;else return typeof t!="object"&&(n={},n[t]=e),this.each((s,a)=>{Object.keys(n).forEach(o=>{let h=String(n[o]).toLowerCase().includes("!important")?"important":"";s.style.setProperty(o,String(n[o]).replace(/!important/i,""),h)})}),this}addClass(t){return this.toggleClass(t,!0),this}removeClass(t){return this.toggleClass(t,!1),this}toggleClass(t,e){return typeof t=="string"&&(t=t.split(/[,\s]+/)),this.each(n=>{let r=t;r==null&&e===!1&&(r=Array.from(n.classList)),r.forEach(s=>{if(s!==""){let a="toggle";e!=null&&(a=e?"add":"remove"),n.classList[a](s)}})}),this}hasClass(t){if(typeof t=="string"&&(t=t.split(/[,\s]+/)),t==null&&this.length>0)return Array.from(this[0].classList);let e=!1;return this.each(n=>{e=e||t.every(r=>Array.from(n.classList??[]).includes(r))}),e}on(t,e,n){typeof e=="function"&&(n=e,e=void 0);let r;return e?.delegate&&(r=e.delegate,delete e.delegate),t=t.split(/[,\s]+/),t.forEach(s=>{let[a,o]=String(s).toLowerCase().split(".");if(r){let h=n;n=l=>{let c=vt(l.target).parents(r);c.length>0?l.delegate=c[0]:l.delegate=l.target,(l.target.matches(r)||c.length>0)&&h(l)}}this.each(h=>{this._save(h,"events",[{event:a,scope:o,callback:n,options:e}]),h.addEventListener(a,n,e)})}),this}off(t,e,n){return typeof e=="function"&&(n=e,e=void 0),t=(t??"").split(/[,\s]+/),t.forEach(r=>{let[s,a]=String(r).toLowerCase().split(".");this.each(o=>{if(Array.isArray(o._mQuery?.events))for(let h=o._mQuery.events.length-1;h>=0;h--){let l=o._mQuery.events[h];a==null||a===""?(l.event==s||s==="")&&(l.callback==n||n==null)&&(o.removeEventListener(l.event,l.callback,l.options),o._mQuery.events.splice(h,1)):(l.event==s||s==="")&&l.scope==a&&(o.removeEventListener(l.event,l.callback,l.options),o._mQuery.events.splice(h,1))}})}),this}trigger(t,e){let n,r=["click","dblclick","mousedown","mouseup","mousemove"],s=["keydown","keyup","keypress"];return t instanceof Event||t instanceof CustomEvent?n=t:r.includes(t)?n=new MouseEvent(t,e):s.includes(t)?n=new KeyboardEvent(t,e):n=new Event(t,e),this.each(a=>{a.dispatchEvent(n)}),this}attr(t,e){if(e===void 0&&typeof t=="string")return this[0]?this[0].getAttribute(t):void 0;{let n={};return typeof t=="object"?n=t:n[t]=e,this.each(r=>{Object.entries(n).forEach(([s,a])=>{r.setAttribute(s,a)})}),this}}removeAttr(){return this.each(t=>{Array.from(arguments).forEach(e=>{t.removeAttribute(e)})}),this}prop(t,e){if(e===void 0&&typeof t=="string")return this[0]?this[0][t]:void 0;{let n={};return typeof t=="object"?n=t:n[t]=e,this.each(r=>{Object.entries(n).forEach(([s,a])=>{let o=ot._fixProp(s);r[o]=a,o=="innerHTML"&&ot._scriptConvert(r)})}),this}}removeProp(){return this.each(t=>{Array.from(arguments).forEach(e=>{delete t[ot._fixProp(e)]})}),this}data(t,e){if(t instanceof Object){Object.entries(t).forEach(n=>{this.data(n[0],n[1])});return}if(t&&t.indexOf("-")!=-1&&console.error(`Key "${t}" contains "-" (dash). Dashes are not allowed in property names. Use camelCase instead.`),arguments.length<2)if(this[0]){let n=Object.assign({},this[0].dataset);return Object.keys(n).forEach(r=>{if(n[r].startsWith("[")||n[r].startsWith("{"))try{n[r]=JSON.parse(n[r])}catch{}}),t?n[t]:n}else return;else return this.each(n=>{e!=null?n.dataset[t]=e instanceof Object?JSON.stringify(e):e:delete n.dataset[t]}),this}removeData(t){return typeof t=="string"&&(t=t.split(/[,\s]+/)),this.each(e=>{t.forEach(n=>{delete e.dataset[n]})}),this}show(){return this.toggle(!0)}hide(){return this.toggle(!1)}toggle(t){return this.each(e=>{let n=e.style.display,r=getComputedStyle(e).display,s=n=="none"||r=="none";if(s&&(t==null||t===!0)){let a=e instanceof HTMLTableRowElement?"table-row":e instanceof HTMLTableCellElement?"table-cell":"block";e.style.display=e._mQuery?.prevDisplay??(n==r&&r!="none"?"":a),this._save(e,"prevDisplay",null)}!s&&(t==null||t===!1)&&(r!="none"&&this._save(e,"prevDisplay",r),e.style.setProperty("display","none"))})}empty(){return this.html("")}html(t){return t instanceof HTMLElement?this.empty().append(t):this.prop("innerHTML",t)}text(t){return this.prop("textContent",t)}val(t){return this.prop("value",t)}change(){return this.trigger("change")}click(){return this.trigger("click")}}let vt=function(i,t){return new ot(i,t)};vt.html=i=>{let t=ot._fragment(i);return vt(t.children,t)},vt.version=ot.version,function(){let i=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),n=Math.max(0,16-(e-i)),r=window.setTimeout(function(){t(e+n)},n);return i=e+n,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();const Nl=i=>{function t(e){const n=window.requestAnimationFrame(t);i(e,n)}window.requestAnimationFrame(t)},s1=(i,t)=>{const n=document.getElementById(i).getContext("2d");Nl((r,s)=>{t(n,r,s)})};function a1(i,t,e,n,r=.5,s="ease"){return new Promise(a=>{const o=getComputedStyle(i),h=parseInt(o.width),l=parseInt(o.height);if(!i||!t){console.log("ERROR: Cannot do transition when one of the divs is null");return}switch(i.parentElement&&(i.parentElement.style.cssText+="; perspective: 900px; overflow: hidden;"),i.style.cssText+="; position: absolute; z-index: 1019; backface-visibility: hidden",t.style.cssText+="; position: absolute; z-index: 1020; backface-visibility: hidden",e){case"slide-left":i.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; transform: translate3d("+h+"px, 0, 0)",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; transform: translate3d(0, 0, 0)",i.style.cssText+="transition: "+r+"s "+s+"; transform: translate3d(-"+h+"px, 0, 0)"},1);break;case"slide-right":i.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; transform: translate3d(-"+h+"px, 0, 0)",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; transform: translate3d(0px, 0, 0)",i.style.cssText+="transition: "+r+"s "+s+"; transform: translate3d("+h+"px, 0, 0)"},1);break;case"slide-down":i.style.cssText+="overflow: hidden; z-index: 1; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; z-index: 0; transform: translate3d(0, 0, 0)",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; transform: translate3d(0, 0, 0)",i.style.cssText+="transition: "+r+"s "+s+"; transform: translate3d(0, "+l+"px, 0)"},1);break;case"slide-up":i.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; transform: translate3d(0, "+l+"px, 0)",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; transform: translate3d(0, 0, 0)",i.style.cssText+="transition: "+r+"s "+s+"; transform: translate3d(0, 0, 0)"},1);break;case"flip-left":i.style.cssText+="overflow: hidden; transform: rotateY(0deg)",t.style.cssText+="overflow: hidden; transform: rotateY(-180deg)",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; transform: rotateY(0deg)",i.style.cssText+="transition: "+r+"s "+s+"; transform: rotateY(180deg)"},1);break;case"flip-right":i.style.cssText+="overflow: hidden; transform: rotateY(0deg)",t.style.cssText+="overflow: hidden; transform: rotateY(180deg)",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; transform: rotateY(0deg)",i.style.cssText+="transition: "+r+"s "+s+"; transform: rotateY(-180deg)"},1);break;case"flip-down":i.style.cssText+="overflow: hidden; transform: rotateX(0deg)",t.style.cssText+="overflow: hidden; transform: rotateX(180deg)",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; transform: rotateX(0deg)",i.style.cssText+="transition: "+r+"s "+s+"; transform: rotateX(-180deg)"},1);break;case"flip-up":i.style.cssText+="overflow: hidden; transform: rotateX(0deg)",t.style.cssText+="overflow: hidden; transform: rotateX(-180deg)",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; transform: rotateX(0deg)",i.style.cssText+="transition: "+r+"s "+s+"; transform: rotateX(180deg)"},1);break;case"pop-in":i.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0); transform: scale(.8); opacity: 0;",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; transform: scale(1); opacity: 1;",i.style.cssText+="transition: "+r+"s "+s+";"},1);break;case"pop-out":i.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0); transform: scale(1); opacity: 1;",t.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0); opacity: 0;",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; opacity: 1;",i.style.cssText+="transition: "+r+"s "+s+"; transform: scale(1.7); opacity: 0;"},1);break;default:i.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; translate3d(0, 0, 0); opacity: 0;",vt(t).show(),setTimeout(()=>{t.style.cssText+="transition: "+r+"s "+s+"; opacity: 1;",i.style.cssText+="transition: "+r+"s "+s},1);break}setTimeout(()=>{if(e==="slide-down"&&(vt(i).css("z-index","1019"),vt(t).css("z-index","1020")),t){const c=vt(t);c?.css({opacity:"1"}),c?.css({transition:"",transform:""})}if(i){const c=vt(i);c?.css({opacity:"1"}),c?.css({transition:"",transform:""})}typeof n=="function"&&n(),a()},r*1e3)})}var Ul=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gl(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Bl={exports:{}};(function(i){var t={};i.exports=t,t.parse=function(e,n){for(var r=t.bin.readUshort,s=t.bin.readUint,l=0,a={},o=new Uint8Array(e),h=o.length-4;s(o,h)!=101010256;)h--;var l=h;l+=4,l+=4;var c=r(o,l);l+=2,r(o,l),l+=2;var d=s(o,l);l+=4;var f=s(o,l);l+=4,l=f;for(var u=0;u<c;u++){s(o,l),l+=4,l+=4,l+=4,l+=4,s(o,l),l+=4;var d=s(o,l);l+=4;var g=s(o,l);l+=4;var p=r(o,l),_=r(o,l+2),y=r(o,l+4);l+=6,l+=8;var b=s(o,l);l+=4,l+=p+_+y,t._readLocal(o,b,a,d,g,n)}return a},t._readLocal=function(e,n,r,s,a,o){var h=t.bin.readUshort,l=t.bin.readUint;l(e,n),n+=4,h(e,n),n+=2,h(e,n),n+=2;var c=h(e,n);n+=2,l(e,n),n+=4,l(e,n),n+=4,n+=8;var d=h(e,n);n+=2;var f=h(e,n);n+=2;var u=t.bin.readUTF8(e,n,d);if(n+=d,n+=f,o){r[u]={size:a,csize:s};return}var g=new Uint8Array(e.buffer,n);if(c==0)r[u]=new Uint8Array(g.buffer.slice(n,n+s));else if(c==8){var p=new Uint8Array(a);t.inflateRaw(g,p),r[u]=p}else throw"unknown compression method: "+c},t.inflateRaw=function(e,n){return t.F.inflate(e,n)},t.inflate=function(e,n){return e[0],e[1],t.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),n)},t.deflate=function(e,n){n==null&&(n={level:6});var r=0,s=new Uint8Array(50+Math.floor(e.length*1.1));s[r]=120,s[r+1]=156,r+=2,r=t.F.deflateRaw(e,s,r,n.level);var a=t.adler(e,0,e.length);return s[r+0]=a>>>24&255,s[r+1]=a>>>16&255,s[r+2]=a>>>8&255,s[r+3]=a>>>0&255,new Uint8Array(s.buffer,0,r+4)},t.deflateRaw=function(e,n){n==null&&(n={level:6});var r=new Uint8Array(50+Math.floor(e.length*1.1)),s=t.F.deflateRaw(e,r,s,n.level);return new Uint8Array(r.buffer,0,s)},t.encode=function(e,n){n==null&&(n=!1);var r=0,s=t.bin.writeUint,a=t.bin.writeUshort,o={};for(var h in e){var l=!t._noNeed(h)&&!n,c=e[h],d=t.crc.crc(c,0,c.length);o[h]={cpr:l,usize:c.length,crc:d,file:l?t.deflateRaw(c):c}}for(var h in o)r+=o[h].file.length+30+46+2*t.bin.sizeUTF8(h);r+=22;var f=new Uint8Array(r),u=0,g=[];for(var h in o){var p=o[h];g.push(u),u=t._writeHeader(f,u,h,p,0)}var _=0,y=u;for(var h in o){var p=o[h];g.push(u),u=t._writeHeader(f,u,h,p,1,g[_++])}var b=u-y;return s(f,u,101010256),u+=4,u+=4,a(f,u,_),u+=2,a(f,u,_),u+=2,s(f,u,b),u+=4,s(f,u,y),u+=4,u+=2,f.buffer},t._noNeed=function(e){var n=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(n)!=-1},t._writeHeader=function(e,n,r,s,a,o){var h=t.bin.writeUint,l=t.bin.writeUshort,c=s.file;h(e,n,a==0?67324752:33639248),n+=4,a==1&&(n+=2),l(e,n,20),n+=2,l(e,n,0),n+=2,l(e,n,s.cpr?8:0),n+=2,h(e,n,0),n+=4,h(e,n,s.crc),n+=4,h(e,n,c.length),n+=4,h(e,n,s.usize),n+=4,l(e,n,t.bin.sizeUTF8(r)),n+=2,l(e,n,0),n+=2,a==1&&(n+=2,n+=2,n+=6,h(e,n,o),n+=4);var d=t.bin.writeUTF8(e,n,r);return n+=d,a==0&&(e.set(c,n),n+=c.length),n},t.crc={table:function(){for(var e=new Uint32Array(256),n=0;n<256;n++){for(var r=n,s=0;s<8;s++)r&1?r=3988292384^r>>>1:r=r>>>1;e[n]=r}return e}(),update:function(e,n,r,s){for(var a=0;a<s;a++)e=t.crc.table[(e^n[r+a])&255]^e>>>8;return e},crc:function(e,n,r){return t.crc.update(4294967295,e,n,r)^4294967295}},t.adler=function(e,n,r){for(var s=1,a=0,o=n,h=n+r;o<h;){for(var l=Math.min(o+5552,h);o<l;)s+=e[o++],a+=s;s=s%65521,a=a%65521}return a<<16|s},t.bin={readUshort:function(e,n){return e[n]|e[n+1]<<8},writeUshort:function(e,n,r){e[n]=r&255,e[n+1]=r>>8&255},readUint:function(e,n){return e[n+3]*16777216+(e[n+2]<<16|e[n+1]<<8|e[n])},writeUint:function(e,n,r){e[n]=r&255,e[n+1]=r>>8&255,e[n+2]=r>>16&255,e[n+3]=r>>24&255},readASCII:function(e,n,r){for(var s="",a=0;a<r;a++)s+=String.fromCharCode(e[n+a]);return s},writeASCII:function(e,n,r){for(var s=0;s<r.length;s++)e[n+s]=r.charCodeAt(s)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,n,r){for(var s="",a,o=0;o<r;o++)s+="%"+t.bin.pad(e[n+o].toString(16));try{a=decodeURIComponent(s)}catch{return t.bin.readASCII(e,n,r)}return a},writeUTF8:function(e,n,r){for(var s=r.length,a=0,o=0;o<s;o++){var h=r.charCodeAt(o);if(!(h&4294967168))e[n+a]=h,a++;else if(!(h&4294965248))e[n+a]=192|h>>6,e[n+a+1]=128|h>>0&63,a+=2;else if(!(h&4294901760))e[n+a]=224|h>>12,e[n+a+1]=128|h>>6&63,e[n+a+2]=128|h>>0&63,a+=3;else if(!(h&4292870144))e[n+a]=240|h>>18,e[n+a+1]=128|h>>12&63,e[n+a+2]=128|h>>6&63,e[n+a+3]=128|h>>0&63,a+=4;else throw"e"}return a},sizeUTF8:function(e){for(var n=e.length,r=0,s=0;s<n;s++){var a=e.charCodeAt(s);if(!(a&4294967168))r++;else if(!(a&4294965248))r+=2;else if(!(a&4294901760))r+=3;else if(!(a&4292870144))r+=4;else throw"e"}return r}},t.F={},t.F.deflateRaw=function(e,n,r,s){var a=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]],o=a[s],h=t.F.U,l=t.F._goodIndex;t.F._hash;var c=t.F._putsE,d=0,f=r<<3,u=0,g=e.length;if(s==0){for(;d<g;){var p=Math.min(65535,g-d);c(n,f,d+p==g?1:0),f=t.F._copyExact(e,d,p,n,f+8),d+=p}return f>>>3}var _=h.lits,y=h.strt,b=h.prev,m=0,v=0,w=0,S=0,T=0,C=0;for(g>2&&(C=t.F._hash(e,0),y[C]=0),d=0;d<g;d++){if(T=C,d+1<g-2){C=t.F._hash(e,d+1);var k=d+1&32767;b[k]=y[C],y[C]=k}if(u<=d){(m>14e3||v>26697)&&g-d>100&&(u<d&&(_[m]=d-u,m+=2,u=d),f=t.F._writeBlock(d==g-1||u==g?1:0,_,m,S,e,w,d-w,n,f),m=v=S=0,w=d);var x=0;d<g-2&&(x=t.F._bestMatch(e,d,b,T,Math.min(o[2],g-d),o[3]));var p=x>>>16,E=x&65535;if(x!=0){var p=x>>>16,E=x&65535,M=l(p,h.of0);h.lhst[257+M]++;var D=l(E,h.df0);h.dhst[D]++,S+=h.exb[M]+h.dxb[D],_[m]=p<<23|d-u,_[m+1]=E<<16|M<<8|D,m+=2,u=d+p}else h.lhst[e[d]]++;v++}}for((w!=d||e.length==0)&&(u<d&&(_[m]=d-u,m+=2,u=d),f=t.F._writeBlock(1,_,m,S,e,w,d-w,n,f),m=0,v=0,m=v=S=0,w=d);f&7;)f++;return f>>>3},t.F._bestMatch=function(e,n,r,s,a,o){var h=n&32767,l=r[h],c=h-l+32768&32767;if(l==h||s!=t.F._hash(e,n-c))return 0;for(var d=0,f=0,u=Math.min(32767,n);c<=u&&--o!=0&&l!=h;){if(d==0||e[n+d]==e[n+d-c]){var g=t.F._howLong(e,n,c);if(g>d){if(d=g,f=c,d>=a)break;c+2<g&&(g=c+2);for(var p=0,_=0;_<g-2;_++){var y=n-c+_+32768&32767,b=r[y],m=y-b+32768&32767;m>p&&(p=m,l=y)}}}h=l,l=r[h],c+=h-l+32768&32767}return d<<16|f},t.F._howLong=function(e,n,r){if(e[n]!=e[n-r]||e[n+1]!=e[n+1-r]||e[n+2]!=e[n+2-r])return 0;var s=n,a=Math.min(e.length,n+258);for(n+=3;n<a&&e[n]==e[n-r];)n++;return n-s},t.F._hash=function(e,n){return(e[n]<<8|e[n+1])+(e[n+2]<<4)&65535},t.saved=0,t.F._writeBlock=function(e,n,r,s,a,o,h,l,c){var d=t.F.U,f=t.F._putsF,u=t.F._putsE,g,p,_,y,b,m,v,w,S;d.lhst[256]++,g=t.F.getTrees(),p=g[0],_=g[1],y=g[2],b=g[3],m=g[4],v=g[5],w=g[6],S=g[7];var T=(c+3&7?8-(c+3&7):0)+32+(h<<3),C=s+t.F.contSize(d.fltree,d.lhst)+t.F.contSize(d.fdtree,d.dhst),k=s+t.F.contSize(d.ltree,d.lhst)+t.F.contSize(d.dtree,d.dhst);k+=14+3*v+t.F.contSize(d.itree,d.ihst)+(d.ihst[16]*2+d.ihst[17]*3+d.ihst[18]*7);for(var x=0;x<286;x++)d.lhst[x]=0;for(var x=0;x<30;x++)d.dhst[x]=0;for(var x=0;x<19;x++)d.ihst[x]=0;var E=T<C&&T<k?0:C<k?1:2;if(f(l,c,e),f(l,c+1,E),c+=3,E==0){for(;c&7;)c++;c=t.F._copyExact(a,o,h,l,c)}else{var M,D;if(E==1&&(M=d.fltree,D=d.fdtree),E==2){t.F.makeCodes(d.ltree,p),t.F.revCodes(d.ltree,p),t.F.makeCodes(d.dtree,_),t.F.revCodes(d.dtree,_),t.F.makeCodes(d.itree,y),t.F.revCodes(d.itree,y),M=d.ltree,D=d.dtree,u(l,c,b-257),c+=5,u(l,c,m-1),c+=5,u(l,c,v-4),c+=4;for(var O=0;O<v;O++)u(l,c+O*3,d.itree[(d.ordr[O]<<1)+1]);c+=3*v,c=t.F._codeTiny(w,d.itree,l,c),c=t.F._codeTiny(S,d.itree,l,c)}for(var I=o,H=0;H<r;H+=2){for(var j=n[H],$=j>>>23,et=I+(j&(1<<23)-1);I<et;)c=t.F._writeLit(a[I++],M,l,c);if($!=0){var G=n[H+1],z=G>>16,W=G>>8&255,J=G&255;c=t.F._writeLit(257+W,M,l,c),u(l,c,$-d.of0[W]),c+=d.exb[W],c=t.F._writeLit(J,D,l,c),f(l,c,z-d.df0[J]),c+=d.dxb[J],I+=$}}c=t.F._writeLit(256,M,l,c)}return c},t.F._copyExact=function(e,n,r,s,a){var o=a>>>3;return s[o]=r,s[o+1]=r>>>8,s[o+2]=255-s[o],s[o+3]=255-s[o+1],o+=4,s.set(new Uint8Array(e.buffer,n,r),o),a+(r+4<<3)},t.F.getTrees=function(){for(var e=t.F.U,n=t.F._hufTree(e.lhst,e.ltree,15),r=t.F._hufTree(e.dhst,e.dtree,15),s=[],a=t.F._lenCodes(e.ltree,s),o=[],h=t.F._lenCodes(e.dtree,o),l=0;l<s.length;l+=2)e.ihst[s[l]]++;for(var l=0;l<o.length;l+=2)e.ihst[o[l]]++;for(var c=t.F._hufTree(e.ihst,e.itree,7),d=19;d>4&&e.itree[(e.ordr[d-1]<<1)+1]==0;)d--;return[n,r,c,a,h,d,s,o]},t.F.getSecond=function(e){for(var n=[],r=0;r<e.length;r+=2)n.push(e[r+1]);return n},t.F.nonZero=function(e){for(var n="",r=0;r<e.length;r+=2)e[r+1]!=0&&(n+=(r>>1)+",");return n},t.F.contSize=function(e,n){for(var r=0,s=0;s<n.length;s++)r+=n[s]*e[(s<<1)+1];return r},t.F._codeTiny=function(e,n,r,s){for(var a=0;a<e.length;a+=2){var o=e[a],h=e[a+1];s=t.F._writeLit(o,n,r,s);var l=o==16?2:o==17?3:7;o>15&&(t.F._putsE(r,s,h,l),s+=l)}return s},t.F._lenCodes=function(e,n){for(var r=e.length;r!=2&&e[r-1]==0;)r-=2;for(var s=0;s<r;s+=2){var a=e[s+1],o=s+3<r?e[s+3]:-1,h=s+5<r?e[s+5]:-1,l=s==0?-1:e[s-1];if(a==0&&o==a&&h==a){for(var c=s+5;c+2<r&&e[c+2]==a;)c+=2;var d=Math.min(c+1-s>>>1,138);d<11?n.push(17,d-3):n.push(18,d-11),s+=d*2-2}else if(a==l&&o==a&&h==a){for(var c=s+5;c+2<r&&e[c+2]==a;)c+=2;var d=Math.min(c+1-s>>>1,6);n.push(16,d-3),s+=d*2-2}else n.push(a,0)}return r>>>1},t.F._hufTree=function(e,n,r){var s=[],a=e.length,o=n.length,h=0;for(h=0;h<o;h+=2)n[h]=0,n[h+1]=0;for(h=0;h<a;h++)e[h]!=0&&s.push({lit:h,f:e[h]});var l=s.length,c=s.slice(0);if(l==0)return 0;if(l==1){var d=s[0].lit,c=d==0?1:0;return n[(d<<1)+1]=1,n[(c<<1)+1]=1,1}s.sort(function(b,m){return b.f-m.f});var f=s[0],u=s[1],g=0,p=1,_=2;for(s[0]={lit:-1,f:f.f+u.f,l:f,r:u,d:0};p!=l-1;)g!=p&&(_==l||s[g].f<s[_].f)?f=s[g++]:f=s[_++],g!=p&&(_==l||s[g].f<s[_].f)?u=s[g++]:u=s[_++],s[p++]={lit:-1,f:f.f+u.f,l:f,r:u};var y=t.F.setDepth(s[p-1],0);for(y>r&&(t.F.restrictDepth(c,r,y),y=r),h=0;h<l;h++)n[(c[h].lit<<1)+1]=c[h].d;return y},t.F.setDepth=function(e,n){return e.lit!=-1?(e.d=n,n):Math.max(t.F.setDepth(e.l,n+1),t.F.setDepth(e.r,n+1))},t.F.restrictDepth=function(e,n,r){var s=0,a=1<<r-n,o=0;for(e.sort(function(l,c){return c.d==l.d?l.f-c.f:c.d-l.d}),s=0;s<e.length&&e[s].d>n;s++){var h=e[s].d;e[s].d=n,o+=a-(1<<r-h)}for(o=o>>>r-n;o>0;){var h=e[s].d;h<n?(e[s].d++,o-=1<<n-h-1):s++}for(;s>=0;s--)e[s].d==n&&o<0&&(e[s].d--,o++);o!=0&&console.log("debt left")},t.F._goodIndex=function(e,n){var r=0;return n[r|16]<=e&&(r|=16),n[r|8]<=e&&(r|=8),n[r|4]<=e&&(r|=4),n[r|2]<=e&&(r|=2),n[r|1]<=e&&(r|=1),r},t.F._writeLit=function(e,n,r,s){return t.F._putsF(r,s,n[e<<1]),s+n[(e<<1)+1]},t.F.inflate=function(e,n){var r=Uint8Array;if(e[0]==3&&e[1]==0)return n||new r(0);var s=t.F,a=s._bitsF,o=s._bitsE,h=s._decodeTiny,l=s.makeCodes,c=s.codes2map,d=s._get17,f=s.U,u=n==null;u&&(n=new r(e.length>>>2<<3));for(var g=0,p=0,_=0,y=0,b=0,m=0,v=0,w=0,S=0,T,C;g==0;){if(g=a(e,S,1),p=a(e,S+1,2),S+=3,p==0){S&7&&(S+=8-(S&7));var k=(S>>>3)+4,x=e[k-4]|e[k-3]<<8;u&&(n=t.F._check(n,w+x)),n.set(new r(e.buffer,e.byteOffset+k,x),w),S=k+x<<3,w+=x;continue}if(u&&(n=t.F._check(n,w+131072)),p==1&&(T=f.flmap,C=f.fdmap,m=511,v=31),p==2){_=o(e,S,5)+257,y=o(e,S+5,5)+1,b=o(e,S+10,4)+4,S+=14;for(var E=0;E<38;E+=2)f.itree[E]=0,f.itree[E+1]=0;for(var M=1,E=0;E<b;E++){var D=o(e,S+E*3,3);f.itree[(f.ordr[E]<<1)+1]=D,D>M&&(M=D)}S+=3*b,l(f.itree,M),c(f.itree,M,f.imap),T=f.lmap,C=f.dmap,S=h(f.imap,(1<<M)-1,_+y,e,S,f.ttree);var O=s._copyOut(f.ttree,0,_,f.ltree);m=(1<<O)-1;var I=s._copyOut(f.ttree,_,y,f.dtree);v=(1<<I)-1,l(f.ltree,O),c(f.ltree,O,T),l(f.dtree,I),c(f.dtree,I,C)}for(;;){var H=T[d(e,S)&m];S+=H&15;var j=H>>>4;if(!(j>>>8))n[w++]=j;else{if(j==256)break;var $=w+j-254;if(j>264){var et=f.ldef[j-257];$=w+(et>>>3)+o(e,S,et&7),S+=et&7}var G=C[d(e,S)&v];S+=G&15;var z=G>>>4,W=f.ddef[z],J=(W>>>4)+a(e,S,W&15);for(S+=W&15,u&&(n=t.F._check(n,w+131072));w<$;)n[w]=n[w++-J],n[w]=n[w++-J],n[w]=n[w++-J],n[w]=n[w++-J];w=$}}}return n.length==w?n:n.slice(0,w)},t.F._check=function(e,n){var r=e.length;if(n<=r)return e;var s=new Uint8Array(Math.max(r<<1,n));return s.set(e,0),s},t.F._decodeTiny=function(e,n,r,s,a,o){for(var h=t.F._bitsE,l=t.F._get17,c=0;c<r;){var d=e[l(s,a)&n];a+=d&15;var f=d>>>4;if(f<=15)o[c]=f,c++;else{var u=0,g=0;f==16?(g=3+h(s,a,2),a+=2,u=o[c-1]):f==17?(g=3+h(s,a,3),a+=3):f==18&&(g=11+h(s,a,7),a+=7);for(var p=c+g;c<p;)o[c]=u,c++}}return a},t.F._copyOut=function(e,n,r,s){for(var a=0,o=0,h=s.length>>>1;o<r;){var l=e[o+n];s[o<<1]=0,s[(o<<1)+1]=l,l>a&&(a=l),o++}for(;o<h;)s[o<<1]=0,s[(o<<1)+1]=0,o++;return a},t.F.makeCodes=function(e,n){for(var r=t.F.U,s=e.length,a,o,h,l,c,d=r.bl_count,l=0;l<=n;l++)d[l]=0;for(l=1;l<s;l+=2)d[e[l]]++;var f=r.next_code;for(a=0,d[0]=0,o=1;o<=n;o++)a=a+d[o-1]<<1,f[o]=a;for(h=0;h<s;h+=2)c=e[h+1],c!=0&&(e[h]=f[c],f[c]++)},t.F.codes2map=function(e,n,r){for(var s=e.length,a=t.F.U,o=a.rev15,h=0;h<s;h+=2)if(e[h+1]!=0)for(var l=h>>1,c=e[h+1],d=l<<4|c,f=n-c,u=e[h]<<f,g=u+(1<<f);u!=g;){var p=o[u]>>>15-n;r[p]=d,u++}},t.F.revCodes=function(e,n){for(var r=t.F.U.rev15,s=15-n,a=0;a<e.length;a+=2){var o=e[a]<<n-e[a+1];e[a]=r[o]>>>s}},t.F._putsE=function(e,n,r){r=r<<(n&7);var s=n>>>3;e[s]|=r,e[s+1]|=r>>>8},t.F._putsF=function(e,n,r){r=r<<(n&7);var s=n>>>3;e[s]|=r,e[s+1]|=r>>>8,e[s+2]|=r>>>16},t.F._bitsE=function(e,n,r){return(e[n>>>3]|e[(n>>>3)+1]<<8)>>>(n&7)&(1<<r)-1},t.F._bitsF=function(e,n,r){return(e[n>>>3]|e[(n>>>3)+1]<<8|e[(n>>>3)+2]<<16)>>>(n&7)&(1<<r)-1},t.F._get17=function(e,n){return(e[n>>>3]|e[(n>>>3)+1]<<8|e[(n>>>3)+2]<<16)>>>(n&7)},t.F._get25=function(e,n){return(e[n>>>3]|e[(n>>>3)+1]<<8|e[(n>>>3)+2]<<16|e[(n>>>3)+3]<<24)>>>(n&7)},t.F.U=function(){var e=Uint16Array,n=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new n(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new n(286),dhst:new n(30),ihst:new n(19),lits:new n(15e3),strt:new e(65536),prev:new e(32768)}}(),function(){for(var e=t.F.U,n=32768,r=0;r<n;r++){var s=r;s=(s&2863311530)>>>1|(s&1431655765)<<1,s=(s&3435973836)>>>2|(s&858993459)<<2,s=(s&4042322160)>>>4|(s&252645135)<<4,s=(s&4278255360)>>>8|(s&16711935)<<8,e.rev15[r]=(s>>>16|s<<16)>>>17}function a(o,h,l){for(;h--!=0;)o.push(0,l)}for(var r=0;r<32;r++)e.ldef[r]=e.of0[r]<<3|e.exb[r],e.ddef[r]=e.df0[r]<<4|e.dxb[r];a(e.fltree,144,8),a(e.fltree,112,9),a(e.fltree,24,7),a(e.fltree,8,8),t.F.makeCodes(e.fltree,9),t.F.codes2map(e.fltree,9,e.flmap),t.F.revCodes(e.fltree,9),a(e.fdtree,32,5),t.F.makeCodes(e.fdtree,5),t.F.codes2map(e.fdtree,5,e.fdmap),t.F.revCodes(e.fdtree,5),a(e.itree,19,0),a(e.ltree,286,0),a(e.dtree,30,0),a(e.ttree,320,0)}()})(Bl);var o1=Bl.exports;const zl=Gl(o1);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const l1=4,Hl=0,jl=1,h1=2;function mi(i){let t=i.length;for(;--t>=0;)i[t]=0}const c1=0,Vl=1,u1=2,d1=3,f1=258,Js=29,Qi=256,tn=Qi+1+Js,_i=30,Qs=19,$l=2*tn+1,$e=15,ta=16,g1=7,ea=256,Xl=16,Yl=17,Wl=18,ia=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Jn=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),p1=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ql=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),m1=512,ae=new Array((tn+2)*2);mi(ae);const en=new Array(_i*2);mi(en);const nn=new Array(m1);mi(nn);const rn=new Array(f1-d1+1);mi(rn);const na=new Array(Js);mi(na);const Qn=new Array(_i);mi(Qn);function ra(i,t,e,n,r){this.static_tree=i,this.extra_bits=t,this.extra_base=e,this.elems=n,this.max_length=r,this.has_stree=i&&i.length}let Kl,Zl,Jl;function sa(i,t){this.dyn_tree=i,this.max_code=0,this.stat_desc=t}const Ql=i=>i<256?nn[i]:nn[256+(i>>>7)],sn=(i,t)=>{i.pending_buf[i.pending++]=t&255,i.pending_buf[i.pending++]=t>>>8&255},Dt=(i,t,e)=>{i.bi_valid>ta-e?(i.bi_buf|=t<<i.bi_valid&65535,sn(i,i.bi_buf),i.bi_buf=t>>ta-i.bi_valid,i.bi_valid+=e-ta):(i.bi_buf|=t<<i.bi_valid&65535,i.bi_valid+=e)},Kt=(i,t,e)=>{Dt(i,e[t*2],e[t*2+1])},th=(i,t)=>{let e=0;do e|=i&1,i>>>=1,e<<=1;while(--t>0);return e>>>1},_1=i=>{i.bi_valid===16?(sn(i,i.bi_buf),i.bi_buf=0,i.bi_valid=0):i.bi_valid>=8&&(i.pending_buf[i.pending++]=i.bi_buf&255,i.bi_buf>>=8,i.bi_valid-=8)},v1=(i,t)=>{const e=t.dyn_tree,n=t.max_code,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,h=t.stat_desc.max_length;let l,c,d,f,u,g,p=0;for(f=0;f<=$e;f++)i.bl_count[f]=0;for(e[i.heap[i.heap_max]*2+1]=0,l=i.heap_max+1;l<$l;l++)c=i.heap[l],f=e[e[c*2+1]*2+1]+1,f>h&&(f=h,p++),e[c*2+1]=f,!(c>n)&&(i.bl_count[f]++,u=0,c>=o&&(u=a[c-o]),g=e[c*2],i.opt_len+=g*(f+u),s&&(i.static_len+=g*(r[c*2+1]+u)));if(p!==0){do{for(f=h-1;i.bl_count[f]===0;)f--;i.bl_count[f]--,i.bl_count[f+1]+=2,i.bl_count[h]--,p-=2}while(p>0);for(f=h;f!==0;f--)for(c=i.bl_count[f];c!==0;)d=i.heap[--l],!(d>n)&&(e[d*2+1]!==f&&(i.opt_len+=(f-e[d*2+1])*e[d*2],e[d*2+1]=f),c--)}},eh=(i,t,e)=>{const n=new Array($e+1);let r=0,s,a;for(s=1;s<=$e;s++)r=r+e[s-1]<<1,n[s]=r;for(a=0;a<=t;a++){let o=i[a*2+1];o!==0&&(i[a*2]=th(n[o]++,o))}},y1=()=>{let i,t,e,n,r;const s=new Array($e+1);for(e=0,n=0;n<Js-1;n++)for(na[n]=e,i=0;i<1<<ia[n];i++)rn[e++]=n;for(rn[e-1]=n,r=0,n=0;n<16;n++)for(Qn[n]=r,i=0;i<1<<Jn[n];i++)nn[r++]=n;for(r>>=7;n<_i;n++)for(Qn[n]=r<<7,i=0;i<1<<Jn[n]-7;i++)nn[256+r++]=n;for(t=0;t<=$e;t++)s[t]=0;for(i=0;i<=143;)ae[i*2+1]=8,i++,s[8]++;for(;i<=255;)ae[i*2+1]=9,i++,s[9]++;for(;i<=279;)ae[i*2+1]=7,i++,s[7]++;for(;i<=287;)ae[i*2+1]=8,i++,s[8]++;for(eh(ae,tn+1,s),i=0;i<_i;i++)en[i*2+1]=5,en[i*2]=th(i,5);Kl=new ra(ae,ia,Qi+1,tn,$e),Zl=new ra(en,Jn,0,_i,$e),Jl=new ra(new Array(0),p1,0,Qs,g1)},ih=i=>{let t;for(t=0;t<tn;t++)i.dyn_ltree[t*2]=0;for(t=0;t<_i;t++)i.dyn_dtree[t*2]=0;for(t=0;t<Qs;t++)i.bl_tree[t*2]=0;i.dyn_ltree[ea*2]=1,i.opt_len=i.static_len=0,i.sym_next=i.matches=0},nh=i=>{i.bi_valid>8?sn(i,i.bi_buf):i.bi_valid>0&&(i.pending_buf[i.pending++]=i.bi_buf),i.bi_buf=0,i.bi_valid=0},rh=(i,t,e,n)=>{const r=t*2,s=e*2;return i[r]<i[s]||i[r]===i[s]&&n[t]<=n[e]},aa=(i,t,e)=>{const n=i.heap[e];let r=e<<1;for(;r<=i.heap_len&&(r<i.heap_len&&rh(t,i.heap[r+1],i.heap[r],i.depth)&&r++,!rh(t,n,i.heap[r],i.depth));)i.heap[e]=i.heap[r],e=r,r<<=1;i.heap[e]=n},sh=(i,t,e)=>{let n,r,s=0,a,o;if(i.sym_next!==0)do n=i.pending_buf[i.sym_buf+s++]&255,n+=(i.pending_buf[i.sym_buf+s++]&255)<<8,r=i.pending_buf[i.sym_buf+s++],n===0?Kt(i,r,t):(a=rn[r],Kt(i,a+Qi+1,t),o=ia[a],o!==0&&(r-=na[a],Dt(i,r,o)),n--,a=Ql(n),Kt(i,a,e),o=Jn[a],o!==0&&(n-=Qn[a],Dt(i,n,o)));while(s<i.sym_next);Kt(i,ea,t)},oa=(i,t)=>{const e=t.dyn_tree,n=t.stat_desc.static_tree,r=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,o,h=-1,l;for(i.heap_len=0,i.heap_max=$l,a=0;a<s;a++)e[a*2]!==0?(i.heap[++i.heap_len]=h=a,i.depth[a]=0):e[a*2+1]=0;for(;i.heap_len<2;)l=i.heap[++i.heap_len]=h<2?++h:0,e[l*2]=1,i.depth[l]=0,i.opt_len--,r&&(i.static_len-=n[l*2+1]);for(t.max_code=h,a=i.heap_len>>1;a>=1;a--)aa(i,e,a);l=s;do a=i.heap[1],i.heap[1]=i.heap[i.heap_len--],aa(i,e,1),o=i.heap[1],i.heap[--i.heap_max]=a,i.heap[--i.heap_max]=o,e[l*2]=e[a*2]+e[o*2],i.depth[l]=(i.depth[a]>=i.depth[o]?i.depth[a]:i.depth[o])+1,e[a*2+1]=e[o*2+1]=l,i.heap[1]=l++,aa(i,e,1);while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],v1(i,t),eh(e,h,i.bl_count)},ah=(i,t,e)=>{let n,r=-1,s,a=t[0*2+1],o=0,h=7,l=4;for(a===0&&(h=138,l=3),t[(e+1)*2+1]=65535,n=0;n<=e;n++)s=a,a=t[(n+1)*2+1],!(++o<h&&s===a)&&(o<l?i.bl_tree[s*2]+=o:s!==0?(s!==r&&i.bl_tree[s*2]++,i.bl_tree[Xl*2]++):o<=10?i.bl_tree[Yl*2]++:i.bl_tree[Wl*2]++,o=0,r=s,a===0?(h=138,l=3):s===a?(h=6,l=3):(h=7,l=4))},oh=(i,t,e)=>{let n,r=-1,s,a=t[0*2+1],o=0,h=7,l=4;for(a===0&&(h=138,l=3),n=0;n<=e;n++)if(s=a,a=t[(n+1)*2+1],!(++o<h&&s===a)){if(o<l)do Kt(i,s,i.bl_tree);while(--o!==0);else s!==0?(s!==r&&(Kt(i,s,i.bl_tree),o--),Kt(i,Xl,i.bl_tree),Dt(i,o-3,2)):o<=10?(Kt(i,Yl,i.bl_tree),Dt(i,o-3,3)):(Kt(i,Wl,i.bl_tree),Dt(i,o-11,7));o=0,r=s,a===0?(h=138,l=3):s===a?(h=6,l=3):(h=7,l=4)}},b1=i=>{let t;for(ah(i,i.dyn_ltree,i.l_desc.max_code),ah(i,i.dyn_dtree,i.d_desc.max_code),oa(i,i.bl_desc),t=Qs-1;t>=3&&i.bl_tree[ql[t]*2+1]===0;t--);return i.opt_len+=3*(t+1)+5+5+4,t},w1=(i,t,e,n)=>{let r;for(Dt(i,t-257,5),Dt(i,e-1,5),Dt(i,n-4,4),r=0;r<n;r++)Dt(i,i.bl_tree[ql[r]*2+1],3);oh(i,i.dyn_ltree,t-1),oh(i,i.dyn_dtree,e-1)},S1=i=>{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&i.dyn_ltree[e*2]!==0)return Hl;if(i.dyn_ltree[9*2]!==0||i.dyn_ltree[10*2]!==0||i.dyn_ltree[13*2]!==0)return jl;for(e=32;e<Qi;e++)if(i.dyn_ltree[e*2]!==0)return jl;return Hl};let lh=!1;const C1=i=>{lh||(y1(),lh=!0),i.l_desc=new sa(i.dyn_ltree,Kl),i.d_desc=new sa(i.dyn_dtree,Zl),i.bl_desc=new sa(i.bl_tree,Jl),i.bi_buf=0,i.bi_valid=0,ih(i)},hh=(i,t,e,n)=>{Dt(i,(c1<<1)+(n?1:0),3),nh(i),sn(i,e),sn(i,~e),e&&i.pending_buf.set(i.window.subarray(t,t+e),i.pending),i.pending+=e},x1=i=>{Dt(i,Vl<<1,3),Kt(i,ea,ae),_1(i)},E1=(i,t,e,n)=>{let r,s,a=0;i.level>0?(i.strm.data_type===h1&&(i.strm.data_type=S1(i)),oa(i,i.l_desc),oa(i,i.d_desc),a=b1(i),r=i.opt_len+3+7>>>3,s=i.static_len+3+7>>>3,s<=r&&(r=s)):r=s=e+5,e+4<=r&&t!==-1?hh(i,t,e,n):i.strategy===l1||s===r?(Dt(i,(Vl<<1)+(n?1:0),3),sh(i,ae,en)):(Dt(i,(u1<<1)+(n?1:0),3),w1(i,i.l_desc.max_code+1,i.d_desc.max_code+1,a+1),sh(i,i.dyn_ltree,i.dyn_dtree)),ih(i),n&&nh(i)},T1=(i,t,e)=>(i.pending_buf[i.sym_buf+i.sym_next++]=t,i.pending_buf[i.sym_buf+i.sym_next++]=t>>8,i.pending_buf[i.sym_buf+i.sym_next++]=e,t===0?i.dyn_ltree[e*2]++:(i.matches++,t--,i.dyn_ltree[(rn[e]+Qi+1)*2]++,i.dyn_dtree[Ql(t)*2]++),i.sym_next===i.sym_end);var k1=C1,A1=hh,P1=E1,M1=T1,R1=x1,D1={_tr_init:k1,_tr_stored_block:A1,_tr_flush_block:P1,_tr_tally:M1,_tr_align:R1},an=(i,t,e,n)=>{let r=i&65535|0,s=i>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do r=r+t[n++]|0,s=s+r|0;while(--a);r%=65521,s%=65521}return r|s<<16|0};const L1=()=>{let i,t=[];for(var e=0;e<256;e++){i=e;for(var n=0;n<8;n++)i=i&1?3988292384^i>>>1:i>>>1;t[e]=i}return t},O1=new Uint32Array(L1());var Et=(i,t,e,n)=>{const r=O1,s=n+e;i^=-1;for(let a=n;a<s;a++)i=i>>>8^r[(i^t[a])&255];return i^-1},Xe={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ye={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:I1,_tr_stored_block:la,_tr_flush_block:F1,_tr_tally:Ee,_tr_align:N1}=D1,{Z_NO_FLUSH:Te,Z_PARTIAL_FLUSH:U1,Z_FULL_FLUSH:G1,Z_FINISH:Gt,Z_BLOCK:ch,Z_OK:At,Z_STREAM_END:uh,Z_STREAM_ERROR:Zt,Z_DATA_ERROR:B1,Z_BUF_ERROR:ha,Z_DEFAULT_COMPRESSION:z1,Z_FILTERED:H1,Z_HUFFMAN_ONLY:tr,Z_RLE:j1,Z_FIXED:V1,Z_DEFAULT_STRATEGY:$1,Z_UNKNOWN:X1,Z_DEFLATED:er}=Ye,Y1=9,W1=15,q1=8,K1=29,ca=256+1+K1,Z1=30,J1=19,Q1=2*ca+1,tg=15,K=3,ke=258,Jt=ke+K+1,eg=32,vi=42,ua=57,da=69,fa=73,ga=91,pa=103,We=113,on=666,Mt=1,yi=2,qe=3,bi=4,ig=3,Ke=(i,t)=>(i.msg=Xe[t],t),dh=i=>i*2-(i>4?9:0),Ae=i=>{let t=i.length;for(;--t>=0;)i[t]=0},ng=i=>{let t,e,n,r=i.w_size;t=i.hash_size,n=t;do e=i.head[--n],i.head[n]=e>=r?e-r:0;while(--t);t=r,n=t;do e=i.prev[--n],i.prev[n]=e>=r?e-r:0;while(--t)};let Pe=(i,t,e)=>(t<<i.hash_shift^e)&i.hash_mask;const Lt=i=>{const t=i.state;let e=t.pending;e>i.avail_out&&(e=i.avail_out),e!==0&&(i.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),i.next_out),i.next_out+=e,t.pending_out+=e,i.total_out+=e,i.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},Ot=(i,t)=>{F1(i,i.block_start>=0?i.block_start:-1,i.strstart-i.block_start,t),i.block_start=i.strstart,Lt(i.strm)},tt=(i,t)=>{i.pending_buf[i.pending++]=t},ln=(i,t)=>{i.pending_buf[i.pending++]=t>>>8&255,i.pending_buf[i.pending++]=t&255},ma=(i,t,e,n)=>{let r=i.avail_in;return r>n&&(r=n),r===0?0:(i.avail_in-=r,t.set(i.input.subarray(i.next_in,i.next_in+r),e),i.state.wrap===1?i.adler=an(i.adler,t,r,e):i.state.wrap===2&&(i.adler=Et(i.adler,t,r,e)),i.next_in+=r,i.total_in+=r,r)},fh=(i,t)=>{let e=i.max_chain_length,n=i.strstart,r,s,a=i.prev_length,o=i.nice_match;const h=i.strstart>i.w_size-Jt?i.strstart-(i.w_size-Jt):0,l=i.window,c=i.w_mask,d=i.prev,f=i.strstart+ke;let u=l[n+a-1],g=l[n+a];i.prev_length>=i.good_match&&(e>>=2),o>i.lookahead&&(o=i.lookahead);do if(r=t,!(l[r+a]!==g||l[r+a-1]!==u||l[r]!==l[n]||l[++r]!==l[n+1])){n+=2,r++;do;while(l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&l[++n]===l[++r]&&n<f);if(s=ke-(f-n),n=f-ke,s>a){if(i.match_start=t,a=s,s>=o)break;u=l[n+a-1],g=l[n+a]}}while((t=d[t&c])>h&&--e!==0);return a<=i.lookahead?a:i.lookahead},wi=i=>{const t=i.w_size;let e,n,r;do{if(n=i.window_size-i.lookahead-i.strstart,i.strstart>=t+(t-Jt)&&(i.window.set(i.window.subarray(t,t+t-n),0),i.match_start-=t,i.strstart-=t,i.block_start-=t,i.insert>i.strstart&&(i.insert=i.strstart),ng(i),n+=t),i.strm.avail_in===0)break;if(e=ma(i.strm,i.window,i.strstart+i.lookahead,n),i.lookahead+=e,i.lookahead+i.insert>=K)for(r=i.strstart-i.insert,i.ins_h=i.window[r],i.ins_h=Pe(i,i.ins_h,i.window[r+1]);i.insert&&(i.ins_h=Pe(i,i.ins_h,i.window[r+K-1]),i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++,i.insert--,!(i.lookahead+i.insert<K)););}while(i.lookahead<Jt&&i.strm.avail_in!==0)},gh=(i,t)=>{let e=i.pending_buf_size-5>i.w_size?i.w_size:i.pending_buf_size-5,n,r,s,a=0,o=i.strm.avail_in;do{if(n=65535,s=i.bi_valid+42>>3,i.strm.avail_out<s||(s=i.strm.avail_out-s,r=i.strstart-i.block_start,n>r+i.strm.avail_in&&(n=r+i.strm.avail_in),n>s&&(n=s),n<e&&(n===0&&t!==Gt||t===Te||n!==r+i.strm.avail_in)))break;a=t===Gt&&n===r+i.strm.avail_in?1:0,la(i,0,0,a),i.pending_buf[i.pending-4]=n,i.pending_buf[i.pending-3]=n>>8,i.pending_buf[i.pending-2]=~n,i.pending_buf[i.pending-1]=~n>>8,Lt(i.strm),r&&(r>n&&(r=n),i.strm.output.set(i.window.subarray(i.block_start,i.block_start+r),i.strm.next_out),i.strm.next_out+=r,i.strm.avail_out-=r,i.strm.total_out+=r,i.block_start+=r,n-=r),n&&(ma(i.strm,i.strm.output,i.strm.next_out,n),i.strm.next_out+=n,i.strm.avail_out-=n,i.strm.total_out+=n)}while(a===0);return o-=i.strm.avail_in,o&&(o>=i.w_size?(i.matches=2,i.window.set(i.strm.input.subarray(i.strm.next_in-i.w_size,i.strm.next_in),0),i.strstart=i.w_size,i.insert=i.strstart):(i.window_size-i.strstart<=o&&(i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,i.insert>i.strstart&&(i.insert=i.strstart)),i.window.set(i.strm.input.subarray(i.strm.next_in-o,i.strm.next_in),i.strstart),i.strstart+=o,i.insert+=o>i.w_size-i.insert?i.w_size-i.insert:o),i.block_start=i.strstart),i.high_water<i.strstart&&(i.high_water=i.strstart),a?bi:t!==Te&&t!==Gt&&i.strm.avail_in===0&&i.strstart===i.block_start?yi:(s=i.window_size-i.strstart,i.strm.avail_in>s&&i.block_start>=i.w_size&&(i.block_start-=i.w_size,i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,s+=i.w_size,i.insert>i.strstart&&(i.insert=i.strstart)),s>i.strm.avail_in&&(s=i.strm.avail_in),s&&(ma(i.strm,i.window,i.strstart,s),i.strstart+=s,i.insert+=s>i.w_size-i.insert?i.w_size-i.insert:s),i.high_water<i.strstart&&(i.high_water=i.strstart),s=i.bi_valid+42>>3,s=i.pending_buf_size-s>65535?65535:i.pending_buf_size-s,e=s>i.w_size?i.w_size:s,r=i.strstart-i.block_start,(r>=e||(r||t===Gt)&&t!==Te&&i.strm.avail_in===0&&r<=s)&&(n=r>s?s:r,a=t===Gt&&i.strm.avail_in===0&&n===r?1:0,la(i,i.block_start,n,a),i.block_start+=n,Lt(i.strm)),a?qe:Mt)},_a=(i,t)=>{let e,n;for(;;){if(i.lookahead<Jt){if(wi(i),i.lookahead<Jt&&t===Te)return Mt;if(i.lookahead===0)break}if(e=0,i.lookahead>=K&&(i.ins_h=Pe(i,i.ins_h,i.window[i.strstart+K-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),e!==0&&i.strstart-e<=i.w_size-Jt&&(i.match_length=fh(i,e)),i.match_length>=K)if(n=Ee(i,i.strstart-i.match_start,i.match_length-K),i.lookahead-=i.match_length,i.match_length<=i.max_lazy_match&&i.lookahead>=K){i.match_length--;do i.strstart++,i.ins_h=Pe(i,i.ins_h,i.window[i.strstart+K-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart;while(--i.match_length!==0);i.strstart++}else i.strstart+=i.match_length,i.match_length=0,i.ins_h=i.window[i.strstart],i.ins_h=Pe(i,i.ins_h,i.window[i.strstart+1]);else n=Ee(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++;if(n&&(Ot(i,!1),i.strm.avail_out===0))return Mt}return i.insert=i.strstart<K-1?i.strstart:K-1,t===Gt?(Ot(i,!0),i.strm.avail_out===0?qe:bi):i.sym_next&&(Ot(i,!1),i.strm.avail_out===0)?Mt:yi},Si=(i,t)=>{let e,n,r;for(;;){if(i.lookahead<Jt){if(wi(i),i.lookahead<Jt&&t===Te)return Mt;if(i.lookahead===0)break}if(e=0,i.lookahead>=K&&(i.ins_h=Pe(i,i.ins_h,i.window[i.strstart+K-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),i.prev_length=i.match_length,i.prev_match=i.match_start,i.match_length=K-1,e!==0&&i.prev_length<i.max_lazy_match&&i.strstart-e<=i.w_size-Jt&&(i.match_length=fh(i,e),i.match_length<=5&&(i.strategy===H1||i.match_length===K&&i.strstart-i.match_start>4096)&&(i.match_length=K-1)),i.prev_length>=K&&i.match_length<=i.prev_length){r=i.strstart+i.lookahead-K,n=Ee(i,i.strstart-1-i.prev_match,i.prev_length-K),i.lookahead-=i.prev_length-1,i.prev_length-=2;do++i.strstart<=r&&(i.ins_h=Pe(i,i.ins_h,i.window[i.strstart+K-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart);while(--i.prev_length!==0);if(i.match_available=0,i.match_length=K-1,i.strstart++,n&&(Ot(i,!1),i.strm.avail_out===0))return Mt}else if(i.match_available){if(n=Ee(i,0,i.window[i.strstart-1]),n&&Ot(i,!1),i.strstart++,i.lookahead--,i.strm.avail_out===0)return Mt}else i.match_available=1,i.strstart++,i.lookahead--}return i.match_available&&(n=Ee(i,0,i.window[i.strstart-1]),i.match_available=0),i.insert=i.strstart<K-1?i.strstart:K-1,t===Gt?(Ot(i,!0),i.strm.avail_out===0?qe:bi):i.sym_next&&(Ot(i,!1),i.strm.avail_out===0)?Mt:yi},rg=(i,t)=>{let e,n,r,s;const a=i.window;for(;;){if(i.lookahead<=ke){if(wi(i),i.lookahead<=ke&&t===Te)return Mt;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=K&&i.strstart>0&&(r=i.strstart-1,n=a[r],n===a[++r]&&n===a[++r]&&n===a[++r])){s=i.strstart+ke;do;while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&r<s);i.match_length=ke-(s-r),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=K?(e=Ee(i,1,i.match_length-K),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(e=Ee(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),e&&(Ot(i,!1),i.strm.avail_out===0))return Mt}return i.insert=0,t===Gt?(Ot(i,!0),i.strm.avail_out===0?qe:bi):i.sym_next&&(Ot(i,!1),i.strm.avail_out===0)?Mt:yi},sg=(i,t)=>{let e;for(;;){if(i.lookahead===0&&(wi(i),i.lookahead===0)){if(t===Te)return Mt;break}if(i.match_length=0,e=Ee(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,e&&(Ot(i,!1),i.strm.avail_out===0))return Mt}return i.insert=0,t===Gt?(Ot(i,!0),i.strm.avail_out===0?qe:bi):i.sym_next&&(Ot(i,!1),i.strm.avail_out===0)?Mt:yi};function Qt(i,t,e,n,r){this.good_length=i,this.max_lazy=t,this.nice_length=e,this.max_chain=n,this.func=r}const hn=[new Qt(0,0,0,0,gh),new Qt(4,4,8,4,_a),new Qt(4,5,16,8,_a),new Qt(4,6,32,32,_a),new Qt(4,4,16,16,Si),new Qt(8,16,32,32,Si),new Qt(8,16,128,128,Si),new Qt(8,32,128,256,Si),new Qt(32,128,258,1024,Si),new Qt(32,258,258,4096,Si)],ag=i=>{i.window_size=2*i.w_size,Ae(i.head),i.max_lazy_match=hn[i.level].max_lazy,i.good_match=hn[i.level].good_length,i.nice_match=hn[i.level].nice_length,i.max_chain_length=hn[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=K-1,i.match_available=0,i.ins_h=0};function og(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=er,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Q1*2),this.dyn_dtree=new Uint16Array((2*Z1+1)*2),this.bl_tree=new Uint16Array((2*J1+1)*2),Ae(this.dyn_ltree),Ae(this.dyn_dtree),Ae(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(tg+1),this.heap=new Uint16Array(2*ca+1),Ae(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ca+1),Ae(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const cn=i=>{if(!i)return 1;const t=i.state;return!t||t.strm!==i||t.status!==vi&&t.status!==ua&&t.status!==da&&t.status!==fa&&t.status!==ga&&t.status!==pa&&t.status!==We&&t.status!==on?1:0},ph=i=>{if(cn(i))return Ke(i,Zt);i.total_in=i.total_out=0,i.data_type=X1;const t=i.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?ua:t.wrap?vi:We,i.adler=t.wrap===2?0:1,t.last_flush=-2,I1(t),At},mh=i=>{const t=ph(i);return t===At&&ag(i.state),t},lg=(i,t)=>cn(i)||i.state.wrap!==2?Zt:(i.state.gzhead=t,At),_h=(i,t,e,n,r,s)=>{if(!i)return Zt;let a=1;if(t===z1&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),r<1||r>Y1||e!==er||n<8||n>15||t<0||t>9||s<0||s>V1||n===8&&a!==1)return Ke(i,Zt);n===8&&(n=9);const o=new og;return i.state=o,o.strm=i,o.status=vi,o.wrap=a,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+K-1)/K),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=t,o.strategy=s,o.method=e,mh(i)},hg=(i,t)=>_h(i,t,er,W1,q1,$1),cg=(i,t)=>{if(cn(i)||t>ch||t<0)return i?Ke(i,Zt):Zt;const e=i.state;if(!i.output||i.avail_in!==0&&!i.input||e.status===on&&t!==Gt)return Ke(i,i.avail_out===0?ha:Zt);const n=e.last_flush;if(e.last_flush=t,e.pending!==0){if(Lt(i),i.avail_out===0)return e.last_flush=-1,At}else if(i.avail_in===0&&dh(t)<=dh(n)&&t!==Gt)return Ke(i,ha);if(e.status===on&&i.avail_in!==0)return Ke(i,ha);if(e.status===vi&&e.wrap===0&&(e.status=We),e.status===vi){let r=er+(e.w_bits-8<<4)<<8,s=-1;if(e.strategy>=tr||e.level<2?s=0:e.level<6?s=1:e.level===6?s=2:s=3,r|=s<<6,e.strstart!==0&&(r|=eg),r+=31-r%31,ln(e,r),e.strstart!==0&&(ln(e,i.adler>>>16),ln(e,i.adler&65535)),i.adler=1,e.status=We,Lt(i),e.pending!==0)return e.last_flush=-1,At}if(e.status===ua){if(i.adler=0,tt(e,31),tt(e,139),tt(e,8),e.gzhead)tt(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),tt(e,e.gzhead.time&255),tt(e,e.gzhead.time>>8&255),tt(e,e.gzhead.time>>16&255),tt(e,e.gzhead.time>>24&255),tt(e,e.level===9?2:e.strategy>=tr||e.level<2?4:0),tt(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(tt(e,e.gzhead.extra.length&255),tt(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(i.adler=Et(i.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=da;else if(tt(e,0),tt(e,0),tt(e,0),tt(e,0),tt(e,0),tt(e,e.level===9?2:e.strategy>=tr||e.level<2?4:0),tt(e,ig),e.status=We,Lt(i),e.pending!==0)return e.last_flush=-1,At}if(e.status===da){if(e.gzhead.extra){let r=e.pending,s=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+s>e.pending_buf_size;){let o=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>r&&(i.adler=Et(i.adler,e.pending_buf,e.pending-r,r)),e.gzindex+=o,Lt(i),e.pending!==0)return e.last_flush=-1,At;r=0,s-=o}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending+=s,e.gzhead.hcrc&&e.pending>r&&(i.adler=Et(i.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=fa}if(e.status===fa){if(e.gzhead.name){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(i.adler=Et(i.adler,e.pending_buf,e.pending-r,r)),Lt(i),e.pending!==0)return e.last_flush=-1,At;r=0}e.gzindex<e.gzhead.name.length?s=e.gzhead.name.charCodeAt(e.gzindex++)&255:s=0,tt(e,s)}while(s!==0);e.gzhead.hcrc&&e.pending>r&&(i.adler=Et(i.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=ga}if(e.status===ga){if(e.gzhead.comment){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(i.adler=Et(i.adler,e.pending_buf,e.pending-r,r)),Lt(i),e.pending!==0)return e.last_flush=-1,At;r=0}e.gzindex<e.gzhead.comment.length?s=e.gzhead.comment.charCodeAt(e.gzindex++)&255:s=0,tt(e,s)}while(s!==0);e.gzhead.hcrc&&e.pending>r&&(i.adler=Et(i.adler,e.pending_buf,e.pending-r,r))}e.status=pa}if(e.status===pa){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(Lt(i),e.pending!==0))return e.last_flush=-1,At;tt(e,i.adler&255),tt(e,i.adler>>8&255),i.adler=0}if(e.status=We,Lt(i),e.pending!==0)return e.last_flush=-1,At}if(i.avail_in!==0||e.lookahead!==0||t!==Te&&e.status!==on){let r=e.level===0?gh(e,t):e.strategy===tr?sg(e,t):e.strategy===j1?rg(e,t):hn[e.level].func(e,t);if((r===qe||r===bi)&&(e.status=on),r===Mt||r===qe)return i.avail_out===0&&(e.last_flush=-1),At;if(r===yi&&(t===U1?N1(e):t!==ch&&(la(e,0,0,!1),t===G1&&(Ae(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),Lt(i),i.avail_out===0))return e.last_flush=-1,At}return t!==Gt?At:e.wrap<=0?uh:(e.wrap===2?(tt(e,i.adler&255),tt(e,i.adler>>8&255),tt(e,i.adler>>16&255),tt(e,i.adler>>24&255),tt(e,i.total_in&255),tt(e,i.total_in>>8&255),tt(e,i.total_in>>16&255),tt(e,i.total_in>>24&255)):(ln(e,i.adler>>>16),ln(e,i.adler&65535)),Lt(i),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?At:uh)},ug=i=>{if(cn(i))return Zt;const t=i.state.status;return i.state=null,t===We?Ke(i,B1):At},dg=(i,t)=>{let e=t.length;if(cn(i))return Zt;const n=i.state,r=n.wrap;if(r===2||r===1&&n.status!==vi||n.lookahead)return Zt;if(r===1&&(i.adler=an(i.adler,t,e,0)),n.wrap=0,e>=n.w_size){r===0&&(Ae(n.head),n.strstart=0,n.block_start=0,n.insert=0);let h=new Uint8Array(n.w_size);h.set(t.subarray(e-n.w_size,e),0),t=h,e=n.w_size}const s=i.avail_in,a=i.next_in,o=i.input;for(i.avail_in=e,i.next_in=0,i.input=t,wi(n);n.lookahead>=K;){let h=n.strstart,l=n.lookahead-(K-1);do n.ins_h=Pe(n,n.ins_h,n.window[h+K-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++;while(--l);n.strstart=h,n.lookahead=K-1,wi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=K-1,n.match_available=0,i.next_in=a,i.input=o,i.avail_in=s,n.wrap=r,At};var fg=hg,gg=_h,pg=mh,mg=ph,_g=lg,vg=cg,yg=ug,bg=dg,wg="pako deflate (from Nodeca project)",un={deflateInit:fg,deflateInit2:gg,deflateReset:pg,deflateResetKeep:mg,deflateSetHeader:_g,deflate:vg,deflateEnd:yg,deflateSetDictionary:bg,deflateInfo:wg};const Sg=(i,t)=>Object.prototype.hasOwnProperty.call(i,t);var Cg=function(i){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(const n in e)Sg(e,n)&&(i[n]=e[n])}}return i},xg=i=>{let t=0;for(let n=0,r=i.length;n<r;n++)t+=i[n].length;const e=new Uint8Array(t);for(let n=0,r=0,s=i.length;n<s;n++){let a=i[n];e.set(a,r),r+=a.length}return e},ir={assign:Cg,flattenChunks:xg};let vh=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{vh=!1}const dn=new Uint8Array(256);for(let i=0;i<256;i++)dn[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;dn[254]=dn[254]=1;var Eg=i=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(i);let t,e,n,r,s,a=i.length,o=0;for(r=0;r<a;r++)e=i.charCodeAt(r),(e&64512)===55296&&r+1<a&&(n=i.charCodeAt(r+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),r++)),o+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(o),s=0,r=0;s<o;r++)e=i.charCodeAt(r),(e&64512)===55296&&r+1<a&&(n=i.charCodeAt(r+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),r++)),e<128?t[s++]=e:e<2048?(t[s++]=192|e>>>6,t[s++]=128|e&63):e<65536?(t[s++]=224|e>>>12,t[s++]=128|e>>>6&63,t[s++]=128|e&63):(t[s++]=240|e>>>18,t[s++]=128|e>>>12&63,t[s++]=128|e>>>6&63,t[s++]=128|e&63);return t};const Tg=(i,t)=>{if(t<65534&&i.subarray&&vh)return String.fromCharCode.apply(null,i.length===t?i:i.subarray(0,t));let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(i[n]);return e};var kg=(i,t)=>{const e=t||i.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(i.subarray(0,t));let n,r;const s=new Array(e*2);for(r=0,n=0;n<e;){let a=i[n++];if(a<128){s[r++]=a;continue}let o=dn[a];if(o>4){s[r++]=65533,n+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&n<e;)a=a<<6|i[n++]&63,o--;if(o>1){s[r++]=65533;continue}a<65536?s[r++]=a:(a-=65536,s[r++]=55296|a>>10&1023,s[r++]=56320|a&1023)}return Tg(s,r)},Ag=(i,t)=>{t=t||i.length,t>i.length&&(t=i.length);let e=t-1;for(;e>=0&&(i[e]&192)===128;)e--;return e<0||e===0?t:e+dn[i[e]]>t?e:t},fn={string2buf:Eg,buf2string:kg,utf8border:Ag};function Pg(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var yh=Pg;const bh=Object.prototype.toString,{Z_NO_FLUSH:Mg,Z_SYNC_FLUSH:Rg,Z_FULL_FLUSH:Dg,Z_FINISH:Lg,Z_OK:nr,Z_STREAM_END:Og,Z_DEFAULT_COMPRESSION:Ig,Z_DEFAULT_STRATEGY:Fg,Z_DEFLATED:Ng}=Ye;function gn(i){this.options=ir.assign({level:Ig,method:Ng,chunkSize:16384,windowBits:15,memLevel:8,strategy:Fg},i||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new yh,this.strm.avail_out=0;let e=un.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==nr)throw new Error(Xe[e]);if(t.header&&un.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=fn.string2buf(t.dictionary):bh.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,e=un.deflateSetDictionary(this.strm,n),e!==nr)throw new Error(Xe[e]);this._dict_set=!0}}gn.prototype.push=function(i,t){const e=this.strm,n=this.options.chunkSize;let r,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?Lg:Mg,typeof i=="string"?e.input=fn.string2buf(i):bh.call(i)==="[object ArrayBuffer]"?e.input=new Uint8Array(i):e.input=i,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),(s===Rg||s===Dg)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(r=un.deflate(e,s),r===Og)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),r=un.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===nr;if(e.avail_out===0){this.onData(e.output);continue}if(s>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0},gn.prototype.onData=function(i){this.chunks.push(i)},gn.prototype.onEnd=function(i){i===nr&&(this.result=ir.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function va(i,t){const e=new gn(t);if(e.push(i,!0),e.err)throw e.msg||Xe[e.err];return e.result}function Ug(i,t){return t=t||{},t.raw=!0,va(i,t)}function Gg(i,t){return t=t||{},t.gzip=!0,va(i,t)}var Bg=gn,zg=va,Hg=Ug,jg=Gg,Vg=Ye,$g={Deflate:Bg,deflate:zg,deflateRaw:Hg,gzip:jg,constants:Vg};const rr=16209,Xg=16191;var Yg=function(t,e){let n,r,s,a,o,h,l,c,d,f,u,g,p,_,y,b,m,v,w,S,T,C,k,x;const E=t.state;n=t.next_in,k=t.input,r=n+(t.avail_in-5),s=t.next_out,x=t.output,a=s-(e-t.avail_out),o=s+(t.avail_out-257),h=E.dmax,l=E.wsize,c=E.whave,d=E.wnext,f=E.window,u=E.hold,g=E.bits,p=E.lencode,_=E.distcode,y=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{g<15&&(u+=k[n++]<<g,g+=8,u+=k[n++]<<g,g+=8),m=p[u&y];e:for(;;){if(v=m>>>24,u>>>=v,g-=v,v=m>>>16&255,v===0)x[s++]=m&65535;else if(v&16){w=m&65535,v&=15,v&&(g<v&&(u+=k[n++]<<g,g+=8),w+=u&(1<<v)-1,u>>>=v,g-=v),g<15&&(u+=k[n++]<<g,g+=8,u+=k[n++]<<g,g+=8),m=_[u&b];i:for(;;){if(v=m>>>24,u>>>=v,g-=v,v=m>>>16&255,v&16){if(S=m&65535,v&=15,g<v&&(u+=k[n++]<<g,g+=8,g<v&&(u+=k[n++]<<g,g+=8)),S+=u&(1<<v)-1,S>h){t.msg="invalid distance too far back",E.mode=rr;break t}if(u>>>=v,g-=v,v=s-a,S>v){if(v=S-v,v>c&&E.sane){t.msg="invalid distance too far back",E.mode=rr;break t}if(T=0,C=f,d===0){if(T+=l-v,v<w){w-=v;do x[s++]=f[T++];while(--v);T=s-S,C=x}}else if(d<v){if(T+=l+d-v,v-=d,v<w){w-=v;do x[s++]=f[T++];while(--v);if(T=0,d<w){v=d,w-=v;do x[s++]=f[T++];while(--v);T=s-S,C=x}}}else if(T+=d-v,v<w){w-=v;do x[s++]=f[T++];while(--v);T=s-S,C=x}for(;w>2;)x[s++]=C[T++],x[s++]=C[T++],x[s++]=C[T++],w-=3;w&&(x[s++]=C[T++],w>1&&(x[s++]=C[T++]))}else{T=s-S;do x[s++]=x[T++],x[s++]=x[T++],x[s++]=x[T++],w-=3;while(w>2);w&&(x[s++]=x[T++],w>1&&(x[s++]=x[T++]))}}else if(v&64){t.msg="invalid distance code",E.mode=rr;break t}else{m=_[(m&65535)+(u&(1<<v)-1)];continue i}break}}else if(v&64)if(v&32){E.mode=Xg;break t}else{t.msg="invalid literal/length code",E.mode=rr;break t}else{m=p[(m&65535)+(u&(1<<v)-1)];continue e}break}}while(n<r&&s<o);w=g>>3,n-=w,g-=w<<3,u&=(1<<g)-1,t.next_in=n,t.next_out=s,t.avail_in=n<r?5+(r-n):5-(n-r),t.avail_out=s<o?257+(o-s):257-(s-o),E.hold=u,E.bits=g};const Ci=15,wh=852,Sh=592,Ch=0,ya=1,xh=2,Wg=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),qg=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Kg=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Zg=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var pn=(i,t,e,n,r,s,a,o)=>{const h=o.bits;let l=0,c=0,d=0,f=0,u=0,g=0,p=0,_=0,y=0,b=0,m,v,w,S,T,C=null,k;const x=new Uint16Array(Ci+1),E=new Uint16Array(Ci+1);let M=null,D,O,I;for(l=0;l<=Ci;l++)x[l]=0;for(c=0;c<n;c++)x[t[e+c]]++;for(u=h,f=Ci;f>=1&&x[f]===0;f--);if(u>f&&(u=f),f===0)return r[s++]=1<<24|64<<16|0,r[s++]=1<<24|64<<16|0,o.bits=1,0;for(d=1;d<f&&x[d]===0;d++);for(u<d&&(u=d),_=1,l=1;l<=Ci;l++)if(_<<=1,_-=x[l],_<0)return-1;if(_>0&&(i===Ch||f!==1))return-1;for(E[1]=0,l=1;l<Ci;l++)E[l+1]=E[l]+x[l];for(c=0;c<n;c++)t[e+c]!==0&&(a[E[t[e+c]]++]=c);if(i===Ch?(C=M=a,k=20):i===ya?(C=Wg,M=qg,k=257):(C=Kg,M=Zg,k=0),b=0,c=0,l=d,T=s,g=u,p=0,w=-1,y=1<<u,S=y-1,i===ya&&y>wh||i===xh&&y>Sh)return 1;for(;;){D=l-p,a[c]+1<k?(O=0,I=a[c]):a[c]>=k?(O=M[a[c]-k],I=C[a[c]-k]):(O=32+64,I=0),m=1<<l-p,v=1<<g,d=v;do v-=m,r[T+(b>>p)+v]=D<<24|O<<16|I|0;while(v!==0);for(m=1<<l-1;b&m;)m>>=1;if(m!==0?(b&=m-1,b+=m):b=0,c++,--x[l]===0){if(l===f)break;l=t[e+a[c]]}if(l>u&&(b&S)!==w){for(p===0&&(p=u),T+=d,g=l-p,_=1<<g;g+p<f&&(_-=x[g+p],!(_<=0));)g++,_<<=1;if(y+=1<<g,i===ya&&y>wh||i===xh&&y>Sh)return 1;w=b&S,r[w]=u<<24|g<<16|T-s|0}}return b!==0&&(r[T+b]=l-p<<24|64<<16|0),o.bits=u,0};const Jg=0,Eh=1,Th=2,{Z_FINISH:kh,Z_BLOCK:Qg,Z_TREES:sr,Z_OK:Ze,Z_STREAM_END:t2,Z_NEED_DICT:e2,Z_STREAM_ERROR:Bt,Z_DATA_ERROR:Ah,Z_MEM_ERROR:Ph,Z_BUF_ERROR:i2,Z_DEFLATED:Mh}=Ye,ar=16180,Rh=16181,Dh=16182,Lh=16183,Oh=16184,Ih=16185,Fh=16186,Nh=16187,Uh=16188,Gh=16189,or=16190,oe=16191,ba=16192,Bh=16193,wa=16194,zh=16195,Hh=16196,jh=16197,Vh=16198,lr=16199,hr=16200,$h=16201,Xh=16202,Yh=16203,Wh=16204,qh=16205,Sa=16206,Kh=16207,Zh=16208,ct=16209,Jh=16210,Qh=16211,n2=852,r2=592,s2=15,tc=i=>(i>>>24&255)+(i>>>8&65280)+((i&65280)<<8)+((i&255)<<24);function a2(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Je=i=>{if(!i)return 1;const t=i.state;return!t||t.strm!==i||t.mode<ar||t.mode>Qh?1:0},ec=i=>{if(Je(i))return Bt;const t=i.state;return i.total_in=i.total_out=t.total=0,i.msg="",t.wrap&&(i.adler=t.wrap&1),t.mode=ar,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(n2),t.distcode=t.distdyn=new Int32Array(r2),t.sane=1,t.back=-1,Ze},ic=i=>{if(Je(i))return Bt;const t=i.state;return t.wsize=0,t.whave=0,t.wnext=0,ec(i)},nc=(i,t)=>{let e;if(Je(i))return Bt;const n=i.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Bt:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=e,n.wbits=t,ic(i))},rc=(i,t)=>{if(!i)return Bt;const e=new a2;i.state=e,e.strm=i,e.window=null,e.mode=ar;const n=nc(i,t);return n!==Ze&&(i.state=null),n},o2=i=>rc(i,s2);let sc=!0,Ca,xa;const l2=i=>{if(sc){Ca=new Int32Array(512),xa=new Int32Array(32);let t=0;for(;t<144;)i.lens[t++]=8;for(;t<256;)i.lens[t++]=9;for(;t<280;)i.lens[t++]=7;for(;t<288;)i.lens[t++]=8;for(pn(Eh,i.lens,0,288,Ca,0,i.work,{bits:9}),t=0;t<32;)i.lens[t++]=5;pn(Th,i.lens,0,32,xa,0,i.work,{bits:5}),sc=!1}i.lencode=Ca,i.lenbits=9,i.distcode=xa,i.distbits=5},ac=(i,t,e,n)=>{let r;const s=i.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(t.subarray(e-s.wsize,e),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>n&&(r=n),s.window.set(t.subarray(e-n,e-n+r),s.wnext),n-=r,n?(s.window.set(t.subarray(e-n,e),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=r))),0},h2=(i,t)=>{let e,n,r,s,a,o,h,l,c,d,f,u,g,p,_=0,y,b,m,v,w,S,T,C;const k=new Uint8Array(4);let x,E;const M=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Je(i)||!i.output||!i.input&&i.avail_in!==0)return Bt;e=i.state,e.mode===oe&&(e.mode=ba),a=i.next_out,r=i.output,h=i.avail_out,s=i.next_in,n=i.input,o=i.avail_in,l=e.hold,c=e.bits,d=o,f=h,C=Ze;t:for(;;)switch(e.mode){case ar:if(e.wrap===0){e.mode=ba;break}for(;c<16;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}if(e.wrap&2&&l===35615){e.wbits===0&&(e.wbits=15),e.check=0,k[0]=l&255,k[1]=l>>>8&255,e.check=Et(e.check,k,2,0),l=0,c=0,e.mode=Rh;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((l&255)<<8)+(l>>8))%31){i.msg="incorrect header check",e.mode=ct;break}if((l&15)!==Mh){i.msg="unknown compression method",e.mode=ct;break}if(l>>>=4,c-=4,T=(l&15)+8,e.wbits===0&&(e.wbits=T),T>15||T>e.wbits){i.msg="invalid window size",e.mode=ct;break}e.dmax=1<<e.wbits,e.flags=0,i.adler=e.check=1,e.mode=l&512?Gh:oe,l=0,c=0;break;case Rh:for(;c<16;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}if(e.flags=l,(e.flags&255)!==Mh){i.msg="unknown compression method",e.mode=ct;break}if(e.flags&57344){i.msg="unknown header flags set",e.mode=ct;break}e.head&&(e.head.text=l>>8&1),e.flags&512&&e.wrap&4&&(k[0]=l&255,k[1]=l>>>8&255,e.check=Et(e.check,k,2,0)),l=0,c=0,e.mode=Dh;case Dh:for(;c<32;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}e.head&&(e.head.time=l),e.flags&512&&e.wrap&4&&(k[0]=l&255,k[1]=l>>>8&255,k[2]=l>>>16&255,k[3]=l>>>24&255,e.check=Et(e.check,k,4,0)),l=0,c=0,e.mode=Lh;case Lh:for(;c<16;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}e.head&&(e.head.xflags=l&255,e.head.os=l>>8),e.flags&512&&e.wrap&4&&(k[0]=l&255,k[1]=l>>>8&255,e.check=Et(e.check,k,2,0)),l=0,c=0,e.mode=Oh;case Oh:if(e.flags&1024){for(;c<16;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}e.length=l,e.head&&(e.head.extra_len=l),e.flags&512&&e.wrap&4&&(k[0]=l&255,k[1]=l>>>8&255,e.check=Et(e.check,k,2,0)),l=0,c=0}else e.head&&(e.head.extra=null);e.mode=Ih;case Ih:if(e.flags&1024&&(u=e.length,u>o&&(u=o),u&&(e.head&&(T=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(n.subarray(s,s+u),T)),e.flags&512&&e.wrap&4&&(e.check=Et(e.check,n,u,s)),o-=u,s+=u,e.length-=u),e.length))break t;e.length=0,e.mode=Fh;case Fh:if(e.flags&2048){if(o===0)break t;u=0;do T=n[s+u++],e.head&&T&&e.length<65536&&(e.head.name+=String.fromCharCode(T));while(T&&u<o);if(e.flags&512&&e.wrap&4&&(e.check=Et(e.check,n,u,s)),o-=u,s+=u,T)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=Nh;case Nh:if(e.flags&4096){if(o===0)break t;u=0;do T=n[s+u++],e.head&&T&&e.length<65536&&(e.head.comment+=String.fromCharCode(T));while(T&&u<o);if(e.flags&512&&e.wrap&4&&(e.check=Et(e.check,n,u,s)),o-=u,s+=u,T)break t}else e.head&&(e.head.comment=null);e.mode=Uh;case Uh:if(e.flags&512){for(;c<16;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}if(e.wrap&4&&l!==(e.check&65535)){i.msg="header crc mismatch",e.mode=ct;break}l=0,c=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),i.adler=e.check=0,e.mode=oe;break;case Gh:for(;c<32;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}i.adler=e.check=tc(l),l=0,c=0,e.mode=or;case or:if(e.havedict===0)return i.next_out=a,i.avail_out=h,i.next_in=s,i.avail_in=o,e.hold=l,e.bits=c,e2;i.adler=e.check=1,e.mode=oe;case oe:if(t===Qg||t===sr)break t;case ba:if(e.last){l>>>=c&7,c-=c&7,e.mode=Sa;break}for(;c<3;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}switch(e.last=l&1,l>>>=1,c-=1,l&3){case 0:e.mode=Bh;break;case 1:if(l2(e),e.mode=lr,t===sr){l>>>=2,c-=2;break t}break;case 2:e.mode=Hh;break;case 3:i.msg="invalid block type",e.mode=ct}l>>>=2,c-=2;break;case Bh:for(l>>>=c&7,c-=c&7;c<32;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}if((l&65535)!==(l>>>16^65535)){i.msg="invalid stored block lengths",e.mode=ct;break}if(e.length=l&65535,l=0,c=0,e.mode=wa,t===sr)break t;case wa:e.mode=zh;case zh:if(u=e.length,u){if(u>o&&(u=o),u>h&&(u=h),u===0)break t;r.set(n.subarray(s,s+u),a),o-=u,s+=u,h-=u,a+=u,e.length-=u;break}e.mode=oe;break;case Hh:for(;c<14;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}if(e.nlen=(l&31)+257,l>>>=5,c-=5,e.ndist=(l&31)+1,l>>>=5,c-=5,e.ncode=(l&15)+4,l>>>=4,c-=4,e.nlen>286||e.ndist>30){i.msg="too many length or distance symbols",e.mode=ct;break}e.have=0,e.mode=jh;case jh:for(;e.have<e.ncode;){for(;c<3;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}e.lens[M[e.have++]]=l&7,l>>>=3,c-=3}for(;e.have<19;)e.lens[M[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,x={bits:e.lenbits},C=pn(Jg,e.lens,0,19,e.lencode,0,e.work,x),e.lenbits=x.bits,C){i.msg="invalid code lengths set",e.mode=ct;break}e.have=0,e.mode=Vh;case Vh:for(;e.have<e.nlen+e.ndist;){for(;_=e.lencode[l&(1<<e.lenbits)-1],y=_>>>24,b=_>>>16&255,m=_&65535,!(y<=c);){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}if(m<16)l>>>=y,c-=y,e.lens[e.have++]=m;else{if(m===16){for(E=y+2;c<E;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}if(l>>>=y,c-=y,e.have===0){i.msg="invalid bit length repeat",e.mode=ct;break}T=e.lens[e.have-1],u=3+(l&3),l>>>=2,c-=2}else if(m===17){for(E=y+3;c<E;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}l>>>=y,c-=y,T=0,u=3+(l&7),l>>>=3,c-=3}else{for(E=y+7;c<E;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}l>>>=y,c-=y,T=0,u=11+(l&127),l>>>=7,c-=7}if(e.have+u>e.nlen+e.ndist){i.msg="invalid bit length repeat",e.mode=ct;break}for(;u--;)e.lens[e.have++]=T}}if(e.mode===ct)break;if(e.lens[256]===0){i.msg="invalid code -- missing end-of-block",e.mode=ct;break}if(e.lenbits=9,x={bits:e.lenbits},C=pn(Eh,e.lens,0,e.nlen,e.lencode,0,e.work,x),e.lenbits=x.bits,C){i.msg="invalid literal/lengths set",e.mode=ct;break}if(e.distbits=6,e.distcode=e.distdyn,x={bits:e.distbits},C=pn(Th,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,x),e.distbits=x.bits,C){i.msg="invalid distances set",e.mode=ct;break}if(e.mode=lr,t===sr)break t;case lr:e.mode=hr;case hr:if(o>=6&&h>=258){i.next_out=a,i.avail_out=h,i.next_in=s,i.avail_in=o,e.hold=l,e.bits=c,Yg(i,f),a=i.next_out,r=i.output,h=i.avail_out,s=i.next_in,n=i.input,o=i.avail_in,l=e.hold,c=e.bits,e.mode===oe&&(e.back=-1);break}for(e.back=0;_=e.lencode[l&(1<<e.lenbits)-1],y=_>>>24,b=_>>>16&255,m=_&65535,!(y<=c);){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}if(b&&!(b&240)){for(v=y,w=b,S=m;_=e.lencode[S+((l&(1<<v+w)-1)>>v)],y=_>>>24,b=_>>>16&255,m=_&65535,!(v+y<=c);){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}l>>>=v,c-=v,e.back+=v}if(l>>>=y,c-=y,e.back+=y,e.length=m,b===0){e.mode=qh;break}if(b&32){e.back=-1,e.mode=oe;break}if(b&64){i.msg="invalid literal/length code",e.mode=ct;break}e.extra=b&15,e.mode=$h;case $h:if(e.extra){for(E=e.extra;c<E;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}e.length+=l&(1<<e.extra)-1,l>>>=e.extra,c-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=Xh;case Xh:for(;_=e.distcode[l&(1<<e.distbits)-1],y=_>>>24,b=_>>>16&255,m=_&65535,!(y<=c);){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}if(!(b&240)){for(v=y,w=b,S=m;_=e.distcode[S+((l&(1<<v+w)-1)>>v)],y=_>>>24,b=_>>>16&255,m=_&65535,!(v+y<=c);){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}l>>>=v,c-=v,e.back+=v}if(l>>>=y,c-=y,e.back+=y,b&64){i.msg="invalid distance code",e.mode=ct;break}e.offset=m,e.extra=b&15,e.mode=Yh;case Yh:if(e.extra){for(E=e.extra;c<E;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}e.offset+=l&(1<<e.extra)-1,l>>>=e.extra,c-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){i.msg="invalid distance too far back",e.mode=ct;break}e.mode=Wh;case Wh:if(h===0)break t;if(u=f-h,e.offset>u){if(u=e.offset-u,u>e.whave&&e.sane){i.msg="invalid distance too far back",e.mode=ct;break}u>e.wnext?(u-=e.wnext,g=e.wsize-u):g=e.wnext-u,u>e.length&&(u=e.length),p=e.window}else p=r,g=a-e.offset,u=e.length;u>h&&(u=h),h-=u,e.length-=u;do r[a++]=p[g++];while(--u);e.length===0&&(e.mode=hr);break;case qh:if(h===0)break t;r[a++]=e.length,h--,e.mode=hr;break;case Sa:if(e.wrap){for(;c<32;){if(o===0)break t;o--,l|=n[s++]<<c,c+=8}if(f-=h,i.total_out+=f,e.total+=f,e.wrap&4&&f&&(i.adler=e.check=e.flags?Et(e.check,r,f,a-f):an(e.check,r,f,a-f)),f=h,e.wrap&4&&(e.flags?l:tc(l))!==e.check){i.msg="incorrect data check",e.mode=ct;break}l=0,c=0}e.mode=Kh;case Kh:if(e.wrap&&e.flags){for(;c<32;){if(o===0)break t;o--,l+=n[s++]<<c,c+=8}if(e.wrap&4&&l!==(e.total&4294967295)){i.msg="incorrect length check",e.mode=ct;break}l=0,c=0}e.mode=Zh;case Zh:C=t2;break t;case ct:C=Ah;break t;case Jh:return Ph;case Qh:default:return Bt}return i.next_out=a,i.avail_out=h,i.next_in=s,i.avail_in=o,e.hold=l,e.bits=c,(e.wsize||f!==i.avail_out&&e.mode<ct&&(e.mode<Sa||t!==kh))&&ac(i,i.output,i.next_out,f-i.avail_out),d-=i.avail_in,f-=i.avail_out,i.total_in+=d,i.total_out+=f,e.total+=f,e.wrap&4&&f&&(i.adler=e.check=e.flags?Et(e.check,r,f,i.next_out-f):an(e.check,r,f,i.next_out-f)),i.data_type=e.bits+(e.last?64:0)+(e.mode===oe?128:0)+(e.mode===lr||e.mode===wa?256:0),(d===0&&f===0||t===kh)&&C===Ze&&(C=i2),C},c2=i=>{if(Je(i))return Bt;let t=i.state;return t.window&&(t.window=null),i.state=null,Ze},u2=(i,t)=>{if(Je(i))return Bt;const e=i.state;return e.wrap&2?(e.head=t,t.done=!1,Ze):Bt},d2=(i,t)=>{const e=t.length;let n,r,s;return Je(i)||(n=i.state,n.wrap!==0&&n.mode!==or)?Bt:n.mode===or&&(r=1,r=an(r,t,e,0),r!==n.check)?Ah:(s=ac(i,t,e,e),s?(n.mode=Jh,Ph):(n.havedict=1,Ze))};var f2=ic,g2=nc,p2=ec,m2=o2,_2=rc,v2=h2,y2=c2,b2=u2,w2=d2,S2="pako inflate (from Nodeca project)",le={inflateReset:f2,inflateReset2:g2,inflateResetKeep:p2,inflateInit:m2,inflateInit2:_2,inflate:v2,inflateEnd:y2,inflateGetHeader:b2,inflateSetDictionary:w2,inflateInfo:S2};function C2(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var x2=C2;const oc=Object.prototype.toString,{Z_NO_FLUSH:E2,Z_FINISH:T2,Z_OK:mn,Z_STREAM_END:Ea,Z_NEED_DICT:Ta,Z_STREAM_ERROR:k2,Z_DATA_ERROR:lc,Z_MEM_ERROR:A2}=Ye;function _n(i){this.options=ir.assign({chunkSize:65536,windowBits:15,to:""},i||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(i&&i.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new yh,this.strm.avail_out=0;let e=le.inflateInit2(this.strm,t.windowBits);if(e!==mn)throw new Error(Xe[e]);if(this.header=new x2,le.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=fn.string2buf(t.dictionary):oc.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=le.inflateSetDictionary(this.strm,t.dictionary),e!==mn)))throw new Error(Xe[e])}_n.prototype.push=function(i,t){const e=this.strm,n=this.options.chunkSize,r=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?T2:E2,oc.call(i)==="[object ArrayBuffer]"?e.input=new Uint8Array(i):e.input=i,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),s=le.inflate(e,a),s===Ta&&r&&(s=le.inflateSetDictionary(e,r),s===mn?s=le.inflate(e,a):s===lc&&(s=Ta));e.avail_in>0&&s===Ea&&e.state.wrap>0&&i[e.next_in]!==0;)le.inflateReset(e),s=le.inflate(e,a);switch(s){case k2:case lc:case Ta:case A2:return this.onEnd(s),this.ended=!0,!1}if(o=e.avail_out,e.next_out&&(e.avail_out===0||s===Ea))if(this.options.to==="string"){let h=fn.utf8border(e.output,e.next_out),l=e.next_out-h,c=fn.buf2string(e.output,h);e.next_out=l,e.avail_out=n-l,l&&e.output.set(e.output.subarray(h,h+l),0),this.onData(c)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(s===mn&&o===0)){if(s===Ea)return s=le.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(e.avail_in===0)break}}return!0},_n.prototype.onData=function(i){this.chunks.push(i)},_n.prototype.onEnd=function(i){i===mn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ir.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function ka(i,t){const e=new _n(t);if(e.push(i),e.err)throw e.msg||Xe[e.err];return e.result}function P2(i,t){return t=t||{},t.raw=!0,ka(i,t)}var M2=_n,R2=ka,D2=P2,L2=ka,O2=Ye,I2={Inflate:M2,inflate:R2,inflateRaw:D2,ungzip:L2,constants:O2};const{Deflate:F2,deflate:N2,deflateRaw:U2,gzip:G2}=$g,{Inflate:B2,inflate:z2,inflateRaw:H2,ungzip:j2}=I2;var V2=F2,$2=N2,X2=U2,Y2=G2,W2=B2,q2=z2,K2=H2,Z2=j2,J2=Ye,Q2={Deflate:V2,deflate:$2,deflateRaw:X2,gzip:Y2,Inflate:W2,inflate:q2,inflateRaw:K2,ungzip:Z2,constants:J2};const L={};L.toRGBA8=function(i){const t=i.width,e=i.height;if(i.tabs.acTL===null)return[L.toRGBA8.decodeImage(i.data,t,e,i).buffer];const n=[];i.frames[0].data===null&&(i.frames[0].data=i.data);const r=t*e*4,s=new Uint8Array(r),a=new Uint8Array(r),o=new Uint8Array(r);for(let h=0;h<i.frames.length;h++){const l=i.frames[h],c=l.rect.x,d=l.rect.y,f=l.rect.width,u=l.rect.height,g=L.toRGBA8.decodeImage(l.data,f,u,i);if(h!==0)for(let p=0;p<r;p++)o[p]=s[p];if(l.blend===0?L._copyTile(g,f,u,s,t,e,c,d,0):l.blend===1&&L._copyTile(g,f,u,s,t,e,c,d,1),n.push(s.buffer.slice(0)),l.dispose===1)L._copyTile(a,f,u,s,t,e,c,d,0);else if(l.dispose===2)for(let p=0;p<r;p++)s[p]=o[p]}return n},L.toRGBA8.decodeImage=function(i,t,e,n){const r=t*e,s=L.decode._getBPP(n),a=Math.ceil(t*s/8),o=new Uint8Array(r*4),h=new Uint32Array(o.buffer),l=n.ctype,c=n.depth,d=L._bin.readUshort;if(l===6){const f=r<<2;if(c===8)for(let u=0;u<f;u+=4)o[u]=i[u],o[u+1]=i[u+1],o[u+2]=i[u+2],o[u+3]=i[u+3];if(c===16)for(let u=0;u<f;u++)o[u]=i[u<<1]}else if(l===2){const f=n.tabs.tRNS;if(f===null){if(c===8)for(let u=0;u<r;u++){const g=u*3;h[u]=-16777216|i[g+2]<<16|i[g+1]<<8|i[g]}if(c===16)for(let u=0;u<r;u++){const g=u*6;h[u]=-16777216|i[g+4]<<16|i[g+2]<<8|i[g]}}else{const u=f[0],g=f[1],p=f[2];if(c===8)for(let _=0;_<r;_++){const y=_<<2,b=_*3;h[_]=-16777216|i[b+2]<<16|i[b+1]<<8|i[b],i[b]===u&&i[b+1]===g&&i[b+2]===p&&(o[y+3]=0)}if(c===16)for(let _=0;_<r;_++){const y=_<<2,b=_*6;h[_]=-16777216|i[b+4]<<16|i[b+2]<<8|i[b],d(i,b)===u&&d(i,b+2)===g&&d(i,b+4)===p&&(o[y+3]=0)}}}else if(l===3){const f=n.tabs.PLTE,u=n.tabs.tRNS,g=u?u.length:0;if(c===1)for(let p=0;p<e;p++){const _=p*a,y=p*t;for(let b=0;b<t;b++){const m=y+b<<2,v=i[_+(b>>3)]>>7-((b&7)<<0)&1,w=3*v;o[m]=f[w],o[m+1]=f[w+1],o[m+2]=f[w+2],o[m+3]=v<g?u[v]:255}}if(c===2)for(let p=0;p<e;p++){const _=p*a,y=p*t;for(let b=0;b<t;b++){const m=y+b<<2,v=i[_+(b>>2)]>>6-((b&3)<<1)&3,w=3*v;o[m]=f[w],o[m+1]=f[w+1],o[m+2]=f[w+2],o[m+3]=v<g?u[v]:255}}if(c===4)for(let p=0;p<e;p++){const _=p*a,y=p*t;for(let b=0;b<t;b++){const m=y+b<<2,v=i[_+(b>>1)]>>4-((b&1)<<2)&15,w=3*v;o[m]=f[w],o[m+1]=f[w+1],o[m+2]=f[w+2],o[m+3]=v<g?u[v]:255}}if(c===8)for(let p=0;p<r;p++){const _=p<<2,y=i[p],b=3*y;o[_]=f[b],o[_+1]=f[b+1],o[_+2]=f[b+2],o[_+3]=y<g?u[y]:255}}else if(l===4){if(c===8)for(let f=0;f<r;f++){const u=f<<2,g=f<<1,p=i[g];o[u]=p,o[u+1]=p,o[u+2]=p,o[u+3]=i[g+1]}if(c===16)for(let f=0;f<r;f++){const u=f<<2,g=f<<2,p=i[g];o[u]=p,o[u+1]=p,o[u+2]=p,o[u+3]=i[g+2]}}else if(l===0){const f=n.tabs.tRNS?n.tabs.tRNS:-1;for(let u=0;u<e;u++){const g=u*a,p=u*t;if(c===1)for(let _=0;_<t;_++){const y=255*(i[g+(_>>>3)]>>>7-(_&7)&1),b=y===f*255?0:255;h[p+_]=b<<24|y<<16|y<<8|y}else if(c===2)for(let _=0;_<t;_++){const y=85*(i[g+(_>>>2)]>>>6-((_&3)<<1)&3),b=y===f*85?0:255;h[p+_]=b<<24|y<<16|y<<8|y}else if(c===4)for(let _=0;_<t;_++){const y=17*(i[g+(_>>>1)]>>>4-((_&1)<<2)&15),b=y===f*17?0:255;h[p+_]=b<<24|y<<16|y<<8|y}else if(c===8)for(let _=0;_<t;_++){const y=i[g+_],b=y===f?0:255;h[p+_]=b<<24|y<<16|y<<8|y}else if(c===16)for(let _=0;_<t;_++){const y=i[g+(_<<1)],b=d(i,g+(_<<1))===f?0:255;h[p+_]=b<<24|y<<16|y<<8|y}}}return o},L.decode=function(i){const t=new Uint8Array(i);let e=8;const n=L._bin,r=n.readUshort,s=n.readUint,a={tabs:{},frames:[]},o=new Uint8Array(t.length);let h=0,l,c=0;const d=[137,80,78,71,13,10,26,10];for(let f=0;f<8;f++)if(t[f]!==d[f])throw"The input is not a PNG file!";for(;e<t.length;){const f=n.readUint(t,e);e+=4;const u=n.readASCII(t,e,4);if(e+=4,u==="IHDR")L.decode._IHDR(t,e,a);else if(u==="CgBI")a.tabs[u]=t.slice(e,e+4);else if(u==="IDAT"){for(let g=0;g<f;g++)o[h+g]=t[e+g];h+=f}else if(u==="acTL")a.tabs[u]={num_frames:s(t,e),num_plays:s(t,e+4)},l=new Uint8Array(t.length);else if(u==="fcTL"){if(c!==0){const y=a.frames[a.frames.length-1];y.data=L.decode._decompress(a,l.slice(0,c),y.rect.width,y.rect.height),c=0}const g={x:s(t,e+12),y:s(t,e+16),width:s(t,e+4),height:s(t,e+8)};let p=r(t,e+22);p=r(t,e+20)/(p===0?100:p);const _={rect:g,delay:Math.round(p*1e3),dispose:t[e+24],blend:t[e+25]};a.frames.push(_)}else if(u==="fdAT"){for(let g=0;g<f-4;g++)l[c+g]=t[e+g+4];c+=f-4}else if(u==="pHYs")a.tabs[u]=[n.readUint(t,e),n.readUint(t,e+4),t[e+8]];else if(u==="cHRM"){a.tabs[u]=[];for(let g=0;g<8;g++)a.tabs[u].push(n.readUint(t,e+g*4))}else if(u==="tEXt"||u==="zTXt"){a.tabs[u]===null&&(a.tabs[u]={});const g=n.nextZero(t,e),p=n.readASCII(t,e,g-e);let _;const y=e+f-g-1;if(u==="tEXt")_=n.readASCII(t,g+1,y);else{const b=L.decode._inflate(t.slice(g+2,g+2+y));_=n.readUTF8(b,0,b.length)}a.tabs[u][p]=_}else if(u==="iTXt"){a.tabs[u]==null&&(a.tabs[u]={});let g=0,p=e;g=n.nextZero(t,p);const _=n.readASCII(t,p,g-p);p=g+1;const y=t[p];p+=2,g=n.nextZero(t,p),p=g+1,g=n.nextZero(t,p),p=g+1;let b;const m=f-(p-e);if(y===0)b=n.readUTF8(t,p,m);else{const v=L.decode._inflate(t.slice(p,p+m));b=n.readUTF8(v,0,v.length)}a.tabs[u][_]=b}else if(u==="PLTE")a.tabs[u]=n.readBytes(t,e,f);else if(u==="hIST"){const g=a.tabs.PLTE.length/3;a.tabs[u]=[];for(let p=0;p<g;p++)a.tabs[u].push(r(t,e+p*2))}else if(u==="tRNS")a.ctype===3?a.tabs[u]=n.readBytes(t,e,f):a.ctype===0?a.tabs[u]=r(t,e):a.ctype===2&&(a.tabs[u]=[r(t,e),r(t,e+2),r(t,e+4)]);else if(u==="gAMA")a.tabs[u]=n.readUint(t,e)/1e5;else if(u==="sRGB")a.tabs[u]=t[e];else if(u==="bKGD")a.ctype===0||a.ctype===4?a.tabs[u]=[r(t,e)]:a.ctype===2||a.ctype===6?a.tabs[u]=[r(t,e),r(t,e+2),r(t,e+4)]:a.ctype===3&&(a.tabs[u]=t[e]);else if(u==="IEND")break;e+=f,e+=4}if(c!==0){const f=a.frames[a.frames.length-1];f.data=L.decode._decompress(a,l.slice(0,c),f.rect.width,f.rect.height),c=0}return a.data=L.decode._decompress(a,o,a.width,a.height),delete a.compress,delete a.interlace,delete a.filter,a},L.decode._decompress=function(i,t,e,n){const r=L.decode._getBPP(i),s=Math.ceil(e*r/8),a=new Uint8Array((s+1+i.interlace)*n);return i.tabs.CgBI?t=L.inflateRaw(t,a):t=L.decode._inflate(t,a),i.interlace===0?t=L.decode._filterZero(t,i,0,e,n):i.interlace===1&&(t=L.decode._readInterlace(t,i)),t},L.decode._inflate=function(i,t){return L.inflateRaw(new Uint8Array(i.buffer,2,i.length-6),t)},L.inflateRaw=function(){const i={};return i.H={},i.H.N=function(t,e){const n=Uint8Array;let r=0,s=0,a=0,o=0,h=0,l=0,c=0,d=0,f=0,u,g;if(t[0]===3&&t[1]===0)return e||new n(0);const p=i.H,_=p.b,y=p.e,b=p.R,m=p.n,v=p.A,w=p.Z,S=p.m,T=e===null;for(T&&(e=new n(t.length>>>2<<3));r===0;){if(r=_(t,f,1),s=_(t,f+1,2),f+=3,s===0){f&7&&(f+=8-(f&7));const C=(f>>>3)+4,k=t[C-4]|t[C-3]<<8;T&&(e=i.H.W(e,d+k)),e.set(new n(t.buffer,t.byteOffset+C,k),d),f=C+k<<3,d+=k;continue}if(T&&(e=i.H.W(e,d+131072)),s===1&&(u=S.J,g=S.h,l=511,c=31),s===2){a=y(t,f,5)+257,o=y(t,f+5,5)+1,h=y(t,f+10,4)+4,f+=14;let C=1;for(let E=0;E<38;E+=2)S.Q[E]=0,S.Q[E+1]=0;for(let E=0;E<h;E++){const M=y(t,f+E*3,3);S.Q[(S.X[E]<<1)+1]=M,M>C&&(C=M)}f+=3*h,m(S.Q,C),v(S.Q,C,S.u),u=S.w,g=S.d,f=b(S.u,(1<<C)-1,a+o,t,f,S.v);const k=p.V(S.v,0,a,S.C);l=(1<<k)-1;const x=p.V(S.v,a,o,S.D);c=(1<<x)-1,m(S.C,k),v(S.C,k,u),m(S.D,x),v(S.D,x,g)}for(;;){const C=u[w(t,f)&l];f+=C&15;const k=C>>>4;if(!(k>>>8))e[d++]=k;else{if(k===256)break;{let x=d+k-254;if(k>264){const I=S.q[k-257];x=d+(I>>>3)+y(t,f,I&7),f+=I&7}const E=g[w(t,f)&c];f+=E&15;const M=E>>>4,D=S.c[M],O=(D>>>4)+_(t,f,D&15);for(f+=D&15;d<x;)e[d]=e[d++-O],e[d]=e[d++-O],e[d]=e[d++-O],e[d]=e[d++-O];d=x}}}}return e.length===d?e:e.slice(0,d)},i.H.W=function(t,e){const n=t.length;if(e<=n)return t;const r=new Uint8Array(n<<1);return r.set(t,0),r},i.H.R=function(t,e,n,r,s,a){const o=i.H.e,h=i.H.Z;let l=0;for(;l<n;){const c=t[h(r,s)&e];s+=c&15;const d=c>>>4;if(d<=15)a[l]=d,l++;else{let f=0,u=0;d===16?(u=3+o(r,s,2),s+=2,f=a[l-1]):d===17?(u=3+o(r,s,3),s+=3):d===18&&(u=11+o(r,s,7),s+=7);const g=l+u;for(;l<g;)a[l]=f,l++}}return s},i.H.V=function(t,e,n,r){let s=0,a=0;const o=r.length>>>1;for(;a<n;){const h=t[a+e];r[a<<1]=0,r[(a<<1)+1]=h,h>s&&(s=h),a++}for(;a<o;)r[a<<1]=0,r[(a<<1)+1]=0,a++;return s},i.H.n=function(t,e){const n=i.H.m,r=t.length;let s,a,o,h,l;const c=n.j;for(let f=0;f<=e;f++)c[f]=0;for(h=1;h<r;h+=2)c[t[h]]++;const d=n.K;for(s=0,c[0]=0,a=1;a<=e;a++)s=s+c[a-1]<<1,d[a]=s;for(o=0;o<r;o+=2)l=t[o+1],l!==0&&(t[o]=d[l],d[l]++)},i.H.A=function(t,e,n){const r=t.length,a=i.H.m.r;for(let o=0;o<r;o+=2)if(t[o+1]!==0){const h=o>>1,l=t[o+1],c=h<<4|l,d=e-l;let f=t[o]<<d;const u=f+(1<<d);for(;f!==u;){const g=a[f]>>>15-e;n[g]=c,f++}}},i.H.l=function(t,e){const n=i.H.m.r,r=15-e;for(let s=0;s<t.length;s+=2){const a=t[s]<<e-t[s+1];t[s]=n[a]>>>r}},i.H.M=function(t,e,n){n=n<<(e&7);const r=e>>>3;t[r]|=n,t[r+1]|=n>>>8},i.H.I=function(t,e,n){n=n<<(e&7);const r=e>>>3;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},i.H.e=function(t,e,n){return(t[e>>>3]|t[(e>>>3)+1]<<8)>>>(e&7)&(1<<n)-1},i.H.b=function(t,e,n){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16)>>>(e&7)&(1<<n)-1},i.H.Z=function(t,e){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16)>>>(e&7)},i.H.i=function(t,e){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16|t[(e>>>3)+3]<<24)>>>(e&7)},i.H.m=function(){const t=Uint16Array,e=Uint32Array;return{K:new t(16),j:new t(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new t(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new e(32),J:new t(512),_:[],h:new t(32),$:[],w:new t(32768),C:[],v:[],d:new t(32768),D:[],u:new t(512),Q:[],r:new t(32768),s:new e(286),Y:new e(30),a:new e(19),t:new e(15e3),k:new t(65536),g:new t(32768)}}(),function(){const t=i.H.m,e=32768;for(let r=0;r<e;r++){let s=r;s=(s&2863311530)>>>1|(s&1431655765)<<1,s=(s&3435973836)>>>2|(s&858993459)<<2,s=(s&4042322160)>>>4|(s&252645135)<<4,s=(s&4278255360)>>>8|(s&16711935)<<8,t.r[r]=(s>>>16|s<<16)>>>17}function n(r,s,a){for(;s--!==0;)r.push(0,a)}for(let r=0;r<32;r++)t.q[r]=t.S[r]<<3|t.T[r],t.c[r]=t.p[r]<<4|t.z[r];n(t._,144,8),n(t._,112,9),n(t._,24,7),n(t._,8,8),i.H.n(t._,9),i.H.A(t._,9,t.J),i.H.l(t._,9),n(t.$,32,5),i.H.n(t.$,5),i.H.A(t.$,5,t.h),i.H.l(t.$,5),n(t.Q,19,0),n(t.C,286,0),n(t.D,30,0),n(t.v,320,0)}(),i.H.N}(),L.decode._readInterlace=function(i,t){const e=t.width,n=t.height,r=L.decode._getBPP(t),s=r>>3,a=Math.ceil(e*r/8),o=new Uint8Array(n*a);let h=0;const l=[0,0,4,0,2,0,1],c=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],f=[8,8,4,4,2,2,1];let u=0;for(;u<7;){const g=d[u],p=f[u];let _=0,y=0,b=l[u];for(;b<n;)b+=g,y++;let m=c[u];for(;m<e;)m+=p,_++;const v=Math.ceil(_*r/8);L.decode._filterZero(i,t,h,_,y);let w=0,S=l[u];for(;S<n;){let T=c[u],C=h+w*v<<3;for(;T<e;){if(r===1){let k=i[C>>3];k=k>>7-(C&7)&1,o[S*a+(T>>3)]|=k<<7-((T&7)<<0)}if(r===2){let k=i[C>>3];k=k>>6-(C&7)&3,o[S*a+(T>>2)]|=k<<6-((T&3)<<1)}if(r===4){let k=i[C>>3];k=k>>4-(C&7)&15,o[S*a+(T>>1)]|=k<<4-((T&1)<<2)}if(r>=8){const k=S*a+T*s;for(let x=0;x<s;x++)o[k+x]=i[(C>>3)+x]}C+=r,T+=p}w++,S+=g}_*y!==0&&(h+=y*(1+v)),u=u+1}return o},L.decode._getBPP=function(i){return[1,null,3,1,2,null,4][i.ctype]*i.depth},L.decode._filterZero=function(i,t,e,n,r){let s=L.decode._getBPP(t);const a=Math.ceil(n*s/8),o=L.decode._paeth;s=Math.ceil(s/8);let h=0,l=1,c=i[e],d=0;if(c>1&&(i[e]=[0,0,1][c-2]),c===3)for(d=s;d<a;d++)i[d+1]=i[d+1]+(i[d+1-s]>>>1)&255;for(let f=0;f<r;f++)if(h=e+f*a,l=h+f+1,c=i[l-1],d=0,c===0)for(;d<a;d++)i[h+d]=i[l+d];else if(c===1){for(;d<s;d++)i[h+d]=i[l+d];for(;d<a;d++)i[h+d]=i[l+d]+i[h+d-s]}else if(c===2)for(;d<a;d++)i[h+d]=i[l+d]+i[h+d-a];else if(c===3){for(;d<s;d++)i[h+d]=i[l+d]+(i[h+d-a]>>>1);for(;d<a;d++)i[h+d]=i[l+d]+(i[h+d-a]+i[h+d-s]>>>1)}else{for(;d<s;d++)i[h+d]=i[l+d]+o(0,i[h+d-a],0);for(;d<a;d++)i[h+d]=i[l+d]+o(i[h+d-s],i[h+d-a],i[h+d-s-a])}return i},L.decode._paeth=function(i,t,e){const n=i+t-e,r=n-i,s=n-t,a=n-e;return r*r<=s*s&&r*r<=a*a?i:s*s<=a*a?t:e},L.decode._IHDR=function(i,t,e){const n=L._bin;e.width=n.readUint(i,t),t+=4,e.height=n.readUint(i,t),t+=4,e.depth=i[t],t++,e.ctype=i[t],t++,e.compress=i[t],t++,e.filter=i[t],t++,e.interlace=i[t],t++},L._bin={nextZero:function(i,t){for(;i[t]!==0;)t++;return t},readUshort:function(i,t){return i[t]<<8|i[t+1]},writeUshort:function(i,t,e){i[t]=e>>8&255,i[t+1]=e&255},readUint:function(i,t){return i[t]*16777216+(i[t+1]<<16|i[t+2]<<8|i[t+3])},writeUint:function(i,t,e){i[t]=e>>24&255,i[t+1]=e>>16&255,i[t+2]=e>>8&255,i[t+3]=e&255},readASCII:function(i,t,e){let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(i[t+r]);return n},writeASCII:function(i,t,e){for(let n=0;n<e.length;n++)i[t+n]=e.charCodeAt(n)},readBytes:function(i,t,e){const n=[];for(let r=0;r<e;r++)n.push(i[t+r]);return n},pad:function(i){return i.length<2?"0"+i:i},readUTF8:function(i,t,e){let n="",r;for(let s=0;s<e;s++)n+="%"+L._bin.pad(i[t+s].toString(16));try{r=decodeURIComponent(n)}catch{return L._bin.readASCII(i,t,e)}return r}},L._copyTile=function(i,t,e,n,r,s,a,o,h){const l=Math.min(t,r),c=Math.min(e,s);let d=0,f=0;for(let u=0;u<c;u++)for(let g=0;g<l;g++)if(a>=0&&o>=0?(d=u*t+g<<2,f=(o+u)*r+a+g<<2):(d=(-o+u)*t-a+g<<2,f=u*r+g<<2),h===0)n[f]=i[d],n[f+1]=i[d+1],n[f+2]=i[d+2],n[f+3]=i[d+3];else if(h===1){const p=i[d+3]*.00392156862745098,_=i[d]*p,y=i[d+1]*p,b=i[d+2]*p,m=n[f+3]*(1/255),v=n[f]*m,w=n[f+1]*m,S=n[f+2]*m,T=1-p,C=p+m*T,k=C===0?0:1/C;n[f+3]=255*C,n[f+0]=(_+v*T)*k,n[f+1]=(y+w*T)*k,n[f+2]=(b+S*T)*k}else if(h===2){const p=i[d+3],_=i[d],y=i[d+1],b=i[d+2],m=n[f+3],v=n[f],w=n[f+1],S=n[f+2];p===m&&_===v&&y===w&&b===S?(n[f]=0,n[f+1]=0,n[f+2]=0,n[f+3]=0):(n[f]=_,n[f+1]=y,n[f+2]=b,n[f+3]=p)}else if(h===3){const p=i[d+3],_=i[d],y=i[d+1],b=i[d+2],m=n[f+3],v=n[f],w=n[f+1],S=n[f+2];if(p===m&&_===v&&y===w&&b===S)continue;if(p<220&&m>20)return!1}return!0},L.encode=function(i,t,e,n,r,s,a){n===null&&(n=0),a===null&&(a=!1);const o=L.encode.compress(i,t,e,n,[!1,!1,!1,0,a]);return L.encode.compressPNG(o,-1),L.encode._main(o,t,e,r,s)},L.encodeLL=function(i,t,e,n,r,s,a,o){const h={ctype:0+(n===1?0:2)+(r===0?0:4),depth:s,frames:[]},l=(n+r)*s,c=l*t;for(let f=0;f<i.length;f++)h.frames.push({rect:{x:0,y:0,width:t,height:e},img:new Uint8Array(i[f]),blend:0,dispose:1,bpp:Math.ceil(l/8),bpl:Math.ceil(c/8)});return L.encode.compressPNG(h,0,!0),L.encode._main(h,t,e,a,o)},L.encode._main=function(i,t,e,n,r){r||(r={});const s=L.crc.crc,a=L._bin.writeUint,o=L._bin.writeUshort,h=L._bin.writeASCII;let l=8;const c=i.frames.length>1;let d=!1,f=8+(16+5+4)+(c?20:0);if(r.sRGB!==null&&r.sRGB!==void 0&&(f+=13),r.pHYs!==null&&r.pHYs!==void 0&&(f+=21),i.ctype===3){const _=i.plte.length;for(let y=0;y<_;y++)i.plte[y]>>>24!==255&&(d=!0);f+=8+_*3+4+(d?8+_*1+4:0)}for(let _=0;_<i.frames.length;_++){const y=i.frames[_];c&&(f+=38),f+=y.cimg.length+12,_!==0&&(f+=4)}f+=12;const u=new Uint8Array(f),g=[137,80,78,71,13,10,26,10];for(let _=0;_<8;_++)u[_]=g[_];if(a(u,l,13),l+=4,h(u,l,"IHDR"),l+=4,a(u,l,t),l+=4,a(u,l,e),l+=4,u[l]=i.depth,l++,u[l]=i.ctype,l++,u[l]=0,l++,u[l]=0,l++,u[l]=0,l++,a(u,l,s(u,l-17,17)),l+=4,r.sRGB!==null&&r.sRGB!==void 0&&(a(u,l,1),l+=4,h(u,l,"sRGB"),l+=4,u[l]=r.sRGB,l++,a(u,l,s(u,l-5,5)),l+=4),r.pHYs!==null&&r.pHYs!==void 0&&(a(u,l,9),l+=4,h(u,l,"pHYs"),l+=4,a(u,l,r.pHYs[0]),l+=4,a(u,l,r.pHYs[1]),l+=4,u[l]=r.pHYs[2],l++,a(u,l,s(u,l-13,13)),l+=4),c&&(a(u,l,8),l+=4,h(u,l,"acTL"),l+=4,a(u,l,i.frames.length),l+=4,a(u,l,r.loop!=null?r.loop:0),l+=4,a(u,l,s(u,l-12,12)),l+=4),i.ctype===3){const _=i.plte.length;a(u,l,_*3),l+=4,h(u,l,"PLTE"),l+=4;for(let y=0;y<_;y++){const b=y*3,m=i.plte[y],v=m&255,w=m>>>8&255,S=m>>>16&255;u[l+b+0]=v,u[l+b+1]=w,u[l+b+2]=S}if(l+=_*3,a(u,l,s(u,l-_*3-4,_*3+4)),l+=4,d){a(u,l,_),l+=4,h(u,l,"tRNS"),l+=4;for(let y=0;y<_;y++)u[l+y]=i.plte[y]>>>24&255;l+=_,a(u,l,s(u,l-_-4,_+4)),l+=4}}let p=0;for(let _=0;_<i.frames.length;_++){const y=i.frames[_];c&&(a(u,l,26),l+=4,h(u,l,"fcTL"),l+=4,a(u,l,p++),l+=4,a(u,l,y.rect.width),l+=4,a(u,l,y.rect.height),l+=4,a(u,l,y.rect.x),l+=4,a(u,l,y.rect.y),l+=4,o(u,l,n[_]),l+=2,o(u,l,1e3),l+=2,u[l]=y.dispose,l++,u[l]=y.blend,l++,a(u,l,s(u,l-30,30)),l+=4);const b=y.cimg,m=b.length;a(u,l,m+(_===0?0:4)),l+=4;const v=l;h(u,l,_===0?"IDAT":"fdAT"),l+=4,_!==0&&(a(u,l,p++),l+=4),u.set(b,l),l+=m,a(u,l,s(u,v,l-v)),l+=4}return a(u,l,0),l+=4,h(u,l,"IEND"),l+=4,a(u,l,s(u,l-4,4)),l+=4,u.buffer},L.encode.compressPNG=function(i,t,e){for(let n=0;n<i.frames.length;n++){const r=i.frames[n],s=r.rect.height,a=new Uint8Array(s*r.bpl+s);r.cimg=L.encode._filterZero(r.img,s,r.bpp,r.bpl,a,t,e)}},L.encode.compress=function(i,t,e,n,r){const s=r[0],a=r[1],o=r[2],h=r[3],l=r[4];let c=6,d=8,f=255;for(let m=0;m<i.length;m++){const v=new Uint8Array(i[m]),w=v.length;for(let S=0;S<w;S+=4)f&=v[S+3]}const u=f!==255,g=L.encode.framize(i,t,e,s,a,o),p={},_=[],y=[];if(n!==0){const m=[];for(let C=0;C<g.length;C++)m.push(g[C].img.buffer);const v=L.encode.concatRGBA(m),w=L.quantize(v,n);let S=0;const T=new Uint8Array(w.abuf);for(let C=0;C<g.length;C++){const k=g[C].img,x=k.length;y.push(new Uint8Array(w.inds.buffer,S>>2,x>>2));for(let E=0;E<x;E+=4)k[E]=T[S+E],k[E+1]=T[S+E+1],k[E+2]=T[S+E+2],k[E+3]=T[S+E+3];S+=x}for(let C=0;C<w.plte.length;C++)_.push(w.plte[C].est.rgba)}else for(let m=0;m<g.length;m++){const v=g[m],w=new Uint32Array(v.img.buffer),S=v.rect.width,T=w.length,C=new Uint8Array(T);y.push(C);for(let k=0;k<T;k++){const x=w[k];if(k!==0&&x===w[k-1])C[k]=C[k-1];else if(k>S&&x===w[k-S])C[k]=C[k-S];else{let E=p[x];if(E===null&&(p[x]=E=_.length,_.push(x),_.length>=300))break;C[k]=E}}}const b=_.length;b<=256&&l===!1&&(b<=2?d=1:b<=4?d=2:b<=16?d=4:d=8,d=Math.max(d,h));for(let m=0;m<g.length;m++){const v=g[m],w=v.rect.width,S=v.rect.height;let T=v.img,C=4*w,k=4;if(b<=256&&l===!1){C=Math.ceil(d*w/8);const x=new Uint8Array(C*S),E=y[m];for(let M=0;M<S;M++){const D=M*C,O=M*w;if(d===8)for(let I=0;I<w;I++)x[D+I]=E[O+I];else if(d===4)for(let I=0;I<w;I++)x[D+(I>>1)]|=E[O+I]<<4-(I&1)*4;else if(d===2)for(let I=0;I<w;I++)x[D+(I>>2)]|=E[O+I]<<6-(I&3)*2;else if(d===1)for(let I=0;I<w;I++)x[D+(I>>3)]|=E[O+I]<<7-(I&7)*1}T=x,c=3,k=1}else if(u===!1&&g.length===1){const x=new Uint8Array(w*S*3),E=w*S;for(let M=0;M<E;M++){const D=M*3,O=M*4;x[D]=T[O],x[D+1]=T[O+1],x[D+2]=T[O+2]}T=x,c=2,k=3,C=3*w}v.img=T,v.bpl=C,v.bpp=k}return{ctype:c,depth:d,plte:_,frames:g}},L.encode.framize=function(i,t,e,n,r,s){const a=[];for(let o=0;o<i.length;o++){const h=new Uint8Array(i[o]),l=new Uint32Array(h.buffer);let c,d=0,f=0,u=t,g=e,p=n?1:0;if(o!==0){const _=s||n||o===1||a[o-2].dispose!==0?1:2;let y=0,b=1e9;for(let v=0;v<_;v++){const w=new Uint32Array(i[o-1-v]);let S=t,T=e,C=-1,k=-1;for(let E=0;E<e;E++)for(let M=0;M<t;M++){const D=E*t+M;l[D]!==w[D]&&(M<S&&(S=M),M>C&&(C=M),E<T&&(T=E),E>k&&(k=E))}C===-1&&(S=T=C=k=0),r&&((S&1)===1&&S--,(T&1)===1&&T--);const x=(C-S+1)*(k-T+1);x<b&&(b=x,y=v,d=S,f=T,u=C-S+1,g=k-T+1)}const m=new Uint8Array(i[o-1-y]);y===1&&(a[o-1].dispose=2),c=new Uint8Array(u*g*4),L._copyTile(m,t,e,c,u,g,-d,-f,0),p=L._copyTile(h,t,e,c,u,g,-d,-f,3)?1:0,p===1?L.encode._prepareDiff(h,t,e,c,{x:d,y:f,width:u,height:g}):L._copyTile(h,t,e,c,u,g,-d,-f,0)}else c=h.slice(0);a.push({rect:{x:d,y:f,width:u,height:g},img:c,blend:p,dispose:0})}if(n)for(let o=0;o<a.length;o++){const h=a[o];if(h.blend===1)continue;const l=h.rect,c=a[o-1].rect,d=Math.min(l.x,c.x),f=Math.min(l.y,c.y),u=Math.max(l.x+l.width,c.x+c.width),g=Math.max(l.y+l.height,c.y+c.height),p={x:d,y:f,width:u-d,height:g-f};a[o-1].dispose=1,o-1!==0&&L.encode._updateFrame(i,t,e,a,o-1,p,r),L.encode._updateFrame(i,t,e,a,o,p,r)}return a},L.encode._updateFrame=function(i,t,e,n,r,s,a){const o=Uint8Array,h=Uint32Array,l=new o(i[r-1]),c=new h(i[r-1]),d=r+1<i.length?new o(i[r+1]):null,f=new o(i[r]),u=new h(f.buffer);let g=t,p=e,_=-1,y=-1;for(let m=0;m<s.height;m++)for(let v=0;v<s.width;v++){const w=s.x+v,S=s.y+m,T=S*t+w,C=u[T];C===0||n[r-1].dispose===0&&c[T]===C&&(d===null||d[T*4+3]!==0)||(w<g&&(g=w),w>_&&(_=w),S<p&&(p=S),S>y&&(y=S))}_===-1&&(g=p=_=y=0),a&&((g&1)===1&&g--,(p&1)===1&&p--),s={x:g,y:p,width:_-g+1,height:y-p+1};const b=n[r];b.rect=s,b.blend=1,b.img=new Uint8Array(s.width*s.height*4),n[r-1].dispose===0?(L._copyTile(l,t,e,b.img,s.width,s.height,-s.x,-s.y,0),L.encode._prepareDiff(f,t,e,b.img,s)):L._copyTile(f,t,e,b.img,s.width,s.height,-s.x,-s.y,0)},L.encode._prepareDiff=function(i,t,e,n,r){L._copyTile(i,t,e,n,r.width,r.height,-r.x,-r.y,2)},L.encode._filterZero=function(i,t,e,n,r,s,a){const o=[];let h=[0,1,2,3,4];s!==-1?h=[s]:(t*n>5e5||e===1)&&(h=[0]);let l;a&&(l={level:0});const c=r.length>1e7&&zl!=null?zl:Q2;for(let u=0;u<h.length;u++){for(let g=0;g<t;g++)L.encode._filterLine(r,i,g,n,e,h[u]);o.push(c.deflate(r,l))}let d,f=1e9;for(let u=0;u<o.length;u++)o[u].length<f&&(d=u,f=o[u].length);return o[d]},L.encode._filterLine=function(i,t,e,n,r,s){const a=e*n;let o=a+e;const h=L.decode._paeth;if(i[o]=s,o++,s===0)if(n<500)for(let l=0;l<n;l++)i[o+l]=t[a+l];else i.set(new Uint8Array(t.buffer,a,n),o);else if(s===1){for(let l=0;l<r;l++)i[o+l]=t[a+l];for(let l=r;l<n;l++)i[o+l]=t[a+l]-t[a+l-r]+256&255}else if(e===0){for(let l=0;l<r;l++)i[o+l]=t[a+l];if(s===2)for(let l=r;l<n;l++)i[o+l]=t[a+l];if(s===3)for(let l=r;l<n;l++)i[o+l]=t[a+l]-(t[a+l-r]>>1)+256&255;if(s===4)for(let l=r;l<n;l++)i[o+l]=t[a+l]-h(t[a+l-r],0,0)+256&255}else{if(s===2)for(let l=0;l<n;l++)i[o+l]=t[a+l]+256-t[a+l-n]&255;if(s===3){for(let l=0;l<r;l++)i[o+l]=t[a+l]+256-(t[a+l-n]>>1)&255;for(let l=r;l<n;l++)i[o+l]=t[a+l]+256-(t[a+l-n]+t[a+l-r]>>1)&255}if(s===4){for(let l=0;l<r;l++)i[o+l]=t[a+l]+256-h(0,t[a+l-n],0)&255;for(let l=r;l<n;l++)i[o+l]=t[a+l]+256-h(t[a+l-r],t[a+l-n],t[a+l-r-n])&255}}},L.crc={table:function(){const i=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;i[t]=e}return i}(),update:function(i,t,e,n){for(let r=0;r<n;r++)i=L.crc.table[(i^t[e+r])&255]^i>>>8;return i},crc:function(i,t,e){return L.crc.update(4294967295,i,t,e)^4294967295}},L.quantize=function(i,t){const e=new Uint8Array(i),n=e.slice(0),r=new Uint32Array(n.buffer),s=L.quantize.getKDtree(n,t),a=s[0],o=s[1],h=L.quantize.planeDst,l=e,c=r,d=l.length,f=new Uint8Array(e.length>>2);let u;if(e.length<2e7)for(let g=0;g<d;g+=4){const p=l[g]*.00392156862745098,_=l[g+1]*(1/255),y=l[g+2]*(1/255),b=l[g+3]*(1/255);u=L.quantize.getNearest(a,p,_,y,b),f[g>>2]=u.ind,c[g>>2]=u.est.rgba}else for(let g=0;g<d;g+=4){const p=l[g]*.00392156862745098,_=l[g+1]*(1/255),y=l[g+2]*(1/255),b=l[g+3]*(1/255);for(u=a;u.left;)u=h(u.est,p,_,y,b)<=0?u.left:u.right;f[g>>2]=u.ind,c[g>>2]=u.est.rgba}return{abuf:n.buffer,inds:f,plte:o}},L.quantize.getKDtree=function(i,t,e){e===null&&(e=1e-4);const n=new Uint32Array(i.buffer),r={i0:0,i1:i.length,bst:null,est:null,tdst:0,left:null,right:null};r.bst=L.quantize.stats(i,r.i0,r.i1),r.est=L.quantize.estats(r.bst);const s=[r];for(;s.length<t;){let a=0,o=0;for(let u=0;u<s.length;u++)s[u].est.L>a&&(a=s[u].est.L,o=u);if(a<e)break;const h=s[o],l=L.quantize.splitPixels(i,n,h.i0,h.i1,h.est.e,h.est.eMq255);if(h.i0>=l||h.i1<=l){h.est.L=0;continue}const d={i0:h.i0,i1:l,bst:null,est:null,tdst:0,left:null,right:null};d.bst=L.quantize.stats(i,d.i0,d.i1),d.est=L.quantize.estats(d.bst);const f={i0:l,i1:h.i1,bst:null,est:null,tdst:0,left:null,right:null};f.bst={R:[],m:[],N:h.bst.N-d.bst.N};for(let u=0;u<16;u++)f.bst.R[u]=h.bst.R[u]-d.bst.R[u];for(let u=0;u<4;u++)f.bst.m[u]=h.bst.m[u]-d.bst.m[u];f.est=L.quantize.estats(f.bst),h.left=d,h.right=f,s[o]=d,s.push(f)}s.sort(function(a,o){return o.bst.N-a.bst.N});for(let a=0;a<s.length;a++)s[a].ind=a;return[r,s]},L.quantize.getNearest=function(i,t,e,n,r){if(i.left==null)return i.tdst=L.quantize.dist(i.est.q,t,e,n,r),i;const s=L.quantize.planeDst(i.est,t,e,n,r);let a=i.left,o=i.right;s>0&&(a=i.right,o=i.left);const h=L.quantize.getNearest(a,t,e,n,r);if(h.tdst<=s*s)return h;const l=L.quantize.getNearest(o,t,e,n,r);return l.tdst<h.tdst?l:h},L.quantize.planeDst=function(i,t,e,n,r){const s=i.e;return s[0]*t+s[1]*e+s[2]*n+s[3]*r-i.eMq},L.quantize.dist=function(i,t,e,n,r){const s=t-i[0],a=e-i[1],o=n-i[2],h=r-i[3];return s*s+a*a+o*o+h*h},L.quantize.splitPixels=function(i,t,e,n,r,s){const a=L.quantize.vecDot;for(n-=4;e<n;){for(;a(i,e,r)<=s;)e+=4;for(;a(i,n,r)>s;)n-=4;if(e>=n)break;const o=t[e>>2];t[e>>2]=t[n>>2],t[n>>2]=o,e+=4,n-=4}for(;a(i,e,r)>s;)e-=4;return e+4},L.quantize.vecDot=function(i,t,e){return i[t]*e[0]+i[t+1]*e[1]+i[t+2]*e[2]+i[t+3]*e[3]},L.quantize.stats=function(i,t,e){const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=[0,0,0,0],s=e-t>>2;for(let a=t;a<e;a+=4){const o=i[a]*.00392156862745098,h=i[a+1]*(1/255),l=i[a+2]*(1/255),c=i[a+3]*(1/255);r[0]+=o,r[1]+=h,r[2]+=l,r[3]+=c,n[0]+=o*o,n[1]+=o*h,n[2]+=o*l,n[3]+=o*c,n[5]+=h*h,n[6]+=h*l,n[7]+=h*c,n[10]+=l*l,n[11]+=l*c,n[15]+=c*c}return n[4]=n[1],n[8]=n[2],n[9]=n[6],n[12]=n[3],n[13]=n[7],n[14]=n[11],{R:n,m:r,N:s}},L.quantize.estats=function(i){const t=i.R,e=i.m,n=i.N,r=e[0],s=e[1],a=e[2],o=e[3],h=n===0?0:1/n,l=[t[0]-r*r*h,t[1]-r*s*h,t[2]-r*a*h,t[3]-r*o*h,t[4]-s*r*h,t[5]-s*s*h,t[6]-s*a*h,t[7]-s*o*h,t[8]-a*r*h,t[9]-a*s*h,t[10]-a*a*h,t[11]-a*o*h,t[12]-o*r*h,t[13]-o*s*h,t[14]-o*a*h,t[15]-o*o*h],c=l,d=L.M4;let f=[Math.random(),Math.random(),Math.random(),Math.random()],u=0,g=0;if(n!==0)for(let y=0;y<16&&(f=d.multVec(c,f),g=Math.sqrt(d.dot(f,f)),f=d.sml(1/g,f),!(y!==0&&Math.abs(g-u)<1e-9));y++)u=g;const p=[r*h,s*h,a*h,o*h],_=d.dot(d.sml(255,p),f);return{Cov:l,q:p,e:f,L:u,eMq255:_,eMq:d.dot(f,p),rgba:(Math.round(255*p[3])<<24|Math.round(255*p[2])<<16|Math.round(255*p[1])<<8|Math.round(255*p[0])<<0)>>>0}},L.M4={multVec:function(i,t){return[i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]*t[3],i[4]*t[0]+i[5]*t[1]+i[6]*t[2]+i[7]*t[3],i[8]*t[0]+i[9]*t[1]+i[10]*t[2]+i[11]*t[3],i[12]*t[0]+i[13]*t[1]+i[14]*t[2]+i[15]*t[3]]},dot:function(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]*t[3]},sml:function(i,t){return[i*t[0],i*t[1],i*t[2],i*t[3]]}},L.encode.concatRGBA=function(i){let t=0;for(let r=0;r<i.length;r++)t+=i[r].byteLength;const e=new Uint8Array(t);let n=0;for(let r=0;r<i.length;r++){const s=new Uint8Array(i[r]),a=s.length;for(let o=0;o<a;o+=4){let h=s[o],l=s[o+1],c=s[o+2];const d=s[o+3];d===0&&(h=l=c=0),e[n+o]=h,e[n+o+1]=l,e[n+o+2]=c,e[n+o+3]=d}n+=a}return e.buffer};const cr=new Map,Aa=(i,t)=>{if(cr.has(i))return t(null,cr.get(i));const e=new Image;e.onload=function(){cr.set(i,{width:e.width,height:e.height,element:e}),t(null,cr.get(i))},e.onerror=function(n){t(n,null)},e.src=i},Pa=(i,t)=>{Aa(i,(e,n)=>{if(!n)return t(e,null);const r=document.createElement("canvas"),s=r.getContext("2d");return r.width=n.width,r.height=n.height,s.drawImage(n.element,0,0,r.width,r.height),s.getImageData(0,0,r.width,r.height)})},tp=(i,t)=>{for(let e=0,n=i.length;e<n;e++){const r=i[e],{type:s}=r;if(s.split("/")[0]!=="image")return;let o;const h=new FileReader;h.onload=function(l){if(!l.target)return t("no reader target",null);const c=l.target.result;o=wo(c);const f=new Blob([c]);Ma(f,(u,g)=>{if(!g)return t(u,null);Aa(g,(p,_)=>{if(!_)return t(p,null);Pa(g,(y,b)=>{if(!b)return t(y,null);const m={name:r.name,fileType:o,size:r.size,width:_.width,height:_.height,imgUrl:g,imageData:b,blob:f};return t(null,m)})})})},h.readAsArrayBuffer(r)}},ep=(i,t=0,e=0)=>{const n=document.createElement("canvas"),r=n.getContext("2d");return n.width=t,n.height=e,r.drawImage(i,0,0,t,e),r.getImageData(0,0,t,e)},ip=(i,t=0,e=0)=>{const n=document.createElement("canvas"),r=n.getContext("2d");return n.width=t,n.height=e,r.drawImage(i,0,0,t,e),r.getImageData(0,0,t,e)},np=i=>{const t=i.width,e=i.height,n=t*e*3,r=n+54,s=[66,77,r&255,r>>8&255,r>>16&255,r>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,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],o=(4-t*3%4)%4,h=i.data;let l="";const c=t<<2;let d=e;const f=String.fromCharCode;do{const g=c*(d-1);let p="";for(let _=0;_<t;_++){const y=_<<2;p+=f(h[g+y+2])+f(h[g+y+1])+f(h[g+y])}for(let _=0;_<o;_++)p+=String.fromCharCode(0);l+=p}while(--d);function u(g){if(!window.btoa)throw"btoa undefined";let p="";if(typeof g=="string")p=g;else for(let _=0;_<g.length;_++)p+=String.fromCharCode(g[_]);return btoa(p)}return u(s.concat(a))+u(l)},rp=i=>{const{width:t,height:e}=i,n=document.createElement("canvas"),r=n.getContext("2d");return n.width=t,n.height=e,r.putImageData(i,0,0,0,0,t,e),n.toDataURL("image/png")},sp=(i,t,e)=>{const{width:n,height:r}=i,s=document.createElement("canvas"),a=s.getContext("2d");s.width=n,s.height=r,a.putImageData(i,0,0,0,0,n,r);const o=`image/${t?t.toLowerCase():"png"}`;s.toBlob(h=>{e?.(null,h)},o,1)},Ma=(i,t)=>{const e=new FileReader;e.onload=function(n){n.target?t(null,n.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(i)},ap=(i,t)=>{Ma(i,function(e,n){if(n){const r=new Image;r.src=n}else t(e)})};function op(i,t){Pa(i,(e,n)=>{if(!n)return t(e,null);const r=n.data;let s=0;const a=[],o=[],h=[];for(let f=0;f<r.length;f+=4)a[s]=r[f],o[s]=r[f+1],h[s]=r[f+2],s+=1;const l=Ra(a),c=Ra(o),d=Ra(h);return t(null,"rgb("+l+","+c+","+d+")")})}function Ra(i){const t={},e=[],n=[];for(let o=0;o<i.length;o++)t[i[o]]?e.push(i[o]):t[i[o]]=1;let r=0;for(let o=0;o<e.length;o++){r=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(r+=1),n[o]=r}const s=Math.max.apply(null,n);let a=0;for(;a<n.length;a++)if(n[a]===s)return;return e[a]}const lp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[(a*e+e-o-1)*4],r[h+1]=t[(a*e+e-o-1)*4+1],r[h+2]=t[(a*e+e-o-1)*4+2],r[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(r,e,n)},hp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[((n-a-1)*e+o)*4],r[h+1]=t[((n-a-1)*e+o)*4+1],r[h+2]=t[((n-a-1)*e+o)*4+2],r[h+3]=t[((n-a-1)*e+o)*4+3]}return new ImageData(r,e,n)},cp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<n;o++){const h=(a*n+o)*4;r[h]=t[(o*e+e-a-1)*4],r[h+1]=t[(o*e+e-a-1)*4+1],r[h+2]=t[(o*e+e-a-1)*4+2],r[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(r,n,e)},up=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<n;o++){const h=(a*n+o)*4;r[h]=t[((n-o-1)*e+a)*4],r[h+1]=t[((n-o-1)*e+a)*4+1],r[h+2]=t[((n-o-1)*e+a)*4+2],r[h+3]=t[((n-o-1)*e+a)*4+3]}return new ImageData(r,n,e)},dp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3;r[h]=l,r[h+1]=l,r[h+2]=l,r[h+3]=t[h+3]}return new ImageData(r,e,n)},fp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];r[h]=l,r[h+1]=l,r[h+2]=l,r[h+3]=t[h+3]}return new ImageData(r,e,n)},gp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3>127?255:0;r[h]=c,r[h+1]=c,r[h+2]=c,r[h+3]=t[h+3]}return new ImageData(r,e,n)},pp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=255-t[h],r[h+1]=255-t[h+1],r[h+2]=255-t[h+2],r[h+3]=t[h+3]}return new ImageData(r,e,n)},mp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[h],r[h+1]=0,r[h+2]=0,r[h+3]=t[h+3]}return new ImageData(r,e,n)},_p=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=0,r[h+1]=t[h+1],r[h+2]=0,r[h+3]=t[h+3]}return new ImageData(r,e,n)},vp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=0,r[h+1]=0,r[h+2]=t[h+2],r[h+3]=t[h+3]}return new ImageData(r,e,n)},yp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[h],r[h+1]=t[h+1],r[h+2]=0,r[h+3]=t[h+3]}return new ImageData(r,e,n)},bp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[h],r[h+1]=0,r[h+2]=t[h+1],r[h+3]=t[h+3]}return new ImageData(r,e,n)},wp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=0,r[h+1]=t[h+1],r[h+2]=t[h+1],r[h+3]=t[h+3]}return new ImageData(r,e,n)},Sp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h+1]+t[h+2])/2;r[h]=t[h],r[h+1]=l,r[h+2]=l,r[h+3]=t[h+3]}return new ImageData(r,e,n)},Cp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+2])/2;r[h]=l,r[h+1]=t[h+1],r[h+2]=l,r[h+3]=t[h+3]}return new ImageData(r,e,n)},xp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1])/2;r[h]=l,r[h+1]=l,r[h+2]=t[h+2],r[h+3]=t[h+3]}return new ImageData(r,e,n)},Ep=i=>hc(i,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Tp=i=>hc(i,[-1,-1,-1,-1,8,-1,-1,-1,-1]),kp=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[h],r[h+1]=t[h+1],r[h+2]=t[h+2],r[h+3]=255}return new ImageData(r,e,n)},Ap=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)r[h]=255,r[h+1]=255,r[h+2]=255,r[h+3]=255;else{const l=cc([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);r[h]=l[0],r[h+1]=l[1],r[h+2]=l[2],r[h+3]=l[3]}}return new ImageData(r,e,n)},Pp=(i,t,e,n,r,s=!1,a)=>{const{data:o,width:h,height:l}=i;let c=r,d=n,f=t,u=e;if(c<0?c=0:c>h&&(c=h),d<0?d=0:d>l&&(d=l),f<1?f=1:f>h&&(f=h),u<1?u=1:u>l&&(u=l),c+f>h&&(f=h-c),d+u>l&&(u=l-d),s){const g=new Uint8ClampedArray(o.length);for(let _=0;_<l;_++)for(let y=0;y<h;y++){const b=(_*h+y)*4;y>=c&&y<=c+f&&_>=d&&_<=d+u?(g[b]=o[b],g[b+1]=o[b+1],g[b+2]=o[b+2],g[b+3]=o[b+3]):(g[b]=255,g[b+1]=255,g[b+2]=255,g[b+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(g,h,l)}else{const g=new Uint8ClampedArray(f*u*4);for(let _=d;_<=d+u;_++)for(let y=c;y<=c+f;y++){const b=((_-d)*f+y-c)*4,m=(_*h+y)*4;g[b]=o[m],g[b+1]=o[m+1],g[b+2]=o[m+2],g[b+3]=o[m+3]}return new ImageData(g,f,u)}},Mp=(i,t,e,n)=>{const{data:r,width:s,height:a}=i;let o=t;o>Math.floor(s/2)&&(o=Math.floor(s/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const h=new Uint8ClampedArray(r.length);for(let c=0;c<a;c++)for(let d=0;d<s;d++){const f=(c*s+d)*4;let u=-1;d<o?c<o?u=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(o-c-1,2)):c>a-o-1&&(u=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(c-(a-o),2))):d>s-o-1&&(c<o?u=Math.sqrt(Math.pow(d-(s-o),2)+Math.pow(o-c-1,2)):c>a-o-1&&(u=Math.sqrt(Math.pow(d-(s-o),2)+Math.pow(c-(a-o),2)))),Math.round(u)>o?(h[f]=255,h[f+1]=255,h[f+2]=255,h[f+3]=n||e.toUpperCase()==="PNG"?0:255):(h[f]=r[f],h[f+1]=r[f+1],h[f+2]=r[f+2],h[f+3]=n||e.toUpperCase()==="PNG"?r[f+3]:255)}return new ImageData(h,s,a)},Rp=(i,t,e,n,r,s=1e4)=>{const a=new Image;a.src=i;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=s,o.height=s,h.drawImage(a,0,0,t,e,0,0,n,r),h.getImageData(0,0,n,r)},Dp=(i,t)=>{const{data:e,width:n,height:r}=i,s=new Uint8ClampedArray(e.length);for(let o=0;o<r;o++)for(let h=0;h<n;h++){const l=(o*n+h)*4;s[l]=Math.max(Math.min(e[l]+t,255),0),s[l+1]=Math.max(Math.min(e[l+1]+t,255),0),s[l+2]=Math.max(Math.min(e[l+2]+t,255),0),s[l+3]=e[l+3]}return new ImageData(s,n,r)},Lp=(i,t,e=!1)=>{const{data:n,width:r,height:s}=i,a=new Uint8ClampedArray(n.length);for(let h=0;h<s;h++)for(let l=0;l<r;l++){const c=(h*r+l)*4;n[c+3]===0?(a[c]=255,a[c+1]=255,a[c+2]=255):(a[c]=n[c],a[c+1]=n[c+1],a[c+2]=n[c+2]);let d=n[c+3];e?d=Math.max(Math.min(Math.floor(255*t),255),0):d=Math.max(Math.min(Math.floor(d+255*t),255),0),a[c+3]=d}return new ImageData(a,r,s)},Op=(i,t,e,n)=>{const{data:r,width:s,height:a}=i,{data:o,width:h,height:l}=t;let c=e,d=n;e+l>a&&(c=a-l),n+h>s&&(d=s-h);const f=new Uint8ClampedArray(r.length);for(let g=0;g<a;g++)for(let p=0;p<s;p++){const _=(g*s+p)*4;if(p<d||p>d+h||g<=c||g>=c+l)f[_]=r[_],f[_+1]=r[_+1],f[_+2]=r[_+2],f[_+3]=r[_+3];else{const y=(g*s+p-((c+1)*s+(g-(c+1))*(s-h))+h-d-1)*4,b=[o[y],o[y+1],o[y+2],o[y+3]],m=[r[_],r[_+1],r[_+2],r[_+3]],v=cc(b,m);f[_]=v[0],f[_+1]=v[1],f[_+2]=v[2],f[_+3]=v[3]}}return new ImageData(f,s,a)},Ip=(i,t,e,n,r,s=10)=>{const{data:a,width:o,height:h}=i;let l=r,c=n,d=t,f=e;l<0?l=0:l>o&&(l=o),c<0?c=0:c>h&&(c=h),d<1?d=1:d>o&&(d=o),f<1?f=1:f>h&&(f=h),l+d>o&&(d=o-l),c+f>h&&(f=h-c);const u=new Uint8ClampedArray(a.length);for(let p=0;p<h;p++)for(let _=0;_<o;_++){const y=(p*o+_)*4;if(_>=l&&_<=l+d&&p>=c&&p<=c+f){const b=Math.floor((_-l)/s),m=Math.floor((p-c)/s);let v=Math.floor(s*(b+1)-s/2+l),w=Math.floor(s*(m+1)-s/2+c);v>o-1&&(v=o-1),w>h-1&&(w=h-1);const S=(w*o+v)*4;u[y]=a[S],u[y+1]=a[S+1],u[y+2]=a[S+2],u[y+3]=a[S+3]}else u[y]=a[y],u[y+1]=a[y+1],u[y+2]=a[y+2],u[y+3]=a[y+3]}return new ImageData(u,o,h)},Fp=async(i,t,e,n,r,s)=>{const a=r/100;if(["JPG","JPEG"].includes(n.toUpperCase())){const o=new Image;o.src=i;const h=document.createElement("canvas"),l=h.getContext("2d");h.width=t,h.height=e,l.drawImage(o,0,0,t,e),h.toBlob(c=>{s(c)},`image/${n.toLowerCase()}`,a)}else{const o=Math.floor(a*256),h=L.encode([i.data.buffer],t,e,o),l=new Blob([h]);s&&s(l)}},Np=(i,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:n,width:r,height:s}=i,{data:a}=t,o=new Uint8ClampedArray(n.length),{backgroundColor:h,changeIntoColor:l}=e;for(let d=0;d<s;d++)for(let f=0;f<r;f++){const u=(d*r+f)*4,g=a[u],p=a[u+1],_=a[u+2],y=a[u+3];g===h.r&&p===h.g&&_===h.b&&y===h.a&&l.a!==0?(o[u]=l.r,o[u+1]=l.g,o[u+2]=l.b,o[u+3]=l.a):(o[u]=n[u],o[u+1]=n[u+1],o[u+2]=n[u+2],o[u+3]=n[u+3])}return new ImageData(o,r,s)}return i},hc=(i,t)=>{const{data:e,width:n,height:r}=i,s=new Uint8ClampedArray(e.length);for(let o=0;o<r;o++)for(let h=0;h<n;h++){const l=(o*n+h)*4;for(let c=0;c<3;c++){const d=l+c;h===0||h===n-1||o===0||o===r-1?s[d]=e[d]:s[d]=t[0]*e[d-n*4-4]+t[1]*e[d-n*4]+t[2]*e[d-n*4+4]+t[3]*e[d-4]+t[4]*e[d]+t[5]*e[d+4]+t[6]*e[d+n*4-4]+t[7]*e[d+n*4]+t[8]*e[d+n*4+4]}s[l+3]=e[l+3]}return new ImageData(s,n,r)},cc=(i,t)=>{if(i&&i.length===4&&t&&t.length===4){const e=i[3],n=t[3];if(e===255||n===0)return i;if(e===0)return t;{const r=e/255,s=n/255,a=Math.max(Math.min(Math.floor(i[0]*r+t[0]*s*(1-r)),255),0),o=Math.max(Math.min(Math.floor(i[1]*r+t[1]*s*(1-r)),255),0),h=Math.max(Math.min(Math.floor(i[2]*r+t[2]*s*(1-r)),255),0),l=Math.max(Math.min(Math.floor((r+s*(1-r))*255),255),0);return[a,o,h,l]}}return[255,255,255,255]},uc=function(i,t,e){const n=new Array(i*i),r=function(o){const h=o;let l=0,c=0;return{write(d,f){if(d>>>f)throw new Error("length over");for(;l+f>=8;)h.writeByte(255&(d<<l|c)),f-=8-l,d>>>=8-l,c=0,l=0;c=d<<l|c,l=l+f},flush(){l>0&&h.writeByte(c)}}},s=function(o){const h=1<<o,l=(1<<o)+1;let c=o+1;const d=a();for(let _=0;_<h;_++)d.add(String.fromCharCode(_));d.add(String.fromCharCode(h)),d.add(String.fromCharCode(l));const f=So(),u=r(f);u.write(h,c);let g=0,p=String.fromCharCode(n[g]);for(g+=1;g<n.length;){const _=String.fromCharCode(n[g]);g+=1,d.contains(p+_)?p=p+_:(u.write(d.indexOf(p),c),d.size()<4095&&(d.size()==1<<c&&(c+=1),d.add(p+_)),p=_)}return u.write(d.indexOf(p),c),u.write(l,c),u.flush(),f.toByteArray()},a=function(){const o={};let h=0;return{add(l){if(this.contains(l))throw new Error("dup key:"+l);o[l]=h,h+=1},size(){return h},indexOf(l){return o[l]},contains(l){return typeof o[l]<"u"}}};return{setPixel(o,h,l){n[h*i+o]=l},write(o){o.writeString("GIF87a"),o.writeShort(i),o.writeShort(i),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(ui("0x"+t[1]+t[2])),o.writeByte(ui("0x"+t[3]+t[4])),o.writeByte(ui("0x"+t[5]+t[6])),o.writeByte(ui("0x"+e[1]+e[2])),o.writeByte(ui("0x"+e[3]+e[4])),o.writeByte(ui("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(i),o.writeShort(i),o.writeByte(0);const h=2,l=s(h);o.writeByte(h);let c=0;for(;l.length-c>255;)o.writeByte(255),o.writeBytes(l,c,255),c+=255;o.writeByte(l.length-c),o.writeBytes(l,c,l.length-c),o.writeByte(0),o.writeString(";")}}},dc=function(i,t,e,n){const r=uc(i,t,e);for(let l=0;l<i;l++)for(let c=0;c<i;c++)r.setPixel(c,l,n(c,l));const s=So();r.write(s);const a=nd(),o=s.toByteArray();for(let l=0,c=o.length;l<c;l++)a.writeByte(o[l]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},It={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},vn={M:0,L:1,H:2,Q:3},Me={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Tt={glog:function(i){if(i<1)throw new Error("glog("+i+")");return Tt.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return Tt.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let i=0;i<8;i++)Tt.EXP_TABLE[i]=1<<i;for(let i=8;i<256;i++)Tt.EXP_TABLE[i]=Tt.EXP_TABLE[i-4]^Tt.EXP_TABLE[i-5]^Tt.EXP_TABLE[i-6]^Tt.EXP_TABLE[i-8];for(let i=0;i<255;i++)Tt.LOG_TABLE[Tt.EXP_TABLE[i]]=i;const ut={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(i){let t=i<<10;for(;ut.getBCHDigit(t)-ut.getBCHDigit(ut.G15)>=0;)t^=ut.G15<<ut.getBCHDigit(t)-ut.getBCHDigit(ut.G15);return(i<<10|t)^ut.G15_MASK},getBCHTypeNumber:function(i){let t=i<<12;for(;ut.getBCHDigit(t)-ut.getBCHDigit(ut.G18)>=0;)t^=ut.G18<<ut.getBCHDigit(t)-ut.getBCHDigit(ut.G18);return i<<12|t},getBCHDigit:function(i){let t=0;for(;i!=0;)t++,i>>>=1;return t},getPatternPosition:function(i){return ut.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,t,e){switch(i){case Me.PATTERN000:return(t+e)%2==0;case Me.PATTERN001:return t%2==0;case Me.PATTERN010:return e%3==0;case Me.PATTERN011:return(t+e)%3==0;case Me.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case Me.PATTERN101:return t*e%2+t*e%3==0;case Me.PATTERN110:return(t*e%2+t*e%3)%2==0;case Me.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){let t=new xi([1],0);for(let e=0;e<i;e++)t=t.multiply(new xi([1,Tt.gexp(e)],0));return t},getLengthInBits:function(i,t){if(1<=t&&t<10)switch(i){case It.MODE_NUMBER:return 10;case It.MODE_ALPHA_NUM:return 9;case It.MODE_8BIT_BYTE:return 8;case It.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(t<27)switch(i){case It.MODE_NUMBER:return 12;case It.MODE_ALPHA_NUM:return 11;case It.MODE_8BIT_BYTE:return 16;case It.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(t<41)switch(i){case It.MODE_NUMBER:return 14;case It.MODE_ALPHA_NUM:return 13;case It.MODE_8BIT_BYTE:return 16;case It.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+t)},getLostPoint:function(i){const t=i.getModuleCount();let e=0;for(let s=0;s<t;s++)for(let a=0;a<t;a++){let o=0;const h=i.isDark(s,a);for(let l=-1;l<=1;l++)if(!(s+l<0||t<=s+l))for(let c=-1;c<=1;c++)a+c<0||t<=a+c||l==0&&c==0||h==i.isDark(s+l,a+c)&&o++;o>5&&(e+=3+o-5)}for(let s=0;s<t-1;s++)for(let a=0;a<t-1;a++){let o=0;i.isDark(s,a)&&o++,i.isDark(s+1,a)&&o++,i.isDark(s,a+1)&&o++,i.isDark(s+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let s=0;s<t;s++)for(let a=0;a<t-6;a++)i.isDark(s,a)&&!i.isDark(s,a+1)&&i.isDark(s,a+2)&&i.isDark(s,a+3)&&i.isDark(s,a+4)&&!i.isDark(s,a+5)&&i.isDark(s,a+6)&&(e+=40);for(let s=0;s<t;s++)for(let a=0;a<t-6;a++)i.isDark(a,s)&&!i.isDark(a+1,s)&&i.isDark(a+2,s)&&i.isDark(a+3,s)&&i.isDark(a+4,s)&&!i.isDark(a+5,s)&&i.isDark(a+6,s)&&(e+=40);let n=0;for(let s=0;s<t;s++)for(let a=0;a<t;a++)i.isDark(a,s)&&n++;const r=Math.abs(100*n/t/t-50)/5;return e+=r*10,e}};class xi{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let n=0;for(;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(let r=0;r<t.length-n;r++)this.num[r]=t[r+n]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let n=0;n<this.getLength();n++)for(let r=0;r<t.getLength();r++)e[n+r]^=Tt.gexp(Tt.glog(this.get(n))+Tt.glog(t.get(r)));return new xi(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=Tt.glog(this.get(0))-Tt.glog(t.get(0)),n=new Array(this.getLength());for(let r=0;r<this.getLength();r++)n[r]=this.get(r);for(let r=0;r<t.getLength();r++)n[r]^=Tt.gexp(Tt.glog(t.get(r))+e);return new xi(n,0).mod(t)}}class he{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=he.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const r=n.length/3,s=[];for(let a=0;a<r;a++){const o=n[a*3+0],h=n[a*3+1],l=n[a*3+2];for(let c=0;c<o;c++)s.push(new he(h,l))}return s}static getRsBlockTable(t,e){switch(e){case vn.L:return he.RS_BLOCK_TABLE[(t-1)*4+0];case vn.M:return he.RS_BLOCK_TABLE[(t-1)*4+1];case vn.Q:return he.RS_BLOCK_TABLE[(t-1)*4+2];case vn.H:return he.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class fc{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 Up{mode;data;constructor(t){this.mode=It.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 Re{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=vn[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Up(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=he.getRSBlocks(t,this.errorCorrectLevel),n=new fc;let r=0;for(let s=0;s<e.length;s++)r+=e[s].dataCount;for(let s=0;s<this.dataList.length;s++){const a=this.dataList[s];n.put(a.mode,4),n.put(a.getLength(),ut.getLengthInBits(a.mode,t)),a.write(n)}if(n.getLengthInBits()<=r*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(let r=0;r<this.moduleCount;r++)this.modules[n][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Re.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(let r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[t+n][e+r]=!0:this.modules[t+n][e+r]=!1)}getBestMaskPattern(){let t=0,e=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const r=ut.getLostPoint(this);(n==0||t>r)&&(t=r,e=n)}return e}createMovieClip(t,e,n){const r=t.createEmptyMovieClip(e,n),s=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*s;for(let h=0;h<this.modules[a].length;h++){const l=h*s;this.modules[a][h]&&(r.beginFill(0,100),r.moveTo(l,o),r.lineTo(l+s,o),r.lineTo(l+s,o+s),r.lineTo(l,o+s),r.endFill())}}return r}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=ut.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let n=0;n<t.length;n++){const r=t[e],s=t[n];if(this.modules[r][s]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[r+a][s+o]=!0:this.modules[r+a][s+o]=!1}}setupTypeNumber(t){const e=ut.getBCHTypeNumber(this.typeNumber);for(let n=0;n<18;n++){const r=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(let n=0;n<18;n++){const r=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}}setupTypeInfo(t,e){const n=this.errorCorrectLevel<<3|e,r=ut.getBCHTypeInfo(n);for(let s=0;s<15;s++){const a=!t&&(r>>s&1)==1;s<6?this.modules[s][8]=a:s<8?this.modules[s+1][8]=a:this.modules[this.moduleCount-15+s][8]=a}for(let s=0;s<15;s++){const a=!t&&(r>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=a:s<9?this.modules[8][15-s-1+1]=a:this.modules[8][15-s-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let n=-1,r=this.moduleCount-1,s=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let h=0;h<2;h++)if(this.modules[r][o-h]==null){let l=!1;a<t.length&&(l=(t[a]>>>s&1)==1),ut.getMask(e,r,o-h)&&(l=!l),this.modules[r][o-h]=l,s--,s==-1&&(a++,s=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}}static createData(t,e,n){const r=he.getRSBlocks(t,e),s=new fc;for(let o=0;o<n.length;o++){const h=n[o];s.put(h.mode,4),s.put(h.getLength(),ut.getLengthInBits(h.mode,t)),h.write(s)}let a=0;for(let o=0;o<r.length;o++)a+=r[o].dataCount;if(s.getLengthInBits()>a*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(Re.PAD0,8),s.getLengthInBits()>=a*8));)s.put(Re.PAD1,8);return Re.createBytes(s,r)}static createBytes(t,e){let n=0,r=0,s=0;const a=new Array(e.length),o=new Array(e.length);for(let d=0;d<e.length;d++){const f=e[d].dataCount,u=e[d].totalCount-f;r=Math.max(r,f),s=Math.max(s,u),a[d]=new Array(f);for(let y=0;y<a[d].length;y++)a[d][y]=255&t.buffer[y+n];n+=f;const g=ut.getErrorCorrectPolynomial(u),_=new xi(a[d],g.getLength()-1).mod(g);o[d]=new Array(g.getLength()-1);for(let y=0;y<o[d].length;y++){const b=y+_.getLength()-o[d].length;o[d][y]=b>=0?_.get(b):0}}let h=0;for(let d=0;d<e.length;d++)h+=e[d].totalCount;const l=new Array(h);let c=0;for(let d=0;d<r;d++)for(let f=0;f<e.length;f++)d<a[f].length&&(l[c++]=a[f][d]);for(let d=0;d<s;d++)for(let f=0;f<e.length;f++)d<o[f].length&&(l[c++]=o[f][d]);return l}}const gc=Math.ceil,yn=Math.floor,pc=Math.round;function Gp(i,t){const e=bo(i),n=t?.ecc||"H",r=t?.size||256,s=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",l=new Re(s,n);l.addData(e),l.make();const c=l.getModuleCount(),d=(r-a*2)/c,f=a,u=r-a;return dc(r,o,h,function(g,p){if(f<=g&&g<u&&f<=p&&p<u){const _=yn((g-f)/d),y=yn((p-f)/d);return l.isDark(y,_)?0:1}else return 1})}function Bp(i,t){const e=t.x||0,n=t.y||0,r=bo(i),s=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?yn(t.size):256,h=t.padding||0,l=-1,c=t.color||"#000000",d=t.background||"#ffffff",f=new Re(l,a);f.addData(r),f.make();const u=f.getModuleCount(),g=(o-h*2)/u;s.fillStyle=d,s.fillRect(e,n,o,o);for(let p=0;p<u;p++)for(let _=0;_<u;_++){const y=gc((_+1)*g)-yn(_*g),b=gc((p+1)*g)-yn(p*g);s.fillStyle=f.isDark(p,_)?c:d,s.fillRect(e+pc(_*g)+h,n+pc(p*g)+h,y,b)}}function mc(){var i=null;if(window.ActiveXObject)for(var t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"],e=0;e<t.length;e++)try{i=new window.ActiveXObject(t[e]);break}catch{continue}else i=new XMLHttpRequest;return i}function zp(i){if(i.action){if(i.method.toLowerCase()==="post")return{url:i.action,data:new FormData(i)};for(var t="",e=0;e<i.elements.length;e++){var n=i.elements[e];if(n.hasAttribute("name")){var r=n.nodeName.toUpperCase()==="INPUT"?n.getAttribute("type").toUpperCase():"TEXT";if(r==="FILE")for(var s=0;s<n.files.length;t+="&"+escape(n.name)+"="+escape(n.files[s++].name));else(r!=="RADIO"&&r!=="CHECKBOX"||n.checked)&&(t+="&"+escape(n.name)+"="+escape(n.value))}}return{url:i.action.replace(/(?:\?.*)?$/,t.replace(/^&/,"?")),data:null}}}function Hp({method:i,url:t,dataType:e,data:n,timeout:r}){return new Promise((s,a)=>{var o=mc();i=(i||"GET").toUpperCase(),e=e||"json";const h=n||"";o.onreadystatechange=function(l){o.readyState===4&&(o.status===200?s(o.response):a(o.statusText))},o.timeout=r,o.ontimeout=function(){a("The request for "+t+" is timed out for "+r+".")},o.upload.addEventListener("progress",function(l){if(l.lengthComputable){const c=Math.round(l.loaded*100/l.total);console.log(c+"%")}},!1),o.upload.addEventListener("load",function(l){},!1),i==="GET"?(o.open("GET",t+"?"+h,!0),o.send(null)):i==="POST"?(o.open("POST",t,!0),o.send(h)):(o.open(i,t,!0),o.send(null))})}function jp(i,t,e){return fetch(i,Object.assign({method:"POST",headers:{},body:{},mode:"",credentials:"",cache:"",redirect:"follow",referrerPolicy:"no-referrer"},t)).then(n=>n.json())}function Vp(i,t){var e=new XMLHttpRequest;e.open("HEAD",i),e.filepath=i,e.callback=t,e.onload=function(){var n=parseFloat(window.localStorage.getItem("lm_"+this.filepath)),r=Date.parse(this.getResponseHeader("Last-Modified"));(isNaN(n)||r>n)&&(window.localStorage.setItem("lm_"+this.filepath,Date.now()),isFinite(n)&&this.callback(r,n))},e.send()}let ur;const _c=new WeakMap;function Da(i,t){let e=_c.get(i);e||(e=new Map,_c.set(i,e));let n=e.get(t);return n||(n=new vc,e.set(t,n)),n}class vc{subscribers;constructor(){this.subscribers=new Set}depend(){ur&&this.subscribers.add(ur)}notify(){this.subscribers.forEach(t=>t())}}function $p(i){ur=i,i(),ur=null}function Xp(i){return Object.keys(i).forEach(t=>{let e=i[t];const n=Da(i,t);Object.defineProperty(i,t,{get(){return n.depend(),e},set(r){r!=e&&(e=r,n.notify())}})}),i}function Yp(i){return new Proxy(i,{get(t,e,n){return Da(i,e).depend(),Reflect.get(t,e,n)},set(t,e,n,r){const s=Da(i,e);return i[e]!=n&&(i[e]=n,s.notify()),Reflect.set(t,e,n,r)}})}const Wp=()=>Math.random()*16777215,qp=()=>`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`,Kp=()=>`#${(~~(Math.random()*(1<<24))).toString(16)}`,yc=function(i){let t="00000"+(i|0).toString(16);return t="#"+t.substring(t.length-6),t},bc=function(i,t=1){const e=i>>16&255,n=i>>8&255,r=i&255,s=t<0?0:t>1?1:t;return s===1?"rgb("+e+","+n+","+r+")":"rgba("+e+","+n+","+r+","+s+")"},dr=function(i){return i[0]==="#"&&(i=i.slice(1)),window.parseInt(i,16)},La=function(i,t=1){const e=dr(i);return bc(e,t)},Zp=i=>{const e=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(i);return e?"#"+((1<<24)+(parseInt(e[1])<<16)+(parseInt(e[2])<<8)+parseInt(e[3])).toString(16).slice(1):""};function Jp(i,t,e,n){let r,s,a;i=i/360,t=t/100,e=e/100;const o=Math.floor(i*6),h=i*6-o,l=e*(1-t),c=e*(1-h*t),d=e*(1-(1-h)*t);switch(o%6){case 0:r=e,s=d,a=l;break;case 1:r=c,s=e,a=l;break;case 2:r=l,s=e,a=d;break;case 3:r=l,s=c,a=e;break;case 4:r=d,s=l,a=e;break;case 5:default:r=e,s=l,a=c;break}return{r:Math.round(r*255),g:Math.round(s*255),b:Math.round(a*255),a:n??1}}function Qp(i,t,e,n){const r=Math.max(i,t,e),s=Math.min(i,t,e),a=r-s,o=r===0?0:a/r,h=r/255;let l;switch(r){case s:l=0;break;case i:l=t-e+a*(t<e?6:0),l/=6*a;break;case t:l=e-i+a*2,l/=6*a;break;case e:default:l=i-t+a*4,l/=6*a;break}return{h:Math.round(l*360),s:Math.round(o*100),v:Math.round(h*100),a:n??1}}const tm=i=>i*Math.PI/180,em=i=>i*180/Math.PI;function De(i,t,e,n,r=!1){return{x:r?i*n+t*e:i*n-t*e,y:r?t*n-i*e:t*n+i*e}}class ce{m;constructor(t=[1,0,0,1,0,0]){this.m=[t[0],t[1],t[2],t[3],t[4],t[5]]}unit(){return this.m=[1,0,0,1,0,0],this}multiply(t){const e=this.m;let n;t instanceof ce?n=t.m:n=t;const r=e[0]*n[0]+e[2]*n[1],s=e[1]*n[0]+e[3]*n[1],a=e[0]*n[2]+e[2]*n[3],o=e[1]*n[2]+e[3]*n[3],h=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return e[0]=r,e[1]=s,e[2]=a,e[3]=o,e[4]=h,e[5]=l,this}inverse(){const t=new ce(this.m),e=t.m,n=1/(e[0]*e[3]-e[1]*e[2]),r=e[3]*n,s=-e[1]*n,a=-e[2]*n,o=e[0]*n,h=n*(e[2]*e[5]-e[3]*e[4]),l=n*(e[1]*e[4]-e[0]*e[5]);return e[0]=r,e[1]=s,e[2]=a,e[3]=o,e[4]=h,e[5]=l,t}translate(t,e){return this.multiply([1,0,0,1,t,e])}rotate(t){const e=t*Math.PI/180,n=Math.cos(e),r=Math.sin(e);return this.multiply([n,r,-r,n,0,0])}skew(t,e=0){const n=t*Math.PI/180,r=e*Math.PI/180,s=Math.tan(n),a=Math.tan(r);return this.multiply([1,a,s,1,0,0])}scale(t,e){return this.multiply([t,0,0,e,0,0])}transformPoint(t,e){const n=t,r=e;return t=n*this.m[0]+r*this.m[2]+this.m[4],e=n*this.m[1]+r*this.m[3]+this.m[5],[t,e]}transformVector(t,e){const n=t,r=e;return t=n*this.m[0]+r*this.m[2],e=n*this.m[1]+r*this.m[3],[t,e]}}class fr{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[n,r,s]=t,[a,o,h]=e;this.x=n-a,this.y=r-o,this.z=s-h}get length(){const{x:t,y:e,z:n}=this;return Math.sqrt(t*t+e*e+n*n)}unit(){const t=this.length;return new fr([this.x/t,this.y/t,this.z/t])}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const e=this.x,n=this.y,r=this.z,s=t.x,a=t.y,o=t.z;return new fr([n*o-r*a,r*s-e*o,e*a-s*n])}}class gr{x;y;vx=0;vy=0;ax=0;ay=0;mass=0;constructor(t,e,n){this.x=t,this.y=e,n?.vx!==void 0&&(this.vx=n?.vx),n?.vy!==void 0&&(this.vy=n?.vy),n?.ax!==void 0&&(this.ax=n?.ax),n?.ay!==void 0&&(this.ay=n?.ay),n?.mass!==void 0&&(this.mass=n?.mass)}distanceTo(t){const e=t.x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)}angleTo(t){const e=t.x-this.x,n=t.y-this.y;return Math.atan2(n,e)}trackVelocity(t,e){return{vx:e.x-t.x,vy:e.y-t.y}}nextFrame(t){const e=t?.gravity??0,n=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,n>0){const r=Math.atan2(this.vy,this.vx);let s=Math.sqrt(this.vx*this.vx+this.vy*this.vy);s>n?s-=n:s=0,this.vx=Math.cos(r)*s,this.vy=Math.sin(r)*s}this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo=(t,e)=>{const n=e?.gravity??0,r=e?.friction??1,s=e?.easing??.05,a=t.x-this.x,o=t.y-this.y;this.vx=a*s,this.vy=o*s,this.vy+=n,this.vx*=r,this.vy*=r,this.x+=this.vx,this.y+=this.vy};nextFrameSpringTo(t,e){const n=e?.gravity??0,r=e?.friction??.95,s=e?.spring??.03;(Array.isArray(t)?t:[t]).forEach(o=>{const h=o.x-this.x,l=o.y-this.y,c=h*s,d=l*s;this.vx+=c,this.vy+=d}),this.vy+=n,this.vx*=r,this.vy*=r,this.x+=this.vx,this.y+=this.vy}nextFrameSpringConnect(t,e){const n=e?.gravity??0,r=e?.friction??.95,s=e?.spring??.03,a=e?.springLength??100,o=this.angleTo(t);this.nextFrameSpringTo(new gr(t.x-Math.cos(o)*a,t.y-Math.sin(o)*a),{spring:s,friction:r,gravity:n})}}class pt extends gr{isMouseDown=!1;radius=0;constructor(t,e,n){super(t,e,n),n?.isMouseDown!==void 0&&(this.isMouseDown=n?.isMouseDown),n?.radius!==void 0&&(this.radius=n?.radius)}setX(t){this.x=t}setY(t){this.y=t}setXY(t,e){this.x=t,this.y=e}eq(t){return this.x===t.x&&this.y===t.y}midPointBtw(t){return new pt(this.x+(t.x-this.x)/2,this.y+(t.y-this.y)/2)}fromRadian(t,e){return new pt(Math.cos(t)*e,Math.sin(t)*e)}toArray(){return[this.x,this.y]}clone(t){this.setXY(t.x,t.y)}checkCollisionTo(t){const e=t.x-this.x,n=t.y-this.y;if(Math.sqrt(e*e+n*n)<this.radius+t.radius){const s=Math.atan2(n,e),a=Math.sin(s),o=Math.cos(s),h={x:0,y:0},l=De(e,n,a,o,!0),c=De(this.vx,this.vy,a,o,!0),d=De(t.vx,t.vy,a,o,!0),f=c.x-d.x;c.x=((this.mass-t.mass)*c.x+2*t.mass*d.x)/(this.mass+t.mass),d.x=f+c.x;const u=Math.abs(c.x)+Math.abs(d.x),g=this.radius+t.radius-Math.abs(h.x-l.x);h.x+=c.x/u*g,l.x+=d.x/u*g;const p=De(h.x,h.y,a,o,!1),_=De(l.x,l.y,a,o,!1);t.x=this.x+_.x,t.y=this.y+_.y,this.x=this.x+p.x,this.y=this.y+p.y;const y=De(c.x,c.y,a,o,!1),b=De(d.x,d.y,a,o,!1);this.vx=y.x,this.vy=y.y,t.vx=b.x,t.vy=b.y}}nextFrameWall(t){const e=t.left,n=t.top,r=t.right,s=t.bottom,a=t?.bounce??-1;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=a):this.x-this.radius<e&&(this.x=e+this.radius,this.vx*=a),this.y+this.radius>s?(this.y=s-this.radius,this.vy*=a):this.y-this.radius<n&&(this.y=n+this.radius,this.vy*=a)}}let Oa=class extends gr{width;height;constructor(t,e,n,r=n,s){super(t,e,s),this.width=n,this.height=r}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t){return!(t.x<this.x||t.x>this.x+this.width||t.y<this.y||t.y>this.y+this.height)}toArray(){return[this.x,this.y,this.width,this.height]}clone(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height}};class im{points=[];constructor(t){this.points=t}get length(){return this.points.length}getPoint(t){return this.points[t]}isContainPoint(t){const e=t.x,n=t.y,r=this.length;let s=!1;const a=2e-10;for(let o=0,h=r-1;o<r;h=o,o++){const l=this.points[o].x,c=this.points[o].y,d=this.points[h].x,f=this.points[h].y;if(l===e&&c===n||d===e&&f===n||n===c&&n===f)return!0;if(n>=c&&n<f||n<c&&n>=f){const u=(d-l)/(f-c),g=l+u*(n-c);if(g===e||Math.abs(g-e)<a)return!0;g>e&&(s=!s)}}return s}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}}const Ei={Linear:{None:function(i){return i}},Quadratic:{In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}},Cubic:{In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}},Quartic:{In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}},Quintic:{In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}},Sinusoidal:{In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}},Exponential:{In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}},Circular:{In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}},Elastic:{In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}},Back:{In:function(i){return i===1?1:i*i*((1.70158+1)*i-1.70158)},Out:function(i){return i===0?0:--i*i*((1.70158+1)*i+1.70158)+1},InOut:function(i){const t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}},Bounce:{In:function(i){return 1-Ei.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?Ei.Bounce.In(i*2)*.5:Ei.Bounce.Out(i*2-1)*.5+.5}},generatePow:function(i=4){return i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return t**i},Out:function(t){return 1-(1-t)**i},InOut:function(t){return t<.5?(t*2)**i/2:(1-(2-t*2)**i)/2+.5}}},random:function(i){return Math.random()},createStep:function(i){return function(t){return Math.floor(t*i)/i}},createNoisyEasing:function(i,t=.1){const e=1-t;return function(n){return t*Math.random()+e*i(n)}}};let bn;typeof self>"u"&&typeof process<"u"&&process.hrtime?bn=function(){const i=process.hrtime();return i[0]*1e3+i[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?bn=self.performance.now.bind(self.performance):Date.now!==void 0?bn=Date.now:bn=function(){return new Date().getTime()};const Ti=bn;let wc=class{_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=Ti(),e=!1){let n=Object.keys(this._tweens);if(n.length===0)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(let r=0;r<n.length;r++){const s=this._tweens[n[r]],a=!e;s&&s.update(t,a)===!1&&!e&&delete this._tweens[n[r]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}};const Qe={Linear:function(i,t){const e=i.length-1,n=e*t,r=Math.floor(n),s=Qe.Utils.Linear;return t<0?s(i[0],i[1],n):t>1?s(i[e],i[e-1],e-n):s(i[r],i[r+1>e?e:r+1],n-r)},Bezier:function(i,t){let e=0;const n=i.length-1,r=Math.pow,s=Qe.Utils.Bernstein;for(let a=0;a<=n;a++)e+=r(1-t,n-a)*r(t,a)*i[a]*s(n,a);return e},CatmullRom:function(i,t){const e=i.length-1;let n=e*t,r=Math.floor(n);const s=Qe.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(r=Math.floor(n=e*(1+t))),s(i[(r-1+e)%e],i[r],i[(r+1)%e],i[(r+2)%e],n-r)):t<0?i[0]-(s(i[0],i[0],i[1],i[1],-n)-i[0]):t>1?i[e]-(s(i[e],i[e],i[e-1],i[e-1],n-e)-i[e]):s(i[r?r-1:0],i[r],i[e<r+1?e:r+1],i[e<r+2?e:r+2],n-r)},Utils:{Linear:function(i,t,e){return(t-i)*e+i},Factorial:function(){const i=[1];return function(t){let e=1;if(i[t])return i[t];for(let n=t;n>1;n--)e*=n;return i[t]=e,e}}(),Bernstein:function(i,t){const e=Qe.Utils.Factorial;return e(i)/e(t)/e(i-t)},CatmullRom:function(i,t,e,n,r){const s=(e-i)*.5,a=(n-t)*.5,o=r*r,h=r*o;return(2*t-2*e+s+a)*h+(-3*t+3*e-2*s-a)*o+s*r+t}}};class wn{static _nextId=0;static nextId(){return wn._nextId++}}const zt=new wc;let nm=class{constructor(t,e=zt){this._object=t,this._group=e}_id=wn.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=Ei.Linear.None;_interpolationFunction=Qe.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=Ti()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,n,r){for(const s in n){const a=t[s],o=Array.isArray(a),h=o?"array":typeof a,l=!o&&Array.isArray(n[s]);if(!(h==="undefined"||h==="function")){if(l){let c=n[s];if(c.length===0)continue;c=c.map(this._handleRelativeValue.bind(this,a)),n[s]=[a].concat(c)}if((h==="object"||o)&&a&&!l){e[s]=o?[]:{};for(const c in a)e[s][c]=a[c];r[s]=o?[]:{},this._setupProperties(a,e[s],n[s],r[s])}else typeof e[s]>"u"&&(e[s]=a),o||(e[s]*=1),l?r[s]=n[s].slice().reverse():r[s]=e[s]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=Ti()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=Ti()){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=zt){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=Ei.Linear.None){return this._easingFunction=t,this}interpolation(t=Qe.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=Ti(),e=!0){if(this._isPaused)return!0;let n,r;const s=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>s)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),r=(t-this._startTime)/this._durationTime,r=this._durationTime===0||r>1?1:r;const a=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,n,r){for(const s in n){if(e[s]===void 0)continue;const a=e[s]||0;let o=n[s];const h=Array.isArray(t[s]),l=Array.isArray(o);!h&&l?t[s]=this._interpolationFunction(o,r):typeof o=="object"&&o?this._updateProperties(t[s],a,o,r):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[s]=a+(o-a)*r))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=n,this._valuesEnd[t]=e}};const rm=wn.nextId,sm=zt.getAll.bind(zt),am=zt.removeAll.bind(zt),om=zt.add.bind(zt),lm=zt.remove.bind(zt),hm=zt.update.bind(zt),cm={Easing:Ei,Group:wc,Interpolation:Qe,now:Ti,Sequence:wn,nextId:rm,Tween:nm,getAll:sm,removeAll:am,add:om,remove:lm,update:hm};function Sc(i){const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",i),t}function um(i,t){const e=Sc(i),{x:n,y:r}=e.getPointAtLength(t);return[n,r]}function dm(i,t){return Sc(i).getTotalLength(t)}let Ht=null;function fm({d:i},t,e){Ht||(Ht=document.createElement("canvas").getContext("2d"));const n=new Path2D(i);return Ht.isPointInPath(n,t,e)}function Cc({d:i},t,e,{lineWidth:n=1,lineCap:r="butt",lineJoin:s="miter"}){if(Ht||(Ht=document.createElement("canvas").getContext("2d")),Ht.isPointInStroke){Ht.save(),Ht.lineWidth=n,Ht.lineCap=r,Ht.lineJoin=s;const a=new Path2D(i),o=Ht.isPointInStroke(a,t,e);return Ht.restore(),o}}var Ia={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},gm=/([astvzqmhlc])([^astvzqmhlc]*)/gi;function pm(i){var t=[];return i.replace(gm,function(e,n,r){var s=n.toLowerCase();for(r=_m(r),s=="m"&&r.length>2&&(t.push([n].concat(r.splice(0,2))),s="l",n=n=="m"?"l":"L");;){if(r.length==Ia[s])return r.unshift(n),t.push(r);if(r.length<Ia[s])throw new Error("malformed path data");t.push([n].concat(r.splice(0,Ia[s])))}}),t}var mm=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function _m(i){var t=i.match(mm);return t?t.map(Number):[]}function vm(i){var t=0,e=0,n=0,r=0;return i.map(function(s){s=s.slice();var a=s[0],o=a.toUpperCase();if(a!=o)switch(s[0]=o,a){case"a":s[6]+=n,s[7]+=r;break;case"v":s[1]+=r;break;case"h":s[1]+=n;break;default:for(var h=1;h<s.length;)s[h++]+=n,s[h++]+=r}switch(o){case"Z":n=t,r=e;break;case"H":n=s[1];break;case"V":r=s[1];break;case"M":n=t=s[1],r=e=s[2];break;default:n=s[s.length-2],r=s[s.length-1]}return s})}const Sn=Math.PI*2;function xc(i,t,e,n){const r=i*n-t*e<0?-1:1;let s=i*e+t*n;return s>1&&(s=1),s<-1&&(s=-1),r*Math.acos(s)}function ym(i,t,e,n,r,s,a,o,h,l){const c=l*(i-e)/2+h*(t-n)/2,d=-h*(i-e)/2+l*(t-n)/2,f=a*a,u=o*o,g=c*c,p=d*d;let _=f*u-f*p-u*g;_<0&&(_=0),_/=f*p+u*g,_=Math.sqrt(_)*(r===s?-1:1);const y=_*a/o*d,b=_*-o/a*c,m=l*y-h*b+(i+e)/2,v=h*y+l*b+(t+n)/2,w=(c-y)/a,S=(d-b)/o,T=(-c-y)/a,C=(-d-b)/o,k=xc(1,0,w,S);let x=xc(w,S,T,C);return s===0&&x>0&&(x-=Sn),s===1&&x<0&&(x+=Sn),[m,v,k,x]}function bm(i,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(i),r=Math.sin(i),s=Math.cos(i+t),a=Math.sin(i+t);return[n,r,n-r*e,r+n*e,s+a*e,a-s*e,s,a]}function wm(i,t,e,n,r,s,a,o,h){const l=Math.sin(h*Sn/360),c=Math.cos(h*Sn/360),d=c*(i-e)/2+l*(t-n)/2,f=-l*(i-e)/2+c*(t-n)/2;if(d===0&&f===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const u=d*d/(a*a)+f*f/(o*o);u>1&&(a*=Math.sqrt(u),o*=Math.sqrt(u));const g=ym(i,t,e,n,r,s,a,o,l,c),p=[];let _=g[2],y=g[3];const b=Math.max(Math.ceil(Math.abs(y)/(Sn/4)),1);y/=b;for(let m=0;m<b;m++)p.push(bm(_,y)),_+=y;return p.map(m=>{for(let v=0;v<m.length;v+=2){let w=m[v+0],S=m[v+1];w*=a,S*=o;const T=c*w-l*S,C=l*w+c*S;m[v+0]=T+g[0],m[v+1]=C+g[1]}return m})}function Sm(i){for(var t,e=[],n=0,r=0,s=0,a=0,o=null,h=null,l=0,c=0,d=0,f=i.length;d<f;d++){var u=i[d],g=u[0];switch(g){case"M":s=u[1],a=u[2];break;case"A":var p=wm(l,c,u[6],u[7],u[4],u[5],u[1],u[2],u[3]);if(!p.length)continue;p=p.map(v=>{const[w,S,T,C,k,x,E,M]=v;return{x1:T,y1:C,x2:k,y2:x,x:E,y:M}});for(var _=0,y;_<p.length;_++)y=p[_],u=["C",y.x1,y.y1,y.x2,y.y2,y.x,y.y],_<p.length-1&&e.push(u);break;case"S":var b=l,m=c;(t=="C"||t=="S")&&(b+=b-n,m+=m-r),u=["C",b,m,u[1],u[2],u[3],u[4]];break;case"T":t=="Q"||t=="T"?(o=l*2-o,h=c*2-h):(o=l,h=c),u=Ec(l,c,o,h,u[1],u[2]);break;case"Q":o=u[1],h=u[2],u=Ec(l,c,u[1],u[2],u[3],u[4]);break;case"L":u=pr(l,c,u[1],u[2]);break;case"H":u=pr(l,c,u[1],c);break;case"V":u=pr(l,c,l,u[1]);break;case"Z":u=pr(l,c,s,a);break}t=g,l=u[u.length-2],c=u[u.length-1],u.length>4?(n=u[u.length-4],r=u[u.length-3]):(n=l,r=c),e.push(u)}return e}function pr(i,t,e,n){return["C",i,t,e,n,e,n]}function Ec(i,t,e,n,r,s){return["C",i/3+.6666666666666666*e,t/3+.6666666666666666*n,r/3+.6666666666666666*e,s/3+.6666666666666666*n,r,s]}function Cm(i){return typeof i!="string"?!1:(i=i.trim(),/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(i)&&/[\dz]$/i.test(i)&&i.length>4)}const mr=Symbol("initialPath"),ue=Symbol("path"),Le=Symbol("bounds"),_r=Symbol("savedPaths"),de=Symbol("renderProps"),Fa=Symbol("beginPath");class xm{constructor(t){if(!Cm(t))throw new Error("Not an SVG path!");this[mr]=vm(pm(t)),this[ue]=Sm(this[mr]),this[Le]=null,this[_r]=[],this[de]={},this[Fa]=!1}save(){return this[_r].push({path:this[ue],bounds:this[Le],renderProps:Object.assign({},this[de])}),this}restore(){if(this[_r].length){const{path:t,bounds:e,renderProps:n}=this[_r].pop();this[ue]=t,this[Le]=e,this[de]=n}return this}get bounds(){if(!this[Le]){const t=this[ue];if(this[Le]=[0,0,0,0],t.length){const e=[1/0,1/0,-1/0,-1/0];for(let n=0,r=t.length;n<r;n++){const s=t[n].slice(1);for(let a=0;a<s.length;a+=2)s[a+0]<e[0]&&(e[0]=s[a+0]),s[a+1]<e[1]&&(e[1]=s[a+1]),s[a+0]>e[2]&&(e[2]=s[a+0]),s[a+1]>e[3]&&(e[3]=s[a+1])}this[Le]=e}}return this[Le]}get size(){const t=this.bounds;return[t[2]-t[0],t[3]-t[1]]}get center(){const[t,e,n,r]=this.bounds;return[(t+n)/2,(e+r)/2]}get d(){let t=this[ue].map(e=>{const[n,...r]=e;return n+r.join()}).join("");return this.isClosed&&(t+="Z"),t}get path(){return this[ue]}get isClosed(){const t=this[mr][this[mr].length-1];return t&&t[0]==="Z"}isPointInPath(t,e){return fm(this,t,e)}isPointInStroke(t,e,{lineWidth:n=1,lineCap:r="butt",lineJoin:s="miter"}){if(Cc)return Cc(this,t,e,{lineWidth:n,lineCap:r,lineJoin:s})}getPointAtLength(t){return um(this.d,t)}getTotalLength(){return dm(this.d)}transform(...t){this[Le]=null;const e=new ce(t),n=this[ue];return this[ue]=n.map(r=>{const[s,...a]=r,o=[s];for(let h=0;h<a.length;h+=2){const l=a[h],c=a[h+1],[d,f]=e.transformPoint(l,c);o.push(d,f)}return o}),this}translate(t,e){const n=new ce().translate(t,e);return this.transform(...n.m)}rotate(t){const e=new ce().rotate(t);return this.transform(...e.m)}scale(t,e){e==null&&(e=t);const n=new ce().scale(t,e);return this.transform(...n.m)}skew(t,e){const n=new ce().skew(t,e);return this.transform(...n.m)}trim(){const[t,e]=this.bounds;return this.translate(-t,-e),this}beginPath(){return this[Fa]=!0,this}toCanvas(t){const e=this[ue],n=this[de];return e.length&&(this[Fa]&&t.beginPath(),e.forEach(r=>{const[s,...a]=r;s==="M"?t.moveTo(...a):t.bezierCurveTo(...a)}),this.isClosed&&t.closePath()),Object.assign(t,n),{stroke(){return t.stroke(),this},fill(){return t.fill(),this}}}strokeStyle(t){return this[de].strokeStyle=t,this}fillStyle(t){return this[de].fillStyle=t,this}lineWidth(t){return this[de].lineWidth=t,this}lineCap(t){return this[de].lineCap=t,this}lineJoin(t){return this[de].lineJoin=t,this}}const Tc=Em("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 Em(i,t=10){const e={},n=i.split(",");for(let r=0;r<n.length;r+=2){const s="&"+n[r+1]+";",a=parseInt(n[r],t);e[s]="&#"+a+";"}return e["\\xa0"]="&#160;",e}function Rt(i,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)i=i.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return i}function vr(i){let t,e;if(!i)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(i[t]);return t}function Tm(i){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[i]||t.start}function km(i){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[i]||t.alphabetic}const Cn={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class Na{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const s=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);s&&(n.setAttribute("stop-color",Rt("rgb({r},{g},{b})",{r:s[1],g:s[2],b:s[3]})),n.setAttribute("stop-opacity",s[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}}class kc{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class yr{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500,enableMirroring:r=!1}){this.enableMirroring=r,t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=n),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Cn);for(let e=0,n=t.length;e<n;e++){const r=t[e];this[r]=Cn[r].canvas}}__getStyleState(){const t={},e=Object.keys(Cn);for(let n=0,r=e.length;n<r;n++){const s=e[n];t[s]=this[s]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const s=e[n];this[s]=t[s]}}__createElement(t,e={},n=!1){const r=this.__document.createElementNS("http://www.w3.org/2000/svg",t),s=Object.keys(e);n&&(r.setAttribute("fill","none"),r.setAttribute("stroke","none"));for(let a=0;a<s.length;a++){const o=s[a];r.setAttribute(o,e[o])}return r}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(s=>{s.setAttribute(t,"")}));const r=Object.keys(Cn);for(let s=0;s<r.length;s++){const a=Cn[r[s]],o=this[r[s]];if(a.apply){if(o instanceof kc){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,Rt("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof Na)e.setAttribute(a.apply,Rt("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const l=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);e.setAttribute(a.svgAttr,Rt("rgb({r},{g},{b})",{r:l[1],g:l[2],b:l[3]}));let c=parseFloat(l[4]);const d=this.globalAlpha;d!=null&&(c*=d),e.setAttribute(a.svgAttr+"-opacity",""+c)}else{let h=a.svgAttr;if(r[s]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const r=Object.keys(Tc);for(let s=0,a=r.length;s<a;s++){const o=r[s],h=Tc[o],l=new RegExp(o,"gi");l.test(e)&&(e=e.replace(l,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const r=this.__createElement("g");e.appendChild(r),this.__currentElement=r}let n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Rt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Rt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Rt("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,r,s,a){this.__addTransform(Rt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:r,e:s,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"?t.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",t.nodeName)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(Rt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(Rt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Rt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,r,s,a){this.__currentPosition={x:s,y:a},this.__addPathCommand(Rt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:r,x:s,y:a}))}quadraticCurveTo(t,e,n,r){this.__currentPosition={x:n,y:r},this.__addPathCommand(Rt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:r}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,r,s){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(s<0)throw new Error("IndexSizeError: The radius provided ("+s+") is negative.");if(a===t&&o===e||t===n&&e===r||s===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),l=this.normalize([n-t,r-e]);if(h[0]*l[1]===h[1]*l[0]){this.lineTo(t,e);return}const c=h[0]*l[0]+h[1]*l[1],d=Math.acos(Math.abs(c)),f=this.normalize([h[0]+l[0],h[1]+l[1]]),u=s/Math.sin(d/2),g=t+u*f[0],p=e+u*f[1],_=[-h[1],h[0]],y=[l[1],-l[0]],b=function(w){const S=w[0];return w[1]>=0?Math.acos(S):-Math.acos(S)},m=b(_),v=b(y);this.lineTo(g+_[0]*s,p+_[1]*s),this.arc(g,p,s,m,v)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,n,r){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,r){const s=this.__createElement("rect",{x:t,y:e,width:n,height:r},!0);this.__closestGroupOrSvg().appendChild(s),this.__currentElement=s,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,r){const s=this.__createElement("rect",{x:t,y:e,width:n,height:r},!0);this.__closestGroupOrSvg().appendChild(s),this.__currentElement=s,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],r=n.childNodes;for(let s=r.length-1;s>=0;s--)r[s]&&n.removeChild(r[s]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,r){if(t===0&&e===0&&n===this.width&&r===this.height){this.__clearCanvas();return}const s=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:n,height:r,fill:"#FFFFFF"},!0);s.appendChild(a)}createLinearGradient(t,e,n,r){const s=this.__createElement("linearGradient",{id:vr(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(s),new Na(s,this)}createRadialGradient(t,e,n,r,s,a){const o=this.__createElement("radialGradient",{id:vr(this.__ids),cx:r+"px",cy:s+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new Na(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,r){const s=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":s.family,"font-size":s.size,"font-style":s.style,"font-weight":s.weight,"text-decoration":s.decoration,x:e,y:n,"text-anchor":Tm(this.textAlign),"dominant-baseline":km(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(r),a.appendChild(this.__wrapTextLink(s,o))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,r,s,a){if(r===s)return;r=r%(2*Math.PI),s=s%(2*Math.PI),r===s&&(s=(s+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+n*Math.cos(s),h=e+n*Math.sin(s),l=t+n*Math.cos(r),c=e+n*Math.sin(r),d=a?0:1;let f=0,u=s-r;u<0&&(u+=2*Math.PI),a?f=u>Math.PI?0:1:f=u>Math.PI?1:0,this.lineTo(l,c),this.__addPathCommand(Rt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:f,sweepFlag:d,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=vr(this.__ids),r=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Rt("url(#{id})",{id:n})),t.appendChild(r),this.__currentElement=r}drawImage(...t){let e=t[0],n,r,s,a,o=0,h=0,l,c,d,f,u,g,p,_;if(t.length===3)n=t[1],r=t[2],l=e.width,c=e.height,s=l,a=c;else if(t.length===5)n=t[1],r=t[2],s=t[3],a=t[4],l=e.width,c=e.height;else if(t.length===9)o=t[1],h=t[2],l=t[3],c=t[4],n=t[5],r=t[6],s=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const y=this.__closestGroupOrSvg();this.__currentElement;const b="translate("+n+", "+r+")";if(e instanceof yr){if(d=e.getSvg().cloneNode(!0),d.childNodes&&d.childNodes.length>1){for(f=d.childNodes[0];f.childNodes.length;)_=f.childNodes[0].getAttribute("id"),this.__ids[_]=_,this.__SVGdefs.appendChild(f.childNodes[0]);if(u=d.childNodes[1],u){const m=u.getAttribute("transform");let v;m?v=m+" "+b:v=b,u.setAttribute("transform",v),y.appendChild(u)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(g=this.__createElement("image"),g.setAttribute("width",s),g.setAttribute("height",a),g.setAttribute("preserveAspectRatio","none"),(o||h||l!==e.width||c!==e.height)&&(p=this.__document.createElement("canvas"),p.width=s,p.height=a,p.getContext("2d")?.drawImage(e,o,h,l,c,0,0,s,a),e=p),g.setAttribute("transform",b),g.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),y.appendChild(g))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),r=vr(this.__ids);let s;return n.setAttribute("id",r),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(s=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(s),this.__SVGdefs.appendChild(n)):t instanceof yr&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new kc(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}const Am=yr,Pm=function(i,t,e,n,r,s){i.beginPath(),i.moveTo(t,e+s),i.lineTo(t,e+r-s),i.quadraticCurveTo(t,e+r,t+s,e+r),i.lineTo(t+n-s,e+r),i.quadraticCurveTo(t+n,e+r,t+n,e+r-s),i.lineTo(t+n,e+s),i.quadraticCurveTo(t+n,e,t+n-s,e),i.lineTo(t+s,e),i.quadraticCurveTo(t,e,t,e+s),i.stroke()},Mm=function(i,t,e,n){var r=t-n,s=0,a=1;i.beginPath(),i.moveTo(r,s);do{if(a>2e4)break;var o=(t+e)*Math.cos(a*Math.PI/72)-(e+n)*Math.cos((t+e)/e*(a*Math.PI/72)),h=(t+e)*Math.sin(a*Math.PI/72)-(e+n)*Math.sin((t+e)/e*(a*Math.PI/72));i.lineTo(o,h),r=o,s=h,a++}while(o!=t-n&&h!=0);i.stroke()},Rm=function(i,t){i.save(),i.beginPath(),i.moveTo(t,0);for(var e=0;e<9;e++)i.rotate(Math.PI/5),e%2==0?i.lineTo(t/.525731*.200811,0):i.lineTo(t,0);i.closePath(),i.fill(),i.restore()},Dm=function(i,t,e,n,r){var s=0;function a(){i.clearRect(t,e,n,r),i.setLineDash([4,2]),i.lineDashOffset=-s,i.strokeRect(t,e,n,r)}function o(){s++,s>16&&(s=0),a(),setTimeout(o,40)}o()},Lm=function(i){i.beginPath(),i.arc(75,75,50,0,Math.PI*2,!0),i.moveTo(110,75),i.arc(75,75,35,0,Math.PI,!1),i.moveTo(65,65),i.arc(60,65,5,0,Math.PI*2,!0),i.moveTo(95,65),i.arc(90,65,5,0,Math.PI*2,!0),i.stroke()};let Om=class{constructor(t=0,e=0,n="#ffff00",r=0){this.x=t,this.y=e,this.color=n,this.rotation=r}draw(t){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.lineWidth=2,t.fillStyle=this.color,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(),t.fill(),t.stroke(),t.restore()}};class Im extends pt{constructor(t=40,e="#ff0000"){super(0,0,{vx:0,vy:0,radius:t}),this.x=0,this.y=0,this.radius=t,this.vx=0,this.vy=0,this.mass=1,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=e,this.lineWidth=1}draw(t){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.fillStyle=this.color,t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore()}getBounds(){return new Oa(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}class Fm{constructor(t=40,e="#ff0000"){this.x=0,this.y=0,this.xpos=0,this.ypos=0,this.zpos=0,this.radius=t,this.vx=0,this.vy=0,this.vz=0,this.mass=1,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=e,this.lineWidth=1,this.visible=!0}draw(t){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.fillStyle=this.color,t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore()}}class Nm{constructor(t=50,e=50,n="#ff0000"){this.x=0,this.y=0,this.width=t,this.height=e,this.vx=0,this.vy=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=n,this.lineWidth=1}draw(t){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.fillStyle=this.color,t.beginPath(),t.rect(0,0,this.width,this.height),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore()}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)}}class Um{constructor(t,e,n,r){this.x=t===void 0?-100:t,this.y=e===void 0?-100:e,this.z=n===void 0?-100:n,this.brightness=r===void 0?1:r}setBrightness(t){this.brightness=Math.min(Math.max(t,0),1)}}let Gm=class{constructor(t,e,n,r){this.x=0,this.y=0,this.x1=t===void 0?0:t,this.y1=e===void 0?0:e,this.x2=n===void 0?0:n,this.y2=r===void 0?0:r,this.rotation=0,this.scaleX=1,this.scaleY=1,this.lineWidth=1}draw(t){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.beginPath(),t.moveTo(this.x1,this.y1),t.lineTo(this.x2,this.y2),t.closePath(),t.stroke(),t.restore()}getBounds(){if(this.rotation===0){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),r=Math.max(this.y1,this.y2);return{x:this.x+t,y:this.y+e,width:n-t,height:r-e}}else{var s=Math.sin(this.rotation),a=Math.cos(this.rotation),o=a*this.x1-s*this.y1,h=a*this.x2-s*this.y2,l=a*this.y1+s*this.x1,c=a*this.y2+s*this.x2;return{x:this.x+Math.min(o,h),y:this.y+Math.min(l,c),width:Math.max(o,h)-Math.min(o,h),height:Math.max(l,c)-Math.min(l,c)}}}};class Bm{constructor(t,e,n){this.x=t===void 0?0:t,this.y=e===void 0?0:e,this.z=n===void 0?0:n,this.fl=250,this.vpX=0,this.vpY=0,this.cX=0,this.cY=0,this.cZ=0}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,n){this.cX=t,this.cY=e,this.cZ=n}rotateX(t){var e=Math.cos(t),n=Math.sin(t),r=this.y*e-this.z*n,s=this.z*e+this.y*n;this.y=r,this.z=s}rotateY(t){var e=Math.cos(t),n=Math.sin(t),r=this.x*e-this.z*n,s=this.z*e+this.x*n;this.x=r,this.z=s}rotateZ(t){var e=Math.cos(t),n=Math.sin(t),r=this.x*e-this.y*n,s=this.y*e+this.x*n;this.x=r,this.y=s}getScreenX(){var t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){var t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}}class zm{constructor(){this.x=0,this.y=0,this.width=25,this.height=20,this.rotation=0,this.showFlame=!1}draw(t){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.lineWidth=1,t.strokeStyle="#ffffff",t.beginPath(),t.moveTo(10,0),t.lineTo(-10,10),t.lineTo(-5,0),t.lineTo(-10,-10),t.lineTo(10,0),t.closePath(),t.stroke(),this.showFlame&&(t.beginPath(),t.moveTo(-7.5,-5),t.lineTo(-15,0),t.lineTo(-7.5,5),t.closePath(),t.stroke()),t.restore()}}class Hm{constructor(t,e,n){this.min=t===void 0?0:t,this.max=e===void 0?100:e,this.value=n===void 0?100:n,this.onchange=null,this.x=0,this.y=0,this.width=16,this.height=100,this.backColor="#cccccc",this.backBorderColor="#999999",this.backWidth=4,this.backX=this.width/2-this.backWidth/2,this.handleColor="#eeeeee",this.handleBorderColor="#cccccc",this.handleHeight=6,this.handleY=0,this.updatePosition()}draw(t){t.save(),t.translate(this.x,this.y),t.fillStyle=this.backColor,t.beginPath(),t.fillRect(this.backX,0,this.backWidth,this.height),t.closePath(),t.strokeStyle=this.handleBorderColor,t.fillStyle=this.handleColor,t.beginPath(),t.rect(0,this.handleY,this.width,this.handleHeight),t.closePath(),t.fill(),t.stroke(),t.restore()}updateValue(){var t=this.value,e=this.height-this.handleHeight,n=this.max-this.min;this.value=(e-this.handleY)/e*n+this.min,typeof this.onchange=="function"&&this.value!==t&&this.onchange()}updatePosition(){var t=this.height-this.handleHeight,e=this.max-this.min;this.handleY=t-(this.value-this.min)/e*t}captureMouse(t){var e=this,n=Ks.captureMouse(t),r=new Oa(0,0,0,0);o(),t.addEventListener("mousedown",function(){r.isContainPoint(n)&&(t.addEventListener("mouseup",s,!1),t.addEventListener("mousemove",a,!1))},!1);function s(){t.removeEventListener("mousemove",a,!1),t.removeEventListener("mouseup",s,!1),o()}function a(){var h=n.y-e.y;e.handleY=Math.min(e.height-e.handleHeight,Math.max(h,0)),e.updateValue()}function o(){r.x=e.x,r.y=e.y+e.handleY,r.width=e.width,r.height=e.handleHeight}}}class jm{constructor(t,e,n,r="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=n,this.color=r,this.lineWidth=1,this.alpha=1}draw(t){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=La(this.color,this.alpha),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){var t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),n=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return t*r>e*n}}class Vm{constructor(t,e,n,r="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=n,this.color=r,this.lineWidth=1,this.alpha=1,this.light=null}draw(t){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=this.getAdjustedColor(),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){var t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),n=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return t*r>e*n}getAdjustedColor(){var t=dr(this.color),e=t>>16,n=t>>8&255,r=t&255,s=this.getLightFactor();return e*=s,n*=s,r*=s,yc(e<<16|n<<8|r)}getLightFactor(){var t={x:this.pointA.x-this.pointB.x,y:this.pointA.y-this.pointB.y,z:this.pointA.z-this.pointB.z},e={x:this.pointB.x-this.pointC.x,y:this.pointB.y-this.pointC.y,z:this.pointB.z-this.pointC.z},n={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},r=n.x*this.light.x+n.y*this.light.y+n.z*this.light.z,s=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(r/(s*a))/Math.PI*this.light.brightness}}class $m{constructor(){this.x=0,this.y=0,this.xpos=0,this.ypos=0,this.zpos=0,this.scaleX=1,this.scaleY=1,this.color="#ffffff",this.alpha=1,this.lineWidth=1,this.branch=[],this.branch[0]=-140-Math.random()*20,this.branch[1]=-30-Math.random()*30,this.branch[2]=Math.random()*80-40,this.branch[3]=-100-Math.random()*40,this.branch[4]=-60-Math.random()*40,this.branch[5]=Math.random()*60-30,this.branch[6]=-110-Math.random()*20}draw(t){t.save(),t.translate(this.x,this.y),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.strokeStyle=La(this.color,this.alpha),t.beginPath(),t.moveTo(0,0),t.lineTo(0,this.branch[0]),t.moveTo(0,this.branch[1]),t.lineTo(this.branch[2],this.branch[3]),t.moveTo(0,this.branch[4]),t.lineTo(this.branch[5],this.branch[6]),t.stroke(),t.restore()}}class Xm{constructor(t,e,n="#ffffff"){this.x=0,this.y=0,this.width=t,this.height=e,this.vx=0,this.vy=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=n,this.lineWidth=1}draw(t){var e=this.height,n=this.width+e,r=e/2;t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.fillStyle=this.color,t.beginPath(),t.moveTo(0,-r),t.lineTo(n-2*r,-r),t.quadraticCurveTo(-r+n,-r,-r+n,0),t.lineTo(-r+n,e-2*r),t.quadraticCurveTo(-r+n,-r+e,n-2*r,-r+e),t.lineTo(0,-r+e),t.quadraticCurveTo(-r,-r+e,-r,e-2*r),t.lineTo(-r,0),t.quadraticCurveTo(-r,-r,0,-r),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.beginPath(),t.arc(0,0,2,0,Math.PI*2,!0),t.closePath(),t.stroke(),t.beginPath(),t.arc(this.width,0,2,0,Math.PI*2,!0),t.closePath(),t.stroke(),t.restore()}getPin(){return{x:this.x+Math.cos(this.rotation)*this.width,y:this.y+Math.sin(this.rotation)*this.width}}}class Ym{canvas;context;mouse;constructor(t){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.mouse=Ks.captureMouse(this.canvas)}getMouseRotation(t){return t.angleTo(this.mouse)}followMouse(t,e){const n=this.getMouseRotation(t),{x:r,y:s}=t.fromRadian(n,e);return t.x+=r,t.y+=s,t}followMouseWithAcceleration(t,e=.05){const n=this.getMouseRotation(t),{x:r,y:s}=t.fromRadian(n,e);return t.ax=r,t.ay=s,t.nextFrame(),t}getMouseDistance(t){return t.distanceTo(this.mouse)}clearRect(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}lineWidth(t){return this.context.lineWidth=t,this}fillStyle(t){return this.context.fillStyle=t,this}fill(){return this.context.fill(),this}strokeStyle(t){return this.context.strokeStyle=t,this}stroke(){return this.context.stroke(),this}createLinearGradient(t,e,n){const r=this.context.createLinearGradient(t.x,t.y,e.x,e.y);return Object.keys(n).forEach(s=>r.addColorStop(parseFloat(s),n[parseFloat(s)])),r}createRadialGradient(t,e,n){const r=this.context.createRadialGradient(t.x,t.y,t.radius,e.x,e.y,e.radius);return Object.keys(n).forEach(s=>r.addColorStop(parseFloat(s),n[parseFloat(s)])),r}moveTo(t){this.context.moveTo(t.x,t.y)}closePath(){this.context.closePath()}lineTo(t,e){this.context.save(),this.context.beginPath(),this.context.moveTo(t.x,t.y),this.context.lineTo(e.x,e.y),this.context.stroke(),this.context.restore()}drawMouseMoveLine(){const t=()=>{this.context.lineTo(this.mouse.x,this.mouse.y),this.stroke()};this.canvas.addEventListener("mousedown",()=>{this.context.beginPath(),this.context.moveTo(this.mouse.x,this.mouse.y),this.canvas.addEventListener("mousemove",t,!1)},!1),this.canvas.addEventListener("mouseup",()=>{this.canvas.removeEventListener("mousemove",t,!1)},!1)}drawMouseMoveBrushLine({brush_size:t,brush_density:e,brush_color:n}={brush_size:25,brush_density:50,brush_color:"#000000"}){const r=this.getImageData(),s=r.data,a=dr(n),o=()=>{for(let h=0;h<e;h++){const l=Math.random()*Math.PI*2,c=Math.random()*t,d=this.mouse.x+Math.cos(l)*c|0,f=this.mouse.y+Math.sin(l)*c|0,u=(d+f*r.width)*4;s[u]=a>>16&255,s[u+1]=a>>8&255,s[u+2]=a&255,s[u+3]=255}this.putImageData(r)};this.canvas.addEventListener("mousedown",()=>{this.canvas.addEventListener("mousemove",o,!1)},!1),this.canvas.addEventListener("mouseup",()=>{this.canvas.removeEventListener("mousemove",o,!1)},!1)}quadraticCurveTo(t,e,n){this.context.save(),this.context.beginPath(),this.context.moveTo(t.x,t.y),this.context.quadraticCurveTo(e.x,e.y,n.x,n.y),this.context.stroke(),this.context.restore()}drawQuadraticCurveLine(t){const e=t.length;if(e<3)return new Error("points length must >= 3");this.context.beginPath(),this.context.moveTo(t[0].x,t[0].y);for(let n=1;n<e;n+=2)this.context.quadraticCurveTo(t[n].x,t[n].y,t[n+1].x,t[n+1].y);this.context.stroke()}quadraticThroughCurveTo(t,e,n){e.x=e.x*2-(t.x+n.x)/2,e.y=e.y*2-(t.y+n.y)/2,this.quadraticCurveTo(t,e,n)}drawQuadraticThroughCurveLine(t){const e=t.length;if(e<3)return new Error("points length must >= 3");this.context.beginPath(),this.context.moveTo(t[0].x,t[0].y);let n=1;for(;n<e-2;n++)this.context.quadraticCurveTo(t[n].x,t[n].y,(t[n].x+t[n+1].x)/2,(t[n].y+t[n+1].y)/2);this.context.quadraticCurveTo(t[n].x,t[n].y,t[n+1].x,t[n+1].y),this.context.stroke()}drawQuadraticThroughCurveLineBetter(t){const e=t.length;if(e<3)return new Error("points length must >= 3");const n=(t[0].x+t[e-1].x)/2,r=(t[0].y+t[e-1].y)/2;this.context.beginPath(),this.context.moveTo(n,r);let s=0;for(;s<e-1;s++){const a=(t[s].x+t[s+1].x)/2,o=(t[s].y+t[s+1].y)/2;this.context.quadraticCurveTo(t[s].x,t[s].y,a,o)}this.context.quadraticCurveTo(t[s].x,t[s].y,r,r),this.context.stroke()}fillRect(t){this.context.save(),this.context.fillRect(t.x,t.y,t.width,t.height),this.context.stroke(),this.context.restore()}drawImage(t,e=0,n=0){this.context.drawImage(t,e,n)}getImageData(t={x:0,y:0,width:this.canvas.width,height:this.canvas.height},e){return this.context.getImageData(t.x,t.y,t.width,t.height,e)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}drawShape(t){t.draw(this.context)}}var Ac=null;if(navigator.mozGetUserMedia)console.log("This appears to be Firefox"),window.webrtcDetectedBrowser="firefox",window.webrtcDetectedVersion=parseInt(navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1],10),RTCSessionDescription=mozRTCSessionDescription,RTCIceCandidate=mozRTCIceCandidate,window.getUserMedia=navigator.mozGetUserMedia.bind(navigator),navigator.getUserMedia=Ac,window.createIceServer=function(i,t,e){var n=null,r=i.split(":");if(r[0].indexOf("stun")===0)n={url:i};else if(r[0].indexOf("turn")===0){var s=i.split("?");(s.length===1||s[1].indexOf("transport=udp")===0)&&(n={url:s[0],credential:e,username:t})}return n},window.createIceServers=function(i,t,e){for(var n=[],r=0;r<i.length;r++){var s=createIceServer(i[r],t,e);s!==null&&n.push(s)}return n},window.attachMediaStream=function(i,t){console.log("Attaching media stream"),i.mozSrcObject=t,i.play()},window.reattachMediaStream=function(i,t){console.log("Reattaching media stream"),i.mozSrcObject=t.mozSrcObject,i.play()};else if(navigator.webkitGetUserMedia){console.log("This appears to be Chrome"),window.webrtcDetectedBrowser="chrome";var Pc=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);Pc!==null?window.webrtcDetectedVersion=parseInt(Pc[2],10):window.webrtcDetectedVersion=999,window.createIceServer=function(i,t,e){var n=null,r=i.split(":");return r[0].indexOf("stun")===0?n={url:i}:r[0].indexOf("turn")===0&&(n={url:i,credential:e,username:t}),n},window.createIceServers=function(i,t,e){for(var n=[],r=0;r<i.length;r++){var s=createIceServer(i[r],t,e);s!==null&&n.push(s)}return n},window.getUserMedia=navigator.webkitGetUserMedia.bind(navigator),navigator.getUserMedia=Ac,window.attachMediaStream=function(i,t){typeof i.srcObject<"u"?i.srcObject=t:typeof i.mozSrcObject<"u"?i.mozSrcObject=t:typeof i.src<"u"?i.src=URL.createObjectURL(t):console.log("Error attaching stream to element.")},window.reattachMediaStream=function(i,t){i.src=t.src}}else console.log("Browser does not appear to be WebRTC-capable");class xn{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{const n=e.target;n instanceof HTMLVideoElement&&console.log(`${n.id} videoWidth: ${n.videoWidth}px, videoHeight: ${n.videoHeight}px.`)}),this.video.srcObject=t}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(n=>{xn.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 Wm{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new xn(t),this.remoteVideoUtil=new xn(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(n=>{this.localVideoUtil.setSrcObject(n),t(n)}).catch(n=>{this.trace(`navigator.getUserMedia error: ${n}.`),e(n)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),n=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),n.length>0&&this.trace(`Using audio device: ${n[0].label}.`);const r=void 0,s=new RTCPeerConnection(r);this.localPeerConnection=s,this.trace("Created local peer connection object localPeerConnection."),s.addEventListener("icecandidate",this.handleConnection),s.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(r);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),s.addTrack(e[0],t),s.addTrack(n[0],t),this.trace("localPeerConnection createOffer start."),s.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,n=t.candidate;if(e&&n){const r=new RTCIceCandidate(n),s=this.getOtherPeer(e);s&&(s.addIceCandidate(r).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
15
+ ${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:
16
+ ${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:
17
+ ${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:
18
+ ${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 qm{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function Mc(i,t){return!i||i.parentElement===null?t:Mc(i.parentElement,t.concat([i]))}const Ua=function(i,t){return getComputedStyle(i,null).getPropertyValue(t)},Km=function(i){return Ua(i,"overflow")+Ua(i,"overflow-y")+Ua(i,"overflow-x")},Zm=function(i){return/(auto|scroll)/.test(Km(i))};function Jm(i){if(!(i instanceof HTMLElement||i instanceof SVGElement))return;const t=Mc(i.parentElement,[]);for(let e=0;e<t.length;e+=1)if(Zm(t[e]))return t[e];return document.scrollingElement||document.documentElement}var Ga={exports:{}},br={},Rc={},Y={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i._registerNode=i.Konva=i.glob=void 0;const t=Math.PI/180;function e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}i.glob=typeof Ul<"u"?Ul:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},i.Konva={_global:i.glob,version:"9.2.2",isBrowser:e(),isUnminified:/param/.test(function(r){}.toString()),dblClickWindow:400,getAngle(r){return i.Konva.angleDeg?r*t:r},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return i.Konva.DD.isDragging},isDragReady(){return!!i.Konva.DD.node},releaseCanvasOnDestroy:!0,document:i.glob.document,_injectGlobal(r){i.glob.Konva=r}};const n=r=>{i.Konva[r.prototype.getClassName()]=r};i._registerNode=n,i.Konva._injectGlobal(i.Konva)})(Y);var gt={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.Util=i.Transform=void 0;const t=Y;class e{constructor(v=[1,0,0,1,0,0]){this.dirty=!1,this.m=v&&v.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new e(this.m)}copyInto(v){v.m[0]=this.m[0],v.m[1]=this.m[1],v.m[2]=this.m[2],v.m[3]=this.m[3],v.m[4]=this.m[4],v.m[5]=this.m[5]}point(v){var w=this.m;return{x:w[0]*v.x+w[2]*v.y+w[4],y:w[1]*v.x+w[3]*v.y+w[5]}}translate(v,w){return this.m[4]+=this.m[0]*v+this.m[2]*w,this.m[5]+=this.m[1]*v+this.m[3]*w,this}scale(v,w){return this.m[0]*=v,this.m[1]*=v,this.m[2]*=w,this.m[3]*=w,this}rotate(v){var w=Math.cos(v),S=Math.sin(v),T=this.m[0]*w+this.m[2]*S,C=this.m[1]*w+this.m[3]*S,k=this.m[0]*-S+this.m[2]*w,x=this.m[1]*-S+this.m[3]*w;return this.m[0]=T,this.m[1]=C,this.m[2]=k,this.m[3]=x,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(v,w){var S=this.m[0]+this.m[2]*w,T=this.m[1]+this.m[3]*w,C=this.m[2]+this.m[0]*v,k=this.m[3]+this.m[1]*v;return this.m[0]=S,this.m[1]=T,this.m[2]=C,this.m[3]=k,this}multiply(v){var w=this.m[0]*v.m[0]+this.m[2]*v.m[1],S=this.m[1]*v.m[0]+this.m[3]*v.m[1],T=this.m[0]*v.m[2]+this.m[2]*v.m[3],C=this.m[1]*v.m[2]+this.m[3]*v.m[3],k=this.m[0]*v.m[4]+this.m[2]*v.m[5]+this.m[4],x=this.m[1]*v.m[4]+this.m[3]*v.m[5]+this.m[5];return this.m[0]=w,this.m[1]=S,this.m[2]=T,this.m[3]=C,this.m[4]=k,this.m[5]=x,this}invert(){var v=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),w=this.m[3]*v,S=-this.m[1]*v,T=-this.m[2]*v,C=this.m[0]*v,k=v*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),x=v*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=w,this.m[1]=S,this.m[2]=T,this.m[3]=C,this.m[4]=k,this.m[5]=x,this}getMatrix(){return this.m}decompose(){var v=this.m[0],w=this.m[1],S=this.m[2],T=this.m[3],C=this.m[4],k=this.m[5],x=v*T-w*S;let E={x:C,y:k,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(v!=0||w!=0){var M=Math.sqrt(v*v+w*w);E.rotation=w>0?Math.acos(v/M):-Math.acos(v/M),E.scaleX=M,E.scaleY=x/M,E.skewX=(v*S+w*T)/x,E.skewY=0}else if(S!=0||T!=0){var D=Math.sqrt(S*S+T*T);E.rotation=Math.PI/2-(T>0?Math.acos(-S/D):-Math.acos(S/D)),E.scaleX=x/D,E.scaleY=D,E.skewX=0,E.skewY=(v*S+w*T)/x}return E.rotation=i.Util._getRotation(E.rotation),E}}i.Transform=e;var n="[object Array]",r="[object Number]",s="[object String]",a="[object Boolean]",o=Math.PI/180,h=180/Math.PI,l="#",c="",d="0",f="Konva warning: ",u="Konva error: ",g="rgb(",p={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},_=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,y=[];const b=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(m){setTimeout(m,60)};i.Util={_isElement(m){return!!(m&&m.nodeType==1)},_isFunction(m){return!!(m&&m.constructor&&m.call&&m.apply)},_isPlainObject(m){return!!m&&m.constructor===Object},_isArray(m){return Object.prototype.toString.call(m)===n},_isNumber(m){return Object.prototype.toString.call(m)===r&&!isNaN(m)&&isFinite(m)},_isString(m){return Object.prototype.toString.call(m)===s},_isBoolean(m){return Object.prototype.toString.call(m)===a},isObject(m){return m instanceof Object},isValidSelector(m){if(typeof m!="string")return!1;var v=m[0];return v==="#"||v==="."||v===v.toUpperCase()},_sign(m){return m===0||m>0?1:-1},requestAnimFrame(m){y.push(m),y.length===1&&b(function(){const v=y;y=[],v.forEach(function(w){w()})})},createCanvasElement(){var m=document.createElement("canvas");try{m.style=m.style||{}}catch{}return m},createImageElement(){return document.createElement("img")},_isInDocument(m){for(;m=m.parentNode;)if(m==document)return!0;return!1},_urlToImage(m,v){var w=i.Util.createImageElement();w.onload=function(){v(w)},w.src=m},_rgbToHex(m,v,w){return(16777216+(m<<16)+(v<<8)+w).toString(16).slice(1)},_hexToRgb(m){m=m.replace(l,c);var v=parseInt(m,16);return{r:v>>16&255,g:v>>8&255,b:v&255}},getRandomColor(){for(var m=(Math.random()*16777215<<0).toString(16);m.length<6;)m=d+m;return l+m},getRGB(m){var v;return m in p?(v=p[m],{r:v[0],g:v[1],b:v[2]}):m[0]===l?this._hexToRgb(m.substring(1)):m.substr(0,4)===g?(v=_.exec(m.replace(/ /g,"")),{r:parseInt(v[1],10),g:parseInt(v[2],10),b:parseInt(v[3],10)}):{r:0,g:0,b:0}},colorToRGBA(m){return m=m||"black",i.Util._namedColorToRBA(m)||i.Util._hex3ColorToRGBA(m)||i.Util._hex4ColorToRGBA(m)||i.Util._hex6ColorToRGBA(m)||i.Util._hex8ColorToRGBA(m)||i.Util._rgbColorToRGBA(m)||i.Util._rgbaColorToRGBA(m)||i.Util._hslColorToRGBA(m)},_namedColorToRBA(m){var v=p[m.toLowerCase()];return v?{r:v[0],g:v[1],b:v[2],a:1}:null},_rgbColorToRGBA(m){if(m.indexOf("rgb(")===0){m=m.match(/rgb\(([^)]+)\)/)[1];var v=m.split(/ *, */).map(Number);return{r:v[0],g:v[1],b:v[2],a:1}}},_rgbaColorToRGBA(m){if(m.indexOf("rgba(")===0){m=m.match(/rgba\(([^)]+)\)/)[1];var v=m.split(/ *, */).map((w,S)=>w.slice(-1)==="%"?S===3?parseInt(w)/100:parseInt(w)/100*255:Number(w));return{r:v[0],g:v[1],b:v[2],a:v[3]}}},_hex8ColorToRGBA(m){if(m[0]==="#"&&m.length===9)return{r:parseInt(m.slice(1,3),16),g:parseInt(m.slice(3,5),16),b:parseInt(m.slice(5,7),16),a:parseInt(m.slice(7,9),16)/255}},_hex6ColorToRGBA(m){if(m[0]==="#"&&m.length===7)return{r:parseInt(m.slice(1,3),16),g:parseInt(m.slice(3,5),16),b:parseInt(m.slice(5,7),16),a:1}},_hex4ColorToRGBA(m){if(m[0]==="#"&&m.length===5)return{r:parseInt(m[1]+m[1],16),g:parseInt(m[2]+m[2],16),b:parseInt(m[3]+m[3],16),a:parseInt(m[4]+m[4],16)/255}},_hex3ColorToRGBA(m){if(m[0]==="#"&&m.length===4)return{r:parseInt(m[1]+m[1],16),g:parseInt(m[2]+m[2],16),b:parseInt(m[3]+m[3],16),a:1}},_hslColorToRGBA(m){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(m)){const[v,...w]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(m),S=Number(w[0])/360,T=Number(w[1])/100,C=Number(w[2])/100;let k,x,E;if(T===0)return E=C*255,{r:Math.round(E),g:Math.round(E),b:Math.round(E),a:1};C<.5?k=C*(1+T):k=C+T-C*T;const M=2*C-k,D=[0,0,0];for(let O=0;O<3;O++)x=S+.3333333333333333*-(O-1),x<0&&x++,x>1&&x--,6*x<1?E=M+(k-M)*6*x:2*x<1?E=k:3*x<2?E=M+(k-M)*(.6666666666666666-x)*6:E=M,D[O]=E*255;return{r:Math.round(D[0]),g:Math.round(D[1]),b:Math.round(D[2]),a:1}}},haveIntersection(m,v){return!(v.x>m.x+m.width||v.x+v.width<m.x||v.y>m.y+m.height||v.y+v.height<m.y)},cloneObject(m){var v={};for(var w in m)this._isPlainObject(m[w])?v[w]=this.cloneObject(m[w]):this._isArray(m[w])?v[w]=this.cloneArray(m[w]):v[w]=m[w];return v},cloneArray(m){return m.slice(0)},degToRad(m){return m*o},radToDeg(m){return m*h},_degToRad(m){return i.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),i.Util.degToRad(m)},_radToDeg(m){return i.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),i.Util.radToDeg(m)},_getRotation(m){return t.Konva.angleDeg?i.Util.radToDeg(m):m},_capitalize(m){return m.charAt(0).toUpperCase()+m.slice(1)},throw(m){throw new Error(u+m)},error(m){console.error(u+m)},warn(m){t.Konva.showWarnings&&console.warn(f+m)},each(m,v){for(var w in m)v(w,m[w])},_inRange(m,v,w){return v<=m&&m<w},_getProjectionToSegment(m,v,w,S,T,C){var k,x,E,M=(m-w)*(m-w)+(v-S)*(v-S);if(M==0)k=m,x=v,E=(T-w)*(T-w)+(C-S)*(C-S);else{var D=((T-m)*(w-m)+(C-v)*(S-v))/M;D<0?(k=m,x=v,E=(m-T)*(m-T)+(v-C)*(v-C)):D>1?(k=w,x=S,E=(w-T)*(w-T)+(S-C)*(S-C)):(k=m+D*(w-m),x=v+D*(S-v),E=(k-T)*(k-T)+(x-C)*(x-C))}return[k,x,E]},_getProjectionToLine(m,v,w){var S=i.Util.cloneObject(m),T=Number.MAX_VALUE;return v.forEach(function(C,k){if(!(!w&&k===v.length-1)){var x=v[(k+1)%v.length],E=i.Util._getProjectionToSegment(C.x,C.y,x.x,x.y,m.x,m.y),M=E[0],D=E[1],O=E[2];O<T&&(S.x=M,S.y=D,T=O)}}),S},_prepareArrayForTween(m,v,w){var S,T=[],C=[];if(m.length>v.length){var k=v;v=m,m=k}for(S=0;S<m.length;S+=2)T.push({x:m[S],y:m[S+1]});for(S=0;S<v.length;S+=2)C.push({x:v[S],y:v[S+1]});var x=[];return C.forEach(function(E){var M=i.Util._getProjectionToLine(E,T,w);x.push(M.x),x.push(M.y)}),x},_prepareToStringify(m){var v;m.visitedByCircularReferenceRemoval=!0;for(var w in m)if(m.hasOwnProperty(w)&&m[w]&&typeof m[w]=="object"){if(v=Object.getOwnPropertyDescriptor(m,w),m[w].visitedByCircularReferenceRemoval||i.Util._isElement(m[w]))if(v.configurable)delete m[w];else return null;else if(i.Util._prepareToStringify(m[w])===null)if(v.configurable)delete m[w];else return null}return delete m.visitedByCircularReferenceRemoval,m},_assign(m,v){for(var w in v)m[w]=v[w];return m},_getFirstPointerId(m){return m.touches?m.changedTouches[0].identifier:m.pointerId||999},releaseCanvas(...m){t.Konva.releaseCanvasOnDestroy&&m.forEach(v=>{v.width=0,v.height=0})},drawRoundedRectPath(m,v,w,S){let T=0,C=0,k=0,x=0;typeof S=="number"?T=C=k=x=Math.min(S,v/2,w/2):(T=Math.min(S[0]||0,v/2,w/2),C=Math.min(S[1]||0,v/2,w/2),x=Math.min(S[2]||0,v/2,w/2),k=Math.min(S[3]||0,v/2,w/2)),m.moveTo(T,0),m.lineTo(v-C,0),m.arc(v-C,C,C,Math.PI*3/2,0,!1),m.lineTo(v,w-x),m.arc(v-x,w-x,x,0,Math.PI/2,!1),m.lineTo(k,w),m.arc(k,w-k,k,Math.PI/2,Math.PI,!1),m.lineTo(0,T),m.arc(T,T,T,Math.PI,Math.PI*3/2,!1)}}})(gt);var dt={},X={},N={};Object.defineProperty(N,"__esModule",{value:!0}),N.getComponentValidator=N.getBooleanValidator=N.getNumberArrayValidator=N.getFunctionValidator=N.getStringOrGradientValidator=N.getStringValidator=N.getNumberOrAutoValidator=N.getNumberOrArrayOfNumbersValidator=N.getNumberValidator=N.alphaComponent=N.RGBComponent=void 0;const fe=Y,mt=gt;function ge(i){return mt.Util._isString(i)?'"'+i+'"':Object.prototype.toString.call(i)==="[object Number]"||mt.Util._isBoolean(i)?i:Object.prototype.toString.call(i)}function Qm(i){return i>255?255:i<0?0:Math.round(i)}N.RGBComponent=Qm;function t5(i){return i>1?1:i<1e-4?1e-4:i}N.alphaComponent=t5;function e5(){if(fe.Konva.isUnminified)return function(i,t){return mt.Util._isNumber(i)||mt.Util.warn(ge(i)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),i}}N.getNumberValidator=e5;function i5(i){if(fe.Konva.isUnminified)return function(t,e){let n=mt.Util._isNumber(t),r=mt.Util._isArray(t)&&t.length==i;return!n&&!r&&mt.Util.warn(ge(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or Array<number>('+i+")"),t}}N.getNumberOrArrayOfNumbersValidator=i5;function n5(){if(fe.Konva.isUnminified)return function(i,t){var e=mt.Util._isNumber(i),n=i==="auto";return e||n||mt.Util.warn(ge(i)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),i}}N.getNumberOrAutoValidator=n5;function r5(){if(fe.Konva.isUnminified)return function(i,t){return mt.Util._isString(i)||mt.Util.warn(ge(i)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),i}}N.getStringValidator=r5;function s5(){if(fe.Konva.isUnminified)return function(i,t){const e=mt.Util._isString(i),n=Object.prototype.toString.call(i)==="[object CanvasGradient]"||i&&i.addColorStop;return e||n||mt.Util.warn(ge(i)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),i}}N.getStringOrGradientValidator=s5;function a5(){if(fe.Konva.isUnminified)return function(i,t){return mt.Util._isFunction(i)||mt.Util.warn(ge(i)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),i}}N.getFunctionValidator=a5;function o5(){if(fe.Konva.isUnminified)return function(i,t){const e=Int8Array?Object.getPrototypeOf(Int8Array):null;return e&&i instanceof e||(mt.Util._isArray(i)?i.forEach(function(n){mt.Util._isNumber(n)||mt.Util.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):mt.Util.warn(ge(i)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),i}}N.getNumberArrayValidator=o5;function l5(){if(fe.Konva.isUnminified)return function(i,t){var e=i===!0||i===!1;return e||mt.Util.warn(ge(i)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),i}}N.getBooleanValidator=l5;function h5(i){if(fe.Konva.isUnminified)return function(t,e){return t==null||mt.Util.isObject(t)||mt.Util.warn(ge(t)+' is a not valid value for "'+e+'" attribute. The value should be an object with properties '+i),t}}N.getComponentValidator=h5,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.Factory=void 0;const t=gt,e=N;var n="get",r="set";i.Factory={addGetterSetter(s,a,o,h,l){i.Factory.addGetter(s,a,o),i.Factory.addSetter(s,a,h,l),i.Factory.addOverloadedGetterSetter(s,a)},addGetter(s,a,o){var h=n+t.Util._capitalize(a);s.prototype[h]=s.prototype[h]||function(){var l=this.attrs[a];return l===void 0?o:l}},addSetter(s,a,o,h){var l=r+t.Util._capitalize(a);s.prototype[l]||i.Factory.overWriteSetter(s,a,o,h)},overWriteSetter(s,a,o,h){var l=r+t.Util._capitalize(a);s.prototype[l]=function(c){return o&&c!==void 0&&c!==null&&(c=o.call(this,c,a)),this._setAttr(a,c),h&&h.call(this),this}},addComponentsGetterSetter(s,a,o,h,l){var c=o.length,d=t.Util._capitalize,f=n+d(a),u=r+d(a),g,p;s.prototype[f]=function(){var y={};for(g=0;g<c;g++)p=o[g],y[p]=this.getAttr(a+d(p));return y};var _=(0,e.getComponentValidator)(o);s.prototype[u]=function(y){var b=this.attrs[a],m;h&&(y=h.call(this,y)),_&&_.call(this,y,a);for(m in y)y.hasOwnProperty(m)&&this._setAttr(a+d(m),y[m]);return y||o.forEach(v=>{this._setAttr(a+d(v),void 0)}),this._fireChangeEvent(a,b,y),l&&l.call(this),this},i.Factory.addOverloadedGetterSetter(s,a)},addOverloadedGetterSetter(s,a){var o=t.Util._capitalize(a),h=r+o,l=n+o;s.prototype[a]=function(){return arguments.length?(this[h](arguments[0]),this):this[l]()}},addDeprecatedGetterSetter(s,a,o,h){t.Util.error("Adding deprecated "+a);var l=n+t.Util._capitalize(a),c=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";s.prototype[l]=function(){t.Util.error(c);var d=this.attrs[a];return d===void 0?o:d},i.Factory.addSetter(s,a,h,function(){t.Util.error(c)}),i.Factory.addOverloadedGetterSetter(s,a)},backCompat(s,a){t.Util.each(a,function(o,h){var l=s.prototype[h],c=n+t.Util._capitalize(o),d=r+t.Util._capitalize(o);function f(){l.apply(this,arguments),t.Util.error('"'+o+'" method is deprecated and will be removed soon. Use ""'+h+'" instead.')}s.prototype[o]=f,s.prototype[c]=f,s.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}}}(X);var $t={},pe={};Object.defineProperty(pe,"__esModule",{value:!0}),pe.HitContext=pe.SceneContext=pe.Context=void 0;const Dc=gt,c5=Y;function u5(i){var t=[],e=i.length,n=Dc.Util,r,s;for(r=0;r<e;r++)s=i[r],n._isNumber(s)?s=Math.round(s*1e3)/1e3:n._isString(s)||(s=s+""),t.push(s);return t}var Lc=",",d5="(",f5=")",g5="([",p5="])",m5=";",_5="()",v5="=",Oc=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],y5=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const b5=100;class wr{constructor(t){this.canvas=t,c5.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,e){var n=this.traceArr,r=n.length,s="",a,o,h,l;for(a=0;a<r;a++)o=n[a],h=o.method,h?(l=o.args,s+=h,t?s+=_5:Dc.Util._isArray(l[0])?s+=g5+l.join(Lc)+p5:(e&&(l=l.map(c=>typeof c=="number"?Math.floor(c):c)),s+=d5+l.join(Lc)+f5)):(s+=o.property,t||(s+=v5+o.val)),s+=m5;return s}clearTrace(){this.traceArr=[]}_trace(t){var e=this.traceArr,n;e.push(t),n=e.length,n>=b5&&e.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var e=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,e.getWidth()/e.pixelRatio,e.getHeight()/e.pixelRatio)}_applyLineCap(t){const e=t.attrs.lineCap;e&&this.setAttr("lineCap",e)}_applyOpacity(t){var e=t.getAbsoluteOpacity();e!==1&&this.setAttr("globalAlpha",e)}_applyLineJoin(t){const e=t.attrs.lineJoin;e&&this.setAttr("lineJoin",e)}setAttr(t,e){this._context[t]=e}arc(t,e,n,r,s,a){this._context.arc(t,e,n,r,s,a)}arcTo(t,e,n,r,s){this._context.arcTo(t,e,n,r,s)}beginPath(){this._context.beginPath()}bezierCurveTo(t,e,n,r,s,a){this._context.bezierCurveTo(t,e,n,r,s,a)}clearRect(t,e,n,r){this._context.clearRect(t,e,n,r)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,e){var n=arguments;if(n.length===2)return this._context.createImageData(t,e);if(n.length===1)return this._context.createImageData(t)}createLinearGradient(t,e,n,r){return this._context.createLinearGradient(t,e,n,r)}createPattern(t,e){return this._context.createPattern(t,e)}createRadialGradient(t,e,n,r,s,a){return this._context.createRadialGradient(t,e,n,r,s,a)}drawImage(t,e,n,r,s,a,o,h,l){var c=arguments,d=this._context;c.length===3?d.drawImage(t,e,n):c.length===5?d.drawImage(t,e,n,r,s):c.length===9&&d.drawImage(t,e,n,r,s,a,o,h,l)}ellipse(t,e,n,r,s,a,o,h){this._context.ellipse(t,e,n,r,s,a,o,h)}isPointInPath(t,e,n,r){return n?this._context.isPointInPath(n,t,e,r):this._context.isPointInPath(t,e,r)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,e,n,r){this._context.fillRect(t,e,n,r)}strokeRect(t,e,n,r){this._context.strokeRect(t,e,n,r)}fillText(t,e,n,r){r?this._context.fillText(t,e,n,r):this._context.fillText(t,e,n)}measureText(t){return this._context.measureText(t)}getImageData(t,e,n,r){return this._context.getImageData(t,e,n,r)}lineTo(t,e){this._context.lineTo(t,e)}moveTo(t,e){this._context.moveTo(t,e)}rect(t,e,n,r){this._context.rect(t,e,n,r)}putImageData(t,e,n){this._context.putImageData(t,e,n)}quadraticCurveTo(t,e,n,r){this._context.quadraticCurveTo(t,e,n,r)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,e){this._context.scale(t,e)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,e,n,r,s,a){this._context.setTransform(t,e,n,r,s,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,e,n,r){this._context.strokeText(t,e,n,r)}transform(t,e,n,r,s,a){this._context.transform(t,e,n,r,s,a)}translate(t,e){this._context.translate(t,e)}_enableTrace(){var t=this,e=Oc.length,n=this.setAttr,r,s,a=function(o){var h=t[o],l;t[o]=function(){return s=u5(Array.prototype.slice.call(arguments,0)),l=h.apply(t,arguments),t._trace({method:o,args:s}),l}};for(r=0;r<e;r++)a(Oc[r]);t.setAttr=function(){n.apply(t,arguments);var o=arguments[0],h=arguments[1];(o==="shadowOffsetX"||o==="shadowOffsetY"||o==="shadowBlur")&&(h=h/this.canvas.getPixelRatio()),t._trace({property:o,val:h})}}_applyGlobalCompositeOperation(t){const e=t.attrs.globalCompositeOperation;var n=!e||e==="source-over";n||this.setAttr("globalCompositeOperation",e)}}pe.Context=wr,y5.forEach(function(i){Object.defineProperty(wr.prototype,i,{get(){return this._context[i]},set(t){this._context[i]=t}})});class w5 extends wr{constructor(t,{willReadFrequently:e=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:e})}_fillColor(t){var e=t.fill();this.setAttr("fillStyle",e),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var e=t._getLinearGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))}_fillRadialGradient(t){const e=t._getRadialGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))}_fill(t){const e=t.fill(),n=t.getFillPriority();if(e&&n==="color"){this._fillColor(t);return}const r=t.getFillPatternImage();if(r&&n==="pattern"){this._fillPattern(t);return}const s=t.getFillLinearGradientColorStops();if(s&&n==="linear-gradient"){this._fillLinearGradient(t);return}const a=t.getFillRadialGradientColorStops();if(a&&n==="radial-gradient"){this._fillRadialGradient(t);return}e?this._fillColor(t):r?this._fillPattern(t):s?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const e=t.getStrokeLinearGradientStartPoint(),n=t.getStrokeLinearGradientEndPoint(),r=t.getStrokeLinearGradientColorStops(),s=this.createLinearGradient(e.x,e.y,n.x,n.y);if(r){for(var a=0;a<r.length;a+=2)s.addColorStop(r[a],r[a+1]);this.setAttr("strokeStyle",s)}}_stroke(t){var e=t.dash(),n=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!n){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t),e&&t.dashEnabled()&&(this.setLineDash(e),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var s=t.getStrokeLinearGradientColorStops();s?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),n||this.restore()}}_applyShadow(t){var e,n,r,s=(e=t.getShadowRGBA())!==null&&e!==void 0?e:"black",a=(n=t.getShadowBlur())!==null&&n!==void 0?n:5,o=(r=t.getShadowOffset())!==null&&r!==void 0?r:{x:0,y:0},h=t.getAbsoluteScale(),l=this.canvas.getPixelRatio(),c=h.x*l,d=h.y*l;this.setAttr("shadowColor",s),this.setAttr("shadowBlur",a*Math.min(Math.abs(c),Math.abs(d))),this.setAttr("shadowOffsetX",o.x*c),this.setAttr("shadowOffsetY",o.y*d)}}pe.SceneContext=w5;class S5 extends wr{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const s=t.getStrokeScaleEnabled();if(!s){this.save();var e=this.getCanvas().getPixelRatio();this.setTransform(e,0,0,e,0,0)}this._applyLineCap(t);var n=t.hitStrokeWidth(),r=n==="auto"?t.strokeWidth():n;this.setAttr("lineWidth",r),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),s||this.restore()}}}pe.HitContext=S5,Object.defineProperty($t,"__esModule",{value:!0}),$t.HitCanvas=$t.SceneCanvas=$t.Canvas=void 0;const Sr=gt,Ic=pe,Fc=Y,C5=X,x5=N;var Cr;function E5(){if(Cr)return Cr;var i=Sr.Util.createCanvasElement(),t=i.getContext("2d");return Cr=function(){var e=Fc.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return e/n}(),Sr.Util.releaseCanvas(i),Cr}class xr{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var e=t||{},n=e.pixelRatio||Fc.Konva.pixelRatio||E5();this.pixelRatio=n,this._canvas=Sr.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var e=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/e,this.getHeight()/e)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var e=this.pixelRatio,n=this.getContext()._context;n.scale(e,e)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var e=this.pixelRatio,n=this.getContext()._context;n.scale(e,e)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,e){this.setWidth(t||0),this.setHeight(e||0)}toDataURL(t,e){try{return this._canvas.toDataURL(t,e)}catch{try{return this._canvas.toDataURL()}catch(r){return Sr.Util.error("Unable to get data URL. "+r.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}$t.Canvas=xr,C5.Factory.addGetterSetter(xr,"pixelRatio",void 0,(0,x5.getNumberValidator)());class T5 extends xr{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new Ic.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}$t.SceneCanvas=T5;class k5 extends xr{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new Ic.HitContext(this),this.setSize(t.width,t.height)}}$t.HitCanvas=k5;var Er={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.DD=void 0;const t=Y,e=gt;i.DD={get isDragging(){var n=!1;return i.DD._dragElements.forEach(r=>{r.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){var n;return i.DD._dragElements.forEach(r=>{n=r.node}),n},_dragElements:new Map,_drag(n){const r=[];i.DD._dragElements.forEach((s,a)=>{const{node:o}=s,h=o.getStage();h.setPointersPositions(n),s.pointerId===void 0&&(s.pointerId=e.Util._getFirstPointerId(n));const l=h._changedPointerPositions.find(f=>f.id===s.pointerId);if(l){if(s.dragStatus!=="dragging"){var c=o.dragDistance(),d=Math.max(Math.abs(l.x-s.startPointerPos.x),Math.abs(l.y-s.startPointerPos.y));if(d<c||(o.startDrag({evt:n}),!o.isDragging()))return}o._setDragPosition(n,s),r.push(o)}}),r.forEach(s=>{s.fire("dragmove",{type:"dragmove",target:s,evt:n},!0)})},_endDragBefore(n){const r=[];i.DD._dragElements.forEach(s=>{const{node:a}=s,o=a.getStage();if(n&&o.setPointersPositions(n),!o._changedPointerPositions.find(c=>c.id===s.pointerId))return;(s.dragStatus==="dragging"||s.dragStatus==="stopped")&&(i.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,s.dragStatus="stopped");const l=s.node.getLayer()||s.node instanceof t.Konva.Stage&&s.node;l&&r.indexOf(l)===-1&&r.push(l)}),r.forEach(s=>{s.draw()})},_endDragAfter(n){i.DD._dragElements.forEach((r,s)=>{r.dragStatus==="stopped"&&r.node.fire("dragend",{type:"dragend",target:r.node,evt:n},!0),r.dragStatus!=="dragging"&&i.DD._dragElements.delete(s)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",i.DD._endDragBefore,!0),window.addEventListener("touchend",i.DD._endDragBefore,!0),window.addEventListener("mousemove",i.DD._drag),window.addEventListener("touchmove",i.DD._drag),window.addEventListener("mouseup",i.DD._endDragAfter,!1),window.addEventListener("touchend",i.DD._endDragAfter,!1))})(Er),Object.defineProperty(dt,"__esModule",{value:!0}),dt.Node=void 0;const q=gt,En=X,Tr=$t,ti=Y,jt=Er,yt=N;var kr="absoluteOpacity",Ar="allEventListeners",me="absoluteTransform",Nc="absoluteScale",ei="canvas",A5="Change",P5="children",M5="konva",Ba="listening",Uc="mouseenter",Gc="mouseleave",Bc="set",zc="Shape",Pr=" ",Hc="stage",Oe="transform",R5="Stage",za="visible",D5=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Pr);let L5=1,V=class yo{constructor(t){this._id=L5++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===Oe||t===me)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,e){var n=this._cache.get(t),r=t===Oe||t===me,s=n===void 0||r&&n.dirty===!0;return s&&(n=e.call(this),this._cache.set(t,n)),n}_calculate(t,e,n){if(!this._attachedDepsListeners.get(t)){const r=e.map(s=>s+"Change.konva").join(Pr);this.on(r,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(ei)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===me&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ei)){const{scene:t,filter:e,hit:n}=this._cache.get(ei);q.Util.releaseCanvas(t,e,n),this._cache.delete(ei)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var e=t||{},n={};(e.x===void 0||e.y===void 0||e.width===void 0||e.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var r=Math.ceil(e.width||n.width),s=Math.ceil(e.height||n.height),a=e.pixelRatio,o=e.x===void 0?Math.floor(n.x):e.x,h=e.y===void 0?Math.floor(n.y):e.y,l=e.offset||0,c=e.drawBorder||!1,d=e.hitCanvasPixelRatio||1;if(!r||!s){q.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}r+=l*2+1,s+=l*2+1,o-=l,h-=l;var f=new Tr.SceneCanvas({pixelRatio:a,width:r,height:s}),u=new Tr.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),g=new Tr.HitCanvas({pixelRatio:d,width:r,height:s}),p=f.getContext(),_=g.getContext();return g.isCache=!0,f.isCache=!0,this._cache.delete(ei),this._filterUpToDate=!1,e.imageSmoothingEnabled===!1&&(f.getContext()._context.imageSmoothingEnabled=!1,u.getContext()._context.imageSmoothingEnabled=!1),p.save(),_.save(),p.translate(-o,-h),_.translate(-o,-h),this._isUnderCache=!0,this._clearSelfAndDescendantCache(kr),this._clearSelfAndDescendantCache(Nc),this.drawScene(f,this),this.drawHit(g,this),this._isUnderCache=!1,p.restore(),_.restore(),c&&(p.save(),p.beginPath(),p.rect(0,0,r,s),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(ei,{scene:f,filter:u,hit:g,x:o,y:h}),this._requestDraw(),this}isCached(){return this._cache.has(ei)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,e){var n=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],r=1/0,s=1/0,a=-1/0,o=-1/0,h=this.getAbsoluteTransform(e);return n.forEach(function(l){var c=h.point(l);r===void 0&&(r=a=c.x,s=o=c.y),r=Math.min(r,c.x),s=Math.min(s,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y)}),{x:r,y:s,width:a-r,height:o-s}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const e=this._getCanvasCache();t.translate(e.x,e.y);var n=this._getCachedSceneCanvas(),r=n.pixelRatio;t.drawImage(n._canvas,0,0,n.width/r,n.height/r),t.restore()}_drawCachedHitCanvas(t){var e=this._getCanvasCache(),n=e.hit;t.save(),t.translate(e.x,e.y),t.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),e=this._getCanvasCache(),n=e.scene,r=e.filter,s=r.getContext(),a,o,h,l;if(t){if(!this._filterUpToDate){var c=n.pixelRatio;r.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio);try{for(a=t.length,s.clear(),s.drawImage(n._canvas,0,0,n.getWidth()/c,n.getHeight()/c),o=s.getImageData(0,0,r.getWidth(),r.getHeight()),h=0;h<a;h++){if(l=t[h],typeof l!="function"){q.Util.error("Filter should be type of function, but got "+typeof l+" instead. Please check correct filters");continue}l.call(this,o),s.putImageData(o,0,0)}}catch(d){q.Util.error("Unable to apply filter. "+d.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return r}return n}on(t,e){if(this._cache&&this._cache.delete(Ar),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(Pr),r=n.length,s,a,o,h,l;for(s=0;s<r;s++)a=n[s],o=a.split("."),h=o[0],l=o[1]||"",this.eventListeners[h]||(this.eventListeners[h]=[]),this.eventListeners[h].push({name:l,handler:e});return this}off(t,e){var n=(t||"").split(Pr),r=n.length,s,a,o,h,l,c;if(this._cache&&this._cache.delete(Ar),!t)for(a in this.eventListeners)this._off(a);for(s=0;s<r;s++)if(o=n[s],h=o.split("."),l=h[0],c=h[1],l)this.eventListeners[l]&&this._off(l,c,e);else for(a in this.eventListeners)this._off(a,c,e);return this}dispatchEvent(t){var e={target:this,type:t.type,evt:t};return this.fire(t.type,e),this}addEventListener(t,e){return this.on(t,function(n){e.call(this,n.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,e,n){var r=this;this.on(t,function(s){for(var a=s.target.findAncestors(e,!0,r),o=0;o<a.length;o++)s=q.Util.cloneObject(s),s.currentTarget=a[o],n.call(a[o],s)})}remove(){return this.isDragging()&&this.stopDrag(),jt.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(me),this._clearSelfAndDescendantCache(kr),this._clearSelfAndDescendantCache(Nc),this._clearSelfAndDescendantCache(Hc),this._clearSelfAndDescendantCache(za),this._clearSelfAndDescendantCache(Ba)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var e="get"+q.Util._capitalize(t);return q.Util._isFunction(this[e])?this[e]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),e=[];t;)e.push(t),t=t.getParent();return e}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var e,n;if(!t)return this;for(e in t)e!==P5&&(n=Bc+q.Util._capitalize(e),q.Util._isFunction(this[n])?this[n](t[e]):this._setAttr(e,t[e]))}),this}isListening(){return this._getCache(Ba,this._isListening)}_isListening(t){if(!this.listening())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isListening(t):!0}isVisible(){return this._getCache(za,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isVisible(t):!0}shouldDrawHit(t,e=!1){if(t)return this._isVisible(t)&&this._isListening(t);var n=this.getLayer(),r=!1;jt.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===n)&&(r=!0)});var s=!e&&!ti.Konva.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!s}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),e=this,n=0,r,s,a,o;function h(c){for(r=[],s=c.length,a=0;a<s;a++)o=c[a],n++,o.nodeType!==zc&&(r=r.concat(o.getChildren().slice())),o._id===e._id&&(a=s);r.length>0&&r[0].getDepth()<=t&&h(r)}const l=this.getStage();return e.nodeType!==R5&&l&&h(l.getChildren()),n}getDepth(){for(var t=0,e=this.parent;e;)t++,e=e.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Oe),this._clearSelfAndDescendantCache(me)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;var e=t.getPointerPosition();if(!e)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(e)}getAbsolutePosition(t){let e=!1,n=this.parent;for(;n;){if(n.isCached()){e=!0;break}n=n.parent}e&&!t&&(t=!0);var r=this.getAbsoluteTransform(t).getMatrix(),s=new q.Transform,a=this.offset();return s.m=r.slice(),s.translate(a.x,a.y),s.getTranslation()}setAbsolutePosition(t){const{x:e,y:n,...r}=this._clearTransform();this.attrs.x=e,this.attrs.y=n,this._clearCache(Oe);var s=this._getAbsoluteTransform().copy();return s.invert(),s.translate(t.x,t.y),t={x:this.attrs.x+s.getTranslation().x,y:this.attrs.y+s.getTranslation().y},this._setTransform(r),this.setPosition({x:t.x,y:t.y}),this._clearCache(Oe),this._clearSelfAndDescendantCache(me),this}_setTransform(t){var e;for(e in t)this.attrs[e]=t[e]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var e=t.x,n=t.y,r=this.x(),s=this.y();return e!==void 0&&(r+=e),n!==void 0&&(s+=n),this.setPosition({x:r,y:s}),this}_eachAncestorReverse(t,e){var n=[],r=this.getParent(),s,a;if(!(e&&e._id===this._id)){for(n.unshift(this);r&&(!e||r._id!==e._id);)n.unshift(r),r=r.parent;for(s=n.length,a=0;a<s;a++)t(n[a])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return q.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,e=this.parent.getChildren().length;return t<e-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return q.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,e=this.parent.getChildren().length;return t<e-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return q.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return q.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return q.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&q.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var e=this.index;return this.parent.children.splice(e,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(kr,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),e=this.getParent();return e&&!e._isUnderCache&&(t*=e.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},e=this.getAttrs(),n,r,s,a,o;t.attrs={};for(n in e)r=e[n],o=q.Util.isObject(r)&&!q.Util._isPlainObject(r)&&!q.Util._isArray(r),!o&&(s=typeof this[n]=="function"&&this[n],delete e[n],a=s?s.call(this):null,e[n]=r,a!==r&&(t.attrs[n]=r));return t.className=this.getClassName(),q.Util._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,e,n){var r=[];e&&this._isMatch(t)&&r.push(this);for(var s=this.parent;s;){if(s===n)return r;s._isMatch(t)&&r.push(s),s=s.parent}return r}isAncestorOf(t){return!1}findAncestor(t,e,n){return this.findAncestors(t,e,n)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var e=t.replace(/ /g,"").split(","),n=e.length,r,s;for(r=0;r<n;r++)if(s=e[r],q.Util.isValidSelector(s)||(q.Util.warn('Selector "'+s+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),q.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),q.Util.warn("Konva is awesome, right?")),s.charAt(0)==="#"){if(this.id()===s.slice(1))return!0}else if(s.charAt(0)==="."){if(this.hasName(s.slice(1)))return!0}else if(this.className===s||this.nodeType===s)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(Hc,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():null}fire(t,e={},n){return e.target=e.target||this,n?this._fireAndBubble(t,e):this._fire(t,e),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(me,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var e;if(t)return e=new q.Transform,this._eachAncestorReverse(function(r){var s=r.transformsEnabled();s==="all"?e.multiply(r.getTransform()):s==="position"&&e.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},t),e;e=this._cache.get(me)||new q.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(e):e.reset();var n=this.transformsEnabled();if(n==="all")e.multiply(this.getTransform());else if(n==="position"){const r=this.attrs.x||0,s=this.attrs.y||0,a=this.attrs.offsetX||0,o=this.attrs.offsetY||0;e.translate(r-a,s-o)}return e.dirty=!1,e}getAbsoluteScale(t){for(var e=this;e;)e._isUnderCache&&(t=e),e=e.getParent();const r=this.getAbsoluteTransform(t).decompose();return{x:r.scaleX,y:r.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Oe,this._getTransform)}_getTransform(){var t,e,n=this._cache.get(Oe)||new q.Transform;n.reset();var r=this.x(),s=this.y(),a=ti.Konva.getAngle(this.rotation()),o=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,h=(e=this.attrs.scaleY)!==null&&e!==void 0?e:1,l=this.attrs.skewX||0,c=this.attrs.skewY||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;return(r!==0||s!==0)&&n.translate(r,s),a!==0&&n.rotate(a),(l!==0||c!==0)&&n.skew(l,c),(o!==1||h!==1)&&n.scale(o,h),(d!==0||f!==0)&&n.translate(-1*d,-1*f),n.dirty=!1,n}clone(t){var e=q.Util.cloneObject(this.attrs),n,r,s,a,o;for(n in t)e[n]=t[n];var h=new this.constructor(e);for(n in this.eventListeners)for(r=this.eventListeners[n],s=r.length,a=0;a<s;a++)o=r[a],o.name.indexOf(M5)<0&&(h.eventListeners[n]||(h.eventListeners[n]=[]),h.eventListeners[n].push(o));return h}_toKonvaCanvas(t){t=t||{};var e=this.getClientRect(),n=this.getStage(),r=t.x!==void 0?t.x:Math.floor(e.x),s=t.y!==void 0?t.y:Math.floor(e.y),a=t.pixelRatio||1,o=new Tr.SceneCanvas({width:t.width||Math.ceil(e.width)||(n?n.width():0),height:t.height||Math.ceil(e.height)||(n?n.height():0),pixelRatio:a}),h=o.getContext();return t.imageSmoothingEnabled===!1&&(h._context.imageSmoothingEnabled=!1),h.save(),(r||s)&&h.translate(-1*r,-1*s),this.drawScene(o),h.restore(),o}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var e=t.mimeType||null,n=t.quality||null,r=this._toKonvaCanvas(t).toDataURL(e,n);return t.callback&&t.callback(r),r}toImage(t){return new Promise((e,n)=>{try{const r=t?.callback;r&&delete t.callback,q.Util._urlToImage(this.toDataURL(t),function(s){e(s),r?.(s)})}catch(r){n(r)}})}toBlob(t){return new Promise((e,n)=>{try{const r=t?.callback;r&&delete t.callback,this.toCanvas(t).toBlob(s=>{e(s),r?.(s)})}catch(r){n(r)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():ti.Konva.dragDistance}_off(t,e,n){var r=this.eventListeners[t],s,a,o;for(s=0;s<r.length;s++)if(a=r[s].name,o=r[s].handler,(a!=="konva"||e==="konva")&&(!e||a===e)&&(!n||n===o)){if(r.splice(s,1),r.length===0){delete this.eventListeners[t];break}s--}}_fireChangeEvent(t,e,n){this._fire(t+A5,{oldVal:e,newVal:n})}addName(t){if(!this.hasName(t)){var e=this.name(),n=e?e+" "+t:t;this.name(n)}return this}hasName(t){if(!t)return!1;const e=this.name();if(!e)return!1;var n=(e||"").split(/\s/g);return n.indexOf(t)!==-1}removeName(t){var e=(this.name()||"").split(/\s/g),n=e.indexOf(t);return n!==-1&&(e.splice(n,1),this.name(e.join(" "))),this}setAttr(t,e){var n=this[Bc+q.Util._capitalize(t)];return q.Util._isFunction(n)?n.call(this,e):this._setAttr(t,e),this}_requestDraw(){if(ti.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t?.batchDraw()}}_setAttr(t,e){var n=this.attrs[t];n===e&&!q.Util.isObject(e)||(e==null?delete this.attrs[t]:this.attrs[t]=e,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,e),this._requestDraw())}_setComponentAttr(t,e,n){var r;n!==void 0&&(r=this.attrs[t],r||(this.attrs[t]=this.getAttr(t)),this.attrs[t][e]=n,this._fireChangeEvent(t,r,n))}_fireAndBubble(t,e,n){e&&this.nodeType===zc&&(e.target=this);var r=(t===Uc||t===Gc)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!r){this._fire(t,e);var s=(t===Uc||t===Gc)&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(e&&!e.cancelBubble||!e)&&this.parent&&this.parent.isListening()&&!s&&(n&&n.parent?this._fireAndBubble.call(this.parent,t,e,n):this._fireAndBubble.call(this.parent,t,e))}}_getProtoListeners(t){var e,n,r;const s=(e=this._cache.get(Ar))!==null&&e!==void 0?e:{};let a=s?.[t];if(a===void 0){a=[];let o=Object.getPrototypeOf(this);for(;o;){const h=(r=(n=o.eventListeners)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:[];a.push(...h),o=Object.getPrototypeOf(o)}s[t]=a,this._cache.set(Ar,s)}return a}_fire(t,e){e=e||{},e.currentTarget=this,e.type=t;const n=this._getProtoListeners(t);if(n)for(var r=0;r<n.length;r++)n[r].handler.call(this,e);const s=this.eventListeners[t];if(s)for(var r=0;r<s.length;r++)s[r].handler.call(this,e)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var e=t?t.pointerId:void 0,n=this.getStage(),r=this.getAbsolutePosition();if(n){var s=n._getPointerById(e)||n._changedPointerPositions[0]||r;jt.DD._dragElements.set(this._id,{node:this,startPointerPos:s,offset:{x:s.x-r.x,y:s.y-r.y},dragStatus:"ready",pointerId:e})}}startDrag(t,e=!0){jt.DD._dragElements.has(this._id)||this._createDragElement(t);const n=jt.DD._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},e)}_setDragPosition(t,e){const n=this.getStage()._getPointerById(e.pointerId);if(n){var r={x:n.x-e.offset.x,y:n.y-e.offset.y},s=this.dragBoundFunc();if(s!==void 0){const a=s.call(this,r,t);a?r=a:q.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==r.x||this._lastPos.y!==r.y)&&(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}}stopDrag(t){const e=jt.DD._dragElements.get(this._id);e&&(e.dragStatus="stopped"),jt.DD._endDragBefore(t),jt.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=jt.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var e=t.evt.button!==void 0,n=!e||ti.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var r=!1;jt.DD._dragElements.forEach(s=>{this.isAncestorOf(s.node)&&(r=!0)}),r||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const e=jt.DD._dragElements.get(this._id),n=e&&e.dragStatus==="dragging",r=e&&e.dragStatus==="ready";n?this.stopDrag():r&&jt.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const e=this.getStage();if(!e)return!1;const n={x:-t.x,y:-t.y,width:e.width()+2*t.x,height:e.height()+2*t.y};return q.Util.haveIntersection(n,this.getClientRect())}static create(t,e){return q.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,e)}static _createNode(t,e){var n=yo.prototype.getClassName.call(t),r=t.children,s,a,o;e&&(t.attrs.container=e),ti.Konva[n]||(q.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const h=ti.Konva[n];if(s=new h(t.attrs),r)for(a=r.length,o=0;o<a;o++)s.add(yo._createNode(r[o]));return s}};dt.Node=V,V.prototype.nodeType="Node",V.prototype._attrsAffectingSize=[],V.prototype.eventListeners={},V.prototype.on.call(V.prototype,D5,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Oe),this._clearSelfAndDescendantCache(me)}),V.prototype.on.call(V.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(za)}),V.prototype.on.call(V.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(Ba)}),V.prototype.on.call(V.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(kr)});const at=En.Factory.addGetterSetter;at(V,"zIndex"),at(V,"absolutePosition"),at(V,"position"),at(V,"x",0,(0,yt.getNumberValidator)()),at(V,"y",0,(0,yt.getNumberValidator)()),at(V,"globalCompositeOperation","source-over",(0,yt.getStringValidator)()),at(V,"opacity",1,(0,yt.getNumberValidator)()),at(V,"name","",(0,yt.getStringValidator)()),at(V,"id","",(0,yt.getStringValidator)()),at(V,"rotation",0,(0,yt.getNumberValidator)()),En.Factory.addComponentsGetterSetter(V,"scale",["x","y"]),at(V,"scaleX",1,(0,yt.getNumberValidator)()),at(V,"scaleY",1,(0,yt.getNumberValidator)()),En.Factory.addComponentsGetterSetter(V,"skew",["x","y"]),at(V,"skewX",0,(0,yt.getNumberValidator)()),at(V,"skewY",0,(0,yt.getNumberValidator)()),En.Factory.addComponentsGetterSetter(V,"offset",["x","y"]),at(V,"offsetX",0,(0,yt.getNumberValidator)()),at(V,"offsetY",0,(0,yt.getNumberValidator)()),at(V,"dragDistance",null,(0,yt.getNumberValidator)()),at(V,"width",0,(0,yt.getNumberValidator)()),at(V,"height",0,(0,yt.getNumberValidator)()),at(V,"listening",!0,(0,yt.getBooleanValidator)()),at(V,"preventDefault",!0,(0,yt.getBooleanValidator)()),at(V,"filters",null,function(i){return this._filterUpToDate=!1,i}),at(V,"visible",!0,(0,yt.getBooleanValidator)()),at(V,"transformsEnabled","all",(0,yt.getStringValidator)()),at(V,"size"),at(V,"dragBoundFunc"),at(V,"draggable",!1,(0,yt.getBooleanValidator)()),En.Factory.backCompat(V,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var ii={};Object.defineProperty(ii,"__esModule",{value:!0}),ii.Container=void 0;const ki=X,Ha=dt,Mr=N;class ni extends Ha.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const e=this.children||[];var n=[];return e.forEach(function(r){t(r)&&n.push(r)}),n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var e=0;e<t.length;e++)this.add(t[e]);return this}const n=t[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var e=this._generalFind(t,!0);return e.length>0?e[0]:void 0}_generalFind(t,e){var n=[];return this._descendants(r=>{const s=r._isMatch(t);return s&&n.push(r),!!(s&&e)}),n}_descendants(t){let e=!1;const n=this.getChildren();for(const r of n){if(e=t(r),e)return!0;if(r.hasChildren()&&(e=r._descendants(t),e))return!0}return!1}toObject(){var t=Ha.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(e=>{t.children.push(e.toObject())}),t}isAncestorOf(t){for(var e=t.getParent();e;){if(e._id===this._id)return!0;e=e.getParent()}return!1}clone(t){var e=Ha.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(n){e.add(n.clone())}),e}getAllIntersections(t){var e=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(t)&&e.push(n)}),e}_clearSelfAndDescendantCache(t){var e;super._clearSelfAndDescendantCache(t),!this.isCached()&&((e=this.children)===null||e===void 0||e.forEach(function(n){n._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(e,n){e.index=n}),this._requestDraw()}drawScene(t,e){var n=this.getLayer(),r=t||n&&n.getCanvas(),s=r&&r.getContext(),a=this._getCanvasCache(),o=a&&a.scene,h=r&&r.isCache;if(!this.isVisible()&&!h)return this;if(o){s.save();var l=this.getAbsoluteTransform(e).getMatrix();s.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(s),s.restore()}else this._drawChildren("drawScene",r,e);return this}drawHit(t,e){if(!this.shouldDrawHit(e))return this;var n=this.getLayer(),r=t||n&&n.hitCanvas,s=r&&r.getContext(),a=this._getCanvasCache(),o=a&&a.hit;if(o){s.save();var h=this.getAbsoluteTransform(e).getMatrix();s.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedHitCanvas(s),s.restore()}else this._drawChildren("drawHit",r,e);return this}_drawChildren(t,e,n){var r,s=e&&e.getContext(),a=this.clipWidth(),o=this.clipHeight(),h=this.clipFunc(),l=a&&o||h;const c=n===this;if(l){s.save();var d=this.getAbsoluteTransform(n),f=d.getMatrix();s.transform(f[0],f[1],f[2],f[3],f[4],f[5]),s.beginPath();let _;if(h)_=h.call(this,s,this);else{var u=this.clipX(),g=this.clipY();s.rect(u,g,a,o)}s.clip.apply(s,_),f=d.copy().invert().getMatrix(),s.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var p=!c&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";p&&(s.save(),s._applyGlobalCompositeOperation(this)),(r=this.children)===null||r===void 0||r.forEach(function(_){_[t](e,n)}),p&&s.restore(),l&&s.restore()}getClientRect(t={}){var e,n=t.skipTransform,r=t.relativeTo,s,a,o,h,l={x:1/0,y:1/0,width:0,height:0},c=this;(e=this.children)===null||e===void 0||e.forEach(function(p){if(p.visible()){var _=p.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});_.width===0&&_.height===0||(s===void 0?(s=_.x,a=_.y,o=_.x+_.width,h=_.y+_.height):(s=Math.min(s,_.x),a=Math.min(a,_.y),o=Math.max(o,_.x+_.width),h=Math.max(h,_.y+_.height)))}});for(var d=this.find("Shape"),f=!1,u=0;u<d.length;u++){var g=d[u];if(g._isVisible(this)){f=!0;break}}return f&&s!==void 0?l={x:s,y:a,width:o-s,height:h-a}:l={x:0,y:0,width:0,height:0},n?l:this._transformedRect(l,r)}}ii.Container=ni,ki.Factory.addComponentsGetterSetter(ni,"clip",["x","y","width","height"]),ki.Factory.addGetterSetter(ni,"clipX",void 0,(0,Mr.getNumberValidator)()),ki.Factory.addGetterSetter(ni,"clipY",void 0,(0,Mr.getNumberValidator)()),ki.Factory.addGetterSetter(ni,"clipWidth",void 0,(0,Mr.getNumberValidator)()),ki.Factory.addGetterSetter(ni,"clipHeight",void 0,(0,Mr.getNumberValidator)()),ki.Factory.addGetterSetter(ni,"clipFunc");var jc={},Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.releaseCapture=Ft.setPointerCapture=Ft.hasPointerCapture=Ft.createEvent=Ft.getCapturedShape=void 0;const O5=Y,Tn=new Map,Vc=O5.Konva._global.PointerEvent!==void 0;function I5(i){return Tn.get(i)}Ft.getCapturedShape=I5;function ja(i){return{evt:i,pointerId:i.pointerId}}Ft.createEvent=ja;function F5(i,t){return Tn.get(i)===t}Ft.hasPointerCapture=F5;function N5(i,t){$c(i),t.getStage()&&(Tn.set(i,t),Vc&&t._fire("gotpointercapture",ja(new PointerEvent("gotpointercapture"))))}Ft.setPointerCapture=N5;function $c(i,t){const e=Tn.get(i);if(!e)return;const n=e.getStage();n&&n.content,Tn.delete(i),Vc&&e._fire("lostpointercapture",ja(new PointerEvent("lostpointercapture")))}Ft.releaseCapture=$c,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.Stage=i.stages=void 0;const t=gt,e=X,n=ii,r=Y,s=$t,a=Er,o=Y,h=Ft;var l="Stage",c="string",d="px",f="mouseout",u="mouseleave",g="mouseover",p="mouseenter",_="mousemove",y="mousedown",b="mouseup",m="pointermove",v="pointerdown",w="pointerup",S="pointercancel",T="lostpointercapture",C="pointerout",k="pointerleave",x="pointerover",E="pointerenter",M="contextmenu",D="touchstart",O="touchend",I="touchmove",H="touchcancel",j="wheel",$=5,et=[[p,"_pointerenter"],[y,"_pointerdown"],[_,"_pointermove"],[b,"_pointerup"],[u,"_pointerleave"],[D,"_pointerdown"],[I,"_pointermove"],[O,"_pointerup"],[H,"_pointercancel"],[g,"_pointerover"],[j,"_wheel"],[M,"_contextmenu"],[v,"_pointerdown"],[m,"_pointermove"],[w,"_pointerup"],[S,"_pointercancel"],[T,"_lostpointercapture"]];const G={mouse:{[C]:f,[k]:u,[x]:g,[E]:p,[m]:_,[v]:y,[w]:b,[S]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[C]:"touchout",[k]:"touchleave",[x]:"touchover",[E]:"touchenter",[m]:I,[v]:D,[w]:O,[S]:H,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[C]:C,[k]:k,[x]:x,[E]:E,[m]:m,[v]:v,[w]:w,[S]:S,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},z=Nt=>Nt.indexOf("pointer")>=0?"pointer":Nt.indexOf("touch")>=0?"touch":"mouse",W=Nt=>{const P=z(Nt);if(P==="pointer")return r.Konva.pointerEventsEnabled&&G.pointer;if(P==="touch")return G.touch;if(P==="mouse")return G.mouse};function J(Nt={}){return(Nt.clipFunc||Nt.clipWidth||Nt.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Nt}const lt="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";i.stages=[];class we extends n.Container{constructor(P){super(J(P)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),i.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{J(this.attrs)}),this._checkVisibility()}_validateAdd(P){const F=P.getType()==="Layer",B=P.getType()==="FastLayer";F||B||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const P=this.visible()?"":"none";this.content.style.display=P}setContainer(P){if(typeof P===c){if(P.charAt(0)==="."){var F=P.slice(1);P=document.getElementsByClassName(F)[0]}else{var B;P.charAt(0)!=="#"?B=P:B=P.slice(1),P=document.getElementById(B)}if(!P)throw"Can not find container in document with id "+B}return this._setAttr("container",P),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),P.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var P=this.children,F=P.length,B;for(B=0;B<F;B++)P[B].clear();return this}clone(P){return P||(P={}),P.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,P)}destroy(){super.destroy();var P=this.content;P&&t.Util._isInDocument(P)&&this.container().removeChild(P);var F=i.stages.indexOf(this);return F>-1&&i.stages.splice(F,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const P=this._pointerPositions[0]||this._changedPointerPositions[0];return P?{x:P.x,y:P.y}:(t.Util.warn(lt),null)}_getPointerById(P){return this._pointerPositions.find(F=>F.id===P)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(P){P=P||{},P.x=P.x||0,P.y=P.y||0,P.width=P.width||this.width(),P.height=P.height||this.height();var F=new s.SceneCanvas({width:P.width,height:P.height,pixelRatio:P.pixelRatio||1}),B=F.getContext()._context,ft=this.children;return(P.x||P.y)&&B.translate(-1*P.x,-1*P.y),ft.forEach(function(st){if(st.isVisible()){var bt=st._toKonvaCanvas(P);B.drawImage(bt._canvas,P.x,P.y,bt.getWidth()/bt.getPixelRatio(),bt.getHeight()/bt.getPixelRatio())}}),F}getIntersection(P){if(!P)return null;var F=this.children,B=F.length,ft=B-1,st;for(st=ft;st>=0;st--){const bt=F[st].getIntersection(P);if(bt)return bt}return null}_resizeDOM(){var P=this.width(),F=this.height();this.content&&(this.content.style.width=P+d,this.content.style.height=F+d),this.bufferCanvas.setSize(P,F),this.bufferHitCanvas.setSize(P,F),this.children.forEach(B=>{B.setSize({width:P,height:F}),B.draw()})}add(P,...F){if(arguments.length>1){for(var B=0;B<arguments.length;B++)this.add(arguments[B]);return this}super.add(P);var ft=this.children.length;return ft>$&&t.Util.warn("The stage has "+ft+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),P.setSize({width:this.width(),height:this.height()}),P.draw(),r.Konva.isBrowser&&this.content.appendChild(P.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(P){return h.hasPointerCapture(P,this)}setPointerCapture(P){h.setPointerCapture(P,this)}releaseCapture(P){h.releaseCapture(P,this)}getLayers(){return this.children}_bindContentEvents(){r.Konva.isBrowser&&et.forEach(([P,F])=>{this.content.addEventListener(P,B=>{this[F](B)},{passive:!1})})}_pointerenter(P){this.setPointersPositions(P);const F=W(P.type);F&&this._fire(F.pointerenter,{evt:P,target:this,currentTarget:this})}_pointerover(P){this.setPointersPositions(P);const F=W(P.type);F&&this._fire(F.pointerover,{evt:P,target:this,currentTarget:this})}_getTargetShape(P){let F=this[P+"targetShape"];return F&&!F.getStage()&&(F=null),F}_pointerleave(P){const F=W(P.type),B=z(P.type);if(F){this.setPointersPositions(P);var ft=this._getTargetShape(B),st=!a.DD.isDragging||r.Konva.hitOnDragEnabled;ft&&st?(ft._fireAndBubble(F.pointerout,{evt:P}),ft._fireAndBubble(F.pointerleave,{evt:P}),this._fire(F.pointerleave,{evt:P,target:this,currentTarget:this}),this[B+"targetShape"]=null):st&&(this._fire(F.pointerleave,{evt:P,target:this,currentTarget:this}),this._fire(F.pointerout,{evt:P,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(P){const F=W(P.type),B=z(P.type);if(F){this.setPointersPositions(P);var ft=!1;this._changedPointerPositions.forEach(st=>{var bt=this.getIntersection(st);if(a.DD.justDragged=!1,r.Konva["_"+B+"ListenClick"]=!0,!bt||!bt.isListening())return;r.Konva.capturePointerEventsEnabled&&bt.setPointerCapture(st.id),this[B+"ClickStartShape"]=bt,bt._fireAndBubble(F.pointerdown,{evt:P,pointerId:st.id}),ft=!0;const Vt=P.type.indexOf("touch")>=0;bt.preventDefault()&&P.cancelable&&Vt&&P.preventDefault()}),ft||this._fire(F.pointerdown,{evt:P,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(P){const F=W(P.type),B=z(P.type);if(!F)return;a.DD.isDragging&&a.DD.node.preventDefault()&&P.cancelable&&P.preventDefault(),this.setPointersPositions(P);var ft=!a.DD.isDragging||r.Konva.hitOnDragEnabled;if(!ft)return;var st={};let bt=!1;var Vt=this._getTargetShape(B);this._changedPointerPositions.forEach(je=>{const ht=h.getCapturedShape(je.id)||this.getIntersection(je),zi=je.id,Se={evt:P,pointerId:zi};var Hi=Vt!==ht;if(Hi&&Vt&&(Vt._fireAndBubble(F.pointerout,{...Se},ht),Vt._fireAndBubble(F.pointerleave,{...Se},ht)),ht){if(st[ht._id])return;st[ht._id]=!0}ht&&ht.isListening()?(bt=!0,Hi&&(ht._fireAndBubble(F.pointerover,{...Se},Vt),ht._fireAndBubble(F.pointerenter,{...Se},Vt),this[B+"targetShape"]=ht),ht._fireAndBubble(F.pointermove,{...Se})):Vt&&(this._fire(F.pointerover,{evt:P,target:this,currentTarget:this,pointerId:zi}),this[B+"targetShape"]=null)}),bt||this._fire(F.pointermove,{evt:P,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(P){const F=W(P.type),B=z(P.type);if(!F)return;this.setPointersPositions(P);const ft=this[B+"ClickStartShape"],st=this[B+"ClickEndShape"];var bt={};let Vt=!1;this._changedPointerPositions.forEach(je=>{const ht=h.getCapturedShape(je.id)||this.getIntersection(je);if(ht){if(ht.releaseCapture(je.id),bt[ht._id])return;bt[ht._id]=!0}const zi=je.id,Se={evt:P,pointerId:zi};let Hi=!1;r.Konva["_"+B+"InDblClickWindow"]?(Hi=!0,clearTimeout(this[B+"DblTimeout"])):a.DD.justDragged||(r.Konva["_"+B+"InDblClickWindow"]=!0,clearTimeout(this[B+"DblTimeout"])),this[B+"DblTimeout"]=setTimeout(function(){r.Konva["_"+B+"InDblClickWindow"]=!1},r.Konva.dblClickWindow),ht&&ht.isListening()?(Vt=!0,this[B+"ClickEndShape"]=ht,ht._fireAndBubble(F.pointerup,{...Se}),r.Konva["_"+B+"ListenClick"]&&ft&&ft===ht&&(ht._fireAndBubble(F.pointerclick,{...Se}),Hi&&st&&st===ht&&ht._fireAndBubble(F.pointerdblclick,{...Se}))):(this[B+"ClickEndShape"]=null,r.Konva["_"+B+"ListenClick"]&&this._fire(F.pointerclick,{evt:P,target:this,currentTarget:this,pointerId:zi}),Hi&&this._fire(F.pointerdblclick,{evt:P,target:this,currentTarget:this,pointerId:zi}))}),Vt||this._fire(F.pointerup,{evt:P,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),r.Konva["_"+B+"ListenClick"]=!1,P.cancelable&&B!=="touch"&&P.preventDefault()}_contextmenu(P){this.setPointersPositions(P);var F=this.getIntersection(this.getPointerPosition());F&&F.isListening()?F._fireAndBubble(M,{evt:P}):this._fire(M,{evt:P,target:this,currentTarget:this})}_wheel(P){this.setPointersPositions(P);var F=this.getIntersection(this.getPointerPosition());F&&F.isListening()?F._fireAndBubble(j,{evt:P}):this._fire(j,{evt:P,target:this,currentTarget:this})}_pointercancel(P){this.setPointersPositions(P);const F=h.getCapturedShape(P.pointerId)||this.getIntersection(this.getPointerPosition());F&&F._fireAndBubble(w,h.createEvent(P)),h.releaseCapture(P.pointerId)}_lostpointercapture(P){h.releaseCapture(P.pointerId)}setPointersPositions(P){var F=this._getContentPosition(),B=null,ft=null;P=P||window.event,P.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(P.touches,st=>{this._pointerPositions.push({id:st.identifier,x:(st.clientX-F.left)/F.scaleX,y:(st.clientY-F.top)/F.scaleY})}),Array.prototype.forEach.call(P.changedTouches||P.touches,st=>{this._changedPointerPositions.push({id:st.identifier,x:(st.clientX-F.left)/F.scaleX,y:(st.clientY-F.top)/F.scaleY})})):(B=(P.clientX-F.left)/F.scaleX,ft=(P.clientY-F.top)/F.scaleY,this.pointerPos={x:B,y:ft},this._pointerPositions=[{x:B,y:ft,id:t.Util._getFirstPointerId(P)}],this._changedPointerPositions=[{x:B,y:ft,id:t.Util._getFirstPointerId(P)}])}_setPointerPosition(P){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(P)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var P=this.content.getBoundingClientRect();return{top:P.top,left:P.left,scaleX:P.width/this.content.clientWidth||1,scaleY:P.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new s.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new s.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!r.Konva.isBrowser){var P=this.container();if(!P)throw"Stage has no container. A container is required.";P.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),P.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(P){P.batchDraw()}),this}}i.Stage=we,we.prototype.nodeType=l,(0,o._registerNode)(we),e.Factory.addGetterSetter(we,"container")}(jc);var kn={},St={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.Shape=i.shapes=void 0;const t=Y,e=gt,n=X,r=dt,s=N,a=Y,o=Ft;var h="hasShadow",l="shadowRGBA",c="patternImage",d="linearGradient",f="radialGradient";let u;function g(){return u||(u=e.Util.createCanvasElement().getContext("2d"),u)}i.shapes={};function p(k){const x=this.attrs.fillRule;x?k.fill(x):k.fill()}function _(k){k.stroke()}function y(k){k.fill()}function b(k){k.stroke()}function m(){this._clearCache(h)}function v(){this._clearCache(l)}function w(){this._clearCache(c)}function S(){this._clearCache(d)}function T(){this._clearCache(f)}class C extends r.Node{constructor(x){super(x);let E;for(;E=e.Util.getRandomColor(),!(E&&!(E in i.shapes)););this.colorKey=E,i.shapes[E]=this}getContext(){return e.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return e.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(h,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(c,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var x=g();const E=x.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(E&&E.setTransform){const M=new e.Transform;M.translate(this.fillPatternX(),this.fillPatternY()),M.rotate(t.Konva.getAngle(this.fillPatternRotation())),M.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),M.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const D=M.getMatrix(),O=typeof DOMMatrix>"u"?{a:D[0],b:D[1],c:D[2],d:D[3],e:D[4],f:D[5]}:new DOMMatrix(D);E.setTransform(O)}return E}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var x=this.fillLinearGradientColorStops();if(x){for(var E=g(),M=this.fillLinearGradientStartPoint(),D=this.fillLinearGradientEndPoint(),O=E.createLinearGradient(M.x,M.y,D.x,D.y),I=0;I<x.length;I+=2)O.addColorStop(x[I],x[I+1]);return O}}_getRadialGradient(){return this._getCache(f,this.__getRadialGradient)}__getRadialGradient(){var x=this.fillRadialGradientColorStops();if(x){for(var E=g(),M=this.fillRadialGradientStartPoint(),D=this.fillRadialGradientEndPoint(),O=E.createRadialGradient(M.x,M.y,this.fillRadialGradientStartRadius(),D.x,D.y,this.fillRadialGradientEndRadius()),I=0;I<x.length;I+=2)O.addColorStop(x[I],x[I+1]);return O}}getShadowRGBA(){return this._getCache(l,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var x=e.Util.colorToRGBA(this.shadowColor());if(x)return"rgba("+x.r+","+x.g+","+x.b+","+x.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const x=this.hitStrokeWidth();return x==="auto"?this.hasStroke():this.strokeEnabled()&&!!x}intersects(x){var E=this.getStage();if(!E)return!1;const M=E.bufferHitCanvas;return M.getContext().clear(),this.drawHit(M,void 0,!0),M.context.getImageData(Math.round(x.x),Math.round(x.y),1,1).data[3]>0}destroy(){return r.Node.prototype.destroy.call(this),delete i.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(x){var E;if(!this.getStage()||!((E=this.attrs.perfectDrawEnabled)!==null&&E!==void 0?E:!0))return!1;const D=x||this.hasFill(),O=this.hasStroke(),I=this.getAbsoluteOpacity()!==1;if(D&&O&&I)return!0;const H=this.hasShadow(),j=this.shadowForStrokeEnabled();return!!(D&&O&&H&&j)}setStrokeHitEnabled(x){e.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),x?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var x=this.size();return{x:this._centroid?-x.width/2:0,y:this._centroid?-x.height/2:0,width:x.width,height:x.height}}getClientRect(x={}){const E=x.skipTransform,M=x.relativeTo,D=this.getSelfRect(),I=!x.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,H=D.width+I,j=D.height+I,$=!x.skipShadow&&this.hasShadow(),et=$?this.shadowOffsetX():0,G=$?this.shadowOffsetY():0,z=H+Math.abs(et),W=j+Math.abs(G),J=$&&this.shadowBlur()||0,lt=z+J*2,we=W+J*2,Nt={width:lt,height:we,x:-(I/2+J)+Math.min(et,0)+D.x,y:-(I/2+J)+Math.min(G,0)+D.y};return E?Nt:this._transformedRect(Nt,M)}drawScene(x,E){var M=this.getLayer(),D=x||M.getCanvas(),O=D.getContext(),I=this._getCanvasCache(),H=this.getSceneFunc(),j=this.hasShadow(),$,et,G,z=D.isCache,W=E===this;if(!this.isVisible()&&!W)return this;if(I){O.save();var J=this.getAbsoluteTransform(E).getMatrix();return O.transform(J[0],J[1],J[2],J[3],J[4],J[5]),this._drawCachedSceneCanvas(O),O.restore(),this}if(!H)return this;if(O.save(),this._useBufferCanvas()&&!z){$=this.getStage(),et=$.bufferCanvas,G=et.getContext(),G.clear(),G.save(),G._applyLineJoin(this);var lt=this.getAbsoluteTransform(E).getMatrix();G.transform(lt[0],lt[1],lt[2],lt[3],lt[4],lt[5]),H.call(this,G,this),G.restore();var we=et.pixelRatio;j&&O._applyShadow(this),O._applyOpacity(this),O._applyGlobalCompositeOperation(this),O.drawImage(et._canvas,0,0,et.width/we,et.height/we)}else{if(O._applyLineJoin(this),!W){var lt=this.getAbsoluteTransform(E).getMatrix();O.transform(lt[0],lt[1],lt[2],lt[3],lt[4],lt[5]),O._applyOpacity(this),O._applyGlobalCompositeOperation(this)}j&&O._applyShadow(this),H.call(this,O,this)}return O.restore(),this}drawHit(x,E,M=!1){if(!this.shouldDrawHit(E,M))return this;var D=this.getLayer(),O=x||D.hitCanvas,I=O&&O.getContext(),H=this.hitFunc()||this.sceneFunc(),j=this._getCanvasCache(),$=j&&j.hit;if(this.colorKey||e.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),$){I.save();var et=this.getAbsoluteTransform(E).getMatrix();return I.transform(et[0],et[1],et[2],et[3],et[4],et[5]),this._drawCachedHitCanvas(I),I.restore(),this}if(!H)return this;if(I.save(),I._applyLineJoin(this),!(this===E)){var z=this.getAbsoluteTransform(E).getMatrix();I.transform(z[0],z[1],z[2],z[3],z[4],z[5])}return H.call(this,I,this),I.restore(),this}drawHitFromCache(x=0){var E=this._getCanvasCache(),M=this._getCachedSceneCanvas(),D=E.hit,O=D.getContext(),I=D.getWidth(),H=D.getHeight(),j,$,et,G,z,W;O.clear(),O.drawImage(M._canvas,0,0,I,H);try{for(j=O.getImageData(0,0,I,H),$=j.data,et=$.length,G=e.Util._hexToRgb(this.colorKey),z=0;z<et;z+=4)W=$[z+3],W>x?($[z]=G.r,$[z+1]=G.g,$[z+2]=G.b,$[z+3]=255):$[z+3]=0;O.putImageData(j,0,0)}catch(J){e.Util.error("Unable to draw hit graph from cached scene canvas. "+J.message)}return this}hasPointerCapture(x){return o.hasPointerCapture(x,this)}setPointerCapture(x){o.setPointerCapture(x,this)}releaseCapture(x){o.releaseCapture(x,this)}}i.Shape=C,C.prototype._fillFunc=p,C.prototype._strokeFunc=_,C.prototype._fillFuncHit=y,C.prototype._strokeFuncHit=b,C.prototype._centroid=!1,C.prototype.nodeType="Shape",(0,a._registerNode)(C),C.prototype.eventListeners={},C.prototype.on.call(C.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m),C.prototype.on.call(C.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",w),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",S),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",T),n.Factory.addGetterSetter(C,"stroke",void 0,(0,s.getStringOrGradientValidator)()),n.Factory.addGetterSetter(C,"strokeWidth",2,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(C,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(C,"hitStrokeWidth","auto",(0,s.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(C,"strokeHitEnabled",!0,(0,s.getBooleanValidator)()),n.Factory.addGetterSetter(C,"perfectDrawEnabled",!0,(0,s.getBooleanValidator)()),n.Factory.addGetterSetter(C,"shadowForStrokeEnabled",!0,(0,s.getBooleanValidator)()),n.Factory.addGetterSetter(C,"lineJoin"),n.Factory.addGetterSetter(C,"lineCap"),n.Factory.addGetterSetter(C,"sceneFunc"),n.Factory.addGetterSetter(C,"hitFunc"),n.Factory.addGetterSetter(C,"dash"),n.Factory.addGetterSetter(C,"dashOffset",0,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(C,"shadowColor",void 0,(0,s.getStringValidator)()),n.Factory.addGetterSetter(C,"shadowBlur",0,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(C,"shadowOpacity",1,(0,s.getNumberValidator)()),n.Factory.addComponentsGetterSetter(C,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(C,"shadowOffsetX",0,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(C,"shadowOffsetY",0,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(C,"fillPatternImage"),n.Factory.addGetterSetter(C,"fill",void 0,(0,s.getStringOrGradientValidator)()),n.Factory.addGetterSetter(C,"fillPatternX",0,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(C,"fillPatternY",0,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(C,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(C,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(C,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(C,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(C,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(C,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(C,"fillEnabled",!0),n.Factory.addGetterSetter(C,"strokeEnabled",!0),n.Factory.addGetterSetter(C,"shadowEnabled",!0),n.Factory.addGetterSetter(C,"dashEnabled",!0),n.Factory.addGetterSetter(C,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(C,"fillPriority","color"),n.Factory.addComponentsGetterSetter(C,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(C,"fillPatternOffsetX",0,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(C,"fillPatternOffsetY",0,(0,s.getNumberValidator)()),n.Factory.addComponentsGetterSetter(C,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(C,"fillPatternScaleX",1,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(C,"fillPatternScaleY",1,(0,s.getNumberValidator)()),n.Factory.addComponentsGetterSetter(C,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(C,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(C,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(C,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(C,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(C,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(C,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(C,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(C,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(C,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(C,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(C,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(C,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(C,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(C,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(C,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(C,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(C,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(C,"fillPatternRotation",0),n.Factory.addGetterSetter(C,"fillRule",void 0,(0,s.getStringValidator)()),n.Factory.backCompat(C,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(St),Object.defineProperty(kn,"__esModule",{value:!0}),kn.Layer=void 0;const _e=gt,Va=ii,Ai=dt,$a=X,Xc=$t,U5=N,G5=St,B5=Y;var z5="#",H5="beforeDraw",j5="draw",Yc=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],V5=Yc.length;class Pi extends Va.Container{constructor(t){super(t),this.canvas=new Xc.SceneCanvas,this.hitCanvas=new Xc.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),t<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[t+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Ai.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=Ai.Node.prototype.moveUp.call(this);if(!t)return!1;var e=this.getStage();return!e||!e.content?!1:(e.content.removeChild(this.getNativeCanvasElement()),this.index<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[this.index+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Ai.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var e=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),e[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Ai.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var e=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),e[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return Ai.Node.prototype.remove.call(this),t&&t.parentNode&&_e.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:e}){return this.canvas.setSize(t,e),this.hitCanvas.setSize(t,e),this._setSmoothEnabled(),this}_validateAdd(t){var e=t.getType();e!=="Group"&&e!=="Shape"&&_e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),Ai.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){_e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){_e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,_e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var e=1,n=!1;;){for(let r=0;r<V5;r++){const s=Yc[r],a=this._getIntersection({x:t.x+s.x*e,y:t.y+s.y*e}),o=a.shape;if(o)return o;if(n=!!a.antialiased,!a.antialiased)break}if(n)e+=1;else return null}}_getIntersection(t){const e=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(t.x*e),Math.round(t.y*e),1,1).data,r=n[3];if(r===255){const s=_e.Util._rgbToHex(n[0],n[1],n[2]),a=G5.shapes[z5+s];return a?{shape:a}:{antialiased:!0}}else if(r>0)return{antialiased:!0};return{}}drawScene(t,e){var n=this.getLayer(),r=t||n&&n.getCanvas();return this._fire(H5,{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),Va.Container.prototype.drawScene.call(this,r,e),this._fire(j5,{node:this}),this}drawHit(t,e){var n=this.getLayer(),r=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),Va.Container.prototype.drawHit.call(this,r,e),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){_e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return _e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,e=!!this.hitCanvas._canvas.parentNode;e?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return _e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}kn.Layer=Pi,Pi.prototype.nodeType="Layer",(0,B5._registerNode)(Pi),$a.Factory.addGetterSetter(Pi,"imageSmoothingEnabled",!0),$a.Factory.addGetterSetter(Pi,"clearBeforeDraw",!0),$a.Factory.addGetterSetter(Pi,"hitGraphEnabled",!0,(0,U5.getBooleanValidator)());var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.FastLayer=void 0;const $5=gt,X5=kn,Y5=Y;class Xa extends X5.Layer{constructor(t){super(t),this.listening(!1),$5.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Rr.FastLayer=Xa,Xa.prototype.nodeType="FastLayer",(0,Y5._registerNode)(Xa);var Mi={};Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.Group=void 0;const W5=gt,q5=ii,K5=Y;class Ya extends q5.Container{_validateAdd(t){var e=t.getType();e!=="Group"&&e!=="Shape"&&W5.Util.throw("You may only add groups and shapes to groups.")}}Mi.Group=Ya,Ya.prototype.nodeType="Group",(0,K5._registerNode)(Ya);var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.Animation=void 0;const Wa=Y,Wc=gt,qa=function(){return Wa.glob.performance&&Wa.glob.performance.now?function(){return Wa.glob.performance.now()}:function(){return new Date().getTime()}}();class te{constructor(t,e){this.id=te.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:qa(),frameRate:0},this.func=t,this.setLayers(e)}setLayers(t){let e=[];return t&&(e=Array.isArray(t)?t:[t]),this.layers=e,this}getLayers(){return this.layers}addLayer(t){const e=this.layers,n=e.length;for(let r=0;r<n;r++)if(e[r]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const e=te.animations,n=e.length;for(let r=0;r<n;r++)if(e[r].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=qa(),te._addAnimation(this),this}stop(){return te._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const e=t.id,n=this.animations,r=n.length;for(let s=0;s<r;s++)if(n[s].id===e){this.animations.splice(s,1);break}}static _runFrames(){const t={},e=this.animations;for(let n=0;n<e.length;n++){const r=e[n],s=r.layers,a=r.func;r._updateFrameObject(qa());const o=s.length;let h;if(a?h=a.call(r,r.frame)!==!1:h=!0,!!h)for(let l=0;l<o;l++){const c=s[l];c._id!==void 0&&(t[c._id]=c)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=te;t.animations.length?(t._runFrames(),Wc.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Wc.Util.requestAnimFrame(this._animationLoop))}}Ri.Animation=te,te.animations=[],te.animIdCounter=0,te.animRunning=!1;var qc={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.Easings=i.Tween=void 0;const t=gt,e=Ri,n=dt,r=Y;var s={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,o=2,h=3,l=0,c=["fill","stroke","shadowColor"];class d{constructor(g,p,_,y,b,m,v){this.prop=g,this.propFunc=p,this.begin=y,this._pos=y,this.duration=m,this._change=0,this.prevPos=0,this.yoyo=v,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=b-this.begin,this.pause()}fire(g){var p=this[g];p&&p()}setTime(g){g>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():g<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=g,this.update())}getTime(){return this._time}setPosition(g){this.prevPos=this._pos,this.propFunc(g),this._pos=g}getPosition(g){return g===void 0&&(g=this._time),this.func(g,this.begin,this._change,this.duration)}play(){this.state=o,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=h,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(g){this.pause(),this._time=g,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var g=this.getTimer()-this._startTime;this.state===o?this.setTime(g):this.state===h&&this.setTime(this.duration-g)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class f{constructor(g){var p=this,_=g.node,y=_._id,b,m=g.easing||i.Easings.Linear,v=!!g.yoyo,w;typeof g.duration>"u"?b=.3:g.duration===0?b=.001:b=g.duration,this.node=_,this._id=l++;var S=_.getLayer()||(_ instanceof r.Konva.Stage?_.getLayers():null);S||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new e.Animation(function(){p.tween.onEnterFrame()},S),this.tween=new d(w,function(T){p._tweenFunc(T)},m,0,1,b*1e3,v),this._addListeners(),f.attrs[y]||(f.attrs[y]={}),f.attrs[y][this._id]||(f.attrs[y][this._id]={}),f.tweens[y]||(f.tweens[y]={});for(w in g)s[w]===void 0&&this._addAttr(w,g[w]);this.reset(),this.onFinish=g.onFinish,this.onReset=g.onReset,this.onUpdate=g.onUpdate}_addAttr(g,p){var _=this.node,y=_._id,b,m,v,w,S,T,C,k;if(v=f.tweens[y][g],v&&delete f.attrs[y][v][g],b=_.getAttr(g),t.Util._isArray(p))if(m=[],S=Math.max(p.length,b.length),g==="points"&&p.length!==b.length&&(p.length>b.length?(C=b,b=t.Util._prepareArrayForTween(b,p,_.closed())):(T=p,p=t.Util._prepareArrayForTween(p,b,_.closed()))),g.indexOf("fill")===0)for(w=0;w<S;w++)if(w%2===0)m.push(p[w]-b[w]);else{var x=t.Util.colorToRGBA(b[w]);k=t.Util.colorToRGBA(p[w]),b[w]=x,m.push({r:k.r-x.r,g:k.g-x.g,b:k.b-x.b,a:k.a-x.a})}else for(w=0;w<S;w++)m.push(p[w]-b[w]);else c.indexOf(g)!==-1?(b=t.Util.colorToRGBA(b),k=t.Util.colorToRGBA(p),m={r:k.r-b.r,g:k.g-b.g,b:k.b-b.b,a:k.a-b.a}):m=p-b;f.attrs[y][this._id][g]={start:b,diff:m,end:p,trueEnd:T,trueStart:C},f.tweens[y][g]=this._id}_tweenFunc(g){var p=this.node,_=f.attrs[p._id][this._id],y,b,m,v,w,S,T,C;for(y in _){if(b=_[y],m=b.start,v=b.diff,C=b.end,t.Util._isArray(m))if(w=[],T=Math.max(m.length,C.length),y.indexOf("fill")===0)for(S=0;S<T;S++)S%2===0?w.push((m[S]||0)+v[S]*g):w.push("rgba("+Math.round(m[S].r+v[S].r*g)+","+Math.round(m[S].g+v[S].g*g)+","+Math.round(m[S].b+v[S].b*g)+","+(m[S].a+v[S].a*g)+")");else for(S=0;S<T;S++)w.push((m[S]||0)+v[S]*g);else c.indexOf(y)!==-1?w="rgba("+Math.round(m.r+v.r*g)+","+Math.round(m.g+v.g*g)+","+Math.round(m.b+v.b*g)+","+(m.a+v.a*g)+")":w=m+v*g;p.setAttr(y,w)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var g=this.node,p=f.attrs[g._id][this._id];p.points&&p.points.trueEnd&&g.setAttr("points",p.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var g=this.node,p=f.attrs[g._id][this._id];p.points&&p.points.trueStart&&g.points(p.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(g){return this.tween.seek(g*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var g=this.node._id,p=this._id,_=f.tweens[g],y;this.pause();for(y in _)delete f.tweens[g][y];delete f.attrs[g][p]}}i.Tween=f,f.attrs={},f.tweens={},n.Node.prototype.to=function(u){var g=u.onFinish;u.node=this,u.onFinish=function(){this.destroy(),g&&g()};var p=new f(u);p.play()},i.Easings={BackEaseIn(u,g,p,_){var y=1.70158;return p*(u/=_)*u*((y+1)*u-y)+g},BackEaseOut(u,g,p,_){var y=1.70158;return p*((u=u/_-1)*u*((y+1)*u+y)+1)+g},BackEaseInOut(u,g,p,_){var y=1.70158;return(u/=_/2)<1?p/2*(u*u*(((y*=1.525)+1)*u-y))+g:p/2*((u-=2)*u*(((y*=1.525)+1)*u+y)+2)+g},ElasticEaseIn(u,g,p,_,y,b){var m=0;return u===0?g:(u/=_)===1?g+p:(b||(b=_*.3),!y||y<Math.abs(p)?(y=p,m=b/4):m=b/(2*Math.PI)*Math.asin(p/y),-(y*Math.pow(2,10*(u-=1))*Math.sin((u*_-m)*(2*Math.PI)/b))+g)},ElasticEaseOut(u,g,p,_,y,b){var m=0;return u===0?g:(u/=_)===1?g+p:(b||(b=_*.3),!y||y<Math.abs(p)?(y=p,m=b/4):m=b/(2*Math.PI)*Math.asin(p/y),y*Math.pow(2,-10*u)*Math.sin((u*_-m)*(2*Math.PI)/b)+p+g)},ElasticEaseInOut(u,g,p,_,y,b){var m=0;return u===0?g:(u/=_/2)===2?g+p:(b||(b=_*.44999999999999996),!y||y<Math.abs(p)?(y=p,m=b/4):m=b/(2*Math.PI)*Math.asin(p/y),u<1?-.5*(y*Math.pow(2,10*(u-=1))*Math.sin((u*_-m)*(2*Math.PI)/b))+g:y*Math.pow(2,-10*(u-=1))*Math.sin((u*_-m)*(2*Math.PI)/b)*.5+p+g)},BounceEaseOut(u,g,p,_){return(u/=_)<.36363636363636365?p*(7.5625*u*u)+g:u<.7272727272727273?p*(7.5625*(u-=.5454545454545454)*u+.75)+g:u<.9090909090909091?p*(7.5625*(u-=.8181818181818182)*u+.9375)+g:p*(7.5625*(u-=.9545454545454546)*u+.984375)+g},BounceEaseIn(u,g,p,_){return p-i.Easings.BounceEaseOut(_-u,0,p,_)+g},BounceEaseInOut(u,g,p,_){return u<_/2?i.Easings.BounceEaseIn(u*2,0,p,_)*.5+g:i.Easings.BounceEaseOut(u*2-_,0,p,_)*.5+p*.5+g},EaseIn(u,g,p,_){return p*(u/=_)*u+g},EaseOut(u,g,p,_){return-p*(u/=_)*(u-2)+g},EaseInOut(u,g,p,_){return(u/=_/2)<1?p/2*u*u+g:-p/2*(--u*(u-2)-1)+g},StrongEaseIn(u,g,p,_){return p*(u/=_)*u*u*u*u+g},StrongEaseOut(u,g,p,_){return p*((u=u/_-1)*u*u*u*u+1)+g},StrongEaseInOut(u,g,p,_){return(u/=_/2)<1?p/2*u*u*u*u*u+g:p/2*((u-=2)*u*u*u*u+2)+g},Linear(u,g,p,_){return p*u/_+g}}})(qc),function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.Konva=void 0;const t=Y,e=gt,n=dt,r=ii,s=jc,a=kn,o=Rr,h=Mi,l=Er,c=St,d=Ri,f=qc,u=pe,g=$t;i.Konva=e.Util._assign(t.Konva,{Util:e.Util,Transform:e.Transform,Node:n.Node,Container:r.Container,Stage:s.Stage,stages:s.stages,Layer:a.Layer,FastLayer:o.FastLayer,Group:h.Group,DD:l.DD,Shape:c.Shape,shapes:c.shapes,Animation:d.Animation,Tween:f.Tween,Easings:f.Easings,Context:u.Context,Canvas:g.Canvas}),i.default=i.Konva}(Rc);var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.Arc=void 0;const Lr=X,Z5=St,Kc=Y,Or=N,J5=Y;class ve extends Z5.Shape{_sceneFunc(t){var e=Kc.Konva.getAngle(this.angle()),n=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,e,n),t.arc(0,0,this.innerRadius(),e,0,!n),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),e=this.outerRadius(),n=this.clockwise(),r=Kc.Konva.getAngle(n?360-this.angle():this.angle()),s=Math.cos(Math.min(r,Math.PI)),a=1,o=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),h=Math.sin(Math.min(r,Math.PI/2)),l=s*(s>0?t:e),c=a*e,d=o*(o>0?t:e),f=h*(h>0?e:t);return{x:l,y:n?-1*f:d,width:c-l,height:f-d}}}Dr.Arc=ve,ve.prototype._centroid=!0,ve.prototype.className="Arc",ve.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,J5._registerNode)(ve),Lr.Factory.addGetterSetter(ve,"innerRadius",0,(0,Or.getNumberValidator)()),Lr.Factory.addGetterSetter(ve,"outerRadius",0,(0,Or.getNumberValidator)()),Lr.Factory.addGetterSetter(ve,"angle",0,(0,Or.getNumberValidator)()),Lr.Factory.addGetterSetter(ve,"clockwise",!1,(0,Or.getBooleanValidator)());var Ir={},An={};Object.defineProperty(An,"__esModule",{value:!0}),An.Line=void 0;const Fr=X,Q5=St,Zc=N,t3=Y;function Ka(i,t,e,n,r,s,a){var o=Math.sqrt(Math.pow(e-i,2)+Math.pow(n-t,2)),h=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-n,2)),l=a*o/(o+h),c=a*h/(o+h),d=e-l*(r-i),f=n-l*(s-t),u=e+c*(r-i),g=n+c*(s-t);return[d,f,u,g]}function Jc(i,t){var e=i.length,n=[],r,s;for(r=2;r<e-2;r+=2)s=Ka(i[r-2],i[r-1],i[r],i[r+1],i[r+2],i[r+3],t),!isNaN(s[0])&&(n.push(s[0]),n.push(s[1]),n.push(i[r]),n.push(i[r+1]),n.push(s[2]),n.push(s[3]));return n}class Ie extends Q5.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var e=this.points(),n=e.length,r=this.tension(),s=this.closed(),a=this.bezier(),o,h,l;if(n){if(t.beginPath(),t.moveTo(e[0],e[1]),r!==0&&n>4){for(o=this.getTensionPoints(),h=o.length,l=s?0:4,s||t.quadraticCurveTo(o[0],o[1],o[2],o[3]);l<h-2;)t.bezierCurveTo(o[l++],o[l++],o[l++],o[l++],o[l++],o[l++]);s||t.quadraticCurveTo(o[h-2],o[h-1],e[n-2],e[n-1])}else if(a)for(l=2;l<n;)t.bezierCurveTo(e[l++],e[l++],e[l++],e[l++],e[l++],e[l++]);else for(l=2;l<n;l+=2)t.lineTo(e[l],e[l+1]);s?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():Jc(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),e=t.length,n=this.tension(),r=Ka(t[e-2],t[e-1],t[0],t[1],t[2],t[3],n),s=Ka(t[e-4],t[e-3],t[e-2],t[e-1],t[0],t[1],n),a=Jc(t,n),o=[r[2],r[3]].concat(a).concat([s[0],s[1],t[e-2],t[e-1],s[2],s[3],r[0],r[1],t[0],t[1]]);return o}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var e=t[0],n=t[0],r=t[1],s=t[1],a,o,h=0;h<t.length/2;h++)a=t[h*2],o=t[h*2+1],e=Math.min(e,a),n=Math.max(n,a),r=Math.min(r,o),s=Math.max(s,o);return{x:e,y:r,width:n-e,height:s-r}}}An.Line=Ie,Ie.prototype.className="Line",Ie.prototype._attrsAffectingSize=["points","bezier","tension"],(0,t3._registerNode)(Ie),Fr.Factory.addGetterSetter(Ie,"closed",!1),Fr.Factory.addGetterSetter(Ie,"bezier",!1),Fr.Factory.addGetterSetter(Ie,"tension",0,(0,Zc.getNumberValidator)()),Fr.Factory.addGetterSetter(Ie,"points",[],(0,Zc.getNumberArrayValidator)());var Di={},Qc={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.t2length=i.getQuadraticArcLength=i.getCubicArcLength=i.binomialCoefficients=i.cValues=i.tValues=void 0,i.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],i.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],i.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(a,o,h)=>{let l,c,d;l=h/2,c=0;for(let u=0;u<20;u++)d=l*i.tValues[20][u]+l,c+=i.cValues[20][u]*n(a,o,d);return l*c};i.getCubicArcLength=t;const e=(a,o,h)=>{h===void 0&&(h=1);const l=a[0]-2*a[1]+a[2],c=o[0]-2*o[1]+o[2],d=2*a[1]-2*a[0],f=2*o[1]-2*o[0],u=4*(l*l+c*c),g=4*(l*d+c*f),p=d*d+f*f;if(u===0)return h*Math.sqrt(Math.pow(a[2]-a[0],2)+Math.pow(o[2]-o[0],2));const _=g/(2*u),y=p/u,b=h+_,m=y-_*_,v=b*b+m>0?Math.sqrt(b*b+m):0,w=_*_+m>0?Math.sqrt(_*_+m):0,S=_+Math.sqrt(_*_+m)!==0?m*Math.log(Math.abs((b+v)/(_+w))):0;return Math.sqrt(u)/2*(b*v-_*w+S)};i.getQuadraticArcLength=e;function n(a,o,h){const l=r(1,h,a),c=r(1,h,o),d=l*l+c*c;return Math.sqrt(d)}const r=(a,o,h)=>{const l=h.length-1;let c,d;if(l===0)return 0;if(a===0){d=0;for(let f=0;f<=l;f++)d+=i.binomialCoefficients[l][f]*Math.pow(1-o,l-f)*Math.pow(o,f)*h[f];return d}else{c=new Array(l);for(let f=0;f<l;f++)c[f]=l*(h[f+1]-h[f]);return r(a-1,o,c)}},s=(a,o,h)=>{let l=1,c=a/o,d=(a-h(c))/o,f=0;for(;l>.001;){const u=h(c+d),g=Math.abs(a-u)/o;if(g<l)l=g,c+=d;else{const p=h(c-d),_=Math.abs(a-p)/o;_<l?(l=_,c-=d):d/=2}if(f++,f>500)break}return c};i.t2length=s})(Qc),Object.defineProperty(Di,"__esModule",{value:!0}),Di.Path=void 0;const e3=X,i3=St,n3=Y,Li=Qc;class Ct extends i3.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Ct.parsePathData(this.data()),this.pathLength=Ct.getPathLength(this.dataArray)}_sceneFunc(t){var e=this.dataArray;t.beginPath();for(var n=!1,r=0;r<e.length;r++){var s=e[r].command,a=e[r].points;switch(s){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var o=a[0],h=a[1],l=a[2],c=a[3],d=a[4],f=a[5],u=a[6],g=a[7],p=l>c?l:c,_=l>c?1:l/c,y=l>c?c/l:1;t.translate(o,h),t.rotate(u),t.scale(_,y),t.arc(0,0,p,d,d+f,1-g),t.scale(1/_,1/y),t.rotate(-u),t.translate(-o,-h);break;case"z":n=!0,t.closePath();break}}!n&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(l){if(l.command==="A"){var c=l.points[4],d=l.points[5],f=l.points[4]+d,u=Math.PI/180;if(Math.abs(c-f)<u&&(u=Math.abs(c-f)),d<0)for(let g=c-u;g>f;g-=u){const p=Ct.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],g,0);t.push(p.x,p.y)}else for(let g=c+u;g<f;g+=u){const p=Ct.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],g,0);t.push(p.x,p.y)}}else if(l.command==="C")for(let g=0;g<=1;g+=.01){const p=Ct.getPointOnCubicBezier(g,l.start.x,l.start.y,l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]);t.push(p.x,p.y)}else t=t.concat(l.points)});for(var e=t[0],n=t[0],r=t[1],s=t[1],a,o,h=0;h<t.length/2;h++)a=t[h*2],o=t[h*2+1],isNaN(a)||(e=Math.min(e,a),n=Math.max(n,a)),isNaN(o)||(r=Math.min(r,o),s=Math.max(s,o));return{x:e,y:r,width:n-e,height:s-r}}getLength(){return this.pathLength}getPointAtLength(t){return Ct.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,e,n,r){return Math.sqrt((n-t)*(n-t)+(r-e)*(r-e))}static getPathLength(t){let e=0;for(var n=0;n<t.length;++n)e+=t[n].pathLength;return e}static getPointAtLengthOfDataArray(t,e){var n,r=0,s=e.length;if(!s)return null;for(;r<s&&t>e[r].pathLength;)t-=e[r].pathLength,++r;if(r===s)return n=e[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=e[r].points.slice(0,2),{x:n[0],y:n[1]};var a=e[r],o=a.points;switch(a.command){case"L":return Ct.getPointOnLine(t,a.start.x,a.start.y,o[0],o[1]);case"C":return Ct.getPointOnCubicBezier((0,Li.t2length)(t,Ct.getPathLength(e),p=>(0,Li.getCubicArcLength)([a.start.x,o[0],o[2],o[4]],[a.start.y,o[1],o[3],o[5]],p)),a.start.x,a.start.y,o[0],o[1],o[2],o[3],o[4],o[5]);case"Q":return Ct.getPointOnQuadraticBezier((0,Li.t2length)(t,Ct.getPathLength(e),p=>(0,Li.getQuadraticArcLength)([a.start.x,o[0],o[2]],[a.start.y,o[1],o[3]],p)),a.start.x,a.start.y,o[0],o[1],o[2],o[3]);case"A":var h=o[0],l=o[1],c=o[2],d=o[3],f=o[4],u=o[5],g=o[6];return f+=u*t/a.pathLength,Ct.getPointOnEllipticalArc(h,l,c,d,f,g)}return null}static getPointOnLine(t,e,n,r,s,a,o){a===void 0&&(a=e),o===void 0&&(o=n);var h=(s-n)/(r-e+1e-8),l=Math.sqrt(t*t/(1+h*h));r<e&&(l*=-1);var c=h*l,d;if(r===e)d={x:a,y:o+c};else if((o-n)/(a-e+1e-8)===h)d={x:a+l,y:o+c};else{var f,u,g=this.getLineLength(e,n,r,s),p=(a-e)*(r-e)+(o-n)*(s-n);p=p/(g*g),f=e+p*(r-e),u=n+p*(s-n);var _=this.getLineLength(a,o,f,u),y=Math.sqrt(t*t-_*_);l=Math.sqrt(y*y/(1+h*h)),r<e&&(l*=-1),c=h*l,d={x:f+l,y:u+c}}return d}static getPointOnCubicBezier(t,e,n,r,s,a,o,h,l){function c(_){return _*_*_}function d(_){return 3*_*_*(1-_)}function f(_){return 3*_*(1-_)*(1-_)}function u(_){return(1-_)*(1-_)*(1-_)}var g=h*c(t)+a*d(t)+r*f(t)+e*u(t),p=l*c(t)+o*d(t)+s*f(t)+n*u(t);return{x:g,y:p}}static getPointOnQuadraticBezier(t,e,n,r,s,a,o){function h(u){return u*u}function l(u){return 2*u*(1-u)}function c(u){return(1-u)*(1-u)}var d=a*h(t)+r*l(t)+e*c(t),f=o*h(t)+s*l(t)+n*c(t);return{x:d,y:f}}static getPointOnEllipticalArc(t,e,n,r,s,a){var o=Math.cos(a),h=Math.sin(a),l={x:n*Math.cos(s),y:r*Math.sin(s)};return{x:t+(l.x*o-l.y*h),y:e+(l.x*h+l.y*o)}}static parsePathData(t){if(!t)return[];var e=t,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];e=e.replace(new RegExp(" ","g"),",");for(var r=0;r<n.length;r++)e=e.replace(new RegExp(n[r],"g"),"|"+n[r]);var s=e.split("|"),a=[],o=[],h=0,l=0,c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,d;for(r=1;r<s.length;r++){var f=s[r],u=f.charAt(0);for(f=f.slice(1),o.length=0;d=c.exec(f);)o.push(d[0]);for(var g=[],p=0,_=o.length;p<_;p++){if(o[p]==="00"){g.push(0,0);continue}var y=parseFloat(o[p]);isNaN(y)?g.push(0):g.push(y)}for(;g.length>0&&!isNaN(g[0]);){var b="",m=[],v=h,w=l,S,T,C,k,x,E,M,D,O,I;switch(u){case"l":h+=g.shift(),l+=g.shift(),b="L",m.push(h,l);break;case"L":h=g.shift(),l=g.shift(),m.push(h,l);break;case"m":var H=g.shift(),j=g.shift();if(h+=H,l+=j,b="M",a.length>2&&a[a.length-1].command==="z"){for(var $=a.length-2;$>=0;$--)if(a[$].command==="M"){h=a[$].points[0]+H,l=a[$].points[1]+j;break}}m.push(h,l),u="l";break;case"M":h=g.shift(),l=g.shift(),b="M",m.push(h,l),u="L";break;case"h":h+=g.shift(),b="L",m.push(h,l);break;case"H":h=g.shift(),b="L",m.push(h,l);break;case"v":l+=g.shift(),b="L",m.push(h,l);break;case"V":l=g.shift(),b="L",m.push(h,l);break;case"C":m.push(g.shift(),g.shift(),g.shift(),g.shift()),h=g.shift(),l=g.shift(),m.push(h,l);break;case"c":m.push(h+g.shift(),l+g.shift(),h+g.shift(),l+g.shift()),h+=g.shift(),l+=g.shift(),b="C",m.push(h,l);break;case"S":T=h,C=l,S=a[a.length-1],S.command==="C"&&(T=h+(h-S.points[2]),C=l+(l-S.points[3])),m.push(T,C,g.shift(),g.shift()),h=g.shift(),l=g.shift(),b="C",m.push(h,l);break;case"s":T=h,C=l,S=a[a.length-1],S.command==="C"&&(T=h+(h-S.points[2]),C=l+(l-S.points[3])),m.push(T,C,h+g.shift(),l+g.shift()),h+=g.shift(),l+=g.shift(),b="C",m.push(h,l);break;case"Q":m.push(g.shift(),g.shift()),h=g.shift(),l=g.shift(),m.push(h,l);break;case"q":m.push(h+g.shift(),l+g.shift()),h+=g.shift(),l+=g.shift(),b="Q",m.push(h,l);break;case"T":T=h,C=l,S=a[a.length-1],S.command==="Q"&&(T=h+(h-S.points[0]),C=l+(l-S.points[1])),h=g.shift(),l=g.shift(),b="Q",m.push(T,C,h,l);break;case"t":T=h,C=l,S=a[a.length-1],S.command==="Q"&&(T=h+(h-S.points[0]),C=l+(l-S.points[1])),h+=g.shift(),l+=g.shift(),b="Q",m.push(T,C,h,l);break;case"A":k=g.shift(),x=g.shift(),E=g.shift(),M=g.shift(),D=g.shift(),O=h,I=l,h=g.shift(),l=g.shift(),b="A",m=this.convertEndpointToCenterParameterization(O,I,h,l,M,D,k,x,E);break;case"a":k=g.shift(),x=g.shift(),E=g.shift(),M=g.shift(),D=g.shift(),O=h,I=l,h+=g.shift(),l+=g.shift(),b="A",m=this.convertEndpointToCenterParameterization(O,I,h,l,M,D,k,x,E);break}a.push({command:b||u,points:m,start:{x:v,y:w},pathLength:this.calcLength(v,w,b||u,m)})}(u==="z"||u==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,e,n,r){var s,a,o,h,l=Ct;switch(n){case"L":return l.getLineLength(t,e,r[0],r[1]);case"C":return(0,Li.getCubicArcLength)([t,r[0],r[2],r[4]],[e,r[1],r[3],r[5]],1);case"Q":return(0,Li.getQuadraticArcLength)([t,r[0],r[2]],[e,r[1],r[3]],1);case"A":s=0;var c=r[4],d=r[5],f=r[4]+d,u=Math.PI/180;if(Math.abs(c-f)<u&&(u=Math.abs(c-f)),a=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],c,0),d<0)for(h=c-u;h>f;h-=u)o=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],h,0),s+=l.getLineLength(a.x,a.y,o.x,o.y),a=o;else for(h=c+u;h<f;h+=u)o=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],h,0),s+=l.getLineLength(a.x,a.y,o.x,o.y),a=o;return o=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],f,0),s+=l.getLineLength(a.x,a.y,o.x,o.y),s}return 0}static convertEndpointToCenterParameterization(t,e,n,r,s,a,o,h,l){var c=l*(Math.PI/180),d=Math.cos(c)*(t-n)/2+Math.sin(c)*(e-r)/2,f=-1*Math.sin(c)*(t-n)/2+Math.cos(c)*(e-r)/2,u=d*d/(o*o)+f*f/(h*h);u>1&&(o*=Math.sqrt(u),h*=Math.sqrt(u));var g=Math.sqrt((o*o*(h*h)-o*o*(f*f)-h*h*(d*d))/(o*o*(f*f)+h*h*(d*d)));s===a&&(g*=-1),isNaN(g)&&(g=0);var p=g*o*f/h,_=g*-h*d/o,y=(t+n)/2+Math.cos(c)*p-Math.sin(c)*_,b=(e+r)/2+Math.sin(c)*p+Math.cos(c)*_,m=function(x){return Math.sqrt(x[0]*x[0]+x[1]*x[1])},v=function(x,E){return(x[0]*E[0]+x[1]*E[1])/(m(x)*m(E))},w=function(x,E){return(x[0]*E[1]<x[1]*E[0]?-1:1)*Math.acos(v(x,E))},S=w([1,0],[(d-p)/o,(f-_)/h]),T=[(d-p)/o,(f-_)/h],C=[(-1*d-p)/o,(-1*f-_)/h],k=w(T,C);return v(T,C)<=-1&&(k=Math.PI),v(T,C)>=1&&(k=0),a===0&&k>0&&(k=k-2*Math.PI),a===1&&k<0&&(k=k+2*Math.PI),[y,b,o,h,S,k,c,a]}}Di.Path=Ct,Ct.prototype.className="Path",Ct.prototype._attrsAffectingSize=["data"],(0,n3._registerNode)(Ct),e3.Factory.addGetterSetter(Ct,"data"),Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.Arrow=void 0;const Nr=X,r3=An,tu=N,s3=Y,eu=Di;class ri extends r3.Line{_sceneFunc(t){super._sceneFunc(t);var e=Math.PI*2,n=this.points(),r=n,s=this.tension()!==0&&n.length>4;s&&(r=this.getTensionPoints());var a=this.pointerLength(),o=n.length,h,l;if(s){const f=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[o-2],n[o-1]],u=eu.Path.calcLength(r[r.length-4],r[r.length-3],"C",f),g=eu.Path.getPointOnQuadraticBezier(Math.min(1,1-a/u),f[0],f[1],f[2],f[3],f[4],f[5]);h=n[o-2]-g.x,l=n[o-1]-g.y}else h=n[o-2]-n[o-4],l=n[o-1]-n[o-3];var c=(Math.atan2(l,h)+e)%e,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[o-2],n[o-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(n[0],n[1]),s?(h=(r[0]+r[2])/2-n[0],l=(r[1]+r[3])/2-n[1]):(h=n[2]-n[0],l=n[3]-n[1]),t.rotate((Math.atan2(-l,-h)+e)%e),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var e=this.dashEnabled();e&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),e&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),e=this.pointerWidth()/2;return{x:t.x-e,y:t.y-e,width:t.width+e*2,height:t.height+e*2}}}Ir.Arrow=ri,ri.prototype.className="Arrow",(0,s3._registerNode)(ri),Nr.Factory.addGetterSetter(ri,"pointerLength",10,(0,tu.getNumberValidator)()),Nr.Factory.addGetterSetter(ri,"pointerWidth",10,(0,tu.getNumberValidator)()),Nr.Factory.addGetterSetter(ri,"pointerAtBeginning",!1),Nr.Factory.addGetterSetter(ri,"pointerAtEnding",!0);var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.Circle=void 0;const a3=X,o3=St,l3=N,h3=Y;class Oi extends o3.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}}Ur.Circle=Oi,Oi.prototype._centroid=!0,Oi.prototype.className="Circle",Oi.prototype._attrsAffectingSize=["radius"],(0,h3._registerNode)(Oi),a3.Factory.addGetterSetter(Oi,"radius",0,(0,l3.getNumberValidator)());var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.Ellipse=void 0;const Za=X,c3=St,iu=N,u3=Y;class Fe extends c3.Shape{_sceneFunc(t){var e=this.radiusX(),n=this.radiusY();t.beginPath(),t.save(),e!==n&&t.scale(1,n/e),t.arc(0,0,e,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}Gr.Ellipse=Fe,Fe.prototype.className="Ellipse",Fe.prototype._centroid=!0,Fe.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,u3._registerNode)(Fe),Za.Factory.addComponentsGetterSetter(Fe,"radius",["x","y"]),Za.Factory.addGetterSetter(Fe,"radiusX",0,(0,iu.getNumberValidator)()),Za.Factory.addGetterSetter(Fe,"radiusY",0,(0,iu.getNumberValidator)());var Br={};Object.defineProperty(Br,"__esModule",{value:!0}),Br.Image=void 0;const Ja=gt,si=X,d3=St,f3=Y,Pn=N;let ee=class td extends d3.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const e=this.getWidth(),n=this.getHeight(),r=this.cornerRadius(),s=this.attrs.image;let a;if(s){const o=this.attrs.cropWidth,h=this.attrs.cropHeight;o&&h?a=[s,this.cropX(),this.cropY(),o,h,0,0,e,n]:a=[s,0,0,e,n]}(this.hasFill()||this.hasStroke()||r)&&(t.beginPath(),r?Ja.Util.drawRoundedRectPath(t,e,n,r):t.rect(0,0,e,n),t.closePath(),t.fillStrokeShape(this)),s&&(r&&t.clip(),t.drawImage.apply(t,a))}_hitFunc(t){var e=this.width(),n=this.height(),r=this.cornerRadius();t.beginPath(),r?Ja.Util.drawRoundedRectPath(t,e,n,r):t.rect(0,0,e,n),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,e;return(t=this.attrs.width)!==null&&t!==void 0?t:(e=this.image())===null||e===void 0?void 0:e.width}getHeight(){var t,e;return(t=this.attrs.height)!==null&&t!==void 0?t:(e=this.image())===null||e===void 0?void 0:e.height}static fromURL(t,e,n=null){var r=Ja.Util.createImageElement();r.onload=function(){var s=new td({image:r});e(s)},r.onerror=n,r.crossOrigin="Anonymous",r.src=t}};Br.Image=ee,ee.prototype.className="Image",(0,f3._registerNode)(ee),si.Factory.addGetterSetter(ee,"cornerRadius",0,(0,Pn.getNumberOrArrayOfNumbersValidator)(4)),si.Factory.addGetterSetter(ee,"image"),si.Factory.addComponentsGetterSetter(ee,"crop",["x","y","width","height"]),si.Factory.addGetterSetter(ee,"cropX",0,(0,Pn.getNumberValidator)()),si.Factory.addGetterSetter(ee,"cropY",0,(0,Pn.getNumberValidator)()),si.Factory.addGetterSetter(ee,"cropWidth",0,(0,Pn.getNumberValidator)()),si.Factory.addGetterSetter(ee,"cropHeight",0,(0,Pn.getNumberValidator)());var Ii={};Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.Tag=Ii.Label=void 0;const zr=X,g3=St,p3=Mi,Qa=N,nu=Y;var ru=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],m3="Change.konva",_3="none",to="up",eo="right",io="down",no="left",v3=ru.length;class ro extends p3.Group{constructor(t){super(t),this.on("add.konva",function(e){this._addListeners(e.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var e=this,n,r=function(){e._sync()};for(n=0;n<v3;n++)t.on(ru[n]+m3,r)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),e=this.getTag(),n,r,s,a,o,h,l;if(t&&e){switch(n=t.width(),r=t.height(),s=e.pointerDirection(),a=e.pointerWidth(),l=e.pointerHeight(),o=0,h=0,s){case to:o=n/2,h=-1*l;break;case eo:o=n+a,h=r/2;break;case io:o=n/2,h=r+l;break;case no:o=-1*a,h=r/2;break}e.setAttrs({x:-1*o,y:-1*h,width:n,height:r}),t.setAttrs({x:-1*o,y:-1*h})}}}Ii.Label=ro,ro.prototype.className="Label",(0,nu._registerNode)(ro);class ai extends g3.Shape{_sceneFunc(t){var e=this.width(),n=this.height(),r=this.pointerDirection(),s=this.pointerWidth(),a=this.pointerHeight(),o=this.cornerRadius();let h=0,l=0,c=0,d=0;typeof o=="number"?h=l=c=d=Math.min(o,e/2,n/2):(h=Math.min(o[0]||0,e/2,n/2),l=Math.min(o[1]||0,e/2,n/2),d=Math.min(o[2]||0,e/2,n/2),c=Math.min(o[3]||0,e/2,n/2)),t.beginPath(),t.moveTo(h,0),r===to&&(t.lineTo((e-s)/2,0),t.lineTo(e/2,-1*a),t.lineTo((e+s)/2,0)),t.lineTo(e-l,0),t.arc(e-l,l,l,Math.PI*3/2,0,!1),r===eo&&(t.lineTo(e,(n-a)/2),t.lineTo(e+s,n/2),t.lineTo(e,(n+a)/2)),t.lineTo(e,n-d),t.arc(e-d,n-d,d,0,Math.PI/2,!1),r===io&&(t.lineTo((e+s)/2,n),t.lineTo(e/2,n+a),t.lineTo((e-s)/2,n)),t.lineTo(c,n),t.arc(c,n-c,c,Math.PI/2,Math.PI,!1),r===no&&(t.lineTo(0,(n+a)/2),t.lineTo(-1*s,n/2),t.lineTo(0,(n-a)/2)),t.lineTo(0,h),t.arc(h,h,h,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,e=0,n=this.pointerWidth(),r=this.pointerHeight(),s=this.pointerDirection(),a=this.width(),o=this.height();return s===to?(e-=r,o+=r):s===io?o+=r:s===no?(t-=n*1.5,a+=n):s===eo&&(a+=n*1.5),{x:t,y:e,width:a,height:o}}}Ii.Tag=ai,ai.prototype.className="Tag",(0,nu._registerNode)(ai),zr.Factory.addGetterSetter(ai,"pointerDirection",_3),zr.Factory.addGetterSetter(ai,"pointerWidth",0,(0,Qa.getNumberValidator)()),zr.Factory.addGetterSetter(ai,"pointerHeight",0,(0,Qa.getNumberValidator)()),zr.Factory.addGetterSetter(ai,"cornerRadius",0,(0,Qa.getNumberOrArrayOfNumbersValidator)(4));var Mn={};Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.Rect=void 0;const y3=X,b3=St,w3=Y,S3=gt,C3=N;class Hr extends b3.Shape{_sceneFunc(t){var e=this.cornerRadius(),n=this.width(),r=this.height();t.beginPath(),e?S3.Util.drawRoundedRectPath(t,n,r,e):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}}Mn.Rect=Hr,Hr.prototype.className="Rect",(0,w3._registerNode)(Hr),y3.Factory.addGetterSetter(Hr,"cornerRadius",0,(0,C3.getNumberOrArrayOfNumbersValidator)(4));var jr={};Object.defineProperty(jr,"__esModule",{value:!0}),jr.RegularPolygon=void 0;const su=X,x3=St,au=N,E3=Y;class oi extends x3.Shape{_sceneFunc(t){const e=this._getPoints();t.beginPath(),t.moveTo(e[0].x,e[0].y);for(var n=1;n<e.length;n++)t.lineTo(e[n].x,e[n].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,e=this.attrs.radius||0,n=[];for(var r=0;r<t;r++)n.push({x:e*Math.sin(r*2*Math.PI/t),y:-1*e*Math.cos(r*2*Math.PI/t)});return n}getSelfRect(){const t=this._getPoints();var e=t[0].x,n=t[0].y,r=t[0].x,s=t[0].y;return t.forEach(a=>{e=Math.min(e,a.x),n=Math.max(n,a.x),r=Math.min(r,a.y),s=Math.max(s,a.y)}),{x:e,y:r,width:n-e,height:s-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}jr.RegularPolygon=oi,oi.prototype.className="RegularPolygon",oi.prototype._centroid=!0,oi.prototype._attrsAffectingSize=["radius"],(0,E3._registerNode)(oi),su.Factory.addGetterSetter(oi,"radius",0,(0,au.getNumberValidator)()),su.Factory.addGetterSetter(oi,"sides",0,(0,au.getNumberValidator)());var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.Ring=void 0;const ou=X,T3=St,lu=N,k3=Y;var hu=Math.PI*2;class li extends T3.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,hu,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),hu,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Vr.Ring=li,li.prototype.className="Ring",li.prototype._centroid=!0,li.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,k3._registerNode)(li),ou.Factory.addGetterSetter(li,"innerRadius",0,(0,lu.getNumberValidator)()),ou.Factory.addGetterSetter(li,"outerRadius",0,(0,lu.getNumberValidator)());var $r={};Object.defineProperty($r,"__esModule",{value:!0}),$r.Sprite=void 0;const hi=X,A3=St,P3=Ri,cu=N,M3=Y;class ie extends A3.Shape{constructor(t){super(t),this._updated=!0,this.anim=new P3.Animation(()=>{var e=this._updated;return this._updated=!1,e}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var e=this.animation(),n=this.frameIndex(),r=n*4,s=this.animations()[e],a=this.frameOffsets(),o=s[r+0],h=s[r+1],l=s[r+2],c=s[r+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,l,c),t.closePath(),t.fillStrokeShape(this)),d)if(a){var f=a[e],u=n*2;t.drawImage(d,o,h,l,c,f[u+0],f[u+1],l,c)}else t.drawImage(d,o,h,l,c,0,0,l,c)}_hitFunc(t){var e=this.animation(),n=this.frameIndex(),r=n*4,s=this.animations()[e],a=this.frameOffsets(),o=s[r+2],h=s[r+3];if(t.beginPath(),a){var l=a[e],c=n*2;t.rect(l[c+0],l[c+1],o,h)}else t.rect(0,0,o,h);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),e=this.animation(),n=this.animations(),r=n[e],s=r.length/4;t<s-1?this.frameIndex(t+1):this.frameIndex(0)}}$r.Sprite=ie,ie.prototype.className="Sprite",(0,M3._registerNode)(ie),hi.Factory.addGetterSetter(ie,"animation"),hi.Factory.addGetterSetter(ie,"animations"),hi.Factory.addGetterSetter(ie,"frameOffsets"),hi.Factory.addGetterSetter(ie,"image"),hi.Factory.addGetterSetter(ie,"frameIndex",0,(0,cu.getNumberValidator)()),hi.Factory.addGetterSetter(ie,"frameRate",17,(0,cu.getNumberValidator)()),hi.Factory.backCompat(ie,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.Star=void 0;const so=X,R3=St,ao=N,D3=Y;class Ne extends R3.Shape{_sceneFunc(t){var e=this.innerRadius(),n=this.outerRadius(),r=this.numPoints();t.beginPath(),t.moveTo(0,0-n);for(var s=1;s<r*2;s++){var a=s%2===0?n:e,o=a*Math.sin(s*Math.PI/r),h=-1*a*Math.cos(s*Math.PI/r);t.lineTo(o,h)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Xr.Star=Ne,Ne.prototype.className="Star",Ne.prototype._centroid=!0,Ne.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,D3._registerNode)(Ne),so.Factory.addGetterSetter(Ne,"numPoints",5,(0,ao.getNumberValidator)()),so.Factory.addGetterSetter(Ne,"innerRadius",0,(0,ao.getNumberValidator)()),so.Factory.addGetterSetter(Ne,"outerRadius",0,(0,ao.getNumberValidator)());var ci={};Object.defineProperty(ci,"__esModule",{value:!0}),ci.Text=ci.stringToArray=void 0;const oo=gt,Pt=X,L3=St,Ue=N,O3=Y;function uu(i){return Array.from(i)}ci.stringToArray=uu;var Fi="auto",I3="center",du="inherit",Rn="justify",F3="Change.konva",N3="2d",fu="-",gu="left",U3="text",G3="Text",B3="top",z3="bottom",pu="middle",mu="normal",H3="px ",Yr=" ",j3="right",_u="rtl",V3="word",$3="char",vu="none",lo="…",yu=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],X3=yu.length;function Y3(i){return i.split(",").map(t=>{t=t.trim();const e=t.indexOf(" ")>=0,n=t.indexOf('"')>=0||t.indexOf("'")>=0;return e&&!n&&(t=`"${t}"`),t}).join(", ")}var Wr;function ho(){return Wr||(Wr=oo.Util.createCanvasElement().getContext(N3),Wr)}function W3(i){i.fillText(this._partialText,this._partialTextX,this._partialTextY)}function q3(i){i.setAttr("miterLimit",2),i.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function K3(i){return i=i||{},!i.fillLinearGradientColorStops&&!i.fillRadialGradientColorStops&&!i.fillPatternImage&&(i.fill=i.fill||"black"),i}class _t extends L3.Shape{constructor(t){super(K3(t)),this._partialTextX=0,this._partialTextY=0;for(var e=0;e<X3;e++)this.on(yu[e]+F3,this._setTextData);this._setTextData()}_sceneFunc(t){var e=this.textArr,n=e.length;if(this.text()){var r=this.padding(),s=this.fontSize(),a=this.lineHeight()*s,o=this.verticalAlign(),h=this.direction(),l=0,c=this.align(),d=this.getWidth(),f=this.letterSpacing(),u=this.fill(),g=this.textDecoration(),p=g.indexOf("underline")!==-1,_=g.indexOf("line-through")!==-1,y;h=h===du?t.direction:h;var b=0,b=a/2,m=0,v=0;for(h===_u&&t.setAttr("direction",h),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",pu),t.setAttr("textAlign",gu),o===pu?l=(this.getHeight()-n*a-r*2)/2:o===z3&&(l=this.getHeight()-n*a-r*2),t.translate(r,l+r),y=0;y<n;y++){var m=0,v=0,w=e[y],S=w.text,T=w.width,C=w.lastInParagraph,k,x,E;if(t.save(),c===j3?m+=d-T-r*2:c===I3&&(m+=(d-T-r*2)/2),p){t.save(),t.beginPath(),t.moveTo(m,b+v+Math.round(s/2)),k=S.split(" ").length-1,x=k===0,E=c===Rn&&!C?d-r*2:T,t.lineTo(m+Math.round(E),b+v+Math.round(s/2)),t.lineWidth=s/15;const j=this._getLinearGradient();t.strokeStyle=j||u,t.stroke(),t.restore()}if(_){t.save(),t.beginPath(),t.moveTo(m,b+v),k=S.split(" ").length-1,x=k===0,E=c===Rn&&C&&!x?d-r*2:T,t.lineTo(m+Math.round(E),b+v),t.lineWidth=s/15;const j=this._getLinearGradient();t.strokeStyle=j||u,t.stroke(),t.restore()}if(h!==_u&&(f!==0||c===Rn)){k=S.split(" ").length-1;for(var M=uu(S),D=0;D<M.length;D++){var O=M[D];O===" "&&!C&&c===Rn&&(m+=(d-r*2-T)/k),this._partialTextX=m,this._partialTextY=b+v,this._partialText=O,t.fillStrokeShape(this),m+=this.measureSize(O).width+f}}else f!==0&&t.setAttr("letterSpacing",`${f}px`),this._partialTextX=m,this._partialTextY=b+v,this._partialText=S,t.fillStrokeShape(this);t.restore(),n>1&&(b+=a)}}}_hitFunc(t){var e=this.getWidth(),n=this.getHeight();t.beginPath(),t.rect(0,0,e,n),t.closePath(),t.fillStrokeShape(this)}setText(t){var e=oo.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(U3,e),this}getWidth(){var t=this.attrs.width===Fi||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Fi||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return oo.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var e=ho(),n=this.fontSize(),r;return e.save(),e.font=this._getContextFont(),r=e.measureText(t),e.restore(),{width:r.width,height:n}}_getContextFont(){return this.fontStyle()+Yr+this.fontVariant()+Yr+(this.fontSize()+H3)+Y3(this.fontFamily())}_addTextLine(t){this.align()===Rn&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var e=this.letterSpacing(),n=t.length;return ho().measureText(t).width+(n?e*(n-1):0)}_setTextData(){var t=this.text().split(`
19
+ `),e=+this.fontSize(),n=0,r=this.lineHeight()*e,s=this.attrs.width,a=this.attrs.height,o=s!==Fi&&s!==void 0,h=a!==Fi&&a!==void 0,l=this.padding(),c=s-l*2,d=a-l*2,f=0,u=this.wrap(),g=u!==vu,p=u!==$3&&g,_=this.ellipsis();this.textArr=[],ho().font=this._getContextFont();for(var y=_?this._getTextWidth(lo):0,b=0,m=t.length;b<m;++b){var v=t[b],w=this._getTextWidth(v);if(o&&w>c)for(;v.length>0;){for(var S=0,T=v.length,C="",k=0;S<T;){var x=S+T>>>1,E=v.slice(0,x+1),M=this._getTextWidth(E)+y;M<=c?(S=x+1,C=E,k=M):T=x}if(C){if(p){var D,O=v[C.length],I=O===Yr||O===fu;I&&k<=c?D=C.length:D=Math.max(C.lastIndexOf(Yr),C.lastIndexOf(fu))+1,D>0&&(S=D,C=C.slice(0,S),k=this._getTextWidth(C))}C=C.trimRight(),this._addTextLine(C),n=Math.max(n,k),f+=r;var H=this._shouldHandleEllipsis(f);if(H){this._tryToAddEllipsisToLastLine();break}if(v=v.slice(S),v=v.trimLeft(),v.length>0&&(w=this._getTextWidth(v),w<=c)){this._addTextLine(v),f+=r,n=Math.max(n,w);break}}else break}else this._addTextLine(v),f+=r,n=Math.max(n,w),this._shouldHandleEllipsis(f)&&b<m-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),h&&f+r>d)break}this.textHeight=e,this.textWidth=n}_shouldHandleEllipsis(t){var e=+this.fontSize(),n=this.lineHeight()*e,r=this.attrs.height,s=r!==Fi&&r!==void 0,a=this.padding(),o=r-a*2,h=this.wrap(),l=h!==vu;return!l||s&&t+n>o}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,e=t!==Fi&&t!==void 0,n=this.padding(),r=t-n*2,s=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!s)){if(e){var o=this._getTextWidth(a.text+lo)<r;o||(a.text=a.text.slice(0,a.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(a.text+lo)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,e=this.hasShadow();return t&&e?!0:super._useBufferCanvas()}}ci.Text=_t,_t.prototype._fillFunc=W3,_t.prototype._strokeFunc=q3,_t.prototype.className=G3,_t.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,O3._registerNode)(_t),Pt.Factory.overWriteSetter(_t,"width",(0,Ue.getNumberOrAutoValidator)()),Pt.Factory.overWriteSetter(_t,"height",(0,Ue.getNumberOrAutoValidator)()),Pt.Factory.addGetterSetter(_t,"direction",du),Pt.Factory.addGetterSetter(_t,"fontFamily","Arial"),Pt.Factory.addGetterSetter(_t,"fontSize",12,(0,Ue.getNumberValidator)()),Pt.Factory.addGetterSetter(_t,"fontStyle",mu),Pt.Factory.addGetterSetter(_t,"fontVariant",mu),Pt.Factory.addGetterSetter(_t,"padding",0,(0,Ue.getNumberValidator)()),Pt.Factory.addGetterSetter(_t,"align",gu),Pt.Factory.addGetterSetter(_t,"verticalAlign",B3),Pt.Factory.addGetterSetter(_t,"lineHeight",1,(0,Ue.getNumberValidator)()),Pt.Factory.addGetterSetter(_t,"wrap",V3),Pt.Factory.addGetterSetter(_t,"ellipsis",!1,(0,Ue.getBooleanValidator)()),Pt.Factory.addGetterSetter(_t,"letterSpacing",0,(0,Ue.getNumberValidator)()),Pt.Factory.addGetterSetter(_t,"text","",(0,Ue.getStringValidator)()),Pt.Factory.addGetterSetter(_t,"textDecoration","");var qr={};Object.defineProperty(qr,"__esModule",{value:!0}),qr.TextPath=void 0;const co=gt,Xt=X,Z3=St,Dn=Di,uo=ci,bu=N,J3=Y;var Q3="",wu="normal";function Su(i){i.fillText(this.partialText,0,0)}function Cu(i){i.strokeText(this.partialText,0,0)}class xt extends Z3.Shape{constructor(t){super(t),this.dummyCanvas=co.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Dn.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const e=this.pathLength;return t-1>e?null:Dn.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Dn.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var e=this.textDecoration(),n=this.fill(),r=this.fontSize(),s=this.glyphInfo;e==="underline"&&t.beginPath();for(var a=0;a<s.length;a++){t.save();var o=s[a].p0;t.translate(o.x,o.y),t.rotate(s[a].rotation),this.partialText=s[a].text,t.fillStrokeShape(this),e==="underline"&&(a===0&&t.moveTo(0,r/2+1),t.lineTo(r,r/2+1)),t.restore()}e==="underline"&&(t.strokeStyle=n,t.lineWidth=r/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var e=this.glyphInfo;if(e.length>=1){var n=e[0].p0;t.moveTo(n.x,n.y)}for(var r=0;r<e.length;r++){var s=e[r].p1;t.lineTo(s.x,s.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return co.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return uo.Text.prototype.setText.call(this,t)}_getContextFont(){return uo.Text.prototype._getContextFont.call(this)}_getTextSize(t){var e=this.dummyCanvas,n=e.getContext("2d");n.save(),n.font=this._getContextFont();var r=n.measureText(t);return n.restore(),{width:r.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:e}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=e,this.glyphInfo=[],!this.attrs.data)return null;const n=this.letterSpacing(),r=this.align(),s=this.kerningFunc(),a=Math.max(this.textWidth+((this.attrs.text||"").length-1)*n,0);let o=0;r==="center"&&(o=Math.max(0,this.pathLength/2-a/2)),r==="right"&&(o=Math.max(0,this.pathLength-a));const h=(0,uo.stringToArray)(this.text());let l=o;for(var c=0;c<h.length;c++){const d=this._getPointAtLength(l);if(!d)return;let f=this._getTextSize(h[c]).width+n;if(h[c]===" "&&r==="justify"){const b=this.text().split(" ").length-1;f+=(this.pathLength-a)/b}const u=this._getPointAtLength(l+f);if(!u)return;const g=Dn.Path.getLineLength(d.x,d.y,u.x,u.y);let p=0;if(s)try{p=s(h[c-1],h[c])*this.fontSize()}catch{p=0}d.x+=p,u.x+=p,this.textWidth+=p;const _=Dn.Path.getPointOnLine(p+g/2,d.x,d.y,u.x,u.y),y=Math.atan2(u.y-d.y,u.x-d.x);this.glyphInfo.push({transposeX:_.x,transposeY:_.y,text:h[c],rotation:y,p0:d,p1:u}),l+=f}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(c){t.push(c.p0.x),t.push(c.p0.y),t.push(c.p1.x),t.push(c.p1.y)});for(var e=t[0]||0,n=t[0]||0,r=t[1]||0,s=t[1]||0,a,o,h=0;h<t.length/2;h++)a=t[h*2],o=t[h*2+1],e=Math.min(e,a),n=Math.max(n,a),r=Math.min(r,o),s=Math.max(s,o);var l=this.fontSize();return{x:e-l/2,y:r-l/2,width:n-e+l,height:s-r+l}}destroy(){return co.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}qr.TextPath=xt,xt.prototype._fillFunc=Su,xt.prototype._strokeFunc=Cu,xt.prototype._fillFuncHit=Su,xt.prototype._strokeFuncHit=Cu,xt.prototype.className="TextPath",xt.prototype._attrsAffectingSize=["text","fontSize","data"],(0,J3._registerNode)(xt),Xt.Factory.addGetterSetter(xt,"data"),Xt.Factory.addGetterSetter(xt,"fontFamily","Arial"),Xt.Factory.addGetterSetter(xt,"fontSize",12,(0,bu.getNumberValidator)()),Xt.Factory.addGetterSetter(xt,"fontStyle",wu),Xt.Factory.addGetterSetter(xt,"align","left"),Xt.Factory.addGetterSetter(xt,"letterSpacing",0,(0,bu.getNumberValidator)()),Xt.Factory.addGetterSetter(xt,"textBaseline","middle"),Xt.Factory.addGetterSetter(xt,"fontVariant",wu),Xt.Factory.addGetterSetter(xt,"text",Q3),Xt.Factory.addGetterSetter(xt,"textDecoration",null),Xt.Factory.addGetterSetter(xt,"kerningFunc",null);var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.Transformer=void 0;const rt=gt,it=X,xu=dt,t4=St,e4=Mn,Eu=Mi,Yt=Y,Ge=N,i4=Y;var Tu="tr-konva",n4=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(i=>i+`.${Tu}`).join(" "),ku="nodesRect",r4=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],s4={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const a4="ontouchstart"in Yt.Konva._global;function o4(i,t,e){if(i==="rotater")return e;t+=rt.Util.degToRad(s4[i]||0);var n=(rt.Util.radToDeg(t)%360+360)%360;return rt.Util._inRange(n,337.5,360)||rt.Util._inRange(n,0,22.5)?"ns-resize":rt.Util._inRange(n,22.5,67.5)?"nesw-resize":rt.Util._inRange(n,67.5,112.5)?"ew-resize":rt.Util._inRange(n,112.5,157.5)?"nwse-resize":rt.Util._inRange(n,157.5,202.5)?"ns-resize":rt.Util._inRange(n,202.5,247.5)?"nesw-resize":rt.Util._inRange(n,247.5,292.5)?"ew-resize":rt.Util._inRange(n,292.5,337.5)?"nwse-resize":(rt.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var Zr=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],Au=1e8;function l4(i){return{x:i.x+i.width/2*Math.cos(i.rotation)+i.height/2*Math.sin(-i.rotation),y:i.y+i.height/2*Math.cos(i.rotation)+i.width/2*Math.sin(i.rotation)}}function Pu(i,t,e){const n=e.x+(i.x-e.x)*Math.cos(t)-(i.y-e.y)*Math.sin(t),r=e.y+(i.x-e.x)*Math.sin(t)+(i.y-e.y)*Math.cos(t);return{...i,rotation:i.rotation+t,x:n,y:r}}function h4(i,t){const e=l4(i);return Pu(i,t,e)}function c4(i,t,e){let n=t;for(let r=0;r<i.length;r++){const s=Yt.Konva.getAngle(i[r]),a=Math.abs(s-t)%(Math.PI*2);Math.min(a,Math.PI*2-a)<e&&(n=s)}return n}class Q extends Eu.Group{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(n4,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return rt.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return Tu+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const e=t.filter(r=>r.isAncestorOf(this)?(rt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=e,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(r=>{const s=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},a=r._attrsAffectingSize.map(o=>o+"Change."+this._getEventNamespace()).join(" ");r.on(a,s),r.on(r4.map(o=>o+`.${this._getEventNamespace()}`).join(" "),s),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,s),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let e;t.on(`dragstart.${this._getEventNamespace()}`,n=>{e=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!e)return;const r=t.getAbsolutePosition(),s=r.x-e.x,a=r.y-e.y;this.nodes().forEach(o=>{if(o===t||o.isDragging())return;const h=o.getAbsolutePosition();o.setAbsolutePosition({x:h.x+s,y:h.y+a}),o.startDrag(n)}),e=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(ku),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(ku,this.__getNodeRect)}__getNodeShape(t,e=this.rotation(),n){var r=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),s=t.getAbsoluteScale(n),a=t.getAbsolutePosition(n),o=r.x*s.x-t.offsetX()*s.x,h=r.y*s.y-t.offsetY()*s.y;const l=(Yt.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:a.x+o*Math.cos(l)+h*Math.sin(-l),y:a.y+h*Math.cos(l)+o*Math.sin(l),width:r.width*s.x,height:r.height*s.y,rotation:l};return Pu(c,-Yt.Konva.getAngle(e),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-Au,y:-Au,width:0,height:0,rotation:0};const e=[];this.nodes().map(l=>{const c=l.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var d=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],f=l.getAbsoluteTransform();d.forEach(function(u){var g=f.point(u);e.push(g)})});const n=new rt.Transform;n.rotate(-Yt.Konva.getAngle(this.rotation()));var r=1/0,s=1/0,a=-1/0,o=-1/0;e.forEach(function(l){var c=n.point(l);r===void 0&&(r=a=c.x,s=o=c.y),r=Math.min(r,c.x),s=Math.min(s,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y)}),n.invert();const h=n.point({x:r,y:s});return{x:h.x,y:h.y,width:a-r,height:o-s,rotation:Yt.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),Zr.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var e=new e4.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:a4?10:"auto"}),n=this;e.on("mousedown touchstart",function(r){n._handleMouseDown(r)}),e.on("dragstart",r=>{e.stopDrag(),r.cancelBubble=!0}),e.on("dragend",r=>{r.cancelBubble=!0}),e.on("mouseenter",()=>{var r=Yt.Konva.getAngle(this.rotation()),s=this.rotateAnchorCursor(),a=o4(t,r,s);e.getStage().content&&(e.getStage().content.style.cursor=a),this._cursorChange=!0}),e.on("mouseout",()=>{e.getStage().content&&(e.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(e)}_createBack(){var t=new t4.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(e,n){var r=n.getParent(),s=r.padding();e.beginPath(),e.rect(-s,-s,n.width()+s*2,n.height()+s*2),e.moveTo(n.width()/2,-s),r.rotateEnabled()&&e.lineTo(n.width()/2,-r.rotateAnchorOffset()*rt.Util._sign(n.height())-s),e.fillStrokeShape(n)},hitFunc:(e,n)=>{if(this.shouldOverdrawWholeArea()){var r=this.padding();e.beginPath(),e.rect(-r,-r,n.width()+r*2,n.height()+r*2),e.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",e=>{e.cancelBubble=!0}),t.on("dragmove",e=>{e.cancelBubble=!0}),t.on("dragend",e=>{e.cancelBubble=!0}),this.on("dragmove",e=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var e=this._getNodeRect(),n=e.width,r=e.height,s=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/s),this.cos=Math.abs(n/s),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),o=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-a.x,y:o.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(h=>{h._fire("transformstart",{evt:t.evt,target:h})})}_handleMouseMove(t){var e,n,r,s=this.findOne("."+this._movingAnchorName),a=s.getStage();a.setPointersPositions(t);const o=a.getPointerPosition();let h={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y};const l=s.getAbsolutePosition();this.anchorDragBoundFunc()&&(h=this.anchorDragBoundFunc()(l,h,t)),s.setAbsolutePosition(h);const c=s.getAbsolutePosition();if(!(l.x===c.x&&l.y===c.y)){if(this._movingAnchorName==="rotater"){var d=this._getNodeRect();e=s.x()-d.width/2,n=-s.y()+d.height/2;let D=Math.atan2(-n,e)+Math.PI/2;d.height<0&&(D-=Math.PI);var f=Yt.Konva.getAngle(this.rotation());const O=f+D,I=Yt.Konva.getAngle(this.rotationSnapTolerance()),j=c4(this.rotationSnaps(),O,I)-d.rotation,$=h4(d,j);this._fitNodesInto($,t);return}var u=this.shiftBehavior(),g;u==="inverted"?g=this.keepRatio()&&!t.shiftKey:u==="none"?g=this.keepRatio():g=this.keepRatio()||t.shiftKey;var m=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(g){var p=m?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(p.x-s.x(),2)+Math.pow(p.y-s.y(),2));var _=this.findOne(".top-left").x()>p.x?-1:1,y=this.findOne(".top-left").y()>p.y?-1:1;e=r*this.cos*_,n=r*this.sin*y,this.findOne(".top-left").x(p.x-e),this.findOne(".top-left").y(p.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(s.y());else if(this._movingAnchorName==="top-right"){if(g){var p=m?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(s.x()-p.x,2)+Math.pow(p.y-s.y(),2));var _=this.findOne(".top-right").x()<p.x?-1:1,y=this.findOne(".top-right").y()>p.y?-1:1;e=r*this.cos*_,n=r*this.sin*y,this.findOne(".top-right").x(p.x+e),this.findOne(".top-right").y(p.y-n)}var b=s.position();this.findOne(".top-left").y(b.y),this.findOne(".bottom-right").x(b.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(s.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(s.x());else if(this._movingAnchorName==="bottom-left"){if(g){var p=m?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(p.x-s.x(),2)+Math.pow(s.y()-p.y,2));var _=p.x<s.x()?-1:1,y=s.y()<p.y?-1:1;e=r*this.cos*_,n=r*this.sin*y,s.x(p.x-e),s.y(p.y+n)}b=s.position(),this.findOne(".top-left").x(b.x),this.findOne(".bottom-right").y(b.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(s.y());else if(this._movingAnchorName==="bottom-right"){if(g){var p=m?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};r=Math.sqrt(Math.pow(s.x()-p.x,2)+Math.pow(s.y()-p.y,2));var _=this.findOne(".bottom-right").x()<p.x?-1:1,y=this.findOne(".bottom-right").y()<p.y?-1:1;e=r*this.cos*_,n=r*this.sin*y,this.findOne(".bottom-right").x(p.x+e),this.findOne(".bottom-right").y(p.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var m=this.centeredScaling()||t.altKey;if(m){var v=this.findOne(".top-left"),w=this.findOne(".bottom-right"),S=v.x(),T=v.y(),C=this.getWidth()-w.x(),k=this.getHeight()-w.y();w.move({x:-S,y:-T}),v.move({x:C,y:k})}var x=this.findOne(".top-left").getAbsolutePosition();e=x.x,n=x.y;var E=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),M=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:e,y:n,width:E,height:M,rotation:Yt.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var e=this.getNode();this._fire("transformend",{evt:t,target:e}),e&&this._nodes.forEach(n=>{n._fire("transformend",{evt:t,target:n})}),this._movingAnchorName=null}}_fitNodesInto(t,e){var n=this._getNodeRect();const r=1;if(rt.Util._inRange(t.width,-this.padding()*2-r,r)){this.update();return}if(rt.Util._inRange(t.height,-this.padding()*2-r,r)){this.update();return}const s=this.flipEnabled();var a=new rt.Transform;if(a.rotate(Yt.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const d=a.point({x:-this.padding()*2,y:0});if(t.x+=d.x,t.y+=d.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,!s){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const d=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.width+=this.padding()*2,!s){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const d=a.point({x:0,y:-this.padding()*2});if(t.x+=d.x,t.y+=d.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!s){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const d=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!s){this.update();return}}if(this.boundBoxFunc()){const d=this.boundBoxFunc()(n,t);d?t=d:rt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,h=new rt.Transform;h.translate(n.x,n.y),h.rotate(n.rotation),h.scale(n.width/o,n.height/o);const l=new rt.Transform;l.translate(t.x,t.y),l.rotate(t.rotation),l.scale(t.width/o,t.height/o);const c=l.multiply(h.invert());this._nodes.forEach(d=>{var f;const u=d.getParent().getAbsoluteTransform(),g=d.getTransform().copy();g.translate(d.offsetX(),d.offsetY());const p=new rt.Transform;p.multiply(u.copy().invert()).multiply(c).multiply(u).multiply(g);const _=p.decompose();d.setAttrs(_),this._fire("transform",{evt:e,target:d}),d._fire("transform",{evt:e,target:d}),(f=d.getLayer())===null||f===void 0||f.batchDraw()}),this.rotation(rt.Util._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,e){this.findOne(t).setAttrs(e)}update(){var t,e=this._getNodeRect();this.rotation(rt.Util._getRotation(e.rotation));var n=e.width,r=e.height,s=this.enabledAnchors(),a=this.resizeEnabled(),o=this.padding(),h=this.anchorSize();const l=this.find("._anchor");l.forEach(d=>{d.setAttrs({width:h,height:h,offsetX:h/2,offsetY:h/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:h/2+o,offsetY:h/2+o,visible:a&&s.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:h/2+o,visible:a&&s.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:h/2-o,offsetY:h/2+o,visible:a&&s.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:h/2+o,visible:a&&s.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:h/2-o,visible:a&&s.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:h/2+o,offsetY:h/2-o,visible:a&&s.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:h/2-o,visible:a&&s.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:h/2-o,offsetY:h/2-o,visible:a&&s.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*rt.Util._sign(r)-o,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const c=this.anchorStyleFunc();c&&l.forEach(d=>{c(d)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Eu.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return xu.Node.prototype.toObject.call(this)}clone(t){var e=xu.Node.prototype.clone.call(this,t);return e}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}Kr.Transformer=Q;function u4(i){return i instanceof Array||rt.Util.warn("enabledAnchors value should be an array"),i instanceof Array&&i.forEach(function(t){Zr.indexOf(t)===-1&&rt.Util.warn("Unknown anchor name: "+t+". Available names are: "+Zr.join(", "))}),i||[]}Q.prototype.className="Transformer",(0,i4._registerNode)(Q),it.Factory.addGetterSetter(Q,"enabledAnchors",Zr,u4),it.Factory.addGetterSetter(Q,"flipEnabled",!0,(0,Ge.getBooleanValidator)()),it.Factory.addGetterSetter(Q,"resizeEnabled",!0),it.Factory.addGetterSetter(Q,"anchorSize",10,(0,Ge.getNumberValidator)()),it.Factory.addGetterSetter(Q,"rotateEnabled",!0),it.Factory.addGetterSetter(Q,"rotationSnaps",[]),it.Factory.addGetterSetter(Q,"rotateAnchorOffset",50,(0,Ge.getNumberValidator)()),it.Factory.addGetterSetter(Q,"rotateAnchorCursor","crosshair"),it.Factory.addGetterSetter(Q,"rotationSnapTolerance",5,(0,Ge.getNumberValidator)()),it.Factory.addGetterSetter(Q,"borderEnabled",!0),it.Factory.addGetterSetter(Q,"anchorStroke","rgb(0, 161, 255)"),it.Factory.addGetterSetter(Q,"anchorStrokeWidth",1,(0,Ge.getNumberValidator)()),it.Factory.addGetterSetter(Q,"anchorFill","white"),it.Factory.addGetterSetter(Q,"anchorCornerRadius",0,(0,Ge.getNumberValidator)()),it.Factory.addGetterSetter(Q,"borderStroke","rgb(0, 161, 255)"),it.Factory.addGetterSetter(Q,"borderStrokeWidth",1,(0,Ge.getNumberValidator)()),it.Factory.addGetterSetter(Q,"borderDash"),it.Factory.addGetterSetter(Q,"keepRatio",!0),it.Factory.addGetterSetter(Q,"shiftBehavior","default"),it.Factory.addGetterSetter(Q,"centeredScaling",!1),it.Factory.addGetterSetter(Q,"ignoreStroke",!1),it.Factory.addGetterSetter(Q,"padding",0,(0,Ge.getNumberValidator)()),it.Factory.addGetterSetter(Q,"node"),it.Factory.addGetterSetter(Q,"nodes"),it.Factory.addGetterSetter(Q,"boundBoxFunc"),it.Factory.addGetterSetter(Q,"anchorDragBoundFunc"),it.Factory.addGetterSetter(Q,"anchorStyleFunc"),it.Factory.addGetterSetter(Q,"shouldOverdrawWholeArea",!1),it.Factory.addGetterSetter(Q,"useSingleNodeRotation",!0),it.Factory.backCompat(Q,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.Wedge=void 0;const Qr=X,d4=St,f4=Y,Mu=N,g4=Y;class ye extends d4.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,f4.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Jr.Wedge=ye,ye.prototype.className="Wedge",ye.prototype._centroid=!0,ye.prototype._attrsAffectingSize=["radius"],(0,g4._registerNode)(ye),Qr.Factory.addGetterSetter(ye,"radius",0,(0,Mu.getNumberValidator)()),Qr.Factory.addGetterSetter(ye,"angle",0,(0,Mu.getNumberValidator)()),Qr.Factory.addGetterSetter(ye,"clockwise",!1),Qr.Factory.backCompat(ye,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var ts={};Object.defineProperty(ts,"__esModule",{value:!0}),ts.Blur=void 0;const Ru=X,p4=dt,m4=N;function Du(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var _4=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],v4=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function y4(i,t){var e=i.data,n=i.width,r=i.height,s,a,o,h,l,c,d,f,u,g,p,_,y,b,m,v,w,S,T,C,k,x,E,M,D=t+t+1,O=n-1,I=r-1,H=t+1,j=H*(H+1)/2,$=new Du,et=null,G=$,z=null,W=null,J=_4[t],lt=v4[t];for(o=1;o<D;o++)G=G.next=new Du,o===H&&(et=G);for(G.next=$,d=c=0,a=0;a<r;a++){for(v=w=S=T=f=u=g=p=0,_=H*(C=e[c]),y=H*(k=e[c+1]),b=H*(x=e[c+2]),m=H*(E=e[c+3]),f+=j*C,u+=j*k,g+=j*x,p+=j*E,G=$,o=0;o<H;o++)G.r=C,G.g=k,G.b=x,G.a=E,G=G.next;for(o=1;o<H;o++)h=c+((O<o?O:o)<<2),f+=(G.r=C=e[h])*(M=H-o),u+=(G.g=k=e[h+1])*M,g+=(G.b=x=e[h+2])*M,p+=(G.a=E=e[h+3])*M,v+=C,w+=k,S+=x,T+=E,G=G.next;for(z=$,W=et,s=0;s<n;s++)e[c+3]=E=p*J>>lt,E!==0?(E=255/E,e[c]=(f*J>>lt)*E,e[c+1]=(u*J>>lt)*E,e[c+2]=(g*J>>lt)*E):e[c]=e[c+1]=e[c+2]=0,f-=_,u-=y,g-=b,p-=m,_-=z.r,y-=z.g,b-=z.b,m-=z.a,h=d+((h=s+t+1)<O?h:O)<<2,v+=z.r=e[h],w+=z.g=e[h+1],S+=z.b=e[h+2],T+=z.a=e[h+3],f+=v,u+=w,g+=S,p+=T,z=z.next,_+=C=W.r,y+=k=W.g,b+=x=W.b,m+=E=W.a,v-=C,w-=k,S-=x,T-=E,W=W.next,c+=4;d+=n}for(s=0;s<n;s++){for(w=S=T=v=u=g=p=f=0,c=s<<2,_=H*(C=e[c]),y=H*(k=e[c+1]),b=H*(x=e[c+2]),m=H*(E=e[c+3]),f+=j*C,u+=j*k,g+=j*x,p+=j*E,G=$,o=0;o<H;o++)G.r=C,G.g=k,G.b=x,G.a=E,G=G.next;for(l=n,o=1;o<=t;o++)c=l+s<<2,f+=(G.r=C=e[c])*(M=H-o),u+=(G.g=k=e[c+1])*M,g+=(G.b=x=e[c+2])*M,p+=(G.a=E=e[c+3])*M,v+=C,w+=k,S+=x,T+=E,G=G.next,o<I&&(l+=n);for(c=s,z=$,W=et,a=0;a<r;a++)h=c<<2,e[h+3]=E=p*J>>lt,E>0?(E=255/E,e[h]=(f*J>>lt)*E,e[h+1]=(u*J>>lt)*E,e[h+2]=(g*J>>lt)*E):e[h]=e[h+1]=e[h+2]=0,f-=_,u-=y,g-=b,p-=m,_-=z.r,y-=z.g,b-=z.b,m-=z.a,h=s+((h=a+H)<I?h:I)*n<<2,f+=v+=z.r=e[h],u+=w+=z.g=e[h+1],g+=S+=z.b=e[h+2],p+=T+=z.a=e[h+3],z=z.next,_+=C=W.r,y+=k=W.g,b+=x=W.b,m+=E=W.a,v-=C,w-=k,S-=x,T-=E,W=W.next,c+=n}}const b4=function(t){var e=Math.round(this.blurRadius());e>0&&y4(t,e)};ts.Blur=b4,Ru.Factory.addGetterSetter(p4.Node,"blurRadius",0,(0,m4.getNumberValidator)(),Ru.Factory.afterSetFilter);var es={};Object.defineProperty(es,"__esModule",{value:!0}),es.Brighten=void 0;const Lu=X,w4=dt,S4=N,C4=function(i){var t=this.brightness()*255,e=i.data,n=e.length,r;for(r=0;r<n;r+=4)e[r]+=t,e[r+1]+=t,e[r+2]+=t};es.Brighten=C4,Lu.Factory.addGetterSetter(w4.Node,"brightness",0,(0,S4.getNumberValidator)(),Lu.Factory.afterSetFilter);var is={};Object.defineProperty(is,"__esModule",{value:!0}),is.Contrast=void 0;const Ou=X,x4=dt,E4=N,T4=function(i){var t=Math.pow((this.contrast()+100)/100,2),e=i.data,n=e.length,r=150,s=150,a=150,o;for(o=0;o<n;o+=4)r=e[o],s=e[o+1],a=e[o+2],r/=255,r-=.5,r*=t,r+=.5,r*=255,s/=255,s-=.5,s*=t,s+=.5,s*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,r=r<0?0:r>255?255:r,s=s<0?0:s>255?255:s,a=a<0?0:a>255?255:a,e[o]=r,e[o+1]=s,e[o+2]=a};is.Contrast=T4,Ou.Factory.addGetterSetter(x4.Node,"contrast",0,(0,E4.getNumberValidator)(),Ou.Factory.afterSetFilter);var ns={};Object.defineProperty(ns,"__esModule",{value:!0}),ns.Emboss=void 0;const Be=X,rs=dt,k4=gt,Iu=N,A4=function(i){var t=this.embossStrength()*10,e=this.embossWhiteLevel()*255,n=this.embossDirection(),r=this.embossBlend(),s=0,a=0,o=i.data,h=i.width,l=i.height,c=h*4,d=l;switch(n){case"top-left":s=-1,a=-1;break;case"top":s=-1,a=0;break;case"top-right":s=-1,a=1;break;case"right":s=0,a=1;break;case"bottom-right":s=1,a=1;break;case"bottom":s=1,a=0;break;case"bottom-left":s=1,a=-1;break;case"left":s=0,a=-1;break;default:k4.Util.error("Unknown emboss direction: "+n)}do{var f=(d-1)*c,u=s;d+u<1&&(u=0),d+u>l&&(u=0);var g=(d-1+u)*h*4,p=h;do{var _=f+(p-1)*4,y=a;p+y<1&&(y=0),p+y>h&&(y=0);var b=g+(p-1+y)*4,m=o[_]-o[b],v=o[_+1]-o[b+1],w=o[_+2]-o[b+2],S=m,T=S>0?S:-S,C=v>0?v:-v,k=w>0?w:-w;if(C>T&&(S=v),k>T&&(S=w),S*=t,r){var x=o[_]+S,E=o[_+1]+S,M=o[_+2]+S;o[_]=x>255?255:x<0?0:x,o[_+1]=E>255?255:E<0?0:E,o[_+2]=M>255?255:M<0?0:M}else{var D=e-S;D<0?D=0:D>255&&(D=255),o[_]=o[_+1]=o[_+2]=D}}while(--p)}while(--d)};ns.Emboss=A4,Be.Factory.addGetterSetter(rs.Node,"embossStrength",.5,(0,Iu.getNumberValidator)(),Be.Factory.afterSetFilter),Be.Factory.addGetterSetter(rs.Node,"embossWhiteLevel",.5,(0,Iu.getNumberValidator)(),Be.Factory.afterSetFilter),Be.Factory.addGetterSetter(rs.Node,"embossDirection","top-left",null,Be.Factory.afterSetFilter),Be.Factory.addGetterSetter(rs.Node,"embossBlend",!1,null,Be.Factory.afterSetFilter);var ss={};Object.defineProperty(ss,"__esModule",{value:!0}),ss.Enhance=void 0;const Fu=X,P4=dt,M4=N;function fo(i,t,e,n,r){var s=e-t,a=r-n,o;return s===0?n+a/2:a===0?n:(o=(i-t)/s,o=a*o+n,o)}const R4=function(i){var t=i.data,e=t.length,n=t[0],r=n,s,a=t[1],o=a,h,l=t[2],c=l,d,f,u=this.enhance();if(u!==0){for(f=0;f<e;f+=4)s=t[f+0],s<n?n=s:s>r&&(r=s),h=t[f+1],h<a?a=h:h>o&&(o=h),d=t[f+2],d<l?l=d:d>c&&(c=d);r===n&&(r=255,n=0),o===a&&(o=255,a=0),c===l&&(c=255,l=0);var g,p,_,y,b,m,v,w,S;for(u>0?(p=r+u*(255-r),_=n-u*(n-0),b=o+u*(255-o),m=a-u*(a-0),w=c+u*(255-c),S=l-u*(l-0)):(g=(r+n)*.5,p=r+u*(r-g),_=n+u*(n-g),y=(o+a)*.5,b=o+u*(o-y),m=a+u*(a-y),v=(c+l)*.5,w=c+u*(c-v),S=l+u*(l-v)),f=0;f<e;f+=4)t[f+0]=fo(t[f+0],n,r,_,p),t[f+1]=fo(t[f+1],a,o,m,b),t[f+2]=fo(t[f+2],l,c,S,w)}};ss.Enhance=R4,Fu.Factory.addGetterSetter(P4.Node,"enhance",0,(0,M4.getNumberValidator)(),Fu.Factory.afterSetFilter);var as={};Object.defineProperty(as,"__esModule",{value:!0}),as.Grayscale=void 0;const D4=function(i){var t=i.data,e=t.length,n,r;for(n=0;n<e;n+=4)r=.34*t[n]+.5*t[n+1]+.16*t[n+2],t[n]=r,t[n+1]=r,t[n+2]=r};as.Grayscale=D4;var os={};Object.defineProperty(os,"__esModule",{value:!0}),os.HSL=void 0;const Ni=X,go=dt,po=N;Ni.Factory.addGetterSetter(go.Node,"hue",0,(0,po.getNumberValidator)(),Ni.Factory.afterSetFilter),Ni.Factory.addGetterSetter(go.Node,"saturation",0,(0,po.getNumberValidator)(),Ni.Factory.afterSetFilter),Ni.Factory.addGetterSetter(go.Node,"luminance",0,(0,po.getNumberValidator)(),Ni.Factory.afterSetFilter);const L4=function(i){var t=i.data,e=t.length,n=1,r=Math.pow(2,this.saturation()),s=Math.abs(this.hue()+360)%360,a=this.luminance()*127,o,h=n*r*Math.cos(s*Math.PI/180),l=n*r*Math.sin(s*Math.PI/180),c=.299*n+.701*h+.167*l,d=.587*n-.587*h+.33*l,f=.114*n-.114*h-.497*l,u=.299*n-.299*h-.328*l,g=.587*n+.413*h+.035*l,p=.114*n-.114*h+.293*l,_=.299*n-.3*h+1.25*l,y=.587*n-.586*h-1.05*l,b=.114*n+.886*h-.2*l,m,v,w,S;for(o=0;o<e;o+=4)m=t[o+0],v=t[o+1],w=t[o+2],S=t[o+3],t[o+0]=c*m+d*v+f*w+a,t[o+1]=u*m+g*v+p*w+a,t[o+2]=_*m+y*v+b*w+a,t[o+3]=S};os.HSL=L4;var ls={};Object.defineProperty(ls,"__esModule",{value:!0}),ls.HSV=void 0;const Ui=X,mo=dt,_o=N,O4=function(i){var t=i.data,e=t.length,n=Math.pow(2,this.value()),r=Math.pow(2,this.saturation()),s=Math.abs(this.hue()+360)%360,a,o=n*r*Math.cos(s*Math.PI/180),h=n*r*Math.sin(s*Math.PI/180),l=.299*n+.701*o+.167*h,c=.587*n-.587*o+.33*h,d=.114*n-.114*o-.497*h,f=.299*n-.299*o-.328*h,u=.587*n+.413*o+.035*h,g=.114*n-.114*o+.293*h,p=.299*n-.3*o+1.25*h,_=.587*n-.586*o-1.05*h,y=.114*n+.886*o-.2*h,b,m,v,w;for(a=0;a<e;a+=4)b=t[a+0],m=t[a+1],v=t[a+2],w=t[a+3],t[a+0]=l*b+c*m+d*v,t[a+1]=f*b+u*m+g*v,t[a+2]=p*b+_*m+y*v,t[a+3]=w};ls.HSV=O4,Ui.Factory.addGetterSetter(mo.Node,"hue",0,(0,_o.getNumberValidator)(),Ui.Factory.afterSetFilter),Ui.Factory.addGetterSetter(mo.Node,"saturation",0,(0,_o.getNumberValidator)(),Ui.Factory.afterSetFilter),Ui.Factory.addGetterSetter(mo.Node,"value",0,(0,_o.getNumberValidator)(),Ui.Factory.afterSetFilter);var hs={};Object.defineProperty(hs,"__esModule",{value:!0}),hs.Invert=void 0;const I4=function(i){var t=i.data,e=t.length,n;for(n=0;n<e;n+=4)t[n]=255-t[n],t[n+1]=255-t[n+1],t[n+2]=255-t[n+2]};hs.Invert=I4;var cs={};Object.defineProperty(cs,"__esModule",{value:!0}),cs.Kaleidoscope=void 0;const us=X,Nu=dt,Uu=gt,Gu=N;var F4=function(i,t,e){var n=i.data,r=t.data,s=i.width,a=i.height,o=e.polarCenterX||s/2,h=e.polarCenterY||a/2,l,c,d,f=0,u=0,g=0,p=0,_,y=Math.sqrt(o*o+h*h);c=s-o,d=a-h,_=Math.sqrt(c*c+d*d),y=_>y?_:y;var b=a,m=s,v,w,S=360/m*Math.PI/180,T,C;for(w=0;w<m;w+=1)for(T=Math.sin(w*S),C=Math.cos(w*S),v=0;v<b;v+=1)c=Math.floor(o+y*v/b*C),d=Math.floor(h+y*v/b*T),l=(d*s+c)*4,f=n[l+0],u=n[l+1],g=n[l+2],p=n[l+3],l=(w+v*s)*4,r[l+0]=f,r[l+1]=u,r[l+2]=g,r[l+3]=p},N4=function(i,t,e){var n=i.data,r=t.data,s=i.width,a=i.height,o=e.polarCenterX||s/2,h=e.polarCenterY||a/2,l,c,d,f,u,g=0,p=0,_=0,y=0,b,m=Math.sqrt(o*o+h*h);c=s-o,d=a-h,b=Math.sqrt(c*c+d*d),m=b>m?b:m;var v=a,w=s,S,T,C=e.polarRotation||0,k,x;for(c=0;c<s;c+=1)for(d=0;d<a;d+=1)f=c-o,u=d-h,S=Math.sqrt(f*f+u*u)*v/m,T=(Math.atan2(u,f)*180/Math.PI+360+C)%360,T=T*w/360,k=Math.floor(T),x=Math.floor(S),l=(x*s+k)*4,g=n[l+0],p=n[l+1],_=n[l+2],y=n[l+3],l=(d*s+c)*4,r[l+0]=g,r[l+1]=p,r[l+2]=_,r[l+3]=y};const U4=function(i){var t=i.width,e=i.height,n,r,s,a,o,h,l,c,d,f,u=Math.round(this.kaleidoscopePower()),g=Math.round(this.kaleidoscopeAngle()),p=Math.floor(t*(g%360)/360);if(!(u<1)){var _=Uu.Util.createCanvasElement();_.width=t,_.height=e;var y=_.getContext("2d").getImageData(0,0,t,e);Uu.Util.releaseCanvas(_),F4(i,y,{polarCenterX:t/2,polarCenterY:e/2});for(var b=t/Math.pow(2,u);b<=8;)b=b*2,u-=1;b=Math.ceil(b);var m=b,v=0,w=m,S=1;for(p+b>t&&(v=m,w=0,S=-1),r=0;r<e;r+=1)for(n=v;n!==w;n+=S)s=Math.round(n+p)%t,d=(t*r+s)*4,o=y.data[d+0],h=y.data[d+1],l=y.data[d+2],c=y.data[d+3],f=(t*r+n)*4,y.data[f+0]=o,y.data[f+1]=h,y.data[f+2]=l,y.data[f+3]=c;for(r=0;r<e;r+=1)for(m=Math.floor(b),a=0;a<u;a+=1){for(n=0;n<m+1;n+=1)d=(t*r+n)*4,o=y.data[d+0],h=y.data[d+1],l=y.data[d+2],c=y.data[d+3],f=(t*r+m*2-n-1)*4,y.data[f+0]=o,y.data[f+1]=h,y.data[f+2]=l,y.data[f+3]=c;m*=2}N4(y,i,{polarRotation:0})}};cs.Kaleidoscope=U4,us.Factory.addGetterSetter(Nu.Node,"kaleidoscopePower",2,(0,Gu.getNumberValidator)(),us.Factory.afterSetFilter),us.Factory.addGetterSetter(Nu.Node,"kaleidoscopeAngle",0,(0,Gu.getNumberValidator)(),us.Factory.afterSetFilter);var ds={};Object.defineProperty(ds,"__esModule",{value:!0}),ds.Mask=void 0;const Bu=X,G4=dt,B4=N;function fs(i,t,e){var n=(e*i.width+t)*4,r=[];return r.push(i.data[n++],i.data[n++],i.data[n++],i.data[n++]),r}function Ln(i,t){return Math.sqrt(Math.pow(i[0]-t[0],2)+Math.pow(i[1]-t[1],2)+Math.pow(i[2]-t[2],2))}function z4(i){for(var t=[0,0,0],e=0;e<i.length;e++)t[0]+=i[e][0],t[1]+=i[e][1],t[2]+=i[e][2];return t[0]/=i.length,t[1]/=i.length,t[2]/=i.length,t}function H4(i,t){var e=fs(i,0,0),n=fs(i,i.width-1,0),r=fs(i,0,i.height-1),s=fs(i,i.width-1,i.height-1),a=t||10;if(Ln(e,n)<a&&Ln(n,s)<a&&Ln(s,r)<a&&Ln(r,e)<a){for(var o=z4([n,e,s,r]),h=[],l=0;l<i.width*i.height;l++){var c=Ln(o,[i.data[l*4],i.data[l*4+1],i.data[l*4+2]]);h[l]=c<a?0:255}return h}}function j4(i,t){for(var e=0;e<i.width*i.height;e++)i.data[4*e+3]=t[e]}function V4(i,t,e){for(var n=[1,1,1,1,0,1,1,1,1],r=Math.round(Math.sqrt(n.length)),s=Math.floor(r/2),a=[],o=0;o<e;o++)for(var h=0;h<t;h++){for(var l=o*t+h,c=0,d=0;d<r;d++)for(var f=0;f<r;f++){var u=o+d-s,g=h+f-s;if(u>=0&&u<e&&g>=0&&g<t){var p=u*t+g,_=n[d*r+f];c+=i[p]*_}}a[l]=c===2040?255:0}return a}function $4(i,t,e){for(var n=[1,1,1,1,1,1,1,1,1],r=Math.round(Math.sqrt(n.length)),s=Math.floor(r/2),a=[],o=0;o<e;o++)for(var h=0;h<t;h++){for(var l=o*t+h,c=0,d=0;d<r;d++)for(var f=0;f<r;f++){var u=o+d-s,g=h+f-s;if(u>=0&&u<e&&g>=0&&g<t){var p=u*t+g,_=n[d*r+f];c+=i[p]*_}}a[l]=c>=1020?255:0}return a}function X4(i,t,e){for(var n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],r=Math.round(Math.sqrt(n.length)),s=Math.floor(r/2),a=[],o=0;o<e;o++)for(var h=0;h<t;h++){for(var l=o*t+h,c=0,d=0;d<r;d++)for(var f=0;f<r;f++){var u=o+d-s,g=h+f-s;if(u>=0&&u<e&&g>=0&&g<t){var p=u*t+g,_=n[d*r+f];c+=i[p]*_}}a[l]=c}return a}const Y4=function(i){var t=this.threshold(),e=H4(i,t);return e&&(e=V4(e,i.width,i.height),e=$4(e,i.width,i.height),e=X4(e,i.width,i.height),j4(i,e)),i};ds.Mask=Y4,Bu.Factory.addGetterSetter(G4.Node,"threshold",0,(0,B4.getNumberValidator)(),Bu.Factory.afterSetFilter);var gs={};Object.defineProperty(gs,"__esModule",{value:!0}),gs.Noise=void 0;const zu=X,W4=dt,q4=N,K4=function(i){var t=this.noise()*255,e=i.data,n=e.length,r=t/2,s;for(s=0;s<n;s+=4)e[s+0]+=r-2*r*Math.random(),e[s+1]+=r-2*r*Math.random(),e[s+2]+=r-2*r*Math.random()};gs.Noise=K4,zu.Factory.addGetterSetter(W4.Node,"noise",.2,(0,q4.getNumberValidator)(),zu.Factory.afterSetFilter);var ps={};Object.defineProperty(ps,"__esModule",{value:!0}),ps.Pixelate=void 0;const Hu=X,Z4=gt,J4=dt,Q4=N,t_=function(i){var t=Math.ceil(this.pixelSize()),e=i.width,n=i.height,r,s,a,o,h,l,c,d=Math.ceil(e/t),f=Math.ceil(n/t),u,g,p,_,y,b,m,v=i.data;if(t<=0){Z4.Util.error("pixelSize value can not be <= 0");return}for(y=0;y<d;y+=1)for(b=0;b<f;b+=1){for(o=0,h=0,l=0,c=0,u=y*t,g=u+t,p=b*t,_=p+t,m=0,r=u;r<g;r+=1)if(!(r>=e))for(s=p;s<_;s+=1)s>=n||(a=(e*s+r)*4,o+=v[a+0],h+=v[a+1],l+=v[a+2],c+=v[a+3],m+=1);for(o=o/m,h=h/m,l=l/m,c=c/m,r=u;r<g;r+=1)if(!(r>=e))for(s=p;s<_;s+=1)s>=n||(a=(e*s+r)*4,v[a+0]=o,v[a+1]=h,v[a+2]=l,v[a+3]=c)}};ps.Pixelate=t_,Hu.Factory.addGetterSetter(J4.Node,"pixelSize",8,(0,Q4.getNumberValidator)(),Hu.Factory.afterSetFilter);var ms={};Object.defineProperty(ms,"__esModule",{value:!0}),ms.Posterize=void 0;const ju=X,e_=dt,i_=N,n_=function(i){var t=Math.round(this.levels()*254)+1,e=i.data,n=e.length,r=255/t,s;for(s=0;s<n;s+=1)e[s]=Math.floor(e[s]/r)*r};ms.Posterize=n_,ju.Factory.addGetterSetter(e_.Node,"levels",.5,(0,i_.getNumberValidator)(),ju.Factory.afterSetFilter);var _s={};Object.defineProperty(_s,"__esModule",{value:!0}),_s.RGB=void 0;const vs=X,vo=dt,r_=N,s_=function(i){var t=i.data,e=t.length,n=this.red(),r=this.green(),s=this.blue(),a,o;for(a=0;a<e;a+=4)o=(.34*t[a]+.5*t[a+1]+.16*t[a+2])/255,t[a]=o*n,t[a+1]=o*r,t[a+2]=o*s,t[a+3]=t[a+3]};_s.RGB=s_,vs.Factory.addGetterSetter(vo.Node,"red",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),vs.Factory.addGetterSetter(vo.Node,"green",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),vs.Factory.addGetterSetter(vo.Node,"blue",0,r_.RGBComponent,vs.Factory.afterSetFilter);var ys={};Object.defineProperty(ys,"__esModule",{value:!0}),ys.RGBA=void 0;const On=X,bs=dt,a_=N,o_=function(i){var t=i.data,e=t.length,n=this.red(),r=this.green(),s=this.blue(),a=this.alpha(),o,h;for(o=0;o<e;o+=4)h=1-a,t[o]=n*a+t[o]*h,t[o+1]=r*a+t[o+1]*h,t[o+2]=s*a+t[o+2]*h};ys.RGBA=o_,On.Factory.addGetterSetter(bs.Node,"red",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),On.Factory.addGetterSetter(bs.Node,"green",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),On.Factory.addGetterSetter(bs.Node,"blue",0,a_.RGBComponent,On.Factory.afterSetFilter),On.Factory.addGetterSetter(bs.Node,"alpha",1,function(i){return this._filterUpToDate=!1,i>1?1:i<0?0:i});var ws={};Object.defineProperty(ws,"__esModule",{value:!0}),ws.Sepia=void 0;const l_=function(i){var t=i.data,e=t.length,n,r,s,a;for(n=0;n<e;n+=4)r=t[n+0],s=t[n+1],a=t[n+2],t[n+0]=Math.min(255,r*.393+s*.769+a*.189),t[n+1]=Math.min(255,r*.349+s*.686+a*.168),t[n+2]=Math.min(255,r*.272+s*.534+a*.131)};ws.Sepia=l_;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.Solarize=void 0;const h_=function(i){var t=i.data,e=i.width,n=i.height,r=e*4,s=n;do{var a=(s-1)*r,o=e;do{var h=a+(o-1)*4,l=t[h],c=t[h+1],d=t[h+2];l>127&&(l=255-l),c>127&&(c=255-c),d>127&&(d=255-d),t[h]=l,t[h+1]=c,t[h+2]=d}while(--o)}while(--s)};Ss.Solarize=h_;var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.Threshold=void 0;const Vu=X,c_=dt,u_=N,d_=function(i){var t=this.threshold()*255,e=i.data,n=e.length,r;for(r=0;r<n;r+=1)e[r]=e[r]<t?0:255};Cs.Threshold=d_,Vu.Factory.addGetterSetter(c_.Node,"threshold",.5,(0,u_.getNumberValidator)(),Vu.Factory.afterSetFilter),Object.defineProperty(br,"__esModule",{value:!0}),br.Konva=void 0;const $u=Rc,f_=Dr,g_=Ir,p_=Ur,m_=Gr,__=Br,Xu=Ii,v_=An,y_=Di,b_=Mn,w_=jr,S_=Vr,C_=$r,x_=Xr,E_=ci,T_=qr,k_=Kr,A_=Jr,P_=ts,M_=es,R_=is,D_=ns,L_=ss,O_=as,I_=os,F_=ls,N_=hs,U_=cs,G_=ds,B_=gs,z_=ps,H_=ms,j_=_s,V_=ys,$_=ws,X_=Ss,Y_=Cs;br.Konva=$u.Konva.Util._assign($u.Konva,{Arc:f_.Arc,Arrow:g_.Arrow,Circle:p_.Circle,Ellipse:m_.Ellipse,Image:__.Image,Label:Xu.Label,Tag:Xu.Tag,Line:v_.Line,Path:y_.Path,Rect:b_.Rect,RegularPolygon:w_.RegularPolygon,Ring:S_.Ring,Sprite:C_.Sprite,Star:x_.Star,Text:E_.Text,TextPath:T_.TextPath,Transformer:k_.Transformer,Wedge:A_.Wedge,Filters:{Blur:P_.Blur,Brighten:M_.Brighten,Contrast:R_.Contrast,Emboss:D_.Emboss,Enhance:L_.Enhance,Grayscale:O_.Grayscale,HSL:I_.HSL,HSV:F_.HSV,Invert:N_.Invert,Kaleidoscope:U_.Kaleidoscope,Mask:G_.Mask,Noise:B_.Noise,Pixelate:z_.Pixelate,Posterize:H_.Posterize,RGB:j_.RGB,RGBA:V_.RGBA,Sepia:$_.Sepia,Solarize:X_.Solarize,Threshold:Y_.Threshold}});var W_=Ga.exports;Object.defineProperty(W_,"__esModule",{value:!0});const q_=br;Ga.exports=q_.Konva;var K_=Ga.exports;const U=Gl(K_),Z_=U.Ellipse.prototype.toObject;U.Ellipse.prototype.toObject=function(){const i=Z_.call(this);return{...i,attrs:{...i.attrs,strokeWidth:this.strokeWidth(),dash:this.dash()}}};const J_=U.Line.prototype.toObject;U.Line.prototype.toObject=function(){const i=J_.call(this);return{...i,attrs:{...i.attrs,x:this.getAbsolutePosition().x,y:this.getAbsolutePosition().y,strokeWidth:this.strokeWidth(),dash:this.dash()}}};const Q_=U.Node.prototype.toObject,tv=function(){const i=Q_.call(this);return{...i,attrs:{...i.attrs,x:this.getAbsolutePosition().x,y:this.getAbsolutePosition().y,scaleX:this.getAbsoluteScale().x,scaleY:this.getAbsoluteScale().y,rotation:this.getAbsoluteRotation(),opacity:this.getAbsoluteOpacity()}}};U.Node.prototype.toObject=tv;const ev=U.Node.prototype.remove;U.Node.prototype.remove=function(){return ev.call(this),this.fire("removed",{target:this}),this};const iv=U.Node.prototype.moveUp;U.Node.prototype.moveUp=function(){const i=iv.call(this);return i&&this.fire("move:up"),i};const nv=U.Node.prototype.moveDown;U.Node.prototype.moveDown=function(){const i=nv.call(this);return i&&this.fire("move:down"),i};const rv=U.Node.prototype.moveToTop;U.Node.prototype.moveToTop=function(){const i=rv.call(this);return i&&this.fire("move:top"),i};const sv=U.Node.prototype.moveToBottom;U.Node.prototype.moveToBottom=function(){const i=sv.call(this);return i&&this.fire("move:bottom"),i};const av=U.Node.prototype.moveTo;U.Node.prototype.moveTo=function(i){const t=av.call(this,i);return this.fire("move:to"),t};const ov=U.Rect.prototype.toObject;U.Rect.prototype.toObject=function(){const i=ov.call(this);return{...i,attrs:{...i.attrs,strokeWidth:this.strokeWidth(),dash:this.dash(),cornerRadius:this.cornerRadius()}}};const lv=U.RegularPolygon.prototype.toObject;U.RegularPolygon.prototype.toObject=function(){const i=lv.call(this);return{...i,attrs:{...i.attrs,strokeWidth:this.strokeWidth(),dash:this.dash()}}};const hv=U.Text.prototype.toObject;U.Text.prototype.toObject=function(){const i=hv.call(this);return{...i,attrs:{...i.attrs,strokeWidth:this.strokeWidth()}}};const cv=U.Image.prototype.toObject;U.Image.prototype.toObject=function(){const i=cv.call(this);return{...i,attrs:{...i.attrs,strokeWidth:this.strokeWidth(),dash:this.dash(),image:this.image()}}};const Yu=(i,t)=>{if(i.length!==t.length)return!1;for(let e=0;e<i.length;e++){const n=i[e],r=t.find(s=>s.id===n.id);if(!r||!uv(n,r))return!1}return!0},uv=(i,t)=>i.attrs.id===i.attrs.id&&i._id===t._id,Gi=i=>i.reduce((t,e)=>[...t,...e.toArray()],[]),dv=i=>{i.sort(function(e,n){return e-n});const t=Math.floor(i.length/2);return i[t]},Wu=i=>{const t=Math.atan2(i[1],i[0]),e=Math.pow(i[0],2)+Math.pow(i[1],2),n=Math.sqrt(e),r=(i[0]*i[3]-i[2]*i[1])/n;return{rotation:t/(Math.PI/180),scaleX:n,scaleY:r,x:i[4],y:i[5]}},fv=(i,t)=>{const e=i.getTransform().getMatrix(),n=t.getTransform().getMatrix(),r=e[0],s=e[1],a=e[2],o=e[3],h=e[4],l=e[5],c=n[0],d=n[1],f=n[2],u=n[3],g=n[4],p=n[5],_=c*u,y=d*f,b=(f*s-r*u)/(y-_),m=(c*s-r*d)/(_-y),v=(f*o-a*u)/(y-_),w=(c*o-a*d)/(_-y),S=(f*(l-p)+u*(g-h))/(y-_),T=(c*(l-p)+d*(g-h))/(_-y);return Wu([b,m,v,w,S,T])};class qu{app;constructor(t){this.app=t}}class gv extends qu{constructor(t){super(t),this.app.stage.on("mousedown",this.onMouseDown),this.app.stage.on("mouseup",this.onMouseUp),this.app.stage.on("mousemove",this.onMouseMove),this.app.stage.on("mouseover",this.onMouseOver),this.app.stage.on("mouseout",this.onMouseOut),this.app.stage.on("dblclick",this.onMouseDoubleClick),this.app.stage.on("click",this.onMouseClick),this.app.stage.on("contextmenu",this.onMouseContextmenu),this.app.stage.on("wheel",this.onWheel)}onMouseDown=t=>{t.evt.button===1&&this.app.triggerPanning(!0),!this.app.stage.draggable()&&this.app.emit("mouseDown",t)};onMouseUp=t=>{t.evt.button===1&&this.app.triggerPanning(!1),!this.app.stage.draggable()&&this.app.emit("mouseUp",t)};onMouseMove=t=>{this.app.stage.draggable()||this.app.emit("mouseMove",t)};onMouseOver=t=>{this.app.stage.draggable()||this.app.emit("mouseOver",t)};onMouseOut=t=>{this.app.stage.draggable()||this.app.emit("mouseOut",t)};onMouseDoubleClick=t=>{this.app.stage.draggable()||this.app.emit("mouseDoubleClick",t)};onMouseClick=t=>{this.app.stage.draggable()||this.app.emit("mouseClick",t)};onMouseContextmenu=t=>{this.app.triggerTool(!1),this.app.emit("mouseContextMenu",t),setTimeout(()=>this.app.triggerTool(!0),100)};onWheel=t=>{if(t.evt.preventDefault(),!this.app.config.mousewheel.enabled)return;const e=this.app.stage.scaleX();this.app.emit("canvasZoomStart",e);const n=this.app.stage.getPointerPosition()??new pt(0,0),r=new pt((n.x-this.app.stage.x())/e,(n.y-this.app.stage.y())/e),s=(t.evt.shiftKey&&!t.evt.ctrlKey?t.evt.deltaX:t.evt.deltaY)>0?1:-1;let a=e;s>0?a+=this.app.config.mousewheel.factor:a-=this.app.config.mousewheel.factor,a=Math.min(Math.max(a,this.app.config.scale.min),this.app.config.scale.max),this.app.stage.scale({x:a,y:a}),this.app.stage.position({x:n.x-r.x*a,y:n.y-r.y*a}),this.app.emit("canvasZoomEnd",a)};destroy(){this.app.stage.off("mousedown",this.onMouseDown),this.app.stage.off("mouseup",this.onMouseUp),this.app.stage.off("mousemove",this.onMouseMove),this.app.stage.off("mouseover",this.onMouseOver),this.app.stage.off("mouseout",this.onMouseOut),this.app.stage.off("dblclick",this.onMouseDoubleClick),this.app.stage.off("click",this.onMouseClick),this.app.stage.off("contextmenu",this.onMouseContextmenu),this.app.stage.off("wheel",this.onWheel)}}const Ku=i=>typeof i=="function";class pv extends qu{currentTool=null;enable=!0;constructor(t){super(t),this.app.on("mouseDown",this.onMousedown),this.app.on("mouseMove",this.onMousemove),this.app.on("mouseUp",this.onMouseup),this.app.on("mouseClick",this.onClick),this.app.on("mouseDoubleClick",this.onDoubleClick)}get available(){return this.currentTool!==null&&this.enable&&!this.app.stage.draggable()}async setTool(t){const e=this.currentTool;e?.name!==t.name&&(e?.hooks&&Ku(e?.hooks?.onInactive)&&await e.hooks.onInactive?.(this.app,e),this.currentTool=t,this.currentTool?.hooks&&Ku(this.currentTool?.hooks?.onActive)&&await this.currentTool.hooks.onActive?.(this.app,this.currentTool),this.app.render(),this.app.emit("toolChanged",e,t))}trigger(t){const e=this.enable;t===void 0?this.enable=!this.enable:this.enable=t,this.currentTool?.enableChanged?.(e,this.enable)}onMousedown=t=>{!this.available||!this.currentTool?.mousedown||t.evt.button!==0||this.currentTool.mousedown({event:t,pointer:this.app.pointer,app:this.app})};onMouseup=t=>{!this.available||!this.currentTool?.mouseup||t.evt.button!==0||this.currentTool.mouseup({event:t,pointer:this.app.pointer,app:this.app})};onMousemove=t=>{!this.available||!this.currentTool?.mousemove||t.evt.button!==0||this.currentTool.mousemove({event:t,pointer:this.app.pointer,app:this.app})};onClick=t=>{!this.available||!this.currentTool?.click||t.evt.button!==0||this.currentTool.click({event:t,pointer:this.app.pointer,app:this.app})};onDoubleClick=t=>{!this.available||!this.currentTool?.doubleClick||t.evt.button!==0||this.currentTool.doubleClick({event:t,pointer:this.app.pointer,app:this.app})};destroy(){this.app.off("mouseDown",this.onMousedown),this.app.off("mouseMove",this.onMousemove),this.app.off("mouseUp",this.onMouseup),this.app.off("mouseClick",this.onClick),this.app.off("mouseDoubleClick",this.onDoubleClick),this.currentTool=null}}var mv=Object.defineProperty,_v=Object.getOwnPropertyDescriptor,ze=(i,t,e,n)=>{for(var r=n>1?void 0:n?_v(t,e):t,s=i.length-1,a;s>=0;s--)(a=i[s])&&(r=(n?a(t,e,r):a(r))||r);return n&&r&&mv(t,e,r),r};class vv{name="alignmentPlugin";alignment;app;options;keyFns=[];constructor(t){this.options={enabled:!0,...t}}install(t){this.app=t,this.alignment=new be(t,this.options),this.app.alignLeft=function(e){const n=this.app.getPlugin("alignmentPlugin");return n&&n.alignment?.alignLeft(e),this},this.app.alignRight=function(e){const n=this.app.getPlugin("alignmentPlugin");return n&&n.alignment?.alignRight(e),this},this.app.alignTop=function(e){const n=this.app.getPlugin("alignmentPlugin");return n&&n.alignment?.alignTop(e),this},this.app.alignBottom=function(e){const n=this.app.getPlugin("alignmentPlugin");return n&&n.alignment?.alignBottom(e),this},this.app.alignCenterX=function(e){const n=this.app.getPlugin("alignmentPlugin");return n&&n.alignment?.alignCenterX(e),this},this.app.alignCenterY=function(e){const n=this.app.getPlugin("alignmentPlugin");return n&&n.alignment?.alignCenterY(e),this},this.app.dispersionX=function(e){const n=this.app.getPlugin("alignmentPlugin");return n&&n.alignment?.dispersionX(e),this},this.app.dispersionY=function(e){const n=this.app.getPlugin("alignmentPlugin");return n&&n.alignment?.dispersionY(e),this},this.keyFns.push(this.app.domKey.on({key:"a",title:"左对齐",shift:!0},()=>{})),this.keyFns.push(this.app.domKey.on({key:"h",title:"水平居中",shift:!0},()=>{})),this.keyFns.push(this.app.domKey.on({key:"d",title:"右对齐",shift:!0},()=>{})),this.keyFns.push(this.app.domKey.on({key:"w",title:"顶对齐",shift:!0},()=>{})),this.keyFns.push(this.app.domKey.on({key:"v",title:"垂直居中",shift:!0},()=>{})),this.keyFns.push(this.app.domKey.on({key:"s",title:"底对齐",shift:!0},()=>{})),this.keyFns.push(this.app.domKey.on({key:"h",title:"水平分布",ctrl:!0,shift:!0},()=>{})),this.keyFns.push(this.app.domKey.on({key:"v",title:"垂直分布",ctrl:!0,shift:!0},()=>{})),this.app.emit("alignmentInstalled",this)}destroy(){this.keyFns.forEach(t=>t.removeListener?.()),this.keyFns=[],this.app?.emit("alignmentDestroy",this)}enable(){this.alignment&&(this.options.enabled=!0,this.alignment.enabled=!0)}disable(){this.alignment&&(this.options.enabled=!1,this.alignment.enabled=!1)}isEnabled(){return this.options.enabled&&(this.alignment?.enabled??!1)}}function He(i,t,e){const n=e.value;return e.value=function(...r){if(this.enabled)return n.apply(this,r);console.log(`Method ${t} is disabled.`)},e}class be{app;enabled;constructor(t,e){const{enabled:n}=e;this.app=t,this.enabled=n}alignLeft(t){const e=t.map(r=>r.getClientRect()),n=Math.min(...e.map(r=>r.x));this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=e[s].x-n;return a.attrs={...a.attrs,x:a.attrs.x-o},a}))}alignRight(t){const e=t.map(r=>r.getClientRect()),n=Math.max(...e.map(r=>r.x+r.width));this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=n-(e[s].x+e[s].width);return a.attrs={...a.attrs,x:a.attrs.x+o},a}))}alignTop(t){const e=t.map(r=>r.getClientRect()),n=Math.min(...e.map(r=>r.y));this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=e[s].y-n;return a.attrs={...a.attrs,y:a.attrs.y-o},a}))}alignBottom(t){const e=t.map(r=>r.getClientRect()),n=Math.max(...e.map(r=>r.y+r.height));this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=n-(e[s].y+e[s].height);return a.attrs={...a.attrs,y:a.attrs.y+o},a}))}alignCenterX(t){const e=t.map(r=>r.getClientRect()),n=e.reduce((r,s)=>r+(s.x+s.width/2),0)/e.length;this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=n-(e[s].x+e[s].width/2);return a.attrs={...a.attrs,x:a.attrs.x+o},a}))}alignCenterY(t){const e=t.map(r=>r.getClientRect()),n=e.reduce((r,s)=>r+(s.y+s.height/2),0)/e.length;this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=n-(e[s].y+e[s].height/2);return a.attrs={...a.attrs,y:a.attrs.y+o},a}))}dispersionX(t){t.map(r=>r.getClientRect().x+r.getClientRect().width/2).every((r,s,a)=>r===a[0])||this.distributeNodes(t,"x")}dispersionY(t){t.map(r=>r.getClientRect().y+r.getClientRect().height/2).every((r,s,a)=>r===a[0])||this.distributeNodes(t,"y")}distributeNodes(t,e){if(t.length<=2)return;t.sort((d,f)=>d.getClientRect()[e]-f.getClientRect()[e]);const n=t[0],r=t[t.length-1],s=n.getClientRect()[e]+(e==="x"?n.getClientRect().width:n.getClientRect().height),a=r.getClientRect()[e]-s,h=t.slice(1,-1).reduce((d,f)=>d+(e==="x"?f.getClientRect().width:f.getClientRect().height),0),l=Math.max((a-h)/(t.length-1),0);let c=s;this.app.update(...t.map((d,f)=>{const u=d.toObject();if(f===0||f===t.length-1)return u;const g=c+l;return u.attrs[e]=g-d.getClientRect()[e]+u.attrs[e],c=g+(e==="x"?d.getClientRect().width:d.getClientRect().height),u}))}}ze([He],be.prototype,"alignLeft",1),ze([He],be.prototype,"alignRight",1),ze([He],be.prototype,"alignTop",1),ze([He],be.prototype,"alignBottom",1),ze([He],be.prototype,"alignCenterX",1),ze([He],be.prototype,"alignCenterY",1),ze([He],be.prototype,"dispersionX",1),ze([He],be.prototype,"dispersionY",1);class Zu{app;selected;optionLayer;enabled;multipleSelect;hightLightConfig;transformerConfig;rubberConfig;transformer;rubberRect;rubberStartPoint=new pt(0,0);rubberEnable=!1;hightLightRects;constructor(t,e){const{enabled:n,multipleSelect:r,transformer:s,hightLight:a,rubber:o}=e;this.app=t,this.selected=new Map,this.hightLightRects=new Map,this.enabled=n,this.multipleSelect=r,this.transformerConfig=s,this.hightLightConfig=a,this.rubberConfig=o,this.optionLayer=new U.Layer,this.optionLayer.name("pictode:option:layer"),this.app.stage.add(this.optionLayer),this.transformer=new U.Transformer({...this.transformerConfig,shouldOverdrawWholeArea:!1,flipEnabled:!1}),this.transformer.anchorStyleFunc(h=>{["middle-left","middle-right","top-center","bottom-center"].some(c=>h.hasName(c))&&([...this.selected.values()][0]instanceof U.Text||[...this.selected.values()][0]instanceof U.Group||this.selected.size>1)&&h.visible(!1);const l=(c="")=>{const d=h.getStage();!d||!d.content||(d.content.style.cursor=c)};h.on("mousedown",()=>{this.enabled=!1}),h.on("mouseup",()=>{this.enabled=!0}),h.on("mouseenter",()=>{this.enabled=!1,h.hasName("rotater")&&l("grabbing")}),h.on("mouseout",()=>{this.enabled=!0,h.hasName("rotater")&&l()})}),this.optionLayer.add(this.transformer),this.rubberRect=new U.Rect({stroke:this.rubberConfig.stroke,fill:this.rubberConfig.fill,strokeWidth:this.rubberConfig.strokeWidth,strokeScaleEnabled:!1}),this.optionLayer.add(this.rubberRect),this.transformer.on("transformstart",this.onTransformStart),this.transformer.on("transformend",this.onTransformEnd),this.transformer.on("dragstart",this.onDragStart),this.transformer.on("dragend",this.onDragEnd),this.app.on("mouseDown",this.onMouseDown),this.app.on("mouseMove",this.onMouseMove),this.app.on("mouseUp",this.onMouseUp),this.app.on("mouseClick",this.onMouseClick),this.app.on("mouseOut",this.onMouseOut)}handleNodeRemoved=({target:t})=>{this.cancelSelect(t),t.off("removed",this.handleNodeRemoved)};select(...t){this.enabled&&(Yu(t,[...this.selected.values()])||(this.cancelSelect(),this.transformer.nodes(t.filter(e=>(e.draggable(!0),e.on("removed",this.handleNodeRemoved),this.selected.set(e.id(),e),e!==this.rubberRect))),this.setHightRect(...t),this.app.render(),this.app.emit("selectedChanged",Array.from(this.selected.values()))))}cancelSelect(...t){this.selected.size!==0&&(t.length===0&&(t=[...this.selected.values()]),t.forEach(e=>{e.draggable(!1),e.off("removed",this.handleNodeRemoved),this.selected.delete(e.id())}),this.removeHightRect(...t),this.transformer.nodes([...this.selected.values()]),this.app.emit("selectedChanged",Array.from(this.selected.values())))}selectAll(){this.select(...this.app.mainLayer.getChildren())}triggerSelector(t){t===void 0?this.enabled=!this.enabled:this.enabled=t,this.enabled||(this.rubberEnable=!1)}isSelected(t){return this.selected.has(t.id())}getSelectClientRect(){return this.transformer.getClientRect()}setHightRect(...t){this.hightLightRects=t.reduce((e,n)=>{const r=new U.Rect({stroke:this.hightLightConfig.stroke,strokeWidth:this.hightLightConfig.strokeWidth,dash:this.hightLightConfig.dash,fillEnabled:!1,strokeScaleEnabled:!1});this.calculateNodeRect(n,r,this.hightLightConfig.padding??0),this.optionLayer.add(r);const s=()=>requestAnimationFrame(()=>this.calculateNodeRect(n,r,this.hightLightConfig.padding??0));return n.on("dragmove transform xChange yChange",s),e.set(n.id(),{rect:r,transformHandler:s}),e},new Map)}removeHightRect(...t){t.forEach(e=>{const n=this.hightLightRects.get(e.id());n&&(e.off("dragmove transform xChange yChange",n.transformHandler),n.rect.remove(),this.hightLightRects.delete(e.id()))})}calculateNodeRect(t,e,n=0){const{x:r,y:s,width:a,height:o}=this.getNodeRect(t,n);e.position({x:(r-this.app.stage.x())/this.app.stage.scaleX(),y:(s-this.app.stage.y())/this.app.stage.scaleY()}),e.width(a/this.app.stage.scaleX()),e.height(o/this.app.stage.scaleY()),e.rotation(t.rotation())}getNodeRect(t,e=0){const n=f=>U.angleDeg?f*Math.PI/180:f,r=[];let s=[];t instanceof U.Group?s=t.getChildren():s=[t],s.map(f=>{const u=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.transformer.ignoreStroke()}),g=[{x:u.x,y:u.y},{x:u.x+u.width,y:u.y},{x:u.x+u.width,y:u.y+u.height},{x:u.x,y:u.y+u.height}],p=f.getAbsoluteTransform();g.forEach(function(_){const y=p.point(_);r.push(new pt(y.x,y.y))})});const a=new U.Transform;a.rotate(-n(t.rotation()));let o,h,l,c;r.forEach(function(f){const u=a.point(f);(o===void 0||h===void 0||l===void 0||c===void 0)&&(o=l=u.x,h=c=u.y),o=Math.min(o,u.x),h=Math.min(h,u.y),l=Math.max(l,u.x),c=Math.max(c,u.y)}),a.invert();const d=a.point({x:(o??0)-e,y:(h??0)-e});return{x:d.x,y:d.y,width:(l??0)-(o??0)+e*2,height:(c??0)-(h??0)+e*2}}onTransformStart=()=>{this.app.emit("nodeTransformStart",Array.from(this.selected.values())),this.app.emit("nodeUpdateBefore",Array.from(this.selected.values()))};onTransformEnd=()=>{this.app.emit("nodeTransformEnd",Array.from(this.selected.values())),this.app.emit("nodeUpdated",Array.from(this.selected.values()))};onDragStart=()=>{this.app.emit("nodeTransformStart",Array.from(this.selected.values())),this.app.emit("nodeUpdateBefore",Array.from(this.selected.values()))};onDragEnd=()=>{this.app.emit("nodeTransformEnd",Array.from(this.selected.values())),this.app.emit("nodeUpdated",Array.from(this.selected.values()))};onMouseDown=t=>{!this.enabled||t.evt.button!==0||t.target instanceof U.Stage&&(this.cancelSelect(),this.rubberStartPoint.clone(this.app.pointer),this.rubberRect.setPosition(this.rubberStartPoint),this.rubberRect.width(0),this.rubberRect.height(0),this.rubberRect.visible(!1),this.rubberEnable=!0)};onMouseMove=()=>{if(!this.enabled||!this.rubberEnable)return;const t=new pt(Math.min(this.app.pointer.x,this.rubberStartPoint.x),Math.min(this.app.pointer.y,this.rubberStartPoint.y));this.rubberRect.setPosition(t),this.rubberRect.width(Math.max(this.app.pointer.x,this.rubberStartPoint.x)-t.x),this.rubberRect.height(Math.max(this.app.pointer.y,this.rubberStartPoint.y)-t.y),this.rubberRect.visible(!0)};onMouseUp=t=>{if(!(!this.enabled||t.evt.button!==0)&&this.rubberEnable){const e=this.app.getShapesInArea(this.rubberRect);this.select(...e),this.rubberRect.visible(!1),this.rubberEnable=!1;return}};onMouseClick=t=>{if(!this.enabled||t.evt.button!==0||t.target instanceof U.Stage||!t.target.attrs.id)return;const n=this.app.findTopGroup(t.target)??t.target;t.evt.shiftKey&&this.multipleSelect?this.selected.has(n.attrs.id)?this.cancelSelect(n):this.select(...this.selected.values(),n):this.select(n)};onMouseOut=t=>{t.target instanceof U.Stage&&(this.rubberEnable=!1)};destroy(){this.transformer.off("transformstart",this.onTransformStart),this.transformer.off("transformend",this.onTransformEnd),this.transformer.off("dragstart",this.onDragStart),this.transformer.off("dragend",this.onDragEnd),this.app.off("mouseDown",this.onMouseDown),this.app.off("mouseMove",this.onMouseMove),this.app.off("mouseUp",this.onMouseUp),this.app.off("mouseClick",this.onMouseClick),this.app.off("mouseOut",this.onMouseOut),this.selected.clear(),this.enabled=!1,this.transformer.remove(),this.optionLayer.remove()}}const yv={enabled:!0,multipleSelect:!0,transformer:{padding:6,ignoreStroke:!0,borderStroke:"#4e86e3",borderStrokeWidth:1,borderDash:[3,3],anchorSize:8,anchorStroke:"#4e86e3",anchorCornerRadius:3,anchorStrokeWidth:1,rotateAnchorOffset:20},hightLight:{padding:3,stroke:"#4e86e3",strokeWidth:1},rubber:{stroke:"#4e86e3",strokeWidth:1,fill:"#4e86e350"}};class bv{name="selectorPlugin";selector;app;options;keyFns=[];constructor(t){this.options={...yv,...t}}install(t){this.app=t,this.selector=new Zu(t,this.options),this.app.on("canvasCleared",this.onCanvasCleared),this.app.select=function(...e){const n=this.app.getPlugin("selectorPlugin");return n&&n.selector?.select(...e),this},this.app.cancelSelect=function(...e){const n=this.app.getPlugin("selectorPlugin");return n&&n.selector?.cancelSelect(...e),this},this.app.selectByEvent=function(e){return this.app.getPlugin("selectorPlugin")&&(e.target instanceof U.Stage?this.cancelSelect():this.select(e.target)),this},this.app.selectAll=function(){const e=this.app.getPlugin("selectorPlugin");return e&&e.selector?.selectAll(),this},this.app.triggerSelector=function(e){const n=this.app.getPlugin("selectorPlugin");return n&&n.selector?.triggerSelector(e),this},this.app.isSelected=function(e){const n=this.app.getPlugin("selectorPlugin");return n?n.selector?.isSelected(e)??!1:!1},this.keyFns.push(this.app.domKey.on({key:"a",title:"全部选中",exact:!0,ctrl:!0},()=>{const e=this.app?.isPluginEnable("selectorPlugin");this.app?.triggerSelector(!0),this.app?.selectAll(),this.app?.triggerSelector(e)})),this.keyFns.push(this.app.domKey.on({key:"g",title:"组合",ctrl:!0,shift:!0,exact:!0},()=>{})),this.app.emit("selectorInstalled",this)}destroy(){this.keyFns.forEach(t=>t.removeListener?.()),this.keyFns=[],this.selector?.destroy(),this.app?.off("canvasCleared",this.onCanvasCleared),this.app?.emit("selectorDestroy",this)}enable(){this.selector&&(this.selector.triggerSelector(!0),this.options.enabled=!0)}disable(){this.selector&&(this.selector.cancelSelect(),this.selector.triggerSelector(!1),this.options.enabled=!1)}isEnabled(){return this.options.enabled&&(this.selector?.enabled??!1)}onCanvasCleared=()=>{this.selector?.cancelSelect()}}class Bi{app;id=0;name;options;executed=!1;executeTime=new Date().getTime();constructor(t,e){this.app=t,this.name=this.constructor.name,this.options=e}toJSON(){return{id:this.id,name:this.name,options:this.options,executed:this.executed,executeTime:this.executeTime}}fromJSON(t){this.id=t.id,this.name=t.name,this.options=t.options,this.executed=t.executed,this.executeTime=t.executeTime}}class wv extends Bi{constructor(t,e){super(t,e)}execute(){this.app._add(...this.options.nodes)}undo(){this.app._remove(...this.options.nodes)}}class Sv extends Bi{constructor(t,e){super(t,e)}execute(){this.app._remove(...this.options.nodes)}undo(){this.app._add(...this.options.nodes)}}class Cv extends Bi{constructor(t,e){super(t,e)}execute(){this.app._update(...this.options.newNodes)}undo(){this.app._update(...this.options.oldNodes)}}class xv extends Bi{constructor(t,e){super(t,e)}execute(){this.options.nodes.forEach(({node:t,newZIndex:e})=>{t.setZIndex(e)})}undo(){this.options.nodes.forEach(({node:t,oldZIndex:e})=>{t.setZIndex(e)})}}class Ev extends Bi{constructor(t,e){super(t,e)}execute(){this.app._makeGroup(this.options.nodes)}undo(){this.app._decomposeGroup(this.options.group)}}class Tv extends Bi{constructor(t,e){super(t,e)}execute(){this.app._decomposeGroup(this.options.group)}undo(){this.app._makeGroup(this.options.nodes)}}class Ju{name="history";app;enabled;stackSize;undoStack=[];redoStack=[];idCounter=0;constructor(t,e){const{enabled:n,stackSize:r}=e;this.app=t,this.enabled=n,this.stackSize=r}execute(t,e){this.undoStack.length>this.stackSize&&this.undoStack.shift(),this.undoStack.push(t),t.id=++this.idCounter,e&&t.execute(),t.executed=!0,t.executeTime=new Date().getTime(),this.redoStack=[],this.app.emit("stackChanged",this.undoStack,this.redoStack)}undo(t=1){if(!this.enabled)return;let e;for(;t;)this.undoStack.length>0&&(e=this.undoStack.pop(),e&&(e.undo(),this.redoStack.push(e),this.app.emit("stackChanged",this.undoStack,this.redoStack))),--t;return this.app.emit("historyUndo",t,e?.toJSON()),e}redo(t=1){if(!this.enabled)return;let e;for(;t;)this.redoStack.length>0&&(e=this.redoStack.pop(),e&&(e.execute(),this.undoStack.push(e),this.app.emit("stackChanged",this.undoStack,this.redoStack))),--t;return this.app.emit("historyRedo",t,e?.toJSON()),e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}jump(t){if(!this.enabled)return;let e=this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0;if(e===void 0||t>e.id)for(e=this.redo();e!==void 0&&t>e.id;)e=this.redo();else for(;e=this.undoStack[this.undoStack.length-1],!(e===void 0||t===e.id);)this.undo();this.app.emit("stackChanged",this.undoStack,this.redoStack)}destroy(){this.undoStack=[],this.redoStack=[],this.app.emit("stackChanged",this.undoStack,this.redoStack)}}class kv{name="historyPlugin";history;app;options;keyFns=[];oldNodes=[];constructor(t){this.options={enabled:!0,stackSize:100,...t}}install(t){this.app=t,this.history=new Ju(t,this.options),this.history.app=t,this.app.on("nodeAdded",this.onNodeAdded),this.app.on("nodeRemoved",this.onNodeRemove),this.app.on("nodeUpdateBefore",this.onNodeUpdateBefore),this.app.on("nodeZindexChanged",this.onNodeZIndexChanged),this.app.on("nodeGroupMake",this.onMakeGroup),this.app.on("nodeGroupDecompose",this.onDecomposeGroup),this.app.on("nodeUpdated",this.onNodeUpdated),this.app.undo=function(e=1){const n=this.app.getPlugin("historyPlugin");return n&&n.history?.undo(e),this},this.app.redo=function(e=1){const n=this.app.getPlugin("historyPlugin");return n&&n.history?.redo(e),this},this.app.canUndo=function(){const e=this.app.getPlugin("historyPlugin");return e?e.history?.canUndo()??!1:!1},this.app.canRedo=function(){const e=this.app.getPlugin("historyPlugin");return e?e.history?.canRedo()??!1:!1},this.app.jump=function(e){const n=this.app.getPlugin("historyPlugin");return n&&n.history?.jump(e),this},this.keyFns.push(this.app.domKey.on({key:"z",title:"撤销",exact:!0,ctrl:!0},()=>{this.app?.undo()})),this.keyFns.push(this.app.domKey.on({key:"y",title:"重做",exact:!0,ctrl:!0},()=>{this.app?.redo()})),this.app.emit("historyInstalled",this)}destroy(){this.keyFns.forEach(t=>t.removeListener?.()),this.keyFns=[],this.history?.destroy(),this.app?.off("nodeAdded",this.onNodeAdded),this.app?.off("nodeRemoved",this.onNodeRemove),this.app?.off("nodeUpdateBefore",this.onNodeUpdateBefore),this.app?.off("nodeUpdated",this.onNodeUpdated),this.app?.off("nodeGroupMake",this.onMakeGroup),this.app?.off("nodeGroupDecompose",this.onDecomposeGroup),this.app?.emit("historyDestroy",this)}enable(){this.history&&(this.options.enabled=!0,this.history.enabled=!0)}disable(){this.history&&(this.options.enabled=!1,this.history.enabled=!1)}isEnabled(){return this.options.enabled&&(this.history?.enabled??!1)}onNodeAdded=t=>{!this.app||!this.history||this.history.execute(new wv(this.app,{nodes:t}))};onNodeRemove=t=>{!this.app||!this.history||this.history.execute(new Sv(this.app,{nodes:t}))};onNodeUpdateBefore=t=>{this.oldNodes=t.map(e=>e.toObject())};onNodeUpdated=t=>{!this.app||!this.history||this.history.execute(new Cv(this.app,{oldNodes:this.oldNodes,newNodes:t.map(e=>e.toObject())}))};onNodeZIndexChanged=t=>{!this.app||!this.history||this.history.execute(new xv(this.app,{nodes:t}))};onMakeGroup=(t,e)=>{!this.app||!this.history||this.history.execute(new Ev(this.app,{nodes:e,group:t}))};onDecomposeGroup=(t,e)=>{!this.app||!this.history||this.history.execute(new Tv(this.app,{nodes:e,group:t}))}}class Av{name="diamondTool";hooks;config;diamond=null;startPointer=new pt(0,0);constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){this.diamond||(this.startPointer.clone(t.pointer),this.diamond=new U.RegularPolygon({sides:4,radius:0,strokeScaleEnabled:!1,...this.config}),this.diamond.setPosition(this.startPointer),t.add(this.diamond),this.hooks?.onStartDrawing?.(t,this.diamond))}mousemove({app:t}){if(!this.diamond)return;const e=t.pointer.x-this.startPointer.x,n=t.pointer.y-this.startPointer.y,r=new pt(this.startPointer.x+e/2,this.startPointer.y+n/2);this.diamond.setPosition(r),this.diamond.radius(r.distanceTo(t.pointer)),t.render()}mouseup({app:t,pointer:e}){if(this.diamond){if(this.startPointer.eq(e)){this.diamond?.destroy(),this.diamond=null;return}this.hooks?.onCompleteDrawing?.(t,this.diamond),this.diamond=null,this.startPointer.setXY(0,0)}}enableChanged(){this.diamond=null,this.startPointer.setXY(0,0)}}class Pv{name="drawingTool";config;hooks;line=null;points=[];constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){const e=this.points.at(-1);(!e||!e.eq(t.pointer))&&this.points.push(t.pointer),!this.line&&(this.line=new U.Line({points:Gi(this.points),globalCompositeOperation:"source-over",lineCap:"round",lineJoin:"round",strokeScaleEnabled:!1,hitStrokeWidth:20,...this.config}),t.add(this.line),this.hooks?.onStartDrawing?.(t,this.line))}mousemove({app:t,event:e}){this.line&&(e.evt.stopPropagation(),this.points.push(t.pointer),this.line.points(Gi(this.points)))}mouseup({app:t,pointer:e}){if(!this.line)return;const n=this.points.at(-1);this.points.length<=6&&n&&e.distanceTo(n)<10&&this.line&&this.line.destroy(),this.hooks?.onCompleteDrawing?.(t,this.line),this.line=null,this.points=[]}enableChanged(){this.line=null,this.points=[]}}class Mv{name="ellipseTool";config;hooks;ellipse=null;startPointer=new pt(0,0);constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){this.ellipse||(this.startPointer.clone(t.pointer),this.ellipse=new U.Ellipse({radiusX:0,radiusY:0,strokeScaleEnabled:!1,...this.config}),this.ellipse.setPosition(this.startPointer),this.ellipse.radius(new pt(0,0)),t.add(this.ellipse))}mousemove({app:t}){if(!this.ellipse)return;const e=t.pointer.x-this.startPointer.x,n=t.pointer.y-this.startPointer.y,r=new pt(Math.abs(e)/2,Math.abs(n)/2);this.ellipse.setPosition(new pt(this.startPointer.x+e/2,this.startPointer.y+n/2)),this.ellipse.radius(r),t.render()}mouseup({app:t,pointer:e}){if(this.ellipse){if(this.startPointer.eq(e)){this.ellipse?.destroy(),this.ellipse=null;return}this.hooks?.onCompleteDrawing?.(t,this.ellipse),this.ellipse=null,this.startPointer.setXY(0,0)}}enableChanged(){this.ellipse=null,this.startPointer.setXY(0,0)}}class Rv{name="imageTool";config;hooks;image=null;isAdded=!1;imageElement=new Image;constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){this.image&&(this.image.opacity(1),this.hooks?.onCompleteDrawing?.(t,this.image),this.image=null)}mousemove({app:t,pointer:e}){if(this.isAdded||(this.image=new U.Image({strokeScaleEnabled:!1,image:this.imageElement,...this.config}),this.image.opacity(.5),this.image.image(this.imageElement),t.add(this.image),this.isAdded=!0),!this.image)return;const n=200,r=n*((this.imageElement.height??1)/(this.imageElement.width??1));this.image.width(n),this.image.height(r),this.image.position(new pt(e.x-n/2,e.y-r/2)),t.render()}enableChanged(){this.image=null,this.imageElement=new Image}}class Dv{name="lineTool";config;hooks;points=[];line=null;constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){this.line||(this.line=new U.Line({points:Gi(this.points),fill:"transparent",strokeScaleEnabled:!1,hitStrokeWidth:20,...this.config}),t.add(this.line),this.hooks?.onStartDrawing?.(t,this.line));const e=this.points.at(-1);(!e||!e.eq(t.pointer))&&this.points.push(t.pointer),this.line.points(Gi(this.points))}mousemove({app:t,pointer:e}){this.line&&(this.line.points(Gi(this.points).concat(e.x,e.y)),t.render())}doubleClick({app:t}){this.line&&(this.hooks?.onCompleteDrawing?.(t,this.line),this.line=null,this.points=[])}enableChanged(){this.line=null,this.points=[]}}class Lv{name="rectTool";config;hooks;startPointer=new pt(0,0);rectangle=null;constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){this.rectangle||(this.startPointer.clone(t.pointer),this.rectangle=new U.Rect({strokeScaleEnabled:!1,...this.config}),this.rectangle.setPosition(this.startPointer),this.rectangle.width(0),this.rectangle.height(0),t.add(this.rectangle),this.hooks?.onStartDrawing?.(t,this.rectangle))}mousemove({app:t}){this.rectangle&&(this.rectangle.setPosition(new pt(Math.min(this.startPointer.x,t.pointer.x),Math.min(this.startPointer.y,t.pointer.y))),this.rectangle.width(Math.abs(t.pointer.x-this.startPointer.x)),this.rectangle.height(Math.abs(t.pointer.y-this.startPointer.y)),t.render())}mouseup({app:t,pointer:e}){if(this.rectangle){if(this.startPointer.eq(e)){this.rectangle?.destroy(),this.rectangle=null;return}this.hooks?.onCompleteDrawing?.(t,this.rectangle),this.rectangle=null,this.startPointer.setXY(0,0)}}enableChanged(){this.rectangle=null,this.startPointer.setXY(0,0)}}class Ov{name="selectTool";hooks;constructor(t){this.hooks=t.hooks}}const Iv=(i,t,e)=>{t.hide();const n=t.absolutePosition(),r={x:i.stage.container().offsetLeft+n.x,y:i.stage.container().offsetTop+n.y},s=document.createElement("textarea");document.body.appendChild(s),s.value=t.text(),s.style.position="absolute",s.style.top=r.y+"px",s.style.left=r.x+"px",s.style.width=t.width()*t.scaleX()-t.padding()*2+"px",s.style.height=t.height()*t.scaleX()-t.padding()*2+5+"px",s.style.fontSize=t.fontSize()*t.scaleX()+"px",s.style.border="none",s.style.padding="0px",s.style.margin="0px",s.style.overflow="hidden",s.style.background="none",s.style.outline="none",s.style.resize="none",s.style.lineHeight=t.lineHeight().toString(),s.style.fontFamily=t.fontFamily(),s.style.transformOrigin="left top",s.style.textAlign=t.align(),s.style.color=t.stroke(),s.style.caretColor=t.stroke();const a=t.rotation();let o="";a&&(o+="rotateZ("+a+"deg)");let h=0;navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(h+=2+Math.round(t.fontSize()/20)),o+="translateY(-"+h+"px)",s.style.transform=o,s.style.height=s.scrollHeight+3+"px",s.focus();function c(){s.parentNode?.removeChild(s),window.removeEventListener("click",f),t.show()}function d(u){u=Math.max(s.value.length*t.fontSize(),u);const g=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),p=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;(g||p)&&(u=Math.ceil(u)),(document.DOCUMENT_NODE||/Edge/.test(navigator.userAgent))&&(u+=1),s.style.width=u+"px"}s.addEventListener("keydown",function(u){u.key==="Enter"&&!u.shiftKey&&(s.value.trim().length>=1?t.text(s.value.charAt(0)===" "?s.value.substring(1):s.value):i.remove(t),c(),e()),u.key==="Escape"&&c()}),s.addEventListener("keydown",function(){const u=t.getAbsoluteScale().x;d(t.width()*u),s.style.height="auto",s.style.height=s.scrollHeight+t.fontSize()+"px"});function f(u){u.target!==s&&(t.text(s.value),c())}setTimeout(()=>{window.addEventListener("click",f)})};class Fv{name="textTool";config;hooks;textNode=null;constructor({config:t,hooks:e}){this.config=t,this.hooks=e}doubleClick({app:t,pointer:e}){this.textNode=new U.Text({...this.config,text:" ",x:e.x,y:e.y,fontFamily:"JiaYouYa"}),this.textNode.on("dblclick",({target:n})=>{Iv(t,n,()=>{this.hooks?.onCompleteDrawing?.(t,n)})}),t.add(this.textNode),this.textNode.fire("dblclick")}enableChanged(){this.textNode=null}}class Nv{name="eraserTool";hooks;targetMap=new Map;isEraser=!1;constructor(t){this.hooks=t.hooks}mousedown({event:t}){this.isEraser=!0,!(t.target instanceof U.Stage)&&(this.targetMap.set(t.target.id(),{node:t.target,opacity:t.target.attrs.opacity}),t.target.opacity(.3))}mouseup({app:t}){this.targetMap.size&&(t.remove(...[...this.targetMap.values()].map(({node:e,opacity:n})=>(e.opacity(n),e))),this.targetMap.clear(),this.isEraser=!1)}mousemove({event:t}){!this.isEraser||t.target instanceof U.Stage||this.targetMap.get(t.target.id())||(this.targetMap.set(t.target.id(),{node:t.target,opacity:t.target.attrs.opacity}),t.target.opacity(.3))}enableChanged(){this.targetMap.clear(),this.isEraser=!1}}const Qu={backgroundColor:"#ffffff",scale:{min:.05,max:5},panning:{enabled:!1,cursor:"grabbing"},mousewheel:{enabled:!1,factor:.1}};class Uv extends $f{stage;mainLayer;config;domKey=new Zn;mouse;tooler;installedPlugins=new Map;resizeObserver;constructor(t){super(),this.config={...Qu,...t},this.stage=new U.Stage({container:document.createElement("div"),width:500,height:500}),this.stage.container().style.backgroundColor=this.config.backgroundColor,this.mainLayer=new U.Layer,this.mainLayer.name("main:layer"),this.stage.add(this.mainLayer),this.tooler=new pv(this),this.mouse=new gv(this),this.resizeObserver=new ResizeObserver(e=>{const{width:n,height:r}=e[0].contentRect;this.stage.width(n),this.stage.height(r),this.emit("resizeRoot",n,r),this.render()}),this.triggerPanning(this.config.panning.enabled),this.triggerMouseWheel(this.config.mousewheel.enabled),this.registerKeyFns()}registerKeyFns(){this.domKey.on({key:"o",title:"打开",exact:!0,ctrl:!0},()=>{wl().then(t=>Ws(t[0])).then(t=>{this.fromJSON(t)})}),this.domKey.on({key:"e",title:"导出图片",exact:!0,ctrl:!0,shift:!0},()=>{}),this.domKey.on({key:"[",title:"下移一层",exact:!0,ctrl:!0},()=>{}),this.domKey.on({key:"]",title:"上移一层",exact:!0,ctrl:!0},()=>{}),this.domKey.on({key:"[",title:"置于底层",exact:!0,ctrl:!0,shift:!0},()=>{}),this.domKey.on({key:"]",title:"置于顶层",exact:!0,ctrl:!0,shift:!0},()=>{}),this.domKey.on({key:["delete","backspace"],title:"删除"},()=>{console.log("删除")}),this.domKey.on({key:"r",title:"重置画布",exact:!0,ctrl:!0},()=>{}),this.domKey.on({key:" ",title:"移动画布"},()=>(console.log("移动画布"),this.triggerPanning(!0),()=>{this.triggerPanning(!1)})),this.domKey.on({key:["Control","Meta"],title:"缩放画布"},()=>(this.triggerMouseWheel(!0),()=>{this.triggerMouseWheel(!1)})),this.domKey.on({key:"j",title:"解除组合",ctrl:!0,shift:!0,exact:!0},()=>{})}get pointer(){const{x:t,y:e}=this.stage.getRelativePointerPosition()??{x:0,y:0};return new pt(t,e)}get curTool(){return this.tooler.currentTool}get containerElement(){return this.stage.container()}mount(t){this.stage.container(t),this.resizeObserver.observe(this.stage.container())}async setTool(t){await this.tooler.setTool(t)}triggerPanning(t){return t===void 0?this.stage.draggable(this.stage.draggable()):this.stage.draggable(t),this.stage.draggable()?this.stage.container().style.cursor=this.config.panning.cursor??"grabbing":this.stage.container().style.cursor="default",this}triggerMouseWheel(t){return t===void 0?this.config.mousewheel.enabled=!this.config.mousewheel.enabled:this.config.mousewheel.enabled=t,this}triggerTool(t){return this.tooler.trigger(t),this}add(...t){return this._add(...t),this.emit("nodeAdded",t),this}_add(...t){return this.mainLayer.add(...t.map(e=>(e.attrs.id||e.id(`#${ed()}`),e))),this.render(),this}remove(...t){return this._remove(...t),this.emit("nodeRemoved",t),this}_remove(...t){return t.forEach(e=>{e.remove()}),this.render(),this}update(...t){const e=n=>n.reduce((r,s)=>{const a=this.getNodeById(s.attrs.id);return a&&r.push(a),r},[]);return this.emit("nodeUpdateBefore",e(t)),this._update(...t),this.emit("nodeUpdated",e(t)),this}_update(...t){return t.forEach(e=>{this.getNodeById(e.attrs.id)?.setAttrs(e.attrs)}),this.render(),this}makeGroup(t){const e=this._makeGroup(t);return e instanceof U.Group&&this.emit("nodeGroupMake",e,t),e}_makeGroup(t){if(t.length<2)return t;const e=new U.Group({draggable:!0});return e.add(...t.map(n=>(n.draggable(!1),n))),this._add(e),e}decomposeGroup(t){const e=this._decomposeGroup(t);return this.emit("nodeGroupDecompose",t,e),e}_decomposeGroup(t){const e=t.getParent()??this.mainLayer,n=[...t.getChildren()].map(r=>{const{x:s,y:a,scaleX:o,scaleY:h,skewX:l,skewY:c,rotation:d}=r.getTransform().decompose();return r.moveTo(e),r.x(s),r.y(a),r.scaleX(o),r.scaleY(h),r.skewX(l),r.skewY(c),r.rotation(d),r});return this._remove(t),n}findTopGroup(t){return t.parent instanceof U.Group&&t.parent.parent instanceof U.Group?this.findTopGroup(t.parent):t.parent instanceof U.Group?t.parent:null}moveUp(...t){return this.moveZIndexNodes(t,e=>e.moveUp()),this}moveDown(...t){return this.moveZIndexNodes(t,e=>e.moveDown()),this}moveTop(...t){return this.moveZIndexNodes(t,e=>e.moveToTop()),this}moveBottom(...t){return t.forEach(e=>e.moveToBottom()),this.moveZIndexNodes(t,e=>e.moveToBottom()),this}moveZIndexNodes(t,e){const n=[];t.map(r=>{const s={node:r,oldZIndex:r.getZIndex(),newZIndex:r.getZIndex()};return e(r),s.newZIndex=r.getZIndex(),s.oldZIndex!==s.newZIndex&&n.push(s),s}),this.emit("nodeZindexChanged",n)}getNodeById(t){return this.getNodes(e=>e.id()===t)?.[0]}getNodes(t){return this.mainLayer.find(t)??[]}isPointInArea(t,e){const{width:n,height:r,x:s,y:a}=e;return t.x>=s&&t.x<=s+n&&t.y>=a&&t.y<=a+r}getShapesInArea(t){return this.mainLayer.getChildren(e=>e.visible()&&e!==t&&this.haveIntersection(t,e))}haveIntersection(t,e){const n=t.getClientRect({relativeTo:this.stage}),r=e.getClientRect({relativeTo:this.stage}),s=n.x<=r.x&&n.y<=r.y,a=n.x+n.width>=r.x+r.width&&n.y<=r.y,o=n.x<=r.x&&n.y+n.height>=r.y+r.height,h=n.x+n.width>=r.x+r.width&&n.y+n.height>=r.y+r.height;return s&&a&&o&&h}render(){this.mainLayer.draw()}scale(){return this.stage.scaleX()}scaleTo(t,e=new pt(0,0)){const n=this.scale();this.emit("canvasZoomStart",n);const r=Math.min(Math.max(t,this.config.scale.min),this.config.scale.max),s=new pt((e.x-this.stage.x())/n,(e.y-this.stage.y())/n);return this.stage.scale({x:r,y:r}),this.stage.position({x:e.x-s.x*r,y:e.y-s.y*r}),this.emit("canvasZoomEnd",this.scale()),this}clear(){this.mainLayer.removeChildren(),this.emit("canvasCleared"),this.render()}async toDataURL(t,e){const{padding:n=10,pixelRatio:r=2,mimeType:s="image/png",quality:a=1,haveBackground:o=!1}=e??{},h=new U.Layer;this.stage.add(h);let l=[];t&&t.length>0?l=t.map(S=>S.toObject()):l=this.mainLayer.children?.map(S=>S.toObject())??[];const c=l.map(S=>U.Node.create(S));h.add(...c);const d=new U.Transformer({rotateAnchorOffset:0});d.nodes(c);const f=d.getClientRect(),u=this.stage.scaleX(),g=this.stage.scaleY(),p=this.stage.x(),_=this.stage.y(),y=f.width+n*2,b=f.height+n*2,m=f.x-n,v=f.y-n,w=new U.Rect({width:y,height:b,x:(m-p)/u,y:(v-_)/g,fill:this.stage.container().style.backgroundColor});return o&&(h.add(w),w.moveToBottom()),new Promise((S,T)=>{try{h.toDataURL({width:y,height:b,x:m,y:v,pixelRatio:r,mimeType:s,quality:a,callback:C=>{S({dataURL:C,width:y,height:b}),d.remove(),h.remove()}})}catch(C){T(C)}})}toJSON(){return JSON.stringify(this.mainLayer.toObject())}fromJSON(t){this.clear(),this.mainLayer.remove();const e=U.Node.create(t,"layer");return this.mainLayer=e,this.stage.add(this.mainLayer),this.render(),this}use(t,...e){return this.installedPlugins.has(t.name)||(this.installedPlugins.set(t.name,t),t.install(this,...e)),this}getPlugin(t){return this.installedPlugins.get(t)}getPlugins(t){return t.map(e=>this.getPlugin(e))}enablePlugin(t){return Array.isArray(t)||(t=[t]),this.getPlugins(t)?.forEach(n=>n?.enable?.()),this}disablePlugin(t){return Array.isArray(t)||(t=[t]),this.getPlugins(t)?.forEach(n=>n?.disable?.()),this}isPluginEnable(t){return this.getPlugin(t)?.isEnabled?.()??!1}destroyPlugins(t){return Array.isArray(t)||(t=[t]),this.getPlugins(t)?.forEach(n=>n?.destroy()),this}destroy(){this.resizeObserver.disconnect(),this.destroyPlugins(Array.from(this.installedPlugins.keys())),this.mouse.destroy(),this.tooler.destroy(),this.stage.destroy(),this.removeAllListeners()}}return A.$=vt,A.AlignmentPlugin=vv,A.Arrow=Om,A.Ball=Im,A.Ball3d=Fm,A.Box=Nm,A.C2S=Am,A.CanvasWrap=Ym,A.DEFAULT_APP_CONFIG=Qu,A.DOMEvent=n1,A.DOMKey=Zn,A.DOMMedia=i1,A.DOMMouse=Ks,A.DOMQuery=kt,A.DOMScroll=r1,A.Dep=vc,A.DiamondTool=Av,A.DrawingTool=Pv,A.EllipseTool=Mv,A.EraserTool=Nv,A.History=Ju,A.HistoryPlugin=kv,A.ImageTool=Rv,A.KonvaApp=Uv,A.Light=Um,A.Line=Gm,A.LineTool=Dv,A.Matrix=ce,A.Point=pt,A.Point3d=Bm,A.Polygon=im,A.QRCode=Re,A.Query=ot,A.Rect=Oa,A.RectTool=Lv,A.Segment=Xm,A.SelectTool=Ov,A.Selector=Zu,A.SelectorPlugin=bv,A.Ship=zm,A.Slider=Hm,A.SvgPath=xm,A.TWEEN=cm,A.TextTool=Fv,A.Tree=$m,A.Triangle=jm,A.TriangleLight=Vm,A.Vector=fr,A.VideoUtil=xn,A.WebGLRenderer=qm,A.WebRTCClient=Wm,A.WebSocket=Zi,A.addWatermark=Op,A.ajax=Hp,A.angle2radian=tm,A.animateCanvas=s1,A.animateInWeb=Nl,A.base64URLDecode=T0,A.base64URLEncode=E0,A.blobToRawImage=ap,A.changeBrightness=Dp,A.changeDiaphaneity=Lp,A.changeSize=Rp,A.clearCookies=n0,A.clickEvent=t1,A.compileTemplate=Q0,A.compression=Fp,A.copyToClipboard=U0,A.createXMLHttpRequest=mc,A.cssTransition=a1,A.dom=N0,A.dquery=Fl,A.drawQRCodeToCanvas=Bp,A.drawSpirograph=Mm,A.drawStar=Rm,A.dynamicStrokeLine=Dm,A.encodeHTML=J0,A.fetchUseFetch=jp,A.fileOrBlobToDataURL=Ma,A.fileToArrayBufferPromise=Sl,A.flatPoints=Gi,A.flipSideToSide=lp,A.flipUpsideDown=hp,A.getBrowserClient=u0,A.getBrowserClientVersion=d0,A.getBrowserLanguage=g0,A.getCanvasImageData=Pa,A.getCanvasImageDataByBitmap=ip,A.getCanvasImageDataByVideo=ep,A.getCookie=e0,A.getCookieObject=i0,A.getDocumentElement=qs,A.getElementLeftInPage=kl,A.getElementPositionInPage=Tl,A.getElementPositionInPage2=o0,A.getElementPositionInViewport=l0,A.getElementTopInPage=Al,A.getFileExtensionFromFile=Cl,A.getFileTypeFromFile=Wf,A.getFilesImageInfo=tp,A.getFixedWidthText=K0,A.getFormElementData=zp,A.getGroupCoords=fv,A.getImageDataByAIData=Np,A.getImageMainColor=op,A.getInternetExplorerVersion=Ll,A.getMiddleValue=dv,A.getMouseButton=e1,A.getMousePositionInElement=Kn,A.getMousePositionInPage=Pl,A.getMousePositionInViewport=h0,A.getOperatingSystem=Ve,A.getOperatingSystemVersion=c0,A.getPageClient=qn,A.getPageScroll=pi,A.getPageSize=r0,A.getRawImageInfo=Aa,A.getScrollParent=Jm,A.getSelectedText=G0,A.getTextWidth=q0,A.getTimeZone=p0,A.getURL=Il,A.getUserGeolocationPromise=f0,A.getViewportSize=Ji,A.gifImage=uc,A.h=Qf,A.handleDragAndDropFiles=Kf,A.handleHashChange=I0,A.handleHistoryChange=F0,A.handleInputFiles=qf,A.handleURLChange=O0,A.hasDocument=w0,A.hasHistory=S0,A.hasWindow=Ol,A.hexStr2num=dr,A.hexStr2rgbStr=La,A.hsv2rgb=Jp,A.htmlElementToBlob=Xf,A.htmlIncodeOrDecode=Z0,A.ifWebFileHasChanged=Vp,A.imageDataToBitmap=np,A.imageDataToBlob=sp,A.imageDataToDataURL=rp,A.isAndroid=Dl,A.isAppleDevice=m0,A.isBrowserSupportFileAPI=C0,A.isDarkMode=y0,A.isElementFocus=B0,A.isElementInViewport=a0,A.isElementInViewportSimple=s0,A.isIE=b0,A.isIOS=Ml,A.isMacOS=Rl,A.isMobile=_0,A.isTabInView=H0,A.isURL=P0,A.isWechat=v0,A.jpgToPng=kp,A.lazyloadImages=Y0,A.leftRotate=cp,A.linkExport=Yf,A.loadScript=X0,A.localstorage=Zs,A.marginSharpen=Tp,A.microTask=Jf,A.mosaic=Ip,A.mount=Ki,A.navigateBack=V0,A.navigateBack2=$0,A.num2HexStr=yc,A.num2rgbStr=bc,A.onDocumentReady=Zf,A.outputGifBase64=dc,A.outputQRCodeBase64=Gp,A.parseURL=k0,A.parseUrlParams=A0,A.patch=xl,A.patchDOM=El,A.pngToJpg=Ap,A.qrDecompose=Wu,A.query=vt,A.radian2angle=em,A.radiusClip=Mp,A.randomColorHexStr=qp,A.randomColorHexStr2=Kp,A.randomColorNumber=Wp,A.reactiveVue2=Xp,A.reactiveVue3=Yp,A.readFileInBrowser=Ws,A.recordToSearch=M0,A.recordToSearch2=R0,A.rectClip=Pp,A.rgb2hsv=Qp,A.rgbStr2hexStr=Zp,A.rightRotate=up,A.rotate=De,A.roundedRect=Pm,A.scrollTo=j0,A.searchToRecord=D0,A.searchToRecord2=L0,A.selectFileInBrowser=wl,A.setCookie=t0,A.setRem=x0,A.shapeArrayEqual=Yu,A.sharpen=Ep,A.siblings=z0,A.smileFace=Lm,A.stringToBlob=bl,A.toBlackAndWhite=gp,A.toBlue=vp,A.toBlueAndGreen=wp,A.toBlueAndGrey=xp,A.toGreen=_p,A.toGreenAndGrey=Cp,A.toGrey=dp,A.toGrey2=fp,A.toOpposite=pp,A.toRed=mp,A.toRedAndBlue=bp,A.toRedAndGreen=yp,A.toRedAndGrey=Sp,A.waitForStyleSheetsLoaded=W0,A.watchEffect=$p,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),A}({});
18
20
  //# sourceMappingURL=zyzgroup_core_web.iife.js.map