@famibee/skynovel 1.28.2 → 1.29.0

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 (129) hide show
  1. package/README.md +4 -6
  2. package/{core/lib → dist}/app.d.ts +0 -0
  3. package/dist/app.d.ts.map +1 -0
  4. package/dist/app.js +52059 -0
  5. package/dist/app.js.map +1 -0
  6. package/{core/lib → dist}/appMain.d.ts +0 -0
  7. package/dist/appMain.d.ts.map +1 -0
  8. package/dist/appMain.js +16 -0
  9. package/dist/appMain.js.map +1 -0
  10. package/{core/lib → dist}/index.d.ts +0 -0
  11. package/{core/lib → dist}/index.d.ts.map +0 -0
  12. package/{core/lib → dist}/preload.d.ts +2 -7
  13. package/dist/preload.d.ts.map +1 -0
  14. package/dist/preload.js +2 -0
  15. package/dist/preload.js.map +1 -0
  16. package/{core/lib → dist}/sn/AnalyzeTagArg.d.ts +0 -0
  17. package/dist/sn/AnalyzeTagArg.d.ts.map +1 -0
  18. package/{core/lib → dist}/sn/Areas.d.ts +0 -0
  19. package/dist/sn/Areas.d.ts.map +1 -0
  20. package/{core/lib → dist}/sn/Button.d.ts +0 -0
  21. package/dist/sn/Button.d.ts.map +1 -0
  22. package/{core/lib → dist}/sn/CallStack.d.ts +0 -0
  23. package/dist/sn/CallStack.d.ts.map +1 -0
  24. package/{core/lib → dist}/sn/CmnInterface.d.ts +0 -0
  25. package/dist/sn/CmnInterface.d.ts.map +1 -0
  26. package/{core/lib → dist}/sn/CmnLib.d.ts +0 -0
  27. package/dist/sn/CmnLib.d.ts.map +1 -0
  28. package/{core/lib → dist}/sn/CmnTween.d.ts +0 -0
  29. package/dist/sn/CmnTween.d.ts.map +1 -0
  30. package/{core/lib → dist}/sn/Config.d.ts +3 -3
  31. package/dist/sn/Config.d.ts.map +1 -0
  32. package/{core/lib → dist}/sn/DebugMng.d.ts +0 -0
  33. package/dist/sn/DebugMng.d.ts.map +1 -0
  34. package/{core/lib → dist}/sn/DesignCast.d.ts +0 -0
  35. package/dist/sn/DesignCast.d.ts.map +1 -0
  36. package/{core/lib → dist}/sn/EventListenerCtn.d.ts +0 -0
  37. package/dist/sn/EventListenerCtn.d.ts.map +1 -0
  38. package/{core/lib → dist}/sn/EventMng.d.ts +0 -0
  39. package/dist/sn/EventMng.d.ts.map +1 -0
  40. package/{core/lib → dist}/sn/FocusMng.d.ts +0 -0
  41. package/dist/sn/FocusMng.d.ts.map +1 -0
  42. package/{core/lib → dist}/sn/FrameMng.d.ts +0 -0
  43. package/dist/sn/FrameMng.d.ts.map +1 -0
  44. package/{core/lib → dist}/sn/Grammar.d.ts +1 -0
  45. package/dist/sn/Grammar.d.ts.map +1 -0
  46. package/{core/lib → dist}/sn/GrpLayer.d.ts +0 -0
  47. package/dist/sn/GrpLayer.d.ts.map +1 -0
  48. package/{core/lib → dist}/sn/Layer.d.ts +0 -0
  49. package/dist/sn/Layer.d.ts.map +1 -0
  50. package/{core/lib → dist}/sn/LayerMng.d.ts +0 -0
  51. package/dist/sn/LayerMng.d.ts.map +1 -0
  52. package/{core/lib → dist}/sn/Main.d.ts +0 -0
  53. package/dist/sn/Main.d.ts.map +1 -0
  54. package/{core/lib → dist}/sn/Pages.d.ts +0 -0
  55. package/dist/sn/Pages.d.ts.map +1 -0
  56. package/{core/lib → dist}/sn/PropParser.d.ts +0 -0
  57. package/dist/sn/PropParser.d.ts.map +1 -0
  58. package/{core/lib → dist}/sn/RubySpliter.d.ts +0 -0
  59. package/dist/sn/RubySpliter.d.ts.map +1 -0
  60. package/{core/lib → dist}/sn/ScriptIterator.d.ts +0 -0
  61. package/dist/sn/ScriptIterator.d.ts.map +1 -0
  62. package/{core/lib → dist}/sn/SoundMng.d.ts +0 -0
  63. package/dist/sn/SoundMng.d.ts.map +1 -0
  64. package/{core/lib → dist}/sn/SysApp.d.ts +6 -6
  65. package/dist/sn/SysApp.d.ts.map +1 -0
  66. package/{core/lib → dist}/sn/SysBase.d.ts +1 -1
  67. package/dist/sn/SysBase.d.ts.map +1 -0
  68. package/{core/lib → dist}/sn/SysNode.d.ts +0 -0
  69. package/dist/sn/SysNode.d.ts.map +1 -0
  70. package/{core/lib → dist}/sn/SysWeb.d.ts +1 -2
  71. package/dist/sn/SysWeb.d.ts.map +1 -0
  72. package/{core/lib → dist}/sn/TxtLayer.d.ts +1 -0
  73. package/dist/sn/TxtLayer.d.ts.map +1 -0
  74. package/{core/lib → dist}/sn/TxtStage.d.ts +0 -0
  75. package/dist/sn/TxtStage.d.ts.map +1 -0
  76. package/{core/lib → dist}/sn/Variable.d.ts +0 -0
  77. package/dist/sn/Variable.d.ts.map +1 -0
  78. package/{core/lib → dist}/web.d.ts +0 -0
  79. package/dist/web.d.ts.map +1 -0
  80. package/dist/web.js +52771 -0
  81. package/dist/web.js.map +1 -0
  82. package/package.json +34 -31
  83. package/.github/workflows/codeql-analysis.yml +0 -66
  84. package/.github/workflows/release.yml +0 -56
  85. package/.travis.yml +0 -14
  86. package/CHANGELOG.md +0 -2585
  87. package/app.js +0 -2
  88. package/appMain.js +0 -8
  89. package/core/lib/app.d.ts.map +0 -1
  90. package/core/lib/appMain.d.ts.map +0 -1
  91. package/core/lib/preload.d.ts.map +0 -1
  92. package/core/lib/preload.js +0 -1
  93. package/core/lib/sn/AnalyzeTagArg.d.ts.map +0 -1
  94. package/core/lib/sn/Areas.d.ts.map +0 -1
  95. package/core/lib/sn/Button.d.ts.map +0 -1
  96. package/core/lib/sn/CallStack.d.ts.map +0 -1
  97. package/core/lib/sn/CmnInterface.d.ts.map +0 -1
  98. package/core/lib/sn/CmnLib.d.ts.map +0 -1
  99. package/core/lib/sn/CmnTween.d.ts.map +0 -1
  100. package/core/lib/sn/Config.d.ts.map +0 -1
  101. package/core/lib/sn/DebugMng.d.ts.map +0 -1
  102. package/core/lib/sn/DesignCast.d.ts.map +0 -1
  103. package/core/lib/sn/EventListenerCtn.d.ts.map +0 -1
  104. package/core/lib/sn/EventMng.d.ts.map +0 -1
  105. package/core/lib/sn/FocusMng.d.ts.map +0 -1
  106. package/core/lib/sn/FrameMng.d.ts.map +0 -1
  107. package/core/lib/sn/Grammar.d.ts.map +0 -1
  108. package/core/lib/sn/GrpLayer.d.ts.map +0 -1
  109. package/core/lib/sn/Hyphenation.d.ts +0 -19
  110. package/core/lib/sn/Hyphenation.d.ts.map +0 -1
  111. package/core/lib/sn/Layer.d.ts.map +0 -1
  112. package/core/lib/sn/LayerMng.d.ts.map +0 -1
  113. package/core/lib/sn/Main.d.ts.map +0 -1
  114. package/core/lib/sn/Pages.d.ts.map +0 -1
  115. package/core/lib/sn/PropParser.d.ts.map +0 -1
  116. package/core/lib/sn/RubySpliter.d.ts.map +0 -1
  117. package/core/lib/sn/ScriptIterator.d.ts.map +0 -1
  118. package/core/lib/sn/SoundMng.d.ts.map +0 -1
  119. package/core/lib/sn/SysApp.d.ts.map +0 -1
  120. package/core/lib/sn/SysBase.d.ts.map +0 -1
  121. package/core/lib/sn/SysNode.d.ts.map +0 -1
  122. package/core/lib/sn/SysWeb.d.ts.map +0 -1
  123. package/core/lib/sn/TxtLayer.d.ts.map +0 -1
  124. package/core/lib/sn/TxtStage.d.ts.map +0 -1
  125. package/core/lib/sn/Variable.d.ts.map +0 -1
  126. package/core/lib/web.d.ts.map +0 -1
  127. package/core/webpack.config.js +0 -46
  128. package/tsconfig.json +0 -37
  129. package/web.js +0 -2
package/app.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see app.js.LICENSE.txt */
2
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(this,(function(){return(()=>{var t={1680:(t,e,i)=>{"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E;i.d(e,{iw:()=>g,T$:()=>o,V0:()=>s,mr:()=>E,yl:()=>m,lg:()=>a,Vi:()=>n,I2:()=>h,UN:()=>v,A7:()=>y,WB:()=>p,G5:()=>b,cB:()=>_,N3:()=>r,oT:()=>c,aH:()=>f,sp:()=>u,vK:()=>l,Nt:()=>d}),function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(n||(n={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(r||(r={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(s||(s={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(o||(o={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(a||(a={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(h||(h={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(u||(u={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(l||(l={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(c||(c={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(f||(f={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(d||(d={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(p||(p={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(g||(g={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(m||(m={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(v||(v={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(_||(_={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(y||(y={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(b||(b={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(E||(E={}))},2038:(t,e,i)=>{"use strict";i.d(e,{eo:()=>Te,M4:()=>_,I8:()=>fe,$N:()=>y,ah:()=>B,bg:()=>b,jd:()=>C,VL:()=>v,a$:()=>be,JZ:()=>Se,TJ:()=>Oe,Bv:()=>Re,Zk:()=>we,Sj:()=>tt,Ie:()=>Ee,lW:()=>G,qm:()=>g,Y8:()=>E,lH:()=>it,TA:()=>x,wn:()=>Lt,jV:()=>q,kV:()=>J,AI:()=>R,WB:()=>st,tT:()=>nt,Ei:()=>ee,fy:()=>he,ZX:()=>z,TO:()=>at,W1:()=>te,e_:()=>u,_w:()=>A,PA:()=>T,HI:()=>ht,zj:()=>Gt,bO:()=>Q,$r:()=>Pt,NW:()=>zt,lD:()=>W,ud:()=>V,TI:()=>L,uW:()=>k,J$:()=>Yt,Th:()=>ge,_z:()=>p,pX:()=>w,id:()=>Xt,ex:()=>Nt,p:()=>se,z9:()=>Ft,ZM:()=>Dt,zI:()=>oe,Ld:()=>Ht,xP:()=>ye,xE:()=>N,wr:()=>ae,UX:()=>Bt,CT:()=>ue,aF:()=>I,oo:()=>$,eH:()=>S,Rv:()=>xe,e6:()=>me,pb:()=>l,a7:()=>Rt,TF:()=>Kt,Y9:()=>_e,kP:()=>ve,qw:()=>ie,K0:()=>Qt,Kc:()=>mt,DL:()=>Jt,Jb:()=>Ce,eG:()=>Ne,sg:()=>wt});var n=i(9319),r=i(1680),s=i(8942),o=i(1034),a=i(6679),h=i(9658);n.X.PREFER_ENV=s.isMobile.any?r.Vi.WEBGL:r.Vi.WEBGL2,n.X.STRICT_TEXTURE_CACHE=!1;var u=[];function l(t,e){if(!t)return null;var i="";if("string"==typeof t){var n=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);n&&(i=n[1].toLowerCase())}for(var r=u.length-1;r>=0;--r){var s=u[r];if(s.test&&s.test(t,i))return new s(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},c(t,e)};function f(t,e){function i(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var d=function(){return d=Object.assign||function(t){for(var e,i=arguments,n=1,r=arguments.length;n<r;n++)for(var s in e=i[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},d.apply(this,arguments)},p=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new o.R("setRealSize"),this.onUpdate=new o.R("update"),this.onError=new o.R("onError")}return t.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},t.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},t.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(t.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.destroyed||this.onUpdate.emit()},t.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),t.prototype.style=function(t,e,i){return!1},t.prototype.dispose=function(){},t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},t.test=function(t,e){return!1},t}(),g=function(t){function e(e,i){var n=this,r=i||{},s=r.width,o=r.height;if(!s||!o)throw new Error("BufferResource width or height invalid");return(n=t.call(this,s,o)||this).data=e,n}return f(e,t),e.prototype.upload=function(t,e,i){var n=t.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===r.iw.UNPACK);var s=e.realWidth,o=e.realHeight;return i.width===s&&i.height===o?n.texSubImage2D(e.target,0,0,0,s,o,e.format,i.type,this.data):(i.width=s,i.height=o,n.texImage2D(e.target,0,i.internalFormat,s,o,0,e.format,i.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(p),m={scaleMode:r.aH.NEAREST,format:r.I2.RGBA,alphaMode:r.iw.NPM},v=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null);var o=t.call(this)||this,a=(i=i||{}).alphaMode,h=i.mipmap,u=i.anisotropicLevel,c=i.scaleMode,f=i.width,d=i.height,g=i.wrapMode,m=i.format,v=i.type,_=i.target,y=i.resolution,b=i.resourceOptions;return!e||e instanceof p||((e=l(e,b)).internal=!0),o.resolution=y||n.X.RESOLUTION,o.width=Math.round((f||0)*o.resolution)/o.resolution,o.height=Math.round((d||0)*o.resolution)/o.resolution,o._mipmap=void 0!==h?h:n.X.MIPMAP_TEXTURES,o.anisotropicLevel=void 0!==u?u:n.X.ANISOTROPIC_LEVEL,o._wrapMode=g||n.X.WRAP_MODE,o._scaleMode=void 0!==c?c:n.X.SCALE_MODE,o.format=m||r.I2.RGBA,o.type=v||r.vK.UNSIGNED_BYTE,o.target=_||r.sp.TEXTURE_2D,o.alphaMode=void 0!==a?a:r.iw.UNPACK,o.uid=(0,s.uid)(),o.touched=0,o.isPowerOfTwo=!1,o._refreshPOT(),o._glTextures={},o.dirtyId=0,o.dirtyStyleId=0,o.cacheId=null,o.valid=f>0&&d>0,o.textureCacheIds=[],o.destroyed=!1,o.resource=null,o._batchEnabled=0,o._batchLocation=0,o.parentTextureArray=null,o.setResource(e),o}return f(e,t),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return i=i||this.resolution,this.setRealSize(t*i,e*i,i)},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=(0,s.isPow2)(this.realWidth)&&(0,s.isPow2)(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete s.BaseTextureCache[this.cacheId],delete s.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,i,r){void 0===r&&(r=n.X.STRICT_TEXTURE_CACHE);var o="string"==typeof t,a=null;if(o)a=t;else{if(!t._pixiId){var h=i&&i.pixiIdPrefix||"pixiid";t._pixiId=h+"_"+(0,s.uid)()}a=t._pixiId}var u=s.BaseTextureCache[a];if(o&&r&&!u)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return u||((u=new e(t,i)).cacheId=a,e.addToCache(u,a)),u},e.fromBuffer=function(t,i,n,s){t=t||new Float32Array(i*n*4);var o=new g(t,{width:i,height:n}),a=t instanceof Float32Array?r.vK.FLOAT:r.vK.UNSIGNED_BYTE;return new e(o,Object.assign(m,s||{width:i,height:n,type:a}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),s.BaseTextureCache[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),s.BaseTextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=s.BaseTextureCache[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete s.BaseTextureCache[t],e}}else if(t&&t.textureCacheIds){for(var n=0;n<t.textureCacheIds.length;++n)delete s.BaseTextureCache[t.textureCacheIds[n]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(s.EventEmitter),_=function(t){function e(e,i){var n=this,r=i||{},s=r.width,o=r.height;(n=t.call(this,s,o)||this).items=[],n.itemDirtyIds=[];for(var a=0;a<e;a++){var h=new v;n.items.push(h),n.itemDirtyIds.push(-2)}return n.length=e,n._load=null,n.baseTexture=null,n}return f(e,t),e.prototype.initFromArray=function(t,e){for(var i=0;i<this.length;i++)t[i]&&(t[i].castToBaseTexture?this.addBaseTextureAt(t[i].castToBaseTexture(),i):t[i]instanceof p?this.addResourceAt(t[i],i):this.addResourceAt(l(t[i],e),i))},e.prototype.dispose=function(){for(var t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,e){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this},e.prototype.bind=function(e){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");t.prototype.bind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=e,this.items[i].on("update",e.update,e)},e.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=null,this.items[i].off("update",e.update,e)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.items.map((function(t){return t.resource})).filter((function(t){return t})).map((function(t){return t.load()}));return this._load=Promise.all(e).then((function(){var e=t.items[0],i=e.realWidth,n=e.realHeight;return t.resize(i,n),Promise.resolve(t)})),this._load},e}(p),y=function(t){function e(e,i){var n,r,s=this,o=i||{},a=o.width,h=o.height;return Array.isArray(e)?(n=e,r=e.length):r=e,s=t.call(this,r,{width:a,height:h})||this,n&&s.initFromArray(n,i),s}return f(e,t),e.prototype.addBaseTextureAt=function(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this},e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=r.sp.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,e,i){var n=this,r=n.length,s=n.itemDirtyIds,o=n.items,a=t.gl;i.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,r,0,e.format,i.type,null);for(var h=0;h<r;h++){var u=o[h];s[h]<u.dirtyId&&(s[h]=u.dirtyId,u.valid&&a.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,h,u.resource.width,u.resource.height,1,e.format,i.type,u.resource.source))}return!0},e}(_),b=function(t){function e(e){var i=this,n=e,r=n.naturalWidth||n.videoWidth||n.width,s=n.naturalHeight||n.videoHeight||n.height;return(i=t.call(this,r,s)||this).source=e,i.noSubImage=!1,i}return f(e,t),e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=(0,s.determineCrossOrigin)(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,n){var s=t.gl,o=e.realWidth,a=e.realHeight;return n=n||this.source,s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===r.iw.UNPACK),this.noSubImage||e.target!==s.TEXTURE_2D||i.width!==o||i.height!==a?(i.width=o,i.height=a,s.texImage2D(e.target,0,i.internalFormat,e.format,i.type,n)):s.texSubImage2D(s.TEXTURE_2D,0,0,0,e.format,i.type,n),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source,i=e.naturalWidth||e.videoWidth||e.width,n=e.naturalHeight||e.videoHeight||e.height;this.resize(i,n),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(p),E=function(t){function e(e){return t.call(this,e)||this}return f(e,t),e.test=function(t){var e=self.OffscreenCanvas;return!!(e&&t instanceof e)||self.HTMLCanvasElement&&t instanceof HTMLCanvasElement},e}(b),x=function(t){function e(i,n){var s=this,o=n||{},a=o.width,h=o.height,u=o.autoLoad,l=o.linkBaseTexture;if(i&&i.length!==e.SIDES)throw new Error("Invalid length. Got "+i.length+", expected 6");s=t.call(this,6,{width:a,height:h})||this;for(var c=0;c<e.SIDES;c++)s.items[c].target=r.sp.TEXTURE_CUBE_MAP_POSITIVE_X+c;return s.linkBaseTexture=!1!==l,i&&s.initFromArray(i,n),!1!==u&&s.load(),s}return f(e,t),e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=r.sp.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,e,i){if(void 0===i&&(i=this.linkBaseTexture),!this.items[e])throw new Error("Index "+e+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=r.sp.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this},e.prototype.upload=function(t,i,n){for(var r=this.itemDirtyIds,s=0;s<e.SIDES;s++){var o=this.items[s];r[s]<o.dirtyId&&(o.valid&&o.resource?(o.resource.upload(t,o,n),r[s]=o.dirtyId):r[s]<-1&&(t.gl.texImage2D(o.target,0,n.internalFormat,i.realWidth,i.realHeight,0,i.format,n.type,null),r[s]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(_),T=function(t){function e(e,i){var r=this;if(i=i||{},!(e instanceof HTMLImageElement)){var s=new Image;b.crossOrigin(s,e,i.crossorigin),s.src=e,e=s}return r=t.call(this,e)||this,!e.complete&&r._width&&r._height&&(r._width=0,r._height=0),r.url=e.src,r._process=null,r.preserveBitmap=!1,r.createBitmap=(void 0!==i.createBitmap?i.createBitmap:n.X.CREATE_IMAGE_BITMAP)&&!!self.createImageBitmap,r.alphaMode="number"==typeof i.alphaMode?i.alphaMode:null,r.bitmap=null,r._load=null,!1!==i.autoLoad&&r.load(),r}return f(e,t),e.prototype.load=function(t){var e=this;return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise((function(t,i){var n=e.source;e.url=n.src;var r=function(){e.destroyed||(n.onload=null,n.onerror=null,e.resize(n.width,n.height),e._load=null,e.createBitmap?t(e.process()):t(e))};n.complete&&n.src?r():(n.onload=r,n.onerror=function(t){i(t),e.onError.emit(t)})}))),this._load},e.prototype.process=function(){var t=this,e=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!self.createImageBitmap)return Promise.resolve(this);var i=self.createImageBitmap,n=!e.crossOrigin||"anonymous"===e.crossOrigin;return this._process=fetch(e.src,{mode:n?"cors":"no-cors"}).then((function(t){return t.blob()})).then((function(n){return i(n,0,0,e.width,e.height,{premultiplyAlpha:t.alphaMode===r.iw.UNPACK?"premultiply":"none"})})).then((function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))})),this._process},e.prototype.upload=function(e,i,n){if("number"==typeof this.alphaMode&&(i.alphaMode=this.alphaMode),!this.createBitmap)return t.prototype.upload.call(this,e,i,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,n,this.bitmap),!this.preserveBitmap){var r=!0,s=i._glTextures;for(var o in s){var a=s[o];if(a!==n&&a.dirtyId!==i.dirtyId){r=!1;break}}r&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return"string"==typeof t||t instanceof HTMLImageElement},e}(b),w=function(t){function e(e,i){var n=this;return i=i||{},(n=t.call(this,document.createElement("canvas"))||this)._width=0,n._height=0,n.svg=e,n.scale=i.scale||1,n._overrideWidth=i.width,n._overrideHeight=i.height,n._resolve=null,n._crossorigin=i.crossorigin,n._load=null,!1!==i.autoLoad&&n.load(),n}return f(e,t),e.prototype.load=function(){var t=this;return this._load||(this._load=new Promise((function(i){if(t._resolve=function(){t.resize(t.source.width,t.source.height),i(t)},e.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}))),this._load},e.prototype._loadSvg=function(){var t=this,e=new Image;b.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=function(i){t._resolve&&(e.onerror=null,t.onError.emit(i))},e.onload=function(){if(t._resolve){var i=e.width,n=e.height;if(!i||!n)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var r=i*t.scale,o=n*t.scale;(t._overrideWidth||t._overrideHeight)&&(r=t._overrideWidth||t._overrideHeight/n*i,o=t._overrideHeight||t._overrideWidth/i*n),r=Math.round(r),o=Math.round(o);var a=t.source;a.width=r,a.height=o,a._pixiId="canvas_"+(0,s.uid)(),a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),t._resolve(),t._resolve=null}}},e.getSize=function(t){var i=e.SVG_SIZE.exec(t),n={};return i&&(n[i[1]]=Math.round(parseFloat(i[3])),n[i[5]]=Math.round(parseFloat(i[7]))),n},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,i){return"svg"===i||"string"==typeof t&&/^data:image\/svg\+xml(;(charset=utf8|utf8))?;base64/.test(t)||"string"==typeof t&&e.SVG_XML.test(t)},e.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(b),S=function(t){function e(i,n){var r=this;if(n=n||{},!(i instanceof HTMLVideoElement)){var s=document.createElement("video");s.setAttribute("preload","auto"),s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline",""),"string"==typeof i&&(i=[i]);var o=i[0].src||i[0];b.crossOrigin(s,o,n.crossorigin);for(var a=0;a<i.length;++a){var h=document.createElement("source"),u=i[a],l=u.src,c=u.mime,f=(l=l||i[a]).split("?").shift().toLowerCase(),d=f.substr(f.lastIndexOf(".")+1);c=c||e.MIME_TYPES[d]||"video/"+d,h.src=l,h.type=c,s.appendChild(h)}i=s}return(r=t.call(this,i)||this).noSubImage=!0,r._autoUpdate=!0,r._isConnectedToTicker=!1,r._updateFPS=n.updateFPS||0,r._msToNextUpdate=0,r.autoPlay=!1!==n.autoPlay,r._load=null,r._resolve=null,r._onCanPlay=r._onCanPlay.bind(r),r._onError=r._onError.bind(r),!1!==n.autoLoad&&r.load(),r}return f(e,t),e.prototype.update=function(e){if(!this.destroyed){var i=a.vB.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-i),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((function(i){t.valid?i(t):(t._resolve=i,e.load())})),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return 3===t.readyState||4===t.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(a.vB.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(a.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(a.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(a.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(a.vB.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,i){return self.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(b),A=function(t){function e(e){return t.call(this,e)||this}return f(e,t),e.test=function(t){return!!self.createImageBitmap&&t instanceof ImageBitmap},e}(b);u.push(T,A,E,S,w,g,x,y);var M={__proto__:null,Resource:p,BaseImageResource:b,INSTALLED:u,autoDetectResource:l,AbstractMultiResource:_,ArrayResource:y,BufferResource:g,CanvasResource:E,CubeResource:x,ImageResource:T,SVGResource:w,VideoResource:S,ImageBitmapResource:A},O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.upload=function(t,e,i){var n=t.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===r.iw.UNPACK);var s=e.realWidth,o=e.realHeight;return i.width===s&&i.height===o?n.texSubImage2D(e.target,0,0,0,s,o,e.format,i.type,this.data):(i.width=s,i.height=o,n.texImage2D(e.target,0,i.internalFormat,s,o,0,e.format,i.type,this.data)),!0},e}(g),R=function(){function t(t,e){this.width=Math.round(t||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new o.R("disposeFramebuffer"),this.multisample=r.G5.NONE}return Object.defineProperty(t.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),t.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new v(null,{scaleMode:r.aH.NEAREST,resolution:1,mipmap:r.WB.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.addDepthTexture=function(t){return this.depthTexture=t||new v(new O(null,{width:this.width,height:this.height}),{scaleMode:r.aH.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:r.WB.OFF,format:r.I2.DEPTH_COMPONENT,type:r.vK.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i<this.colorTextures.length;i++){var n=this.colorTextures[i],r=n.resolution;n.setSize(t/r,e/r)}this.depthTexture&&(r=this.depthTexture.resolution,this.depthTexture.setSize(t/r,e/r))}},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},t}(),C=function(t){function e(e){var i=this;if("number"==typeof e){var n=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];e={width:n,height:s,scaleMode:o,resolution:a}}return e.width=e.width||100,e.height=e.height||100,e.multisample=void 0!==e.multisample?e.multisample:r.G5.NONE,(i=t.call(this,null,e)||this).mipmap=r.WB.OFF,i.valid=!0,i.clearColor=[0,0,0,0],i.framebuffer=new R(i.realWidth,i.realHeight).addColorTexture(0,i),i.framebuffer.multisample=e.multisample,i.maskStack=[],i.filterStack=[{}],i}return f(e,t),e.prototype.resize=function(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},e.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(v),I=function(){function t(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return t.prototype.set=function(t,e,i){var n=e.width,r=e.height;if(i){var s=t.width/2/n,o=t.height/2/r,a=t.x/n+s,u=t.y/r+o;i=h.Lv.add(i,h.Lv.NW),this.x0=a+s*h.Lv.uX(i),this.y0=u+o*h.Lv.uY(i),i=h.Lv.add(i,2),this.x1=a+s*h.Lv.uX(i),this.y1=u+o*h.Lv.uY(i),i=h.Lv.add(i,2),this.x2=a+s*h.Lv.uX(i),this.y2=u+o*h.Lv.uY(i),i=h.Lv.add(i,2),this.x3=a+s*h.Lv.uX(i),this.y3=u+o*h.Lv.uY(i)}else this.x0=t.x/n,this.y0=t.y/r,this.x1=(t.x+t.width)/n,this.y1=t.y/r,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/r,this.x3=t.x/n,this.y3=(t.y+t.height)/r;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},t.prototype.toString=function(){return"[@pixi/core:TextureUvs x0="+this.x0+" y0="+this.y0+" x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+" x3="+this.x3+" y3="+this.y3+"]"},t}(),P=new I,N=function(t){function e(i,n,r,s,o,a){var u=t.call(this)||this;if(u.noFrame=!1,n||(u.noFrame=!0,n=new h.Ae(0,0,1,1)),i instanceof e&&(i=i.baseTexture),u.baseTexture=i,u._frame=n,u.trim=s,u.valid=!1,u._uvs=P,u.uvMatrix=null,u.orig=r||n,u._rotate=Number(o||0),!0===o)u._rotate=2;else if(u._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return u.defaultAnchor=a?new h.E9(a.x,a.y):new h.E9(0,0),u._updateID=0,u.textureCacheIds=[],i.valid?u.noFrame?i.valid&&u.onBaseTextureUpdated(i):u.frame=n:i.once("loaded",u.onBaseTextureUpdated,u),u.noFrame&&i.on("update",u.onBaseTextureUpdated,u),u}return f(e,t),e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var i=this.baseTexture.resource;i&&i.url&&s.TextureCache[i.url]&&e.removeFromCache(i.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){var t=this._frame.clone(),i=this._frame===this.orig?t:this.orig.clone(),n=new e(this.baseTexture,!this.noFrame&&t,i,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(n._frame=t),n},e.prototype.updateUvs=function(){this._uvs===P&&(this._uvs=new I),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,i,r){void 0===i&&(i={}),void 0===r&&(r=n.X.STRICT_TEXTURE_CACHE);var o="string"==typeof t,a=null;if(o)a=t;else if(t instanceof v){if(!t.cacheId){var h=i&&i.pixiIdPrefix||"pixiid";t.cacheId=h+"-"+(0,s.uid)(),v.addToCache(t,t.cacheId)}a=t.cacheId}else t._pixiId||(h=i&&i.pixiIdPrefix||"pixiid",t._pixiId=h+"_"+(0,s.uid)()),a=t._pixiId;var u=s.TextureCache[a];if(o&&r&&!u)throw new Error('The cacheId "'+a+'" does not exist in TextureCache.');return u||t instanceof v?!u&&t instanceof v&&(u=new e(t),e.addToCache(u,a)):(i.resolution||(i.resolution=(0,s.getResolutionOfUrl)(t)),(u=new e(new v(t,i))).baseTexture.cacheId=a,v.addToCache(u.baseTexture,a),e.addToCache(u,a)),u},e.fromURL=function(t,i){var n=Object.assign({autoLoad:!1},null==i?void 0:i.resourceOptions),r=e.from(t,Object.assign({resourceOptions:n},i),!1),s=r.baseTexture.resource;return r.baseTexture.valid?Promise.resolve(r):s.load().then((function(){return Promise.resolve(r)}))},e.fromBuffer=function(t,i,n,r){return new e(v.fromBuffer(t,i,n,r))},e.fromLoader=function(t,i,r,o){var a=new v(t,Object.assign({scaleMode:n.X.SCALE_MODE,resolution:(0,s.getResolutionOfUrl)(i)},o)),h=a.resource;h instanceof T&&(h.url=i);var u=new e(a);return r||(r=i),v.addToCache(u.baseTexture,r),e.addToCache(u,r),r!==i&&(v.addToCache(u.baseTexture,i),e.addToCache(u,i)),u.baseTexture.valid?Promise.resolve(u):new Promise((function(t){u.baseTexture.once("loaded",(function(){return t(u)}))}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),s.TextureCache[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),s.TextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=s.TextureCache[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete s.TextureCache[t],e}}else if(t&&t.textureCacheIds){for(var n=0;n<t.textureCacheIds.length;++n)s.TextureCache[t.textureCacheIds[n]]===t&&delete s.TextureCache[t.textureCacheIds[n]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,i=t.y,n=t.width,r=t.height,s=e+n>this.baseTexture.width,o=i+r>this.baseTexture.height;if(s||o){var a=s&&o?"and":"or",h="X: "+e+" + "+n+" = "+(e+n)+" > "+this.baseTexture.width,u="Y: "+i+" + "+r+" = "+(i+r)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=n&&r&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},e}(s.EventEmitter);function D(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}N.EMPTY=new N(new v),D(N.EMPTY),D(N.EMPTY.baseTexture),N.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new N(new v(new E(t)))}(),D(N.WHITE),D(N.WHITE.baseTexture);var L=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return f(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,i){void 0===i&&(i=!0);var n=this.baseTexture.resolution,r=Math.round(t*n)/n,s=Math.round(e*n)/n;this.valid=r>0&&s>0,this._frame.width=this.orig.width=r,this._frame.height=this.orig.height=s,i&&this.baseTexture.resize(r,s),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){for(var i=arguments,n=[],r=1;r<arguments.length;r++)n[r-1]=i[r];return"number"==typeof t&&((0,s.deprecation)("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:n[0],scaleMode:n[1],resolution:n[2]}),new e(new C(t))},e}(N),k=function(){function t(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return t.prototype.createTexture=function(t,e,i){void 0===i&&(i=r.G5.NONE);var n=new C(Object.assign({width:t,height:e,resolution:1,multisample:i},this.textureOptions));return new L(n)},t.prototype.getOptimalTexture=function(t,e,i,n){var o;void 0===i&&(i=1),void 0===n&&(n=r.G5.NONE),t=Math.ceil(t*i),e=Math.ceil(e*i),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?o=n>1?-n:-1:(o=((65535&(t=(0,s.nextPow2)(t)))<<16|65535&(e=(0,s.nextPow2)(e)))>>>0,n>1&&(o+=4294967296*n)),this.texturePool[o]||(this.texturePool[o]=[]);var a=this.texturePool[o].pop();return a||(a=this.createTexture(t,e,n)),a.filterPoolKey=o,a.setResolution(i),a},t.prototype.getFilterTexture=function(t,e,i){var n=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||r.G5.NONE);return n.filterFrame=t.filterFrame,n},t.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},t.prototype.returnFilterTexture=function(t){this.returnTexture(t)},t.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var n=0;n<i.length;n++)i[n].destroy(!0)}this.texturePool={}},t.prototype.setScreenSize=function(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){for(var e in this.enableFullScreen=t.width>0&&t.height>0,this.texturePool)if(Number(e)<0){var i=this.texturePool[e];if(i)for(var n=0;n<i.length;n++)i[n].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}},t.SCREEN_KEY=-1,t}(),B=function(){function t(t,e,i,n,s,o,a){void 0===e&&(e=0),void 0===i&&(i=!1),void 0===n&&(n=r.vK.FLOAT),this.buffer=t,this.size=e,this.normalized=i,this.type=n,this.stride=s,this.start=o,this.instance=a}return t.prototype.destroy=function(){this.buffer=null},t.from=function(e,i,n,r,s){return new t(e,i,n,r,s)},t}(),F=0,G=function(){function t(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=F++,this.disposeRunner=new o.R("disposeBuffer")}return t.prototype.update=function(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(t.prototype,"index",{get:function(){return this.type===r.mr.ELEMENT_ARRAY_BUFFER},set:function(t){this.type=t?r.mr.ELEMENT_ARRAY_BUFFER:r.mr.ARRAY_BUFFER},enumerable:!1,configurable:!0}),t.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new t(e)},t}(),U={Float32Array,Uint32Array,Int32Array,Uint8Array},j={5126:4,5123:2,5121:1},X=0,H={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},z=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=X++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new o.R("disposeGeometry"),this.refCount=0}return t.prototype.addAttribute=function(t,e,i,n,r,s,o,a){if(void 0===i&&(i=0),void 0===n&&(n=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof G||(e instanceof Array&&(e=new Float32Array(e)),e=new G(e));var h=t.split("|");if(h.length>1){for(var u=0;u<h.length;u++)this.addAttribute(h[u],e,i,n,r);return this}var l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new B(l,i,n,r,s,o,a),this.instanced=this.instanced||a,this},t.prototype.getAttribute=function(t){return this.attributes[t]},t.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},t.prototype.addIndex=function(t){return t instanceof G||(t instanceof Array&&(t=new Uint16Array(t)),t=new G(t)),t.type=r.mr.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},t.prototype.getIndex=function(){return this.indexBuffer},t.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],i=[],n=new G;for(t in this.attributes){var r=this.attributes[t],o=this.buffers[r.buffer];e.push(o.data),i.push(r.size*j[r.type]/4),r.buffer=0}for(n.data=function(t,e){for(var i=0,n=0,r={},o=0;o<t.length;o++)n+=e[o],i+=t[o].length;var a=new ArrayBuffer(4*i),h=null,u=0;for(o=0;o<t.length;o++){var l=e[o],c=t[o],f=(0,s.getBufferType)(c);r[f]||(r[f]=new U[f](a)),h=r[f];for(var d=0;d<c.length;d++)h[(d/l|0)*n+u+d%l]=c[d];u+=l}return new Float32Array(a)}(e,i),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},t.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},t.prototype.clone=function(){for(var e=new t,i=0;i<this.buffers.length;i++)e.buffers[i]=new G(this.buffers[i].data.slice(0));for(var i in this.attributes){var n=this.attributes[i];e.attributes[i]=new B(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=r.mr.ELEMENT_ARRAY_BUFFER),e},t.merge=function(e){for(var i,n=new t,o=[],a=[],h=[],u=0;u<e.length;u++){i=e[u];for(var l=0;l<i.buffers.length;l++)a[l]=a[l]||0,a[l]+=i.buffers[l].data.length,h[l]=0}for(u=0;u<i.buffers.length;u++)o[u]=new(H[(0,s.getBufferType)(i.buffers[u].data)])(a[u]),n.buffers[u]=new G(o[u]);for(u=0;u<e.length;u++)for(i=e[u],l=0;l<i.buffers.length;l++)o[l].set(i.buffers[l].data,h[l]),h[l]+=i.buffers[l].data.length;if(n.attributes=i.attributes,i.indexBuffer){n.indexBuffer=n.buffers[i.buffers.indexOf(i.indexBuffer)],n.indexBuffer.type=r.mr.ELEMENT_ARRAY_BUFFER;var c=0,f=0,d=0,p=0;for(u=0;u<i.buffers.length;u++)if(i.buffers[u]!==i.indexBuffer){p=u;break}for(var u in i.attributes){var g=i.attributes[u];(0|g.buffer)===p&&(f+=g.size*j[g.type]/4)}for(u=0;u<e.length;u++){var m=e[u].indexBuffer.data;for(l=0;l<m.length;l++)n.indexBuffer.data[l+d]+=c;c+=e[u].buffers[p].data.length/f,d+=m.length}}return n},t}(),W=function(t){function e(){var e=t.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return f(e,t),e}(z),V=function(t){function e(){var e=t.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new G(e.vertices),e.uvBuffer=new G(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return f(e,t),e.prototype.map=function(t,e){var i=0,n=0;return this.uvs[0]=i,this.uvs[1]=n,this.uvs[2]=i+e.width/t.width,this.uvs[3]=n,this.uvs[4]=i+e.width/t.width,this.uvs[5]=n+e.height/t.height,this.uvs[6]=i,this.uvs[7]=n+e.height/t.height,i=e.x,n=e.y,this.vertices[0]=i,this.vertices[1]=n,this.vertices[2]=i+e.width,this.vertices[3]=n,this.vertices[4]=i+e.width,this.vertices[5]=n+e.height,this.vertices[6]=i,this.vertices[7]=n+e.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(z),Y=0,$=function(){function t(t,e,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Y++,this.static=!!e,this.ubo=!!i,t instanceof G?(this.buffer=t,this.buffer.type=r.mr.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new G(new Float32Array(1)),this.buffer.type=r.mr.UNIFORM_BUFFER,this.autoManage=!0))}return t.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},t.prototype.add=function(e,i,n){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[e]=new t(i,n)},t.from=function(e,i,n){return new t(e,i,n)},t.uboFrom=function(e,i){return new t(e,null==i||i,!0)},t}(),q=function(){function t(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=r.G5.NONE,this.sourceFrame=new h.Ae,this.destinationFrame=new h.Ae,this.bindingSourceFrame=new h.Ae,this.bindingDestinationFrame=new h.Ae,this.filters=[],this.transform=null}return t.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},t}(),Z=[new h.E9,new h.E9,new h.E9,new h.E9],K=new h.y3,J=function(){function t(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new k,this.texturePool.setScreenSize(t.view),this.statePool=[],this.quad=new W,this.quadUv=new V,this.tempRect=new h.Ae,this.activeState={},this.globalUniforms=new $({outputFrame:new h.Ae,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return t.prototype.push=function(t,e){for(var i,n,r=this.renderer,s=this.defaultFilterStack,o=this.statePool.pop()||new q,a=this.renderer.renderTexture,h=e[0].resolution,u=e[0].multisample,l=e[0].padding,c=e[0].autoFit,f=null===(i=e[0].legacy)||void 0===i||i,d=1;d<e.length;d++){var p=e[d];h=Math.min(h,p.resolution),u=Math.min(u,p.multisample),l=this.useMaxPadding?Math.max(l,p.padding):l+p.padding,c=c&&p.autoFit,f=f||null===(n=p.legacy)||void 0===n||n}if(1===s.length&&(this.defaultFilterStack[0].renderTexture=a.current),s.push(o),o.resolution=h,o.multisample=u,o.legacy=f,o.target=t,o.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),o.sourceFrame.pad(l),c){var g=this.tempRect.copyFrom(a.sourceFrame);r.projection.transform&&this.transformAABB(K.copyFrom(r.projection.transform).invert(),g),o.sourceFrame.fit(g)}this.roundFrame(o.sourceFrame,a.current?a.current.resolution:r.resolution,a.sourceFrame,a.destinationFrame,r.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,h,u),o.filters=e,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;var m=this.tempRect;m.x=0,m.y=0,m.width=o.sourceFrame.width,m.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(a.sourceFrame),o.bindingDestinationFrame.copyFrom(a.destinationFrame),o.transform=r.projection.transform,r.projection.transform=null,a.bind(o.renderTexture,o.sourceFrame,m),r.framebuffer.clear(0,0,0,0)},t.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),i=e.filters;this.activeState=e;var n=this.globalUniforms.uniforms;n.outputFrame=e.sourceFrame,n.resolution=e.resolution;var s=n.inputSize,o=n.inputPixel,a=n.inputClamp;if(s[0]=e.destinationFrame.width,s[1]=e.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],o[0]=Math.round(s[0]*e.resolution),o[1]=Math.round(s[1]*e.resolution),o[2]=1/o[0],o[3]=1/o[1],a[0]=.5*o[2],a[1]=.5*o[3],a[2]=e.sourceFrame.width*s[2]-.5*o[2],a[3]=e.sourceFrame.height*s[3]-.5*o[3],e.legacy){var h=n.filterArea;h[0]=e.destinationFrame.width,h[1]=e.destinationFrame.height,h[2]=e.sourceFrame.x,h[3]=e.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();var u=t[t.length-1];if(this.renderer.framebuffer.blit(),1===i.length)i[0].apply(this,e.renderTexture,u.renderTexture,r.yl.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var l=e.renderTexture,c=this.getOptimalFilterTexture(l.width,l.height,e.resolution);c.filterFrame=l.filterFrame;var f=0;for(f=0;f<i.length-1;++f){1===f&&e.multisample>1&&((c=this.getOptimalFilterTexture(l.width,l.height,e.resolution)).filterFrame=l.filterFrame),i[f].apply(this,l,c,r.yl.CLEAR,e);var d=l;l=c,c=d}i[f].apply(this,l,u.renderTexture,r.yl.BLEND,e),f>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)},t.prototype.bindAndClear=function(t,e){void 0===e&&(e=r.yl.CLEAR);var i=this.renderer,n=i.renderTexture,s=i.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,n.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=1&s.stateId||this.forceClear;(e===r.yl.CLEAR||e===r.yl.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)},t.prototype.applyFilter=function(t,e,i,n){var s=this.renderer;s.state.set(t.state),this.bindAndClear(i,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(r.lg.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(r.lg.TRIANGLE_STRIP))},t.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,n=i.sourceFrame,r=i.destinationFrame,s=e._texture.orig,o=t.set(r.width,0,0,r.height,n.x,n.y),a=e.worldTransform.copyTo(h.y3.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/s.width,1/s.height),o.translate(e.anchor.x,e.anchor.y),o},t.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},t.prototype.getOptimalFilterTexture=function(t,e,i,n){return void 0===i&&(i=1),void 0===n&&(n=r.G5.NONE),this.texturePool.getOptimalTexture(t,e,i,n)},t.prototype.getFilterTexture=function(t,e,i){if("number"==typeof t){var n=t;t=e,e=n}t=t||this.activeState.renderTexture;var s=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||r.G5.NONE);return s.filterFrame=t.filterFrame,s},t.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},t.prototype.emptyPool=function(){this.texturePool.clear(!0)},t.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},t.prototype.transformAABB=function(t,e){var i=Z[0],n=Z[1],r=Z[2],s=Z[3];i.set(e.left,e.top),n.set(e.left,e.bottom),r.set(e.right,e.top),s.set(e.right,e.bottom),t.apply(i,i),t.apply(n,n),t.apply(r,r),t.apply(s,s);var o=Math.min(i.x,n.x,r.x,s.x),a=Math.min(i.y,n.y,r.y,s.y),h=Math.max(i.x,n.x,r.x,s.x),u=Math.max(i.y,n.y,r.y,s.y);e.x=o,e.y=a,e.width=h-o,e.height=u-a},t.prototype.roundFrame=function(t,e,i,n,r){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(r){var s=r.a,o=r.b,a=r.c,h=r.d;if((Math.abs(o)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(s)>1e-4||Math.abs(h)>1e-4))return}(r=r?K.copyFrom(r):K.identity()).translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(r,t),t.ceil(e),this.transformAABB(r.invert(),t)}},t}(),Q=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),tt=function(){function t(t){this.renderer=t,this.emptyRenderer=new Q(t),this.currentRenderer=this.emptyRenderer}return t.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},t.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.copyBoundTextures=function(t,e){for(var i=this.renderer.texture.boundTextures,n=e-1;n>=0;--n)t[n]=i[n]||null,t[n]&&(t[n]._batchLocation=n)},t.prototype.boundArray=function(t,e,i,n){for(var r=t.elements,s=t.ids,o=t.count,a=0,h=0;h<o;h++){var u=r[h],l=u._batchLocation;if(l>=0&&l<n&&e[l]===u)s[h]=l;else for(;a<n;){var c=e[a];if(!c||c._batchEnabled!==i||c._batchLocation!==a){s[h]=a,u._batchLocation=a,e[a]=u;break}a++}}},t.prototype.destroy=function(){this.renderer=null},t}(),et=0,it=function(){function t(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),t.view.addEventListener("webglcontextlost",this.handleContextLost,!1),t.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(t.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),t.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=et++,t.isContextLost()&&t.getExtension("WEBGL_lose_context")&&t.getExtension("WEBGL_lose_context").restoreContext()},t.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=et++,this.renderer.runners.contextChange.emit(t)},t.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},t.prototype.createContext=function(t,e){var i;if(n.X.PREFER_ENV>=r.Vi.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},t.prototype.getExtensions=function(){var t=this.gl,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},t.prototype.handleContextLost=function(t){t.preventDefault()},t.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},t.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},t.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},t.prototype.validateContext=function(t){var e=t.getContextAttributes(),i="WebGL2RenderingContext"in self&&t instanceof self.WebGL2RenderingContext;i&&(this.webGLVersion=2),e.stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},t}(),nt=function(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=r.G5.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},rt=new h.Ae,st=function(){function t(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new R(10,10),this.msaaSamples=null}return t.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new h.Ae,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;n.X.PREFER_ENV===r.Vi.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},t.prototype.bind=function(t,e,i){void 0===i&&(i=0);var n=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,r.framebuffer)),r.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,r.mipLevel=i),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,r.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var s=0;s<t.colorTextures.length;s++){var o=t.colorTextures[s];this.renderer.texture.unbind(o.parentTextureArray||o)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){var a=e.width>>i,h=e.height>>i,u=a/e.width;this.setViewport(e.x*u,e.y*u,a,h)}else a=t.width>>i,h=t.height>>i,this.setViewport(0,0,a,h)}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},t.prototype.setViewport=function(t,e,i,n){var r=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n),r.width===i&&r.height===n&&r.x===t&&r.y===e||(r.x=t,r.y=e,r.width=i,r.height=n,this.gl.viewport(t,e,i,n))},Object.defineProperty(t.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),t.prototype.clear=function(t,e,i,n,s){void 0===s&&(s=r.V0.COLOR|r.V0.DEPTH);var o=this.gl;o.clearColor(t,e,i,n),o.clear(s)},t.prototype.initFramebuffer=function(t){var e=this.gl,i=new nt(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i},t.prototype.resizeFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID];i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.RGBA8,t.width,t.height)),i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var n=t.colorTextures,r=n.length;e.drawBuffers||(r=Math.min(r,1));for(var s=0;s<r;s++){var o=n[s],a=o.parentTextureArray||o;this.renderer.texture.bind(a,0)}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)},t.prototype.updateFramebuffer=function(t,e){var i=this.gl,n=t.glFramebuffers[this.CONTEXT_UID],r=t.colorTextures,s=r.length;i.drawBuffers||(s=Math.min(s,1)),n.multisample>1&&this.canMultisampleFramebuffer(t)?(n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.RGBA8,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var o=[],a=0;a<s;a++){var h=r[a],u=h.parentTextureArray||h;this.renderer.texture.bind(u,0),0===a&&n.msaaBuffer||(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+a,h.target,u._glTextures[this.CONTEXT_UID].texture,e),o.push(i.COLOR_ATTACHMENT0+a))}if(o.length>1&&i.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){var l=t.depthTexture;this.renderer.texture.bind(l,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null):(n.stencil=n.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.DEPTH24_STENCIL8,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil))},t.prototype.canMultisampleFramebuffer=function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture},t.prototype.detectSamples=function(t){var e=this.msaaSamples,i=r.G5.NONE;if(t<=1||null===e)return i;for(var n=0;n<e.length;n++)if(e[n]<=t){i=e[n];break}return 1===i&&(i=r.G5.NONE),i},t.prototype.blit=function(t,e,i){var n=this,r=n.current,s=n.renderer,o=n.gl,a=n.CONTEXT_UID;if(2===s.context.webGLVersion&&r){var h=r.glFramebuffers[a];if(h){if(!t){if(!h.msaaBuffer)return;var u=r.colorTextures[0];if(!u)return;h.blitFramebuffer||(h.blitFramebuffer=new R(r.width,r.height),h.blitFramebuffer.addColorTexture(0,u)),(t=h.blitFramebuffer).colorTextures[0]!==u&&(t.colorTextures[0]=u,t.dirtyId++,t.dirtyFormat++),t.width===r.width&&t.height===r.height||(t.width=r.width,t.height=r.height,t.dirtyId++,t.dirtySize++)}e||((e=rt).width=r.width,e.height=r.height),i||(i=e);var l=e.width===i.width&&e.height===i.height;this.bind(t),o.bindFramebuffer(o.READ_FRAMEBUFFER,h.framebuffer),o.blitFramebuffer(e.x,e.y,e.width,e.height,i.x,i.y,i.width,i.height,o.COLOR_BUFFER_BIT,l?o.NEAREST:o.LINEAR)}}},t.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],n=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var r=this.managedFramebuffers.indexOf(t);r>=0&&this.managedFramebuffers.splice(r,1),t.disposeRunner.remove(this),e||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&i.blitFramebuffer.dispose()}},t.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i<e.length;i++)this.disposeFramebuffer(e[i],t)},t.prototype.forceStencil=function(){var t=this.current;if(t){var e=t.glFramebuffers[this.CONTEXT_UID];if(e&&!e.stencil){t.stencil=!0;var i=t.width,n=t.height,r=this.gl,s=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,s),e.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,e.multisample,r.DEPTH24_STENCIL8,i,n):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,i,n),e.stencil=s,r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,s)}}},t.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new h.Ae},t.prototype.destroy=function(){this.renderer=null},t}(),ot={5126:4,5123:2,5121:1},at=function(){function t(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return t.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){var i=this.renderer.context.extensions.vertexArrayObject;n.X.PREFER_ENV===r.Vi.WEBGL_LEGACY&&(i=null),i?(t.createVertexArray=function(){return i.createVertexArrayOES()},t.bindVertexArray=function(t){return i.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return i.deleteVertexArrayOES(t)}):(this.hasVao=!1,t.createVertexArray=function(){return null},t.bindVertexArray=function(){return null},t.deleteVertexArray=function(){return null})}if(2!==e.webGLVersion){var s=t.getExtension("ANGLE_instanced_arrays");s?(t.vertexAttribDivisor=function(t,e){return s.vertexAttribDivisorANGLE(t,e)},t.drawElementsInstanced=function(t,e,i,n,r){return s.drawElementsInstancedANGLE(t,e,i,n,r)},t.drawArraysInstanced=function(t,e,i,n){return s.drawArraysInstancedANGLE(t,e,i,n)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex},t.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var i=this.gl,n=t.glVertexArrayObjects[this.CONTEXT_UID],r=!1;n||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=n={},r=!0);var s=n[e.program.id]||this.initGeometryVao(t,e,r);this._activeGeometry=t,this._activeVao!==s&&(this._activeVao=s,this.hasVao?i.bindVertexArray(s):this.activateVao(t,e.program)),this.updateBuffers()},t.prototype.reset=function(){this.unbind()},t.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.renderer.buffer,i=0;i<t.buffers.length;i++){var n=t.buffers[i];e.update(n)}},t.prototype.checkCompatibility=function(t,e){var i=t.attributes,n=e.attributeData;for(var r in n)if(!i[r])throw new Error('shader and geometry incompatible, geometry missing the "'+r+'" attribute')},t.prototype.getSignature=function(t,e){var i=t.attributes,n=e.attributeData,r=["g",t.id];for(var s in i)n[s]&&r.push(s,n[s].location);return r.join("-")},t.prototype.initGeometryVao=function(t,e,i){void 0===i&&(i=!0);var n=this.gl,r=this.CONTEXT_UID,s=this.renderer.buffer,o=e.program;o.glPrograms[r]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,o);var a=this.getSignature(t,o),h=t.glVertexArrayObjects[this.CONTEXT_UID],u=h[a];if(u)return h[o.id]=u,u;var l=t.buffers,c=t.attributes,f={},d={};for(var p in l)f[p]=0,d[p]=0;for(var p in c)!c[p].size&&o.attributeData[p]?c[p].size=o.attributeData[p].size:c[p].size||console.warn("PIXI Geometry attribute '"+p+"' size cannot be determined (likely the bound shader does not have the attribute)"),f[c[p].buffer]+=c[p].size*ot[c[p].type];for(var p in c){var g=c[p],m=g.size;void 0===g.stride&&(f[g.buffer]===m*ot[g.type]?g.stride=0:g.stride=f[g.buffer]),void 0===g.start&&(g.start=d[g.buffer],d[g.buffer]+=m*ot[g.type])}u=n.createVertexArray(),n.bindVertexArray(u);for(var v=0;v<l.length;v++){var _=l[v];s.bind(_),i&&_._glBuffers[r].refCount++}return this.activateVao(t,o),this._activeVao=u,h[o.id]=u,h[a]=u,u},t.prototype.disposeGeometry=function(t,e){var i;if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var n=t.glVertexArrayObjects[this.CONTEXT_UID],r=this.gl,s=t.buffers,o=null===(i=this.renderer)||void 0===i?void 0:i.buffer;if(t.disposeRunner.remove(this),n){if(o)for(var a=0;a<s.length;a++){var h=s[a]._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,0!==h.refCount||e||o.dispose(s[a],e))}if(!e)for(var u in n)if("g"===u[0]){var l=n[u];this._activeVao===l&&this.unbind(),r.deleteVertexArray(l)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),i=0;i<e.length;i++)this.disposeGeometry(this.managedGeometries[e[i]],t)},t.prototype.activateVao=function(t,e){var i=this.gl,n=this.CONTEXT_UID,r=this.renderer.buffer,s=t.buffers,o=t.attributes;t.indexBuffer&&r.bind(t.indexBuffer);var a=null;for(var h in o){var u=o[h],l=s[u.buffer],c=l._glBuffers[n];if(e.attributeData[h]){a!==c&&(r.bind(l),a=c);var f=e.attributeData[h].location;if(i.enableVertexAttribArray(f),i.vertexAttribPointer(f,u.size,u.type||i.FLOAT,u.normalized,u.stride,u.start),u.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");i.vertexAttribDivisor(f,1)}}}},t.prototype.draw=function(t,e,i,n){var r=this.gl,s=this._activeGeometry;if(s.indexBuffer){var o=s.indexBuffer.data.BYTES_PER_ELEMENT,a=2===o?r.UNSIGNED_SHORT:r.UNSIGNED_INT;2===o||4===o&&this.canUseUInt32ElementIndex?s.instanced?r.drawElementsInstanced(t,e||s.indexBuffer.data.length,a,(i||0)*o,n||1):r.drawElements(t,e||s.indexBuffer.data.length,a,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else s.instanced?r.drawArraysInstanced(t,i,e||s.getSize(),n||1):r.drawArrays(t,i,e||s.getSize());return this},t.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},t.prototype.destroy=function(){this.renderer=null},t}(),ht=function(){function t(t){void 0===t&&(t=null),this.type=r.A7.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=n.X.FILTER_MULTISAMPLE,this.enabled=!0,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._target=null}return Object.defineProperty(t.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=r.A7.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},t.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},t}();function ut(t,e,i){var n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}function lt(t,e){var i=t.getShaderSource(e).split("\n").map((function(t,e){return e+": "+t})),n=t.getShaderInfoLog(e),r=n.split("\n"),s={},o=r.map((function(t){return parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))})).filter((function(t){return!(!t||s[t]||(s[t]=!0,0))})),a=[""];o.forEach((function(t){i[t-1]="%c"+i[t-1]+"%c",a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));var h=i.join("\n");a[0]=h,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,a),console.groupEnd()}function ct(t){for(var e=new Array(t),i=0;i<e.length;i++)e[i]=!1;return e}function ft(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return ct(2*e);case"bvec3":return ct(3*e);case"bvec4":return ct(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var dt,pt={},gt=pt;function mt(){if(gt===pt||gt&&gt.isContextLost()){var t=document.createElement("canvas"),e=void 0;n.X.PREFER_ENV>=r.Vi.WEBGL2&&(e=t.getContext("webgl2",{})),e||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),gt=e}return gt}function vt(t,e,i){if("precision"!==t.substring(0,9)){var n=e;return e===r.cB.HIGH&&i!==r.cB.HIGH&&(n=r.cB.MEDIUM),"precision "+n+" float;\n"+t}return i!==r.cB.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var _t={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function yt(t){return _t[t]}var bt=null,Et={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function xt(t,e){if(!bt){var i=Object.keys(Et);bt={};for(var n=0;n<i.length;++n){var r=i[n];bt[t[r]]=Et[r]}}return bt[e]}var Tt,wt=[{test:function(t){return"float"===t.type&&1===t.size},code:function(t){return'\n if(uv["'+t+'"] !== ud["'+t+'"].value)\n {\n ud["'+t+'"].value = uv["'+t+'"]\n gl.uniform1f(ud["'+t+'"].location, uv["'+t+'"])\n }\n '}},{test:function(t){return("sampler2D"===t.type||"samplerCube"===t.type||"sampler2DArray"===t.type)&&1===t.size&&!t.isArray},code:function(t){return't = syncData.textureCount++;\n\n renderer.texture.bind(uv["'+t+'"], t);\n\n if(ud["'+t+'"].value !== t)\n {\n ud["'+t+'"].value = t;\n gl.uniform1i(ud["'+t+'"].location, t);\n; // eslint-disable-line max-len\n }'}},{test:function(t,e){return"mat3"===t.type&&1===t.size&&void 0!==e.a},code:function(t){return'\n gl.uniformMatrix3fv(ud["'+t+'"].location, false, uv["'+t+'"].toArray(true));\n '},codeUbo:function(t){return"\n var "+t+"_matrix = uv."+t+".toArray(true);\n\n data[offset] = "+t+"_matrix[0];\n data[offset+1] = "+t+"_matrix[1];\n data[offset+2] = "+t+"_matrix[2];\n \n data[offset + 4] = "+t+"_matrix[3];\n data[offset + 5] = "+t+"_matrix[4];\n data[offset + 6] = "+t+"_matrix[5];\n \n data[offset + 8] = "+t+"_matrix[6];\n data[offset + 9] = "+t+"_matrix[7];\n data[offset + 10] = "+t+"_matrix[8];\n "}},{test:function(t,e){return"vec2"===t.type&&1===t.size&&void 0!==e.x},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud["'+t+'"].location, v.x, v.y);\n }'},codeUbo:function(t){return"\n v = uv."+t+";\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n "}},{test:function(t){return"vec2"===t.type&&1===t.size},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud["'+t+'"].location, v[0], v[1]);\n }\n '}},{test:function(t,e){return"vec4"===t.type&&1===t.size&&void 0!==e.width},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud["'+t+'"].location, v.x, v.y, v.width, v.height)\n }'},codeUbo:function(t){return"\n v = uv."+t+";\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n data[offset+2] = v.width;\n data[offset+3] = v.height;\n "}},{test:function(t){return"vec4"===t.type&&1===t.size},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud["'+t+'"].location, v[0], v[1], v[2], v[3])\n }'}}],St={float:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1f(location, v);\n }",vec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\n }",vec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }",vec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",int:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",ivec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",ivec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",ivec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",uint:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1ui(location, v);\n }",uvec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0], v[1]);\n }",uvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }",uvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",bool:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1i(location, v);\n }",bvec2:"\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",bvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",bvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"gl.uniform1i(location, v)",samplerCube:"gl.uniform1i(location, v)",sampler2DArray:"gl.uniform1i(location, v)"},At={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"},Mt=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function Ot(t){for(var e="",i=0;i<t;++i)i>0&&(e+="\nelse "),i<t-1&&(e+="if(test == "+i+".0){}");return e}function Rt(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var i=e.createShader(e.FRAGMENT_SHADER);;){var n=Mt.replace(/%forloop%/gi,Ot(t));if(e.shaderSource(i,n),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS))break;t=t/2|0}return t}var Ct=0,It={},Pt=function(){function t(e,i,s){void 0===s&&(s="pixi-shader"),this.id=Ct++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=i||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(s=s.replace(/\s+/g,"-"),It[s]?(It[s]++,s+="-"+It[s]):It[s]=1,this.vertexSrc="#define SHADER_NAME "+s+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+s+"\n"+this.fragmentSrc,this.vertexSrc=vt(this.vertexSrc,n.X.PRECISION_VERTEX,r.cB.HIGH),this.fragmentSrc=vt(this.fragmentSrc,n.X.PRECISION_FRAGMENT,function(){if(!dt){dt=r.cB.MEDIUM;var t=mt();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);dt=e.precision?r.cB.HIGH:r.cB.MEDIUM}}return dt}())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),t.from=function(e,i,n){var r=e+i,o=s.ProgramCache[r];return o||(s.ProgramCache[r]=o=new t(e,i,n)),o},t}(),Nt=function(){function t(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof $?e:new $(e):new $({})}return t.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var i in e.uniforms){var n=e.uniforms[i];if(n.group&&this.checkUniformExists(t,n))return!0}return!1},t.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(t.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),t.from=function(e,i,n){return new t(Pt.from(e,i),n)},t}(),Dt=function(){function t(){this.data=0,this.blendMode=r.T$.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(t.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(t){!!(1&this.data)!==t&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(t){!!(2&this.data)!==t&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(t){!!(4&this.data)!==t&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(t){!!(8&this.data)!==t&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(t){!!(32&this.data)!==t&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(t){!!(16&this.data)!==t&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blend=t!==r.T$.NONE,this._blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},t.for2d=function(){var e=new t;return e.depthTest=!1,e.blend=!0,e},t}(),Lt=function(t){function e(i,r,s){var o=this,a=Pt.from(i||e.defaultVertexSrc,r||e.defaultFragmentSrc);return(o=t.call(this,a,s)||this).padding=0,o.resolution=n.X.FILTER_RESOLUTION,o.multisample=n.X.FILTER_MULTISAMPLE,o.enabled=!0,o.autoFit=!0,o.state=new Dt,o}return f(e,t),e.prototype.apply=function(t,e,i,n,r){t.applyFilter(this,e,i,n)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),e}(Nt),kt=new h.y3,Bt=function(){function t(t,e){this._texture=t,this.mapCoord=new h.y3,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1}return Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),t.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var i=this.mapCoord,n=0;n<t.length;n+=2){var r=t[n],s=t[n+1];e[n]=r*i.a+s*i.c+i.tx,e[n+1]=r*i.b+s*i.d+i.ty}return e},t.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var i=e._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);var n=e.orig,r=e.trim;r&&(kt.set(n.width/r.width,0,0,n.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(kt));var s=e.baseTexture,o=this.uClampFrame,a=this.clampMargin/s.resolution,h=this.clampOffset;return o[0]=(e._frame.x+a+h)/s.width,o[1]=(e._frame.y+a+h)/s.height,o[2]=(e._frame.x+e._frame.width-a+h)/s.width,o[3]=(e._frame.y+e._frame.height-a+h)/s.height,this.uClampOffset[0]=h/s.realWidth,this.uClampOffset[1]=h/s.realHeight,this.isSimple=e._frame.width===s.width&&e._frame.height===s.height&&0===e.rotate,!0},t}(),Ft=function(t){function e(e,i,n){var r=this,s=null;return"string"!=typeof e&&void 0===i&&void 0===n&&(s=e,e=void 0,i=void 0,n=void 0),(r=t.call(this,e||"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n",i||"varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n",n)||this).maskSprite=s,r.maskMatrix=new h.y3,r}return f(e,t),Object.defineProperty(e.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),e.prototype.apply=function(t,e,i,n){var r=this._maskSprite,s=r._texture;s.valid&&(s.uvMatrix||(s.uvMatrix=new Bt(s,0)),s.uvMatrix.update(),this.uniforms.npmAlpha=s.baseTexture.alphaMode?0:1,this.uniforms.mask=s,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,r).prepend(s.uvMatrix.mapCoord),this.uniforms.alpha=r.worldAlpha,this.uniforms.maskClamp=s.uvMatrix.uClampFrame,t.applyFilter(this,e,i,n))},e}(Lt),Gt=function(){function t(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return t.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},t.prototype.push=function(t,e){var i=e;if(!i.isMaskData){var n=this.maskDataPool.pop()||new ht;n.pooled=!0,n.maskObject=e,i=n}var s=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(s),i.autoDetect&&this.detect(i),i._target=t,i.type!==r.A7.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case r.A7.SCISSOR:this.renderer.scissor.push(i);break;case r.A7.STENCIL:this.renderer.stencil.push(i);break;case r.A7.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i)}i.type===r.A7.SPRITE&&this.maskStack.push(i)},t.prototype.pop=function(t){var e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case r.A7.SCISSOR:this.renderer.scissor.pop();break;case r.A7.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case r.A7.SPRITE:this.popSpriteMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){var i=this.maskStack[this.maskStack.length-1];i.type===r.A7.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}},t.prototype.detect=function(t){t.maskObject.isSprite?t.type=r.A7.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=r.A7.SCISSOR:t.type=r.A7.STENCIL},t.prototype.pushSpriteMask=function(t){var e,i,n=t.maskObject,r=t._target,s=t._filters;s||(s=this.alphaMaskPool[this.alphaMaskIndex])||(s=this.alphaMaskPool[this.alphaMaskIndex]=[new Ft]);var o,a,h=this.renderer,u=h.renderTexture;if(u.current){var l=u.current;o=t.resolution||l.resolution,a=null!==(e=t.multisample)&&void 0!==e?e:l.multisample}else o=t.resolution||h.resolution,a=null!==(i=t.multisample)&&void 0!==i?i:h.multisample;s[0].resolution=o,s[0].multisample=a,s[0].maskSprite=n;var c=r.filterArea;r.filterArea=n.getBounds(!0),h.filter.push(r,s),r.filterArea=c,t._filters||this.alphaMaskIndex++},t.prototype.popSpriteMask=function(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},t.prototype.destroy=function(){this.renderer=null},t}(),Ut=function(){function t(t){this.renderer=t,this.maskStack=[],this.glConst=0}return t.prototype.getStackLength=function(){return this.maskStack.length},t.prototype.setMaskStack=function(t){var e=this.renderer.gl,i=this.getStackLength();this.maskStack=t;var n=this.getStackLength();n!==i&&(0===n?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},t.prototype._useCurrent=function(){},t.prototype.destroy=function(){this.renderer=null,this.maskStack=null},t}(),jt=new h.y3,Xt=function(t){function e(e){var i=t.call(this,e)||this;return i.glConst=WebGLRenderingContext.SCISSOR_TEST,i}return f(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){if(!t._scissorRectLocal){var e=t._scissorRect,i=t.maskObject,n=this.renderer,r=n.renderTexture;i.renderable=!0;var s=i.getBounds();this.roundFrameToPixels(s,r.current?r.current.resolution:n.resolution,r.sourceFrame,r.destinationFrame,n.projection.transform),i.renderable=!1,e&&s.fit(e),t._scissorRectLocal=s}},e.isMatrixRotated=function(t){if(!t)return!1;var e=t.a,i=t.b,n=t.c,r=t.d;return(Math.abs(i)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(r)>1e-4)},e.prototype.testScissor=function(t){var i=t.maskObject;if(!i.isFastRect||!i.isFastRect())return!1;if(e.isMatrixRotated(i.worldTransform))return!1;if(e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var n=t._scissorRectLocal;return n.width>0&&n.height>0},e.prototype.roundFrameToPixels=function(t,i,n,r,s){e.isMatrixRotated(s)||((s=s?jt.copyFrom(s):jt.identity()).translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.renderer.filter.transformAABB(s,t),t.fit(r),t.x=Math.round(t.x*i),t.y=Math.round(t.y*i),t.width=Math.round(t.width*i),t.height=Math.round(t.height*i))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var e=this.renderer.gl;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(){var t=this.renderer.gl;this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t,e=this.maskStack[this.maskStack.length-1]._scissorRect;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},e}(Ut),Ht=function(t){function e(e){var i=t.call(this,e)||this;return i.glConst=WebGLRenderingContext.STENCIL_TEST,i}return f(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,i=this.renderer.gl,n=t._stencilCounter;0===n&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++,i.colorMask(!1,!1,!1,!1),i.stencilFunc(i.EQUAL,n,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?e.disable(e.STENCIL_TEST):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e}(Ut),zt=function(){function t(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new h.y3,this.transform=null}return t.prototype.update=function(t,e,i,n){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);var r=this.renderer;r.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,r.globalUniforms.update(),r.shader.shader&&r.shader.syncUniformGroup(r.shader.shader.uniforms.globals)},t.prototype.calculateProjection=function(t,e,i,n){var r=this.projectionMatrix,s=n?-1:1;r.identity(),r.a=1/e.width*2,r.d=s*(1/e.height*2),r.tx=-1-e.x*r.a,r.ty=-s-e.y*r.d},t.prototype.setTransform=function(t){},t.prototype.destroy=function(){this.renderer=null},t}(),Wt=new h.Ae,Vt=new h.Ae,Yt=function(){function t(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new h.Ae,this.destinationFrame=new h.Ae,this.viewportFrame=new h.Ae}return t.prototype.bind=function(t,e,i){void 0===t&&(t=null);var n,r,s,o=this.renderer;this.current=t,t?(s=(n=t.baseTexture).resolution,e||(Wt.width=t.frame.width,Wt.height=t.frame.height,e=Wt),i||(Vt.x=t.frame.x,Vt.y=t.frame.y,Vt.width=e.width,Vt.height=e.height,i=Vt),r=n.framebuffer):(s=o.resolution,e||(Wt.width=o.screen.width,Wt.height=o.screen.height,e=Wt),i||((i=Wt).width=e.width,i.height=e.height));var a=this.viewportFrame;a.x=i.x*s,a.y=i.y*s,a.width=i.width*s,a.height=i.height*s,t||(a.y=o.view.height-(a.y+a.height)),a.ceil(),this.renderer.framebuffer.bind(r,a),this.renderer.projection.update(i,e,s,!r),t?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)},t.prototype.clear=function(t,e){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor;var i=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,r=i.width!==n.width||i.height!==n.height;if(r){var s=this.viewportFrame,o=s.x,a=s.y,h=s.width,u=s.height;o=Math.round(o),a=Math.round(a),h=Math.round(h),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,a,h,u)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),r&&this.renderer.scissor.pop()},t.prototype.resize=function(){this.bind(null)},t.prototype.reset=function(){this.bind(null)},t.prototype.destroy=function(){this.renderer=null},t}();function $t(t,e,i,n,r){i.buffer.update(r)}var qt={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},Zt={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function Kt(t){for(var e=t.map((function(t){return{data:t,offset:0,dataLen:0,dirty:0}})),i=0,n=0,r=0,s=0;s<e.length;s++){var o=e[s];if(i=Zt[o.data.type],o.data.size>1&&(i=Math.max(i,16)*o.data.size),o.dataLen=i,n%i!=0&&n<16){var a=n%i%16;n+=a,r+=a}n+i>16?(r=16*Math.ceil(r/16),o.offset=r,r+=i,n=i):(o.offset=r,n+=i,r+=i)}return{uboElements:e,size:r=16*Math.ceil(r/16)}}function Jt(t,e){var i=[];for(var n in t)e[n]&&i.push(e[n]);return i.sort((function(t,e){return t.index-e.index})),i}function Qt(t,e){if(!t.autoManage)return{size:0,syncFunc:$t};for(var i=Kt(Jt(t.uniforms,e)),n=i.uboElements,r=i.size,s=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],o=0;o<n.length;o++){for(var a=n[o],h=t.uniforms[a.data.name],u=a.data.name,l=!1,c=0;c<wt.length;c++){var f=wt[c];if(f.codeUbo&&f.test(a.data,h)){s.push("offset = "+a.offset/4+";",wt[c].codeUbo(a.data.name,h)),l=!0;break}}if(!l)if(a.data.size>1){var d=yt(a.data.type),p=Math.max(Zt[a.data.type]/16,1),g=d/p,m=(4-g%4)%4;s.push("\n cv = ud."+u+".value;\n v = uv."+u+";\n offset = "+a.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+a.data.size*p+"; i++)\n {\n for(var j = 0; j < "+g+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+m+";\n }\n\n ")}else{var v=qt[a.data.type];s.push("\n cv = ud."+u+".value;\n v = uv."+u+";\n offset = "+a.offset/4+";\n "+v+";\n ")}}return s.push("\n renderer.buffer.update(buffer);\n "),{size:r,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join("\n"))}}var te=function(){},ee=function(){function t(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},t}();function ie(t,e){var i=ut(t,t.VERTEX_SHADER,e.vertexSrc),n=ut(t,t.FRAGMENT_SHADER,e.fragmentSrc),r=t.createProgram();if(t.attachShader(r,i),t.attachShader(r,n),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)||function(t,e,i,n){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(i,t.COMPILE_STATUS)||lt(t,i),t.getShaderParameter(n,t.COMPILE_STATUS)||lt(t,n),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,r,i,n),e.attributeData=function(t,e){for(var i={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),r=0;r<n;r++){var s=e.getActiveAttrib(t,r);if(0!==s.name.indexOf("gl_")){var o=xt(e,s.type),a={type:o,name:s.name,size:yt(o),location:e.getAttribLocation(t,s.name)};i[s.name]=a}}return i}(r,t),e.uniformData=function(t,e){for(var i={},n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),r=0;r<n;r++){var s=e.getActiveUniform(t,r),o=s.name.replace(/\[.*?\]$/,""),a=!!s.name.match(/\[.*?\]$/),h=xt(e,s.type);i[o]={name:o,index:r,type:h,size:s.size,isArray:a,value:ft(h,s.size)}}return i}(r,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){var s=Object.keys(e.attributeData);s.sort((function(t,e){return t>e?1:-1}));for(var o=0;o<s.length;o++)e.attributeData[s[o]].location=o,t.bindAttribLocation(r,o,s[o]);t.linkProgram(r)}t.deleteShader(i),t.deleteShader(n);var a={};for(var o in e.uniformData){var h=e.uniformData[o];a[o]={location:t.getUniformLocation(r,o),value:ft(h.type,h.size)}}return new ee(r,a)}var ne=0,re={textureCount:0,uboCount:0},se=function(){function t(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=ne++}return t.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof Tt)return Tt;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");Tt=!0===t({a:"b"},"a","b")}catch(t){Tt=!1}return Tt}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},t.prototype.contextChange=function(t){this.gl=t,this.reset()},t.prototype.bind=function(t,e){t.uniforms.globals=this.renderer.globalUniforms;var i=t.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),e||(re.textureCount=0,re.uboCount=0,this.syncUniformGroup(t.uniformGroup,re)),n},t.prototype.setUniforms=function(t){var e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)},t.prototype.syncUniformGroup=function(t,e){var i=this.getGlProgram();t.static&&t.dirtyId===i.uniformDirtyGroups[t.id]||(i.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))},t.prototype.syncUniforms=function(t,e,i){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,i)},t.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){var i,n=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var r in t.uniforms){var s=e[r];if(s){for(var o=t.uniforms[r],a=!1,h=0;h<wt.length;h++)if(wt[h].test(s,o)){n.push(wt[h].code(r,o)),a=!0;break}if(!a){var u=(1===s.size?St:At)[s.type].replace("location",'ud["'+r+'"].location');n.push('\n cu = ud["'+r+'"];\n cv = cu.value;\n v = uv["'+r+'"];\n '+u+";")}}else(null===(i=t.uniforms[r])||void 0===i?void 0:i.group)&&(t.uniforms[r].ubo?n.push("\n renderer.shader.syncUniformBufferGroup(uv."+r+", '"+r+"');\n "):n.push("\n renderer.shader.syncUniformGroup(uv."+r+", syncData);\n "))}return new Function("ud","uv","renderer","syncData",n.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},t.prototype.syncUniformBufferGroup=function(t,e){var i=this.getGlProgram();if(!t.static||0!==t.dirtyId||!i.uniformGroups[t.id]){t.dirtyId=0;var n=i.uniformGroups[t.id]||this.createSyncBufferGroup(t,i,e);t.buffer.update(),n(i.uniformData,t.uniforms,this.renderer,re,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,i.uniformBufferBindings[e])},t.prototype.createSyncBufferGroup=function(t,e,i){var n=this.renderer.gl;this.renderer.buffer.bind(t.buffer);var r=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(e.program,r,this.shader.uniformBindCount),this.shader.uniformBindCount++;var s=this.getSignature(t,this.shader.program.uniformData,"ubo"),o=this._uboCache[s];if(o||(o=this._uboCache[s]=Qt(t,this.shader.program.uniformData)),t.autoManage){var a=new Float32Array(o.size/4);t.buffer.update(a)}return e.uniformGroups[t.id]=o.syncFunc,e.uniformGroups[t.id]},t.prototype.getSignature=function(t,e,i){var n=t.uniforms,r=[i+"-"];for(var s in n)r.push(s),e[s]&&r.push(e[s].type);return r.join("-")},t.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},t.prototype.generateProgram=function(t){var e=this.gl,i=t.program,n=ie(e,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n},t.prototype.reset=function(){this.program=null,this.shader=null},t.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},t}(),oe=function(){function t(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=r.T$.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new Dt,this.defaultState.blend=!0}return t.prototype.contextChange=function(t){this.gl=t,this.blendModes=function(t,e){return void 0===e&&(e=[]),e[r.T$.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.ADD]=[t.ONE,t.ONE],e[r.T$.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.NONE]=[0,0],e[r.T$.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[r.T$.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[r.T$.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[r.T$.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[r.T$.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[r.T$.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[r.T$.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[r.T$.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[r.T$.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[r.T$.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()},t.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,i=0;e;)1&e&&this.map[i].call(this,!!(t.data&1<<i)),e>>=1,i++;this.stateId=t.data}for(i=0;i<this.checks.length;i++)this.checks[i](this,t)},t.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data},t.prototype.setBlend=function(e){this.updateCheck(t.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},t.prototype.setOffset=function(e){this.updateCheck(t.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},t.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},t.prototype.setDepthMask=function(t){this.gl.depthMask(t)},t.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},t.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},t.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],i=this.gl;2===e.length?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}},t.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},t.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},t.prototype.updateCheck=function(t,e){var i=this.checks.indexOf(t);e&&-1===i?this.checks.push(t):e||-1===i||this.checks.splice(i,1)},t.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},t.checkPolygonOffset=function(t,e){t.setPolygonOffset(1,e.polygonOffset)},t.prototype.destroy=function(){this.gl=null},t}(),ae=function(){function t(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=n.X.GC_MAX_IDLE,this.checkCountMax=n.X.GC_MAX_CHECK_COUNT,this.mode=n.X.GC_MODE}return t.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==r.UN.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},t.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,n=0;n<e.length;n++){var r=e[n];!r.framebuffer&&this.count-r.touched>this.maxIdle&&(t.destroyTexture(r,!0),e[n]=null,i=!0)}if(i){var s=0;for(n=0;n<e.length;n++)null!==e[n]&&(e[s++]=e[n]);e.length=s}},t.prototype.unload=function(t){var e=this.renderer.texture,i=t._texture;i&&!i.framebuffer&&e.destroyTexture(i);for(var n=t.children.length-1;n>=0;n--)this.unload(t.children[n])},t.prototype.destroy=function(){this.renderer=null},t}(),he=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=r.vK.UNSIGNED_BYTE,this.internalFormat=r.I2.RGBA,this.samplerType=0},ue=function(){function t(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new v,this.hasIntegerTextures=!1}return t.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){var e,i,n,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x,T,w;return"WebGL2RenderingContext"in self&&t instanceof self.WebGL2RenderingContext?((e={})[r.vK.UNSIGNED_BYTE]=((i={})[r.I2.RGBA]=t.RGBA8,i[r.I2.RGB]=t.RGB8,i[r.I2.RG]=t.RG8,i[r.I2.RED]=t.R8,i[r.I2.RGBA_INTEGER]=t.RGBA8UI,i[r.I2.RGB_INTEGER]=t.RGB8UI,i[r.I2.RG_INTEGER]=t.RG8UI,i[r.I2.RED_INTEGER]=t.R8UI,i[r.I2.ALPHA]=t.ALPHA,i[r.I2.LUMINANCE]=t.LUMINANCE,i[r.I2.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,i),e[r.vK.BYTE]=((n={})[r.I2.RGBA]=t.RGBA8_SNORM,n[r.I2.RGB]=t.RGB8_SNORM,n[r.I2.RG]=t.RG8_SNORM,n[r.I2.RED]=t.R8_SNORM,n[r.I2.RGBA_INTEGER]=t.RGBA8I,n[r.I2.RGB_INTEGER]=t.RGB8I,n[r.I2.RG_INTEGER]=t.RG8I,n[r.I2.RED_INTEGER]=t.R8I,n),e[r.vK.UNSIGNED_SHORT]=((s={})[r.I2.RGBA_INTEGER]=t.RGBA16UI,s[r.I2.RGB_INTEGER]=t.RGB16UI,s[r.I2.RG_INTEGER]=t.RG16UI,s[r.I2.RED_INTEGER]=t.R16UI,s[r.I2.DEPTH_COMPONENT]=t.DEPTH_COMPONENT16,s),e[r.vK.SHORT]=((o={})[r.I2.RGBA_INTEGER]=t.RGBA16I,o[r.I2.RGB_INTEGER]=t.RGB16I,o[r.I2.RG_INTEGER]=t.RG16I,o[r.I2.RED_INTEGER]=t.R16I,o),e[r.vK.UNSIGNED_INT]=((a={})[r.I2.RGBA_INTEGER]=t.RGBA32UI,a[r.I2.RGB_INTEGER]=t.RGB32UI,a[r.I2.RG_INTEGER]=t.RG32UI,a[r.I2.RED_INTEGER]=t.R32UI,a[r.I2.DEPTH_COMPONENT]=t.DEPTH_COMPONENT24,a),e[r.vK.INT]=((h={})[r.I2.RGBA_INTEGER]=t.RGBA32I,h[r.I2.RGB_INTEGER]=t.RGB32I,h[r.I2.RG_INTEGER]=t.RG32I,h[r.I2.RED_INTEGER]=t.R32I,h),e[r.vK.FLOAT]=((u={})[r.I2.RGBA]=t.RGBA32F,u[r.I2.RGB]=t.RGB32F,u[r.I2.RG]=t.RG32F,u[r.I2.RED]=t.R32F,u[r.I2.DEPTH_COMPONENT]=t.DEPTH_COMPONENT32F,u),e[r.vK.HALF_FLOAT]=((l={})[r.I2.RGBA]=t.RGBA16F,l[r.I2.RGB]=t.RGB16F,l[r.I2.RG]=t.RG16F,l[r.I2.RED]=t.R16F,l),e[r.vK.UNSIGNED_SHORT_5_6_5]=((c={})[r.I2.RGB]=t.RGB565,c),e[r.vK.UNSIGNED_SHORT_4_4_4_4]=((f={})[r.I2.RGBA]=t.RGBA4,f),e[r.vK.UNSIGNED_SHORT_5_5_5_1]=((d={})[r.I2.RGBA]=t.RGB5_A1,d),e[r.vK.UNSIGNED_INT_2_10_10_10_REV]=((p={})[r.I2.RGBA]=t.RGB10_A2,p[r.I2.RGBA_INTEGER]=t.RGB10_A2UI,p),e[r.vK.UNSIGNED_INT_10F_11F_11F_REV]=((g={})[r.I2.RGB]=t.R11F_G11F_B10F,g),e[r.vK.UNSIGNED_INT_5_9_9_9_REV]=((m={})[r.I2.RGB]=t.RGB9_E5,m),e[r.vK.UNSIGNED_INT_24_8]=((v={})[r.I2.DEPTH_STENCIL]=t.DEPTH24_STENCIL8,v),e[r.vK.FLOAT_32_UNSIGNED_INT_24_8_REV]=((_={})[r.I2.DEPTH_STENCIL]=t.DEPTH32F_STENCIL8,_),w=e):((y={})[r.vK.UNSIGNED_BYTE]=((b={})[r.I2.RGBA]=t.RGBA,b[r.I2.RGB]=t.RGB,b[r.I2.ALPHA]=t.ALPHA,b[r.I2.LUMINANCE]=t.LUMINANCE,b[r.I2.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,b),y[r.vK.UNSIGNED_SHORT_5_6_5]=((E={})[r.I2.RGB]=t.RGB,E),y[r.vK.UNSIGNED_SHORT_4_4_4_4]=((x={})[r.I2.RGBA]=t.RGBA,x),y[r.vK.UNSIGNED_SHORT_5_5_5_1]=((T={})[r.I2.RGBA]=t.RGBA,T),w=y),w}(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i<e;i++)this.boundTextures[i]=null;this.emptyTextures={};var n=new he(t.createTexture());for(t.bindTexture(t.TEXTURE_2D,n.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=n,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new he(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture),i=0;i<6;i++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);for(t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR),i=0;i<this.boundTextures.length;i++)this.bind(null,i)},t.prototype.bind=function(t,e){void 0===e&&(e=0);var i=this.gl;if((t=null==t?void 0:t.castToBaseTexture())&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;var n=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(t.target,n.texture)),n.dirtyId!==t.dirtyId&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),this.updateTexture(t)),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[e]=null},t.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},t.prototype.unbind=function(t){var e=this.gl,i=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var n=0;n<i.length;n++)i[n]===this.unknownTexture&&this.bind(null,n)}for(n=0;n<i.length;n++)i[n]===t&&(this.currentLocation!==n&&(e.activeTexture(e.TEXTURE0+n),this.currentLocation=n),e.bindTexture(t.target,this.emptyTextures[t.target].texture),i[n]=null)},t.prototype.ensureSamplerType=function(t){var e=this,i=e.boundTextures,n=e.hasIntegerTextures,s=e.CONTEXT_UID;if(n)for(var o=t-1;o>=0;--o){var a=i[o];a&&a._glTextures[s].samplerType!==r.oT.FLOAT&&this.renderer.texture.unbind(a)}},t.prototype.initTexture=function(t){var e=new he(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},t.prototype.initTextureType=function(t,e){var i,n;e.internalFormat=null!==(n=null===(i=this.internalFormats[t.type])||void 0===i?void 0:i[t.format])&&void 0!==n?n:t.format,2===this.webGLVersion&&t.type===r.vK.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},t.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var i=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(i,t,e))e.samplerType!==r.oT.FLOAT&&(this.hasIntegerTextures=!0);else{var n=t.realWidth,s=t.realHeight,o=i.gl;(e.width!==n||e.height!==s||e.dirtyId<0)&&(e.width=n,e.height=s,o.texImage2D(t.target,0,e.internalFormat,n,s,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},t.prototype.destroyTexture=function(t,e){var i=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var n=this.managedTextures.indexOf(t);-1!==n&&(0,s.removeItems)(this.managedTextures,n,1)}},t.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==r.WB.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=r.Nt.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},t.prototype.setStyle=function(t,e){var i=this.gl;if(e.mipmap&&t.mipmap!==r.WB.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===r.aH.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===r.aH.LINEAR){var s=Math.min(t.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===r.aH.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===r.aH.LINEAR?i.LINEAR:i.NEAREST)},t.prototype.destroy=function(){this.renderer=null},t}(),le={__proto__:null,FilterSystem:J,BatchSystem:tt,ContextSystem:it,FramebufferSystem:st,GeometrySystem:at,MaskSystem:Gt,ScissorSystem:Xt,StencilSystem:Ht,ProjectionSystem:zt,RenderTextureSystem:Yt,ShaderSystem:se,StateSystem:oe,TextureGCSystem:ae,TextureSystem:ue},ce=new h.y3,fe=function(t){function e(e,i){void 0===e&&(e=r.N3.UNKNOWN);var o=t.call(this)||this;return i=Object.assign({},n.X.RENDER_OPTIONS,i),o.options=i,o.type=e,o.screen=new h.Ae(0,0,i.width,i.height),o.view=i.view||document.createElement("canvas"),o.resolution=i.resolution||n.X.RESOLUTION,o.useContextAlpha=i.useContextAlpha,o.autoDensity=!!i.autoDensity,o.preserveDrawingBuffer=i.preserveDrawingBuffer,o.clearBeforeRender=i.clearBeforeRender,o._backgroundColor=0,o._backgroundColorRgba=[0,0,0,1],o._backgroundColorString="#000000",o.backgroundColor=i.backgroundColor||o._backgroundColor,o.backgroundAlpha=i.backgroundAlpha,void 0!==i.transparent&&((0,s.deprecation)("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),o.useContextAlpha=i.transparent,o.backgroundAlpha=i.transparent?0:1),o._lastObjectRendered=null,o.plugins={},o}return f(e,t),e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(e*this.resolution);var i=this.view.width/this.resolution,n=this.view.height/this.resolution;this.screen.width=i,this.screen.height=n,this.autoDensity&&(this.view.style.width=i+"px",this.view.style.height=n+"px"),this.emit("resize",i,n)},e.prototype.generateTexture=function(t,e,i,n){void 0===e&&(e={}),"number"==typeof e&&((0,s.deprecation)("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),e={scaleMode:e,resolution:i,region:n});var r=e.region,o=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&(i[n[r]]=t[n[r]])}return i}(e,["region"]);0===(n=r||t.getLocalBounds(null,!0)).width&&(n.width=1),0===n.height&&(n.height=1);var a=L.create(d({width:n.width,height:n.height},o));return ce.tx=-n.x,ce.ty=-n.y,this.render(t,{renderTexture:a,clear:!1,transform:ce,skipUpdateTransform:!!t.parent}),a},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var i=this;i.plugins=null,i.type=r.N3.UNKNOWN,i.view=null,i.screen=null,i._tempDisplayObjectParent=null,i.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=(0,s.hex2string)(t),(0,s.hex2rgb)(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(s.EventEmitter),de=function(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},pe=function(){function t(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return t.prototype.destroy=function(){this.renderer=null},t.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},t.prototype.bind=function(t){var e=this.gl,i=this.CONTEXT_UID,n=t._glBuffers[i]||this.createGLBuffer(t);e.bindBuffer(t.type,n.buffer)},t.prototype.bindBufferBase=function(t,e){var i=this.gl,n=this.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var r=t._glBuffers[n]||this.createGLBuffer(t);this.boundBufferBases[e]=t,i.bindBufferBase(i.UNIFORM_BUFFER,e,r.buffer)}},t.prototype.bindBufferRange=function(t,e,i){var n=this.gl,r=this.CONTEXT_UID;i=i||0;var s=t._glBuffers[r]||this.createGLBuffer(t);n.bindBufferRange(n.UNIFORM_BUFFER,e||0,s.buffer,256*i,256)},t.prototype.update=function(t){var e=this.gl,i=this.CONTEXT_UID,n=t._glBuffers[i];if(t._updateID!==n.updateID)if(n.updateID=t._updateID,e.bindBuffer(t.type,n.buffer),n.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{var r=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,r)}},t.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var i=t._glBuffers[this.CONTEXT_UID],n=this.gl;t.disposeRunner.remove(this),i&&(e||n.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),i=0;i<e.length;i++)this.dispose(this.managedBuffers[e[i]],t)},t.prototype.createGLBuffer=function(t){var e=this.CONTEXT_UID,i=this.gl;return t._glBuffers[e]=new de(i.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]},t}(),ge=function(t){function e(i){var n=t.call(this,r.N3.WEBGL,i)||this;return i=n.options,n.gl=null,n.CONTEXT_UID=0,n.runners={destroy:new o.R("destroy"),contextChange:new o.R("contextChange"),reset:new o.R("reset"),update:new o.R("update"),postrender:new o.R("postrender"),prerender:new o.R("prerender"),resize:new o.R("resize")},n.runners.contextChange.add(n),n.globalUniforms=new $({projectionMatrix:new h.y3},!0),n.addSystem(Gt,"mask").addSystem(it,"context").addSystem(oe,"state").addSystem(se,"shader").addSystem(ue,"texture").addSystem(pe,"buffer").addSystem(at,"geometry").addSystem(st,"framebuffer").addSystem(Xt,"scissor").addSystem(Ht,"stencil").addSystem(zt,"projection").addSystem(ae,"textureGC").addSystem(J,"filter").addSystem(Yt,"renderTexture").addSystem(tt,"batch"),n.initPlugins(e.__plugins),n.multisample=void 0,i.context?n.context.initFromContext(i.context):n.context.initFromOptions({alpha:!!n.useContextAlpha,antialias:i.antialias,premultipliedAlpha:n.useContextAlpha&&"notMultiplied"!==n.useContextAlpha,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:n.options.powerPreference}),n.renderingToScreen=!0,(0,s.sayHello)(2===n.context.webGLVersion?"WebGL 2":"WebGL 1"),n.resize(n.options.width,n.options.height),n}return f(e,t),e.create=function(t){if((0,s.isWebGLSupported)())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.contextChange=function(){var t,e=this.gl;if(1===this.context.webGLVersion){var i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i);t>=r.G5.HIGH?this.multisample=r.G5.HIGH:t>=r.G5.MEDIUM?this.multisample=r.G5.MEDIUM:t>=r.G5.LOW?this.multisample=r.G5.LOW:this.multisample=r.G5.NONE},e.prototype.addSystem=function(t,e){var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var n in this[e]=i,this.runners)this.runners[n].add(i);return this},e.prototype.render=function(t,e){var i,n,r,o;if(e&&(e instanceof L?((0,s.deprecation)("6.0.0","Renderer#render arguments changed, use options instead."),i=e,n=arguments[2],r=arguments[3],o=arguments[4]):(i=e.renderTexture,n=e.clear,r=e.transform,o=e.skipUpdateTransform)),this.renderingToScreen=!i,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(i||(this._lastObjectRendered=t),!o){var a=t.enableTempParent();t.updateTransform(),t.disableTempParent(a)}this.renderTexture.bind(i),this.batch.currentRenderer.start(),(void 0!==n?n:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),i&&i.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(e,i,n,r){void 0===i&&(i={});var s=t.prototype.generateTexture.call(this,e,i,n,r);return this.framebuffer.blit(),s},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(e){for(var i in this.runners.destroy.emit(),this.runners)this.runners[i].destroy();t.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return(0,s.deprecation)("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(fe);function me(t){return ge.create(t)}var ve="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",_e="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",ye=function(){function t(t){(0,s.deprecation)("6.1.0","System class is deprecated, implemement ISystem interface instead."),this.renderer=t}return t.prototype.destroy=function(){this.renderer=null},t}(),be=function(){this.texArray=null,this.blend=0,this.type=r.lg.TRIANGLES,this.start=0,this.size=0,this.data=null},Ee=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;t<this.count;t++)this.elements[t]=null;this.count=0},t}(),xe=function(){function t(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(t.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),t.prototype.view=function(t){return this[t+"View"]},t.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},t.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},t}(),Te=function(t){function e(e){var i=t.call(this,e)||this;return i.shaderGenerator=null,i.geometryClass=null,i.vertexSize=null,i.state=Dt.for2d(),i.size=4*n.X.SPRITE_BATCH_SIZE,i._vertexCount=0,i._indexCount=0,i._bufferedElements=[],i._bufferedTextures=[],i._bufferSize=0,i._shader=null,i._packedGeometries=[],i._packedGeometryPoolSize=2,i._flushId=0,i._aBuffers={},i._iBuffers={},i.MAX_TEXTURES=1,i.renderer.on("prerender",i.onPrerender,i),e.runners.contextChange.add(i),i._dcIndex=0,i._aIndex=0,i._iIndex=0,i._attributeBuffer=null,i._indexBuffer=null,i._tempBoundTextures=[],i}return f(e,t),e.prototype.contextChange=function(){var t=this.renderer.gl;n.X.PREFER_ENV===r.Vi.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),n.X.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=Rt(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,i=e._textureArrayPool,n=this.size/4,r=Math.floor(n/this.MAX_TEXTURES)+1;t.length<n;)t.push(new be);for(;i.length<r;)i.push(new Ee);for(var s=0;s<this.MAX_TEXTURES;s++)this._tempBoundTextures[s]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,i=this.MAX_TEXTURES,n=e._textureArrayPool,r=this.renderer.batch,s=this._tempBoundTextures,o=this.renderer.textureGC.count,a=++v._globalBatch,h=0,u=n[0],l=0;r.copyBoundTextures(s,i);for(var c=0;c<this._bufferSize;++c){var f=t[c];t[c]=null,f._batchEnabled!==a&&(u.count>=i&&(r.boundArray(u,s,a,i),this.buildDrawCalls(u,l,c),l=c,u=n[++h],++a),f._batchEnabled=a,f.touched=o,u.elements[u.count++]=f)}for(u.count>0&&(r.boundArray(u,s,a,i),this.buildDrawCalls(u,l,this._bufferSize),++h,++a),c=0;c<s.length;c++)s[c]=null;v._globalBatch=a},e.prototype.buildDrawCalls=function(t,i,n){var r=this,o=r._bufferedElements,a=r._attributeBuffer,h=r._indexBuffer,u=r.vertexSize,l=e._drawCallPool,c=this._dcIndex,f=this._aIndex,d=this._iIndex,p=l[c];p.start=this._iIndex,p.texArray=t;for(var g=i;g<n;++g){var m=o[g],v=m._texture.baseTexture,_=s.premultiplyBlendMode[v.alphaMode?1:0][m.blendMode];o[g]=null,i<g&&p.blend!==_&&(p.size=d-p.start,i=g,(p=l[++c]).texArray=t,p.start=d),this.packInterleavedGeometry(m,a,h,f,d),f+=m.vertexData.length/2*u,d+=m.indices.length,p.blend=_}i<n&&(p.size=d-p.start,++c),this._dcIndex=c,this._aIndex=f,this._iIndex=d},e.prototype.bindAndClearTexArray=function(t){for(var e=this.renderer.texture,i=0;i<t.count;i++)e.bind(t.elements[i],t.ids[i]),t.elements[i]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this,e=t._packedGeometries,i=t._attributeBuffer,r=t._indexBuffer;n.X.CAN_UPLOAD_SAME_BUFFER?(e[this._flushId]._buffer.update(i.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(i.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,i=this.renderer,n=i.gl,r=i.state,s=e._drawCallPool,o=null,a=0;a<t;a++){var h=s[a],u=h.texArray,l=h.type,c=h.size,f=h.start,d=h.blend;o!==u&&(o=u,this.bindAndClearTexArray(u)),this.state.blendMode=d,r.set(this.state),n.drawElements(l,c,n.UNSIGNED_SHORT,2*f)}},e.prototype.flush=function(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),n.X.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),t.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var e=(0,s.nextPow2)(Math.ceil(t/8)),i=(0,s.log2)(e),n=8*e;this._aBuffers.length<=i&&(this._iBuffers.length=i+1);var r=this._aBuffers[n];return r||(this._aBuffers[n]=r=new xe(n*this.vertexSize*4)),r},e.prototype.getIndexBuffer=function(t){var e=(0,s.nextPow2)(Math.ceil(t/12)),i=(0,s.log2)(e),n=12*e;this._iBuffers.length<=i&&(this._iBuffers.length=i+1);var r=this._iBuffers[i];return r||(this._iBuffers[i]=r=new Uint16Array(n)),r},e.prototype.packInterleavedGeometry=function(t,e,i,n,r){for(var o=e.uint32View,a=e.float32View,h=n/this.vertexSize,u=t.uvs,l=t.indices,c=t.vertexData,f=t._texture.baseTexture._batchLocation,d=Math.min(t.worldAlpha,1),p=d<1&&t._texture.baseTexture.alphaMode?(0,s.premultiplyTint)(t._tintRGB,d):t._tintRGB+(255*d<<24),g=0;g<c.length;g+=2)a[n++]=c[g],a[n++]=c[g+1],a[n++]=u[g],a[n++]=u[g+1],o[n++]=p,a[n++]=f;for(g=0;g<l.length;g++)i[r++]=h+l[g]},e._drawCallPool=[],e._textureArrayPool=[],e}(Q),we=function(){function t(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return t.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),i=0;i<t;i++)e[i]=i;this.defaultGroupCache[t]=$.from({uSamplers:e},!0);var n=this.fragTemplate;n=(n=n.replace(/%count%/gi,""+t)).replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new Pt(this.vertexSrc,n)}var r={tint:new Float32Array([1,1,1,1]),translationMatrix:new h.y3,default:this.defaultGroupCache[t]};return new Nt(this.programCache[t],r)},t.prototype.generateSampleSrc=function(t){var e="";e+="\n",e+="\n";for(var i=0;i<t;i++)i>0&&(e+="\nelse "),i<t-1&&(e+="if(vTextureId < "+i+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+i+"], vTextureCoord);",e+="\n}";return(e+="\n")+"\n"},t}(),Se=function(t){function e(e){void 0===e&&(e=!1);var i=t.call(this)||this;return i._buffer=new G(null,e,!1),i._indexBuffer=new G(null,e,!0),i.addAttribute("aVertexPosition",i._buffer,2,!1,r.vK.FLOAT).addAttribute("aTextureCoord",i._buffer,2,!1,r.vK.FLOAT).addAttribute("aColor",i._buffer,4,!0,r.vK.UNSIGNED_BYTE).addAttribute("aTextureId",i._buffer,1,!0,r.vK.FLOAT).addIndex(i._indexBuffer),i}return f(e,t),e}(z),Ae="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",Me="varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\n",Oe=function(){function t(){}return t.create=function(t){var e=Object.assign({vertex:Ae,fragment:Me,geometryClass:Se,vertexSize:6},t),i=e.vertex,n=e.fragment,r=e.vertexSize,s=e.geometryClass;return function(t){function e(e){var o=t.call(this,e)||this;return o.shaderGenerator=new we(i,n),o.geometryClass=s,o.vertexSize=r,o}return f(e,t),e}(Te)},Object.defineProperty(t,"defaultVertexSrc",{get:function(){return Ae},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentTemplate",{get:function(){return Me},enumerable:!1,configurable:!0}),t}(),Re=Oe.create(),Ce={},Ie=function(t){Object.defineProperty(Ce,t,{get:function(){return(0,s.deprecation)("6.0.0","PIXI.systems."+t+" has moved to PIXI."+t),M[t]}})};for(var Pe in M)Ie(Pe);var Ne={},De=function(t){Object.defineProperty(Ne,t,{get:function(){return(0,s.deprecation)("6.0.0","PIXI.resources."+t+" has moved to PIXI."+t),le[t]}})};for(var Pe in le)De(Pe)},550:(t,e,i)=>{"use strict";i.d(e,{LP:()=>b,aN:()=>y,kC:()=>d,dp:()=>E});var n=i(2038),r=function(){function t(t,e,i){void 0===e&&(e=!1),this._fn=t,this._once=e,this._thisArg=i,this._next=this._prev=this._owner=null}return t.prototype.detach=function(){return null!==this._owner&&(this._owner.detach(this),!0)},t}();function s(t,e){return t._head?(t._tail._next=e,e._prev=t._tail,t._tail=e):(t._head=e,t._tail=e),e._owner=t,e}var o=function(){function t(){this._head=this._tail=void 0}return t.prototype.handlers=function(t){void 0===t&&(t=!1);var e=this._head;if(t)return!!e;for(var i=[];e;)i.push(e),e=e._next;return i},t.prototype.has=function(t){if(!(t instanceof r))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return t._owner===this},t.prototype.dispatch=function(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];var n=this._head;if(!n)return!1;for(;n;)n._once&&this.detach(n),n._fn.apply(n._thisArg,e),n=n._next;return!0},t.prototype.add=function(t,e){if(void 0===e&&(e=null),"function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return s(this,new r(t,!1,e))},t.prototype.once=function(t,e){if(void 0===e&&(e=null),"function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return s(this,new r(t,!0,e))},t.prototype.detach=function(t){if(!(t instanceof r))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return t._owner!==this||(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null),this},t.prototype.detachAll=function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this},t}();function a(t,e){e=e||{};for(var i={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},n=i.parser[e.strictMode?"strict":"loose"].exec(t),r={},s=14;s--;)r[i.key[s]]=n[s]||"";return r[i.q.name]={},r[i.key[12]].replace(i.q.parser,(function(t,e,n){e&&(r[i.q.name][e]=n)})),r}var h=!(!self.XDomainRequest||"withCredentials"in new XMLHttpRequest),u=null;function l(){}function c(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function f(t){return t.toString().replace("object ","")}var d=function(){function t(e,i,n){if(this._dequeue=l,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,"string"!=typeof e||"string"!=typeof i)throw new Error("Both name and url are required for constructing a resource.");n=n||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,0===i.indexOf("data:")),this.name=e,this.url=i,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===n.crossOrigin?"anonymous":n.crossOrigin,this.timeout=n.timeout||0,this.loadType=n.loadType||this._determineLoadType(),this.xhrType=n.xhrType,this.metadata=n.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=l,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new o,this.onProgress=new o,this.onComplete=new o,this.onAfterMiddleware=new o}return t.setExtensionLoadType=function(e,i){c(t._loadTypeMap,e,i)},t.setExtensionXhrType=function(e,i){c(t._xhrTypeMap,e,i)},Object.defineProperty(t.prototype,"isDataUrl",{get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isComplete",{get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),t.prototype.complete=function(){this._clearEvents(),this._finish()},t.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=t.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},t.prototype.load=function(e){var i=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout((function(){return e(i)}),1);else switch(e&&this.onComplete.once(e),this._setFlag(t.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case t.LOAD_TYPE.IMAGE:this.type=t.TYPE.IMAGE,this._loadElement("image");break;case t.LOAD_TYPE.AUDIO:this.type=t.TYPE.AUDIO,this._loadSourceElement("audio");break;case t.LOAD_TYPE.VIDEO:this.type=t.TYPE.VIDEO,this._loadSourceElement("video");break;case t.LOAD_TYPE.XHR:default:h&&this.crossOrigin?this._loadXdr():this._loadXhr()}},t.prototype._hasFlag=function(t){return 0!=(this._flags&t)},t.prototype._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},t.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},t.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(t.STATUS_FLAGS.COMPLETE,!0),this._setFlag(t.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},t.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==self.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},t.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==self.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,i=0;i<this.url.length;++i)this.data.appendChild(this._createSource(t,this.url[i],Array.isArray(e)?e[i]:e));else e=this.metadata.mimeType,this.data.appendChild(this._createSource(t,this.url,Array.isArray(e)?e[0]:e));this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},t.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===t.XHR_RESPONSE_TYPE.JSON||this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=t.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},t.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new self.XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout((function(){return t.send()}),1)},t.prototype._createSource=function(t,e,i){i||(i=t+"/"+this._getExtension(e));var n=document.createElement("source");return n.src=e,n.type=i,n},t.prototype._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},t.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},t.prototype._onTimeout=function(){this.abort("Load timed out.")},t.prototype._xhrOnError=function(){var t=this.xhr;this.abort(f(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},t.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(f(t)+" Request timed out.")},t.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(f(t)+" Request was aborted by the user.")},t.prototype._xhrOnLoad=function(){var e=this.xhr,i="",n=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(i=e.responseText),0===n&&(i.length>0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?n=200:1223===n&&(n=204),2==(n/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(self.DOMParser){var r=new DOMParser;this.data=r.parseFromString(i,"text/xml")}else{var s=document.createElement("div");s.innerHTML=i,this.data=s}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(self.origin!==self.location.origin)return"anonymous";e=e||self.location,u||(u=document.createElement("a")),u.href=t;var i=a(u.href,{strictMode:!0}),n=!i.port&&""===e.port||i.port===e.port,r=i.protocol?i.protocol+":":"";return i.host===e.hostname&&n&&r===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(t){void 0===t&&(t=this.url);var e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var n=t.indexOf("?"),r=t.indexOf("#"),s=Math.min(n>-1?n:t.length,r>-1?r:t.length);e=(t=t.substring(0,s)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},t}();function p(){}function g(t){return function(){for(var e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];if(null===t)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,i)}}!function(t){var e,i,n,r;(r=t.STATUS_FLAGS||(t.STATUS_FLAGS={}))[r.NONE=0]="NONE",r[r.DATA_URL=1]="DATA_URL",r[r.COMPLETE=2]="COMPLETE",r[r.LOADING=4]="LOADING",(n=t.TYPE||(t.TYPE={}))[n.UNKNOWN=0]="UNKNOWN",n[n.JSON=1]="JSON",n[n.XML=2]="XML",n[n.IMAGE=3]="IMAGE",n[n.AUDIO=4]="AUDIO",n[n.VIDEO=5]="VIDEO",n[n.TEXT=6]="TEXT",(i=t.LOAD_TYPE||(t.LOAD_TYPE={}))[i.XHR=1]="XHR",i[i.IMAGE=2]="IMAGE",i[i.AUDIO=3]="AUDIO",i[i.VIDEO=4]="VIDEO",(e=t.XHR_RESPONSE_TYPE||(t.XHR_RESPONSE_TYPE={})).DEFAULT="text",e.BUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.TEXT="text",t._loadTypeMap={gif:t.LOAD_TYPE.IMAGE,png:t.LOAD_TYPE.IMAGE,bmp:t.LOAD_TYPE.IMAGE,jpg:t.LOAD_TYPE.IMAGE,jpeg:t.LOAD_TYPE.IMAGE,tif:t.LOAD_TYPE.IMAGE,tiff:t.LOAD_TYPE.IMAGE,webp:t.LOAD_TYPE.IMAGE,tga:t.LOAD_TYPE.IMAGE,svg:t.LOAD_TYPE.IMAGE,"svg+xml":t.LOAD_TYPE.IMAGE,mp3:t.LOAD_TYPE.AUDIO,ogg:t.LOAD_TYPE.AUDIO,wav:t.LOAD_TYPE.AUDIO,mp4:t.LOAD_TYPE.VIDEO,webm:t.LOAD_TYPE.VIDEO},t._xhrTypeMap={xhtml:t.XHR_RESPONSE_TYPE.DOCUMENT,html:t.XHR_RESPONSE_TYPE.DOCUMENT,htm:t.XHR_RESPONSE_TYPE.DOCUMENT,xml:t.XHR_RESPONSE_TYPE.DOCUMENT,tmx:t.XHR_RESPONSE_TYPE.DOCUMENT,svg:t.XHR_RESPONSE_TYPE.DOCUMENT,tsx:t.XHR_RESPONSE_TYPE.DOCUMENT,gif:t.XHR_RESPONSE_TYPE.BLOB,png:t.XHR_RESPONSE_TYPE.BLOB,bmp:t.XHR_RESPONSE_TYPE.BLOB,jpg:t.XHR_RESPONSE_TYPE.BLOB,jpeg:t.XHR_RESPONSE_TYPE.BLOB,tif:t.XHR_RESPONSE_TYPE.BLOB,tiff:t.XHR_RESPONSE_TYPE.BLOB,webp:t.XHR_RESPONSE_TYPE.BLOB,tga:t.XHR_RESPONSE_TYPE.BLOB,json:t.XHR_RESPONSE_TYPE.JSON,text:t.XHR_RESPONSE_TYPE.TEXT,txt:t.XHR_RESPONSE_TYPE.TEXT,ttf:t.XHR_RESPONSE_TYPE.BUFFER,otf:t.XHR_RESPONSE_TYPE.BUFFER},t.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}(d||(d={}));var m=function(t,e){this.data=t,this.callback=e},v=function(){function t(t,e){var i=this;if(void 0===e&&(e=1),this.workers=0,this.saturated=p,this.unsaturated=p,this.empty=p,this.drain=p,this.error=p,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(t,e,n){if(n&&"function"!=typeof n)throw new Error("task callback must be a function");if(i.started=!0,null==t&&i.idle())setTimeout((function(){return i.drain()}),1);else{var r=new m(t,"function"==typeof n?n:p);e?i._tasks.unshift(r):i._tasks.push(r),setTimeout(i.process,1)}},this.process=function(){for(;!i.paused&&i.workers<i.concurrency&&i._tasks.length;){var t=i._tasks.shift();0===i._tasks.length&&i.empty(),i.workers+=1,i.workers===i.concurrency&&i.saturated(),i._worker(t.data,g(i._next(t)))}},this._worker=t,0===e)throw new Error("Concurrency must not be zero");this.concurrency=e,this.buffer=e/4}return t.prototype._next=function(t){var e=this;return function(){for(var i=arguments,n=[],r=0;r<arguments.length;r++)n[r]=i[r];e.workers-=1,t.callback.apply(t,n),null!=n[0]&&e.error(n[0],t.data),e.workers<=e.concurrency-e.buffer&&e.unsaturated(),e.idle()&&e.drain(),e.process()}},t.prototype.push=function(t,e){this._insert(t,!1,e)},t.prototype.kill=function(){this.workers=0,this.drain=p,this.started=!1,this._tasks=[]},t.prototype.unshift=function(t,e){this._insert(t,!0,e)},t.prototype.length=function(){return this._tasks.length},t.prototype.running=function(){return this.workers},t.prototype.idle=function(){return this._tasks.length+this.workers===0},t.prototype.pause=function(){!0!==this.paused&&(this.paused=!0)},t.prototype.resume=function(){if(!1!==this.paused){this.paused=!1;for(var t=1;t<=this.concurrency;t++)this.process()}},t.eachSeries=function(t,e,i,n){var r=0,s=t.length;!function o(a){a||r===s?i&&i(a):n?setTimeout((function(){e(t[r++],o)}),1):e(t[r++],o)}()},t.queue=function(e,i){return new t(e,i)},t}(),_=/(#[\w-]+)?$/,y=function(){function t(e,i){var n=this;void 0===e&&(e=""),void 0===i&&(i=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return n._loadResource(t,e)},this.resources={},this.baseUrl=e,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return n._loadResource(t,e)},this._queue=v.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new o,this.onError=new o,this.onLoad=new o,this.onStart=new o,this.onComplete=new o;for(var r=0;r<t._plugins.length;++r){var s=t._plugins[r],a=s.pre,h=s.use;a&&this.pre(a),h&&this.use(h)}this._protected=!1}return t.prototype._add=function(t,e,i,n){if(this.loading&&(!i||!i.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new d(t,e,i),"function"==typeof n&&this.resources[t].onAfterMiddleware.once(n),this.loading){for(var r=i.parentResource,s=[],o=0;o<r.children.length;++o)r.children[o].isComplete||s.push(r.children[o]);var a=r.progressChunk*(s.length+1)/(s.length+2);for(r.children.push(this.resources[t]),r.progressChunk=a,o=0;o<s.length;++o)s[o].progressChunk=a;this.resources[t].progressChunk=a}return this._queue.push(this.resources[t]),this},t.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},t.prototype.use=function(t){return this._afterMiddleware.push(t),this},t.prototype.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort("loader reset")}return this.resources={},this},t.prototype.load=function(t){if("function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=100/this._queue._tasks.length,i=0;i<this._queue._tasks.length;++i)this._queue._tasks[i].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},Object.defineProperty(t.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t},enumerable:!1,configurable:!0}),t.prototype._prepareUrl=function(t){var e,i=a(t,{strictMode:!0});if(e=i.protocol||!i.path||0===t.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t,this.defaultQueryString){var n=_.exec(e)[0];-1!==(e=e.substr(0,e.length-n.length)).indexOf("?")?e+="&"+this.defaultQueryString:e+="?"+this.defaultQueryString,e+=n}return e},t.prototype._loadResource=function(t,e){var i=this;t._dequeue=e,v.eachSeries(this._beforeMiddleware,(function(e,n){e.call(i,t,(function(){n(t.isComplete?{}:null)}))}),(function(){t.isComplete?i._onLoad(t):(t._onLoadBinding=t.onComplete.once(i._onLoad,i),t.load())}),!0)},t.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},t.prototype._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},t.prototype._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),v.eachSeries(this._afterMiddleware,(function(i,n){i.call(e,t,n)}),(function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(100,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&0===e._resourcesParsing.length&&e._onComplete()}),!0)},t.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(t,"shared",{get:function(){var e=t._shared;return e||((e=new t)._protected=!0,t._shared=e),e},enumerable:!1,configurable:!0}),t.registerPlugin=function(e){return t._plugins.push(e),e.add&&e.add(),t},t._plugins=[],t}();y.prototype.add=function(t,e,i,n){if(Array.isArray(t)){for(var r=0;r<t.length;++r)this.add(t[r]);return this}if("object"==typeof t&&(i=t,n=e||i.callback||i.onComplete,e=i.url,t=i.name||i.key||i.url),"string"!=typeof e&&(n=i,i=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");return"function"==typeof i&&(n=i,i=null),this._add(t,e,i,n)};var b=function(){function t(){}return t.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?y.shared:new y},t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t}(),E=function(){function t(){}return t.add=function(){d.setExtensionLoadType("svg",d.LOAD_TYPE.XHR),d.setExtensionXhrType("svg",d.XHR_RESPONSE_TYPE.TEXT)},t.use=function(t,e){if(!t.data||t.type!==d.TYPE.IMAGE&&"svg"!==t.extension)e();else{var i=t.data,r=t.url,s=t.name,o=t.metadata;n.xE.fromLoader(i,r,s,o).then((function(i){t.texture=i,e()})).catch(e)}},t}(),x=self.URL||self.webkitURL;y.registerPlugin({use:function(t,e){if(t.data){if(t.xhr&&t.xhrType===d.XHR_RESPONSE_TYPE.BLOB)if(self.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var i=x.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=i,t.type=d.TYPE.IMAGE,void(t.data.onload=function(){x.revokeObjectURL(i),t.data.onload=null,e()})}}else{var n=t.xhr.getResponseHeader("content-type");if(n&&0===n.indexOf("image"))return t.data=new Image,t.data.src="data:"+n+";base64,"+function(t){for(var e="",i=0;i<t.length;){for(var n=[0,0,0],r=[0,0,0,0],s=0;s<n.length;++s)i<t.length?n[s]=255&t.charCodeAt(i++):n[s]=0;switch(r[0]=n[0]>>2,r[1]=(3&n[0])<<4|n[1]>>4,r[2]=(15&n[1])<<2|n[2]>>6,r[3]=63&n[2],i-(t.length-1)){case 2:r[3]=64,r[2]=64;break;case 1:r[3]=64}for(s=0;s<r.length;++s)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(r[s])}return e}(t.xhr.responseText),t.type=d.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}}),y.registerPlugin(E)},9658:(t,e,i)=>{"use strict";i.d(e,{Cd:()=>h,ZX:()=>o,Pj:()=>u,y3:()=>p,AB:()=>d,_b:()=>r,E9:()=>f,mg:()=>l,jl:()=>s,Ae:()=>a,c9:()=>c,HS:()=>n,wx:()=>T,Lv:()=>x});var n,r=2*Math.PI,s=180/Math.PI,o=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(n||(n={}));var a=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=n.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height},t.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},t.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),r=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=n,this.height=Math.max(r-n,0),this},t.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=n-this.y,this},t.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),r=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=n,this.height=r-n,this},t.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),h=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.radius=i,this.type=n.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,n=this.x-t,r=this.y-e;return(n*=n)+(r*=r)<=i},t.prototype.getBounds=function(){return new a(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},t}(),u=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t,this.y=e,this.width=i,this.height=r,this.type=n.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var i=(t-this.x)/this.width,n=(e-this.y)/this.height;return(i*=i)+(n*=n)<=1},t.prototype.getBounds=function(){return new a(this.x-this.width,this.y-this.height,this.width,this.height)},t.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),l=function(){function t(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];var r=Array.isArray(e[0])?e[0]:e;if("number"!=typeof r[0]){for(var s=[],o=0,a=r.length;o<a;o++)s.push(r[o].x,r[o].y);r=s}this.points=r,this.type=n.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var e=new t(this.points.slice());return e.closeStroke=this.closeStroke,e},t.prototype.contains=function(t,e){for(var i=!1,n=this.points.length/2,r=0,s=n-1;r<n;s=r++){var o=this.points[2*r],a=this.points[2*r+1],h=this.points[2*s],u=this.points[2*s+1];a>e!=u>e&&t<(e-a)/(u-a)*(h-o)+o&&(i=!i)}return i},t.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce((function(t,e){return t+", "+e}),"")+"]"},t}(),c=function(){function t(t,e,i,r,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=s,this.type=n.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;var n=t-(this.x+i),r=e-(this.y+i),s=i*i;if(n*n+r*r<=s)return!0;if((n=t-(this.x+this.width-i))*n+r*r<=s)return!0;if(n*n+(r=e-(this.y+this.height-i))*r<=s)return!0;if((n=t-(this.x+i))*n+r*r<=s)return!0}return!1},t.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},t}(),f=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},t}(),d=function(){function t(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this._x=i,this._y=n,this.cb=t,this.scope=e}return t.prototype.clone=function(e,i){return void 0===e&&(e=this.cb),void 0===i&&(i=this.scope),new t(e,i,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},t.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),p=function(){function t(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=s}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=s,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},t.prototype.apply=function(t,e){e=e||new f;var i=t.x,n=t.y;return e.x=this.a*i+this.c*n+this.tx,e.y=this.b*i+this.d*n+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new f;var i=1/(this.a*this.d+this.c*-this.b),n=t.x,r=t.y;return e.x=this.d*i*n+-this.c*i*r+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*r+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a,r=this.c,s=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=r*e-this.d*i,this.d=r*i+this.d*e,this.tx=s*e-this.ty*i,this.ty=s*i+this.ty*e,this},t.prototype.append=function(t){var e=this.a,i=this.b,n=this.c,r=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*r,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*r,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*r+this.ty,this},t.prototype.setTransform=function(t,e,i,n,r,s,o,a,h){return this.a=Math.cos(o+h)*r,this.b=Math.sin(o+h)*r,this.c=-Math.sin(o-a)*s,this.d=Math.cos(o-a)*s,this.tx=t-(i*this.a+n*this.c),this.ty=e-(i*this.b+n*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var i=this.a,n=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,i=this.b,n=this.c,s=this.d,o=t.pivot,a=-Math.atan2(-n,s),h=Math.atan2(i,e),u=Math.abs(a+h);return u<1e-5||Math.abs(r-u)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(n*n+s*s),t.position.x=this.tx+(o.x*e+o.y*n),t.position.y=this.ty+(o.x*i+o.y*s),t},t.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.tx,s=t*n-e*i;return this.a=n/s,this.b=-e/s,this.c=-i/s,this.d=t/s,this.tx=(i*this.ty-n*r)/s,this.ty=-(t*this.ty-e*r)/s,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),g=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],m=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],v=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],_=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],y=[],b=[],E=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];y.push(e);for(var i=0;i<16;i++)for(var n=E(g[t]*g[i]+v[t]*m[i]),r=E(m[t]*g[i]+_[t]*m[i]),s=E(g[t]*v[i]+v[t]*_[i]),o=E(m[t]*v[i]+_[t]*_[i]),a=0;a<16;a++)if(g[a]===n&&m[a]===r&&v[a]===s&&_[a]===o){e.push(a);break}}for(t=0;t<16;t++){var h=new p;h.set(g[t],m[t],v[t],_[t],0,0),b.push(h)}}();var x={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return g[t]},uY:function(t){return m[t]},vX:function(t){return v[t]},vY:function(t){return _[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return y[t][e]},sub:function(t,e){return y[t][x.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?x.S:x.N:2*Math.abs(e)<=Math.abs(t)?t>0?x.E:x.W:e>0?t>0?x.SE:x.SW:t>0?x.NE:x.NW},matrixAppendRotationInv:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var r=b[x.inv(e)];r.tx=i,r.ty=n,t.append(r)}},T=function(){function t(){this.worldTransform=new p,this.localTransform=new p,this.position=new d(this.onChange,this,0,0),this.scale=new d(this.onChange,this,1,1),this.pivot=new d(this.onChange,this,0,0),this.skew=new d(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,n=this.worldTransform;n.a=e.a*i.a+e.b*i.c,n.b=e.a*i.b+e.b*i.d,n.c=e.c*i.a+e.d*i.c,n.d=e.c*i.b+e.d*i.d,n.tx=e.tx*i.a+e.ty*i.c+i.tx,n.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}()},1034:(t,e,i)=>{"use strict";i.d(e,{R:()=>n});var n=function(){function t(t){this.items=[],this._name=t,this._aliasCount=0}return t.prototype.emit=function(t,e,i,n,r,s,o,a){if(arguments.length>8)throw new Error("max arguments reached");var h=this,u=h.name,l=h.items;this._aliasCount++;for(var c=0,f=l.length;c<f;c++)l[c][u](t,e,i,n,r,s,o,a);return l===this.items&&this._aliasCount--,this},t.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(n.prototype,{dispatch:{value:n.prototype.emit},run:{value:n.prototype.emit}})},9319:(t,e,i)=>{"use strict";i.d(e,{t:()=>F,X:()=>G});var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x=/iPhone/i,T=/iPod/i,w=/iPad/i,S=/\biOS-universal(?:.+)Mac\b/i,A=/\bAndroid(?:.+)Mobile\b/i,M=/Android/i,O=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,R=/Silk/i,C=/Windows Phone/i,I=/\bWindows(?:.+)ARM\b/i,P=/BlackBerry/i,N=/BB10/i,D=/Opera Mini/i,L=/\b(CriOS|Chrome)(?:.+)Mobile/i,k=/Mobile(?:.+)Firefox\b/i,B=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream},F=function(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var i=e.userAgent,n=i.split("[FBAN");void 0!==n[1]&&(i=n[0]),void 0!==(n=i.split("Twitter"))[1]&&(i=n[0]);var r=function(t){return function(e){return e.test(t)}}(i),s={apple:{phone:r(x)&&!r(C),ipod:r(T),tablet:!r(x)&&(r(w)||B(e))&&!r(C),universal:r(S),device:(r(x)||r(T)||r(w)||r(S)||B(e))&&!r(C)},amazon:{phone:r(O),tablet:!r(O)&&r(R),device:r(O)||r(R)},android:{phone:!r(C)&&r(O)||!r(C)&&r(A),tablet:!r(C)&&!r(O)&&!r(A)&&(r(R)||r(M)),device:!r(C)&&(r(O)||r(R)||r(A)||r(M))||r(/\bokhttp\b/i)},windows:{phone:r(C),tablet:r(I),device:r(C)||r(I)},other:{blackberry:r(P),blackberry10:r(N),opera:r(D),firefox:r(k),chrome:r(L),device:r(P)||r(N)||r(D)||r(k)||r(L)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}(self.navigator);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(n||(n={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(r||(r={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(s||(s={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(o||(o={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(a||(a={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(h||(h={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(u||(u={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(l||(l={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(c||(c={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(f||(f={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(d||(d={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(p||(p={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(g||(g={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(m||(m={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(v||(v={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(_||(_={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(y||(y={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(b||(b={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(E||(E={}));var G={MIPMAP_TEXTURES:p.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:b.NONE,SPRITE_MAX_TEXTURES:function(t){var e,i=!0;(F.tablet||F.phone)&&(F.apple.device&&(e=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(e[1],10)<11&&(i=!1),F.android.device&&(e=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(e[1],10)<7&&(i=!1));return i?32:4}(),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:v.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:d.CLAMP,SCALE_MODE:f.LINEAR,PRECISION_VERTEX:_.HIGH,PRECISION_FRAGMENT:F.apple.device?_.HIGH:_.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!F.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1}},2292:(t,e,i)=>{"use strict";i.r(e),i.d(e,{Filter:()=>D,Filterable:()=>A,Sound:()=>R,SoundLibrary:()=>P,SoundLoader:()=>_,SoundSprite:()=>x,filters:()=>L,htmlaudio:()=>N,sound:()=>G,utils:()=>F,webaudio:()=>k});var n,r=i(550),s=i(8942),o=i(6679),a=i(2038);function h(){return n}var u=function(t,e){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var c=function(){return(c=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},f=["mp3","ogg","oga","opus","mpeg","wav","m4a","aiff","wma","mid","caf"],d={};function p(t){var e=c({m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"'},t||{}),i=document.createElement("audio"),n={},r=/^no$/;f.forEach((function(t){var s=i.canPlayType("audio/".concat(t)).replace(r,""),o=e[t]?i.canPlayType(e[t]).replace(r,""):"";n[t]=!!s||!!o})),Object.assign(d,n)}p();var g=/\.(\{([^\}]+)\})(\?.*)?$/;function m(t){var e=g,i="string"==typeof t?t:t.url;if(!e.test(i))return i;for(var n=e.exec(i),r=n[2].split(","),s=r[r.length-1],o=0,a=r.length;o<a;o++){var h=r[o];if(d[h]){s=h;break}}var u=i.replace(n[1],s);if("string"!=typeof t){var l=t;l.extension=s,l.url=u}return u}var v,_=function(){function t(){}return t.add=function(){t.setLegacy(h().useLegacy)},t.setLegacy=function(t){var e=f;t?e.forEach((function(t){r.kC.setExtensionXhrType(t,r.kC.XHR_RESPONSE_TYPE.DEFAULT),r.kC.setExtensionLoadType(t,r.kC.LOAD_TYPE.AUDIO)})):e.forEach((function(t){r.kC.setExtensionXhrType(t,r.kC.XHR_RESPONSE_TYPE.BUFFER),r.kC.setExtensionLoadType(t,r.kC.LOAD_TYPE.XHR)}))},t.pre=function(t,e){m(t),e()},t.use=function(t,e){t.data&&f.indexOf(t.extension)>-1?t.sound=h().add(t.name,{loaded:e,preload:!0,url:t.url,source:t.data}):e()},t}(),y=0,b=function(t){function e(e){var i=t.call(this)||this;return i.id=y++,i.init(e),i}return l(e,t),e.prototype.set=function(t,e){if(void 0===this[t])throw new Error("Property with name ".concat(t," does not exist."));switch(t){case"speed":this.speed=e;break;case"volume":this.volume=e;break;case"paused":this.paused=e;break;case"loop":this.loop=e;break;case"muted":this.muted=e}return this},Object.defineProperty(e.prototype,"progress",{get:function(){return this._source.currentTime/this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!1,configurable:!0}),e.prototype._onPlay=function(){this._playing=!0},e.prototype._onPause=function(){this._playing=!1},e.prototype.init=function(t){this._playing=!1,this._duration=t.source.duration;var e=this._source=t.source.cloneNode(!1);e.src=t.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),t.context.on("refresh",this.refresh,this),t.context.on("refreshPaused",this.refreshPaused,this),this._media=t},e.prototype._internalStop=function(){this._source&&this._playing&&(this._source.onended=null,this._source.pause())},e.prototype.stop=function(){this._internalStop(),this._source&&this.emit("stop")},Object.defineProperty(e.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._muted},set:function(t){this._muted=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.refresh=function(){var t=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;var i=t.volume*(t.muted?0:1),n=e.volume*(e.muted?0:1),r=this._volume*(this._muted?0:1);this._source.volume=r*i*n,this._source.playbackRate=this._speed*t.speed*e.speed},e.prototype.refreshPaused=function(){var t=this._media.context,e=this._media.parent,i=this._paused||e.paused||t.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",i))},e.prototype.play=function(t){var i=this,n=t.start,r=t.end,s=t.speed,a=t.loop,h=t.volume,u=t.muted;this._speed=s,this._volume=h,this._loop=!!a,this._muted=u,this.refresh(),this.loop&&null!==r&&(this.loop=!1),this._start=n,this._end=r||this._duration,this._start=Math.max(0,this._start-e.PADDING),this._end=Math.min(this._end+e.PADDING,this._duration),this._source.onloadedmetadata=function(){i._source&&(i._source.currentTime=n,i._source.onloadedmetadata=null,i.emit("progress",n,i._duration),o.vB.shared.add(i._onUpdate,i))},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start")},e.prototype._onUpdate=function(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete()},e.prototype._onComplete=function(){o.vB.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this)},e.prototype.destroy=function(){o.vB.shared.remove(this._onUpdate,this),this.removeAllListeners();var t=this._source;t&&(t.onended=null,t.onplay=null,t.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=!1,this._end=null,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null)},e.prototype.toString=function(){return"[HTMLAudioInstance id=".concat(this.id,"]")},e.PADDING=.1,e}(s.EventEmitter),E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.init=function(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url)},e.prototype.create=function(){return new b(this)},Object.defineProperty(e.prototype,"isPlayable",{get:function(){return!!this._source&&4===this._source.readyState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._source.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this.parent.context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null)},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!1,configurable:!0}),e.prototype.load=function(t){var e=this._source,i=this.parent;if(4!==e.readyState)if(i.url){e.src=i.url;var n=function(){o(),i.isLoaded=!0;var e=i.autoPlayStart();t&&t(null,i,e)},r=function(){o(),t&&t(new Error("Sound loading has been aborted"))},s=function(){o();var i="Failed to load audio element (code: ".concat(e.error.code,")");t&&t(new Error(i))},o=function(){e.removeEventListener("canplaythrough",n),e.removeEventListener("load",n),e.removeEventListener("abort",r),e.removeEventListener("error",s)};e.addEventListener("canplaythrough",n,!1),e.addEventListener("load",n,!1),e.addEventListener("abort",r,!1),e.addEventListener("error",s,!1),e.load()}else t(new Error("sound.url or sound.source must be set"));else{i.isLoaded=!0;var a=i.autoPlayStart();t&&setTimeout((function(){t(null,i,a)}),0)}},e}(s.EventEmitter),x=function(){function t(t,e){this.parent=t,Object.assign(this,e),this.duration=this.end-this.start}return t.prototype.play=function(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})},t.prototype.destroy=function(){this.parent=null},t}(),T=function(){function t(){}return t.setParamValue=function(t,e){if(t.setValueAtTime){var i=h().context;t.setValueAtTime(e,i.audioContext.currentTime)}else t.value=e;return e},t}(),w=0,S=function(t){function e(e){var i=t.call(this)||this;return i.id=w++,i._media=null,i._paused=!1,i._muted=!1,i._elapsed=0,i.init(e),i}return l(e,t),e.prototype.set=function(t,e){if(void 0===this[t])throw new Error("Property with name ".concat(t," does not exist."));switch(t){case"speed":this.speed=e;break;case"volume":this.volume=e;break;case"muted":this.muted=e;break;case"loop":this.loop=e;break;case"paused":this.paused=e}return this},e.prototype.stop=function(){this._source&&(this._internalStop(),this.emit("stop"))},Object.defineProperty(e.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh(),this._update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._muted},set:function(t){this._muted=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return this._filters},set:function(t){var e;this._filters&&(null===(e=this._filters)||void 0===e||e.filter((function(t){return t})).forEach((function(t){return t.disconnect()})),this._filters=null,this._source.connect(this._gain)),this._filters=(null==t?void 0:t.length)?t.slice(0):null,this.refresh()},enumerable:!1,configurable:!0}),e.prototype.refresh=function(){if(this._source){var t=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;var i=t.volume*(t.muted?0:1),n=e.volume*(e.muted?0:1),r=this._volume*(this._muted?0:1);T.setParamValue(this._gain.gain,r*n*i),T.setParamValue(this._source.playbackRate,this._speed*e.speed*t.speed),this.applyFilters()}},e.prototype.applyFilters=function(){var t;if(null===(t=this._filters)||void 0===t?void 0:t.length){this._source.disconnect();var e=this._source;this._filters.forEach((function(t){e.connect(t.destination),e=t})),e.connect(this._gain)}},e.prototype.refreshPaused=function(){var t=this._media.context,e=this._media.parent,i=this._paused||e.paused||t.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i))},e.prototype.play=function(t){var e=t.start,i=t.end,n=t.speed,r=t.loop,s=t.volume,o=t.muted,a=t.filters;this._paused=!1;var h=this._media.nodes.cloneBufferSource(),u=h.source,l=h.gain;this._source=u,this._gain=l,this._speed=n,this._volume=s,this._loop=!!r,this._muted=o,this._filters=a,this.refresh();var c=this._source.buffer.duration;this._duration=c,this._end=i,this._lastUpdate=this._now(),this._elapsed=e,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=e,this._source.start(0,e)):i?this._source.start(0,e,i-e):this._source.start(0,e),this.emit("start"),this._update(!0),this.enableTicker(!0)},e.prototype.enableTicker=function(t){o.vB.shared.remove(this._updateListener,this),t&&o.vB.shared.add(this._updateListener,this)},Object.defineProperty(e.prototype,"progress",{get:function(){return this._progress},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){var t;this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),null===(t=this._filters)||void 0===t||t.forEach((function(t){return t.disconnect()})),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1},e.prototype.toString=function(){return"[WebAudioInstance id=".concat(this.id,"]")},e.prototype._now=function(){return this._media.context.audioContext.currentTime},e.prototype._updateListener=function(){this._update()},e.prototype._update=function(t){if(void 0===t&&(t=!1),this._source){var e=this._now(),i=e-this._lastUpdate;if(i>0||t){var n=this._source.playbackRate.value;this._elapsed+=i*n,this._lastUpdate=e;var r=this._duration,s=void 0;if(this._source.loopStart){var o=this._source.loopEnd-this._source.loopStart;s=(this._source.loopStart+this._elapsed%o)/r}else s=this._elapsed%r/r;this._progress=s,this.emit("progress",this._progress,r)}}},e.prototype.init=function(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this)},e.prototype._internalStop=function(){if(this._source){this.enableTicker(!1),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null}catch(t){}this._source=null}},e.prototype._onComplete=function(){if(this._source){this.enableTicker(!1),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null}catch(t){}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)},e}(s.EventEmitter),A=function(){function t(t,e){this._output=e,this._input=t}return Object.defineProperty(t.prototype,"destination",{get:function(){return this._input},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._filters},set:function(t){var e=this;if(this._filters&&(this._filters.forEach((function(t){t&&t.disconnect()})),this._filters=null,this._input.connect(this._output)),t&&t.length){this._filters=t.slice(0),this._input.disconnect();var i=null;t.forEach((function(t){null===i?e._input.connect(t.destination):i.connect(t.destination),i=t})),i.connect(this._output)}},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.filters=null,this._input=null,this._output=null},t}(),M=function(t){function e(e){var i=this,n=e.audioContext,r=n.createBufferSource(),s=n.createGain(),o=n.createAnalyser();return r.connect(o),o.connect(s),s.connect(e.destination),(i=t.call(this,o,s)||this).context=e,i.bufferSource=r,i.gain=s,i.analyser=o,i}return l(e,t),Object.defineProperty(e.prototype,"script",{get:function(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(e.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null},e.prototype.cloneBufferSource=function(){var t=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=t.buffer,T.setParamValue(e.playbackRate,t.playbackRate.value),e.loop=t.loop;var i=this.context.audioContext.createGain();return e.connect(i),i.connect(this.destination),{source:e,gain:i}},Object.defineProperty(e.prototype,"bufferSize",{get:function(){return this.script.bufferSize},enumerable:!1,configurable:!0}),e.BUFFER_SIZE=0,e}(A),O=function(){function t(){}return t.prototype.init=function(t){this.parent=t,this._nodes=new M(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source},t.prototype.destroy=function(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null}catch(t){}this._source=null,this.source=null},t.prototype.create=function(){return new S(this)},Object.defineProperty(t.prototype,"context",{get:function(){return this.parent.context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPlayable",{get:function(){return!!this._source&&!!this._source.buffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._nodes.filters},set:function(t){this._nodes.filters=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._source.buffer.duration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._source.buffer},set:function(t){this._source.buffer=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nodes",{get:function(){return this._nodes},enumerable:!1,configurable:!0}),t.prototype.load=function(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t&&t(new Error("sound.url or sound.source must be set"))},t.prototype._loadUrl=function(t){var e=this,i=new XMLHttpRequest,n=this.parent.url;i.open("GET",n,!0),i.responseType="arraybuffer",i.onload=function(){e.source=i.response,e._decode(i.response,t)},i.send()},t.prototype._decode=function(t,e){var i=this,n=function(t,n){if(t)e&&e(t);else{i.parent.isLoaded=!0,i.buffer=n;var r=i.parent.autoPlayStart();e&&e(null,i.parent,r)}};t instanceof AudioBuffer?n(null,t):this.parent.context.decode(t,n)},t}(),R=function(){function t(t,e){this.media=t,this.options=e,this._instances=[],this._sprites={},this.media.init(this);var i=e.complete;this._autoPlayOptions=i?{complete:i}:null,this.isLoaded=!1,this.isPlaying=!1,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded)}return t.from=function(e){var i={};return"string"==typeof e?i.url=e:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i.source=e:i=e,(i=c({autoPlay:!1,singleInstance:!1,url:null,source:null,preload:!1,volume:1,speed:1,complete:null,loaded:null,loop:!1},i)).url&&(i.url=m(i.url)),Object.freeze(i),new t(h().useLegacy?new E:new O,i)},Object.defineProperty(t.prototype,"context",{get:function(){return h().context},enumerable:!1,configurable:!0}),t.prototype.pause=function(){return this.isPlaying=!1,this.paused=!0,this},t.prototype.resume=function(){return this.isPlaying=this._instances.length>0,this.paused=!1,this},Object.defineProperty(t.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this.media.filters},set:function(t){this.media.filters=t},enumerable:!1,configurable:!0}),t.prototype.addSprites=function(t,e){if("object"==typeof t){var i={};for(var n in t)i[n]=this.addSprites(n,t[n]);return i}var r=new x(this,e);return this._sprites[t]=r,r},t.prototype.destroy=function(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null},t.prototype.removeSprites=function(t){if(t){var e=this._sprites[t];void 0!==e&&(e.destroy(),delete this._sprites[t])}else for(var i in this._sprites)this.removeSprites(i);return this},Object.defineProperty(t.prototype,"isPlayable",{get:function(){return this.isLoaded&&this.media&&this.media.isPlayable},enumerable:!1,configurable:!0}),t.prototype.stop=function(){if(!this.isPlayable)return this.autoPlay=!1,this._autoPlayOptions=null,this;this.isPlaying=!1;for(var t=this._instances.length-1;t>=0;t--)this._instances[t].stop();return this},t.prototype.play=function(t,e){var i,n=this;if("string"==typeof t?i={sprite:s=t,loop:this.loop,complete:e}:"function"==typeof t?(i={}).complete=t:i=t,(i=c({complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:!1,loop:!1},i||{})).sprite){var r=i.sprite,s=this._sprites[r];i.start=s.start+(i.start||0),i.end=s.end,i.speed=s.speed||1,i.loop=s.loop||i.loop,delete i.sprite}if(i.offset&&(i.start=i.offset),!this.isLoaded)return new Promise((function(t,e){n.autoPlay=!0,n._autoPlayOptions=i,n._preload((function(n,r,s){n?e(n):(i.loaded&&i.loaded(n,r,s),t(s))}))}));(this.singleInstance||i.singleInstance)&&this._removeInstances();var o=this._createInstance();return this._instances.push(o),this.isPlaying=!0,o.once("end",(function(){i.complete&&i.complete(n),n._onComplete(o)})),o.once("stop",(function(){n._onComplete(o)})),o.play(i),o},t.prototype.refresh=function(){for(var t=this._instances.length,e=0;e<t;e++)this._instances[e].refresh()},t.prototype.refreshPaused=function(){for(var t=this._instances.length,e=0;e<t;e++)this._instances[e].refreshPaused()},Object.defineProperty(t.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"muted",{get:function(){return this._muted},set:function(t){this._muted=t,this.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this.refresh()},enumerable:!1,configurable:!0}),t.prototype._preload=function(t){this.media.load(t)},Object.defineProperty(t.prototype,"instances",{get:function(){return this._instances},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sprites",{get:function(){return this._sprites},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this.media.duration},enumerable:!1,configurable:!0}),t.prototype.autoPlayStart=function(){var t;return this.autoPlay&&(t=this.play(this._autoPlayOptions)),t},t.prototype._removeInstances=function(){for(var t=this._instances.length-1;t>=0;t--)this._poolInstance(this._instances[t]);this._instances.length=0},t.prototype._onComplete=function(t){if(this._instances){var e=this._instances.indexOf(t);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0}this._poolInstance(t)},t.prototype._createInstance=function(){if(t._pool.length>0){var e=t._pool.pop();return e.init(this.media),e}return this.media.create()},t.prototype._poolInstance=function(e){e.destroy(),t._pool.indexOf(e)<0&&t._pool.push(e)},t._pool=[],t}(),C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.speed=1,e.muted=!1,e.volume=1,e.paused=!1,e}return l(e,t),e.prototype.refresh=function(){this.emit("refresh")},e.prototype.refreshPaused=function(){this.emit("refreshPaused")},Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioContext",{get:function(){return null},enumerable:!1,configurable:!0}),e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this.paused},e.prototype.destroy=function(){this.removeAllListeners()},e}(s.EventEmitter),I=function(t){function e(){var i=this,n=window,r=new e.AudioContext,o=r.createDynamicsCompressor(),a=r.createAnalyser();return a.connect(o),o.connect(r.destination),(i=t.call(this,a,o)||this)._ctx=r,i._offlineCtx=new e.OfflineAudioContext(1,2,n.OfflineAudioContext?r.sampleRate:44100),i._unlocked=!1,i.compressor=o,i.analyser=a,i.events=new s.EventEmitter,i.volume=1,i.speed=1,i.muted=!1,i.paused=!1,"running"!==r.state&&(i._unlock(),i._unlock=i._unlock.bind(i),document.addEventListener("mousedown",i._unlock,!0),document.addEventListener("touchstart",i._unlock,!0),document.addEventListener("touchend",i._unlock,!0)),i}return l(e,t),e.prototype._unlock=function(){this._unlocked||(this.playEmptySound(),"running"===this._ctx.state&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._unlocked=!0))},e.prototype.playEmptySound=function(){var t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),"suspended"===t.context.state&&t.context.resume()},Object.defineProperty(e,"AudioContext",{get:function(){var t=window;return t.AudioContext||t.webkitAudioContext||null},enumerable:!1,configurable:!0}),Object.defineProperty(e,"OfflineAudioContext",{get:function(){var t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this);var e=this._ctx;void 0!==e.close&&e.close(),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null},Object.defineProperty(e.prototype,"audioContext",{get:function(){return this._ctx},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offlineContext",{get:function(){return this._offlineCtx},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){t&&"running"===this._ctx.state?this._ctx.suspend():t||"suspended"!==this._ctx.state||this._ctx.resume(),this._paused=t},enumerable:!1,configurable:!0}),e.prototype.refresh=function(){this.events.emit("refresh")},e.prototype.refreshPaused=function(){this.events.emit("refreshPaused")},e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this._paused},e.prototype.decode=function(t,e){var i=function(t){e(new Error(t.message||"Unable to decode file"))},n=this._offlineCtx.decodeAudioData(t,(function(t){e(null,t)}),i);n&&n.catch(i)},e}(A),P=function(){function t(){this.init()}return t.prototype.init=function(){return this.supported&&(this._webAudioContext=new I),this._htmlAudioContext=new C,this._sounds={},this.useLegacy=!this.supported,this},Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filtersAll",{get:function(){return this.useLegacy?[]:this._context.filters},set:function(t){this.useLegacy||(this._context.filters=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"supported",{get:function(){return null!==I.AudioContext},enumerable:!1,configurable:!0}),t.prototype.add=function(t,e){if("object"==typeof t){var i={};for(var n in t){var r=this._getOptions(t[n],e);i[n]=this.add(n,r)}return i}if(e instanceof R)return this._sounds[t]=e,e;var s=this._getOptions(e),o=R.from(s);return this._sounds[t]=o,o},t.prototype._getOptions=function(t,e){var i;return i="string"==typeof t?{url:t}:t instanceof ArrayBuffer||t instanceof AudioBuffer||t instanceof HTMLAudioElement?{source:t}:t,c(c({},i),e||{})},Object.defineProperty(t.prototype,"useLegacy",{get:function(){return this._useLegacy},set:function(t){_.setLegacy(t),this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){return this.exists(t,!0),this._sounds[t].destroy(),delete this._sounds[t],this},Object.defineProperty(t.prototype,"volumeAll",{get:function(){return this._context.volume},set:function(t){this._context.volume=t,this._context.refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speedAll",{get:function(){return this._context.speed},set:function(t){this._context.speed=t,this._context.refresh()},enumerable:!1,configurable:!0}),t.prototype.togglePauseAll=function(){return this._context.togglePause()},t.prototype.pauseAll=function(){return this._context.paused=!0,this._context.refreshPaused(),this},t.prototype.resumeAll=function(){return this._context.paused=!1,this._context.refreshPaused(),this},t.prototype.toggleMuteAll=function(){return this._context.toggleMute()},t.prototype.muteAll=function(){return this._context.muted=!0,this._context.refresh(),this},t.prototype.unmuteAll=function(){return this._context.muted=!1,this._context.refresh(),this},t.prototype.removeAll=function(){for(var t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this},t.prototype.stopAll=function(){for(var t in this._sounds)this._sounds[t].stop();return this},t.prototype.exists=function(t,e){return void 0===e&&(e=!1),!!this._sounds[t]},t.prototype.find=function(t){return this.exists(t,!0),this._sounds[t]},t.prototype.play=function(t,e){return this.find(t).play(e)},t.prototype.stop=function(t){return this.find(t).stop()},t.prototype.pause=function(t){return this.find(t).pause()},t.prototype.resume=function(t){return this.find(t).resume()},t.prototype.volume=function(t,e){var i=this.find(t);return void 0!==e&&(i.volume=e),i.volume},t.prototype.speed=function(t,e){var i=this.find(t);return void 0!==e&&(i.speed=e),i.speed},t.prototype.duration=function(t){return this.find(t).duration},t.prototype.close=function(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this},t}(),N={__proto__:null,HTMLAudioMedia:E,HTMLAudioInstance:b,HTMLAudioContext:C},D=function(){function t(t,e){this.init(t,e)}return t.prototype.init=function(t,e){this.destination=t,this.source=e||t},t.prototype.connect=function(t){this.source.connect(t)},t.prototype.disconnect=function(){this.source.disconnect()},t.prototype.destroy=function(){this.disconnect(),this.destination=null,this.source=null},t}(),L={__proto__:null,Filter:D,EqualizerFilter:function(t){function e(i,n,r,s,o,a,u,l,c,f){void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===u&&(u=0),void 0===l&&(l=0),void 0===c&&(c=0),void 0===f&&(f=0);var d=this;if(!h().useLegacy){var p=[{f:e.F32,type:"lowshelf",gain:i},{f:e.F64,type:"peaking",gain:n},{f:e.F125,type:"peaking",gain:r},{f:e.F250,type:"peaking",gain:s},{f:e.F500,type:"peaking",gain:o},{f:e.F1K,type:"peaking",gain:a},{f:e.F2K,type:"peaking",gain:u},{f:e.F4K,type:"peaking",gain:l},{f:e.F8K,type:"peaking",gain:c},{f:e.F16K,type:"highshelf",gain:f}].map((function(t){var e=h().context.audioContext.createBiquadFilter();return e.type=t.type,T.setParamValue(e.Q,1),e.frequency.value=t.f,T.setParamValue(e.gain,t.gain),e}));(d=t.call(this,p[0],p[p.length-1])||this).bands=p,d.bandsMap={};for(var g=0;g<d.bands.length;g++){var m=d.bands[g];g>0&&d.bands[g-1].connect(m),d.bandsMap[m.frequency.value]=m}return d}d=t.call(this,null)||this}return l(e,t),e.prototype.setGain=function(t,e){if(void 0===e&&(e=0),!this.bandsMap[t])throw new Error("No band found for frequency ".concat(t));T.setParamValue(this.bandsMap[t].gain,e)},e.prototype.getGain=function(t){if(!this.bandsMap[t])throw new Error("No band found for frequency ".concat(t));return this.bandsMap[t].gain.value},Object.defineProperty(e.prototype,"f32",{get:function(){return this.getGain(e.F32)},set:function(t){this.setGain(e.F32,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f64",{get:function(){return this.getGain(e.F64)},set:function(t){this.setGain(e.F64,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f125",{get:function(){return this.getGain(e.F125)},set:function(t){this.setGain(e.F125,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f250",{get:function(){return this.getGain(e.F250)},set:function(t){this.setGain(e.F250,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f500",{get:function(){return this.getGain(e.F500)},set:function(t){this.setGain(e.F500,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f1k",{get:function(){return this.getGain(e.F1K)},set:function(t){this.setGain(e.F1K,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f2k",{get:function(){return this.getGain(e.F2K)},set:function(t){this.setGain(e.F2K,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f4k",{get:function(){return this.getGain(e.F4K)},set:function(t){this.setGain(e.F4K,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f8k",{get:function(){return this.getGain(e.F8K)},set:function(t){this.setGain(e.F8K,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f16k",{get:function(){return this.getGain(e.F16K)},set:function(t){this.setGain(e.F16K,t)},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this.bands.forEach((function(t){T.setParamValue(t.gain,0)}))},e.prototype.destroy=function(){this.bands.forEach((function(t){t.disconnect()})),this.bands=null,this.bandsMap=null},e.F32=32,e.F64=64,e.F125=125,e.F250=250,e.F500=500,e.F1K=1e3,e.F2K=2e3,e.F4K=4e3,e.F8K=8e3,e.F16K=16e3,e}(D),DistortionFilter:function(t){function e(e){void 0===e&&(e=0);var i=this;if(!h().useLegacy){var n=h().context.audioContext.createWaveShaper();return(i=t.call(this,n)||this)._distortion=n,i.amount=e,i}i=t.call(this,null)||this}return l(e,t),Object.defineProperty(e.prototype,"amount",{get:function(){return this._amount},set:function(t){this._amount=t;for(var e,i=1e3*t,n=44100,r=new Float32Array(n),s=Math.PI/180,o=0;o<n;++o)e=2*o/n-1,r[o]=(3+i)*e*20*s/(Math.PI+i*Math.abs(e));this._distortion.curve=r,this._distortion.oversample="4x"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){this._distortion=null,t.prototype.destroy.call(this)},e}(D),StereoFilter:function(t){function e(e){void 0===e&&(e=0);var i=this;if(!h().useLegacy){var n,r,s,o=h().context.audioContext;return o.createStereoPanner?s=n=o.createStereoPanner():((r=o.createPanner()).panningModel="equalpower",s=r),(i=t.call(this,s)||this)._stereo=n,i._panner=r,i.pan=e,i}i=t.call(this,null)||this}return l(e,t),Object.defineProperty(e.prototype,"pan",{get:function(){return this._pan},set:function(t){this._pan=t,this._stereo?T.setParamValue(this._stereo.pan,t):this._panner.setPosition(t,0,1-Math.abs(t))},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this._stereo=null,this._panner=null},e}(D),ReverbFilter:function(t){function e(e,i,n){void 0===e&&(e=3),void 0===i&&(i=2),void 0===n&&(n=!1);var r=this;if(!h().useLegacy)return(r=t.call(this,null)||this)._seconds=r._clamp(e,1,50),r._decay=r._clamp(i,0,100),r._reverse=n,r._rebuild(),r;r=t.call(this,null)||this}return l(e,t),e.prototype._clamp=function(t,e,i){return Math.min(i,Math.max(e,t))},Object.defineProperty(e.prototype,"seconds",{get:function(){return this._seconds},set:function(t){this._seconds=this._clamp(t,1,50),this._rebuild()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"decay",{get:function(){return this._decay},set:function(t){this._decay=this._clamp(t,0,100),this._rebuild()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reverse",{get:function(){return this._reverse},set:function(t){this._reverse=t,this._rebuild()},enumerable:!1,configurable:!0}),e.prototype._rebuild=function(){for(var t,e=h().context.audioContext,i=e.sampleRate,n=i*this._seconds,r=e.createBuffer(2,n,i),s=r.getChannelData(0),o=r.getChannelData(1),a=0;a<n;a++)t=this._reverse?n-a:a,s[a]=(2*Math.random()-1)*Math.pow(1-t/n,this._decay),o[a]=(2*Math.random()-1)*Math.pow(1-t/n,this._decay);var u=h().context.audioContext.createConvolver();u.buffer=r,this.init(u)},e}(D),MonoFilter:function(t){function e(){var e=this;if(!h().useLegacy){var i=h().context.audioContext,n=i.createChannelSplitter(),r=i.createChannelMerger();return r.connect(n),(e=t.call(this,r,n)||this)._merger=r,e}e=t.call(this,null)||this}return l(e,t),e.prototype.destroy=function(){this._merger.disconnect(),this._merger=null,t.prototype.destroy.call(this)},e}(D),StreamFilter:function(t){function e(){var e=this;if(!h().useLegacy){var i=h().context.audioContext,n=i.createMediaStreamDestination(),r=i.createMediaStreamSource(n.stream);return(e=t.call(this,n,r)||this)._stream=n.stream,e}e=t.call(this,null)||this}return l(e,t),Object.defineProperty(e.prototype,"stream",{get:function(){return this._stream},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){this._stream=null,t.prototype.destroy.call(this)},e}(D),TelephoneFilter:function(t){function e(){if(!h().useLegacy){var e=h().context.audioContext,i=e.createBiquadFilter(),n=e.createBiquadFilter(),r=e.createBiquadFilter(),s=e.createBiquadFilter();return i.type="lowpass",T.setParamValue(i.frequency,2e3),n.type="lowpass",T.setParamValue(n.frequency,2e3),r.type="highpass",T.setParamValue(r.frequency,500),s.type="highpass",T.setParamValue(s.frequency,500),i.connect(n),n.connect(r),r.connect(s),t.call(this,i,s)||this}t.call(this,null)}return l(e,t),e}(D)},k={__proto__:null,WebAudioMedia:O,WebAudioInstance:S,WebAudioNodes:M,WebAudioContext:I,WebAudioUtils:T},B=0,F={__proto__:null,playOnce:function(t,e){var i="alias".concat(B++);return h().add(i,{url:t,preload:!0,autoPlay:!0,loaded:function(t){t&&(h().remove(i),e&&e(t))},complete:function(){h().remove(i),e&&e(null)}}),i},get PLAY_ID(){return B},render:function(t,e){var i=document.createElement("canvas");e=c({width:512,height:128,fill:"black"},e||{}),i.width=e.width,i.height=e.height;var n=a.VL.from(i);if(!(t.media instanceof O))return n;var r=t.media,s=i.getContext("2d");s.fillStyle=e.fill;for(var o=r.buffer.getChannelData(0),h=Math.ceil(o.length/e.width),u=e.height/2,l=0;l<e.width;l++){for(var f=1,d=-1,p=0;p<h;p++){var g=o[l*h+p];g<f&&(f=g),g>d&&(d=g)}s.fillRect(l,(1+f)*u,1,Math.max(1,(d-f)*u))}return n},resolveUrl:m,sineTone:function(t,e){void 0===t&&(t=200),void 0===e&&(e=1);var i=R.from({singleInstance:!0});if(!(i.media instanceof O))return i;for(var n=i.media,r=i.context.audioContext.createBuffer(1,48e3*e,48e3),s=r.getChannelData(0),o=0;o<s.length;o++){var a=t*(o/r.sampleRate)*Math.PI;s[o]=2*Math.sin(a)}return n.buffer=r,i.isLoaded=!0,i},validateFormats:p,supported:d,extensions:f},G=(v=new P,n=v,v);r.aN.registerPlugin(_)},6679:(t,e,i)=>{"use strict";i.d(e,{vB:()=>o,Sb:()=>a,uF:()=>n});var n,r=i(9319);r.X.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(n||(n={}));var s=function(){function t(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=0),void 0===n&&(n=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=n}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),o=function(){function t(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new s(null,null,1/0),this.deltaMS=1/r.X.TARGET_FPMS,this.elapsedMS=1/r.X.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,i){return void 0===i&&(i=n.NORMAL),this._addListener(new s(t,e,i))},t.prototype.addOnce=function(t,e,i){return void 0===i&&(i=n.NORMAL),this._addListener(new s(t,e,i,!0))},t.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=t-i%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*r.X.TARGET_FPMS;for(var n=this._head,s=n.next;s;)s=s.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(t.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),i=Math.min(Math.max(0,e)/1e3,r.X.TARGET_FPMS);this._maxElapsedMS=1/i},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"shared",{get:function(){if(!t._shared){var e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared},enumerable:!1,configurable:!0}),Object.defineProperty(t,"system",{get:function(){if(!t._system){var e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system},enumerable:!1,configurable:!0}),t}(),a=function(){function t(){}return t.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,n.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?o.shared:new o,t.autoStart&&this.start()},t.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},t}()},8942:(t,e,i)=>{"use strict";i.r(e),i.d(e,{isMobile:()=>n.t,EventEmitter:()=>s.a,earcut:()=>a.a,BaseTextureCache:()=>j,CanvasRenderTarget:()=>z,DATA_URI:()=>Y,ProgramCache:()=>G,TextureCache:()=>U,clearTextureCache:()=>H,correctBlendMode:()=>x,createIndicesForQuads:()=>A,decomposeDataUri:()=>$,deprecation:()=>F,destroyTextureCache:()=>X,determineCrossOrigin:()=>q,getBufferType:()=>M,getResolutionOfUrl:()=>Z,hex2rgb:()=>v,hex2string:()=>_,interleaveTypedArrays:()=>R,isPow2:()=>I,isWebGLSupported:()=>g,log2:()=>P,nextPow2:()=>C,premultiplyBlendMode:()=>E,premultiplyRgba:()=>T,premultiplyTint:()=>w,premultiplyTintToRgba:()=>S,removeItems:()=>N,rgb2hex:()=>b,sayHello:()=>p,sign:()=>D,skipHello:()=>d,string2hex:()=>y,trimCanvas:()=>W,uid:()=>k,url:()=>l});var n=i(9319),r=i(6729),s=i.n(r),o=i(9187),a=i.n(o),h=i(8575),u=i(1680),l={parse:h.Qc,format:h.WU,resolve:h.DB};n.X.RETINA_PREFIX=/@([0-9\.]+)x/,n.X.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var c,f=!1;function d(){f=!0}function p(t){var e;if(!f){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var i=["\n %c %c %c PixiJS 6.2.2 - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=self.console).log.apply(e,i)}else self.console&&self.console.log("PixiJS 6.2.2 - "+t+" - http://www.pixijs.com/");f=!0}}function g(){return void 0===c&&(c=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:n.X.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!self.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var s=i.getExtension("WEBGL_lose_context");s&&s.loseContext()}return i=null,r}catch(t){return!1}}()),c}var m={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function v(t,e){return void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function _(t){var e=t.toString(16);return"#"+("000000".substr(0,6-e.length)+e)}function y(t){return"string"==typeof t&&"#"===(t=m[t.toLowerCase()]||t)[0]&&(t=t.substr(1)),parseInt(t,16)}function b(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var E=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[u.T$.NORMAL_NPM]=u.T$.NORMAL,t[u.T$.ADD_NPM]=u.T$.ADD,t[u.T$.SCREEN_NPM]=u.T$.SCREEN,e[u.T$.NORMAL]=u.T$.NORMAL_NPM,e[u.T$.ADD]=u.T$.ADD_NPM,e[u.T$.SCREEN]=u.T$.SCREEN_NPM;var n=[];return n.push(e),n.push(t),n}();function x(t,e){return E[e?1:0][t]}function T(t,e,i,n){return i=i||new Float32Array(4),n||void 0===n?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function w(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,n=t>>8&255,r=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((n=n*e+.5|0)<<8)+(r*e+.5|0)}function S(t,e,i,n){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(n||void 0===n)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function A(t,e){void 0===e&&(e=null);var i=6*t;if((e=e||new Uint16Array(i)).length!==i)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+i);for(var n=0,r=0;n<i;n+=6,r+=4)e[n+0]=r+0,e[n+1]=r+1,e[n+2]=r+2,e[n+3]=r+0,e[n+4]=r+2,e[n+5]=r+3;return e}function M(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}var O={Float32Array,Uint32Array,Int32Array,Uint8Array};function R(t,e){for(var i=0,n=0,r={},s=0;s<t.length;s++)n+=e[s],i+=t[s].length;var o=new ArrayBuffer(4*i),a=null,h=0;for(s=0;s<t.length;s++){var u=e[s],l=t[s],c=M(l);r[c]||(r[c]=new O[c](o)),a=r[c];for(var f=0;f<l.length;f++)a[(f/u|0)*n+h+f%u]=l[f];h+=u}return new Float32Array(o)}function C(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)}function I(t){return!(t&t-1||!t)}function P(t){var e=(t>65535?1:0)<<4,i=((t>>>=e)>255?1:0)<<3;return e|=i,e|=i=((t>>>=i)>15?1:0)<<2,(e|=i=((t>>>=i)>3?1:0)<<1)|(t>>>=i)>>1}function N(t,e,i){var n,r=t.length;if(!(e>=r||0===i)){var s=r-(i=e+i>r?r-e:i);for(n=e;n<s;++n)t[n]=t[n+i];t.length=s}}function D(t){return 0===t?0:t<0?-1:1}var L=0;function k(){return++L}var B={};function F(t,e,i){if(void 0===i&&(i=3),!B[e]){var n=(new Error).stack;void 0===n?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(n=n.split("\n").splice(i).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(n))),B[e]=!0}}var G={},U=Object.create(null),j=Object.create(null);function X(){var t;for(t in U)U[t].destroy();for(t in j)j[t].destroy()}function H(){var t;for(t in U)delete U[t];for(t in j)delete j[t]}var z=function(){function t(t,e,i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=i||n.X.RESOLUTION,this.resize(t,e)}return t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0}),t}();function W(t){var e,i,n,r=t.width,s=t.height,o=t.getContext("2d"),a=o.getImageData(0,0,r,s).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e<h;e+=4)0!==a[e+3]&&(i=e/4%r,n=~~(e/4/r),null===u.top&&(u.top=n),(null===u.left||i<u.left)&&(u.left=i),(null===u.right||u.right<i)&&(u.right=i+1),(null===u.bottom||u.bottom<n)&&(u.bottom=n));return null!==u.top&&(r=u.right-u.left,s=u.bottom-u.top+1,l=o.getImageData(u.left,u.top,r,s)),{height:s,width:r,data:l}}var V,Y=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function $(t){var e=Y.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}}function q(t,e){if(void 0===e&&(e=self.location),0===t.indexOf("data:"))return"";e=e||self.location,V||(V=document.createElement("a")),V.href=t;var i=l.parse(V.href),n=!i.port&&""===e.port||i.port===e.port;return i.hostname===e.hostname&&n&&i.protocol===e.protocol?"":"anonymous"}function Z(t,e){var i=n.X.RETINA_PREFIX.exec(t);return i?parseFloat(i[1]):void 0!==e?e:1}},3426:(t,e,i)=>{"use strict";i.r(e),i.d(e,{decode:()=>a,encode:()=>o});for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256),s=0;s<n.length;s++)r[n.charCodeAt(s)]=s;var o=function(t){var e,i=new Uint8Array(t),r=i.length,s="";for(e=0;e<r;e+=3)s+=n[i[e]>>2],s+=n[(3&i[e])<<4|i[e+1]>>4],s+=n[(15&i[e+1])<<2|i[e+2]>>6],s+=n[63&i[e+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s},a=function(t){var e,i,n,s,o,a=.75*t.length,h=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var l=new ArrayBuffer(a),c=new Uint8Array(l);for(e=0;e<h;e+=4)i=r[t.charCodeAt(e)],n=r[t.charCodeAt(e+1)],s=r[t.charCodeAt(e+2)],o=r[t.charCodeAt(e+3)],c[u++]=i<<2|n>>4,c[u++]=(15&n)<<4|s>>2,c[u++]=(3&s)<<6|63&o;return l}},3063:(t,e)=>{function i(t){if(t)return function(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}(t)}e.Emitter=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},i.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r=0;r<n.length;r++)if((i=n[r])===e||i.fn===e){n.splice(r,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},i.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),i=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(i){n=0;for(var r=(i=i.slice(0)).length;n<r;++n)i[n].apply(this,e)}return this},i.prototype.emitReserved=i.prototype.emit,i.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}},6194:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>y,Easing:()=>r,Group:()=>o,Interpolation:()=>a,Sequence:()=>h,Tween:()=>l,VERSION:()=>c,add:()=>m,getAll:()=>p,nextId:()=>f,now:()=>s,remove:()=>v,removeAll:()=>g,update:()=>_});var n,r={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.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},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 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-r.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?.5*r.Bounce.In(2*t):.5*r.Bounce.Out(2*t-1)+.5}}},s="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},o=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=s()),void 0===e&&(e=!1);var i=Object.keys(this._tweens);if(0===i.length)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var r=this._tweens[i[n]],o=!e;r&&!1===r.update(t,o)&&!e&&delete this._tweens[i[n]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),a={Linear:function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n),s=a.Utils.Linear;return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)},Bezier:function(t,e){for(var i=0,n=t.length-1,r=Math.pow,s=a.Utils.Bernstein,o=0;o<=n;o++)i+=r(1-e,n-o)*r(e,o)*t[o]*s(n,o);return i},CatmullRom:function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n),s=a.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i],n-r)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-n)-t[0]):e>1?t[i]-(s(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):s(t[r?r-1:0],t[r],t[i<r+1?i:r+1],t[i<r+2?i:r+2],n-r)},Utils:{Linear:function(t,e,i){return(e-t)*i+t},Bernstein:function(t,e){var i=a.Utils.Factorial;return i(t)/i(e)/i(t-e)},Factorial:(n=[1],function(t){var e=1;if(n[t])return n[t];for(var i=t;i>1;i--)e*=i;return n[t]=e,e}),CatmullRom:function(t,e,i,n,r){var s=.5*(i-t),o=.5*(n-e),a=r*r;return(2*e-2*i+s+o)*(r*a)+(-3*e+3*i-2*s-o)*a+s*r+e}}},h=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),u=new o,l=function(){function t(t,e){void 0===e&&(e=u),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=r.Linear.None,this._interpolationFunction=a.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=h.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){return this._valuesEnd=Object.create(t),void 0!==e&&(this._duration=e),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?s()+parseFloat(t):t:s(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,i,n){for(var r in i){var s=t[r],o=Array.isArray(s),a=o?"array":typeof s,h=!o&&Array.isArray(i[r]);if("undefined"!==a&&"function"!==a){if(h){var u=i[r];if(0===u.length)continue;u=u.map(this._handleRelativeValue.bind(this,s)),i[r]=[s].concat(u)}if("object"!==a&&!o||!s||h)void 0===e[r]&&(e[r]=s),o||(e[r]*=1),n[r]=h?i[r].slice().reverse():e[r]||0;else{for(var l in e[r]=o?[]:{},s)e[r][l]=s[l];n[r]=o?[]:{},this._setupProperties(s,e[r],i[r],n[r])}}}},t.prototype.stop=function(){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},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=s()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=s()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return this._group=t,this},t.prototype.delay=function(t){return this._delayTime=t,this},t.prototype.repeat=function(t){return this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return this._yoyo=t,this},t.prototype.easing=function(t){return this._easingFunction=t,this},t.prototype.interpolation=function(t){return this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){if(void 0===t&&(t=s()),void 0===e&&(e=!0),this._isPaused)return!0;var i,n,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(t-this._startTime)/this._duration,n=0===this._duration||n>1?1:n;var o=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){for(i in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(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),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,h=this._chainedTweens.length;a<h;a++)this._chainedTweens[a].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,i,n){for(var r in i)if(void 0!==e[r]){var s=e[r]||0,o=i[r],a=Array.isArray(t[r]),h=Array.isArray(o);!a&&h?t[r]=this._interpolationFunction(o,n):"object"==typeof o&&o?this._updateProperties(t[r],s,o,n):"number"==typeof(o=this._handleRelativeValue(s,o))&&(t[r]=s+(o-s)*n)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof i?this._valuesStartRepeat[t]+parseFloat(i):this._valuesEnd[t],this._valuesEnd[t]=e},t}(),c="18.6.4",f=h.nextId,d=u,p=d.getAll.bind(d),g=d.removeAll.bind(d),m=d.add.bind(d),v=d.remove.bind(d),_=d.update.bind(d);const y={Easing:r,Group:o,Interpolation:a,now:s,Sequence:h,nextId:f,Tween:l,VERSION:c,getAll:p,removeAll:g,add:m,remove:v,update:_}},3010:t=>{function e(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=e,e.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),i=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-i:t+i}return 0|Math.min(t,this.max)},e.prototype.reset=function(){this.attempts=0},e.prototype.setMin=function(t){this.ms=t},e.prototype.setMax=function(t){this.max=t},e.prototype.setJitter=function(t){this.jitter=t}},1227:(t,e,i)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;e.splice(1,0,i,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(n++,"%c"===t&&(r=n))})),e.splice(r,0,i)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=i(2447)(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},2447:(t,e,i)=>{t.exports=function(t){function e(t){let i,r,s,o=null;function a(...t){if(!a.enabled)return;const n=a,r=Number(new Date),s=r-(i||r);n.diff=s,n.prev=i,n.curr=r,i=r,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let o=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((i,r)=>{if("%%"===i)return"%";o++;const s=e.formatters[r];if("function"==typeof s){const e=t[o];i=s.call(n,e),t.splice(o,1),o--}return i})),e.formatArgs.call(n,t),(n.log||e.log).apply(n,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(r!==e.namespaces&&(r=e.namespaces,s=e.enabled(t)),s),set:t=>{o=t}}),"function"==typeof e.init&&e.init(a),a}function n(t,i){const n=e(this.namespace+(void 0===i?":":i)+t);return n.log=this.log,n}function r(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(r),...e.skips.map(r).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let i;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),r=n.length;for(i=0;i<r;i++)n[i]&&("-"===(t=n[i].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let i,n;for(i=0,n=e.skips.length;i<n;i++)if(e.skips[i].test(t))return!1;for(i=0,n=e.names.length;i<n;i++)if(e.names[i].test(t))return!0;return!1},e.humanize=i(7824),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((i=>{e[i]=t[i]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let i=0;for(let e=0;e<t.length;e++)i=(i<<5)-i+t.charCodeAt(e),i|=0;return e.colors[Math.abs(i)%e.colors.length]},e.enable(e.load()),e}},9187:t=>{"use strict";function e(t,e,s){s=s||2;var o,a,h,c,f,p,g,m=e&&e.length,v=m?e[0]*s:t.length,_=i(t,0,v,s,!0),y=[];if(!_||_.next===_.prev)return y;if(m&&(_=function(t,e,r,s){var o,a,h,c=[];for(o=0,a=e.length;o<a;o++)(h=i(t,e[o]*s,o<a-1?e[o+1]*s:t.length,s,!1))===h.next&&(h.steiner=!0),c.push(d(h));for(c.sort(u),o=0;o<c.length;o++)r=n(r=l(c[o],r),r.next);return r}(t,e,_,s)),t.length>80*s){o=h=t[0],a=c=t[1];for(var b=s;b<v;b+=s)(f=t[b])<o&&(o=f),(p=t[b+1])<a&&(a=p),f>h&&(h=f),p>c&&(c=p);g=0!==(g=Math.max(h-o,c-a))?1/g:0}return r(_,y,s,o,a,g),y}function i(t,e,i,n,r){var s,o;if(r===A(t,e,i,n)>0)for(s=e;s<i;s+=n)o=T(s,t[s],t[s+1],o);else for(s=i-n;s>=e;s-=n)o=T(s,t[s],t[s+1],o);return o&&v(o,o.next)&&(w(o),o=o.next),o}function n(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!v(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(w(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function r(t,e,i,u,l,c,d){if(t){!d&&c&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=f(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,s,o,a,h,u=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e<u&&(a++,n=n.nextZ);e++);for(h=u;a>0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,h--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,u*=2}while(o>1)}(r)}(t,u,l,c);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?o(t,u,l,c):s(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),w(t),t=g.next,m=g.next;else if((t=g)===m){d?1===d?r(t=a(n(t),e,i),e,i,u,l,c,2):2===d&&h(t,e,i,u,l,c):r(n(t),e,i,u,l,c,1);break}}}function s(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(p(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function o(t,e,i,n){var r=t.prev,s=t,o=t.next;if(m(r,s,o)>=0)return!1;for(var a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,h=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,u=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,l=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,c=f(a,h,e,i,n),d=f(u,l,e,i,n),g=t.prevZ,v=t.nextZ;g&&g.z>=c&&v&&v.z<=d;){if(g!==t.prev&&g!==t.next&&p(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;if(g=g.prevZ,v!==t.prev&&v!==t.next&&p(r.x,r.y,s.x,s.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;g&&g.z>=c;){if(g!==t.prev&&g!==t.next&&p(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&p(r.x,r.y,s.x,s.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function a(t,e,i){var r=t;do{var s=r.prev,o=r.next.next;!v(s,o)&&_(s,r,r.next,o)&&E(s,o)&&E(o,s)&&(e.push(s.i/i),e.push(r.i/i),e.push(o.i/i),w(r),w(r.next),r=t=o),r=r.next}while(r!==t);return n(r)}function h(t,e,i,s,o,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&g(h,u)){var l=x(h,u);return h=n(h,h.next),l=n(l,l.next),r(h,e,i,s,o,a),void r(l,e,i,s,o,a)}u=u.next}h=h.next}while(h!==t)}function u(t,e){return t.x-e.x}function l(t,e){var i=function(t,e){var i,n=e,r=t.x,s=t.y,o=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){var a=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>o){if(o=a,a===r){if(s===n.y)return n;if(s===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===o)return i;var h,u=i,l=i.x,f=i.y,d=1/0;n=i;do{r>=n.x&&n.x>=l&&r!==n.x&&p(s<f?r:o,s,l,f,s<f?o:r,s,n.x,n.y)&&(h=Math.abs(s-n.y)/(r-n.x),E(n,t)&&(h<d||h===d&&(n.x>i.x||n.x===i.x&&c(i,n)))&&(i=n,d=h)),n=n.next}while(n!==u);return i}(t,e);if(!i)return e;var r=x(i,t),s=n(i,i.next);return n(r,r.next),e===i?s:e}function c(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function f(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function d(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function p(t,e,i,n,r,s,o,a){return(r-o)*(e-a)-(t-o)*(s-a)>=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&_(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(E(t,e)&&E(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||v(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,i,n){var r=b(m(t,e,i)),s=b(m(t,e,n)),o=b(m(i,n,t)),a=b(m(i,n,e));return r!==s&&o!==a||!(0!==r||!y(t,i,e))||!(0!==s||!y(t,n,e))||!(0!==o||!y(i,t,n))||!(0!==a||!y(i,e,n))}function y(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function b(t){return t>0?1:t<0?-1:0}function E(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function x(t,e){var i=new S(t.i,t.x,t.y),n=new S(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function T(t,e,i,n){var r=new S(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function w(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function S(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,n){for(var r=0,s=e,o=i-n;s<i;s+=n)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}t.exports=e,t.exports.default=e,e.deviation=function(t,e,i,n){var r=e&&e.length,s=r?e[0]*i:t.length,o=Math.abs(A(t,0,s,i));if(r)for(var a=0,h=e.length;a<h;a++){var u=e[a]*i,l=a<h-1?e[a+1]*i:t.length;o-=Math.abs(A(t,u,l,i))}var c=0;for(a=0;a<n.length;a+=3){var f=n[a]*i,d=n[a+1]*i,p=n[a+2]*i;c+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},e.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var s=0;s<t[r].length;s++)for(var o=0;o<e;o++)i.vertices.push(t[r][s][o]);r>0&&(n+=t[r-1].length,i.holes.push(n))}return i}},6729:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,r,s,o){var a=i?i+t:t;if(!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,s),!0;case 6:return l.fn.call(l.context,e,n,r,s,o),!0}for(u=1,h=new Array(c-1);u<c;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var f,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,n);break;case 4:l[u].fn.call(l[u].context,e,n,r);break;default:if(!h)for(f=1,h=new Array(c-1);f<c;f++)h[f-1]=arguments[f];l[u].fn.apply(l[u].context,h)}}return!0},a.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var h=0,u=[],l=a.length;h<l;h++)(a[h].fn!==e||r&&!a[h].once||n&&a[h].context!==n)&&u.push(a[h]);u.length?this._events[s]=1===u.length?u[0]:u:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a},7042:function(t){t.exports=(()=>{var t={944:function(t){t.exports=(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=s(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,h=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){h=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(h)throw o}}}}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=i){var n,r,s=[],o=!0,a=!1;try{for(i=i.call(t);!(o=(n=i.next()).done)&&(s.push(n.value),!e||s.length!==e);o=!0);}catch(t){a=!0,r=t}finally{try{o||null==i.return||i.return()}finally{if(a)throw r}}return s}}(t,e)||s(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){if(t){if("string"==typeof t)return o(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.d(e,{default:()=>h});var h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];a(this,t),this.allowExtra=e,this.defaults=new Map,this.types=new Map,this.optional=new Set,this.required=new Set}var e;return(e=[{key:"setDefaults",value:function(t){var e=this;return Object.entries(t).forEach((function(t){var i=r(t,2),n=i[0],s=i[1];return e.defaults.set(n,s)})),this}},{key:"setTypes",value:function(t){var e=this;return Object.entries(t).forEach((function(t){var i=r(t,2),n=i[0],s=i[1];return e.types.set(n,s)})),this}},{key:"setOptional",value:function(t){var e=this;return t.forEach((function(t){return e.optional.add(t)})),this}},{key:"setRequired",value:function(t){var e=this;return t.forEach((function(t){return e.required.add(t)})),this}},{key:"resolve",value:function(t){var e=Object.assign(this.getDefaults(),t);return this.validate(e),e}},{key:"getDefaults",value:function(){var t,e={},i=n(this.defaults);try{for(i.s();!(t=i.n()).done;){var s=r(t.value,2),o=s[0],a=s[1];e[o]=a}}catch(t){i.e(t)}finally{i.f()}return e}},{key:"validate",value:function(t){for(var e in t){if(!this.optionExists(e))throw new Error('Unkown option "'.concat(e,'".'));this.checkType(e,t[e])}var i,r=n(this.required.values());try{for(r.s();!(i=r.n()).done;){var s=i.value;if(void 0===t[s])throw new Error('Option "'.concat(s,'" is required.'))}}catch(t){r.e(t)}finally{r.f()}}},{key:"checkType",value:function(t,e){if(this.types.has(t)){var n=this.types.get(t),r=i(e);if(r!==n)throw new Error('Wrong value for option "'.concat(t,'". Expected type "').concat(n,'" but got "').concat(r,'".'))}}},{key:"optionExists",value:function(t){return!!this.allowExtra||this.defaults.has(t)||this.optional.has(t)||this.required.has(t)||this.types.has(t)}}])&&function(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,e),t}();return e.default})()},162:function(t){t.exports=(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>i});var i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._events={},this.on=this.addEventListener,this.off=this.removeEventListener}var e;return(e=[{key:"emit",value:function(t,e){if(Object.prototype.hasOwnProperty.call(this._events,t))for(var i=this._events[t],n={type:t,detail:e},r=i.length,s=0;s<r;s++)this.handle(i[s],n)}},{key:"handle",value:function(t,e){t(e)}},{key:"addEventListener",value:function(t,e){Object.prototype.hasOwnProperty.call(this._events,t)||(this._events[t]=[]),this._events[t].indexOf(e)<0&&this._events[t].push(e)}},{key:"removeEventListener",value:function(t,e){if(Object.prototype.hasOwnProperty.call(this._events,t)){var i=this._events[t],n=i.indexOf(e);n>=0&&i.splice(n,1),0===i.length&&delete this._events[t]}}}])&&function(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,e),t}();return e.default})()}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";i.r(n),i.d(n,{GamepadHandler:()=>d,GamepadListener:()=>E});var t=i(162),e=i.n(t),r=i(944),s=i.n(r);function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?c(t):e}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(d,t);var e,i,n,r,s,o=(r=d,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=f(r);if(s){var i=f(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return l(this,t)});function d(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return a(this,d),(i=o.call(this)).index=t,i.options=i.constructor.resolveOptions(n),i.sticks=new Array(e.axes.length/2).fill(null).map((function(){return[null,null]})),i.buttons=new Array(e.buttons.length).fill(null),i.updateStick=i.updateStick.bind(c(i)),i.updateButton=i.updateButton.bind(c(i)),i}return e=d,n=[{key:"resolveOptions",value:function(t){var e=void 0!==t.stick,i=void 0!==t.button,n={stick:this.optionResolver.resolve(e?t.stick:i?{}:t),button:this.optionResolver.resolve(i?t.button:e?{}:t)};return n.stick.deadZone=Math.max(Math.min(n.stick.deadZone,1),0),n.button.deadZone=Math.max(Math.min(n.button.deadZone,1),0),n.stick.precision=n.stick.precision?Math.pow(10,n.stick.precision):0,n.button.precision=n.button.precision?Math.pow(10,n.button.precision):0,n}}],(i=[{key:"update",value:function(t){for(var e=0,i=this.sticks.length,n=0;n<i;n++)for(var r=0;r<2;r++)this.updateStick(t,n,r,t.axes[e++]);var s=this.buttons.length;for(e=0;e<s;e++)this.updateButton(t,t.buttons[e],e)}},{key:"updateStick",value:function(t,e,i,n){var r=this.options.stick,s=r.deadZone,o=r.analog,a=r.precision;s&&n<s&&n>-s&&(n=0),o?a&&(n=Math.round(n*a)/a):n=n>0?1:n<0?-1:0,this.sticks[e][i]!==n&&(this.sticks[e][i]=n,this.emit("axis",{gamepad:t,stick:e,axis:i,value:n,index:this.index}))}},{key:"updateButton",value:function(t,e,i){var n=this.options.button,r=n.deadZone,s=n.analog,o=n.precision,a=e.value,h=e.pressed,u=a;r&&e.value<r&&e.value>-r&&(u=0),s?o&&(u=Math.round(u*o)/o):u=h?1:0,this.buttons[i]!==u&&(this.buttons[i]=u,this.emit("button",{gamepad:t,button:i,pressed:h,value:u,index:this.index}))}}])&&h(e.prototype,i),n&&h(e,n),d}(e());d.optionResolver=(new(s())).setDefaults({analog:!0,deadZone:0,precision:0}).setTypes({analog:"boolean",deadZone:"number",precision:"number"});var p=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.callback=e,this.frame=null,this.update=this.update.bind(this)}var e;return(e=[{key:"setCallback",value:function(t){this.callback=t}},{key:"start",value:function(){this.frame||(this.frame=window.requestAnimationFrame(this.update))}},{key:"stop",value:function(){this.frame&&(window.cancelAnimationFrame(this.frame),this.frame=null)}},{key:"update",value:function(){this.frame=window.requestAnimationFrame(this.update),this.callback()}}])&&function(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,e),t}();function g(t){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _(t,e){return!e||"object"!==g(e)&&"function"!=typeof e?y(t):e}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var E=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e)}(s,t);var e,i,n,r=(i=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=b(i);if(n){var r=b(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return _(this,t)});function s(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(m(this,s),t=r.call(this),"function"!=typeof navigator.getGamepads)throw new Error("This browser does not support gamepad API.");return t.options=e,t.onAxis=t.onAxis.bind(y(t)),t.update=t.update.bind(y(t)),t.start=t.start.bind(y(t)),t.stop=t.stop.bind(y(t)),t.discover=t.discover.bind(y(t)),t.onButton=t.onButton.bind(y(t)),t.handlers=new Array(4).fill(null),t.loop=new p(t.update),window.addEventListener("error",t.stop),t}return(e=[{key:"start",value:function(){this.loop.start()}},{key:"stop",value:function(){this.loop.stop()}},{key:"update",value:function(){var t=navigator.getGamepads();this.discover(t[0],0),this.discover(t[1],1),this.discover(t[2],2),this.discover(t[3],3)}},{key:"discover",value:function(t,e){t?(this.handlers[e]||this.registerHandler(e,t),this.handlers[e].update(t)):this.handlers[e]&&this.removeGamepad(e)}},{key:"registerHandler",value:function(t,e){if(this.handlers[t])throw new Error("Gamepad #".concat(t," is already registered."));var i=new d(t,e,this.options);this.handlers[t]=i,i.addEventListener("axis",this.onAxis),i.addEventListener("button",this.onButton),this.emit("gamepad:connected",{index:t,gamepad:e}),this.emit("gamepad:".concat(t,":connected"),{index:t,gamepad:e})}},{key:"removeGamepad",value:function(t){if(!this.handlers[t])throw new Error("Gamepad #".concat(t," is not registered."));this.handlers[t].removeEventListener("axis",this.onAxis),this.handlers[t].removeEventListener("button",this.onButton),this.handlers[t]=null,this.emit("gamepad:disconnected",{index:t}),this.emit("gamepad:".concat(t,":disconnected"),{index:t})}},{key:"onAxis",value:function(t){var e=t.detail.index;this.emit("gamepad:axis",t.detail),this.emit("gamepad:".concat(e,":axis"),t.detail),this.emit("gamepad:".concat(e,":axis:").concat(t.detail.axis),t.detail)}},{key:"onButton",value:function(t){var e=t.detail.index;this.emit("gamepad:button",t.detail),this.emit("gamepad:".concat(e,":button"),t.detail),this.emit("gamepad:".concat(e,":button:").concat(t.detail.button),t.detail)}}])&&function(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(s.prototype,e),s}(e())})(),n})()},8058:t=>{try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){t.exports=!1}},5586:(t,e,i)=>{"use strict";function n(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.map((function(e){return e.split(" ").map((function(e){return e?""+t+e:""})).join(" ")})).join(" ")}function r(t,e){return function(i){i&&(t[e]=i)}}function s(t,e,i){return function(n){n&&(t[e][i]=n)}}function o(t,e){return function(i){var n=i.prototype;t.forEach((function(t){e(n,t)}))}}i.r(e),i.d(e,{EVENTS:()=>$s,METHODS:()=>Ys,PROPERTIES:()=>Vs,PROPS_MAP:()=>qs,default:()=>io,getElementInfo:()=>to,makeAble:()=>eo});var a=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var i=this.keys,n=this.values,r=i.indexOf(t),s=-1===r?i.length:r;i[s]=t,n[s]=e},t}(),h=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),u="function"==typeof Map,l=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}(),c=function(){function t(t,e,i,n,r,s,o,a){this.prevList=t,this.list=e,this.added=i,this.removed=n,this.changed=r,this.maintained=s,this.changedBeforeAdded=o,this.fixed=a}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t=function(t,e){var i=[],n=[];return t.forEach((function(t){var e=t[0],r=t[1],s=new l;i[e]=s,n[r]=s})),i.forEach((function(t,e){t.connect(i[e-1])})),t.filter((function(t,i){return!e[i]})).map((function(t,e){var r=t[0],s=t[1];if(r===s)return[0,0];var o=i[r],a=n[s-1],h=o.getIndex();return o.disconnect(),a?o.connect(a,a.next):o.connect(void 0,i[0]),[h,o.getIndex()]}))}(this.changedBeforeAdded,this.fixed),e=this.changed,i=[];this.cacheOrdered=t.filter((function(t,n){var r=t[0],s=t[1],o=e[n],a=o[0],h=o[1];if(r!==s)return i.push([a,h]),!0})),this.cachePureChanged=i},t}();function f(t,e,i){var n=u?Map:i?h:a,r=i||function(t){return t},s=[],o=[],l=[],f=t.map(r),d=e.map(r),p=new n,g=new n,m=[],v=[],_={},y=[],b=0,E=0;return f.forEach((function(t,e){p.set(t,e)})),d.forEach((function(t,e){g.set(t,e)})),f.forEach((function(t,e){var i=g.get(t);void 0===i?(++E,o.push(e)):_[i]=E})),d.forEach((function(t,e){var i=p.get(t);void 0===i?(s.push(e),++b):(l.push([i,e]),E=_[e]||0,m.push([i-E,e-b]),v.push(e===i),i!==e&&y.push([i,e]))})),o.reverse(),new c(t,e,s,o,y,l,m,v)}var d=function(){function t(t,e){void 0===t&&(t=[]),this.findKeyCallback=e,this.list=[].slice.call(t)}return t.prototype.update=function(t){var e=[].slice.call(t),i=f(this.list,e,this.findKeyCallback);return this.list=e,i},t}();const p=d;var g="undefined",m=(typeof document!==g&&document,[{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:'\\"',close:'\\"'},{open:"\\'",close:"\\'"}]),v=1e-7,_={cm:function(t){return 96*t/2.54},mm:function(t){return 96*t/254},in:function(t){return 96*t},pt:function(t){return 96*t/72},pc:function(t){return 96*t/6},"%":function(t,e){return t*e/100},vw:function(t,e){return void 0===e&&(e=window.innerWidth),t/100*e},vh:function(t,e){return void 0===e&&(e=window.innerHeight),t/100*e},vmax:function(t,e){return void 0===e&&(e=Math.max(window.innerWidth,window.innerHeight)),t/100*e},vmin:function(t,e){return void 0===e&&(e=Math.min(window.innerWidth,window.innerHeight)),t/100*e}};function y(t){return typeof t===g}function b(t){return t&&"object"==typeof t}function E(t){return Array.isArray(t)}function x(t){return"string"==typeof t}function T(t){return"function"==typeof t}function w(t,e,i,n,r){return S(t,e,i)?i:function(t,e,i,n,r){for(var s,o=function(i){var o=e[i].trim();if(o===t.close&&!S(t,e,i))return{value:i};var a=i,h=D(r,(function(t){return t.open===o}));if(h&&(a=w(h,e,i,n,r)),-1===a)return s=i,"break";s=i=a},a=i;a<n;++a){var h=o(a);if(a=s,"object"==typeof h)return h.value;if("break"===h)break}return-1}(t,e,i+1,n,r)}function S(t,e,i){if(!t.ignore)return null;var n=e.slice(Math.max(i-3,0),i+3).join("");return new RegExp(t.ignore).exec(n)}function A(t,e){var i=x(e)?{separator:e}:e,n=i.separator,r=void 0===n?",":n,s=i.isSeparateFirst,o=i.isSeparateOnlyOpenClose,a=i.isSeparateOpenClose,h=void 0===a?o:a,u=i.openCloseCharacters,l=void 0===u?m:u,c=l.map((function(t){var e=t.open,i=t.close;return e===i?e:e+"|"+i})).join("|"),f=new RegExp("(\\s*"+r+"\\s*|"+c+"|\\s+)","g"),d=t.split(f).filter(Boolean),p=d.length,g=[],v=[];function _(){return!!v.length&&(g.push(v.join("")),v=[],!0)}for(var y,b=function(t){var e=d[t].trim(),i=t,n=D(l,(function(t){return t.open===e})),a=D(l,(function(t){return t.close===e}));if(n){if(-1!==(i=w(n,d,t,p,l))&&h)return _()&&s?(y=t,"break"):(g.push(d.slice(t,i+1).join("")),t=i,s?(y=t,"break"):(y=t,"continue"))}else{if(a&&!S(a,d,t))throw new Error("invalid format: "+a.close);if(function(t,e){return(""===e||" "==e)&&(""===t||" "==t)||t===e}(e,r)&&!o)return _(),s?(y=t,"break"):(y=t,"continue")}-1===i&&(i=p-1),v.push(d.slice(t,i+1).join("")),y=t=i},E=0;E<p;++E){var T=b(E);if(E=y,"break"===T)break}return v.length&&g.push(v.join("")),g}function M(t){return A(t,"")}function O(t){return A(t,",")}function R(t){var e=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(t);return!e||e.length<4?{}:{prefix:e[1],value:e[2],suffix:e[3]}}function C(t){var e=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(t);if(!e)return{prefix:"",unit:"",value:NaN};var i=e[1],n=e[2];return{prefix:i,unit:e[3],value:parseFloat(n)}}function I(t,e){return void 0===e&&(e="-"),t.replace(/([a-z])([A-Z])/g,(function(t,i,n){return""+i+e+n.toLowerCase()}))}function P(){return Date.now?Date.now():(new Date).getTime()}function N(t,e,i){void 0===i&&(i=-1);for(var n=t.length,r=0;r<n;++r)if(e(t[r],r,t))return r;return i}function D(t,e,i){var n=N(t,e);return n>-1?t[n]:i}function L(t){if(Object.keys)return Object.keys(t);var e=[];for(var i in e)e.push(i);return e}function k(t,e){var i=C(t),n=i.value,r=i.unit;if(b(e)){var s=e[r];if(s){if(T(s))return s(n);if(_[r])return _[r](n,s)}}else if("%"===r)return n*e/100;return _[r]?_[r](n):n}function B(t,e,i){return[[X(e[0],v),X(e[0]*t[1]/t[0],v)],[X(e[1]*t[0]/t[1],v),X(e[1],v)]].filter((function(t){return t.every((function(t,n){return i?t<=e[n]:t>=e[n]}))}))[0]||t}function F(t){for(var e=t.length,i=0,n=e-1;n>=0;--n)i+=t[n];return e?i/e:0}function G(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=Math.atan2(n,i);return r>=0?r:r+2*Math.PI}function U(t){var e=function(t){return[0,1].map((function(e){return F(t.map((function(t){return t[e]})))}))}(t),i=G(e,t[0]),n=G(e,t[1]);return i<n&&n-i<Math.PI||i>n&&n-i<-Math.PI?1:-1}function j(t,e){return Math.sqrt(Math.pow((e?e[0]:0)-t[0],2)+Math.pow((e?e[1]:0)-t[1],2))}function X(t,e){return e?Math.round(t/e)*e:t}function H(t,e){return t.forEach((function(i,n){t[n]=X(t[n],e)})),t}function z(t,e){return t.classList?t.classList.contains(e):!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function W(t,e,i,n){t.addEventListener(e,i,n)}function V(t,e,i,n){t.removeEventListener(e,i,n)}var Y=function(t,e){return Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Y(t,e)};function $(t,e){function i(){this.constructor=t}Y(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var q=function(){return q=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},q.apply(this,arguments)};function Z(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}function K(t,e){if(t===e)return!1;for(var i in t)if(!(i in e))return!0;for(var i in e)if(t[i]!==e[i])return!0;return!1}function J(t,e){var i=Object.keys(t),n=Object.keys(e),r=f(i,n,(function(t){return t})),s={},o={},a={};return r.added.forEach((function(t){var i=n[t];s[i]=e[i]})),r.removed.forEach((function(e){var n=i[e];o[n]=t[n]})),r.maintained.forEach((function(n){var r=n[0],s=i[r],o=[t[s],e[s]];t[s]!==e[s]&&(a[s]=o)})),{added:s,removed:o,changed:a}}function Q(t){t.forEach((function(t){t()}))}function tt(t){var e=0;return t.map((function(t){return null==t?"$compat"+ ++e:""+t}))}function et(t,e,i,n){return x(t)||"number"==typeof t?new ht("text_"+t,e,i,n,null,{}):new("string"==typeof t.type?ut:t.type.prototype.render?pt:ft)(t.type,e,i,n,t.ref,t.props)}function it(t){var e=[];return t.forEach((function(t){e=e.concat(E(t)?it(t):t)})),e}function nt(t){var e=t.className,i=Z(t,["className"]);return null!=e&&(i.class=e),delete i.style,delete i.children,i}function rt(t,e){if(!e)return t;for(var i in e)y(t[i])&&(t[i]=e[i]);return t}function st(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var r=e||{},s=r.key,o=r.ref,a=Z(r,["key","ref"]);return{type:t,key:s,ref:o,props:q(q({},a),{children:it(i).filter((function(t){return null!=t&&!1!==t}))})}}var ot=function(){function t(t,e,i,n,r,s){void 0===s&&(s={}),this.type=t,this.key=e,this.index=i,this.container=n,this.ref=r,this.props=s,this._providers=[]}var e=t.prototype;return e._should=function(t,e){return!0},e._update=function(t,e,i,n){if(this.base&&!x(e)&&!n&&!this._should(e.props,i))return!1;this.original=e,this._setState(i);var r=this.props;return x(e)||(this.props=e.props,this.ref=e.ref),this._render(t,this.base?r:{},i),!0},e._mounted=function(){var t=this.ref;t&&t(this.base)},e._setState=function(t){},e._updated=function(){var t=this.ref;t&&t(this.base)},e._destroy=function(){var t=this.ref;t&&t(null)},t}();function at(t){var e={},i={};for(var n in t)0===n.indexOf("on")?i[n.replace("on","").toLowerCase()]=t[n]:e[n]=t[n];return{attributes:e,events:i}}var ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}$(e,t);var i=e.prototype;return i._render=function(t){var e=this,i=!this.base;return i&&(this.base=document.createTextNode(this.type.replace("text_",""))),t.push((function(){i?e._mounted():e._updated()})),!0},i._unmount=function(){this.base.parentNode.removeChild(this.base)},e}(ot),ut=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.events={},e._isSVG=!1,e}$(e,t);var i=e.prototype;return i.addEventListener=function(t,e){var i=this.events;i[t]=function(t){t.nativeEvent=t,e(t)},this.base.addEventListener(t,i[t])},i.removeEventListener=function(t){var e=this.events;this.base.removeEventListener(t,e[t]),delete e[t]},i._should=function(t){return K(this.props,t)},i._render=function(t,e){var i=this,n=!this.base;if(n){var r=this._hasSVG();this._isSVG=r;var s=this.props.portalContainer;if(!s){var o=this.type;s=r?document.createElementNS("http://www.w3.org/2000/svg",o):document.createElement(o)}this.base=s}_t(this,this._providers,this.props.children,t,null);var a=this.base,h=at(e),u=h.attributes,l=h.events,c=at(this.props),f=c.attributes,d=c.events;return function(t,e,i){var n=J(t,e),r=n.added,s=n.removed,o=n.changed;for(var a in r)i.setAttribute(a,r[a]);for(var a in o)i.setAttribute(a,o[a][1]);for(var a in s)i.removeAttribute(a)}(nt(u),nt(f),a),function(t,e,i){var n=J(t,e),r=n.added,s=n.removed,o=n.changed;for(var a in s)i.removeEventListener(a);for(var a in r)i.addEventListener(a,r[a]);for(var a in o)i.removeEventListener(a),i.addEventListener(a,o[a][1]);for(var a in s)i.removeEventListener(a)}(l,d,this),function(t,e,i){var n=i.style,r=J(t,e),s=r.added,o=r.removed,a=r.changed;for(var h in s){var u=I(h,"-");n.setProperty?n.setProperty(u,s[h]):n[u]=s[h]}for(var h in a)u=I(h,"-"),n.setProperty?n.setProperty(u,a[h][1]):n[u]=a[h][1];for(var h in o)u=I(h,"-"),n.removeProperty?n.removeProperty(u):n[u]=""}(e.style||{},this.props.style||{},a),t.push((function(){n?i._mounted():i._updated()})),!0},i._unmount=function(){var t=this.events,e=this.base;for(var i in t)e.removeEventListener(i,t[i]);this._providers.forEach((function(t){t._unmount()})),this.events={},this.props.portalContainer||e.parentNode.removeChild(e)},i._hasSVG=function(){if(this._isSVG||"svg"===this.type)return!0;var t=lt(this.container);return t&&"ownerSVGElement"in t},e}(ot);function lt(t){if(!t)return null;var e=t.base;return e instanceof Node?e:lt(t.container)}function ct(t){if(!t)return null;if(t instanceof Node)return t;var e=t.$_provider._providers;return e.length?ct(e[0].base):null}var ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}$(e,t);var i=e.prototype;return i._render=function(t){var e=this.type(this.props);return _t(this,this._providers,e?[e]:[],t),!0},i._unmount=function(){this._providers.forEach((function(t){t._unmount()}))},e}(ot),dt=function(t){function e(e){var i=t.call(this,"container","container",0,null)||this;return i.base=e,i}$(e,t);var i=e.prototype;return i._render=function(){return!0},i._unmount=function(){},e}(ot),pt=function(t){function e(e,i,n,r,s,o){return void 0===o&&(o={}),t.call(this,e,i,n,r,s,rt(o,e.defaultProps))||this}$(e,t);var i=e.prototype;return i._should=function(t,e){return this.base.shouldComponentUpdate(rt(t,this.type.defaultProps),e||this.base.state)},i._render=function(t,e,i){var n=this;this.props=rt(this.props,this.type.defaultProps);var r=!this.base;r?(this.base=new this.type(this.props),this.base.$_provider=this):this.base.props=this.props;var s=this.base,o=s.state,a=s.render();a&&a.props&&!a.props.children.length&&(a.props.children=this.props.children),_t(this,this._providers,a?[a]:[],t,i,null),t.push((function(){r?(n._mounted(),s.componentDidMount()):(n._updated(),s.componentDidUpdate(e,o))}))},i._setState=function(t){var e=this.base;e&&t&&(e.state=t)},i._unmount=function(){this._providers.forEach((function(t){t._unmount()})),clearTimeout(this.base.$_timer),this.base.componentWillUnmount()},e}(ot),gt=function(){function t(t){void 0===t&&(t={}),this.props=t,this.state={},this.$_timer=0,this.$_state={}}var e=t.prototype;return e.shouldComponentUpdate=function(t,e){return!0},e.render=function(){return null},e.setState=function(t,e,i){var n=this;this.$_timer||(this.$_state={}),clearTimeout(this.$_timer),this.$_timer=0,this.$_state=q(q({},this.$_state),t),i?this.$_setState(e,i):this.$_timer=setTimeout((function(){n.$_timer=0,n.$_setState(e,i)}))},e.forceUpdate=function(t){this.setState({},t,!0)},e.componentDidMount=function(){},e.componentDidUpdate=function(t,e){},e.componentWillUnmount=function(){},e.$_setState=function(t,e){var i=[],n=this.$_provider;_t(n.container,[n],[n.original],i,q(q({},this.state),this.$_state),e)&&(t&&i.push(t),Q(i))},t}(),mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $(e,t),e.prototype.shouldComponentUpdate=function(t,e){return K(this.props,t)||K(this.state,e)},e}(gt),vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}$(e,t);var i=e.prototype;return i.componentDidMount=function(){var t=this.props,e=t.element,i=t.container;this._portalProvider=new dt(i),yt(e,i,this._portalProvider)},i.componentDidUpdate=function(){var t=this.props;yt(t.element,t.container,this._portalProvider)},i.componentWillUnmount=function(){yt(null,this.props.container,this._portalProvider),this._portalProvider=null},e}(mt);function _t(t,e,i,n,r,s){var o=function(t,e,i){var n=i.map((function(t){return x(t)?null:t.key})),r=f(tt(e.map((function(t){return t.key}))),tt(n),(function(t){return t}));r.removed.forEach((function(t){e.splice(t,1)[0]._unmount()})),r.ordered.forEach((function(t){var i=t[0],n=t[1],r=e.splice(i,1)[0];e.splice(n,0,r);var s=ct(r.base),o=ct(e[n+1]&&e[n+1].base);s&&s.parentNode.insertBefore(s,o)})),r.added.forEach((function(r){e.splice(r,0,et(i[r],n[r],r,t))}));var s=r.maintained.filter((function(r){r[0];var s=r[1],o=i[s],a=e[s];return(x(o)?"text_"+o:o.type)!==a.type?(a._unmount(),e.splice(s,1,et(o,n[s],s,t)),!0):(a.index=s,!1)}));return function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n}(r.added,s.map((function(t){return t[0],t[1]})))}(t,e,i),a=e.filter((function(t,e){return t._update(n,i[e],r,s)})),h=lt(t);return h&&o.reverse().forEach((function(i){var n=e[i],r=ct(n.base);if(r&&h!==r&&!r.parentNode){var s=function(t,e){for(var i=t._providers,n=i.length,r=e.index+1;r<n;++r){var s=ct(i[r].base);if(s)return s}return null}(t,n);h.insertBefore(r,s)}})),a.length>0}function yt(t,e,i){void 0===i&&(i=e.__REACT_COMPAT__);var n=!!i;return i||(i=new dt(e)),function(t,e,i){var n=[];_t(t,t._providers,e,n,void 0),Q(n)}(i,t?[t]:[]),n||(e.__REACT_COMPAT__=i),i}function bt(t,e,i){var n=e.__REACT_COMPAT__;t&&!n&&(e.innerHTML=""),yt(t,e,n),i&&i()}function Et(t,e){for(var i=t.length,n=0;n<i;++n)if(e(t[n],n))return!0;return!1}function xt(t,e){for(var i=t.length,n=0;n<i;++n)if(e(t[n],n))return t[n];return null}function Tt(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function wt(t){return t.replace(/_/g,".")}function St(t,e){var i=null,n="-1";return Et(t,(function(t){var r=Tt("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",e);return!(!r||t.brand||(i=t,n=r[3]||"-1",t.versionAlias?n=t.versionAlias:t.versionTest&&(n=function(t,e){var i=Tt("("+t+")((?:\\/|\\s|:)([0-9|\\.|_]+))",e);return i?i[3]:""}(t.versionTest.toLowerCase(),e)||n),n=wt(n),0))})),{preset:i,version:n}}function At(t,e){var i={brand:"",version:"-1"};return Et(t,(function(t){var n=Mt(e,t);return!!n&&(i.brand=t.id,i.version=t.versionAlias||n.version,"-1"!==i.version)})),i}function Mt(t,e){return xt(t,(function(t){var i=t.brand;return Tt(""+e.test,i.toLowerCase())}))}var Ot=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],Rt=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome",versionTest:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",versionAlias:"-1",brand:!0}],Ct=[{test:"applewebkit",id:"webkit",versionTest:"applewebkit|safari"}],It=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],Pt=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"mac os x",id:"mac"},{test:"android",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];const Nt=function(t){return void 0===t&&function(){if("undefined"==typeof navigator||!navigator||!navigator.userAgentData)return!1;var t=navigator.userAgentData,e=t.brands||t.uaList;return!(!e||!e.length)}()?function(t){var e=navigator.userAgentData,i=(e.uaList||e.brands).slice(),n=e.mobile||!1,r=i[0],s={name:r.brand,version:r.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!At(It,i).brand},o={name:"unknown",version:"-1",majorVersion:-1};s.webkit=!s.chromium&&Et(Ct,(function(t){return Mt(i,t)}));var a=At(Rt,i);if(s.chromium=!!a.brand,s.chromiumVersion=a.version,!s.chromium){var h=At(Ct,i);s.webkit=!!h.brand,s.webkitVersion=h.version}if(t){var u=t.platform.toLowerCase(),l=xt(Pt,(function(t){return new RegExp(""+t.test,"g").exec(u)}));o.name=l?l.id:u,o.version=t.platformVersion}var c=At(Ot,i);return c.brand&&(s.name=c.brand,s.version=t?t.uaFullVersion:c.version),"Linux armv8l"===navigator.platform?o.name="android":s.webkit&&(o.name=n?"ios":"mac"),"ios"===o.name&&s.webview&&(s.version="-1"),o.version=wt(o.version),s.version=wt(s.version),o.majorVersion=parseInt(o.version,10),s.majorVersion=parseInt(s.version,10),{browser:s,os:o,isMobile:n,isHints:!0}}():function(t){var e=function(t){var e=t;if(void 0===e){if("undefined"==typeof navigator||!navigator)return"";e=navigator.userAgent||""}return e.toLowerCase()}(t),i=!!/mobi/g.exec(e),n={name:"unknown",version:"-1",majorVersion:-1,webview:!!St(It,e).preset,chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},r={name:"unknown",version:"-1",majorVersion:-1},s=St(Ot,e),o=s.preset,a=s.version,h=St(Pt,e),u=h.preset,l=h.version,c=St(Rt,e);if(n.chromium=!!c.preset,n.chromiumVersion=c.version,!n.chromium){var f=St(Ct,e);n.webkit=!!f.preset,n.webkitVersion=f.version}return u&&(r.name=u.id,r.version=l,r.majorVersion=parseInt(l,10)),o&&(n.name=o.id,n.version=a,n.webview&&"ios"===r.name&&"safari"!==n.name&&(n.webview=!1)),n.majorVersion=parseInt(n.version,10),{browser:n,os:r,isMobile:i,isHints:!1}}(t)};function Dt(t,e,i,n,r,s){for(var o=0;o<r;++o){var a=i+o*r,h=n+o*r;t[a]+=t[h]*s,e[a]+=e[h]*s}}function Lt(t,e,i,n,r){for(var s=0;s<r;++s){var o=i+s*r,a=n+s*r,h=t[o],u=e[o];t[o]=t[a],t[a]=h,e[o]=e[a],e[a]=u}}function kt(t,e,i,n,r){for(var s=0;s<n;++s){var o=i+s*n;t[o]/=r,e[o]/=r}}function Bt(t,e,i){void 0===i&&(i=Math.sqrt(t.length));for(var n=t.slice(),r=0;r<i;++r)n[r*i+e-1]=0,n[(e-1)*i+r]=0;return n[(e-1)*(i+1)]=1,n}function Ft(t,e){void 0===e&&(e=Math.sqrt(t.length));for(var i=t.slice(),n=ee(e),r=0;r<e;++r){var s=e*r+r;if(!X(i[s],v))for(var o=r+1;o<e;++o)if(i[e*r+o]){Lt(i,n,r,o,e);break}if(!X(i[s],v))return[];for(kt(i,n,r,e,i[s]),o=0;o<e;++o){var a=o,h=i[o+r*e];X(h,v)&&r!==o&&Dt(i,n,a,r,e,-h)}}return n}function Gt(t,e){for(var i=t.slice(),n=t.length;n<e-1;++n)i[n]=0;return i[e-1]=1,i}function Ut(t,e,i){if(void 0===e&&(e=Math.sqrt(t.length)),e===i)return t;for(var n=ee(i),r=Math.min(e,i),s=0;s<r-1;++s){for(var o=0;o<r-1;++o)n[s*i+o]=t[s*e+o];n[(s+1)*i-1]=t[(s+1)*e-1],n[(i-1)*i+s]=t[(e-1)*e+s]}return n[i*i-1]=t[e*e-1],n}function jt(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=ee(t);return e.forEach((function(e){n=Xt(n,e,t)})),n}function Xt(t,e,i){void 0===i&&(i=Math.sqrt(t.length));var n=[],r=t.length/i,s=e.length/r;if(!r)return e;if(!s)return t;for(var o=0;o<i;++o)for(var a=0;a<s;++a){n[a*i+o]=0;for(var h=0;h<r;++h)n[a*i+o]+=t[h*i+o]*e[a*r+h]}return n}function Ht(t,e){for(var i=Math.min(t.length,e.length),n=t.slice(),r=0;r<i;++r)n[r]=n[r]+e[r];return n}function zt(t,e){for(var i=Math.min(t.length,e.length),n=t.slice(),r=0;r<i;++r)n[r]=n[r]-e[r];return n}function Wt(t,e){return void 0===e&&(e=9===t.length),e?[t[0],t[1],t[3],t[4],t[6],t[7]]:t}function Vt(t,e,i){void 0===i&&(i=e.length);var n=Xt(t,e,i),r=n[i-1];return n.map((function(t){return t/r}))}function Yt(t,e){return Xt(t,[1,0,0,0,0,Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1],4)}function $t(t,e){return Xt(t,[Math.cos(e),0,-Math.sin(e),0,0,1,0,0,Math.sin(e),0,Math.cos(e),0,0,0,0,1],4)}function qt(t,e){return Xt(t,te(e,4))}function Zt(t,e){var i=e[0],n=void 0===i?1:i,r=e[1],s=void 0===r?1:r,o=e[2];return Xt(t,[n,0,0,0,0,s,0,0,0,0,void 0===o?1:o,0,0,0,0,1],4)}function Kt(t,e){return Vt(te(e,3),Gt(t,3))}function Jt(t,e){var i=e[0],n=void 0===i?0:i,r=e[1],s=void 0===r?0:r,o=e[2];return Xt(t,[1,0,0,0,0,1,0,0,0,0,1,0,n,s,void 0===o?0:o,1],4)}function Qt(t,e){return Xt(t,e,4)}function te(t,e){var i=Math.cos(t),n=Math.sin(t),r=ee(e);return r[0]=i,r[1]=n,r[e]=-n,r[e+1]=i,r}function ee(t){for(var e=t*t,i=[],n=0;n<e;++n)i[n]=n%(t+1)?0:1;return i}function ie(t,e){for(var i=ee(e),n=Math.min(t.length,e-1),r=0;r<n;++r)i[(e+1)*r]=t[r];return i}function ne(t,e){for(var i=ee(e),n=Math.min(t.length,e-1),r=0;r<n;++r)i[e*(e-1)+r]=t[r];return i}function re(t,e,i,n,r,s,o,a){var h=t[0],u=t[1],l=e[0],c=e[1],f=i[0],d=i[1],p=n[0],g=n[1],m=r[0],v=r[1],_=s[0],y=s[1],b=o[0],E=o[1],x=a[0],T=a[1],w=Ft([h,0,l,0,f,0,p,0,u,0,c,0,d,0,g,0,1,0,1,0,1,0,1,0,0,h,0,l,0,f,0,p,0,u,0,c,0,d,0,g,0,1,0,1,0,1,0,1,-m*h,-v*h,-_*l,-y*l,-b*f,-E*f,-x*p,-T*p,-m*u,-v*u,-_*c,-y*c,-b*d,-E*d,-x*g,-T*g],8);if(!w.length)return[];var S=Xt(w,[m,v,_,y,b,E,x,T],8);return S[8]=1,Ut(function(t,e){void 0===e&&(e=Math.sqrt(t.length));for(var i=[],n=0;n<e;++n)for(var r=0;r<e;++r)i[r*e+n]=t[e*n+r];return i}(S),3,4)}function se(t){var e=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return t.forEach((function(t){var i=t.matrixFunction,n=t.functionValue;i&&(e=i(e,n))})),e}function oe(t){return(E(t)?t:M(t)).map((function(t){var e=R(t),i=e.prefix,n=e.value,r=null,s=i,o="";if("translate"===i||"translateX"===i||"translate3d"===i){var a=O(n).map((function(t){return parseFloat(t)})),h=a[0],u=a[1],l=void 0===u?0:u,c=a[2];r=Jt,o=[h,l,void 0===c?0:c]}else if("translateY"===i)r=Jt,o=[0,l=parseFloat(n),0];else if("translateZ"===i)r=Jt,o=[0,0,parseFloat(n)];else if("scale"===i||"scale3d"===i){var f=O(n).map((function(t){return parseFloat(t)})),d=f[0],p=f[1],g=void 0===p?d:p,m=f[2];r=Zt,o=[d,g,void 0===m?1:m]}else if("scaleX"===i)r=Zt,o=[d=parseFloat(n),1,1];else if("scaleY"===i)r=Zt,o=[1,g=parseFloat(n),1];else if("scaleZ"===i)r=Zt,o=[1,1,parseFloat(n)];else if("rotate"===i||"rotateZ"===i||"rotateX"===i||"rotateY"===i){var v=C(n),_=v.unit,y=v.value;"rotate"===i||"rotateZ"===i?(s="rotateZ",r=qt):"rotateX"===i?r=Yt:"rotateY"===i&&(r=$t),o="rad"===_?y:y*Math.PI/180}else if("matrix3d"===i)r=Qt,o=O(n).map((function(t){return parseFloat(t)}));else if("matrix"===i){var b=O(n).map((function(t){return parseFloat(t)}));r=Qt,o=[b[0],b[1],0,0,b[2],b[3],0,0,0,0,1,0,b[4],b[5],0,1]}else s="";return{name:i,functionName:s,value:n,matrixFunction:r,functionValue:o}}))}var ae,he=function(t,e){return he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},he(t,e)},ue="function"==typeof Map?void 0:(ae=0,function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++ae)});const le=function(t){function e(e){return void 0===e&&(e=[]),t.call(this,e,ue)||this}return function(t,e){function i(){this.constructor=t}he(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e}(p);function ce(t){return t.length<3?0:Math.abs(function(t){for(var e=0,i=t.length-1;i>=0;--i)e+=t[i];return e}(t.map((function(e,i){var n=t[i+1]||t[0];return e[0]*n[1]-n[0]*e[1]}))))/2}function fe(t,e){var i=e.width,n=e.height,r=e.left,s=e.top,o=de(t),a=o.minX,h=o.minY,u=o.maxX,l=o.maxY,c=i/(u-a),f=n/(l-h);return t.map((function(t){return[r+(t[0]-a)*c,s+(t[1]-h)*f]}))}function de(t){var e=t.map((function(t){return t[0]})),i=t.map((function(t){return t[1]}));return{minX:Math.min.apply(Math,e),minY:Math.min.apply(Math,i),maxX:Math.max.apply(Math,e),maxY:Math.max.apply(Math,i)}}function pe(t,e,i){var n=t[0],r=t[1],s=de(e),o=s.minX,a=s.minY,h=s.maxX,u=s.maxY,l=[[o,r],[h,r]],c=[[n,a],[n,u]],f=ge(l[0],l[1]),d=ge(c[0],c[1]),p=_e(e),g=[],m=[];return p.forEach((function(t){var e=ge(t[0],t[1]),i=ve(me(f,e),[l,t]),s=ve(me(d,e),[c,t]);1===i.length&&t[0][1]===r||g.push.apply(g,i),1===s.length&&t[0][0]===n||m.push.apply(m,s),e[0]||g.push.apply(g,i),e[1]||m.push.apply(m,s)})),!i&&(N(g,(function(t){return t[0]===n}))>-1||N(m,(function(t){return t[1]===r}))>-1)||!!(g.filter((function(t){return t[0]>n})).length%2&&m.filter((function(t){return t[1]>r})).length%2)}function ge(t,e){var i=t[0],n=t[1],r=e[0],s=e[1];if(i===r&&n===s)return[0,0,0];if(i===r)return[1,0,-i];if(n===s)return[0,1,-n];var o=(r-i)/(n-s);return[1,o,-i-o*n]}function me(t,e){var i,n,r=t[0],s=t[1],o=t[2],a=e[0],h=e[1],u=e[2],l=0===r&&0===a,c=0===s&&0===h;if(l&&c)return[];if(l){var f=-o/s;return f!==-u/h?[]:[[-1/0,f],[1/0,f]]}if(c){var d=-o/r;return d!==-u/a?[]:[[d,-1/0],[d,1/0]]}return 0===r?[[i=-(h*(n=-o/s)+u)/a,n]]:0===a?[[i=-(s*(n=-u/h)+o)/r,n]]:0===s?[[i=-o/r,n=-(a*i+u)/h]]:0===h?[[i=-u/a,n=-(r*i+o)/s]]:[[i=(s*u-h*o)/(h*r-s*a),n=-(r*i+o)/s]]}function ve(t,e){var i=e.map((function(t){return[0,1].map((function(e){return[Math.min(t[0][e],t[1][e]),Math.max(t[0][e],t[1][e])]}))}));if(2===t.length){var n=t[0],r=n[0],s=n[1];if(r===t[1][0]){var o=Math.max.apply(Math,i.map((function(t){return t[1][0]}))),a=Math.min.apply(Math,i.map((function(t){return t[1][1]})));return o>a?[]:[[r,o],[r,a]]}if(s===t[1][1]){var h=Math.max.apply(Math,i.map((function(t){return t[0][0]}))),u=Math.min.apply(Math,i.map((function(t){return t[0][1]})));return h>u?[]:[[h,s],[u,s]]}}return t.filter((function(t){return i.every((function(e){return e[0][0]<=t[0]&&t[0]<=e[0][1]&&e[1][0]<=t[1]&&t[1]<=e[1][1]}))}))}function _e(t){return function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n}(t.slice(1),[t[0]]).map((function(e,i){return[t[i],e]}))}var ye=function(){return ye=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},ye.apply(this,arguments)},be=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(b(t))for(var i in t)this.on(i,t[i]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(b(t))for(var i in t)this.off(i);else if(e){var n=this._events[t];if(n){var r=N(n,(function(t){return t.listener===e}));r>-1&&n.splice(r,1)}}else this._events[t]=[];else this._events={};return this},e.once=function(t,e){var i=this;return e&&this._addEvent(t,e,{once:!0}),new Promise((function(e){i._addEvent(t,e,{once:!0})}))},e.emit=function(t,e){var i=this;void 0===e&&(e={});var n=this._events[t];if(!t||!n)return!0;var r=!1;return e.eventType=t,e.stop=function(){r=!0},e.currentTarget=this,function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n}(n).forEach((function(n){n.listener(e),n.once&&i.off(t,n.listener)})),!r},e.trigger=function(t,e){return void 0===e&&(e={}),this.emit(t,e)},e._addEvent=function(t,e,i){var n=this._events;n[t]=n[t]||[],n[t].push(ye({listener:e},i))},t}();const Ee=be;var xe=function(t,e){return xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},xe(t,e)};function Te(t){var e=t.container;return e===document.body?[e.scrollLeft||document.documentElement.scrollLeft,e.scrollTop||document.documentElement.scrollTop]:[e.scrollLeft,e.scrollTop]}var we=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.startRect=null,e.startPos=[],e.prevTime=0,e.timer=0,e}!function(t,e){function i(){this.constructor=t}xe(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t);var i=e.prototype;return i.dragStart=function(t,e){var i=e.container,n=0,r=0,s=0,o=0;if(i===document.body)s=window.innerWidth,o=window.innerHeight;else{var a=i.getBoundingClientRect();n=a.top,r=a.left,s=a.width,o=a.height}this.startPos=[t.clientX,t.clientY],this.startRect={top:n,left:r,width:s,height:o}},i.drag=function(t,e){var i=this,n=t.clientX,r=t.clientY,s=e.container,o=e.threshold,a=void 0===o?0:o,h=e.throttleTime,u=void 0===h?0:h,l=e.getScrollPosition,c=void 0===l?Te:l,f=this.startRect,d=this.startPos,p=P(),g=Math.max(u+this.prevTime-p,0),m=[0,0];if(f.top>r-a?(d[1]>f.top||r<d[1])&&(m[1]=-1):f.top+f.height<r+a&&(d[1]<f.top+f.height||r>d[1])&&(m[1]=1),f.left>n-a?(d[0]>f.left||n<d[0])&&(m[0]=-1):f.left+f.width<n+a&&(d[0]<f.left+f.width||n>d[0])&&(m[0]=1),clearTimeout(this.timer),!m[0]&&!m[1])return!1;if(g>0)return this.timer=window.setTimeout((function(){i.drag(t,e)}),g),!1;this.prevTime=p;var v=c({container:s,direction:m});this.trigger("scroll",{container:s,direction:m,inputEvent:t});var _=c({container:s,direction:m}),y=_[0]-v[0],b=_[1]-v[1];return!(!y&&!b||(this.trigger("move",{offsetX:m[0]?y:0,offsetY:m[1]?b:0,inputEvent:t}),u&&(this.timer=window.setTimeout((function(){i.drag(t,e)}),u)),0))},i.dragEnd=function(){clearTimeout(this.timer)},e}(Ee);const Se=we;var Ae=function(t,e){return Ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Ae(t,e)},Me=function(){return Me=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Me.apply(this,arguments)};function Oe(t){return 180*(e=[t[0].clientX,t[0].clientY],n=(i=[t[1].clientX,t[1].clientY])[0]-e[0],r=i[1]-e[1],((s=Math.atan2(r,n))>=0?s:s+2*Math.PI)/Math.PI);var e,i,n,r,s}function Re(t){return t.touches?function(t){for(var e=Math.min(t.length,2),i=[],n=0;n<e;++n)i.push(Pe(t[n]));return i}(t.touches):[Pe(t)]}function Ce(t,e,i){var n=i.length,r=Ne(t,n),s=r.clientX,o=r.clientY,a=r.originalClientX,h=r.originalClientY,u=Ne(e,n),l=u.clientX,c=u.clientY,f=Ne(i,n);return{clientX:a,clientY:h,deltaX:s-l,deltaY:o-c,distX:s-f.clientX,distY:o-f.clientY}}function Ie(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function Pe(t){return{clientX:t.clientX,clientY:t.clientY}}function Ne(t,e){void 0===e&&(e=t.length);for(var i={clientX:0,clientY:0,originalClientX:0,originalClientY:0},n=0;n<e;++n){var r=t[n];i.originalClientX+="originalClientX"in r?r.originalClientX:r.clientX,i.originalClientY+="originalClientY"in r?r.originalClientY:r.clientY,i.clientX+=r.clientX,i.clientY+=r.clientY}return e?{clientX:i.clientX/e,clientY:i.clientY/e,originalClientX:i.originalClientX/e,originalClientY:i.originalClientY/e}:i}var De=function(){function t(t){this.prevClients=[],this.startClients=[],this.movement=0,this.length=0,this.startClients=t,this.prevClients=t,this.length=t.length}var e=t.prototype;return e.addClients=function(t){void 0===t&&(t=this.prevClients);var e=this.getPosition(t),i=e.deltaX,n=e.deltaY;return this.movement+=Math.sqrt(i*i+n*n),this.prevClients=t,e},e.getAngle=function(t){return void 0===t&&(t=this.prevClients),Oe(t)},e.getRotation=function(t){return void 0===t&&(t=this.prevClients),Oe(t)-Oe(this.startClients)},e.getPosition=function(t){return Ce(t||this.prevClients,this.prevClients,this.startClients)},e.getPositions=function(t){void 0===t&&(t=this.prevClients);var e=this.prevClients;return this.startClients.map((function(i,n){return Ce([t[n]],[e[n]],[i])}))},e.getMovement=function(t){var e=this.movement;if(!t)return e;var i=Ne(t,this.length),n=Ne(this.prevClients,this.length),r=i.clientX-n.clientX,s=i.clientY-n.clientY;return Math.sqrt(r*r+s*s)+e},e.getDistance=function(t){return void 0===t&&(t=this.prevClients),Ie(t)},e.getScale=function(t){return void 0===t&&(t=this.prevClients),Ie(t)/Ie(this.startClients)},e.move=function(t,e){this.startClients.forEach((function(i){i.clientX-=t,i.clientY-=e})),this.prevClients.forEach((function(i){i.clientX-=t,i.clientY-=e}))},t}(),Le=["textarea","input"];const ke=function(t){function e(e,i){void 0===i&&(i={});var n=t.call(this)||this;n.options={},n.flag=!1,n.pinchFlag=!1,n.datas={},n.isDrag=!1,n.isPinch=!1,n.isMouse=!1,n.isTouch=!1,n.clientStores=[],n.targets=[],n.prevTime=0,n.doubleFlag=!1,n.onDragStart=function(t,e){if(void 0===e&&(e=!0),n.flag||!1!==t.cancelable){var i=n.options,r=i.container,s=i.pinchOutside,o=i.preventRightClick,a=i.preventDefault,h=i.checkInput,u=n.isTouch,l=!n.flag;if(l){var c=document.activeElement,f=t.target,d=f.tagName.toLowerCase(),p=Le.indexOf(d)>-1,g=f.isContentEditable;if(p||g){if(h||c===f)return!1;if(c&&g&&c.isContentEditable&&c.contains(f))return!1}else if((a||"touchstart"===t.type)&&c){var m=c.tagName;(c.isContentEditable||Le.indexOf(m)>-1)&&c.blur()}if(n.clientStores=[new De(Re(t))],n.flag=!0,n.isDrag=!1,n.datas={},o&&(3===t.which||2===t.button))return n.initDrag(),!1;n.doubleFlag=P()-n.prevTime<200,!1===n.emit("dragStart",Me({datas:n.datas,inputEvent:t,isTrusted:e,isDouble:n.doubleFlag},n.getCurrentStore().getPosition()))&&n.initDrag(),n.flag&&a&&t.preventDefault()}if(!n.flag)return!1;var v=0;if(l&&u&&s&&(v=setTimeout((function(){W(r,"touchstart",n.onDragStart,{passive:!1})}))),!l&&u&&s&&V(r,"touchstart",n.onDragStart),n.flag&&function(t){return t.touches&&t.touches.length>=2}(t)){if(clearTimeout(v),l&&t.touches.length!==t.changedTouches.length)return;n.pinchFlag||n.onPinchStart(t)}}},n.onDrag=function(t,e){if(n.flag){var i=Re(t),r=n.moveClients(i,t,!1);if((n.pinchFlag||r.deltaX||r.deltaY)&&!1===n.emit("drag",Me({},r,{isScroll:!!e,inputEvent:t})))return void n.stop();n.pinchFlag&&n.onPinch(t,i),n.getCurrentStore().addClients(i)}},n.onDragEnd=function(t){if(n.flag){var e=n.options,i=e.pinchOutside,r=e.container;n.isTouch&&i&&V(r,"touchstart",n.onDragStart),n.flag=!1;var s=n.getCurrentStore().getPosition(),o=P(),a=!n.isDrag&&n.doubleFlag;n.prevTime=n.isDrag||a?0:o,n.emit("dragEnd",Me({datas:n.datas,isDouble:a,isDrag:n.isDrag,isClick:!n.isDrag,inputEvent:t},s)),n.pinchFlag&&n.onPinchEnd(t),n.clientStores=[]}},n.onBlur=function(){n.onDragEnd()};var r=[].concat(e);n.options=Me({checkInput:!1,container:r.length>1?window:r[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},i);var s=n.options,o=s.container,a=s.events,h=s.checkWindowBlur;if(n.isTouch=a.indexOf("touch")>-1,n.isMouse=a.indexOf("mouse")>-1,n.targets=r,n.isMouse&&(r.forEach((function(t){W(t,"mousedown",n.onDragStart)})),W(o,"mousemove",n.onDrag),W(o,"mouseup",n.onDragEnd),W(o,"contextmenu",n.onDragEnd)),h&&W(window,"blur",n.onBlur),n.isTouch){var u={passive:!1};r.forEach((function(t){W(t,"touchstart",n.onDragStart,u)})),W(o,"touchmove",n.onDrag,u),W(o,"touchend",n.onDragEnd,u),W(o,"touchcancel",n.onDragEnd,u)}return n}!function(t,e){function i(){this.constructor=t}Ae(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t);var i=e.prototype;return i.stop=function(){this.isDrag=!1,this.flag=!1,this.clientStores=[],this.datas={}},i.getMovement=function(t){return this.getCurrentStore().getMovement(t)+this.clientStores.slice(1).reduce((function(t,e){return t+e.movement}),0)},i.isDragging=function(){return this.isDrag},i.isFlag=function(){return this.flag},i.isPinchFlag=function(){return this.pinchFlag},i.isDoubleFlag=function(){return this.doubleFlag},i.isPinching=function(){return this.isPinch},i.scrollBy=function(t,e,i,n){void 0===n&&(n=!0),this.flag&&(this.clientStores[0].move(t,e),n&&this.onDrag(i,!0))},i.move=function(t,e){var i=t[0],n=t[1],r=this.getCurrentStore().prevClients;return this.moveClients(r.map((function(t){var e=t.clientX,r=t.clientY;return{clientX:e+i,clientY:r+n,originalClientX:e,originalClientY:r}})),e,!0)},i.triggerDragStart=function(t){this.onDragStart(t,!1)},i.setEventDatas=function(t){var e=this.datas;for(var i in t)e[i]=t[i];return this},i.getEventDatas=function(){return this.datas},i.unset=function(){var t=this,e=this.targets,i=this.options.container;this.off(),V(window,"blur",this.onBlur),this.isMouse&&(e.forEach((function(e){V(e,"mousedown",t.onDragStart)})),V(i,"mousemove",this.onDrag),V(i,"mouseup",this.onDragEnd),V(i,"contextmenu",this.onDragEnd)),this.isTouch&&(e.forEach((function(e){V(e,"touchstart",t.onDragStart)})),V(i,"touchstart",this.onDragStart),V(i,"touchmove",this.onDrag),V(i,"touchend",this.onDragEnd),V(i,"touchcancel",this.onDragEnd))},i.onPinchStart=function(t){var e=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>e)){var i=new De(Re(t));this.pinchFlag=!0,this.clientStores.splice(0,0,i),!1===this.emit("pinchStart",Me({datas:this.datas,angle:i.getAngle(),touches:this.getCurrentStore().getPositions()},i.getPosition(),{inputEvent:t}))&&(this.pinchFlag=!1)}},i.onPinch=function(t,e){if(this.flag&&this.pinchFlag&&!(e.length<2)){var i=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",Me({datas:this.datas,movement:this.getMovement(e),angle:i.getAngle(e),rotation:i.getRotation(e),touches:i.getPositions(e),scale:i.getScale(e),distance:i.getDistance(e)},i.getPosition(e),{inputEvent:t}))}},i.onPinchEnd=function(t){if(this.pinchFlag){var e=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var i=this.getCurrentStore();this.emit("pinchEnd",Me({datas:this.datas,isPinch:e,touches:i.getPositions()},i.getPosition(),{inputEvent:t})),this.isPinch=!1,this.pinchFlag=!1}},i.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},i.getCurrentStore=function(){return this.clientStores[0]},i.moveClients=function(t,e,i){var n=this.getCurrentStore()[i?"addClients":"getPosition"](t);return this.isDrag=!0,Me({datas:this.datas},n,{movement:this.getMovement(t),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:e})},e}(Ee);const Be=function(t){var e,i="rCS"+function(t){for(var e=5381,i=t.length;i;)e=33*e^t.charCodeAt(--i);return e>>>0}(t).toString(36),n=0;return{className:i,inject:function(r,s){void 0===s&&(s={});var o,a=function(t){if(t&&t.getRootNode){var e=t.getRootNode();if(11===e.nodeType)return e}}(r),h=0===n;return(a||h)&&(o=function(t,e,i,n){var r=document.createElement("style");return r.setAttribute("type","text/css"),r.setAttribute("data-styled-id",t),i.nonce&&r.setAttribute("nonce",i.nonce),r.innerHTML=function(t,e,i){return i.original?e:e.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(e,i){var n=i.trim();return(n?O(n):[""]).map((function(e){var i=e.trim();return 0===i.indexOf("@")?i:i.indexOf(":global")>-1?i.replace(/\:global/g,""):i.indexOf(":host")>-1?""+i.replace(/\:host/g,"."+t):i?"."+t+" "+i:"."+t})).join(", ")+" {"}))}(t,e,i),(n||document.head||document.body).appendChild(r),r}(i,t,s,a)),h&&(e=o),a||++n,{destroy:function(){a?(r.removeChild(o),o=null):(n>0&&--n,0===n&&e&&(e.parentNode.removeChild(e),e=null))}}}}};var Fe=function(t,e){return Fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Fe(t,e)};function Ge(t,e){function i(){this.constructor=t}Fe(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Ue=function(){return Ue=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Ue.apply(this,arguments)},je=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.injectResult=null,e.tag="div",e}Ge(e,t);var i=e.prototype;return i.render=function(){var t=this.props,e=t.className,i=void 0===e?"":e,n=(t.cspNonce,t.portalContainer),s=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}(t,["className","cspNonce","portalContainer"]),o=this.injector.className,a=this.tag,h={};return"simple-1.1.0".indexOf("simple")>-1&&n&&(h={portalContainer:n}),st(a,Ue({ref:r(this,"element"),"data-styled-id":o,className:i+" "+o},h,s))},i.componentDidMount=function(){this.injectResult=this.injector.inject(this.element,{nonce:this.props.cspNonce})},i.componentWillUnmount=function(){this.injectResult.destroy(),this.injectResult=null},i.getElement=function(){return this.element},e}(gt);const Xe=function(t,e){var i=Be(e);return function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.injector=i,n.tag=t,n}return Ge(n,e),n}(je)};var He=function(t,e){return He=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},He(t,e)};function ze(t,e){function i(){this.constructor=t}He(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var We=function(){return We=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},We.apply(this,arguments)};function Ve(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n}function Ye(t,e){var i;return We({events:{},props:(i={},i[t]=Boolean,i),name:t},e)}function $e(t,e){return'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="'+32*t+'px" height="'+32*t+'px" viewBox="0 0 32 32" ><path d="M 16,5 L 12,10 L 14.5,10 L 14.5,22 L 12,22 L 16,27 L 20,22 L 17.5,22 L 17.5,10 L 20, 10 L 16,5 Z" stroke-linejoin="round" stroke-width="1.2" fill="black" stroke="white" style="transform:rotate('+e+'deg);transform-origin: 16px 16px"></path></svg>'}var qe,Ze,Ke=Nt().browser.webkit,Je=Ke&&(qe="undefined"==typeof window?{userAgent:""}:window.navigator,!!(Ze=/applewebkit\/([^\s]+)/g.exec(qe.userAgent.toLowerCase()))&&parseFloat(Ze[1])<605),Qe="moveable-",ti="\n{\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tleft: 0;\n\ttop: 0;\n z-index: 3000;\n --moveable-color: #4af;\n --zoom: 1;\n --zoompx: 1px;\n will-change: transform;\n}\n.control-box {\n z-index: 0;\n}\n.line, .control {\n position: absolute;\n\tleft: 0;\n top: 0;\n will-change: transform;\n}\n.control {\n\twidth: 14px;\n\theight: 14px;\n\tborder-radius: 50%;\n\tborder: 2px solid #fff;\n\tbox-sizing: border-box;\n background: #4af;\n background: var(--moveable-color);\n\tmargin-top: -7px;\n margin-left: -7px;\n border: 2px solid #fff;\n z-index: 10;\n}\n.padding {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100px;\n height: 100px;\n transform-origin: 0 0;\n}\n.line {\n\twidth: 1px;\n height: 1px;\n background: #4af;\n background: var(--moveable-color);\n\ttransform-origin: 0px 50%;\n}\n.line.dashed {\n box-sizing: border-box;\n background: transparent;\n}\n.line.dashed.horizontal {\n border-top: 1px dashed #4af;\n border-top-color: #4af;\n border-top-color: var(--moveable-color);\n}\n.line.dashed.vertical {\n border-left: 1px dashed #4af;\n border-left-color: #4af;\n border-left-color: var(--moveable-color);\n}\n.line.vertical {\n transform: translateX(-50%);\n}\n.line.horizontal {\n transform: translateY(-50%);\n}\n.line.vertical.bold {\n width: 2px;\n}\n.line.horizontal.bold {\n height: 2px;\n}\n\n.control.origin {\n\tborder-color: #f55;\n\tbackground: #fff;\n\twidth: 12px;\n\theight: 12px;\n\tmargin-top: -6px;\n margin-left: -6px;\n\tpointer-events: none;\n}\n"+[0,15,30,45,60,75,90,105,120,135,150,165].map((function(t){return'\n.direction[data-rotation="'+t+'"] {\n\t'+function(t){var e=$e(1,t),i=$e(2,t),n=45*Math.round(t/45)%180,r="ns-resize";return 135===n?r="nwse-resize":45===n?r="nesw-resize":90===n&&(r="ew-resize"),"cursor:"+r+";cursor: url('"+e+"') 16 16, "+r+";cursor: -webkit-image-set(url('"+e+"') 1x, url('"+i+"') 2x) 16 16, "+r+";"}(t)+"\n}\n"})).join("\n")+"\n.group {\n z-index: -1;\n}\n.area {\n position: absolute;\n}\n.area-pieces {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n}\n.area.avoid, .area.pass {\n pointer-events: none;\n}\n.area.avoid+.area-pieces {\n display: block;\n}\n.area-piece {\n position: absolute;\n}\n\n"+(Je?':global svg *:before {\n\tcontent:"";\n\ttransform-origin: inherit;\n}':"")+"\n",ei=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],ii=1e-7,ni=1e-9,ri=Math.pow(10,10),si=-ri,oi=["n","w","s","e","nw","ne","sw","se"],ai={n:[0,1],s:[2,3],w:[2,0],e:[1,3],nw:[0],ne:[1],sw:[2],se:[3]},hi={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},ui=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager"];function li(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(void 0,Ve([Qe],t))}function ci(t,e,i){return jt(e,ne(i,e),t,ne(i.map((function(t){return-t})),e))}function fi(t){var e=t.transformOrigin;return e?e.split(" "):["0","0"]}function di(t,e,i){for(var n=document.body,r=!t||i?t:t.parentElement,s=t===e||r===e,o="relative";r&&r!==n;){e===r&&(s=!0);var a=Xi(r),h=a.transform;if(o=a.position,"svg"===r.tagName.toLowerCase()||"static"!==o||h&&"none"!==h)break;r=r.parentElement,o="relative"}return{isStatic:"static"===o,isEnd:s||!r||r===n,offsetParent:r||n}}function pi(t,e,i,n){var r,s=t.tagName.toLowerCase(),o=t.offsetLeft,a=t.offsetTop;if(n){var h=(e||document.documentElement).getBoundingClientRect();o-=h.left,a-=h.top}var u,l,c=y(o),f=!c;return f||"svg"===s?l=(u=fi(i).map((function(t){return parseFloat(t)}))).slice():(l=(u=Je?function(t){return fi(Xi(t,":before")).map((function(e,i){var n=C(e),r=n.value,s=n.unit;return r*function(t,e,i){return"%"===e?bi(t.ownerSVGElement)[i?"width":"height"]/100:1}(t,s,0===i)}))}(t):fi(i).map((function(t){return parseFloat(t)}))).slice(),f=!0,r=function(t,e){if(!t.getBBox)return[0,0];var i=t.getBBox(),n=bi(t.ownerSVGElement),r=i.x-n.x,s=i.y-n.y;return[r,s,e[0]-r,e[1]-s]}(t,u),o=r[0],a=r[1],u[0]=r[2],u[1]=r[3]),{tagName:s,isSVG:c,hasOffset:f,offset:[o||0,a||0],origin:u,targetOrigin:l}}function gi(t,e,i){void 0===i&&(i=Xi(t));var n=Xi(document.body),r=n.position;if(!(e||r&&"static"!==r))return[0,0];var s=parseInt(n.marginLeft,10),o=parseInt(n.marginTop,10);return"absolute"===i.position&&("auto"===i.top&&"auto"===i.bottom||(o=0),"auto"===i.left&&"auto"===i.right||(s=0)),[s,o]}function mi(t){t.forEach((function(t){var e=t.matrix;e&&(t.matrix=Ut(e,3,4))}))}function vi(t,e,i){for(var n,r,s,o,a,h,u=t,l=[],c=!i&&t===e,f=c,d=!1,p=3,g=di(e,e,!0).offsetParent;u&&!f;){f=c;var m=Xi(u),v=m.position,_="fixed"===v,y=(o=(h=m.transform)&&"none"!==h?b(h)?h:R(h).value.split(/s*,\s*/g).map((function(t){return parseFloat(t)})):[1,0,0,1,0,0],void 0===(a=void 0)&&(a=6===o.length),a?[o[0],o[1],0,o[2],o[3],0,o[4],o[5],1]:o),E=y.length;d||16!==E||(d=!0,p=4,mi(l),s&&(s=Ut(s,3,4))),d&&9===E&&(y=Ut(y,3,4));var x=pi(u,e,m,_),T=x.tagName,w=x.hasOffset,S=x.isSVG,A=x.origin,M=x.targetOrigin,O=x.offset,C=O[0],I=O[1];"svg"===T&&s?(l.push({type:"target",target:u,matrix:Ei(u,p)}),l.push({type:"offset",target:u,matrix:ee(p)})):"g"===T&&t!==u&&(C=0,I=0);var P=di(u,e),N=P.offsetParent,D=P.isEnd,L=P.isStatic;Ke&&w&&!S&&L&&("relative"===v||"static"===v)&&(C-=N.offsetLeft,I-=N.offsetTop,c=c||D);var k=0,B=0;if(w&&g!==N&&(k=N.clientLeft,B=N.clientTop),w&&N===document.body){var F=gi(u,!1,m);C+=F[0],I+=F[1]}if(l.push({type:"target",target:u,matrix:ci(y,p,A)}),w?l.push({type:"offset",target:u,matrix:ne([C-u.scrollLeft+k,I-u.scrollTop+B],p)}):l.push({type:"offset",target:u,origin:A}),s||(s=y),n||(n=A),r||(r=M),f||_)break;u=N,c=D,i&&u!==document.body||(f=c)}return s||(s=ee(p)),n||(n=[0,0]),r||(r=[0,0]),{offsetContainer:g,matrixes:l,targetMatrix:s,transformOrigin:n,targetOrigin:r,is3d:d}}function _i(t,e,i,n){var r;void 0===i&&(i=e);var s=0,o=0,a=0,h={};if(t){var u=Xi(t);s=t.offsetWidth,o=t.offsetHeight,y(s)&&(s=(r=Ii(t,u,!0))[0],o=r[1])}if(t){var l=function(t,e,i,n){void 0===i&&(i=e);var r=vi(t,e),s=r.matrixes,o=r.is3d,a=r.targetMatrix,h=r.transformOrigin,u=r.targetOrigin,l=vi(r.offsetContainer,i,!0),c=l.matrixes,f=l.is3d,d=n||f||o,p=d?4:3,g="svg"!==t.tagName.toLowerCase()&&"ownerSVGElement"in t,m=a,v=ee(p),_=ee(p),y=ee(p),b=ee(p),E=s.length,x=i||document.body,T=di(x,x,!0).offsetParent;c.reverse(),s.reverse(),!o&&d&&(m=Ut(m,3,4),mi(s)),!f&&d&&mi(c),c.forEach((function(t){_=Xt(_,t.matrix,p)})),s.forEach((function(t,e){if(E-2===e&&(y=v.slice()),E-1===e&&(b=v.slice()),!t.matrix){var i=function(t,e,i,n,r){var s,o=t.target,a=t.origin,h=e.matrix,u=Ii(o,void 0,!0),l=u[0],c=u[1],f=i.getBoundingClientRect(),d=[0,0];i===document.body&&(d=gi(o,!0));for(var p=o.getBoundingClientRect(),g=p.left-f.left+i.scrollLeft-(i.clientLeft||0)+d[0],m=p.top-f.top+i.scrollTop-(i.clientTop||0)+d[1],v=p.width,_=p.height,y=jt(n,r,h),b=Si(y,l,c,n),E=b.left,x=b.top,T=b.width,w=b.height,S=xi(y,a,n),A=zt(S,[E,x]),M=[g+A[0]*v/T,m+A[1]*_/w],O=[0,0],R=0;++R<10;){var C=Ft(r,n);s=zt(xi(C,M,n),xi(C,S,n)),O[0]=s[0],O[1]=s[1];var I=Si(jt(n,r,ne(O,n),h),l,c,n),P=I.left-g,N=I.top-m;if(Math.abs(P)<2&&Math.abs(N)<2)break;M[0]-=P,M[1]-=N}return O.map((function(t){return Math.round(t)}))}(t,s[e+1],T,p,Xt(_,v,p));t.matrix=ne(i,p)}v=Xt(v,t.matrix,p)}));var w=!g&&o;m||(m=ee(w?4:3));var S=yi(g&&16===m.length?Ut(m,4,3):m,w);return{rootMatrix:_=Bt(_,p,p),beforeMatrix:y,offsetMatrix:b,allMatrix:v,targetMatrix:m,targetTransform:S,transformOrigin:h,targetOrigin:u,is3d:d}}(t,e,i,n),c=Ai(l.allMatrix,l.transformOrigin,s,o);h=We(We({},l),c);var f=Ai(l.allMatrix,[50,50],100,100);a=Pi([f.pos1,f.pos2],f.direction)}var d=n?4:3;return We({width:s,height:o,rotation:a,rootMatrix:ee(d),beforeMatrix:ee(d),offsetMatrix:ee(d),allMatrix:ee(d),targetMatrix:ee(d),targetTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!!n,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1},h)}function yi(t,e){return void 0===e&&(e=t.length>9),(e?"matrix3d":"matrix")+"("+Wt(t,!e).join(",")+")"}function bi(t){var e=t.clientWidth,i=t.clientHeight;if(!t)return{x:0,y:0,width:0,height:0,clientWidth:e,clientHeight:i};var n=t.viewBox,r=n&&n.baseVal||{x:0,y:0,width:0,height:0};return{x:r.x,y:r.y,width:r.width||e,height:r.height||i,clientWidth:e,clientHeight:i}}function Ei(t,e){var i=bi(t),n=i.width,r=i.height,s=i.clientWidth,o=i.clientHeight,a=s/n,h=o/r,u=t.preserveAspectRatio.baseVal,l=u.align,c=u.meetOrSlice,f=[0,0],d=[a,h],p=[0,0];if(1!==l){var g=(l-2)%3,m=Math.floor((l-2)/3);f[0]=n*g/2,f[1]=r*m/2;var v=2===c?Math.max(h,a):Math.min(a,h);d[0]=v,d[1]=v,p[0]=(s-n)/2*g,p[1]=(o-r)/2*m}var _=ie(d,e);return _[e*(e-1)]=p[0],_[e*(e-1)+1]=p[1],ci(_,e,f)}function xi(t,e,i){return Vt(t,Gt(e,i),i)}function Ti(t,e,i,n){return[[0,0],[e,0],[0,i],[e,i]].map((function(e){return xi(t,e,n)}))}function wi(t){var e=t.map((function(t){return t[0]})),i=t.map((function(t){return t[1]})),n=Math.min.apply(Math,e),r=Math.min.apply(Math,i),s=Math.max.apply(Math,e),o=Math.max.apply(Math,i);return{left:n,top:r,right:s,bottom:o,width:s-n,height:o-r}}function Si(t,e,i,n){return wi(Ti(t,e,i,n))}function Ai(t,e,i,n){var r=16===t.length?4:3,s=Ti(t,i,n,r),o=s[0],a=o[0],h=o[1],u=s[1],l=u[0],c=u[1],f=s[2],d=f[0],p=f[1],g=s[3],m=g[0],v=g[1],_=xi(t,e,r),y=_[0],b=_[1],E=Math.min(a,l,d,m),x=Math.min(h,c,p,v),T=Math.max(a,l,d,m);return a=a-E||0,{left:E,top:x,right:T,bottom:Math.max(h,c,p,v),origin:[y=y-E||0,b=b-x||0],pos1:[a,h=h-x||0],pos2:[l=l-E||0,c=c-x||0],pos3:[d=d-E||0,p=p-x||0],pos4:[m=m-E||0,v=v-x||0],direction:U(s)}}function Mi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Oi(t,e){return Mi([e[0]-t[0],e[1]-t[1]])}function Ri(t,e,i,n){void 0===i&&(i=1),void 0===n&&(n=G(t,e));var r=Oi(t,e);return{transform:"translateY(-50%) translate("+t[0]+"px, "+t[1]+"px) rotate("+n+"rad) scaleY("+i+")",width:r+"px"}}function Ci(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var r=i.length,s=i.reduce((function(t,e){return t+e[0]}),0)/r,o=i.reduce((function(t,e){return t+e[1]}),0)/r;return{transform:"translateZ(0px) translate("+s+"px, "+o+"px) rotate("+t+"rad) scale("+e+")"}}function Ii(t,e,i,n){void 0===e&&(e=Xi(t)),void 0===n&&(n=i||"border-box"===e.boxSizing);var r=t.offsetWidth,s=t.offsetHeight,o=!y(r);if((i||n)&&o)return[r,s];if(!o&&"svg"!==t.tagName.toLowerCase()){var a=t.getBBox();return[a.width,a.height]}return r=t.clientWidth,s=t.clientHeight,i||n?[r+(parseFloat(e.borderLeftWidth)||0)+(parseFloat(e.borderRightWidth)||0),s+(parseFloat(e.borderTopWidth)||0)+(parseFloat(e.borderBottomWidth)||0)]:[r-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0),s-(parseFloat(e.paddingTop)||0)-(parseFloat(e.paddingBottom)||0)]}function Pi(t,e){return G(e>0?t[0]:t[1],e>0?t[1]:t[0])}function Ni(t,e,i,n,r){var s=1,o=[0,0],a={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},h={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},u={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},l=_i(e,i,r,!1);if(e){var c=l.is3d?4:3,f=Ai(l.offsetMatrix,Ht(l.transformOrigin,function(t,e){void 0===e&&(e=Math.sqrt(t.length));for(var i=[],n=t[e*e-1],r=0;r<e-1;++r)i[r]=t[e*(e-1)+r]/n;return i[e-1]=0,i}(l.targetMatrix,c)),l.width,l.height);s=f.direction,o=Ht(f.origin,[f.left-l.left,f.top-l.top]),a=Di(e),h=Di(di(n,n,!0).offsetParent||document.body,!0),t&&(u=Di(t))}return We({targetClientRect:a,containerClientRect:h,moveableClientRect:u,beforeDirection:s,beforeOrigin:o,originalBeforeOrigin:o,target:e},l)}function Di(t,e){var i=0,n=0,r=0,s=0;if(t===document.body||t===document.documentElement)r=window.innerWidth,s=window.innerHeight,i=-(document.documentElement.scrollLeft||document.body.scrollLeft),n=-(document.documentElement.scrollTop||document.body.scrollTop);else{var o=t.getBoundingClientRect();i=o.left,n=o.top,r=o.width,s=o.height}var a={left:i,right:i+r,top:n,bottom:n+s,width:r,height:s};return e&&(a.clientLeft=t.clientLeft,a.clientTop=t.clientTop,a.clientWidth=t.clientWidth,a.clientHeight=t.clientHeight,a.scrollWidth=t.scrollWidth,a.scrollHeight=t.scrollHeight,a.overflow="visible"!==Xi(t).overflow),a}function Li(t){if(t){var e=t.getAttribute("data-direction");if(e){var i=[0,0];return e.indexOf("w")>-1&&(i[0]=-1),e.indexOf("e")>-1&&(i[0]=1),e.indexOf("n")>-1&&(i[1]=-1),e.indexOf("s")>-1&&(i[1]=1),i}}}function ki(t,e){return[Ht(e,t[0]),Ht(e,t[1]),Ht(e,t[2]),Ht(e,t[3])]}function Bi(t){var e=t.left,i=t.top;return ki([t.pos1,t.pos2,t.pos3,t.pos4],[e,i])}function Fi(t,e){t[e]&&(t[e].unset(),t[e]=null)}function Gi(t,e,i){var n=e.datas;n.datas||(n.datas={});var r=We(We({},i),{target:t.state.target,clientX:e.clientX,clientY:e.clientY,inputEvent:e.inputEvent,currentTarget:t,moveable:t,datas:n.datas});return n.isStartEvent?n.lastEvent=r:n.isStartEvent=!0,r}function Ui(t,e,i){var n=e.datas,r="isDrag"in i?i.isDrag:e.isDrag;return n.datas||(n.datas={}),We(We({isDrag:r},i),{moveable:t,target:t.state.target,clientX:e.clientX,clientY:e.clientY,inputEvent:e.inputEvent,currentTarget:t,lastEvent:n.lastEvent,isDouble:e.isDouble,datas:n.datas})}function ji(t,e,i,n){return t.triggerEvent(e,i,n)}function Xi(t,e){return window.getComputedStyle(t,e)}function Hi(t,e,i){var n={},r={};return t.filter((function(t){var s=t.name;if(n[s]||!e.some((function(e){return t[e]})))return!1;if(!i&&t.ableGroup){if(r[t.ableGroup])return!1;r[t.ableGroup]=!0}return n[s]=!0,!0}))}function zi(t,e){return t===e||null==t&&null==e}function Wi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.sort((function(t,e){return Math.abs(e)-Math.abs(t)})),t[0]}function Vi(t,e,i){return Vt(Ft(t,i),Gt(e,i),i)}function Yi(t,e){var i,n=t.is3d?4:3;return i=Vi(t.rootMatrix,[e.distX,e.distY],n),e.distX=i[0],e.distY=i[1],e}function $i(t,e,i,n,r){return zt(xi(t,Ht(i,e),r),n)}function qi(t,e,i){return i?t/e*100+"%":t+"px"}function Zi(t){return Math.abs(t)<=ii?0:t}function Ki(t,e){return e.isRequest?("resizable"===e.requestAble||"scalable"===e.requestAble)&&e.parentDirection:z(e.inputEvent.target,li("direction"))}function Ji(t){var e={};for(var i in t)e[t[i]]=i;return e}function Qi(t,e){return t?x(t)?e?document.querySelector(t):t:T(t)?t():"current"in t?t.current:t:null}function tn(t,e){return t?((i=t)&&b(i)&&(E(i)||"length"in i)?[].slice.call(t):[t]).reduce((function(t,i){return x(i)&&e?Ve(t,[].slice.call(document.querySelectorAll(i))):(t.push(Qi(i,e)),t)}),[]):[];var i}function en(t,e){var i=t.rootMatrix,n=t.is3d,r=Ft(i,n?4:3);return n||(r=Ut(r,3,4)),r[12]=0,r[13]=0,r[14]=0,function(t,e){var i=Vt(t,[e[0],e[1]||0,e[2]||0,1],4),n=i[3]||1;return[i[0]/n,i[1]/n,i[2]/n]}(r,e)}var nn=Ye("pinchable",{events:{onPinchStart:"pinchStart",onPinch:"pinch",onPinchEnd:"pinchEnd",onPinchGroupStart:"pinchGroupStart",onPinchGroup:"pinchGroup",onPinchGroupEnd:"pinchGroupEnd"},dragStart:function(){return!0},pinchStart:function(t,e){var i=e.datas,n=e.targets,r=e.angle,s=e.originalDatas,o=t.props,a=o.pinchable,h=o.ables;if(!a)return!1;var u="onPinch"+(n?"Group":"")+"Start",l="drag"+(n?"Group":"")+"ControlStart",c=(!0===a?t.controlAbles:h.filter((function(t){return a.indexOf(t.name)>-1}))).filter((function(t){return t.canPinch&&t[l]})),f=Gi(t,e,{});n&&(f.targets=n);var d=ji(t,u,f);i.isPinch=!1!==d,i.ables=c;var p=i.isPinch;return!!p&&(c.forEach((function(i){if(s[i.name]=s[i.name]||{},i[l]){var n=We(We({},e),{datas:s[i.name],parentRotate:r,isPinch:!0});i[l](t,n)}})),t.state.snapRenderInfo={request:e.isRequest,direction:[0,0]},p)},pinch:function(t,e){var i=e.datas,n=e.scale,r=e.distance,s=e.originalDatas,o=e.inputEvent,a=e.targets,h=e.angle;if(i.isPinch){var u=r*(1-1/n),l=Gi(t,e,{});a&&(l.targets=a),ji(t,"onPinch"+(a?"Group":""),l);var c=i.ables,f="drag"+(a?"Group":"")+"Control";return c.forEach((function(i){i[f]&&i[f](t,We(We({},e),{datas:s[i.name],inputEvent:o,parentDistance:u,parentRotate:h,isPinch:!0}))})),l}},pinchEnd:function(t,e){var i=e.datas,n=e.isPinch,r=e.inputEvent,s=e.targets,o=e.originalDatas;if(i.isPinch){var a="onPinch"+(s?"Group":"")+"End",h=Ui(t,e,{isDrag:n});s&&(h.targets=s),ji(t,a,h);var u=i.ables,l="drag"+(s?"Group":"")+"ControlEnd";return u.forEach((function(i){i[l]&&i[l](t,We(We({},e),{isDrag:n,datas:o[i.name],inputEvent:r,isPinch:!0}))})),n}},pinchGroupStart:function(t,e){return this.pinchStart(t,We(We({},e),{targets:t.props.targets}))},pinchGroup:function(t,e){return this.pinch(t,We(We({},e),{targets:t.props.targets}))},pinchGroupEnd:function(t,e){return this.pinchEnd(t,We(We({},e),{targets:t.props.targets}))}});function rn(t,e,i,n,r){var s=e.gesto.move(i,t.inputEvent),o=s.originalDatas||s.datas,a=o.draggable||(o.draggable={});return We(We({},r?Yi(e,s):s),{isDrag:!0,isPinch:!!n,parentEvent:!0,datas:a,originalDatas:t.originalDatas})}var sn=function(){function t(){this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}}}var e=t.prototype;return e.dragStart=function(t,e){this.isDrag=!1,this.isFlag=!1;var i=e.originalDatas;return this.datas=i,i.draggable||(i.draggable={}),We(We({},this.move(t,e.inputEvent)),{type:"dragstart"})},e.drag=function(t,e){return this.move([t[0]-this.prevX,t[1]-this.prevY],e)},e.move=function(t,e){var i,n;return this.isFlag?(i=this.prevX+t[0],n=this.prevY+t[1],this.isDrag=!0):(this.prevX=t[0],this.prevY=t[1],this.startX=t[0],this.startY=t[1],i=t[0],n=t[1],this.isFlag=!0),this.prevX=i,this.prevY=n,{type:"drag",clientX:i,clientY:n,inputEvent:e,isDrag:this.isDrag,distX:i-this.startX,distY:n-this.startY,deltaX:t[0],deltaY:t[1],datas:this.datas.draggable,originalDatas:this.datas,parentEvent:!0,parentGesto:this}},t}();function on(t,e,i){var n=i.originalDatas;n.groupable=n.groupable||{};var r=n.groupable;r.childDatas=r.childDatas||[];var s=r.childDatas;return t.moveables.map((function(t,n){return s[n]=s[n]||{},s[n][e]=s[n][e]||{},We(We({},i),{datas:s[n][e],originalDatas:s[n]})}))}function an(t,e,i,n,r,s){var o=!!i.match(/Start$/g),a=!!i.match(/End$/g),h=r.isPinch,u=r.datas,l=on(t,e.name,r),c=t.moveables,f=l.map((function(t,r){var l=c[r],f=t;o?f=(new sn).dragStart(n,t):(l.state.gesto||(l.state.gesto=u.childGestos[r]),f=rn(t,l.state,n,h,s));var d=e[i](l,We(We({},f),{parentFlag:!0}));return a&&(l.state.gesto=null),d}));return o&&(u.childGestos=c.map((function(t){return t.state.gesto}))),f}function hn(t,e,i,n,r,s){void 0===r&&(r=function(t,e){return e});var o=!!i.match(/End$/g),a=on(t,e.name,n),h=t.moveables;return a.map((function(t,n){var a,u=h[n];a=r(u,t);var l=e[i](u,We(We({},a),{parentFlag:!0}));return l&&s&&s(u,t,l,n),o&&(u.state.gesto=null),l}))}function un(t,e){var i=e.clientX,n=e.clientY,r=e.datas,s=t.state,o=s.moveableClientRect,a=s.rootMatrix,h=s.is3d,u=s.pos1,l=zt(Vi(a,[i-o.left,n-o.top],h?4:3),u),c=gn({datas:r,distX:l[0],distY:l[1]});return[c[0],c[1]]}function ln(t,e){var i=e.datas,n=t.state,r=n.allMatrix,s=n.beforeMatrix,o=n.is3d,a=n.left,h=n.top,u=n.origin,l=n.offsetMatrix,c=n.targetMatrix,f=n.transformOrigin,d=o?4:3;i.is3d=o,i.matrix=r,i.targetMatrix=c,i.beforeMatrix=s,i.offsetMatrix=l,i.transformOrigin=f,i.inverseMatrix=Ft(r,d),i.inverseBeforeMatrix=Ft(s,d),i.absoluteOrigin=Gt(Ht([a,h],u),d),i.startDragBeforeDist=Vt(i.inverseBeforeMatrix,i.absoluteOrigin,d),i.startDragDist=Vt(i.inverseMatrix,i.absoluteOrigin,d)}function cn(t,e){var i=t.datas,n=t.originalDatas.beforeRenderable,r=i.transformIndex,s=n.nextTransforms,o=n.nextTransformAppendedIndexes,a=-1===r?s.length:r+o.filter((function(t){return t<r})).length,h=function(t,e){var i=t.slice(0,e<0?void 0:e),n=t.slice(0,e<0?void 0:e+1),r=t[e]||"",s=e<0?[]:t.slice(e),o=e<0?[]:t.slice(e+1),a=oe(i),h=oe(n),u=oe([r]),l=oe(s),c=oe(o),f=se(a),d=se(h),p=se(l),g=se(c),m=Xt(f,p,4);return{transforms:t,beforeFunctionMatrix:f,beforeFunctionMatrix2:d,targetFunctionMatrix:se(u),afterFunctionMatrix:p,afterFunctionMatrix2:g,allFunctionMatrix:m,beforeFunctions:a,beforeFunctions2:h,targetFunction:u[0],afterFunctions:l,afterFunctions2:c,beforeFunctionTexts:i,beforeFunctionTexts2:n,targetFunctionText:r,afterFunctionTexts:s,afterFunctionTexts2:o}}(s,a),u=h.targetFunction,l="rotate"===e?"rotateZ":e;i.beforeFunctionTexts=h.beforeFunctionTexts,i.afterFunctionTexts=h.afterFunctionTexts,i.beforeTransform=h.beforeFunctionMatrix,i.beforeTransform2=h.beforeFunctionMatrix2,i.targetTansform=h.targetFunctionMatrix,i.afterTransform=h.afterFunctionMatrix,i.afterTransform2=h.afterFunctionMatrix2,i.targetAllTransform=h.allFunctionMatrix,u.functionName===l?(i.afterFunctionTexts.splice(0,1),i.isAppendTransform=!1):(i.isAppendTransform=!0,n.nextTransformAppendedIndexes=Ve(o,[a]))}function fn(t,e,i){return t.beforeFunctionTexts.join(" ")+" "+(t.isAppendTransform?i:e)+" "+t.afterFunctionTexts.join(" ")}function dn(t,e,i){var n=t.beforeTransform,r=t.afterTransform,s=t.beforeTransform2,o=t.afterTransform2,a=t.targetAllTransform,h=i?Xt(a,e,4):Xt(e,a,4),u=Xt(Ft(i?s:n,4),h,4);return Xt(u,Ft(i?o:r,4),4)}function pn(t){var e=t.datas,i=t.distX,n=t.distY,r=e.inverseBeforeMatrix,s=e.is3d,o=e.startDragBeforeDist,a=s?4:3;return zt(Vt(r,Ht(e.absoluteOrigin,[i,n]),a),o)}function gn(t,e){var i=t.datas,n=t.distX,r=t.distY,s=i.inverseBeforeMatrix,o=i.inverseMatrix,a=i.is3d,h=i.startDragBeforeDist,u=i.startDragDist,l=a?4:3;return zt(Vt(e?s:o,Ht(i.absoluteOrigin,[n,r]),l),e?h:u)}function mn(t){var e=[];return t[1]>=0&&(t[0]>=0&&e.push(3),t[0]<=0&&e.push(2)),t[1]<=0&&(t[0]>=0&&e.push(1),t[0]<=0&&e.push(0)),e}function vn(t,e){return mn(e).map((function(e){return t[e]}))}function _n(t,e){var i=vn(t,e);return[F(i.map((function(t){return t[0]}))),F(i.map((function(t){return t[1]})))]}function yn(t,e,i,n){return Xt(t,ci(e,n,i),n)}function bn(t){var e=t.originalDatas.beforeRenderable;return{setTransform:function(i,n){void 0===n&&(n=-1),e.startTransforms=E(i)?i:M(i),xn(t,n)},setTransformIndex:function(e){xn(t,e)}}}function En(t,e){xn(t,N(t.originalDatas.beforeRenderable.startTransforms,(function(t){return 0===t.indexOf(e+"(")})))}function xn(t,e){var i=t.originalDatas.beforeRenderable,n=t.datas;if(n.transformIndex=e,-1!==e){var r=i.startTransforms[e];if(r){var s=oe([r]);n.startValue=s[0].functionValue}}}function Tn(t,e){t.originalDatas.beforeRenderable.nextTransforms=M(e)}function wn(t,e,i,n,r){return Tn(r,e),{transform:e,drag:xr.drag(t,rn(r,t.state,i,n,!1))}}function Sn(t,e,i,n,r){var s=t.state,o=s.left,a=s.top,h=t.props.groupable,u=function(t,e,i){var n=t.transformOrigin,r=t.offsetMatrix,s=t.is3d,o=e.beforeTransform,a=e.afterTransform,h=s?4:3;return yn(r,Ut(Xt(Xt(o,function(t){return se(oe(t))}([i]),4),a,4),4,h),n,h)}(t.state,r,e),l=h?o:0,c=h?a:0,f=zt(n,Mn(t,i,u));return zt(f,[l,c])}function An(t){var e=t.state,i=e.width,n=e.height,r=e.transformOrigin;return[r[0]/(i/2)-1,r[1]/(n/2)-1]}function Mn(t,e,i){void 0===i&&(i=t.state.allMatrix);var n=t.state,r=n.width,s=n.height,o=n.is3d?4:3;return xi(i,[r/2*(1+e[0]),s/2*(1+e[1])],o)}function On(t,e){return _n(Bi(t.state),e)}var Rn=["left","right","center"],Cn=["top","bottom","middle"],In={start:"left",end:"right",center:"center"},Pn={start:"top",end:"bottom",center:"middle"};function Nn(t,e){var i=t.props,n=i.snappable,r=i.bounds,s=i.innerBounds,o=i.verticalGuidelines,a=i.horizontalGuidelines,h=i.snapGridWidth,u=i.snapGridHeight,l=t.state,c=l.guidelines,f=l.enableSnap;return!(!n||!f||e&&!0!==n&&n.indexOf(e)<0||!(h||u||r||s||c&&c.length||o&&o.length||a&&a.length))}function Dn(t){return!1===t?{}:!0!==t&&t?t:{left:!0,right:!0,top:!0,bottom:!0}}function Ln(t,e){var i=function(t,e){var i=Dn(t),n={};for(var r in i)r in e&&i[r]&&(n[r]=e[r]);return n}(t,e),n=Cn.filter((function(t){return t in i})),r=Rn.filter((function(t){return t in i}));return{horizontal:n.map((function(t){return i[t]})),vertical:r.map((function(t){return i[t]}))}}function kn(t,e,i,n,r,s,o){void 0===r&&(r=0),void 0===s&&(s=0),void 0===o&&(o={left:0,top:0,right:0,bottom:0});var a=[],h=o.left,u=o.top,l=o.bottom,c=i+o.right-h,f=n+l-u;return t&&t.forEach((function(t){a.push({type:"horizontal",pos:[h,X(t-s+u,.1)],size:c})})),e&&e.forEach((function(t){a.push({type:"vertical",pos:[X(t-r+h,.1),u],size:f})})),a}function Bn(t){var e=t.state,i=t.props.elementGuidelines,n=void 0===i?[]:i;if(!n.length)return e.elementRects=[],[];var r=(e.elementRects||[]).filter((function(t){return!t.refresh})),s=n.map((function(t){return b(t)&&"element"in t?t:{element:Qi(t,!0)}})).filter((function(t){return t.element})),o=f(r.map((function(t){return t.element})),s.map((function(t){return t.element})),ue),a=o.maintained,h=o.added,u=[];a.forEach((function(t){var e=t[0],i=t[1];u[i]=r[e]})),function(t,e){if(!e.length)return[];var i=t.state,n=i.containerClientRect,r=i.targetClientRect,s=r.top,o=r.left,a=i.rootMatrix,h=i.is3d?4:3,u=function(t,e,i){var n=xi(t,[e.clientLeft,e.clientTop],i);return[e.left+n[0],e.top+n[1]]}(a,n,h),l=u[0],c=u[1],f=de(Bi(i)),d=zt([f.minX,f.minY],Vi(a,[o-l,s-c],h)).map((function(t){return e=t,Math.round(e%1==-.5?e-1:e);var e})),p=d[0],g=d[1];return e.map((function(t){var e=t.element.getBoundingClientRect(),i=e.left-l,n=e.top-c,r=n+e.height,s=i+e.width,o=Vi(a,[i,n],h),u=o[0],f=o[1],d=Vi(a,[s,r],h),m=d[0],v=d[1];return We(We({},t),{rect:{left:u+p,right:m+p,top:f+g,bottom:v+g,center:(u+m)/2+p,middle:(f+v)/2+g}})}))}(t,h.map((function(t){return s[t]}))).map((function(t,e){u[h[e]]=t})),e.elementRects=u;var l=Dn(t.props.elementSnapDirections),c=[];return u.forEach((function(t){var e=t.element,i=t.top,n=void 0===i?l.top:i,r=t.left,s=void 0===r?l.left:r,o=t.right,a=void 0===o?l.right:o,h=t.bottom,u=void 0===h?l.bottom:h,f=t.center,d=void 0===f?l.center:f,p=t.middle,g=void 0===p?l.middle:p,m=t.className,v=t.rect,_=Ln({top:n,right:a,left:s,bottom:u,center:d,middle:g},v),y=_.horizontal,b=_.vertical,E=v.top,x=v.left,T=v.right-x,w=v.bottom-E,S=[T,w];b.forEach((function(i){c.push({type:"vertical",element:e,pos:[X(i,.1),E],size:w,sizes:S,className:m,elementRect:t})})),y.forEach((function(i){c.push({type:"horizontal",element:e,pos:[x,X(i,.1)],size:T,sizes:S,className:m,elementRect:t})}))})),c}function Fn(t){var e=t.state,i=e.snapOffset,n=e.containerClientRect,r=n.overflow,s=n.scrollHeight,o=n.scrollWidth,a=n.clientHeight,h=n.clientWidth,u=n.clientLeft,l=n.clientTop,c=t.props,f=c.snapGap,d=void 0===f||f,p=c.verticalGuidelines,g=c.horizontalGuidelines,m=c.snapThreshold,v=void 0===m?5:m,_=c.snapGridWidth,y=void 0===_?0:_,b=c.snapGridHeight,E=void 0===b?0:b,x=Ve(Bn(t));if(d){var T=wi(Bi(t.state)),w=T.top,S=T.left,A=T.bottom,M=T.right;x.push.apply(x,function(t,e,i){var n=t.state.elementRects,r=[];return[["vertical",In,Pn],["horizontal",Pn,In]].forEach((function(t){var s=t[0],o=t[1],a=t[2],h=e[o.start],u=e[o.end],l=e[o.center],c=e[a.start],f=e[a.end];function d(t){var e=t.rect;return e[o.end]<h+i?h-e[o.end]:u-i<e[o.start]?e[o.start]-u:-1}var p=n.filter((function(t){var e=t.rect;return!(e[a.start]>f||e[a.end]<c)&&d(t)>0})).sort((function(t,e){return d(t)-d(e)})),g=[];p.forEach((function(t){p.forEach((function(e){if(t!==e){var i=t.rect,n=e.rect,r=i[a.start],s=i[a.end],o=n[a.start];r>n[a.end]||o>s||g.push([t,e])}}))})),g.forEach((function(t){var e=t[0],n=t[1],a=e.rect,c=n.rect,f=a[o.start],d=a[o.end],p=c[o.start],g=c[o.end],m=0,v=0,_=!1,y=!1,b=!1;if(d<=h&&u<=p){if(y=!0,v=d+(m=(p-d-(u-h))/2)+(u-h)/2,Math.abs(v-l)>i)return}else if(d<p&&g<h+i){if(_=!0,v=g+(m=p-d),Math.abs(v-h)>i)return}else{if(!(d<p&&u-i<f))return;if(b=!0,v=f-(m=p-d),Math.abs(v-u)>i)return}m&&r.push({type:s,pos:"vertical"===s?[v,0]:[0,v],element:n.element,size:0,className:n.className,isStart:_,isCenter:y,isEnd:b,gap:m,hide:!0,gapRects:[e,n]})}))})),r}(t,{top:w,left:S,bottom:A,right:M,center:(S+M)/2,middle:(w+A)/2},v))}return x.push.apply(x,function(t,e,i,n,r,s){void 0===r&&(r=0),void 0===s&&(s=0);var o=[];if(e)for(var a=0;a<=n;a+=e)o.push({type:"horizontal",pos:[0,X(a-s,.1)],size:i,hide:!0});if(t)for(a=0;a<=i;a+=t)o.push({type:"vertical",pos:[X(a-r,.1),0],size:n,hide:!0});return o}(y,E,r?o:h,r?s:a,u,l)),x.push.apply(x,kn(g||!1,p||!1,r?o:h,r?s:a,u,l,i)),x}function Gn(t,e,i,n){var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=t.length-1,n=0;n<i;++n){var r=t[n];if(!y(r))return r}return t[i]}(n,t.props.snapThreshold,5);return Un(t.state.guidelines,e,i,r)}function Un(t,e,i,n){return{vertical:Hn(t,"vertical",e,n),horizontal:Hn(t,"horizontal",i,n)}}function jn(t,e,i){var n=Ln(t.props.snapDirections,e);return Gn(t,n.vertical,n.horizontal,i)}function Xn(t){var e=t.isSnap;if(!e)return{isSnap:!1,offset:0,dist:-1,pos:0,guideline:null};var i=t.posInfos[0],n=i.guidelineInfos[0],r=n.offset,s=n.dist,o=n.guideline;return{isSnap:e,offset:r,dist:s,pos:i.pos,guideline:o}}function Hn(t,e,i,n){if(!t||!t.length)return{isSnap:!1,index:-1,posInfos:[]};var r="vertical"===e?0:1,s=i.map((function(i,s){var o=t.map((function(t){var e=t.pos,n=i-e[r];return{offset:n,dist:Math.abs(n),guideline:t}})).filter((function(t){var i=t.guideline,r=t.dist;return!(i.type!==e||r>n)})).sort((function(t,e){return t.dist-e.dist}));return{pos:i,index:s,guidelineInfos:o}})).filter((function(t){return t.guidelineInfos.length>0})).sort((function(t,e){return t.guidelineInfos[0].dist-e.guidelineInfos[0].dist})),o=s.length>0;return{isSnap:o,index:o?s[0].index:-1,posInfos:s}}function zn(t,e){var i=Math.abs(t.offset),n=Math.abs(e.offset);return t.isBound&&e.isBound?n-i:t.isBound?-1:e.isBound?1:t.isSnap&&e.isSnap?n-i:t.isSnap?-1:e.isSnap||i<ii?1:n<ii?-1:i-n}function Wn(t,e){return t.slice().sort((function(t,i){var n=t.sign[e],r=i.sign[e],s=t.offset[e],o=i.offset[e];return n?r?zn({isBound:t.isBound,isSnap:t.isSnap,offset:s},{isBound:i.isBound,isSnap:i.isSnap,offset:o}):-1:1}))[0]}function Vn(t,e){var i=F([e[0][0],e[1][0]]),n=F([e[0][1],e[1][1]]);return{vertical:i<=t[0],horizontal:n<=t[1]}}function Yn(t,e){var i,n,r=e[0],s=e[1],o=s[0]-r[0],a=s[1]-r[1];return Math.abs(o)<ii&&(o=0),Math.abs(a)<ii&&(a=0),o?a?(i=a/o*(t[0]-r[0])+r[1],n=t[1]):(i=r[1],n=t[1]):(i=r[0],n=t[0]),i-n}function $n(t,e,i){void 0===i&&(i=ii);var n=Yn(t[0],e)<=0;return t.slice(1).every((function(t){var r=Yn(t,e);return r<=0===n||Math.abs(r)<=i}))}function qn(t,e,i,n,r){return void 0===r&&(r=0),n&&e-r<=t||!n&&t<=i+r?{isBound:!0,offset:n?e-t:i-t}:{isBound:!1,offset:0}}function Zn(t,e,i,n,r){var s,o=t[0],a=t[1],h=e[0],u=e[1],l=Zi(a[1]-o[1]),c=Zi(a[0]-o[0]),f=Zi(u[1]-h[1]);if(!Zi(u[0]-h[0])){if(r&&!l)return{isBound:!1,offset:0};if(c)return qn(l/c*(h[0]-o[0])+o[1],h[1],u[1],i,n);var d=h[0]-o[0];return{isBound:s=Math.abs(d)<=(n||0),offset:s?d:0}}return f||r&&!c?{isBound:!1,offset:0}:l?qn((h[1]-o[1])/(l/c)+o[0],h[0],u[0],i,n):(d=h[1]-o[1],{isBound:s=Math.abs(d)<=(n||0),offset:s?d:0})}function Kn(t,e,i,n){return e.map((function(e){var r=e[0],s=e[1],o=e[2],a=function(t,e,i){var n=t.props.innerBounds;if(!n)return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var r=n.left,s=n.top,o=n.width,a=n.height,h=[[r,s],[r,s+a]],u=[[r,s],[r+o,s]],l=[[r+o,s],[r+o,s+a]],c=[[r,s+a],[r+o,s+a]],f=Vn(i,e),d=f.horizontal,p=f.vertical;if($n([i,[r,s],[r+o,s],[r,s+a],[r+o,s+a]],e))return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var g=Zn(e,u,p),m=Zn(e,c,p),v=Zn(e,h,d),_=Zn(e,l,d),y=g.isBound&&m.isBound,b=g.isBound||m.isBound,E=v.isBound&&_.isBound,x=v.isBound||_.isBound,T=Wi(g.offset,m.offset),w=Wi(v.offset,_.offset),S=[0,0],A=!1,M=!1;return Math.abs(w)<Math.abs(T)?(S=[T,0],A=b,M=y):(S=[0,w],A=x,M=E),{isAllBound:M,isVerticalBound:b,isHorizontalBound:x,isBound:A,offset:S}}(t,[s,o],i),h=a.isBound,u=a.offset,l=a.isVerticalBound,c=a.isHorizontalBound,f=gn({datas:n,distX:u[0],distY:u[1]}).map((function(t,e){return t*(r[e]?2/r[e]:0)}));return{sign:r,isBound:h,isVerticalBound:l,isHorizontalBound:c,isSnap:!1,offset:f}}))}function Jn(t,e,i){return function(t,e){var i=[],n=t[0],r=t[1];return n&&r?i.push([[0,2*r],t,[-n,r]],[[2*n,0],t,[n,-r]]):n?(i.push([[2*n,0],[n,1],[n,-1]]),e&&i.push([[0,-1],[n,-1],[-n,-1]],[[0,1],[n,1],[-n,1]])):r?(i.push([[0,2*r],[1,r],[-1,r]]),e&&i.push([[-1,0],[-1,r],[-1,-r]],[[1,0],[1,r],[1,-r]])):i.push([[-1,0],[-1,-1],[-1,1]],[[1,0],[1,-1],[1,1]],[[0,-1],[-1,-1],[1,-1]],[[0,1],[-1,1],[1,1]]),i}(e,i).map((function(e){var i=e[0],n=e[1],r=e[2];return[i,_n(t,n),_n(t,r)]}))}function Qn(t,e,i,n){var r=n?t.map((function(t){return Kt(t,n)})):t,s=Ve([i],e);return[[r[0],r[1]],[r[1],r[3]],[r[3],r[2]],[r[2],r[0]]].some((function(t){return!$n(s,t)}))}function tr(t,e,i){var n=t||{},r=n.position,s=void 0===r?"client":r,o=n.left,a=void 0===o?-1/0:o,h=n.top,u=void 0===h?-1/0:h,l=n.right,c=void 0===l?1/0:l,f=n.bottom,d={position:s,left:a,top:u,right:c,bottom:void 0===f?1/0:f};return{vertical:ir(d,e,!0),horizontal:ir(d,i,!1)}}function er(t,e){var i=t.state,n=i.containerClientRect,r=n.clientHeight,s=n.clientWidth,o=n.clientLeft,a=n.clientTop,h=i.snapOffset,u=h.left,l=h.top,c=h.right,f=h.bottom,d=e||t.props.bounds||{},p="css"===(d.position||"client"),g=d.left,m=void 0===g?-1/0:g,v=d.top,_=void 0===v?-1/0:v,y=d.right,b=void 0===y?p?-1/0:1/0:y,E=d.bottom,x=void 0===E?p?-1/0:1/0:E;return p&&(b=s+c-u-b,x=r+f-l-x),{left:m+u-o,right:b+u-o,top:_+l-a,bottom:x+l-a}}function ir(t,e,i){var n=t[i?"left":"top"],r=t[i?"right":"bottom"],s=Math.min.apply(Math,e),o=Math.max.apply(Math,e),a=[];return n+1>s&&a.push({isBound:!0,offset:s-n,pos:n}),r-1<o&&a.push({isBound:!0,offset:o-r,pos:r}),a.length||a.push({isBound:!1,offset:0,pos:0}),a.sort((function(t,e){return Math.abs(e.offset)-Math.abs(t.offset)}))}function nr(t,e,i){return(i?t.map((function(t){return Kt(t,i)})):t).some((function(t){return t[0]<e.left&&Math.abs(t[0]-e.left)>.1||t[0]>e.right&&Math.abs(t[0]-e.right)>.1||t[1]<e.top&&Math.abs(t[1]-e.top)>.1||t[1]>e.bottom&&Math.abs(t[1]-e.bottom)>.1}))}function rr(t,e){return function(t,e){var i,n=t.direction,r=t.classNames,s=t.size,o=t.pos,a=t.zoom,h=t.key,u="horizontal"===n,l=u?"Y":"X";return e.createElement("div",{key:h,className:r.join(" "),style:(i={},i[u?"width":"height"]=""+s,i.transform="translate("+o[0]+", "+o[1]+") translate"+l+"(-50%) scale"+l+"("+a+")",i)})}(We(We({},t),{classNames:Ve([li("line","guideline",t.direction)],t.classNames).filter((function(t){return t})),size:t.size||t.sizeValue+"px",pos:t.pos||t.posValue.map((function(t){return X(t,.1)+"px"}))}),e)}function sr(t,e,i,n,r,s,o,a){var h=t.props.zoom;return i.map((function(t,i){var u=t.type,l=t.pos,c=[0,0];return c[o]=n,c[o?0:1]=-r+l,rr({key:e+"TargetGuideline"+i,classNames:[li("target","bold",u)],posValue:c,sizeValue:s,zoom:h,direction:e},a)}))}function or(t,e,i,n,r,s){var o=t.props,a=o.zoom,h=o.isDisplayInnerSnapDigit,u="horizontal"===e?In:Pn,l=r[u.start],c=r[u.end];return i.filter((function(t){var e=t.hide,i=t.elementRect;if(e)return!1;if(h&&i){var n=i.rect;if(n[u.start]<=l&&c<=n[u.end])return!1}return!0})).map((function(t,i){var r=t.pos,o=t.size,h=t.element,u=[-n[0]+r[0],-n[1]+r[1]];return rr({key:e+"-default-guideline-"+i,classNames:h?[li("bold")]:[],direction:e,posValue:u,sizeValue:o,zoom:a},s)}))}function ar(t,e,i,n,r,s,o,a){var h,u=t.props,l=u.snapDigit,c=void 0===l?0:l,f=u.isDisplaySnapDigit,d=void 0===f||f,p=u.snapDistFormat,g=void 0===p?function(t){return t}:p,m=u.zoom,v="horizontal"===e?"X":"Y",_="vertical"===e?"height":"width",y=Math.abs(r),b=d?parseFloat(y.toFixed(c)):0;return a.createElement("div",{key:e+"-"+i+"-guideline-"+n,className:li("guideline-group",e),style:(h={left:s[0]+"px",top:s[1]+"px"},h[_]=y+"px",h)},rr({direction:e,classNames:[li(i),o],size:"100%",posValue:[0,0],sizeValue:y,zoom:m},a),a.createElement("div",{className:li("size-value","gap"),style:{transform:"translate"+v+"(-50%) scale("+m+")"}},b>0?g(b):""))}function hr(t,e,i,n,r){var s=function(t,e,i,n){var r=e[0]-t[0],s=e[1]-t[1];if(Math.abs(r)<v&&(r=0),Math.abs(s)<v&&(s=0),!r)return n?[0,0]:[0,i];if(!s)return n?[i,0]:[0,0];var o=s/r,a=t[1]-o*t[0];return n?[i,o*(e[0]+i)+a-e[1]]:[(e[1]+i-a)/o-e[0],i]}(t,e,i,n);if(!s)return{isOutside:!1,offset:[0,0]};var o=j(t,e),a=j(s,t),h=j(s,e),u=a>o||h>o,l=gn({datas:r,distX:s[0],distY:s[1]});return{offset:[l[0],l[1]],isOutside:u}}function ur(t,e){return t.isBound?t.offset:e.isSnap?Xn(e).offset:0}function lr(t,e,i,n,r,s){if(!Nn(t,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var o=ki(s.absolutePoses,[e,i]),a=wi(o),h=a.left,u=a.right,l=a.top,c=a.bottom,f={horizontal:o.map((function(t){return t[1]})),vertical:o.map((function(t){return t[0]}))},d=cr(t,r,Ln(Dn(t.props.snapDirections),{left:h,right:u,top:l,bottom:c,center:(h+u)/2,middle:(l+c)/2}),f),p=d.vertical,g=d.horizontal,m=function(t,e,i){var n,r=Jn(e,[0,0],!1).map((function(t){var e=t[0],i=t[1],n=t[2];return[e.map((function(t){return 2*Math.abs(t)})),i,n]})),s=Kn(t,r,_n(e,[0,0]),i),o=Wn(s,0),a=Wn(s,1),h=0,u=0,l=o.isVerticalBound||a.isVerticalBound,c=o.isHorizontalBound||a.isHorizontalBound;return(l||c)&&(n=function(t,e){var i=t.datas,n=t.distX,r=t.distY,s=(i.beforeMatrix,i.matrix),o=i.is3d,a=(i.startDragBeforeDist,i.startDragDist),h=i.absoluteOrigin,u=o?4:3;return zt(Vt(s,Ht(a,[n,r]),u),h)}({datas:i,distX:-o.offset[0],distY:-a.offset[1]}),h=n[0],u=n[1]),{vertical:{isBound:l,offset:h},horizontal:{isBound:c,offset:u}}}(t,o,s),_=m.vertical,y=m.horizontal,b=p.isSnap,E=g.isSnap,x=p.isBound||_.isBound,T=g.isBound||y.isBound,w=function(t,e,i,n,r){var s=e[0],o=e[1],a=i[0],h=i[1],u=n[0],l=n[1],c=r[0],f=r[1],d=-c,p=-f;if(t&&s&&o){d=0,p=0;var g=[];if(a&&h?g.push([0,f],[c,0]):a?g.push([c,0]):h?g.push([0,f]):u&&l?g.push([0,f],[c,0]):u?g.push([c,0]):l&&g.push([0,f]),g.length){g.sort((function(t,e){return Mi(zt([s,o],t))-Mi(zt([s,o],e))}));var m=g[0];if(m[0]&&Math.abs(s)>v)d=-m[0],p=o*Math.abs(s+d)/Math.abs(s)-o;else if(m[1]&&Math.abs(o)>v){var _=o;p=-m[1],d=s*Math.abs(o+p)/Math.abs(_)-s}if(t&&h&&a)if(Math.abs(d)>v&&Math.abs(d)<Math.abs(c))d*=y=Math.abs(c)/Math.abs(d),p*=y;else if(Math.abs(p)>v&&Math.abs(p)<Math.abs(f)){var y;d*=y=Math.abs(f)/Math.abs(p),p*=y}else d=Wi(-c,d),p=Wi(-f,p)}}else d=s||a?-c:0,p=o||h?-f:0;return[d,p]}(n,[e,i],[x,T],[b,E],[Wi(p.offset,_.offset),Wi(g.offset,y.offset)]);return[{isBound:x,isSnap:b,offset:w[0]},{isBound:T,isSnap:E,offset:w[1]}]}function cr(t,e,i,n){void 0===n&&(n=i);var r=tr(er(t),n.vertical,n.horizontal),s=r.horizontal,o=r.vertical,a=e?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:Gn(t,i.vertical,i.horizontal),h=a.horizontal,u=a.vertical,l=ur(s[0],h),c=ur(o[0],u),f=Math.abs(l),d=Math.abs(c);return{horizontal:{isBound:s[0].isBound,isSnap:h.isSnap,snapIndex:h.index,offset:l,dist:f,bounds:s,snap:h},vertical:{isBound:o[0].isBound,isSnap:u.isSnap,snapIndex:u.index,offset:c,dist:d,bounds:o,snap:u}}}function fr(t,e,i,n,r){var s=tr(e,i,n),o=s.horizontal,a=s.vertical,h=Un(t,i,n,r),u=h.horizontal,l=h.vertical,c=ur(o[0],u),f=ur(a[0],l),d=Math.abs(c),p=Math.abs(f);return{horizontal:{isBound:o[0].isBound,isSnap:u.isSnap,snapIndex:u.index,offset:c,dist:d,bounds:o,snap:u},vertical:{isBound:a[0].isBound,isSnap:l.isSnap,snapIndex:l.index,offset:f,dist:p,bounds:a,snap:l}}}function dr(t,e){return t.isBound?t.offset:e.isSnap?e.offset:0}function pr(t){var e=t.state;if(!e.guidelines||!e.guidelines.length){var i=t.state.container,n=t.props.snapContainer||i,r=e.containerClientRect,s={left:0,top:0,bottom:0,right:0};if(i!==n){var o=Qi(n,!0);if(o){var a=Di(o),h=en(e,[a.left-r.left,a.top-r.top]),u=en(e,[a.right-r.right,a.bottom-r.bottom]);s.left=X(h[0],.1),s.top=X(h[1],.1),s.right=X(u[0],.1),s.bottom=X(u[1],.1)}}e.snapOffset=s,e.guidelines=Fn(t),e.enableSnap=!0}}function gr(t,e,i,n,r,s){var o=Ti(t,e,i,s?4:3),a=function(t,e){return _n(t,e.map((function(t){return-t})))}(o,r);return ki(o,zt(n,a))}function mr(t,e,i,n,r,s){var o=function(t,e){var i=[],n=[-t[0],-t[1]];return t[0]&&t[1]?(i.push([n,[t[0],-t[1]]],[n,[-t[0],t[1]]]),e&&i.push([n,t])):t[0]?e?i.push([n,[n[0],-1]],[n,[n[0],1]],[n,[t[0],-1]],[n,t],[n,[t[0],1]]):i.push([[n[0],-1],[t[0],-1]],[[n[0],0],[t[0],0]],[[n[0],1],[t[0],1]]):t[1]?e?i.push([n,[-1,n[1]]],[n,[1,n[1]]],[n,[-1,t[1]]],[n,[1,t[1]]],[n,t]):i.push([[-1,n[1]],[-1,t[1]]],[[0,n[1]],[0,t[1]]],[[1,n[1]],[1,t[1]]]):i.push([n,[1,0]],[n,[-1,0]],[n,[0,-1]],[n,[0,1]],[[1,0],[1,-1]],[[1,0],[1,1]],[[0,1],[1,1]],[[0,1],[-1,1]],[[-1,0],[-1,-1]],[[-1,0],[-1,1]],[[0,-1],[1,-1]],[[0,-1],[-1,-1]]),i}(i,n),a=Jn(e,i,n),h=Ve(function(t,e,i,n,r,s){return i.map((function(i){var o=i[0],a=i[1],h=_n(e,o),u=_n(e,a),l=n?function(t,e,i,n){var r=function(t,e,i){var n=er(t),r=n.left,s=n.top,o=n.right,a=n.bottom,h=i[0],u=i[1],l=zt(i,e),c=l[0],f=l[1];Math.abs(c)<ii&&(c=0),Math.abs(f)<ii&&(f=0);var d=f>0,p=c>0,g={isBound:!1,offset:0,pos:0},m={isBound:!1,offset:0,pos:0};if(0===c&&0===f)return{vertical:g,horizontal:m};if(0===c)d?a<u&&(m.pos=a,m.offset=u-a):s>u&&(m.pos=s,m.offset=u-s);else if(0===f)p?o<h&&(g.pos=o,g.offset=h-o):r>h&&(g.pos=r,g.offset=h-r);else{var v=f/c,_=i[1]-v*h,y=0,b=0,E=!1;p&&o<=h?(y=v*o+_,b=o,E=!0):!p&&h<=r&&(y=v*r+_,b=r,E=!0),E&&(y<s||y>a)&&(E=!1),E||(d&&a<=u?(b=((y=a)-_)/v,E=!0):!d&&u<=s&&(b=((y=s)-_)/v,E=!0)),E&&(g.isBound=!0,g.pos=b,g.offset=h-b,m.isBound=!0,m.pos=y,m.offset=u-y)}return{vertical:g,horizontal:m}}(t,e,i),s=r.horizontal,o=r.vertical,a=n?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:function(t,e,i){var n=i[0],r=i[1],s=e[0],o=e[1],a=zt(i,e),h=a[0],u=a[1],l=u>0,c=h>0;h=Zi(h),u=Zi(u);var f={isSnap:!1,offset:0,pos:0},d={isSnap:!1,offset:0,pos:0};if(0===h&&0===u)return{vertical:f,horizontal:d};var p=Gn(t,h?[n]:[],u?[r]:[]),g=p.vertical,m=p.horizontal;g.posInfos.filter((function(t){var e=t.pos;return c?e>=s:e<=s})),m.posInfos.filter((function(t){var e=t.pos;return l?e>=o:e<=o})),g.isSnap=g.posInfos.length>0,m.isSnap=m.posInfos.length>0;var v=Xn(g),_=v.isSnap,y=v.guideline,b=Xn(m),E=b.isSnap,x=b.guideline,T=E?x.pos[1]:0,w=_?y.pos[0]:0;if(0===h)E&&(d.isSnap=!0,d.pos=x.pos[1],d.offset=r-d.pos);else if(0===u)_&&(f.isSnap=!0,f.pos=w,f.offset=n-w);else{var S=u/h,A=i[1]-S*n,M=0,O=0,R=!1;_?(M=S*(O=w)+A,R=!0):E&&(O=((M=T)-A)/S,R=!0),R&&(f.isSnap=!0,f.pos=O,f.offset=n-O,d.isSnap=!0,d.pos=M,d.offset=r-M)}return{vertical:f,horizontal:d}}(t,e,i),h=a.horizontal,u=a.vertical,l=dr(s,h),c=dr(o,u),f=Math.abs(l),d=Math.abs(c);return{horizontal:{isBound:s.isBound,isSnap:h.isSnap,offset:l,dist:f},vertical:{isBound:o.isBound,isSnap:u.isSnap,offset:c,dist:d}}}(t,h,u,r):cr(t,r,{vertical:[u[0]],horizontal:[u[1]]}),c=l.horizontal,f=c.offset,d=c.isBound,p=c.isSnap,g=l.vertical,m=g.offset,v=g.isBound,_=g.isSnap,y=zt(a,o);if(!m&&!f)return{isBound:v||d,isSnap:_||p,sign:y,offset:[0,0]};var b=function(t,e,i,n){var r=G(t,e)/Math.PI*180,s=i.vertical,o=s.isBound,a=s.isSnap,h=s.dist,u=i.horizontal,l=u.isBound,c=u.isSnap,f=r%180,d=f<3||f>177,p=f>87&&f<93;return u.dist<h&&(o||a&&!p&&(!n||!d))?"vertical":!l&&(!c||d||n&&p)?"":"horizontal"}(h,u,l,n);if(!b)return{sign:y,isBound:!1,isSnap:!1,offset:[0,0]};var E="vertical"===b,x=hr(h,u,-(E?m:f),E,s).offset.map((function(t,e){return t*(y[e]?2/y[e]:0)}));return{sign:y,isBound:E?v:d,isSnap:E?_:p,offset:x}}))}(t,e,o,n,r,s),Kn(t,a,_n(e,[0,0]),s)),u=Wn(h,0),l=Wn(h,1);return{width:{isBound:u.isBound,offset:u.offset[0]},height:{isBound:l.isBound,offset:l.offset[1]}}}function vr(t,e,i,n,r,s,o,a){for(var h=Bi(t.state),u=t.props.keepRatio,l=0,c=0,f=0;f<2;++f){var d=mr(t,e(l,c),r,u,o,a),p=d.width,g=d.height,m=p.isBound,v=g.isBound,_=p.offset,y=g.offset;if(1===f&&(m||(_=0),v||(y=0)),0===f&&o&&!m&&!v)return[0,0];if(u){var b=Math.abs(_)*(i?1/i:1),E=Math.abs(y)*(n?1/n:1);(m&&v?b<E:v||!m&&b<E)?_=i*y/n:y=n*_/i}l+=_,c+=y}if(r[0]&&r[1]){var x=function(t,e,i,n,r){var s=[-i[0],-i[1]],o=t.state,a=o.width,h=o.height,u=t.props.bounds,l=1/0,c=1/0;if(u){var f=[[i[0],-i[1]],[-i[0],i[1]]],d=u.left,p=void 0===d?-1/0:d,g=u.top,m=void 0===g?-1/0:g,v=u.right,_=void 0===v?1/0:v,y=u.bottom,b=void 0===y?1/0:y;f.forEach((function(t){var i=t[0]!==s[0],o=t[1]!==s[1],u=_n(e,t),f=360*G(n,u)/Math.PI;if(o){var d=u.slice();(Math.abs(f-360)<2||Math.abs(f-180)<2)&&(d[1]=n[1]);var g=hr(n,d,(n[1]<u[1]?b:m)-u[1],!1,r),v=g.offset[1],y=g.isOutside;isNaN(v)||(c=h+(y?1:-1)*Math.abs(v))}if(i){d=u.slice(),(Math.abs(f-90)<2||Math.abs(f-270)<2)&&(d[0]=n[0]);var E=hr(n,d,(n[0]<u[0]?_:p)-u[0],!0,r),x=E.offset[0],T=E.isOutside;isNaN(x)||(l=a+(T?1:-1)*Math.abs(x))}}))}return{maxWidth:l,maxHeight:c}}(t,h,r,s,a),T=x.maxWidth,w=x.maxHeight,S=function(t,e,i,n,r,s,o,a,h){var u=_n(e,o),l=cr(t,a,{vertical:[u[0]],horizontal:[u[1]]}),c=l.horizontal.offset,f=l.vertical.offset;if(f||c){var d=gn({datas:h,distX:-f,distY:-c}),p=d[0],g=d[1];return[Math.min(r||1/0,i+o[0]*p)-i,Math.min(s||1/0,n+o[1]*g)-n]}return[0,0]}(t,e(l,c).map((function(t){return t.map((function(t){return X(t,1e-4)}))})),i+l,n+c,T,w,r,o,a);l+=_=S[0],c+=y=S[1]}return[l,c]}function _r(t,e,i,n){if(!Nn(t,"rotatable"))return n;var r=e.pos1,s=e.pos2,o=e.pos3,a=e.pos4,h=n*Math.PI/180,u=[r,s,o,a].map((function(t){return zt(t,i)})),l=u.map((function(t){return Kt(t,h)})),c=Ve(function(t,e,i,n,r){if(!t.props.bounds)return[];var s=r*Math.PI/180,o=er(t),a=o.left,h=o.top,u=o.right,l=o.bottom,c=a-n[0],f=u-n[0],d=h-n[1],p=l-n[1],g={left:c,top:d,right:f,bottom:p};if(!nr(i,g,0))return[];var m=[];return[[c,0],[f,0],[d,1],[p,1]].forEach((function(t){var n=t[0],r=t[1];i.forEach((function(t){var i=G([0,0],t);m.push.apply(m,function(t,e,i){var n=Mi(t),r=Math.sqrt(n*n-e*e)||0;return[r,-r].sort((function(e,n){return Math.abs(e-t[i?0:1])-Math.abs(n-t[i?0:1])})).map((function(t){return G([0,0],i?[t,e]:[e,t])}))}(t,n,r).map((function(t){return s+t-i})).filter((function(t){return!nr(e,g,t)})).map((function(t){return X(180*t/Math.PI,ii)})))}))})),m}(t,u,l,i,n),function(t,e,i,n,r){var s=t.props.innerBounds,o=r*Math.PI/180;if(!s)return[];var a=s.left,h=s.top,u=s.width,l=s.height,c=a-n[0],f=a+u-n[0],d=h-n[1],p=h+l-n[1],g=[[c,d],[f,d],[c,p],[f,p]],m=_n(i,[0,0]);if(!Qn(i,g,m,0))return[];var v=[],_=g.map((function(t){return[Mi(t),G([0,0],t)]}));return[[i[0],i[1]],[i[1],i[3]],[i[3],i[2]],[i[2],i[0]]].forEach((function(t){var i=G([0,0],function(t){var e=t[0],i=t[1],n=i[0]-e[0],r=i[1]-e[1];if(!n)return[e[0],0];if(!r)return[0,e[1]];var s=r/n,o=-s*e[0]+e[1];return[-o/(s+1/s),o/(s*s+1)]}(t)),n=function(t){var e=t[0],i=t[1],n=i[0]-e[0],r=i[1]-e[1];if(!n)return Math.abs(e[0]);if(!r)return Math.abs(e[1]);var s=r/n;return Math.abs((-s*e[0]+e[1])/Math.sqrt(Math.pow(s,2)+1))}(t);v.push.apply(v,_.filter((function(t){var e=t[0];return e&&n<=e})).map((function(t){var e=t[0],r=t[1],s=Math.acos(e?n/e:0);return[o+(r+s)-i,o+(r-s)-i]})).reduce((function(t,e){return t.push.apply(t,e),t}),[]).filter((function(t){return!Qn(e,g,m,t)})).map((function(t){return X(180*t/Math.PI,ii)})))})),v}(t,u,l,i,n));return c.sort((function(t,e){return Math.abs(t-n)-Math.abs(e-n)})),c.length?c[0]:n}function yr(t){var e=[];return t.forEach((function(t){t.guidelineInfos.forEach((function(t){var i=t.guideline;e.indexOf(i)>-1||e.push(i)}))})),e}function br(t,e,i,n,r,s){var o=tr(er(t,s),e,i),a=o.vertical,h=o.horizontal;a.forEach((function(t){t.isBound&&n.push({type:"bounds",pos:t.pos})})),h.forEach((function(t){t.isBound&&r.push({type:"bounds",pos:t.pos})}));var u=function(t){var e=t.props.innerBounds;if(!e)return{vertical:[],horizontal:[]};var i=t.getRect(),n=i.pos1,r=i.pos2,s=i.pos3,o=i.pos4,a=_n([n,r,s,o],[0,0]),h=e.left,u=e.top,l=e.width,c=e.height,f=[[h,u],[h,u+c]],d=[[h,u],[h+l,u]],p=[[h+l,u],[h+l,u+c]],g=[[h,u+c],[h+l,u+c]],m=[],v=[],_={top:!1,bottom:!1,left:!1,right:!1};return[[n,r],[r,o],[o,s],[s,n]].forEach((function(t){var e=Vn(a,t),i=e.horizontal,n=e.vertical,r=Zn(t,d,n,1,!0),s=Zn(t,g,n,1,!0),o=Zn(t,f,i,1,!0),y=Zn(t,p,i,1,!0);r.isBound&&!_.top&&(m.push(u),_.top=!0),s.isBound&&!_.bottom&&(m.push(u+c),_.bottom=!0),o.isBound&&!_.left&&(v.push(h),_.left=!0),y.isBound&&!_.right&&(v.push(h+l),_.right=!0)})),{horizontal:m,vertical:v}}(t),l=u.vertical,c=u.horizontal;l.forEach((function(t){N(n,(function(e){var i=e.type,n=e.pos;return"bounds"===i&&n===t}))>=0||n.push({type:"bounds",pos:t})})),c.forEach((function(t){N(r,(function(e){var i=e.type,n=e.pos;return"bounds"===i&&n===t}))>=0||r.push({type:"bounds",pos:t})}))}var Er={name:"snappable",props:{snappable:[Boolean,Array],snapContainer:Object,snapDirections:[Boolean,Object],elementSnapDirections:[Boolean,Object],snapGap:Boolean,snapGridWidth:Number,snapGridHeight:Number,isDisplaySnapDigit:Boolean,isDisplayInnerSnapDigit:Boolean,snapDigit:Number,snapThreshold:Number,horizontalGuidelines:Array,verticalGuidelines:Array,elementGuidelines:Array,bounds:Object,innerBounds:Object,snapDistFormat:Function},events:{onSnap:"snap"},css:[":host {\n --bounds-color: #d66;\n}\n.guideline {\n pointer-events: none;\n z-index: 2;\n}\n.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}\n.guideline-group {\n position: absolute;\n top: 0;\n left: 0;\n}\n.guideline-group .size-value {\n position: absolute;\n color: #f55;\n font-size: 12px;\n font-weight: bold;\n}\n.guideline-group.horizontal .size-value {\n transform-origin: 50% 100%;\n transform: translateX(-50%);\n left: 50%;\n bottom: 5px;\n}\n.guideline-group.vertical .size-value {\n transform-origin: 0% 50%;\n top: 50%;\n transform: translateY(-50%);\n left: 5px;\n}\n.guideline.gap {\n background: #f55;\n}\n.size-value.gap {\n color: #f55;\n}\n"],render:function(t,e){var i=t.state,n=i.top,r=i.left,s=i.pos1,o=i.pos2,a=i.pos3,h=i.pos4,u=i.snapRenderInfo;if(!u||!Nn(t,""))return[];i.guidelines=Fn(t);var l=Math.min(s[0],o[0],a[0],h[0]),c=Math.min(s[1],o[1],a[1],h[1]),f=u.externalPoses||[],d=Bi(t.state),p=[],g=[],m=[],v=[],_=[],y=wi(d),b=y.width,E=y.height,x=y.top,T=y.left,w=y.bottom,S=y.right,A={left:T,right:S,top:x,bottom:w,center:(T+S)/2,middle:(x+w)/2},M=f.length>0,O=M?wi(f):{};if(!u.request){if(u.direction&&_.push(function(t,e,i){var n=[];if(i[0]&&i[1])n=[i,[-i[0],i[1]],[i[0],-i[1]]].map((function(t){return _n(e,t)}));else if(i[0]||i[1])t.props.keepRatio?n=[[-1,-1],[-1,1],[1,-1],[1,1],i].map((function(t){return _n(e,t)})):(n=vn(e,i)).length>1&&n.push([(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]);else for(var r=[e[0],e[1],e[3],e[2],e[0]],s=0;s<4;++s)n.push(r[s]),n.push([(r[s][0]+r[s+1][0])/2,(r[s][1]+r[s+1][1])/2]);return Gn(t,n.map((function(t){return t[0]})),n.map((function(t){return t[1]})),1)}(t,d,u.direction)),u.snap){var R=wi(d);u.center&&(R.middle=(R.top+R.bottom)/2,R.center=(R.left+R.right)/2),_.push(jn(t,R,1))}M&&(u.center&&(O.middle=(O.top+O.bottom)/2,O.center=(O.left+O.right)/2),_.push(jn(t,O,1))),_.forEach((function(t){var e=t.vertical.posInfos,i=t.horizontal.posInfos;p.push.apply(p,e.filter((function(t){return t.guidelineInfos.some((function(t){return!t.guideline.hide}))})).map((function(t){return{type:"snap",pos:t.pos}}))),g.push.apply(g,i.filter((function(t){return t.guidelineInfos.some((function(t){return!t.guideline.hide}))})).map((function(t){return{type:"snap",pos:t.pos}}))),m.push.apply(m,yr(e)),v.push.apply(v,yr(i))}))}br(t,[T,S],[x,w],p,g),M&&br(t,[O.left,O.right],[O.top,O.bottom],p,g,u.externalBounds);var C=Ve(m,v),I=C.filter((function(t){return t.element&&!t.gapRects})),P=C.filter((function(t){return t.gapRects}));return ji(t,"onSnap",{guidelines:C.filter((function(t){return!t.element})),elements:I,gaps:P},!0),Ve(function(t,e,i,n,r){var s=t.props.isDisplayInnerSnapDigit,o=[];return["vertical","horizontal"].forEach((function(a){var h=e.filter((function(t){return t.type===a})),u="vertical"===a?1:0,l=u?0:1,c=function(t,e,i,n){var r,s,o,a,h="vertical"===t?0:1,u="vertical"===t?1:0,l=h?In:Pn,c=i[l.start],f=i[l.end];return(r=e,s=function(t){return t.pos[h]},o=[],a=[],r.forEach((function(t,e){var i=s(t),n=a.indexOf(i),r=o[n]||[];-1===n&&(a.push(i),o.push(r)),r.push(t)})),o).map((function(e){var i=[],r=[];return e.forEach((function(e){var s,o,a=e.element,d=e.elementRect.rect;if(d[l.end]<c)i.push(e);else if(f<d[l.start])r.push(e);else if(d[l.start]<=c&&f<=d[l.end]&&n){var p=e.pos,g={element:a,rect:We(We({},d),(s={},s[l.end]=d[l.start],s))},m={element:a,rect:We(We({},d),(o={},o[l.start]=d[l.end],o))},v=[0,0],_=[0,0];v[h]=p[h],v[u]=p[u],_[h]=p[h],_[u]=p[u]+e.size,i.push({type:t,pos:v,size:0,elementRect:g}),r.push({type:t,pos:_,size:0,elementRect:m})}})),i.sort((function(t,e){return e.pos[u]-t.pos[u]})),r.sort((function(t,e){return t.pos[u]-e.pos[u]})),{total:e,start:i,end:r,inner:[]}}))}(a,h,n,s),f=u?Pn:In,d=u?In:Pn,p=n[f.start],g=n[f.end];c.forEach((function(e){var s=e.total,h=e.start,c=e.end,m=e.inner,v=i[l]+s[0].pos[l]-n[d.start],_=n;h.forEach((function(e){var n=e.elementRect.rect,s=_[f.start]-n[f.end];if(s>0){var h=[0,0];h[u]=i[u]+_[f.start]-p-s,h[l]=v,o.push(ar(t,a,"dashed",o.length,s,h,e.className,r))}_=n})),_=n,c.forEach((function(e){var n=e.elementRect.rect,s=n[f.start]-_[f.end];if(s>0){var h=[0,0];h[u]=i[u]+_[f.end]-p,h[l]=v,o.push(ar(t,a,"dashed",o.length,s,h,e.className,r))}_=n})),m.forEach((function(e){var n=e.elementRect.rect,s=p-n[f.start],h=n[f.end]-g,c=[0,0],d=[0,0];c[u]=i[u]-s,c[l]=v,d[u]=i[u]+g-p,d[l]=v,o.push(ar(t,a,"dashed",o.length,s,c,e.className,r)),o.push(ar(t,a,"dashed",o.length,h,d,e.className,r))}))}))})),o}(t,I,[l,c],A,e),function(t,e,i,n,r){var s=[];return["horizontal","vertical"].forEach((function(o){var a=e.filter((function(t){return t.type===o})),h="vertical"===o?0:1,u=h?0:1,l=h?Pn:In,c=h?In:Pn,f=n[l.start],d=n[l.end],p=n[c.start],g=n[c.end];a.forEach((function(e){var n=e.gap,o=e.gapRects,a=e.className,m=Math.max.apply(Math,Ve([p],o.map((function(t){return t.rect[c.start]})))),v=Math.min.apply(Math,Ve([g],o.map((function(t){return t.rect[c.end]})))),_=(m+v)/2;m!==v&&_!==(p+g)/2&&o.forEach((function(e){var o=e.rect,c=[i[0],i[1]];if(o[l.end]<f)c[h]+=o[l.end]-f;else{if(!(d<o[l.start]))return;c[h]+=o[l.start]-f-n}c[u]+=_-p,s.push(ar(t,h?"vertical":"horizontal","gap",s.length,n,c,a,r))}))}))})),s}(t,P,[l,c],A,e),or(t,"horizontal",v,[r,n],A,e),or(t,"vertical",m,[r,n],A,e),sr(t,"horizontal",g,l,n,b,0,e),sr(t,"vertical",p,c,r,E,1,e))},dragStart:function(t,e){t.state.snapRenderInfo={request:e.isRequest,snap:!0,center:!0},pr(t)},drag:function(t){t.state.guidelines=Fn(t)},pinchStart:function(t){this.unset(t)},dragEnd:function(t){this.unset(t)},dragControlCondition:function(t,e){return!(!Ki(0,e)&&!Ir(t,e))||(!e.isRequest&&e.inputEvent?z(e.inputEvent.target,li("snap-control")):void 0)},dragControlStart:function(t){t.state.snapRenderInfo=null,pr(t)},dragControl:function(t){this.drag(t)},dragControlEnd:function(t){this.unset(t)},dragGroupStart:function(t,e){this.dragStart(t,e)},dragGroup:function(t){this.drag(t)},dragGroupEnd:function(t){this.unset(t)},dragGroupControlStart:function(t){t.state.snapRenderInfo=null,pr(t)},dragGroupControl:function(t){this.drag(t)},dragGroupControlEnd:function(t){this.unset(t)},unset:function(t){var e=t.state;e.enableSnap=!1,e.guidelines=[],e.snapRenderInfo=null,e.elementRects=[]}},xr={name:"draggable",props:{draggable:Boolean,throttleDrag:Number,throttleDragRotate:Number,startDragRotate:Number,edgeDraggable:Boolean},events:{onDragStart:"dragStart",onDrag:"drag",onDragEnd:"dragEnd",onDragGroupStart:"dragGroupStart",onDragGroup:"dragGroup",onDragGroupEnd:"dragGroupEnd"},render:function(t,e){var i=t.props,n=i.throttleDragRotate,r=i.zoom,s=t.state,o=s.dragInfo,a=s.beforeOrigin;if(!n||!o)return[];var h=o.dist;if(!h[0]&&!h[1])return[];var u=Mi(h),l=G(h,[0,0]);return[e.createElement("div",{className:li("line","horizontal","dragline","dashed"),key:"dragRotateGuideline",style:{width:u+"px",transform:"translate("+a[0]+"px, "+a[1]+"px) rotate("+l+"rad) scaleY("+r+")"}})]},dragStart:function(t,e){var i=e.datas,n=e.parentEvent,r=e.parentGesto,s=t.state,o=s.target;if(s.gesto)return!1;s.gesto=r||t.targetGesto;var a=Xi(o);i.datas={},i.left=parseFloat(a.left||"")||0,i.top=parseFloat(a.top||"")||0,i.bottom=parseFloat(a.bottom||"")||0,i.right=parseFloat(a.right||"")||0,i.startValue=[0,0],ln(t,e),En(e,"translate"),function(t,e){e.absolutePoses=Bi(t.state)}(t,i),i.prevDist=[0,0],i.prevBeforeDist=[0,0],i.isDrag=!1,i.deltaOffset=[0,0],i.distOffset=[0,0];var h=Gi(t,e,We({set:function(t){i.startValue=t}},bn(e)));return!1!==(n||ji(t,"onDragStart",h))?(i.isDrag=!0,t.state.dragInfo={startRect:t.getRect(),dist:[0,0]}):(s.gesto=null,i.isPinch=!1),!!i.isDrag&&h},drag:function(t,e){if(e){cn(e,"translate");var i=e.datas,n=e.parentEvent,r=e.parentFlag,s=e.isPinch,o=e.isRequest,a=e.distX,h=e.distY,u=i.isDrag,l=i.prevDist,c=i.prevBeforeDist,f=i.startValue,d=i.distOffset;if(u){a+=d[0],h+=d[1];var p=t.props,g=p.parentMoveable,m=n?0:p.throttleDrag||0,v=n?0:p.throttleDragRotate||0,_=!1,y=0;if(!n&&v>0&&(a||h)){var b=p.startDragRotate||0,E=X(b+180*G([0,0],[a,h])/Math.PI,v)-b,x=h*Math.abs(Math.cos((E-90)/180*Math.PI)),T=Mi([a*Math.abs(Math.cos(E/180*Math.PI)),x]);y=E*Math.PI/180,a=T*Math.cos(y),h=T*Math.sin(y)}if(!s&&!n&&!r&&(!v||a||h)){var w=lr(t,a,h,v,o,i),S=w[0],A=w[1],M=S.isSnap,O=S.isBound,R=S.offset,C=A.isSnap,I=A.isBound;_=M||C||O||I,a+=R,h+=A.offset}var P=Ht(pn({datas:i,distX:a,distY:h}),f),N=Ht(function(t){var e=t.datas,i=pn({datas:e,distX:t.distX,distY:t.distY});return Vt(dn(e,function(t,e){for(var i=ee(4),n=0;n<3;++n)i[12+n]=t[n]||0;return i}([i[0],i[1]])),Gt([0,0,0],4),4)}({datas:i,distX:a,distY:h}),f);v||_||(H(N,m),H(P,m));var D=zt(P,f),L=zt(N,f),k=zt(L,l),B=zt(D,c);i.prevDist=L,i.prevBeforeDist=D,i.passDelta=k,i.passDist=L;var F=i.left+D[0],U=i.top+D[1],j=i.right-D[0],z=i.bottom-D[1],W=fn(i,"translate("+N[0]+"px, "+N[1]+"px)","translate("+L[0]+"px, "+L[1]+"px)");if(t.state.dragInfo.dist=n?[0,0]:L,n||g||!k.every((function(t){return!t}))||!B.some((function(t){return!t}))){var V=t.state,Y=Gi(t,e,{transform:W,dist:L,delta:k,translate:N,beforeDist:D,beforeDelta:B,beforeTranslate:P,left:F,top:U,right:j,bottom:z,width:V.width,height:V.height,isPinch:s});return!n&&ji(t,"onDrag",Y),Y}}}},dragAfter:function(t,e){var i=e.datas,n=e.datas,r=n.deltaOffset,s=n.distOffset;return!(!r[0]&&!r[1])&&(i.deltaOffset=[0,0],s[0]+=r[0],s[1]+=r[1],this.drag(t,e))},dragEnd:function(t,e){var i=e.parentEvent,n=e.datas,r=e.isDrag;if(t.state.gesto=null,t.state.dragInfo=null,n.isDrag)return n.isDrag=!1,!i&&ji(t,"onDragEnd",Ui(t,e,{})),r},dragGroupStart:function(t,e){var i=e.datas,n=e.clientX,r=e.clientY,s=this.dragStart(t,e);if(!s)return!1;var o=an(t,this,"dragStart",[n||0,r||0],e,!1),a=ji(t,"onDragGroupStart",We(We({},s),{targets:t.props.targets,events:o}));return i.isDrag=!1!==a,!!i.isDrag&&s},dragGroup:function(t,e){if(e.datas.isDrag){var i=this.drag(t,e),n=an(t,this,"drag",e.datas.passDelta,e,!1);if(i){var r=We({targets:t.props.targets,events:n},i);return ji(t,"onDragGroup",r),r}}},dragGroupEnd:function(t,e){var i=e.isDrag;if(e.datas.isDrag)return this.dragEnd(t,e),an(t,this,"dragEnd",[0,0],e,!1),ji(t,"onDragGroupEnd",Ui(t,e,{targets:t.props.targets})),i},request:function(t){var e={},i=t.getRect(),n=0,r=0;return{isControl:!1,requestStart:function(){return{datas:e}},request:function(t){return"x"in t?n=t.x-i.left:"deltaX"in t&&(n+=t.deltaX),"y"in t?r=t.y-i.top:"deltaY"in t&&(r+=t.deltaY),{datas:e,distX:n,distY:r}},requestEnd:function(){return{datas:e,isDrag:!0}}}},unset:function(t){t.state.dragInfo=null}};function Tr(t,e,i,n){void 0===n&&(n="");var r=t.state,s=r.renderPoses,o=r.rotation,a=r.direction,h=t.props,u=h.renderDirections,l=void 0===u?e:u,c=h.zoom,f={};if(!l)return[];var d=a>0?1:-1,p=!0===l?oi:l,g=o/Math.PI*180;return p.forEach((function(t){f[t]=!0})),p.map((function(t){var e=ai[t];if(!e||!f[t])return null;var r=(X(g,15)+d*hi[t]+720)%180;return i.createElement("div",{className:li("control","direction",t,n),"data-rotation":r,"data-direction":t,key:"direction-"+t,style:Ci.apply(void 0,Ve([o,c],e.map((function(t){return s[t]}))))})}))}function wr(t,e,i,n,r,s){for(var o=[],a=6;a<arguments.length;a++)o[a-6]=arguments[a];var h=G(i,n),u=e?X(h/Math.PI*180,15)%180:-1;return t.createElement("div",{key:"line"+s,className:li.apply(void 0,Ve(["line","direction",e],o)),"data-rotation":u,"data-line-index":s,"data-direction":e,style:Ri(i,n,r,h)})}function Sr(t,e){return Tr(t,oi,e)}function Ar(t,e){return Tr(t,["nw","ne","sw","se"],e)}function Mr(t,e,i,n,r,s){var o=t.state.is3d?4:3,a=xi(t.state.rootMatrix,r,o),h=Ht([s.left,s.top],a);e.startAbsoluteOrigin=h,e.prevDeg=G(h,[i,n])/Math.PI*180,e.prevSnapDeg=e.prevDeg,e.startDeg=e.prevDeg,e.loop=0}function Or(t,e,i,n,r,s){var o=i.prevDeg,a=_r(t,e,i.origin,n);return i.prevDeg=a,[a-o,a,s+a]}function Rr(t,e,i,n,r,s,o,a){var h=i.prevDeg,u=i.prevSnapDeg,l=i.startDeg,c=i.loop;h>n&&h>270&&n<90?++i.loop:h<n&&h<90&&n>270&&--i.loop;var f=i.loop,d=360*c+u-l+s,p=360*f+n-l+s;i.prevDeg=p-360*f+l-s;var g=r*((p=X(p,o))-s);return a&&(p=(g=_r(t,e,i.origin,g))/r+s),i.prevSnapDeg=p-360*f+l-s,[r*(p-d),g,s+g]}function Cr(t,e,i,n,r,s,o,a){return Rr(t,e,i,G(i.startAbsoluteOrigin,[r,s])/Math.PI*180,n,o,a,!0)}function Ir(t,e){if(e.isRequest)return"rotatable"===e.requestAble;var i=e.inputEvent.target;if(z(i,li("rotation-control")))return!0;var n=t.props.rotationTarget;return!!n&&tn(n,!0).some((function(t){return!!t&&(i===t||i.contains(t))}))}var Pr={name:"rotatable",canPinch:!0,props:{rotatable:Boolean,rotationPosition:String,throttleRotate:Number,renderDirections:Object,rotationTarget:Object},events:{onRotateStart:"rotateStart",onRotate:"rotate",onRotateEnd:"rotateEnd",onRotateGroupStart:"rotateGroupStart",onRotateGroup:"rotateGroup",onRotateGroupEnd:"rotateGroupEnd"},css:[".rotation {\n position: absolute;\n height: 40px;\n width: 1px;\n transform-origin: 50% 100%;\n height: calc(40px * var(--zoom));\n top: auto;\n left: 0;\n bottom: 100%;\n will-change: transform;\n }\n .rotation .rotation-line {\n display: block;\n width: 100%;\n height: 100%;\n transform-origin: 50% 50%;\n }\n .rotation .rotation-control {\n border-color: #4af;\n border-color: var(--moveable-color);\n background:#fff;\n cursor: alias;\n }"],render:function(t,e){var i=t.props,n=i.rotatable,r=i.rotationPosition,s=i.zoom,o=i.renderDirections,a=t.state,h=a.renderPoses,u=a.direction;if(!n)return null;var l=function(t,e,i){var n=e[0],r=e[1],s=e[2],o=e[3];if("none"!==t){var a=(t||"top").split("-"),h=a[0],u=a[1],l=[n,r];"left"===h?l=[s,n]:"right"===h?l=[r,o]:"bottom"===h&&(l=[o,s]);var c=[(l[0][0]+l[1][0])/2,(l[0][1]+l[1][1])/2],f=Pi(l,i);if(u){var d="top"===u||"left"===u,p="bottom"===h||"left"===h;c=l[d&&!p||!d&&p?0:1]}return[c,f]}}(r,h,u),c=[];if(l){var f=l[0],d=l[1];c.push(e.createElement("div",{key:"rotation",className:li("rotation"),style:{transform:"translate(-50%) translate("+f[0]+"px, "+f[1]+"px) rotate("+d+"rad)"}},e.createElement("div",{className:li("line rotation-line"),style:{transform:"scaleX("+s+")"}}),e.createElement("div",{className:li("control rotation-control"),style:{transform:"translate(0.5px) scale("+s+")"}})))}return o&&c.push.apply(c,Tr(t,[],e)),c},dragControlCondition:Ir,dragControlStart:function(t,e){var i=e.datas,n=e.clientX,r=e.clientY,s=e.parentRotate,o=e.parentFlag,a=e.isPinch,h=e.isRequest,u=t.state,l=u.target,c=u.left,f=u.top,d=u.origin,p=u.beforeOrigin,g=u.direction,m=u.beforeDirection,v=u.targetTransform,_=u.moveableClientRect;if(!h&&!l)return!1;var y=t.getRect();if(i.rect=y,i.transform=v,i.left=c,i.top=f,i.fixedPosition=Mn(t,An(t)),i.absoluteInfo={origin:y.origin,startValue:y.rotation},Mr(t,i.absoluteInfo,n,r,d,_),h||a||o){var b=s||0;i.beforeInfo={origin:y.beforeOrigin,prevDeg:b,startDeg:b,prevSnapDeg:b,loop:0},i.afterInfo={origin:y.origin,prevDeg:b,startDeg:b,prevSnapDeg:b,loop:0}}else i.beforeInfo={origin:y.beforeOrigin},i.afterInfo={origin:y.origin},Mr(t,i.beforeInfo,n,r,p,_),Mr(t,i.afterInfo,n,r,d,_);i.direction=g,i.beforeDirection=m,i.startValue=0,i.datas={},En(e,"rotate");var E=Gi(t,e,We(We({set:function(t){i.startValue=t*Math.PI/180}},bn(e)),{dragStart:xr.dragStart(t,(new sn).dragStart([0,0],e))})),x=ji(t,"onRotateStart",E);return i.isRotate=!1!==x,t.state.snapRenderInfo={request:e.isRequest},!!i.isRotate&&E},dragControl:function(t,e){var i,n,r,s,o,a,h,u,l,c=e.datas,f=e.clientX,d=e.clientY,p=e.parentRotate,g=e.parentFlag,m=e.isPinch,v=e.groupDelta,_=c.beforeDirection,y=c.beforeInfo,b=c.afterInfo,E=c.absoluteInfo,x=c.isRotate,T=c.startValue,w=c.rect;if(x){cn(e,"rotate");var S,A,M,O,R,C,I,P,N,D=function(t){return Ai(t.datas.beforeTransform,[50,50],100,100).direction}(e),L=_*D,k=t.props,B=k.throttleRotate,F=void 0===B?0:B,G=k.parentMoveable,U=180/Math.PI*T,j=E.startValue;if(!g&&"parentDist"in e){var X=e.parentDist;S=(i=Or(t,w,b,X,0,U))[0],A=i[1],M=i[2],O=(n=Or(t,w,y,X,0,U))[0],R=n[1],C=n[2],I=(r=Or(t,w,E,X,0,j))[0],P=r[1],N=r[2]}else m||g?(S=(s=Rr(t,w,b,p,L,U,F))[0],A=s[1],M=s[2],O=(o=Rr(t,w,y,p,_,U,F))[0],R=o[1],C=o[2],I=(a=Rr(t,w,E,p,L,j,F))[0],P=a[1],N=a[2]):(S=(h=Cr(t,w,b,L,f,d,U,F))[0],A=h[1],M=h[2],O=(u=Cr(t,w,y,_,f,d,U,F))[0],R=u[1],C=u[2],I=(l=Cr(t,w,E,L,f,d,j,F))[0],P=l[1],N=l[2]);if(I||S||O||G){var H=fn(c,"rotate("+M+"deg)","rotate("+A+"deg)"),z=function(t,e,i,n){return Sn(t,"rotate("+e+"deg)",An(t),i,n)}(t,A,c.fixedPosition,c),W=zt(Ht(v||[0,0],z),c.prevInverseDist||[0,0]);c.prevInverseDist=z;var V=Gi(t,e,We({delta:S,dist:A,rotate:M,beforeDist:R,beforeDelta:O,beforeRotate:C,absoluteDist:P,absoluteDelta:I,absoluteRotate:N,isPinch:!!m},wn(t,H,W,m,e)));return ji(t,"onRotate",V),V}}},dragControlEnd:function(t,e){var i=e.datas,n=e.isDrag;return!!i.isRotate&&(i.isRotate=!1,ji(t,"onRotateEnd",Ui(t,e,{})),n)},dragGroupControlCondition:Ir,dragGroupControlStart:function(t,e){var i=e.datas,n=t.state,r=n.left,s=n.top,o=n.beforeOrigin,a=this.dragControlStart(t,e);if(!a)return!1;a.set(i.beforeDirection*t.rotation);var h=hn(t,this,"dragControlStart",e,(function(t,e){var i=t.state,n=i.left,a=i.top,h=i.beforeOrigin,u=Ht(zt([n,a],[r,s]),zt(h,o));return e.datas.groupClient=u,We(We({},e),{parentRotate:0})})),u=ji(t,"onRotateGroupStart",We(We({},a),{targets:t.props.targets,events:h}));return i.isRotate=!1!==u,!!i.isRotate&&a},dragGroupControl:function(t,e){var i=e.datas;if(i.isRotate){var n=this.dragControl(t,e);if(n){var r=i.beforeDirection,s=n.beforeDist,o=n.beforeDelta/180*Math.PI,a=hn(t,this,"dragControl",e,(function(t,e){var i=e.datas.groupClient,n=i[0],a=i[1],h=Kt([n,a],o*r),u=h[0],l=h[1],c=[u-n,l-a];return e.datas.groupClient=[u,l],We(We({},e),{parentRotate:s,groupDelta:c})}));t.rotation=r*n.beforeRotate;var h=We({targets:t.props.targets,events:a,set:function(e){t.rotation=e}},n);return ji(t,"onRotateGroup",h),h}}},dragGroupControlEnd:function(t,e){var i=e.isDrag;if(e.datas.isRotate)return this.dragControlEnd(t,e),hn(t,this,"dragControlEnd",e),ji(t,"onRotateGroupEnd",Ui(t,e,{targets:t.props.targets})),i},request:function(t){var e={},i=0,n=t.getRotation();return{isControl:!0,requestStart:function(){return{datas:e}},request:function(t){return"deltaRotate"in t?i+=t.deltaRotate:"rotate"in t&&(i=t.rotate-n),{datas:e,parentDist:i}},requestEnd:function(){return{datas:e,isDrag:!0}}}}},Nr={name:"resizable",ableGroup:"size",canPinch:!0,props:{resizable:Boolean,throttleResize:Number,renderDirections:Array,keepRatio:Boolean},events:{onResizeStart:"resizeStart",onResize:"resize",onResizeEnd:"resizeEnd",onResizeGroupStart:"resizeGroupStart",onResizeGroup:"resizeGroup",onResizeGroupEnd:"resizeGroupEnd"},render:function(t,e){var i=t.props,n=i.resizable,r=i.edge;if(n)return r?Ar(t,e):Sr(t,e)},dragControlCondition:Ki,dragControlStart:function(t,e){var i,n=e.inputEvent,r=e.isPinch,s=e.parentDirection,o=e.datas,a=e.parentFlag,h=s||(r?[0,0]:Li(n.target)),u=t.state,l=u.target,c=u.width,f=u.height;if(!h||!l)return!1;!r&&ln(t,e),o.datas={},o.direction=h,o.startOffsetWidth=c,o.startOffsetHeight=f,o.prevWidth=0,o.prevHeight=0,i=function(t){var e=Xi(t);return[parseFloat(e.width),parseFloat(e.height)]}(l),o.startWidth=i[0],o.startHeight=i[1];var d=[Math.max(0,c-o.startWidth),Math.max(0,f-o.startHeight)];if(o.minSize=d,o.maxSize=[1/0,1/0],!a){var p=Xi(l),g=p.position,m=p.minWidth,v=p.minHeight,_=p.maxWidth,y=p.maxHeight,b="static"===g||"relative"===g,E=b?l.parentElement:l.offsetParent,T=c,w=f;if(E&&(T=E.clientWidth,w=E.clientHeight,b)){var S=Xi(E);T-=parseFloat(S.paddingLeft)||0,w-=parseFloat(S.paddingTop)||0}o.minSize=Ht([k(m,T)||0,k(v,w)||0],d),o.maxSize=Ht([k(_,T)||1/0,k(y,w)||1/0],d)}var A=t.props.transformOrigin||"% %";function M(t){o.ratio=t&&isFinite(t)?t:0}function O(e){o.fixedDirection=e,o.fixedPosition=On(t,e)}o.transformOrigin=A&&x(A)?A.split(" "):A,o.isWidth=!h[0]&&!h[1]||h[0]||!h[1],M(c/f),O([-h[0],-h[1]]);var R=Gi(t,e,{direction:h,set:function(t){var e=t[0],i=t[1];o.startWidth=e,o.startHeight=i},setMin:function(t){o.minSize=t},setMax:function(t){o.maxSize=[t[0]||1/0,t[1]||1/0]},setRatio:M,setFixedDirection:O,setOrigin:function(t){o.transformOrigin=t},dragStart:xr.dragStart(t,(new sn).dragStart([0,0],e))});return!1!==ji(t,"onResizeStart",R)&&(o.isResize=!0,t.state.snapRenderInfo={request:e.isRequest,direction:h}),!!o.isResize&&R},dragControl:function(t,e){var i,n=e.datas,r=e.distX,s=e.distY,o=e.parentFlag,a=e.isPinch,h=e.parentDistance,u=e.parentScale,l=e.parentKeepRatio,c=e.dragClient,f=e.parentDist,d=e.isRequest,p=n.isResize,g=n.transformOrigin,m=n.fixedDirection,v=n.startWidth,_=n.startHeight,y=n.prevWidth,b=n.prevHeight,E=n.minSize,x=n.maxSize,T=n.ratio,w=n.isWidth,S=n.startOffsetWidth,A=n.startOffsetHeight;if(p){var M=t.props,O=M.throttleResize,R=void 0===O?0:O,I=M.parentMoveable,P=M.snapThreshold,N=void 0===P?5:P,D=n.direction,L=D,k=0,F=0;D[0]||D[1]||(L=[1,1]);var U=T&&(t.props.keepRatio||l),j=c;if(c||(j=!o&&a?On(t,[0,0]):n.fixedPosition),f)k=f[0],F=f[1],U&&(k?F||(F=k/T):k=F*T);else if(u)k=(u[0]-1)*S,F=(u[1]-1)*A;else if(a)h&&(k=h,F=h*A/S);else{var H=gn({datas:n,distX:r,distY:s});if(k=L[0]*H[0],F=L[1]*H[1],U&&S&&A){var z=G([0,0],H),W=G([0,0],L),V=Mi([k,F]),Y=Math.cos(z-W)*V;if(L[0])if(L[1]){var $=2*L[0]*S,q=2*L[1]*A,Z=Mi([$+H[0],q+H[1]])-Mi([$,q]),K=G([0,0],[T,1]);k=Math.cos(K)*Z,F=Math.sin(K)*Z}else F=(k=Y)*T;else k=(F=Y)/T}else if(!U){var J=Ve(D);S||(H[0]<0?J[0]=-1:H[0]>0&&(J[0]=1)),A||(H[1]<0?J[1]=-1:H[1]>0&&(J[1]=1)),D=J,k=(L=J)[0]*H[0],F=L[1]*H[1]}}var Q=L[0]||U?Math.max(S+k,ii):S,tt=L[1]||U?Math.max(A+F,ii):A;U&&S&&A&&(w?tt=Q/T:Q=tt*T);var et=[0,0];if(a||(et=function(t,e,i,n,r,s,o){if(!Nn(t,"resizable"))return[0,0];var a=t.state,h=a.allMatrix,u=a.is3d;return vr(t,(function(t,s){return gr(h,e+t,i+s,r,n,u)}),e,i,n,r,s,o)}(t,Q,tt,D,j,d,n)),f&&(!f[0]&&(et[0]=0),!f[1]&&(et[1]=0)),U){L[0]&&L[1]&&et[0]&&et[1]&&(Math.abs(et[0])>Math.abs(et[1])?et[1]=0:et[0]=0);var it=!et[0]&&!et[1];it&&(w?Q=X(Q,R):tt=X(tt,R)),L[0]&&!L[1]||et[0]&&!et[1]||it&&w?tt=(Q+=et[0])/T:(!L[0]&&L[1]||!et[0]&&et[1]||it&&!w)&&(Q=(tt+=et[1])*T)}else S+k<-N&&(et[0]=0),S+F<-N&&(et[1]=0),Q+=et[0],tt+=et[1],et[0]||(Q=X(Q,R)),et[1]||(tt=X(tt,R));Q=(i=function(t,e,i,n){if(!n)return t.map((function(t,n){return function(t,e,i){return Math.max(e,Math.min(t,i))}(t,e[n],i[n])}));var r=t[0],s=t[1],o=B(t,e,!1),a=o[0],h=o[1],u=B(t,i,!0),l=u[0],c=u[1];return r<a||s<h?(r=a,s=h):(r>l||s>c)&&(r=l,s=c),[r,s]}([Q,tt],E,x,U))[0],tt=i[1];var nt=[(k=(Q=Math.round(Q))-S)-y,(F=(tt=Math.round(tt))-A)-b];n.prevWidth=k,n.prevHeight=F;var rt=function(t,e,i,n,r,s){var o=t.props.groupable,a=t.state,h=a.transformOrigin,u=a.targetMatrix,l=a.offsetMatrix,c=a.is3d,f=a.width,d=a.height,p=a.left,g=a.top,m=c?4:3,v=function(t,e,i,n,r,s){return void 0===n&&(n=e),void 0===r&&(r=i),void 0===s&&(s=[0,0]),t?t.map((function(t,o){var a=C(t),h=a.value,u=a.unit,l=o?r:n,c=o?i:e;return"%"===t||isNaN(h)?c*(l?s[o]/l:0):"%"!==u?h:c*h/100})):s}(s,e,i,f,d,h),_=o?p:0,y=o?g:0,b=function(t,e,i,n,r,s){var o=_n(Ti(e,i,n,r),s);return[t[0]-o[0],t[1]-o[1]]}(r,yn(l,u,v,m),e,i,m,n);return zt(b,[_,y])}(t,Q,tt,m,j,g);if(I||!nt.every((function(t){return!t}))||!rt.every((function(t){return!t}))){var st=Gi(t,e,{width:v+k,height:_+F,offsetWidth:Q,offsetHeight:tt,direction:D,dist:[k,F],delta:nt,isPinch:!!a,drag:xr.drag(t,rn(e,t.state,rt,!!a,!1))});return ji(t,"onResize",st),st}}},dragControlAfter:function(t,e){var i=e.datas,n=i.isResize,r=i.startOffsetWidth,s=i.startOffsetHeight,o=i.prevWidth,a=i.prevHeight;if(n){var h=t.state,u=h.width-(r+o),l=h.height-(s+a),c=Math.abs(u)>3,f=Math.abs(l)>3;return c&&(i.startWidth+=u,i.startOffsetWidth+=u,i.prevWidth+=u),f&&(i.startHeight+=l,i.startOffsetHeight+=l,i.prevHeight+=l),c||f?(this.dragControl(t,e),!0):void 0}},dragControlEnd:function(t,e){var i=e.datas,n=e.isDrag;return!!i.isResize&&(i.isResize=!1,ji(t,"onResizeEnd",Ui(t,e,{})),n)},dragGroupControlCondition:Ki,dragGroupControlStart:function(t,e){var i=e.datas,n=this.dragControlStart(t,e);if(!n)return!1;var r=on(t,"resizable",e);function s(e,n){var r=i.fixedDirection,s=i.fixedPosition,o=On(e,r),a=Vt(te(-t.rotation/180*Math.PI,3),[o[0]-s[0],o[1]-s[1],1],3),h=a[0],u=a[1];return n.datas.originalX=h,n.datas.originalY=u,n}var o=hn(t,this,"dragControlStart",e,(function(t,e){return s(t,e)})),a=We(We({},n),{targets:t.props.targets,events:o,setFixedDirection:function(e){n.setFixedDirection(e),o.forEach((function(i,n){i.setFixedDirection(e),s(t.moveables[n],r[n])}))}}),h=ji(t,"onResizeGroupStart",a);return i.isResize=!1!==h,!!i.isResize&&n},dragGroupControl:function(t,e){var i=e.datas;if(i.isResize){var n=this.dragControl(t,e);if(n){var r=n.offsetWidth,s=n.offsetHeight,o=n.dist,a=t.props.keepRatio,h=[r/(r-o[0]),s/(s-o[1])],u=i.fixedPosition,l=hn(t,this,"dragControl",e,(function(e,i){var n=Vt(te(t.rotation/180*Math.PI,3),[i.datas.originalX*h[0],i.datas.originalY*h[1],1],3),r=n[0],s=n[1];return We(We({},i),{parentDist:null,parentScale:h,dragClient:Ht(u,[r,s]),parentKeepRatio:a})})),c=We({targets:t.props.targets,events:l},n);return ji(t,"onResizeGroup",c),c}}},dragGroupControlEnd:function(t,e){var i=e.isDrag;if(e.datas.isResize)return this.dragControlEnd(t,e),hn(t,this,"dragControlEnd",e),ji(t,"onResizeGroupEnd",Ui(t,e,{targets:t.props.targets})),i},request:function(t){var e={},i=0,n=0,r=t.getRect();return{isControl:!0,requestStart:function(t){return{datas:e,parentDirection:t.direction||[1,1]}},request:function(t){return"offsetWidth"in t?i=t.offsetWidth-r.offsetWidth:"deltaWidth"in t&&(i+=t.deltaWidth),"offsetHeight"in t?n=t.offsetHeight-r.offsetHeight:"deltaHeight"in t&&(n+=t.deltaHeight),{datas:e,parentDist:[i,n]}},requestEnd:function(){return{datas:e,isDrag:!0}}}}},Dr={name:"scalable",ableGroup:"size",canPinch:!0,props:{scalable:Boolean,throttleScale:Number,renderDirections:String,keepRatio:Boolean},events:{onScaleStart:"scaleStart",onScale:"scale",onScaleEnd:"scaleEnd",onScaleGroupStart:"scaleGroupStart",onScaleGroup:"scaleGroup",onScaleGroupEnd:"scaleGroupEnd"},render:function(t,e){var i=t.props,n=i.resizable,r=i.scalable,s=i.edge;if(!n&&r)return s?Ar(t,e):Sr(t,e)},dragControlCondition:Ki,dragControlStart:function(t,e){var i=e.datas,n=e.isPinch,r=e.inputEvent,s=e.parentDirection||(n?[0,0]:Li(r.target)),o=t.state,a=o.width,h=o.height,u=o.targetTransform,l=o.target,c=o.pos1,f=o.pos2,d=o.pos4;if(!s||!l)return!1;n||ln(t,e),i.datas={},i.transform=u,i.prevDist=[1,1],i.direction=s,i.width=a,i.height=h,i.startValue=[1,1];var p=j(c,f),g=j(f,d),m=!s[0]&&!s[1]||s[0]||!s[1];function v(t){i.ratio=t&&isFinite(t)?t:0}function _(e){i.fixedDirection=e,i.fixedPosition=On(t,e)}i.scaleWidth=p,i.scaleHeight=g,i.scaleXRatio=p/a,i.scaleYRatio=g/h,En(e,"scale"),i.isWidth=m,v(j(c,f)/j(f,d)),_([-s[0],-s[1]]);var y=Gi(t,e,We(We({direction:s,set:function(t){i.startValue=t},setRatio:v,setFixedDirection:_},bn(e)),{dragStart:xr.dragStart(t,(new sn).dragStart([0,0],e))}));return!1!==ji(t,"onScaleStart",y)&&(i.isScale=!0,t.state.snapRenderInfo={request:e.isRequest,direction:s}),!!i.isScale&&y},dragControl:function(t,e){cn(e,"scale");var i=e.datas,n=e.distX,r=e.distY,s=e.parentScale,o=e.parentDistance,a=e.parentKeepRatio,h=e.parentFlag,u=e.isPinch,l=e.dragClient,c=e.parentDist,f=e.isRequest,d=i.prevDist,p=i.direction,g=i.width,m=i.height,v=i.isScale,_=i.startValue,y=i.isWidth,b=i.ratio,x=i.fixedDirection,T=i.scaleXRatio,w=i.scaleYRatio;if(!v)return!1;var S=t.props,A=S.throttleScale,M=S.parentMoveable,O=p;p[0]||p[1]||(O=[1,1]);var R=b&&(t.props.keepRatio||a),C=t.state,I=1,P=1,N=l;if(l||(N=!h&&u?On(t,[0,0]):i.fixedPosition),c)I=(g+c[0])/g,P=(m+c[1])/m;else if(s)I=s[0],P=s[1];else if(u)o&&(I=(g+o)/g,P=(m+o*m/g)/m);else{var D=gn({datas:i,distX:n,distY:r}),L=O[0]*D[0]*T,k=O[1]*D[1]*w;if(R&&g&&m)if(O[0])if(O[1]){var B=Mi([L,k]),F=G([0,0],D),U=G([0,0],O),j=Math.cos(F-U)*B,H=G([0,0],[b,1]);L=Math.cos(H)*j,k=Math.sin(H)*j}else k=L/b;else L=k*b;I=(g+L/T)/g,P=(m+k/w)/m}I=O[0]||R?I*_[0]:_[0],P=O[1]||R?P*_[1]:_[1],0===I&&(I=(d[0]>0?1:-1)*ni),0===P&&(P=(d[1]>0?1:-1)*ni);var z=[I/_[0],P/_[1]],W=[I,P];if(!u&&t.props.groupable){var V=(C.snapRenderInfo||{}).direction;E(V)&&(V[0]||V[1])&&(C.snapRenderInfo={direction:p,request:e.isRequest})}var Y=[0,0];if(u||(Y=function(t,e,i,n,r){var s=r.width,o=r.height,a=r.fixedPosition;if(!Nn(t,"scalable"))return[0,0];var h=r.is3d,u=vr(t,(function(t,n){return gr(function(t,e){var i=t.transformOrigin,n=t.offsetMatrix,r=t.is3d?4:3;return yn(n,Xt(t.targetMatrix,ie(e,r),r),i,r)}(r,Ht(e,[t/s,n/o])),s,o,a,i,h)}),s,o,i,a,n,r);return[u[0]/s,u[1]/o]}(t,z,p,f,i)),R){O[0]&&O[1]&&Y[0]&&Y[1]&&(Math.abs(Y[0]*g)>Math.abs(Y[1]*m)?Y[1]=0:Y[0]=0);var $=!Y[0]&&!Y[1];if($&&(y?z[0]=X(z[0]*_[0],A)/_[0]:z[1]=X(z[1]*_[1],A)/_[1]),O[0]&&!O[1]||Y[0]&&!Y[1]||$&&y){z[0]+=Y[0];var q=g*z[0]*_[0]/b;z[1]=q/m/_[1]}else if(!O[0]&&O[1]||!Y[0]&&Y[1]||$&&!y){z[1]+=Y[1];var Z=m*z[1]*_[1]*b;z[0]=Z/g/_[0]}}else z[0]+=Y[0],z[1]+=Y[1],Y[0]||(z[0]=X(z[0]*_[0],A)/_[0]),Y[1]||(z[1]=X(z[1]*_[1],A)/_[1]);0===z[0]&&(z[0]=(d[0]>0?1:-1)*ni),0===z[1]&&(z[1]=(d[1]>0?1:-1)*ni);var K,J,Q=[z[0]/d[0],z[1]/d[1]];J=_,W=[(K=z)[0]*J[0],K[1]*J[1]];var tt=function(t,e,i,n,r){return Sn(t,"scale("+e.join(", ")+")",i,n,r)}(t,z,x,N,i),et=zt(tt,i.prevInverseDist||[0,0]);if(i.prevDist=z,i.prevInverseDist=tt,I===d[0]&&P===d[1]&&et.every((function(t){return!t}))&&!M)return!1;var it=fn(i,"scale("+W.join(", ")+")","scale("+z.join(", ")+")"),nt=Gi(t,e,We({offsetWidth:g,offsetHeight:m,direction:p,scale:W,dist:z,delta:Q,isPinch:!!u},wn(t,it,et,u,e)));return ji(t,"onScale",nt),nt},dragControlEnd:function(t,e){var i=e.datas,n=e.isDrag;return!!i.isScale&&(i.isScale=!1,ji(t,"onScaleEnd",Ui(t,e,{})),n)},dragGroupControlCondition:Ki,dragGroupControlStart:function(t,e){var i=e.datas,n=this.dragControlStart(t,e);if(!n)return!1;var r=on(t,"resizable",e);function s(e,n){var r=i.fixedDirection,s=i.fixedPosition,o=On(e,r),a=Vt(te(-t.rotation/180*Math.PI,3),[o[0]-s[0],o[1]-s[1],1],3),h=a[0],u=a[1];return n.datas.originalX=h,n.datas.originalY=u,n}i.moveableScale=t.scale;var o=hn(t,this,"dragControlStart",e,(function(t,e){return s(t,e)})),a=We(We({},n),{targets:t.props.targets,events:o,setFixedDirection:function(e){n.setFixedDirection(e),o.forEach((function(i,n){i.setFixedDirection(e),s(t.moveables[n],r[n])}))}}),h=ji(t,"onScaleGroupStart",a);return i.isScale=!1!==h,!!i.isScale&&a},dragGroupControl:function(t,e){var i=e.datas;if(i.isScale){var n=this.dragControl(t,e);if(n){var r=i.moveableScale;t.scale=[n.scale[0]*r[0],n.scale[1]*r[1]];var s=t.props.keepRatio,o=n.dist,a=n.scale,h=i.fixedPosition,u=hn(t,this,"dragControl",e,(function(e,i){var n=Vt(te(t.rotation/180*Math.PI,3),[i.datas.originalX*o[0],i.datas.originalY*o[1],1],3),r=n[0],u=n[1];return We(We({},i),{parentDist:null,parentScale:a,parentKeepRatio:s,dragClient:Ht(h,[r,u])})})),l=We({targets:t.props.targets,events:u},n);return ji(t,"onScaleGroup",l),l}}},dragGroupControlEnd:function(t,e){var i=e.isDrag;if(e.datas.isScale)return this.dragControlEnd(t,e),hn(t,this,"dragControlEnd",e),ji(t,"onScaleGroupEnd",Ui(t,e,{targets:t.props.targets})),i},request:function(){var t={},e=0,i=0;return{isControl:!0,requestStart:function(e){return{datas:t,parentDirection:e.direction||[1,1]}},request:function(n){return e+=n.deltaWidth,i+=n.deltaHeight,{datas:t,parentDist:[e,i]}},requestEnd:function(){return{datas:t,isDrag:!0}}}}};function Lr(t,e){return t.map((function(t,i){return(t*2+e[i]*1)/3}))}function kr(t,e,i){var n=G(t,e),r=G(t,i)-n;return r>=0?r:r+2*Math.PI}var Br={name:"warpable",ableGroup:"size",props:{warpable:Boolean,renderDirections:Array},events:{onWarpStart:"warpStart",onWarp:"warp",onWarpEnd:"warpEnd"},render:function(t,e){var i=t.props,n=i.resizable,r=i.scalable,s=i.warpable,o=i.zoom;if(n||r||!s)return[];var a=t.state,h=a.pos1,u=a.pos2,l=a.pos3,c=a.pos4,f=Lr(h,u),d=Lr(u,h),p=Lr(h,l),g=Lr(l,h),m=Lr(l,c),v=Lr(c,l),_=Lr(u,c),y=Lr(c,u);return Ve([e.createElement("div",{className:li("line"),key:"middeLine1",style:Ri(f,m,o)}),e.createElement("div",{className:li("line"),key:"middeLine2",style:Ri(d,v,o)}),e.createElement("div",{className:li("line"),key:"middeLine3",style:Ri(p,_,o)}),e.createElement("div",{className:li("line"),key:"middeLine4",style:Ri(g,y,o)})],Sr(t,e))},dragControlCondition:function(t,e){return!e.isRequest&&z(e.inputEvent.target,li("direction"))},dragControlStart:function(t,e){var i=e.datas,n=e.inputEvent,r=t.props.target,s=Li(n.target);if(!s||!r)return!1;var o=t.state,a=o.transformOrigin,h=o.is3d,u=o.targetTransform,l=o.targetMatrix,c=o.width,f=o.height,d=o.left,p=o.top;return i.datas={},i.targetTransform=u,i.warpTargetMatrix=h?l:Ut(l,3,4),i.targetInverseMatrix=Bt(Ft(i.warpTargetMatrix,4),3,4),i.direction=s,i.left=d,i.top=p,i.poses=[[0,0],[c,0],[0,f],[c,f]].map((function(t){return zt(t,a)})),i.nextPoses=i.poses.map((function(t){var e=t[0],n=t[1];return Vt(i.warpTargetMatrix,[e,n,0,1],4)})),i.startValue=ee(4),i.prevMatrix=ee(4),i.absolutePoses=Bi(o),i.posIndexes=mn(s),ln(t,e),En(e,"matrix3d"),o.snapRenderInfo={request:e.isRequest,direction:s},!1!==ji(t,"onWarpStart",Gi(t,e,We({set:function(t){i.startValue=t}},bn(e))))&&(i.isWarp=!0),i.isWarp},dragControl:function(t,e){var i=e.datas,n=e.isRequest,r=e.distX,s=e.distY,o=i.targetInverseMatrix,a=i.prevMatrix,h=i.isWarp,u=i.startValue,l=i.poses,c=i.posIndexes,f=i.absolutePoses;if(!h)return!1;if(cn(e,"matrix3d"),Nn(t,"warpable")){var d=c.map((function(t){return f[t]}));d.length>1&&d.push([(d[0][0]+d[1][0])/2,(d[0][1]+d[1][1])/2]);var p=cr(t,n,{horizontal:d.map((function(t){return t[1]+s})),vertical:d.map((function(t){return t[0]+r}))}),g=p.horizontal,m=p.vertical;s-=g.offset,r-=m.offset}var v=gn({datas:i,distX:r,distY:s},!0),_=i.nextPoses.slice();if(c.forEach((function(t){_[t]=Ht(_[t],v)})),!ei.every((function(t){return e=t.map((function(t){return l[t]})),i=t.map((function(t){return _[t]})),n=kr(e[0],e[1],e[2]),r=kr(i[0],i[1],i[2]),!(n>=(s=Math.PI)&&r<=s||n<=s&&r>=s);var e,i,n,r,s})))return!1;var y=re(l[0],l[2],l[1],l[3],_[0],_[2],_[1],_[3]);if(!y.length)return!1;var b=dn(i,Xt(o,y,4),!0),E=Xt(Ft(a,4),b,4);i.prevMatrix=b;var x=Xt(u,b,4),T=fn(i,"matrix3d("+x.join(", ")+")","matrix3d("+b.join(", ")+")");return Tn(e,T),ji(t,"onWarp",Gi(t,e,{delta:E,matrix:x,dist:b,multiply:Xt,transform:T})),!0},dragControlEnd:function(t,e){var i=e.datas,n=e.isDrag;return!!i.isWarp&&(i.isWarp=!1,ji(t,"onWarpEnd",Ui(t,e,{})),n)}},Fr=li("area-pieces"),Gr=li("area-piece"),Ur=li("avoid");function jr(t){var e=t.areaElement,i=t.state,n=i.width,r=i.height;!function(t,e){if(t.classList)t.classList.remove(e);else{var i=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(i," ")}}(e,Ur),e.style.cssText+="left: 0px; top: 0px; width: "+n+"px; height: "+r+"px"}function Xr(t){return t.createElement("div",{key:"area_pieces",className:Fr},t.createElement("div",{className:Gr}),t.createElement("div",{className:Gr}),t.createElement("div",{className:Gr}),t.createElement("div",{className:Gr}))}var Hr={name:"dragArea",props:{dragArea:Boolean,passDragArea:Boolean},events:{onClick:"click",onClickGroup:"clickGroup"},render:function(t,e){var i=t.props,n=i.target,s=i.dragArea,o=i.groupable,a=i.passDragArea,h=t.state,u=h.width,l=h.height,c=h.renderPoses,f=a?li("area","pass"):li("area");if(o)return[e.createElement("div",{key:"area",ref:r(t,"areaElement"),className:f}),Xr(e)];if(!n||!s)return[];var d=re([0,0],[u,0],[0,l],[u,l],c[0],c[1],c[2],c[3]),p=d.length?yi(d,!0):"none";return[e.createElement("div",{key:"area",ref:r(t,"areaElement"),className:f,style:{top:"0px",left:"0px",width:u+"px",height:l+"px",transformOrigin:"0 0",transform:p}}),Xr(e)]},dragStart:function(t,e){var i=e.datas,n=e.clientX,r=e.clientY;if(!e.inputEvent)return!1;i.isDragArea=!1;var s,o,a=t.areaElement,h=t.state,u=h.moveableClientRect,l=h.renderPoses,c=h.rootMatrix,f=h.is3d,d=u.left,p=u.top,g=wi(l),m=g.left,v=g.top,_=g.width,y=g.height,b=Vi(c,[n-d,r-p],f?4:3),E=b[0],x=b[1],T=[{left:m,top:v,width:_,height:(x-=v)-10},{left:m,top:v,width:(E-=m)-10,height:y},{left:m,top:v+x+10,width:_,height:y-x-10},{left:m+E+10,top:v,width:_-E-10,height:y}],w=[].slice.call(a.nextElementSibling.children);T.forEach((function(t,e){w[e].style.cssText="left: "+t.left+"px;top: "+t.top+"px; width: "+t.width+"px; height: "+t.height+"px;"})),o=Ur,(s=a).classList?s.classList.add(o):s.className+=" "+o,h.disableNativeEvent=!0},drag:function(t,e){var i=e.datas,n=e.inputEvent;if(this.enableNativeEvent(t),!n)return!1;i.isDragArea||(i.isDragArea=!0,jr(t))},dragEnd:function(t,e){this.enableNativeEvent(t);var i=e.inputEvent,n=e.datas;if(!i)return!1;n.isDragArea||jr(t)},dragGroupStart:function(t,e){return this.dragStart(t,e)},dragGroup:function(t,e){return this.drag(t,e)},dragGroupEnd:function(t,e){return this.dragEnd(t,e)},unset:function(t){jr(t),t.state.disableNativeEvent=!1},enableNativeEvent:function(t){var e=t.state;e.disableNativeEvent&&requestAnimationFrame((function(){e.disableNativeEvent=!1}))}},zr=Ye("origin",{render:function(t,e){var i=t.props.zoom,n=t.state,r=n.beforeOrigin,s=n.rotation;return[e.createElement("div",{className:li("control","origin"),style:Ci(s,i,r),key:"beforeOrigin"})]}});function Wr(t){var e=t.scrollContainer;return[e.scrollLeft,e.scrollTop]}var Vr={name:"scrollable",canPinch:!0,props:{scrollable:Boolean,scrollContainer:Object,scrollThreshold:Number,getScrollPosition:Function},events:{onScroll:"scroll",onScrollGroup:"scrollGroup"},dragStart:function(t,e){var i=t.props.scrollContainer,n=void 0===i?t.getContainer():i,r=new Se,s=Qi(n,!0);e.datas.dragScroll=r;var o=e.isControl?"controlGesto":"targetGesto",a=e.targets;r.on("scroll",(function(i){var n=i.container,r=i.direction,s=Gi(t,e,{scrollContainer:n,direction:r}),o=a?"onScrollGroup":"onScroll";a&&(s.targets=a),ji(t,o,s)})).on("move",(function(i){var n=i.offsetX,r=i.offsetY;t[o].scrollBy(n,r,e.inputEvent,!1)})),r.dragStart(e,{container:s})},checkScroll:function(t,e){var i=e.datas.dragScroll;if(i){var n=t.props,r=n.scrollContainer,s=void 0===r?t.getContainer():r,o=n.scrollThreshold,a=void 0===o?0:o,h=n.getScrollPosition,u=void 0===h?Wr:h;return i.drag(e,{container:s,threshold:a,getScrollPosition:function(t){return u({scrollContainer:t.container,direction:t.direction})}}),!0}},drag:function(t,e){return this.checkScroll(t,e)},dragEnd:function(t,e){e.datas.dragScroll.dragEnd(),e.datas.dragScroll=null},dragControlStart:function(t,e){return this.dragStart(t,We(We({},e),{isControl:!0}))},dragControl:function(t,e){return this.drag(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupStart:function(t,e){return this.dragStart(t,We(We({},e),{targets:t.props.targets}))},dragGroup:function(t,e){return this.drag(t,We(We({},e),{targets:t.props.targets}))},dragGroupEnd:function(t,e){return this.dragEnd(t,We(We({},e),{targets:t.props.targets}))},dragGroupControlStart:function(t,e){return this.dragStart(t,We(We({},e),{targets:t.props.targets,isControl:!0}))},dragGroupContro:function(t,e){return this.drag(t,We(We({},e),{targets:t.props.targets}))},dragGroupControEnd:function(t,e){return this.dragEnd(t,We(We({},e),{targets:t.props.targets}))}},Yr={name:"",props:{target:Object,dragTarget:Object,container:Object,portalContainer:Object,rootContainer:Object,zoom:Number,transformOrigin:Array,edge:Boolean,ables:Array,className:String,pinchThreshold:Number,pinchOutside:Boolean,triggerAblesSimultaneously:Boolean,checkInput:Boolean,cspNonce:String,translateZ:Number,hideDefaultLines:Boolean,props:Object},events:{}},$r=Ye("padding",{render:function(t,e){var i=t.props;if(i.dragArea)return[];var n=i.padding||{},r=n.left,s=void 0===r?0:r,o=n.top,a=void 0===o?0:o,h=n.right,u=void 0===h?0:h,l=n.bottom,c=void 0===l?0:l,f=t.state,d=f.renderPoses,p=[f.pos1,f.pos2,f.pos3,f.pos4],g=[];return s>0&&g.push([0,2]),a>0&&g.push([0,1]),u>0&&g.push([1,3]),c>0&&g.push([2,3]),g.map((function(t,i){var n=t[0],r=t[1],s=re([0,0],[100,0],[0,100],[100,100],p[n],p[r],d[n],d[r]);if(s.length)return e.createElement("div",{key:"padding"+i,className:li("padding"),style:{transform:yi(s,!0)}})}))}}),qr=["nw","ne","se","sw"];function Zr(t,e){var i=t[0]+t[1],n=i>e?e/i:1;return t[0]*=n,t[1]=e-t[1]*n,t}var Kr=[1,2,5,6],Jr=[0,3,4,7],Qr=[1,-1,-1,1],ts=[1,1,-1,-1];function es(t,e,i,n,r,s,o,a,h){void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=n),void 0===h&&(h=r);var u=[],l=!1,c=t.map((function(t,c){var f=e[c],d=f.horizontal,p=f.vertical;if(p&&!l&&(l=!0,u.push("/")),l){var g=Math.max(0,1===p?t[1]-o:h-t[1]);return u.push(qi(g,r,i)),g}return g=Math.max(0,1===d?t[0]-s:a-t[0]),u.push(qi(g,n,i)),g}));return{styles:u,raws:c}}function is(t){for(var e=[0,0],i=[0,0],n=t.length,r=0;r<n;++r){var s=t[r];s.sub&&(s.horizontal&&(0===e[1]&&(e[0]=r),e[1]=r-e[0]+1,i[0]=r+1),s.vertical&&(0===i[1]&&(i[0]=r),i[1]=r-i[0]+1))}return{horizontalRange:e,verticalRange:i}}function ns(t,e,i,n,r,s){var o,a,h,u;void 0===s&&(s=[0,0]);var l=t.indexOf("/"),c=(l>-1?t.slice(0,l):t).length,f=t.slice(0,c),d=t.slice(c+1),p=f[0],g=void 0===p?"0px":p,m=f[1],v=void 0===m?g:m,_=f[2],y=void 0===_?g:_,b=f[3],E=void 0===b?v:b,x=d[0],T=void 0===x?g:x,w=d[1],S=void 0===w?T:w,A=d[2],M=void 0===A?T:A,O=d[3],R=void 0===O?S:O,C=[g,v,y,E].map((function(t){return k(t,e)})),I=[T,S,M,R].map((function(t){return k(t,i)})),P=C.slice(),N=I.slice();o=Zr([P[0],P[1]],e),P[0]=o[0],P[1]=o[1],a=Zr([P[3],P[2]],e),P[3]=a[0],P[2]=a[1],h=Zr([N[0],N[3]],i),N[0]=h[0],N[3]=h[1],u=Zr([N[1],N[2]],i),N[1]=u[0],N[2]=u[1];var D=P.slice(0,Math.max(s[0],f.length)),L=N.slice(0,Math.max(s[1],d.length));return Ve(D.map((function(t,e){var s=qr[e];return{horizontal:Qr[e],vertical:0,pos:[n+t,r+(-1===ts[e]?i:0)],sub:!0,raw:C[e],direction:s}})),L.map((function(t,i){var s=qr[i];return{horizontal:0,vertical:ts[i],pos:[n+(-1===Qr[i]?e:0),r+t],sub:!0,raw:I[i],direction:s}})))}function rs(t,e,i,n,r){void 0===r&&(r=e.length);var s=is(t.slice(n)),o=s.horizontalRange,a=s.verticalRange,h=i-n,u=0;if(0===h)u=r;else if(h>0&&h<o[1])u=o[1]-h;else{if(!(h>=a[0]))return;u=a[0]+a[1]-h}t.splice(i,u),e.splice(i,u)}function ss(t,e,i,n,r,s,o,a,h,u,l){void 0===u&&(u=0),void 0===l&&(l=0);var c=is(t.slice(i)),f=c.horizontalRange,d=c.verticalRange;if(n>-1)for(var p=1===Qr[n]?s-u:a-s,g=f[1];g<=n;++g){var m=1===ts[g]?l:h,v=0;if(n===g?v=s:0===g?v=u+p:-1===Qr[g]&&(v=a-(e[i][0]-u)),t.splice(i+g,0,{horizontal:Qr[g],vertical:0,pos:[v,m]}),e.splice(i+g,0,[v,m]),0===g)break}else if(r>-1){var _=1===ts[r]?o-l:h-o;if(0===f[1]&&0===d[1]){var y=[u+_,l];t.push({horizontal:Qr[0],vertical:0,pos:y}),e.push(y)}var b=d[0];for(g=d[1];g<=r&&(v=1===Qr[g]?u:a,m=0,r===g?m=o:0===g?m=l+_:1===ts[g]?m=e[i+b][1]:-1===ts[g]&&(m=h-(e[i+b][1]-l)),t.push({horizontal:0,vertical:ts[g],pos:[v,m]}),e.push([v,m]),0!==g);++g);}}function os(t,e){return void 0===e&&(e=t.map((function(t){return t.raw}))),{horizontals:t.map((function(t,i){return t.horizontal?e[i]:null})).filter((function(t){return null!=t})),verticals:t.map((function(t,i){return t.vertical?e[i]:null})).filter((function(t){return null!=t}))}}var as=[[0,-1,"n"],[1,0,"e"]],hs=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function us(t,e,i){var n=t.props.clipRelative,r=t.state,s=r.width,o=r.height,a=e,h=a.type,u=a.poses,l="rect"===h,c="circle"===h;if("polygon"===h)return i.map((function(t){return qi(t[0],s,n)+" "+qi(t[1],o,n)}));if(l||"inset"===h){var f=i[1][1],d=i[3][0],p=i[7][0],g=i[5][1];if(l)return[f,d,g,p].map((function(t){return t+"px"}));var m=[f,s-d,o-g,p].map((function(t,e){return qi(t,e%2?s:o,n)}));if(i.length>8){var v=zt(i[4],i[0]),_=v[0],y=v[1];m.push.apply(m,Ve(["round"],es(i.slice(8),u.slice(8),n,_,y,p,f,d,g).styles))}return m}if(c||"ellipse"===h){var b=i[0],E=qi(Math.abs(i[1][1]-b[1]),c?Math.sqrt((s*s+o*o)/2):o,n);return(m=c?[E]:[qi(Math.abs(i[2][0]-b[0]),s,n),E]).push("at",qi(b[0],s,n),qi(b[1],o,n)),m}}function ls(t,e,i,n){var r=[n,(n+e)/2,e],s=[t,(t+i)/2,i];return hs.map((function(t){var e=t[0],i=t[1],n=t[2],o=r[e+1],a=s[i+1];return{vertical:Math.abs(i),horizontal:Math.abs(e),direction:n,pos:[o,a]}}))}function cs(t,e,i,n,r){var s,o,a,h,u,l,c,f=r;if(!f){var d=Xi(t),p=d.clipPath;f="none"!==p?p:d.clip}if(f&&"none"!==f&&"auto"!==f||(f=n)){var g=R(f),m=g.prefix,v=void 0===m?f:m,_=g.value,y=void 0===_?"":_,b="circle"===v,E=" ";if("polygon"===v){E=",";var x=(D=O(y||"0% 0%, 100% 0%, 100% 100%, 0% 100%")).map((function(t){var n=t.split(" "),r=n[0],s=n[1];return{vertical:1,horizontal:1,pos:[k(r,e),k(s,i)]}}));return{type:v,clipText:f,poses:x,splitter:E}}if(b||"ellipse"===v){var T,w,S,A="",I="",P=0,N=0,D=M(y);if(b)T=void 0===(s=D[0])?"50%":s,A=void 0===(o=D[2])?"50%":o,I=void 0===(a=D[3])?"50%":a,P=k(T,Math.sqrt((e*e+i*i)/2)),N=P;else w=void 0===(h=D[0])?"50%":h,S=void 0===(u=D[1])?"50%":u,A=void 0===(l=D[3])?"50%":l,I=void 0===(c=D[4])?"50%":c,P=k(w,e),N=k(S,i);var L=[k(A,e),k(I,i)];return x=Ve([{vertical:1,horizontal:1,pos:L,direction:"nesw"}],as.slice(0,b?1:2).map((function(t){return{vertical:Math.abs(t[1]),horizontal:t[0],direction:t[2],sub:!0,pos:[L[0]+t[0]*P,L[1]+t[1]*N]}}))),{type:v,clipText:f,radiusX:P,radiusY:N,left:L[0]-P,top:L[1]-N,poses:x,splitter:E}}if("inset"===v){var B=(D=M(y||"0 0 0 0")).indexOf("round"),F=(B>-1?D.slice(0,B):D).length,G=D.slice(F+1),U=D.slice(0,F),j=U[0],X=U[1],H=void 0===X?j:X,z=U[2],W=void 0===z?j:z,V=U[3],Y=void 0===V?H:V,$=[j,W].map((function(t){return k(t,i)})),q=$[0],Z=$[1],K=[Y,H].map((function(t){return k(t,e)})),J=K[0],Q=K[1],tt=e-Q,et=i-Z,it=ns(G,tt-J,et-q,J,q);return{type:"inset",clipText:f,poses:x=Ve(ls(q,tt,et,J),it),top:q,left:J,right:tt,bottom:et,radius:G,splitter:E}}if("rect"===v){E=",";var nt=(D=O(y||"0px, "+e+"px, "+i+"px, 0px")).map((function(t){return C(t).value}));return{type:"rect",clipText:f,poses:x=ls(q=nt[0],Q=nt[1],Z=nt[2],J=nt[3]),top:q,right:Q,bottom:Z,left:J,values:D,splitter:E}}}}var fs={name:"clippable",props:{clippable:Boolean,defaultClipPath:String,customClipPath:String,clipRelative:Boolean,clipArea:Boolean,dragWithClip:Boolean,clipTargetBounds:Boolean,clipVerticalGuidelines:Array,clipHorizontalGuidelines:Array,clipSnapThreshold:Boolean},events:{onClipStart:"clipStart",onClip:"clip",onClipEnd:"clipEnd"},css:[".control.clip-control {\n background: #6d6;\n cursor: pointer;\n}\n.control.clip-control.clip-radius {\n background: #d66;\n}\n.line.clip-line {\n background: #6e6;\n cursor: move;\n z-index: 1;\n}\n.clip-area {\n position: absolute;\n top: 0;\n left: 0;\n}\n.clip-ellipse {\n position: absolute;\n cursor: move;\n border: 1px solid #6d6;\n border: var(--zoompx) solid #6d6;\n border-radius: 50%;\n transform-origin: 0px 0px;\n}",":host {\n --bounds-color: #d66;\n}",".guideline {\n pointer-events: none;\n z-index: 2;\n}",".line.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}"],render:function(t,e){var i=t.props,n=i.customClipPath,r=i.defaultClipPath,s=i.clipArea,o=i.zoom,a=t.state,h=a.target,u=a.width,l=a.height,c=a.allMatrix,f=a.is3d,d=a.left,p=a.top,g=a.pos1,m=a.pos2,v=a.pos3,_=a.pos4,y=a.clipPathState,b=a.snapBoundInfos;if(!h)return[];var E=cs(h,u,l,r||"inset",y||n);if(!E)return[];var x=f?4:3,T=E.type,w=E.poses.map((function(t){var e=xi(c,t.pos,x);return[e[0]-d,e[1]-p]})),S=[],A=[],M="rect"===T,O="inset"===T,R="polygon"===T;if(M||O||R){var C=O?w.slice(0,8):w;A=C.map((function(t,i){var n=0===i?C[C.length-1]:C[i-1],r=G(n,t),s=Oi(n,t);return e.createElement("div",{key:"clipLine"+i,className:li("line","clip-line","snap-control"),"data-clip-index":i,style:{width:s+"px",transform:"translate("+n[0]+"px, "+n[1]+"px) rotate("+r+"rad) scaleY("+o+")"}})}))}if(S=w.map((function(t,i){return e.createElement("div",{key:"clipControl"+i,className:li("control","clip-control","snap-control"),"data-clip-index":i,style:{transform:"translate("+t[0]+"px, "+t[1]+"px) scale("+o+")"}})})),O&&S.push.apply(S,w.slice(8).map((function(t,i){return e.createElement("div",{key:"clipRadiusControl"+i,className:li("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+i,style:{transform:"translate("+t[0]+"px, "+t[1]+"px) scale("+o+")"}})}))),"circle"===T||"ellipse"===T){var I=E.left,P=E.top,N=E.radiusX,D=E.radiusY,L=zt(xi(c,[I,P],x),xi(c,[0,0],x)),k=L[0],B=L[1],F="none";if(!s){for(var U=Math.max(10,N/5,D/5),j=[],X=0;X<=U;++X){var H=2*Math.PI/U*X;j.push([N+(N-o)*Math.cos(H),D+(D-o)*Math.sin(H)])}j.push([N,-2]),j.push([-2,-2]),j.push([-2,2*D+2]),j.push([2*N+2,2*D+2]),j.push([2*N+2,-2]),j.push([N,-2]),F="polygon("+j.map((function(t){return t[0]+"px "+t[1]+"px"})).join(", ")+")"}S.push(e.createElement("div",{key:"clipEllipse",className:li("clip-ellipse","snap-control"),style:{width:2*N+"px",height:2*D+"px",clipPath:F,transform:"translate("+(-d+k)+"px, "+(-p+B)+"px) "+yi(c)}}))}if(s){var z=wi(Ve([g,m,v,_],w)),W=z.width,V=z.height,Y=z.left,$=z.top;(R||M||O)&&(j=O?w.slice(0,8):w,S.push(e.createElement("div",{key:"clipArea",className:li("clip-area","snap-control"),style:{width:W+"px",height:V+"px",transform:"translate("+Y+"px, "+$+"px)",clipPath:"polygon("+j.map((function(t){return t[0]-Y+"px "+(t[1]-$)+"px"})).join(", ")+")"}})))}return b&&["vertical","horizontal"].forEach((function(t){var i=b[t],n="horizontal"===t;i.isSnap&&A.push.apply(A,i.snap.posInfos.map((function(i,r){var s=i.pos,a=zt(xi(c,n?[0,s]:[s,0],x),[d,p]),h=zt(xi(c,n?[u,s]:[s,l],x),[d,p]);return wr(e,"",a,h,o,"clip"+t+"snap"+r,"guideline")}))),i.isBound&&A.push.apply(A,i.bounds.map((function(i,r){var s=i.pos,a=zt(xi(c,n?[0,s]:[s,0],x),[d,p]),h=zt(xi(c,n?[u,s]:[s,l],x),[d,p]);return wr(e,"",a,h,o,"clip"+t+"bounds"+r,"guideline","bounds","bold")})))})),Ve(S,A)},dragControlCondition:function(t,e){return e.inputEvent&&(e.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(t,e){var i=t.props.dragWithClip;return!(void 0===i||i)&&this.dragControlStart(t,e)},drag:function(t,e){return this.dragControl(t,e)},dragEnd:function(t,e){return this.dragControlEnd(t,e)},dragControlStart:function(t,e){var i=t.state,n=t.props,r=n.defaultClipPath,s=n.customClipPath,o=i.target,a=i.width,h=i.height,u=e.inputEvent?e.inputEvent.target:null,l=u?u.getAttribute("class"):"",c=e.datas,f=cs(o,a,h,r||"inset",s);if(!f)return!1;var d=f.clipText;return!1===ji(t,"onClipStart",Gi(t,e,{clipType:f.type,clipStyle:d,poses:f.poses.map((function(t){return t.pos}))}))?(c.isClipStart=!1,!1):(c.isControl=l.indexOf("clip-control")>-1,c.isLine=l.indexOf("clip-line")>-1,c.isArea=l.indexOf("clip-area")>-1||l.indexOf("clip-ellipse")>-1,c.index=u?parseInt(u.getAttribute("data-clip-index"),10):-1,c.clipPath=f,c.isClipStart=!0,i.clipPathState=d,ln(t,e),!0)},dragControl:function(t,e){var i=e.datas,n=e.originalDatas;if(!i.isClipStart)return!1;var r=n&&n.draggable||{},s=i,o=s.isControl,a=s.isLine,h=s.isArea,u=s.index,l=s.clipPath;if(!l)return!1;var c=r.isDrag?r.prevDist:gn(e),f=c[0],d=c[1],p=t.props,g=t.state,m=g.width,v=g.height,_=!h&&!o&&!a,y=l.type,b=l.poses,E=l.splitter,x=b.map((function(t){return t.pos}));_&&(f=-f,d=-d);var T=!o||"nesw"===b[u].direction,w="inset"===y||"rect"===y,S=b.map((function(){return[0,0]}));if(o&&!T){var A=b[u],M=A.horizontal,O=A.vertical,R=[f*Math.abs(M),d*Math.abs(O)];S=function(t,e,i,n){var r=t[e],s=r.direction,o=r.sub,a=t.map((function(){return[0,0]})),h=s?s.split(""):[];if(n&&e<8){var u=h.filter((function(t){return"w"===t||"e"===t}))[0],l=h.filter((function(t){return"n"===t||"s"===t}))[0];a[e]=i,t.forEach((function(t,e){var n=t.direction;n&&(n.indexOf(u)>-1&&(a[e][0]=i[0]),n.indexOf(l)>-1&&(a[e][1]=i[1]))})),u&&(a[1][0]=i[0]/2,a[5][0]=i[0]/2),l&&(a[3][1]=i[1]/2,a[7][1]=i[1]/2)}else s&&!o?h.forEach((function(e){var n="n"===e||"s"===e;t.forEach((function(t,r){var s=t.direction,o=t.horizontal,h=t.vertical;s&&-1!==s.indexOf(e)&&(a[r]=[n||!o?0:i[0],n&&h?i[1]:0])}))})):a[e]=i;return a}(b,u,R,w)}else T&&(S=x.map((function(){return[f,d]})));var C=x.map((function(t,e){return Ht(t,S[e])})),I=Ve(C);g.snapBoundInfos=null;var P="circle"===l.type,N="ellipse"===l.type;if(P||N){var D=wi(C),L=Math.abs(D.bottom-D.top),B=Math.abs(N?D.right-D.left:L),F=C[0][1]+L,G=C[0][0]-B,U=C[0][0]+B;P&&(I.push([U,D.bottom]),S.push([1,0])),I.push([D.left,F]),S.push([0,1]),I.push([G,D.bottom]),S.push([1,0])}var j=kn((p.clipHorizontalGuidelines||[]).map((function(t){return k(""+t,v)})),(p.clipVerticalGuidelines||[]).map((function(t){return k(""+t,m)})),m,v),X=[],H=[];if(P||N)X=[I[4][0],I[2][0]],H=[I[1][1],I[3][1]];else if(w){var z=[I[0],I[2],I[4],I[6]],W=[S[0],S[2],S[4],S[6]];X=z.filter((function(t,e){return W[e][0]})).map((function(t){return t[0]})),H=z.filter((function(t,e){return W[e][1]})).map((function(t){return t[1]}))}else X=I.filter((function(t,e){return S[e][0]})).map((function(t){return t[0]})),H=I.filter((function(t,e){return S[e][1]})).map((function(t){return t[1]}));for(var V=[0,0],Y=function(t){var e=fr(j,p.clipTargetBounds&&{left:0,top:0,right:m,bottom:v},X,H,5),i=e.horizontal,n=e.vertical,r=i.offset,s=n.offset;if(i.isBound&&(V[1]+=r),n.isBound&&(V[0]+=s),!N&&!P||0!==S[0][0]||0!==S[0][1])return I.forEach((function(t,e){var i=S[e];i[0]&&(t[0]-=s),i[1]&&(t[1]-=r)})),"break";var o=wi(C),a=o.bottom-o.top,h=N?o.right-o.left:a;h-=n.isBound?Math.abs(s):0===n.snapIndex?-s:s,a-=i.isBound?Math.abs(r):0===i.snapIndex?-r:r,P&&(h=a=zn(n,i)>0?a:h);var u=I[0];I[1][1]=u[1]-a,I[2][0]=u[0]+h,I[3][1]=u[1]+a,I[4][0]=u[0]-h},$=0;$<2&&"break"!==Y();++$);var q=us(t,l,C),Z=y+"("+q.join(E)+")";return g.clipPathState=Z,P||N?(X=[I[4][0],I[2][0]],H=[I[1][1],I[3][1]]):w?(z=[I[0],I[2],I[4],I[6]],X=z.map((function(t){return t[0]})),H=z.map((function(t){return t[1]}))):(X=I.map((function(t){return t[0]})),H=I.map((function(t){return t[1]}))),g.snapBoundInfos=fr(j,p.clipTargetBounds&&{left:0,top:0,right:m,bottom:v},X,H,1),n.draggable&&(n.draggable.deltaOffset=V),ji(t,"onClip",Gi(t,e,{clipEventType:"changed",clipType:y,poses:C,clipStyle:Z,clipStyles:q,distX:f,distY:d})),!0},dragControlEnd:function(t,e){this.unset(t);var i=e.isDrag,n=e.datas,r=e.isDouble,s=n.isLine,o=n.isClipStart,a=n.isControl;return!!o&&(ji(t,"onClipEnd",Ui(t,e,{})),r&&(a?function(t,e){var i=e.datas,n=i.clipPath,r=i.index,s=n,o=s.type,a=s.poses,h=s.splitter,u=a.map((function(t){return t.pos})),l=u.length;if("polygon"===o)a.splice(r,1),u.splice(r,1);else{if("inset"!==o)return;if(r<8)return;if(rs(a,u,r,8,l),l===a.length)return}var c=us(t,n,u);ji(t,"onClip",Gi(t,e,{clipEventType:"removed",clipType:o,poses:u,clipStyles:c,clipStyle:o+"("+c.join(h)+")",distX:0,distY:0}))}(t,e):s&&function(t,e){var i=un(t,e),n=i[0],r=i[1],s=e.datas,o=s.clipPath,a=s.index,h=o,u=h.type,l=h.poses,c=h.splitter,f=l.map((function(t){return t.pos}));if("polygon"===u)f.splice(a,0,[n,r]);else{if("inset"!==u)return;var d=Kr.indexOf(a),p=Jr.indexOf(a),g=l.length;if(ss(l,f,8,d,p,n,r,f[4][0],f[4][1],f[0][0],f[0][1]),g===l.length)return}var m=us(t,o,f);ji(t,"onClip",Gi(t,e,{clipEventType:"added",clipType:u,poses:f,clipStyles:m,clipStyle:u+"("+m.join(c)+")",distX:0,distY:0}))}(t,e)),r||i)},unset:function(t){t.state.clipPathState="",t.state.snapBoundInfos=null}},ds={name:"originDraggable",props:{originDraggable:Boolean,originRelative:Boolean},events:{onDragOriginStart:"dragOriginStart",onDragOrigin:"dragOrigin",onDragOriginEnd:"dragOriginEnd"},css:[":host[data-able-origindraggable] .control.origin {\n pointer-events: auto;\n}"],dragControlCondition:function(t,e){return e.isRequest?"originDraggable"===e.requestAble:z(e.inputEvent.target,li("origin"))},dragControlStart:function(t,e){var i=e.datas;ln(t,e);var n=Gi(t,e,{dragStart:xr.dragStart(t,(new sn).dragStart([0,0],e))}),r=ji(t,"onDragOriginStart",n);return i.startOrigin=t.state.transformOrigin,i.startTargetOrigin=t.state.targetOrigin,i.prevOrigin=[0,0],i.isDragOrigin=!0,!1===r?(i.isDragOrigin=!1,!1):n},dragControl:function(t,e){var i=e.datas,n=e.isPinch,r=e.isRequest;if(!i.isDragOrigin)return!1;var s=gn(e),o=s[0],a=s[1],h=t.state,u=h.width,l=h.height,c=h.offsetMatrix,f=h.targetMatrix,d=h.is3d,p=t.props.originRelative,g=void 0===p||p,m=d?4:3,v=[o,a];if(r){var _=e.distOrigin;(_[0]||_[1])&&(v=_)}var y=Ht(i.startOrigin,v),b=Ht(i.startTargetOrigin,v),E=zt(v,i.prevOrigin),x=yn(c,f,y,m),T=t.getRect(),w=wi(Ti(x,u,l,m)),S=[T.left-w.left,T.top-w.top];i.prevOrigin=v;var A=Gi(t,e,{width:u,height:l,origin:y,dist:v,delta:E,transformOrigin:[qi(b[0],u,g),qi(b[1],l,g)].join(" "),drag:xr.drag(t,rn(e,t.state,S,!!n,!1))});return ji(t,"onDragOrigin",A),A},dragControlEnd:function(t,e){return!!e.datas.isDragOrigin&&(ji(t,"onDragOriginEnd",Ui(t,e,{})),!0)},dragGroupControlCondition:function(t,e){return this.dragControlCondition(t,e)},dragGroupControlStart:function(t,e){return!!this.dragControlStart(t,e)},dragGroupControl:function(t,e){var i=this.dragControl(t,e);return!!i&&(t.transformOrigin=i.transformOrigin,!0)},request:function(t){var e={},i=t.getRect(),n=0,r=0,s=i.transformOrigin,o=[0,0];return{isControl:!0,requestStart:function(){return{datas:e}},request:function(t){return"deltaOrigin"in t?(o[0]+=t.deltaOrigin[0],o[1]+=t.deltaOrigin[1]):"origin"in t?(o[0]=t.origin[0]-s[0],o[1]=t.origin[1]-s[1]):("x"in t?n=t.x-i.left:"deltaX"in t&&(n+=t.deltaX),"y"in t?r=t.y-i.top:"deltaY"in t&&(r+=t.deltaY)),{datas:e,distX:n,distY:r,distOrigin:o}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function ps(t,e,i,n,r){var s;if(void 0===n&&(n=[0,0]),r)s=r;else{var o=Xi(t);s=o&&o.borderRadius||""}return ns(!s||!r&&"0px"===s?[]:M(s),e,i,0,0,n)}function gs(t,e,i,n,r,s){var o=t.state,a=o.width,h=o.height,u=es(s,r,t.props.roundRelative,a,h),l=u.raws,c=u.styles,f=os(r,l),d=f.horizontals,p=f.verticals,g=c.join(" ");o.borderRadiusState=g,ji(t,"onRound",Gi(t,e,{horizontals:d,verticals:p,borderRadius:g,width:a,height:h,delta:n,dist:i}))}var ms={name:"roundable",props:{roundable:Boolean,roundRelative:Boolean,minRoundControls:Array,maxRoundControls:Array,roundClickable:Boolean},events:{onRoundStart:"roundStart",onRound:"round",onRoundEnd:"roundEnd"},css:[".control.border-radius {\n background: #d66;\n cursor: pointer;\n}",":host[data-able-roundable] .line.direction {\n cursor: pointer;\n}"],render:function(t,e){var i=t.state,n=i.target,r=i.width,s=i.height,o=i.allMatrix,a=i.is3d,h=i.left,u=i.top,l=i.borderRadiusState,c=t.props,f=c.minRoundControls,d=void 0===f?[0,0]:f,p=c.maxRoundControls,g=void 0===p?[4,4]:p,m=c.zoom;if(!n)return null;var v=a?4:3,_=ps(n,r,s,d,l);if(!_)return null;var y=0,b=0;return _.map((function(t,i){b+=Math.abs(t.horizontal),y+=Math.abs(t.vertical);var n=zt(xi(o,t.pos,v),[h,u]),r=t.vertical?y<=g[1]:b<=g[0];return e.createElement("div",{key:"borderRadiusControl"+i,className:li("control","border-radius"),"data-radius-index":i,style:{display:r?"block":"none",transform:"translate("+n[0]+"px, "+n[1]+"px) scale("+m+")"}})}))},dragControlCondition:function(t,e){if(!e.inputEvent||e.isRequest)return!1;var i=e.inputEvent.target.getAttribute("class")||"";return i.indexOf("border-radius")>-1||i.indexOf("moveable-line")>-1&&i.indexOf("moveable-direction")>-1},dragControlStart:function(t,e){var i=e.inputEvent,n=e.datas,r=i.target,s=r.getAttribute("class")||"",o=s.indexOf("border-radius")>-1,a=s.indexOf("moveable-line")>-1&&s.indexOf("moveable-direction")>-1,h=o?parseInt(r.getAttribute("data-radius-index"),10):-1,u=a?parseInt(r.getAttribute("data-line-index"),10):-1;if(!o&&!a)return!1;if(!1===ji(t,"onRoundStart",Gi(t,e,{})))return!1;n.lineIndex=u,n.controlIndex=h,n.isControl=o,n.isLine=a,ln(t,e);var l=t.props,c=l.roundRelative,f=l.minRoundControls,d=void 0===f?[0,0]:f,p=t.state,g=p.target,m=p.width,v=p.height;n.isRound=!0,n.prevDist=[0,0];var _=ps(g,m,v,d)||[];return n.controlPoses=_,p.borderRadiusState=es(_.map((function(t){return t.pos})),_,c,m,v).styles.join(" "),!0},dragControl:function(t,e){var i=e.datas;if(!i.isRound||!i.isControl||!i.controlPoses.length)return!1;var n=i.controlIndex,r=i.controlPoses,s=gn(e),o=s[0],a=s[1],h=[o,a],u=zt(h,i.prevDist),l=t.props.maxRoundControls,c=void 0===l?[4,4]:l,f=t.state,d=f.width,p=f.height,g=r[n],m=g.vertical,v=g.horizontal,_=r.map((function(t){var e=t.horizontal,i=t.vertical,n=[e*v*h[0],i*m*h[1]];if(e){if(1===c[0])return n;if(c[0]<4&&e!==v)return n}else{if(0===c[1])return n[1]=i*v*h[0]/d*p,n;if(m){if(1===c[1])return n;if(c[1]<4&&i!==m)return n}}return[0,0]}));_[n]=h;var y=r.map((function(t,e){return Ht(t.pos,_[e])}));return i.prevDist=[o,a],gs(t,e,h,u,r,y),!0},dragControlEnd:function(t,e){var i=t.state;i.borderRadiusState="";var n=e.datas,r=e.isDouble;if(!n.isRound)return!1;var s=i.width,o=i.height,a=n.isControl,h=n.controlIndex,u=n.isLine,l=n.lineIndex,c=n.controlPoses,f=c.map((function(t){return t.pos})),d=f.length,p=t.props.roundClickable;if(r&&(void 0===p||p)){if(a)rs(c,f,h,0);else if(u){var g=un(t,e);!function(t,e,i,n,r,s,o){var a=os(t),h=a.horizontals,u=a.verticals,l=h.length,c=u.length,f=-1,d=-1;0===i?0===l?f=0:1===l&&(f=1):3===i&&(l<=2?f=2:l<=3&&(f=3)),2===i?0===c?d=0:c<4&&(d=3):1===i&&(c<=1?d=1:c<=2&&(d=2)),ss(t,e,0,f,d,n,r,s,o)}(c,f,l,g[0],g[1],s,o)}d!==c.length&&gs(t,e,[0,0],[0,0],c,f)}return ji(t,"onRoundEnd",Ui(t,e,{})),i.borderRadiusState="",!0},unset:function(t){t.state.borderRadiusState=""}},vs={isPinch:!0,name:"beforeRenderable",props:{},events:{onBeforeRenderStart:"beforeRenderStart",onBeforeRender:"beforeRender",onBeforeRenderEnd:"beforeRenderEnd",onBeforeRenderGroupStart:"beforeRenderGroupStart",onBeforeRenderGroup:"beforeRenderGroup",onBeforeRenderGroupEnd:"beforeRenderGroupEnd"},setTransform:function(t,e){var i=t.state,n=i.is3d,r=i.target,s=i.targetMatrix,o=null==r?void 0:r.style.transform,a=n?"matrix3d("+s.join(",")+")":"matrix("+Wt(s,!0)+")";e.datas.startTransforms=o&&"none"!==o?M(o):[a]},resetTransform:function(t,e){e.datas.nextTransforms=e.datas.startTransforms,e.datas.nextTransformAppendedIndexes=[]},fillDragStartParams:function(t,e){return Gi(t,e,{setTransform:function(t){e.datas.startTransforms=E(t)?t:M(t)},isPinch:!!e.isPinch})},fillDragParams:function(t,e){return Gi(t,e,{isPinch:!!e.isPinch})},dragStart:function(t,e){this.setTransform(t,e),ji(t,"onBeforeRenderStart",this.fillDragStartParams(t,e))},drag:function(t,e){this.resetTransform(t,e),ji(t,"onBeforeRender",Gi(t,e,{isPinch:!!e.isPinch}))},dragEnd:function(t,e){ji(t,"onBeforeRenderEnd",Gi(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag}))},dragGroupStart:function(t,e){var i=this;this.dragStart(t,e);var n=on(t,"beforeRenderable",e),r=t.moveables,s=n.map((function(t,e){var n=r[e];return i.setTransform(n,t),i.fillDragStartParams(n,t)}));ji(t,"onBeforeRenderGroupStart",Gi(t,e,{isPinch:!!e.isPinch,targets:t.props.targets,setTransform:function(){},events:s}))},dragGroup:function(t,e){var i=this;this.drag(t,e);var n=on(t,"beforeRenderable",e),r=t.moveables,s=n.map((function(t,e){var n=r[e];return i.resetTransform(n,t),i.fillDragParams(n,t)}));ji(t,"onBeforeRenderGroup",Gi(t,e,{isPinch:!!e.isPinch,targets:t.props.targets,events:s}))},dragGroupEnd:function(t,e){this.dragEnd(t,e),ji(t,"onBeforeRenderGroupEnd",Gi(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag,targets:t.props.targets}))},dragControlStart:function(t,e){return this.dragStart(t,e)},dragControl:function(t,e){return this.drag(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupControlStart:function(t,e){return this.dragGroupStart(t,e)},dragGroupControl:function(t,e){return this.dragGroup(t,e)},dragGroupControlEnd:function(t,e){return this.dragGroupEnd(t,e)}},_s={name:"renderable",props:{},events:{onRenderStart:"renderStart",onRender:"render",onRenderEnd:"renderEnd",onRenderGroupStart:"renderGroupStart",onRenderGroup:"renderGroup",onRenderGroupEnd:"renderGroupEnd"},dragStart:function(t,e){ji(t,"onRenderStart",Gi(t,e,{isPinch:!!e.isPinch}))},drag:function(t,e){ji(t,"onRender",Gi(t,e,{isPinch:!!e.isPinch}))},dragEnd:function(t,e){ji(t,"onRenderEnd",Gi(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag}))},dragGroupStart:function(t,e){ji(t,"onRenderGroupStart",Gi(t,e,{isPinch:!!e.isPinch,targets:t.props.targets}))},dragGroup:function(t,e){ji(t,"onRenderGroup",Gi(t,e,{isPinch:!!e.isPinch,targets:t.props.targets}))},dragGroupEnd:function(t,e){ji(t,"onRenderGroupEnd",Gi(t,e,{isPinch:!!e.isPinch,isDrag:e.isDrag,targets:t.props.targets}))},dragControlStart:function(t,e){return this.dragStart(t,e)},dragControl:function(t,e){return this.drag(t,e)},dragControlEnd:function(t,e){return this.dragEnd(t,e)},dragGroupControlStart:function(t,e){return this.dragGroupStart(t,e)},dragGroupControl:function(t,e){return this.dragGroup(t,e)},dragGroupControlEnd:function(t,e){return this.dragGroupEnd(t,e)}};function ys(t,e,i,n,r,s,o){var a="Start"===r,h=t.state.target,u=s.isRequest;if(!h||a&&n.indexOf("Control")>-1&&!u&&t.areaElement===s.inputEvent.target)return!1;var l=""+i+n+r,c=""+i+n+"Condition",f="End"===r,d=r.indexOf("After")>-1,p=a&&(!t.targetGesto||!t.controlGesto||!t.targetGesto.isFlag()||!t.controlGesto.isFlag());p&&t.updateRect(r,!0,!1),""!==r||d||u||Yi(t.state,s);var g=Ve([vs],t[e],[_s]);if(u){var m=s.requestAble;g.some((function(t){return t.name===m}))||g.push.apply(g,t.props.ables.filter((function(t){return t.name===m})))}if(!g.length)return!1;var v=g.filter((function(t){return t[l]})),_=s.datas;p&&v.forEach((function(e){e.unset&&e.unset(t)}));var y,b=s.inputEvent;f&&b&&(y=document.elementFromPoint(s.clientX,s.clientY)||b.target);var E=v.filter((function(e){var i=e.name,n=_[i]||(_[i]={});return a&&(n.isEventStart=!e[c]||e[c](t,s)),!!n.isEventStart&&e[l](t,We(We({},s),{datas:n,originalDatas:_,inputTarget:y}))})).length,x=a&&v.length&&!E;return(f||x)&&(t.state.gesto=null,t.moveables&&t.moveables.forEach((function(t){t.state.gesto=null}))),p&&x&&v.forEach((function(e){e.unset&&e.unset(t)})),!t.isUnmounted&&!x&&((!a&&E&&!o||f)&&(t.updateRect(r,!0,!1),t.forceUpdate()),a||f||d||!E||o||ys(t,e,i,n,r+"After",s),!0)}function bs(t,e,i){var n=t.controlBox.getElement(),r=[];r.push(n),t.props.dragArea&&!t.props.dragTarget||r.push(e);var s=function(e){var i=e.inputEvent.target;return i===t.areaElement||!t.isMoveableElement(i)||z(i,"moveable-area")||z(i,"moveable-padding")};return Es(t,r,"targetAbles",i,{dragStart:s,pinchStart:s})}function Es(t,e,i,n,r){void 0===r&&(r={});var s=t.props,o=s.pinchOutside,a=s.pinchThreshold,h={container:window,pinchThreshold:a,pinchOutside:o},u=new ke(e,h);return["drag","pinch"].forEach((function(e){["Start","","End"].forEach((function(s){u.on(""+e+s,(function(o){var a=o.eventType;(!r[a]||r[a](o))&&ys(t,i,e,n,s,o)||o.stop()}))}))})),u}var xs=function(){function t(t,e,i){var n=this;this.target=t,this.moveable=e,this.eventName=i,this.ables=[],this.onEvent=function(t){var e=n.eventName,i=n.moveable;i.state.disableNativeEvent||n.ables.forEach((function(n){n[e](i,{inputEvent:t})}))},this.target.addEventListener(this.eventName.toLowerCase(),this.onEvent)}var e=t.prototype;return e.setAbles=function(t){this.ables=t},e.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this.onEvent),this.target=null,this.moveable=null},t}(),Ts=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=We({container:null,gesto:null,renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1},Ni(null)),e.enabledAbles=[],e.targetAbles=[],e.controlAbles=[],e.rotation=0,e.scale=[1,1],e.isUnmounted=!1,e.events={mouseEnter:null,mouseLeave:null},e.onPreventClick=function(t){t.stopPropagation(),V(window,"click",e.onPreventClick,!0)},e}ze(e,t);var i=e.prototype;return i.render=function(){var t=this.props,e=this.state,i=t.parentPosition,n=t.className,s=t.target,o=t.zoom,a=t.cspNonce,h=t.translateZ,u=t.cssStyled,l=t.portalContainer;this.checkUpdate(),this.updateRenderPoses();var c=i||{left:0,top:0},f=c.left,d=c.top,p=e.left,g=e.top,m=e.target,v=e.direction,_=t.targets,y=(_&&_.length||s)&&m,b=this.isDragging(),E={};return this.getEnabledAbles().forEach((function(t){E["data-able-"+t.name.toLowerCase()]=!0})),st(u,We({cspNonce:a,ref:r(this,"controlBox"),className:li("control-box",-1===v?"reverse":"",b?"dragging":"")+" "+n},E,{onClick:this.onPreventClick,portalContainer:l,style:{position:"absolute",display:y?"block":"none",transform:"translate3d("+(p-f)+"px, "+(g-d)+"px, "+h+")","--zoom":o,"--zoompx":o+"px"}}),this.renderAbles(),this._renderLines())},i.componentDidMount=function(){this.controlBox.getElement();var t=this.props,e=t.parentMoveable,i=t.container,n=t.wrapperMoveable;this.updateEvent(t),this.updateNativeEvents(t),i||e||n||this.updateRect("",!1,!0),this.updateCheckInput()},i.componentDidUpdate=function(t){this.updateNativeEvents(t),this.updateEvent(t),this.updateCheckInput()},i.componentWillUnmount=function(){this.isUnmounted=!0,Fi(this,"targetGesto"),Fi(this,"controlGesto");var t=this.events;for(var e in t){var i=t[e];i&&i.destroy()}},i.getContainer=function(){var t=this.props,e=t.parentMoveable,i=t.wrapperMoveable;return t.container||i&&i.getContainer()||e&&e.getContainer()||this.controlBox.getElement().parentElement},i.isMoveableElement=function(t){return t&&(t.getAttribute("class")||"").indexOf(Qe)>-1},i.dragStart=function(t){return this.targetGesto&&this.targetGesto.triggerDragStart(t),this},i.hitTest=function(t){var e,i=this.state,n=i.target,r=i.pos1,s=i.pos2,o=i.pos3,a=i.pos4,h=i.targetClientRect;if(!n)return 0;if(t instanceof Element){var u=t.getBoundingClientRect();e={left:u.left,top:u.top,width:u.width,height:u.height}}else e=We({width:0,height:0},t);var l=e.left,c=e.top,f=e.width,d=e.height,p=fe([r,s,a,o],h),g=function(t,e){var i=function(t,e){var i=t.slice(),n=e.slice();-1===U(i)&&i.reverse(),-1===U(n)&&n.reverse();var r=_e(i),s=_e(n),o=r.map((function(t){return ge(t[0],t[1])})),a=s.map((function(t){return ge(t[0],t[1])})),h=[];o.forEach((function(t,e){var i=r[e],o=[];a.forEach((function(n,r){var a=ve(me(t,n),[i,s[r]]);o.push.apply(o,a.map((function(t){return{index1:e,index2:r,pos:t}})))})),o.sort((function(t,e){return j(i[0],t.pos)-j(i[0],e.pos)})),h.push.apply(h,o),pe(i[1],n)&&h.push({index1:e,index2:-1,pos:i[1]})})),s.forEach((function(t,e){if(pe(t[1],i)){var n=!1,r=N(h,(function(t){return t.index2===e?(n=!0,!1):!!n}));-1===r&&(n=!1,r=N(h,(function(t){var i=t.index1,r=t.index2;return-1===i&&r+1===e?(n=!0,!1):!!n}))),-1===r?h.push({index1:-1,index2:e,pos:t[1]}):h.splice(r,0,{index1:-1,index2:e,pos:t[1]})}}));var u=h.map((function(t){return t.pos})),l={};return u.filter((function(t){var e=t[0]+"x"+t[1];return!l[e]&&(l[e]=!0,!0)}))}(t,e);return ce(i)}(p,[[l,c],[l+f,c],[l+f,c+d],[l,c+d]]),m=ce(p);return g&&m?Math.min(100,g/m*100):0},i.isInside=function(t,e){var i=this.state,n=i.target,r=i.pos1,s=i.pos2,o=i.pos3,a=i.pos4,h=i.targetClientRect;return!!n&&pe([t,e],fe([r,s,a,o],h))},i.updateRect=function(t,e,i){void 0===i&&(i=!0);var n=this.props,r=n.parentMoveable,s=this.state.target||this.props.target,o=this.getContainer(),a=r?r.props.rootContainer:n.rootContainer;this.updateState(Ni(this.controlBox&&this.controlBox.getElement(),s,o,o,a||o),!r&&i)},i.isTargetChanged=function(t,e){var i=this.props,n=i.dragTarget||i.target,r=t.dragTarget||t.target,s=i.dragArea,o=t.dragArea;return!s&&r!==n||(e||s)&&o!==s},i.updateNativeEvents=function(t){var e=this,i=this.props.dragArea?this.areaElement:this.state.target,n=this.events,r=L(n);if(this.isTargetChanged(t))for(var s in n){var o=n[s];o&&o.destroy(),n[s]=null}if(i){var a=this.enabledAbles;r.forEach((function(t){var r=Hi(a,[t]),s=r.length>0,o=n[t];s?(o||(o=new xs(i,e,t),n[t]=o),o.setAbles(r)):o&&(o.destroy(),n[t]=null)}))}},i.updateEvent=function(t){var e=this.controlBox.getElement(),i=this.targetAbles.length,n=this.controlAbles.length,r=this.props,s=r.dragTarget||r.target,o=this.isTargetChanged(t,!0),a=!i&&this.targetGesto||o;a&&(Fi(this,"targetGesto"),this.updateState({gesto:null})),n||Fi(this,"controlGesto"),s&&i&&!this.targetGesto&&(this.targetGesto=bs(this,s,"")),!this.controlGesto&&n&&(this.controlGesto=Es(this,e,"controlAbles","Control")),a&&this.unsetAbles()},i.isDragging=function(){return!!this.targetGesto&&this.targetGesto.isFlag()||!!this.controlGesto&&this.controlGesto.isFlag()},i.updateTarget=function(t){this.updateRect(t,!0)},i.getRect=function(){var t=this.state,e=Bi(this.state),i=e[0],n=e[1],r=e[2],s=e[3],o=wi(e),a=t.width,h=t.height,u=o.width,l=o.height,c=o.left,f=o.top,d=[t.left,t.top],p=Ht(d,t.origin);return{width:u,height:l,left:c,top:f,pos1:i,pos2:n,pos3:r,pos4:s,offsetWidth:a,offsetHeight:h,beforeOrigin:Ht(d,t.beforeOrigin),origin:p,transformOrigin:t.transformOrigin,rotation:this.getRotation()}},i.getManager=function(){return this},i.getRotation=function(){var t,e,i,n,r=this.state;return t=r.pos1,e=r.pos2,i=r.direction,n=G(t,e)/Math.PI*180,(n=i>=0?n:180-n)>=0?n:360+n},i.request=function(t,e,i){void 0===e&&(e={});var n=this.props,r=n.ables,s=n.groupable,o=r.filter((function(e){return e.name===t}))[0];if(this.isDragging()||!o||!o.request)return{request:function(){return this},requestEnd:function(){return this}};var a=this,h=o.request(this),u=i||e.isInstant,l=h.isControl?"controlAbles":"targetAbles",c=(s?"Group":"")+(h.isControl?"Control":""),f={request:function(e){return ys(a,l,"drag",c,"",We(We({},h.request(e)),{requestAble:t,isRequest:!0}),u),this},requestEnd:function(){return ys(a,l,"drag",c,"End",We(We({},h.requestEnd()),{requestAble:t,isRequest:!0}),u),this}};return ys(a,l,"drag",c,"Start",We(We({},h.requestStart(e)),{requestAble:t,isRequest:!0}),u),u?f.request(e).requestEnd():f},i.destroy=function(){this.componentWillUnmount()},i.updateRenderPoses=function(){var t=this.state,e=this.props,i=t.originalBeforeOrigin,n=t.transformOrigin,r=t.allMatrix,s=t.is3d,o=t.pos1,a=t.pos2,h=t.pos3,u=t.pos4,l=t.left,c=t.top,f=e.padding||{},d=f.left,p=void 0===d?0:d,g=f.top,m=void 0===g?0:g,v=f.bottom,_=void 0===v?0:v,y=f.right,b=void 0===y?0:y,E=s?4:3,x=e.groupable?i:Ht(i,[l,c]);t.renderPoses=[Ht(o,$i(r,[-p,-m],n,x,E)),Ht(a,$i(r,[b,-m],n,x,E)),Ht(h,$i(r,[-p,_],n,x,E)),Ht(u,$i(r,[b,_],n,x,E))]},i.checkUpdate=function(){var t=this.props,e=t.target,i=t.container,n=t.parentMoveable,r=this.state,s=r.target,o=r.container;(s||e)&&(this.updateAbles(),(!zi(s,e)||!zi(o,i))&&(this.updateState({target:e,container:i}),n||!i&&!this.controlBox||this.updateRect("End",!1,!1)))},i.triggerEvent=function(t,e){var i=this.props[t];return i&&i(e)},i.useCSS=function(t,e){var i=this.props.customStyledMap,n=t+e;return i[n]||(i[n]=Xe(t,e)),i[n]},i.unsetAbles=function(){var t=this;this.targetAbles.filter((function(e){return!!e.unset&&(e.unset(t),!0)})).length&&this.forceUpdate()},i.updateAbles=function(t,e){void 0===t&&(t=this.props.ables),void 0===e&&(e="");var i=this.props,n=i.triggerAblesSimultaneously,r=t.filter((function(t){return t&&(t.always||i[t.name])})),s="drag"+e+"ControlStart",o=Hi(r,["drag"+e+"Start","pinch"+e+"Start"],n),a=Hi(r,[s],n);this.enabledAbles=r,this.targetAbles=o,this.controlAbles=a},i.updateState=function(t,e){if(e)this.setState(t);else{var i=this.state;for(var n in t)i[n]=t[n]}},i.getEnabledAbles=function(){var t=this.props;return t.ables.filter((function(e){return e&&t[e.name]}))},i.renderAbles=function(){var t,e=this,i=this.props.triggerAblesSimultaneously,n={createElement:st};return function(t,e){var i=[],n={};return t.forEach((function(t,e){var r=t.key,s=n[r];s||(s=[],n[r]=s,i.push(s)),s.push(t)})),i}((t=Hi(this.getEnabledAbles(),["render"],i).map((function(t){return(0,t.render)(e,n)||[]})),t.reduce((function(t,e){return t.concat(e)}),[])).filter((function(t){return t}))).map((function(t){return t[0]}))},i.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},i._renderLines=function(){var t=this.props,e=t.edge,i=t.zoom;if(t.hideDefaultLines)return[];var n=this.state.renderPoses,r={createElement:st};return[wr(r,e?"n":"",n[0],n[1],i,0),wr(r,e?"e":"",n[1],n[3],i,1),wr(r,e?"w":"",n[0],n[2],i,2),wr(r,e?"s":"",n[2],n[3],i,3)]},e.defaultProps={target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,edge:!1,parentMoveable:null,wrapperMoveable:null,parentPosition:null,portalContainer:null,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{}},e}(mt),ws={name:"groupable",props:{defaultGroupRotate:Number,defaultGroupOrigin:String,groupable:Boolean},events:{},render:function(t,e){var i=t.props.targets||[];t.moveables=[];var n=t.state,r={left:n.left,top:n.top};return i.map((function(i,n){return e.createElement(Ts,{key:"moveable"+n,ref:s(t,"moveables",n),target:i,origin:!1,cssStyled:t.props.cssStyled,customStyledMap:t.props.customStyledMap,parentMoveable:t,parentPosition:r})}))}},Ss=Ye("clickable",{props:{},events:{onClick:"click",onClickGroup:"clickGroup"},always:!0,dragStart:function(t,e){e.isRequest||W(window,"click",t.onPreventClick,!0)},dragControlStart:function(t,e){this.dragStart(t,e)},dragGroupStart:function(t,e){this.dragStart(t,e),e.datas.inputTarget=e.inputEvent&&e.inputEvent.target},dragEnd:function(t,e){this.endEvent(t);var i=t.state.target,n=e.inputEvent,r=e.inputTarget;if(e.isDrag||this.unset(t),n&&r&&!e.isDrag&&!t.isMoveableElement(r)){var s=i.contains(r);ji(t,"onClick",Gi(t,e,{isDouble:e.isDouble,inputTarget:r,isTarget:i===r,containsTarget:s}))}},dragGroupEnd:function(t,e){this.endEvent(t);var i=e.inputEvent,n=e.inputTarget;if(i&&n&&!e.isDrag&&!t.isMoveableElement(n)&&e.datas.inputTarget!==n){var r=t.props.targets,s=r.indexOf(n),o=s>-1,a=!1;-1===s&&(a=(s=N(r,(function(t){return t.contains(n)})))>-1),ji(t,"onClickGroup",Gi(t,e,{isDouble:e.isDouble,targets:r,inputTarget:n,targetIndex:s,isTarget:o,containsTarget:a}))}},dragControlEnd:function(t){this.endEvent(t)},dragGroupControlEnd:function(t){this.endEvent(t)},endEvent:function(t){var e=this;requestAnimationFrame((function(){e.unset(t)}))},unset:function(t){V(window,"click",t.onPreventClick,!0)}});function As(t){var e=t.originalDatas.draggable;return e||(t.originalDatas.draggable={},e=t.originalDatas.draggable),We(We({},t),{datas:e})}var Ms=Ye("edgeDraggable",{dragControlCondition:function(t,e){if(!t.props.edgeDraggable||!e.inputEvent)return!1;var i=e.inputEvent.target;return z(i,li("direction"))&&z(i,li("line"))},dragControlStart:function(t,e){return xr.dragStart(t,As(e))},dragControl:function(t,e){return xr.drag(t,As(e))},dragControlEnd:function(t,e){return xr.dragEnd(t,As(e))},dragGroupControlCondition:function(t,e){if(!t.props.edgeDraggable||!e.inputEvent)return!1;var i=e.inputEvent.target;return z(i,li("direction"))&&z(i,li("line"))},dragGroupControlStart:function(t,e){return xr.dragGroupStart(t,As(e))},dragGroupControl:function(t,e){return xr.dragGroup(t,As(e))},dragGroupControlEnd:function(t,e){return xr.dragGroupEnd(t,As(e))},unset:function(t){t.state.dragInfo=null}}),Os={name:"individualGroupable",props:{individualGroupable:Boolean},events:{}},Rs=[vs,Yr,Er,nn,xr,Ms,Pr,Nr,Dr,Br,Vr,$r,zr,ds,fs,ms,ws,Os,Ss,Hr,_s],Cs=Rs.reduce((function(t,e){return We(We({},t),"events"in e?e.events:{})}),{}),Is=Rs.reduce((function(t,e){return We(We({},t),e.props)}),{}),Ps=Ji(Cs),Ns=Object.keys(Ps),Ds=Object.keys(Is);function Ls(t,e){return Math.max.apply(Math,t.map((function(t){var i=t[0],n=t[1],r=t[2],s=t[3];return Math.max(i[e],n[e],r[e],s[e])})))}function ks(t,e){return Math.min.apply(Math,t.map((function(t){var i=t[0],n=t[1],r=t[2],s=t[3];return Math.min(i[e],n[e],r[e],s[e])})))}var Bs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.differ=new le,e.moveables=[],e.transformOrigin="50% 50%",e}ze(e,t);var i=e.prototype;return i.updateEvent=function(t){var e=this.state,i=this.props,n=t.dragTarget||e.target,r=i.dragTarget||this.areaElement;n!==r&&(Fi(this,"targetGesto"),Fi(this,"controlGesto"),e.target=null),e.target||(e.target=this.areaElement,this.controlBox.getElement().style.display="block",this.targetGesto=bs(this,r,"Group"),this.controlGesto=Es(this,this.controlBox.getElement(),"controlAbles","GroupControl"));var s=!zi(t.container,i.container);s&&(e.container=i.container);var o=this.differ.update(i.targets),a=o.added,h=o.changed,u=o.removed;(s||a.length||h.length||u.length)&&this.updateRect()},i.checkUpdate=function(){this.updateAbles()},i.updateRect=function(t,e,i){if(void 0===i&&(i=!0),this.controlBox){this.moveables.forEach((function(e){e.updateRect(t,!1,!1)}));var n=this.state,r=this.props,s=n.target||r.target;(!e||""!==t&&r.updateGroup)&&(this.rotation=r.defaultGroupRotate,this.transformOrigin=r.defaultGroupOrigin||"50% 50%",this.scale=[1,1]);var o=this.rotation,a=this.scale,h=function(t,e){if(!t.length)return[0,0,0,0];var i=t.map((function(t){return Bi(t.state)})),n=ri,r=ri,s=0,o=0,a=X(e,ii);if(a%90){var h=a/180*Math.PI,u=Math.tan(h),l=-1/u,c=[si,ri],f=[si,ri];i.forEach((function(t){t.forEach((function(t){var e=t[1]-u*t[0],i=t[1]-l*t[0];c[0]=Math.max(c[0],e),c[1]=Math.min(c[1],e),f[0]=Math.max(f[0],i),f[1]=Math.min(f[1],i)}))})),c.forEach((function(t){f.forEach((function(e){var i=(e-t)/(u-l),s=u*i+t;n=Math.min(n,i),r=Math.min(r,s)}))}));var d=i.map((function(t){var e=t[0],i=t[1],n=t[2],r=t[3];return[Kt(e,-h),Kt(i,-h),Kt(n,-h),Kt(r,-h)]}));s=Ls(d,0)-ks(d,0),o=Ls(d,1)-ks(d,1)}else if(n=ks(i,0),r=ks(i,1),s=Ls(i,0)-n,o=Ls(i,1)-r,a%180){var p=s;s=o,o=p}return[n,r,s,o]}(this.moveables,o),u=h[0],l=h[1],c=h[2],f=h[3],d="rotate("+o+"deg) scale("+(a[0]>=0?1:-1)+", "+(a[1]>=0?1:-1)+")";s.style.cssText+="left:0px;top:0px; transform-origin: "+this.transformOrigin+"; width:"+c+"px; height:"+f+"px;transform:"+d,n.width=c,n.height=f;var p=this.getContainer(),g=Ni(this.controlBox.getElement(),s,this.controlBox.getElement(),this.getContainer(),this.props.rootContainer||p),m=[g.left,g.top],v=Bi(g),_=v[0],y=v[1],b=v[2],E=v[3],x=de([_,y,b,E]),T=[x.minX,x.minY];g.pos1=zt(_,T),g.pos2=zt(y,T),g.pos3=zt(b,T),g.pos4=zt(E,T),g.left=u-g.left+T[0],g.top=l-g.top+T[1],g.origin=zt(Ht(m,g.origin),T),g.beforeOrigin=zt(Ht(m,g.beforeOrigin),T),g.originalBeforeOrigin=Ht(m,g.originalBeforeOrigin);var w=g.targetClientRect,S=a[0]*a[1]>0?1:-1;w.top+=g.top-n.top,w.left+=g.left-n.left,s.style.transform="translate("+-T[0]+"px, "+-T[1]+"px) "+d,this.updateState(We(We({},g),{direction:S,beforeDirection:S}),i)}},i.getRect=function(){return We(We({},t.prototype.getRect.call(this)),{children:this.moveables.map((function(t){return t.getRect()}))})},i.triggerEvent=function(e,i,n){if(n||e.indexOf("Group")>-1)return t.prototype.triggerEvent.call(this,e,i)},i.updateAbles=function(){t.prototype.updateAbles.call(this,Ve(this.props.ables,[ws]),"Group")},e.defaultProps=We(We({},Ts.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),e}(Ts),Fs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.moveables=[],e}ze(e,t);var i=e.prototype;return i.render=function(){var t=this,e=this.props,i=e.cspNonce,n=e.cssStyled,o=e.targets;return st(n,{cspNonce:i,ref:r(this,"controlBox"),className:li("control-box")},o.map((function(e,i){return st(Ts,We({key:"moveable"+i,ref:s(t,"moveables",i)},t.props,{target:e,wrapperMoveable:t}))})))},i.componentDidUpdate=function(){},i.updateRect=function(t,e,i){void 0===i&&(i=!0),this.moveables.forEach((function(n){n.updateRect(t,e,i)}))},i.getRect=function(){return We(We({},t.prototype.getRect.call(this)),{children:this.moveables.map((function(t){return t.getRect()}))})},i.request=function(){return{request:function(){return this},requestEnd:function(){return this}}},i.dragStart=function(){return this},i.hitTest=function(){return 0},i.isInside=function(){return!1},i.isDragging=function(){return!1},i.updateRenderPoses=function(){},i.updateEvent=function(){},i.checkUpdate=function(){},i.triggerEvent=function(){},i.updateAbles=function(){},e}(Ts),Gs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.refTargets=[],e.selectorMap={},e}ze(e,t);var i,n,s=e.prototype;return e.makeStyled=function(){var t={};this.getTotalAbles().forEach((function(e){var i=e.css;i&&i.forEach((function(e){t[e]=!0}))}));var e=L(t).join("\n");this.defaultStyled=Xe("div",(ti+e).replace(/([^}{]*){/gm,(function(t,e){return e.replace(/\.([^{,\s\d.]+)/g,".moveable-$1")+"{"})))},e.getTotalAbles=function(){return Ve([Yr,ws,Os,Hr],this.defaultAbles)},s.render=function(){var t=this.constructor;t.defaultStyled||t.makeStyled();var e=this.props,i=e.ables,n=e.props,s=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}(e,["ables","props"]),o=tn(s.target||s.targets),a=function(t,e){var i=[];return t.forEach((function(t){t&&(x(t)?e[t]&&i.push.apply(i,e[t]):i.push(t))})),i}(o,this.selectorMap);this.refTargets=o;var h=a.length>1,u=Ve(t.getTotalAbles(),i||[]),l=We(We(We({},s),n||{}),{ables:u,cssStyled:t.defaultStyled,customStyledMap:t.customStyledMap});return h?s.individualGroupable?st(Fs,We({key:"individual-group",ref:r(this,"moveable")},l,{target:null,targets:a})):st(Bs,We({key:"group",ref:r(this,"moveable")},l,{target:null,targets:a})):st(Ts,We({key:"single",ref:r(this,"moveable")},l,{target:a[0]}))},s.componentDidMount=function(){this.updateRefs()},s.componentDidUpdate=function(){this.updateRefs()},s.updateRefs=function(t){var e=tn(this.props.target||this.props.targets),i=this.refTargets.some((function(t,i){var n=e[i];return!(!t&&!n)&&t!==n})),n=t?{}:this.selectorMap,r={};this.refTargets.forEach((function(t){x(t)&&(n[t]?r[t]=n[t]:(i=!0,r[t]=[].slice.call(document.querySelectorAll(t))))})),this.selectorMap=r,i&&this.forceUpdate()},s.getManager=function(){return this.moveable},e.defaultAbles=[],e.customStyledMap={},e.defaultStyled=null,function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);s>3&&o&&Object.defineProperty(e,i,o)}([(i=ui,void 0===n&&(n={}),function(t,e){i.forEach((function(i){var r=n[i]||i;r in t||(t[r]=function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var s=(t=this[e])[i].apply(t,n);return s===this[e]?this:s})}))})],e.prototype,"moveable",void 0),e}(mt),Us=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ze(e,t),e.defaultAbles=Rs,e}(Gs);const js=Us;var Xs=function(t,e){return Xs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Xs(t,e)};function Hs(t,e){function i(){this.constructor=t}Xs(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var zs=function(){return zs=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},zs.apply(this,arguments)},Ws=function(t){function e(e){var i=t.call(this,e)||this;return i.state={},i.state=i.props,i}return Hs(e,t),e.prototype.render=function(){return t=st(js,zs({ref:r(this,"moveable")},this.state)),e=this.state.parentElement,st(vt,{element:t,container:e});var t,e},e}(gt),Vs=Ds,Ys=ui,$s=Ns,qs=Is,Zs=function(){return Zs=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Zs.apply(this,arguments)},Ks=function(){function t(){this._events={}}var e=t.prototype;return e.on=function(t,e){if(b(t))for(var i in t)this.on(i,t[i]);else this._addEvent(t,e,{});return this},e.off=function(t,e){if(t)if(b(t))for(var i in t)this.off(i);else if(e){var n=this._events[t];if(n){var r=N(n,(function(t){return t.listener===e}));r>-1&&n.splice(r,1)}}else this._events[t]=[];else this._events={};return this},e.once=function(t,e){var i=this;return e&&this._addEvent(t,e,{once:!0}),new Promise((function(e){i._addEvent(t,e,{once:!0})}))},e.emit=function(t,e){var i=this;void 0===e&&(e={});var n=this._events[t];if(!t||!n)return!0;var r=!1;return e.eventType=t,e.stop=function(){r=!0},e.currentTarget=this,function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,r++)n[r]=s[o];return n}(n).forEach((function(n){n.listener(e),n.once&&i.off(t,n.listener)})),!r},e.trigger=function(t,e){return void 0===e&&(e={}),this.emit(t,e)},e._addEvent=function(t,e,i){var n=this._events;n[t]=n[t]||[],n[t].push(Zs({listener:e},i))},t}(),Js=function(t){function e(e,i){void 0===i&&(i={});var n=t.call(this)||this;n.tempElement=document.createElement("div");var s=zs({},i),o={};$s.forEach((function(t){var e;o[(e="on "+t,e.replace(/[\s-_]([a-z])/g,(function(t,e){return e.toUpperCase()})))]=function(e){return n.trigger(t,e)}})),bt(st(Ws,zs({ref:r(n,"innerMoveable"),parentElement:e},s,o)),n.tempElement);var a=s.target;return E(a)&&a.length>1&&n.updateRect(),n}Hs(e,t);var i=e.prototype;return i.setState=function(t,e){this.innerMoveable.setState(t,e)},i.destroy=function(){bt(null,this.tempElement),this.off(),this.tempElement=null,this.innerMoveable=null},i.getMoveable=function(){return this.innerMoveable.moveable},e=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}([o(Ys,(function(t,e){t[e]||(t[e]=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=this.getMoveable();if(n&&n[e])return n[e].apply(n,t)})})),o(Vs,(function(t,e){Object.defineProperty(t,e,{get:function(){return this.getMoveable().props[e]},set:function(t){var i;this.setState(((i={})[e]=t,i))},enumerable:!0,configurable:!0})}))],e),e}(Ks),Qs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Hs(e,t),e}(Js);function to(t,e,i){return function(t,e,i){return void 0===i&&(i=e),_i(t,e,i,!0)}(t,e,i)}function eo(t,e){return Ye(t,e)}const io=Qs},7824:t=>{var e=1e3,i=60*e,n=60*i,r=24*n;function s(t,e,i,n){var r=e>=1.5*i;return Math.round(t/i)+" "+n+(r?"s":"")}t.exports=function(t,o){o=o||{};var a,h,u=typeof t;if("string"===u&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(s){var o=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*r;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*i;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(t);if("number"===u&&isFinite(t))return o.long?(a=t,(h=Math.abs(a))>=r?s(a,h,r,"day"):h>=n?s(a,h,n,"hour"):h>=i?s(a,h,i,"minute"):h>=e?s(a,h,e,"second"):a+" ms"):function(t){var s=Math.abs(t);return s>=r?Math.round(t/r)+"d":s>=n?Math.round(t/n)+"h":s>=i?Math.round(t/i)+"m":s>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},7418:t=>{"use strict";var e=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,s){for(var o,a,h=r(t),u=1;u<arguments.length;u++){for(var l in o=Object(arguments[u]))i.call(o,l)&&(h[l]=o[l]);if(e){a=e(o);for(var c=0;c<a.length;c++)n.call(o,a[c])&&(h[a[c]]=o[a[c]])}}return h}},1830:(t,e)=>{e.encode=function(t){var e="";for(var i in t)t.hasOwnProperty(i)&&(e.length&&(e+="&"),e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return e},e.decode=function(t){for(var e={},i=t.split("&"),n=0,r=i.length;n<r;n++){var s=i[n].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}},4187:t=>{var e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var n,r,s=t,o=t.indexOf("["),a=t.indexOf("]");-1!=o&&-1!=a&&(t=t.substring(0,o)+t.substring(o,a).replace(/:/g,";")+t.substring(a,t.length));for(var h,u,l=e.exec(t||""),c={},f=14;f--;)c[i[f]]=l[f]||"";return-1!=o&&-1!=a&&(c.source=s,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=(n=c.path,r=n.replace(/\/{2,9}/g,"/").split("/"),"/"!=n.substr(0,1)&&0!==n.length||r.splice(0,1),"/"==n.substr(n.length-1,1)&&r.splice(r.length-1,1),r),c.queryKey=(h=c.query,u={},h.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,e,i){e&&(u[e]=i)})),u),c}},7864:function(t){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){"use strict";function n(t){if(!(this instanceof n))return new n(t);this._=t}var r=n.prototype;function s(t,e){for(var i=0;i<t;i++)e(i)}function o(t,e,i){return function(t,e){s(e.length,(function(i){t(e[i],i,e)}))}((function(i,n,r){e=t(e,i,n,r)}),i),e}function a(t,e){return o((function(e,i,n,r){return e.concat([t(i,n,r)])}),[],e)}function h(t,e){var i={v:0,buf:e};return s(t,(function(){var t;i={v:i.v<<1|(t=i.buf,t[0]>>7),buf:function(t){var e=o((function(t,e,i,n){return t.concat(i===n.length-1?Buffer.from([e,0]).readUInt16BE(0):n.readUInt16BE(i))}),[],t);return Buffer.from(a((function(t){return(t<<1&65535)>>8}),e))}(i.buf)}})),i}function u(){return"undefined"!=typeof Buffer}function l(){if(!u())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function c(t){l();var e=o((function(t,e){return t+e}),0,t);if(e%8!=0)throw new Error("The bits ["+t.join(", ")+"] add up to "+e+" which is not an even number of bytes; the total should be divisible by 8");var i,r=e/8,s=(i=function(t){return t>48},o((function(t,e){return t||(i(e)?e:t)}),null,t));if(s)throw new Error(s+" bit range requested exceeds 48 bit (6 byte) Number max.");return new n((function(e,i){var n=r+i;return n>e.length?x(i,r.toString()+" bytes"):E(n,o((function(t,e){var i=h(e,t.buf);return{coll:t.coll.concat(i.v),buf:i.buf}}),{coll:[],buf:e.slice(i,n)},t).coll)}))}function f(t,e){return new n((function(i,n){return l(),n+e>i.length?x(n,e+" bytes for "+t):E(n+e,i.slice(n,n+e))}))}function d(t,e){if("number"!=typeof(i=e)||Math.floor(i)!==i||e<0||e>6)throw new Error(t+" requires integer length in range [0, 6].");var i}function p(t){return d("uintBE",t),f("uintBE("+t+")",t).map((function(e){return e.readUIntBE(0,t)}))}function g(t){return d("uintLE",t),f("uintLE("+t+")",t).map((function(e){return e.readUIntLE(0,t)}))}function m(t){return d("intBE",t),f("intBE("+t+")",t).map((function(e){return e.readIntBE(0,t)}))}function v(t){return d("intLE",t),f("intLE("+t+")",t).map((function(e){return e.readIntLE(0,t)}))}function _(t){return t instanceof n}function y(t){return"[object Array]"==={}.toString.call(t)}function b(t){return u()&&Buffer.isBuffer(t)}function E(t,e){return{status:!0,index:t,value:e,furthest:-1,expected:[]}}function x(t,e){return y(e)||(e=[e]),{status:!1,index:-1,value:null,furthest:t,expected:e}}function T(t,e){if(!e)return t;if(t.furthest>e.furthest)return t;var i=t.furthest===e.furthest?function(t,e){if(function(){if(void 0!==n._supportsSet)return n._supportsSet;var t="undefined"!=typeof Set;return n._supportsSet=t,t}()&&Array.from){for(var i=new Set(t),r=0;r<e.length;r++)i.add(e[r]);var s=Array.from(i);return s.sort(),s}for(var o={},a=0;a<t.length;a++)o[t[a]]=!0;for(var h=0;h<e.length;h++)o[e[h]]=!0;var u=[];for(var l in o)({}).hasOwnProperty.call(o,l)&&u.push(l);return u.sort(),u}(t.expected,e.expected):e.expected;return{status:t.status,index:t.index,value:t.value,furthest:e.furthest,expected:i}}var w={};function S(t,e){if(b(t))return{offset:e,line:-1,column:-1};t in w||(w[t]={});for(var i=w[t],n=0,r=0,s=0,o=e;o>=0;){if(o in i){n=i[o].line,0===s&&(s=i[o].lineStart);break}("\n"===t.charAt(o)||"\r"===t.charAt(o)&&"\n"!==t.charAt(o+1))&&(r++,0===s&&(s=o+1)),o--}var a=n+r,h=e-s;return i[e]={line:a,lineStart:s},{offset:e,line:a+1,column:h+1}}function A(t){if(!_(t))throw new Error("not a parser: "+t)}function M(t,e){return"string"==typeof t?t.charAt(e):t[e]}function O(t){if("number"!=typeof t)throw new Error("not a number: "+t)}function R(t){if("function"!=typeof t)throw new Error("not a function: "+t)}function C(t){if("string"!=typeof t)throw new Error("not a string: "+t)}function I(t,e){return new Array(e+1).join(t)}function P(t,e,i){var n=e-t.length;return n<=0?t:I(i,n)+t}function N(t,e,i,n){return{from:t-e>0?t-e:0,to:t+i>n?n:t+i}}function D(t,e){var i,n,r,s,h,u=e.index,l=u.offset,c=1;if(l===t.length)return"Got the end of the input";if(b(t)){var f=l-l%8,d=l-f,p=N(f,40,40,t.length),g=a((function(t){return a((function(t){return P(t.toString(16),2,"0")}),t)}),function(t,e){var i=t.length,n=[],r=0;if(i<=8)return[t.slice()];for(var s=0;s<i;s++)n[r]||n.push([]),n[r].push(t[s]),(s+1)%8==0&&r++;return n}(t.slice(p.from,p.to).toJSON().data));s=function(t){return 0===t.from&&1===t.to?{from:t.from,to:t.to}:{from:t.from/8,to:Math.floor(t.to/8)}}(p),n=f/8,i=3*d,d>=4&&(i+=1),c=2,r=a((function(t){return t.length<=4?t.join(" "):t.slice(0,4).join(" ")+" "+t.slice(4).join(" ")}),g),(h=(8*(s.to>0?s.to-1:s.to)).toString(16).length)<2&&(h=2)}else{var m=t.split(/\r\n|[\n\r\u2028\u2029]/);i=u.column-1,n=u.line-1,s=N(n,2,3,m.length),r=m.slice(s.from,s.to),h=s.to.toString().length}var v=n-s.from;return b(t)&&(h=(8*(s.to>0?s.to-1:s.to)).toString(16).length)<2&&(h=2),o((function(e,n,r){var o,a=r===v,u=a?"> ":" ";return o=b(t)?P((8*(s.from+r)).toString(16),h,"0"):P((s.from+r+1).toString(),h," "),[].concat(e,[u+o+" | "+n],a?[" "+I(" ",h)+" | "+P("",i," ")+I("^",c)]:[])}),[],r).join("\n")}function L(t,e){return["\n","-- PARSING FAILED "+I("-",50),"\n\n",D(t,e),"\n\n",(i=e.expected,1===i.length?"Expected:\n\n"+i[0]:"Expected one of the following: \n\n"+i.join(", ")),"\n"].join("");var i}function k(t){return void 0!==t.flags?t.flags:[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.unicode?"u":"",t.sticky?"y":""].join("")}function B(){for(var t=[].slice.call(arguments),e=t.length,i=0;i<e;i+=1)A(t[i]);return n((function(i,n){for(var r,s=new Array(e),o=0;o<e;o+=1){if(!(r=T(t[o]._(i,n),r)).status)return r;s[o]=r.value,n=r.index}return T(E(n,s),r)}))}function F(){var t=[].slice.call(arguments);if(0===t.length)throw new Error("seqMap needs at least one argument");var e=t.pop();return R(e),B.apply(null,t).map((function(t){return e.apply(null,t)}))}function G(){var t=[].slice.call(arguments),e=t.length;if(0===e)return W("zero alternates");for(var i=0;i<e;i+=1)A(t[i]);return n((function(e,i){for(var n,r=0;r<t.length;r+=1)if((n=T(t[r]._(e,i),n)).status)return n;return n}))}function U(t,e){return j(t,e).or(z([]))}function j(t,e){return A(t),A(e),F(t,e.then(t).many(),(function(t,e){return[t].concat(e)}))}function X(t){C(t);var e="'"+t+"'";return n((function(i,n){var r=n+t.length,s=i.slice(n,r);return s===t?E(r,s):x(n,e)}))}function H(t,e){!function(t){if(!(t instanceof RegExp))throw new Error("not a regexp: "+t);for(var e=k(t),i=0;i<e.length;i++){var n=e.charAt(i);if("i"!==n&&"m"!==n&&"u"!==n&&"s"!==n)throw new Error('unsupported regexp flag "'+n+'": '+t)}}(t),arguments.length>=2?O(e):e=0;var i=function(t){return RegExp("^(?:"+t.source+")",k(t))}(t),r=""+t;return n((function(t,n){var s=i.exec(t.slice(n));if(s){if(0<=e&&e<=s.length){var o=s[0],a=s[e];return E(n+o.length,a)}return x(n,"valid match group (0 to "+s.length+") in "+r)}return x(n,r)}))}function z(t){return n((function(e,i){return E(i,t)}))}function W(t){return n((function(e,i){return x(i,t)}))}function V(t){if(_(t))return n((function(e,i){var n=t._(e,i);return n.index=i,n.value="",n}));if("string"==typeof t)return V(X(t));if(t instanceof RegExp)return V(H(t));throw new Error("not a string, regexp, or parser: "+t)}function Y(t){return A(t),n((function(e,i){var n=t._(e,i),r=e.slice(i,n.index);return n.status?x(i,'not "'+r+'"'):E(i,null)}))}function $(t){return R(t),n((function(e,i){var n=M(e,i);return i<e.length&&t(n)?E(i+1,n):x(i,"a character/byte matching "+t)}))}function q(t,e){arguments.length<2&&(e=t,t=void 0);var i=n((function(t,n){return i._=e()._,i._(t,n)}));return t?i.desc(t):i}function Z(){return W("fantasy-land/empty")}r.parse=function(t){if("string"!=typeof t&&!b(t))throw new Error(".parse must be called with a string or Buffer as its argument");var e,i=this.skip(tt)._(t,0);return e=i.status?{status:!0,value:i.value}:{status:!1,index:S(t,i.furthest),expected:i.expected},delete w[t],e},r.tryParse=function(t){var e=this.parse(t);if(e.status)return e.value;var i=L(t,e),n=new Error(i);throw n.type="ParsimmonError",n.result=e,n},r.assert=function(t,e){return this.chain((function(i){return t(i)?z(i):W(e)}))},r.or=function(t){return G(this,t)},r.trim=function(t){return this.wrap(t,t)},r.wrap=function(t,e){return F(t,this,e,(function(t,e){return e}))},r.thru=function(t){return t(this)},r.then=function(t){return A(t),B(this,t).map((function(t){return t[1]}))},r.many=function(){var t=this;return n((function(e,i){for(var n=[],r=void 0;;){if(!(r=T(t._(e,i),r)).status)return T(E(i,n),r);if(i===r.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");i=r.index,n.push(r.value)}}))},r.tieWith=function(t){return C(t),this.map((function(e){if(function(t){if(!y(t))throw new Error("not an array: "+t)}(e),e.length){C(e[0]);for(var i=e[0],n=1;n<e.length;n++)C(e[n]),i+=t+e[n];return i}return""}))},r.tie=function(){return this.tieWith("")},r.times=function(t,e){var i=this;return arguments.length<2&&(e=t),O(t),O(e),n((function(n,r){for(var s=[],o=void 0,a=void 0,h=0;h<t;h+=1){if(a=T(o=i._(n,r),a),!o.status)return a;r=o.index,s.push(o.value)}for(;h<e&&(a=T(o=i._(n,r),a),o.status);h+=1)r=o.index,s.push(o.value);return T(E(r,s),a)}))},r.result=function(t){return this.map((function(){return t}))},r.atMost=function(t){return this.times(0,t)},r.atLeast=function(t){return F(this.times(t),this.many(),(function(t,e){return t.concat(e)}))},r.map=function(t){R(t);var e=this;return n((function(i,n){var r=e._(i,n);return r.status?T(E(r.index,t(r.value)),r):r}))},r.contramap=function(t){R(t);var e=this;return n((function(i,n){var r=e.parse(t(i.slice(n)));return r.status?E(n+i.length,r.value):r}))},r.promap=function(t,e){return R(t),R(e),this.contramap(t).map(e)},r.skip=function(t){return B(this,t).map((function(t){return t[0]}))},r.mark=function(){return F(K,this,K,(function(t,e,i){return{start:t,value:e,end:i}}))},r.node=function(t){return F(K,this,K,(function(e,i,n){return{name:t,value:i,start:e,end:n}}))},r.sepBy=function(t){return U(this,t)},r.sepBy1=function(t){return j(this,t)},r.lookahead=function(t){return this.skip(V(t))},r.notFollowedBy=function(t){return this.skip(Y(t))},r.desc=function(t){y(t)||(t=[t]);var e=this;return n((function(i,n){var r=e._(i,n);return r.status||(r.expected=t),r}))},r.fallback=function(t){return this.or(z(t))},r.ap=function(t){return F(t,this,(function(t,e){return t(e)}))},r.chain=function(t){var e=this;return n((function(i,n){var r=e._(i,n);return r.status?T(t(r.value)._(i,r.index),r):r}))},r.concat=r.or,r.empty=Z,r.of=z,r["fantasy-land/ap"]=r.ap,r["fantasy-land/chain"]=r.chain,r["fantasy-land/concat"]=r.concat,r["fantasy-land/empty"]=r.empty,r["fantasy-land/of"]=r.of,r["fantasy-land/map"]=r.map;var K=n((function(t,e){return E(e,S(t,e))})),J=n((function(t,e){return e>=t.length?x(e,"any character/byte"):E(e+1,M(t,e))})),Q=n((function(t,e){return E(t.length,t.slice(e))})),tt=n((function(t,e){return e<t.length?x(e,"EOF"):E(e,null)})),et=H(/[0-9]/).desc("a digit"),it=H(/[0-9]*/).desc("optional digits"),nt=H(/[a-z]/i).desc("a letter"),rt=H(/[a-z]*/i).desc("optional letters"),st=H(/\s*/).desc("optional whitespace"),ot=H(/\s+/).desc("whitespace"),at=X("\r"),ht=X("\n"),ut=X("\r\n"),lt=G(ut,ht,at).desc("newline"),ct=G(lt,tt);n.all=Q,n.alt=G,n.any=J,n.cr=at,n.createLanguage=function(t){var e={};for(var i in t)({}).hasOwnProperty.call(t,i)&&function(i){e[i]=q((function(){return t[i](e)}))}(i);return e},n.crlf=ut,n.custom=function(t){return n(t(E,x))},n.digit=et,n.digits=it,n.empty=Z,n.end=ct,n.eof=tt,n.fail=W,n.formatError=L,n.index=K,n.isParser=_,n.lazy=q,n.letter=nt,n.letters=rt,n.lf=ht,n.lookahead=V,n.makeFailure=x,n.makeSuccess=E,n.newline=lt,n.noneOf=function(t){return $((function(e){return t.indexOf(e)<0})).desc("none of '"+t+"'")},n.notFollowedBy=Y,n.of=z,n.oneOf=function(t){for(var e=t.split(""),i=0;i<e.length;i++)e[i]="'"+e[i]+"'";return $((function(e){return t.indexOf(e)>=0})).desc(e)},n.optWhitespace=st,n.Parser=n,n.range=function(t,e){return $((function(i){return t<=i&&i<=e})).desc(t+"-"+e)},n.regex=H,n.regexp=H,n.sepBy=U,n.sepBy1=j,n.seq=B,n.seqMap=F,n.seqObj=function(){for(var t,e={},i=0,r=(t=arguments,Array.prototype.slice.call(t)),s=r.length,o=0;o<s;o+=1){var a=r[o];if(!_(a)){if(y(a)&&2===a.length&&"string"==typeof a[0]&&_(a[1])){var h=a[0];if(Object.prototype.hasOwnProperty.call(e,h))throw new Error("seqObj: duplicate key "+h);e[h]=!0,i++;continue}throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.")}}if(0===i)throw new Error("seqObj expects at least one named parser, found zero");return n((function(t,e){for(var i,n={},o=0;o<s;o+=1){var a,h;if(y(r[o])?(a=r[o][0],h=r[o][1]):(a=null,h=r[o]),!(i=T(h._(t,e),i)).status)return i;a&&(n[a]=i.value),e=i.index}return T(E(e,n),i)}))},n.string=X,n.succeed=z,n.takeWhile=function(t){return R(t),n((function(e,i){for(var n=i;n<e.length&&t(M(e,n));)n++;return E(n,e.slice(i,n))}))},n.test=$,n.whitespace=ot,n["fantasy-land/empty"]=Z,n["fantasy-land/of"]=z,n.Binary={bitSeq:c,bitSeqObj:function(t){l();var e={},i=0,n=a((function(t){if(y(t)){var n=t;if(2!==n.length)throw new Error("["+n.join(", ")+"] should be length 2, got length "+n.length);if(C(n[0]),O(n[1]),Object.prototype.hasOwnProperty.call(e,n[0]))throw new Error("duplicate key in bitSeqObj: "+n[0]);return e[n[0]]=!0,i++,n}return O(t),[null,t]}),t);if(i<1)throw new Error("bitSeqObj expects at least one named pair, got ["+t.join(", ")+"]");var r=a((function(t){return t[0]}),n);return c(a((function(t){return t[1]}),n)).map((function(t){return o((function(t,e){return null!==e[0]&&(t[e[0]]=e[1]),t}),{},a((function(e,i){return[e,t[i]]}),r))}))},byte:function(t){if(l(),O(t),t>255)throw new Error("Value specified to byte constructor ("+t+"=0x"+t.toString(16)+") is larger in value than a single byte.");var e=(t>15?"0x":"0x0")+t.toString(16);return n((function(i,n){var r=M(i,n);return r===t?E(n+1,r):x(n,e)}))},buffer:function(t){return f("buffer",t).map((function(t){return Buffer.from(t)}))},encodedString:function(t,e){return f("string",e).map((function(e){return e.toString(t)}))},uintBE:p,uint8BE:p(1),uint16BE:p(2),uint32BE:p(4),uintLE:g,uint8LE:g(1),uint16LE:g(2),uint32LE:g(4),intBE:m,int8BE:m(1),int16BE:m(2),int32BE:m(4),intLE:v,int8LE:v(1),int16LE:v(2),int32LE:v(4),floatBE:f("floatBE",4).map((function(t){return t.readFloatBE(0)})),floatLE:f("floatLE",4).map((function(t){return t.readFloatLE(0)})),doubleBE:f("doubleBE",8).map((function(t){return t.readDoubleBE(0)})),doubleLE:f("doubleLE",8).map((function(t){return t.readDoubleLE(0)}))},t.exports=n}])},6841:(t,e,i)=>{"use strict";i.r(e),i.d(e,{ALPHA_MODES:()=>mt.iw,AbstractBatchRenderer:()=>ht.eo,AbstractMultiResource:()=>ht.M4,AbstractRenderer:()=>ht.I8,AccessibilityManager:()=>J,AnimatedSprite:()=>Vn,AppLoaderPlugin:()=>gt.LP,Application:()=>ut,ArrayResource:()=>ht.$N,Attribute:()=>ht.ah,BLEND_MODES:()=>mt.T$,BUFFER_BITS:()=>mt.V0,BUFFER_TYPE:()=>mt.mr,BaseImageResource:()=>ht.bg,BasePrepare:()=>$e,BaseRenderTexture:()=>ht.jd,BaseTexture:()=>ht.VL,BatchDrawCall:()=>ht.a$,BatchGeometry:()=>ht.JZ,BatchPluginFactory:()=>ht.TJ,BatchRenderer:()=>ht.Bv,BatchShaderGenerator:()=>ht.Zk,BatchSystem:()=>ht.Sj,BatchTextureArray:()=>ht.Ie,BitmapFont:()=>Mi,BitmapFontData:()=>_i,BitmapFontLoader:()=>Pi,BitmapText:()=>Ii,BlobResource:()=>xt,Bounds:()=>S,Buffer:()=>ht.lW,BufferResource:()=>ht.qm,CLEAR_MODES:()=>mt.yl,CanvasResource:()=>ht.Y8,Circle:()=>w.Cd,CompressedTextureLoader:()=>wt,CompressedTextureResource:()=>Tt,Container:()=>Z,ContextSystem:()=>ht.lH,CountLimiter:()=>Ue,CubeResource:()=>ht.TA,DDSLoader:()=>Nt,DEG_TO_RAD:()=>w.ZX,DRAW_MODES:()=>mt.lg,DisplayObject:()=>Y,ENV:()=>mt.Vi,Ellipse:()=>w.Pj,Extract:()=>pt,FORMATS:()=>mt.I2,FORMATS_TO_COMPONENTS:()=>kt,FillStyle:()=>Yt,Filter:()=>ht.wn,FilterState:()=>ht.jV,FilterSystem:()=>ht.kV,Framebuffer:()=>ht.AI,FramebufferSystem:()=>ht.WB,GC_MODES:()=>mt.UN,GLFramebuffer:()=>ht.tT,GLProgram:()=>ht.Ei,GLTexture:()=>ht.fy,GRAPHICS_CURVES:()=>Vt,Geometry:()=>ht.ZX,GeometrySystem:()=>ht.TO,Graphics:()=>xe,GraphicsData:()=>ge,GraphicsGeometry:()=>_e,IGLUniformData:()=>ht.W1,INSTALLED:()=>ht.e_,INTERNAL_FORMATS:()=>ft,INTERNAL_FORMAT_TO_BYTES_PER_PIXEL:()=>vt,ImageBitmapResource:()=>ht._w,ImageResource:()=>ht.PA,InteractionData:()=>tt,InteractionEvent:()=>it,InteractionManager:()=>at,InteractionTrackingData:()=>nt,KTXLoader:()=>Ft,LINE_CAP:()=>Xt,LINE_JOIN:()=>jt,LineStyle:()=>ye,Loader:()=>gt.aN,LoaderResource:()=>gt.kC,MASK_TYPES:()=>mt.A7,MIPMAP_MODES:()=>mt.WB,MSAA_QUALITY:()=>mt.G5,MaskData:()=>ht.HI,MaskSystem:()=>ht.zj,Matrix:()=>w.y3,Mesh:()=>pi,MeshBatchUvs:()=>ci,MeshGeometry:()=>mi,MeshMaterial:()=>gi,NineSlicePlane:()=>Hn,ObjectRenderer:()=>ht.bO,ObservablePoint:()=>w.AB,PI_2:()=>w._b,PRECISION:()=>mt.cB,ParticleContainer:()=>Ht,ParticleRenderer:()=>Wt,PlaneGeometry:()=>Fn,Point:()=>w.E9,Polygon:()=>w.mg,Prepare:()=>Je,Program:()=>ht.$r,ProjectionSystem:()=>ht.NW,Quad:()=>ht.lD,QuadUv:()=>ht.ud,RAD_TO_DEG:()=>w.jl,RENDERER_TYPE:()=>mt.N3,Rectangle:()=>w.Ae,RenderTexture:()=>ht.TI,RenderTexturePool:()=>ht.uW,RenderTextureSystem:()=>ht.J$,Renderer:()=>ht.Th,Resource:()=>ht._z,RopeGeometry:()=>Gn,RoundedRectangle:()=>w.c9,Runner:()=>zn.R,SAMPLER_TYPES:()=>mt.oT,SCALE_MODES:()=>mt.aH,SHAPES:()=>w.HS,SVGResource:()=>ht.pX,ScissorSystem:()=>ht.id,Shader:()=>ht.ex,ShaderSystem:()=>ht.p,SimpleMesh:()=>Xn,SimplePlane:()=>jn,SimpleRope:()=>Un,Sprite:()=>Me,SpriteMaskFilter:()=>ht.z9,Spritesheet:()=>ti,SpritesheetLoader:()=>ei,State:()=>ht.ZM,StateSystem:()=>ht.zI,StencilSystem:()=>ht.Ld,System:()=>ht.xP,TARGETS:()=>mt.sp,TEXT_GRADIENT:()=>pe,TYPES:()=>mt.vK,TYPES_TO_BYTES_PER_COMPONENT:()=>Lt,TYPES_TO_BYTES_PER_PIXEL:()=>Bt,TemporaryDisplayObject:()=>$,Text:()=>Fe,TextMetrics:()=>Le,TextStyle:()=>Ie,Texture:()=>ht.xE,TextureGCSystem:()=>ht.wr,TextureLoader:()=>gt.dp,TextureMatrix:()=>ht.UX,TextureSystem:()=>ht.CT,TextureUvs:()=>ht.aF,Ticker:()=>Q.vB,TickerPlugin:()=>Q.Sb,TilingSprite:()=>si,TilingSpriteRenderer:()=>hi,TimeLimiter:()=>Qe,Transform:()=>w.wx,UPDATE_PRIORITY:()=>Q.uF,UniformGroup:()=>ht.oo,VERSION:()=>Yn,VideoResource:()=>ht.eH,ViewableBuffer:()=>ht.Rv,WRAP_MODES:()=>mt.Nt,accessibleTarget:()=>K,autoDetectRenderer:()=>ht.e6,autoDetectResource:()=>ht.pb,checkMaxIfStatementsInShader:()=>ht.a7,createUBOElements:()=>ht.TF,defaultFilterVertex:()=>ht.Y9,defaultVertex:()=>ht.kP,filters:()=>$n,generateProgram:()=>ht.qw,generateUniformBufferSync:()=>ht.K0,getTestContext:()=>ht.Kc,getUBOData:()=>ht.DL,graphicsUtils:()=>Te,groupD8:()=>w.Lv,interactiveTarget:()=>st,isMobile:()=>T.t,resources:()=>ht.Jb,settings:()=>T.X,systems:()=>ht.eG,uniformParsers:()=>ht.sg,utils:()=>x});var n=setTimeout,r="undefined"!=typeof setImmediate?setImmediate:null;function s(t){return Boolean(t&&void 0!==t.length)}function o(){}function a(t){if(!(this instanceof a))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(t,this)}function h(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,a._immediateFn((function(){var i=1===t._state?e.onFulfilled:e.onRejected;if(null!==i){var n;try{n=i(t._value)}catch(t){return void l(e.promise,t)}u(e.promise,n)}else(1===t._state?u:l)(e.promise,t._value)}))):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var i=e.then;if(e instanceof a)return t._state=3,t._value=e,void c(t);if("function"==typeof i)return void d((n=i,r=e,function(){n.apply(r,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){l(t,e)}var n,r}function l(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&a._immediateFn((function(){t._handled||a._unhandledRejectionFn(t._value)}));for(var e=0,i=t._deferreds.length;e<i;e++)h(t,t._deferreds[e]);t._deferreds=null}function f(t,e,i){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=i}function d(t,e){var i=!1;try{t((function(t){i||(i=!0,u(e,t))}),(function(t){i||(i=!0,l(e,t))}))}catch(t){if(i)return;i=!0,l(e,t)}}a.prototype.catch=function(t){return this.then(null,t)},a.prototype.then=function(t,e){var i=new this.constructor(o);return h(this,new f(t,e,i)),i},a.prototype.finally=function(t){var e=this.constructor;return this.then((function(i){return e.resolve(t()).then((function(){return i}))}),(function(i){return e.resolve(t()).then((function(){return e.reject(i)}))}))},a.all=function(t){return new a((function(e,i){if(!s(t))return i(new TypeError("Promise.all accepts an array"));var n=Array.prototype.slice.call(t);if(0===n.length)return e([]);var r=n.length;function o(t,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,(function(e){o(t,e)}),i)}n[t]=s,0==--r&&e(n)}catch(t){i(t)}}for(var a=0;a<n.length;a++)o(a,n[a])}))},a.allSettled=function(t){return new this((function(e,i){if(!t||void 0===t.length)return i(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(t);if(0===n.length)return e([]);var r=n.length;function s(t,i){if(i&&("object"==typeof i||"function"==typeof i)){var o=i.then;if("function"==typeof o)return void o.call(i,(function(e){s(t,e)}),(function(i){n[t]={status:"rejected",reason:i},0==--r&&e(n)}))}n[t]={status:"fulfilled",value:i},0==--r&&e(n)}for(var o=0;o<n.length;o++)s(o,n[o])}))},a.resolve=function(t){return t&&"object"==typeof t&&t.constructor===a?t:new a((function(e){e(t)}))},a.reject=function(t){return new a((function(e,i){i(t)}))},a.race=function(t){return new a((function(e,i){if(!s(t))return i(new TypeError("Promise.race accepts an array"));for(var n=0,r=t.length;n<r;n++)a.resolve(t[n]).then(e,i)}))},a._immediateFn="function"==typeof r&&function(t){r(t)}||function(t){n(t,0)},a._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};const p=a;var g=i(7418),m=i.n(g);if(self.Promise||(self.Promise=p),Object.assign||(Object.assign=m()),Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!self.performance||!self.performance.now){var v=Date.now();self.performance||(self.performance={}),self.performance.now=function(){return Date.now()-v}}for(var _=Date.now(),y=["ms","moz","webkit","o"],b=0;b<y.length&&!self.requestAnimationFrame;++b){var E=y[b];self.requestAnimationFrame=self[E+"RequestAnimationFrame"],self.cancelAnimationFrame=self[E+"CancelAnimationFrame"]||self[E+"CancelRequestAnimationFrame"]}self.requestAnimationFrame||(self.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),i=16+_-e;return i<0&&(i=0),_=e,self.setTimeout((function(){_=Date.now(),t(performance.now())}),i)}),self.cancelAnimationFrame||(self.cancelAnimationFrame=function(t){return clearTimeout(t)}),Math.sign||(Math.sign=function(t){return 0===(t=Number(t))||isNaN(t)?t:t>0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),self.ArrayBuffer||(self.ArrayBuffer=Array),self.Float32Array||(self.Float32Array=Array),self.Uint32Array||(self.Uint32Array=Array),self.Uint16Array||(self.Uint16Array=Array),self.Uint8Array||(self.Uint8Array=Array),self.Int32Array||(self.Int32Array=Array);var x=i(8942),T=i(9319),w=i(9658);T.X.SORTABLE_CHILDREN=!1;var S=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?w.Ae.EMPTY:((t=t||new w.Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addPointMatrix=function(t,e){var i=t.a,n=t.b,r=t.c,s=t.d,o=t.tx,a=t.ty,h=i*e.x+r*e.y+o,u=n*e.x+s*e.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,u),this.maxY=Math.max(this.maxY,u)},t.prototype.addQuad=function(t){var e=this.minX,i=this.minY,n=this.maxX,r=this.maxY,s=t[0],o=t[1];e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,r=o>r?o:r,e=(s=t[2])<e?s:e,i=(o=t[3])<i?o:i,n=s>n?s:n,r=o>r?o:r,e=(s=t[4])<e?s:e,i=(o=t[5])<i?o:i,n=s>n?s:n,r=o>r?o:r,e=(s=t[6])<e?s:e,i=(o=t[7])<i?o:i,n=s>n?s:n,r=o>r?o:r,this.minX=e,this.minY=i,this.maxX=n,this.maxY=r},t.prototype.addFrame=function(t,e,i,n,r){this.addFrameMatrix(t.worldTransform,e,i,n,r)},t.prototype.addFrameMatrix=function(t,e,i,n,r){var s=t.a,o=t.b,a=t.c,h=t.d,u=t.tx,l=t.ty,c=this.minX,f=this.minY,d=this.maxX,p=this.maxY,g=s*e+a*i+u,m=o*e+h*i+l;c=g<c?g:c,f=m<f?m:f,d=g>d?g:d,p=m>p?m:p,c=(g=s*n+a*i+u)<c?g:c,f=(m=o*n+h*i+l)<f?m:f,d=g>d?g:d,p=m>p?m:p,c=(g=s*e+a*r+u)<c?g:c,f=(m=o*e+h*r+l)<f?m:f,d=g>d?g:d,p=m>p?m:p,c=(g=s*n+a*r+u)<c?g:c,f=(m=o*n+h*r+l)<f?m:f,d=g>d?g:d,p=m>p?m:p,this.minX=c,this.minY=f,this.maxX=d,this.maxY=p},t.prototype.addVertexData=function(t,e,i){for(var n=this.minX,r=this.minY,s=this.maxX,o=this.maxY,a=e;a<i;a+=2){var h=t[a],u=t[a+1];n=h<n?h:n,r=u<r?u:r,s=h>s?h:s,o=u>o?u:o}this.minX=n,this.minY=r,this.maxX=s,this.maxY=o},t.prototype.addVertices=function(t,e,i,n){this.addVerticesMatrix(t.worldTransform,e,i,n)},t.prototype.addVerticesMatrix=function(t,e,i,n,r,s){void 0===r&&(r=0),void 0===s&&(s=r);for(var o=t.a,a=t.b,h=t.c,u=t.d,l=t.tx,c=t.ty,f=this.minX,d=this.minY,p=this.maxX,g=this.maxY,m=i;m<n;m+=2){var v=e[m],_=e[m+1],y=o*v+h*_+l,b=u*_+a*v+c;f=Math.min(f,y-r),p=Math.max(p,y+r),d=Math.min(d,b-s),g=Math.max(g,b+s)}this.minX=f,this.minY=d,this.maxX=p,this.maxY=g},t.prototype.addBounds=function(t){var e=this.minX,i=this.minY,n=this.maxX,r=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<i?t.minY:i,this.maxX=t.maxX>n?t.maxX:n,this.maxY=t.maxY>r?t.maxY:r},t.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,r=t.maxX<e.maxX?t.maxX:e.maxX,s=t.maxY<e.maxY?t.maxY:e.maxY;if(i<=r&&n<=s){var o=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=i<o?i:o,this.minY=n<a?n:a,this.maxX=r>h?r:h,this.maxY=s>u?s:u}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,r=t.maxX<e.x+e.width?t.maxX:e.x+e.width,s=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(i<=r&&n<=s){var o=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=i<o?i:o,this.minY=n<a?n:a,this.maxX=r>h?r:h,this.maxY=s>u?s:u}},t.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(t,e,i,n,r,s){t-=r,e-=s,i+=r,n+=s,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>n?this.maxY:n},t}(),A=function(t,e){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},A(t,e)};function M(t,e){function i(){this.constructor=t}A(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var O,R,C,I,P,N,D,L,k,B,F,G,U,j,X,H,z,W,V,Y=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new w.wx,e.alpha=1,e.visible=!0,e.renderable=!0,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new S,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return M(e,t),e.mixin=function(t){for(var i=Object.keys(t),n=0;n<i.length;++n){var r=i[n];Object.defineProperty(e.prototype,r,Object.getOwnPropertyDescriptor(t,r))}},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.prototype.getBounds=function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new w.Ae),e=this._boundsRect),this._bounds.getRectangle(e)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new w.Ae),t=this._localBoundsRect),this._localBounds||(this._localBounds=new S);var e=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var n=this._bounds,r=this._boundsID;this._bounds=this._localBounds;var s=this.getBounds(!1,t);return this.parent=i,this.transform=e,this._bounds=n,this._bounds.updateID+=this._boundsID-r,s},e.prototype.toGlobal=function(t,e,i){return void 0===i&&(i=!1),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},e.prototype.toLocal=function(t,e,i,n){return e&&(t=e.toGlobal(t,i,n)),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,i)},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,e,i,n,r,s,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=1),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),this.position.x=t,this.position.y=e,this.scale.x=i||1,this.scale.y=n||1,this.rotation=r,this.skew.x=s,this.skew.y=o,this.pivot.x=a,this.pivot.y=h,this},e.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),this.emit("destroyed"),this.removeAllListeners(),this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},Object.defineProperty(e.prototype,"_tempDisplayObjectParent",{get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new $),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),e.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},e.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.transform.rotation*w.jl},set:function(t){this.transform.rotation=t*w.ZX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){var e;this._mask!==t&&(this._mask&&((e=this._mask.maskObject||this._mask)._maskRefCount--,0===e._maskRefCount&&(e.renderable=!0,e.isMask=!1)),this._mask=t,this._mask&&(0===(e=this._mask.maskObject||this._mask)._maskRefCount&&(e.renderable=!1,e.isMask=!0),e._maskRefCount++))},enumerable:!1,configurable:!0}),e}(x.EventEmitter),$=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.sortDirty=null,e}return M(e,t),e}(Y);function q(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}Y.prototype.displayObjectUpdateTransform=Y.prototype.updateTransform,function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(O||(O={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(R||(R={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(C||(C={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(I||(I={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(P||(P={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(N||(N={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(D||(D={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(L||(L={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(k||(k={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(B||(B={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(F||(F={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(G||(G={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(U||(U={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(j||(j={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(X||(X={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(H||(H={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(z||(z={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(W||(W={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(V||(V={}));var Z=function(t){function e(){var e=t.call(this)||this;return e.children=[],e.sortableChildren=T.X.SORTABLE_CHILDREN,e.sortDirty=!1,e}return M(e,t),e.prototype.onChildrenChange=function(t){},e.prototype.addChild=function(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];if(e.length>1)for(var n=0;n<e.length;n++)this.addChild(e[n]);else{var r=e[0];r.parent&&r.parent.removeChild(r),r.parent=this,this.sortDirty=!0,r.transform._parentID=-1,this.children.push(r),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",r,this,this.children.length-1),r.emit("added",this)}return e[0]},e.prototype.addChildAt=function(t,e){if(e<0||e>this.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),n=this.getChildIndex(e);this.children[i]=e,this.children[n]=t,this.onChildrenChange(i<n?i:n)}},e.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},e.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);(0,x.removeItems)(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];if(e.length>1)for(var n=0;n<e.length;n++)this.removeChild(e[n]);else{var r=e[0],s=this.children.indexOf(r);if(-1===s)return null;r.parent=null,r.transform._parentID=-1,(0,x.removeItems)(this.children,s,1),this._boundsID++,this.onChildrenChange(s),r.emit("removed",this),this.emit("childRemoved",r,this,s)}return e[0]},e.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,(0,x.removeItems)(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e},e.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var i,n=t,r=e-n;if(r>0&&r<=e){i=this.children.splice(n,r);for(var s=0;s<i.length;++s)i[s].parent=null,i[s].transform&&(i[s].transform._parentID=-1);for(this._boundsID++,this.onChildrenChange(t),s=0;s<i.length;++s)i[s].emit("removed",this),this.emit("childRemoved",i[s],this,s);return i}if(0===r&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,e=0,i=this.children.length;e<i;++e){var n=this.children[e];n._lastSortedIndex=e,t||0===n.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(q),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t<e;++t){var i=this.children[t];i.visible&&i.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){var i=e._mask.maskObject||e._mask;i.calculateBounds(),this._bounds.addBoundsMask(e._bounds,i._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID},e.prototype.getLocalBounds=function(e,i){void 0===i&&(i=!1);var n=t.prototype.getLocalBounds.call(this,e);if(!i)for(var r=0,s=this.children.length;r<s;++r){var o=this.children[r];o.visible&&o.updateTransform()}return n},e.prototype._calculateBounds=function(){},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else{this._render(t);for(var e=0,i=this.children.length;e<i;++e)this.children[e].render(t)}},e.prototype.renderAdvanced=function(t){var e=this.filters,i=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var n=0;n<e.length;n++)e[n].enabled&&this._enabledFilters.push(e[n])}var r=e&&this._enabledFilters&&this._enabledFilters.length||i&&(!i.isMaskData||i.enabled&&(i.autoDetect||i.type!==z.NONE));r&&t.batch.flush(),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.push(this,this._enabledFilters),i&&t.mask.push(this,this._mask),this._render(t),n=0;for(var s=this.children.length;n<s;n++)this.children[n].render(t);r&&t.batch.flush(),i&&t.mask.pop(this),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var i="boolean"==typeof e?e:e&&e.children,n=this.removeChildren(0,this.children.length);if(i)for(var r=0;r<n.length;++r)n[r].destroy(e)},Object.defineProperty(e.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t},enumerable:!1,configurable:!0}),e}(Y);Z.prototype.containerUpdateTransform=Z.prototype.updateTransform;var K={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Y.mixin(K);var J=function(){function t(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(x.isMobile.tablet||x.isMobile.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2..toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),self.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),t.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2..toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",(function(){t._isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()})),document.body.appendChild(e),this._hookDiv=e},t.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},t.prototype.activate=function(){var t;this._isActive||(this._isActive=!0,self.document.addEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(t=this.renderer.view.parentNode)||void 0===t||t.appendChild(this.div))},t.prototype.deactivate=function(){var t;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(t=this.div.parentNode)||void 0===t||t.removeChild(this.div))},t.prototype.updateAccessibleObjects=function(t){if(t.visible&&t.accessibleChildren){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);var e=t.children;if(e)for(var i=0;i<e.length;i++)this.updateAccessibleObjects(e[i])}},t.prototype.update=function(){var t=performance.now();if(!(x.isMobile.android.device&&t<this.androidUpdateCount)&&(this.androidUpdateCount=t+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var e=this.renderer.view.getBoundingClientRect(),i=e.left,n=e.top,r=e.width,s=e.height,o=this.renderer,a=o.width,h=o.height,u=o.resolution,l=r/a*u,c=s/h*u,f=this.div;f.style.left=i+"px",f.style.top=n+"px",f.style.width=a+"px",f.style.height=h+"px";for(var d=0;d<this.children.length;d++){var p=this.children[d];if(p.renderId!==this.renderId)p._accessibleActive=!1,(0,x.removeItems)(this.children,d,1),this.div.removeChild(p._accessibleDiv),this.pool.push(p._accessibleDiv),p._accessibleDiv=null,d--;else{f=p._accessibleDiv;var g=p.hitArea,m=p.worldTransform;p.hitArea?(f.style.left=(m.tx+g.x*m.a)*l+"px",f.style.top=(m.ty+g.y*m.d)*c+"px",f.style.width=g.width*m.a*l+"px",f.style.height=g.height*m.d*c+"px"):(g=p.getBounds(),this.capHitArea(g),f.style.left=g.x*l+"px",f.style.top=g.y*c+"px",f.style.width=g.width*l+"px",f.style.height=g.height*c+"px",f.title!==p.accessibleTitle&&null!==p.accessibleTitle&&(f.title=p.accessibleTitle),f.getAttribute("aria-label")!==p.accessibleHint&&null!==p.accessibleHint&&f.setAttribute("aria-label",p.accessibleHint)),p.accessibleTitle===f.title&&p.tabIndex===f.tabIndex||(f.title=p.accessibleTitle,f.tabIndex=p.tabIndex,this.debug&&this.updateDebugHTML(f))}}this.renderId++}},t.prototype.updateDebugHTML=function(t){t.innerHTML="type: "+t.type+"</br> title : "+t.title+"</br> tabIndex: "+t.tabIndex},t.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);var e=this.renderer,i=e.width,n=e.height;t.x+t.width>i&&(t.width=i-t.x),t.y+t.height>n&&(t.height=n-t.y)},t.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},t.prototype._onClick=function(t){var e=this.renderer.plugins.interaction,i=t.target.displayObject,n=e.eventData;e.dispatchEvent(i,"click",n),e.dispatchEvent(i,"pointertap",n),e.dispatchEvent(i,"tap",n)},t.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction,i=t.target.displayObject,n=e.eventData;e.dispatchEvent(i,"mouseover",n)},t.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction,i=t.target.displayObject,n=e.eventData;e.dispatchEvent(i,"mouseout",n)},t.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},t.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},t.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},t}(),Q=i(6679),tt=function(){function t(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new w.E9,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(t.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),t.prototype.getLocalPosition=function(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)},t.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},t.prototype.reset=function(){this.isPrimary=!1},t}(),et=function(t,e){return et=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},et(t,e)},it=function(){function t(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return t.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},t.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},t}(),nt=function(){function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE}return t.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Object.defineProperty(t.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"none",{get:function(){return this._flags===t.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"over",{get:function(){return 0!=(this._flags&t.FLAGS.OVER)},set:function(e){this._doSet(t.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightDown",{get:function(){return 0!=(this._flags&t.FLAGS.RIGHT_DOWN)},set:function(e){this._doSet(t.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftDown",{get:function(){return 0!=(this._flags&t.FLAGS.LEFT_DOWN)},set:function(e){this._doSet(t.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),t.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),t}(),rt=function(){function t(){this._tempPoint=new w.E9}return t.prototype.recursiveFindHit=function(t,e,i,n,r){if(!e||!e.visible)return!1;var s=t.data.global,o=!1,a=r=e.interactive||r,h=!0;if(e.hitArea?(n&&(e.worldTransform.applyInverse(s,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?o=!0:(n=!1,h=!1)),a=!1):e._mask&&n&&(e._mask.containsPoint&&e._mask.containsPoint(s)||(n=!1)),h&&e.interactiveChildren&&e.children)for(var u=e.children,l=u.length-1;l>=0;l--){var c=u[l],f=this.recursiveFindHit(t,c,i,n,a);if(f){if(!c.parent)continue;a=!1,f&&(t.target&&(n=!1),o=!0)}}return r&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(s)&&(o=!0),e.interactive&&(o&&!t.target&&(t.target=e),i&&i(t,e,!!o))),o},t.prototype.findHit=function(t,e,i,n){this.recursiveFindHit(t,e,i,n,!1)},t}(),st={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Y.mixin(st);var ot={target:null,data:{global:null}},at=function(t){function e(e,i){var n=t.call(this)||this;return i=i||{},n.renderer=e,n.autoPreventDefault=void 0===i.autoPreventDefault||i.autoPreventDefault,n.interactionFrequency=i.interactionFrequency||10,n.mouse=new tt,n.mouse.identifier=1,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[1]=n.mouse,n.interactionDataPool=[],n.eventData=new it,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!("PointerEvent"in self),n.supportsTouchEvents="ontouchstart"in self,n.supportsPointerEvents=!!self.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new rt,n._tempDisplayObject=new $,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=void 0===i.useSystemTicker||i.useSystemTicker,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return function(t,e){function i(){this.constructor=t}et(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,e){return ot.target=null,ot.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(ot,e,null,!0),ot.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(Q.vB.system.add(this.tickerUpdate,this,Q.uF.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(Q.vB.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;self.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(self.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),self.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),self.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(self.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),self.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;self.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(self.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),self.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),self.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(self.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),self.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this.update())},e.prototype.update=function(){if(this.interactionDOMElement)if(this._didMove)this._didMove=!1;else{for(var t in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var e=this.activeInteractionData[t];if(e.originalEvent&&"touch"!==e.pointerType){var i=this.configureInteractionEventForDOMEvent(this.eventData,e.originalEvent,e);this.processInteractive(i,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){t=t||"default";var e=!0;if(self.OffscreenCanvas&&this.interactionDOMElement instanceof OffscreenCanvas&&(e=!1),this.currentCursorMode!==t){this.currentCursorMode=t;var i=this.cursorStyles[t];if(i)switch(typeof i){case"string":e&&(this.interactionDOMElement.style.cursor=i);break;case"function":i(t);break;case"object":e&&Object.assign(this.interactionDOMElement.style,i)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,e,i){i.stopPropagationHint&&t!==i.stopsPropagatingAt||(i.currentTarget=t,i.type=e,t.emit(e,i),t[e]&&t[e](i))},e.prototype.delayDispatchEvent=function(t,e,i){this.delayedEvents.push({displayObject:t,eventString:e,eventData:i})},e.prototype.mapPositionToPoint=function(t,e,i){var n;n=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:this.interactionDOMElement.width,height:this.interactionDOMElement.height,left:0,top:0};var r=1/this.resolution;t.x=(e-n.left)*(this.interactionDOMElement.width/n.width)*r,t.y=(i-n.top)*(this.interactionDOMElement.height/n.height)*r},e.prototype.processInteractive=function(t,e,i,n){var r=this.search.findHit(t,e,i,n),s=this.delayedEvents;if(!s.length)return r;t.stopPropagationHint=!1;var o=s.length;this.delayedEvents=[];for(var a=0;a<o;a++){var h=s[a],u=h.displayObject,l=h.eventString,c=h.eventData;c.stopsPropagatingAt===u&&(c.stopPropagationHint=!0),this.dispatchEvent(u,l,c)}return r},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,n=0;n<i;n++){var r=e[n],s=this.getInteractionDataForPointerId(r),o=this.configureInteractionEventForDOMEvent(this.eventData,r,s);if(o.data.originalEvent=t,this.processInteractive(o,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",o),"touch"===r.pointerType)this.emit("touchstart",o);else if("mouse"===r.pointerType||"pen"===r.pointerType){var a=2===r.button;this.emit(a?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,e,i){var n=t.data,r=t.data.identifier;if(i)if(e.trackedPointers[r]||(e.trackedPointers[r]=new nt(r)),this.dispatchEvent(e,"pointerdown",t),"touch"===n.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===n.pointerType||"pen"===n.pointerType){var s=2===n.button;s?e.trackedPointers[r].rightDown=!0:e.trackedPointers[r].leftDown=!0,this.dispatchEvent(e,s?"rightdown":"mousedown",t)}},e.prototype.onPointerComplete=function(t,e,i){for(var n=this.normalizeToPointerData(t),r=n.length,s=t.target!==this.interactionDOMElement?"outside":"",o=0;o<r;o++){var a=n[o],h=this.getInteractionDataForPointerId(a),u=this.configureInteractionEventForDOMEvent(this.eventData,a,h);if(u.data.originalEvent=t,this.processInteractive(u,this.lastObjectRendered,i,e||!s),this.emit(e?"pointercancel":"pointerup"+s,u),"mouse"===a.pointerType||"pen"===a.pointerType){var l=2===a.button;this.emit(l?"rightup"+s:"mouseup"+s,u)}else"touch"===a.pointerType&&(this.emit(e?"touchcancel":"touchend"+s,u),this.releaseInteractionDataForPointerId(a.pointerId))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,e){var i=t.data,n=t.data.identifier;void 0!==e.trackedPointers[n]&&(delete e.trackedPointers[n],this.dispatchEvent(e,"pointercancel",t),"touch"===i.pointerType&&this.dispatchEvent(e,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,e,i){var n=t.data,r=t.data.identifier,s=e.trackedPointers[r],o="touch"===n.pointerType,a="mouse"===n.pointerType||"pen"===n.pointerType,h=!1;if(a){var u=2===n.button,l=nt.FLAGS,c=u?l.RIGHT_DOWN:l.LEFT_DOWN,f=void 0!==s&&s.flags&c;i?(this.dispatchEvent(e,u?"rightup":"mouseup",t),f&&(this.dispatchEvent(e,u?"rightclick":"click",t),h=!0)):f&&this.dispatchEvent(e,u?"rightupoutside":"mouseupoutside",t),s&&(u?s.rightDown=!1:s.leftDown=!1)}i?(this.dispatchEvent(e,"pointerup",t),o&&this.dispatchEvent(e,"touchend",t),s&&(a&&!h||this.dispatchEvent(e,"pointertap",t),o&&(this.dispatchEvent(e,"tap",t),s.over=!1))):s&&(this.dispatchEvent(e,"pointerupoutside",t),o&&this.dispatchEvent(e,"touchendoutside",t)),s&&s.none&&delete e.trackedPointers[r]},e.prototype.onPointerMove=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);"mouse"!==e[0].pointerType&&"pen"!==e[0].pointerType||(this._didMove=!0,this.cursor=null);for(var i=e.length,n=0;n<i;n++){var r=e[n],s=this.getInteractionDataForPointerId(r),o=this.configureInteractionEventForDOMEvent(this.eventData,r,s);o.data.originalEvent=t,this.processInteractive(o,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",o),"touch"===r.pointerType&&this.emit("touchmove",o),"mouse"!==r.pointerType&&"pen"!==r.pointerType||this.emit("mousemove",o)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,e,i){var n=t.data,r="touch"===n.pointerType,s="mouse"===n.pointerType||"pen"===n.pointerType;s&&this.processPointerOverOut(t,e,i),this.moveWhenInside&&!i||(this.dispatchEvent(e,"pointermove",t),r&&this.dispatchEvent(e,"touchmove",t),s&&this.dispatchEvent(e,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0];"mouse"===e.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var i=this.getInteractionDataForPointerId(e),n=this.configureInteractionEventForDOMEvent(this.eventData,e,i);n.data.originalEvent=e,this.processInteractive(n,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",n),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",n):this.releaseInteractionDataForPointerId(i.identifier)}},e.prototype.processPointerOverOut=function(t,e,i){var n=t.data,r=t.data.identifier,s="mouse"===n.pointerType||"pen"===n.pointerType,o=e.trackedPointers[r];i&&!o&&(o=e.trackedPointers[r]=new nt(r)),void 0!==o&&(i&&this.mouseOverRenderer?(o.over||(o.over=!0,this.delayDispatchEvent(e,"pointerover",t),s&&this.delayDispatchEvent(e,"mouseover",t)),s&&null===this.cursor&&(this.cursor=e.cursor)):o.over&&(o.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),s&&this.dispatchEvent(e,"mouseout",t),o.none&&delete e.trackedPointers[r]))},e.prototype.onPointerOver=function(t){var e=this.normalizeToPointerData(t)[0],i=this.getInteractionDataForPointerId(e),n=this.configureInteractionEventForDOMEvent(this.eventData,e,i);n.data.originalEvent=e,"mouse"===e.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",n),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",n)},e.prototype.getInteractionDataForPointerId=function(t){var e,i=t.pointerId;return 1===i||"mouse"===t.pointerType?e=this.mouse:this.activeInteractionData[i]?e=this.activeInteractionData[i]:((e=this.interactionDataPool.pop()||new tt).identifier=i,this.activeInteractionData[i]=e),e.copyEvent(t),e},e.prototype.releaseInteractionDataForPointerId=function(t){var e=this.activeInteractionData[t];e&&(delete this.activeInteractionData[t],e.reset(),this.interactionDataPool.push(e))},e.prototype.configureInteractionEventForDOMEvent=function(t,e,i){return t.data=i,this.mapPositionToPoint(i.global,e.clientX,e.clientY),"touch"===e.pointerType&&(e.globalX=i.global.x,e.globalY=i.global.y),i.originalEvent=e,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var i=0,n=t.changedTouches.length;i<n;i++){var r=t.changedTouches[i];void 0===r.button&&(r.button=t.touches.length?1:0),void 0===r.buttons&&(r.buttons=t.touches.length?1:0),void 0===r.isPrimary&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===r.width&&(r.width=r.radiusX||1),void 0===r.height&&(r.height=r.radiusY||1),void 0===r.tiltX&&(r.tiltX=0),void 0===r.tiltY&&(r.tiltY=0),void 0===r.pointerType&&(r.pointerType="touch"),void 0===r.pointerId&&(r.pointerId=r.identifier||0),void 0===r.pressure&&(r.pressure=r.force||.5),void 0===r.twist&&(r.twist=0),void 0===r.tangentialPressure&&(r.tangentialPressure=0),void 0===r.layerX&&(r.layerX=r.offsetX=r.clientX),void 0===r.layerY&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,e.push(r)}else if(!self.MouseEvent||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof self.PointerEvent)){var s=t;void 0===s.isPrimary&&(s.isPrimary=!0),void 0===s.width&&(s.width=1),void 0===s.height&&(s.height=1),void 0===s.tiltX&&(s.tiltX=0),void 0===s.tiltY&&(s.tiltY=0),void 0===s.pointerType&&(s.pointerType="mouse"),void 0===s.pointerId&&(s.pointerId=1),void 0===s.pressure&&(s.pressure=.5),void 0===s.twist&&(s.twist=0),void 0===s.tangentialPressure&&(s.tangentialPressure=0),s.isNormalized=!0,e.push(s)}else e.push(t);return e},e.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},e}(x.EventEmitter),ht=i(2038),ut=function(){function t(e){var i=this;this.stage=new Z,e=Object.assign({forceCanvas:!1},e),this.renderer=(0,ht.e6)(e),t._plugins.forEach((function(t){t.init.call(i,e)}))}return t.registerPlugin=function(e){t._plugins.push(e)},t.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(t.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),t.prototype.destroy=function(e,i){var n=this,r=t._plugins.slice(0);r.reverse(),r.forEach((function(t){t.destroy.call(n)})),this.stage.destroy(i),this.stage=null,this.renderer.destroy(e),this.renderer=null},t._plugins=[],t}(),lt=function(){function t(){}return t.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(t){self.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(self.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){e._resizeTo&&(e.cancelResize(),e._resizeId=requestAnimationFrame((function(){return e.resize()})))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(e._resizeTo){var t,i;if(e.cancelResize(),e._resizeTo===self)t=self.innerWidth,i=self.innerHeight;else{var n=e._resizeTo;t=n.clientWidth,i=n.clientHeight}e.renderer.resize(t,i)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null},t.destroy=function(){self.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},t}();ut.registerPlugin(lt);var ct,ft,dt=new w.Ae,pt=function(){function t(t){this.renderer=t}return t.prototype.image=function(t,e,i){var n=new Image;return n.src=this.base64(t,e,i),n},t.prototype.base64=function(t,e,i){return this.canvas(t).toDataURL(e,i)},t.prototype.canvas=function(e){var i,n,r,s=this.renderer,o=!1,a=!1;e&&(e instanceof ht.TI?r=e:(r=this.renderer.generateTexture(e),a=!0)),r?(i=r.baseTexture.resolution,n=r.frame,o=!1,s.renderTexture.bind(r)):(i=this.renderer.resolution,o=!0,(n=dt).width=this.renderer.width,n.height=this.renderer.height,s.renderTexture.bind(null));var h=Math.floor(n.width*i+1e-4),u=Math.floor(n.height*i+1e-4),l=new x.CanvasRenderTarget(h,u,1),c=new Uint8Array(4*h*u),f=s.gl;f.readPixels(n.x*i,n.y*i,h,u,f.RGBA,f.UNSIGNED_BYTE,c);var d=l.context.getImageData(0,0,h,u);if(t.arrayPostDivide(c,d.data),l.context.putImageData(d,0,0),o){var p=new x.CanvasRenderTarget(l.width,l.height,1);p.context.scale(1,-1),p.context.drawImage(l.canvas,0,-u),l.destroy(),l=p}return a&&r.destroy(!0),l.canvas},t.prototype.pixels=function(e){var i,n,r,s=this.renderer,o=!1;e&&(e instanceof ht.TI?r=e:(r=this.renderer.generateTexture(e),o=!0)),r?(i=r.baseTexture.resolution,n=r.frame,s.renderTexture.bind(r)):(i=s.resolution,(n=dt).width=s.width,n.height=s.height,s.renderTexture.bind(null));var a=n.width*i,h=n.height*i,u=new Uint8Array(4*a*h),l=s.gl;return l.readPixels(n.x*i,n.y*i,a,h,l.RGBA,l.UNSIGNED_BYTE,u),o&&r.destroy(!0),t.arrayPostDivide(u,u),u},t.prototype.destroy=function(){this.renderer=null},t.arrayPostDivide=function(t,e){for(var i=0;i<t.length;i+=4){var n=e[i+3]=t[i+3];0!==n?(e[i]=Math.round(Math.min(255*t[i]/n,255)),e[i+1]=Math.round(Math.min(255*t[i+1]/n,255)),e[i+2]=Math.round(Math.min(255*t[i+2]/n,255))):(e[i]=t[i],e[i+1]=t[i+1],e[i+2]=t[i+2])}},t}(),gt=i(550),mt=i(1680);!function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL"}(ft||(ft={}));var vt=((ct={})[ft.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,ct[ft.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,ct[ft.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,ct[ft.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,ct[ft.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,ct[ft.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,ct[ft.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,ct[ft.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,ct[ft.COMPRESSED_R11_EAC]=.5,ct[ft.COMPRESSED_SIGNED_R11_EAC]=.5,ct[ft.COMPRESSED_RG11_EAC]=1,ct[ft.COMPRESSED_SIGNED_RG11_EAC]=1,ct[ft.COMPRESSED_RGB8_ETC2]=.5,ct[ft.COMPRESSED_RGBA8_ETC2_EAC]=1,ct[ft.COMPRESSED_SRGB8_ETC2]=.5,ct[ft.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,ct[ft.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,ct[ft.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,ct[ft.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,ct[ft.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,ct[ft.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,ct[ft.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,ct[ft.COMPRESSED_RGB_ETC1_WEBGL]=.5,ct[ft.COMPRESSED_RGB_ATC_WEBGL]=.5,ct[ft.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,ct[ft.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,ct),_t=function(t,e){return _t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},_t(t,e)};function yt(t,e){function i(){this.constructor=t}_t(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var bt,Et,xt=function(t){function e(e,i){void 0===i&&(i={width:1,height:1,autoLoad:!0});var n,r,s=this;return"string"==typeof e?(n=e,r=new Uint8Array):(n=null,r=e),(s=t.call(this,r,i)||this).origin=n,s.buffer=r?new ht.Rv(r):null,s.origin&&!1!==i.autoLoad&&s.load(),r&&r.length&&(s.loaded=!0,s.onBlobLoaded(s.buffer.rawBinaryData)),s}return yt(e,t),e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return t=this,void 0,i=function(){var t;return function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}(this,(function(e){switch(e.label){case 0:return[4,fetch(this.origin)];case 1:return[4,e.sent().blob()];case 2:return[4,e.sent().arrayBuffer()];case 3:return t=e.sent(),this.data=new Uint32Array(t),this.buffer=new ht.Rv(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),[2,this]}}))},new((e=Promise)||(e=Promise))((function(n,r){function s(t){try{a(i.next(t))}catch(t){r(t)}}function o(t){try{a(i.throw(t))}catch(t){r(t)}}function a(t){t.done?n(t.value):new e((function(e){e(t.value)})).then(s,o)}a((i=i.apply(t,[])).next())}));var t,e,i},e}(ht.qm),Tt=function(t){function e(i,n){var r=t.call(this,i,n)||this;return r.format=n.format,r.levels=n.levels||1,r._width=n.width,r._height=n.height,r._extension=e._formatToExtension(r.format),(n.levelBuffers||r.buffer)&&(r._levelBuffers=n.levelBuffers||e._createLevelBuffers(i instanceof Uint8Array?i:r.buffer.uint8View,r.format,r.levels,4,4,r.width,r.height)),r}return yt(e,t),e.prototype.upload=function(t,e,i){var n=t.gl;if(!t.context.extensions[this._extension])throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var r=0,s=this.levels;r<s;r++){var o=this._levelBuffers[r],a=o.levelID,h=o.levelWidth,u=o.levelHeight,l=o.levelBuffer;n.compressedTexImage2D(n.TEXTURE_2D,a,this.format,h,u,0,l)}return!0},e.prototype.onBlobLoaded=function(){this._levelBuffers=e._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},e._formatToExtension=function(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,e,i,n,r,s,o){for(var a=new Array(i),h=t.byteOffset,u=s,l=o,c=u+n-1&~(n-1),f=l+r-1&~(r-1),d=c*f*vt[e],p=0;p<i;p++)a[p]={levelID:p,levelWidth:i>1?u:c,levelHeight:i>1?l:f,levelBuffer:new Uint8Array(t.buffer,h,d)},h+=d,d=(c=(u=u>>1||1)+n-1&~(n-1))*(f=(l=l>>1||1)+r-1&~(r-1))*vt[e];return a},e}(xt),wt=function(){function t(){}return t.use=function(e,i){var n=e.data;if(e.type===gt.kC.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var r=n.textures,s=void 0,o=void 0,a=0,h=r.length;a<h;a++){var u=r[a],l=u.src,c=u.format;if(c||(o=l),t.textureFormats[c]){s=l;break}}if(!(s=s||o))return void i(new Error("Cannot load compressed-textures in "+e.url+", make sure you provide a fallback"));if(s===e.url)return void i(new Error("URL of compressed texture cannot be the same as the manifest's URL"));var f={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},d=x.url.resolve(e.url.replace(this.baseUrl,""),s),p=n.cacheID;this.add(p,d,f,(function(t){if(t.error)i(t.error);else{var n=t.texture,r=void 0===n?null:n,s=t.textures,o=void 0===s?{}:s;Object.assign(e,{texture:r,textures:o}),i()}}))}else i()},t.add=function(){var e=document.createElement("canvas").getContext("webgl");if(e){var i={s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};for(var n in t.textureExtensions=i,t.textureFormats={},i){var r=i[n];r&&Object.assign(t.textureFormats,Object.getPrototypeOf(r))}}else console.warn("WebGL not available for compressed textures. Silently failing.")},t}();function St(t,e,i){var n={textures:{},texture:null};return e?(e.map((function(t){return new ht.xE(new ht.VL(t,Object.assign({mipmap:mt.WB.OFF,alphaMode:mt.iw.NO_PREMULTIPLIED_ALPHA},i)))})).forEach((function(e,i){var r=e.baseTexture,s=t+"-"+(i+1);ht.VL.addToCache(r,s),ht.xE.addToCache(e,s),0===i&&(ht.VL.addToCache(r,t),ht.xE.addToCache(e,t),n.texture=e),n.textures[s]=e})),n):n}gt.kC.setExtensionXhrType("dds",gt.kC.XHR_RESPONSE_TYPE.BUFFER);var At,Mt;!function(t){t[t.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",t[t.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",t[t.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",t[t.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",t[t.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",t[t.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",t[t.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",t[t.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",t[t.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",t[t.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",t[t.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",t[t.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",t[t.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",t[t.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",t[t.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",t[t.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",t[t.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",t[t.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",t[t.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",t[t.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",t[t.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",t[t.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",t[t.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",t[t.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",t[t.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",t[t.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",t[t.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",t[t.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",t[t.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",t[t.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",t[t.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",t[t.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",t[t.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",t[t.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",t[t.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",t[t.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",t[t.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",t[t.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",t[t.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",t[t.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",t[t.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",t[t.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",t[t.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",t[t.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",t[t.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",t[t.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",t[t.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",t[t.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",t[t.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",t[t.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",t[t.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",t[t.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",t[t.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",t[t.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",t[t.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",t[t.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",t[t.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",t[t.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",t[t.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",t[t.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",t[t.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",t[t.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",t[t.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",t[t.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",t[t.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",t[t.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",t[t.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",t[t.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",t[t.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",t[t.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",t[t.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",t[t.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",t[t.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",t[t.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",t[t.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",t[t.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",t[t.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",t[t.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",t[t.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",t[t.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",t[t.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",t[t.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",t[t.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",t[t.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",t[t.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",t[t.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",t[t.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",t[t.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",t[t.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",t[t.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",t[t.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",t[t.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",t[t.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",t[t.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",t[t.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",t[t.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",t[t.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",t[t.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",t[t.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",t[t.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",t[t.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",t[t.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",t[t.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",t[t.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",t[t.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",t[t.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",t[t.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",t[t.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",t[t.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",t[t.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",t[t.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",t[t.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"}(At||(At={})),function(t){t[t.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",t[t.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",t[t.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"}(Mt||(Mt={}));var Ot,Rt,Ct,It=((bt={})[827611204]=ft.COMPRESSED_RGBA_S3TC_DXT1_EXT,bt[861165636]=ft.COMPRESSED_RGBA_S3TC_DXT3_EXT,bt[894720068]=ft.COMPRESSED_RGBA_S3TC_DXT5_EXT,bt),Pt=((Et={})[At.DXGI_FORMAT_BC1_TYPELESS]=ft.COMPRESSED_RGBA_S3TC_DXT1_EXT,Et[At.DXGI_FORMAT_BC1_UNORM]=ft.COMPRESSED_RGBA_S3TC_DXT1_EXT,Et[At.DXGI_FORMAT_BC2_TYPELESS]=ft.COMPRESSED_RGBA_S3TC_DXT3_EXT,Et[At.DXGI_FORMAT_BC2_UNORM]=ft.COMPRESSED_RGBA_S3TC_DXT3_EXT,Et[At.DXGI_FORMAT_BC3_TYPELESS]=ft.COMPRESSED_RGBA_S3TC_DXT5_EXT,Et[At.DXGI_FORMAT_BC3_UNORM]=ft.COMPRESSED_RGBA_S3TC_DXT5_EXT,Et[At.DXGI_FORMAT_BC1_UNORM_SRGB]=ft.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,Et[At.DXGI_FORMAT_BC2_UNORM_SRGB]=ft.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,Et[At.DXGI_FORMAT_BC3_UNORM_SRGB]=ft.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,Et),Nt=function(){function t(){}return t.use=function(e,i){if("dds"===e.extension&&e.data)try{Object.assign(e,St(e.name||e.url,t.parse(e.data),e.metadata))}catch(t){return void i(t)}i()},t.parse=function(t){var e=new Uint32Array(t);if(542327876!==e[0])throw new Error("Invalid DDS file magic word");var i=new Uint32Array(t,0,124/Uint32Array.BYTES_PER_ELEMENT),n=i[3],r=i[4],s=i[7],o=new Uint32Array(t,19*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),a=o[1];if(4&a){var h=o[2];if(808540228!==h){var u=It[h],l=new Uint8Array(t,128);return[new Tt(l,{format:u,width:r,height:n,levels:s})]}var c=new Uint32Array(e.buffer,128,20/Uint32Array.BYTES_PER_ELEMENT),f=c[0],d=c[1],p=c[2],g=c[3],m=Pt[f];if(void 0===m)throw new Error("DDSLoader cannot parse texture data with DXGI format "+f);if(4===p)throw new Error("DDSLoader does not support cubemap textures");if(d===Mt.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSLoader does not supported 3D texture data");var v=new Array;if(1===g)v.push(new Uint8Array(t,148));else{for(var _=vt[m],y=0,b=r,E=n,x=0;x<s;x++)y+=Math.max(1,b+3&-4)*Math.max(1,E+3&-4)*_,b>>>=1,E>>>=1;var T=148;for(x=0;x<g;x++)v.push(new Uint8Array(t,T,y)),T+=y}return v.map((function(t){return new Tt(t,{format:m,width:r,height:n,levels:s})}))}if(64&a)throw new Error("DDSLoader does not support uncompressed texture data.");if(512&a)throw new Error("DDSLoader does not supported YUV uncompressed texture data.");if(131072&a)throw new Error("DDSLoader does not support single-channel (lumninance) texture data!");if(2&a)throw new Error("DDSLoader does not support single-channel (alpha) texture data!");throw new Error("DDSLoader failed to load a texture file due to an unknown reason!")},t}();gt.kC.setExtensionXhrType("ktx",gt.kC.XHR_RESPONSE_TYPE.BUFFER);var Dt=[171,75,84,88,32,49,49,187,13,10,26,10],Lt=((Ot={})[mt.vK.UNSIGNED_BYTE]=1,Ot[mt.vK.UNSIGNED_SHORT]=2,Ot[mt.vK.FLOAT]=4,Ot[mt.vK.HALF_FLOAT]=8,Ot),kt=((Rt={})[mt.I2.RGBA]=4,Rt[mt.I2.RGB]=3,Rt[mt.I2.LUMINANCE]=1,Rt[mt.I2.LUMINANCE_ALPHA]=2,Rt[mt.I2.ALPHA]=1,Rt),Bt=((Ct={})[mt.vK.UNSIGNED_SHORT_4_4_4_4]=2,Ct[mt.vK.UNSIGNED_SHORT_5_5_5_1]=2,Ct[mt.vK.UNSIGNED_SHORT_5_6_5]=2,Ct),Ft=function(){function t(){}return t.use=function(e,i){if("ktx"===e.extension&&e.data)try{var n=e.name||e.url;Object.assign(e,St(n,t.parse(n,e.data),e.metadata))}catch(t){return void i(t)}i()},t.parse=function(e,i){var n=new DataView(i);if(!t.validate(e,n))return null;var r=67305985===n.getUint32(12,!0),s=n.getUint32(16,r),o=n.getUint32(24,r),a=n.getUint32(28,r),h=n.getUint32(36,r),u=n.getUint32(40,r)||1,l=n.getUint32(44,r)||1,c=n.getUint32(48,r)||1,f=n.getUint32(52,r),d=n.getUint32(56,r),p=n.getUint32(60,r);if(0===u||1!==l)throw new Error("Only 2D textures are supported");if(1!==f)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==c)throw new Error("WebGL does not support array textures");var g,m=h+3&-4,v=u+3&-4,_=new Array(c),y=h*u;if(0===s&&(y=m*v),void 0===(g=0!==s?Lt[s]?Lt[s]*kt[o]:Bt[s]:vt[a]))throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var b=y*g,E=h,x=u,T=m,w=v,S=64+p,A=0;A<d;A++){for(var M=n.getUint32(S,r),O=S+4,R=0;R<c;R++){var C=_[R];C||(C=_[R]=new Array(d)),C[A]={levelID:A,levelWidth:d>1?E:T,levelHeight:d>1?x:w,levelBuffer:new Uint8Array(i,O,b)},O+=b}S=(S+=M+4)%4!=0?S+4-S%4:S,b=(T=(E=E>>1||1)+4-1&-4)*(w=(x=x>>1||1)+4-1&-4)*g}if(0!==s)throw new Error("TODO: Uncompressed");return _.map((function(t){return new Tt(null,{format:a,width:h,height:u,levels:d,levelBuffers:t})}))},t.validate=function(t,e){for(var i=0;i<Dt.length;i++)if(e.getUint8(i)!==Dt[i])return console.error(t+" is not a valid *.ktx file!"),!1;return!0},t}(),Gt=function(t,e){return Gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Gt(t,e)};function Ut(t,e){function i(){this.constructor=t}Gt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var jt,Xt,Ht=function(t){function e(e,i,n,r){void 0===e&&(e=1500),void 0===n&&(n=16384),void 0===r&&(r=!1);var s=t.call(this)||this;return n>16384&&(n=16384),s._properties=[!1,!0,!1,!1,!1],s._maxSize=e,s._batchSize=n,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=mt.T$.NORMAL,s.autoResize=r,s.roundPixels=!0,s.baseTexture=null,s.setProperties(i),s._tint=0,s.tintRgb=new Float32Array(4),s.tint=16777215,s}return Ut(e,t),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,(0,x.hex2rgb)(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return e.onChildrenChange(0)}))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},e}(Z),zt=function(){function t(t,e,i){this.geometry=new ht.ZX,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(var n=0;n<t.length;++n){var r=t[n];r={attributeName:r.attributeName,size:r.size,uploadFunction:r.uploadFunction,type:r.type||mt.vK.FLOAT,offset:r.offset},e[n]?this.dynamicProperties.push(r):this.staticProperties.push(r)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return t.prototype.initBuffers=function(){var t=this.geometry,e=0;this.indexBuffer=new ht.lW((0,x.createIndicesForQuads)(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var i=0;i<this.dynamicProperties.length;++i)(o=this.dynamicProperties[i]).offset=e,e+=o.size,this.dynamicStride+=o.size;var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new ht.lW(this.dynamicData,!1,!1);var r=0;for(this.staticStride=0,i=0;i<this.staticProperties.length;++i)(o=this.staticProperties[i]).offset=r,r+=o.size,this.staticStride+=o.size;var s=new ArrayBuffer(this.size*this.staticStride*4*4);for(this.staticData=new Float32Array(s),this.staticDataUint32=new Uint32Array(s),this.staticBuffer=new ht.lW(this.staticData,!0,!1),i=0;i<this.dynamicProperties.length;++i){var o=this.dynamicProperties[i];t.addAttribute(o.attributeName,this.dynamicBuffer,0,o.type===mt.vK.UNSIGNED_BYTE,o.type,4*this.dynamicStride,4*o.offset)}for(i=0;i<this.staticProperties.length;++i)o=this.staticProperties[i],t.addAttribute(o.attributeName,this.staticBuffer,0,o.type===mt.vK.UNSIGNED_BYTE,o.type,4*this.staticStride,4*o.offset)},t.prototype.uploadDynamic=function(t,e,i){for(var n=0;n<this.dynamicProperties.length;n++){var r=this.dynamicProperties[n];r.uploadFunction(t,e,i,r.type===mt.vK.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,r.offset)}this.dynamicBuffer._updateID++},t.prototype.uploadStatic=function(t,e,i){for(var n=0;n<this.staticProperties.length;n++){var r=this.staticProperties[n];r.uploadFunction(t,e,i,r.type===mt.vK.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,r.offset)}this.staticBuffer._updateID++},t.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},t}(),Wt=function(t){function e(e){var i=t.call(this,e)||this;return i.shader=null,i.properties=null,i.tempMatrix=new w.y3,i.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:i.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:i.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:i.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:i.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:mt.vK.UNSIGNED_BYTE,uploadFunction:i.uploadTint,offset:0}],i.shader=ht.ex.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",{}),i.state=ht.ZM.for2d(),i}return Ut(e,t),e.prototype.render=function(t){var e=t.children,i=t._maxSize,n=t._batchSize,r=this.renderer,s=e.length;if(0!==s){s>i&&!t.autoResize&&(s=i);var o=t._buffers;o||(o=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.state.blendMode=(0,x.correctBlendMode)(t.blendMode,a.alphaMode),r.state.set(this.state);var h=r.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(r.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=(0,x.premultiplyRgba)(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.alphaMode),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,f=0;c<s;c+=n,f+=1){var d=s-c;d>n&&(d=n),f>=o.length&&o.push(this._generateOneMoreBuffer(t));var p=o[f];p.uploadDynamic(e,c,d);var g=t._bufferUpdateIDs[f]||0;(l=l||p._updateID<g)&&(p._updateID=t._updateID,p.uploadStatic(e,c,d)),r.geometry.bind(p.geometry),h.drawElements(h.TRIANGLES,6*d,h.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var e=[],i=t._maxSize,n=t._batchSize,r=t._properties,s=0;s<i;s+=n)e.push(new zt(this.properties,r,n));return e},e.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,i=t._properties;return new zt(this.properties,i,e)},e.prototype.uploadVertices=function(t,e,i,n,r,s){for(var o=0,a=0,h=0,u=0,l=0;l<i;++l){var c=t[e+l],f=c._texture,d=c.scale.x,p=c.scale.y,g=f.trim,m=f.orig;g?(o=(a=g.x-c.anchor.x*m.width)+g.width,h=(u=g.y-c.anchor.y*m.height)+g.height):(o=m.width*(1-c.anchor.x),a=m.width*-c.anchor.x,h=m.height*(1-c.anchor.y),u=m.height*-c.anchor.y),n[s]=a*d,n[s+1]=u*p,n[s+r]=o*d,n[s+r+1]=u*p,n[s+2*r]=o*d,n[s+2*r+1]=h*p,n[s+3*r]=a*d,n[s+3*r+1]=h*p,s+=4*r}},e.prototype.uploadPosition=function(t,e,i,n,r,s){for(var o=0;o<i;o++){var a=t[e+o].position;n[s]=a.x,n[s+1]=a.y,n[s+r]=a.x,n[s+r+1]=a.y,n[s+2*r]=a.x,n[s+2*r+1]=a.y,n[s+3*r]=a.x,n[s+3*r+1]=a.y,s+=4*r}},e.prototype.uploadRotation=function(t,e,i,n,r,s){for(var o=0;o<i;o++){var a=t[e+o].rotation;n[s]=a,n[s+r]=a,n[s+2*r]=a,n[s+3*r]=a,s+=4*r}},e.prototype.uploadUvs=function(t,e,i,n,r,s){for(var o=0;o<i;++o){var a=t[e+o]._texture._uvs;a?(n[s]=a.x0,n[s+1]=a.y0,n[s+r]=a.x1,n[s+r+1]=a.y1,n[s+2*r]=a.x2,n[s+2*r+1]=a.y2,n[s+3*r]=a.x3,n[s+3*r+1]=a.y3,s+=4*r):(n[s]=0,n[s+1]=0,n[s+r]=0,n[s+r+1]=0,n[s+2*r]=0,n[s+2*r+1]=0,n[s+3*r]=0,n[s+3*r+1]=0,s+=4*r)}},e.prototype.uploadTint=function(t,e,i,n,r,s){for(var o=0;o<i;++o){var a=t[e+o],h=a._texture.baseTexture.alphaMode>0,u=a.alpha,l=u<1&&h?(0,x.premultiplyTint)(a._tintRGB,u):a._tintRGB+(255*u<<24);n[s]=l,n[s+r]=l,n[s+2*r]=l,n[s+3*r]=l,s+=4*r}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}(ht.bO);!function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"}(jt||(jt={})),function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"}(Xt||(Xt={}));var Vt={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var i=Math.ceil(t/this.maxLength);return i<this.minSegments?i=this.minSegments:i>this.maxSegments&&(i=this.maxSegments),i}},Yt=function(){function t(){this.color=16777215,this.alpha=1,this.texture=ht.xE.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=ht.xE.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),$t=function(t,e){return $t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},$t(t,e)};function qt(t,e){function i(){this.constructor=t}$t(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Zt={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var i=t.points,n=t.holes,r=e.points,s=e.indices;if(i.length>=6){for(var o=[],a=0;a<n.length;a++){var h=n[a];o.push(i.length/2),i=i.concat(h.points)}var u=(0,x.earcut)(i,o,2);if(!u)return;var l=r.length/2;for(a=0;a<u.length;a+=3)s.push(u[a]+l),s.push(u[a+1]+l),s.push(u[a+2]+l);for(a=0;a<i.length;a++)r.push(i[a])}}},Kt={build:function(t){var e,i,n=t.shape,r=t.points,s=n.x,o=n.y;if(r.length=0,t.type===w.HS.CIRC)e=n.radius,i=n.radius;else{var a=t.shape;e=a.width,i=a.height}if(0!==e&&0!==i){var h=Math.floor(30*Math.sqrt(n.radius))||Math.floor(15*Math.sqrt(e+i));h/=2.3;for(var u=2*Math.PI/h,l=0;l<h-.5;l++)r.push(s+Math.sin(-u*l)*e,o+Math.cos(-u*l)*i);r.push(r[0],r[1])}},triangulate:function(t,e){var i=t.points,n=e.points,r=e.indices,s=n.length/2,o=s,a=t.shape,h=t.matrix,u=a.x,l=a.y;n.push(t.matrix?h.a*u+h.c*l+h.tx:u,t.matrix?h.b*u+h.d*l+h.ty:l);for(var c=0;c<i.length;c+=2)n.push(i[c],i[c+1]),r.push(s++,o,s)}},Jt={build:function(t){var e=t.shape,i=e.x,n=e.y,r=e.width,s=e.height,o=t.points;o.length=0,o.push(i,n,i+r,n,i+r,n+s,i,n+s)},triangulate:function(t,e){var i=t.points,n=e.points,r=n.length/2;n.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),e.indices.push(r,r+1,r+2,r+1,r+2,r+3)}};function Qt(t,e,i){return t+(e-t)*i}function te(t,e,i,n,r,s,o){void 0===o&&(o=[]);for(var a=o,h=0,u=0,l=0,c=0,f=0,d=0,p=0,g=0;p<=20;++p)h=Qt(t,i,g=p/20),u=Qt(e,n,g),l=Qt(i,r,g),c=Qt(n,s,g),f=Qt(h,l,g),d=Qt(u,c,g),0===p&&a[a.length-2]===f&&a[a.length-1]===d||a.push(f,d);return a}var ee={build:function(t){var e=t.shape,i=t.points,n=e.x,r=e.y,s=e.width,o=e.height,a=Math.max(0,Math.min(e.radius,Math.min(s,o)/2));i.length=0,a?(te(n,r+a,n,r,n+a,r,i),te(n+s-a,r,n+s,r,n+s,r+a,i),te(n+s,r+o-a,n+s,r+o,n+s-a,r+o,i),te(n+a,r+o,n,r+o,n,r+o-a,i)):i.push(n,r,n+s,r,n+s,r+o,n,r+o)},triangulate:function(t,e){for(var i=t.points,n=e.points,r=e.indices,s=n.length/2,o=(0,x.earcut)(i,null,2),a=0,h=o.length;a<h;a+=3)r.push(o[a]+s),r.push(o[a+1]+s),r.push(o[a+2]+s);for(a=0,h=i.length;a<h;a++)n.push(i[a],i[++a])}};function ie(t,e,i,n,r,s,o,a){var h,u;o?(h=n,u=-i):(h=-n,u=i);var l=t-i*r+h,c=e-n*r+u,f=t+i*s+h,d=e+n*s+u;return a.push(l,c),a.push(f,d),2}function ne(t,e,i,n,r,s,o,a){var h=i-t,u=n-e,l=Math.atan2(h,u),c=Math.atan2(r-t,s-e);a&&l<c?l+=2*Math.PI:!a&&l>c&&(c+=2*Math.PI);var f=l,d=c-l,p=Math.abs(d),g=Math.sqrt(h*h+u*u),m=1+(15*p*Math.sqrt(g)/Math.PI>>0),v=d/m;if(f+=v,a){o.push(t,e),o.push(i,n);for(var _=1,y=f;_<m;_++,y+=v)o.push(t,e),o.push(t+Math.sin(y)*g,e+Math.cos(y)*g);o.push(t,e),o.push(r,s)}else{for(o.push(i,n),o.push(t,e),_=1,y=f;_<m;_++,y+=v)o.push(t+Math.sin(y)*g,e+Math.cos(y)*g),o.push(t,e);o.push(r,s),o.push(t,e)}return 2*m}function re(t,e){t.lineStyle.native?function(t,e){var i=0,n=t.shape,r=t.points||n.points,s=n.type!==w.HS.POLY||n.closeStroke;if(0!==r.length){var o=e.points,a=e.indices,h=r.length/2,u=o.length/2,l=u;for(o.push(r[0],r[1]),i=1;i<h;i++)o.push(r[2*i],r[2*i+1]),a.push(l,l+1),l++;s&&a.push(l,u)}}(t,e):function(t,e){var i=t.shape,n=t.points||i.points.slice(),r=e.closePointEps;if(0!==n.length){var s=t.lineStyle,o=new w.E9(n[0],n[1]),a=new w.E9(n[n.length-2],n[n.length-1]),h=i.type!==w.HS.POLY||i.closeStroke,u=Math.abs(o.x-a.x)<r&&Math.abs(o.y-a.y)<r;if(h){n=n.slice(),u&&(n.pop(),n.pop(),a.set(n[n.length-2],n[n.length-1]));var l=.5*(o.x+a.x),c=.5*(a.y+o.y);n.unshift(l,c),n.push(l,c)}var f=e.points,d=n.length/2,p=n.length,g=f.length/2,m=s.width/2,v=m*m,_=s.miterLimit*s.miterLimit,y=n[0],b=n[1],E=n[2],x=n[3],T=0,S=0,A=-(b-x),M=y-E,O=0,R=0,C=Math.sqrt(A*A+M*M);A/=C,M/=C,A*=m,M*=m;var I=s.alignment,P=2*(1-I),N=2*I;h||(s.cap===Xt.ROUND?p+=ne(y-A*(P-N)*.5,b-M*(P-N)*.5,y-A*P,b-M*P,y+A*N,b+M*N,f,!0)+2:s.cap===Xt.SQUARE&&(p+=ie(y,b,A,M,P,N,!0,f))),f.push(y-A*P,b-M*P),f.push(y+A*N,b+M*N);for(var D=1;D<d-1;++D){y=n[2*(D-1)],b=n[2*(D-1)+1],E=n[2*D],x=n[2*D+1],T=n[2*(D+1)],S=n[2*(D+1)+1],A=-(b-x),M=y-E,A/=C=Math.sqrt(A*A+M*M),M/=C,A*=m,M*=m,O=-(x-S),R=E-T,O/=C=Math.sqrt(O*O+R*R),R/=C,O*=m,R*=m;var L=E-y,k=b-x,B=E-T,F=S-x,G=k*B-F*L,U=G<0;if(Math.abs(G)<.1)f.push(E-A*P,x-M*P),f.push(E+A*N,x+M*N);else{var j=(-A+y)*(-M+x)-(-A+E)*(-M+b),X=(-O+T)*(-R+x)-(-O+E)*(-R+S),H=(L*X-B*j)/G,z=(F*j-k*X)/G,W=(H-E)*(H-E)+(z-x)*(z-x),V=E+(H-E)*P,Y=x+(z-x)*P,$=E-(H-E)*N,q=x-(z-x)*N,Z=U?P:N;W<=Math.min(L*L+k*k,B*B+F*F)+Z*Z*v?s.join===jt.BEVEL||W/v>_?(U?(f.push(V,Y),f.push(E+A*N,x+M*N),f.push(V,Y),f.push(E+O*N,x+R*N)):(f.push(E-A*P,x-M*P),f.push($,q),f.push(E-O*P,x-R*P),f.push($,q)),p+=2):s.join===jt.ROUND?U?(f.push(V,Y),f.push(E+A*N,x+M*N),p+=ne(E,x,E+A*N,x+M*N,E+O*N,x+R*N,f,!0)+4,f.push(V,Y),f.push(E+O*N,x+R*N)):(f.push(E-A*P,x-M*P),f.push($,q),p+=ne(E,x,E-A*P,x-M*P,E-O*P,x-R*P,f,!1)+4,f.push(E-O*P,x-R*P),f.push($,q)):(f.push(V,Y),f.push($,q)):(f.push(E-A*P,x-M*P),f.push(E+A*N,x+M*N),s.join===jt.BEVEL||W/v>_||(s.join===jt.ROUND?p+=U?ne(E,x,E+A*N,x+M*N,E+O*N,x+R*N,f,!0)+2:ne(E,x,E-A*P,x-M*P,E-O*P,x-R*P,f,!1)+2:(U?(f.push($,q),f.push($,q)):(f.push(V,Y),f.push(V,Y)),p+=2)),f.push(E-O*P,x-R*P),f.push(E+O*N,x+R*N),p+=2)}}y=n[2*(d-2)],b=n[2*(d-2)+1],E=n[2*(d-1)],A=-(b-(x=n[2*(d-1)+1])),M=y-E,A/=C=Math.sqrt(A*A+M*M),M/=C,A*=m,M*=m,f.push(E-A*P,x-M*P),f.push(E+A*N,x+M*N),h||(s.cap===Xt.ROUND?p+=ne(E-A*(P-N)*.5,x-M*(P-N)*.5,E-A*P,x-M*P,E+A*N,x+M*N,f,!1)+2:s.cap===Xt.SQUARE&&(p+=ie(E,x,A,M,P,N,!1,f)));var K=e.indices,J=Vt.epsilon*Vt.epsilon;for(D=g;D<p+g-2;++D)y=f[2*D],b=f[2*D+1],E=f[2*(D+1)],x=f[2*(D+1)+1],T=f[2*(D+2)],S=f[2*(D+2)+1],Math.abs(y*(x-S)+E*(S-b)+T*(b-x))<J||K.push(D,D+1,D+2)}}(t,e)}var se,oe=function(){function t(){}return t.curveTo=function(t,e,i,n,r,s){var o=s[s.length-2],a=s[s.length-1]-e,h=o-t,u=n-e,l=i-t,c=Math.abs(a*l-h*u);if(c<1e-8||0===r)return s[s.length-2]===t&&s[s.length-1]===e||s.push(t,e),null;var f=a*a+h*h,d=u*u+l*l,p=a*u+h*l,g=r*Math.sqrt(f)/c,m=r*Math.sqrt(d)/c,v=g*p/f,_=m*p/d,y=g*l+m*h,b=g*u+m*a,E=h*(m+v),x=a*(m+v),T=l*(g+_),w=u*(g+_);return{cx:y+t,cy:b+e,radius:r,startAngle:Math.atan2(x-b,E-y),endAngle:Math.atan2(w-b,T-y),anticlockwise:h*u>l*a}},t.arc=function(t,e,i,n,r,s,o,a,h){for(var u=o-s,l=Vt._segmentsCount(Math.abs(u)*r,40*Math.ceil(Math.abs(u)/w._b)),c=u/(2*l),f=2*c,d=Math.cos(c),p=Math.sin(c),g=l-1,m=g%1/g,v=0;v<=g;++v){var _=c+s+f*(v+m*v),y=Math.cos(_),b=-Math.sin(_);h.push((d*y+p*b)*r+i,(d*-b+p*y)*r+n)}},t}(),ae=function(){function t(){}return t.curveLength=function(t,e,i,n,r,s,o,a){for(var h=0,u=0,l=0,c=0,f=0,d=0,p=0,g=0,m=0,v=0,_=0,y=t,b=e,E=1;E<=10;++E)v=y-(g=(p=(d=(f=1-(u=E/10))*f)*f)*t+3*d*u*i+3*f*(l=u*u)*r+(c=l*u)*o),_=b-(m=p*e+3*d*u*n+3*f*l*s+c*a),y=g,b=m,h+=Math.sqrt(v*v+_*_);return h},t.curveTo=function(e,i,n,r,s,o,a){var h=a[a.length-2],u=a[a.length-1];a.length-=2;var l=Vt._segmentsCount(t.curveLength(h,u,e,i,n,r,s,o)),c=0,f=0,d=0,p=0,g=0;a.push(h,u);for(var m=1,v=0;m<=l;++m)d=(f=(c=1-(v=m/l))*c)*c,g=(p=v*v)*v,a.push(d*h+3*f*v*e+3*c*p*n+g*s,d*u+3*f*v*i+3*c*p*r+g*o)},t}(),he=function(){function t(){}return t.curveLength=function(t,e,i,n,r,s){var o=t-2*i+r,a=e-2*n+s,h=2*i-2*t,u=2*n-2*e,l=4*(o*o+a*a),c=4*(o*h+a*u),f=h*h+u*u,d=2*Math.sqrt(l+c+f),p=Math.sqrt(l),g=2*l*p,m=2*Math.sqrt(f),v=c/p;return(g*d+p*c*(d-m)+(4*f*l-c*c)*Math.log((2*p+v+d)/(v+m)))/(4*g)},t.curveTo=function(e,i,n,r,s){for(var o=s[s.length-2],a=s[s.length-1],h=Vt._segmentsCount(t.curveLength(o,a,e,i,n,r)),u=0,l=0,c=1;c<=h;++c){var f=c/h;u=o+(e-o)*f,l=a+(i-a)*f,s.push(u+(e+(n-e)*f-u)*f,l+(i+(r-i)*f-l)*f)}},t}(),ue=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),le=((se={})[w.HS.POLY]=Zt,se[w.HS.CIRC]=Kt,se[w.HS.ELIP]=Kt,se[w.HS.RECT]=Jt,se[w.HS.RREC]=ee,se),ce=[],fe=[];function de(t){for(var e=t.points,i=0,n=0;n<e.length-2;n+=2)i+=(e[n+2]-e[n])*(e[n+3]+e[n+1]);return i>0}var pe,ge=function(){function t(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=n,this.type=t.type}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),me=new w.E9,ve=new S,_e=function(t){function e(){var e=t.call(this)||this;return e.closePointEps=1e-4,e.boundsPadding=0,e.uvsFloat32=null,e.indicesUint16=null,e.batchable=!1,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.drawCalls=[],e.batchDirty=-1,e.batches=[],e.dirty=0,e.cacheDirty=-1,e.clearDirty=0,e.shapeIndex=0,e._bounds=new S,e.boundsDirty=-1,e}return qt(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),fe.push(this.drawCalls[t]);for(this.drawCalls.length=0,t=0;t<this.batches.length;t++){var e=this.batches[t];e.reset(),ce.push(e)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=null);var r=new ge(t,e,i,n);return this.graphicsData.push(r),this.dirty++,this},e.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var i=new ge(t,null,null,e),n=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=n.lineStyle,n.holes.push(i),this.dirty++,this},e.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var e=this.graphicsData,i=0;i<e.length;++i){var n=e[i];if(n.fillStyle.visible&&n.shape&&(n.matrix?n.matrix.applyInverse(t,me):me.copyFrom(t),n.shape.contains(me.x,me.y))){var r=!1;if(n.holes)for(var s=0;s<n.holes.length;s++)if(n.holes[s].shape.contains(me.x,me.y)){r=!0;break}if(!r)return!0}}return!1},e.prototype.updateBatches=function(t){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var e=this.uvs,i=this.graphicsData,n=null,r=null;this.batches.length>0&&(r=(n=this.batches[this.batches.length-1]).style);for(var s=this.shapeIndex;s<i.length;s++){this.shapeIndex++;var o=i[s],a=o.fillStyle,h=o.lineStyle;le[o.type].build(o),o.matrix&&this.transformPoints(o.points,o.matrix);for(var u=0;u<2;u++){var l=0===u?a:h;if(l.visible){var c=l.texture.baseTexture,f=this.indices.length,d=this.points.length/2;c.wrapMode=mt.Nt.REPEAT,0===u?this.processFill(o):this.processLine(o);var p=this.points.length/2-d;0!==p&&(n&&!this._compareStyles(r,l)&&(n.end(f,d),n=null),n||((n=ce.pop()||new ue).begin(l,f,d),this.batches.push(n),r=l),this.addUvs(this.points,e,l.texture,d,p,l.matrix))}}}var g=this.indices.length,m=this.points.length/2;if(n&&n.end(g,m),0!==this.batches.length){if(this.indicesUint16&&this.indices.length===this.indicesUint16.length)this.indicesUint16.set(this.indices);else{var v=m>65535&&t;this.indicesUint16=v?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,e){return!(!t||!e)&&t.texture.baseTexture===e.texture.baseTexture&&t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t<e;t++){var i=this.graphicsData[t],n=i.fillStyle,r=i.lineStyle;if(n&&!n.texture.baseTexture.valid)return!1;if(r&&!r.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,e=0,i=t.length;e<i;e++)for(var n=t[e],r=0;r<n.size;r++){var s=n.start+r;this.indicesUint16[s]=this.indicesUint16[s]-n.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,i=0;i<t.length;i++)if(t[i].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++ht.VL._globalBatch,e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),fe.push(this.drawCalls[e]);this.drawCalls.length=0;var i=this.colors,n=this.textureIds,r=fe.pop();r||((r=new ht.a$).texArray=new ht.Ie),r.texArray.count=0,r.start=0,r.size=0,r.type=mt.lg.TRIANGLES;var s=0,o=null,a=0,h=!1,u=mt.lg.TRIANGLES,l=0;for(this.drawCalls.push(r),e=0;e<this.batches.length;e++){var c=this.batches[e],f=c.style,d=f.texture.baseTexture;h!==!!f.native&&(u=(h=!!f.native)?mt.lg.LINES:mt.lg.TRIANGLES,o=null,s=8,t++),o!==d&&(o=d,d._batchEnabled!==t&&(8===s&&(t++,s=0,r.size>0&&((r=fe.pop())||((r=new ht.a$).texArray=new ht.Ie),this.drawCalls.push(r)),r.start=l,r.size=0,r.texArray.count=0,r.type=u),d.touched=1,d._batchEnabled=t,d._batchLocation=s,d.wrapMode=mt.Nt.REPEAT,r.texArray.elements[r.texArray.count++]=d,s++)),r.size+=c.size,l+=c.size,a=d._batchLocation,this.addColors(i,f.color,f.alpha,c.attribSize,c.attribStart),this.addTextureIds(n,a,c.attribSize,c.attribStart)}ht.VL._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,i=this.colors,n=this.textureIds,r=new ArrayBuffer(3*t.length*4),s=new Float32Array(r),o=new Uint32Array(r),a=0,h=0;h<t.length/2;h++)s[a++]=t[2*h],s[a++]=t[2*h+1],s[a++]=e[2*h],s[a++]=e[2*h+1],o[a++]=i[h],s[a++]=n[h];this._buffer.update(r),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){t.holes.length?(this.processHoles(t.holes),Zt.triangulate(t,this)):le[t.type].triangulate(t,this)},e.prototype.processLine=function(t){re(t,this);for(var e=0;e<t.holes.length;e++)re(t.holes[e],this)},e.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var i=t[e];le[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds,e=ve,i=w.y3.IDENTITY;this._bounds.clear(),e.clear();for(var n=0;n<this.graphicsData.length;n++){var r=this.graphicsData[n],s=r.shape,o=r.type,a=r.lineStyle,h=r.matrix||w.y3.IDENTITY,u=0;if(a&&a.visible){var l=a.alignment;u=a.width,o===w.HS.POLY?de(s)?u*=1-l:u*=l:u*=Math.max(0,l)}if(i!==h&&(e.isEmpty()||(t.addBoundsMatrix(e,i),e.clear()),i=h),o===w.HS.RECT||o===w.HS.RREC){var c=s;e.addFramePad(c.x,c.y,c.x+c.width,c.y+c.height,u,u)}else if(o===w.HS.CIRC){var f=s;e.addFramePad(f.x,f.y,f.x,f.y,f.radius+u,f.radius+u)}else if(o===w.HS.ELIP){var d=s;e.addFramePad(d.x,d.y,d.x,d.y,d.width+u,d.height+u)}else{var p=s;t.addVerticesMatrix(i,p.points,0,p.points.length,u,u)}}e.isEmpty()||t.addBoundsMatrix(e,i),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,e){for(var i=0;i<t.length/2;i++){var n=t[2*i],r=t[2*i+1];t[2*i]=e.a*n+e.c*r+e.tx,t[2*i+1]=e.b*n+e.d*r+e.ty}},e.prototype.addColors=function(t,e,i,n,r){void 0===r&&(r=0);var s=(e>>16)+(65280&e)+((255&e)<<16),o=(0,x.premultiplyTint)(s,i);t.length=Math.max(t.length,r+n);for(var a=0;a<n;a++)t[r+a]=o},e.prototype.addTextureIds=function(t,e,i,n){void 0===n&&(n=0),t.length=Math.max(t.length,n+i);for(var r=0;r<i;r++)t[n+r]=e},e.prototype.addUvs=function(t,e,i,n,r,s){void 0===s&&(s=null);for(var o=0,a=e.length,h=i.frame;o<r;){var u=t[2*(n+o)],l=t[2*(n+o)+1];if(s){var c=s.a*u+s.c*l+s.tx;l=s.b*u+s.d*l+s.ty,u=c}o++,e.push(u/h.width,l/h.height)}var f=i.baseTexture;(h.width<f.width||h.height<f.height)&&this.adjustUvs(e,i,a,r)},e.prototype.adjustUvs=function(t,e,i,n){for(var r=e.baseTexture,s=1e-6,o=i+2*n,a=e.frame,h=a.width/r.width,u=a.height/r.height,l=a.x/a.width,c=a.y/a.height,f=Math.floor(t[i]+s),d=Math.floor(t[i+1]+s),p=i+2;p<o;p+=2)f=Math.min(f,Math.floor(t[p]+s)),d=Math.min(d,Math.floor(t[p+1]+s));for(l-=f,c-=d,p=i;p<o;p+=2)t[p]=(t[p]+l)*h,t[p+1]=(t[p+1]+c)*u},e.BATCHABLE_SIZE=100,e}(ht.JZ),ye=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.alignment=.5,e.native=!1,e.cap=Xt.BUTT,e.join=jt.MITER,e.miterLimit=10,e}return qt(e,t),e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){t.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e}(Yt),be=new Float32Array(3),Ee={},xe=function(t){function e(e){void 0===e&&(e=null);var i=t.call(this)||this;return i.shader=null,i.pluginName="batch",i.currentPath=null,i.batches=[],i.batchTint=-1,i.batchDirty=-1,i.vertexData=null,i._fillStyle=new Yt,i._lineStyle=new ye,i._matrix=null,i._holeMode=!1,i.state=ht.ZM.for2d(),i._geometry=e||new _e,i._geometry.refCount++,i._transformID=-1,i.tint=16777215,i.blendMode=mt.T$.NORMAL,i}return qt(e,t),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t,e,i,n,r){return void 0===t&&(t=null),void 0===e&&(e=0),void 0===i&&(i=1),void 0===n&&(n=.5),void 0===r&&(r=!1),"number"==typeof t&&(t={width:t,color:e,alpha:i,alignment:n,native:r}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:ht.xE.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:Xt.BUTT,join:jt.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var e=t.width>0&&t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:e},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new w.mg,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new w.mg,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,n=i[i.length-2],r=i[i.length-1];return n===t&&r===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,n){this._initCurve();var r=this.currentPath.points;return 0===r.length&&this.moveTo(0,0),he.curveTo(t,e,i,n,r),this},e.prototype.bezierCurveTo=function(t,e,i,n,r,s){return this._initCurve(),ae.curveTo(t,e,i,n,r,s,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,n,r){this._initCurve(t,e);var s=this.currentPath.points,o=oe.curveTo(t,e,i,n,r,s);if(o){var a=o.cx,h=o.cy,u=o.radius,l=o.startAngle,c=o.endAngle,f=o.anticlockwise;this.arc(a,h,u,l,c,f)}return this},e.prototype.arc=function(t,e,i,n,r,s){if(void 0===s&&(s=!1),n===r)return this;if(!s&&r<=n?r+=w._b:s&&n<=r&&(n+=w._b),0==r-n)return this;var o=t+Math.cos(n)*i,a=e+Math.sin(n)*i,h=this._geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var l=Math.abs(u[u.length-2]-o),c=Math.abs(u[u.length-1]-a);l<h&&c<h||u.push(o,a)}else this.moveTo(o,a),u=this.currentPath.points;return oe.arc(o,a,t,e,i,n,r,s,u),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill({texture:ht.xE.WHITE,color:t,alpha:e})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:ht.xE.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var e=t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:e},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,n){return this.drawShape(new w.Ae(t,e,i,n))},e.prototype.drawRoundedRect=function(t,e,i,n,r){return this.drawShape(new w.c9(t,e,i,n,r))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new w.Cd(t,e,i))},e.prototype.drawEllipse=function(t,e,i,n){return this.drawShape(new w.Pj(t,e,i,n))},e.prototype.drawPolygon=function(){for(var t,e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];var r=!0,s=i[0];s.points?(r=s.closeStroke,t=s.points):t=Array.isArray(i[0])?i[0]:i;var o=new w.mg(t);return o.closeStroke=r,this.drawShape(o),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return!(1!==t.length||t[0].shape.type!==w.HS.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var e=this._geometry,i=t.context.supports.uint32Indices;e.updateBatches(i),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(var n=0;n<i;n++){var r=t.batches[n],s=r.style.color,o=new Float32Array(this.vertexData.buffer,4*r.attribStart*2,2*r.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*r.attribStart*2,2*r.attribSize),h={vertexData:o,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*r.start,r.size),uvs:a,_batchRGB:(0,x.hex2rgb)(s),_tintRGB:s,_texture:r.style.texture,alpha:r.style.alpha,worldAlpha:1};this.batches[n]=h}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var e=0,i=this.batches.length;e<i;e++){var n=this.batches[e];n.worldAlpha=this.worldAlpha*n.alpha,t.plugins[this.pluginName].render(n)}}},e.prototype._renderDirect=function(t){var e=this._resolveDirectShader(t),i=this._geometry,n=this.tint,r=this.worldAlpha,s=e.uniforms,o=i.drawCalls;s.translationMatrix=this.transform.worldTransform,s.tint[0]=(n>>16&255)/255*r,s.tint[1]=(n>>8&255)/255*r,s.tint[2]=(255&n)/255*r,s.tint[3]=r,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var a=0,h=o.length;a<h;a++)this._renderDrawCallDirect(t,i.drawCalls[a])},e.prototype._renderDrawCallDirect=function(t,e){for(var i=e.texArray,n=e.type,r=e.size,s=e.start,o=i.count,a=0;a<o;a++)t.texture.bind(i.elements[a],a);t.geometry.draw(n,r,s)},e.prototype._resolveDirectShader=function(t){var e=this.shader,i=this.pluginName;if(!e){if(!Ee[i]){for(var n=t.plugins.batch.MAX_TEXTURES,r=new Int32Array(n),s=0;s<n;s++)r[s]=s;var o={tint:new Float32Array([1,1,1,1]),translationMatrix:new w.y3,default:ht.oo.from({uSamplers:r},!0)},a=t.plugins[i]._shader.program;Ee[i]=new ht.ex(a,o)}e=Ee[i]}return e},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var e=t.bounds,i=e.minX,n=e.minY,r=e.maxX,s=e.maxY;this._bounds.addFrame(this.transform,i,n,r,s)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=(0,x.hex2rgb)(this.tint,be),e=0;e<this.batches.length;e++){var i=this.batches[e],n=i._batchRGB,r=(t[0]*n[0]*255<<16)+(t[1]*n[1]*255<<8)+(0|t[2]*n[2]*255);i._tintRGB=(r>>16)+(65280&r)+((255&r)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,i=e.a,n=e.b,r=e.c,s=e.d,o=e.tx,a=e.ty,h=this._geometry.points,u=this.vertexData,l=0,c=0;c<h.length;c+=2){var f=h[c],d=h[c+1];u[l++]=i*f+r*d+o,u[l++]=s*d+n*f+a}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(e){this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,t.prototype.destroy.call(this,e)},e._TEMP_POINT=new w.E9,e}(Z),Te={buildPoly:Zt,buildCircle:Kt,buildRectangle:Jt,buildRoundedRectangle:ee,buildLine:re,ArcUtils:oe,BezierUtils:ae,QuadraticUtils:he,BatchPart:ue,FILL_COMMANDS:le,BATCH_POOL:ce,DRAW_CALL_POOL:fe},we=function(t,e){return we=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},we(t,e)},Se=new w.E9,Ae=new Uint16Array([0,1,2,0,2,3]),Me=function(t){function e(e){var i=t.call(this)||this;return i._anchor=new w.AB(i._onAnchorUpdate,i,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),i._texture=null,i._width=0,i._height=0,i._tint=null,i._tintRGB=null,i.tint=16777215,i.blendMode=mt.T$.NORMAL,i._cachedTint=16777215,i.uvs=null,i.texture=e||ht.xE.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=Ae,i.pluginName="batch",i.isSprite=!0,i._roundPixels=T.X.ROUND_PIXELS,i}return function(t,e){function i(){this.constructor=t}we(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=(0,x.sign)(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=(0,x.sign)(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,i=e.a,n=e.b,r=e.c,s=e.d,o=e.tx,a=e.ty,h=this.vertexData,u=t.trim,l=t.orig,c=this._anchor,f=0,d=0,p=0,g=0;if(u?(f=(d=u.x-c._x*l.width)+u.width,p=(g=u.y-c._y*l.height)+u.height):(f=(d=-c._x*l.width)+l.width,p=(g=-c._y*l.height)+l.height),h[0]=i*d+r*g+o,h[1]=s*g+n*d+a,h[2]=i*f+r*g+o,h[3]=s*g+n*f+a,h[4]=i*f+r*p+o,h[5]=s*p+n*f+a,h[6]=i*d+r*p+o,h[7]=s*p+n*d+a,this._roundPixels)for(var m=T.X.RESOLUTION,v=0;v<h.length;++v)h[v]=Math.round((h[v]*m|0)/m)}},e.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,i=t.orig,n=this._anchor,r=this.transform.worldTransform,s=r.a,o=r.b,a=r.c,h=r.d,u=r.tx,l=r.ty,c=-n._x*i.width,f=c+i.width,d=-n._y*i.height,p=d+i.height;e[0]=s*c+a*d+u,e[1]=h*d+o*c+l,e[2]=s*f+a*d+u,e[3]=h*d+o*f+l,e[4]=s*f+a*p+u,e[5]=h*p+o*f+l,e[6]=s*c+a*p+u,e[7]=h*p+o*c+l},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._localBounds||(this._localBounds=new S),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new w.Ae),e=this._localBoundsRect),this._localBounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Se);var e=this._texture.orig.width,i=this._texture.orig.height,n=-e*this.anchor.x,r=0;return Se.x>=n&&Se.x<n+e&&(r=-i*this.anchor.y,Se.y>=r&&Se.y<r+i)},e.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var i="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!i)}this._texture=null},e.from=function(t,i){return new e(t instanceof ht.xE?t:ht.xE.from(t,i))},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var e=(0,x.sign)(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var e=(0,x.sign)(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||ht.xE.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(Z),Oe=function(t,e){return Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Oe(t,e)};!function(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(pe||(pe={}));var Re={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:pe.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Ce=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ie=function(){function t(t){this.styleID=0,this.reset(),De(this,t,t)}return t.prototype.clone=function(){var e={};return De(e,this,Re),new t(e)},t.prototype.reset=function(){De(this,Re,Re)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=Ne(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=Ne(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stroke",{get:function(){return this._stroke},set:function(t){var e=Ne(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trim",{get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},enumerable:!1,configurable:!0}),t.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var i=e.length-1;i>=0;i--){var n=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&Ce.indexOf(n)<0&&(n='"'+n+'"'),e[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},t}();function Pe(t){return"number"==typeof t?(0,x.hex2string)(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Ne(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=Pe(t[e]);return t}return Pe(t)}function De(t,e,i){for(var n in i)Array.isArray(e[n])?t[n]=e[n].slice():t[n]=e[n]}var Le=function(){function t(t,e,i,n,r,s,o,a,h){this.text=t,this.style=e,this.width=i,this.height=n,this.lines=r,this.lineWidths=s,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=h}return t.measureText=function(e,i,n,r){void 0===r&&(r=t._canvas),n=null==n?i.wordWrap:n;var s=i.toFontString(),o=t.measureFont(s);0===o.fontSize&&(o.fontSize=i.fontSize,o.ascent=i.fontSize);var a=r.getContext("2d");a.font=s;for(var h=(n?t.wordWrap(e,i,r):e).split(/(?:\r\n|\r|\n)/),u=new Array(h.length),l=0,c=0;c<h.length;c++){var f=a.measureText(h[c]).width+(h[c].length-1)*i.letterSpacing;u[c]=f,l=Math.max(l,f)}var d=l+i.strokeThickness;i.dropShadow&&(d+=i.dropShadowDistance);var p=i.lineHeight||o.fontSize+i.strokeThickness,g=Math.max(p,o.fontSize+i.strokeThickness)+(h.length-1)*(p+i.leading);return i.dropShadow&&(g+=i.dropShadowDistance),new t(e,i,d,g,h,u,p+i.leading,l,o)},t.wordWrap=function(e,i,n){void 0===n&&(n=t._canvas);for(var r=n.getContext("2d"),s=0,o="",a="",h=Object.create(null),u=i.letterSpacing,l=i.whiteSpace,c=t.collapseSpaces(l),f=t.collapseNewlines(l),d=!c,p=i.wordWrapWidth+u,g=t.tokenize(e),m=0;m<g.length;m++){var v=g[m];if(t.isNewline(v)){if(!f){a+=t.addLine(o),d=!c,o="",s=0;continue}v=" "}if(c){var _=t.isBreakingSpace(v),y=t.isBreakingSpace(o[o.length-1]);if(_&&y)continue}var b=t.getFromCache(v,u,h,r);if(b>p)if(""!==o&&(a+=t.addLine(o),o="",s=0),t.canBreakWords(v,i.breakWords))for(var E=t.wordWrapSplit(v),x=0;x<E.length;x++){for(var T=E[x],w=1;E[x+w];){var S=E[x+w],A=T[T.length-1];if(t.canBreakChars(A,S,v,x,i.breakWords))break;T+=S,w++}x+=T.length-1;var M=t.getFromCache(T,u,h,r);M+s>p&&(a+=t.addLine(o),d=!1,o="",s=0),o+=T,s+=M}else{o.length>0&&(a+=t.addLine(o),o="",s=0);var O=m===g.length-1;a+=t.addLine(v,!O),d=!1,o="",s=0}else b+s>p&&(d=!1,a+=t.addLine(o),o="",s=0),(o.length>0||!t.isBreakingSpace(v)||d)&&(o+=v,s+=b)}return a+t.addLine(o,!1)},t.addLine=function(e,i){return void 0===i&&(i=!0),e=t.trimRight(e),i?e+"\n":e},t.getFromCache=function(t,e,i,n){var r=i[t];if("number"!=typeof r){var s=t.length*e;r=n.measureText(t).width+s,i[t]=r}return r},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var i=e.length-1;i>=0;i--){var n=e[i];if(!t.isBreakingSpace(n))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e,i){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var i=[],n="";if("string"!=typeof e)return i;for(var r=0;r<e.length;r++){var s=e[r],o=e[r+1];t.isBreakingSpace(s,o)||t.isNewline(s)?(""!==n&&(i.push(n),n=""),i.push(s)):n+=s}return""!==n&&i.push(n),i},t.canBreakWords=function(t,e){return e},t.canBreakChars=function(t,e,i,n,r){return!0},t.wordWrapSplit=function(t){return t.split("")},t.measureFont=function(e){if(t._fonts[e])return t._fonts[e];var i={ascent:0,descent:0,fontSize:0},n=t._canvas,r=t._context;r.font=e;var s=t.METRICS_STRING+t.BASELINE_SYMBOL,o=Math.ceil(r.measureText(s).width),a=Math.ceil(r.measureText(t.BASELINE_SYMBOL).width),h=Math.ceil(t.HEIGHT_MULTIPLIER*a);a=a*t.BASELINE_MULTIPLIER|0,n.width=o,n.height=h,r.fillStyle="#f00",r.fillRect(0,0,o,h),r.font=e,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(s,0,a);var u=r.getImageData(0,0,o,h).data,l=u.length,c=4*o,f=0,d=0,p=!1;for(f=0;f<a;++f){for(var g=0;g<c;g+=4)if(255!==u[d+g]){p=!0;break}if(p)break;d+=c}for(i.ascent=a-f,d=l-c,p=!1,f=h;f>a;--f){for(g=0;g<c;g+=4)if(255!==u[d+g]){p=!0;break}if(p)break;d-=c}return i.descent=f-a,i.fontSize=i.ascent+i.descent,t._fonts[e]=i,i},t.clearMetrics=function(e){void 0===e&&(e=""),e?delete t._fonts[e]:t._fonts={}},t}(),ke=function(){try{var t=new OffscreenCanvas(0,0),e=t.getContext("2d");return e&&e.measureText?t:document.createElement("canvas")}catch(t){return document.createElement("canvas")}}();ke.width=ke.height=10,Le._canvas=ke,Le._context=ke.getContext("2d"),Le._fonts={},Le.METRICS_STRING="|ÉqÅ",Le.BASELINE_SYMBOL="M",Le.BASELINE_MULTIPLIER=1.4,Le.HEIGHT_MULTIPLIER=2,Le._newlines=[10,13],Le._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var Be={texture:!0,children:!1,baseTexture:!0},Fe=function(t){function e(e,i,n){var r=this,s=!1;n||(n=document.createElement("canvas"),s=!0),n.width=3,n.height=3;var o=ht.xE.from(n);return o.orig=new w.Ae,o.trim=new w.Ae,(r=t.call(this,o)||this)._ownCanvas=s,r.canvas=n,r.context=r.canvas.getContext("2d"),r._resolution=T.X.RESOLUTION,r._autoResolution=!0,r._text=null,r._style=null,r._styleListener=null,r._font="",r.text=e,r.style=i,r.localStyleID=-1,r}return function(t,e){function i(){this.constructor=t}Oe(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.updateText=function(t){var i=this._style;if(this.localStyleID!==i.styleID&&(this.dirty=!0,this.localStyleID=i.styleID),this.dirty||!t){this._font=this._style.toFontString();var n,r,s=this.context,o=Le.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),a=o.width,h=o.height,u=o.lines,l=o.lineHeight,c=o.lineWidths,f=o.maxLineWidth,d=o.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,a)+2*i.padding)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,h)+2*i.padding)*this._resolution),s.scale(this._resolution,this._resolution),s.clearRect(0,0,this.canvas.width,this.canvas.height),s.font=this._font,s.lineWidth=i.strokeThickness,s.textBaseline=i.textBaseline,s.lineJoin=i.lineJoin,s.miterLimit=i.miterLimit;for(var p=i.dropShadow?2:1,g=0;g<p;++g){var m=i.dropShadow&&0===g,v=m?Math.ceil(Math.max(1,h)+2*i.padding):0,_=v*this._resolution;if(m){s.fillStyle="black",s.strokeStyle="black";var y=i.dropShadowColor,b=(0,x.hex2rgb)("number"==typeof y?y:(0,x.string2hex)(y)),E=i.dropShadowBlur*this._resolution,T=i.dropShadowDistance*this._resolution;s.shadowColor="rgba("+255*b[0]+","+255*b[1]+","+255*b[2]+","+i.dropShadowAlpha+")",s.shadowBlur=E,s.shadowOffsetX=Math.cos(i.dropShadowAngle)*T,s.shadowOffsetY=Math.sin(i.dropShadowAngle)*T+_}else s.fillStyle=this._generateFillStyle(i,u,o),s.strokeStyle=i.stroke,s.shadowColor="black",s.shadowBlur=0,s.shadowOffsetX=0,s.shadowOffsetY=0;var w=(l-d.fontSize)/2;(!e.nextLineHeightBehavior||l-d.fontSize<0)&&(w=0);for(var S=0;S<u.length;S++)n=i.strokeThickness/2,r=i.strokeThickness/2+S*l+d.ascent+w,"right"===i.align?n+=f-c[S]:"center"===i.align&&(n+=(f-c[S])/2),i.stroke&&i.strokeThickness&&this.drawLetterSpacing(u[S],n+i.padding,r+i.padding-v,!0),i.fill&&this.drawLetterSpacing(u[S],n+i.padding,r+i.padding-v)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,e,i,n){void 0===n&&(n=!1);var r=this._style.letterSpacing,s="letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype;if(0===r||s)return s&&(this.context.letterSpacing=r,this.context.textLetterSpacing=r),void(n?this.context.strokeText(t,e,i):this.context.fillText(t,e,i));for(var o=e,a=Array.from?Array.from(t):t.split(""),h=this.context.measureText(t).width,u=0,l=0;l<a.length;++l){var c=a[l];n?this.context.strokeText(c,o,i):this.context.fillText(c,o,i);for(var f="",d=l+1;d<a.length;++d)f+=a[d];o+=h-(u=this.context.measureText(f).width)+r,h=u}},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=(0,x.trimCanvas)(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var i=this._texture,n=this._style,r=n.trim?0:n.padding,s=i.baseTexture;i.trim.width=i._frame.width=t.width/this._resolution,i.trim.height=i._frame.height=t.height/this._resolution,i.trim.x=-r,i.trim.y=-r,i.orig.width=i._frame.width-2*r,i.orig.height=i._frame.height-2*r,this._onTextureUpdate(),s.setRealSize(t.width,t.height,this._resolution),i.updateUvs(),this._recursivePostUpdateTransform(),this.dirty=!1},e.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype._render.call(this,e)},e.prototype.getLocalBounds=function(e){return this.updateText(!0),t.prototype.getLocalBounds.call(this,e)},e.prototype._calculateBounds=function(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._generateFillStyle=function(t,e,i){var n,r=t.fill;if(!Array.isArray(r))return r;if(1===r.length)return r[0];var s=t.dropShadow?t.dropShadowDistance:0,o=t.padding||0,a=this.canvas.width/this._resolution-s-2*o,h=this.canvas.height/this._resolution-s-2*o,u=r.slice(),l=t.fillGradientStops.slice();if(!l.length)for(var c=u.length+1,f=1;f<c;++f)l.push(f/c);if(u.unshift(r[0]),l.unshift(0),u.push(r[r.length-1]),l.push(1),t.fillGradientType===pe.LINEAR_VERTICAL){n=this.context.createLinearGradient(a/2,o,a/2,h+o);var d=i.fontProperties.fontSize+t.strokeThickness;for(f=0;f<e.length;f++){var p=i.lineHeight*(f-1)+d,g=i.lineHeight*f,m=g;f>0&&p>g&&(m=(g+p)/2);var v=g+d,_=i.lineHeight*(f+1),y=v;f+1<e.length&&_<v&&(y=(v+_)/2);for(var b=(y-m)/h,E=0;E<u.length;E++){var x;x="number"==typeof l[E]?l[E]:E/u.length;var T=Math.min(1,Math.max(0,m/h+x*b));T=Number(T.toFixed(5)),n.addColorStop(T,u[E])}}}else{n=this.context.createLinearGradient(o,h/2,a+o,h/2);var w=u.length+1,S=1;for(f=0;f<u.length;f++){var A;A="number"==typeof l[f]?l[f]:S/w,n.addColorStop(A,u[f]),S++}}return n},e.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},Be,e),t.prototype.destroy.call(this,e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(e.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var e=(0,x.sign)(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var e=(0,x.sign)(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},this._style=t instanceof Ie?t:new Ie(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.nextLineHeightBehavior=!1,e}(Me);T.X.UPLOADS_PER_FRAME=4;var Ge=function(t,e){return Ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Ge(t,e)},Ue=function(){function t(t){this.maxItemsPerFrame=t,this.itemsLeft=0}return t.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},t.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},t}();function je(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var n=0;n<t._textures.length;n++)if(t._textures[n]instanceof ht.xE){var r=t._textures[n].baseTexture;-1===e.indexOf(r)&&(e.push(r),i=!0)}return i}function Xe(t,e){if(t.baseTexture instanceof ht.VL){var i=t.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function He(t,e){if(t._texture&&t._texture instanceof ht.xE){var i=t._texture.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function ze(t,e){return e instanceof Fe&&(e.updateText(!0),!0)}function We(t,e){if(e instanceof Ie){var i=e.toFontString();return Le.measureFont(i),!0}return!1}function Ve(t,e){if(t instanceof Fe){-1===e.indexOf(t.style)&&e.push(t.style),-1===e.indexOf(t)&&e.push(t);var i=t._texture.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function Ye(t,e){return t instanceof Ie&&(-1===e.indexOf(t)&&e.push(t),!0)}var $e=function(){function t(t){var e=this;this.limiter=new Ue(T.X.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(Ve),this.registerFindHook(Ye),this.registerFindHook(je),this.registerFindHook(Xe),this.registerFindHook(He),this.registerUploadHook(ze),this.registerUploadHook(We)}return t.prototype.upload=function(t,e){"function"==typeof t&&(e=t,t=null),t&&this.add(t),this.queue.length?(e&&this.completes.push(e),this.ticking||(this.ticking=!0,Q.vB.system.addOnce(this.tick,this,Q.uF.UTILITY))):e&&e()},t.prototype.tick=function(){setTimeout(this.delayedTick,0)},t.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var t=this.queue[0],e=!1;if(t&&!t._destroyed)for(var i=0,n=this.uploadHooks.length;i<n;i++)if(this.uploadHooks[i](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)Q.vB.system.addOnce(this.tick,this,Q.uF.UTILITY);else{this.ticking=!1;var r=this.completes.slice(0);for(this.completes.length=0,i=0,n=r.length;i<n;i++)r[i]()}},t.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},t.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},t.prototype.add=function(t){for(var e=0,i=this.addHooks.length;e<i&&!this.addHooks[e](t,this.queue);e++);if(t instanceof Z)for(e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this},t.prototype.destroy=function(){this.ticking&&Q.vB.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();function qe(t,e){return e instanceof ht.VL&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function Ze(t,e){if(!(e instanceof xe))return!1;var i=e.geometry;e.finishPoly(),i.updateBatches();for(var n=i.batches,r=0;r<n.length;r++){var s=n[r].style.texture;s&&qe(t,s.baseTexture)}return i.batchable||t.geometry.bind(i,e._resolveDirectShader(t)),!0}function Ke(t,e){return t instanceof xe&&(e.push(t),!0)}var Je=function(t){function e(e){var i=t.call(this,e)||this;return i.uploadHookHelper=i.renderer,i.registerFindHook(Ke),i.registerUploadHook(qe),i.registerUploadHook(Ze),i}return function(t,e){function i(){this.constructor=t}Ge(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e}($e),Qe=function(){function t(t){this.maxMilliseconds=t,this.frameStart=0}return t.prototype.beginFrame=function(){this.frameStart=Date.now()},t.prototype.allowedToUpload=function(){return Date.now()-this.frameStart<this.maxMilliseconds},t}(),ti=function(){function t(t,e,i){void 0===i&&(i=null),this._texture=t instanceof ht.xE?t:null,this.baseTexture=t instanceof ht.VL?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;var n=this.baseTexture.resource;this.resolution=this._updateResolution(i||(n?n.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return t.prototype._updateResolution=function(t){void 0===t&&(t=null);var e=this.data.meta.scale,i=(0,x.getResolutionOfUrl)(t,null);return null===i&&(i=void 0!==e?parseFloat(e):1),1!==i&&this.baseTexture.setResolution(i),i},t.prototype.parse=function(e){this._batchIndex=0,this._callback=e,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},t.prototype._processFrames=function(e){for(var i=e,n=t.BATCH_SIZE;i-e<n&&i<this._frameKeys.length;){var r=this._frameKeys[i],s=this._frames[r],o=s.frame;if(o){var a,h=null,u=!1!==s.trimmed&&s.sourceSize?s.sourceSize:s.frame,l=new w.Ae(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);a=s.rotated?new w.Ae(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):new w.Ae(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),!1!==s.trimmed&&s.spriteSourceSize&&(h=new w.Ae(Math.floor(s.spriteSourceSize.x)/this.resolution,Math.floor(s.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[r]=new ht.xE(this.baseTexture,a,l,h,s.rotated?2:0,s.anchor),ht.xE.addToCache(this.textures[r],r)}i++}},t.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var i=0;i<t[e].length;i++){var n=t[e][i];this.animations[e].push(this.textures[n])}}},t.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},t.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((function(){e._batchIndex*t.BATCH_SIZE<e._frameKeys.length?e._nextBatch():(e._processAnimations(),e._parseComplete())}),0)},t.prototype.destroy=function(t){var e;for(var i in void 0===t&&(t=!1),this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(null===(e=this._texture)||void 0===e||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null},t.BATCH_SIZE=1e3,t}(),ei=function(){function t(){}return t.use=function(e,i){var n,r,s=this,o=e.name+"_image";if(e.data&&e.type===gt.kC.TYPE.JSON&&e.data.frames&&!s.resources[o]){var a=null===(r=null===(n=e.data)||void 0===n?void 0:n.meta)||void 0===r?void 0:r.related_multi_packs;if(Array.isArray(a))for(var h=function(t){if("string"!=typeof t)return"continue";var i=t.replace(".json",""),n=x.url.resolve(e.url.replace(s.baseUrl,""),t);if(s.resources[i]||Object.values(s.resources).some((function(t){return x.url.format(x.url.parse(t.url))===n})))return"continue";var r={crossOrigin:e.crossOrigin,loadType:gt.kC.LOAD_TYPE.XHR,xhrType:gt.kC.XHR_RESPONSE_TYPE.JSON,parentResource:e,metadata:e.metadata};s.add(i,n,r)},u=0,l=a;u<l.length;u++)h(l[u]);var c={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},f=t.getResourcePath(e,s.baseUrl);s.add(o,f,c,(function(t){if(t.error)i(t.error);else{var n=new ti(t.texture,e.data,e.url);n.parse((function(){e.spritesheet=n,e.textures=n.textures,i()}))}}))}else i()},t.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:x.url.resolve(t.url.replace(e,""),t.data.meta.image)},t}(),ii=function(t,e){return ii=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},ii(t,e)};function ni(t,e){function i(){this.constructor=t}ii(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var ri=new w.E9,si=function(t){function e(e,i,n){void 0===i&&(i=100),void 0===n&&(n=100);var r=t.call(this,e)||this;return r.tileTransform=new w.wx,r._width=i,r._height=n,r.uvMatrix=r.texture.uvMatrix||new ht.UX(e),r.pluginName="tilingSprite",r.uvRespectAnchor=!1,r}return ni(e,t),Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,i=this._width*(1-this._anchor._x),n=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,i,n)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new w.Ae),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,ri);var e=this._width,i=this._height,n=-e*this.anchor._x;if(ri.x>=n&&ri.x<n+e){var r=-i*this.anchor._y;if(ri.y>=r&&ri.y<r+i)return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,i){return new e(t instanceof ht.xE?t:ht.xE.from(t,i),i.width,i.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e}(Me),oi="#version 100\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",ai=new w.y3,hi=function(t){function e(e){var i=t.call(this,e)||this;return e.runners.contextChange.add(i),i.quad=new ht.ud,i.state=ht.ZM.for2d(),i}return ni(e,t),e.prototype.contextChange=function(){var t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=ht.ex.from(oi,"#version 100\n#define SHADER_NAME Tiling-Sprite-Simple-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 texSample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = texSample * uColor;\n}\n",e),this.shader=t.context.webGLVersion>1?ht.ex.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",e):ht.ex.from(oi,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",e)},e.prototype.render=function(t){var e=this.renderer,i=this.quad,n=i.vertices;n[0]=n[6]=t._width*-t.anchor.x,n[1]=n[3]=t._height*-t.anchor.y,n[2]=n[4]=t._width*(1-t.anchor.x),n[5]=n[7]=t._height*(1-t.anchor.y);var r=t.uvRespectAnchor?t.anchor.x:0,s=t.uvRespectAnchor?t.anchor.y:0;(n=i.uvs)[0]=n[6]=-r,n[1]=n[3]=-s,n[2]=n[4]=1-r,n[5]=n[7]=1-s,i.invalidate();var o=t._texture,a=o.baseTexture,h=t.tileTransform.localTransform,u=t.uvMatrix,l=a.isPowerOfTwo&&o.frame.width===a.width&&o.frame.height===a.height;l&&(a._glTextures[e.CONTEXT_UID]?l=a.wrapMode!==mt.Nt.CLAMP:a.wrapMode===mt.Nt.CLAMP&&(a.wrapMode=mt.Nt.REPEAT));var c=l?this.simpleShader:this.shader,f=o.width,d=o.height,p=t._width,g=t._height;ai.set(h.a*f/p,h.b*f/g,h.c*d/p,h.d*d/g,h.tx/p,h.ty/g),ai.invert(),l?ai.prepend(u.mapCoord):(c.uniforms.uMapCoord=u.mapCoord.toArray(!0),c.uniforms.uClampFrame=u.uClampFrame,c.uniforms.uClampOffset=u.uClampOffset),c.uniforms.uTransform=ai.toArray(!0),c.uniforms.uColor=(0,x.premultiplyTintToRgba)(t.tint,t.worldAlpha,c.uniforms.uColor,a.alphaMode),c.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),c.uniforms.uSampler=o,e.shader.bind(c),e.geometry.bind(i),this.state.blendMode=(0,x.correctBlendMode)(t.blendMode,a.alphaMode),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(ht.bO),ui=function(t,e){return ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},ui(t,e)};function li(t,e){function i(){this.constructor=t}ui(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var ci=function(){function t(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return t.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}},t}(),fi=new w.E9,di=new w.mg,pi=function(t){function e(e,i,n,r){void 0===r&&(r=mt.lg.TRIANGLES);var s=t.call(this)||this;return s.geometry=e,s.shader=i,s.state=n||ht.ZM.for2d(),s.drawMode=r,s.start=0,s.size=0,s.uvs=null,s.indices=null,s.vertexData=new Float32Array(1),s.vertexDirty=-1,s._transformID=-1,s._roundPixels=T.X.ROUND_PIXELS,s.batchUvs=null,s}return li(e,t),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){var i=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===mt.lg.TRIANGLES&&i.length<2*e.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var e=this.geometry,i=this.shader;i.uvMatrix&&(i.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=i._tintRGB,this._texture=i.texture;var n=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[n]),t.plugins[n].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry.buffers[0],e=t.data,i=t._updateID;if(i!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var n=this.transform.worldTransform,r=n.a,s=n.b,o=n.c,a=n.d,h=n.tx,u=n.ty,l=this.vertexData,c=0;c<l.length/2;c++){var f=e[2*c],d=e[2*c+1];l[2*c]=r*f+o*d+h,l[2*c+1]=s*f+a*d+u}if(this._roundPixels){var p=T.X.RESOLUTION;for(c=0;c<l.length;++c)l[c]=Math.round((l[c]*p|0)/p)}this.vertexDirty=i}},e.prototype.calculateUvs=function(){var t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new ci(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},e.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,fi);for(var e=this.geometry.getBuffer("aVertexPosition").data,i=di.points,n=this.geometry.getIndex().data,r=n.length,s=4===this.drawMode?3:1,o=0;o+2<r;o+=s){var a=2*n[o],h=2*n[o+1],u=2*n[o+2];if(i[0]=e[a],i[1]=e[a+1],i[2]=e[h],i[3]=e[h+1],i[4]=e[u],i[5]=e[u+1],di.contains(fi.x,fi.y))return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},e.BATCHABLE_SIZE=100,e}(Z),gi=function(t){function e(e,i){var n=this,r={uSampler:e,alpha:1,uTextureMatrix:w.y3.IDENTITY,uColor:new Float32Array([1,1,1,1])};return(i=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},i)).uniforms&&Object.assign(r,i.uniforms),(n=t.call(this,i.program||ht.$r.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),r)||this)._colorDirty=!1,n.uvMatrix=new ht.UX(e),n.batchable=void 0===i.program,n.pluginName=i.pluginName,n.tint=i.tint,n.alpha=i.alpha,n}return li(e,t),Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;(0,x.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(ht.ex),mi=function(t){function e(e,i,n){var r=t.call(this)||this,s=new ht.lW(e),o=new ht.lW(i,!0),a=new ht.lW(n,!0,!0);return r.addAttribute("aVertexPosition",s,2,!1,mt.vK.FLOAT).addAttribute("aTextureCoord",o,2,!1,mt.vK.FLOAT).addIndex(a),r._updateId=-1,r}return li(e,t),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(ht.ZX),vi=function(t,e){return vi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},vi(t,e)},_i=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},yi=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var n in e){var r=e[n].match(/^[a-z]+/gm)[0],s=e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var a in s){var h=s[a].split("="),u=h[0],l=h[1].replace(/"/gm,""),c=parseFloat(l),f=isNaN(c)?l:c;o[u]=f}i[r].push(o)}var d=new _i;return i.info.forEach((function(t){return d.info.push({face:t.face,size:parseInt(t.size,10)})})),i.common.forEach((function(t){return d.common.push({lineHeight:parseInt(t.lineHeight,10)})})),i.page.forEach((function(t){return d.page.push({id:parseInt(t.id,10),file:t.file})})),i.char.forEach((function(t){return d.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})})),i.kerning.forEach((function(t){return d.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})})),i.distanceField.forEach((function(t){return d.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType})})),d},t}(),bi=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new _i,i=t.getElementsByTagName("info"),n=t.getElementsByTagName("common"),r=t.getElementsByTagName("page"),s=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),a=t.getElementsByTagName("distanceField"),h=0;h<i.length;h++)e.info.push({face:i[h].getAttribute("face"),size:parseInt(i[h].getAttribute("size"),10)});for(h=0;h<n.length;h++)e.common.push({lineHeight:parseInt(n[h].getAttribute("lineHeight"),10)});for(h=0;h<r.length;h++)e.page.push({id:parseInt(r[h].getAttribute("id"),10)||0,file:r[h].getAttribute("file")});for(h=0;h<s.length;h++){var u=s[h];e.char.push({id:parseInt(u.getAttribute("id"),10),page:parseInt(u.getAttribute("page"),10)||0,x:parseInt(u.getAttribute("x"),10),y:parseInt(u.getAttribute("y"),10),width:parseInt(u.getAttribute("width"),10),height:parseInt(u.getAttribute("height"),10),xoffset:parseInt(u.getAttribute("xoffset"),10),yoffset:parseInt(u.getAttribute("yoffset"),10),xadvance:parseInt(u.getAttribute("xadvance"),10)})}for(h=0;h<o.length;h++)e.kerning.push({first:parseInt(o[h].getAttribute("first"),10),second:parseInt(o[h].getAttribute("second"),10),amount:parseInt(o[h].getAttribute("amount"),10)});for(h=0;h<a.length;h++)e.distanceField.push({fieldType:a[h].getAttribute("fieldType"),distanceRange:parseInt(a[h].getAttribute("distanceRange"),10)});return e},t}(),Ei=function(){function t(){}return t.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new self.DOMParser).parseFromString(t,"text/xml");return bi.test(e)}return!1},t.parse=function(t){var e=(new self.DOMParser).parseFromString(t,"text/xml");return bi.parse(e)},t}(),xi=[yi,bi,Ei];function Ti(t){for(var e=0;e<xi.length;e++)if(xi[e].test(t))return xi[e];return null}function wi(t,e,i,n,r,s,o){var a=i.text,h=i.fontProperties;e.translate(n,r),e.scale(s,s);var u=o.strokeThickness/2,l=-o.strokeThickness/2;if(e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=function(t,e,i,n,r,s){var o,a=i.fill;if(!Array.isArray(a))return a;if(1===a.length)return a[0];var h=i.dropShadow?i.dropShadowDistance:0,u=i.padding||0,l=t.width/n-h-2*u,c=t.height/n-h-2*u,f=a.slice(),d=i.fillGradientStops.slice();if(!d.length)for(var p=f.length+1,g=1;g<p;++g)d.push(g/p);if(f.unshift(a[0]),d.unshift(0),f.push(a[a.length-1]),d.push(1),i.fillGradientType===pe.LINEAR_VERTICAL){o=e.createLinearGradient(l/2,u,l/2,c+u);var m=0,v=(s.fontProperties.fontSize+i.strokeThickness)/c;for(g=0;g<r.length;g++)for(var _=s.lineHeight*g,y=0;y<f.length;y++){var b=_/c+("number"==typeof d[y]?d[y]:y/f.length)*v,E=Math.max(m,b);E=Math.min(E,1),o.addColorStop(E,f[y]),m=E}}else{o=e.createLinearGradient(u,c/2,l+u,c/2);var x=f.length+1,T=1;for(g=0;g<f.length;g++){var w;w="number"==typeof d[g]?d[g]:T/x,o.addColorStop(w,f[g]),T++}}return o}(t,e,o,s,[a],i),e.strokeStyle=o.stroke,o.dropShadow){var c=o.dropShadowColor,f=(0,x.hex2rgb)("number"==typeof c?c:(0,x.string2hex)(c)),d=o.dropShadowBlur*s,p=o.dropShadowDistance*s;e.shadowColor="rgba("+255*f[0]+","+255*f[1]+","+255*f[2]+","+o.dropShadowAlpha+")",e.shadowBlur=d,e.shadowOffsetX=Math.cos(o.dropShadowAngle)*p,e.shadowOffsetY=Math.sin(o.dropShadowAngle)*p}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;o.stroke&&o.strokeThickness&&e.strokeText(a,u,l+i.lineHeight-h.descent),o.fill&&e.fillText(a,u,l+i.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function Si(t){return Array.from?Array.from(t):t.split("")}function Ai(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}var Mi=function(){function t(t,e,i){var n,r,s=t.info[0],o=t.common[0],a=t.page[0],h=t.distanceField[0],u=(0,x.getResolutionOfUrl)(a.file),l={};this._ownsTextures=i,this.font=s.face,this.size=s.size,this.lineHeight=o.lineHeight/u,this.chars={},this.pageTextures=l;for(var c=0;c<t.page.length;c++){var f=t.page[c],d=f.id,p=f.file;l[d]=e instanceof Array?e[c]:e[p],(null==h?void 0:h.fieldType)&&"none"!==h.fieldType&&(l[d].baseTexture.alphaMode=mt.iw.NO_PREMULTIPLIED_ALPHA)}for(c=0;c<t.char.length;c++){var g=t.char[c],m=(d=g.id,g.page),v=t.char[c],_=v.x,y=v.y,b=v.width,E=v.height,T=v.xoffset,S=v.yoffset,A=v.xadvance;_/=u,y/=u,b/=u,E/=u,T/=u,S/=u,A/=u;var M=new w.Ae(_+l[m].frame.x/u,y+l[m].frame.y/u,b,E);this.chars[d]={xOffset:T,yOffset:S,xAdvance:A,kerning:{},texture:new ht.xE(l[m].baseTexture,M),page:m}}for(c=0;c<t.kerning.length;c++){var O=t.kerning[c],R=O.first,C=O.second,I=O.amount;R/=u,C/=u,I/=u,this.chars[C]&&(this.chars[C].kerning[R]=I)}this.distanceFieldRange=null==h?void 0:h.distanceRange,this.distanceFieldType=null!==(r=null===(n=null==h?void 0:h.fieldType)||void 0===n?void 0:n.toLowerCase())&&void 0!==r?r:"none"}return t.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},t.install=function(e,i,n){var r;if(e instanceof _i)r=e;else{var s=Ti(e);if(!s)throw new Error("Unrecognized data format for font.");r=s.parse(e)}i instanceof ht.xE&&(i=[i]);var o=new t(r,i,n);return t.available[o.font]=o,o},t.uninstall=function(e){var i=t.available[e];if(!i)throw new Error("No font found named '"+e+"'");i.destroy(),delete t.available[e]},t.from=function(e,i,n){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var r=Object.assign({},t.defaultOptions,n),s=r.chars,o=r.padding,a=r.resolution,h=r.textureWidth,u=r.textureHeight,l=function(t){"string"==typeof t&&(t=[t]);for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];if(Array.isArray(r)){if(2!==r.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+r.length+".");var s=r[0].charCodeAt(0),o=r[1].charCodeAt(0);if(o<s)throw new Error("[BitmapFont]: Invalid character range.");for(var a=s,h=o;a<=h;a++)e.push(String.fromCharCode(a))}else e.push.apply(e,Si(r))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(s),c=i instanceof Ie?i:new Ie(i),f=h,d=new _i;d.info[0]={face:c.fontFamily,size:c.fontSize},d.common[0]={lineHeight:c.fontSize};for(var p,g,m,v=0,_=0,y=0,b=[],E=0;E<l.length;E++){p||((p=document.createElement("canvas")).width=h,p.height=u,g=p.getContext("2d"),m=new ht.VL(p,{resolution:a}),b.push(new ht.xE(m)),d.page.push({id:b.length-1,file:""}));var x=Le.measureText(l[E],c,!1,p),T=x.width,w=Math.ceil(x.height),S=Math.ceil(("italic"===c.fontStyle?2:1)*T);if(_>=u-w*a){if(0===_)throw new Error("[BitmapFont] textureHeight "+u+"px is too small for "+c.fontSize+"px fonts");--E,p=null,g=null,m=null,_=0,v=0,y=0}else if(y=Math.max(w+x.fontProperties.descent,y),S*a+v>=f)--E,_+=y*a,_=Math.ceil(_),v=0,y=0;else{wi(p,g,x,v,_,a,c);var A=Ai(x.text);d.char.push({id:A,page:b.length-1,x:v/a,y:_/a,width:S,height:w,xoffset:0,yoffset:0,xadvance:Math.ceil(T-(c.dropShadow?c.dropShadowDistance:0)-(c.stroke?c.strokeThickness:0))}),v+=(S+2*o)*a,v=Math.ceil(v)}}E=0;for(var M=l.length;E<M;E++)for(var O=l[E],R=0;R<M;R++){var C=l[R],I=g.measureText(O).width,P=g.measureText(C).width,N=g.measureText(O+C).width-(I+P);N&&d.kerning.push({first:Ai(O),second:Ai(C),amount:N})}var D=new t(d,b,!0);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=D,D},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}(),Oi=[],Ri=[],Ci=[],Ii=function(t){function e(i,n){void 0===n&&(n={});var r=t.call(this)||this;r._tint=16777215;var s=Object.assign({},e.styleDefaults,n),o=s.align,a=s.tint,h=s.maxWidth,u=s.letterSpacing,l=s.fontName,c=s.fontSize;if(!Mi.available[l])throw new Error('Missing BitmapFont "'+l+'"');return r._activePagesMeshData=[],r._textWidth=0,r._textHeight=0,r._align=o,r._tint=a,r._fontName=l,r._fontSize=c||Mi.available[l].size,r._text=i,r._maxWidth=h,r._maxLineHeight=0,r._letterSpacing=u,r._anchor=new w.AB((function(){r.dirty=!0}),r,0,0),r._roundPixels=T.X.ROUND_PIXELS,r.dirty=!0,r._textureCache={},r}return function(t,e){function i(){this.constructor=t}vi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.updateText=function(){for(var t,e=Mi.available[this._fontName],i=this._fontSize/e.size,n=new w.E9,r=[],s=[],o=[],a=Si(this._text.replace(/(?:\r\n|\r)/g,"\n")||" "),h=this._maxWidth*e.size/this._fontSize,u="none"===e.distanceFieldType?Oi:Ri,l=null,c=0,f=0,d=0,p=-1,g=0,m=0,v=0,_=0,y=0;y<a.length;y++){var b=Ai(X=a[y]);if(/(?:\s)/.test(X)&&(p=y,g=c,_++),"\r"!==X&&"\n"!==X){var E=e.chars[b];if(E){l&&E.kerning[l]&&(n.x+=E.kerning[l]);var T=Ci.pop()||{texture:ht.xE.EMPTY,line:0,charCode:0,prevSpaces:0,position:new w.E9};T.texture=E.texture,T.line=d,T.charCode=b,T.position.x=n.x+E.xOffset+this._letterSpacing/2,T.position.y=n.y+E.yOffset,T.prevSpaces=_,r.push(T),c=T.position.x+E.texture.orig.width,n.x+=E.xAdvance+this._letterSpacing,v=Math.max(v,E.yOffset+E.texture.height),l=b,-1!==p&&h>0&&n.x>h&&(++m,(0,x.removeItems)(r,1+p-m,1+y-p),y=p,p=-1,s.push(g),o.push(r.length>0?r[r.length-1].prevSpaces:0),f=Math.max(f,g),d++,n.x=0,n.y+=e.lineHeight,l=null,_=0)}}else s.push(c),o.push(-1),f=Math.max(f,c),++d,++m,n.x=0,n.y+=e.lineHeight,l=null,_=0}var S=a[a.length-1];"\r"!==S&&"\n"!==S&&(/(?:\s)/.test(S)&&(c=g),s.push(c),f=Math.max(f,c),o.push(-1));var A=[];for(y=0;y<=d;y++){var M=0;"right"===this._align?M=f-s[y]:"center"===this._align?M=(f-s[y])/2:"justify"===this._align&&(M=o[y]<0?0:(f-s[y])/o[y]),A.push(M)}var O=r.length,R={},C=[],I=this._activePagesMeshData;for(y=0;y<I.length;y++)u.push(I[y]);for(y=0;y<O;y++){var P=(z=r[y].texture).baseTexture.uid;if(!R[P]){if(!(K=u.pop())){var N=new mi,D=void 0,L=void 0;"none"===e.distanceFieldType?(D=new gi(ht.xE.EMPTY),L=mt.T$.NORMAL):(D=new gi(ht.xE.EMPTY,{program:ht.$r.from("// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n","// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n // MSDF\r\n float median = texColor.r + texColor.g + texColor.b -\r\n min(texColor.r, min(texColor.g, texColor.b)) -\r\n max(texColor.r, max(texColor.g, texColor.b));\r\n // SDF\r\n median = min(median, texColor.a);\r\n\r\n float screenPxDistance = uFWidth * (median - 0.5);\r\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n"),uniforms:{uFWidth:0}}),L=mt.T$.NORMAL_NPM);var k=new pi(N,D);k.blendMode=L,K={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:k,vertices:null,uvs:null,indices:null}}K.index=0,K.indexCount=0,K.vertexCount=0,K.uvsCount=0,K.total=0;var B=this._textureCache;B[P]=B[P]||new ht.xE(z.baseTexture),K.mesh.texture=B[P],K.mesh.tint=this._tint,C.push(K),R[P]=K}R[P].total++}for(y=0;y<I.length;y++)-1===C.indexOf(I[y])&&this.removeChild(I[y].mesh);for(y=0;y<C.length;y++)C[y].mesh.parent!==this&&this.addChild(C[y].mesh);for(var y in this._activePagesMeshData=C,R){var F=(K=R[y]).total;if(!((null===(t=K.indices)||void 0===t?void 0:t.length)>6*F)||K.vertices.length<2*pi.BATCHABLE_SIZE)K.vertices=new Float32Array(8*F),K.uvs=new Float32Array(8*F),K.indices=new Uint16Array(6*F);else for(var G=K.total,U=K.vertices,j=4*G*2;j<U.length;j++)U[j]=0;K.mesh.size=6*F}for(y=0;y<O;y++){var X,H=(X=r[y]).position.x+A[X.line]*("justify"===this._align?X.prevSpaces:1);this._roundPixels&&(H=Math.round(H));var z,W=H*i,V=X.position.y*i,Y=R[(z=X.texture).baseTexture.uid],$=z.frame,q=z._uvs,Z=Y.index++;Y.indices[6*Z+0]=0+4*Z,Y.indices[6*Z+1]=1+4*Z,Y.indices[6*Z+2]=2+4*Z,Y.indices[6*Z+3]=0+4*Z,Y.indices[6*Z+4]=2+4*Z,Y.indices[6*Z+5]=3+4*Z,Y.vertices[8*Z+0]=W,Y.vertices[8*Z+1]=V,Y.vertices[8*Z+2]=W+$.width*i,Y.vertices[8*Z+3]=V,Y.vertices[8*Z+4]=W+$.width*i,Y.vertices[8*Z+5]=V+$.height*i,Y.vertices[8*Z+6]=W,Y.vertices[8*Z+7]=V+$.height*i,Y.uvs[8*Z+0]=q.x0,Y.uvs[8*Z+1]=q.y0,Y.uvs[8*Z+2]=q.x1,Y.uvs[8*Z+3]=q.y1,Y.uvs[8*Z+4]=q.x2,Y.uvs[8*Z+5]=q.y2,Y.uvs[8*Z+6]=q.x3,Y.uvs[8*Z+7]=q.y3}for(var y in this._textWidth=f*i,this._textHeight=(n.y+e.lineHeight)*i,R){var K=R[y];if(0!==this.anchor.x||0!==this.anchor.y)for(var J=0,Q=this._textWidth*this.anchor.x,tt=this._textHeight*this.anchor.y,et=0;et<K.total;et++)K.vertices[J++]-=Q,K.vertices[J++]-=tt,K.vertices[J++]-=Q,K.vertices[J++]-=tt,K.vertices[J++]-=Q,K.vertices[J++]-=tt,K.vertices[J++]-=Q,K.vertices[J++]-=tt;this._maxLineHeight=v*i;var it=K.mesh.geometry.getBuffer("aVertexPosition"),nt=K.mesh.geometry.getBuffer("aTextureCoord"),rt=K.mesh.geometry.getIndex();it.data=K.vertices,nt.data=K.uvs,rt.data=K.indices,it.update(),nt.update(),rt.update()}for(y=0;y<r.length;y++)Ci.push(r[y])},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype._render=function(e){var i=Mi.available[this._fontName],n=i.distanceFieldRange,r=i.distanceFieldType,s=i.size;if("none"!==r)for(var o=this.worldTransform,a=o.a,h=o.b,u=o.c,l=o.d,c=Math.sqrt(a*a+h*h),f=Math.sqrt(u*u+l*l),d=(Math.abs(c)+Math.abs(f))/2,p=this._fontSize/s,g=0,m=this._activePagesMeshData;g<m.length;g++)m[g].mesh.shader.uniforms.uFWidth=d*n*p*e.resolution;t.prototype._render.call(this,e)},e.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!Mi.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),e.prototype.destroy=function(e){var i=this._textureCache;for(var n in i)i[n].destroy(),delete i[n];this._textureCache=null,t.prototype.destroy.call(this,e)},e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e}(Z),Pi=function(){function t(){}return t.add=function(){gt.kC.setExtensionXhrType("fnt",gt.kC.XHR_RESPONSE_TYPE.TEXT)},t.use=function(e,i){var n=Ti(e.data);if(n)for(var r=t.getBaseUrl(this,e),s=n.parse(e.data),o={},a=function(t){o[t.metadata.pageFile]=t.texture,Object.keys(o).length===s.page.length&&(e.bitmapFont=Mi.install(s,o,!0),i())},h=0;h<s.page.length;++h){var u=s.page[h].file,l=r+u,c=!1;for(var f in this.resources){var d=this.resources[f];if(d.url===l){d.metadata.pageFile=u,d.texture?a(d):d.onAfterMiddleware.add(a),c=!0;break}}if(!c){var p={crossOrigin:e.crossOrigin,loadType:gt.kC.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},e.metadata.imageMetadata),parentResource:e};this.add(l,p,a)}}else i()},t.getBaseUrl=function(e,i){var n=i.isDataUrl?"":t.dirname(i.url);return i.isDataUrl&&("."===n&&(n=""),e.baseUrl&&n&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(n+="/")),(n=n.replace(e.baseUrl,""))&&"/"!==n.charAt(n.length-1)&&(n+="/"),n},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t}(),Ni=function(t,e){return Ni=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Ni(t,e)},Di=function(t){function e(e){void 0===e&&(e=1);var i=t.call(this,ht.kP,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",{uAlpha:1})||this;return i.alpha=e,i}return function(t,e){function i(){this.constructor=t}Ni(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(ht.wn),Li=function(t,e){return Li=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Li(t,e)};function ki(t,e){function i(){this.constructor=t}Li(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Bi,Fi,Gi,Ui,ji,Xi,Hi,zi,Wi,Vi,Yi,$i,qi,Zi,Ki,Ji,Qi,tn,en,nn={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},rn=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join("\n");!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(Bi||(Bi={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(Fi||(Fi={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(Gi||(Gi={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(Ui||(Ui={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(ji||(ji={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(Xi||(Xi={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(Hi||(Hi={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(zi||(zi={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(Wi||(Wi={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(Vi||(Vi={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Yi||(Yi={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}($i||($i={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(qi||(qi={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(Zi||(Zi={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(Ki||(Ki={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(Ji||(Ji={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(Qi||(Qi={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(tn||(tn={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(en||(en={}));var sn=function(t){function e(e,i,n,r,s){void 0===i&&(i=8),void 0===n&&(n=4),void 0===r&&(r=T.X.FILTER_RESOLUTION),void 0===s&&(s=5);var o=this,a=function(t,e){var i,n=Math.ceil(t/2),r="\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }",s="";i=e?"vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var o=0;o<t;o++){var a=i.replace("%index%",o.toString());s+=a=a.replace("%sampleIndex%",o-(n-1)+".0"),s+="\n"}return(r=r.replace("%blur%",s)).replace("%size%",t.toString())}(s,e),h=function(t){for(var e,i=nn[t],n=i.length,r=rn,s="",o=0;o<t;o++){var a="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",o.toString());e=o,o>=n&&(e=t-o-1),s+=a=a.replace("%value%",i[e].toString()),s+="\n"}return(r=r.replace("%blur%",s)).replace("%size%",t.toString())}(s);return(o=t.call(this,a,h)||this).horizontal=e,o.resolution=r,o._quality=0,o.quality=n,o.blur=i,o}return ki(e,t),e.prototype.apply=function(t,e,i,n){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,n);else{var r=t.getFilterTexture(),s=t.renderer,o=e,a=r;this.state.blend=!1,t.applyFilter(this,o,a,Zi.CLEAR);for(var h=1;h<this.passes-1;h++){t.bindAndClear(o,Zi.BLIT),this.uniforms.uSampler=a;var u=a;a=o,o=u,s.shader.bind(this),s.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,a,i,n),t.returnFilterTexture(r)}},Object.defineProperty(e.prototype,"blur",{get:function(){return this.strength},set:function(t){this.padding=1+2*Math.abs(t),this.strength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t},enumerable:!1,configurable:!0}),e}(ht.wn),on=function(t){function e(e,i,n,r){void 0===e&&(e=8),void 0===i&&(i=4),void 0===n&&(n=T.X.FILTER_RESOLUTION),void 0===r&&(r=5);var s=t.call(this)||this;return s.blurXFilter=new sn(!0,e,i,n,r),s.blurYFilter=new sn(!1,e,i,n,r),s.resolution=n,s.quality=i,s.blur=e,s.repeatEdgePixels=!1,s}return ki(e,t),e.prototype.apply=function(t,e,i,n){var r=Math.abs(this.blurXFilter.strength),s=Math.abs(this.blurYFilter.strength);if(r&&s){var o=t.getFilterTexture();this.blurXFilter.apply(t,e,o,Zi.CLEAR),this.blurYFilter.apply(t,o,i,n),t.returnFilterTexture(o)}else s?this.blurYFilter.apply(t,e,i,n):this.blurXFilter.apply(t,e,i,n)},e.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))},Object.defineProperty(e.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(t){this.blurYFilter.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(t){this._repeatEdgePixels=t,this.updatePadding()},enumerable:!1,configurable:!0}),e}(ht.wn),an=function(t,e){return an=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},an(t,e)},hn=function(t){function e(){var e=this,i={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return(e=t.call(this,ht.Y9,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",i)||this).alpha=1,e}return function(t,e){function i(){this.constructor=t}an(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.tint=function(t,e){var i=[(t>>16&255)/255,0,0,0,0,0,(t>>8&255)/255,0,0,0,0,0,(255&t)/255,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),n=Math.sin(t),r=1/3,s=(0,Math.sqrt)(r),o=[i+(1-i)*r,r*(1-i)-s*n,r*(1-i)+s*n,0,0,r*(1-i)+s*n,i+r*(1-i),r*(1-i)-s*n,0,0,r*(1-i)-s*n,r*(1-i)+s*n,i+r*(1-i),0,0,0,0,0,1,0];this._loadMatrix(o,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,n=-.5*(i-1),r=[i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,n=-.5*(i-1),r=[i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,n,r){var s=((i=i||16770432)>>16&255)/255,o=(i>>8&255)/255,a=(255&i)/255,h=((n=n||3375104)>>16&255)/255,u=(n>>8&255)/255,l=(255&n)/255,c=[.3,.59,.11,0,0,s,o,a,t=t||.2,0,h,u,l,e=e||.15,0,s-h,o-u,a-l,0,0];this._loadMatrix(c,r)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(ht.wn);hn.prototype.grayscale=hn.prototype.greyscale;var un,ln,cn,fn,dn,pn,gn,mn,vn,_n,yn,bn,En,xn,Tn,wn,Sn,An,Mn,On=function(t,e){return On=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},On(t,e)},Rn=function(t){function e(e,i){var n=this,r=new w.y3;return e.renderable=!1,(n=t.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,n.maskMatrix=r,null==i&&(i=20),n.scale=new w.E9(i,i),n}return function(t,e){function i(){this.constructor=t}On(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.apply=function(t,e,i,n){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var r=this.maskSprite.worldTransform,s=Math.sqrt(r.a*r.a+r.b*r.b),o=Math.sqrt(r.c*r.c+r.d*r.d);0!==s&&0!==o&&(this.uniforms.rotation[0]=r.a/s,this.uniforms.rotation[1]=r.b/s,this.uniforms.rotation[2]=r.c/o,this.uniforms.rotation[3]=r.d/o),t.applyFilter(this,e,i,n)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e}(ht.wn),Cn=function(t,e){return Cn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Cn(t,e)},In=function(t){function e(){return t.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}return function(t,e){function i(){this.constructor=t}Cn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e}(ht.wn),Pn=function(t,e){return Pn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Pn(t,e)},Nn=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random());var n=t.call(this,ht.Y9,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return n.noise=e,n.seed=i,n}return function(t,e){function i(){this.constructor=t}Pn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e}(ht.wn);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(un||(un={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(ln||(ln={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(cn||(cn={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(fn||(fn={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(dn||(dn={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(pn||(pn={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(gn||(gn={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(mn||(mn={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(vn||(vn={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(_n||(_n={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(yn||(yn={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(bn||(bn={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(En||(En={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(xn||(xn={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(Tn||(Tn={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(wn||(wn={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(Sn||(Sn={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(An||(An={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(Mn||(Mn={}));var Dn=new w.y3;Y.prototype._cacheAsBitmap=!1,Y.prototype._cacheData=null,Y.prototype._cacheAsBitmapResolution=null,Y.prototype._cacheAsBitmapMultisample=An.NONE;var Ln=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(Y.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ln),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Y.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Y.prototype._initCachedDisplayObject=function(t){var e;if(!this._cacheData||!this._cacheData.sprite){var i=this.alpha;this.alpha=1,t.batch.flush();var n=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var r=this.filters[0].padding;n.pad(r)}n.ceil(T.X.RESOLUTION);var s=t.renderTexture.current,o=t.renderTexture.sourceFrame.clone(),a=t.renderTexture.destinationFrame.clone(),h=t.projection.transform,u=ht.TI.create({width:n.width,height:n.height,resolution:this.cacheAsBitmapResolution||t.resolution,multisample:null!==(e=this.cacheAsBitmapMultisample)&&void 0!==e?e:t.multisample}),l="cacheAsBitmap_"+(0,x.uid)();this._cacheData.textureCacheId=l,ht.VL.addToCache(u.baseTexture,l),ht.xE.addToCache(u,l);var c=this.transform.localTransform.copyTo(Dn).invert().translate(-n.x,-n.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:u,clear:!0,transform:c,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=h,t.renderTexture.bind(s,o,a),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;var f=new Me(u);f.transform.worldTransform=this.transform.worldTransform,f.anchor.x=-n.x/n.width,f.anchor.y=-n.y/n.height,f.alpha=i,f._bounds=this._bounds,this._cacheData.sprite=f,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=f.containsPoint.bind(f)}},Y.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Y.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(null,!0),i=this.alpha;this.alpha=1;var n=t.context,r=t._projTransform;e.ceil(T.X.RESOLUTION);var s=ht.TI.create({width:e.width,height:e.height}),o="cacheAsBitmap_"+(0,x.uid)();this._cacheData.textureCacheId=o,ht.VL.addToCache(s.baseTexture,o),ht.xE.addToCache(s,o);var a=Dn;this.transform.localTransform.copyTo(a),a.invert(),a.tx-=e.x,a.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:s,clear:!0,transform:a,skipUpdateTransform:!1}),t.context=n,t._projTransform=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;var h=new Me(s);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-e.x/e.width,h.anchor.y=-e.y/e.height,h.alpha=i,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Y.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Y.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Y.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ht.VL.removeFromCache(this._cacheData.textureCacheId),ht.xE.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Y.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Y.prototype.name=null,Z.prototype.getChildByName=function(t,e){for(var i=0,n=this.children.length;i<n;i++)if(this.children[i].name===t)return this.children[i];if(e)for(i=0,n=this.children.length;i<n;i++)if(this.children[i].getChildByName){var r=this.children[i].getChildByName(t,!0);if(r)return r}return null},Y.prototype.getGlobalPosition=function(t,e){return void 0===t&&(t=new w.E9),void 0===e&&(e=!1),this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};var kn=function(t,e){return kn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},kn(t,e)};function Bn(t,e){function i(){this.constructor=t}kn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Fn=function(t){function e(e,i,n,r){void 0===e&&(e=100),void 0===i&&(i=100),void 0===n&&(n=10),void 0===r&&(r=10);var s=t.call(this)||this;return s.segWidth=n,s.segHeight=r,s.width=e,s.height=i,s.build(),s}return Bn(e,t),e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],n=[],r=this.segWidth-1,s=this.segHeight-1,o=this.width/r,a=this.height/s,h=0;h<t;h++){var u=h%this.segWidth,l=h/this.segWidth|0;e.push(u*o,l*a),i.push(u/r,l/s)}var c=r*s;for(h=0;h<c;h++){var f=h%r,d=h/r|0,p=d*this.segWidth+f,g=d*this.segWidth+f+1,m=(d+1)*this.segWidth+f,v=(d+1)*this.segWidth+f+1;n.push(p,g,m,g,v,m)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint16Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e}(mi),Gn=function(t){function e(e,i,n){void 0===e&&(e=200),void 0===n&&(n=0);var r=t.call(this,new Float32Array(4*i.length),new Float32Array(4*i.length),new Uint16Array(6*(i.length-1)))||this;return r.points=i,r._width=e,r.textureScale=n,r.build(),r}return Bn(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),e.prototype.build=function(){var t=this.points;if(t){var e=this.getBuffer("aVertexPosition"),i=this.getBuffer("aTextureCoord"),n=this.getIndex();if(!(t.length<1)){e.data.length/4!==t.length&&(e.data=new Float32Array(4*t.length),i.data=new Float32Array(4*t.length),n.data=new Uint16Array(6*(t.length-1)));var r=i.data,s=n.data;r[0]=0,r[1]=0,r[2]=0,r[3]=1;for(var o=0,a=t[0],h=this._width*this.textureScale,u=t.length,l=0;l<u;l++){var c=4*l;if(this.textureScale>0){var f=a.x-t[l].x,d=a.y-t[l].y,p=Math.sqrt(f*f+d*d);a=t[l],o+=p/h}else o=l/(u-1);r[c]=o,r[c+1]=0,r[c+2]=o,r[c+3]=1}var g=0;for(l=0;l<u-1;l++)c=2*l,s[g++]=c,s[g++]=c+1,s[g++]=c+2,s[g++]=c+2,s[g++]=c+1,s[g++]=c+3;i.update(),n.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var e,i=t[0],n=0,r=0,s=this.buffers[0].data,o=t.length,a=0;a<o;a++){var h=t[a],u=4*a;r=-((e=a<t.length-1?t[a+1]:h).x-i.x),n=e.y-i.y;var l=Math.sqrt(n*n+r*r),c=this.textureScale>0?this.textureScale*this._width/2:this._width/2;n/=l,r/=l,n*=c,r*=c,s[u]=h.x+n,s[u+1]=h.y+r,s[u+2]=h.x-n,s[u+3]=h.y-r,i=h}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(mi),Un=function(t){function e(e,i,n){void 0===n&&(n=0);var r=this,s=new Gn(e.height,i,n),o=new gi(e);return n>0&&(e.baseTexture.wrapMode=mt.Nt.REPEAT),(r=t.call(this,s,o)||this).autoUpdate=!0,r}return Bn(e,t),e.prototype._render=function(e){var i=this.geometry;(this.autoUpdate||i._width!==this.shader.texture.height)&&(i._width=this.shader.texture.height,i.update()),t.prototype._render.call(this,e)},e}(pi),jn=function(t){function e(e,i,n){var r=this,s=new Fn(e.width,e.height,i,n),o=new gi(ht.xE.WHITE);return(r=t.call(this,s,o)||this).texture=e,r.autoResize=!0,r}return Bn(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,e=this.shader.texture,i=e.width,n=e.height;!this.autoResize||t.width===i&&t.height===n||(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e.prototype.destroy=function(e){this.shader.texture.off("update",this.textureUpdated,this),t.prototype.destroy.call(this,e)},e}(pi),Xn=function(t){function e(e,i,n,r,s){void 0===e&&(e=ht.xE.EMPTY);var o=this,a=new mi(i,n,r);a.getBuffer("aVertexPosition").static=!1;var h=new gi(e);return(o=t.call(this,a,h,null,s)||this).autoUpdate=!0,o}return Bn(e,t),Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},e}(pi),Hn=function(t){function e(e,i,n,r,s){void 0===i&&(i=10),void 0===n&&(n=10),void 0===r&&(r=10),void 0===s&&(s=10);var o=t.call(this,ht.xE.WHITE,4,4)||this;return o._origWidth=e.orig.width,o._origHeight=e.orig.height,o._width=o._origWidth,o._height=o._origHeight,o._leftWidth=i,o._rightWidth=r,o._topHeight=n,o._bottomHeight=s,o.texture=e,o}return Bn(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,i=this._topHeight+this._bottomHeight,n=this._height>i?1:this._height/i;return Math.min(e,n)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,n=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=n*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-n*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(jn),zn=i(1034),Wn=function(t,e){return Wn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Wn(t,e)},Vn=function(t){function e(e,i){void 0===i&&(i=!0);var n=t.call(this,e[0]instanceof ht.xE?e[0]:e[0].texture)||this;return n._textures=null,n._durations=null,n._autoUpdate=i,n._isConnectedToTicker=!1,n.animationSpeed=1,n.loop=!0,n.updateAnchor=!1,n.onComplete=null,n.onFrameChange=null,n.onLoop=null,n._currentTime=0,n._playing=!1,n._previousFrame=null,n.textures=e,n}return function(t,e){function i(){this.constructor=t}Wn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Q.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Q.vB.shared.add(this.update,this,Q.uF.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){if(this._playing){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var n=this._currentTime%1*this._durations[this.currentFrame];for(n+=e/60*1e3;n<0;)this._currentTime--,n+=this._durations[this.currentFrame];var r=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);n>=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*r,this._currentTime+=r;this._currentTime+=n/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<i||this.animationSpeed<0&&this.currentFrame>i)&&this.onLoop(),this.updateTexture())}},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],n=0;n<t.length;++n)i.push(ht.xE.from(t[n]));return new e(i)},e.fromImages=function(t){for(var i=[],n=0;n<t.length;++n)i.push(ht.xE.from(t[n]));return new e(i)},Object.defineProperty(e.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof ht.xE)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Q.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Q.vB.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),e}(Me);ht.Th.registerPlugin("accessibility",J),ht.Th.registerPlugin("extract",pt),ht.Th.registerPlugin("interaction",at),ht.Th.registerPlugin("particle",Wt),ht.Th.registerPlugin("prepare",Je),ht.Th.registerPlugin("batch",ht.Bv),ht.Th.registerPlugin("tilingSprite",hi),gt.aN.registerPlugin(Pi),gt.aN.registerPlugin(wt),gt.aN.registerPlugin(Nt),gt.aN.registerPlugin(Ft),gt.aN.registerPlugin(ei),ut.registerPlugin(Q.Sb),ut.registerPlugin(gt.LP);var Yn="6.2.2",$n={AlphaFilter:Di,BlurFilter:on,BlurFilterPass:sn,ColorMatrixFilter:hn,DisplacementFilter:Rn,FXAAFilter:In,NoiseFilter:Nn}},1795:function(t,e,i){var n;t=i.nmd(t),function(){"use strict";var r={function:!0,object:!0},s=r[typeof window]&&window||this,o=r[typeof e]&&e,a=r.object&&t&&!t.nodeType&&t,h=o&&a&&"object"==typeof i.g&&i.g;!h||h.global!==h&&h.window!==h&&h.self!==h||(s=h);var u=Math.pow(2,53)-1,l=/\bOpera/,c=Object.prototype,f=c.hasOwnProperty,d=c.toString;function p(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function g(t){return t=b(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:p(t)}function m(t,e){for(var i in t)f.call(t,i)&&e(t[i],i,t)}function v(t){return null==t?p(t):d.call(t).slice(8,-1)}function _(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function y(t,e){var i=null;return function(t,e){var i=-1,n=t?t.length:0;if("number"==typeof n&&n>-1&&n<=u)for(;++i<n;)e(t[i],i);else m(t,e)}(t,(function(n,r){i=e(i,n,r,t)})),i}function b(t){return String(t).replace(/^ +| +$/g,"")}var E=function t(e){var i=s,n=e&&"object"==typeof e&&"String"!=v(e);n&&(i=e,e=null);var r=i.navigator||{},o=r.userAgent||"";e||(e=o);var a,h,u,c,f=n?!!r.likeChrome:/\bChrome\b/.test(e)&&!/internal|\n/i.test(d.toString()),p="Object",E=n?p:"ScriptBridgingProxyObject",x=n?p:"Environment",T=n&&i.java?"JavaPackage":v(i.java),w=n?p:"RuntimeObject",S=/\bJava/.test(T)&&i.java,A=S&&v(i.environment)==x,M=S?"a":"α",O=S?"b":"β",R=i.document||{},C=i.operamini||i.opera,I=l.test(I=n&&C?C["[[Class]]"]:v(C))?I:C=null,P=e,N=[],D=null,L=e==o,k=L&&C&&"function"==typeof C.version&&C.version(),B=y([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],(function(t,i){return t||RegExp("\\b"+(i.pattern||_(i))+"\\b","i").exec(e)&&(i.label||i)})),F=y(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"],(function(t,i){return t||RegExp("\\b"+(i.pattern||_(i))+"\\b","i").exec(e)&&(i.label||i)})),G=X([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),U=y({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}},(function(t,i,n){return t||(i[G]||i[/^[a-z]+(?: +[a-z]+\b)*/i.exec(G)]||RegExp("\\b"+_(n)+"(?:\\b|\\w*\\d)","i").exec(e))&&n})),j=y(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "],(function(t,i){var n=i.pattern||_(i);return!t&&(t=RegExp("\\b"+n+"(?:/[\\d.]+|[ \\w.]*)","i").exec(e))&&(t=function(t,e,i){var n={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return e&&i&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(n=n[/[\d.]+$/.exec(t)])&&(t="Windows "+n),t=String(t),e&&i&&(t=t.replace(RegExp(e,"i"),i)),g(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(t,n,i.label||i)),t}));function X(t){return y(t,(function(t,i){var n=i.pattern||_(i);return!t&&(t=RegExp("\\b"+n+" *\\d+[.\\w_]*","i").exec(e)||RegExp("\\b"+n+" *\\w+-[\\w]*","i").exec(e)||RegExp("\\b"+n+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(e))&&((t=String(i.label&&!RegExp(n,"i").test(i.label)?i.label:t).split("/"))[1]&&!/[\d.]+/.test(t[0])&&(t[0]+=" "+t[1]),i=i.label||i,t=g(t[0].replace(RegExp(n,"i"),i).replace(RegExp("; *(?:"+i+"[_-])?","i")," ").replace(RegExp("("+i+")[-_.]?(\\w)","i"),"$1 $2"))),t}))}function H(t){return y(t,(function(t,i){return t||(RegExp(i+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(e)||0)[1]||null}))}if(B&&(B=[B]),/\bAndroid\b/.test(j)&&!G&&(a=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(e))&&(G=b(a[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),U&&!G?G=X([U]):U&&G&&(G=G.replace(RegExp("^("+_(U)+")[-_.\\s]","i"),U+" ").replace(RegExp("^("+_(U)+")[-_.]?(\\w)","i"),U+" $2")),(a=/\bGoogle TV\b/.exec(G))&&(G=a[0]),/\bSimulator\b/i.test(e)&&(G=(G?G+" ":"")+"Simulator"),"Opera Mini"==F&&/\bOPiOS\b/.test(e)&&N.push("running in Turbo/Uncompressed mode"),"IE"==F&&/\blike iPhone OS\b/.test(e)?(U=(a=t(e.replace(/like iPhone OS/,""))).manufacturer,G=a.product):/^iP/.test(G)?(F||(F="Safari"),j="iOS"+((a=/ OS ([\d_]+)/i.exec(e))?" "+a[1].replace(/_/g,"."):"")):"Konqueror"==F&&/^Linux\b/i.test(j)?j="Kubuntu":U&&"Google"!=U&&(/Chrome/.test(F)&&!/\bMobile Safari\b/i.test(e)||/\bVita\b/.test(G))||/\bAndroid\b/.test(j)&&/^Chrome/.test(F)&&/\bVersion\//i.test(e)?(F="Android Browser",j=/\bAndroid\b/.test(j)?j:"Android"):"Silk"==F?(/\bMobi/i.test(e)||(j="Android",N.unshift("desktop mode")),/Accelerated *= *true/i.test(e)&&N.unshift("accelerated")):"UC Browser"==F&&/\bUCWEB\b/.test(e)?N.push("speed mode"):"PaleMoon"==F&&(a=/\bFirefox\/([\d.]+)\b/.exec(e))?N.push("identifying as Firefox "+a[1]):"Firefox"==F&&(a=/\b(Mobile|Tablet|TV)\b/i.exec(e))?(j||(j="Firefox OS"),G||(G=a[1])):!F||(a=!/\bMinefield\b/i.test(e)&&/\b(?:Firefox|Safari)\b/.exec(F))?(F&&!G&&/[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(a+"/")+8))&&(F=null),(a=G||U||j)&&(G||U||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(j))&&(F=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(j)?j:a)+" Browser")):"Electron"==F&&(a=(/\bChrome\/([\d.]+)\b/.exec(e)||0)[1])&&N.push("Chromium "+a),k||(k=H(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",_(F),"(?:Firefox|Minefield|NetFront)"])),(a=("iCab"==B&&parseFloat(k)>3?"WebKit":/\bOpera\b/.test(F)&&(/\bOPR\b/.test(e)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(e)&&!/^(?:Trident|EdgeHTML)$/.test(B)&&"WebKit"||!B&&/\bMSIE\b/i.test(e)&&("Mac OS"==j?"Tasman":"Trident")||"WebKit"==B&&/\bPlayStation\b(?! Vita\b)/i.test(F)&&"NetFront")&&(B=[a]),"IE"==F&&(a=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e)||0)[1])?(F+=" Mobile",j="Windows Phone "+(/\+$/.test(a)?a:a+".x"),N.unshift("desktop mode")):/\bWPDesktop\b/i.test(e)?(F="IE Mobile",j="Windows Phone 8.x",N.unshift("desktop mode"),k||(k=(/\brv:([\d.]+)/.exec(e)||0)[1])):"IE"!=F&&"Trident"==B&&(a=/\brv:([\d.]+)/.exec(e))&&(F&&N.push("identifying as "+F+(k?" "+k:"")),F="IE",k=a[1]),L){if("global",c=null!=(u=i)?typeof u.global:"number",/^(?:boolean|number|string|undefined)$/.test(c)||"object"==c&&!u.global)v(a=i.runtime)==E?(F="Adobe AIR",j=a.flash.system.Capabilities.os):v(a=i.phantom)==w?(F="PhantomJS",k=(a=a.version||null)&&a.major+"."+a.minor+"."+a.patch):"number"==typeof R.documentMode&&(a=/\bTrident\/(\d+)/i.exec(e))?(k=[k,R.documentMode],(a=+a[1]+4)!=k[1]&&(N.push("IE "+k[1]+" mode"),B&&(B[1]=""),k[1]=a),k="IE"==F?String(k[1].toFixed(1)):k[0]):"number"==typeof R.documentMode&&/^(?:Chrome|Firefox)\b/.test(F)&&(N.push("masking as "+F+" "+k),F="IE",k="11.0",B=["Trident"],j="Windows");else if(S&&(P=(a=S.lang.System).getProperty("os.arch"),j=j||a.getProperty("os.name")+" "+a.getProperty("os.version")),A){try{k=i.require("ringo/engine").version.join("."),F="RingoJS"}catch(t){(a=i.system)&&a.global.system==i.system&&(F="Narwhal",j||(j=a[0].os||null))}F||(F="Rhino")}else"object"==typeof i.process&&!i.process.browser&&(a=i.process)&&("object"==typeof a.versions&&("string"==typeof a.versions.electron?(N.push("Node "+a.versions.node),F="Electron",k=a.versions.electron):"string"==typeof a.versions.nw&&(N.push("Chromium "+k,"Node "+a.versions.node),F="NW.js",k=a.versions.nw)),F||(F="Node.js",P=a.arch,j=a.platform,k=(k=/[\d.]+/.exec(a.version))?k[0]:null));j=j&&g(j)}if(k&&(a=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(k)||/(?:alpha|beta)(?: ?\d)?/i.exec(e+";"+(L&&r.appMinorVersion))||/\bMinefield\b/i.test(e)&&"a")&&(D=/b/i.test(a)?"beta":"alpha",k=k.replace(RegExp(a+"\\+?$"),"")+("beta"==D?O:M)+(/\d+\+?/.exec(a)||"")),"Fennec"==F||"Firefox"==F&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(j))F="Firefox Mobile";else if("Maxthon"==F&&k)k=k.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(G))"Xbox 360"==G&&(j=null),"Xbox 360"==G&&/\bIEMobile\b/.test(e)&&N.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(F)&&(!F||G||/Browser|Mobi/.test(F))||"Windows CE"!=j&&!/Mobi/i.test(e))if("IE"==F&&L)try{null===i.external&&N.unshift("platform preview")}catch(t){N.unshift("embedded")}else(/\bBlackBerry\b/.test(G)||/\bBB10\b/.test(e))&&(a=(RegExp(G.replace(/ +/g," *")+"/([.\\d]+)","i").exec(e)||0)[1]||k)?(j=((a=[a,/BB10/.test(e)])[1]?(G=null,U="BlackBerry"):"Device Software")+" "+a[0],k=null):this!=m&&"Wii"!=G&&(L&&C||/Opera/.test(F)&&/\b(?:MSIE|Firefox)\b/i.test(e)||"Firefox"==F&&/\bOS X (?:\d+\.){2,}/.test(j)||"IE"==F&&(j&&!/^Win/.test(j)&&k>5.5||/\bWindows XP\b/.test(j)&&k>8||8==k&&!/\bTrident\b/.test(e)))&&!l.test(a=t.call(m,e.replace(l,"")+";"))&&a.name&&(a="ing as "+a.name+((a=a.version)?" "+a:""),l.test(F)?(/\bIE\b/.test(a)&&"Mac OS"==j&&(j=null),a="identify"+a):(a="mask"+a,F=I?g(I.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(a)&&(j=null),L||(k=null)),B=["Presto"],N.push(a));else F+=" Mobile";(a=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(e)||0)[1])&&(a=[parseFloat(a.replace(/\.(\d)$/,".0$1")),a],"Safari"==F&&"+"==a[1].slice(-1)?(F="WebKit Nightly",D="alpha",k=a[1].slice(0,-1)):k!=a[1]&&k!=(a[2]=(/\bSafari\/([\d.]+\+?)/i.exec(e)||0)[1])||(k=null),a[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(e)||0)[1],537.36==a[0]&&537.36==a[2]&&parseFloat(a[1])>=28&&"WebKit"==B&&(B=["Blink"]),L&&(f||a[1])?(B&&(B[1]="like Chrome"),a=a[1]||((a=a[0])<530?1:a<532?2:a<532.05?3:a<533?4:a<534.03?5:a<534.07?6:a<534.1?7:a<534.13?8:a<534.16?9:a<534.24?10:a<534.3?11:a<535.01?12:a<535.02?"13+":a<535.07?15:a<535.11?16:a<535.19?17:a<536.05?18:a<536.1?19:a<537.01?20:a<537.11?"21+":a<537.13?23:a<537.18?24:a<537.24?25:a<537.36?26:"Blink"!=B?"27":"28")):(B&&(B[1]="like Safari"),a=(a=a[0])<400?1:a<500?2:a<526?3:a<533?4:a<534?"4+":a<535?5:a<537?6:a<538?7:a<601?8:a<602?9:a<604?10:a<606?11:a<608?12:"12"),B&&(B[1]+=" "+(a+="number"==typeof a?".x":/[.+]/.test(a)?"":"+")),"Safari"==F&&(!k||parseInt(k)>45)?k=a:"Chrome"==F&&/\bHeadlessChrome/i.test(e)&&N.unshift("headless")),"Opera"==F&&(a=/\bzbov|zvav$/.exec(j))?(F+=" ",N.unshift("desktop mode"),"zvav"==a?(F+="Mini",k=null):F+="Mobile",j=j.replace(RegExp(" *"+a+"$"),"")):"Safari"==F&&/\bChrome\b/.exec(B&&B[1])?(N.unshift("desktop mode"),F="Chrome Mobile",k=null,/\bOS X\b/.test(j)?(U="Apple",j="iOS 4.3+"):j=null):/\bSRWare Iron\b/.test(F)&&!k&&(k=H("Chrome")),k&&0==k.indexOf(a=/[\d.]+$/.exec(j))&&e.indexOf("/"+a+"-")>-1&&(j=b(j.replace(a,""))),j&&-1!=j.indexOf(F)&&!RegExp(F+" OS").test(j)&&(j=j.replace(RegExp(" *"+_(F)+" *"),"")),B&&!/\b(?:Avant|Nook)\b/.test(F)&&(/Browser|Lunascape|Maxthon/.test(F)||"Safari"!=F&&/^iOS/.test(j)&&/\bSafari\b/.test(B[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(F)&&B[1])&&(a=B[B.length-1])&&N.push(a),N.length&&(N=["("+N.join("; ")+")"]),U&&G&&G.indexOf(U)<0&&N.push("on "+U),G&&N.push((/^on /.test(N[N.length-1])?"":"on ")+G),j&&(a=/ ([\d.+]+)$/.exec(j),h=a&&"/"==j.charAt(j.length-a[0].length-1),j={architecture:32,family:a&&!h?j.replace(a[0],""):j,version:a?a[1]:null,toString:function(){var t=this.version;return this.family+(t&&!h?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(a=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(P))&&!/\bi686\b/i.test(P)?(j&&(j.architecture=64,j.family=j.family.replace(RegExp(" *"+a),"")),F&&(/\bWOW64\b/i.test(e)||L&&/\w(?:86|32)$/.test(r.cpuClass||r.platform)&&!/\bWin64; x64\b/i.test(e))&&N.unshift("32-bit")):j&&/^OS X/.test(j.family)&&"Chrome"==F&&parseFloat(k)>=39&&(j.architecture=64),e||(e=null);var z={};return z.description=e,z.layout=B&&B[0],z.manufacturer=U,z.name=F,z.prerelease=D,z.product=G,z.ua=e,z.version=F&&k,z.os=j||{architecture:null,family:null,version:null,toString:function(){return"null"}},z.parse=t,z.toString=function(){return this.description||""},z.version&&N.unshift(k),z.name&&N.unshift(F),j&&F&&(j!=String(j).split(" ")[0]||j!=F.split(" ")[0]&&!G)&&N.push(G?"("+j+")":"on "+j),N.length&&(z.description=N.join(" ")),z}();s.platform=E,void 0===(n=function(){return E}.call(e,i,e,t))||(t.exports=n)}.call(this)},2587:t=>{"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,i,n,r){i=i||"&",n=n||"=";var s={};if("string"!=typeof t||0===t.length)return s;var o=/\+/g;t=t.split(i);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var h=t.length;a>0&&h>a&&(h=a);for(var u=0;u<h;++u){var l,c,f,d,p=t[u].replace(o,"%20"),g=p.indexOf(n);g>=0?(l=p.substr(0,g),c=p.substr(g+1)):(l=p,c=""),f=decodeURIComponent(l),d=decodeURIComponent(c),e(s,f)?Array.isArray(s[f])?s[f].push(d):s[f]=[s[f],d]:s[f]=d}return s}},2361:t=>{"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,i,n,r){return i=i||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(r){var s=encodeURIComponent(e(r))+n;return Array.isArray(t[r])?t[r].map((function(t){return s+encodeURIComponent(e(t))})).join(i):s+encodeURIComponent(e(t[r]))})).join(i):r?encodeURIComponent(e(r))+n+encodeURIComponent(e(t)):""}},7673:(t,e,i)=>{"use strict";e.decode=e.parse=i(2587),e.encode=e.stringify=i(2361)},6069:function(t,e){"use strict";var i,n,r,s=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i},o=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};Object.defineProperty(e,"__esModule",{value:!0}),e.AnalyzeTagArg=void 0,e.AnalyzeTagArg=class{constructor(){i.set(this,/;[^\n]*|(?<key>\w+)(?:\s|;[^\n]*\n)*=(?:\s|;[^\n]*\n)*(?:(?<val>[^\s"'#|;]+)|(["'#])(?<val2>.*?)\3)(?:\|(?:(?<def>[^\s"'#;]+)|(["'#])(?<def2>.*?)\6))?|(?<literal>[^\s;]+)/g),n.set(this,{}),r.set(this,!1)}go(t){if(s(this,n,{},"f"),s(this,r,!1,"f"),!t)return;let e=null;for(;e=o(this,i,"f").exec(t);){const t=e?.groups;t&&(t.key?o(this,n,"f")[t.key]={val:t.val??t.val2,def:t.def??t.def2}:t.literal&&("*"===t.literal?s(this,r,!0,"f"):o(this,n,"f")[t.literal]={val:"1"}))}}get hPrm(){return o(this,n,"f")}get isKomeParam(){return o(this,r,"f")}},i=new WeakMap,n=new WeakMap,r=new WeakMap},9630:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Areas=void 0,e.Areas=class{constructor(){this.hAreas={}}clear(){this.hAreas={}}search(t){for(const e in this.hAreas)if(!(t<parseInt(e))&&t<=this.hAreas[e])return!0;return!1}record(t){if(!this.search(t)){for(const e in this.hAreas)if(this.hAreas[e]+1===t)return void(t+1 in this.hAreas?(this.hAreas[e]=this.hAreas[t+1],delete this.hAreas[t+1]):this.hAreas[e]=t);if(t+1 in this.hAreas)return this.hAreas[t]=this.hAreas[t+1],void delete this.hAreas[t+1];this.hAreas[t]=t}}erase(t){if(this.search(t)){if(t in this.hAreas)return this.hAreas[t]>t&&(this.hAreas[t+1]=this.hAreas[t]),void delete this.hAreas[t];for(const e in this.hAreas)if(!(t<parseInt(e)||this.hAreas[e]<t))return this.hAreas[e]===t||(this.hAreas[t+1]=this.hAreas[e]),void(this.hAreas[e]=t-1)}}get count(){return Object.keys(this.hAreas).length}toString(){let t="";const e=[];for(const t in this.hAreas)e.push(parseInt(t));return e.sort((function(t,e){return t-e})),e.forEach((e=>{t+=","+e+(e===this.hAreas[e])?"":0})),""!==t&&(t=t.slice(1)),t}}},6761:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},v=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.Button=void 0;const _=i(6841),y=i(4965),b=i(7007),E=i(1481),x=i(4412);class T extends _.Container{constructor(t,e,i,o){super(),this.hArg=t,this.evtMng=e,this.resolve=i,this.canFocus=o,n.add(this),this.getBtnBounds=()=>m(this,a,"f"),a.set(this,new _.Rectangle),h.set(this,void 0),u.set(this,void 0),l.set(this,void 0),f.set(this,(()=>{})),d.set(this,(()=>!1)),p.set(this,(()=>{})),y.CmnLib.isDbg&&(this.makeDesignCast=t=>t(m(this,h,"f")),this.cvsResize=()=>m(this,h,"f").cvsResize());let w={x:this.x=(0,y.uint)(t.left??0),y:this.y=(0,y.uint)(t.top??0),rotation:this.angle=(0,y.argChk_Num)(t,"rotation",this.angle),pivot_x:this.pivot.x=(0,y.argChk_Num)(t,"pivot_x",this.pivot.x),pivot_y:this.pivot.y=(0,y.argChk_Num)(t,"pivot_y",this.pivot.y),scale_x:this.scale.x=(0,y.argChk_Num)(t,"scale_x",this.scale.x),scale_y:this.scale.y=(0,y.argChk_Num)(t,"scale_y",this.scale.y),width:0,height:0};const S=w.enabled=(0,y.argChk_Boolean)(t,"enabled",!0);if(this.getBtnBounds=()=>(m(this,a,"f").x=w.x,m(this,a,"f").y=w.y,m(this,a,"f")),t.pic)return w.type="pic",v(this,h,new x.PicBtnDesignCast(this,t),"f"),S&&this.evtMng.button(this.hArg,this,(()=>m(this,f,"f").call(this)),(()=>m(this,d,"f").call(this)),(()=>m(this,p,"f").call(this))),void(b.GrpLayer.csv2Sprites(t.pic,this,(t=>{m(this,n,"m",g).call(this,t,w),m(this,a,"f").width=t.width*w.scale_x,m(this,a,"f").height=t.height*w.scale_y}),(t=>{t&&i()}))||i());if(!t.text)throw"textまたはpic属性は必須です";const A=(0,y.argChk_Num)(t,"height",30),M=new _.TextStyle({align:"center",dropShadow:!0,dropShadowAlpha:.7,dropShadowColor:"white",dropShadowBlur:7,dropShadowDistance:0,fill:"black",fontFamily:T.fontFamily,fontSize:A,padding:5});if(t.style)try{const e=JSON.parse(t.style);for(const t in e)M[t]=e[t]}catch(t){throw new Error(`[button] style指定が異常です。JSON文字列は「"」で囲んで下さい err:${t}`)}const O=new _.Text(t.text??"",M);O.alpha=(0,y.argChk_Num)(t,"alpha",O.alpha),O.width=(0,y.argChk_Num)(t,"width",100),O.height=t.height=A,this.setText=t=>O.text=t,w.type="text",w={...w,...M},w.alpha=O.alpha,w.text=O.text,w.width=O.width,w.height=O.height,v(this,h,new x.TxtBtnDesignCast(this,t,O),"f");let R=!1;if(t.b_pic&&(w.b_pic=t.b_pic,R=b.GrpLayer.csv2Sprites(t.b_pic,this,(t=>{m(this,n,"m",c).call(this,t,O),w.width=this.width,w.height=this.height}),(e=>{E.Layer.setBlendmode(this,t),e&&i()}))),O.name=JSON.stringify(w),this.addChild(O),m(this,a,"f").width=O.width,m(this,a,"f").height=O.height,w.width=this.width,w.height=this.height,t.b_pic||E.Layer.setBlendmode(this,t),m(T,r,"f",s).call(T,this,O),!S)return void(R||i());const C=M.clone();if(t.style_hover)try{const e=JSON.parse(t.style_hover);for(const t in e)C[t]=e[t]}catch(t){throw new Error(`[button] style_hover指定が異常です。JSON文字列は「"」で囲んで下さい err:${t}`)}else C.fill="white";const I=C.clone();if(t.style_clicked)try{const e=JSON.parse(t.style_clicked);for(const t in e)I[t]=e[t]}catch(t){throw new Error(`[button] style_clicked指定が異常です。JSON文字列は「"」で囲んで下さい err:${t}`)}else I.dropShadow=!1;e.button(t,this,(()=>O.style=M),(()=>!!o()&&(O.style=C,!0)),(()=>O.style=I)),R||i()}static init(t){t.oCfg.debug.masume&&(v(T,r,((t,e)=>t.addChild((new _.Graphics).beginFill(8926088,.2).lineStyle(1,8926088,1).drawRect(e.x,e.y,e.width,e.height).endFill())),"f",s),v(T,r,((t,e,i,n)=>t.addChild((new _.Graphics).beginFill(8926088,.2).lineStyle(1,8926088,1).drawRect(e.x,e.y,i,n).endFill())),"f",o))}setText(t){}destroy(t){this.evtMng.unButton(this),super.destroy()}makeDesignCast(t){}showDesignCast(){m(this,h,"f").visible=!0}cvsResize(){}update_b_pic(t,e){const i=JSON.parse(e.name??"{}");m(this,u,"f")&&this.removeChild(m(this,u,"f")),this.hArg.b_pic=i.b_pic=t,e.name=JSON.stringify(i),t&&b.GrpLayer.csv2Sprites(t,this,(t=>m(this,n,"m",c).call(this,t,e)),(()=>E.Layer.setBlendmode(this,this.hArg)))}update_pic(t,e){const i=JSON.parse(e.name??"{}");m(this,l,"f")&&this.removeChild(m(this,l,"f")),this.hArg.pic=i.pic=t,e.name=JSON.stringify(i),t&&b.GrpLayer.csv2Sprites(t,this,(t=>m(this,n,"m",g).call(this,t,i)),(()=>E.Layer.setBlendmode(this,this.hArg)))}}e.Button=T,r=T,a=new WeakMap,h=new WeakMap,u=new WeakMap,l=new WeakMap,f=new WeakMap,d=new WeakMap,p=new WeakMap,n=new WeakSet,c=function(t,e){v(this,u,t,"f"),this.setChildIndex(t,0),t.alpha=e.alpha,t.setTransform(e.x,e.y,1,1,e.rotation,0,0,(t.width-e.width)/2,(t.height-e.height)/2),t.name=e.name},g=function(t,e){v(this,l,t,"f"),e.alpha=t.alpha=(0,y.argChk_Num)(this.hArg,"alpha",t.alpha),m(this,h,"f").setSp(t);const i=t.width/3,n=t.height,s=t.texture.baseTexture,a=new _.Texture(s,new _.Rectangle(0,0,i,n)),u=new _.Texture(s,new _.Rectangle(i,0,i,n)),c=new _.Texture(s,new _.Rectangle(2*i,0,i,n)),g=()=>t.texture=a;g(),v(this,f,g,"f"),v(this,d,(()=>!!this.canFocus()&&(t.texture=c,!0)),"f"),v(this,p,(()=>t.texture=u),"f"),"width"in this.hArg?(e.width=(0,y.uint)(this.hArg.width),this.scale.x*=e.width/i):e.width=i,"height"in this.hArg?(e.height=(0,y.uint)(this.hArg.height),this.scale.y*=e.height/i):e.height=i,t.name=JSON.stringify(e),m(T,r,"f",o).call(T,this,t,i,n)},T.fontFamily="'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif",s={value:(t,e)=>{}},o={value:(t,e,i,n)=>{}}},9824:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CallStack=void 0,e.CallStack=class{constructor(t="",e=0,i={":hEvt1Time":{},":hMp":{}}){this.$fn=t,this.$idx=e,this.$csArg=i,this.toString=()=>`[fn:${this.$fn}, idx:${this.$idx}, csArg:${this.$csArg}]`}get fn(){return this.$fn}get idx(){return this.$idx}get csArg(){return this.$csArg}}},4965:(t,e,i)=>{"use strict";function n(t){return parseInt(String(t),10)}Object.defineProperty(e,"__esModule",{value:!0}),e.CmnLib=e.getExt=e.getFn=e.argChk_Color=e.parseColor=e.argChk_Boolean=e.argChk_Num=e.addStyle=e.initStyle=e.cnvTweenArg=e.hMemberCnt=e.getDateStr=e.uint=e.int=void 0,e.int=n,e.uint=function(t){const e=parseInt(String(t),10);return e<0?-e:e},"toInt"in String.prototype||(String.prototype.toInt=function(){return n(this)}),"toUint"in String.prototype||(String.prototype.toUint=function(){const t=n(this);return t<0?-t:t}),e.getDateStr=function(t="/",e=" ",i=":",n=""){const r=new Date;return r.getFullYear()+t+String(100+r.getMonth()+1).slice(1,3)+t+String(100+r.getDate()).slice(1,3)+e+String(100+r.getHours()).slice(1,3)+i+String(100+r.getMinutes()).slice(1,3)+(""===n?"":n+String(r.getMilliseconds()))},e.hMemberCnt={alpha:0,height:0,rotation:0,scale_x:0,scale_y:0,pivot_x:0,pivot_y:0,width:0,x:0,y:0},e.cnvTweenArg=function(t,i){const n={};for(const r in e.hMemberCnt){if(!(r in t))continue;const e=String(t[r]),s=("="===e.charAt(0)?e.slice(1):e).split(","),o=n[r]=parseFloat(s[0]);s.length>1&&(n[r]+=Math.round(Math.random()*(parseFloat(s[1])-o+1))),"="===e.charAt(0)&&(n[r]+=parseFloat(i[r]))}return n};const r="/* SKYNovel */";function s(t){if("#"===t.charAt(0))return parseInt(t.slice(1),16);const e=Number(t);if(!isNaN(e))return e;if("black"===t)return 0;u.cc4ColorName.fillStyle=t;const i=u.cc4ColorName.fillStyle;if("#000000"===i)throw`色名前 ${t} が異常です`;return parseInt(i.slice(1),16)}e.initStyle=function(){const t=document.getElementsByTagName("head")[0];for(let e=t.children.length-1;e>=0;--e){const i=t.children[e];i instanceof HTMLStyleElement&&i.innerText.slice(0,14)===r&&t.removeChild(i)}},e.addStyle=function(t){const e=document.createElement("style");e.innerHTML=r+t,document.getElementsByTagName("head")[0].appendChild(e)},e.argChk_Num=function(t,e,i){const n=t[e];if(!(e in t)){if(isNaN(i))throw`[${t[":タグ名"]}]属性 ${e} は必須です`;return t[e]=i,i}const r="0x"===String(n).slice(0,2)?parseInt(n):parseFloat(n);if(isNaN(r))throw`[${t[":タグ名"]}]属性 ${e} の値【${n}】が数値ではありません`;return t[e]=r},e.argChk_Boolean=function(t,e,i){if(!(e in t))return t[e]=i;const n=t[e];if(null===n)return!1;const r=String(n);return t[e]="false"!==r&&Boolean(r)},e.parseColor=s,e.argChk_Color=function(t,e,i){const n=t[e];return t[e]=n?s(String(n)):i};const o=/^[^\/\.]+$|[^\/]+(?=\.)/;e.getFn=function(t){return(t.match(o)??[""])[0]};const a=/\.([^\.]+)$/;e.getExt=function(t){return(t.match(a)??[""])[1]};const h=i(1795);class u{}e.CmnLib=u,u.stageW=0,u.stageH=0,u.debugLog=!1,u.isSafari="Safari"===h.name,u.isFirefox="Firefox"===h.name,u.isMac=new RegExp("OS X").test(h.os?.family??""),u.isMobile=!new RegExp("(Windows|OS X)").test(h.os?.family??""),u.hDip={},u.isDbg=!1,u.isPackaged=!1,u.isDarkMode=!1},8566:function(t,e,i){"use strict";var n,r,s=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};Object.defineProperty(e,"__esModule",{value:!0}),e.CmnTween=void 0;const o=i(6194);class a{static ease(t){if(!t)return t=>o.Easing.Linear.None(t);if(!(t in s(a,n,"f",r)))throw"異常なease指定です";return s(a,n,"f",r)[t]}}e.CmnTween=a,n=a,r={value:{"Back.In":t=>o.Easing.Back.In(t),"Back.InOut":t=>o.Easing.Back.InOut(t),"Back.Out":t=>o.Easing.Back.Out(t),"Bounce.In":t=>o.Easing.Bounce.In(t),"Bounce.InOut":t=>o.Easing.Bounce.InOut(t),"Bounce.Out":t=>o.Easing.Bounce.Out(t),"Circular.In":t=>o.Easing.Circular.In(t),"Circular.InOut":t=>o.Easing.Circular.InOut(t),"Circular.Out":t=>o.Easing.Circular.Out(t),"Cubic.In":t=>o.Easing.Cubic.In(t),"Cubic.InOut":t=>o.Easing.Cubic.InOut(t),"Cubic.Out":t=>o.Easing.Cubic.Out(t),"Elastic.In":t=>o.Easing.Elastic.In(t),"Elastic.InOut":t=>o.Easing.Elastic.InOut(t),"Elastic.Out":t=>o.Easing.Elastic.Out(t),"Exponential.In":t=>o.Easing.Exponential.In(t),"Exponential.InOut":t=>o.Easing.Exponential.InOut(t),"Exponential.Out":t=>o.Easing.Exponential.Out(t),"Linear.None":t=>o.Easing.Linear.None(t),"Quadratic.In":t=>o.Easing.Quadratic.In(t),"Quadratic.InOut":t=>o.Easing.Quadratic.InOut(t),"Quadratic.Out":t=>o.Easing.Quadratic.Out(t),"Quartic.In":t=>o.Easing.Quartic.In(t),"Quartic.InOut":t=>o.Easing.Quartic.InOut(t),"Quartic.Out":t=>o.Easing.Quartic.Out(t),"Quintic.In":t=>o.Easing.Quintic.In(t),"Quintic.InOut":t=>o.Easing.Quintic.InOut(t),"Quintic.Out":t=>o.Easing.Quintic.Out(t),"Sinusoidal.In":t=>o.Easing.Sinusoidal.In(t),"Sinusoidal.InOut":t=>o.Easing.Sinusoidal.InOut(t),"Sinusoidal.Out":t=>o.Easing.Sinusoidal.Out(t)}}},3422:function(t,e,i){"use strict";var n,r,s,o=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i},a=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};Object.defineProperty(e,"__esModule",{value:!0}),e.Config=void 0;const h=i(4965);class u{constructor(t){this.sys=t,this.oCfg={save_ns:"",coder:{len:864},window:{width:300,height:300},book:{title:"",creator:"",cre_url:"",publisher:"",pub_url:"",detail:"",version:"1.0"},log:{max_len:1024},init:{bg_color:0,tagch_msecwait:10,auto_msecpagewait:3500,escape:""},debug:{devtool:!1,token:!1,tag:!1,putCh:!1,debugLog:!1,baseTx:!1,masume:!1,variable:!1},code:{},debuger_token:""},this.userFnTail="",this.hPathFn2Exts={},n.set(this,!1),r.set(this,!1),s.set(this,/([^\/\s]+)\.([^\d]\w+)/)}static async generate(t){const e=new u(t),i=t.cur+"prj.json",n=await(await t.fetch(i)).text(),r=JSON.parse(t.decStr(i,n));return await e.load(r),e}async load(t){if(this.oCfg.save_ns=t?.save_ns??this.oCfg.save_ns,this.oCfg.coder=t?.coder??this.oCfg.coder,h.CmnLib.stageW=this.oCfg.window.width=Number(t?.window?.width??this.oCfg.window.width),h.CmnLib.stageH=this.oCfg.window.height=Number(t?.window?.height??this.oCfg.window.height),this.oCfg.book={...this.oCfg.book,...t.book},this.oCfg.log.max_len=t.log?.max_len?.max_len??this.oCfg.log.max_len,this.oCfg.init={...this.oCfg.init,...t.init},this.oCfg.init.bg_color=(0,h.parseColor)(String(this.oCfg.init.bg_color)),this.oCfg.debug={...this.oCfg.debug,...t.debug},h.CmnLib.debugLog=this.oCfg.debug.debugLog,this.oCfg.debuger_token=t.debuger_token,await this.sys.loadPath(this.hPathFn2Exts,this),o(this,n,this.matchPath("^breakline$",u.EXT_SPRITE).length>0,"f"),o(this,r,this.matchPath("^breakpage$",u.EXT_SPRITE).length>0,"f"),this.sys.crypto)for(const t in this.hPathFn2Exts){const e=this.hPathFn2Exts[t];for(const t in e){if(":RIPEMD160"!==t.slice(-10))continue;const i=e[t].slice(e[t].lastIndexOf("/")+1),n=e[t.slice(0,-10)],r=await this.sys.fetch(n),s=await r.text();if(i!==this.sys.hash(s))throw`ファイル改竄エラーです fn:${n}`}}}get existsBreakline(){return a(this,n,"f")}get existsBreakpage(){return a(this,r,"f")}getNs(){return`skynovel.${this.oCfg.save_ns} - `}searchPath(t,e=""){if(!t)throw"[searchPath] fnが空です";if("http://"===t.slice(0,7))return t;if("downloads:/"===t.slice(0,11)){const e=this.sys.path_downloads+t.slice(11);return this.sys.ensureFileSync(e),e}if("userdata:/"===t.slice(0,10)){const e=this.sys.path_userdata+"storage/"+t.slice(10);return this.sys.ensureFileSync(e),e}const i=t.match(a(this,s,"f"));let n=i?i[1]:t;const r=i?i[2]:"";if(this.userFnTail){const t=n+"@@"+this.userFnTail;if(t in this.hPathFn2Exts)if(""===e)n=t;else for(let i in this.hPathFn2Exts[t])if(-1!==`|${e}|`.indexOf(`|${i}|`)){n=t;break}}const o=this.hPathFn2Exts[n];if(!o)throw`サーチパスに存在しないファイル【${t}】です`;let u="";if(!r){const i=(0,h.int)(o[":cnt"]);if(""===e){if(i>1)throw`指定ファイル【${t}】が複数マッチします。サーチ対象拡張子群【${e}】で絞り込むか、ファイル名を個別にして下さい。`;return t}const n=`|${e}|`;if(i>1){let i=0;for(const r in o)if(-1!==n.indexOf(`|${r}|`)&&++i>1)throw`指定ファイル【${t}】が複数マッチします。サーチ対象拡張子群【${e}】で絞り込むか、ファイル名を個別にして下さい。`}for(let t in o)if(-1!==n.indexOf(`|${t}|`))return o[t];throw`サーチ対象拡張子群【${e}】にマッチするファイルがサーチパスに存在しません。探索ファイル名=【${t}】`}if(""!==e&&-1===`|${e}|`.indexOf(`|${r}|`))throw`指定ファイルの拡張子【${r}】は、サーチ対象拡張子群【${e}】にマッチしません。探索ファイル名=【${t}】`;if(u=o[r],!u)throw`サーチパスに存在しない拡張子【${r}】です。探索ファイル名=【${t}】、サーチ対象拡張子群【${e}】`;return u}matchPath(t,e=""){const i=[],n=new RegExp(t),r=new RegExp(e);for(let t in this.hPathFn2Exts){if(-1===t.search(n))continue;const s=this.hPathFn2Exts[t];if(""===e){i.push(s);continue}const o={};let a=!1;for(const e in s)-1!==e.search(r)&&(o[e]=t,a=!0);a&&i.push(o)}return i}addPath(t,e){const i={};for(const t in e)i[t]=(":"===t.charAt(0)?"":this.sys.cur)+e[t];this.hPathFn2Exts[t]=i}}e.Config=u,n=new WeakMap,r=new WeakMap,s=new WeakMap,u.EXT_SPRITE="png|jpg|jpeg|json|svg|webp|mp4|webm",u.EXT_SCRIPT="sn|ssn",u.EXT_FONT="woff2|otf|ttf",u.EXT_SOUND="mp3|m4a|ogg|aac|flac|wav",u.EXT_HTML="htm|html"},7307:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i},g=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};Object.defineProperty(e,"__esModule",{value:!0}),e.DebugMng=void 0;const m=i(4965),v=i(1795);class _{constructor(t,e,i){this.sys=t,n.add(this),u.set(this,!0),p(_,r,i,"f",s),p(_,r,e,"f",o),p(_,r,e.title,"f",a),_.myTrace=g(_,r,"m",f),e.log=t=>g(this,n,"m",l).call(this,t),e.trace=t=>g(this,n,"m",c).call(this,t),p(_,r,document.createElement("span"),"f",h),g(_,r,"f",h).hidden=!0,g(_,r,"f",h).textContent="",g(_,r,"f",h).style.cssText=`\tz-index: ${Number.MAX_SAFE_INTEGER};\n\t\t\tposition: absolute; left: 0; top: 0;\n\t\t\tcolor: black;\n\t\t\tbackground-color: rgba(255, 255, 255, 0.7);`,document.body.appendChild(g(_,r,"f",h))}destroy(){p(_,r,(()=>!1),"f",a),document.body.removeChild(g(_,r,"f",h)),_.myTrace=_.trace_beforeNew}static trace_beforeNew(t,e="E"){let i=`{${e}} `+t,n="";switch(e){case"D":n=`color:#${m.CmnLib.isDarkMode?"49F":"05A"};`;break;case"W":n="color:#FF8800;";break;case"F":n="color:#BB0000;";break;case"ET":throw i;case"E":return void console.error("%c"+i,"color:#FF3300;");default:n="color:black;",i=" "+i}console.info("%c"+i,n)}}e.DebugMng=_,r=_,u=new WeakMap,n=new WeakSet,l=function(t){let e="";return g(this,u,"f")&&(p(this,u,!1,"f"),e=`== ${v.description} ==\n`),this.sys.appendFile(this.sys.path_downloads+"log.txt",`${e}--- ${(0,m.getDateStr)("-","_","")} [fn:${g(_,r,"f",s).scriptFn} line:${g(_,r,"f",s).lineNum}] prj:${this.sys.cur}\n${t.text||`(text is ${t.text})`}\n`,(t=>{t&&console.log(t)})),!1},c=function(t){return _.myTrace(t.text||`(text is ${t.text})`,"I"),!1},f=function(t,e="E"){let i=`{${e}} `;g(_,r,"f",s)&&g(_,r,"f",s).lineNum>0&&(i+=`(fn:${g(_,r,"f",s).scriptFn} line:${g(_,r,"f",s).lineNum}) `),i+=t,g(_,r,"m",d).call(_,i,e);let n="";switch(e){case"D":n=`color:#${m.CmnLib.isDarkMode?"49F":"05A"};`;break;case"W":n="color:#F80;";break;case"F":n="color:#B00;";break;case"ET":case"E":if(g(_,r,"f",a).call(_,{text:t}),g(this,r,"f",o).dump_lay({}),g(this,r,"f",o).dump_val({}),g(_,r,"f",s).dumpErrForeLine(),g(this,r,"f",o).dump_stack({}),"ET"===e)throw i;return void console.error("%c"+i,"color:#F30;");default:n="",i=" "+i}console.info("%c"+i,n)},d=function(t,e){let i="";switch(e){case"D":i="color:#05A;";break;case"W":i="color:#F80;";break;case"F":i="color:#B00;";break;case"ET":case"E":i="color:#F30;";break;default:i=""}g(_,r,"f",h).innerHTML+=`<span style='${i}'>${t}</span><br/>`,g(_,r,"f",h).hidden=!1},s={value:void 0},o={value:void 0},a={value:void 0},h={value:void 0},_.myTrace=_.trace_beforeNew},4412:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},y=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i},b=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PicBtnDesignCast=e.TxtBtnDesignCast=e.BtnDesignCast=e.TxtLayPadDesignCast=e.TxtLayDesignCast=e.GrpLayDesignCast=e.DesignCast=void 0;const E=i(4965),x=i(5785),T=i(7307),w=i(3422),S=i(6841),A=b(i(5586));class M{constructor(t,e=!1){this.bg_col=t,this.isLay=e,n.add(this),this.hArg={},this.id_tag="",this.hDesignArg={rotation:0,pivot_x:0,pivot_y:0,left:0,center:0,right:0,s_right:0,top:0,middle:0,bottom:0,s_bottom:0,width:0,height:0},this.fncLay=()=>{},this.mov=void 0,this.div=void 0,this.lx=0,this.ly=0,this.rect=S.Rectangle.EMPTY,this.pivot=new S.Point(0,0),this.scale=new S.Point(1,1),this.rotation=0,this.oldFn=()=>"",this.rotatable=!0}static init(t,e,i,n,l,c,f){t.view.insertAdjacentHTML("beforebegin",`<div id="${_(M,r,"f",u)}" style="width: ${E.CmnLib.stageW*M.sys.cvsScale}px; height: ${E.CmnLib.stageH*e.cvsScale}px; background: rgba(0,0,0,0); position: absolute; touch-action: none; user-select: none; display: none;"></div>`),y(M,r,document.getElementById(_(M,r,"f",u)),"f",s),M.divHint.classList.add("sn_design_hint"),t.view.parentElement.appendChild(M.divHint),M.sys=e,y(M,r,i,"f",o),M.prpPrs=n,y(M,r,l,"f",a),y(M,r,c,"f",h),M.hPages=f,(0,E.addStyle)("\n.sn_design_cast {\n\tposition: absolute; touch-action: none; user-select: none;\n\topacity: 0.6; border-radius: 8px;\n}\n\n.sn_design_cast.drag_border {\n\tline-height: 1.8;\n\tborder: dashed 5px #333;\n}\n\n.sn_design_hint {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tpadding: 5px;\n\tborder-radius: 5px;\n\tbackground: #333;\n\tz-index: 10;\n\tcolor: #fff;\n\tfont-weight: bold;\n\tfont-size: 12px;\n\tdisplay: none;\n}\n")}static setHint(t,e,i,n){M.divHint.innerHTML=t;const r=window.getComputedStyle(M.divHint),s=parseFloat(r.width),o=parseFloat(r.height);M.divHint.style.cssText=`display: block; left: ${Math.max(10,n.lx+e-s)}px;\n\t\ttop: ${Math.max(10,n.ly+i-o-10)}px;`}static cvsResizeDesign(){const t=_(M,r,"f",s).style;t.width=E.CmnLib.stageW*M.sys.cvsScale+"px",t.height=E.CmnLib.stageH*M.sys.cvsScale+"px"}destroy(){this.div=void 0,this.mov?.destroy(),this.mov=void 0}gethArg(){return this.hArg}sethArg(t){if(!this.includeDesignArg(t))return;this.id_tag||(this.id_tag=t[":id_tag"]??""),this.hArg=t;const e=t[":id_dc"]??this.id_tag;_(M,r,"f",c)[e]=this}includeDesignArg(t){for(const e in t)if(e in this.hDesignArg)return!0;return!1}getRect(){return S.Rectangle.EMPTY}cnvPosArg(t,e){return{}}cnvSizeArg(t,e){return{}}setPos(t,e){}setSize(t,e){}setOther(t){}adopt(t){this.child=t,t.parent=this}static enterMode(){M.leaveMode(),_(M,r,"f",s).style.display="inline",y(M,r,0,"f",l),y(M,r,{},"f",c)}static allHide(){_(M,r,"f",f).forEach((t=>t.visible=!1))}set visible(t){this.div&&this.mov&&(this.div.style.display=t?"inline":"none",this.mov.updateTarget())}static leaveMode(){_(M,r,"f",s).textContent="",_(M,r,"f",s).style.display="none",_(M,r,"f",f).forEach((t=>t.destroy())),y(M,r,[],"f",f)}cvsResize(){_(this,n,"m",d).call(this),this.mov?.updateTarget()}onDragStart(){}make(){var t,e;const i=this.hArg[":id_dc"]??this.id_tag;_(M,r,"f",c)[i]=this;const a=this.div=document.createElement("div");a.id=_(M,r,"f",u)+"_"+y(t=M,r,(e=_(t,r,"f",l),++e),"f",l),a.classList.add("sn_design_cast"),a.dataset.id_dc=i,a.style.backgroundColor=`${this.bg_col}`,a.style.display="none",this.rect=this.getRect(),_(this,n,"m",d).call(this),(this.parent?document.querySelector(`[data-id_dc="${this.parent.id_tag}"]`)??_(M,r,"f",s):_(M,r,"f",s)).appendChild(a);const p={aPos:[0,0],roDeg:0,trOrg:"",origin:[0,0]},g=()=>{p.aPos=[NaN,NaN],p.roDeg=this.rotation;const t=this.pivot.x*M.sys.cvsScale,e=this.pivot.y*M.sys.cvsScale;p.trOrg=`${t}px ${e}px`,p.origin=[t,e],Object.assign(this.mov,{verticalGuidelines:[],horizontalGuidelines:[]})},m=t=>{M.sys.send2Dbg("_changeCast",{...t,":id_tag":this.id_tag}),M.divHint.style.display="none"},v=()=>{const[t,e]=p.aPos;if(isNaN(t))return void(M.divHint.style.display="none");const i=(0,E.int)(this.rect.x+=t/M.sys.cvsScale+this.pivot.x),n=(0,E.int)(this.rect.y+=e/M.sys.cvsScale+this.pivot.y);this.setPos(i,n);const r=(0,E.uint)(this.rect.width),s=(0,E.uint)(this.rect.height);this.setSize(r,s),m({...this.cnvPosArg(i,n),...this.cnvSizeArg(r,s)})};let b;this.mov=new A.default(document.body,{target:a,draggable:!0,resizable:!0,rotatable:this.rotatable,originDraggable:this.rotatable,snappable:!0}).on("dragStart",(t=>{g(),this.onDragStart();const e=this.child?.mov;e&&(b=e.target,e.isInside(t.clientX,t.clientY)&&(e.target=void 0))})).on("drag",(t=>{p.aPos=t.beforeTranslate,this.procDragHint(t,t.left,t.top)})).on("dragEnd",(()=>{v(),this.child?.mov&&(this.child.mov.target=b),this.parent?.mov&&(this.parent.mov.target=this.parent.div)})).on("resizeStart",g).on("resize",(t=>{a.style.width=`${t.width}px`,a.style.height=`${t.height}px`,p.aPos=t.drag.beforeTranslate,this.rect.width=t.width/M.sys.cvsScale,this.rect.height=t.height/M.sys.cvsScale,this.procResizeHint(t,t.drag.left,t.drag.top)})).on("resizeEnd",v).on("rotateStart",(t=>{g(),t.set(p.roDeg)})).on("rotate",(t=>{p.roDeg=t.beforeRotate,M.setHint((0,E.int)(p.roDeg)+"度",t.drag.left,t.drag.top,this)})).on("rotateEnd",(()=>{this.rotation=p.roDeg,this.setOther({}),m({rotation:(0,E.int)(p.roDeg)})})).on("dragOriginStart",(()=>g)).on("dragOrigin",(t=>{p.trOrg=t.transformOrigin,p.origin=t.origin})).on("dragOriginEnd",(()=>{const[t,e]=p.origin;p.trOrg=`${t}px ${e}px`;const i=this.pivot.x=t/M.sys.cvsScale,n=this.pivot.y=e/M.sys.cvsScale;this.setOther({});const r=(0,E.int)(this.rect.x+i),s=(0,E.int)(this.rect.y+n);this.setPos(r,s),m({...this.cnvPosArg(r,s),pivot_x:(0,E.int)(i),pivot_y:(0,E.int)(n)})})).on("render",(()=>{const{aPos:t,roDeg:e,trOrg:i}=p;a.style.transformOrigin=i,a.style.transform=`translate(${t[0]}px, ${t[1]}px) rotate(${e}deg)`})),_(M,r,"f",f).push(this),a.addEventListener("dragenter",(()=>a.classList.add("drag_border"))),a.addEventListener("dragover",(t=>{t.stopPropagation(),t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy")})),a.addEventListener("dragleave",(()=>a.classList.remove("drag_border"))),a.addEventListener("drop",(t=>{t.stopPropagation(),t.preventDefault(),a.classList.remove("drag_border");const e=t.dataTransfer;if(!e||0===e.files.length)return;const i=e.files[0],n={":id_tag":this.id_tag,fn:(0,E.getFn)(i.name),ext:(0,E.getExt)(i.name),url:"",buf:new ArrayBuffer(0),old_fn:this.oldFn(),old_url:_(M,r,"f",h).searchPath(this.oldFn(),w.Config.EXT_SPRITE)};i.arrayBuffer().then((t=>{n.buf=t;try{n.url=_(M,r,"f",o).cnvPath4Dbg(_(M,r,"f",h).searchPath(i.name,w.Config.EXT_SPRITE))}catch{}M.sys.send2Dbg("_dropFile",n)})).catch((t=>console.error("drop2dc %o",t)))})),a.addEventListener("dblclick",(t=>{t.preventDefault(),M.sys.send2Dbg("_focusScript",this.hArg)}))}procDragHint(t,e,i){const[n,r]=t.beforeTranslate;M.setHint(`(${(0,E.int)(this.rect.x+n/M.sys.cvsScale)}, ${(0,E.int)(this.rect.y+r/M.sys.cvsScale)})`,e,i,this)}procResizeHint(t,e,i){M.setHint(`(${(0,E.int)(t.drag.left)}, ${(0,E.int)(t.drag.top)})<br/>${(0,E.int)(this.rect.width)} x ${(0,E.int)(this.rect.height)}`,e,i,this)}static replaceToken(t){const e=t[":id_tag"],i=_(M,r,"f",c)[e];if(!document.querySelector(`div[data-id_dc='${e}']`)||!i)return;const n=t[":token"];_(M,r,"f",o).replace(t[":idx_tkn"],n);const[s,h]=(0,x.tagToken2Name_Args)(n);i.child&&(i.child.hArg[":token"]=i.hArg[":token"]),_(M,r,"f",a).go(h);const u=_(M,r,"f",a).hPrm;if("pivot_x"in u||"pivot_y"in u){const e=Number(M.prpPrs.getValAmpersand(u.pivot_x.val??"0")),r=Number(M.prpPrs.getValAmpersand(u.pivot_y.val??"0"));(isNaN(e)||isNaN(r))&&T.DebugMng.myTrace(`pivot_xかpivot_yが数値ではありません\n(fn:${t[":path"].slice(13)} ln:${t[":ln"]})\n${n}`,"F"),i.pivot.set(e,r)}if("left"in u||"top"in u||"x"in u||"y"in u){const e=(0,E.int)(M.prpPrs.getValAmpersand(u.left.val??u.x.val??"0")),r=(0,E.int)(M.prpPrs.getValAmpersand(u.top.val??u.y.val??"0"));(isNaN(e)||isNaN(r))&&T.DebugMng.myTrace(`widthかheightが数値ではありません\n(fn:${t[":path"].slice(13)} ln:${t[":ln"]})\n${n}`,"F"),i.rect.x=e-i.pivot.x,i.rect.y=r-i.pivot.y,i.setPos(e,r)}if("width"in u||"height"in u){const e=(0,E.int)(M.prpPrs.getValAmpersand(u.width.val??"0")),r=(0,E.int)(M.prpPrs.getValAmpersand(u.height.val??"0"));(isNaN(e)||isNaN(r))&&T.DebugMng.myTrace(`widthかheightが数値ではありません\n(fn:${t[":path"].slice(13)} ln:${t[":ln"]})\n${n}`,"F"),i.rect.width=e,i.rect.height=r,i.setSize(e,r)}if("scale_x"in u||"scale_y"in u){const e=Number(M.prpPrs.getValAmpersand(u.scale_x.val??"0")),r=Number(M.prpPrs.getValAmpersand(u.scale_y.val??"0"));(isNaN(e)||isNaN(r))&&T.DebugMng.myTrace(`scale_xかscale_yが数値ではありません\n(fn:${t[":path"].slice(13)} ln:${t[":ln"]})\n${n}`,"F"),i.scale.set(e,r)}if("rotation"in u){const e=Number(M.prpPrs.getValAmpersand(u.rotation.val??"0"));isNaN(e)&&T.DebugMng.myTrace(`rotationが数値ではありません\n(fn:${t[":path"].slice(13)} ln:${t[":ln"]})\n${n}`,"F"),i.rotation=e}i.setOther(u),i.cvsResize()}}e.DesignCast=M,r=M,n=new WeakSet,d=function(){this.fncLay(),this.div&&Object.assign(this.div.style,{left:`${this.lx+this.rect.x*M.sys.cvsScale}px`,top:`${this.ly+this.rect.y*M.sys.cvsScale}px`,width:this.rect.width*M.sys.cvsScale+"px",height:this.rect.height*M.sys.cvsScale+"px",transformOrigin:`${this.pivot.x*M.sys.cvsScale}px ${this.pivot.y*M.sys.cvsScale}px`,transform:`scale(${this.scale.x}, ${this.scale.y}) rotate(${this.rotation}deg)`})},s={value:void 0},o={value:void 0},a={value:void 0},h={value:void 0},M.divHint=document.createElement("div"),u={value:"DesignMode"},l={value:0},c={value:{}},f={value:[]},e.GrpLayDesignCast=class extends M{constructor(t,e){super("#29e",!0),this.spLay=t,this.gl=e,p.set(this,void 0),this.oldFn=()=>this.hArg.fn??""}setSp(t){y(this,p,t,"f")}getRect(){return new S.Rectangle(this.spLay.x,this.spLay.y,_(this,p,"f")?.width??0,_(this,p,"f")?.height??0)}cnvPosArg(t,e){return{left:t,top:e}}cnvSizeArg(t,e){return{width:t,height:e}}setPos(t,e){this.spLay.x=t,this.spLay.y=e}setSize(t,e){_(this,p,"f").width=t,_(this,p,"f").height=e}setOther(t){if("fn"in t){const e=M.prpPrs.getValAmpersand(t.fn.val??"");this.gl.lay({fn:e})}this.spLay.pivot.copyFrom(this.pivot),this.spLay.scale.copyFrom(this.scale),this.spLay.angle=this.rotation}},p=new WeakMap,e.TxtLayDesignCast=class extends M{constructor(t,e){super("#29e",!0),this.spLay=t,this.ts=e,this.hDesignArg={rotation:0,pivot_x:0,pivot_y:0,left:0,center:0,right:0,s_right:0,top:0,middle:0,bottom:0,s_bottom:0,width:0,height:0,pl:0,pr:0,pt:0,pb:0}}getRect(){const t=this.ts.infTL;return new S.Rectangle(this.spLay.x,this.spLay.y,t.$width,t.$height)}cnvPosArg(t,e){return{left:t,top:e}}cnvSizeArg(t,e){return{width:t,height:e}}setPos(t,e){this.spLay.position.set(t,e),this.ts.lay(this.cnvPosArg(t,e))}setSize(t,e){this.ts.lay(this.cnvSizeArg(t,e))}setOther(t){this.child?.setOther(t),this.spLay.pivot.copyFrom(this.pivot),this.spLay.scale.copyFrom(this.scale),this.spLay.angle=this.rotation}},e.TxtLayPadDesignCast=class extends M{constructor(t){super("#9e2"),this.ts=t,g.add(this),this.rotatable=!1}getRect(){const t=this.ts.infTL;return new S.Rectangle(t.pad_left,t.pad_top,t.$width-t.pad_left-t.pad_right,t.$height-t.pad_top-t.pad_bottom)}cnvPosArg(t,e){return{pl:t,pt:e}}cnvSizeArg(t,e){const i=this.ts.infTL;return{pr:i.$width-i.pad_left-t,pb:i.$height-i.pad_top-e}}setPos(t,e){this.ts.lay(this.cnvPosArg(t,e))}setSize(t,e){this.ts.lay({...this.cnvSizeArg(t,e),":redraw":!0})}setOther(t){const e=this.ts.infTL;if(("pl"in t||"pt"in t)&&(this.setPos(this.rect.x=parseFloat(M.prpPrs.getValAmpersand(t.pl?.val??`${e.pad_left}`)),this.rect.y=parseFloat(M.prpPrs.getValAmpersand(t.pt?.val??`${e.pad_top}`))),this.cvsResize()),"pr"in t||"pb"in t){this.ts.lay({pr:parseFloat(M.prpPrs.getValAmpersand(t.pr?.val??`${e.pad_right}`)),pb:parseFloat(M.prpPrs.getValAmpersand(t.pb?.val??`${e.pad_bottom}`))});const i=this.getRect();this.setSize(this.rect.width=i.width,this.rect.height=i.height),this.cvsResize()}}procDragHint(t,e,i){const[n,r]=t.beforeTranslate;_(this,g,"m",m).call(this,e,i,n,r)}procResizeHint(t,e,i){const[n,r]=t.drag.beforeTranslate;_(this,g,"m",m).call(this,e,i,n,r)}},g=new WeakSet,m=function(t,e,i,n){const r=this.rect.x,s=this.rect.y,o=this.rect.width,a=this.rect.height,h=this.ts.infTL,u=(0,E.int)(r+i/M.sys.cvsScale),l=(0,E.int)(s+n/M.sys.cvsScale),c=(0,E.int)(h.$width-u-o),f=(0,E.int)(h.$height-l-a),d=t=>"&nbsp;".repeat(t);M.setHint(d(11)+`上幅=${l}<br/>\n\t\t\t左幅=${u+d(10)}右幅=${c}<br/>`+d(5)+`内側 ${(0,E.int)(o)} x ${(0,E.int)(a)}<br/>`+d(10)+`下幅=${f}`,t,e,this)};class O extends M{constructor(t,e){super("#e92"),this.btn=t,this.hArg=e,this.pivot.x=(0,E.argChk_Num)(e,"pivot_x",this.pivot.x),this.pivot.y=(0,E.argChk_Num)(e,"pivot_y",this.pivot.y),this.scale.x=(0,E.argChk_Num)(e,"scale_x",this.scale.x),this.scale.y=(0,E.argChk_Num)(e,"scale_y",this.scale.y),this.rotation=(0,E.argChk_Num)(e,"rotation",this.rotation),this.sethArg(e)}sethArg(t){super.sethArg(t);const e=this.hArg.layer??"";this.fncLay=this.parent||this.child||!e?()=>{}:()=>{const t=M.hPages[e].fore;this.lx=t.x*M.sys.cvsScale,this.ly=t.y*M.sys.cvsScale}}cnvPosArg(t,e){return{left:t,top:e}}cnvSizeArg(t,e){return{width:t,height:e}}setPos(t,e){this.btn.x=t,this.btn.y=e}setOther(t){this.btn.pivot.copyFrom(this.pivot),this.btn.scale.copyFrom(this.scale),this.btn.angle=this.rotation}onDragStart(){const t=this.btn.parent.children.filter((t=>t!==this.btn));Object.assign(this.mov,{verticalGuidelines:t.map((t=>this.lx+t.x*M.sys.cvsScale)),horizontalGuidelines:t.map((t=>this.ly+t.y*M.sys.cvsScale))})}}e.BtnDesignCast=O,e.TxtBtnDesignCast=class extends O{constructor(t,e,i){super(t,e),this.txt=i,this.oldFn=()=>this.hArg.b_pic??"",(0,E.argChk_Boolean)(e,"design",!0)||(this.setPos=()=>{},this.setSize=()=>{})}getRect(){return new S.Rectangle(this.btn.x,this.btn.y,this.txt.width,this.txt.height)}setSize(t,e){this.txt.width=t,this.txt.height=e}setOther(t){if(super.setOther(t),"b_pic"in t){const e=M.prpPrs.getValAmpersand(t.b_pic.val??"");this.btn.update_b_pic(e,this.txt)}}},e.PicBtnDesignCast=class extends O{constructor(t,e){super(t,e),v.set(this,void 0),this.oldFn=()=>this.hArg.pic??""}setSp(t){y(this,v,t,"f")}getRect(){return new S.Rectangle(this.btn.x,this.btn.y,_(this,v,"f").width,_(this,v,"f").height)}setSize(t,e){_(this,v,"f").width=t,_(this,v,"f").height=e}setOther(t){if(super.setOther(t),"pic"in t){const e=M.prpPrs.getValAmpersand(t.pic.val??"");this.btn.update_pic(e,_(this,v,"f"))}}},v=new WeakMap},5097:function(t,e,i){"use strict";var n,r=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},s=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.EventListenerCtn=void 0;const o=i(6841);e.EventListenerCtn=class{constructor(){n.set(this,[])}add(t,e,i,s={}){if(t instanceof o.BaseTexture)switch(e){case"loaded":case"update":case"error":case"dispose":t.on(e,i,s),r(this,n,"f").push((()=>t.off(e,i,s)))}else{if(t instanceof o.utils.EventEmitter)return t.on(e,i,s),void r(this,n,"f").push((()=>t.off(e,i,s)));t.addEventListener(e,i,s),r(this,n,"f").push((()=>t.removeEventListener(e,i,{capture:s.capture??!1})))}}clear(){r(this,n,"f").forEach((t=>t())),s(this,n,[],"f")}},n=new WeakMap},8526:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x,T,w,S,A,M,O,R,C,I,P,N,D,L,k,B,F,G,U,j,X,H,z,W,V,Y=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},$=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.EventMng=void 0;const q=i(4965),Z=i(1028),K=i(5097),J=i(6761),Q=i(5455),tt=i(6194),et=i(6841),it=i(3422),nt=i(7007),{GamepadListener:rt}=i(7042);e.EventMng=class{constructor(t,e,i,_,A,N,L,k,J){if(this.cfg=t,this.hTag=e,this.appPixi=i,this.main=_,this.layMng=A,this.val=N,this.sndMng=L,this.scrItr=k,this.sys=J,n.add(this),r.set(this,new K.EventListenerCtn),s.set(this,document.createElement("canvas")),o.set(this,100),a.set(this,50),h.set(this,void 0),u.set(this,new et.Graphics),this.setTxtHint=(t,e,i)=>{},l.set(this,new rt({analog:!1,deadZone:.3})),c.set(this,new Q.FocusMng),f.set(this,(t=>{})),m.set(this,!1),v.set(this,!1),y.set(this,{}),b.set(this,{}),E.set(this,!1),x.set(this,!1),T.set(this,(t=>Y(this,y,"f")[t]??Y(this,b,"f")[t])),S.set(this,(()=>{$(this,S,(()=>{}),"f"),this.scrItr.firstWait()})),M.set(this,void 0),O.set(this,void 0),R.set(this,((t,e,i,n,r,s)=>{Y(this,u,"f").zIndex=1e3,Y(this,u,"f").x=i.x,Y(this,u,"f").y=i.y,Y(this,u,"f").rotation=e.rotation;const o=(n?e.parent:e).scale,h="button"===t[":タグ名"]&&t.pic;Y(this,u,"f").clear().beginFill(3407616,.2).lineStyle(1,3407616,1).drawRect(0,0,i.width,i.height).endFill().beginFill(13311,.2).lineStyle(2,13311,1),s?Y(this,u,"f").drawRect(n?i.height:i.width,((n?i.width:i.height)-r)/2,Y(this,a,"f")*(h?1:o.x),r*(h?1:o.y)):Y(this,u,"f").drawRect((i.width-r)/2,-Y(this,a,"f"),r*(h?1:o.x),Y(this,a,"f")*(h?1:o.y)),Y(this,u,"f").endFill()})),C.set(this,((t,e)=>{})),I.set(this,new K.EventListenerCtn),B.set(this,(()=>this.layMng.goTxt())),U.set(this,(()=>!1)),z.set(this,(()=>{})),V.set(this,{Alt:0,Meta:0,Control:0,ArrowDown:0,End:0,Enter:0,Escape:0," ":0,GoBack:0}),e.clear_event=t=>Y(this,n,"m",P).call(this,t),e.event=t=>Y(this,n,"m",D).call(this,t),e.l=t=>Y(this,n,"m",F).call(this,t),e.p=t=>Y(this,n,"m",G).call(this,t),e.s=()=>(this.scrItr.recodePage(),Y(this,n,"m",w).call(this,(()=>{}),!1,!0),!0),e.set_cancel_skip=()=>Y(this,n,"m",j).call(this),e.set_focus=t=>Y(this,n,"m",X).call(this,t),e.wait=t=>Y(this,n,"m",H).call(this,t),e.waitclick=()=>Y(this,n,"m",W).call(this),L.setEvtMng(this),k.setOtherObj(this,A),Z.TxtLayer.setEvtMng(_,this,J),A.setEvtMng(this),J.setFire(((t,e)=>this.fire(t,e))),q.CmnLib.isDbg){const t={pause:()=>{if($(this,E,!0,"f"),!Y(this,x,"f"))return;const t={};this.scrItr.recodeDesign(t),this.sys.callHook("_enterDesign",t),this.sys.send2Dbg("_enterDesign",t)},stopOnBreakpoint:()=>$(this,E,!0,"f"),stopOnDataBreakpoint:()=>$(this,E,!0,"f"),continue:()=>$(this,E,!1,"f"),disconnect:()=>$(this,E,!1,"f")};t.attach=t.stopOnEntry=t.stopOnStep=t.stopOnStepIn=t.stopOnStepOut=t.stopOnBackstep=t.pause,J.addHook((e=>t[e]?.()))}let tt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAyBAMAAABYG2ONAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGuGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDIgNzkuMTY0NDYwLCAyMDIwLzA1LzEyLTE2OjA0OjE3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjEuMiAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjAtMDgtMTlUMDM6MDk6MjUrMDk6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIwLTA4LTE5VDIzOjUyOjI5KzA5OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIwLTA4LTE5VDIzOjUyOjI5KzA5OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjI5ZjM1YWNlLTc0NzMtNGI3My05OGJjLWQ1OTk4ZDk5MjQzNiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDphY2U0MDcwOS04ZTQxLTQ1YjYtYTMwZi05NDU1YWM1OTAwMmEiIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDphY2U0MDcwOS04ZTQxLTQ1YjYtYTMwZi05NDU1YWM1OTAwMmEiPiA8eG1wTU06SGlzdG9yeT4gPHJkZjpTZXE+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJjcmVhdGVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOmFjZTQwNzA5LThlNDEtNDViNi1hMzBmLTk0NTVhYzU5MDAyYSIgc3RFdnQ6d2hlbj0iMjAyMC0wOC0xOVQwMzowOToyNSswOTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIxLjIgKE1hY2ludG9zaCkiLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjA3Mzg4MzYwLWJjMjctNDRkZi1hMTYwLTk5N2M4ODNmYTA0ZCIgc3RFdnQ6d2hlbj0iMjAyMC0wOC0xOVQyMjo0NTozNiswOTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIxLjIgKE1hY2ludG9zaCkiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjI5ZjM1YWNlLTc0NzMtNGI3My05OGJjLWQ1OTk4ZDk5MjQzNiIgc3RFdnQ6d2hlbj0iMjAyMC0wOC0xOVQyMzo1MjoyOSswOTowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIxLjIgKE1hY2ludG9zaCkiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+WWAYXwAAACdQTFRF////PDIlPDIlPDIlPDIlPDIlPDIlPDIlPDIlPDIlPDIlPDIlPDIlCOA6SAAAAA10Uk5TACB/MID/EJBA8NCwYDCdv6cAAABoSURBVHgBYxicYBQIKZEIlJmMSQWGTKS7a8RpGdUyqmVUy6iWUS3y7zGBAlwai+wnrOZwTA2FgBnE220F0RFlQLwWtq1gLdtI8SI7SEc4acFyMjQ08gBpgWzlAEKkgayoBJJj7AAuCQAm1kUjHh83WgAAAABJRU5ErkJggg==",st=!1;try{tt=t.searchPath("hint",it.Config.EXT_SPRITE),st=!0}catch{}const ot=Y(this,s,"f").getContext("2d");if(ot){Y(this,s,"f").hidden=!0,i.view.parentElement.appendChild(Y(this,s,"f"));const t=Y(this,s,"f").style;t.position="absolute",t.left=t.top="0",t.zIndex="10000",t.pointerEvents="none",t.userSelect="none",$(this,h,10,"f");const e=new Image,n=()=>{Y(this,s,"f").width=$(this,o,e.width,"f"),Y(this,s,"f").height=$(this,a,e.height,"f"),this.setTxtHint("行方向の変更","white","22px Arial")};this.setTxtHint=(t,i,n)=>{ot.clearRect(0,0,Y(this,s,"f").width,Y(this,s,"f").height),ot.drawImage(e,0,0),ot.textBaseline="top",ot.font=n,ot.fillStyle=i,ot.fillText(t,Y(this,h,"f"),16,Y(this,o,"f")-2*Y(this,h,"f"))},st?nt.GrpLayer.loadPic2Img("hint",e,(t=>{e===t&&n()})):(e.src=tt,e.onload=n)}this.cfg.oCfg.debug.masume?i.stage.addChild(Y(this,u,"f")):$(this,R,(()=>{}),"f"),i.stage.interactive=!0,q.CmnLib.isMobile?i.stage.on("pointerdown",(t=>this.fire("click",t))):Y(this,r,"f").add(i.stage,"pointerdown",(t=>{switch(t.data.button){case 0:this.fire("click",t);break;case 1:this.fire("middleclick",t)}})),Y(this,r,"f").add(window,"keydown",(t=>Y(this,n,"m",d).call(this,t))),Y(this,r,"f").add(i.view,"contextmenu",(t=>Y(this,n,"m",p).call(this,t)));const at=t=>{q.CmnLib.isDarkMode=t.matches,N.setVal_Nochk("tmp","const.sn.isDarkMode",q.CmnLib.isDarkMode)},ht=globalThis.matchMedia("(prefers-color-scheme: dark)");at(ht),ht.addEventListener("change",(t=>{at(t),this.fire("sn:chgDarkMode",t)})),"WheelEvent"in window&&(Y(this,r,"f").add(i.view,"wheel",(t=>Y(this,n,"m",g).call(this,t)),{passive:!0}),$(this,f,(t=>t.addEventListener("wheel",(t=>Y(this,n,"m",g).call(this,t)),{passive:!0})),"f"),$(this,C,((t,e)=>t.add(i.view,"wheel",(t=>{t.isComposing||t.deltaY<=0||(t.stopPropagation(),e())}))),"f")),q.CmnLib.debugLog&&(Y(this,l,"f").on("gamepad:connected",(t=>console.log(`👺<'gamepad:connected' index:${t.detail.index} id:${t.detail.gamepad.id}`))),Y(this,l,"f").on("gamepad:disconnected",(t=>console.log(`👺<'gamepad:disconnected' index:${t.detail.index} id:${t.detail.gamepad.id}`))));const ut=["","ArrowUp","","ArrowLeft","","ArrowRight","","ArrowDown",""],lt=[0,0];Y(this,l,"f").on("gamepad:axis",(t=>{if(!document.hasFocus()||0!==t.detail.stick)return;lt[t.detail.axis]=t.detail.value;const e=3*(lt[1]+1)+(lt[0]+1),i=ut[e];if(!i)return;const n=Y(this,c,"f").getFocus();(!n||n instanceof et.Container?globalThis:n).dispatchEvent(new KeyboardEvent("keydown",{key:i,bubbles:!0})),!n||n instanceof et.Container||"range"===n.getAttribute("type")&&n.dispatchEvent(new InputEvent("input",{bubbles:!0}))})),Y(this,l,"f").on("gamepad:button",(t=>{if(document.hasFocus()&&0!==t.detail.value)if(t.detail.button%2==0){const t=Y(this,c,"f").getFocus();(!t||t instanceof et.Container?globalThis:t).dispatchEvent(new KeyboardEvent("keydown",{key:"Enter",bubbles:!0}))}else i.view.dispatchEvent(new Event("contextmenu"))})),Y(this,l,"f").start(),Y(this,r,"f").add(window,"keyup",(t=>{t.isComposing||t.key in Y(this,V,"f")&&(Y(this,V,"f")[t.key]=0)})),N.defTmp("const.sn.key.alternate",(()=>Y(this,V,"f").Alt>0)),N.defTmp("const.sn.key.command",(()=>Y(this,V,"f").Meta>0)),N.defTmp("const.sn.key.control",(()=>Y(this,V,"f").Control>0)),N.defTmp("const.sn.key.end",(()=>Y(this,V,"f").End>0)),N.defTmp("const.sn.key.escape",(()=>Y(this,V,"f").Escape>0)),N.defTmp("const.sn.key.back",(()=>Y(this,V,"f").GoBack>0))}resvFlameEvent(t){t.addEventListener("keydown",(t=>Y(this,n,"m",d).call(this,t))),t.addEventListener("contextmenu",(t=>Y(this,n,"m",p).call(this,t))),Y(this,f,"f").call(this,t)}destroy(){Y(this,c,"f").destroy(),Y(this,r,"f").clear(),Y(this,s,"f")?.parentElement.removeChild(Y(this,s,"f"))}fire(t,e){if(Y(this,U,"f").call(this)||!Y(this,x,"f")||Y(this,E,"f"))return;const i=t.toLowerCase();if(q.CmnLib.debugLog&&console.log(`👺 fire<(key:\`${i}\` type:${e.type} e:%o)`,{...e}),"enter"===i){const t=Y(this,c,"f").getFocus();if(t instanceof et.Container)return void t.emit("pointerdown",new Event("pointerdown"))}const n=Y(this,T,"f").call(this,i);n?("wheel"!==i.slice(-5)&&e.preventDefault?.(),e.stopPropagation(),"dom="!==i.slice(0,4)&&this.layMng.clickTxtLay(),$(this,x,!1,"f"),n(e),Y(this,s,"f").hidden=!0):"swipe"===i.slice(0,5)&&globalThis.scrollBy(-e.deltaX??0,-e.deltaY??0)}popLocalEvts(){const t=Y(this,y,"f");return $(this,y,{},"f"),t}pushLocalEvts(t){$(this,y,t,"f")}waitEvent(t,e=!0,i=!1){if(e&&i)throw"canskipとglobalを同時にtrue指定できません";if(this.val.getVal("tmp:sn.skip.enabled")){if(this.val.getVal("tmp:sn.skip.all")||this.scrItr.isNextKidoku)return t(),!1;Y(this,U,"f").call(this)}return Y(this,n,"m",w).call(this,t,e,i),!0}unButton(t){Y(this,c,"f").remove(t)}button(t,e,i,r,o){t.fn||t.label||this.main.errScript("fnまたはlabelは必須です"),e.interactive=e.buttonMode=!0;const a=t.key?.toLowerCase()??" ";t.fn||(t.fn=this.scrItr.scriptFn);const h=(0,q.argChk_Boolean)(t,"global",!1);h?Y(this,b,"f")[a]=()=>this.main.resumeByJumpOrCall(t):Y(this,y,"f")[a]=()=>this.main.resumeByJumpOrCall(t);const u=e;u.on("pointerdown",(t=>this.fire(a,t)));const l=t.hint?()=>Y(this,n,"m",A).call(this,t,e):()=>{},f=()=>{i(),Y(this,s,"f").hidden=!0},d=()=>(l(),r());if(u.on("pointerover",d),u.on("pointerout",(()=>{Y(this,c,"f").isFocus(e)?d():f()})),u.on("pointerdown",o),u.on("pointerup",q.CmnLib.isMobile?f:()=>{Y(this,c,"f").isFocus(e)?d():f()}),Y(this,c,"f").add(e,d,f),t.clickse&&(this.cfg.searchPath(t.clickse,it.Config.EXT_SOUND),u.on("pointerdown",(()=>{const e={fn:t.clickse,join:!1};t.clicksebuf&&(e.buf=t.clicksebuf),this.hTag.playse(e)}))),t.enterse&&(this.cfg.searchPath(t.enterse,it.Config.EXT_SOUND),u.on("pointerover",(()=>{const e={fn:t.enterse,join:!1};t.entersebuf&&(e.buf=t.entersebuf),this.hTag.playse(e)}))),t.leavese&&(this.cfg.searchPath(t.leavese,it.Config.EXT_SOUND),u.on("pointerout",(()=>{const e={fn:t.leavese,join:!1};t.leavesebuf&&(e.buf=t.leavesebuf),this.hTag.playse(e)}))),t.onenter){const e=a+t.onenter.toLowerCase(),i={fn:t.fn,label:t.onenter,call:!0,key:e};h?Y(this,b,"f")[e]=()=>this.main.resumeByJumpOrCall(i):Y(this,y,"f")[e]=()=>this.main.resumeByJumpOrCall(i),u.on("pointerover",(t=>this.fire(e,t)))}if(t.onleave){const e=a+t.onleave.toLowerCase(),i={fn:t.fn,label:t.onleave,call:!0,key:e};h?Y(this,b,"f")[e]=()=>this.main.resumeByJumpOrCall(i):Y(this,y,"f")[e]=()=>this.main.resumeByJumpOrCall(i),u.on("pointerout",(t=>this.fire(e,t)))}this.sndMng.loadAheadSnd(t)}cvsResize(){Y(this,s,"f").hidden||Y(this,n,"m",A).call(this,Y(this,M,"f"),Y(this,O,"f"),!1)}waitLimitedEvent(t,e){Y(this,B,"f").call(this),this.val.saveKidoku();const i=()=>{Y(this,I,"f").clear(),e()};if(this.val.getVal("tmp:sn.skip.enabled")){if(this.val.getVal("tmp:sn.skip.all")||this.scrItr.isNextKidoku)return i(),!1;Y(this,U,"f").call(this)}return!(0,q.argChk_Boolean)(t,"canskip",!0)||(Y(this,I,"f").add(window,"pointerdown",(t=>{t.stopPropagation(),i()})),Y(this,I,"f").add(window,"keydown",(t=>{t.isComposing||(t.stopPropagation(),i())})),Y(this,C,"f").call(this,Y(this,I,"f"),i),!0)}isSkippingByKeyDown(){if(this.scrItr.skip4page)return!0;for(const t in Y(this,V,"f"))if(2===Y(this,V,"f")[t])return!0;return!1}},r=new WeakMap,s=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,u=new WeakMap,l=new WeakMap,c=new WeakMap,f=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakMap,T=new WeakMap,S=new WeakMap,M=new WeakMap,O=new WeakMap,R=new WeakMap,C=new WeakMap,I=new WeakMap,B=new WeakMap,U=new WeakMap,z=new WeakMap,V=new WeakMap,n=new WeakSet,d=function(t){if(t.isComposing)return;t.key in Y(this,V,"f")&&(Y(this,V,"f")[t.key]=t.repeat?2:1);const e=(t.altKey?"Alt"===t.key?"":"alt+":"")+(t.ctrlKey?"Control"===t.key?"":"ctrl+":"")+(t.shiftKey?"Shift"===t.key?"":"shift+":"")+t.key;this.fire(e,t)},p=function(t){const e=(t.altKey?"Alt"===t.key?"":"alt+":"")+(t.ctrlKey?"Control"===t.key?"":"ctrl+":"")+(t.shiftKey?"Shift"===t.key?"":"shift+":"")+"rightclick";this.fire(e,t),t.preventDefault()},g=function(t){if(t.isComposing)return;if(Y(this,m,"f"))return void $(this,v,!0,"f");$(this,m,!0,"f"),Y(this,n,"m",_).call(this);const e=(t.altKey?"alt+":"")+(t.ctrlKey?"ctrl+":"")+(t.shiftKey?"shift+":"")+(t.deltaY>0?"downwheel":"upwheel");this.fire(e,t)},_=function t(){setTimeout((()=>{if(Y(this,v,"f"))return $(this,v,!1,"f"),void Y(this,n,"m",t).call(this);$(this,m,!1,"f")}),250)},w=function(t,e=!0,i=!0){if(Y(this,B,"f").call(this),this.val.saveKidoku(),e?Y(this,y,"f").click=Y(this,y,"f").enter=Y(this,y,"f").arrowdown=Y(this,y,"f")["wheel.y>0"]=t:(delete Y(this,y,"f").click,delete Y(this,y,"f").enter,delete Y(this,y,"f").arrowdown,delete Y(this,y,"f")["wheel.y>0"]),$(this,T,i?t=>Y(this,y,"f")[t]??Y(this,b,"f")[t]:t=>Y(this,y,"f")[t],"f"),$(this,x,!0,"f"),Y(this,S,"f").call(this),q.CmnLib.debugLog){const t=Object.create(null);t.local=Object.keys(Y(this,y,"f")),t.global=Object.keys(Y(this,b,"f")),console.log("🎍 wait event... %o",t)}},A=function(t,e,i=!0){$(this,M,t,"f"),$(this,O,e,"f");const n=e instanceof J.Button?e.getBtnBounds():e.getBounds(),r="link"===t[":タグ名"];if(!r){const t=e.parent.parent;n.x+=t.x,n.y+=t.y}this.setTxtHint(t.hint??"",t.hint_color??"white",t.hint_font??"22px Arial");const h=(0,q.argChk_Num)(t,"hint_width",Y(this,o,"f")),u=h/Y(this,o,"f"),l=(0,q.argChk_Boolean)(t,"hint_tate",!1);Y(this,s,"f").style.left=`${this.sys.ofsLeft4elm+n.x*this.sys.cvsScale}px`,Y(this,s,"f").style.top=`${this.sys.ofsTop4elm+n.y*this.sys.cvsScale}px`,Y(this,s,"f").style.transformOrigin="top left",Y(this,s,"f").style.transform=`rotateZ(${e.rotation+(l?90*Math.PI/180:0)}rad) scale(${u*this.sys.cvsScale}, ${this.sys.cvsScale}) translate(${((l?n.height:n.width)-h)/2/u}px, ${(l?-n.width:0)-Y(this,a,"f")}px)`,Y(this,s,"f").hidden=!1,i&&Y(this,R,"f").call(this,t,e,n,r,h,l)},P=function(t){const e=(0,q.argChk_Boolean)(t,"global",!1),i=Y(this,e?b:y,"f");for(const t in i)Y(this,n,"m",N).call(this,t,i[t]);return $(this,e?b:y,{},"f"),$(this,x,!1,"f"),!1},N=function(t,e){"dom="===t.slice(0,4)&&Y(this,n,"m",k).call(this,t).el.forEach((t=>t.removeEventListener("click",e)))},D=function(t){const e=t.key;if(!e)throw"keyは必須です";const i=e.toLowerCase(),s=(0,q.argChk_Boolean)(t,"call",!1),o=(0,q.argChk_Boolean)(t,"global",!1)?Y(this,b,"f"):Y(this,y,"f");if((0,q.argChk_Boolean)(t,"del",!1)){if(t.fn||t.label||s)throw"fn/label/callとdelは同時指定できません";return Y(this,n,"m",N).call(this,e,o[i]),delete o[i],!1}if(t.fn??=this.scrItr.scriptFn,"dom="===e.slice(0,4)){const i=Y(this,n,"m",k).call(this,e);if(0===i.el.length){if((0,q.argChk_Boolean)(t,"need_err",!0))throw`HTML内にセレクタ(${i.sel})に対応する要素が見つかりません。存在しない場合を許容するなら、need_err=false と指定してください`;return!1}let s=["click","keydown"];switch(i.el[0].type??""){case"checkbox":case"range":s=["input"];break;case"text":case"textarea":s=["input","change"]}s.forEach(((t,s)=>i.el.forEach((o=>{Y(this,r,"f").add(o,t,(n=>{if(!Y(this,x,"f")||this.layMng.getFrmDisabled(i.id))return;if("keydown"===t&&"Enter"!==n.key)return;const r=o.dataset;for(const t in r)r.hasOwnProperty(t)&&this.val.setVal_Nochk("tmp",`sn.event.domdata.${t}`,r[t]);this.fire(e,n)})),0===s&&Y(this,c,"f").add(o,(()=>!!Y(this,n,"m",L).call(this,o)&&(o.focus(),!0)),(()=>{}))}))))}return o[i]=()=>this.main.resumeByJumpOrCall(t),!1},L=function(t){if(null===t.offsetParent)return!1;let e=t;do{if("none"===getComputedStyle(e).display||"false"===e.dataset.focus||e?.disabled)return!1;e=e.parentElement}while(null!==e);return!0},k=function(t){const e=t.indexOf(":");let i="";if(e>=0){const n=t.slice(4,e),r=`const.sn.frm.${n}`;if(!this.val.getVal(`tmp:${r}`,0))throw`HTML【${n}】が読み込まれていません`;const s=document.getElementById(n).contentWindow;return i=t.slice(e+1),{el:s.document.querySelectorAll(i),id:n,sel:i}}return i=t.slice(4),{el:document.querySelectorAll(i),id:"",sel:i}},F=function(t){if(this.scrItr.skip4page)return!1;if(!this.val.getVal("tmp:sn.tagL.enabled"))return Y(this,B,"f").call(this),!1;if(this.val.getVal("tmp:sn.skip.enabled"))if(this.val.getVal("tmp:sn.skip.all")||this.scrItr.isNextKidoku){if("ps".includes(this.val.getVal("sys:sn.skip.mode")))return!1}else Y(this,U,"f").call(this);return this.val.getVal("tmp:sn.auto.enabled")?Y(this,n,"m",H).call(this,{time:Number(this.scrItr.isKidoku?this.val.getVal("sys:sn.auto.msecLineWait_Kidoku"):this.val.getVal("sys:sn.auto.msecLineWait"))}):((0,q.argChk_Boolean)(t,"visible",!0)&&this.layMng.breakLine(),Y(this,n,"m",w).call(this,(()=>this.main.resume())),!0)},G=function(t){if(this.scrItr.recodePage(),this.val.getVal("tmp:sn.skip.enabled"))if(this.val.getVal("tmp:sn.skip.all")||this.scrItr.isNextKidoku){if("s"==this.val.getVal("sys:sn.skip.mode"))return Y(this,B,"f").call(this),!1}else Y(this,U,"f").call(this);if(this.val.getVal("tmp:sn.auto.enabled"))return Y(this,n,"m",H).call(this,{time:Number(this.scrItr.isKidoku?this.val.getVal("sys:sn.auto.msecPageWait_Kidoku"):this.val.getVal("sys:sn.auto.msecPageWait"))});(0,q.argChk_Boolean)(t,"visible",!0)&&this.layMng.breakPage();const e=()=>{this.sndMng.clearCache(),this.main.resume()};return Y(this,n,"m",w).call(this,(0,q.argChk_Boolean)(t,"er",!1)&&this.layMng.currentTxtlayFore?()=>{this.hTag.er(t),e()}:e),!0},j=function(){return $(this,U,(()=>($(this,U,(()=>!1),"f"),this.val.setVal_Nochk("tmp","sn.tagL.enabled",!0),this.val.setVal_Nochk("tmp","sn.skip.enabled",!1),this.val.setVal_Nochk("tmp","sn.auto.enabled",!1),this.layMng.setNormalChWait(),Y(this,z,"f").call(this),!0)),"f"),!1},X=function(t){const{add:e,del:i,to:r}=t;if("dom="===e?.slice(0,4)){const i=Y(this,n,"m",k).call(this,e);if(0===i.el.length&&(0,q.argChk_Boolean)(t,"need_err",!0))throw`HTML内にセレクタ(${i.sel})に対応する要素が見つかりません。存在しない場合を許容するなら、need_err=false と指定してください`;return i.el.forEach((t=>Y(this,c,"f").add(t,(()=>!!Y(this,n,"m",L).call(this,t)&&(t.focus(),!0)),(()=>{})))),!1}if("dom="===i?.slice(0,4)){const e=Y(this,n,"m",k).call(this,i);if(0===e.el.length&&(0,q.argChk_Boolean)(t,"need_err",!0))throw`HTML内にセレクタ(${e.sel})に対応する要素が見つかりません。存在しない場合を許容するなら、need_err=false と指定してください`;return e.el.forEach((t=>Y(this,c,"f").remove(t))),!1}if(!r)throw"[set_focus] add か to は必須です";switch(r){case"null":Y(this,c,"f").blur();break;case"next":Y(this,c,"f").next();break;case"prev":Y(this,c,"f").prev()}return!1},H=function(t){const e=(0,q.argChk_Num)(t,"time",NaN);if(this.scrItr.skip4page)return!1;if(this.val.getVal("tmp:sn.skip.enabled"))return this.val.getVal("tmp:sn.skip.all")||this.scrItr.isNextKidoku||Y(this,U,"f").call(this),!1;this.val.getVal("tmp:sn.auto.enabled")&&$(this,z,(()=>{this.scrItr.subIdxToken(),i.end()}),"f");const i=new tt.Tween({}).to({},e).onComplete((()=>{$(this,z,(()=>{}),"f"),i.stop(),this.main.resume()})).start();return this.waitEvent((()=>i.end()),(0,q.argChk_Boolean)(t,"canskip",!0),(0,q.argChk_Boolean)(t,"global",!1))},W=function(){return!this.scrItr.skip4page&&((this.val.getVal("tmp:sn.skip.enabled")||this.val.getVal("tmp:sn.auto.enabled"))&&Y(this,U,"f").call(this),Y(this,n,"m",w).call(this,(()=>this.main.resume())),!0)}},5455:function(t,e,i){"use strict";var n,r,s,o,a,h,u=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},l=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.FocusMng=void 0;const c=i(4965),f=i(6841);e.FocusMng=class{constructor(){n.add(this),r.set(this,[]),s.set(this,-1),a.set(this,c.CmnLib.debugLog?t=>console.log(`👾 <FocusMng idx:${t} btn:%o`,u(this,r,"f")[t].btn):()=>{})}destroy(){l(this,r,[],"f"),l(this,s,-1,"f")}add(t,e,i){if(u(this,r,"f").findIndex((e=>e.btn===t))>=0)return;if(t instanceof f.Container)return t.on("pointerdown",(()=>{for(let e=u(this,r,"f").length-1;e>=0;--e)if(u(this,r,"f")[e].btn===t)return void l(this,s,e,"f");l(this,s,-1,"f")})),void u(this,r,"f").push({btn:t,on:e,off:i});t.addEventListener("focus",(()=>{for(let e=u(this,r,"f").length-1;e>=0;--e)if(u(this,r,"f")[e].btn===t)return void l(this,s,e,"f");l(this,s,-1,"f")}));let a=t=>{},h="button"===t.localName||"a"===t.localName?t=>!t.isTrusted&&"Enter"===t.key:t=>"Enter"===t.key;const c=t;switch(c.type??""){case"checkbox":a=()=>c.checked=!c.checked;break;case"":t.querySelectorAll("input[type]").length>0&&(a=e=>u(this,n,"m",o).call(this,t,e.key),h=()=>!1);break;case"range":a=t=>{t.isTrusted||("ArrowUp"===t.key?c.stepUp():c.stepDown())};break;case"text":case"textarea":a=t=>{if(t.isTrusted)return;let e=(c.selectionStart??0)+("ArrowUp"===t.key?-1:1);e<0&&(e=0),c.setSelectionRange(e,e)}}t.addEventListener("keydown",(e=>{"ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"Enter"!==e.key||(e.stopPropagation(),e.stopImmediatePropagation(),h(e)?t.dispatchEvent(new MouseEvent("click")):a(e))}),{passive:!0}),t.hasAttribute("tabindex")||(t.tabIndex=0),u(this,r,"f").push({btn:t,on:e,off:i})}remove(t){var e;const i=u(this,r,"f").findIndex((e=>e.btn===t));i<0||(u(this,r,"f").splice(i,1),0===u(this,r,"f").length?l(this,s,-1,"f"):i<=u(this,s,"f")&&l(this,s,(e=u(this,s,"f"),--e),"f"))}isFocus(t){return!(u(this,s,"f")<0)&&u(this,r,"f")[u(this,s,"f")].btn===t}prev(){var t;u(this,n,"m",h).call(this);const e=u(this,r,"f").length;if(0!==e){l(this,s,(t=u(this,s,"f"),--t),"f")<0&&l(this,s,e-1,"f");for(let t=e;t>=1;--t){const i=(u(this,s,"f")+t)%e;if(u(this,r,"f")[i].on())return l(this,s,i,"f"),void u(this,a,"f").call(this,i)}l(this,s,-1,"f")}}next(){var t;u(this,n,"m",h).call(this);const e=u(this,r,"f").length;if(0!==e){l(this,s,(t=u(this,s,"f"),++t),"f")>=e&&l(this,s,0,"f");for(let t=0;t<e;++t){const i=(u(this,s,"f")+t)%e;if(u(this,r,"f")[i].on())return l(this,s,i,"f"),void u(this,a,"f").call(this,i)}l(this,s,-1,"f")}}getFocus(){if(u(this,s,"f")<0)return;u(this,n,"m",h).call(this),u(this,s,"f")>=u(this,r,"f").length&&l(this,s,0,"f");const t=u(this,r,"f")[u(this,s,"f")];return t.on()?t.btn:void 0}blur(){u(this,n,"m",h).call(this),l(this,s,-1,"f"),globalThis.focus()}},r=new WeakMap,s=new WeakMap,a=new WeakMap,n=new WeakSet,o=function(t,e){const i=t.querySelectorAll("input[type]"),n=i.length;for(let t=0;t<n;++t)if(i[t].checked){i[(t+n+("ArrowUp"===e?-1:1))%n].checked=!0;break}},h=function(){for(let t=u(this,r,"f").length-1;t>=0;--t){const e=u(this,r,"f")[t];e.btn instanceof f.Container&&!e.btn.parent?u(this,r,"f").splice(t,1):e.off()}}},9552:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},g=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.FrameMng=void 0;const m=i(4965),v=i(8566),_=i(3422),y=i(7007),b=i(6194),E=i(6841);e.FrameMng=class{constructor(t,e,i,h,g,m,v){this.cfg=t,this.appPixi=i,this.val=h,this.main=g,this.sys=m,this.hTwInf=v,n.add(this),r.set(this,void 0),s.set(this,Object.create(null)),a.set(this,{}),c.set(this,1),e.add_frame=t=>p(this,n,"m",o).call(this,t),e.let_frame=t=>p(this,n,"m",u).call(this,t),e.set_frame=t=>p(this,n,"m",l).call(this,t),e.frame=t=>p(this,n,"m",f).call(this,t),e.tsy_frame=t=>p(this,n,"m",d).call(this,t)}setEvtMng(t){g(this,r,t,"f")}destroy(){for(const t in p(this,s,"f")){const e=p(this,s,"f")[t];e.parentElement.removeChild(e)}g(this,s,Object.create(null),"f")}getFrmDisabled(t){return p(this,a,"f")[t]}cvsResize(){for(const t in p(this,s,"f")){const e=p(this,s,"f")[t],i="const.sn.frm."+t,n=Number(this.val.getVal(i+".x")),r=Number(this.val.getVal(i+".y")),o=Number(this.val.getVal(i+".width")),a=Number(this.val.getVal(i+".height"));e.style.left=`${this.sys.ofsLeft4elm+n*this.sys.cvsScale}px`,e.style.top=`${this.sys.ofsTop4elm+r*this.sys.cvsScale}px`,e.width=String(o*this.sys.cvsScale),e.height=String(a*this.sys.cvsScale)}}},r=new WeakMap,s=new WeakMap,a=new WeakMap,c=new WeakMap,n=new WeakSet,o=function(t){const{id:e,src:i,alpha:o=1,scale_x:u=1,scale_y:l=1,rotate:c=0}=t;if(!e)throw"idは必須です";if(!i)throw"srcは必須です";const f="const.sn.frm."+e;if(this.val.getVal(`tmp:${f}`))throw`frame【${e}】はすでにあります`;const d=(0,m.argChk_Boolean)(t,"visible",!0),g=t.b_color?` background-color: ${t.b_color};`:"",v=p(this,n,"m",h).call(this,t);this.appPixi.view.insertAdjacentHTML("beforebegin",`<iframe id="${e}" sandbox="allow-scripts allow-same-origin" style="opacity: ${o}; position: absolute; left:${this.sys.ofsLeft4elm+v.x*this.sys.cvsScale}px; top: ${this.sys.ofsTop4elm+v.y*this.sys.cvsScale}px; z-index: 1; ${g} border: 0px; overflow: hidden; display: ${d?"inline":"none"}; transform: scale(${u}, ${l}) rotate(${c}deg);" width="${v.width*this.sys.cvsScale}" height="${v.height*this.sys.cvsScale}"></iframe>`);const b=this.cfg.searchPath(i,_.Config.EXT_HTML),x=(new E.Loader).add({name:i,url:b,xhrType:E.LoaderResource.XHR_RESPONSE_TYPE.TEXT});return this.sys.crypto&&x.use(((t,e)=>{try{t.data=this.sys.decStr(t.extension,t.data)}catch(e){this.main.errScript(`[add_frame]Html ロード失敗です src:${t.name} ${e}`,!1)}e?.()})),x.load(((t,n)=>{const h=document.getElementById(e);p(this,s,"f")[e]=h,p(this,a,"f")[e]=!1,h.srcdoc=String(n[i]?.data).replace("sn_repRes();","").replace(/\s(?:src|href)=(["'])(\S+)\1/g,((t,e,i)=>"../"===i.slice(0,3)?this.sys.cur+i.slice(4):t.replace(e,e+b.slice(0,b.lastIndexOf("/")+1)))),h.onload=()=>{this.val.setVal_Nochk("tmp",f,!0),this.val.setVal_Nochk("tmp",f+".alpha",o),this.val.setVal_Nochk("tmp",f+".x",v.x),this.val.setVal_Nochk("tmp",f+".y",v.y),this.val.setVal_Nochk("tmp",f+".scale_x",u),this.val.setVal_Nochk("tmp",f+".scale_y",l),this.val.setVal_Nochk("tmp",f+".rotate",c),this.val.setVal_Nochk("tmp",f+".width",v.width),this.val.setVal_Nochk("tmp",f+".height",v.height),this.val.setVal_Nochk("tmp",f+".visible",d);const t=h.contentWindow;p(this,r,"f").resvFlameEvent(t),t.sn_repRes?.((t=>y.GrpLayer.loadPic2Img(t.dataset.src??"",t))),this.main.resume()}})),!0},h=function(t){const e={...t},i=this.sys.resolution;return new DOMRect((0,m.argChk_Num)(e,"x",0)*i,(0,m.argChk_Num)(e,"y",0)*i,(0,m.argChk_Num)(e,"width",m.CmnLib.stageW)*i,(0,m.argChk_Num)(e,"height",m.CmnLib.stageH)*i)},u=function(t){const{id:e,var_name:i}=t;if(!e)throw"idは必須です";const n=document.getElementById(e);if(!n)throw`id【${e}】はフレームではありません`;const r="const.sn.frm."+e;if(!this.val.getVal(`tmp:${r}`))throw`frame【${e}】が読み込まれていません`;if(!i)throw"var_nameは必須です";const s=n.contentWindow;if(!s.hasOwnProperty(i))throw`frame【${e}】に変数/関数【${i}】がありません。変数は var付きにして下さい`;const o=s[i];return this.val.setVal_Nochk("tmp",r+"."+i,(0,m.argChk_Boolean)(t,"function",!1)?o():o),!1},l=function(t){const{id:e,var_name:i,text:n}=t;if(!e)throw"idは必須です";const r=document.getElementById(e);if(!r)throw`id【${e}】はフレームではありません`;const s="const.sn.frm."+e;if(!this.val.getVal(`tmp:${s}`))throw`frame【${e}】が読み込まれていません`;if(!i)throw"var_nameは必須です";if(!n)throw"textは必須です";return this.val.setVal_Nochk("tmp",s+"."+i,n),r.contentWindow[i]=n,!1},f=function(t){var e,i;const{id:r}=t;if(!r)throw"idは必須です";const s=document.getElementById(r);if(!s)throw`id【${r}】はフレームではありません`;const o="const.sn.frm."+r;if(!this.val.getVal("tmp:"+o))throw`frame【${r}】が読み込まれていません`;const u=s.style;if((0,m.argChk_Boolean)(t,"float",!1)?u.zIndex=`${g(this,c,(e=p(this,c,"f"),++e),"f")}`:"index"in t?u.zIndex=`${(0,m.argChk_Num)(t,"index",0)}`:t.dive&&(u.zIndex=`-${g(this,c,(i=p(this,c,"f"),++i),"f")}`),"alpha"in t){const e=u.opacity=String(t.alpha);this.val.setVal_Nochk("tmp",o+".alpha",e)}const l=p(this,n,"m",h).call(this,t);if(("x"in t||"y"in t)&&(u.left=`${this.sys.ofsLeft4elm+l.x*this.sys.cvsScale}px`,u.top=`${this.sys.ofsTop4elm+l.y*this.sys.cvsScale}px`,this.val.setVal_Nochk("tmp",o+".x",l.x),this.val.setVal_Nochk("tmp",o+".y",l.y)),"scale_x"in t||"scale_y"in t||"rotate"in t){const e=(0,m.argChk_Num)(t,"scale_x",1),i=(0,m.argChk_Num)(t,"scale_y",1),n=(0,m.argChk_Num)(t,"rotate",0);u.transform=`scale(${e}, ${i}) rotate(${n}deg)`,this.val.setVal_Nochk("tmp",o+".scale_x",e),this.val.setVal_Nochk("tmp",o+".scale_y",i),this.val.setVal_Nochk("tmp",o+".rotate",n)}if("width"in t&&(s.width=String(l.width*this.sys.cvsScale),this.val.setVal_Nochk("tmp",o+".width",l.width)),"height"in t&&(s.height=String(l.height*this.sys.cvsScale),this.val.setVal_Nochk("tmp",o+".height",l.height)),"visible"in t){const e=(0,m.argChk_Boolean)(t,"visible",!0);u.display=e?"inline":"none",this.val.setVal_Nochk("tmp",o+".visible",e)}if("b_color"in t&&(u.backgroundColor=t.b_color),"disabled"in t){const e=p(this,a,"f")[r]=(0,m.argChk_Boolean)(t,"disabled",!0);s.contentDocument.body.querySelectorAll("input,select").forEach((t=>t.disabled=e))}return!1},d=function(t){const{id:e}=t;if(!e)throw"idは必須です";const i=document.getElementById(e);if(!i)throw`id【${e}】はフレームではありません`;const s="const.sn.frm."+e;if(!this.val.getVal(`tmp:${s}`,0))throw`frame【${e}】が読み込まれていません`;const o={};"alpha"in t&&(o.a=i.style.opacity),("x"in t||"y"in t||"scale_x"in t||"scale_y"in t||"rotate"in t)&&(o.x=Number(this.val.getVal(`tmp:${s}.x`)),o.y=Number(this.val.getVal(`tmp:${s}.y`)),o.sx=Number(this.val.getVal(`tmp:${s}.scale_x`)),o.sy=Number(this.val.getVal(`tmp:${s}.scale_y`)),o.r=Number(this.val.getVal(`tmp:${s}.rotate`))),"width"in t&&(o.w=this.val.getVal(`tmp:${s}.width`)),"height"in t&&(o.h=this.val.getVal(`tmp:${s}.height`));const a=(0,m.cnvTweenArg)(t,o),u={},l=(0,m.argChk_Num)(t,"repeat",1);let c=()=>{};"alpha"in t&&(u.a=(0,m.argChk_Num)(a,"alpha",0),c=()=>{i.style.opacity=o.a,this.val.setVal_Nochk("tmp","alpha",o.a)});let f=()=>{};const d=p(this,n,"m",h).call(this,a);("x"in t||"y"in t||"scale_x"in t||"scale_y"in t||"rotate"in t)&&(u.x=d.x,u.y=d.y,u.sx=(0,m.argChk_Num)(a,"scale_x",1),u.sy=(0,m.argChk_Num)(a,"scale_y",1),u.r=(0,m.argChk_Num)(a,"rotate",0),f=()=>{i.style.left=this.sys.ofsLeft4elm+o.x*this.sys.cvsScale+"px",i.style.top=this.sys.ofsTop4elm+o.y*this.sys.cvsScale+"px",i.style.transform=`scale(${o.sx}, ${o.sy}) rotate(${o.r}deg)`,this.val.setVal_Nochk("tmp",s+".x",o.x),this.val.setVal_Nochk("tmp",s+".y",o.y),this.val.setVal_Nochk("tmp",s+".scale_x",o.sx),this.val.setVal_Nochk("tmp",s+".scale_y",o.sy),this.val.setVal_Nochk("tmp",s+".rotate",o.r)});let g=()=>{};"width"in t&&(u.w=d.width,g=()=>{i.width=o.w*this.sys.cvsScale+"px",this.val.setVal_Nochk("tmp",s+".width",o.w)});let _=()=>{};"height"in t&&(u.h=d.height,_=()=>{i.height=o.h*this.sys.cvsScale+"px",this.val.setVal_Nochk("tmp",s+".height",o.h)}),this.appPixi.stage.interactive=!1;const y=`frm\n${t.id}`,E=new b.Tween(o).to(u,(0,m.argChk_Num)(t,"time",NaN)*(Boolean(this.val.getVal("tmp:sn.skip.enabled")||p(this,r,"f").isSkippingByKeyDown())?0:1)).delay((0,m.argChk_Num)(t,"delay",0)).easing(v.CmnTween.ease(t.ease)).repeat(0===l?1/0:l-1).yoyo((0,m.argChk_Boolean)(t,"yoyo",!1)).onUpdate((()=>{c(),f(),g(),_()})).onComplete((()=>{this.appPixi.stage.interactive=!0;const t=this.hTwInf[y];t&&(delete this.hTwInf[y],t.tw?.stop(),t.resume&&this.main.resume(),t.onEnd?.())}));if("chain"in t){const e=this.hTwInf[t.chain??""];if(!e||!e.tw)throw`${t.chain}は存在しない・または終了したトゥイーンです`;delete e.onEnd,e.tw.chain(E)}else E.start();return this.hTwInf[y]={tw:E,resume:!1},!1}},5785:function(t,e,i){"use strict";var n,r,s,o,a,h=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},u=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.Grammar=e.splitAmpersand=e.tagToken2Name=e.tagToken2Name_Args=e.REG_TAG=void 0;const l=i(8911);e.REG_TAG=/(?<name>[^\s;\]]+)/,e.tagToken2Name_Args=function(t){const i=e.REG_TAG.exec(t.slice(1,-1))?.groups;if(!i)throw`タグ記述【${t}】異常です(タグ解析)`;const n=i.name;return[n,t.slice(1+n.length,-1)]},e.tagToken2Name=function(t){const i=e.REG_TAG.exec(t.slice(1))?.groups;if(!i)throw`タグ記述【${t}】異常です(タグ解析)`;return i.name},e.splitAmpersand=function(t){const e=t.replaceAll("==","=").replaceAll("!=","≠").split("="),i=e.length;if(i<2||i>3)throw"「&計算」書式では「=」指定が一つか二つ必要です";if("&"===e[1].charAt(0))throw"「&計算」書式では「&」指定が不要です";return{name:e[0].replaceAll("=","==").replaceAll("≠","!="),text:e[1].replaceAll("=","==").replaceAll("≠","!="),cast:3===i?e[2].trim():void 0}},e.Grammar=class{constructor(){n.set(this,void 0),r.set(this,new RegExp("")),s.set(this,""),o.set(this,""),a.set(this,void 0),this.replaceScr_C2M_And_let_ml=(t,e=0)=>{if(h(this,a,"f")){for(let i=t.len-1;i>=e;--i){const e=t.aToken[i];if(this.REG_TOKEN_NOTXT.lastIndex=0,this.REG_TOKEN_NOTXT.test(e.charAt(0)))continue;const n=t.aLNum[i],s=e.match(h(this,r,"f"));if(!s)continue;let o=1;for(let e=s.length-1;e>=0;--e){let r=s[e];const u=h(this,a,"f")[r.charAt(0)];u&&(r=u+("]"===u.slice(-1)?"":`'${r.slice(1,-1)}']`)),t.aToken.splice(i,o,r),t.aLNum.splice(i,o,n),o=0}}t.len=t.aToken.length}},this.setEscape("")}setEscape(t){if(h(this,a,"f")&&t in h(this,a,"f"))throw"[エスケープ文字] char【"+t+"】が登録済みの括弧マクロまたは一文字マクロです";const e=t??"\\";this.REG_TOKEN=new RegExp((t?`\\${t}\\S|`:"")+"\\n+|\\t+|\\[let_ml\\s+[^\\]]+\\].+?(?=\\[endlet_ml[\\]\\s])|\\[(?:[^\"'#;\\]]+|"+(e?`(?:"(?:\\${e}["'#\\n]|[^"])*"|'(?:\\${e}["'#\\n]|[^'])*'|\\#(?:\\${e}["'#\\n]|[^#])*\\#)`:"([\"'#]).*?\\1")+"|;[^\\n]*)*?]|;[^\\n]*|&[^&\\n]+&|&&?[^;\\n\\t&]+|^\\*\\w+"+`|[^\\n\\t\\[;${t?`\\${t}`:""}]+`,"gs"),l.RubySpliter.setEscape(t),u(this,n,new RegExp(`[\\w\\s;[\\]*=&|《》${t?`\\${t}`:""}]`),"f"),this.REG_TOKEN_NOTXT=new RegExp(`[\\n\\t;\\[*&${t?`\\${t}`:""}]`)}bracket2macro(t,e,i){const{name:r,text:s}=t;if(!r)throw"[bracket2macro] nameは必須です";if(!s)throw"[bracket2macro] textは必須です";if(2!==s.length)throw"[bracket2macro] textは括弧の前後を示す二文字を指定してください";u(this,a,h(this,a,"f")??{},"f");const o=s.charAt(0),l=s.charAt(1);if(o in h(this,a,"f"))throw"[bracket2macro] text【"+o+"】が登録済みの括弧マクロまたは一文字マクロです";if(l in h(this,a,"f"))throw"[bracket2macro] text【"+l+"】が登録済みの括弧マクロまたは一文字マクロです";if(h(this,n,"f").lastIndex=0,h(this,n,"f").test(o))throw"[bracket2macro] text【"+o+"】は括弧マクロに使用できない文字です";if(h(this,n,"f").lastIndex=0,h(this,n,"f").test(l))throw"[bracket2macro] text【"+l+"】は括弧マクロに使用できない文字です";h(this,a,"f")[l]="0",h(this,a,"f")[o]=`[${r} text=`,this.addC2M(`\\${o}[^\\${l}]*\\${l}`,`\\${o}\\${l}`),this.replaceScr_C2M_And_let_ml(e,i)}char2macro(t,e,i,r){const{char:s,name:o}=t;if(!s)throw"[char2macro] charは必須です";if(u(this,a,h(this,a,"f")??{},"f"),s in h(this,a,"f"))throw"[char2macro] char【"+s+"】が登録済みの括弧マクロまたは一文字マクロです";if(h(this,n,"f").lastIndex=0,h(this,n,"f").test(s))throw"[char2macro] char【"+s+"】は一文字マクロに使用できない文字です";if(!o)throw"[char2macro] nameは必須です";if(!(o in e))throw`[char2macro] 未定義のタグ又はマクロ[${o}]です`;h(this,a,"f")[s]=`[${o}]`,this.addC2M(`\\${s}`,`\\${s}`),this.replaceScr_C2M_And_let_ml(i,r)}addC2M(t,e){u(this,s,h(this,s,"f")+`${t}|`,"f"),u(this,o,h(this,o,"f")+`${e}`,"f"),u(this,r,new RegExp(`(${h(this,s,"f")}[^${h(this,o,"f")}]+)`,"g"),"f")}},n=new WeakMap,r=new WeakMap,s=new WeakMap,o=new WeakMap,a=new WeakMap},7007:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x,T,w,S,A,M,O=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},R=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.GrpLayer=void 0;const C=i(1481),I=i(4965),P=i(3422),N=i(6841),D=i(5097),L=i(4412);class k extends C.Layer{constructor(){super(),d.set(this,new L.GrpLayDesignCast(this.spLay,this)),p.set(this,""),g.set(this,""),m.set(this,""),this.lay=t=>this.laySub(t,(t=>{t&&O(k,n,"f",o).resume()})),v.set(this,0),_.set(this,0),T.set(this,void 0),w.set(this,void 0),S.set(this,(()=>{})),this.record=()=>Object.assign(super.record(),{sBkFn:O(this,g,"f"),sBkFace:O(this,m,"f"),idc_hArg:O(this,d,"f").gethArg()}),this.dump=()=>super.dump()+`, "pic":"${O(this,p,"f")}"`,I.CmnLib.isDbg&&(this.setSp=t=>O(this,d,"f").setSp(t),this.cvsResize=()=>{super.cvsResize(),O(this,d,"f").cvsResize()})}static init(t,e,i,r,s){R(k,n,t,"f",o),R(k,n,e,"f",a),R(k,n,i,"f",h),R(k,n,r,"f",u);const f=()=>{const t=O(k,n,"f",l)*O(k,n,"f",c);for(const e in k.hFn2VElm)k.hFn2VElm[e].volume=t};s.setNoticeChgVolume((t=>{R(k,n,t,"f",l),f()}),(t=>{R(k,n,t,"f",c),f()})),O(k,n,"f",u).crypto&&R(k,n,O(k,n,"m",E),"f",y)}static setEvtMng(t){R(k,n,t,"f",f)}static destroy(){O(k,n,"f",r).clear(),R(k,n,{},"f",s),k.hFn2ResAniSpr={},k.hFn2VElm={}}setSp(t){}laySub(t,e){const{fn:i,face:n=""}=t;if(O(this,d,"f").sethArg(t),!i)return super.lay(t),this.spLay.children.length>0&&this.setPos(t),R(this,g,"","f"),R(this,p,R(this,m,n,"f"),"f"),e(!1),!1;const r="fn"in t,s="face"in t;this.clearLay({filter:"true"}),r&&R(this,g,i,"f"),s&&R(this,m,n,"f"),super.lay(t),t.dx=0,t.dy=0;const o=k.csv2Sprites(R(this,p,i+(n?","+n:""),"f"),this.spLay,(e=>{("width"in t||"height"in t)&&(e.width=(0,I.argChk_Num)(t,"width",0),e.height=(0,I.argChk_Num)(t,"height",0)),R(this,v,e.width,"f"),R(this,_,e.height,"f"),C.Layer.setXY(e,t,this.spLay,!0),this.setSp(e)}),(i=>{C.Layer.setBlendmode(this.spLay,t),e(i)}));return o||e(!1),o}get width(){return O(this,v,"f")}get height(){return O(this,_,"f")}static csv2Sprites(t,e,i,r=(()=>{})){let h=!1;if("data:"===t.slice(0,5)){const n=()=>{const n=N.Sprite.from(t);e?.addChild(n),i(n),r(h)};return t in N.utils.TextureCache?n():(h=!0,(new N.Loader).add(t,t).load(n)),h}const l=[],c=new N.Loader;t.split(",").forEach(((t,e)=>{if(!t)throw"face属性に空要素が含まれます";const r=O(k,n,"f",s)[t]||{fn:t,dx:0,dy:0,blendmode:N.BLEND_MODES.NORMAL},o=0===e?i:t=>{t.x=r.dx,t.y=r.dy,t.blendMode=r.blendmode};if(l.push({fn:r.fn,fnc:o}),r.fn in k.hFn2ResAniSpr)return;if(r.fn in N.utils.TextureCache)return;if(r.fn in N.Loader.shared.resources)return;h=!0;const f=O(k,n,"f",a).searchPath(r.fn,P.Config.EXT_SPRITE),d=O(this,n,"f",u).crypto?{xhrType:".json"===f.slice(-5)?N.LoaderResource.XHR_RESPONSE_TYPE.TEXT:N.LoaderResource.XHR_RESPONSE_TYPE.BUFFER}:{};c.add({...d,name:r.fn,url:f})}));const f=t=>{for(const i of l){const r=O(k,n,"m",x).call(k,i.fn,t);r.name=i.fn,e?.addChild(r),i.fnc(r)}r(h)};return h?c.use(((t,e)=>{O(this,n,"f",u).dec(t.extension,t.data).then((i=>O(k,n,"f",y).call(k,i,t,(()=>e?.())))).catch((e=>O(this,n,"f",o).errScript(`Graphic ロード失敗です fn:${t.name} ${e}`,!1)))})).load(((t,e)=>f(e))):f({}),h}static wv(t){const{fn:e}=t;if(!e)throw"fnは必須です";const i=k.hFn2VElm[e];if(!i||i.loop)return!1;if(i.ended)return delete k.hFn2VElm[e],!1;const r=()=>{i.removeEventListener("ended",r),delete k.hFn2VElm[e],O(this,n,"f",o).resume()};return i.addEventListener("ended",r,{once:!0,passive:!0}),O(k,n,"f",f).waitEvent((()=>{i.pause(),r()}),(0,I.argChk_Boolean)(t,"canskip",!0),(0,I.argChk_Boolean)(t,"global",!1))}renderStart(){R(this,T,N.RenderTexture.create({width:I.CmnLib.stageW,height:I.CmnLib.stageH}),"f"),R(this,w,new N.Sprite(O(this,T,"f")),"f"),O(this,w,"f").visible=!1,this.spLay.addChildAt(O(this,w,"f"),0),O(this,w,"f").position.set(-this.spLay.x,-this.spLay.y);let t=()=>{const t=this.spLay.alpha;this.spLay.alpha=1,this.spLay.children.forEach((t=>t.visible=!0)),O(this,w,"f").visible=!1,O(k,n,"f",h).renderer.render(this.spLay,{renderTexture:O(this,T,"f")}),this.spLay.alpha=t,this.spLay.children.forEach((t=>t.visible=!1))};if(!this.containMovement){let e=t;t=()=>{t=()=>{},e()}}R(this,S,(()=>{t(),O(this,w,"f").visible=!0}),"f"),O(k,n,"f",h).ticker.add(O(this,S,"f"))}renderEnd(){O(k,n,"f",h).ticker.remove(O(this,S,"f")),this.spLay.removeChild(O(this,w,"f")),this.spLay.children.forEach((t=>t.visible=!0)),O(this,w,"f").destroy(!0)}static loadPic2Img(t,e,i){const r=O(this,n,"f",M)[t];if(r)return void(e.src=r);const s=O(this,n,"f",A)[t];if(s)return void s.push(e);O(this,n,"f",A)[t]=[e];const h=O(k,n,"f",a).searchPath(t,P.Config.EXT_SPRITE),l=(new N.Loader).add({name:t,url:h,xhrType:N.LoaderResource.XHR_RESPONSE_TYPE.BUFFER});O(k,n,"f",u).crypto&&l.use(((t,e)=>{O(k,n,"f",u).dec(t.extension,t.data).then((i=>{"bin"===t.extension?(t.data=i,i instanceof HTMLImageElement&&(t.type=N.LoaderResource.TYPE.IMAGE),e?.()):e?.()})).catch((e=>O(k,n,"f",o).errScript(`GrpLayer loadPic ロード失敗です fn:${t.name} ${e}`,!1)))})),l.load(((t,e)=>{for(const t in e){const r=O(this,n,"f",M)[t]=e[t].data.src;O(this,n,"f",A)[t].forEach((t=>{t.src=r,i&&(t.onload=()=>i(t))})),delete O(this,n,"f",A)[t]}}))}setPos(t){C.Layer.setXY(0===this.spLay.children.length?this.spLay:this.spLay.children[0],t,this.spLay,!0)}static add_face(t){const{name:e}=t;if(!e)throw"nameは必須です";if(e in O(k,n,"f",s))throw"一つのname("+e+")に対して同じ画像を複数割り当てられません";const{fn:i=e}=t;return O(k,n,"f",s)[e]={fn:i,dx:(0,I.argChk_Num)(t,"dx",0),dy:(0,I.argChk_Num)(t,"dy",0),blendmode:C.Layer.getBlendmodeNum(t.blendmode||"")},!1}static clearFace2Name(){R(k,n,{},"f",s)}get containMovement(){if(""===O(this,p,"f"))return!1;const t=this.spLay.children;return O(this,p,"f").split(",").some(((e,i)=>t[i]instanceof N.AnimatedSprite||k.hFn2VElm[e]))}clearLay(t){super.clearLay(t);for(const t of this.spLay.removeChildren())t.destroy();R(this,g,"","f"),R(this,m,"","f"),R(this,p,"","f")}playback(t,e){if(super.playback(t,e),""===t.sBkFn&&""===t.sBkFace)return R(this,g,t.sBkFn,"f"),R(this,m,t.sBkFace,"f"),void O(this,d,"f").sethArg(t.idc_hArg);e.push(new Promise((e=>this.laySub({fn:t.sBkFn,face:t.sBkFace,left:t.x,top:t.y,alpha:t.alpha,blendmode:t.blendMode,rotation:t.rotation,scale_x:t.scale_x,scale_y:t.scale_y},(i=>{this.spLay.position.set(t.x,t.y),e()})))))}makeDesignCast(t){this.spLay.visible&&t(O(this,d,"f"))}cvsResize(){super.cvsResize()}showDesignCast(){O(this,d,"f").visible=!0}}e.GrpLayer=k,n=k,d=new WeakMap,p=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,_=new WeakMap,T=new WeakMap,w=new WeakMap,S=new WeakMap,b=function(t){const e=/([^\d]+)\d+\.(\w+)/.exec(t[0]);if(!e)return;const i=e[1].length,n=-e[2].length-1;t.sort(((t,e)=>(0,I.int)(t.slice(i,n))>(0,I.int)(e.slice(i,n))?1:-1))},E=function(t,e,i){if(e.data=t,"bin"===e.extension&&(t instanceof HTMLImageElement?(e.texture=N.Texture.fromLoader(t,e.url,e.name),e.type=N.LoaderResource.TYPE.IMAGE,URL.revokeObjectURL(t.src)):t instanceof HTMLVideoElement&&(t.volume=O(k,n,"f",l),k.hFn2VElm[e.name]=t,e.type=N.LoaderResource.TYPE.VIDEO,URL.revokeObjectURL(t.src))),"json"!==e.extension)return void i();if("string"!=typeof t)return void i();const r=e.data=JSON.parse(t);if(e.type=N.LoaderResource.TYPE.JSON,!r.meta?.image)return void i();const s=(0,I.getFn)(r.meta.image),h=O(k,n,"f",a).searchPath(s,P.Config.EXT_SPRITE);(new N.Loader).use(((t,e)=>{O(this,n,"f",u).dec(t.extension,t.data).then((i=>{t.data=i,i instanceof HTMLImageElement&&(t.type=N.LoaderResource.TYPE.IMAGE,URL.revokeObjectURL(i.src)),e?.()})).catch((e=>O(this,n,"f",o).errScript(`Graphic ロード失敗です dec2res4Cripto fn:${t.name} ${e}`,!1)))})).add({name:s,url:h,xhrType:N.LoaderResource.XHR_RESPONSE_TYPE.BUFFER}).load(((t,s)=>{for(const i in t.resources){const s=N.Texture.from(t.resources[i].data).baseTexture,o=Object.values(r.frames);O(k,n,"m",b).call(k,o),k.hFn2ResAniSpr[e.name]={aTex:o.map((t=>new N.Texture(s,new N.Rectangle(t.frame.x,t.frame.y,t.frame.w,t.frame.h)))),meta:r.meta}}i()}))},x=function(t,e){const i=k.hFn2ResAniSpr[t];if(i){const t=new N.AnimatedSprite(i.aTex);return t.animationSpeed=i.meta.animationSpeed??1,t.play(),t}return t in N.utils.TextureCache?N.Sprite.from(t):t in k.hFn2VElm?N.Sprite.from(k.hFn2VElm[t]):t in e?new N.Sprite(e[t].texture):new N.Sprite},r={value:new D.EventListenerCtn},s={value:{}},o={value:void 0},a={value:void 0},h={value:void 0},u={value:void 0},l={value:1},c={value:1},f={value:void 0},k.hFn2ResAniSpr={},y={value:(t,e,i)=>{switch(e.type){case N.LoaderResource.TYPE.JSON:const t=e.spritesheet._frameKeys;O(k,n,"m",b).call(k,t),k.hFn2ResAniSpr[e.name]={aTex:t.map((t=>N.Texture.from(t))),meta:e.data.meta};break;case N.LoaderResource.TYPE.VIDEO:const i=e.data;i.volume=O(k,n,"f",l),k.hFn2VElm[e.name]=i}i()}},k.hFn2VElm={},A={value:{}},M={value:{}}},1481:function(t,e,i){"use strict";var n,r,s=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};Object.defineProperty(e,"__esModule",{value:!0}),e.Layer=void 0;const o=i(6841),a=i(4965);class h{constructor(){this.layname="",this.name_="",this.spLay=new o.Sprite(o.Texture.EMPTY)}set name(t){this.name_=t}get name(){return this.name_}get alpha(){return this.spLay.alpha}set alpha(t){this.spLay.alpha=t}get height(){return this.spLay.height}get rotation(){return this.spLay.angle}set rotation(t){this.spLay.angle=t}get scale_x(){return this.spLay.scale.x}set scale_x(t){this.spLay.scale.x=t}get scale_y(){return this.spLay.scale.y}set scale_y(t){this.spLay.scale.y=t}get width(){return this.spLay.width}get x(){return this.spLay.x}set x(t){this.spLay.x=t}get y(){return this.spLay.y}set y(t){this.spLay.y=t}destroy(){}lay(t){return"alpha"in t&&(this.spLay.alpha=(0,a.argChk_Num)(t,"alpha",1)),h.setBlendmode(this.spLay,t),("pivot_x"in t||"pivot_y"in t)&&this.spLay.pivot.set((0,a.argChk_Num)(t,"pivot_x",this.spLay.pivot.x),(0,a.argChk_Num)(t,"pivot_y",this.spLay.pivot.y)),"rotation"in t&&(this.spLay.angle=(0,a.argChk_Num)(t,"rotation",0)),("scale_x"in t||"scale_y"in t)&&this.spLay.scale.set((0,a.argChk_Num)(t,"scale_x",this.spLay.scale.x),(0,a.argChk_Num)(t,"scale_y",this.spLay.scale.y)),"visible"in t&&(this.spLay.visible=(0,a.argChk_Boolean)(t,"visible",!0)),!1}static setBlendmode(t,e){const{blendmode:i}=e;if(!i)return;const n=h.getBlendmodeNum(i);t&&(t.blendMode=n),t.children.forEach((t=>{t&&(t.blendMode=n)}))}static getBlendmodeNum(t){if(!t)return o.BLEND_MODES.NORMAL;const e=s(h,n,"f",r)[t];if(void 0!==e)return e;throw`${t} はサポートされない blendmode です`}get containMovement(){return!1}renderStart(){}renderEnd(){}clearLay(t){this.spLay.alpha=1,this.spLay.blendMode=o.BLEND_MODES.NORMAL,this.spLay.pivot.set(0,0),this.spLay.angle=0,this.spLay.scale.set(1,1),(0,a.argChk_Boolean)(t,"filter",!1)&&(this.spLay.filters=[])}copy(t,e){const i=this.name_;this.playback(t.record(),e),this.name=i}record(){return{name:this.name_,idx:this.spLay.parent.getChildIndex(this.spLay),alpha:this.spLay.alpha,blendMode:this.spLay.blendMode,rotation:this.spLay.angle,scale_x:this.spLay.scale.x,scale_y:this.spLay.scale.y,pivot_x:this.spLay.pivot.x,pivot_y:this.spLay.pivot.y,x:this.spLay.x,y:this.spLay.y,visible:this.spLay.visible}}playback(t,e){this.name=t.name,this.clearLay({filter:"true"}),this.spLay.alpha=t.alpha,this.spLay.blendMode=t.blendMode,this.spLay.angle=t.rotation,this.spLay.scale.set(t.scale_x,t.scale_y),this.spLay.pivot.set(t.pivot_x,t.pivot_y),this.spLay.position.set(t.x,t.y),this.spLay.visible=t.visible}snapshot(t,e){t.render(this.spLay,{clear:!1}),e()}snapshot_end(){}makeDesignCast(t){}makeDesignCastChildren(t){}showDesignCast(){}showDesignCastChildren(){}cvsResize(){}cvsResizeChildren(){}dump(){return` "idx":${this.spLay.parent.getChildIndex(this.spLay)}, "visible":"${this.spLay.visible}", "left":${this.spLay.x}, "top":${this.spLay.y}, "alpha":${this.spLay.alpha}, "rotation":${this.spLay.angle}, "name":"${this.name_}", "scale_x":${this.spLay.scale.x}, "scale_y":${this.spLay.scale.y}`}static setXY(t,e,i,n=!1,r=!1){if(e.pos)return void h.setXYByPos(t,e.pos,i);const s=t.getBounds(),o=i.scale.x<0?-i.scale.x:i.scale.x,u=1===o?s.width:s.width*o,l=i.scale.y<0?-i.scale.y:i.scale.y,c=1===l?s.height:s.height*l;let f=i.x;"left"in e?(f=(0,a.argChk_Num)(e,"left",0),f>-1&&f<1&&(f*=a.CmnLib.stageW)):"center"in e?(f=(0,a.argChk_Num)(e,"center",0),f>-1&&f<1&&(f*=a.CmnLib.stageW),f-=(r?u/3:u)/2):"right"in e?(f=(0,a.argChk_Num)(e,"right",0),f>-1&&f<1&&(f*=a.CmnLib.stageW),f-=r?u/3:u):"s_right"in e&&(f=(0,a.argChk_Num)(e,"s_right",0),f>-1&&f<1&&(f*=a.CmnLib.stageW),f=a.CmnLib.stageW-f-(r?u/3:u)),i.x=(0,a.int)(i.scale.x<0?f+(r?u/3:u):f);let d=i.y;"top"in e?(d=(0,a.argChk_Num)(e,"top",0),d>-1&&d<1&&(d*=a.CmnLib.stageH)):"middle"in e?(d=(0,a.argChk_Num)(e,"middle",0),d>-1&&d<1&&(d*=a.CmnLib.stageH),d-=c/2):"bottom"in e?(d=(0,a.argChk_Num)(e,"bottom",0),d>-1&&d<1&&(d*=a.CmnLib.stageH),d-=c):"s_bottom"in e&&(d=(0,a.argChk_Num)(e,"s_bottom",0),d>-1&&d<1&&(d*=a.CmnLib.stageH),d=a.CmnLib.stageH-d-c),i.y=(0,a.int)(i.scale.y<0?d+c:d),n&&("left"in e||"center"in e||"right"in e||"s_right"in e||"top"in e||"middle"in e||"bottom"in e||"s_bottom"in e||h.setXYByPos(t,"c",i))}static setXYByPos(t,e,i){if("stay"===e)return;if(void 0===t)throw"setXYByPos base === undefined";if(void 0===i)throw"setXYByPos result === undefined";const n=t.getBounds(),r=i.scale.x<0?-i.scale.x:i.scale.x,s=1===r?n.width:n.width*r,o=i.scale.y<0?-i.scale.y:i.scale.y,h=1===o?n.height:n.height*o;let u=0;u=e&&"c"!==e?"r"===e?a.CmnLib.stageW-.5*s:"l"===e?.5*s:(0,a.int)(e):.5*a.CmnLib.stageW,i.x=(0,a.int)(u-.5*s),i.y=a.CmnLib.stageH-h,i.scale.x<0&&(i.x+=s),i.scale.y<0&&(i.y+=h)}static setXYCenter(t){const e=t.getBounds();t.x=.5*(a.CmnLib.stageW-e.width),t.y=.5*(a.CmnLib.stageH-e.height)}}e.Layer=h,n=h,r={value:{normal:o.BLEND_MODES.NORMAL,add:o.BLEND_MODES.ADD,multiply:o.BLEND_MODES.MULTIPLY,screen:o.BLEND_MODES.SCREEN}}},5844:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x,T,w,S,A,M,O,R,C,I,P,N,D,L,k,B,F,G,U,j,X,H,z,W,V,Y,$,q,Z,K,J,Q,tt,et,it,nt,rt,st,ot,at,ht,ut,lt,ct,ft,dt,pt,gt,mt,vt,_t,yt,bt,Et,xt=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},Tt=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.LayerMng=void 0;const wt=i(4965),St=i(8566),At=i(4040),Mt=i(7007),Ot=i(1028),Rt=i(8911),Ct=i(7411),It=i(9552),Pt=i(6761),Nt=i(4412),Dt=i(6194),Lt=i(6841);class kt{constructor(t,e,i,r,A,F,G,U,Z,Q){this.cfg=t,this.hTag=e,this.appPixi=i,this.val=r,this.main=A,this.scrItr=F,this.sys=G,this.sndMng=U,this.alzTagArg=Z,this.prpPrs=Q,n.add(this),s.set(this,void 0),o.set(this,new Lt.Container),a.set(this,new Lt.Container),h.set(this,void 0),u.set(this,(()=>(0,Dt.update)())),l.set(this,{attach:t=>(Nt.DesignCast.leaveMode(),!1),continue:t=>(Nt.DesignCast.leaveMode(),!1),disconnect:t=>(Nt.DesignCast.leaveMode(),!1),_enterDesign:t=>(Nt.DesignCast.enterMode(),xt(this,x,"f").forEach((t=>{const e=xt(this,E,"f")[t].fore;e.makeDesignCastChildren((t=>t.make())),e.makeDesignCast((t=>t.make()))})),xt(this,n,"m",d).call(this,xt(this,T,"f")),!1),_replaceToken:(t,e)=>(Nt.DesignCast.replaceToken(e),!1),_selectNode:(t,e)=>(xt(this,n,"m",d).call(this,e.node),!1)}),c.set(this,""),f.set(this,""),this.getFrmDisabled=t=>xt(this,h,"f").getFrmDisabled(t),p.set(this,void 0),g.set(this,void 0),v.set(this,((t,e=this.currentTxtlayForeNeedErr,i=!0)=>e.tagCh("| 《"+t+"》"))),this.goTxt=()=>{},this.breakLine=()=>{},this.breakPage=()=>{},E.set(this,{}),x.set(this,[]),T.set(this,""),w.set(this,""),O.set(this,"\nprecision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform sampler2D rule;\nuniform float vague;\nuniform float tick;\n\nuniform vec4 inputPixel;\nuniform highp vec4 outputFrame;\nvec2 getUV(vec2 coord) {\n\treturn coord * inputPixel.xy / outputFrame.zw;\n}\n\nvoid main(void) {\n\tvec4 fg = texture2D(uSampler, vTextureCoord);\n\tvec4 ru = texture2D(rule, getUV(vTextureCoord));\n\n\tfloat v = ru.r - tick;\n\tif (abs(v) < vague) {\n\t\tfloat f_a = fg.a *(0.5 +v /vague *0.5);\n\n\t\tgl_FragColor.rgb = fg.rgb *f_a;\n\t\tgl_FragColor.a = f_a;\n\t}\n\telse {\n\t\tgl_FragColor = (v >= 0.0)? fg : vec4(0);\n\t}\n}"),R.set(this,{rule:Lt.Texture.EMPTY,vague:0,tick:0}),C.set(this,new Lt.Filter(void 0,xt(this,O,"f"),xt(this,R,"f"))),I.set(this,Lt.RenderTexture.create({width:wt.CmnLib.stageW,height:wt.CmnLib.stageH})),P.set(this,new Lt.Sprite(xt(this,I,"f"))),N.set(this,Lt.RenderTexture.create({width:wt.CmnLib.stageW,height:wt.CmnLib.stageH})),D.set(this,new Lt.Sprite(xt(this,N,"f"))),L.set(this,[]),B.set(this,{tw:void 0,resume:!1}),z.set(this,{}),J.set(this,(t=>{throw xt(this,nt,"f").call(this),0})),tt.set(this,(t=>{throw xt(this,nt,"f").call(this),0})),it.set(this,void 0),nt.set(this,(()=>{throw"文字レイヤーがありません。文字表示や操作する前に、[add_lay layer=(レイヤ名) class=txt]で文字レイヤを追加して下さい"})),st.set(this,{text:""}),ot.set(this,[]);const et=()=>{G.cvsResize()&&(this.cvsResizeDesign(),xt(this,f,"f")?xt(this,x,"f").forEach((t=>xt(this,E,"f")[t].fore.cvsResizeChildren())):xt(this,x,"f").forEach((t=>xt(this,E,"f")[t].fore.cvsResize())),xt(this,h,"f").cvsResize(),xt(this,g,"f").cvsResize())};if(wt.CmnLib.isMobile)globalThis.addEventListener("orientationchange",et,{passive:!0});else{let t;globalThis.addEventListener("resize",(()=>{t||(t=setTimeout((()=>{t=void 0,et()}),1e3/60*10))}),{passive:!0})}G.cvsResize(),Ot.TxtLayer.init(t,e,r,(t=>this.recText(t)),(t=>xt(this,E,"f")[t.layname].fore===t),i),Mt.GrpLayer.init(A,t,i,G,U),Pt.Button.init(t),Tt(this,h,new It.FrameMng(this.cfg,this.hTag,this.appPixi,this.val,A,this.sys,xt(this,z,"f")),"f"),G.hFactoryCls.grp=()=>new Mt.GrpLayer,G.hFactoryCls.txt=()=>new Ot.TxtLayer,e.loadplugin=t=>xt(this,n,"m",y).call(this,t),e.snapshot=t=>xt(this,n,"m",_).call(this,t),e.add_lay=t=>xt(this,n,"m",b).call(this,t),e.clear_lay=t=>xt(this,n,"m",M).call(this,t),e.finish_trans=()=>xt(this,n,"m",X).call(this),e.lay=t=>xt(this,n,"m",S).call(this,t),e.trans=t=>xt(this,n,"m",k).call(this,t),e.wt=t=>xt(this,n,"m",j).call(this,t),e.quake=t=>xt(this,n,"m",H).call(this,t),e.stop_quake=t=>e.finish_trans(t),e.wq=t=>e.wt(t),e.pause_tsy=t=>xt(this,n,"m",$).call(this,t),e.resume_tsy=t=>xt(this,n,"m",q).call(this,t),e.stop_tsy=t=>xt(this,n,"m",Y).call(this,t),e.tsy=t=>xt(this,n,"m",W).call(this,t),e.wait_tsy=t=>xt(this,n,"m",V).call(this,t),e.ch=t=>xt(this,n,"m",K).call(this,t),e.clear_text=t=>xt(this,n,"m",at).call(this,t),e.current=t=>xt(this,tt,"f").call(this,t),e.endlink=t=>xt(this,n,"m",ht).call(this,t),e.er=t=>xt(this,n,"m",ut).call(this,t),e.graph=t=>xt(this,n,"m",lt).call(this,t),e.link=t=>xt(this,n,"m",ct).call(this,t),e.r=t=>xt(this,n,"m",ft).call(this,t),e.rec_ch=t=>xt(this,n,"m",pt).call(this,t),e.rec_r=()=>xt(this,n,"m",dt).call(this),e.reset_rec=t=>xt(this,n,"m",gt).call(this,t),e.ruby2=t=>xt(this,n,"m",mt).call(this,t),e.span=t=>xt(this,n,"m",vt).call(this,t),e.tcy=t=>xt(this,n,"m",_t).call(this,t),e.add_face=t=>Mt.GrpLayer.add_face(t),e.wv=t=>Mt.GrpLayer.wv(t),e.dump_lay=t=>xt(this,n,"m",yt).call(this,t),e.enable_event=t=>xt(this,n,"m",bt).call(this,t),e.button=t=>xt(this,n,"m",Et).call(this,t),t.existsBreakline&&(this.breakLine=()=>xt(this,v,"f").call(this,'grp|{"id":"break","pic":"breakline"}')),t.existsBreakpage&&(this.breakPage=()=>xt(this,v,"f").call(this,'grp|{"id":"break","pic":"breakpage"}'));const rt=new Lt.Graphics;rt.beginFill(t.oCfg.init.bg_color,1).lineStyle(0,t.oCfg.init.bg_color).drawRect(0,0,wt.CmnLib.stageW,wt.CmnLib.stageH).endFill(),xt(this,o,"f").addChild(rt.clone()),xt(this,a,"f").addChild(rt),xt(this,a,"f").visible=!1,Tt(this,s,this.appPixi.stage,"f"),xt(this,s,"f").addChild(xt(this,a,"f")),xt(this,s,"f").addChild(xt(this,o,"f")),xt(this,s,"f").addChild(xt(this,P,"f")),xt(this,s,"f").addChild(xt(this,D,"f")),this.appPixi.ticker.add(xt(this,u,"f"));const St=(t,e)=>{xt(this,n,"m",m).call(this,Number(e))};St(0,r.getVal("sys:TextLayer.Back.Alpha",1)),r.defValTrg("sys:TextLayer.Back.Alpha",St);const At=(t,e)=>Pt.Button.fontFamily=e;At(0,r.getVal("tmp:sn.button.fontFamily",Pt.Button.fontFamily)),r.defValTrg("tmp:sn.button.fontFamily",At),r.defTmp("const.sn.log.json",(()=>JSON.stringify(xt(this,st,"f").text?[...xt(this,ot,"f"),xt(this,st,"f")]:xt(this,ot,"f")))),r.defTmp("const.sn.last_page_text",(()=>this.currentTxtlayFore?.pageText??"")),wt.CmnLib.isDbg&&(Nt.DesignCast.init(this.appPixi,G,F,Q,Z,this.cfg,xt(this,E,"f")),this.cvsResizeDesign=()=>Nt.DesignCast.cvsResizeDesign(),G.addHook(((t,e)=>{xt(this,l,"f")[t]?.(t,e)&&delete xt(this,l,"f")[t]})))}cvsResizeDesign(){}cover(t,e=0){xt(this,p,"f")&&(xt(this,s,"f").removeChild(xt(this,p,"f")),xt(this,p,"f").destroy(),Tt(this,p,void 0,"f")),t&&xt(this,s,"f").addChild(Tt(this,p,new Lt.Graphics,"f").beginFill(e).lineStyle(0,e).drawRect(0,0,wt.CmnLib.stageW,wt.CmnLib.stageH).endFill())}setEvtMng(t){Tt(this,g,t,"f"),xt(this,h,"f").setEvtMng(t),Mt.GrpLayer.setEvtMng(t)}before_destroy(){for(const t in xt(this,E,"f"))xt(this,E,"f")[t].destroy()}destroy(){Mt.GrpLayer.destroy(),Rt.RubySpliter.destroy(),Ct.TxtStage.destroy(),xt(this,h,"f").destroy(),this.stopAllTw(),this.appPixi.ticker.remove(xt(this,u,"f")),Tt(kt,r,10,"f",Z)}stopAllTw(){Tt(this,z,{},"f"),(0,Dt.removeAll)()}clearBreak(){this.currentTxtlayFore&&(this.clearBreak=()=>xt(this,v,"f").call(this,"del|break"),this.clearBreak())}clickTxtLay(){if(!this.currentTxtlayFore)return;const t=xt(this,n,"m",F).call(this),e=t.length;for(let i=0;i<e;++i){const e=t[i],n=xt(this,E,"f")[e];if(n.fore instanceof Ot.TxtLayer&&!n.fore.click())break}}static get msecChWait(){return xt(kt,r,"f",Z)}static set msecChWait(t){Tt(kt,r,t,"f",Z)}setNormalChWait(){Tt(kt,r,this.scrItr.normalWait,"f",Z)}get currentTxtlayForeNeedErr(){return xt(this,nt,"f").call(this),this.currentTxtlayFore}get currentTxtlayFore(){if(xt(this,it,"f"))return xt(this,it,"f").fore}recText(t,e=!1){const i=xt(this,st,"f");if(e)return i.text&&(i.text=String(i.text).replaceAll("</span><span class='sn_ch'>",""),xt(this,ot,"f").push(i)>this.cfg.oCfg.log.max_len&&Tt(this,ot,xt(this,ot,"f").slice(-this.cfg.oCfg.log.max_len),"f")),void Tt(this,st,{text:""},"f");i.text=t.replace(/\\`/,"`"),this.val.setVal_Nochk("save","const.sn.sLog",String(this.val.getVal("const.sn.log.json")))}record(){const t={};return xt(this,x,"f").forEach((e=>{const i=xt(this,E,"f")[e];t[e]={cls:i.cls,fore:i.fore.record(),back:i.back.record()}})),t}playback(t,e){Tt(this,ot,JSON.parse(String(this.val.getVal("save:const.sn.sLog"))),"f"),Tt(this,st,{text:""},"f");const i=[],n=[];for(const e in t){const r=t[e];n.push({layer:e,idx:r.fore.idx});const s=xt(this,E,"f")[e]??=new At.Pages(e,r.cls,xt(this,o,"f"),xt(this,a,"f"),{},this.sys,this.val,{isWait:!1});s.fore.playback(r.fore,i),s.back.playback(r.back,i)}const r=xt(this,o,"f").children.length;Promise.allSettled(i).then((()=>{n.sort((function(t,e){return t.idx<e.idx?-1:t.idx>e.idx?1:0})),n.forEach((t=>{const e=xt(this,E,"f")[t.layer];if(!e)return;const i=r>t.idx?t.idx:r-1;xt(this,o,"f").setChildIndex(e.fore.spLay,i),xt(this,a,"f").setChildIndex(e.back.spLay,i)})),e()})).catch((t=>console.error("fn:LayerMng.ts playback e:%o",t)))}}e.LayerMng=kt,r=kt,s=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,u=new WeakMap,l=new WeakMap,c=new WeakMap,f=new WeakMap,p=new WeakMap,g=new WeakMap,v=new WeakMap,E=new WeakMap,x=new WeakMap,T=new WeakMap,w=new WeakMap,O=new WeakMap,R=new WeakMap,C=new WeakMap,I=new WeakMap,P=new WeakMap,N=new WeakMap,D=new WeakMap,L=new WeakMap,B=new WeakMap,z=new WeakMap,J=new WeakMap,tt=new WeakMap,it=new WeakMap,nt=new WeakMap,st=new WeakMap,ot=new WeakMap,n=new WeakSet,d=function(t){var e,i;e=this,i=this,[{set value(t){Tt(e,c,t,"f")}}.value,{set value(t){Tt(i,f,t,"f")}}.value=""]=t.split("/");const n=xt(this,E,"f")[xt(this,c,"f")];n&&(Nt.DesignCast.allHide(),xt(this,f,"f")?n.fore.showDesignCastChildren():n.fore.showDesignCast())},m=function(t){xt(this,n,"m",F).call(this).forEach((e=>{const i=xt(this,E,"f")[e];i.fore instanceof Ot.TxtLayer&&(i.fore.chgBackAlpha(t),i.back.chgBackAlpha(t))}))},_=function(t){const e=t.fn?"userdata:/"===t.fn.slice(0,10)?t.fn:`downloads:/${t.fn+(0,wt.getDateStr)("-","_","","_")}.png`:`downloads:/snapshot${(0,wt.getDateStr)("-","_","","_")}.png`,i=this.cfg.searchPath(e);if(this.sys.canCapturePage(i))return!1;const r=(0,wt.getExt)(i),h=(0,wt.argChk_Color)(t,"b_color",this.cfg.oCfg.init.bg_color),u=(0,Lt.autoDetectRenderer)({width:(0,wt.argChk_Num)(t,"width",wt.CmnLib.stageW),height:(0,wt.argChk_Num)(t,"height",wt.CmnLib.stageH),backgroundAlpha:h>16777216&&"png"===r?0:1,antialias:(0,wt.argChk_Boolean)(t,"smoothing",!1),preserveDrawingBuffer:!0,backgroundColor:16777215&h,autoDensity:!0}),l=[],c="back"!==t.page?"fore":"back";return xt(this,B,"f").tw?l.push(new Promise((t=>{xt(this,a,"f").visible=!0,xt(this,L,"f").forEach((t=>u.render(t,{clear:!1}))),xt(this,a,"f").visible=!1,xt(this,P,"f").visible=!0,xt(this,o,"f").filters=xt(this,D,"f").filters,xt(this,o,"f").visible=!0,u.render(xt(this,o,"f"),{clear:!1}),xt(this,o,"f").visible=!1,xt(this,o,"f").filters=[],t()}))):xt(this,n,"m",F).call(this,t.layer).forEach((t=>l.push(new Promise((e=>xt(this,E,"f")[t][c].snapshot(u,(()=>e()))))))),Promise.allSettled(l).then((async()=>{const e=Lt.RenderTexture.create({width:u.width,height:u.height,transform:!0});u.render(xt(this,s,"f"),{renderTexture:e}),await this.sys.savePic(i,u.plugins.extract.base64(Lt.Sprite.from(e))),xt(this,B,"f").tw||xt(this,n,"m",F).call(this,t.layer).forEach((t=>xt(this,E,"f")[t][c].snapshot_end())),u.destroy(!0)})),!1},y=function(t){const{fn:e}=t;if(!e)throw"fnは必須です";const i=(0,wt.argChk_Boolean)(t,"join",!0);if("css"!==(0,wt.getExt)(e))throw"サポートされない拡張子です";return(async()=>{const t=await fetch(e);if(!t.ok)throw new Error("Network response was not ok.");(0,wt.addStyle)(await t.text()),i&&this.main.resume()})(),i},b=function(t){const{layer:e,class:i}=t;if(!e)throw"layerは必須です";if(e.includes(","))throw"layer名に「,」は使えません";if(e in xt(this,E,"f"))throw`layer【${e}】はすでにあります`;if(!i)throw"clsは必須です";const s={isWait:!1};switch(xt(this,E,"f")[e]=new At.Pages(e,i,xt(this,o,"f"),xt(this,a,"f"),t,this.sys,this.val,s),xt(this,x,"f").push(e),i){case"txt":xt(this,T,"f")||(Tt(this,nt,(()=>{}),"f"),Tt(this,J,xt(this,n,"m",Q),"f"),Tt(this,tt,xt(this,n,"m",et),"f"),this.hTag.current({layer:e}),this.goTxt=()=>{this.val.getVal("sn.skip.enabled")?Tt(kt,r,0,"f",Z):this.setNormalChWait(),xt(this,n,"m",F).call(this).forEach((t=>{const e=xt(this,E,"f")[t];e.fore instanceof Ot.TxtLayer&&xt(this,v,"f").call(this,"gotxt|",e.fore,!1)}))}),this.val.setVal_Nochk("save","const.sn.layer."+(e??xt(this,T,"f"))+".enabled",!0);break;case"grp":if(xt(this,w,"f"))break;Tt(this,w,e,"f")}return this.scrItr.recodeDesign(t),s.isWait},S=function(t){const e=xt(this,n,"m",rt).call(this,t),i=xt(this,E,"f")[e],r=i.back.spLay,s=i.fore.spLay;if((0,wt.argChk_Boolean)(t,"float",!1))xt(this,a,"f").setChildIndex(r,xt(this,a,"f").children.length-1),xt(this,o,"f").setChildIndex(s,xt(this,o,"f").children.length-1),xt(this,n,"m",A).call(this);else if(t.index)(0,wt.argChk_Num)(t,"index",0)&&(xt(this,a,"f").setChildIndex(r,t.index),xt(this,o,"f").setChildIndex(s,t.index),xt(this,n,"m",A).call(this));else if(t.dive){const{dive:i}=t;let h=0;if(e===i)throw"[lay] 属性 layerとdiveが同じ【"+i+"】です";const u=xt(this,E,"f")[i];if(!u)throw"[lay] 属性 dive【"+i+"】が不正です。レイヤーがありません";const l=u.back,c=u.fore,f=xt(this,a,"f").getChildIndex(l.spLay),d=xt(this,o,"f").getChildIndex(c.spLay);h=f<d?f:d,h>xt(this,a,"f").getChildIndex(r)&&--h,xt(this,o,"f").setChildIndex(s,h),xt(this,a,"f").setChildIndex(r,h),xt(this,n,"m",A).call(this)}return t[":id_tag"]=i.fore.name.slice(0,-7),this.scrItr.recodeDesign(t),i.lay(t)},A=function(){Tt(this,x,xt(this,n,"m",U).call(this),"f")},M=function(t){return xt(this,n,"m",G).call(this,t,(e=>{const i=xt(this,E,"f")[xt(this,n,"m",rt).call(this,{layer:e})];"both"===t.page?(i.fore.clearLay(t),i.back.clearLay(t)):i.getPage(t).clearLay(t)})),!1},k=function(t){xt(this,n,"m",X).call(this);const e=St.CmnTween.ease(t.ease);Tt(this,L,[],"f");const i={},r=[];xt(this,n,"m",F).call(this,t.layer).forEach((t=>{i[t]=!0,r.push(xt(this,E,"f")[t].fore)}));const s=[];xt(this,n,"m",F).call(this).forEach((t=>{const e=xt(this,E,"f")[t][i[t]?"back":"fore"];xt(this,L,"f").push(e.spLay),s.push(e)})),xt(this,I,"f").resize(wt.CmnLib.stageW,wt.CmnLib.stageH),this.appPixi.renderer.render(xt(this,a,"f"),{renderTexture:xt(this,I,"f")});let h=()=>{xt(this,a,"f").visible=!0,xt(this,L,"f").forEach((t=>{this.appPixi.renderer.render(t,{renderTexture:xt(this,I,"f"),clear:!1})})),xt(this,a,"f").visible=!1};if(!s.some((t=>t.containMovement))){let t=h;h=()=>{h=()=>{},t()}}xt(this,N,"f").resize(wt.CmnLib.stageW,wt.CmnLib.stageH),this.appPixi.renderer.render(xt(this,o,"f"),{renderTexture:xt(this,N,"f")});let u=()=>{xt(this,o,"f").visible=!0,this.appPixi.renderer.render(xt(this,o,"f"),{renderTexture:xt(this,N,"f")}),xt(this,o,"f").visible=!1};if(!r.some((t=>t.containMovement))){let t=u;u=()=>{u=()=>{},t()}}const l=()=>{h(),xt(this,P,"f").visible=!0,u(),xt(this,D,"f").visible=!0};xt(this,D,"f").alpha=1;const c=()=>{var t,e;this.appPixi.ticker&&this.appPixi.ticker.remove(l),t=this,e=this,[{set value(e){Tt(t,o,e,"f")}}.value,{set value(t){Tt(e,a,t,"f")}}.value]=[xt(this,a,"f"),xt(this,o,"f")];const n=[];for(const t in xt(this,E,"f")){const e=xt(this,E,"f")[t];if(i[t]){e.transPage(n);continue}const r=xt(this,o,"f").getChildIndex(e.back.spLay);xt(this,o,"f").removeChild(e.back.spLay),xt(this,a,"f").removeChild(e.fore.spLay),xt(this,o,"f").addChildAt(e.fore.spLay,r),xt(this,a,"f").addChildAt(e.back.spLay,r)}Promise.allSettled(n),xt(this,o,"f").visible=!0,xt(this,a,"f").visible=!1,xt(this,P,"f").visible=!1,xt(this,D,"f").visible=!1,xt(this,B,"f").tw?.stop(),xt(this,B,"f").resume&&this.main.resume(),Tt(this,B,{tw:void 0,resume:!1},"f")};Tt(this,B,{tw:void 0,resume:!1},"f");const f=(0,wt.argChk_Num)(t,"time",0);if(0===f||xt(this,g,"f").isSkippingByKeyDown())return c(),!1;const d="glsl"in t;if(!d&&!("rule"in t))return xt(this,D,"f").filters=[],xt(this,B,"f").tw=new Dt.Tween(xt(this,D,"f")).to({alpha:0},f).delay((0,wt.argChk_Num)(t,"delay",0)).easing(e).onComplete(c).start(),this.appPixi.ticker.add(l),!1;const p=d?new Lt.Filter(void 0,t.glsl,xt(this,R,"f")):xt(this,C,"f");if(p.uniforms.vague=(0,wt.argChk_Num)(t,"vague",.04),p.uniforms.tick=0,xt(this,B,"f").tw=new Dt.Tween(p.uniforms).to({tick:1},f).delay((0,wt.argChk_Num)(t,"delay",0)).easing(e).onComplete(c),xt(this,D,"f").filters=[p],d)return xt(this,B,"f").tw.start(),this.appPixi.ticker.add(l),!1;if(!t.rule)throw"ruleが指定されていません";return Mt.GrpLayer.csv2Sprites(t.rule,void 0,(t=>{p.uniforms.rule=t.texture,t.destroy(),xt(this,B,"f").tw?.start(),this.appPixi.ticker.add(l)})),!1},F=function(t=""){return t?t.split(","):xt(this,x,"f")},G=function(t,e){const i=xt(this,n,"m",F).call(this,t.layer);return i.forEach((t=>{if(!t)return;const i=xt(this,E,"f")[t];if(!i)throw"存在しないlayer【"+t+"】です";e(t,i)})),i},U=function(t=""){return xt(this,n,"m",F).call(this,t).sort(((t,e)=>{const i=xt(this,o,"f").getChildIndex(xt(this,E,"f")[t].fore.spLay),n=xt(this,o,"f").getChildIndex(xt(this,E,"f")[e].fore.spLay);return i<n?-1:i>n?1:0}))},j=function(t){return!!xt(this,B,"f").tw&&(xt(this,B,"f").resume=!0,xt(this,g,"f").waitLimitedEvent(t,(()=>xt(this,n,"m",X).call(this))))},X=function(){return xt(this,B,"f").tw?.end(),!1},H=function(t){xt(this,n,"m",X).call(this);const e=(0,wt.argChk_Num)(t,"time",NaN);if(0===e)return!1;if(this.val.getVal("tmp:sn.skip.enabled"))return!1;if(xt(this,g,"f").isSkippingByKeyDown())return!1;const i=[];xt(this,n,"m",F).call(this,t.layer).forEach((t=>{i.push(xt(this,E,"f")[t].fore.spLay)})),xt(this,N,"f").resize(wt.CmnLib.stageW,wt.CmnLib.stageH);const r=()=>{xt(this,o,"f").visible=!0,i.forEach((t=>this.appPixi.renderer.render(t,{renderTexture:xt(this,N,"f"),clear:!1}))),xt(this,o,"f").visible=!1};xt(this,D,"f").visible=!0,xt(this,D,"f").alpha=1;const s=(0,wt.uint)((0,wt.argChk_Num)(t,"hmax",10)),a=(0,wt.uint)((0,wt.argChk_Num)(t,"vmax",10)),h=0===s?()=>{}:()=>xt(this,D,"f").x=Math.round(Math.random()*s*2)-s,u=0===a?()=>{}:()=>xt(this,D,"f").y=Math.round(Math.random()*a*2)-a;xt(this,D,"f").filters=[];const l=(0,wt.argChk_Num)(t,"repeat",1),c=new Dt.Tween(xt(this,D,"f")).to({x:0,y:0},e).delay((0,wt.argChk_Num)(t,"delay",0)).easing(St.CmnTween.ease(t.ease)).onUpdate((()=>{h(),u()})).repeat(0===l?1/0:l-1).yoyo((0,wt.argChk_Boolean)(t,"yoyo",!1)).onComplete((()=>{this.appPixi.ticker?.remove(r),xt(this,o,"f").visible=!0,xt(this,D,"f").visible=!1,xt(this,D,"f").x=0,xt(this,D,"f").y=0,xt(this,B,"f").tw?.stop(),xt(this,B,"f").resume&&this.main.resume(),Tt(this,B,{tw:void 0,resume:!1},"f")})).start();return Tt(this,B,{tw:c,resume:!1},"f"),this.appPixi.ticker.add(r),!1},W=function(t){if(!t.layer)throw"layerは必須です";const e=xt(this,n,"m",rt).call(this,t);let i=xt(this,E,"f")[e].fore,r=()=>{};const s=xt(this,g,"f").isSkippingByKeyDown();!s&&"render"in t&&(i.renderStart(),r=()=>i.renderEnd());const o=(0,wt.cnvTweenArg)(t,i),a=(0,wt.argChk_Num)(t,"repeat",1),h=t.name??t.layer,u=new Dt.Tween(i).to(o,(0,wt.argChk_Num)(t,"time",NaN)*(Boolean(this.val.getVal("tmp:sn.skip.enabled")||s)?0:1)).delay((0,wt.argChk_Num)(t,"delay",0)).easing(St.CmnTween.ease(t.ease)).repeat(0===a?1/0:a-1).yoyo((0,wt.argChk_Boolean)(t,"yoyo",!1)).onComplete((()=>{const t=xt(this,z,"f")[h];t&&(r(),delete xt(this,z,"f")[h],t.tw?.stop(),t.resume&&this.main.resume(),t.onEnd?.())}));if("chain"in t){const e=xt(this,z,"f")[t.chain??""];if(!e?.tw)throw`${t.chain}は存在しない・または終了したトゥイーンです`;delete e.onEnd,e.tw.chain(u)}else u.start();const l=(0,wt.argChk_Boolean)(t,"arrive",!1),c=(0,wt.argChk_Boolean)(t,"backlay",!1);return xt(this,z,"f")[h]={tw:u,resume:!1,onEnd:()=>{if(l&&Object.assign(i,o),c){const t=xt(this,E,"f")[e].back.spLay;for(const e in wt.hMemberCnt)t[e]=i[e]}}},!1},V=function(t){const e="id"in t?`frm\n${t.id}`:t.name??t.layer;if(!e)throw"トゥイーンが指定されていません";const i=xt(this,z,"f")[e];return!!i?.tw&&(i.resume=xt(this,g,"f").waitEvent((()=>i.tw?.end()),(0,wt.argChk_Boolean)(t,"canskip",!0),(0,wt.argChk_Boolean)(t,"global",!1)))},Y=function(t){const e="id"in t?`frm\n${t.id}`:t.name??t.layer;if(!e)throw"トゥイーンが指定されていません";return xt(this,z,"f")[e]?.tw?.end(),!1},$=function(t){const e="id"in t?`frm\n${t.id}`:t.name??t.layer;if(!e)throw"トゥイーンが指定されていません";return xt(this,z,"f")[e]?.tw?.pause(),!1},q=function(t){const e="id"in t?`frm\n${t.id}`:t.name??t.layer;if(!e)throw"トゥイーンが指定されていません";return xt(this,z,"f")[e]?.tw?.resume(),!1},K=function(t){const{text:e}=t;if(!e)throw"textは必須です";const i=xt(this,J,"f").call(this,t);delete t.text,this.val.getVal("tmp:sn.skip.enabled")?t.wait=0:"wait"in t&&(0,wt.argChk_Num)(t,"wait",NaN);const n=(0,wt.argChk_Boolean)(t,"record",!0),r=this.val.doRecLog();return n||this.val.setVal_Nochk("save","sn.doRecLog",n),i.tagCh(e.replaceAll("[r]","\n")),n||this.val.setVal_Nochk("save","sn.doRecLog",r),!1},Q=function(t){const e=xt(this,n,"m",rt).call(this,t,xt(this,T,"f")),i=xt(this,E,"f")[e].getPage(t);if(!(i instanceof Ot.TxtLayer))throw e+"はTxtLayerではありません";return i},et=function(t){const{layer:e}=t;if(!e)throw"[current] layerは必須です";if(Tt(this,it,xt(this,E,"f")[e],"f"),!(xt(this,it,"f").getPage(t)instanceof Ot.TxtLayer))throw`${e}はTxtLayerではありません`;return this.recText("",!0),Tt(this,T,e,"f"),this.val.setVal_Nochk("save","const.sn.mesLayer",e),xt(this,n,"m",F).call(this).forEach((t=>{const i=xt(this,E,"f")[t];i.fore instanceof Ot.TxtLayer&&(i.fore.isCur=i.back.isCur=t===e)})),!1},rt=function(t,e=""){const i=t.layer??e;if(i.includes(","))throw"layer名に「,」は使えません";if(!(i in xt(this,E,"f")))throw"属性 layer【"+i+"】が不正です。レイヤーがありません";return t.layer=i},at=function(t){const e=xt(this,J,"f").call(this,t);return t.layer===xt(this,T,"f")&&"fore"===t.page&&this.recText("",!0),e.clearText(),!1},ht=function(t){return xt(this,v,"f").call(this,"endlink|",xt(this,J,"f").call(this,t)),!1},ut=function(t){return(0,wt.argChk_Boolean)(t,"rec_page_break",!0)&&this.recText("",!0),xt(this,it,"f")&&(xt(this,it,"f").fore.clearLay(t),xt(this,it,"f").back.clearLay(t)),!1},lt=function(t){if(!t.pic)throw"[graph] picは必須です";return t.text="| 《grp|"+JSON.stringify(t)+"》",xt(this,n,"m",K).call(this,t)},ct=function(t){return t.style??="background-color: rgba(255,0,0,0.5);",t.style_hover??="background-color: rgba(255,0,0,0.9);",t.style_clicked??=t.style,xt(this,v,"f").call(this,"link|"+JSON.stringify(t),xt(this,J,"f").call(this,t)),!1},ft=function(t){return t.text="\n",xt(this,n,"m",K).call(this,t)},dt=function(){return this.recText("\n"),!1},pt=function(t){return Tt(this,st,t,"f"),this.recText(t.text??""),!1},gt=function(t){return Tt(this,ot,[],"f"),Tt(this,st,{text:t.text??""},"f"),this.val.setVal_Nochk("save","const.sn.sLog",t.text?`[{text:"${t.text}"}]`:"[]"),!1},mt=function(t){const{t:e,r:i}=t;if(!e)throw"[ruby2] tは必須です";if(!i)throw"[ruby2] rは必須です";return t.text="|"+e+"《"+i+"》",xt(this,n,"m",K).call(this,t)},vt=function(t){return xt(this,v,"f").call(this,"span|"+JSON.stringify(t),xt(this,J,"f").call(this,t)),!1},_t=function(t){if(!t.t)throw"[tcy] tは必須です";return t.text="| 《tcy|"+t.t+"|"+(t.r??"")+"》",xt(this,n,"m",K).call(this,t)},yt=function(t){return console.group("🥟 [dump_lay]"),xt(this,n,"m",F).call(this,t.layer).forEach((t=>{const e=xt(this,E,"f")[t];try{console.info(`%c${e.fore.name.slice(0,-7)} %o`,`color:#${wt.CmnLib.isDarkMode?"49F":"05A"};`,JSON.parse(`{"back":{${e.back.dump()}}, "fore":{${e.fore.dump()}}}`))}catch(t){console.error("dump_lay err:%o",t),console.error(` back:${e.back.dump()}`),console.error(` fore:${e.fore.dump()}`)}})),console.groupEnd(),!1},bt=function(t){const e=xt(this,n,"m",rt).call(this,t,xt(this,T,"f")),i=(0,wt.argChk_Boolean)(t,"enabled",!0);return xt(this,J,"f").call(this,t).enabled=i,this.val.setVal_Nochk("save","const.sn.layer."+e+".enabled",i),!1},Et=function(t){return At.Pages.argChk_page(t,"back"),t.clicksebuf??="SYS",t.entersebuf??="SYS",t.leavesebuf??="SYS",t.fn||(t.fn=this.scrItr.scriptFn),xt(this,J,"f").call(this,t).addButton(t),this.scrItr.recodeDesign(t),!1},Z={value:10}},5681:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x,T,w,S=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i},A=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};Object.defineProperty(e,"__esModule",{value:!0}),e.Main=void 0;const M=i(4965),O=i(3422),R=i(5785),C=i(6069),I=i(7177),P=i(7307),N=i(7408),D=i(3497),L=i(5844),k=i(8526),B=i(3690),F=i(6841);e.Main=class{constructor(t){this.sys=t,n.add(this),r.set(this,void 0),s.set(this,void 0),o.set(this,Object.create(null)),a.set(this,void 0),h.set(this,void 0),u.set(this,void 0),l.set(this,void 0),c.set(this,void 0),f.set(this,void 0),d.set(this,void 0),p.set(this,(()=>{})),g.set(this,new C.AnalyzeTagArg),m.set(this,!1),v.set(this,"skynovel"),y.set(this,(()=>A(this,p,"f").call(this))),b.set(this,((t=A(this,n,"m",x))=>{A(this,T,"f")||(A(this,f,"f").clearBreak(),S(this,p,t,"f"),this.resume=(t=A(this,n,"m",x))=>{S(this,p,t,"f")},A(this,l,"f").noticeBreak(!1))})),this.resume=A(this,b,"f"),this.stop=()=>{S(this,p,(()=>{}),"f"),this.resume=A(this,b,"f"),A(this,l,"f").noticeBreak(!0)},E.set(this,!0),T.set(this,!1),this.isDestroyed=()=>A(this,T,"f"),w.set(this,void 0),F.utils.skipHello(),O.Config.generate(t).then((t=>S(this,r,t,"f"))).then((()=>A(this,n,"m",_).call(this))).catch((t=>console.error("load err fn:prj.json e:%o",t)))}errScript(t,e=!0){if(this.stop(),P.DebugMng.myTrace(t),M.CmnLib.debugLog&&console.log("🍜 SKYNovel err!"),e)throw t}resumeByJumpOrCall(t){t.url?globalThis.open(t.url):(A(this,a,"f").setVal_Nochk("tmp","sn.eventArg",t.arg??""),A(this,a,"f").setVal_Nochk("tmp","sn.eventLabel",t.label??""),(0,M.argChk_Boolean)(t,"call",!1)?(A(this,l,"f").subIdxToken(),this.resume((()=>A(this,o,"f").call(t)))):(A(this,o,"f").clear_event({}),this.resume((()=>A(this,o,"f").jump(t)))))}setLoop(t,e=""){S(this,E,t,"f")?this.resume():this.stop(),this.sys.setTitleInfo(e?` -- ${e}中`:"")}fire(t,e){A(this,d,"f").fire(t,e)}async destroy(t=0){A(this,T,"f")||(S(this,T,!0,"f"),A(this,m,"f")&&(this.stop(),S(this,E,!1,"f"),await A(this,f,"f").before_destroy(),t>0&&await new Promise((e=>setTimeout(e,t))),S(this,o,{},"f"),A(this,d,"f").destroy(),A(this,l,"f").destroy(),A(this,f,"f").destroy(),A(this,c,"f").destroy(),A(this,s,"f").ticker.remove(A(this,y,"f")),A(this,w,"f")&&A(this,s,"f")&&document.body.insertBefore(A(this,w,"f"),A(this,s,"f").view),F.utils.clearTextureCache(),A(this,s,"f").destroy(!0)))}},r=new WeakMap,s=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,u=new WeakMap,l=new WeakMap,c=new WeakMap,f=new WeakMap,d=new WeakMap,p=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,E=new WeakMap,T=new WeakMap,w=new WeakMap,n=new WeakSet,_=async function(){const t=document.createElement("canvas")?.getContext("2d");if(!t)throw"argChk_Color err";M.CmnLib.cc4ColorName=t;const e={width:A(this,r,"f").oCfg.window.width,height:A(this,r,"f").oCfg.window.height,backgroundColor:A(this,r,"f").oCfg.init.bg_color=(0,M.parseColor)(String(A(this,r,"f").oCfg.init.bg_color)),resolution:globalThis.devicePixelRatio??1,autoResize:!0},i=document.getElementById(A(this,v,"f"));i&&(S(this,w,i.cloneNode(!0),"f"),A(this,w,"f").id=A(this,v,"f"),e.view=i),S(this,s,new F.Application(e),"f"),i||(document.body.appendChild(A(this,s,"f").view),A(this,s,"f").view.id=A(this,v,"f")),S(this,a,new N.Variable(A(this,r,"f"),A(this,o,"f")),"f"),S(this,h,new I.PropParser(A(this,a,"f"),A(this,r,"f").oCfg.init.escape??"\\"),"f"),await Promise.allSettled(this.sys.init(A(this,o,"f"),A(this,s,"f"),A(this,a,"f"),this)),A(this,o,"f").title({text:A(this,r,"f").oCfg.book.title||"SKYNovel"}),S(this,u,new D.SoundMng(A(this,r,"f"),A(this,o,"f"),A(this,a,"f"),this,this.sys),"f"),S(this,l,new B.ScriptIterator(A(this,r,"f"),A(this,o,"f"),this,A(this,a,"f"),A(this,g,"f"),(()=>A(this,n,"m",x).call(this)),A(this,h,"f"),A(this,u,"f"),this.sys),"f"),S(this,c,new P.DebugMng(this.sys,A(this,o,"f"),A(this,l,"f")),"f"),S(this,f,new L.LayerMng(A(this,r,"f"),A(this,o,"f"),A(this,s,"f"),A(this,a,"f"),this,A(this,l,"f"),this.sys,A(this,u,"f"),A(this,g,"f"),A(this,h,"f")),"f"),S(this,d,new k.EventMng(A(this,r,"f"),A(this,o,"f"),A(this,s,"f"),this,A(this,f,"f"),A(this,a,"f"),A(this,u,"f"),A(this,l,"f"),this.sys),"f"),A(this,s,"f").ticker.add(A(this,y,"f")),this.resumeByJumpOrCall({fn:"main"}),S(this,m,!0,"f")},x=function(){for(;A(this,E,"f");){let t=A(this,l,"f").nextToken();if(!t)break;const e=t.charCodeAt(0);if(9!==e)if(10!==e){if(91===e){if(A(this,l,"f").isBreak(t))return;try{const e=(t.match(/\n/g)??[]).length;if(e>0&&A(this,l,"f").addLineNum(e),A(this,l,"f").タグ解析(t)){this.stop();break}continue}catch(e){if(e instanceof Error){const i=e;let n=`タグ解析中例外 mes=${i.message}(${i.name})`;n=`[${(0,R.tagToken2Name)(t)}]`+n,this.errScript(n,!1)}else this.errScript(String(e),!1);return}}if(38===e)try{if("&"!==t.slice(-1)){if(A(this,l,"f").isBreak(t))return;const e=(0,R.splitAmpersand)(t.slice(1));e.name=A(this,h,"f").getValAmpersand(e.name),e.text=String(A(this,h,"f").parse(e.text)),A(this,o,"f").let(e);continue}if("&"===t.charAt(1))throw new Error("「&表示&」書式では「&」指定が不要です");t=String(A(this,h,"f").parse(t.slice(1,-1)))}catch(t){return void this.errScript(t instanceof Error?`& 変数操作・表示 mes=${t.message}(${t.name})`:t,!1)}else{if(59===e)continue;if(42===e&&t.length>1)continue}try{A(this,f,"f").currentTxtlayForeNeedErr.tagCh(t)}catch(t){return void this.errScript(t instanceof Error?`文字表示 mes=${t.message}(${t.name})`:t,!1)}}else A(this,l,"f").addLineNum(t.length)}}},4040:function(t,e,i){"use strict";var n,r=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i},s=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};Object.defineProperty(e,"__esModule",{value:!0}),e.Pages=void 0;const o=i(4965);class a{constructor(t,e,i,h,u,l,c,f){this.cls_=e,n.set(this,void 0),this.lay=t=>this.getPage(t).lay(t),this.getPage=t=>"back"!==a.argChk_page(t,"fore")?s(this,n,"f").fore:s(this,n,"f").back;const d=l.hFactoryCls[e];if(!d)throw`属性 class【${e}】が不正です`;r(this,n,{fore:d(),back:d()},"f"),s(this,n,"f").fore.layname=s(this,n,"f").back.layname=t;const p=u[":id_tag"]=`layer:${t} cls:${e}`;s(this,n,"f").fore.name=`${p} page:A`,s(this,n,"f").back.name=`${p} page:B`,i.addChild(this.fore.spLay),h.addChild(this.back.spLay),(0,o.argChk_Boolean)(u,"visible",!0),(0,o.argChk_Boolean)(u,"visible",!0),f.isWait=this.fore.lay(u)||this.back.lay(u);const g=`const.sn.lay.${t}`;c.setVal_Nochk("tmp",g,!0),c.defTmp(g+".fore.alpha",(()=>s(this,n,"f").fore.alpha)),c.defTmp(g+".back.alpha",(()=>s(this,n,"f").back.alpha)),c.defTmp(g+".fore.height",(()=>s(this,n,"f").fore.height)),c.defTmp(g+".back.height",(()=>s(this,n,"f").back.height)),c.defTmp(g+".fore.visible",(()=>s(this,n,"f").fore.spLay.visible)),c.defTmp(g+".back.visible",(()=>s(this,n,"f").back.spLay.visible)),c.defTmp(g+".fore.width",(()=>s(this,n,"f").fore.width)),c.defTmp(g+".back.width",(()=>s(this,n,"f").back.width)),c.defTmp(g+".fore.x",(()=>s(this,n,"f").fore.x)),c.defTmp(g+".back.x",(()=>s(this,n,"f").back.x)),c.defTmp(g+".fore.y",(()=>s(this,n,"f").fore.y)),c.defTmp(g+".back.y",(()=>s(this,n,"f").back.y))}destroy(){s(this,n,"f").fore.destroy(),s(this,n,"f").back.destroy()}static argChk_page(t,e){const i=t.page??e;if("fore"===i)return t.page=i;if("back"===i)return t.page=i;throw Error("属性 page【"+i+"】が不正です")}get cls(){return this.cls_}get fore(){return s(this,n,"f").fore}get back(){return s(this,n,"f").back}transPage(t){[s(this,n,"f").back,s(this,n,"f").fore]=[s(this,n,"f").fore,s(this,n,"f").back],s(this,n,"f").back.copy(s(this,n,"f").fore,t)}}e.Pages=a,n=new WeakMap},7177:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),p=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),g=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&d(e,t,i);return p(e,t),e},m=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},v=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.PropParser=void 0;const _=g(i(7864)),y=i(4965);class b{constructor(t,e="\\"){function i(t){const e=[];return t.forEach((t=>e.push((t instanceof RegExp?_.regex(t):_.string(t)).trim(_.optWhitespace)))),_.alt.apply(null,e)}function r(t,e){const i=_.lazy((()=>_.seq(t,i).or(e)));return i}function c(t,e){let i=_.lazy((()=>e.chain((e=>_.seq(t,_.of(e),i).or(_.of(e))))));return i}function f(t,e){return _.seqMap(e,_.seq(t,e).many(),((t,e)=>e.reduce(((t,e)=>[e[0],t,e[1]]),t)))}this.val=t,n.add(this),s.set(this,null),a.set(this,{"!num!":t=>t.shift(),"!str!":t=>m(this,n,"m",l).call(this,t.shift()),"!bool!":t=>t.shift(),"!":t=>{const e=t.shift();return"!bool!"===e[0]?!Boolean(e[1]):!("true"===String(m(this,n,"m",o).call(this,e)))},"~":t=>~Number(m(this,n,"m",o).call(this,t.shift())),"**":t=>Number(m(this,n,"m",o).call(this,t.shift()))**Number(m(this,n,"m",o).call(this,t.shift())),"*":t=>Number(m(this,n,"m",o).call(this,t.shift()))*Number(m(this,n,"m",o).call(this,t.shift())),"/":t=>Number(m(this,n,"m",o).call(this,t.shift()))/Number(m(this,n,"m",o).call(this,t.shift())),"¥":t=>Math.floor(m(this,a,"f")["/"](t)),"%":t=>Number(m(this,n,"m",o).call(this,t.shift()))%Number(m(this,n,"m",o).call(this,t.shift())),"+":t=>{const e=m(this,n,"m",o).call(this,t.shift()),i=m(this,n,"m",o).call(this,t.shift());return"[object String]"===Object.prototype.toString.call(e)||"[object String]"===Object.prototype.toString.call(i)?String(e)+String(i):Number(e)+Number(i)},"-":t=>Number(m(this,n,"m",o).call(this,t.shift()))-Number(m(this,n,"m",o).call(this,t.shift())),int:t=>(0,y.int)(m(this,n,"m",h).call(this,t.shift())),parseInt:t=>(0,y.int)(m(this,a,"f").Number(t)),Number:t=>{const e=m(this,n,"m",o).call(this,t.shift());return"[object String]"!==Object.prototype.toString.call(e)?Number(e):m(this,n,"m",h).call(this,m(this,s,"f").parse(String(e)).value)},ceil:t=>Math.ceil(m(this,n,"m",h).call(this,t.shift())),floor:t=>Math.floor(m(this,n,"m",h).call(this,t.shift())),round:t=>Math.round(m(this,n,"m",h).call(this,t.shift())),isNaN:t=>isNaN(Number(m(this,n,"m",o).call(this,t.shift()))),"<<":t=>Number(m(this,n,"m",o).call(this,t.shift()))<<Number(m(this,n,"m",o).call(this,t.shift())),">>":t=>Number(m(this,n,"m",o).call(this,t.shift()))>>Number(m(this,n,"m",o).call(this,t.shift())),">>>":t=>Number(m(this,n,"m",o).call(this,t.shift()))>>>Number(m(this,n,"m",o).call(this,t.shift())),"<":t=>Number(m(this,n,"m",o).call(this,t.shift()))<Number(m(this,n,"m",o).call(this,t.shift())),"<=":t=>Number(m(this,n,"m",o).call(this,t.shift()))<=Number(m(this,n,"m",o).call(this,t.shift())),">":t=>Number(m(this,n,"m",o).call(this,t.shift()))>Number(m(this,n,"m",o).call(this,t.shift())),">=":t=>Number(m(this,n,"m",o).call(this,t.shift()))>=Number(m(this,n,"m",o).call(this,t.shift())),"==":t=>{const e=m(this,n,"m",o).call(this,t.shift()),i=m(this,n,"m",o).call(this,t.shift());return null!=e||null!=i||e&&i?String(e)===String(i):e==i},"!=":t=>!m(this,a,"f")["=="](t),"===":t=>{const e=m(this,n,"m",o).call(this,t.shift()),i=m(this,n,"m",o).call(this,t.shift());return Object.prototype.toString.call(e)==Object.prototype.toString.call(i)&&String(e)===String(i)},"!==":t=>!m(this,a,"f")["==="](t),"&":t=>Number(m(this,n,"m",o).call(this,t.shift()))&Number(m(this,n,"m",o).call(this,t.shift())),"^":t=>Number(m(this,n,"m",o).call(this,t.shift()))^Number(m(this,n,"m",o).call(this,t.shift())),"|":t=>Number(m(this,n,"m",o).call(this,t.shift()))|Number(m(this,n,"m",o).call(this,t.shift())),"&&":t=>"true"===String(m(this,n,"m",o).call(this,t.shift()))&&"true"===String(m(this,n,"m",o).call(this,t.shift())),"||":t=>"true"===String(m(this,n,"m",o).call(this,t.shift()))||"true"===String(m(this,n,"m",o).call(this,t.shift())),"?":t=>{const e=t.shift();let i=!1;if("!bool!"===e[0])i=Boolean(e[1]);else{const t=String(m(this,n,"m",o).call(this,e));i="true"!==t&&"false"!==t?0!==(0,y.int)(t):"true"===t}const r=t.shift();if(":"!==r[0])throw Error("(PropParser)三項演算子の文法エラーです。: が見つかりません");return m(this,n,"m",o).call(this,r[i?1:2])},":":()=>{throw Error("(PropParser)三項演算子の文法エラーです。? が見つかりません")}}),u.set(this,/(\$((tmp|sys|save|mp):)?[^\s!--\/:-@[-^`{-~]+|\#\{[^\}]+})/g),this.getValAmpersand=t=>"&"===t.charAt(0)?String(this.parse(t.slice(1))):t;const d=_.alt(_.alt(_.regex(/-?(0|[1-9][0-9]*)\.[0-9]+/),_.regex(/0x[0-9a-fA-F]+/)).map(Number),_.alt(_.regex(/-?(0|[1-9][0-9]*)/)).map((t=>(0,y.int)(t)))).map((t=>["!num!",t])).desc("number"),p=_.string("null").map((()=>["!str!",null])),g=_.regex(/(true|false)/).map((t=>["!bool!","true"===t])).desc("boolean"),b=_.regex(new RegExp(`(?:"(?:\\${e}["'#\\n]|[^"])*"|'(?:\\${e}["'#\\n]|[^'])*'|\\#(?:\\${e}["'#\\n]|[^#])*\\#)`)).map((t=>["!str!",t.slice(1,-1).replaceAll(e,"")])).desc("string"),E=/\[[^\]]+\]/g,x=_.regex(/-?(?:(?:tmp|sys|save|mp):)?[^\s!-\/:-@[-^`{-~]+(?:\.[^\s!-\/:-@[-^`{-~]+|\[[^\]]+\])*(?:@str)?/).map((t=>{const e=String(t).replace(E,(t=>"."+this.parse(t.slice(1,-1))));if("-"===e.charAt(0)){const t=this.val.getVal(e.slice(1));if(null==t||"null"===String(t))throw Error("(PropParser)数値以外に-符号がついています");return["!num!",-Number(t)]}const i=this.val.getVal(e);return null==i?["!str!",i]:"boolean"==typeof i?["!bool!",i]:"[object String]"===Object.prototype.toString.call(i)?["!str!",String(i)]:["!num!",Number(i)]})).desc("string"),T=_.lazy((()=>_.string("(").then(m(this,s,"f")).skip(_.string(")")).or(d).or(p).or(g).or(b).or(x))),w=[{type:r,ops:i([/[A-Za-z_][A-Za-z0-9_]*(?=\()/])},{type:r,ops:i([/(!(?!=)|~)/])},{type:c,ops:i(["**"])},{type:f,ops:i(["*","/","¥","%"])},{type:f,ops:i(["+","-"])},{type:f,ops:i([/(>>>|<<|>>)/])},{type:f,ops:i([/(<=|<|>=|>)/])},{type:f,ops:i([/(===|!==|==|!=)/])},{type:f,ops:i([/&(?!&)/])},{type:f,ops:i(["^"])},{type:f,ops:i([/\|(?!\|)/])},{type:f,ops:i(["&&"])},{type:f,ops:i(["||"])},{type:c,ops:i([":"])},{type:c,ops:i(["?"])}].reduce(((t,e)=>e.type(e.ops,t)),T);v(this,s,w.trim(_.optWhitespace),"f")}parse(t){const e=m(this,s,"f").parse(t);if(!e.status)throw Error("(PropParser)文法エラー【"+t+"】");const i=e.value;return"!str!"===i[0]?m(this,n,"m",l).call(this,i[1]):m(this,n,"m",o).call(this,i)}static getValName(t){const e=m(this,r,"f",c).exec(t.trim())?.groups;if(e)return{scope:e.scope||"tmp",name:m(b,r,"m",f).call(b,e.name),at:e.at??""}}}e.PropParser=b,r=b,s=new WeakMap,a=new WeakMap,u=new WeakMap,n=new WeakSet,o=function t(e){const i=e.shift();if(i instanceof Array)return m(this,n,"m",t).call(this,i);const r=m(this,a,"f")[i];return r?r(e):Object(null)},h=function(t){const e=m(this,n,"m",o).call(this,t);if("[object Number]"!==Object.prototype.toString.call(e))throw Error("(PropParser)引数【"+e+"】が数値ではありません");return Number(e)},l=function(t){return null==t?t:String(t).replace(m(this,u,"f"),(t=>"$"===t.charAt(0)?this.val.getVal(t.slice(1)):this.parse(t.slice(2,-1))))},f=function(t){let e=0,i=0;for(;;){if(e=t.indexOf('["'),e<0){if(e=t.indexOf("['"),e<0)break;i=t.indexOf("']",e+2)}else i=t.indexOf('"]',e+2);if(i<0)break;t=t.slice(0,e)+"."+t.slice(e+2,i)+t.slice(i+2),e=i-2}return t},c={value:/^((?<scope>\w+?):)?(?<name>[^\s :@]+)(?<at>\@str)?$/}},8911:function(t,e){"use strict";var i,n,r,s,o=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i},a=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};Object.defineProperty(e,"__esModule",{value:!0}),e.RubySpliter=void 0;class h{constructor(){r.set(this,(()=>{}))}static setting(t){t.sesame&&o(h,i,t.sesame,"f",n)}static getSesame(){return a(h,i,"f",n)}static destroy(){o(h,i,"ヽ","f",n)}init(t){o(this,r,t,"f")}static setEscape(t){o(h,i,new RegExp((t?`(?<ce>\\${t}\\S)|`:"")+"|(?<str>[^《\\n]+)《(?<ruby>[^》\\n]+)》|(?:(?<kan>[⺀-⿟々〇〻㐀-鿿豈-﫿]+[ぁ-ヿ]*|[^ |《》\\n])《(?<kan_ruby>[^》\\n]+)》)|(?<txt>[\ud800-\udbff][\udc00-\udfff]|[^ |《》]+(?=|)|[^ |《》]*[ぁ-ヿ](?=[⺀-⿟々〇〻㐀-鿿豈-﫿]+《)|.)","gs"),"f",s)}putTxt(t){let e=null;for(;e=a(h,i,"f",s).exec(t);){const t=e?.groups;if(!t)continue;const i=t.ruby;if(i){this.putTxtRb(t.str,i);continue}const n=t.kan_ruby;n?this.putTxtRb(t.kan,n):t.ce?a(this,r,"f").call(this,t.ce.slice(1),""):Array.from(t.txt??"").forEach((t=>a(this,r,"f").call(this,t,"")))}}putTxtRb(t,e){const s=Array.from(t),o=s.length;if("*"===e.charAt(0)&&e.length<=2){const t="center|"+("*"===e?a(h,i,"f",n):e.charAt(1));for(let e=0;e<o;++e)a(this,r,"f").call(this,s[e],t);return}if(1===o||-1===e.indexOf(" "))return void a(this,r,"f").call(this,t,e.replaceAll("\t"," "));const u=e.split(" "),l=u.length,c=l>o?l:o;for(let t=0;t<c;++t)a(this,r,"f").call(this,t<o?s[t]:"",t<l?u[t].replaceAll("\t"," "):"")}}e.RubySpliter=h,i=h,r=new WeakMap,n={value:"ヽ"},s={value:void 0}},3690:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x,T,w,S,A,M,O,R,C,I,P,N,D,L,k,B,F,G,U,j,X,H,z,W,V,Y,$,q,Z,K,J,Q,tt,et,it,nt,rt,st,ot,at,ht,ut,lt,ct,ft,dt,pt,gt,mt,vt,_t,yt,bt,Et,xt,Tt,wt,St,At,Mt,Ot,Rt,Ct,It=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},Pt=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.ScriptIterator=void 0;const Nt=i(4965),Dt=i(3422),Lt=i(9824),kt=i(5785),Bt=i(6841),Ft=i(7307);var Gt;!function(t){t[t.Running=0]="Running",t[t.Wait=1]="Wait",t[t.Break=2]="Break",t[t.Breaking=3]="Breaking",t[t.Step=4]="Step",t[t.Stepping=5]="Stepping",t[t.StepOuting=6]="StepOuting",t[t.StepOut=7]="StepOut"}(Gt||(Gt={}));class Ut{constructor(t,e,i,S,P,H,q,K,J){if(this.cfg=t,this.hTag=e,this.main=i,this.val=S,this.alzTagArg=P,this.runAnalyze=H,this.prpPrs=q,this.sndMng=K,this.sys=J,n.add(this),s.set(this,{aToken:[""],len:1,aLNum:[1]}),o.set(this,""),a.set(this,0),h.set(this,0),this.addLineNum=t=>Pt(this,h,It(this,h,"f")+t,"f"),u.set(this,[]),l.set(this,new kt.Grammar),this.firstWait=()=>{},f.set(this,{disconnect:()=>{Pt(Ut,r,{},"f",E),Pt(Ut,r,{},"f",x),this.isBreak=()=>!1,It(this,f,"f").continue({}),Pt(this,T,Gt.Running,"f")},restart:()=>this.isBreak=()=>!1,add_break:t=>It(this,n,"m",c).call(this,t.fn,t.o),data_break:t=>{It(this,T,"f")===Gt.Running&&(Pt(this,T,Gt.Wait,"f"),this.main.setLoop(!1,`変数 ${t.dataId}【${t.old_v}】→【${t.new_v}】データブレーク`),this.sys.callHook("stopOnDataBreakpoint",{}),this.sys.send2Dbg("stopOnDataBreakpoint",{}))},set_func_break:t=>{Pt(Ut,r,{},"f",x),t.a.forEach((t=>It(Ut,r,"f",x)[t.name]=1)),this.sys.send2Dbg(t.ri,{})},stack:t=>this.sys.send2Dbg(t.ri,{a:It(this,n,"m",A).call(this)}),eval:t=>{this.sys.send2Dbg(t.ri,{v:this.prpPrs.parse(t.txt)})},continue:()=>{It(this,n,"m",b).call(this)||(Pt(this,a,It(this,a,"f")-It(this,n,"a",y),"f"),Pt(this,T,Gt.Breaking,"f"),this.main.setLoop(!0),this.main.resume())},stepover:t=>It(this,n,"m",m).call(this,t),stepin:()=>{if(It(this,n,"m",b).call(this))return;const t=It(this,s,"f").aToken[It(this,a,"f")-It(this,n,"a",y)];this.sys.callHook("stopOnStep"+(It(this,bt,"f").test(t)?"In":""),{}),Pt(this,a,It(this,a,"f")-It(this,n,"a",y),"f"),Pt(this,T,It(this,T,"f")===Gt.Wait?Gt.Step:Gt.Stepping,"f"),this.main.setLoop(!0),this.main.resume()},stepout:t=>{It(this,n,"m",b).call(this)||(It(this,u,"f").length>0?It(this,n,"m",v).call(this,!0):It(this,n,"m",m).call(this,t))},pause:()=>{Pt(this,T,Gt.Step,"f"),this.main.setLoop(!1,"一時停止"),this.sys.send2Dbg("stopOnStep",{})},stopOnEntry:()=>{Pt(this,T,Gt.Step,"f"),this.main.setLoop(!1,"一時停止"),this.sys.send2Dbg("stopOnEntry",{})}}),d.set(this,(t=>this.cfg.searchPath(t,Dt.Config.EXT_SCRIPT))),g.set(this,(t=>(this.sys.pathBaseCnvSnPath4Dbg+It(this,d,"f").call(this,t)).replace(It(Ut,r,"f",p),`$1/prj/$2/${It(this,o,"f")}$3`))),this.cnvPath4Dbg=t=>this.sys.pathBaseCnvSnPath4Dbg+t.replace("/crypto_prj/","/prj/"),_.set(this,0),T.set(this,Gt.Running),this.isBreak=t=>!1,M.set(this,(t=>{})),O.set(this,void 0),R.set(this,void 0),D.set(this,(()=>{})),L.set(this,(()=>{})),k.set(this,""),B.set(this,{}),this.noticeBreak=t=>{},F.set(this,5),G.set(this,[-1]),$.set(this,""),Z.set(this,""),this.nextToken=()=>"",Q.set(this,(t=>{})),et.set(this,/(\*{2,})(.*)/),it.set(this,/\[macro\s/),nt.set(this,/\[endmacro[\s\]]/),rt.set(this,/^\[let_ml\s/g),st.set(this,/^\[endlet_ml\s*]/g),at.set(this,Object.create(null)),lt.set(this,/^\[(call|loadplugin)\s/),ct.set(this,/\bfn\s*=\s*[^\s\]]+/),ft.set(this,(()=>{for(let t=It(this,s,"f").len-1;t>=0;--t){const e=It(this,s,"f").aToken[t];if(It(this,lt,"f").lastIndex=0,!It(this,lt,"f").test(e))continue;const[i,n]=(0,kt.tagToken2Name_Args)(e);this.alzTagArg.go(n);const r=this.alzTagArg.hPrm.fn;if(!r)continue;const o=r.val;if(!o||"*"!==o.slice(-1))continue;const a="loadplugin"===i?"css":"sn",h=this.cfg.matchPath("^"+o.slice(0,-1)+".*",a);It(this,s,"f").aToken.splice(t,1,"\t","; "+e),It(this,s,"f").aLNum.splice(t,1,NaN,NaN);for(const i of h){const n=e.replace(It(this,ct,"f"),"fn="+decodeURIComponent((0,Nt.getFn)(i[a])));It(this,s,"f").aToken.splice(t,0,n),It(this,s,"f").aLNum.splice(t,0,NaN)}}It(this,s,"f").len=It(this,s,"f").aToken.length})),pt.set(this,!1),yt.set(this,"call"),bt.set(this,/\[(call)\b/),Tt.set(this,!1),St.set(this,{hSave:{},hPages:{},aIfStk:[-1]}),Rt.set(this,[]),Ct.set(this,-1),e.let_ml=t=>It(this,n,"m",C).call(this,t),e.dump_stack=()=>It(this,n,"m",I).call(this),e.dump_script=t=>It(this,n,"m",N).call(this,t),e.else=e.elsif=e.endif=()=>It(this,n,"m",U).call(this),e.if=t=>It(this,n,"m",j).call(this,t),e.call=t=>It(this,n,"m",X).call(this,t),e.jump=t=>It(this,n,"m",z).call(this,t),e.page=t=>It(this,n,"m",W).call(this,t),e.pop_stack=t=>It(this,n,"m",V).call(this,t),e.return=()=>It(this,n,"m",Y).call(this),e.bracket2macro=t=>It(this,n,"m",mt).call(this,t),e.char2macro=t=>It(this,n,"m",vt).call(this,t),e.endmacro=()=>It(this,n,"m",Y).call(this),e.macro=t=>It(this,n,"m",_t).call(this,t),e.load=t=>It(this,n,"m",Et).call(this,t),e.reload_script=t=>It(this,n,"m",wt).call(this,t),e.record_place=()=>It(this,n,"m",At).call(this),e.save=t=>It(this,n,"m",Ot).call(this,t),t.oCfg.debug.token&&Pt(this,Q,(t=>console.log(`🌱 トークン fn:${It(this,o,"f")} idx:${It(this,a,"f")} ln:${It(this,h,"f")} token【${t}】`)),"f"),S.defTmp("const.sn.vctCallStk.length",(()=>It(this,u,"f").length)),It(this,l,"f").setEscape(t.oCfg.init.escape),Nt.CmnLib.isDbg){J.addHook(((t,e)=>It(this,f,"f")[t]?.(e))),this.isBreak=It(this,n,"m",w);const t=this.analyzeInit;this.analyzeInit=()=>{this.analyzeInit=()=>{},this.sys.send2Dbg("hi",{})},It(this,f,"f").auth=e=>{const i=e.hBreakpoint.hFn2hLineBP;for(const t in i)It(this,n,"m",c).call(this,t,i[t]);if(Pt(Ut,r,{},"f",x),e.hBreakpoint.aFunc.forEach((t=>It(Ut,r,"f",x)[t.name]=1)),e.stopOnEntry){for(;;){let t=this.nextToken();if(!t)break;const e=t.charCodeAt(0);if(91===e)break;if(38===e)break;if(42===e&&1===t.length)break;10===e&&Pt(this,h,It(this,h,"f")+t.length,"f")}this.sys.callHook("stopOnEntry",{}),this.analyzeInit=t,this.analyzeInit()}else this.firstWait=()=>{this.sys.callHook("stopOnEntry",{})},this.analyzeInit=t,this.analyzeInit()}}else this.recodeDesign=()=>{};t.oCfg.debug.tag&&Pt(this,M,(t=>console.log(`🌲 タグ解析 fn:${It(this,o,"f")} idx:${It(this,a,"f")} ln:${It(this,h,"f")} [${t} %o]`,this.alzTagArg.hPrm)),"f")}get scriptFn(){return It(this,o,"f")}subIdxToken(){var t;Pt(this,a,(t=It(this,a,"f"),--t),"f")}get lineNum(){return It(this,h,"f")}destroy(){this.isBreak=()=>!1}タグ解析(t){const[e,i]=(0,kt.tagToken2Name_Args)(t),n=this.hTag[e];if(!n)throw`未定義のタグ【${e}】です`;this.alzTagArg.go(i),It(this,M,"f").call(this,e);const r=this.alzTagArg.hPrm;if(r.cond){const t=r.cond.val;if(!t||"&"===t.charAt(0))throw"属性condは「&」が不要です";const e=this.prpPrs.parse(t),i=String(e);if("null"===i||"undefined"===i)return!1;if(!e)return!1}let s={};const o=It(this,u,"f").length;if(this.alzTagArg.isKomeParam){if(0===o)throw"属性「*」はマクロのみ有効です";s={...It(this,u,"f")[It(this,u,"f").length-1].csArg}}s[":タグ名"]=e;for(const t in r){let e=r[t].val;if("%"===e?.charAt(0)){if(0===o)throw"属性「%」はマクロ定義内でのみ使用できます(そのマクロの引数を示す簡略文法であるため)";const i=It(this,u,"f")[It(this,u,"f").length-1].csArg[e.slice(1)];if(i){s[t]=i;continue}if(e=r[t].def,void 0===e||"null"===e)continue}if(e=this.prpPrs.getValAmpersand(e??""),"undefined"!==e){s[t]=e;continue}const i=r[t].def;void 0!==i&&(e=this.prpPrs.getValAmpersand(i),"undefined"!==e&&(s[t]=e))}return n(s)}setOtherObj(t,e){Pt(this,O,t,"f"),Pt(this,R,e,"f")}dumpErrForeLine(){if(0===It(this,a,"f"))return console.group(`🥟 Error line (from 0 rows before) fn:${It(this,o,"f")}`),void console.groupEnd();let t="";for(let e=It(this,a,"f")-1;e>=0&&(t=It(this,s,"f").aToken[e]+t,!((t.match(/\n/g)??[]).length>=It(this,F,"f")));--e);const e=t.split("\n").slice(-It(this,F,"f")),i=e.length;console.group(`🥟 Error line (from ${i} rows before) fn:${It(this,o,"f")}`);const r=String(It(this,h,"f")).length,u=It(this,n,"m",P).call(this,It(this,s,"f"),It(this,a,"f"));for(let t=0;t<i;++t){const n=It(this,h,"f")-i+t+1,s=`${String(n).padStart(r," ")}: %c`,o=e[t],a=o.length>75?o.slice(0,75)+"…":o;t===i-1?console.info(s+a.slice(0,u.col_s)+"%c"+a.slice(u.col_s),"color: black; background-color: skyblue;","color: black; background-color: pink;"):console.info(s+a,"color: black; background-color: skyblue;")}console.groupEnd()}analyzeInit(){const t=It(this,n,"m",ot).call(this,It(this,s,"f"),Boolean(this.val.getVal("mp:const.sn.macro.name")),It(this,h,"f"),It(this,Z,"f"),It(this,a,"f"));Pt(this,a,t.idx,"f"),Pt(this,h,t.ln,"f"),this.runAnalyze()}get isKidoku(){return It(this,pt,"f")}get isNextKidoku(){let t=It(this,o,"f"),e=It(this,a,"f"),i=It(this,s,"f").len;if(It(this,u,"f").length>0){const n=It(this,u,"f")[0];t=n.fn,e=n.idx;const r=It(this,at,"f")[t];r&&(i=r.len)}const n=this.val.getAreaKidoku(t);return!!n&&e!==i&&n.search(e)}get normalWait(){return It(this,pt,"f")?this.val.getVal("sys:sn.tagCh.doWait_Kidoku")?(0,Nt.uint)(this.val.getVal("sys:sn.tagCh.msecWait_Kidoku")):0:this.val.getVal("sys:sn.tagCh.doWait")?(0,Nt.uint)(this.val.getVal("sys:sn.tagCh.msecWait")):0}get skip4page(){return It(this,Tt,"f")}recodePage(){var t;if(Pt(this,Tt,!1,"f"),!this.val.getVal("save:sn.doRecLog"))return;const{fn:e,idx:i}=It(this,n,"m",Mt).call(this),r=i-1,s=r+":"+e,o=It(this,Rt,"f").findIndex((t=>t.key===s));if(o>-1)return void Pt(this,Ct,o,"f");const a={key:s,fn:e,idx:r,retFn:e,retIdx:0,retMark:{...It(this,St,"f")}};if(It(this,Ct,"f")>=0){const t=It(this,Rt,"f")[It(this,Ct,"f")];a.retFn=t.fn,a.retIdx=t.idx+1}Pt(this,Ct,(t=It(this,Ct,"f"),++t),"f")===It(this,Rt,"f").length?It(this,Rt,"f").push(a):It(this,Rt,"f")[It(this,Ct,"f")]=a}recodeDesign(t){let e="",i=0;const r=It(this,u,"f").length;if(t.design_unit&&r>0){const t=It(this,u,"f")[0];e=t.fn,i=t.idx}else e=It(this,o,"f"),i=It(this,a,"f");t[":path"]=It(this,g,"f").call(this,e);const s=It(this,n,"m",P).call(this,It(this,at,"f")[e],i);t[":ln"]=s.ln,t[":col_s"]=s.col_s,t[":col_e"]=s.col_e;const h=i-1;t[":idx_tkn"]=h,t[":token"]=It(this,at,"f")[e].aToken[h],this.sys.send2Dbg("_recodeDesign",t)}replace(t,e){It(this,s,"f").aToken[t]=e}}e.ScriptIterator=Ut,r=Ut,s=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,u=new WeakMap,l=new WeakMap,f=new WeakMap,d=new WeakMap,g=new WeakMap,_=new WeakMap,T=new WeakMap,M=new WeakMap,O=new WeakMap,R=new WeakMap,D=new WeakMap,L=new WeakMap,k=new WeakMap,B=new WeakMap,F=new WeakMap,G=new WeakMap,$=new WeakMap,Z=new WeakMap,Q=new WeakMap,et=new WeakMap,it=new WeakMap,nt=new WeakMap,rt=new WeakMap,st=new WeakMap,at=new WeakMap,lt=new WeakMap,ct=new WeakMap,ft=new WeakMap,pt=new WeakMap,yt=new WeakMap,bt=new WeakMap,Tt=new WeakMap,St=new WeakMap,Rt=new WeakMap,Ct=new WeakMap,n=new WeakSet,c=function(t,e){It(Ut,r,"f",E)[It(this,g,"f").call(this,t)]=e},m=function(t){if(It(this,n,"m",b).call(this))return;const e=It(this,s,"f").aToken[It(this,a,"f")-It(this,n,"a",y)];It(this,bt,"f").test(e)?It(this,n,"m",v).call(this,!1):(this.sys.callHook("stopOnStep",{}),It(this,f,"f").stepin(t))},v=function(t){this.sys.callHook("stopOnStep"+(t?"Out":""),{}),Pt(this,_,It(this,u,"f").length-(t?1:0),"f"),Pt(this,a,It(this,a,"f")-It(this,n,"a",y),"f"),Pt(this,T,t?Gt.StepOut:Gt.StepOuting,"f"),this.main.setLoop(!0),this.main.resume()},y=function(){return It(this,T,"f")===Gt.Break||It(this,T,"f")===Gt.Step?1:0},b=function(){return!(It(this,a,"f")<It(this,s,"f").len||(this.sys.callHook("stopOnEntry",{}),this.main.setLoop(!1,"スクリプト終端です"),0))},w=function(t){switch(It(this,T,"f")){case Gt.StepOuting:It(this,n,"m",S).call(this),Pt(this,T,Gt.StepOut,"f");break;case Gt.StepOut:if(It(this,u,"f").length!==It(this,_,"f"))break;return Pt(this,T,Gt.Step,"f"),this.main.setLoop(!1,"ステップ実行"),this.sys.send2Dbg("stopOnStep",{}),!0;case Gt.Stepping:It(this,n,"m",S).call(this),Pt(this,T,Gt.Step,"f");break;case Gt.Step:return It(this,n,"m",S).call(this),this.main.setLoop(!1,"ステップ実行"),this.sys.send2Dbg("stopOnStep",{}),!0;case Gt.Breaking:It(this,n,"m",S).call(this),Pt(this,T,Gt.Running,"f");break;default:if((0,kt.tagToken2Name)(t)in It(Ut,r,"f",x))return Pt(this,T,Gt.Break,"f"),this.main.setLoop(!1,`関数 ${t} ブレーク`),this.sys.callHook("stopOnBreakpoint",{}),this.sys.send2Dbg("stopOnBreakpoint",{}),!0;{const t=It(Ut,r,"f",E)[It(this,g,"f").call(this,It(this,o,"f"))];if(!t)break;const e=t[It(this,h,"f")];if(!e)break;if(e.condition){if(!this.prpPrs.parse(e.condition))break}else if("hitCondition"in e&&--e.hitCondition>0)break;const i=It(this,T,"f")===Gt.Running;Pt(this,T,Gt.Break,"f"),this.main.setLoop(!1,i?(e.condition?"条件":"ヒットカウント")+"ブレーク":"ステップ実行");const n=i?"stopOnBreakpoint":"stopOnStep";this.sys.callHook(n,{}),this.sys.send2Dbg(n,{})}return!0}return!1},S=function(){const t=It(Ut,r,"f",E)[(0,Nt.getFn)(It(this,o,"f"))]?.[It(this,h,"f")];t?.hitCondition&&--t.hitCondition},A=function(){const t=It(this,T,"f")===Gt.Breaking?1:0,e=It(this,s,"f").aToken[It(this,a,"f")-1+t],i=It(this,g,"f").call(this,It(this,o,"f")),r=(0,kt.tagToken2Name)(e),h=r?`[${r}]`:e,l=this.val.getVal("mp:const.sn.macro")??"{}";if(0===It(this,a,"f"))return[{fn:i,ln:1,col:1,nm:h,ma:l}];const c=It(this,n,"m",P).call(this,It(this,s,"f"),It(this,a,"f")),f=[{fn:i,ln:c.ln,col:c.col_s+1,nm:h,ma:l}],d=It(this,u,"f").length;if(0===d)return f;for(let t=d-1;t>=0;--t){const e=It(this,u,"f")[t],i=It(this,at,"f")[e.fn],r=i.aToken[e.idx-1],s=It(this,n,"m",P).call(this,i,e.idx),o=(0,kt.tagToken2Name)(r);f.push({fn:It(this,g,"f").call(this,e.fn),ln:s.ln,col:s.col_s+1,nm:o?`[${o}]`:r,ma:e.csArg[":hMp"]["const.sn.macro"]??"{}"})}return f},C=function(t){var e;const{name:i}=t;if(!i)throw"nameは必須です";let n="";const r=It(this,s,"f").len;for(;It(this,a,"f")<r&&(n=It(this,s,"f").aToken[It(this,a,"f")],""===n);Pt(this,a,(e=It(this,a,"f"),++e),"f"));return t.text=n,t.cast="str",this.hTag.let(t),Pt(this,a,It(this,a,"f")+2,"f"),Pt(this,h,It(this,h,"f")+(n.match(/\n/g)??[]).length,"f"),!1},I=function(){if(0===It(this,a,"f"))return console.group(`🥟 [dump_stack] スクリプト現在地 fn:${It(this,o,"f")} line:1 col:0`),console.groupEnd(),!1;const t=It(this,n,"m",P).call(this,It(this,s,"f"),It(this,a,"f")),e=`スクリプト現在地 fn:${It(this,o,"f")} line:${t.ln} col:${t.col_s+1}`;console.group(`🥟 [dump_stack] ${e}`);const i=It(this,u,"f").length;if(i>0){console.info(e);for(let t=i-1;t>=0;--t){const e=It(this,u,"f")[t],r=e.csArg[":hMp"],s=r?r[":タグ名"]:void 0,o=e.csArg[":タグ名"]??"",a=It(this,n,"m",P).call(this,It(this,at,"f")[e.fn],e.idx);console.info(`${i-t}つ前のコール元 fn:${e.fn} line:${a.ln} col:${a.col_s+1}`+(s?"(["+s+"]マクロ内)":" ")+`で [${o} ...]をコール`)}}return console.groupEnd(),!1},P=function(t,e){const i={ln:1,col_s:0,col_e:0};if(!t)return i;let n=e-1;const r=i.ln=t.aLNum[n];for(;t.aLNum[n]===r;){if("\n"!==t.aToken[n].charAt(0)){const e=t.aToken[n].length;i.col_e>0&&(i.col_s+=e),i.col_e+=e}if(--n<0)break}return i},N=function(t){const{set_fnc:e,break_fnc:i}=t;if(!e)throw"set_fncは必須です";if(Pt(this,D,globalThis[e],"f"),!It(this,D,"f")){if((0,Nt.argChk_Boolean)(t,"need_err",!0))throw`HTML内に関数${e}が見つかりません`;return Pt(this,D,(()=>{}),"f"),!1}if(this.noticeBreak=t=>{It(this,k,"f")!==It(this,o,"f")&&(Pt(this,k,It(this,o,"f"),"f"),It(this,D,"f").call(this,It(this,B,"f")[It(this,o,"f")]=It(this,B,"f")[It(this,o,"f")]??It(this,s,"f").aToken.join(""))),It(this,L,"f").call(this,It(this,h,"f"),t)},this.noticeBreak(!0),!i)return!1;if(Pt(this,L,globalThis[i],"f"),!It(this,L,"f")){if((0,Nt.argChk_Boolean)(t,"need_err",!0))throw`HTML内に関数${i}が見つかりません`;Pt(this,L,(()=>{}),"f")}return!1},U=function(){if(-1===It(this,G,"f")[0])throw"ifブロック内ではありません";return Pt(this,a,It(this,G,"f")[0],"f"),It(this,G,"f").shift(),!1},j=function(t){var e,i;const{exp:n}=t;if(!n)throw"expは必須です";if("&"===n.charAt(0))throw"属性expは「&」が不要です";let r=0,o=this.prpPrs.parse(n)?It(this,a,"f"):-1;const u=It(this,s,"f").aLNum[It(this,a,"f")];let l=It(this,h,"f")-(u||0);const c=It(this,s,"f").len;for(;It(this,a,"f")<c;Pt(this,a,(e=It(this,a,"f"),++e),"f")){const t=It(this,s,"f").aLNum[It(this,a,"f")];It(this,s,"f").aLNum[It(this,a,"f")]=(t||0)+l;const e=It(this,s,"f").aToken[It(this,a,"f")];if(!e)continue;const n=e.charCodeAt(0);if(10===n){Pt(this,h,It(this,h,"f")+e.length,"f");continue}if(91!==n)continue;const[u,c]=(0,kt.tagToken2Name_Args)(e);if(!(u in this.hTag))throw`未定義のタグ[${u}]です`;switch(this.alzTagArg.go(c),u){case"if":++r;break;case"elsif":if(r>0)break;if(o>-1)break;const t=this.alzTagArg.hPrm.exp.val??"";if("&"===t.charAt(0))throw"属性expは「&」が不要です";this.prpPrs.parse(t)&&(o=It(this,a,"f")+1);break;case"else":if(r>0)break;-1===o&&(o=It(this,a,"f")+1);break;case"endif":if(r>0){--r;break}return-1===o?(Pt(this,a,(i=It(this,a,"f"),++i),"f"),It(this,s,"f").aLNum[It(this,a,"f")]+=l):(It(this,G,"f").unshift(It(this,a,"f")+1),Pt(this,a,o,"f"),Pt(this,h,It(this,s,"f").aLNum[It(this,a,"f")],"f")),!1}}throw"[endif]がないままスクリプト終端です"},X=function(t){(0,Nt.argChk_Boolean)(t,"count",!1)||It(this,n,"m",gt).call(this);const{fn:e}=t;return e&&It(this,d,"f").call(this,e),It(this,n,"m",H).call(this,{":hEvt1Time":It(this,O,"f").popLocalEvts(),":hMp":this.val.cloneMp()}),(0,Nt.argChk_Boolean)(t,"clear_local_event",!1)&&this.hTag.clear_event({}),It(this,n,"m",K).call(this,e,t.label),!0},H=function(t){It(this,s,"f").aLNum[It(this,a,"f")]=It(this,h,"f"),It(this,$,"f")||(t[":resvToken"]="",It(this,n,"m",q).call(this)),It(this,u,"f").push(new Lt.CallStack(It(this,o,"f"),It(this,a,"f"),t)),It(this,G,"f").unshift(-1)},z=function(t){return(0,Nt.argChk_Boolean)(t,"count",!0)||It(this,n,"m",gt).call(this),It(this,G,"f")[0]=-1,It(this,n,"m",K).call(this,t.fn,t.label),!0},W=function(t){var e,i;if(-1===It(this,Ct,"f"))return!1;if((0,Nt.argChk_Boolean)(t,"clear",!1))return Pt(this,Rt,[],"f"),Pt(this,Ct,-1,"f"),!1;const{to:r}=t;if(!r)throw"clearかtoは必須です";const s=It(this,Ct,"f");switch(r){case"prev":It(this,Ct,"f")>0&&Pt(this,Ct,(e=It(this,Ct,"f"),--e),"f");break;case"next":const t=It(this,Rt,"f").length;It(this,Ct,"f")<t-1&&Pt(this,Ct,(i=It(this,Ct,"f"),++i),"f");break;default:throw`属性to「${r}」は異常です`}if(s===It(this,Ct,"f"))return!1;const o=It(this,Rt,"f")[It(this,Ct,"f")],{fn:a,idx:h}=It(this,n,"m",Mt).call(this);return o.key!==h+":"+a&&It(this,n,"m",xt).call(this,{fn:o.retFn,index:o.retIdx},o.retMark)},V=function(t){if((0,Nt.argChk_Boolean)(t,"clear",!1))Pt(this,u,[],"f");else if(!It(this,u,"f").pop())throw"[pop_stack] スタックが空です";return It(this,n,"m",q).call(this),Pt(this,G,[-1],"f"),this.val.setMp({}),!1},Y=function(){const t=It(this,u,"f").pop();if(!t)throw"[return] スタックが空です";const e=t.csArg;It(this,G,"f").shift();const i=e[":hMp"];i&&this.val.setMp(i);const r=e[":resvToken"];return r?this.nextToken=()=>(It(this,n,"m",q).call(this),r):It(this,n,"m",q).call(this),e[":hEvt1Time"]&&It(this,O,"f").pushLocalEvts(e[":hEvt1Time"]),t.fn in It(this,at,"f")?(It(this,n,"m",ut).call(this,t),!1):(It(this,n,"m",K).call(this,t.fn,"",t.idx),!0)},q=function(){Pt(this,$,"","f"),this.nextToken=It(this,n,"m",J)},K=function(t="",e="",i=0){if(t||e||this.main.errScript("[jump系] fnまたはlabelは必須です"),e?("*"!==e.charAt(0)&&this.main.errScript("[jump系] labelは*で始まります"),Pt(this,Z,e,"f"),"**"!==It(this,Z,"f").slice(0,2)&&Pt(this,a,i,"f")):(Pt(this,Z,"","f"),Pt(this,a,i,"f")),!t)return void this.analyzeInit();const r=It(this,d,"f").call(this,t);if(t===It(this,o,"f"))return void this.analyzeInit();Pt(this,o,t,"f");const u=It(this,at,"f")[It(this,o,"f")];if(u)return Pt(this,s,u,"f"),void this.analyzeInit();(new Bt.Loader).add({name:It(this,o,"f"),url:r}).use(((t,e)=>{try{t.data=this.sys.decStr(t.extension,t.data)}catch(e){this.main.errScript(`[jump系]snロード失敗です fn:${t.name} ${e}`,!1)}e?.()})).load(((e,i)=>{this.nextToken=It(this,n,"m",J),Pt(this,h,1,"f"),It(this,n,"m",ht).call(this,i[t].data),this.hTag.record_place({}),this.main.resume((()=>this.analyzeInit()))})),this.main.stop()},J=function(){var t;if(It(this,n,"m",tt).call(this))return"";It(this,n,"m",dt).call(this),It(this,s,"f").aLNum[It(this,a,"f")]||=It(this,h,"f");const e=It(this,s,"f").aToken[It(this,a,"f")];return It(this,Q,"f").call(this,e),Pt(this,a,(t=It(this,a,"f"),++t),"f"),e},tt=function(){return!(It(this,a,"f")<It(this,s,"f").len||(this.main.errScript("スクリプト終端です"),0))},ot=function(t,e,i,r,s){const o=t.aToken.length;if(!r){if(It(this,n,"m",tt).call(this))return{idx:s,ln:i};if(t.aLNum[s])i=t.aLNum[s];else{i=1;for(let e=0;e<s;++e){t.aLNum[e]||=i;const n=t.aToken[e];10===n.charCodeAt(0)?i+=n.length:i+=(n.match(/\n/g)??[]).length}t.aLNum[s]=i}return{idx:s,ln:i}}t.aLNum[0]=1;const a=r.match(It(this,et,"f"));if(a){r=a[1];let n=s;switch(a[2]){case"before":for(;t.aToken[--n]!==r;)0===n&&Ft.DebugMng.myTrace("[jump系 無名ラベルbefore] "+i+"行目以前で"+(e?"マクロ内に":"")+"ラベル【"+r+"】がありません","ET"),e&&t.aToken[n].search(It(this,it,"f"))>-1&&Ft.DebugMng.myTrace("[jump系 無名ラベルbefore] マクロ内にラベル【"+r+"】がありません","ET");return{idx:n+1,ln:t.aLNum[n]};case"after":for(;t.aToken[++n]!==r;)n===o&&Ft.DebugMng.myTrace("[jump系 無名ラベルafter] "+i+"行目以後でマクロ内にラベル【"+r+"】がありません","ET"),t.aToken[n].search(It(this,nt,"f"))>-1&&Ft.DebugMng.myTrace("[jump系 無名ラベルafter] "+i+"行目以後でマクロ内にラベル【"+r+"】がありません","ET");return{idx:n+1,ln:t.aLNum[n]};default:Ft.DebugMng.myTrace("[jump系] 無名ラベル指定【label="+r+"】が間違っています","ET")}}i=1;const h=new RegExp("^"+r.replaceAll("*","\\*")+"(?:\\s|;|\\[|$)");let u=!1;for(let e=0;e<o;++e){t.aLNum[e]||=i;const n=t.aToken[e];if(u){It(this,st,"f").lastIndex=0,It(this,st,"f").test(n)?u=!1:i+=(n.match(/\n/g)??[]).length;continue}const r=n.charCodeAt(0);if(10!==r){if(42!==r)91===r&&(i+=(n.match(/\n/g)??[]).length,It(this,rt,"f").lastIndex=0,It(this,rt,"f").test(n)&&(u=!0));else if(n.search(h)>-1)return{idx:e+1,ln:i}}else i+=n.length}if(u)throw"[let_ml]の終端・[endlet_ml]がありません";throw Ft.DebugMng.myTrace(`[jump系] ラベル【${r}】がありません`,"ET"),"Dummy"},ht=function(t){const e=t.replace(/(\r\n|\r)/g,"\n").match(It(this,l,"f").REG_TOKEN)??[];for(let t=e.length-1;t>=0;--t){const i=e[t];if(It(this,rt,"f").lastIndex=0,It(this,rt,"f").test(i)){const n=i.indexOf("]")+1;if(0===n)throw"[let_ml]で閉じる【]】がありません";const r=i.slice(0,n),s=i.slice(n);e.splice(t,1,r,s)}}Pt(this,s,{aToken:e,len:e.length,aLNum:[]},"f");let i="";try{i="ScriptIterator.replaceScriptChar2macro",It(this,l,"f").replaceScr_C2M_And_let_ml(It(this,s,"f")),i="ScriptIterator.replaceScript_Wildcard",It(this,ft,"f").call(this)}catch(t){if(t instanceof Error){const e=t;i+=`例外 mes=${e.message}(${e.name})`}else i=t;this.main.errScript(i,!1)}It(this,at,"f")[It(this,o,"f")]=It(this,s,"f"),this.val.loadScrWork(It(this,o,"f"))},ut=function(t){Pt(this,o,t.fn,"f"),Pt(this,a,t.idx,"f");const e=It(this,at,"f")[It(this,o,"f")];e&&Pt(this,s,e,"f"),Pt(this,h,It(this,s,"f").aLNum[t.idx],"f")},dt=function(){const t=this.val.getAreaKidoku(It(this,o,"f"));if(!t)throw`recordKidoku fn:'${It(this,o,"f")}' (areas === null)`;It(this,u,"f").length>0?t.record(It(this,a,"f")):(Pt(this,pt,t.search(It(this,a,"f")),"f"),this.val.setVal_Nochk("tmp","const.sn.isKidoku",It(this,pt,"f")),It(this,pt,"f")||t.record(It(this,a,"f")))},gt=function(){this.val.getAreaKidoku(It(this,o,"f"))?.erase(It(this,a,"f")),Pt(this,pt,!1,"f")},mt=function(t){return It(this,l,"f").bracket2macro(t,It(this,s,"f"),It(this,a,"f")),!1},vt=function(t){return It(this,l,"f").char2macro(t,this.hTag,It(this,s,"f"),It(this,a,"f")),!1},_t=function(t){var e,i;const{name:r}=t;if(!r)throw"nameは必須です";if(r in this.hTag)throw`[${r}]はタグかすでに定義済みのマクロです`;const u=It(this,h,"f"),l=new Lt.CallStack(It(this,o,"f"),It(this,a,"f"));for(Pt(this,yt,It(this,yt,"f")+"|"+r,"f"),Pt(this,bt,new RegExp(`\\[(${It(this,yt,"f")})\\b`),"f"),this.hTag[r]=e=>(e.design_unit=t.design_unit,It(this,n,"m",H).call(this,{...e,":hMp":this.val.cloneMp()}),this.val.setMp(e),this.val.setVal_Nochk("mp","const.sn.macro",JSON.stringify(t)),this.val.setVal_Nochk("mp","const.sn.me_call_scriptFn",It(this,o,"f")),Pt(this,h,u,"f"),It(this,n,"m",ut).call(this,l),!1);It(this,a,"f")<It(this,s,"f").len;Pt(this,a,(e=It(this,a,"f"),++e),"f")){It(this,s,"f").aLNum[It(this,a,"f")]||=It(this,h,"f");const t=It(this,s,"f").aToken[It(this,a,"f")];if(t.search(It(this,nt,"f"))>-1)return Pt(this,a,(i=It(this,a,"f"),++i),"f"),!1;const e=t.charCodeAt(0);10===e?Pt(this,h,It(this,h,"f")+t.length,"f"):91===e&&Pt(this,h,It(this,h,"f")+(t.match(/\n/g)??[]).length,"f")}throw`マクロ[${r}]定義の終端・[endmacro]がありません`},Et=function(t){if(!("place"in t))throw"placeは必須です";const e=Number(t.place);if("fn"in t!="label"in t)throw"fnとlabelはセットで指定して下さい";const i=this.val.getMark(e);if(!i)throw`place【${e}】は存在しません`;return It(this,n,"m",xt).call(this,t,i)},xt=function(t,e,i=!0){this.hTag.clear_event({}),this.val.mark2save(e),this.val.setMp({}),It(this,R,"f").recText("",!0),i&&this.sndMng.playLoopFromSaveObj(),(0,Nt.argChk_Boolean)(t,"do_rec",!0)&&Pt(this,St,{hSave:this.val.cloneSave(),hPages:{...e.hPages},aIfStk:[...e.aIfStk]},"f");const r={enabled:this.val.getVal("save:const.sn.autowc.enabled"),text:this.val.getVal("save:const.sn.autowc.text"),time:Number(this.val.getVal("save:const.sn.autowc.time"))};this.hTag.autowc(r);const s=String(this.val.getVal("save:const.sn.scriptFn")),h=Number(this.val.getVal("save:const.sn.scriptIdx"));return Pt(this,G,[...It(this,St,"f").aIfStk],"f"),Pt(this,u,[],"f"),It(this,R,"f").cover(!0),It(this,R,"f").stopAllTw(),"index"in t?(It(this,R,"f").playback(It(this,St,"f").hPages,(()=>{It(this,R,"f").cover(!1),Pt(this,Tt,!0,"f"),It(this,n,"m",K).call(this,t.fn??s,"",t.index??h)})),!0):(delete It(this,at,"f")[s],It(this,R,"f").playback(It(this,St,"f").hPages,"label"in t?()=>{It(this,R,"f").cover(!1),Pt(this,o,s,"f"),Pt(this,a,h,"f"),this.hTag.call({fn:t.fn,label:t.label})}:()=>{It(this,R,"f").cover(!1),It(this,n,"m",K).call(this,s,"",h)}),!0)},wt=function(t){const e=this.val.getMark(0);return delete It(this,at,"f")[(0,Nt.getFn)(e.hSave["const.sn.scriptFn"])],t.do_rec=!1,It(this,n,"m",xt).call(this,t,e,!1)},At=function(){if(this.main.isDestroyed())return!1;const{fn:t,idx:e}=It(this,n,"m",Mt).call(this);return this.val.setVal_Nochk("save","const.sn.scriptFn",t),this.val.setVal_Nochk("save","const.sn.scriptIdx",e),Pt(this,St,{hSave:this.val.cloneSave(),hPages:It(this,R,"f").record(),aIfStk:It(this,G,"f").slice(It(this,u,"f").length)},"f"),!1},Mt=function(){if(0===It(this,u,"f").length)return{fn:It(this,o,"f"),idx:It(this,a,"f")};const t=It(this,u,"f")[0];return{fn:t.fn,idx:t.idx}},Ot=function(t){if(!("place"in t))throw"placeは必須です";const e=Number(t.place);delete t[":タグ名"],delete t.place,t.text=(t.text??"").replace(/^(<br\/>)+/,""),It(this,St,"f").json=t,this.val.setMark(e,It(this,St,"f"));const i=Number(this.val.getVal("sys:const.sn.save.place"));return e===i&&this.val.setVal_Nochk("sys","const.sn.save.place",i+1),!1},p={value:/(.+)\/crypto_prj\/([^\/]+)\/[^\.]+(\.\w+)/},E={value:{}},x={value:{}}},3497:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x,T,w,S,A,M,O,R,C=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},I=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.SoundMng=void 0;const P=i(4965),N=i(8566),D=i(3422),L=i(2292),k=i(6841),B=i(6194);class F{constructor(t,e,i,r,u){this.cfg=t,this.val=i,this.main=r,this.sys=u,n.add(this),s.set(this,{}),o.set(this,{}),a.set(this,void 0),_.set(this,(()=>{L.sound.volumeAll=Number(this.val.getVal("sys:sn.sound.global_volume",1)),I(this,_,(()=>{}),"f")})),e.volume=t=>C(this,n,"m",h).call(this,t),e.fadebgm=t=>C(this,n,"m",f).call(this,t),e.fadeoutbgm=t=>C(this,n,"m",l).call(this,t),e.fadeoutse=t=>C(this,n,"m",c).call(this,t),e.fadese=t=>C(this,n,"m",d).call(this,t),e.playbgm=t=>C(this,n,"m",p).call(this,t),e.playse=t=>C(this,n,"m",m).call(this,t),e.stop_allse=()=>C(this,n,"m",y).call(this),e.stopbgm=t=>C(this,n,"m",b).call(this,t),e.stopse=t=>C(this,n,"m",E).call(this,t),e.wb=t=>C(this,n,"m",x).call(this,t),e.wf=t=>C(this,n,"m",T).call(this,t),e.stopfadese=t=>C(this,n,"m",w).call(this,t),e.wl=t=>C(this,n,"m",S).call(this,t),e.ws=t=>C(this,n,"m",A).call(this,t),e.xchgbuf=t=>C(this,n,"m",M).call(this,t),this.val.setVal_Nochk("save","const.sn.loopPlaying","{}"),i.setVal_Nochk("tmp","const.sn.sound.codecs",JSON.stringify(L.utils.supported))}setEvtMng(t){I(this,a,t,"f")}setNoticeChgVolume(t,e){this.val.defValTrg("sys:sn.sound.global_volume",((e,i)=>t(L.sound.volumeAll=Number(i)))),this.val.defValTrg("sys:sn.sound.movie_volume",((t,i)=>e(Number(i)))),this.val.setVal_Nochk("sys","sn.sound.global_volume",this.val.getVal("sys:sn.sound.global_volume",1)),this.val.setVal_Nochk("sys","sn.sound.movie_volume",this.val.getVal("sys:sn.sound.movie_volume",1))}clearCache(){L.sound.removeAll()}loadAheadSnd(t){[t.clickse,t.enterse,t.leavese].forEach((t=>{t&&!L.sound.exists(t)&&C(this,n,"m",v).call(this,"",t,{preload:!0,autoPlay:!1})}))}playLoopFromSaveObj(){const t=String(this.val.getVal("save:const.sn.loopPlaying","{}"));if(this.val.flush(),"{}"===t)return void C(this,n,"m",y).call(this);const e=[];I(this,o,JSON.parse(t),"f");for(const t in C(this,o,"f")){const i="save:const.sn.sound."+t+".",r={fn:String(this.val.getVal(i+"fn")),buf:t,join:!1,loop:!0,volume:Number(this.val.getVal(i+"volume")),start_ms:Number(this.val.getVal(i+"start_ms")),end_ms:Number(this.val.getVal(i+"end_ms")),ret_ms:Number(this.val.getVal(i+"ret_ms"))};e.push((()=>{"BGM"===r.buf?C(this,n,"m",p).call(this,r):C(this,n,"m",m).call(this,r)}))}C(this,n,"m",y).call(this),e.forEach((t=>t()))}}e.SoundMng=F,r=F,s=new WeakMap,o=new WeakMap,a=new WeakMap,_=new WeakMap,n=new WeakSet,h=function(t){const{buf:e="SE"}=t,i="const.sn.sound."+e+".volume",r=C(this,n,"m",u).call(this,t,1);return Number(this.val.getVal("sys:"+i))!==r&&(this.val.setVal_Nochk("sys",i,r),this.val.flush(),t.time=0,t.volume=Number(this.val.getVal("save:"+i)),C(this,n,"m",d).call(this,t))},u=function(t,e){const i=(0,P.argChk_Num)(t,"volume",e);return i<0?0:i>1?1:i},l=function(t){return t.volume=0,C(this,n,"m",f).call(this,t)},c=function(t){return t.volume=0,C(this,n,"m",d).call(this,t)},f=function(t){return t.buf="BGM",C(this,n,"m",d).call(this,t)},d=function(t){C(this,n,"m",w).call(this,t);const{buf:e="SE"}=t,i=C(this,s,"f")[e];if(!i?.playing()||!i.snd)return!1;const r="const.sn.sound."+e+".volume",o=C(this,n,"m",u).call(this,t,NaN);this.val.setVal_Nochk("save",r,o);const h=o*Number(this.val.getVal("sys:"+r,1)),l=(0,P.argChk_Boolean)(t,"stop",0===o);l&&(C(this,n,"m",R).call(this,e),this.val.setVal_Nochk("save","const.sn.sound."+e+".fn","")),this.val.flush();const c=(0,P.argChk_Num)(t,"time",NaN),f=(0,P.argChk_Num)(t,"delay",0);if(0===c&&0===f||this.val.getVal("tmp:sn.skip.enabled")||C(this,a,"f").isSkippingByKeyDown())return i.snd.volume=h,l&&C(this,n,"m",E).call(this,t),!1;const d=(0,P.argChk_Num)(t,"repeat",1);return i.twFade=new B.Tween({v:i.snd.volume}).to({v:h},c).delay(f).easing(N.CmnTween.ease(t.ease)).repeat(0===d?1/0:d-1).yoyo((0,P.argChk_Boolean)(t,"yoyo",!1)).onUpdate((t=>{i.playing()&&(i.snd.volume=t.v)})).onComplete((()=>{const e=C(this,s,"f")[t.buf=i.now_buf];e?.twFade&&(delete e.twFade,l&&C(this,n,"m",E).call(this,t),e.resumeFade&&this.main.resume())})).start(),!1},p=function(t){return t.buf="BGM",t.canskip=!1,(0,P.argChk_Boolean)(t,"loop",!0),C(this,n,"m",m).call(this,t)},m=function(t){const{buf:e="SE",fn:i}=t;if(C(this,n,"m",E).call(this,{buf:e}),!i)throw`[playse] fnは必須です buf:${e}`;if((0,P.argChk_Boolean)(t,"canskip",!0)&&C(this,a,"f").isSkippingByKeyDown())return!1;const o=(0,P.argChk_Boolean)(t,"loop",!1);C(this,n,"m",O).call(this,e,o);const h="const.sn.sound."+e+".";this.val.setVal_Nochk("save",h+"fn",i);const l=C(this,n,"m",u).call(this,t,1);this.val.setVal_Nochk("save",h+"volume",l);const c=l*Number(this.val.getVal("sys:"+h+"volume",1)),f=(0,P.argChk_Num)(t,"start_ms",0),d=(0,P.argChk_Num)(t,"end_ms",C(F,r,"f",g)),p=(0,P.argChk_Num)(t,"ret_ms",0);if(f<0)throw`[playse] start_ms:${f} が負の値です`;if(p<0)throw`[playse] ret_ms:${p} が負の値です`;if(d>0){if(f>=d)throw`[playse] start_ms:${f} >= end_ms:${d} は異常値です`;if(p>=d)throw`[playse] ret_ms:${p} >= end_ms:${d} は異常値です`}this.val.setVal_Nochk("save",h+"start_ms",f),this.val.setVal_Nochk("save",h+"end_ms",d),this.val.setVal_Nochk("save",h+"ret_ms",p),this.val.flush();const m=L.sound.find(i),y=C(this,s,"f")[e]={now_buf:e,snd:m,loop:o,start_ms:f,end_ms:d,ret_ms:p,resume:!1,playing:()=>!0,onend:()=>{const e=C(this,s,"f")[t.buf=y.now_buf];e&&(delete C(this,s,"f")[t.buf],e.playing=()=>!1,C(this,n,"m",w).call(this,t),e.resume&&this.main.resume())}},b={loop:o,volume:c,speed:(0,P.argChk_Num)(t,"speed",1),sprites:{},loaded:(t,e)=>{if(t)return void this.main.errScript(`Sound ロード失敗ですa fn:${i} ${t}`,!1);if(!e)return;const n=C(this,s,"f")[y.now_buf];n&&(n.snd=e)}};let x="";if(f>0||d<C(F,r,"f",g)){x=`${i};${f};${d};${p}`;const t=b.sprites[x]={start:f/1e3,end:d/1e3};b.preload=!0;const e=b.loaded;b.loaded=(n,s)=>{if(n)return void this.main.errScript(`Sound ロード失敗ですb fn:${i} ${n}`,!1);if(!s)return;const o=s.duration;if(e?.(n,s),t.end<0){if(t.end+=o,s.removeSprites(x),s.addSprites(x,t),t.start>=t.end)throw`[playse] start_ms:${f} >= end_ms:${d}(${1e3*t.end}) は異常値です`;if(p>=1e3*t.end)throw`[playse] ret_ms:${p} >= end_ms:${d}(${1e3*t.end}) は異常値です`}if(t.start>=o)throw`[playse] start_ms:${f} >= 音声ファイル再生時間:${o} は異常値です`;if(d!==C(F,r,"f",g)&&t.end>=o)throw`[playse] end_ms:${d} >= 音声ファイル再生時間:${o} は異常値です`;s.play(x,b.complete)}}else b.autoPlay=!0;if(o?0!==p&&(b.loop=!1,b.complete=t=>{const r=t.duration,o=`${i};loop2;${d};${p}`,a={preload:!0,loop:!0,volume:c,speed:b.speed,sprites:{},loaded:(t,e)=>{if(!e)return;const i=C(this,s,"f")[y.now_buf];i&&(i.snd=e),e.play(o)}},h=a.sprites[o]={start:p/1e3,end:d/1e3};if(h.end<0&&(h.end+=r,t.removeSprites(o),t.addSprites(o,h)),h.start>=r)throw`[playse] ret_ms:${p} >= 音声ファイル再生時間:${r} は異常値です`;C(this,n,"m",v).call(this,e,i,a)}):b.complete=()=>C(this,s,"f")[y.now_buf]?.onend(),C(this,_,"f").call(this),m){if(m.volume=c,x)C(this,n,"m",v).call(this,e,i,b);else if(m.isPlayable){const t=m.options.source;t instanceof ArrayBuffer&&0!==t.byteLength?y.snd=L.Sound.from({...b,url:m.options.url,source:t}):m.play(b)}return!1}const T=(0,P.argChk_Boolean)(t,"join",!0);if(T){const t=b.loaded;b.loaded=(e,i)=>{t?.(e,i),this.main.resume()}}return C(this,n,"m",v).call(this,e,i,b),T},v=function(t,e,i){const n=this.cfg.searchPath(e,D.Config.EXT_SOUND);if(".bin"!==n.slice(-4)){i.url=n;const r=L.Sound.from(i);return t&&(C(this,s,"f")[t].snd=r),void(i.loop||L.sound.add(e,r))}(new k.Loader).add({name:e,url:n,xhrType:k.LoaderResource.XHR_RESPONSE_TYPE.BUFFER}).use(((t,e)=>{this.sys.dec(t.extension,t.data).then((i=>{t.data=i,e?.()})).catch((e=>this.main.errScript(`Sound ロード失敗です fn:${t.name} ${e}`,!1)))})).load(((n,r)=>{i.source=r[e]?.data;const o=L.Sound.from(i);t&&(C(this,s,"f")[t].snd=o),i.loop||L.sound.add(e,o)}))},y=function(){for(const t in C(this,s,"f"))C(this,n,"m",E).call(this,{buf:t});return I(this,s,{},"f"),L.sound.stopAll(),!1},b=function(t){return t.buf="BGM",C(this,n,"m",E).call(this,t)},E=function(t){const{buf:e="SE"}=t;C(this,n,"m",R).call(this,e);const i=C(this,s,"f")[e];return i&&(i.snd?.stop(),i.onend()),!1},x=function(t){return t.buf="BGM",C(this,n,"m",T).call(this,t)},T=function(t){const{buf:e="SE"}=t,i=C(this,s,"f")[e];return!(!i?.twFade||!i.playing())&&(i.resumeFade=C(this,a,"f").waitEvent((()=>C(this,n,"m",w).call(this,t)),(0,P.argChk_Boolean)(t,"canskip",!0),(0,P.argChk_Boolean)(t,"global",!1)))},w=function(t){const{buf:e="SE"}=t;return C(this,s,"f")[e]?.twFade?.stop().end(),!1},S=function(t){return t.buf="BGM",C(this,n,"m",A).call(this,t)},A=function(t){const{buf:e="SE"}=t,i=C(this,s,"f")[e];return!(!i?.playing()||i.loop)&&(i.resume=C(this,a,"f").waitEvent((()=>{t.buf=i.now_buf,C(this,n,"m",E).call(this,t);const e=C(this,s,"f")[t.buf];e?.playing()&&!e.loop&&e.onend()}),(0,P.argChk_Boolean)(t,"canskip",!1),(0,P.argChk_Boolean)(t,"global",!1)))},M=function(t){const{buf:e="SE",buf2:i="SE"}=t;if(e===i)return!1;const n=C(this,s,"f")[e];n&&(n.now_buf=i);const r=C(this,s,"f")[i];r&&(r.now_buf=e),[C(this,s,"f")[e],C(this,s,"f")[i]]=[r,n];const a="const.sn.sound."+e+".",h=Number(this.val.getVal("save:"+a+"volume")),u=Number(this.val.getVal("save:"+a+"fn")),l="const.sn.sound."+i+".",c=Number(this.val.getVal("save:"+l+"volume")),f=Number(this.val.getVal("save:"+l+"fn"));return this.val.setVal_Nochk("save",a+"volume",c),this.val.setVal_Nochk("save",l+"volume",h),this.val.setVal_Nochk("save",a+"fn",f),this.val.setVal_Nochk("save",l+"fn",u),e in C(this,o,"f")==i in C(this,o,"f")&&(e in C(this,o,"f")?(delete C(this,o,"f")[e],C(this,o,"f")[i]=0):(delete C(this,o,"f")[i],C(this,o,"f")[e]=0),this.val.setVal_Nochk("save","const.sn.loopPlaying",JSON.stringify(C(this,o,"f")))),this.val.flush(),!1},O=function(t,e){e?(C(this,o,"f")[t]=0,this.val.setVal_Nochk("save","const.sn.loopPlaying",JSON.stringify(C(this,o,"f"))),this.val.flush()):C(this,n,"m",R).call(this,t)},R=function(t){delete C(this,o,"f")[t],this.val.setVal_Nochk("save","const.sn.loopPlaying",JSON.stringify(C(this,o,"f"))),this.val.flush()},g={value:999e3}},5041:function(t,e,i){"use strict";var n,r,s,o,a=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},h=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.SysApp=void 0;const u=i(5810),l=i(7529),c=i(4965),f=i(5681),d=i(7307),{to_app:p}=window;class g extends u.SysNode{constructor(t={},e={cur:"prj/",crypto:!1,dip:""}){super(t,e),n.add(this),r.set(this,{getAppPath:"",isPackaged:!1,downloads:"",userData:"",getVersion:"",env:{},platform:"",arch:""}),this.readFileSync=p.readFileSync,this.writeFileSync=p.writeFileSync,this.appendFile=p.appendFile,this.ensureFileSync=p.ensureFileSync,this.$path_userdata="",this.$path_downloads="",s.set(this,void 0),this.copyBMFolder=async(t,e)=>{const i=`${this.$path_userdata}storage/${t}/`,n=`${this.$path_userdata}storage/${e}/`;await p.existsSync(i)&&p.copySync(i,n)},this.eraseBMFolder=async t=>{await p.removeSync(`${this.$path_userdata}storage/${t}/`)},this.close=()=>(p.win_close(),!1),this._export=()=>((async()=>{const t=await p.tarFs_pack(this.$path_userdata+"storage/");t.on("end",(()=>{c.CmnLib.debugLog&&console.log("プレイデータをエクスポートしました"),this.fire("sn:exported",new Event("click"))})),t.pipe(await p.createWriteStream(this.$path_downloads+(this.crypto?"":"no_crypto_")+this.cfg.getNs()+(0,c.getDateStr)("-","_","")+".spd"))})(),!1),this._import=()=>{const t=this.flush;return new Promise(((t,e)=>{const i=document.createElement("input");i.type="file",i.accept=".spd, text/plain",i.onchange=()=>{i.files?t(i.files[0].path):e()},i.click()})).then((async e=>{this.flush=()=>{};const i=this.$path_userdata+"storage/";await p.removeSync(i),await p.ensureDirSync(i),(await p.createReadStream(e)).on("end",(async()=>{const e=this.$path_userdata+"storage/data.json"+(this.crypto?"_":""),i=await p.readFileSync(e),n=JSON.parse(this.crypto?this.decStr("json",i):i);if(!n.sys||!n.mark||!n.kidoku)throw new Error("異常なプレイデータです");n.sys[l.SysBase.VALNM_CFG_NS]===this.cfg.oCfg.save_ns?(this.data.sys=n.sys,this.data.mark=n.mark,this.data.kidoku=n.kidoku,this.flush=t,this.flush(),this.val.updateData(n),c.CmnLib.debugLog&&console.log("プレイデータをインポートしました"),this.fire("sn:imported",new Event("click"))):console.error(`別のゲーム【プロジェクト名=${n.sys[l.SysBase.VALNM_CFG_NS]}】のプレイデータです`)})).pipe(await p.tarFs_extract(i))})),!1},this.navigate_to=t=>{const{url:e}=t;if(!e)throw"[navigate_to] urlは必須です";return p.navigate_to(e),!1},this.tglFlscr_sub=async()=>p.setSimpleFullScreen(this.isFullScr=!await p.isSimpleFullScreen()),this.update_check=t=>{const{url:e}=t;if(!e)throw"[update_check] urlは必須です";if("/"!==e.slice(-1))throw"[update_check] urlの最後は/です";return c.CmnLib.debugLog&&d.DebugMng.myTrace(`[update_check] url=${e}`,"D"),(async()=>{let t={},i="",s="";const h=await this.fetch(e+"_index.json");if(h.ok)c.CmnLib.debugLog&&d.DebugMng.myTrace("[update_check] _index.jsonを取得しました","D"),t=await h.json(),s=t.version;else{const t=await this.fetch(e+`latest${c.CmnLib.isMac?"-mac":""}.yml`);if(!t.ok)return void(c.CmnLib.debugLog&&d.DebugMng.myTrace("[update_check] [update_check] .ymlが見つかりません"));c.CmnLib.debugLog&&d.DebugMng.myTrace("[update_check] .ymlを取得しました","D"),i=await t.text();const n=/version: (.+)/.exec(i);if(!n)throw"[update_check] .yml に version が見つかりません";s=n[1]}const u=a(this,r,"f").getVersion;if(c.CmnLib.debugLog&&d.DebugMng.myTrace(`[update_check] 現在ver=${u} 新規ver=${s}`,"D"),s===u)return void(c.CmnLib.debugLog&&d.DebugMng.myTrace("[update_check] バージョン更新なし","I"));const l={title:"アプリ更新",icon:a(this,r,"f").getAppPath+"/app/icon.png",buttons:["OK","Cancel"],defaultId:0,cancelId:1,message:`アプリ【${this.cfg.oCfg.book.title}】に更新があります。\nダウンロードしますか?`,detail:`現在 NOW ver ${u}\n新規 NEW ver ${s}`};if(!((await p.showMessageBox(l)).response>0)){if(c.CmnLib.debugLog&&d.DebugMng.myTrace("[update_check] アプリダウンロード開始","D"),h.ok){const i=a(this,r,"f").platform+"_"+a(this,r,"f").arch;let s=t[i];if(s)await a(this,n,"m",o).call(this,e,i+"-"+s.cn,s.path);else{let i="";const s=[],h=new RegExp("^"+a(this,r,"f").platform+"_");for(const n in t){if(!h.test(n))continue;const r=t[n];i+="\n- "+r.path,s.push({url:e,urlApp:n+"-"+r.cn,fn:String(r.path)})}if(l.message=`CPU = ${a(this,r,"f").arch}\nに対応するファイルが見つかりません。同じOSのファイルをすべてダウンロードしますか?`,l.detail=s.length+" 個ファイルがあります"+i,(await p.showMessageBox(l)).response>0)return;await Promise.allSettled(s.map((t=>a(this,n,"m",o).call(this,t.url,t.urlApp,t.fn))))}}else{const t=/path: (.+)/.exec(i);if(!t)throw"[update_check] path が見つかりません";const s=t[1];c.CmnLib.debugLog&&d.DebugMng.myTrace(`[update_check] path=${s}`,"D");const h=/sha512: (.+)/.exec(i);if(!h)throw"[update_check] sha512 が見つかりません";const u=h[1];c.CmnLib.debugLog&&d.DebugMng.myTrace(`[update_check] sha=${u}=`,"D");const l=/(.+)(\.\w+)/.exec(s)??["","",""];await a(this,n,"m",o).call(this,e,l[1]+"-"+a(this,r,"f").arch+l[2],s)}c.CmnLib.debugLog&&d.DebugMng.myTrace("アプリファイルを保存しました","D"),l.buttons.pop(),l.message=`アプリ【${this.cfg.oCfg.book.title}】の更新パッケージを\nダウンロードしました`,p.showMessageBox(l)}})(),!1},this.window=t=>{const e=(0,c.argChk_Num)(t,"x",Number(this.val.getVal("sys:const.sn.nativeWindow.x",0))),i=(0,c.argChk_Num)(t,"y",Number(this.val.getVal("sys:const.sn.nativeWindow.y",0)));return p.window((0,c.argChk_Boolean)(t,"centering",!1),e,i,c.CmnLib.stageW,c.CmnLib.stageH),this.val.setVal_Nochk("sys","const.sn.nativeWindow.x",e),this.val.setVal_Nochk("sys","const.sn.nativeWindow.y",i),this.flush(),!1},this.canCapturePage=t=>(p.capturePage(t),!0),globalThis.addEventListener("DOMContentLoaded",(async()=>this.loaded(t,e)),{once:!0,passive:!0})}async loaded(t,e){await super.loaded(t,e),h(this,r,await p.getInfo(),"f"),c.CmnLib.isPackaged=a(this,r,"f").isPackaged,this.arg=e={...e,cur:a(this,r,"f").getAppPath.replaceAll("\\","/")+(c.CmnLib.isPackaged?"/doc/":"/")+e.cur},this.$path_downloads=a(this,r,"f").downloads.replaceAll("\\","/")+"/",c.CmnLib.isDbg=Boolean(a(this,r,"f").env.SKYNOVEL_DBG)&&!c.CmnLib.isPackaged,c.CmnLib.isDbg&&(this.extPort=(0,c.uint)(a(this,r,"f").env.SKYNOVEL_PORT??"3776")),this.run()}initVal(t,e,i){e["const.sn.isDebugger"]=!1,e["const.sn.screenResolutionX"]=screen.width,e["const.sn.screenResolutionY"]=screen.height,this.$path_userdata=c.CmnLib.isDbg?a(this,r,"f").getAppPath.slice(0,-3)+".vscode/":a(this,r,"f").userData.replaceAll("\\","/")+"/",p.Store({cwd:this.$path_userdata+"storage",name:this.arg.crypto?"data_":"data",encryptionKey:this.arg.crypto?this.stk():void 0}),this.flush=()=>p.flush(this.data),(async()=>{const n=e["const.sn.isFirstBoot"]=await p.Store_isEmpty();if(n)this.data.sys=t.sys,this.data.mark=t.mark,this.data.kidoku=t.kidoku,this.flush();else{const t=await p.Store_get();this.data.sys=t.sys,this.data.mark=t.mark,this.data.kidoku=t.kidoku}const r=this.data.sys["const.sn.nativeWindow.x"]??0,s=this.data.sys["const.sn.nativeWindow.y"]??0;p.window(n,r,s,c.CmnLib.stageW,c.CmnLib.stageH),p.on("save_win_pos",((t,e,i)=>{this.val.setVal_Nochk("sys","const.sn.nativeWindow.x",e),this.val.setVal_Nochk("sys","const.sn.nativeWindow.y",i),this.flush()})),i(this.data)})()}async run(){if(a(this,s,"f")){const t=10;a(this,s,"f").destroy(t),await new Promise((e=>setTimeout(e,t)))}h(this,s,new f.Main(this),"f")}init(t,e,i,n){super.init(t,e,i,n);const r=new Event("click");return p.on("fire",((t,e)=>n.fire(e,r))),this.cfg.oCfg.debug.devtool?p.openDevTools():p.win_ev_devtools_opened((()=>{console.error("DevToolは禁止されています。許可する場合は【プロジェクト設定】の【devtool】をONに。"),n.destroy()})),[]}cvsResize(){const t=super.cvsResize();if(c.CmnLib.isMac)return t;const e=this.appPixi.view.style;return this.isFullScr?(e.left=`${this.ofsLeft4elm}px`,e.top=`${this.ofsTop4elm}px`,e.position="fixed"):(e.left="",e.top="",e.position="relative"),t}titleSub(t){p.win_setTitle(t)}}e.SysApp=g,r=new WeakMap,s=new WeakMap,n=new WeakSet,o=async function(t,e,i){c.CmnLib.debugLog&&d.DebugMng.myTrace(`[update_check] アプリファイルDL試行... url=${t+e}`,"D");const n=await this.fetch(t+e);if(!n.ok)return void(c.CmnLib.debugLog&&d.DebugMng.myTrace(`[update_check] アプリファイルが見つかりません url=${t+i}`));const s=a(this,r,"f").downloads+"/"+i;c.CmnLib.debugLog&&d.DebugMng.myTrace(`[update_check] pathDL=${s}`,"D");const o=await n.arrayBuffer();await this.writeFileSync(s,new DataView(o))}},7529:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},T=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.SysBase=void 0;const w=i(4965),S=i(7046);class A{constructor(t={},e){this.hPlg=t,this.arg=e,this.hFactoryCls={},this.fetch=t=>fetch(t),this.resolution=1,this.data={sys:{},mark:{},kidoku:{}},r.set(this,0),s.set(this,0),o.set(this,1),a.set(this,0),h.set(this,0),u.set(this,0),l.set(this,0),this.isFullScr=!1,this.extPort=3776,c.set(this,void 0),f.set(this,{auth:t=>{t.t===this.cfg.oCfg.debuger_token?this.toast("接続"):this.end()},continue:()=>this.toast("再生"),disconnect:()=>this.toast("切断"),restart:t=>{this.send2Dbg(t?.ri??"",{}),this.end(),this.run()},pause:()=>this.toast("一時停止"),stopOnEntry:()=>this.toast("一時停止"),stopOnDataBreakpoint:()=>this.toast("注意"),stopOnBreakpoint:()=>this.toast("注意"),stopOnStep:()=>this.toast("一歩進む"),stopOnStepIn:()=>this.toast("ステップイン"),stopOnStepOut:()=>this.toast("ステップアウト"),stopOnBackstep:()=>this.toast("一歩戻る"),_addPath:t=>this.cfg.addPath(t.fn,t.o)}),this.pathBaseCnvSnPath4Dbg="",p.set(this,[]),this.callHook=(t,e)=>{},this.send2Dbg=(t,e)=>{x(this,c,"f")?.emit("data",t,e)},this.copyBMFolder=(t,e)=>{},this.eraseBMFolder=t=>{},this.close=()=>!1,this._export=()=>!1,this._import=()=>!1,this.navigate_to=()=>!1,this.title=t=>{const{text:e}=t;if(!e)throw"[title] textは必須です";return T(this,g,e,"f"),this.titleSub(x(this,g,"f")+x(this,v,"f")),!1},g.set(this,""),m.set(this,(t=>{if(!t.key)return this.tglFlscr_sub(),!1;const e=t.key.toLowerCase();return document.addEventListener("keydown",(t=>{(t.altKey?"Alt"===t.key?"":"alt+":"")+(t.ctrlKey?"Control"===t.key?"":"ctrl+":"")+(t.shiftKey?"Shift"===t.key?"":"shift+":"")+t.key.toLowerCase()===e&&(t.stopPropagation(),this.tglFlscr_sub())}),{passive:!0}),!1})),this.update_check=()=>!1,this.window=()=>!1,v.set(this,""),_.set(this,((t,e)=>({ret:e.toString(),ext_num:0}))),y.set(this,{1:{ext:"jpeg",fnc:t=>x(this,b,"f").call(this,t),mime:"image/jpeg"},2:{ext:"png",fnc:t=>x(this,b,"f").call(this,t),mime:"image/png"},3:{ext:"svg",fnc:t=>x(this,b,"f").call(this,t),mime:"image/svg+xml"},4:{ext:"webp",fnc:t=>x(this,b,"f").call(this,t),mime:"image/webp"},10:{ext:"mp3",fnc:t=>t.arrayBuffer(),mime:"audio/mpeg"},11:{ext:"m4a",fnc:t=>t.arrayBuffer(),mime:"audio/aac"},12:{ext:"ogg",fnc:t=>t.arrayBuffer(),mime:"audio/ogg"},13:{ext:"aac",fnc:t=>t.arrayBuffer(),mime:"audio/aac"},14:{ext:"flac",fnc:t=>t.arrayBuffer(),mime:"audio/flac"},15:{ext:"wav",fnc:t=>t.arrayBuffer(),mime:"audio/wav"},20:{ext:"mp4",fnc:t=>x(this,E,"f").call(this,t),mime:"video/mp4"},21:{ext:"webm",fnc:t=>x(this,E,"f").call(this,t),mime:"video/webm"},22:{ext:"ogv",fnc:t=>x(this,E,"f").call(this,t),mime:"video/ogv"}}),b.set(this,(t=>new Promise(((e,i)=>{const n=new Image;n.onload=()=>e(n),n.onerror=t=>i(t),n.src=URL.createObjectURL(t)})))),E.set(this,(t=>new Promise(((e,i)=>{const n=document.createElement("video");n.addEventListener("error",(()=>i(n?.error?.message??""))),n.addEventListener("canplay",(()=>e(n))),n.src=URL.createObjectURL(t)})))),this.enc=t=>t,this.stk=()=>"",this.hash=t=>"",this.isApp=!1,this.$path_downloads="",this.$path_userdata="",this.canCapturePage=t=>!1}async loaded(t,e){const i=t.snsys_pre;return delete t.snsys_pre,i?.init({addTag:()=>{},addLayCls:()=>{},searchPath:()=>"",getVal:()=>({}),resume:()=>{},render:()=>{},setDec:t=>T(this,_,t,"f"),setEnc:t=>this.enc=t,getStK:t=>this.stk=t,getHash:t=>this.hash=t})}get cur(){return this.arg.cur}get crypto(){return this.arg.crypto}async loadPath(t,e){this.cfg=e}initVal(t,e,i){}flush(){}async run(){}init(t,e,i,n){this.val=i,this.appPixi=e;let r="";try{this.val.setSys(this),r="sys",r+=Number(this.val.getVal("sys:TextLayer.Back.Alpha",1)),r="kidoku",this.val.saveKidoku()}catch(t){console.error(`セーブデータ(${r})が壊れています。一度クリアする必要があります %o`,t)}t.close=t=>this.close(t),t.export=t=>this._export(t),t.import=t=>this._import(t),t.navigate_to=t=>this.navigate_to(t),t.title=t=>this.title(t),t.toggle_full_screen=t=>x(this,m,"f").call(this,t),t.update_check=t=>this.update_check(t),t.window=t=>this.window(t),i.setVal_Nochk("tmp","const.sn.isApp",(()=>this.isApp)),i.setVal_Nochk("tmp","const.sn.isDbg",(()=>w.CmnLib.isDbg)),i.setVal_Nochk("tmp","const.sn.isPackaged",(()=>w.CmnLib.isPackaged)),this.val.defTmp("const.sn.displayState",(()=>this.isFullScr)),i.setVal_Nochk("sys",A.VALNM_CFG_NS,this.cfg.oCfg.save_ns),i.flush(),w.CmnLib.isDbg&&this.attach_debug(n),this.hFactoryCls={};const s=[];for(const e in this.hPlg)s.push(this.hPlg[e].init({addTag:(e,i)=>{if(t[e])throw`すでに定義済みのタグ[${e}]です`;t[e]=i},addLayCls:(t,e)=>{if(this.hFactoryCls[t])throw`すでに定義済みのレイヤcls【${t}】です`;this.hFactoryCls[t]=e},searchPath:(t,e="")=>this.cfg.searchPath(t,e),getVal:i.getVal,resume:()=>n.resume(),render:(t,e,i=!1)=>this.appPixi.renderer.render(t,{renderTexture:e,clear:i}),setDec:t=>T(this,_,t,"f"),setEnc:t=>this.enc=t,getStK:t=>this.stk=t,getHash:t=>this.hash=t}));return s}get cvsWidth(){return x(this,r,"f")}get cvsHeight(){return x(this,s,"f")}get cvsScale(){return x(this,o,"f")}get ofsLeft4elm(){return x(this,a,"f")}get ofsTop4elm(){return x(this,h,"f")}get ofsPadLeft_Dom2PIXI(){return x(this,u,"f")}get ofsPadTop_Dom2PIXI(){return x(this,l,"f")}cvsResize(){const t=x(this,r,"f"),e=x(this,s,"f");let i=globalThis.innerWidth,n=globalThis.innerHeight;const{angle:c=0}=screen.orientation,f=c%180==0?"p":"l";w.CmnLib.isMobile&&("p"===f&&i>n||"l"===f&&i<n)&&([i,n]=[n,i]);const d=this.appPixi.view,p=d.getBoundingClientRect();(0,w.argChk_Boolean)(w.CmnLib.hDip,"expanding",!0)||w.CmnLib.stageW>i||w.CmnLib.stageH>n?(w.CmnLib.stageW/w.CmnLib.stageH<=i/n?(T(this,s,n,"f"),T(this,r,w.CmnLib.stageW/w.CmnLib.stageH*n,"f")):(T(this,r,i,"f"),T(this,s,w.CmnLib.stageH/w.CmnLib.stageW*i,"f")),T(this,o,x(this,r,"f")/w.CmnLib.stageW,"f"),T(this,u,(w.CmnLib.isMobile?(globalThis.innerWidth-x(this,r,"f"))/2:p.left)*(1-x(this,o,"f")),"f"),T(this,l,(w.CmnLib.isMobile?(globalThis.innerHeight-x(this,s,"f"))/2:p.top)*(1-x(this,o,"f")),"f")):(T(this,r,w.CmnLib.stageW,"f"),T(this,s,w.CmnLib.stageH,"f"),T(this,o,1,"f"),T(this,u,0,"f"),T(this,l,0,"f"));const g=d.parentElement.style;d.parentElement===document.body&&(g.position="relative",g.width=`${x(this,r,"f")}px`,g.height=`${x(this,s,"f")}px`);const m=d.style;return m.width=g.width,m.height=g.height,T(this,a,p.left,"f"),T(this,h,p.top,"f"),this.isFullScr&&(T(this,a,x(this,a,"f")+(i-x(this,r,"f"))/2,"f"),T(this,h,x(this,h,"f")+(n-x(this,s,"f"))/2,"f")),t!==x(this,r,"f")||e!==x(this,s,"f")}attach_debug(t){this.attach_debug=()=>{};const e=document.createElement("style");e.innerHTML="/* SKYNovel Dbg */\n.sn_BounceInOut { animation: sn_kfBounceInOut linear 1.5s; }\n@keyframes sn_kfBounceInOut{\n0%\t{opacity: 0;\ttransform: scaleX(0.30) scaleY(0.30);}\n10%\t{opacity: 1;\ttransform: scaleX(1.10) scaleY(1.10);}\n20%\t{\t\t\t\ttransform: scaleX(0.95) scaleY(0.95);}\n30%\t{\t\t\t\ttransform: scaleX(1.00) scaleY(1.00);}\n70%\t{opacity: 1;}\n100%{opacity: 0;}\n}\n.sn_BounceIn { animation: sn_kfBounceIn linear 0.3s; }\n@keyframes sn_kfBounceIn{\n0%\t{opacity: 0;\ttransform: scaleX(0.30) scaleY(0.30);}\n50%\t{opacity: 1;\ttransform: scaleX(1.10) scaleY(1.10);}\n100%{\t\t\t\ttransform: scaleX(0.95) scaleY(0.95);}\n}\n.sn_HopIn { animation: sn_kfHopIn linear 0.8s; }\n@keyframes sn_kfHopIn{\n0%\t{transform:\ttranslate(0px, 0px);}\n15% {transform:\ttranslate(0px, -25px);}\n30% {transform:\ttranslate(0px, 0px);}\n45% {transform:\ttranslate(0px, -15px);}\n60% {transform:\ttranslate(0px, 0px);}\n75% {transform:\ttranslate(0px, -5px);}\n100%{transform:\ttranslate(0px, 0px);}\n}",document.getElementsByTagName("head")[0].appendChild(e),this.addHook(((t,e)=>x(this,f,"f")[t]?.(e))),T(this,c,(0,S.io)(`http://localhost:${this.extPort}`),"f"),x(this,c,"f").on("data",((t,e)=>{this.callHook(t,e)})).on("disconnect",(()=>t.setLoop(!0))),this.callHook=(t,e)=>x(this,p,"f").forEach((i=>i(t,e)))}end(){x(this,c,"f")?.disconnect(),T(this,c,void 0,"f")}toast(t){const e=document.body;e.querySelectorAll(".sn_BounceIn, .sn_HopIn").forEach((t=>e.removeChild(t)));const i=document.createElement("img"),r=x(A,n,"f",d)[t];i.src=`data:image/svg+xml;base64,${r.dat}`;const s=Math.min(w.CmnLib.stageW,w.CmnLib.stageH)/4*x(this,o,"f");i.width=i.height=s,i.style.cssText=`position: absolute;\nleft: ${(w.CmnLib.stageW-s)/2*x(this,o,"f")+s*(r.dx??0)}px;\ntop: ${(w.CmnLib.stageH-s)/2*x(this,o,"f")+s*(r.dy??0)}px;`,i.classList.add("sn_toast",r.ease??"sn_BounceInOut"),r.ease||i.addEventListener("animationend",(()=>e.removeChild(i)),{once:!0,passive:!0}),e.insertBefore(i,this.appPixi.view)}setFire(t){this.fire=t}addHook(t){x(this,p,"f").push(t)}titleSub(t){}tglFlscr_sub(){}setTitleInfo(t){T(this,v,t,"f"),this.titleSub(x(this,g,"f")+x(this,v,"f"))}decStr(t,e){return x(this,_,"f").call(this,t,e).ret}async dec(t,e){const{ret:i,ext_num:n}=x(this,_,"f").call(this,t,e),r=x(this,y,"f")[n];return r?.fnc?await r.fnc(new Blob([i],{type:r.mime})):i}get path_downloads(){return this.$path_downloads}get path_userdata(){return this.$path_userdata}async savePic(t,e){}async appendFile(t,e,i){}async ensureFileSync(t){}}e.SysBase=A,n=A,r=new WeakMap,s=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,u=new WeakMap,l=new WeakMap,c=new WeakMap,f=new WeakMap,p=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,_=new WeakMap,y=new WeakMap,b=new WeakMap,E=new WeakMap,A.VALNM_CFG_NS="const.sn.cfg.ns",d={value:{接続:{dx:-1,dat:"PHN2ZyBoZWlnaHQ9IjY0MCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDY0MCA2NDAiIHdpZHRoPSI2NDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJtNjQwIDMyMGMwIDE3Ni43My0xNDMuMjcgMzIwLTMyMCAzMjBzLTMyMC0xNDMuMjctMzIwLTMyMCAxNDMuMjctMzIwIDMyMC0zMjAgMzIwIDE0My4yNyAzMjAgMzIweiIvPjxwYXRoIGlkPSJiIiBkPSJtMCAyOTJ2NTUuODhoMTI3LjEzYzEyLjM3IDQ2IDU0LjEyIDc5Ljg3IDEwNCA3OS44N2g3Ny44N3YtMjE1LjYyYy00Ni43MyAwLTcyLjY4IDAtNzcuODggMC00OS43NCAwLTkxLjYyIDMzLjg3LTEwMy45OSA3OS44Ny0xNi45NSAwLTU5LjMzIDAtMTI3LjEzIDB6Ii8+PHBhdGggaWQ9ImMiIGQ9Im01MTIuODggMjkyYy0xMi4zOC00Ni01NC4xMy03OS44Ny0xMDQtNzkuODctNS4yMSAwLTMxLjIxIDAtNzggMHYyMTUuNzRoNzcuODdjNDkuODggMCA5MS43NS0zMy44NyAxMDQtNzkuODdoMTI3LjI1di01NmMtNzYuMjcgMC0xMTguNjUgMC0xMjcuMTIgMHoiLz48L2RlZnM+PHVzZSBmaWxsPSIjMmUyZTJlIiB4bGluazpocmVmPSIjYSIvPjx1c2UgZmlsbD0ibm9uZSIgeGxpbms6aHJlZj0iI2EiLz48dXNlIGZpbGw9IiMzYWFiZDIiIHhsaW5rOmhyZWY9IiNiIi8+PHVzZSBmaWxsPSJub25lIiB4bGluazpocmVmPSIjYiIvPjx1c2UgZmlsbD0iIzNhYWJkMiIgeGxpbms6aHJlZj0iI2MiLz48dXNlIGZpbGw9Im5vbmUiIHhsaW5rOmhyZWY9IiNjIi8+PC9zdmc+"},切断:{dat:"PHN2ZyBoZWlnaHQ9IjY0MCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDY0MCA2NDAiIHdpZHRoPSI2NDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJtNjQwIDMyMGMwIDE3Ni43My0xNDMuMjcgMzIwLTMyMCAzMjBzLTMyMC0xNDMuMjctMzIwLTMyMCAxNDMuMjctMzIwIDMyMC0zMjAgMzIwIDE0My4yNyAzMjAgMzIweiIvPjxwYXRoIGlkPSJiIiBkPSJtMTkxLjUzIDIyMS4yNGMtNDUuNjggMC04NC4wMSAzMS4wNC05NS4zIDczLjE2LTYuNDEgMC0zOC40OSAwLTk2LjIzIDB2NTEuMjFoOTYuMjNjMTEuMyA0Mi4xMSA0OS42MyA3My4xNiA5NS4zIDczLjE2aDcxLjMzdi00OC4yNGg1My43OHYtMTAxLjA1aC01My43OHYtNDguMjRjLTQyLjggMC02Ni41NyAwLTcxLjMzIDB6Ii8+PHBhdGggaWQ9ImMiIGQ9Im00NDguNDcgMjIxLjIzYy00Ljc2IDAtMjguNTMgMC03MS4zMyAwdjE5Ny41M2g3MS4zM2M0NS42OCAwIDgzLjk5LTMxLjA0IDk1LjI5LTczLjE1aDk2LjI0di01MS4yMWgtOTYuMjRjLTMzLjA4LTQ4Ljc4LTY0Ljg0LTczLjE3LTk1LjI5LTczLjE3eiIvPjwvZGVmcz48dXNlIGZpbGw9IiMyZTJlMmUiIHhsaW5rOmhyZWY9IiNhIi8+PHVzZSBmaWxsPSJub25lIiB4bGluazpocmVmPSIjYSIvPjx1c2UgZmlsbD0iI2RmNTY1NiIgeGxpbms6aHJlZj0iI2IiLz48dXNlIGZpbGw9Im5vbmUiIHhsaW5rOmhyZWY9IiNiIi8+PHVzZSBmaWxsPSIjZGY1NjU2IiB4bGluazpocmVmPSIjYyIvPjx1c2UgZmlsbD0ibm9uZSIgeGxpbms6aHJlZj0iI2MiLz48L3N2Zz4="},再生:{dat:"PHN2ZyBoZWlnaHQ9IjY0MCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDY0MCA2NDAiIHdpZHRoPSI2NDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJtMCAzMjBjMCAxNzYuNzIgMTQzLjI4IDMyMCAzMjAgMzIwczMyMC0xNDMuMjggMzIwLTMyMC0xNDMuMjgtMzIwLTMyMC0zMjAtMzIwIDE0My4yOC0zMjAgMzIwem0yNTguODMgMTExLjA1Yy0xLjI5Ljc5LTIuOTMuODMtNC4yNi4wNC0xLjI5LS43NC0yLjExLTIuMTItMi4xMS0zLjY3IDAtNy4xNiAwLTQyLjk3IDAtMTA3LjQzczAtMTAwLjI3IDAtMTA3LjQzYzAtMS41My44Mi0yLjkzIDIuMTEtMy42OCAxLjMzLS43NiAyLjk3LS43MiA0LjI2LjA0IDE4IDEwLjc1IDE2MiA5Ni43MSAxODAgMTA3LjQ2IDEuMjkuNzMgMi4wNSAyLjE0IDIuMDUgMy42MSAwIDEuNDktLjc2IDIuODgtMi4wNSAzLjYzLTM2IDIxLjQ5LTE2MiA5Ni42OS0xODAgMTA3LjQzeiIvPjwvZGVmcz48cGF0aCBkPSJtMTU0LjU3IDE3MC4xOWgzNDYuMTV2MzA3LjY5aC0zNDYuMTV6IiBmaWxsPSIjZmZmIi8+PHVzZSBmaWxsPSIjMmUyZTJlIiB4bGluazpocmVmPSIjYSIvPjx1c2UgZmlsbD0ibm9uZSIgeGxpbms6aHJlZj0iI2EiLz48L3N2Zz4="},一時停止:{dat:"PHN2ZyBoZWlnaHQ9IjY0MCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDY0MCA2NDAiIHdpZHRoPSI2NDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJtMCAzMjBjMCAxNzYuNzIgMTQzLjI4IDMyMCAzMjAgMzIwczMyMC0xNDMuMjggMzIwLTMyMC0xNDMuMjgtMzIwLTMyMC0zMjAtMzIwIDE0My4yOC0zMjAgMzIwem0yMDAgMTAwdi0yMDBoODB2MjAwem0xNjAgMHYtMjAwaDgwdjIwMHoiLz48L2RlZnM+PHBhdGggZD0ibTE0Ny40OSAxODAuNDFoMzUyLjR2MjgyLjY5aC0zNTIuNHoiIGZpbGw9IiNmZmYiLz48dXNlIGZpbGw9IiMyZTJlMmUiIHhsaW5rOmhyZWY9IiNhIi8+PHVzZSBmaWxsPSJub25lIiB4bGluazpocmVmPSIjYSIvPjwvc3ZnPg=="},注意:{ease:"sn_HopIn",dat:"PHN2ZyBoZWlnaHQ9IjY0MCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDY0MCA2NDAiIHdpZHRoPSI2NDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJtMzQzLjM0IDI5LjJjLTEwLjM3LTE3Ljk3LTM2LjMxLTE3Ljk3LTQ2LjY5IDAtMjkuMyA1MC43NS0yNjMuNyA0NTYuNzQtMjkzIDUwNy40OS0xMC4zNyAxNy45NyAyLjU5IDQwLjQ0IDIzLjM0IDQwLjQ0aDU4Ni4wMWMyMC43NSAwIDMzLjcyLTIyLjQ2IDIzLjM1LTQwLjQ0LTU4LjYtMTAxLjUtMjYzLjctNDU2Ljc0LTI5My4wMS01MDcuNDl6bS0yMy4zNCA0ODIuODNjLTE0LjUyIDAtMjYuMjktMi43MS0yNi4yOS02LjA2IDAtNC4yMSAwLTM3Ljg2IDAtNDIuMDcgMC0zLjM1IDExLjc3LTYuMDcgMjYuMjktNi4wN3MyNi4yOSAyLjcyIDI2LjI5IDYuMDd2NDIuMDdjLTcuODQgNC4wNC0xNi42MSA2LjA2LTI2LjI5IDYuMDZ6bTIxLjk5LTEwMy44NGMwIDUuNDMtOS44NSA5LjgzLTIxLjk5IDkuODMtMTIuMTUgMC0yMS45OS00LjQtMjEuOTktOS44MyAwLS4xMy4wNy0uMjUuMDgtLjM4LTEuMzctMTcuNTYtMTIuMy0xNTguMDYtMTMuNjctMTc1LjYyIDAtNS40MyAxNS45My05Ljg0IDM1LjU4LTkuODRzMzUuNTggNC40MSAzNS41OCA5Ljg0Yy0uOTEgMTEuNy01LjQ3IDcwLjI1LTEzLjY3IDE3NS42Mi4wNi4xNi4wOC4yOS4wOC4zOHoiLz48L2RlZnM+PHBhdGggZD0ibTI0MS4yOSAxOTEuNDRoMTQ1LjQ5djM1MS42NmgtMTQ1LjQ5eiIgZmlsbD0iI2ZmZiIvPjx1c2UgZmlsbD0iI2QyYmYzYSIgeGxpbms6aHJlZj0iI2EiLz48dXNlIGZpbGw9Im5vbmUiIHhsaW5rOmhyZWY9IiNhIi8+PC9zdmc+"},一歩進む:{ease:"sn_BounceIn",dat:"PHN2ZyBoZWlnaHQ9IjY0MCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDY0MCA2NDAiIHdpZHRoPSI2NDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJtMCAzMjBjMCAxNzYuNzIgMTQzLjI4IDMyMCAzMjAgMzIwczMyMC0xNDMuMjggMzIwLTMyMC0xNDMuMjgtMzIwLTMyMC0zMjAtMzIwIDE0My4yOC0zMjAgMzIwem0zNzYuOTMgOTEuOTdjMC01My41MSAwLTgzLjI0IDAtODkuMTktLjE1LjE0LS4yNS4zNC0uNDQuNDUtMTYuMTEgOS42Mi0xNDQuOTUgODYuNTQtMTYxLjA2IDk2LjE1LTEuMTUuNjktMi42Mi43My0zLjgxLjAyLTEuMTUtLjY0LTEuODktMS44OS0xLjg5LTMuMjggMC02LjQxIDAtMzguNDQgMC05Ni4xMSAwLTU3LjY5IDAtODkuNzQgMC05Ni4xNSAwLTEuMzUuNzQtMi42MiAxLjg5LTMuMjkgMS4xOS0uNjggMi42Ni0uNjQgMy44MS4wNCAxNi4xMSA5LjYyIDE0NC45NSA4Ni41NCAxNjEuMDYgOTYuMTYuMTkuMS4yOS4zMS40NC40NSAwLTYuMTMgMC0zNi43NyAwLTkxLjkyaDUzLjMydjE4Ni42N3oiLz48L2RlZnM+PHBhdGggZD0ibTE0Ny40OSAxNTQuMmgzNTIuNHYzMDguOWgtMzUyLjR6IiBmaWxsPSIjZmZmIi8+PHVzZSBmaWxsPSIjMmUyZTJlIiB4bGluazpocmVmPSIjYSIvPjx1c2UgZmlsbD0ibm9uZSIgeGxpbms6aHJlZj0iI2EiLz48L3N2Zz4="},一歩戻る:{ease:"sn_BounceIn",dat:"PHN2ZyBoZWlnaHQ9IjY0MCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDY0MCA2NDAiIHdpZHRoPSI2NDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJtMCAzMjBjMCAxNzYuNzIgMTQzLjI4IDMyMCAzMjAgMzIwczMyMC0xNDMuMjggMzIwLTMyMC0xNDMuMjgtMzIwLTMyMC0zMjAtMzIwIDE0My4yOC0zMjAgMzIwem00MzAuMjcgOTYuMTRjMCAxLjM1LS43NCAyLjYyLTEuODkgMy4yOC0xLjE5LjY5LTIuNjYuNjUtMy44MS0uMDMtMTYuMTEtOS42Mi0xNDQuOTUtODYuNTQtMTYxLjA1LTk2LjE2LS4yLS4xLS4yOS0uMzEtLjQ1LS40NXY5MS45MmgtNTMuMzJ2LTE4Ni42N2g1My4zMnY4OS4xOWMuMTYtLjE0LjI1LS4zNC40NS0uNDUgMTYuMS05LjYyIDE0NC45NC04Ni41NCAxNjEuMDUtOTYuMTYgMS4xNS0uNjggMi42Mi0uNzIgMy44MS0uMDEgMS4xNS42NCAxLjg5IDEuODkgMS44OSAzLjI4djk2LjExeiIvPjwvZGVmcz48cGF0aCBkPSJtMTQ3LjQ5IDE1NC4yaDM1Mi40djMwOC45aC0zNTIuNHoiIGZpbGw9IiNmZmYiLz48dXNlIGZpbGw9IiMyZTJlMmUiIHhsaW5rOmhyZWY9IiNhIi8+PHVzZSBmaWxsPSJub25lIiB4bGluazpocmVmPSIjYSIvPjwvc3ZnPg=="},ステップイン:{ease:"sn_BounceIn",dat:"PHN2ZyBoZWlnaHQ9IjY0MCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDY0MCA2NDAiIHdpZHRoPSI2NDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJtMCAzMTkuOTljMCAxNzYuNzQgMTQzLjI3IDMyMC4wMSAzMjAuMDEgMzIwLjAxIDE3Ni43MiAwIDMxOS45OS0xNDMuMjcgMzE5Ljk5LTMyMC4wMSAwLTE3Ni43Mi0xNDMuMjctMzE5Ljk5LTMxOS45OS0zMTkuOTktMTc2Ljc0IDAtMzIwLjAxIDE0My4yNy0zMjAuMDEgMzE5Ljk5em0xNTMuMDUtMjkuNzIgNTUuMTItNTUuMTMgMTExLjg0IDExMS44MiAxMTEuODItMTExLjgyIDU1LjEyIDU1LjEyLTE2Ni45NCAxNjYuOTd6Ii8+PC9kZWZzPjxwYXRoIGQ9Im0xNDcuNDkgMTU0LjJoMzUyLjR2MzA4LjloLTM1Mi40eiIgZmlsbD0iI2ZmZiIvPjx1c2UgZmlsbD0iIzJlMmUyZSIgeGxpbms6aHJlZj0iI2EiLz48dXNlIGZpbGw9Im5vbmUiIHhsaW5rOmhyZWY9IiNhIi8+PC9zdmc+"},ステップアウト:{ease:"sn_BounceIn",dat:"PHN2ZyBoZWlnaHQ9IjY0MCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDY0MCA2NDAiIHdpZHRoPSI2NDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJtMCAzMjAuMDFjMCAxNzYuNzIgMTQzLjI3IDMxOS45OSAzMTkuOTkgMzE5Ljk5IDE3Ni43NCAwIDMyMC4wMS0xNDMuMjcgMzIwLjAxLTMxOS45OSAwLTE3Ni43NC0xNDMuMjctMzIwLjAxLTMyMC4wMS0zMjAuMDEtMTc2LjcyIDAtMzE5Ljk5IDE0My4yNy0zMTkuOTkgMzIwLjAxem0zMTkuOTktMjYuOTgtMTExLjgyIDExMS44My01NS4xMi01NS4xMyAxNjYuOTQtMTY2Ljk2IDE2Ni45NiAxNjYuOTYtNTUuMTIgNTUuMTN6Ii8+PC9kZWZzPjxwYXRoIGQ9Im0xNDcuNDkgMTU0LjJoMzUyLjR2MzA4LjloLTM1Mi40eiIgZmlsbD0iI2ZmZiIvPjx1c2UgZmlsbD0iIzJlMmUyZSIgeGxpbms6aHJlZj0iI2EiLz48dXNlIGZpbGw9Im5vbmUiIHhsaW5rOmhyZWY9IiNhIi8+PC9zdmc+"}}}},5810:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SysNode=void 0;const n=i(7529),r=i(4965);class s extends n.SysBase{constructor(){super(...arguments),this.isApp=!0}async loadPath(t,e){await super.loadPath(t,e);const i=this.arg.cur+"path.json",n=await this.readFileSync(i),r=JSON.parse(this.decStr(i,n));for(const e in r){const i=t[e]=r[e];for(const t in i)":cnt"!==t&&(i[t]=this.arg.cur+i[t])}}async savePic(t,e){const i=e.slice(e.indexOf(",",20)+1);try{await this.writeFileSync(t,Buffer.from(i,"base64")),r.CmnLib.debugLog&&console.log(`画像ファイル ${t} を保存しました`)}catch(t){throw t}}async readFileSync(t){return""}async writeFileSync(t,e,i){}}e.SysNode=s},1028:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x,T,w,S,A,M,O,R,C,I,P,N,D,L,k,B,F,G,U,j,X,H,z,W,V,Y,$,q,Z,K,J=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},Q=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.TxtLayer=void 0;const tt=i(1481),et=i(4965),it=i(7411),nt=i(3422),rt=i(8911),st=i(7007),ot=i(6761),at=i(5844),ht=i(6841);class ut extends tt.Layer{constructor(){super(),n.add(this),v.set(this,0),_.set(this,0),y.set(this,!1),b.set(this,void 0),E.set(this,""),x.set(this,new it.TxtStage(this.spLay,(()=>this.canFocus()),J(ut,r,"f",d))),T.set(this,new rt.RubySpliter),w.set(this,new ht.Container),A.set(this,""),M.set(this,!0),R.set(this,""),P.set(this,""),N.set(this,(t=>"")),D.set(this,(t=>t)),L.set(this,""),k.set(this,new RegExp("[ ]")),this.isCur=!1,B.set(this,(()=>"")),F.set(this,""),U.set(this,!1),j.set(this,((t,e)=>{J(ut,r,"f",s).oCfg.debug.putCh&&console.log(`🖊 文字表示 text:\`${t}\` ruby:\`${e}\` name:\`${this.name_}\``);const i=e.split("|");let h="";const u=J(ut,r,"f",f).isSkippingByKeyDown();switch(i.length){case 1:if(Q(this,U,!0,"f"),"\n"===t){if(J(this,V,"f"))return h=J(this,V,"f").slice(-1)[0],J(this,n,"m",Z).call(this),J(this,W,"f").push(ut.rec("<br/>")),J(this,W,"f").push(h),Q(this,V,J(this,W,"f"),"f"),void Q(this,W,[],"f");J(this,z,"f")?(Q(this,z,!1,"f"),h="<ruby> <rt> </rt></ruby><br/>"):h="<br/>";break}J(this,z,"f")&&(Q(this,z,!1,"f"),""===e&&(e=" ")),h=J(this,n,"m",X).call(this,t,e,u,J(this,F,"f"));break;case 2:switch(i[0]){case"start":case"left":case"center":case"right":case"justify":case"121":case"even":case"1ruby":Q(this,z,!1,"f"),Q(this,U,!0,"f"),h=J(this,n,"m",X).call(this,t,i[1],u,i[0]);break;case"gotxt":if(J(this,n,"m",Z).call(this),this.isCur&&J(ut,r,"f",a).call(ut,J(this,W,"f").join("").replace(/^<ruby> <rt> <\/rt><\/ruby>(<br\/>)+/,"").replace(/style='(anim\S+ \S+?;\s*)+/g,"style='").replace(/( style=''| data-(add|arg|cmd)='.+?'|\n+|\t+)/g,"").replace(/class='sn_ch .+?'/g,"class='sn_ch'").replaceAll("class='offrec'","style='display: none;'").replaceAll("`","\\`")),!J(this,U,"f"))return;return J(this,x,"f").goTxt(J(this,W,"f")),Q(this,U,!1,"f"),void Q(this,H,0,"f");case"add":{const t=JSON.parse(i[1]);if(t.style??="",J(this,n,"m",q).call(this,t),J(this,V,"f"))J(this,n,"m",Z).call(this);else{u&&Q(this,H,0,"f");const e=Number(t.wait??-1),i=0===e?"":` sn_ch_in_${J(this,A,"f")}`,n=e<0?"":` animation-duration: ${e}ms;`;J(this,W,"f").push(`<span class='sn_ch${i}' style='animation-delay: ${J(this,H,"f")}ms;${n} ${t.style}' data-add='${JSON.stringify(t)}'>`)}Q(this,V,J(this,W,"f"),"f"),Q(this,W,[],"f")}return;case"add_close":return void J(this,n,"m",Z).call(this);case"grp":Q(this,U,!0,"f");{u&&Q(this,H,0,"f");const t=(i[1]?i[1].slice(0,-1)+",":"{")+`"delay": ${J(this,H,"f")}}`;J(this,M,"f")&&Q(this,H,J(this,H,"f")+(J(ut,r,"f",p)?0:at.LayerMng.msecChWait),"f");const e=JSON.parse(t);if(e.style??="","id"in e||(e.id=J(this,W,"f").length),"break"===e.id)return void J(this,x,"f").dispBreak(e.pic);h=`<span data-cmd='grp' data-id='${e.id}' data-arg='${t}'`;const n=Number(e.wait??-1),s=n<0?"":` animation-duration: ${n}ms;`;if(h+=` class='sn_ch${0===n?"":` sn_ch_in_${J(this,A,"f")}`}' style='animation-delay: ${J(this,H,"f")}ms;${s} ${e.style}' data-add='{"ch_in_style":"${J(this,A,"f")}", "ch_out_style":"${J(this,R,"f")}"}'> </span>`,J(this,z,"f")&&(Q(this,z,!1,"f"),h=`<ruby>${h}<rt> </rt></ruby>`),J(this,W,"f").slice(-1)[0]===h)return}break;case"del":if("break"!==i[1])throw"文字レイヤdelコマンドは、現在id=breakのみサポートします";return void it.TxtStage.delBreak();case"span":J(this,n,"m",Z).call(this),Q(this,U,!0,"f");{const t=JSON.parse(i[1]);if(J(this,n,"m",q).call(this,t),!t.style)return;u&&Q(this,H,0,"f");const e=Number(t.wait??-1),r=0===e?"":` sn_ch_in_${J(this,A,"f")}`,s=e<0?"":` animation-duration: ${e}ms;`;J(this,W,"f").push(`<span class='sn_ch${r}' style='animation-delay: ${J(this,H,"f")}ms;${s} ${t.style}' data-add='{"ch_in_style":"${J(this,A,"f")}", "ch_out_style":"${J(this,R,"f")}"}'>`),Q(this,V,J(this,W,"f"),"f"),Q(this,W,[],"f")}return;case"link":J(this,n,"m",Z).call(this),Q(this,U,!0,"f");{const t=JSON.parse(i[1]);t.style??="",J(this,n,"m",q).call(this,t),u&&Q(this,H,0,"f");const e=Number(t.wait??-1),r=0===e?"":` sn_ch_in_${J(this,A,"f")}`,s=e<0?"":` animation-duration: ${e}ms;`;Q(this,Y,` data-cmd='link' data-arg='${i[1]}'`,"f"),J(this,W,"f").push(`<span${J(this,Y,"f")} class='sn_ch${r}' style='animation-delay: ${J(this,H,"f")}ms;${s} ${t.style}' data-add='{"ch_in_style":"${J(this,A,"f")}", "ch_out_style":"${J(this,R,"f")}"}'>`),Q(this,V,J(this,W,"f"),"f"),Q(this,W,[],"f")}return;case"endlink":return Q(this,U,!0,"f"),J(this,V,"f")&&Q(this,W,J(this,W,"f").map((t=>t.replace(/ data-cmd='linkrsv'/,J(this,Y,"f")))),"f"),void J(this,n,"m",Z).call(this);default:Q(this,U,!0,"f"),h=J(this,n,"m",X).call(this,t,e,u,J(this,F,"f"))}break;case 3:if(Q(this,z,!1,"f"),Q(this,U,!0,"f"),"tcy"!==i[0])throw`異常な値です putCh(text: ${t}, ruby: ${e})`;{J(ut,r,"f",o).doRecLog()&&Q(this,K,J(this,K,"f")+(t+(e?`《${e}》`:"")),"f");const n=i[1],s=n.length>1?J(this,W,"f").length+1:"",a=et.CmnLib.isSafari?i[2].replace(/[A-Za-z0-9]/g,(t=>String.fromCharCode(t.charCodeAt(0)+65248))):i[2];u&&Q(this,H,0,"f");const l=this.mkStyle_r_align(n,a,J(this,F,"f")),c=` data-add='{"ch_in_style":"${J(this,A,"f")}", "ch_out_style":"${J(this,R,"f")}"}'`,f=`<span data-tcy='${s}' style='\ntext-combine-upright: all;\n-webkit-text-combine: horizontal;\n${J(this,N,"f").call(this,n)}`;h=a?J(this,V,"f")?`<ruby>${f}'${c} data-cmd='linkrsv'>${n}</span>\n\t\t\t\t\t\t\t<rt${l}>${a}</rt></ruby>`:`<span class='sn_ch sn_ch_in_${J(this,A,"f")}' style='animation-delay: ${J(this,H,"f")}ms;'>\n\t\t\t\t\t\t\t<ruby>${f}'${c}>${n}</span>\n\t\t\t\t\t\t\t<rt${l}>${a}</rt></ruby>\n\t\t\t\t\t\t</span>`:J(this,V,"f")?`${f}'${c} data-cmd='linkrsv'>${n}</span>`:`${f}\n\t\t\t\t\t\t\tanimation-delay: ${J(this,H,"f")}ms;\n\t\t\t\t\t\t\theight: 1em;\n\t\t\t\t\t\t' class='sn_ch sn_ch_in_${J(this,A,"f")}'${c}>${n}</span>`,J(this,M,"f")&&Q(this,H,J(this,H,"f")+(J(ut,r,"f",p)?J(ut,r,"f",g)[t.charAt(0)]??0:at.LayerMng.msecChWait),"f")}}J(this,W,"f").push(ut.rec(h))})),H.set(this,0),z.set(this,!0),W.set(this,[]),V.set(this,void 0),Y.set(this,""),$.set(this,{ch_in_style:"",ch_out_style:"",r_align:""}),this.click=()=>!this.spLay.interactiveChildren||!this.spLay.visible||J(this,x,"f").skipChIn(),K.set(this,""),this.addButton=t=>new Promise((e=>{t.key=`btn=[${J(this,w,"f").children.length}] `+this.name_,t[":id_tag"]=t.key.slice(0,-7),(0,et.argChk_Boolean)(t,"hint_tate",J(this,x,"f").tategaki);const i=new ot.Button(t,J(ut,r,"f",f),(()=>e()),(()=>this.canFocus()));i.name=JSON.stringify(t).replaceAll('"',"'"),J(this,w,"f").addChild(i)})),this.record=()=>Object.assign(super.record(),{enabled:this.enabled,r_align:J(this,F,"f"),b_do:void 0===J(this,b,"f")?void 0:J(this,b,"f")instanceof ht.Sprite?"Sprite":"Graphics",b_pic:J(this,E,"f"),b_color:J(this,v,"f"),b_alpha:J(this,_,"f"),b_alpha_isfixed:J(this,y,"f"),ffs:J(this,P,"f"),txs:J(this,x,"f").record(),strNoFFS:J(this,L,"f"),btns:J(this,w,"f").children.map((t=>t.name))}),this.spLay.addChild(J(this,x,"f")),J(this,T,"f").init(J(this,j,"f")),this.spLay.addChild(J(this,w,"f")),J(this,w,"f").name="cntBtn",this.lay({style:`width: ${et.CmnLib.stageW}px; height: ${et.CmnLib.stageH}px; font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif; color: white; font-size: 24px; line-height: 1.5; padding: 16px;`,in_style:"default",out_style:"default",back_clear:"true"})}static init(t,e,i,n,c,f){Q(ut,r,t,"f",s),it.TxtStage.init(t,f),Q(ut,r,i,"f",o),Q(ut,r,n,"f",a),Q(ut,r,c,"f",h),i.setDoRecProc(ut.chgDoRec),e.autowc=t=>J(ut,r,"m",m).call(ut,t),e.autowc({enabled:"false",text:"",time:""}),e.ch_in_style=t=>J(ut,r,"m",u).call(ut,t),e.ch_out_style=t=>J(ut,r,"m",l).call(ut,t),it.TxtStage.initChStyle(),(0,et.initStyle)();let d="";t.matchPath(".+",nt.Config.EXT_FONT).forEach((t=>{for(const e in t)d+=`\n@font-face {\n\tfont-family: '${t[e]}';\n\tsrc: url('${J(this,r,"f",s).searchPath(t[e],nt.Config.EXT_FONT)}');\n}\n`})),d+="\n.sn_tx {\n\tpointer-events: none;\n\tuser-select: none;\n\t-webkit-touch-callout: none;\n\tbox-sizing: border-box;\n}\n.sn_ch {\n\tposition: relative;\n\tdisplay: inline-block;\n}\n",(0,et.addStyle)(d),J(ut,r,"m",u).call(ut,{name:"default",wait:500,alpha:0,x:"=0.3",y:"=0",scale_x:1,scale_y:1,rotate:0,join:!0,ease:"ease-out"}),J(ut,r,"m",l).call(ut,{name:"default",wait:0,alpha:0,x:"=0",y:"=0",scale_x:1,scale_y:1,rotate:0,join:!1,ease:"ease-out"})}static setEvtMng(t,e,i){Q(ut,r,t,"f",c),Q(ut,r,e,"f",f),Q(ut,r,i,"f",d),it.TxtStage.setEvtMng(e)}destroy(){J(this,b,"f")&&(this.spLay.removeChild(J(this,b,"f")).destroy(),Q(this,b,void 0,"f")),this.clearText(),J(this,x,"f").destroy(),Q(ut,r,!1,"f",p),Q(ut,r,{},"f",g),ut.rec=t=>t}set name(t){this.name_=t,J(this,x,"f").name=t}get name(){return this.name_}cvsResize(){J(this,x,"f").cvsResize()}cvsResizeChildren(){J(this,w,"f").children.forEach((t=>t.cvsResize()))}lay(t){return super.lay(t),tt.Layer.setXY(this.spLay,t,this.spLay),t[":id_tag"]=this.name_.slice(0,-7),rt.RubySpliter.setting(t),J(this,n,"m",I).call(this,t),J(this,x,"f").lay(t),"r_align"in t&&Q(this,F,t.r_align??"","f"),Q(this,B,et.CmnLib.isSafari?J(this,x,"f").tategaki?(t,e)=>`text-align: start; height: ${e}em; padding-top: ${t}; padding-bottom: ${t};`:(t,e)=>`text-align: start; width: ${e}em; padding-left: ${t}; padding-right: ${t};`:J(this,x,"f").tategaki?t=>`text-align: justify; text-align-last: justify; padding-top: ${t}; padding-bottom: ${t};`:t=>`text-align: justify; text-align-last: justify; padding-left: ${t}; padding-right: ${t};`,"f"),et.CmnLib.isFirefox&&(this.mkStyle_r_align=J(this,n,"m",G)),"alpha"in t&&J(this,w,"f").children.forEach((t=>t.alpha=this.spLay.alpha)),J(this,n,"m",S).call(this,t),J(this,n,"m",O).call(this,t),J(this,n,"m",C).call(this,t,(t=>{t&&J(ut,r,"f",c).resume()}))}get width(){return J(this,x,"f").getWidth}get height(){return J(this,x,"f").getHeight}chgBackAlpha(t){const e=J(this,y,"f")?J(this,_,"f"):t*J(this,_,"f");J(this,b,"f")instanceof ht.Graphics&&(J(this,b,"f")&&(this.spLay.removeChild(J(this,b,"f")),J(this,b,"f").destroy()),this.spLay.addChildAt(Q(this,b,new ht.Graphics,"f").beginFill(J(this,v,"f")).lineStyle(void 0).drawRect(0,0,J(this,x,"f").getWidth,J(this,x,"f").getHeight).endFill(),0),J(this,b,"f").name="back(color)"),J(this,b,"f")&&(J(this,b,"f").visible=e>0,J(this,b,"f").alpha=e)}static chgDoRec(t){ut.rec=t?t=>t:t=>`<span class='offrec'>${t}</span>`}mkStyle_r_align(t,e,i){if(!i)return"";const n=2*t.length;if(n-e.length<0)return` style='text-align: ${i};'`;let r="";switch(i){case"justify":r=J(this,B,"f").call(this,"0",n);break;case"121":r=J(this,B,"f").call(this,`calc(${(n-e.length)/(2*e.length)}em)`,n);break;case"even":r=J(this,B,"f").call(this,`calc(${(n-e.length)/(e.length+1)}em)`,n);break;case"1ruby":r=J(this,B,"f").call(this,"1em",n);break;default:r=`text-align: ${i};`}return` style='${r}'`}tagCh(t){J(this,T,"f").putTxt(t)}clearText(){this.spLay.addChild(Q(this,x,J(this,x,"f").reNew(),"f")),Q(this,H,0,"f"),Q(this,z,!0,"f"),Q(this,W,[],"f"),Q(this,V,void 0,"f"),Q(this,K,"","f"),J(ut,r,"f",a).call(ut,"",!0)}get pageText(){return J(this,K,"f").replace("《 》","")}get enabled(){return this.spLay.interactiveChildren}set enabled(t){this.spLay.interactiveChildren=t}canFocus(){return(this.spLay.interactiveChildren??!1)&&this.spLay.visible&&J(ut,r,"f",h).call(ut,this)}clearLay(t){super.clearLay(t),this.clearText(),J(this,w,"f").removeChildren().forEach((t=>t.destroy()))}playback(t,e){super.playback(t,e),this.enabled=t.enabled,Q(this,F,t.r_align,"f"),this.cvsResize(),J(this,n,"m",I).call(this,t),J(this,x,"f").playback(t.txs),Q(this,_,t.b_alpha,"f"),Q(this,y,t.b_alpha_isfixed,"f"),e.push(new Promise((e=>{J(this,n,"m",C).call(this,t.b_do?"Sprite"===t.b_do?{b_pic:t.b_pic}:{b_color:t.b_color}:{b_pic:""},(t=>{t&&e()}))||e()})));const i=t.btns;e=e.concat(i.map((t=>this.addButton(JSON.parse(t.replaceAll("'",'"'))))))}snapshot(t,e){t.render(this.spLay,{clear:!1}),J(this,x,"f").snapshot(t,e)}snapshot_end(){J(this,x,"f").snapshot_end()}makeDesignCast(t){this.spLay.visible&&J(this,x,"f").makeDesignCast(t)}makeDesignCastChildren(t){this.spLay.visible&&J(this,w,"f").children.forEach((e=>e.makeDesignCast(t)))}showDesignCast(){J(this,x,"f").showDesignCast()}showDesignCastChildren(){J(this,w,"f").children.forEach((t=>t.showDesignCast()))}dump(){return J(this,j,"f").call(this,"","gotxt|"),super.dump()+`, "enabled":"${this.enabled}", ${J(this,x,"f").dump()}, "b_pic":"${J(this,E,"f")}", "b_color":"${J(this,v,"f")}", "b_alpha":${J(this,_,"f")}, "b_alpha_isfixed":"${J(this,y,"f")}", "width":${J(this,x,"f").getWidth}, "height":${J(this,x,"f").getHeight}, "pixi_obj":[${this.spLay.children.map((t=>`{"class":"${t instanceof ht.Sprite?"Sprite":t instanceof ht.Graphics?"Graphics":t instanceof ht.Container?"Container":"?"}", "name":"${t.name}", "alpha":${t.alpha}, "x":${t.x}, "y":${t.y}, "visible":"${t.visible}"}`)).join(",")}], "button":[${J(this,w,"f").children.map((t=>t.children[0].name??"{}")).join(",")}]`}}e.TxtLayer=ut,r=ut,v=new WeakMap,_=new WeakMap,y=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakMap,T=new WeakMap,w=new WeakMap,A=new WeakMap,M=new WeakMap,R=new WeakMap,P=new WeakMap,N=new WeakMap,D=new WeakMap,L=new WeakMap,k=new WeakMap,B=new WeakMap,F=new WeakMap,U=new WeakMap,j=new WeakMap,H=new WeakMap,z=new WeakMap,W=new WeakMap,V=new WeakMap,Y=new WeakMap,$=new WeakMap,K=new WeakMap,n=new WeakSet,u=function(t){const e=it.TxtStage.ch_in_style(t),i="="===e.x.charAt(0)?100*e.nx+"%":`${e.nx}px`,n="="===e.y.charAt(0)?100*e.ny+"%":`${e.ny}px`,{name:r}=t;return(0,et.addStyle)(`\n.sn_ch_in_${r} {\n\tposition: relative;\n\tdisplay: inline-block;\n}\n.go_ch_in_${r} {\n\topacity: ${e.alpha};\n\tposition: relative;\n\tdisplay: inline-block;\n\tanimation: sn_ch_in_${r} ${e.wait}ms ${e.ease} 0s both;\n}\n@keyframes sn_ch_in_${r} {\n\tfrom {transform: rotate(${e.rotate}deg) scale(${e.scale_x}, ${e.scale_y}) translate(${i}, ${n});}\n\tto {opacity: 1; transform: none;}\n}\n`),!1},l=function(t){const e=it.TxtStage.ch_out_style(t),i="="===e.x.charAt(0)?100*e.nx+"%":`${e.nx}px`,n="="===e.y.charAt(0)?100*e.ny+"%":`${e.ny}px`,{name:r}=t;return(0,et.addStyle)(`\n.go_ch_out_${r} {\n\tposition: relative;\n\tdisplay: inline-block;\n\tanimation: go_ch_out_${r} ${e.wait}ms ${e.ease} 0s both;\n}\n@keyframes go_ch_out_${r} {\n\tto {\n\t\topacity: ${e.alpha};\n\t\ttransform: rotate(${e.rotate}deg) scale(${e.scale_x}, ${e.scale_y}) translate(${i}, ${n});\n\t}\n`),!1},m=function(t){Q(ut,r,(0,et.argChk_Boolean)(t,"enabled",J(ut,r,"f",p)),"f",p),J(ut,r,"f",o).setVal_Nochk("save","const.sn.autowc.enabled",J(ut,r,"f",p));const{text:e}=t;if("text"in t!="time"in t)throw"[autowc] textとtimeは同時指定必須です";if(J(ut,r,"f",o).setVal_Nochk("save","const.sn.autowc.text",e),!e)return J(ut,r,"f",o).setVal_Nochk("save","const.sn.autowc.time",""),!1;const i=e.length;if(J(ut,r,"f",p)&&0===i)throw'[autowc] enabled === false かつ text === "" は許されません';const n=String(t.time).split(",");if(n.length!==i)throw"[autowc] text文字数とtimeに記述された待ち時間(コンマ区切り)は同数にして下さい";return Q(ut,r,{},"f",g),n.forEach(((t,i)=>J(ut,r,"f",g)[e[i]]=(0,et.uint)(t))),J(ut,r,"f",o).setVal_Nochk("save","const.sn.autowc.time",t.time),!1},S=function(t){const{in_style:e}=t;if(!e)return;const i=it.TxtStage.getChInStyle(e);if(!i)throw`存在しないin_style【${e}】です`;Q(this,A,e,"f"),Q(this,M,i.join,"f")},O=function(t){const{out_style:e}=t;if(e){if(!it.TxtStage.getChOutStyle(e))throw`存在しないout_style【${e}】です`;Q(this,R,e,"f")}},C=function(t,e){if("back_clear"in t)return(0,et.argChk_Boolean)(t,"back_clear",!1)&&(Q(this,v,0,"f"),Q(this,_,0,"f"),Q(this,y,!1,"f"),Q(this,E,"","f")),e(!1),!1;Q(this,_,(0,et.argChk_Num)(t,"b_alpha",J(this,_,"f")),"f"),Q(this,y,(0,et.argChk_Boolean)(t,"b_alpha_isfixed",J(this,y,"f")),"f");const i=(J(this,y,"f")?1:Number(J(ut,r,"f",o).getVal("sys:TextLayer.Back.Alpha")))*J(this,_,"f");if(t.b_pic){if(J(this,E,"f")!==t.b_pic)return Q(this,E,t.b_pic,"f"),J(this,b,"f")&&(this.spLay.removeChild(J(this,b,"f")),J(this,b,"f").destroy()),st.GrpLayer.csv2Sprites(J(this,E,"f"),this.spLay,(t=>{Q(this,b,t,"f"),t.name="back(pic)",t.visible=i>0,t.alpha=i,J(this,x,"f").setSize(t.width,t.height),this.spLay.setChildIndex(t,0),e(!0)}))}else"b_color"in t&&(Q(this,v,(0,et.argChk_Color)(t,"b_color",0),"f"),J(this,b,"f")&&(this.spLay.removeChild(J(this,b,"f")),J(this,b,"f").destroy()),Q(this,E,"","f"),this.spLay.addChildAt(Q(this,b,new ht.Graphics,"f").beginFill(J(this,v,"f")).lineStyle(void 0).drawRect(0,0,J(this,x,"f").getWidth,J(this,x,"f").getHeight).endFill(),0),J(this,b,"f").name="back(color)");return J(this,b,"f")&&(J(this,b,"f").visible=i>0,J(this,b,"f").alpha=i),e(!1),!1},I=function(t){"noffs"in t&&(Q(this,L,t.noffs??"","f"),Q(this,k,new RegExp(`[ ${J(this,L,"f")}]`),"f")),"ffs"in t&&(Q(this,P,J(this,P,"f")??"","f"),""===J(this,P,"f")?(Q(this,N,(()=>""),"f"),Q(this,D,(t=>t),"f")):(Q(this,N,(t=>J(this,k,"f").test(t)?"":` font-feature-settings: ${J(this,P,"f")};`),"f"),Q(this,D,(t=>J(this,k,"f").test(t)?t:`<span style='font-feature-settings: ${J(this,P,"f")};'>${t}</span>`),"f")))},G=function(t,e,i){if(!i)return"";const n=2*t.length;if(n-e.length<0)return` style='text-align: ${i};'`;let r="";switch(i){case"left":case"right":r="ruby-align: start;";break;case"center":r="ruby-align: center;";break;case"justify":r="ruby-align: space-between;";break;case"121":r="ruby-align: space-around;";break;case"even":const t=(n-e.length)/(e.length+1);r="ruby-align: space-between; "+(J(this,x,"f").tategaki?`padding-top: ${t}em; padding-bottom: ${t}em;`:`padding-left: ${t}em; padding-right: ${t}em;`);break;case"1ruby":r="ruby-align: space-between; "+(J(this,x,"f").tategaki?"padding-top: 1em; padding-bottom: 1em;":"padding-left: 1em; padding-right: 1em;");break;default:r=`text-align: ${i};`}return` style='${r}'`},X=function(t,e,i,n){" "===t&&(t="&nbsp;"),J(ut,r,"f",o).doRecLog()&&Q(this,K,J(this,K,"f")+(t+(e?`《${e}》`:"")),"f");let s="";const a=this.mkStyle_r_align(t,e,n);i&&Q(this,H,0,"f");const h=` data-add='{"ch_in_style":"${J(this,A,"f")}", "ch_out_style":"${J(this,R,"f")}"}'`;return s=e?J(this,V,"f")?`<ruby style='${J(this,N,"f").call(this,t)}'${h} data-cmd='linkrsv'>${t}<rt${a}>${e}</rt></ruby>`:`<span class='sn_ch sn_ch_in_${J(this,A,"f")}' style='animation-delay: ${J(this,H,"f")}ms;${J(this,N,"f").call(this,t)}'>\n\t\t\t\t\t<ruby${h}>${t}<rt${a}>${e}</rt></ruby>\n\t\t\t\t</span>`:J(this,V,"f")?J(this,D,"f").call(this,t):`<span class='sn_ch sn_ch_in_${J(this,A,"f")}' style='animation-delay: ${J(this,H,"f")}ms;${J(this,N,"f").call(this,t)}'${h}>${t}</span>`,J(this,M,"f")&&Q(this,H,J(this,H,"f")+(J(ut,r,"f",p)?J(ut,r,"f",g)[t.charAt(0)]??0:at.LayerMng.msecChWait),"f"),s},q=function(t){J(this,$,"f").ch_in_style=J(this,A,"f"),J(this,n,"m",S).call(this,t),J(this,$,"f").ch_out_style=J(this,R,"f"),J(this,n,"m",O).call(this,t),J(this,$,"f").r_align=J(this,F,"f"),"r_align"in t&&Q(this,F,t.r_align,"f")},Z=function(){J(this,V,"f")&&(J(this,V,"f").push(J(this,W,"f"),"</span>"),Q(this,W,Array.prototype.concat.apply([],J(this,V,"f")),"f"),Q(this,V,void 0,"f"),J(this,n,"m",S).call(this,{in_style:J(this,$,"f").ch_in_style}),J(this,n,"m",O).call(this,{out_style:J(this,$,"f").ch_out_style}),Q(this,F,J(this,$,"f").r_align,"f"))},s={value:void 0},o={value:void 0},a={value:void 0},h={value:void 0},c={value:void 0},f={value:void 0},d={value:void 0},p={value:!1},g={value:{}},ut.rec=t=>t},7411:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x,T,w,S,A,M,O,R,C,I,P,N,D,L,k,B,F,G,U,j,X,H,z,W,V=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},Y=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.TxtStage=void 0;const $=i(4965),q=i(8566),Z=i(7007),K=i(7307),J=i(4412),Q=i(6841),tt=i(6194);class et extends Q.Container{constructor(t,e,i){super(),this.spLay=t,this.canFocus=e,this.sys=i,n.add(this),h.set(this,document.createElement("span")),u.set(this,new Q.Container),l.set(this,new Q.Graphics),c.set(this,new J.TxtLayDesignCast(this.spLay,this)),f.set(this,new J.TxtLayPadDesignCast(this)),d.set(this,{fontsize:24,$width:0,$height:0,pad_left:0,pad_right:0,pad_top:0,pad_bottom:0}),p.set(this,!1),g.set(this,0),m.set(this,0),_.set(this,0),y.set(this,!1),b.set(this,0),E.set(this,0),w.set(this,void 0),S.set(this,[]),A.set(this,[]),M.set(this,0),I.set(this,void 0),P.set(this,/animation\-duration: (?<ms>\d+)ms;/),N.set(this,(()=>{})),L.set(this,!1),U.set(this,0),X.set(this,"Quadratic.Out"),H.set(this,"Quadratic.Out"),W.set(this,void 0),V(this,h,"f").classList.add("sn_tx"),V(this,h,"f").style.position="absolute",V(et,r,"f",o).view.parentElement.appendChild(V(this,h,"f")),this.addChild(V(this,u,"f")),this.addChild(V(this,l,"f")),V(this,l,"f").name="grpDbgMasume",V(this,c,"f").adopt(V(this,f,"f"))}static init(t,e){Y(et,r,t,"f",s),Y(et,r,e,"f",o),Y(et,r,/[、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々]/,"f",O),Y(et,r,/[[({〈「『【〔“〝]/,"f",R),Y(et,r,/[─‥…]/,"f",C)}static setEvtMng(t){Y(et,r,t,"f",a)}static destroy(){Y(et,r,{backgroundColor:0,borderBottomWidth:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},"f",x),Y(et,r,Object.create(null),"f",k),Y(et,r,Object.create(null),"f",F),Y(et,r,new Q.Container,"f",G)}lay(t){const e=V(this,h,"f").style;if(t.style){const i=document.createElement("span");i.style.cssText=t.style;const n=i.style.length;for(let t=0;t<n;++t){const n=i.style[t];n in V(et,r,"f",x)?K.DebugMng.myTrace(`${n}は指定できません`,"W"):e[n]=i.style[n]}!i.style.opacity&&"alpha"in t&&(e.opacity=String(this.spLay.alpha))}else"alpha"in t&&(e.opacity=String(this.spLay.alpha));if("width"in t&&(e.width=(t.width??"0")+"px"),"height"in t&&(e.height=(t.height??"0")+"px"),"pl"in t&&(e.paddingLeft=(t.pl??"0")+"px"),"pr"in t&&(e.paddingRight=(t.pr??"0")+"px"),"pt"in t&&(e.paddingTop=(t.pt??"0")+"px"),"pb"in t&&(e.paddingBottom=(t.pb??"0")+"px"),V(this,n,"m",v).call(this),V(this,c,"f").sethArg(t),Y(this,_,this.spLay.position.x-($.CmnLib.isSafari&&!$.CmnLib.isMobile&&V(this,y,"f")?V(this,d,"f").pad_left+V(this,d,"f").pad_right:0),"f"),e.transformOrigin=`${this.spLay.pivot.x}px ${this.spLay.pivot.y}px`,this.cvsResize(),e.display=this.spLay.visible?"inline":"none",e.textShadow=t.filter??e.textShadow??"",Y(this,p,(0,$.argChk_Boolean)(t,"break_fixed",V(this,p,"f")),"f"),Y(this,g,(0,$.argChk_Num)(t,"break_fixed_left",V(this,g,"f")),"f"),Y(this,m,(0,$.argChk_Num)(t,"break_fixed_top",V(this,m,"f")),"f"),":redraw"in t&&V(this,M,"f")>0){const t=[V(this,h,"f").innerHTML.replace(/(animation-delay: )\d+ms/g,"$10ms"),"<span class='sn_ch' data-add='{\"ch_in_style\":\"default\"}'> </span>"];V(this,n,"m",z).call(this),this.goTxt(t)}}cvsResize(){const t=V(this,h,"f").style;t.left=`${this.sys.ofsLeft4elm+V(this,_,"f")*this.sys.cvsScale}px`,t.top=`${this.sys.ofsTop4elm+this.spLay.position.y*this.sys.cvsScale}px`,t.transform=`rotate(${this.spLay.angle}deg) scale(${this.spLay.scale.x*this.sys.cvsScale}, ${this.spLay.scale.y*this.sys.cvsScale})`,V(this,c,"f").cvsResize(),V(this,f,"f").cvsResize()}get tategaki(){return V(this,y,"f")}get infTL(){return V(this,d,"f")}get getWidth(){return V(this,d,"f").$width}get getHeight(){return V(this,d,"f").$height}setSize(t,e){V(this,d,"f").$width=t,V(this,d,"f").$height=e,V(this,h,"f").style.width=V(this,d,"f").$width+"px",V(this,h,"f").style.height=V(this,d,"f").$height+"px"}goTxt(t){V(et,r,"f",G).visible=!1;const e=V(this,A,"f").length;0===e?(V(et,r,"f",s).oCfg.debug.masume&&($.CmnLib.debugLog&&console.log(`🍌 masume ${this.name} v:${this.visible} l:${this.x} t:${this.y} a:${this.alpha} pl:${V(this,d,"f").pad_left} pr:${V(this,d,"f").pad_right} pt:${V(this,d,"f").pad_top} pb:${V(this,d,"f").pad_bottom} w:${V(this,d,"f").$width} h:${V(this,d,"f").$height}`),V(this,l,"f").clear().beginFill(3407616,.2).lineStyle(1,3407616,1).drawRect(-V(this,d,"f").pad_left,-V(this,d,"f").pad_top,V(this,d,"f").$width,V(this,d,"f").$height).endFill().beginFill(13311,.2).lineStyle(2,13311,1).drawRect(0,0,V(this,d,"f").$width-V(this,d,"f").pad_left-V(this,d,"f").pad_right,V(this,d,"f").$height-V(this,d,"f").pad_top-V(this,d,"f").pad_bottom).endFill()),V(this,h,"f").innerHTML=[...t].join("").replaceAll(/[\n\t]/g,"")):V(this,h,"f").insertAdjacentHTML("beforeend",t.slice(V(this,M,"f")).join("").replaceAll(/[\n\t]/g,"")),Y(this,M,t.length,"f");let i=0,o=2;do{const t=Y(this,A,V(this,n,"m",j).call(this,V(this,h,"f")),"f");if(i=t.length,1!==this.sys.cvsScale){const e=this.sys.ofsPadLeft_Dom2PIXI+parseFloat(V(this,h,"f").style.left)*(1-this.sys.cvsScale),n=this.sys.ofsPadTop_Dom2PIXI+parseFloat(V(this,h,"f").style.top)*(1-this.sys.cvsScale);for(let r=0;r<i;++r){const i=t[r].rect;i.x-=e,i.y-=n,i.x/=this.sys.cvsScale,i.y/=this.sys.cvsScale,i.width/=this.sys.cvsScale,i.height/=this.sys.cvsScale}}if(i<2)break;let e=-1/0;for(;o<i;++o){const n=t[o];if("<rt"===n.elm.outerHTML.slice(0,3))continue;const s=this.tategaki?n.rect.y:n.rect.x;if(e<=s){e=s;continue}e=-1/0;const a=o;if(V(et,r,"f",C).test(t[o-1].ch)&&t[o-1].ch===n.ch)--o;else{if(V(et,r,"f",R).test(t[o-1].ch))--o;else{if(!V(et,r,"f",O).test(n.ch))continue;for(;o>0&&V(et,r,"f",O).test(t[--o].ch););}for(;o>0&&V(et,r,"f",R).test(t[o-1].ch);)--o}const h=t[o].elm.parentElement,u=document.createElement("br");if(h.classList.contains("sn_tx"))h.insertBefore(u,t[o].elm);else{const t=h.parentElement;t.classList.contains("sn_ch")?t.parentElement.insertBefore(u,t):t.insertBefore(u,h)}o+=2,o<a&&(o=a),i=-1;break}}while(i<0);const c=$.CmnLib.debugLog?(t,e)=>console.log(`🍌 masume ch:${t.ch} x:${e.x} y:${e.y} w:${e.width} h:${e.height}`):()=>{},f=V(et,r,"f",s).oCfg.debug.masume?(t,e)=>{c(t,e),V(this,l,"f").beginFill(6737151,.5).lineStyle(2,16724736,1).drawRect(e.x,e.y,e.width,e.height).endFill()}:()=>{},p=q.CmnTween.ease(V(this,X,"f")),v=V(this,h,"f").getBoundingClientRect(),_=v.left+globalThis.scrollX+V(this,d,"f").pad_left,b=v.top+globalThis.scrollY+V(this,d,"f").pad_top;let E=new Q.Rectangle;for(let t=e;t<i;++t){const e=V(this,A,"f")[t],i=e.rect,s=JSON.parse(e.arg??'{"delay": 0}'),o=JSON.parse(e.add??"{}"),h=V(et,r,"f",k)[o.ch_in_style];switch(i.x-=_,i.y-=b,f(e,i),h&&(V(this,y,"f")?(i.x+=(i.width-i.height)/2,i.width=i.height):(i.y+=(i.height-i.width)/2,i.height=i.width),E=i),e.cmd){case"grp":const l=new Q.Container;V(this,u,"f").addChild(l),Z.GrpLayer.csv2Sprites(s.pic,l,(t=>{V(this,n,"m",D).call(this,l,s,o,i,p,h??{}),l.parent||l.removeChild(t)}));break;case"link":const c=new Q.Sprite;s.key=`lnk=[${t}] `+this.name,V(this,n,"m",D).call(this,c,s,o,i,p,h??{}),s.hint_tate??=V(this,y,"f");const f=e.elm.style.cssText,d=s.style_hover??"",g=s.style_clicked??"";V(et,r,"f",a).button(s,c,(()=>e.elm.style.cssText=f),V(this,I,"f")!==e.elm?()=>!!this.canFocus()&&(e.elm.style.cssText=d,!0):()=>!1,(()=>e.elm.style.cssText=g)),Y(this,I,e.elm,"f"),V(this,u,"f").addChild(c)}}const x=V(this,h,"f").querySelectorAll("span.sn_ch");x.forEach((t=>t.className=t.className.replace(/sn_ch_in_([^\s"]+)/g,"go_ch_in_$1"))),Y(this,L,!0,"f"),Y(this,N,(()=>{Y(this,L,!1,"f"),x.forEach((t=>t.className=t.className.replace(/ go_ch_in_[^\s"]+/g,""))),e!==i&&(Y(this,g,E.x+(V(this,y,"f")?0:E.width),"f"),Y(this,m,E.y+(V(this,y,"f")?E.height:0),"f")),V(et,r,"f",G).position.set(V(this,g,"f"),V(this,m,"f")),V(et,r,"f",G).visible=!0,Y(this,N,(()=>{}),"f")}),"f");const T=x.length;if(0===T)return void V(this,N,"f").call(this);let w;for(let t=T-1;t>=0;--t){const e=x[t];if("sn_ch"===e.className)break;const i=e.getAttribute("style");if(!i){w=e;break}const n=i.match(V(this,P,"f"))?.groups;if(!n||Number(n.ms)>0){w=e;break}}w?w.addEventListener("animationend",V(this,N,"f"),{once:!0,passive:!0}):V(this,N,"f").call(this)}skipChIn(){let t=V(this,L,"f");return V(this,N,"f").call(this),V(this,S,"f").forEach((e=>{e.tw&&(e.tw.stop().end(),t=!0)})),Y(this,S,[],"f"),t}static initChStyle(){Y(et,r,Object.create(null),"f",k),Y(et,r,Object.create(null),"f",F)}static getChInStyle(t){return V(et,r,"f",k)[t]}static ch_in_style(t){const{name:e}=t;if(!e)throw"nameは必須です";if(V(et,r,"f",B).lastIndex=0,V(et,r,"f",B).test(e))throw`name【${e}】に使えない文字が含まれます`;if(e in V(et,r,"f",k))throw`name【${e}】はすでにあります`;const i=String(t.x??"=0"),n=String(t.y??"=0");return V(et,r,"f",k)[e]={wait:(0,$.argChk_Num)(t,"wait",500),alpha:(0,$.argChk_Num)(t,"alpha",0),x:i,y:n,nx:parseFloat("="===i.charAt(0)?i.slice(1):i),ny:parseFloat("="===n.charAt(0)?n.slice(1):n),scale_x:(0,$.argChk_Num)(t,"scale_x",1),scale_y:(0,$.argChk_Num)(t,"scale_y",1),rotate:(0,$.argChk_Num)(t,"rotate",0),join:(0,$.argChk_Boolean)(t,"join",!0),ease:t.ease??"ease-out"}}static getChOutStyle(t){return V(et,r,"f",F)[t]}static ch_out_style(t){const{name:e}=t;if(!e)throw"nameは必須です";if(V(et,r,"f",B).lastIndex=0,V(et,r,"f",B).test(e))throw`name【${e}】に使えない文字が含まれます`;if(e in V(et,r,"f",F))throw`name【${e}】はすでにあります`;const i=String(t.x??"=0"),n=String(t.y??"=0");return V(et,r,"f",F)[e]={wait:(0,$.argChk_Num)(t,"wait",500),alpha:(0,$.argChk_Num)(t,"alpha",0),x:i,y:n,nx:parseFloat("="===i.charAt(0)?i.slice(1):i),ny:parseFloat("="===n.charAt(0)?n.slice(1):n),scale_x:(0,$.argChk_Num)(t,"scale_x",1),scale_y:(0,$.argChk_Num)(t,"scale_y",1),rotate:(0,$.argChk_Num)(t,"rotate",0),join:(0,$.argChk_Boolean)(t,"join",!1),ease:t.ease??"ease-out"}}dispBreak(t){const e=V(et,r,"f",G);e.visible=!1,this.addChild(e),Z.GrpLayer.csv2Sprites(t,e,(t=>{e.parent||e.removeChild(t)}))}static delBreak(){const t=V(et,r,"f",G);t.parent&&(t.parent.removeChild(t),t.removeChildren()),Y(et,r,new Q.Container,"f",G)}reNew(){V(this,n,"m",z).call(this);const t=new et(this.spLay,(()=>this.canFocus()),this.sys);return Y(t,d,V(this,d,"f"),"f"),V(t,h,"f").style.cssText=V(this,h,"f").style.cssText,Y(t,_,V(this,_,"f"),"f"),t.name=this.name,V(t,n,"m",v).call(t),V(t,c,"f").sethArg(V(this,c,"f").gethArg()),Y(t,w,V(this,w,"f"),"f"),Y(t,X,V(this,X,"f"),"f"),Y(t,H,V(this,H,"f"),"f"),Y(t,p,V(this,p,"f"),"f"),Y(t,g,V(this,g,"f"),"f"),Y(t,m,V(this,m,"f"),"f"),this.destroy(),t}record(){return{infTL:V(this,d,"f"),cssText:V(this,h,"f").style.cssText,left:V(this,_,"f"),idc_hArg:V(this,c,"f").gethArg(),ch_filter:V(this,w,"f"),fi_easing:V(this,X,"f"),fo_easing:V(this,H,"f"),break_fixed:V(this,p,"f"),break_fixed_left:V(this,g,"f"),break_fixed_top:V(this,m,"f")}}playback(t){Y(this,d,t.infTL,"f"),this.position.set(V(this,d,"f").pad_left,V(this,d,"f").pad_top),V(this,h,"f").style.cssText=t.cssText,Y(this,_,t.left,"f"),V(this,n,"m",v).call(this),V(this,c,"f").sethArg(t.idc_hArg),Y(this,w,t.ch_filter,"f"),Y(this,X,t.fi_easing,"f"),Y(this,H,t.fo_easing,"f"),Y(this,p,t.break_fixed??!1,"f"),Y(this,g,t.break_fixed_left??0,"f"),Y(this,m,t.break_fixed_top??0,"f")}snapshot(t,e){V(this,n,"m",T).call(this,(i=>{Y(this,W,new Q.Sprite(i),"f"),V(this,y,"f")&&(V(this,W,"f").x+=$.CmnLib.stageW-(V(this,_,"f")+V(this,d,"f").$width)-($.CmnLib.isSafari&&!$.CmnLib.isMobile?0:V(this,d,"f").pad_left+V(this,d,"f").pad_right)),V(this,W,"f").y-=V(this,E,"f"),V(this,W,"f").texture.frame=new Q.Rectangle(0,0,V(this,d,"f").$width-V(this,_,"f"),V(this,d,"f").$height),V(this,u,"f").addChild(V(this,W,"f")),t.render(V(this,W,"f"),void 0,!1),e()}),!1)}snapshot_end(){V(this,W,"f")&&(V(this,u,"f").removeChild(V(this,W,"f")),Y(this,W,void 0,"f"))}makeDesignCast(t){t(V(this,c,"f"));const e=V(this,c,"f").gethArg();V(this,f,"f").sethArg({...e,":id_dc":e[":id_tag"]+"_pad"}),t(V(this,f,"f"))}showDesignCast(){V(this,c,"f").visible=!0,V(this,f,"f").visible=!0}dump(){const t=[],e=V(this,h,"f").style,i=e.length;for(let n=0;n<i;++n){const i=e[n];t.push(`"${i}":"${e[i].replace(/(["\\])/g,"\\$1")}"`)}return`"txt":"${V(this,h,"f").textContent.replace(/(["\\])/g,"\\$1")}", "style":{${t.join(",")}}`}destroy(){et.delBreak(),V(this,h,"f").parentElement.removeChild(V(this,h,"f")),this.removeChild(V(this,u,"f")),this.removeChild(V(this,l,"f")),super.destroy()}}e.TxtStage=et,r=et,h=new WeakMap,u=new WeakMap,l=new WeakMap,c=new WeakMap,f=new WeakMap,d=new WeakMap,p=new WeakMap,g=new WeakMap,m=new WeakMap,_=new WeakMap,y=new WeakMap,b=new WeakMap,E=new WeakMap,w=new WeakMap,S=new WeakMap,A=new WeakMap,M=new WeakMap,I=new WeakMap,P=new WeakMap,N=new WeakMap,L=new WeakMap,U=new WeakMap,X=new WeakMap,H=new WeakMap,W=new WeakMap,n=new WeakSet,v=function(){const t=V(this,h,"f").style,e=parseFloat(t.fontSize||"0");V(this,d,"f").fontsize=e,V(this,d,"f").pad_left=parseFloat(t.paddingLeft||"0"),V(this,d,"f").pad_right=parseFloat(t.paddingRight||"0"),V(this,d,"f").pad_top=parseFloat(t.paddingTop||"0"),V(this,d,"f").pad_bottom=parseFloat(t.paddingBottom||"0"),V(this,d,"f").$width=parseFloat(t.width||"0"),V(this,d,"f").$height=parseFloat(t.height||"0"),this.position.set(V(this,d,"f").pad_left,V(this,d,"f").pad_top),Y(this,y,"vertical-rl"===t.writingMode,"f"),Y(this,b,0,"f"),Y(this,E,0,"f");const i=t.lineHeight??"0";Y(this,U,V(this,y,"f")?0:("px"===i.slice(-2)?parseFloat(i):e*parseFloat(i)-e)/2,"f")},T=function(t,e=!0){const i={escape:t=>t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1"),mimeType:t=>{const e=function(t){return/\.([^\.\/]*?)$/g.exec(t)?.[1]??""}(t).toLowerCase();return function(){const t="application/font-woff",e="image/jpeg";return{woff:t,woff2:t,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:e,jpeg:e,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"}}()[e]||""},dataAsUrl:function(t,e){return"data:"+e+";base64,"+t},isDataUrl:function(t){return-1!==t.search(/^(data:)/)},resolveUrl:function(t,e){const i=document.implementation.createHTMLDocument(),n=i.createElement("base");i.head.appendChild(n);const r=i.createElement("a");return i.body.appendChild(r),n.href=e,r.href=t,r.href},getAndEncode:function(t){return new Promise((function(e){const i=new XMLHttpRequest;function n(t){console.error(t),e("")}i.onreadystatechange=function(){if(4!==i.readyState)return;if(200!==i.status)return void n("cannot fetch resource: "+t+", status: "+i.status);const r=new FileReader;r.onloadend=function(){const t=r.result.toString().split(/,/)[1];e(t)},r.readAsDataURL(i.response)},i.ontimeout=function(){n("timeout of 30000ms occured while fetching resource: "+t)},i.responseType="blob",i.timeout=3e4,i.open("GET",t,!0),i.send()}))},asArray:t=>{const e=[],i=t.length;for(let n=0;n<i;++n)e.push(t[n]);return e}},n=function(){const t=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,i,s){return e(t)?Promise.resolve(t).then(n).then((e=>{let n=Promise.resolve(t);for(const t of e)n=n.then((e=>r(e,t,i,s)));return n})):Promise.resolve(t)},shouldProcess:e};function e(e){return-1!==e.search(t)}function n(e){const n=[];let r;for(;r=t.exec(e);)n.push(r[1]);return n.filter((function(t){return!i.isDataUrl(t)}))}function r(t,e,n,r){return Promise.resolve(e).then((t=>n?i.resolveUrl(t,n):t)).then(r||i.getAndEncode).then((t=>i.dataAsUrl(t,i.mimeType(e)))).then((n=>t.replace(function(t){return new RegExp("(url\\(['\"]?)("+i.escape(t)+")(['\"]?\\))","g")}(e),"$1"+n+"$3")))}}(),r=function(){return{resolveAll:function(){return t().then((t=>Promise.allSettled(t.map((t=>t.resolve()))))).then((t=>t.join("\n")))},impl:{readAll:t}};function t(){return Promise.resolve(i.asArray(document.styleSheets)).then((function(t){const e=[];for(const n of t)try{if(n.href)continue;i.asArray(n.cssRules||[]).forEach(e.push.bind(e))}catch(t){console.error("Error while reading CSS rules from "+n.href,t.toString())}return e})).then((function(t){return t.filter((t=>t.type===CSSRule.FONT_FACE_RULE)).filter((t=>n.shouldProcess(t.style.getPropertyValue("src"))))})).then((e=>e.map(t)));function t(t){return{resolve:function(){const e=(t.parentStyleSheet||{}).href;return n.inlineAll(t.cssText,e)},src:function(){return t.style.getPropertyValue("src")}}}}}();Promise.resolve(V(this,h,"f")).then((t=>{const i=t.cloneNode(!0);return i.style.padding="0px",i.style.paddingRight=V(this,b,"f")+"px",i.style.paddingTop=V(this,E,"f")+"px",i.style.left="0px",i.style.top="0px",i.style.width=V(this,d,"f").$width-V(this,d,"f").pad_left-V(this,d,"f").pad_right+"px",i.style.height=V(this,d,"f").$height-V(this,d,"f").pad_top-V(this,d,"f").pad_bottom+"px",V(this,h,"f").hidden=e,i})).then((function(t){return r.resolveAll().then((e=>{const i=document.createElement("style");return t.appendChild(i),i.appendChild(document.createTextNode(e)),t}))})).then((t=>{t.setAttribute("xmlns","http://www.w3.org/1999/xhtml");const e=new Image;return e.src=`data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="${V(this,d,"f").$width}px" height="${V(this,d,"f").$height}px"><foreignObject x="0" y="0" width="100%" height="100%">${(new XMLSerializer).serializeToString(t).replaceAll("#","%23").replaceAll("\n","%0A")}</foreignObject></svg>`,new Promise((t=>e.onload=()=>t(e)))})).then((t=>new Promise((e=>setTimeout((()=>e(t)),100))))).then((e=>{const i=document.createElement("canvas");i.width=V(this,d,"f").$width,i.height=V(this,d,"f").$height,i.getContext("2d").drawImage(e,0,0),i.toBlob((e=>{if(!e)return;const i=URL.createObjectURL(e);Q.Texture.from(i).once("update",(e=>{t(e),URL.revokeObjectURL(i)}))}))})).catch((t=>K.DebugMng.myTrace(`goTxt() = ${t}`)))},D=function(t,e,i,n,r,s){t.alpha=0,e.x&&(n.x="="===e.x.charAt(0)?n.x+parseInt(e.x.slice(1)):parseInt(e.x)),e.y&&(n.y="="===e.y.charAt(0)?n.y+parseInt(e.y.slice(1)):parseInt(e.y)),e.width&&(n.width=parseInt(e.width)),e.height&&(n.height=parseInt(e.height)),e.wait&&(s.wait=parseInt(e.wait)),t.width=n.width,t.height=n.height,t.position.set("="===s.x.charAt(0)?n.x+t.width*s.nx:s.nx,"="===s.y.charAt(0)?n.y+t.height*s.ny:s.ny);const o={sp:t,tw:new tt.Tween(t).to({alpha:1,x:n.x,y:n.y,width:n.width,height:n.height,angle:0},s.wait??0).easing(r).delay((i.wait??0)+(e.delay??0)).onComplete((()=>{o.tw=void 0})).start()};V(this,S,"f").push(o)},j=function t(e){const i=[];if(e.nodeType!==e.TEXT_NODE)return e.childNodes.forEach((e=>i.push(V(this,n,"m",t).call(this,e)))),Array.prototype.concat.apply([],i);const r=e.ownerDocument.createRange();r.selectNodeContents(e);let s=0;const o=r.endOffset;for(;s<o;){r.setStart(e,s),r.setEnd(e,++s);const t=r.getBoundingClientRect(),n=r.startContainer.parentElement;if(!n)throw"fn:TxtStage.ts pe null";const o=r.toString(),a={ch:o,rect:new Q.Rectangle(t.left+globalThis.scrollX,t.top+globalThis.scrollY,t.width,t.height+("gjqy".includes(o)?V(this,U,"f"):0)),elm:n,cmd:n.getAttribute("data-cmd")??void 0,arg:n.getAttribute("data-arg")??void 0,add:n.getAttribute("data-add")??void 0,tcy:n.getAttribute("data-tcy")??void 0};i.push(a)}return r.detach(),i},z=function(){V(this,l,"f").clear(),Y(this,A,[],"f"),Y(this,M,0,"f"),this.skipChIn();const t=V(this,h,"f").cloneNode(!0);t.textContent="";const e=V(this,h,"f");e.parentElement.insertBefore(t,e);let i=0;e.querySelectorAll("span.sn_ch").forEach((t=>{const e=JSON.parse(t?.getAttribute("data-add")??t?.children[0]?.getAttribute("data-add")??t?.children[0]?.children[0]?.getAttribute("data-add")??"{}");if(!e.ch_out_style)return;const n=V(et,r,"f",F)[e.ch_out_style];n&&(0!==n.wait?(i+=n.wait,n.join||(t.style.animationDelay="0ms"),t.classList.add(`go_ch_out_${e.ch_out_style}`)):t.style.display="none")}));const n=()=>{e.parentElement.removeChild(e),V(this,u,"f").removeChildren().forEach((t=>{t instanceof Q.Container&&V(et,r,"f",a).unButton(t),t.destroy()}))};0===i?(V(this,h,"f").textContent="",n()):e.lastElementChild?.addEventListener("animationend",n,{once:!0,passive:!0}),Y(this,h,t,"f")},s={value:void 0},o={value:void 0},a={value:void 0},x={value:{backgroundColor:0,borderBottomWidth:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0}},O={value:void 0},R={value:void 0},C={value:void 0},k={value:Object.create(null)},B={value:/[\s\.,]/},F={value:Object.create(null)},G={value:new Q.Container}},7408:function(t,e,i){"use strict";var n,r,s,o,a,h,u,l,c,f,d,p,g,m,v,_,y,b,E,x,T,w,S,A,M,O,R,C,I,P,N,D,L,k,B,F,G,U,j,X,H,z,W=this&&this.__classPrivateFieldGet||function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},V=this&&this.__classPrivateFieldSet||function(t,e,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(t,i):r?r.value=i:e.set(t,i),i};Object.defineProperty(e,"__esModule",{value:!0}),e.Variable=void 0;const Y=i(4965),$=i(9630),q=i(7177),Z=i(1795);class K{constructor(t,e){if(this.cfg=t,n.add(this),s.set(this,{sys:{},save:{},tmp:{},mp:{}}),o.set(this,W(this,s,"f").save),a.set(this,W(this,s,"f").tmp),h.set(this,void 0),u.set(this,{sys:{},mark:{},kidoku:{}}),l.set(this,void 0),c.set(this,{}),f.set(this,void 0),d.set(this,{auth:(t,e)=>W(this,n,"m",p).call(this,e.hBreakpoint.aData),var:(t,e)=>W(this,h,"f").send2Dbg(e.ri,{v:W(this,s,"f")[e.scope]??{}}),set_var:(t,e)=>{try{W(this,C,"f").call(this,e.nm,e.val),W(this,h,"f").send2Dbg(e.ri,{})}catch{}},set_data_break:(t,e)=>{W(this,n,"m",p).call(this,e.a),W(this,h,"f").send2Dbg(e.ri,{})},disconnect:t=>V(K,r,{},"f",I)}),g.set(this,(()=>{})),m.set(this,(t=>{})),this.getMark=t=>W(this,u,"f").mark[t],this.getAreaKidoku=t=>W(this,c,"f")[t],C.set(this,((t,e,i=!0)=>{if(!t)throw"[変数に値セット] nameは必須です";if(null==e)throw"[変数に値セット] textは必須です(空文字はOK)";const n=q.PropParser.getValName(t);if(void 0===n)throw"[変数参照] name("+t+")が変数名として異常です";const r=W(this,s,"f")[n.scope];if(!r)throw"[変数に値セット] scopeが異常【"+n.scope+"】です";const o=n.name;if("const."===o.slice(0,6)&&o in r)throw"[変数に値セット] 変数【"+o+"】は書き換え不可です";this.setVal_Nochk(n.scope,o,e,i)})),this.getVal=(t,e)=>{if(!t)throw"[変数参照] nameは必須です";const i=q.PropParser.getValName(t);if(void 0===i)throw"[変数参照] name("+t+")が変数名として異常です";const r=W(this,s,"f")[i.scope];if(!r)throw"[変数参照] scopeが異常【"+i.scope+"】です";const o=i.name;let a=r[o];if(!(o in r)){a=e;let t="";const i=o.split("."),n=i.length;for(let s=0;s<n;++s,t+="."){if(t+=i[s],!(t in r))continue;let o=JSON.parse(r[t]);if("[object Object]"!==Object.prototype.toString.call(o)){if(s+1===n){a=o;break}continue}let h=s;for(;++h<n;){if(!(i[h]in o)){a=e;break}if(o=o[i[h]],"[object Object]"!==Object.prototype.toString.call(o)||h+1===n){a=o;break}}a instanceof Object&&(a=JSON.stringify(a));break}}return a instanceof Function&&(a=a()),"@str"===i.at?a:W(this,n,"m",P).call(this,a)},N.set(this,/^-?[\d\.]+$/),D.set(this,(()=>{const t={tmp:{},sys:{},save:{},mp:{}};for(let e in t){const i=W(this,s,"f")[e],n=t[e];for(let t in i){const e=i[t];"[object Function]"===Object.prototype.toString.call(e)?n[t]=e():n[t]=e}}return console.info("🥟 [dump_val]",t),!1})),L.set(this,!1),k.set(this,{"sys:sn.tagCh.doWait":t=>W(this,n,"m",B).call(this,t),"sys:sn.tagCh.doWait_Kidoku":t=>W(this,n,"m",B).call(this,t),"sys:sn.tagCh.msecWait":t=>W(this,n,"m",F).call(this,t),"sys:sn.tagCh.msecWait_Kidoku":t=>W(this,n,"m",G).call(this,t),"sys:sn.tagCh.canskip":t=>W(this,n,"m",B).call(this,t),"sys:sn.auto.msecPageWait":t=>W(this,n,"m",U).call(this,t),"sys:sn.auto.msecPageWait_Kidoku":t=>W(this,n,"m",U).call(this,t),"sys:sn.auto.msecLineWait":t=>W(this,n,"m",j).call(this,t),"sys:sn.auto.msecLineWait_Kidoku":t=>W(this,n,"m",j).call(this,t),"save:sn.doRecLog":t=>{W(this,m,"f").call(this,V(this,L,W(this,n,"m",X).call(this,t),"f"))},"save:sn.userFnTail":(t,e)=>this.cfg.userFnTail=e,"tmp:sn.tagL.enabled":t=>W(this,n,"m",H).call(this,t),"tmp:sn.skip.all":t=>W(this,n,"m",z).call(this,t),"tmp:sn.skip.enabled":t=>W(this,n,"m",z).call(this,t),"tmp:sn.auto.enabled":t=>W(this,n,"m",z).call(this,t),"tmp:flash.desktop.NativeApplication.nativeApplication.systemIdleMode":()=>{},"tmp:sn.chkFontMode":()=>{W(this,a,"f")["const.sn.onLauncher"]||W(this,a,"f")["const.sn.isDebugger"]}}),e.let=t=>W(this,n,"m",y).call(this,t),e.let_abs=t=>W(this,n,"m",b).call(this,t),e.let_char_at=t=>W(this,n,"m",E).call(this,t),e.let_index_of=t=>W(this,n,"m",x).call(this,t),e.let_length=t=>W(this,n,"m",T).call(this,t),e.let_replace=t=>W(this,n,"m",w).call(this,t),e.let_round=t=>W(this,n,"m",S).call(this,t),e.let_search=t=>W(this,n,"m",A).call(this,t),e.let_substr=t=>W(this,n,"m",M).call(this,t),e.clearsysvar=()=>W(this,n,"m",O).call(this),e.clearvar=()=>W(this,n,"m",R).call(this),e.dump_val=()=>W(this,D,"f").call(this),e.copybookmark=t=>W(this,n,"m",v).call(this,t),e.erasebookmark=t=>W(this,n,"m",_).call(this,t),W(this,o,"f")["sn.userFnTail"]="",this.defTmp("const.sn.bookmark.json",(()=>{const t=[];return Object.keys(W(this,u,"f").mark).sort().forEach((e=>{const i={...W(this,u,"f").mark[e].json};i.place=e,t.push(i)})),JSON.stringify(t)})),W(this,a,"f")["const.sn.isFirstBoot"]=!0,W(this,a,"f")["sn.tagL.enabled"]=!0,W(this,a,"f")["sn.skip.all"]=!1,W(this,a,"f")["sn.skip.enabled"]=!1,W(this,a,"f")["sn.auto.enabled"]=!1,W(this,a,"f")["const.sn.last_page_text"]="",W(this,a,"f")["const.sn.displayState"]=!1,W(this,a,"f")["const.Date.getTime"]=()=>(new Date).getTime(),W(this,a,"f")["const.Date.getDateStr"]=()=>(0,Y.getDateStr)(),W(this,a,"f")["const.sn.platform"]=JSON.stringify(Z),W(this,n,"m",O).call(this),W(this,n,"m",R).call(this),W(this,a,"f")["const.sn.config.window.width"]=t.oCfg.window.width,W(this,a,"f")["const.sn.config.window.height"]=t.oCfg.window.height,W(this,a,"f")["const.sn.config.book.title"]=t.oCfg.book.title,W(this,a,"f")["const.sn.config.book.version"]=t.oCfg.book.version,W(this,a,"f")["const.sn.Math.PI"]=Math.PI,"undefined"==typeof window)return;const i=window,$=i.AudioContext??i.webkitAudioContext;W(this,a,"f")["const.sn.needClick2Play"]=()=>"suspended"===(new $).state}setSys(t){V(this,h,t,"f"),t.initVal(W(this,u,"f"),W(this,a,"f"),(e=>{this.updateData(e),sessionStorage.clear();const i=this.cfg.getNs();V(this,g,this.cfg.oCfg.debug.variable?()=>{const e={};Object.keys(W(this,l,"f")).forEach((t=>{const i=W(this,l,"f")[t];e["sys:"+t]=i instanceof Function?i():i})),sessionStorage[i+"sys"]=JSON.stringify(e);const n={};Object.keys(W(this,o,"f")).forEach((t=>{const e=W(this,o,"f")[t];n["save:"+t]=e instanceof Function?e():e})),sessionStorage[i+"save"]=JSON.stringify(n);const r={};Object.keys(W(this,a,"f")).forEach((t=>{const e=W(this,a,"f")[t];r[t]=e instanceof Function?e():e})),sessionStorage[i+"tmp"]=JSON.stringify(r);const h={};Object.keys(W(this,s,"f").mp).forEach((t=>{const e=W(this,s,"f").mp[t];h[t]=e instanceof Function?e():e})),sessionStorage[i+"mp"]=JSON.stringify(h);const c={};Object.keys(W(this,u,"f").mark).forEach((t=>{const e=W(this,u,"f").mark[t];c[t]=e instanceof Function?e():e})),sessionStorage[i+"mark"]=JSON.stringify(c);const f={};Object.keys(W(this,u,"f").kidoku).forEach((t=>{const e=W(this,u,"f").kidoku[t];f[t]=e instanceof Function?e():e})),sessionStorage[i+"kidoku"]=JSON.stringify(f),t.flush()}:()=>t.flush(),"f"),V(this,f,((e,i)=>t.callHook(e,i)),"f"),t.addHook(((t,e)=>W(this,d,"f")[t]?.(t,e)));const r=this.getVal("sys:sn.tagCh.msecWait",-1);(W(this,a,"f")["const.sn.isFirstBoot"]||-1===r)&&W(this,n,"m",O).call(this)}))}updateData(t){V(this,u,t,"f"),V(this,l,W(this,s,"f").sys=W(this,u,"f").sys,"f"),V(this,c,{},"f");for(const t in W(this,u,"f").kidoku){const e=new $.Areas;e.hAreas={...W(this,u,"f").kidoku[t]},W(this,c,"f")[t]=e}}flush(){W(this,g,"f").call(this)}setDoRecProc(t){V(this,m,t,"f")}defTmp(t,e){W(this,a,"f")[t]=e}cloneMp(){return{...W(this,s,"f").mp}}setMp(t){W(this,s,"f").mp=t}setMark(t,e){W(this,u,"f").mark[t]=e,this.flush()}cloneSave(){return{...W(this,s,"f").save}}mark2save(t){V(this,o,W(this,s,"f").save={...t.hSave},"f"),V(this,L,W(this,o,"f")["sn.doRecLog"]??!1,"f")}loadScrWork(t){t in W(this,c,"f")||(W(this,c,"f")[t]=new $.Areas)}saveKidoku(){for(const t in W(this,c,"f"))W(this,u,"f").kidoku[t]={...W(this,c,"f")[t].hAreas};this.flush()}setVal_Nochk(t,e,i,o=!1){const a=W(this,s,"f")[t];o&&(i=W(this,n,"m",P).call(this,i));const h=t+":"+e;if(h in W(K,r,"f",I)){const t=a[e],n=i;t!=n&&W(this,f,"f").call(this,"data_break",{dataId:h,old_v:t,new_v:n})}a[e]=i,W(this,k,"f")[h]?.(e,i)}doRecLog(){return W(this,L,"f")}defValTrg(t,e){W(this,k,"f")[t]=e}}e.Variable=K,r=K,s=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,u=new WeakMap,l=new WeakMap,c=new WeakMap,f=new WeakMap,d=new WeakMap,g=new WeakMap,m=new WeakMap,C=new WeakMap,N=new WeakMap,D=new WeakMap,L=new WeakMap,k=new WeakMap,n=new WeakSet,p=function(t){V(K,r,{},"f",I),t.forEach((t=>W(K,r,"f",I)[t.dataId]=1))},v=function(t){if(!("from"in t))throw"fromは必須です";if(!("to"in t))throw"toは必須です";const e=Number(t.from),i=Number(t.to);if(e===i)return!1;if(!(e in W(this,u,"f").mark))throw`from:${e} のセーブデータは存在しません`;return this.setMark(i,{...W(this,u,"f").mark[e]}),W(this,h,"f").copyBMFolder(e,i),!1},_=function(t){const{place:e}=t;if(!e)throw"placeは必須です";return delete W(this,u,"f").mark[e],this.flush(),W(this,h,"f").eraseBMFolder(e),!1},y=function(t){if(!t.name)throw"nameは必須です";let e=!0;if(t.cast)switch(t.cast){case"num":(0,Y.argChk_Num)(t,"text",NaN);break;case"int":t.text=String((0,Y.int)((0,Y.argChk_Num)(t,"text",NaN)));break;case"uint":t.text=String((0,Y.uint)((0,Y.argChk_Num)(t,"text",NaN)));break;case"bool":(0,Y.argChk_Boolean)(t,"text",!1);break;case"str":e=!1;break;default:throw"cast【"+t.cast+"】は未定義です"}return W(this,C,"f").call(this,t.name,t.text,e),!1},b=function(t){const e=(0,Y.argChk_Num)(t,"text",0);return t.text=String(e<0?-e:e),W(this,n,"m",y).call(this,t),!1},E=function(t){return t.text=(t.text??"").charAt((0,Y.argChk_Num)(t,"pos",0)),W(this,n,"m",y).call(this,t),!1},x=function(t){const{val:e}=t;if(!e)throw"valは必須です";const i=(0,Y.argChk_Num)(t,"start",0);return t.text=String((t.text??"").indexOf(e,i)),W(this,n,"m",y).call(this,t),!1},T=function(t){return t.text=String((t.text??"").length),W(this,n,"m",y).call(this,t),!1},w=function(t){if(!t.reg)throw"regは必須です";const{flags:e}=t,i=e?new RegExp(t.reg,e):new RegExp(t.reg);return t.text=String(t.text??"").replace(i,String(t.val)),W(this,n,"m",y).call(this,t),!1},S=function(t){const e=(0,Y.argChk_Num)(t,"text",0);return t.text=String(Math.round(e)),W(this,n,"m",y).call(this,t),!1},A=function(t){if(!t.reg)throw"regは必須です";const{flags:e}=t,i=e?new RegExp(t.reg,e):new RegExp(t.reg);return t.text=String((t.text??"").search(i)),W(this,n,"m",y).call(this,t),!1},M=function(t){const e=(0,Y.argChk_Num)(t,"pos",0);return t.text="all"!==t.len?(t.text??"").slice(e,e+(0,Y.int)((0,Y.argChk_Num)(t,"len",1))):(t.text??"").slice(e),W(this,n,"m",y).call(this,t),!1},O=function(){const t=V(this,l,W(this,s,"f").sys=W(this,u,"f").sys={},"f");"undefined"!=typeof process||(this.setVal_Nochk("sys","const.sn.window.x",0),this.setVal_Nochk("sys","const.sn.window.y",0)),this.setVal_Nochk("sys","sn.tagCh.doWait",!0),this.setVal_Nochk("sys","sn.tagCh.doWait_Kidoku",!0),this.setVal_Nochk("sys","sn.tagCh.msecWait",this.cfg.oCfg.init.tagch_msecwait),this.setVal_Nochk("sys","sn.tagCh.msecWait_Kidoku",this.cfg.oCfg.init.tagch_msecwait),this.setVal_Nochk("sys","sn.tagCh.canskip",!0),this.setVal_Nochk("sys","sn.skip.mode","s"),this.setVal_Nochk("sys","sn.auto.msecPageWait",(0,Y.argChk_Num)(t,"sn.auto.msecPageWait",this.cfg.oCfg.init.auto_msecpagewait??3500)),this.setVal_Nochk("sys","sn.auto.msecPageWait_Kidoku",(0,Y.argChk_Num)(t,"sn.auto.msecPageWait",this.cfg.oCfg.init.auto_msecpagewait??3500)),this.setVal_Nochk("sys","sn.auto.msecLineWait",500),this.setVal_Nochk("sys","sn.auto.msecLineWait_Kidoku",500),this.setVal_Nochk("sys","const.sn.sound.BGM.volume",1),this.setVal_Nochk("sys","const.sn.sound.SE.volume",1),this.setVal_Nochk("sys","const.sn.sound.SYS.volume",1);for(const t in W(this,u,"f").kidoku)W(this,u,"f").kidoku[t].hAreas={},W(this,c,"f")[t].clear();return this.setVal_Nochk("sys","TextLayer.Back.Alpha",.5),W(this,s,"f").mark=W(this,u,"f").mark={},this.setVal_Nochk("sys","const.sn.save.place",1),this.flush(),!1},R=function(){const t=W(this,o,"f")["const.sn.mesLayer"]??"",e=W(this,o,"f")["sn.doRecLog"]??!1,i=W(this,o,"f")["const.sn.sLog"]??"[]";return V(this,o,W(this,s,"f").save={},"f"),this.setVal_Nochk("save","const.sn.mesLayer",t),this.setVal_Nochk("save","sn.doRecLog",e),this.setVal_Nochk("save","const.sn.sLog",i),!1},P=function(t){const e=t;return"true"===e||"false"!==e&&("null"===e?null:"undefined"!==e?(W(this,N,"f").lastIndex=0,W(this,N,"f").test(e)?parseFloat(e):t):void 0)},B=function(t){(0,Y.argChk_Boolean)(W(this,l,"f"),t,!0)},F=function(t){(0,Y.argChk_Num)(W(this,l,"f"),t,10),W(this,l,"f")["sn.tagCh.doWait"]},G=function(t){(0,Y.argChk_Num)(W(this,l,"f"),t,void 0===this.cfg.oCfg.init.tagch_msecwait?10:this.cfg.oCfg.init.tagch_msecwait),W(this,l,"f")["sn.tagCh.doWait_Kidoku"]},U=function(t){(0,Y.argChk_Num)(W(this,l,"f"),t,void 0===this.cfg.oCfg.init.auto_msecpagewait?3500:this.cfg.oCfg.init.auto_msecpagewait)},j=function(t){(0,Y.argChk_Num)(W(this,l,"f"),t,500)},X=function(t){return(0,Y.argChk_Boolean)(W(this,o,"f"),t,!0)},H=function(t){(0,Y.argChk_Boolean)(W(this,a,"f"),t,!0)},z=function(t){(0,Y.argChk_Boolean)(W(this,a,"f"),t,!1)},I={value:{}}},2511:function(t,e,i){var n;t=i.nmd(t),function(r){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof i.g&&i.g;s.global!==s&&s.window!==s&&s.self;var o,a=2147483647,h=36,u=/^xn--/,l=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function g(t){throw RangeError(f[t])}function m(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function v(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+m((t=t.replace(c,".")).split("."),e).join(".")}function _(t){for(var e,i,n=[],r=0,s=t.length;r<s;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<s?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function y(t){return m(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)})).join("")}function b(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function E(t,e,i){var n=0;for(t=i?d(t/700):t>>1,t+=d(t/e);t>455;n+=h)t=d(t/35);return d(n+36*t/(t+38))}function x(t){var e,i,n,r,s,o,u,l,c,f,p,m=[],v=t.length,_=0,b=128,x=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&g("not-basic"),m.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<v;){for(s=_,o=1,u=h;r>=v&&g("invalid-input"),((l=(p=t.charCodeAt(r++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:h)>=h||l>d((a-_)/o))&&g("overflow"),_+=l*o,!(l<(c=u<=x?1:u>=x+26?26:u-x));u+=h)o>d(a/(f=h-c))&&g("overflow"),o*=f;x=E(_-s,e=m.length+1,0==s),d(_/e)>a-b&&g("overflow"),b+=d(_/e),_%=e,m.splice(_++,0,b)}return y(m)}function T(t){var e,i,n,r,s,o,u,l,c,f,m,v,y,x,T,w=[];for(v=(t=_(t)).length,e=128,i=0,s=72,o=0;o<v;++o)(m=t[o])<128&&w.push(p(m));for(n=r=w.length,r&&w.push("-");n<v;){for(u=a,o=0;o<v;++o)(m=t[o])>=e&&m<u&&(u=m);for(u-e>d((a-i)/(y=n+1))&&g("overflow"),i+=(u-e)*y,e=u,o=0;o<v;++o)if((m=t[o])<e&&++i>a&&g("overflow"),m==e){for(l=i,c=h;!(l<(f=c<=s?1:c>=s+26?26:c-s));c+=h)T=l-f,x=h-f,w.push(p(b(f+T%x,0))),l=d(T/x);w.push(p(b(l,0))),s=E(i,y,n==r),i=0,++n}++i,++e}return w.join("")}o={version:"1.3.2",ucs2:{decode:_,encode:y},decode:x,encode:T,toASCII:function(t){return v(t,(function(t){return l.test(t)?"xn--"+T(t):t}))},toUnicode:function(t){return v(t,(function(t){return u.test(t)?x(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return o}.call(e,i,e,t))||(t.exports=n)}()},8575:(t,e,i)=>{"use strict";var n=i(2511),r=i(2502);function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.Qc=y,e.DB=function(t,e){return y(t,!1,!0).resolve(e)},e.WU=function(t){return r.isString(t)&&(t=y(t)),t instanceof s?t.format():s.prototype.format.call(t)};var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),c=["%","/","?",";","#"].concat(l),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=i(7673);function y(t,e,i){if(t&&r.isObject(t)&&t instanceof s)return t;var n=new s;return n.parse(t,e,i),n}s.prototype.parse=function(t,e,i){if(!r.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var s=t.indexOf("?"),a=-1!==s&&s<t.indexOf("#")?"?":"#",u=t.split(a);u[0]=u[0].replace(/\\/g,"/");var y=t=u.join(a);if(y=y.trim(),!i&&1===t.split("#").length){var b=h.exec(y);if(b)return this.path=y,this.href=y,this.pathname=b[1],b[2]?(this.search=b[2],this.query=e?_.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var E=o.exec(y);if(E){var x=(E=E[0]).toLowerCase();this.protocol=x,y=y.substr(E.length)}if(i||E||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var T="//"===y.substr(0,2);!T||E&&m[E]||(y=y.substr(2),this.slashes=!0)}if(!m[E]&&(T||E&&!v[E])){for(var w,S,A=-1,M=0;M<f.length;M++)-1!==(O=y.indexOf(f[M]))&&(-1===A||O<A)&&(A=O);for(-1!==(S=-1===A?y.lastIndexOf("@"):y.lastIndexOf("@",A))&&(w=y.slice(0,S),y=y.slice(S+1),this.auth=decodeURIComponent(w)),A=-1,M=0;M<c.length;M++){var O;-1!==(O=y.indexOf(c[M]))&&(-1===A||O<A)&&(A=O)}-1===A&&(A=y.length),this.host=y.slice(0,A),y=y.slice(A),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var C=this.hostname.split(/\./),I=(M=0,C.length);M<I;M++){var P=C[M];if(P&&!P.match(d)){for(var N="",D=0,L=P.length;D<L;D++)P.charCodeAt(D)>127?N+="x":N+=P[D];if(!N.match(d)){var k=C.slice(0,M),B=C.slice(M+1),F=P.match(p);F&&(k.push(F[1]),B.unshift(F[2])),B.length&&(y="/"+B.join(".")+y),this.hostname=k.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=n.toASCII(this.hostname));var G=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+G,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!g[x])for(M=0,I=l.length;M<I;M++){var j=l[M];if(-1!==y.indexOf(j)){var X=encodeURIComponent(j);X===j&&(X=escape(j)),y=y.split(j).join(X)}}var H=y.indexOf("#");-1!==H&&(this.hash=y.substr(H),y=y.slice(0,H));var z=y.indexOf("?");if(-1!==z?(this.search=y.substr(z),this.query=y.substr(z+1),e&&(this.query=_.parse(this.query)),y=y.slice(0,z)):e&&(this.search="",this.query={}),y&&(this.pathname=y),v[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){G=this.pathname||"";var W=this.search||"";this.path=G+W}return this.href=this.format(),this},s.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",n=this.hash||"",s=!1,o="";this.host?s=t+this.host:this.hostname&&(s=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&r.isObject(this.query)&&Object.keys(this.query).length&&(o=_.stringify(this.query));var a=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||v[e])&&!1!==s?(s="//"+(s||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):s||(s=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),e+s+(i=i.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(a=a.replace("#","%23"))+n},s.prototype.resolve=function(t){return this.resolveObject(y(t,!1,!0)).format()},s.prototype.resolveObject=function(t){if(r.isString(t)){var e=new s;e.parse(t,!1,!0),t=e}for(var i=new s,n=Object.keys(this),o=0;o<n.length;o++){var a=n[o];i[a]=this[a]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var h=Object.keys(t),u=0;u<h.length;u++){var l=h[u];"protocol"!==l&&(i[l]=t[l])}return v[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!v[t.protocol]){for(var c=Object.keys(t),f=0;f<c.length;f++){var d=c[f];i[d]=t[d]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||m[t.protocol])i.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),i.pathname=p.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var g=i.pathname||"",_=i.search||"";i.path=g+_}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var y=i.pathname&&"/"===i.pathname.charAt(0),b=t.host||t.pathname&&"/"===t.pathname.charAt(0),E=b||y||i.host&&t.pathname,x=E,T=i.pathname&&i.pathname.split("/")||[],w=(p=t.pathname&&t.pathname.split("/")||[],i.protocol&&!v[i.protocol]);if(w&&(i.hostname="",i.port=null,i.host&&(""===T[0]?T[0]=i.host:T.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),E=E&&(""===p[0]||""===T[0])),b)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,T=p;else if(p.length)T||(T=[]),T.pop(),T=T.concat(p),i.search=t.search,i.query=t.query;else if(!r.isNullOrUndefined(t.search))return w&&(i.hostname=i.host=T.shift(),(R=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=R.shift(),i.host=i.hostname=R.shift())),i.search=t.search,i.query=t.query,r.isNull(i.pathname)&&r.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i;if(!T.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var S=T.slice(-1)[0],A=(i.host||t.host||T.length>1)&&("."===S||".."===S)||""===S,M=0,O=T.length;O>=0;O--)"."===(S=T[O])?T.splice(O,1):".."===S?(T.splice(O,1),M++):M&&(T.splice(O,1),M--);if(!E&&!x)for(;M--;M)T.unshift("..");!E||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),A&&"/"!==T.join("/").substr(-1)&&T.push("");var R,C=""===T[0]||T[0]&&"/"===T[0].charAt(0);return w&&(i.hostname=i.host=C?"":T.length?T.shift():"",(R=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=R.shift(),i.host=i.hostname=R.shift())),(E=E||i.host&&T.length)&&!C&&T.unshift(""),T.length?i.pathname=T.join("/"):(i.pathname=null,i.path=null),r.isNull(i.pathname)&&r.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},s.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},2502:t=>{"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},2281:t=>{"use strict";var e,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),n={},r=0,s=0;function o(t){var e="";do{e=i[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}function a(){var t=o(+new Date);return t!==e?(r=0,e=t):t+"."+o(r++)}for(;s<64;s++)n[i[s]]=s;a.encode=o,a.decode=function(t){var e=0;for(s=0;s<t.length;s++)e=64*e+n[t.charAt(s)];return e},t.exports=a},6242:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},4679:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const n=i(3481);Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return n.Socket}}),e.protocol=n.Socket.protocol;var r=i(9870);Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return r.Transport}});var s=i(7385);Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return s.transports}});var o=i(9622);Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return o.installTimerFunctions}})},3481:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Socket=void 0;const r=i(7385),s=i(9622),o=n(i(1830)),a=n(i(4187)),h=n(i(1227)),u=i(3063),l=i(1373),c=(0,h.default)("engine.io-client:socket");class f extends u.Emitter{constructor(t,e={}){super(),t&&"object"==typeof t&&(e=t,t=null),t?(t=(0,a.default)(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=(0,a.default)(e.host).host),(0,s.installTimerFunctions)(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},e),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=o.default.decode(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",(()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())}),!1),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close")},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){c('creating transport "%s"',t);const e=function(t){const e={};for(let i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}(this.opts.query);e.EIO=l.protocol,e.transport=t,this.id&&(e.sid=this.id);const i=Object.assign({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return c("options: %j",i),new r.transports[t](i)}open(){let t;if(this.opts.rememberUpgrade&&f.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return c("error while creating transport: %s",t),this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){c("setting transport %s",t.name),this.transport&&(c("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(()=>{this.onClose("transport close")}))}probe(t){c('probing transport "%s"',t);let e=this.createTransport(t),i=!1;f.priorWebsocketSuccess=!1;const n=()=>{i||(c('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",(n=>{if(!i)if("pong"===n.type&&"probe"===n.data){if(c('probe transport "%s" pong',t),this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;f.priorWebsocketSuccess="websocket"===e.name,c('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{i||"closed"!==this.readyState&&(c("changing transport and sending upgrade packet"),u(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())}))}else{c('probe transport "%s" failed',t);const i=new Error("probe error");i.transport=e.name,this.emitReserved("upgradeError",i)}})))};function r(){i||(i=!0,u(),e.close(),e=null)}const s=i=>{const n=new Error("probe error: "+i);n.transport=e.name,r(),c('probe transport "%s" failed because of error: %s',t,i),this.emitReserved("upgradeError",n)};function o(){s("transport closed")}function a(){s("socket closed")}function h(t){e&&t.name!==e.name&&(c('"%s" works - aborting "%s"',t.name,e.name),r())}const u=()=>{e.removeListener("open",n),e.removeListener("error",s),e.removeListener("close",o),this.off("close",a),this.off("upgrading",h)};e.once("open",n),e.once("error",s),e.once("close",o),this.once("close",a),this.once("upgrading",h),e.open()}onOpen(){if(c("socket open"),this.readyState="open",f.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){c("starting upgrade probes");let t=0;const e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(c('socket receive: type "%s", data "%s"',t.type,t.data),this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}else c('packet received with socket readyState "%s"',this.readyState)}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(c("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emitReserved("flush"))}write(t,e,i){return this.sendPacket("message",t,e,i),this}send(t,e,i){return this.sendPacket("message",t,e,i),this}sendPacket(t,e,i,n){if("function"==typeof e&&(n=e,e=void 0),"function"==typeof i&&(n=i,i=null),"closing"===this.readyState||"closed"===this.readyState)return;(i=i||{}).compress=!1!==i.compress;const r={type:t,data:e,options:i};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),n&&this.once("flush",n),this.flush()}close(){const t=()=>{this.onClose("forced close"),c("socket closing - telling transport to close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},i=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?i():t()})):this.upgrading?i():t()),this}onError(t){c("socket error %j",t),f.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(c('socket close with reason: "%s"',t),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let i=0;const n=t.length;for(;i<n;i++)~this.transports.indexOf(t[i])&&e.push(t[i]);return e}}e.Socket=f,f.protocol=l.protocol},9870:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;const r=i(1373),s=i(3063),o=i(9622),a=(0,n(i(1227)).default)("engine.io-client:transport");class h extends s.Emitter{constructor(t){super(),this.writable=!1,(0,o.installTimerFunctions)(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,e){const i=new Error(t);return i.type="TransportError",i.description=e,super.emit("error",i),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState?this.write(t):a("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emit("open")}onData(t){const e=(0,r.decodePacket)(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emit("packet",t)}onClose(){this.readyState="closed",super.emit("close")}}e.Transport=h},7385:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transports=void 0;const n=i(715),r=i(1308);e.transports={websocket:r.WS,polling:n.XHR}},715:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Request=e.XHR=void 0;const r=n(i(6666)),s=n(i(1227)),o=n(i(6242)),a=i(9622),h=i(3063),u=i(484),l=(0,s.default)("engine.io-client:polling-xhr");function c(){}const f=null!=new r.default({xdomain:!1}).responseType;class d extends u.Polling{constructor(t){if(super(t),"undefined"!=typeof location){const e="https:"===location.protocol;let i=location.port;i||(i=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||i!==t.port,this.xs=t.secure!==e}const e=t&&t.forceBase64;this.supportsBinary=f&&!e}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new p(this.uri(),t)}doWrite(t,e){const i=this.request({method:"POST",data:t});i.on("success",e),i.on("error",(t=>{this.onError("xhr post error",t)}))}doPoll(){l("xhr poll");const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(t=>{this.onError("xhr poll error",t)})),this.pollXhr=t}}e.XHR=d;class p extends h.Emitter{constructor(t,e){super(),(0,a.installTimerFunctions)(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.create()}create(){const t=(0,a.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const e=this.xhr=new r.default(t);try{l("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&e.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(t){}if("POST"===this.method)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in e&&(e.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(e.timeout=this.opts.requestTimeout),e.onreadystatechange=()=>{4===e.readyState&&(200===e.status||1223===e.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof e.status?e.status:0)}),0))},l("xhr data %s",this.data),e.send(this.data)}catch(t){return void this.setTimeoutFn((()=>{this.onError(t)}),0)}"undefined"!=typeof document&&(this.index=p.requestsCount++,p.requests[this.index]=this)}onSuccess(){this.emit("success"),this.cleanup()}onData(t){this.emit("data",t),this.onSuccess()}onError(t){this.emit("error",t),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=c,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete p.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&this.onData(t)}abort(){this.cleanup()}}if(e.Request=p,p.requestsCount=0,p.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",g);else if("function"==typeof addEventListener){const t="onpagehide"in o.default?"pagehide":"unload";addEventListener(t,g,!1)}function g(){for(let t in p.requests)p.requests.hasOwnProperty(t)&&p.requests[t].abort()}},484:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Polling=void 0;const r=i(9870),s=n(i(1227)),o=n(i(2281)),a=n(i(1830)),h=i(1373),u=(0,s.default)("engine.io-client:polling");class l extends r.Transport{constructor(){super(...arguments),this.polling=!1}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{u("paused"),this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(u("we are currently polling - waiting to pause"),t++,this.once("pollComplete",(function(){u("pre-pause polling complete"),--t||e()}))),this.writable||(u("we are currently writing - waiting to pause"),t++,this.once("drain",(function(){u("pre-pause writing complete"),--t||e()})))}else e()}poll(){u("polling"),this.polling=!0,this.doPoll(),this.emit("poll")}onData(t){u("polling got data %s",t),(0,h.decodePayload)(t,this.socket.binaryType).forEach((t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose(),!1;this.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():u('ignoring poll - transport state "%s"',this.readyState))}doClose(){const t=()=>{u("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(u("transport open - closing"),t()):(u("transport not open - deferring close"),this.once("open",t))}write(t){this.writable=!1,(0,h.encodePayload)(t,(t=>{this.doWrite(t,(()=>{this.writable=!0,this.emit("drain")}))}))}uri(){let t=this.query||{};const e=this.opts.secure?"https":"http";let i="";!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,o.default)()),this.supportsBinary||t.sid||(t.b64=1),this.opts.port&&("https"===e&&443!==Number(this.opts.port)||"http"===e&&80!==Number(this.opts.port))&&(i=":"+this.opts.port);const n=a.default.encode(t);return e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(n.length?"?"+n:"")}}e.Polling=l},5552:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultBinaryType=e.usingBrowserWebSocket=e.WebSocket=e.nextTick=void 0;const r=n(i(6242));e.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),e.WebSocket=r.default.WebSocket||r.default.MozWebSocket,e.usingBrowserWebSocket=!0,e.defaultBinaryType="arraybuffer"},1308:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.WS=void 0;const r=i(9870),s=n(i(1830)),o=n(i(2281)),a=i(9622),h=i(5552),u=n(i(1227)),l=i(1373),c=(0,u.default)("engine.io-client:websocket"),f="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class d extends r.Transport{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),e=this.opts.protocols,i=f?{}:(0,a.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=h.usingBrowserWebSocket&&!f?e?new h.WebSocket(t,e):new h.WebSocket(t):new h.WebSocket(t,e,i)}catch(t){return this.emit("error",t)}this.ws.binaryType=this.socket.binaryType||h.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=this.onClose.bind(this),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const i=t[e],n=e===t.length-1;(0,l.encodePacket)(i,this.supportsBinary,(t=>{const e={};!h.usingBrowserWebSocket&&(i.options&&(e.compress=i.options.compress),this.opts.perMessageDeflate)&&("string"==typeof t?Buffer.byteLength(t):t.length)<this.opts.perMessageDeflate.threshold&&(e.compress=!1);try{h.usingBrowserWebSocket?this.ws.send(t):this.ws.send(t,e)}catch(t){c("websocket closed before onclose event")}n&&(0,h.nextTick)((()=>{this.writable=!0,this.emit("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const e=this.opts.secure?"wss":"ws";let i="";this.opts.port&&("wss"===e&&443!==Number(this.opts.port)||"ws"===e&&80!==Number(this.opts.port))&&(i=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,o.default)()),this.supportsBinary||(t.b64=1);const n=s.default.encode(t);return e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(n.length?"?"+n:"")}check(){return!(!h.WebSocket||"__initialize"in h.WebSocket&&this.name===d.prototype.name)}}e.WS=d},6666:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=n(i(8058)),s=n(i(6242));e.default=function(t){const e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||r.default))return new XMLHttpRequest}catch(t){}if(!e)try{return new(s.default[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},9622:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.installTimerFunctions=e.pick=void 0;const r=n(i(6242));e.pick=function(t,...e){return e.reduce(((e,i)=>(t.hasOwnProperty(i)&&(e[i]=t[i]),e)),{})};const s=setTimeout,o=clearTimeout;e.installTimerFunctions=function(t,e){e.useNativeTimers?(t.setTimeoutFn=s.bind(r.default),t.clearTimeoutFn=o.bind(r.default)):(t.setTimeoutFn=setTimeout.bind(r.default),t.clearTimeoutFn=clearTimeout.bind(r.default))}},3087:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERROR_PACKET=e.PACKET_TYPES_REVERSE=e.PACKET_TYPES=void 0;const i=Object.create(null);e.PACKET_TYPES=i,i.open="0",i.close="1",i.ping="2",i.pong="3",i.message="4",i.upgrade="5",i.noop="6";const n=Object.create(null);e.PACKET_TYPES_REVERSE=n,Object.keys(i).forEach((t=>{n[i[t]]=t})),e.ERROR_PACKET={type:"error",data:"parser error"}},7572:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(3087),r=i(3426),s="function"==typeof ArrayBuffer,o=(t,e)=>{if(s){const i=(0,r.decode)(t);return a(i,e)}return{base64:!0,data:t}},a=(t,e)=>"blob"===e&&t instanceof ArrayBuffer?new Blob([t]):t;e.default=(t,e)=>{if("string"!=typeof t)return{type:"message",data:a(t,e)};const i=t.charAt(0);return"b"===i?{type:"message",data:o(t.substring(1),e)}:n.PACKET_TYPES_REVERSE[i]?t.length>1?{type:n.PACKET_TYPES_REVERSE[i],data:t.substring(1)}:{type:n.PACKET_TYPES_REVERSE[i]}:n.ERROR_PACKET}},3908:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(3087),r="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),s="function"==typeof ArrayBuffer,o=(t,e)=>{const i=new FileReader;return i.onload=function(){const t=i.result.split(",")[1];e("b"+t)},i.readAsDataURL(t)};e.default=({type:t,data:e},i,a)=>{return r&&e instanceof Blob?i?a(e):o(e,a):s&&(e instanceof ArrayBuffer||(h=e,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(h):h&&h.buffer instanceof ArrayBuffer))?i?a(e):o(new Blob([e]),a):a(n.PACKET_TYPES[t]+(e||""));var h}},1373:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=void 0;const n=i(3908);e.encodePacket=n.default;const r=i(7572);e.decodePacket=r.default;const s=String.fromCharCode(30);e.encodePayload=(t,e)=>{const i=t.length,r=new Array(i);let o=0;t.forEach(((t,a)=>{(0,n.default)(t,!1,(t=>{r[a]=t,++o===i&&e(r.join(s))}))}))},e.decodePayload=(t,e)=>{const i=t.split(s),n=[];for(let t=0;t<i.length;t++){const s=(0,r.default)(i[t],e);if(n.push(s),"error"===s.type)break}return n},e.protocol=4},7046:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.connect=e.io=e.Socket=e.Manager=e.protocol=void 0;const r=i(3084),s=i(4168);Object.defineProperty(e,"Manager",{enumerable:!0,get:function(){return s.Manager}});const o=i(8312);Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return o.Socket}});const a=n(i(1227)).default("socket.io-client"),h={};function u(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};const i=r.url(t,e.path||"/socket.io"),n=i.source,o=i.id,u=i.path,l=h[o]&&u in h[o].nsps;let c;return e.forceNew||e["force new connection"]||!1===e.multiplex||l?(a("ignoring socket cache for %s",n),c=new s.Manager(n,e)):(h[o]||(a("new io instance for %s",n),h[o]=new s.Manager(n,e)),c=h[o]),i.query&&!e.query&&(e.query=i.queryKey),c.socket(i.path,e)}e.io=u,e.connect=u,e.default=u,Object.assign(u,{Manager:s.Manager,Socket:o.Socket,io:u,connect:u});var l=i(4514);Object.defineProperty(e,"protocol",{enumerable:!0,get:function(){return l.protocol}}),t.exports=u},4168:function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&n(e,t,i);return r(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Manager=void 0;const a=i(4679),h=i(8312),u=s(i(4514)),l=i(7149),c=o(i(3010)),f=i(3063),d=o(i(1227)).default("socket.io-client:manager");class p extends f.Emitter{constructor(t,e){var i;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,a.installTimerFunctions(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(i=e.randomizationFactor)&&void 0!==i?i:.5),this.backoff=new c.default({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;const n=e.parser||u;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(d("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;d("opening %s",this.uri),this.engine=new a.Socket(this.uri,this.opts);const e=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const n=l.on(e,"open",(function(){i.onopen(),t&&t()})),r=l.on(e,"error",(e=>{d("error"),i.cleanup(),i._readyState="closed",this.emitReserved("error",e),t?t(e):i.maybeReconnectOnOpen()}));if(!1!==this._timeout){const t=this._timeout;d("connect attempt will timeout after %d",t),0===t&&n();const i=this.setTimeoutFn((()=>{d("connect attempt timed out after %d",t),n(),e.close(),e.emit("error",new Error("timeout"))}),t);this.opts.autoUnref&&i.unref(),this.subs.push((function(){clearTimeout(i)}))}return this.subs.push(n),this.subs.push(r),this}connect(t){return this.open(t)}onopen(){d("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(l.on(t,"ping",this.onping.bind(this)),l.on(t,"data",this.ondata.bind(this)),l.on(t,"error",this.onerror.bind(this)),l.on(t,"close",this.onclose.bind(this)),l.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){this.decoder.add(t)}ondecoded(t){this.emitReserved("packet",t)}onerror(t){d("error",t),this.emitReserved("error",t)}socket(t,e){let i=this.nsps[t];return i||(i=new h.Socket(this,t,e),this.nsps[t]=i),i}_destroy(t){const e=Object.keys(this.nsps);for(const t of e)if(this.nsps[t].active)return void d("socket %s is still active, skipping close",t);this._close()}_packet(t){d("writing packet %j",t);const e=this.encoder.encode(t);for(let i=0;i<e.length;i++)this.engine.write(e[i],t.options)}cleanup(){d("cleanup"),this.subs.forEach((t=>t())),this.subs.length=0,this.decoder.destroy()}_close(){d("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t){d("closed due to %s",t),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)d("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();d("will wait %dms before reconnect attempt",e),this._reconnecting=!0;const i=this.setTimeoutFn((()=>{t.skipReconnect||(d("attempting reconnect"),this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((e=>{e?(d("reconnect attempt error"),t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):(d("reconnect success"),t.onreconnect())})))}),e);this.opts.autoUnref&&i.unref(),this.subs.push((function(){clearTimeout(i)}))}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}e.Manager=p},7149:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.on=void 0,e.on=function(t,e,i){return t.on(e,i),function(){t.off(e,i)}}},8312:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Socket=void 0;const r=i(4514),s=i(7149),o=i(3063),a=n(i(1227)).default("socket.io-client:socket"),h=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class u extends o.Emitter{constructor(t,e,i){super(),this.connected=!1,this.disconnected=!0,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,i&&i.auth&&(this.auth=i.auth),this.io._autoConnect&&this.open()}subEvents(){if(this.subs)return;const t=this.io;this.subs=[s.on(t,"open",this.onopen.bind(this)),s.on(t,"packet",this.onpacket.bind(this)),s.on(t,"error",this.onerror.bind(this)),s.on(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(h.hasOwnProperty(t))throw new Error('"'+t+'" is a reserved event name');e.unshift(t);const i={type:r.PacketType.EVENT,data:e,options:{}};if(i.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){const t=this.ids++;a("emitting packet with ack id %d",t);const n=e.pop();this._registerAckCallback(t,n),i.id=t}const n=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return!this.flags.volatile||n&&this.connected?this.connected?this.packet(i):this.sendBuffer.push(i):a("discard packet as the transport is not currently writable"),this.flags={},this}_registerAckCallback(t,e){const i=this.flags.timeout;if(void 0===i)return void(this.acks[t]=e);const n=this.io.setTimeoutFn((()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&(a("removing packet with ack id %d from the buffer",t),this.sendBuffer.splice(e,1));a("event with ack id %d has timed out after %d ms",t,i),e.call(this,new Error("operation has timed out"))}),i);this.acks[t]=(...t)=>{this.io.clearTimeoutFn(n),e.apply(this,[null,...t])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){a("transport is open - connecting"),"function"==typeof this.auth?this.auth((t=>{this.packet({type:r.PacketType.CONNECT,data:t})})):this.packet({type:r.PacketType.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t){a("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emitReserved("disconnect",t)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case r.PacketType.CONNECT:if(t.data&&t.data.sid){const e=t.data.sid;this.onconnect(e)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case r.PacketType.EVENT:case r.PacketType.BINARY_EVENT:this.onevent(t);break;case r.PacketType.ACK:case r.PacketType.BINARY_ACK:this.onack(t);break;case r.PacketType.DISCONNECT:this.ondisconnect();break;case r.PacketType.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){const e=t.data||[];a("emitting event %j",e),null!=t.id&&(a("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const i of e)i.apply(this,t)}super.emit.apply(this,t)}ack(t){const e=this;let i=!1;return function(...n){i||(i=!0,a("sending ack %j",n),e.packet({type:r.PacketType.ACK,id:t,data:n}))}}onack(t){const e=this.acks[t.id];"function"==typeof e?(a("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):a("bad ack %s",t.id)}onconnect(t){a("socket connected with id %s",t),this.id=t,this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((t=>this.emitEvent(t))),this.receiveBuffer=[],this.sendBuffer.forEach((t=>this.packet(t))),this.sendBuffer=[]}ondisconnect(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((t=>t())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:r.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let i=0;i<e.length;i++)if(t===e[i])return e.splice(i,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}}e.Socket=u},3084:function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.url=void 0;const r=n(i(4187)),s=n(i(1227)).default("socket.io-client:url");e.url=function(t,e="",i){let n=t;i=i||"undefined"!=typeof location&&location,null==t&&(t=i.protocol+"//"+i.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?i.protocol+t:i.host+t),/^(https?|wss?):\/\//.test(t)||(s("protocol-less url %s",t),t=void 0!==i?i.protocol+"//"+t:"https://"+t),s("parse %s",t),n=r.default(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+e,n.href=n.protocol+"://"+o+(i&&i.port===n.port?"":":"+n.port),n}},4880:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reconstructPacket=e.deconstructPacket=void 0;const n=i(665);function r(t,e){if(!t)return t;if(n.isBinary(t)){const i={_placeholder:!0,num:e.length};return e.push(t),i}if(Array.isArray(t)){const i=new Array(t.length);for(let n=0;n<t.length;n++)i[n]=r(t[n],e);return i}if("object"==typeof t&&!(t instanceof Date)){const i={};for(const n in t)t.hasOwnProperty(n)&&(i[n]=r(t[n],e));return i}return t}function s(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i]=s(t[i],e);else if("object"==typeof t)for(const i in t)t.hasOwnProperty(i)&&(t[i]=s(t[i],e));return t}e.deconstructPacket=function(t){const e=[],i=t.data,n=t;return n.data=r(i,e),n.attachments=e.length,{packet:n,buffers:e}},e.reconstructPacket=function(t,e){return t.data=s(t.data,e),t.attachments=void 0,t}},4514:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const n=i(3063),r=i(4880),s=i(665),o=i(1227).default("socket.io-parser");var a;e.protocol=5,function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(a=e.PacketType||(e.PacketType={})),e.Encoder=class{encode(t){return o("encoding packet %j",t),t.type!==a.EVENT&&t.type!==a.ACK||!s.hasBinary(t)?[this.encodeAsString(t)]:(t.type=t.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,this.encodeAsBinary(t))}encodeAsString(t){let e=""+t.type;return t.type!==a.BINARY_EVENT&&t.type!==a.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data)),o("encoded %j as %s",t,e),e}encodeAsBinary(t){const e=r.deconstructPacket(t),i=this.encodeAsString(e.packet),n=e.buffers;return n.unshift(i),n}};class h extends n.Emitter{constructor(){super()}add(t){let e;if("string"==typeof t)e=this.decodeString(t),e.type===a.BINARY_EVENT||e.type===a.BINARY_ACK?(this.reconstructor=new u(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e);else{if(!s.isBinary(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e))}}decodeString(t){let e=0;const i={type:Number(t.charAt(0))};if(void 0===a[i.type])throw new Error("unknown packet type "+i.type);if(i.type===a.BINARY_EVENT||i.type===a.BINARY_ACK){const n=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);const r=t.substring(n,e);if(r!=Number(r)||"-"!==t.charAt(e))throw new Error("Illegal attachments");i.attachments=Number(r)}if("/"===t.charAt(e+1)){const n=e+1;for(;++e&&","!==t.charAt(e)&&e!==t.length;);i.nsp=t.substring(n,e)}else i.nsp="/";const n=t.charAt(e+1);if(""!==n&&Number(n)==n){const n=e+1;for(;++e;){const i=t.charAt(e);if(null==i||Number(i)!=i){--e;break}if(e===t.length)break}i.id=Number(t.substring(n,e+1))}if(t.charAt(++e)){const n=function(t){try{return JSON.parse(t)}catch(t){return!1}}(t.substr(e));if(!h.isPayloadValid(i.type,n))throw new Error("invalid payload");i.data=n}return o("decoded %s as %j",t,i),i}static isPayloadValid(t,e){switch(t){case a.CONNECT:return"object"==typeof e;case a.DISCONNECT:return void 0===e;case a.CONNECT_ERROR:return"string"==typeof e||"object"==typeof e;case a.EVENT:case a.BINARY_EVENT:return Array.isArray(e)&&e.length>0;case a.ACK:case a.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}e.Decoder=h;class u{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=r.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},665:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasBinary=e.isBinary=void 0;const i="function"==typeof ArrayBuffer,n=Object.prototype.toString,r="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===n.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===n.call(File);function o(t){return i&&(t instanceof ArrayBuffer||(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer)(t))||r&&t instanceof Blob||s&&t instanceof File}e.isBinary=o,e.hasBinary=function t(e,i){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let i=0,n=e.length;i<n;i++)if(t(e[i]))return!0;return!1}if(o(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return t(e.toJSON(),!0);for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t(e[i]))return!0;return!1}}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.loaded=!0,s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};return(()=>{"use strict";var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.argChk_Boolean=t.argChk_Num=t.Layer=t.CmnLib=t.SysApp=void 0;const e=i(5041);Object.defineProperty(t,"SysApp",{enumerable:!0,get:function(){return e.SysApp}});const r=i(4965);Object.defineProperty(t,"CmnLib",{enumerable:!0,get:function(){return r.CmnLib}}),Object.defineProperty(t,"argChk_Num",{enumerable:!0,get:function(){return r.argChk_Num}}),Object.defineProperty(t,"argChk_Boolean",{enumerable:!0,get:function(){return r.argChk_Boolean}});const s=i(1481);Object.defineProperty(t,"Layer",{enumerable:!0,get:function(){return s.Layer}})})(),n})()}));