@wcardinal/wcardinal-ui 0.309.0 → 0.310.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 (119) hide show
  1. package/README.md +1 -1
  2. package/dist/types/wcardinal/ui/d-base-state-and-value.d.ts +4 -0
  3. package/dist/types/wcardinal/ui/d-base-state-matcher.d.ts +1 -0
  4. package/dist/types/wcardinal/ui/d-base-state-set-blinker-datum-impl.d.ts +5 -0
  5. package/dist/types/wcardinal/ui/d-base-state-set-blinker-impl.d.ts +8 -0
  6. package/dist/types/wcardinal/ui/d-base-state-set-blinker.d.ts +3 -0
  7. package/dist/types/wcardinal/ui/d-base-state-set-impl.d.ts +51 -18
  8. package/dist/types/wcardinal/ui/d-base-state-set-sub-datum-impl.d.ts +17 -0
  9. package/dist/types/wcardinal/ui/d-base-state-set-sub-datum.d.ts +6 -0
  10. package/dist/types/wcardinal/ui/d-base-state-set-sub-impl.d.ts +15 -0
  11. package/dist/types/wcardinal/ui/d-base-state-set-sub.d.ts +6 -0
  12. package/dist/types/wcardinal/ui/d-base-state-set-ticker-datum-impl.d.ts +5 -0
  13. package/dist/types/wcardinal/ui/d-base-state-set-ticker-impl.d.ts +8 -0
  14. package/dist/types/wcardinal/ui/d-base-state-set-ticker.d.ts +3 -0
  15. package/dist/types/wcardinal/ui/d-base-state-set.d.ts +38 -8
  16. package/dist/types/wcardinal/ui/d-base.d.ts +23 -1
  17. package/dist/types/wcardinal/ui/d-chart-axis-base-guide-container.d.ts +21 -0
  18. package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +6 -0
  19. package/dist/types/wcardinal/ui/d-chart-axis-base-options.d.ts +5 -0
  20. package/dist/types/wcardinal/ui/d-chart-axis-base.d.ts +4 -0
  21. package/dist/types/wcardinal/ui/d-chart-axis-guide-container.d.ts +14 -0
  22. package/dist/types/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.d.ts +41 -0
  23. package/dist/types/wcardinal/ui/d-chart-axis-guide-simple-shape.d.ts +80 -0
  24. package/dist/types/wcardinal/ui/d-chart-axis-guide-simple.d.ts +32 -0
  25. package/dist/types/wcardinal/ui/d-chart-axis-guide.d.ts +14 -0
  26. package/dist/types/wcardinal/ui/d-chart-axis.d.ts +2 -0
  27. package/dist/types/wcardinal/ui/d-dynamic-text-geometry.d.ts +7 -4
  28. package/dist/types/wcardinal/ui/d-dynamic-text-measure-result.d.ts +3 -0
  29. package/dist/types/wcardinal/ui/d-dynamic-text-measure.d.ts +4 -3
  30. package/dist/types/wcardinal/ui/d-dynamic-text-style.d.ts +16 -1
  31. package/dist/types/wcardinal/ui/d-dynamic-text.d.ts +7 -6
  32. package/dist/types/wcardinal/ui/d-links.d.ts +2 -1
  33. package/dist/types/wcardinal/ui/d-text-base.d.ts +1 -0
  34. package/dist/types/wcardinal/ui/index.d.ts +18 -0
  35. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-text-base.d.ts +1 -0
  36. package/dist/types/wcardinal/ui/theme/white/d-theme-white-text-base.d.ts +1 -0
  37. package/dist/types/wcardinal/ui/util/util-font.d.ts +2 -0
  38. package/dist/wcardinal/ui/d-base-state-and-value.js +2 -0
  39. package/dist/wcardinal/ui/d-base-state-and-value.js.map +1 -0
  40. package/dist/wcardinal/ui/d-base-state-matcher.js +2 -0
  41. package/dist/wcardinal/ui/d-base-state-matcher.js.map +1 -0
  42. package/dist/wcardinal/ui/d-base-state-set-blinker-datum-impl.js +17 -0
  43. package/dist/wcardinal/ui/d-base-state-set-blinker-datum-impl.js.map +1 -0
  44. package/dist/wcardinal/ui/d-base-state-set-blinker-impl.js +16 -0
  45. package/dist/wcardinal/ui/d-base-state-set-blinker-impl.js.map +1 -0
  46. package/dist/wcardinal/ui/d-base-state-set-blinker.js +2 -0
  47. package/dist/wcardinal/ui/d-base-state-set-blinker.js.map +1 -0
  48. package/dist/wcardinal/ui/d-base-state-set-impl.js +298 -129
  49. package/dist/wcardinal/ui/d-base-state-set-impl.js.map +1 -1
  50. package/dist/wcardinal/ui/d-base-state-set-sub-datum-impl.js +75 -0
  51. package/dist/wcardinal/ui/d-base-state-set-sub-datum-impl.js.map +1 -0
  52. package/dist/wcardinal/ui/d-base-state-set-sub-datum.js +2 -0
  53. package/dist/wcardinal/ui/d-base-state-set-sub-datum.js.map +1 -0
  54. package/dist/wcardinal/ui/d-base-state-set-sub-impl.js +73 -0
  55. package/dist/wcardinal/ui/d-base-state-set-sub-impl.js.map +1 -0
  56. package/dist/wcardinal/ui/d-base-state-set-sub.js +2 -0
  57. package/dist/wcardinal/ui/d-base-state-set-sub.js.map +1 -0
  58. package/dist/wcardinal/ui/d-base-state-set-ticker-datum-impl.js +17 -0
  59. package/dist/wcardinal/ui/d-base-state-set-ticker-datum-impl.js.map +1 -0
  60. package/dist/wcardinal/ui/d-base-state-set-ticker-impl.js +16 -0
  61. package/dist/wcardinal/ui/d-base-state-set-ticker-impl.js.map +1 -0
  62. package/dist/wcardinal/ui/d-base-state-set-ticker.js +2 -0
  63. package/dist/wcardinal/ui/d-base-state-set-ticker.js.map +1 -0
  64. package/dist/wcardinal/ui/d-base-state-set.js.map +1 -1
  65. package/dist/wcardinal/ui/d-base.js +34 -2
  66. package/dist/wcardinal/ui/d-base.js.map +1 -1
  67. package/dist/wcardinal/ui/d-chart-axis-base-guide-container.js +75 -0
  68. package/dist/wcardinal/ui/d-chart-axis-base-guide-container.js.map +1 -0
  69. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +7 -0
  70. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
  71. package/dist/wcardinal/ui/d-chart-axis-base-options.js.map +1 -1
  72. package/dist/wcardinal/ui/d-chart-axis-base.js +23 -1
  73. package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
  74. package/dist/wcardinal/ui/d-chart-axis-guide-container.js +2 -0
  75. package/dist/wcardinal/ui/d-chart-axis-guide-container.js.map +1 -0
  76. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js +328 -0
  77. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js.map +1 -0
  78. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape.js +2 -0
  79. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape.js.map +1 -0
  80. package/dist/wcardinal/ui/d-chart-axis-guide-simple.js +123 -0
  81. package/dist/wcardinal/ui/d-chart-axis-guide-simple.js.map +1 -0
  82. package/dist/wcardinal/ui/d-chart-axis-guide.js +2 -0
  83. package/dist/wcardinal/ui/d-chart-axis-guide.js.map +1 -0
  84. package/dist/wcardinal/ui/d-chart-axis.js.map +1 -1
  85. package/dist/wcardinal/ui/d-dynamic-text-geometry.js +17 -10
  86. package/dist/wcardinal/ui/d-dynamic-text-geometry.js.map +1 -1
  87. package/dist/wcardinal/ui/d-dynamic-text-measure-result.js +22 -0
  88. package/dist/wcardinal/ui/d-dynamic-text-measure-result.js.map +1 -1
  89. package/dist/wcardinal/ui/d-dynamic-text-measure.js +14 -10
  90. package/dist/wcardinal/ui/d-dynamic-text-measure.js.map +1 -1
  91. package/dist/wcardinal/ui/d-dynamic-text-style.js +107 -6
  92. package/dist/wcardinal/ui/d-dynamic-text-style.js.map +1 -1
  93. package/dist/wcardinal/ui/d-dynamic-text.js +52 -29
  94. package/dist/wcardinal/ui/d-dynamic-text.js.map +1 -1
  95. package/dist/wcardinal/ui/d-links.js +18 -1
  96. package/dist/wcardinal/ui/d-links.js.map +1 -1
  97. package/dist/wcardinal/ui/d-text-base.js +6 -3
  98. package/dist/wcardinal/ui/d-text-base.js.map +1 -1
  99. package/dist/wcardinal/ui/index.js +18 -0
  100. package/dist/wcardinal/ui/index.js.map +1 -1
  101. package/dist/wcardinal/ui/shape/e-shape-state-set-impl-observable.js +2 -2
  102. package/dist/wcardinal/ui/shape/e-shape-state-set-impl-observable.js.map +1 -1
  103. package/dist/wcardinal/ui/theme/dark/d-theme-dark-text-base.js +3 -0
  104. package/dist/wcardinal/ui/theme/dark/d-theme-dark-text-base.js.map +1 -1
  105. package/dist/wcardinal/ui/theme/white/d-theme-white-text-base.js +3 -0
  106. package/dist/wcardinal/ui/theme/white/d-theme-white-text-base.js.map +1 -1
  107. package/dist/wcardinal/ui/util/util-font.js +18 -11
  108. package/dist/wcardinal/ui/util/util-font.js.map +1 -1
  109. package/dist/wcardinal-ui-theme-dark.js +4 -1
  110. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  111. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  112. package/dist/wcardinal-ui-theme-white.js +4 -1
  113. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  114. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  115. package/dist/wcardinal-ui.cjs.js +1403 -275
  116. package/dist/wcardinal-ui.js +1397 -275
  117. package/dist/wcardinal-ui.min.js +2 -2
  118. package/dist/wcardinal-ui.min.js.map +1 -1
  119. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  /*
2
- Winter Cardinal UI v0.309.0
2
+ Winter Cardinal UI v0.310.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
6
6
  Material Design icons by Google
7
7
  Apache license version 2.0.
8
8
  */
9
- !function(t){"use strict";var n={},i={},r={CIRCLE:0,RECTANGLE:1,RECTANGLE_ROUNDED:2,TRIANGLE:3,TRIANGLE_ROUNDED:4,LINE:5,IMAGE:6,IMAGE_SDF:7,GROUP:8,BAR:9,LABEL:10,NULL:11,GROUP_SHADOWED:12,LINE_OF_CIRCLES:13,LINE_OF_RECTANGLES:14,LINE_OF_RECTANGLE_ROUNDEDS:15,LINE_OF_TRIANGLES:16,LINE_OF_TRIANGLE_ROUNDEDS:17,EMBEDDED:18,EMBEDDED_LAYER:19,BUTTON:20,RECTANGLE_PIVOTED:21,CONNECTOR_LINE:22,CONNECTOR_ELBOW:23,SEMICIRCLE:24,EXTENSION:1e3},e={},u=function(){function t(t,n,i,r,e,u){this.buffer=t,this.i=u,this.u=n,this.h=i,this.o=r,this.l=e}return t.prototype.init=function(t){t.uploaded=this;for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].init(n);return this.update(t),this},t.prototype.update=function(t){for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].update(n,t)},t.prototype.isCompatible=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)if(!n[i].isCompatible(t))return!1;return!0},t.prototype.getBuffer=function(){return this.buffer},t.prototype.getVertexOffset=function(){return this.u},t.prototype.getVertexCount=function(){return this.o},t.prototype.getIndexOffset=function(){return this.h},t.prototype.getIndexCount=function(){return this.l},t.prototype.buildUnit=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)n[i].buildUnit(t)},t}(),s={NONE:0,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING:14,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896},h=function(t,n,i,r){return i&s.DOTTED_MASK?i&s.DOTTED?r.set(n,n):i&s.DOTTED_DENSELY?r.set(n,.5*n):r.set(n,2*n):i&s.DASHED_MASK?i&s.DASHED?r.set(2*n,n):i&s.DASHED_DENSELY?r.set(2*n,.5*n):r.set(2*n,2*n):r.set(2*t,0),r},o=function(t){var n=t&s.NON_EXPANDING_WIDTH?1:0,i=t&s.NON_SHRINKING_WIDTH?2:0;return t&(s.DOTTED_MASK||s.DASHED_MASK)?n|i|(t&s.NON_SCALING_DOT_AND_DASH?4:0):n|i},a=new t.Point,c=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5,t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5},f=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+2,t[++r]=n+1,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3},l=function(t,n,i,r,e,u,s,c,f){var l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty,w=e[0],p=e[1],O=l*w+b*p+g,D=v*w+d*p+m,E=e[2],M=e[3],S=l*E+b*M+g,T=v*E+d*M+m,j=S-O,N=T-D,I=Math.sqrt(j*j+N*N),C=I;if(0<=u&&1e-5<I){var A=u/I;S=O+(j*=A),T=D+(N*=A),C=u}var R=O-j,L=D-N,y=S+j,k=T+N,x=o(c),B=h(C,s,c,a),_=B.x,P=B.y,U=(r<<1)-1,F=(r<<2)-1,G=6*r-1;t[++U]=O,t[++U]=D,t[++U]=O,t[++U]=D,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=L,n[++G]=S,n[++G]=T,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=L,n[++G]=S,n[++G]=T,i[++F]=0,i[++F]=_,i[++F]=P,i[++F]=C,i[++F]=0,i[++F]=_,i[++F]=P,i[++F]=C,t[++U]=S,t[++U]=T,t[++U]=S,t[++U]=T,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=y,n[++G]=k,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=y,n[++G]=k,i[++F]=C,i[++F]=_,i[++F]=P,i[++F]=C,i[++F]=C,i[++F]=_,i[++F]=P,i[++F]=C},v=function(t,n,i){var r=(n<<1)-1;t[++r]=i.x0,t[++r]=i.y0,t[++r]=i.x3,t[++r]=i.y3,t[++r]=i.x1,t[++r]=i.y1,t[++r]=i.x2,t[++r]=i.y2},b=function(){function t(){this.target="",this.position=0}return t.prototype.init=function(t){this.target=t,this.position=0},t.prototype.hasNext=function(){return this.position<this.target.length},t.prototype.findNextBreak=function(t,n){for(var i=t.length,r=n;r<i;++r){var e=t.charCodeAt(r);if(!this.isLowSurrogate(e)&&!this.isVariationSelector(e))return r}return i},t.prototype.isHighSurrogate=function(t){return 55296<=t&&t<=56319},t.prototype.isLowSurrogate=function(t){return 56320<=t&&t<=57343},t.prototype.isVariationSelector=function(t){return 65024<=t&&t<=65039},t.prototype.next=function(){var t=this.target,n=this.position,i=this.findNextBreak(t,n+1),r=t.substring(n,i);return this.position=i,r},t.prototype.advance=function(t){var n=this.target,i=this.position,r=this.findNextBreak(n,i+1);return n.substring(i,r)!==t&&(this.position=r,!0)},t.prototype.close=function(){var t=this.target.length;return this.position<t&&(this.position=t,!0)},t.from=function(n){null==t.v&&(t.v=new t);var i=t.v;return i.init(n),i},t.v=null,t}(),d={NORMAL:0,BOLD:1},g={NORMAL:0,ITALIC:1},m={LEFT:0,CENTER:1,RIGHT:2,OUTSIDE_LEFT:3,OUTSIDE_RIGHT:4},w={TOP:0,MIDDLE:1,BOTTOM:2,OUTSIDE_TOP:3,OUTSIDE_BOTTOM:4},p={LEFT_TO_RIGHT:0,TOP_TO_BOTTOM:1,BOTTOM_TO_TOP:2,RIGHT_TO_LEFT:3},O=function(t,n,i,r){var e=i-t,u=r-n;return Math.sqrt(e*e+u*u)},D=1e-5,E=new t.Point,M=function(t){return 12*Math.ceil(t.text.value.length/12)},S=function(t,n,i){for(var r=3*n-1,e=3*(n+i)-1;r<e;)t[++r]=0,t[++r]=0,t[++r]=2},T=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s,t[++e]=s+1,t[++e]=s+3,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=4},j=function(t,n,i,r,e,u,h,a,c){var f=6*n-1,l=6*(n+i)-1,v=o(s.NONE);if(null!=r)for(var b=r.font.size/(e*(a+c)*.5),g=h===d.NORMAL?0:.05;f<l;)t[++f]=u,t[++f]=v,t[++f]=b,t[++f]=1,t[++f]=0,t[++f]=g;else for(;f<l;)t[++f]=0,t[++f]=v,t[++f]=0,t[++f]=1,t[++f]=0,t[++f]=0},N=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g,p,O,D,E){switch(t){case m.LEFT:switch(n){case w.TOP:E.x=o+g*(i+e)+O*(r+u),E.y=a+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i+e)+O*(r-.5*h),E.y=.5*(a+d)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i+e)+O*(r-u-h),E.y=d+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i+e)+O*(r-u-h),E.y=a+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i+e)+O*(r+u),E.y=d+p*(i+e)+D*(r+u)}break;case m.CENTER:switch(n){case w.TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r+u),E.y=.5*(a+f)+p*(i-.5*s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+l)+g*(i-.5*s)+O*(r-.5*h),E.y=.5*(a+v)+p*(i-.5*s)+D*(r-.5*h);break;case w.BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(d+v)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(a+f)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r+u),E.y=.5*(d+v)+p*(i-.5*s)+D*(r+u)}break;case m.RIGHT:switch(n){case w.TOP:E.x=c+g*(i-e-s)+O*(r+u),E.y=f+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(f+v)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i-e-s)+O*(r-u-h),E.y=v+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i-e-s)+O*(r-u-h),E.y=f+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i-e-s)+O*(r+u),E.y=v+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_LEFT:switch(n){case w.TOP:E.x=o+g*(i-e-s)+O*(r+u),E.y=a+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(a+d)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i-e-s)+O*(r-u-h),E.y=d+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i-e-s)+O*(r-u-h),E.y=a+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i-e-s)+O*(r+u),E.y=d+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_RIGHT:switch(n){case w.TOP:E.x=c+g*(i+e)+O*(r+u),E.y=f+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i+e)+O*(r-.5*h),E.y=.5*(f+v)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i+e)+O*(r-u-h),E.y=v+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i+e)+O*(r-u-h),E.y=f+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i+e)+O*(r+u),E.y=v+p*(i+e)+D*(r+u)}}},I=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,d,M,S,T,j,I,L,y,k,B,_,P){var U=.5*s,F=.5*h,G=P.a,H=P.b,z=P.c,V=P.d,W=P.tx,X=P.ty,K=e-U,Y=u-F,J=e+U,Z=u-F,q=e+U,Q=u+F,$=G*K+z*Y+W,tt=H*K+V*Y+X,nt=G*J+z*Z+W,it=H*J+V*Z+X,rt=G*q+z*Q+W,et=H*q+V*Q+X,ut=$+(rt-nt),st=tt+(et-it),ht=O($,tt,nt,it),ot=O(0,0,G,H),at=1,ct=0;if(D<ot){var ft=1/ot;at=G*ft,ct=H*ft}var lt=O($,tt,ut,st),vt=O(0,0,z,V),bt=0,dt=1;if(D<ot){var gt=1/vt;bt=z*gt,dt=V*gt}var mt=E;switch(j){case p.LEFT_TO_RIGHT:break;case p.TOP_TO_BOTTOM:mt.set(bt,dt),bt=-at,dt=-ct,at=mt.x,ct=mt.y,mt.x=vt,vt=ot,ot=mt.x;break;case p.BOTTOM_TO_TOP:mt.set(bt,dt),bt=at,dt=ct,at=-mt.x,ct=-mt.y,mt.x=vt,vt=ot,ot=mt.x;break;case p.RIGHT_TO_LEFT:at=-at,ct=-ct,bt=-bt,dt=-dt}for(var wt=0,pt=0,Ot=0,Dt=a*vt,Et=Math.max(0,a+T)*vt,Mt=0,St=1,Tt=o.characters,jt=b.from(c),Nt=0;jt.hasNext();)"\n"!==(vn=jt.next())?(0<Nt&&(Mt+=Math.max(0,Nt+S)),(dn=Tt[vn])?(Nt=dn.advance,Ot=dn.height):Nt=0):(Mt+=Nt,Nt=0,wt=Math.max(wt,Mt),Mt=0,pt+=Et,St+=1);if(Mt+=Nt,wt=Math.max(wt,Mt),pt+=Dt,Mt=0,k&&C(l,v)){var It=0,Ct=0;switch(j){case p.LEFT_TO_RIGHT:case p.RIGHT_TO_LEFT:It=Math.max(0,ht-2*I),Ct=Math.max(0,lt-2*L);break;case p.TOP_TO_BOTTOM:case p.BOTTOM_TO_TOP:It=Math.max(0,lt-2*L),Ct=Math.max(0,ht-2*I)}var At=wt*ot*(a/o.font.size),Rt=pt,Lt=Math.min(1,Math.min(It/At,Ct/Rt));a*=Lt,Dt*=Lt,Et*=Lt,pt*=Lt}var yt=a/o.font.size,kt=ot*yt;wt*=kt,Ot*=vt*yt;var xt=0,Bt=0,_t=NaN;switch(j){case p.LEFT_TO_RIGHT:N(l,v,d,M,I,L,wt,pt,$,tt,nt,it,rt,et,ut,st,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,y&&C(l,v)&&(_t=ht-2*I);break;case p.TOP_TO_BOTTOM:N(function(t){switch(t){case w.TOP:return m.LEFT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.RIGHT;case w.OUTSIDE_TOP:return m.OUTSIDE_LEFT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_RIGHT}}(v),function(t){switch(t){case m.LEFT:return w.BOTTOM;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.TOP;case m.OUTSIDE_LEFT:return w.OUTSIDE_BOTTOM;case m.OUTSIDE_RIGHT:return w.OUTSIDE_TOP}}(l),M,d,L,I,wt,pt,nt,it,rt,et,ut,st,$,tt,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,y&&C(l,v)&&(_t=lt-2*L);break;case p.BOTTOM_TO_TOP:N(function(t){switch(t){case w.TOP:return m.RIGHT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.LEFT;case w.OUTSIDE_TOP:return m.OUTSIDE_RIGHT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_LEFT}}(v),function(t){switch(t){case m.LEFT:return w.TOP;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.BOTTOM;case m.OUTSIDE_LEFT:return w.OUTSIDE_TOP;case m.OUTSIDE_RIGHT:return w.OUTSIDE_BOTTOM}}(l),M,d,L,I,wt,pt,ut,st,$,tt,nt,it,rt,et,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,y&&C(l,v)&&(_t=lt-2*L);break;case p.RIGHT_TO_LEFT:N(function(t){switch(t){case m.LEFT:return m.RIGHT;case m.CENTER:return m.CENTER;case m.RIGHT:return m.LEFT;case m.OUTSIDE_LEFT:return m.OUTSIDE_RIGHT;case m.OUTSIDE_RIGHT:return m.OUTSIDE_LEFT}}(l),function(t){switch(t){case w.TOP:return w.BOTTOM;case w.MIDDLE:return w.MIDDLE;case w.BOTTOM:return w.TOP;case w.OUTSIDE_TOP:return w.OUTSIDE_BOTTOM;case w.OUTSIDE_BOTTOM:return w.OUTSIDE_TOP}}(v),d,M,I,L,wt,pt,rt,et,ut,st,$,tt,nt,it,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,y&&C(l,v)&&(_t=ht-2*I)}if(_t<wt){var Pt=.5*(wt-_t);B[0]=xt+at*Pt,B[1]=Bt+ct*Pt,B[2]=at,B[3]=ct,B[4]=bt,B[5]=dt,B[6]=_t,B[7]=pt,B[8]=ot,B[9]=vt}else B[0]=xt,B[1]=Bt,B[2]=at,B[3]=ct,B[4]=bt,B[5]=dt,B[6]=wt,B[7]=pt,B[8]=ot,B[9]=vt;var Ut=_.x0,Ft=_.x1,Gt=_.x3,Ht=_.y0,zt=_.y1,Vt=_.y3,Wt=Ft-Ut,Xt=zt-Ht,Kt=Gt-Ut,Yt=Vt-Ht,Jt=Et*bt,Zt=Et*dt,qt=kt*at,Qt=kt*ct,$t=.5*(Ot-Dt),tn=$t*bt,nn=$t*dt,rn=f===g.NORMAL?0:.25*a,en=xt-tn+rn*qt,un=Bt-nn+rn*Qt,sn=xt+tn+Dt*bt,hn=Bt+nn+Dt*dt,on=en,an=un,cn=sn,fn=hn;Mt=0,Nt=0,jt.position=0,St=0;for(var ln=2*i;jt.hasNext();ln+=8){var vn;if("\n"!==(vn=jt.next())){var bn=Mt;0<Nt&&(Mt+=Math.max(0,Nt+S));var dn,gn=Mt*qt,mn=Mt*Qt;if(on=en+gn,an=un+mn,cn=sn+gn,fn=hn+mn,St+=1,dn=Tt[vn]){var wn=dn.advance;if(_t<(Mt+wn)*kt){var pn=Tt["..."];if(pn){if(1<St&&_t<(Mt+pn.advance)*kt){ln-=8,St-=1;var On=(Mt=bn)*qt,Dn=Mt*Qt;on=en+On,an=un+Dn,cn=sn+On,fn=hn+Dn}for(Nt=pn.advance,R(t,n,ln,pn,o,qt,Qt,on,an,cn,fn,Wt,Xt,Kt,Yt,Ut,Ht),ln+=8;;ln+=8){if(!jt.hasNext()||!jt.advance("\n")){ln-=8;break}A(t,n,ln,on,an,cn,fn,Ut,Ht,Gt,Vt),St+=1}}else Nt=wn,A(t,n,ln,on,an,cn,fn,Ut,Ht,Gt,Vt)}else Nt=wn,R(t,n,ln,dn,o,qt,Qt,on,an,cn,fn,Wt,Xt,Kt,Yt,Ut,Ht)}else Nt=0,A(t,n,ln,on,an,cn,fn,Ut,Ht,Gt,Vt)}else Mt+=Nt,Nt=0,A(t,n,ln,on=en+=Jt,an=un+=Zt,cn=sn+=Jt,fn=hn+=Zt,Ut,Ht,Gt,Vt),x(t,at,ct,St,ln,wt-Mt*kt,j,l,v),Mt=0,St=0}x(t,at,ct,St,ln,wt-(Mt+=Nt)*kt,j,l,v);for(var En=2*(i+r);ln<En;ln+=2)t[ln+0]=xt,t[ln+1]=Bt,n[ln+0]=Ut,n[ln+1]=Ht},C=function(t,n){switch(t){case m.LEFT:case m.CENTER:case m.RIGHT:switch(n){case w.TOP:case w.MIDDLE:case w.BOTTOM:return!0}}return!1},A=function(t,n,i,r,e,u,s,h,o,a,c){t[i+0]=r,t[i+1]=e,t[i+2]=r,t[i+3]=e,t[i+4]=u,t[i+5]=s,t[i+6]=u,t[i+7]=s,n[i+0]=h,n[i+1]=o,n[i+2]=h,n[i+3]=o,n[i+4]=a,n[i+5]=c,n[i+6]=a,n[i+7]=c},R=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=r.x-r.origin.x,w=r.width,p=m*u,O=m*s,D=(m+w)*u,E=(m+w)*s;t[i+0]=h+p,t[i+1]=o+O,t[i+2]=h+D,t[i+3]=o+E,t[i+4]=a+D,t[i+5]=c+E,t[i+6]=a+p,t[i+7]=c+O;var M=r.x/e.width,S=r.y/e.height,T=(r.x+r.width)/e.width,j=(r.y+r.height)/e.height,N=f*M,I=l*M,C=f*T,A=l*T,R=v*S,L=b*S,y=v*j,k=b*j;n[i+0]=d+N+R,n[i+1]=g+I+L,n[i+2]=d+C+R,n[i+3]=g+A+L,n[i+4]=d+C+y,n[i+5]=g+A+k,n[i+6]=d+N+y,n[i+7]=g+I+k},L=function(t,n,i,r,e){for(var u=n-8*i-1,s=0;s<i;++s)t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e},y=function(t,n,i,r,e,u){L(t,n,i,(r*=.5)*e,r*u)},k=function(t,n,i,r,e,u){L(t,n,i,r*e,r*u)},x=function(t,n,i,r,e,u,s,h,o){if(D<u)switch(s){case p.LEFT_TO_RIGHT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:break;case m.CENTER:y(t,e,r,u,n,i);break;case m.OUTSIDE_LEFT:case m.RIGHT:k(t,e,r,u,n,i)}break;case p.TOP_TO_BOTTOM:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:break;case w.MIDDLE:y(t,e,r,u,n,i);break;case w.OUTSIDE_TOP:case w.BOTTOM:k(t,e,r,u,n,i)}break;case p.BOTTOM_TO_TOP:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:k(t,e,r,u,n,i);break;case w.MIDDLE:y(t,e,r,u,n,i)}break;case p.RIGHT_TO_LEFT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:k(t,e,r,u,n,i);break;case m.CENTER:y(t,e,r,u,n,i)}}},B=function(t,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};function _(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}B(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var P,U,F,G={NONE:0,CLOSED:1,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896,CURVE:1024,FORMATTER_MASK:1024},H=function(t,n,i,r,e){for(var u=(t>>16&255)/255*n,s=(t>>8&255)/255*n,h=(t>>0&255)/255*n,o=n,a=(i<<2)-1,c=(i+r<<2)-1;a<c;)e[++a]=u,e[++a]=s,e[++a]=h,e[++a]=o},z=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=-1,this.strokeAlign=NaN,this.strokeWidth=NaN,this.strokeSide=NaN,this.strokeStyle=NaN,this.colorFill=NaN,this.alphaFill=-1,this.colorStroke=NaN,this.alphaStroke=-1,this.texture=null,this.textureTransformId=NaN}return n.prototype.isCompatible=function(t){return!0},n.prototype.updateColorFill=function(t,n){var i=n.fill,r=n.visible&&i.enable,e=i.color,u=r?i.alpha:0;e===this.colorFill&&u===this.alphaFill||(this.colorFill=e,this.alphaFill=u,t.updateColorFills(),H(e,u,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.stroke,r=n.visible&&i.enable&&0<i.width,e=i.color,u=r?i.alpha:0;e===this.colorStroke&&u===this.alphaStroke||(this.colorStroke=e,this.alphaStroke=u,t.updateColorStrokes(),H(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),V=function(t){return t.updateTransform(),t.transform.getLocalId()},W=function(n){return n.texture||t.Texture.WHITE},X=function(t){var n=t;return null==n._uvs&&t.updateUvs(),n._updateID},K=function(t){return t._uvs},Y=function(){function t(){}return t.setDefaultThemeClass=function(t){this.DEFAULT_THEME_CLASS=t},t.getDefaultThemeClass=function(){return this.DEFAULT_THEME_CLASS},t.getInstance=function(){if(null==this.INSTANCE){var t=this.getDefaultThemeClass();if(null==t)throw new Error("No default theme class found");this.INSTANCE=new t}return this.INSTANCE},t.setInstance=function(t){var n=this.INSTANCE;return this.INSTANCE=t,n},t.get=function(t){return this.getInstance().get(t)},t.set=function(t,n){this.getInstance().set(t,n)},t.getClass=function(t){return this.getInstance().getClass(t)},t.setClass=function(t,n){this.getInstance().setClass(t,n)},t.getAtlas=function(){return this.getInstance().getAtlas()},t.DEFAULT_THEME_CLASS=null,t.INSTANCE=null,t}(),J=function(){function t(){}return Object.defineProperty(t,"THEME",{get:function(){var t=this.g;if(null!=t)return t;var n=Y.getInstance().get("EShape");return this.g=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_COLOR",{get:function(){return this.THEME.getFillColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_ALPHA",{get:function(){return this.THEME.getFillAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_COLOR",{get:function(){return this.THEME.getStrokeColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALPHA",{get:function(){return this.THEME.getStrokeAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_WIDTH",{get:function(){return this.THEME.getStrokeWidth()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALIGN",{get:function(){return this.THEME.getStrokeAlign()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_SIDE",{get:function(){return this.THEME.getStrokeSide()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_STYLE",{get:function(){return this.THEME.getStrokeStyle()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_VALUE",{get:function(){return this.THEME.getTextValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_COLOR",{get:function(){return this.THEME.getTextColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_ALPHA",{get:function(){return this.THEME.getTextAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_FAMILY",{get:function(){return this.THEME.getTextFamily()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_SIZE",{get:function(){return this.THEME.getTextSize()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"RADIUS",{get:function(){return this.THEME.getRadius()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_X",{get:function(){return this.THEME.getSizeX()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_Y",{get:function(){return this.THEME.getSizeY()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HIGHLIGHT_COLOR",{get:function(){return this.THEME.getHighlightColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"CURVE_SEGMENT_COUNT",{get:function(){return this.THEME.getCurveSegmentCount()},enumerable:!1,configurable:!0}),t}(),Z={NONE:0,CIRCLE:1,TRIANGLE:2,RECTANGLE:3},q=function(){function t(t,n,i,r){this.p=t,this.O=n,this.S=i,this.T=r}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha)},t.prototype.set=function(t,n,i){var r=!1;void 0!==t&&this.O!==t&&(this.O=t,r=!0),void 0!==n&&this.S!==n&&(this.S=n,r=!0),void 0!==i&&this.T!==i&&(this.T=i,r=!0),r&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T}},t.prototype.serialize=function(t){var n="[".concat(this.O?1:0,",").concat(this.S,",").concat(this.T,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getFill(t);if(null!=r)this.set(!!r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setFill(t,e),this.set(!!e[0],e[1],e[2])}}},t}(),Q=function(){function n(){}return n.prototype.lock=function(){return this},n.prototype.unlock=function(){return this},Object.defineProperty(n.prototype,"type",{get:function(){return Z.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var n=this.j;return null==n&&(n=new t.Point,this.j=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transform",{get:function(){var n=this.I;return null==n&&(n=new t.Matrix,this.I=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){var t=this.C;return null==t&&(t=new q(this,!0,J.FILL_COLOR,1),this.C=t),t},enumerable:!1,configurable:!0}),n.prototype.updateUploaded=function(){},n.prototype.copy=function(t){return this},n.prototype.set=function(t,n,i){return this},n.prototype.serialize=function(t){return-1},n.prototype.deserialize=function(t,n){},n}(),$=function(){function t(){this.A=new Q}return t.prototype.lock=function(){return this},t.prototype.unlock=function(){return this},Object.defineProperty(t.prototype,"head",{get:function(){return this.A},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.A},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t.getInstance=function(){var n=this.INSTANCE;return null==n&&(n=new t,this.INSTANCE=n),n},t}(),tt={TOP:0,LEFT:1,RIGHT:2,BOTTOM:3},nt=function(){function n(t){this.p=t,this.R=0,this.L=[0,0,0,0],this.k=[],this.B=G.NONE,this.j=-1,this._=tt.TOP,this.P=NaN,this.U=NaN,this.F=NaN,this.G=NaN}return n.prototype.getComputedSize=function(t,n,i,r){if(0<=t)return t;switch(n){case tt.TOP:case tt.BOTTOM:return Math.abs(r);case tt.RIGHT:case tt.LEFT:return Math.abs(i)}return 0},n.prototype.update=function(){var t=this.p.size,n=t.x,i=t.y,r=this._,e=this.j;if(this.P!==e||this.U!==n||this.F!==i||this.G!==r){this.R+=1,this.P=e,this.U=n,this.F=i,this.G=r;var u=.5*n,s=.5*i,h=this.getComputedSize(e,r,n,i),o=this.L;switch(r){case tt.TOP:o[0]=0,o[1]=-s,o[2]=0,o[3]=-s+h;break;case tt.RIGHT:o[0]=u,o[1]=0,o[2]=u-h,o[3]=0;break;case tt.BOTTOM:o[0]=0,o[1]=s,o[2]=0,o[3]=s-h;break;case tt.LEFT:o[0]=-u,o[1]=0,o[2]=-u+h,o[3]=0}}},Object.defineProperty(n.prototype,"length",{get:function(){return 2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.update(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.update(),this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.k},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){this.moveTo(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"position",{get:function(){return this._},set:function(t){this.moveTo(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.moveTo(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=$.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return t instanceof n?this.moveTo(t.position,t.size,t.style):this.moveTo(void 0,void 0,t.style)},n.prototype.set=function(t,n,i){var r,e;if(null!=t){var u=t[0];if(0===u){var s=t[1];r=s<=0?tt.TOP:tt.BOTTOM,e=Math.abs(t[3]-s)}else r=u<=0?tt.LEFT:tt.RIGHT,e=Math.abs(t[2]-u)}return this.moveTo(r,e,i)},n.prototype.moveTo=function(t,n,i){var r=!1;return null!=i&&this.B!==i&&(this.B=i,r=!0),null!=t&&this._!==t&&(this._=t,r=!0),null!=n&&this.j!==n&&(this.j=n,r=!0),r&&this.p.updateUploaded(),this},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[".concat(this._,",").concat(this.j,",").concat(this.B,"]"))},n.prototype.deserialize=function(t,n){if(0<=t&&t<n.resources.length){var i=n.resources[t],r=JSON.parse(i);this.moveTo(r[0],r[1],r[2])}},n.prototype.calcHitPointAbs=function(t,n,i,r,e,u,s,h){if(2<=this.length){var o=this.L;if(s(t,n,o[0],o[1],o[2],o[3],0,e,h))return!0}return!1},n}(),it={NONE:0,LINE:1,MARKER_TAIL:2,MARKER_HEAD:3,TEXT:4,CHILDREN:5},rt={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},et=function(){function t(){}return t.add=function(n){t.INSTANCES.push(n)},t.first=function(){var n=t.INSTANCES;if(0<n.length)return n[0];throw new Error("No application found.")},t.last=function(){var n=t.INSTANCES;if(0<n.length)return n[n.length-1];throw new Error("No application found.")},t.get=function(n){var i=t.INSTANCES;return 0<=n&&n<i.length?i[n]:null},t.indexOf=function(n){return t.INSTANCES.indexOf(n)},t.size=function(){return t.INSTANCES.length},t.getStage=function(t){for(var n=t;n.parent;)n=n.parent;return"application"in n&&"layer"in n?n:null},t.find=function(t){var n=this.getStage(t);return n?n.layer.application:null},t.getLayerBase=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerBase():null},t.getLayerOverlay=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerOverlay():null},t.getLayer=function(t){var n=this.getStage(t);return n?n.layer:null},t.getResolution=function(t){var n,i=this.getLayer(t);return i?i.renderer.resolution:null!==(n=window.devicePixelRatio)&&void 0!==n?n:1},t.update=function(n){if(n){var i=this.getStage(n);i&&i.layer.update()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].update()},t.render=function(n){if(n){var i=this.getStage(n);i&&i.layer.render()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].render()},t.INSTANCES=[],t}(),ut=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if(n[i]===t)return i;for(i=0,r=n.length;i<r;++i)if(n[i].isEquals(t))return i;return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.serialize=function(t){for(var n=[],i=this.values,r=0,e=i.length;r<e;++r)n.push(i[r].serialize(t));return n},t}(),st=function(){function t(t){this.p=t,this.V=new Set}return t.prototype.add=function(t){var n=this.V;return!n.has(t)&&(n.add(t),!0)},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.size=function(){return this.V.size},t.prototype.remove=function(t){return this.V.delete(t)},t.prototype.clear=function(){return 0<this.V.size&&(this.V.clear(),!0)},t.prototype.copy=function(t){var n=this.V;return n.clear(),t.each((function(t){n.add(t)})),this},t.prototype.each=function(t){return this.V.forEach(t),this},t.prototype.fit=function(t){this.V.forEach(this.toOnFitBound(t))},t.prototype.toOnFitBound=function(t){var n;return t?(null==(n=this.W)&&(n=this.newOnFitBound(!0),this.W=n),n):(null==(n=this.K)&&(n=this.newOnFitBound(!1),this.K=n),n)},t.prototype.newOnFitBound=function(t){var n=this;return function(i){n.onFit(i,t)}},t.prototype.onFit=function(t,n){t.fit(n)},t.prototype.attach=function(){var t=this.p;return this.V.forEach((function(n){n.set(t)})),this},t.prototype.detach=function(){return this.V.forEach((function(t){t.set(null)})),this},t}(),ht={NONE:0,TRANSFORM:1,SIZE:2,STYLE:4,ACTION:8,POINTS:16,STATE:32,IMAGE:64,DATA:128,TAG:128,CONNECTOR:256,CAPABILITY:512,ALL:1023},ot={HOVERED:"HOVERED",ACTIVE:"ACTIVE",FOCUSED:"FOCUSED",UNFOCUSABLE:"UNFOCUSABLE",FOCUS_ROOT:"FOCUS_ROOT",FOCUS_REVERSE:"FOCUS_REVERSE",READ_ONLY:"READ_ONLY",DISABLED:"DISABLED",GESTURING:"GESTURING",PRESSED:"PRESSED",INVALID:"INVALID",SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",WARNED:"WARNED",CHANGED:"CHANGED",ALTERNATED:"ALTERNATED",NEW_WINDOW:"NEW_WINDOW"},at=function(t){return"function"==typeof t},ct=function(t){return"string"==typeof t||"[object String]"===Object.prototype.toString.call(t)},ft=function(){function t(){this.J=new Set,this.p=null}return t.prototype.is=function(t){return this.J.has(t)},t.prototype.in=function(t){return this.is(t)||this.under(t)},t.prototype.on=function(t){var n,i;return null!==(i=null===(n=this.p)||void 0===n?void 0:n.is(t))&&void 0!==i&&i},t.prototype.under=function(t){var n,i;return null!==(i=null===(n=this.p)||void 0===n?void 0:n.in(t))&&void 0!==i&&i},t.prototype.lock=function(t){return this},t.prototype.unlock=function(){return this},t.prototype.begin=function(){return this},t.prototype.end=function(){return this},t.prototype.checkAdded=function(t){return!this.J.has(t)},t.prototype.add=function(t){return this.checkAdded(t)&&(this.begin(),this.J.add(t),this.end()),this},t.prototype.checkAddeds=function(t){for(var n=this.J,i=0,r=t.length;i<r;++i)if(!n.has(t[i]))return!0;return!1},t.prototype.addAll=function(t){var n=ct(t)?arguments:t;if(this.checkAddeds(n)){this.begin();for(var i=this.J,r=0,e=n.length;r<e;++r)i.add(n[r]);this.end()}return this},t.prototype.checkRemoved=function(t){return this.J.has(t)},t.prototype.remove=function(t){return this.checkRemoved(t)&&(this.begin(),this.J.delete(t),this.end()),this},t.prototype.checkRemoveds=function(t){for(var n=this.J,i=0,r=t.length;i<r;++i)if(n.has(t[i]))return!0;return!1},t.prototype.removeAll=function(t){var n=this,i=this.J;if(at(t)){var r=!1;i.forEach((function(e){t(e)&&(r||(r=!0,n.begin()),i.delete(e))})),r&&this.end()}else{var e=ct(t)?arguments:t;if(this.checkRemoveds(e)){this.begin();for(var u=0,s=e.length;u<s;++u)i.delete(e[u]);this.end()}}return this},t.prototype.clear=function(){var t=this.J;return 0<t.size&&(this.begin(),t.clear(),this.end()),this},t.prototype.set=function(t,n){if(!0===n)null!=t&&this.add(t);else if(!1===n)null!=t&&this.remove(t);else{var i=t,r=n;null!=i?null!=r?(this.checkAdded(i)||this.checkRemoved(r))&&(this.begin(),this.J.add(i).delete(r),this.end()):this.add(i):null!=r&&this.remove(r)}return this},t.prototype.setAll=function(t,n){if(!0===n)null!=t&&this.addAll(t);else if(!1===n)null!=t&&this.removeAll(t);else{var i=t,r=n;if(null!=i)if(null!=r){if(this.checkAddeds(i)||this.checkRemoveds(r)){this.begin();for(var e=this.J,u=0,s=i.length;u<s;++u)e.add(i[u]);for(u=0,s=r.length;u<s;++u)e.delete(r[u]);this.end()}}else this.addAll(i);else null!=r&&this.removeAll(r)}return this},t.prototype.each=function(t){return this.J.forEach((function(n){t(n)})),this},t.prototype.size=function(){return this.J.size},t.prototype.copy=function(n){if(n instanceof t){this.begin();var i=this.J;i.clear(),n.local.forEach((function(t){i.add(t)})),this.p=n.parent,this.end()}return this},Object.defineProperty(t.prototype,"local",{get:function(){return this.J},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},set:function(t){this.p!==t&&(this.begin(),this.p=t,this.end())},enumerable:!1,configurable:!0}),t.prototype.onParentChange=function(t,n){this.p=n,this.begin(),this.p=t,this.end()},Object.defineProperty(t.prototype,"isHovered",{get:function(){return this.is(ot.HOVERED)},set:function(t){this.set(ot.HOVERED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inHovered",{get:function(){return this.in(ot.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHovered",{get:function(){return this.on(ot.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underHovered",{get:function(){return this.under(ot.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this.is(ot.ACTIVE)},set:function(t){this.set(ot.ACTIVE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inActive",{get:function(){return this.in(ot.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onActive",{get:function(){return this.on(ot.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underActive",{get:function(){return this.under(ot.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPressed",{get:function(){return this.is(ot.PRESSED)},set:function(t){this.set(ot.PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inPressed",{get:function(){return this.in(ot.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onPressed",{get:function(){return this.on(ot.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underPressed",{get:function(){return this.under(ot.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return this.is(ot.READ_ONLY)},set:function(t){this.set(ot.READ_ONLY,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inReadOnly",{get:function(){return this.in(ot.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onReadOnly",{get:function(){return this.on(ot.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underReadOnly",{get:function(){return this.under(ot.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return!this.is(ot.DISABLED)},set:function(t){this.set(ot.DISABLED,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inEnabled",{get:function(){return!this.in(ot.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onEnabled",{get:function(){return!this.on(ot.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underEnabled",{get:function(){return!this.under(ot.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.is(ot.DISABLED)},set:function(t){this.set(ot.DISABLED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisabled",{get:function(){return this.in(ot.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDisabled",{get:function(){return this.on(ot.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underDisabled",{get:function(){return this.under(ot.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActionable",{get:function(){return!this.in(ot.DISABLED)&&!this.in(ot.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGesturing",{get:function(){return this.is(ot.GESTURING)},set:function(t){this.set(ot.GESTURING,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inGesturing",{get:function(){return this.in(ot.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onGesturing",{get:function(){return this.on(ot.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underGesturing",{get:function(){return this.under(ot.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocused",{get:function(){return this.is(ot.FOCUSED)},set:function(t){this.set(ot.FOCUSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocused",{get:function(){return this.in(ot.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocused",{get:function(){return this.on(ot.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocused",{get:function(){return this.under(ot.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusRoot",{get:function(){return this.is(ot.FOCUS_ROOT)},set:function(t){this.set(ot.FOCUS_ROOT,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusRoot",{get:function(){return this.in(ot.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusRoot",{get:function(){return this.on(ot.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusRoot",{get:function(){return this.under(ot.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusReverse",{get:function(){return this.is(ot.FOCUS_REVERSE)},set:function(t){this.set(ot.FOCUS_REVERSE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusReverse",{get:function(){return this.in(ot.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusReverse",{get:function(){return this.on(ot.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusReverse",{get:function(){return this.under(ot.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusable",{get:function(){return!this.is(ot.UNFOCUSABLE)},set:function(t){this.set(ot.UNFOCUSABLE,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusable",{get:function(){return!this.in(ot.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusable",{get:function(){return!this.on(ot.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusable",{get:function(){return!this.under(ot.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUnfocusable",{get:function(){return this.is(ot.UNFOCUSABLE)},set:function(t){this.set(ot.UNFOCUSABLE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inUnfocusable",{get:function(){return this.in(ot.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUnfocusable",{get:function(){return this.on(ot.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underUnfocusable",{get:function(){return this.under(ot.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isInvalid",{get:function(){return this.is(ot.INVALID)},set:function(t){this.set(ot.INVALID,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inInvalid",{get:function(){return this.in(ot.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onInvalid",{get:function(){return this.on(ot.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underInvalid",{get:function(){return this.on(ot.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSucceeded",{get:function(){return this.is(ot.SUCCEEDED)},set:function(t){this.set(ot.SUCCEEDED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inSucceeded",{get:function(){return this.in(ot.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSucceeded",{get:function(){return this.on(ot.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underSucceeded",{get:function(){return this.under(ot.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFailed",{get:function(){return this.is(ot.FAILED)},set:function(t){this.set(ot.FAILED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFailed",{get:function(){return this.in(ot.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFailed",{get:function(){return this.on(ot.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFailed",{get:function(){return this.under(ot.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isWarned",{get:function(){return this.is(ot.WARNED)},set:function(t){this.set(ot.WARNED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inWarned",{get:function(){return this.in(ot.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onWarned",{get:function(){return this.on(ot.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underWarned",{get:function(){return this.on(ot.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.is(ot.CHANGED)},set:function(t){this.set(ot.CHANGED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inChanged",{get:function(){return this.in(ot.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onChanged",{get:function(){return this.on(ot.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underChanged",{get:function(){return this.on(ot.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlternated",{get:function(){return this.is(ot.ALTERNATED)},set:function(t){this.set(ot.ALTERNATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inAlternated",{get:function(){return this.in(ot.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAlternated",{get:function(){return this.on(ot.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underAlternated",{get:function(){return this.on(ot.ALTERNATED)},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){var t=[];return this.J.forEach((function(n){t.push(n)})),{local:t}},t.prototype.toString=function(){return JSON.stringify(this.toObject())},t}(),lt=function(t){function n(n){var i=t.call(this)||this;return i.Z=n,i.q=0,i.$=!1,i.tt=!0,i}return _(n,t),n.prototype.lock=function(t){return this.q+=1,!1===t&&(this.tt=!1),this},n.prototype.unlock=function(){return this.q-=1,this.end()},Object.defineProperty(n.prototype,"saved",{get:function(){var t=this.nt;return null==t&&(t=new ft,this.nt=t),t},enumerable:!1,configurable:!0}),n.prototype.begin=function(){return this.tt&&!this.$&&(this.$=!0,this.saved.copy(this)),this},n.prototype.end=function(){return this.q<=0&&(this.tt=!0,this.$&&(this.$=!1,this.onChange(this,this.saved))),this},n.prototype.onChange=function(t,n){this.Z(t,n)},n}(ft),vt={CLICKED:"CLICKED",DBL_CLICKED:"DBL_CLICKED",DOWN:"DOWN",UP:"UP",UP_OUTSIDE:"UP_OUTSIDE",RIGHT_CLICKED:"RIGHT_CLICKED",RIGHT_DOWN:"RIGHT_DOWN",RIGHT_UP:"RIGHT_UP",RIGHT_UP_OUTSIDE:"RIGHT_UP_OUTSIDE",RIGHT_PRESSED:"RIGHT_PRESSED",ACTIVATED:"ACTIVATED",DEACTIVATED:"DEACTIVATED"},bt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onChange=function(n,i){n.isActive?i.isActive||this.J.add(vt.ACTIVATED).delete(vt.DEACTIVATED):i.isActive&&this.J.add(vt.DEACTIVATED).delete(vt.ACTIVATED),t.prototype.onChange.call(this,n,i)},Object.defineProperty(n.prototype,"isClicked",{get:function(){return this.is(vt.CLICKED)},set:function(t){this.set(vt.CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inClicked",{get:function(){return this.in(vt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onClicked",{get:function(){return this.on(vt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underClicked",{get:function(){return this.under(vt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDblClicked",{get:function(){return this.is(vt.DBL_CLICKED)},set:function(t){this.set(vt.DBL_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDblClicked",{get:function(){return this.in(vt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDblClicked",{get:function(){return this.on(vt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDblClicked",{get:function(){return this.under(vt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDown",{get:function(){return this.is(vt.DOWN)},set:function(t){this.set(vt.DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDown",{get:function(){return this.in(vt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDown",{get:function(){return this.on(vt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDown",{get:function(){return this.under(vt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUp",{get:function(){return this.is(vt.UP)},set:function(t){this.set(vt.UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUp",{get:function(){return this.in(vt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUp",{get:function(){return this.on(vt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUp",{get:function(){return this.under(vt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUpOutside",{get:function(){return this.is(vt.UP_OUTSIDE)},set:function(t){this.set(vt.UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUpOutside",{get:function(){return this.in(vt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUpOutside",{get:function(){return this.on(vt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUpOutside",{get:function(){return this.under(vt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightClicked",{get:function(){return this.is(vt.RIGHT_CLICKED)},set:function(t){this.set(vt.RIGHT_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightClicked",{get:function(){return this.in(vt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightClicked",{get:function(){return this.on(vt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightClicked",{get:function(){return this.under(vt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightDown",{get:function(){return this.is(vt.RIGHT_DOWN)},set:function(t){this.set(vt.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightDown",{get:function(){return this.in(vt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightDown",{get:function(){return this.on(vt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightDown",{get:function(){return this.under(vt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUp",{get:function(){return this.is(vt.RIGHT_UP)},set:function(t){this.set(vt.RIGHT_UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUp",{get:function(){return this.in(vt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUp",{get:function(){return this.on(vt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUp",{get:function(){return this.under(vt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUpOutside",{get:function(){return this.is(vt.RIGHT_UP_OUTSIDE)},set:function(t){this.set(vt.RIGHT_UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUpOutside",{get:function(){return this.in(vt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUpOutside",{get:function(){return this.on(vt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUpOutside",{get:function(){return this.under(vt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightPressed",{get:function(){return this.is(vt.RIGHT_PRESSED)},set:function(t){this.set(vt.RIGHT_PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightPressed",{get:function(){return this.in(vt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightPressed",{get:function(){return this.on(vt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightPressed",{get:function(){return this.under(vt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isActivated",{get:function(){return this.is(vt.ACTIVATED)},set:function(t){this.set(vt.ACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inActivated",{get:function(){return this.in(vt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onActivated",{get:function(){return this.on(vt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underActivated",{get:function(){return this.under(vt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDeactivated",{get:function(){return this.is(vt.DEACTIVATED)},set:function(t){this.set(vt.DEACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDeactivated",{get:function(){return this.in(vt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDeactivated",{get:function(){return this.on(vt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDeactivated",{get:function(){return this.under(vt.DEACTIVATED)},enumerable:!1,configurable:!0}),n}(lt),dt=function(n){function i(i){var r=n.call(this)||this;return r.internalTransform=new t.Matrix,r.p=i,r}return _(i,n),i.prototype.onChange=function(){n.prototype.onChange.call(this),this.p.onTransformChange()},i.prototype.updateSkew=function(){n.prototype.updateSkew.call(this),this.p.onTransformChange()},i.prototype.getLocalIdCurrent=function(){return this._currentLocalID},i.prototype.getLocalId=function(){return this._localID},i.prototype.getParentId=function(){return this._parentID},i.prototype.getWorldId=function(){return this._worldID},i.prototype.updateTransform=function(t){var r=this._currentLocalID,e=this._worldID;n.prototype.updateTransform.call(this,t);var u=this._currentLocalID,s=this._worldID;if(r!==u){var h=this.localTransform,o=this.internalTransform;h.copyTo(o),t instanceof i&&o.prepend(t.internalTransform)}else e!==s&&(h=this.localTransform,o=this.internalTransform,t instanceof i&&(h.copyTo(o).prepend(t.internalTransform),this._currentLocalID+=1,this._localID=this._currentLocalID))},i}(t.Transform),gt=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0,this.strokeWidth=0,this.strokeScale=1,this.strokeAlign=0}return t.prototype.set=function(t,n,i,r,e,u,s){return this.x=t,this.y=n,this.width=i,this.height=r,this.strokeWidth=e,this.strokeScale=u,this.strokeAlign=s,this},t}(),mt=function(t,n,i,r){return-i<=t&&t<=+i&&-r<=n&&n<=+r},wt=function(t){for(var n=t.points,i="[".concat(t.direction),r=0,e=n.length,u=1;r<e;r+=1,u+=3){var s=n[r];i+=",".concat(s.color,",").concat(s.alpha,",").concat(s.position)}return i+"]"},pt={NONE:0,ID:1,POSITION:2,WIDTH:4,HEIGHT:8,ROTATION:16,SKEW:32,ALIGN:0,REPLACING:64,GROUPING:128,UNGROUPING:256,FILL:512,STROKE:1024,STROKE_SIDE:2048,BORDER_RADIUS:4096,TEXT:8192,TEXTURE:16384,TAG:32768,DATA:32768,DATA_MAPPING:1048576,ACTION:65536,CURSOR:131072,ORDER_IN_LAYER:262144,CHILDREN:524288,COORDINATE:62,SHAPE:1728,LAYER:262144,PRIMITIVE:1042175,GROUP:1042431,EMBEDDED:1417471,CONNECTOR:1041985,ALL:2097151},Ot=function(){function t(){this.added=pt.NONE,this.removed=pt.NONE,this.locked=pt.NONE}return t.prototype.add=function(t){return this.removed&=~t,this.added|=t,this},t.prototype.remove=function(t){return this.added&=~t,this.removed|=t,this},t.prototype.lock=function(t){return this.locked|=t,this},t.prototype.unlock=function(t){return this.locked&=~t,this},t.prototype.clear=function(){return this.added=pt.NONE,this.removed=pt.NONE,this.locked=pt.NONE,this},t.prototype.set=function(t,n,i){return null!=t&&(this.added=t),null!=n&&(this.removed=n),null!=i&&(this.locked=i),this},t.prototype.copy=function(t){return this.added=t.added,this.removed=t.removed,this.locked=t.locked,this},t}(),Dt=function(n){function i(t){var i=n.call(this)||this;return i.id="",i.uuid=0,i.type=t,i.transform=i.newTransform(),i.it=0,i.rt=!1,i.action=new ut,i.et=!0,i.ut=0,i.st=!1,i.ht=!1,i.ot=NaN,i.ct=NaN,i.ft=NaN,i.interactive=!1,i.parent=null,i.children=[],i.selected=!1,i.index=0,i.reference=0,i}return _(i,n),i.prototype.newTransform=function(){return new dt(this)},i.prototype.onSizeChange=function(){this.ot=NaN,this.ct=NaN,this.ft=NaN,this.lt(),this.updateUploaded();var t=this.vt;null!=t&&t.fit(!0);var n=this.runtime;null!=n&&n.onResize(this)},i.prototype.onTransformChange=function(){this.lt(),this.onParentTransformChange()},i.prototype.onParentTransformChange=function(){this.updateUploaded();var t=this.vt;null!=t&&t.fit(!0);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onParentTransformChange()},i.prototype.lt=function(){if(0===this.it){var t=this.parent;null!=t&&t.onChildTransformChange()}else this.rt=!0},i.prototype.disallowOnTransformChange=function(){this.it+=1,1===this.it&&(this.rt=!1)},i.prototype.allowOnTransformChange=function(t){this.it-=1,0===this.it&&this.rt&&(this.rt=!1,t&&this.onTransformChange())},i.prototype.onChildTransformChange=function(){},i.prototype.disallowUploadedUpdate=function(){this.ut+=1,1===this.ut&&(this.st=!1,this.ht=!1)},i.prototype.allowUploadedUpdate=function(){this.ut-=1,0===this.ut&&(this.ht?(this.ht=!1,this.st=!1,this.updateUploadedRecursively()):this.st&&(this.st=!1,this.updateUploaded()))},i.prototype.updateUploadedRecursively=function(){if(0===this.ut){this.updateUploaded();for(var t=this.children,n=0,i=t.length;n<i;++n)t[n].updateUploadedRecursively()}else this.ht=!0},i.prototype.updateUploaded=function(){if(0===this.ut){var t=this.uploaded;null!=t&&t.update(this)}else this.st=!0},Object.defineProperty(i.prototype,"image",{get:function(){return this.bt},set:function(t){this.bt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){for(var t=this;t.parent instanceof i;)t=t.parent;return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"connector",{get:function(){var t=this.vt;return null==t&&(t=new st(this),this.vt=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){if(this.et){var t=this.parent;return!(t instanceof i)||t.visible}return!1},set:function(t){this.et!==t&&(this.et=t,this.updateUploadedRecursively())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"worldVisible",{get:function(){if(this.et){var t=this.parent;return!t||t.worldVisible}return!1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){var t=this.parent;null!=t&&t.toDirty()},i.prototype.attach=function(t,n){this.detach(),this.parent=t;var i=t.children;return null!=n&&0<=n&&n<i.length?i.splice(n,0,this):i.push(this),t.onChildTransformChange(),t.toDirty(),this.onAttach(),this},i.prototype.onAttach=function(){this.uploaded=void 0;var t=this.vt;t&&(t.attach(),t.fit(!0));for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onAttach()},i.prototype.detach=function(){var t=this.parent;if(t){this.parent=null;var n=t.children,i=n.indexOf(this);0<=i&&(n.splice(i,1),t.onChildTransformChange(),t.toDirty(),this.onDetach())}return this},i.prototype.onDetach=function(){this.uploaded=void 0;var t=this.vt;t&&t.detach();for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onDetach()},i.prototype.updateTransform=function(){var n=this.parent;n?(n.parent&&n.updateTransform(),this.transform.updateTransform(n.transform)):this.transform.updateTransform(t.Transform.IDENTITY)},i.prototype.serializeChildren=function(t){for(var n=this.children,i=[],r=0,e=n.length;r<e;++r){var u=n[r];i.push(u.serialize(t))}return i},i.prototype.serializeImage=function(t){var n=this.bt;return null!=n?t.addResource(n.src):-1},i.prototype.serializeGradient=function(t){var n=this.gradient;return null!=n?(null==n.serialized&&(n.serialized=wt(n)),t.addResource(n.serialized)):-1},i.prototype.serializeState=function(t){var n=this.state;return(this.interactive?1:0)|(n.isFocusable?0:2)|(n.isActive?4:0)},i.prototype.serialize=function(t){var n=this.transform,i=n.position,r=n.pivot,e=this.size,u=this.shortcut,s=null!=u?t.addResource(u):-1,h=this.cursor,o=null!=h?t.addResource(h):-1,a=this.title,c=null!=a?t.addResource(a):-1,f=pt.NONE,l=pt.NONE,v=pt.NONE,b=this.wt;return null!=b&&(f=b.added,l=b.removed,v=b.locked),[this.type,t.addResource(this.id),i.x,i.y,e.x,e.y,n.rotation,n.skew.x,this.fill.serialize(t),this.stroke.serialize(t),o,this.text.serialize(t),this.data.serialize(t),this.radius,this.corner,-1,-1,this.action.serialize(t),this.serializeImage(t),this.serializeGradient(t),this.serializeChildren(t),r.x,r.y,this.serializeState(t),s,c,this.uuid,f,l,v]},i.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},i.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},i.prototype.getShapeScale=function(){var t=this.root.parent;return null!=t&&null!=t.getShapeScale?t.getShapeScale():1},i.prototype.getStrokeWidthScale=function(t){return t&s.NON_EXPANDING_WIDTH?t&s.NON_SHRINKING_WIDTH?this.getShapeScale():Math.min(1,this.getShapeScale()):t&s.NON_SHRINKING_WIDTH?Math.max(1,this.getShapeScale()):1},i.prototype.getHitTestSize=function(t){var n=this.size;return t.width=.5*n.x,t.height=.5*n.y,t},i.prototype.toHitTestData=function(t,n){var r,e=this.getHitTestSize(null!==(r=i.WORK_HIT_TEST_DATA)&&void 0!==r?r:i.WORK_HIT_TEST_DATA=new gt),u=e.width,s=e.height,h=this.transform.pivot,o=t-h.x,a=n-h.y,c=this.stroke,f=c.enable?c.width:0,l=this.getStrokeWidthScale(c.style),v=c.align,b=f*l*v;return e.set(0<=u?+o:-o,0<=s?+a:-a,Math.abs(u)+b,Math.abs(s)+b,f,l,v)},i.prototype.contains=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbs(i.x,i.y,i.width,i.height,i.strokeWidth,i.strokeScale,i.strokeAlign)?this:this.containsText(t,n)||this.containsChildren(t,n)},i.prototype.containsText=function(t,n){var i=this.text;if(null!=i.atlas){var r=i.world;if(null!=r){var e=this.transform.internalTransform,u=e.a*t+e.c*n+e.tx-r[0],s=e.b*t+e.d*n+e.ty-r[1],h=r[2]*u+r[3]*s,o=r[4]*u+r[5]*s,a=r[6],c=r[7];if(0<=h&&h<=a&&0<=o&&o<=c)return this}}return null},i.prototype.containsChildren=function(t,n){for(var i=this.children,r=i.length-1;0<=r;--r){var e=i[r];e.updateTransform();var u=e.transform.localTransform,s=u.a,h=u.b,o=u.c,a=u.d,c=u.tx,f=u.ty,l=1/(s*a-o*h),v=(a*t-o*n+f*o-c*a)*l,b=(s*n-h*t-f*s+c*h)*l,d=e.contains(v,b);if(null!=d)return d}return null},i.prototype.containsBBox=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbsBBox(i.x,i.y,i.width,i.height)},i.prototype.containsAbs=function(t,n,i,r,e,u,s){return this.containsAbsBBox(t,n,i,r)},i.prototype.containsAbsBBox=function(t,n,i,r){return mt(t,n,i,r)},i.prototype.select=function(t){return!1},i.prototype.toGlobal=function(t,n,i){return!0!==i&&this.updateTransform(),n.copyFrom(t),this.transform.worldTransform.apply(n,n),n},i.prototype.toLocal=function(n,i,r,e){return!0!==e&&this.updateTransform(),void 0===r&&(r=new t.Point),r.copyFrom(n),this.transform.worldTransform.applyInverse(r,r),r},i.prototype.getBounds=function(n,i){!0!==n&&this.updateTransform();var r=this._bounds||new t.Rectangle;this._bounds=r;var e=this.transform.getWorldId();return e!==this.ot&&(this.ot=e,this.Ot(this.transform.worldTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsInternal=function(n,i){!0!==n&&this.updateTransform();var r=this.Dt||new t.Rectangle;this.Dt=r;var e=this.transform.getLocalIdCurrent();return e!==this.ct&&(this.ct=e,this.Ot(this.transform.internalTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsLocal=function(n,i){!0!==n&&this.updateTransform();var r=this.Et||new t.Rectangle;this.Et=r;var e=this.transform.getLocalIdCurrent();return e!==this.ft&&(this.ft=e,this.Ot(this.transform.localTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsSize=function(){return this.size},i.prototype.Ot=function(t,n){var i=this.transform.pivot,r=i.x,e=i.y,u=this.getBoundsSize(),s=.5*u.x,h=.5*u.y,o=t.a,a=t.b,c=t.c,f=t.d,l=-s+r,v=-h+e,b=o*l+c*v,d=a*l+f*v,g=o*(l=+s+r)+c*(v=-h+e),m=a*l+f*v,w=o*(l=-s+r)+c*(v=+h+e),p=a*l+f*v,O=o*(l=+s+r)+c*(v=+h+e),D=a*l+f*v,E=Math.min(b,g,w,O),M=Math.min(d,m,p,D),S=Math.max(b,g,w,O),T=Math.max(d,m,p,D);return n.x=E+t.tx,n.y=M+t.ty,n.width=S-E,n.height=T-M,n},i.prototype.destroy=function(){for(var t=this.children,n=t.length-1;0<=n;--n)t[n].destroy();t.length=0},i.prototype.onStateChange=function(t,n){var r=this.runtime;null!=r&&r.onStateChange(this,t,n);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}},Object.defineProperty(i.prototype,"state",{get:function(){var t=this,n=this.Mt;return null==n&&(n=new bt((function(n,i){t.onStateChange(n,i)})),this.Mt=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"capability",{get:function(){var t=this.wt;return null==t&&(t=new Ot,this.wt=t),t},enumerable:!1,configurable:!0}),i.prototype.getCapability=function(){return this.wt},i.prototype.focus=function(){return this.setFocused(!0),this},i.prototype.blur=function(){return this.setFocused(!1),this},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=et.getLayer(this);n&&n.getFocusController().set(this,t)}},i.prototype.onKeyDown=function(t){var n=this.runtime;return!!n&&n.onKeyDown(this,t)},i.prototype.onKeyUp=function(t){var n=this.runtime;return!!n&&n.onKeyUp(this,t)},i.prototype.update=function(t){var n=this.runtime;n&&n.update(this,t)},i.prototype.onRender=function(t,n){var i=this.runtime;i&&i.onRender(this,t,n)},i.prototype.updateRecursively=function(t){this.update(t);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].update(t)},i.prototype.copy=function(t,n){if(void 0===n&&(n=ht.ALL),this.id=t.id,this.uuid=t.uuid,n&ht.TRANSFORM){var r=this.transform,e=t.transform;r.position.copyFrom(e.position),r.rotation=e.rotation,r.skew.copyFrom(e.skew),r.pivot.copyFrom(e.pivot),r.scale.copyFrom(e.scale)}if(n&ht.SIZE&&this.size.copyFrom(t.size),n&ht.STYLE&&(this.fill.copy(t.fill),this.stroke.copy(t.stroke),this.text.copy(t.text),this.radius=t.radius,this.corner=t.corner),n&ht.DATA&&this.data.copy(t.data),n&ht.IMAGE&&(this.image=t.image),n&ht.ACTION&&(this.action.clearAndAddAll(t.action.values),this.interactive=t.interactive,this.cursor=t.cursor,this.shortcut=t.shortcut),n&ht.POINTS){var u=t.points;if(null!=u){var s=this.points;null!=s&&s.copy(u)}}if(n&ht.STATE&&this.state.lock(!1).copy(t.state).unlock(),n&ht.CONNECTOR)if(t instanceof i){var h=t.vt;h?this.connector.copy(h):(o=this.vt)&&o.clear()}else{var o;(o=this.vt)&&o.clear()}if(n&ht.CAPABILITY){var a=t.getCapability();if(null!=a)this.capability.copy(a);else{var c=this.wt;null!=c&&c.clear()}}return this},i}(t.utils.EventEmitter),Et=function(){function t(t,n,i,r,e,u,s,h){this.p=t,this.O=n,this.S=i,this.T=r,this.St=e,this.Tt=u,this.jt=s,this.B=h}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this.Tt},set:function(t){this.Tt!==t&&(this.Tt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return this.jt},set:function(t){this.jt!==t&&(this.jt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width,t.align,t.side,t.style)},t.prototype.set=function(t,n,i,r,e,u,s){var h=!1;void 0!==t&&this.O!==t&&(this.O=t,h=!0),void 0!==n&&this.S!==n&&(this.S=n,h=!0),void 0!==i&&this.T!==i&&(this.T=i,h=!0),void 0!==r&&this.St!==r&&(this.St=r,h=!0),void 0!==e&&this.Tt!==e&&(this.Tt=e,h=!0),void 0!==u&&this.jt!==u&&(this.jt=u,h=!0),void 0!==s&&this.B!==s&&(this.B=s,h=!0),h&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T,this.St,this.Tt,this.jt,this.B)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T,width:this.St,align:this.Tt,side:this.jt,style:this.B}},t.prototype.serialize=function(t){var n=this.O?1:0,i="[".concat(n,",").concat(this.S,",").concat(this.T,",").concat(this.St,",").concat(this.Tt,",").concat(this.jt,",").concat(this.B,"]");return t.addResource(i)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getStroke(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3],r[4],r[5],r[6]);else{var e=JSON.parse(i[t]);n.setStroke(t,e),this.set(!!e[0],e[1],e[2],e[3],e[4],e[5],e[6])}}},t}(),Mt={NONE:0,FROM:1,TO:2,FROM_TO:3},St=function(){function t(){this.Nt=Mt.NONE,this.It=0,this.Ct=1}return Object.defineProperty(t.prototype,"type",{get:function(){return this.Nt},set:function(t){if(this.Nt!==t){this.Nt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.It},set:function(t){if(this.It!==t){this.It=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},set:function(t){if(this.Ct!==t){this.Ct=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;if(void 0!==t&&void 0!==n)if(null!==t&&null!==n){var r=this.Nt|Mt.FROM|Mt.TO;this.Nt===r&&this.It===t&&this.Ct===n||(this.Nt=r,this.It=t,this.Ct=n,i=!0)}else null!==t?(r=(this.Nt|Mt.FROM)&~Mt.TO,this.Nt===r&&this.It===t||(this.Nt=r,this.It=t,i=!0)):null!==n?(r=(this.Nt|Mt.TO)&~Mt.FROM,this.Nt===r&&this.It===t||(this.Nt=r,this.Ct=n,i=!0)):(r=this.Nt&~(Mt.TO|Mt.FROM),this.Nt!==r&&(this.Nt=r,i=!0));else void 0!==t?null!==t?(r=this.Nt|Mt.FROM,this.Nt===r&&this.It===t||(this.Nt=r,this.It=t,i=!0)):(r=this.Nt&~Mt.FROM,this.Nt!==r&&(this.Nt=r,i=!0)):void 0!==n&&(null!==n?(r=this.Nt|Mt.TO,this.Nt===r&&this.Ct===n||(this.Nt=r,this.Ct=n,i=!0)):(r=this.Nt&~Mt.TO,this.Nt!==r&&(this.Nt=r,i=!0)));if(i){var e=this.parent;null!=e&&(e.isChanged=!0)}return i},t.prototype.normalize=function(t){var n=this.Nt,i=this.It,r=this.Ct;switch(n){case Mt.FROM_TO:return(t-i)/(r-i);case Mt.FROM:return t-i;case Mt.TO:return r-t;case Mt.NONE:default:return t}},t.prototype.isEquals=function(t){return this.Nt===t.type&&this.It===t.from&&this.Ct===t.to},t.prototype.copy=function(t){return this.At(t.type,t.from,t.to)},t.prototype.At=function(t,n,i){var r=!1;if(this.Nt!==t&&(this.Nt=t,r=!0),this.It!==n&&(this.It=n,r=!0),this.Ct!==i&&(this.Ct=i,r=!0),r){var e=this.parent;null!=e&&(e.isChanged=!0)}return this},t.prototype.toObject=function(){return{type:this.type,from:this.from,to:this.to}},t.prototype.serialize=function(t){var n="[".concat(this.Nt,",").concat(this.It,",").concat(this.Ct,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getRange(t);if(null!=r)this.At(r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setRange(t,e),this.At(e[0],e[1],e[2])}}},t}(),Tt={ASCENDING:0,DESCENDING:1},jt={BOOLEAN:7,BOOLEAN_ARRAY:8,NUMBER:0,NUMBER_ARRAY:1,STRING:2,STRING_ARRAY:3,OBJECT:4,OBJECT_ARRAY:5,TICKER:6,EXTENSION:1e3},Nt={PRIVATE:0,PUBLIC:1,PROTECTED:2},It={UNKNOWN:-1,FOUND:0,NOT_FOUND:1,BAD_REQUEST:2,SERVER_ERROR:3,SERVICE_UNAVAILABLE:4,FORBIDDEN:5,NOT_DEFINED:6},Ct=function(t,n){return t-n},At=function(){function t(){this.id="",this.as="",this.type=jt.NUMBER,this.scope=Nt.PUBLIC,this.initial="",this.format="",this.range=new St,this.Rt=0,this.Lt=0,this.Mt=It.UNKNOWN,this.yt=0,this.kt=Tt.ASCENDING}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},set:function(t){this.p!==t&&(this.p=t,this.range.parent=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Rt},set:function(t){var n=this.formatter;null!=n&&(t=n(t));var i=this.yt;if(i<=0){if(this.Rt!==t){this.Rt=t;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.L;null==e&&(e=[],this.L=e),this.Rt=t;var u=this.kt;u===Tt.ASCENDING?e.push(t):e.unshift(t);var s=e.length-i;if(0<s)if(u===Tt.ASCENDING)for(var h=0;h<s;++h)e.shift();else e.length=i;var o=this.parent;null!=o&&(o.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){return this.range.normalize(this.Rt)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.L;return null==t&&(t=[],this.L=t),t},set:function(t){var n=t.length;if(0<n){var i=this.yt;if(i<=0){var r=t[n-1];if(null!=(s=this.formatter)&&(r=s(r)),this.Rt!==r){this.Rt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.L;null==u&&(u=[],this.L=u);var s,h=this.kt;if(null!=(s=this.formatter))if(this.Rt=s(t[n-1]),h===Tt.ASCENDING)for(var o=0;o<n;++o)u.push(s(t[o]));else for(o=0;o<n;++o)u.unshift(s(t[o]));else if(this.Rt=t[n-1],h===Tt.ASCENDING)for(o=0;o<n;++o)u.push(t[o]);else for(o=0;o<n;++o)u.unshift(t[o]);var a=u.length-i;if(0<a)if(h===Tt.ASCENDING)for(o=0;o<a;++o)u.shift();else u.length=i;var c=this.parent;null!=c&&(c.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.Lt},set:function(t){var n=this.yt;if(n<=0){if(this.Lt!==t){this.Lt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.xt;null==r&&(r=[],this.xt=r),this.Lt=t;var e=this.kt;e===Tt.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===Tt.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"times",{get:function(){var t=this.xt;return null==t&&(t=[],this.xt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.yt;if(i<=0){var r=t[n-1];if(this.Lt!==r){this.Lt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.xt;null==u&&(u=[],this.xt=u),this.Lt=t[n-1];var s=this.kt;if(s===Tt.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===Tt.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.Mt},set:function(t){var n=this.yt;if(n<=0){if(this.Mt!==t){this.Mt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Bt;null==r&&(r=[],this.Bt=r),this.Mt=t;var e=this.kt;e===Tt.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===Tt.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"states",{get:function(){var t=this.Bt;return null==t&&(t=[],this.Bt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.yt;if(i<=0){var r=t[n-1];if(this.Mt!==r){this.Mt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.Bt;null==u&&(u=[],this.Bt=u),this.Mt=t[n-1];var s=this.kt;if(s===Tt.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===Tt.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){return this.yt},set:function(t){if(this.yt<t)this.yt=t;else if(t<this.yt){this.yt=t;var n=!1,i=this.kt,r=this.L;if(null!=r&&0<(s=r.length-t)){if(i===Tt.ASCENDING)for(var e=0;e<s;++e)r.shift();else r.length=t;n=!0}var u=this.xt;if(null!=u&&0<(s=u.length-t)){if(i===Tt.ASCENDING)for(e=0;e<s;++e)u.shift();else u.length=t;n=!0}var s,h=this.Bt;if(null!=h&&0<(s=h.length-t)){if(i===Tt.ASCENDING)for(e=0;e<s;++e)h.shift();else h.length=t;n=!0}if(n){var o=this.parent;null!=o&&(o.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.kt},set:function(t){this.kt=t},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){var n=!1,i=this.L;null!=i&&0<=t&&t<i.length&&(i.splice(t,1),n=!0);var r=this.xt;null!=r&&0<=t&&t<r.length&&(r.splice(t,1),n=!0);var e=this.Bt;if(null!=e&&0<=t&&t<e.length&&(e.splice(t,1),n=!0),n){var u=this.parent;null!=u&&(u.isChanged=!0)}},t.prototype.removeAll=function(t){var n=!1,i=t.slice(0).sort(Ct),r=i.length,e=this.L;if(null!=e)for(var u=r-1;0<=u;--u)0<=(o=i[u])&&o<e.length&&(e.splice(o,1),n=!0);var s=this.xt;if(null!=s)for(u=r-1;0<=u;--u)0<=(o=i[u])&&o<s.length&&(s.splice(o,1),n=!0);var h=this.Bt;if(null!=h)for(u=r-1;0<=u;--u){var o;0<=(o=i[u])&&o<h.length&&(h.splice(o,1),n=!0)}if(n){var a=this.parent;null!=a&&(a.isChanged=!0)}},t.prototype.clear=function(){var t=!1,n=this.L;null!=n&&(n.length=0,t=!0);var i=this.xt;null!=i&&(i.length=0,t=!0);var r=this.Bt;if(null!=r&&(r.length=0,t=!0),t){var e=this.parent;null!=e&&(e.isChanged=!0)}},t.prototype.toDirty=function(){var t=this.parent;null!=t&&(t.isChanged=!0)},t.prototype.copy=function(t){return this.id=t.id,this.as=t.as,this.type=t.type,this.scope=t.scope,this.initial=t.initial,this.format=t.format,this.formatter=t.formatter,this.range.copy(t.range),this.Rt=t.value,this.Lt=t.time,this.Mt=t.state,this.yt=t.capacity,this},t.prototype.isEquals=function(t){return this.id===t.id&&this.as===t.as&&this.type===t.type&&this.scope===t.scope&&this.initial===t.initial&&this.formatter===t.formatter&&this.range.isEquals(t.range)},t.prototype.serialize=function(t){var n=t.addData(this.id),i=t.addResource(this.as),r=t.addResource(this.initial),e=t.addResource(this.format.trim()),u=this.range.serialize(t);return t.addResource("[".concat(n,",").concat(r,",").concat(e,",").concat(u,",").concat(this.yt,",").concat(this.kt,",").concat(this.type,",").concat(this.scope,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i,r,e=n.resources;if(0<=t&&t<e.length){var u=n.getDataValue(t);null==u&&(u=JSON.parse(e[t]),n.setDataValue(t,u)),this.id=n.data[u[0]]||"";var s=u[8];this.as=null!=s&&e[s]||"",this.type=null!==(i=u[6])&&void 0!==i?i:jt.NUMBER,this.scope=null!==(r=u[7])&&void 0!==r?r:Nt.PUBLIC,this.initial=e[u[1]]||"",this.format=e[u[2]]||"",this.range.deserialize(u[3],n),this.yt=u[4],this.kt=u[5]}return this},t}(),Rt=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if((e=n[i])===t)return i;for(i=0,r=n.length;i<r;++i){var e;if((e=n[i])[0]===t[0]&&e[1]===t[1]&&e[2]===t[2])return i}return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.copy=function(t){this.clearAndAddAll(t.values)},t.prototype.serialize=function(t){var n=this.values;if(n.length<=0)return-1;for(var i="[",r="",e=0,u=n.length;e<u;++e){var s=n[e],h=t.addResource(s[0]),o=t.addResource(s[1]),a=t.addResource(s[2]);i+="".concat(r).concat(h,",").concat(o,",").concat(a),r=","}return i+="]",t.addResource(i)},t.prototype.deserialize=function(t,n){var i=this.values;i.length=0;var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataMapping(t);null==u&&(u=JSON.parse(r[t]),n.setDataMapping(t,u));for(var s=0,h=u.length;s<h;s+=3){var o=u[s],a=u[s+1],c=u[s+2];i.push([0<=o&&o<e?r[o]:"",0<=a&&a<e?r[a]:"",0<=c&&c<e?r[c]:""])}}},t}(),Lt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},yt=function(){function t(){}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Pt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i,r=null!==(i=this.Pt)&&void 0!==i?i:this.Pt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Pt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),c.value=n}return!0},t.prototype.toDirty=function(t){var n=this.Pt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.each=function(t){var n=this.Pt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t}(),kt=function(){function t(){this.Pt=new Map}return t.prototype.set=function(t,n){return this.Pt.set(t,n),this},t.prototype.get=function(t){var n;return null!==(n=this.Pt.get(t))&&void 0!==n?n:null},t.prototype.contains=function(t){return this.Pt.has(t)},t.prototype.remove=function(t){var n=this.Pt,i=n.get(t);return n.delete(t),null!=i?i:null},t.prototype.clear=function(){return this.Pt.clear(),this},t.prototype.size=function(){return this.Pt.size},t.prototype.each=function(t){var n=!1;return this.Pt.forEach((function(i,r){n||!1===t(i,r)&&(n=!0)})),this},t.prototype.copy=function(t){var n=this.Pt;return n.clear(),t.each((function(t,i){n.set(i,t)})),this},t.prototype.serialize=function(t){var n=this.Pt;if(n.size<=0)return-1;var i=[];return n.forEach((function(n,r){var e=t.addResource(n),u=t.addResource(r);i.push(u,e)})),t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=this.Pt;i.clear();var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataSystem(t);null==u&&(u=JSON.parse(r[t]),n.setDataSystem(t,u));for(var s=0,h=u.length;s<h;s+=2){var o=u[s];if(0<=o&&o<e){var a=r[o],c=u[s+1];0<=c&&c<e&&i.set(a,r[c])}}}},t}(),xt=function(){function t(){this.L=[],this.Ut=!0}return Object.defineProperty(t.prototype,"values",{get:function(){return this.L},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.L;return 0<t.length?t[0].id:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"as",{get:function(){var t=this.L;return 0<t.length?t[0].as:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var t=this.L;return 0<t.length?t[0].type:jt.NUMBER},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scope",{get:function(){var t=this.L;return 0<t.length?t[0].scope:Nt.PRIVATE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initial",{get:function(){var t=this.L;return 0<t.length?t[0].initial:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){var t=this.L;return 0<t.length?t[0].format:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.L;return 0<t.length?t[0].range:null!=P?P:P=new St},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this.L;return 0<t.length?t[0].value:0},set:function(t){var n=this.L;0<n.length&&(n[0].value=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){var t=this.L;return 0<t.length?t[0].nvalue:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){var t=this.L;return 0<t.length?t[0].time:0},set:function(t){var n=this.L;0<n.length&&(n[0].time=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){var t=this.L;return 0<t.length?t[0].state:It.UNKNOWN},set:function(t){var n=this.L;0<n.length&&(n[0].state=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){var t=this.L;return 0<t.length?t[0].capacity:0},set:function(t){var n=this.L;0<n.length&&(n[0].capacity=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alias",{get:function(){var t=this.Ft;return null==t&&(t=this.newAlias(),this.Ft=t),t},enumerable:!1,configurable:!0}),t.prototype.newAlias=function(){var t=this.L,n=t.length;if(0<n){for(var i={},r=0;r<n;++r){var e=t[r];i[e.as||e.id]=e}return i}return null!=U?U:U={}},Object.defineProperty(t.prototype,"mapping",{get:function(){var t=this.Gt;return null==t&&(t=this.newMapping(),this.Gt=t),t},enumerable:!1,configurable:!0}),t.prototype.newMapping=function(){return new Rt},t.prototype.getMapping=function(){return this.Gt},Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Ht;return null==t&&(t=this.newPrivate(),this.Ht=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new yt},t.prototype.getPrivate=function(){return this.Ht},Object.defineProperty(t.prototype,"system",{get:function(){var t=this.zt;return null==t&&(t=this.newSystem(),this.zt=t),t},enumerable:!1,configurable:!0}),t.prototype.newSystem=function(){return new kt},t.prototype.getSystem=function(){return this.zt},t.prototype.add=function(t,n){var i=this.L;t.parent=this,void 0===n?i.push(t):i.splice(n,0,t)},t.prototype.set=function(t,n){var i=this.L;if(0<=t&&t<i.length){var r=i[t];return n.parent=this,i[t]=n,r.parent=void 0,r}return null},t.prototype.remove=function(t){var n=this.L;0<=t&&t<n.length&&(n.splice(t,1)[0].parent=void 0)},t.prototype.indexOf=function(t){for(var n=this.L,i=n.length,r=0;r<i;++r)if(n[r]===t)return r;for(r=0;r<i;++r)if(n[r].isEquals(t))return r;for(r=0;r<i;++r)if(n[r].id===t.id)return r;return-1},t.prototype.get=function(t){var n=this.L;return 0<=t&&t<n.length?n[t]:null},t.prototype.size=function(){return this.L.length},t.prototype.swap=function(t,n){var i=this.L,r=i[n];i[n]=i[t],i[t]=r},t.prototype.copy=function(t){var n=this.L;n.length=0;for(var i=0,r=t.size();i<r;++i){var e=t.get(i);if(null!=e){var u=(new At).copy(e);u.parent=this,n.push(u)}}var s=t.getMapping();s&&this.mapping.copy(s);var h=t.getSystem();return h&&this.system.copy(h),this},t.prototype.serialize=function(t){for(var n=this.L,i=[],r=0,e=n.length;r<e;++r)i.push(n[r].serialize(t));var u,s=this.Gt;return null!=s?(i.push(s.serialize(t)),null!=(u=this.zt)?t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]")):t.addResource("[".concat(JSON.stringify(i),"]"))):null!=(u=this.zt)?(i.push(-1),t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]"))):t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getData(t);null==r&&(r=JSON.parse(i[t]),n.setData(t,r));var e=this.L;if(e.length=0,this.isMapped(r)){for(var u=r[0],s=u.length,h=0,o=s-1;h<o;++h){var a=u[h];(l=new At).parent=this,l.deserialize(a,n),e.push(l)}var c=u[s-1];0<=c&&this.mapping.deserialize(c,n);var f=r[1];null!=f&&0<=f&&this.system.deserialize(f,n)}else for(h=0,o=r.length;h<o;++h){var l;a=r[h],(l=new At).parent=this,l.deserialize(a,n),e.push(l)}}},t.prototype.isMapped=function(t){return 0<t.length&&Lt(t[0])},t}(),Bt=function(){function t(t,n,i){this.p=t,this.Vt=n,this.Wt=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Vt},set:function(t){this.Vt!==t&&(this.Vt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.Wt},set:function(t){this.Wt!==t&&(this.Wt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Vt!==t&&(this.Vt=t,i=!0),null!=n&&this.Wt!==n&&(this.Wt=n,i=!0),i&&this.p.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Vt,vertical:this.Wt}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Vt,",").concat(this.Wt,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getAlign(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setAlign(t,e),this.set(e[0],e[1])}}},t}(),_t=function(){function t(t,n,i){this.p=t,this.Vt=n,this.Wt=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Vt},set:function(t){this.Vt!==t&&(this.Vt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.Wt},set:function(t){this.Wt!==t&&(this.Wt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Vt!==t&&(this.Vt=t,i=!0),null!=n&&this.Wt!==n&&(this.Wt=n,i=!0),i&&this.p.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Vt,vertical:this.Wt}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Vt,",").concat(this.Wt,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getMargin(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setMargin(t,e),this.set(e[0],e[1])}}},t}(),Pt=function(){function t(t,n,i,r,e){this.p=t,this.O=n,this.S=i,this.T=r,this.St=e}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width)},t.prototype.set=function(t,n,i,r){var e=!1;void 0!==t&&this.O!==t&&(this.O=t,e=!0),void 0!==n&&this.S!==n&&(this.S=n,e=!0),void 0!==i&&this.T!==i&&(this.T=i,e=!0),void 0!==r&&this.St!==r&&(this.St=r,e=!0),e&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T,this.St)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T,width:this.St}},t.prototype.serialize=function(t){var n="[".concat(this.O?1:0,",").concat(this.S,",").concat(this.T,",").concat(this.St,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getTextOutline(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3]);else{var e=JSON.parse(i[t]);n.setTextOutline(t,e),this.set(!!e[0],e[1],e[2],e[3])}}},t}(),Ut=function(){function t(t,n,i,r,e,u){this.p=t,this.O=!0,this.Rt=n,this.S=i,this.T=r,this.Xt=e,this.j=u,this.Kt=d.NORMAL,this.align=new Bt(t,m.CENTER,w.MIDDLE),this.offset=new _t(t,0,0),this.B=g.NORMAL,this.spacing=new _t(t,0,0),this.outline=new Pt(t,!1,16777215,1,.5),this.Yt=p.LEFT_TO_RIGHT,this.padding=new _t(t,10,10),this.Jt=!1,this.Zt=!1}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Rt},set:function(t){if(this.Rt!==t){this.Rt=t;var n=this.p,i=n.uploaded;if(null==i||!i.isCompatible(n))return this.atlas=void 0,void n.toDirty();var r=this.atlas,e=r&&r.characters;if(null==e)return this.atlas=void 0,void n.toDirty();for(var u=0,s=t.length;u<s;++u)if(!(t[u]in e))return this.atlas=void 0,void n.toDirty();n.updateUploaded()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){return this.Xt},set:function(t){this.Xt!==t&&(this.Xt=t,this.p.toDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this.Kt},set:function(t){this.Kt!==t&&(this.Kt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this.Yt},set:function(t){this.Yt!==t&&(this.Yt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){return this.Jt},set:function(t){this.Jt!==t&&(this.Jt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fitting",{get:function(){return this.Zt},set:function(t){this.Zt!==t&&(this.Zt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return t&&(this.set(t.value,t.color,t.alpha,t.family,t.size,t.weight,t.style,t.direction,t.clipping,t.fitting),this.align.copy(t.align),this.offset.copy(t.offset),this.outline.copy(t.outline),this.spacing.copy(t.spacing),this.padding.copy(t.padding)),this},t.prototype.set=function(t,n,i,r,e,u,s,h,o,a){var c=!1,f=!1;return null!=t&&this.Rt!==t&&(this.Rt=t,c=!0),null!=n&&this.S!==n&&(this.S=n,f=!0),null!=i&&this.T!==i&&(this.T=i,f=!0),null!=r&&this.Xt!==r&&(this.Xt=r,c=!0),null!=e&&this.j!==e&&(this.j=e,f=!0),null!=u&&this.Kt!==u&&(this.Kt=u,f=!0),null!=s&&this.B!==s&&(this.B=s,f=!0),null!=h&&this.Yt!==h&&(this.Yt=h,f=!0),null!=o&&this.Jt!==o&&(this.Jt=o,f=!0),null!=a&&this.Zt!==a&&(this.Zt=a,f=!0),c?this.p.toDirty():f&&this.p.updateUploaded(),this},t.prototype.toObject=function(){return{value:this.Rt,color:this.S,alpha:this.T,family:this.Xt,size:this.j,weight:this.Kt,align:this.align.toObject(),offset:this.offset.toObject(),style:this.B,outline:this.outline.toObject(),direction:this.Yt,spacing:this.spacing.toObject(),padding:this.padding.toObject(),clipping:this.Jt,fitting:this.Zt}},t.prototype.serialize=function(t){var n=t.addResource(this.Rt),i=t.addResource(this.Xt),r=this.align.serialize(t),e=this.offset.serialize(t),u=this.outline.serialize(t),s=this.spacing.serialize(t),h=this.padding.serialize(t),o=this.Jt?1:0,a=this.Zt?1:0,c="[".concat(n,",").concat(this.S,",").concat(this.T,",").concat(i,",").concat(this.j,",")+"".concat(this.Kt,",").concat(r,",").concat(e,",").concat(this.B,",").concat(u,",")+"".concat(s,",").concat(this.Yt,",").concat(h,",").concat(o,",").concat(a,"]");return t.addResource(c)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getText(t);null==r&&(r=JSON.parse(i[t]),n.setText(t,r)),this.set(i[r[0]]||"",r[1],r[2],i[r[3]]||"auto",r[4],r[5],r[8],r[11],!!r[13],!!r[14]),this.align.deserialize(r[6],n),this.offset.deserialize(r[7],n),this.outline.deserialize(r[9],n),this.spacing.deserialize(r[10],n),this.padding.deserialize(r[12],n)}},t}(),Ft=function(n){function i(t){var i=n.call(this,t)||this;i.size=i.newSize(),i.fill=i.newFill(),i.stroke=i.newStroke(),i.qt=J.RADIUS,i.Qt=rt.ALL;var r=new xt;return i.data=r,i.tag=r,i.text=i.newText(),i}return _(i,n),i.prototype.newSize=function(){var n=this;return new t.ObservablePoint((function(){n.onSizeChange()}),void 0,J.SIZE_X,J.SIZE_Y)},i.prototype.newFill=function(){return new q(this,!0,J.FILL_COLOR,J.FILL_ALPHA)},i.prototype.newStroke=function(){return new Et(this,!0,J.STROKE_COLOR,J.STROKE_ALPHA,J.STROKE_WIDTH,J.STROKE_ALIGN,J.STROKE_SIDE,J.STROKE_STYLE)},i.prototype.newText=function(){return new Ut(this,J.TEXT_VALUE,J.TEXT_COLOR,J.TEXT_ALPHA,J.TEXT_FAMILY,J.TEXT_SIZE)},Object.defineProperty(i.prototype,"corner",{get:function(){return this.Qt},set:function(t){this.Qt!==t&&(this.Qt=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"radius",{get:function(){return this.qt},set:function(t){this.qt!==t&&(this.qt=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"image",{get:function(){return this.bt},set:function(t){if(this.bt!==t){null!=t?(this.bt=t,this.imageSrc=t.src):(this.bt=void 0,this.imageSrc=void 0);var n=this.parent;null!=n&&n.toDirty()}},enumerable:!1,configurable:!0}),i}(Dt),Gt=function(t,n,i,r,e,u,s){if(t.fill.enable){if((c=n*n)*(o=e*e)+(f=i*i)*(h=r*r)<=h*o)return!0}else if(0<u){var h,o,a=u*s,c=n*n,f=i*i,l=Math.max(0,r-a),v=Math.max(0,e-a),b=l*l,d=v*v;if(b*d<=c*d+f*b&&c*(o=e*e)+f*(h=r*r)<=h*o)return!0}return!1},Ht={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_OR_LEFT:9,TOP_OR_RIGHT:3,BOTTOM_OR_LEFT:12,BOTTOM_OR_RIGHT:6,ALL:15},zt=function(t,n,i,r,e,u,s){if(mt(n,i,r,e)){if(t.fill.enable)return!0;var h=t.stroke.side;if(0<u&&h!==Ht.NONE){var o=u*s,a=Math.max(0,r-o),c=Math.max(0,e-o);if(!mt(n,i,a,c))return!(h!==Ht.ALL&&!(n<=-a?i<=-c?h&Ht.TOP_OR_LEFT:+c<=i?h&Ht.BOTTOM_OR_LEFT:h&Ht.LEFT:+a<=n?i<=-c?h&Ht.TOP_OR_RIGHT:+c<=i?h&Ht.BOTTOM_OR_RIGHT:h&Ht.RIGHT:i<=-c?h&Ht.TOP:+c<=i&&h&Ht.BOTTOM))}}return!1},Vt=function(t,n,i,r,e){return+i*t+r-n<=0&&-i*t+r-n<=0&&n<=e},Wt=function(t,n,i,r,e,u,s){var h=2*e/r;if(t.fill.enable){if(Vt(n,i,h,-e,+e))return!0}else if(0<u){var o=u*s;if(Vt(n,i,h,-e,+e)){var a=2*r*e/(r+Math.sqrt(r*r+4*e*e)),c=e-a,f=c+(-e-c)*Math.max(0,a-o)/a;if(!Vt(n,i,h,f,e-o))return!0}}return!1},Xt=function(t,n,i){return.5*(i+t*n)},Kt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getHitTestSize=function(n){var i=this.gt.formatted;if("boundary"in i){var r=i.boundary;n.width=Math.max(Math.abs(r[0]),Math.abs(r[2])),n.height=Math.max(Math.abs(r[1]),Math.abs(r[3]))}else t.prototype.getHitTestSize.call(this,n);return n},n.prototype.toMarkerSize=function(t){var n=0,i=t.getMarker();if(i){var r=i.head;if(r.type!==Z.NONE){var e=r.size;n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y)))}var u=i.tail;u.type!==Z.NONE&&(e=u.size,n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y))))}return n},n.prototype.containsAbsMarker=function(t,n,i,r,e,u){var s=t.type;if(s!==Z.NONE){var h=t.transform,o=h.a,a=h.b,c=h.c,f=h.d,l=h.tx,v=h.ty,b=1/(o*f-c*a),d=(f*n-c*i+v*c-l*f)*b,g=(o*i-a*n-v*o+l*a)*b,m=t.size,w=.5*m.x,p=.5*m.y;w<0&&(w=-w,n=-n),p<0&&(p=-p,i=-i);var O=r*e*u;switch(w+=O,p+=O,s){case Z.CIRCLE:return Gt(this,d,g,w,p,r,e);case Z.TRIANGLE:return Wt(this,d,g,w,p,r,e);case Z.RECTANGLE:return zt(this,d,g,w,p,r,e)}}return!1},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=this.gt,o=Xt(e,u,0),a=o+this.toMarkerSize(h);if(this.containsAbsBBox(t,n,i+a,r+a)){var c=h.getMarker();if(c){if(this.containsAbsMarker(c.head,t,n,e,u,s))return!0;if(this.containsAbsMarker(c.tail,t,n,e,u,s))return!0}var f=this.calcHitPointAbsHitTester;return h.calcHitPointAbs(t,n,i,r,o,null,f,null)}return!1},n.prototype.calcHitPart=function(t,n){var i=this.toHitTestData(t,n),r=i.strokeWidth,e=i.strokeScale,u=Xt(r,e,0),s=this.gt,h=u+this.toMarkerSize(s),o=i.x,a=i.y,c=i.width,f=i.height;if(this.containsAbsBBox(o,a,c+h,f+h)){var l=s.getMarker();if(l){var v=i.strokeAlign;if(this.containsAbsMarker(l.head,o,a,r,e,v))return it.MARKER_HEAD;if(this.containsAbsMarker(l.tail,o,a,r,e,v))return it.MARKER_TAIL}var b=this.calcHitPointAbsHitTester;if(s.calcHitPointAbs(o,a,c,f,u,null,b,null))return it.LINE}return this.containsText(t,n)?it.TEXT:this.containsChildren(t,n)?it.CHILDREN:it.NONE},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.gt,h=this.toHitTestData(t,n),o=(i||Xt)(h.strokeWidth,h.strokeScale,0);return!!this.containsAbsBBox(h.x,h.y,h.width+o,h.height+o)&&s.calcHitPointAbs(h.x,h.y,h.width,h.height,o,r,e,u)},n.prototype.calcHitPointAbsHitTester=function(t,n,i,r,e,u,s,h,o){var a=e-i,c=u-r,f=t-i,l=n-r,v=a*a+c*c,b=a*f+c*l,d=f*f+l*l;if(1e-4<v){var g=Math.max(0,Math.min(1,b/v));if(v*g*g-2*b*g+d<h*h)return!0}return!1},n}(Ft),Yt=function(t){function n(n){void 0===n&&(n=r.BAR);var i=t.call(this,n)||this;return i.gt=new nt(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbsBBox=function(n,i,r,e){var u=Math.max(0,this.gt.size);return t.prototype.containsAbsBBox.call(this,n,i,r+u,e+u)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.gt.serialize(n),i},n}(Kt),Jt=function(t){function n(n,i){var r=t.call(this,n,i,4,2)||this;return r.pointsId=NaN,r.pointsStyle=G.NONE,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset,i=this.indexOffset;t.updateClippings(),t.updateIndices(),c(t.clippings,n),f(t.indices,n,i)},n.prototype.update=function(t,n){this.updateVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexStepAndColorFill=function(t,n){if(n instanceof Yt){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.stroke,h=s.enable?s.width:0,o=s.style,a=h!==this.strokeWidth||o!==this.strokeStyle,c=V(n),f=this.transformLocalId!==c,v=n.points,b=v.id,d=b!==this.pointsId,g=v.style,m=g!==this.pointsStyle;(u||f||a||d||m)&&(this.sizeX=r,this.sizeY=e,this.strokeWidth=h,this.strokeStyle=o,this.transformLocalId=c,this.pointsId=b,this.pointsStyle=g,d&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),l(t.vertices,t.steps,t.colorFills,this.vertexOffset,v.values,v.size,h,o,n.transform.internalTransform))}},n.prototype.updateUv=function(t,n){var i=W(n),r=X(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),v(t.uvs,this.vertexOffset,K(i)))},n}(z),Zt=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=NaN,this.scaleX=1,this.scaleY=1,this.size=NaN,this.family="auto",this.value="",this.texture=null,this.textureTransformId=NaN,this.color=NaN,this.alpha=NaN,this.weight=NaN,this.style=NaN,this.alignHorizontal=NaN,this.alignVertical=NaN,this.offsetHorizontal=NaN,this.offsetVertical=NaN,this.outlineWidth=NaN,this.outlineColor=NaN,this.outlineAlpha=NaN,this.spacingHorizontal=NaN,this.spacingVertical=NaN,this.direction=NaN,this.paddingHorizontal=NaN,this.paddingVertical=NaN,this.clipping=!1,this.fitting=!1}return n.prototype.init=function(t){var n=this.vertexCount;if(0<n){var i=this.vertexOffset;t.updateClippings(),S(t.clippings,i,n),t.updateIndices(),T(t.indices,i,this.indexOffset,this.indexCount)}},n.prototype.isCompatible=function(t){return 4*M(t)===this.vertexCount},n.prototype.update=function(t,n){if(0<this.vertexCount){var i=n.text.atlas;null!=i&&(this.updateVertex(t,n,i),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateStep(t,n))}},n.prototype.updateVertex=function(n,i,r){var e=i.size,u=e.x,s=e.y,h=u!==this.sizeX||s!==this.sizeY,o=V(i),a=this.transformLocalId!==o,c=i.text,f=c.size,l=c.family,v=c.value,b=c.style,d=c.align.horizontal,g=c.align.vertical,m=c.offset.horizontal,w=c.offset.vertical,p=c.spacing.horizontal,O=c.spacing.vertical,D=c.direction,E=c.padding.horizontal,M=c.padding.vertical,S=c.clipping,T=c.fitting,j=c.texture||t.Texture.WHITE,N=X(j),C=v!==this.value||l!==this.family,A=f!==this.size,R=b!==this.style,L=d!==this.alignHorizontal||g!==this.alignVertical,y=m!==this.offsetHorizontal||w!==this.offsetVertical,k=p!==this.spacingHorizontal||O!==this.spacingVertical||E!==this.paddingHorizontal||M!==this.paddingVertical,x=D!==this.direction,B=this.clipping!==S,_=this.fitting!==T,P=j!==this.texture||N!==this.textureTransformId;if(h||a||C||A||R||L||y||k||x||B||_||P){this.size=f,this.family=l,this.value=v,this.style=b,this.alignHorizontal=d,this.alignVertical=g,this.offsetHorizontal=m,this.offsetVertical=w,this.spacingHorizontal=p,this.spacingVertical=O,this.direction=D,this.paddingHorizontal=E,this.paddingVertical=M,this.clipping=S,this.fitting=T,this.texture=j,this.textureTransformId=N,(A||_||T&&h)&&(this.weight=NaN),n.updateVertices(),n.updateUvs();var U=i.size,F=c.world;null==F&&(F=[0,0,0,0,0,0,0,0],c.world=F),I(n.vertices,n.uvs,this.vertexOffset,this.vertexCount,0,0,U.x,U.y,r,f,v,b,d,g,m,w,p,O,D,E,M,S,T,F,K(j),i.transform.internalTransform)}},n.prototype.updateColorFill=function(t,n){var i=n.text,r=i.color,e=n.visible&&i.enable?i.alpha:0;r===this.color&&e===this.alpha||(this.color=r,this.alpha=e,t.updateColorFills(),H(r,e,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.text,r=i.outline,e=r.color,u=n.visible&&i.enable?r.alpha:0;e===this.outlineColor&&u===this.outlineAlpha||(this.outlineColor=e,this.outlineAlpha=u,t.updateColorStrokes(),H(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.updateStep=function(t,n){var i=n.text,r=i.outline,e=r.enable?r.width:0,u=e!==this.outlineWidth,s=i.weight,h=s!==this.weight,o=1,a=1,c=i.world;null!=c&&(o=c[8],a=c[9]);var f=D<Math.abs(this.scaleX-o)||D<Math.abs(this.scaleY-a);(h||u||f)&&(this.weight=s,this.outlineWidth=e,this.scaleX=o,this.scaleY=a,t.updateSteps(),j(t.steps,this.vertexOffset,this.vertexCount,i.atlas,i.size,e,s,this.scaleX,this.scaleY))},n.prototype.buildUnit=function(n){if(0<this.vertexCount){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;r!==n.baseTexture&&(n.baseTexture=r,n.push(i,this.indexOffset))}},n}(),qt=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=4+h,c=2+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Jt(i,r),new Zt(i+4,r+2,h,o)]).init(n):null},Qt=function(t,n,i){var r=t.length;if(n<r)return t;for(var e="",u=0,s=n-r;u<s;++u)e+=i;return e+t},$t=function(){function t(){}return t.toCode=function(t){return Qt(t.toString(16).toUpperCase(),6,"0")},t.fromCode=function(t){var n=t.trim().toLowerCase();if(6===n.length){var i=Number("0x".concat(n));if(i==i)return i}return null},t.fromRgb=function(t,n,i){return 255*t<<16|255*n<<8|255*i|0},t.blend=function(t,n,i){var r=t>>16&255,e=t>>8&255,u=255&(0|t),s=n>>16&255,h=n>>8&255,o=255&(0|n),a=Math.max(0,Math.min(1,i)),c=1-a;return Math.max(0,Math.min(255,r*c+s*a))<<16|Math.max(0,Math.min(255,e*c+h*a))<<8|0|Math.max(0,Math.min(255,u*c+o*a))},t.brighten=function(t,n){return 0<=n?this.blend(t,16777215,n):this.blend(t,0,-n)},t.darken=function(t,n){return 0<=n?this.blend(t,0,n):this.blend(t,16777215,-n)},t.toGrayscale=function(t){var n=this.toLuma(t);return n<<16|n<<8|n},t.toLuma=function(t){return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(255&(0|t))&255},t}(),tn={NONE:0,POSITION_X:1,POSITION_Y:2,POSITION:3,ROTATION:4,COLOR_FILL:8,COLOR_STROKE:16,COLOR_FILL_AND_STROKE:24,COLOR_TEXT:32,COLOR_TEXT_OUTLINE:64,COLOR:120,VISIBILITY:128,HEIGHT:256,WIDTH:512,SIZE:768,TEXT:1024,CURSOR:2048},nn=function(){function t(){}return t.toBaseFill=function(t,n){return(n.written&tn.COLOR_FILL?t:n).fill},t.toBaseStroke=function(t,n){return(n.written&tn.COLOR_STROKE?t:n).stroke},t.toBaseText=function(t,n){return(n.written&tn.COLOR_TEXT?t:n).text},t.toBaseTextOutline=function(t,n){return(n.written&tn.COLOR_TEXT_OUTLINE?t:n).text.outline},t}(),rn={isInitializing:!1},en=function(){function t(){}return t.from=function(t,n,i,r,e,u){if(t.trim().length<=0)return i;try{var s="try {with (shape) {with (state) {with (data.alias) {with (environment) {"+(e?"var result = (".concat(t,");")+"return (result != null ? ".concat(n,"(result) : null);"):"return ".concat(n,"(").concat(t,");"))+"}}}}} catch (e) {"+"return ".concat(r,";")+"}";return null==u?Function("shape","time","environment",s):Function("shape","time","environment",u,s)}catch(t){return i}},t.ofNumberOrNull=function(t){return this.from(t,"Number",this.NULL,"null",!0)},t.ofStringOrNull=function(t){return this.from(t,"String",this.NULL,"null",!0)},t.ofUnknown=function(t){return this.from(t,"",this.NULL,"null",!1)},t.ofNumber=function(t){return this.from(t,"Number",this.ZERO,"0",!1)},t.ofNumberOrOne=function(t){return this.from(t,"Number",this.ONE,"1",!1)},t.ofNumberOrOneHundred=function(t){return this.from(t,"Number",this.ONE_HUNDRED,"100",!1)},t.ofString=function(t){return this.from(t,"String",this.EMPTY,'""',!1)},t.ofBoolean=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrTrue=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrFalse=function(t){return this.from(t,"Boolean",this.FALSE,"false",!1)},t.ofElementOrNull=function(t){return this.from(t,"",void 0,"null",!1,"container")},t.NULL=function(){return null},t.ZERO=function(){return 0},t.ONE=function(){return 1},t.ONE_HUNDRED=function(){return 100},t.EMPTY=function(){return""},t.TRUE=function(){return!0},t.FALSE=function(){return!1},t}(),un=function(){function t(t){this.reset=t||tn.NONE}return t.prototype.initialize=function(t,n){},t.prototype.execute=function(t,n,i){},t.prototype.onResize=function(t,n){},t.prototype.onFocus=function(t,n){},t.prototype.onBlur=function(t,n){},t.prototype.onClick=function(t,n,i){},t.prototype.onDblClick=function(t,n,i,r){},t.prototype.onDowning=function(t,n,i){},t.prototype.onDown=function(t,n,i){},t.prototype.onMove=function(t,n,i){},t.prototype.onOver=function(t,n,i){},t.prototype.onOut=function(t,n,i){},t.prototype.onUp=function(t,n,i){},t.prototype.onUpOutside=function(t,n,i){},t.prototype.onPressed=function(t,n,i){},t.prototype.onUnpressed=function(t,n,i){},t.prototype.onKeyDown=function(t,n,i){},t.prototype.onKeyUp=function(t,n,i){},t.prototype.onRightClick=function(t,n,i){},t.prototype.onRightDowning=function(t,n,i){},t.prototype.onRightDown=function(t,n,i){},t.prototype.onRightUp=function(t,n,i){},t.prototype.onRightUpOutside=function(t,n,i){},t.prototype.onRightPressed=function(t,n,i){},t.prototype.onRightUnpressed=function(t,n,i){},t.prototype.onRender=function(t,n,i,r){},t}(),sn=function(t){function n(n,i){var r=t.call(this,i)||this;return r.condition=en.ofBoolean(n.condition),r}return _(n,t),n}(un),hn=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.interval=n.interval,r}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.interval,e=r<<1,u=i%e;u<r?(this.toOff(t,n),n.effect=i+(r-u)):(this.toOn(t,n),n.effect=i+(e-u))}},n.prototype.toOn=function(t,n){},n.prototype.toOff=function(t,n){},n}(sn),on=function(t){function n(n){return t.call(this,n,tn.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=nn.toBaseFill(t,n);t.fill.set(void 0,$t.brighten(i.color,.5),i.alpha);var r=nn.toBaseStroke(t,n);t.stroke.set(void 0,$t.brighten(r.color,.5),r.alpha);var e=nn.toBaseText(t,n);t.text.set(void 0,$t.brighten(e.color,.5),e.alpha);var u=nn.toBaseTextOutline(t,n);t.text.outline.set(void 0,$t.brighten(u.color,.5),u.alpha),n.written|=this.reset},n}(hn),an=function(t){function n(n){var i=t.call(this,n,tn.COLOR_FILL)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.fill.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(hn),cn=function(t){function n(n){var i=t.call(this,n,tn.COLOR_STROKE)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.stroke.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(hn),fn=function(t){function n(n){return t.call(this,n,tn.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=nn.toBaseFill(t,n);t.fill.set(void 0,$t.darken(i.color,.5),i.alpha);var r=nn.toBaseStroke(t,n);t.stroke.set(void 0,$t.darken(r.color,.5),r.alpha);var e=nn.toBaseText(t,n);t.text.set(void 0,$t.darken(e.color,.5),e.alpha);var u=nn.toBaseTextOutline(t,n);t.text.outline.set(void 0,$t.darken(u.color,.5),u.alpha),n.written|=this.reset},n}(hn),ln=function(t){function n(n){return t.call(this,n,tn.COLOR_FILL_AND_STROKE)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=nn.toBaseFill(t,n);t.fill.set(void 0,i.color,.5*i.alpha);var r=nn.toBaseStroke(t,n);t.stroke.set(void 0,r.color,.5*r.alpha),n.written|=this.reset},n}(hn),vn=function(t){function n(n){return t.call(this,n,tn.VISIBILITY)||this}return _(n,t),n.prototype.toOn=function(t,n){t.visible=!0,n.written|=this.reset},n.prototype.toOff=function(t,n){t.visible=!1,n.written|=this.reset},n}(hn),bn={VISIBILITY:0,BRIGHTEN:1,DARKEN:2,OPACITY:3,COLOR_FILL:4,COLOR_STROKE:5},dn=function(){function t(t,n){this.type=t,this.condition=n}return t.prototype.isEquals=function(t){return this.type===t.type&&this.condition===t.condition},t.prototype.toLabel=function(){return this.getTheme().toLabel(this)},t.prototype.getTheme=function(){var n;return null!==(n=t.THEME)&&void 0!==n?n:t.THEME=Y.getInstance().get("EShapeActionValue")},t}(),gn=function(t){function n(n,i,r){var e=t.call(this,n,i)||this;return e.subtype=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.subtype===i.subtype},n}(dn),mn={SHOW_HIDE:0,BLINK:1,TRANSFORM:2,OPEN:3,EMIT_EVENT:4,CHANGE_COLOR_LEGACY:5,CHANGE_TEXT:6,CHANGE_CURSOR:7,MISC:8,CHANGE_COLOR:9,GESTURE:10,EXTENSION:1e3},wn=function(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)},pn=function(){function t(){}return t.toResource=function(t,n,i){if(0<=t&&t<n.length){var r=n[t];if(wn(r)&&0<=r&&r<i.length)return i[r]}return""},t}(),On=function(t){function n(n,i,r,e,u){var s=t.call(this,mn.BLINK,i,n)||this;return s.interval=r,s.color=e,s.alpha=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.interval===i.interval&&this.color===i.color&&this.alpha===i.alpha},n.prototype.toRuntime=function(){switch(this.subtype){case bn.BRIGHTEN:return new on(this);case bn.COLOR_FILL:return new an(this);case bn.COLOR_STROKE:return new cn(this);case bn.DARKEN:return new fn(this);case bn.OPACITY:return new ln(this);case bn.VISIBILITY:return new vn(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.interval,",").concat(this.color,",").concat(this.alpha,"]"))},n.deserialize=function(t,i){var r=pn.toResource(1,t,i.resources);return new n(t[2],r,t[3],t[4],t[5])},n}(gn),Dn=function(){function t(){}return t.blend=function(t,n,i){var r=Math.max(0,Math.min(1,i));return Math.max(0,Math.min(1,t*(1-r)+n*r))},t}(),En=function(t){function n(n){return t.call(this,n,n.subtype<<3)||this}return _(n,t),n.prototype.set=function(t,n,i,r,e,u){var s=this.reset;if(null!=r){if(null!=e)if(null!=u){if(s&tn.COLOR_FILL){var h=nn.toBaseFill(t,n);t.fill.set(void 0,$t.blend(h.color,r,u),Dn.blend(h.alpha,e,u))}s&tn.COLOR_STROKE&&(h=nn.toBaseStroke(t,n),t.stroke.set(void 0,$t.blend(h.color,r,u),Dn.blend(h.alpha,e,u))),s&tn.COLOR_TEXT&&(h=nn.toBaseText(t,n),t.text.set(void 0,$t.blend(h.color,r,u),Dn.blend(h.alpha,e,u))),s&tn.COLOR_TEXT_OUTLINE&&(h=nn.toBaseTextOutline(t,n),t.text.outline.set(void 0,$t.blend(h.color,r,u),Dn.blend(h.alpha,e,u)))}else s&tn.COLOR_FILL&&t.fill.set(void 0,r,e),s&tn.COLOR_STROKE&&t.stroke.set(void 0,r,e),s&tn.COLOR_TEXT&&t.text.set(void 0,r,e),s&tn.COLOR_TEXT_OUTLINE&&t.text.outline.set(void 0,r,e);else null!=u?(s&tn.COLOR_FILL&&(h=nn.toBaseFill(t,n),t.fill.set(void 0,$t.blend(h.color,r,u),h.alpha)),s&tn.COLOR_STROKE&&(h=nn.toBaseStroke(t,n),t.stroke.set(void 0,$t.blend(h.color,r,u),h.alpha)),s&tn.COLOR_TEXT&&(h=nn.toBaseText(t,n),t.text.set(void 0,$t.blend(h.color,r,u),h.alpha)),s&tn.COLOR_TEXT_OUTLINE&&(h=nn.toBaseTextOutline(t,n),t.text.outline.set(void 0,$t.blend(h.color,r,u),h.alpha))):(s&tn.COLOR_FILL&&(h=nn.toBaseFill(t,n),t.fill.set(void 0,r,h.alpha)),s&tn.COLOR_STROKE&&(h=nn.toBaseStroke(t,n),t.stroke.set(void 0,r,h.alpha)),s&tn.COLOR_TEXT&&(h=nn.toBaseText(t,n),t.text.set(void 0,r,h.alpha)),s&tn.COLOR_TEXT_OUTLINE&&(h=nn.toBaseTextOutline(t,n),t.text.outline.set(void 0,r,h.alpha)));n.written|=s}else null!=e&&(null!=u?(s&tn.COLOR_FILL&&(h=nn.toBaseFill(t,n),t.fill.set(void 0,h.color,Dn.blend(h.alpha,e,u))),s&tn.COLOR_STROKE&&(h=nn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,Dn.blend(h.alpha,e,u))),s&tn.COLOR_TEXT&&(h=nn.toBaseText(t,n),t.text.set(void 0,h.color,Dn.blend(h.alpha,e,u))),s&tn.COLOR_TEXT_OUTLINE&&(h=nn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,Dn.blend(h.alpha,e,u)))):(s&tn.COLOR_FILL&&(h=nn.toBaseFill(t,n),t.fill.set(void 0,h.color,e)),s&tn.COLOR_STROKE&&(h=nn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,e)),s&tn.COLOR_TEXT&&(h=nn.toBaseText(t,n),t.text.set(void 0,h.color,e)),s&tn.COLOR_TEXT_OUTLINE&&(h=nn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,e))),n.written|=s)},n}(sn),Mn={COLOR_AND_ALPHA:0,COLOR:1,ALPHA:2,CODE:3,BRIGHTNESS:4},Sn=function(t){function n(n){var i=t.call(this,n)||this;switch(n.target){case Mn.COLOR:i.color=n.color,i.alpha=null;break;case Mn.ALPHA:i.color=null,i.alpha=n.alpha;break;default:i.color=n.color,i.alpha=n.alpha}return i.blend=en.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.color,e=this.alpha,u=this.blend(t,i,rn);this.set(t,n,i,r,e,u)}},n}(En),Tn={NONE:0,FILL:1,STROKE:2,TEXT:4,TEXT_OUTLINE:8,FILL_AND_STROKE:3,ALL:15},jn={FILL:0,STROKE:1,FILL_AND_STROKE:2,TEXT:3,TEXT_OUTLINE:4,ALL:5},Nn=function(){function t(){}return t.from=function(t){if(t[0]===mn.CHANGE_COLOR)return t[2];switch(t[2]){case jn.FILL:return Tn.FILL;case jn.STROKE:return Tn.STROKE;case jn.FILL_AND_STROKE:return Tn.FILL_AND_STROKE;case jn.TEXT:return Tn.TEXT;case jn.TEXT_OUTLINE:return Tn.TEXT_OUTLINE;case jn.ALL:return Tn.ALL}},t.unpack=function(t){var n=[];return t&Tn.FILL&&n.push(Tn.FILL),t&Tn.STROKE&&n.push(Tn.STROKE),t&Tn.TEXT&&n.push(Tn.TEXT),t&Tn.TEXT_OUTLINE&&n.push(Tn.TEXT_OUTLINE),n},t.pack=function(t){for(var n=Tn.NONE,i=0,r=t.length;i<r;++i)n|=t[i];return n},t}(),In=function(t){function n(n,i,r,e,u,s){var h=t.call(this,mn.CHANGE_COLOR,i,n)||this;return h.target=r,h.color=e,h.alpha=u,h.blend=s,h}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new Sn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.target,",").concat(this.color,",").concat(this.alpha,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.from(t),e=pn.toResource(1,t,i.resources),u=pn.toResource(6,t,i.resources);return new n(r,e,t[3],t[4],t[5],u)},n}(gn),Cn=function(t){function n(n){var i=t.call(this,n)||this;return i.brightness=en.ofNumberOrNull(n.brightness),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.brightness(t,i,rn);this.set(t,n,i,r)}},n.prototype.set=function(t,n,i,r){var e=this.reset;if(null!=r){var u=this.toAdjusted;if(e&tn.COLOR_FILL){var s=nn.toBaseFill(t,n);t.fill.set(void 0,u(s.color,r),s.alpha)}e&tn.COLOR_STROKE&&(s=nn.toBaseStroke(t,n),t.stroke.set(void 0,u(s.color,r),s.alpha)),e&tn.COLOR_TEXT&&(s=nn.toBaseText(t,n),t.text.set(void 0,u(s.color,r),s.alpha)),e&tn.COLOR_TEXT_OUTLINE&&(s=nn.toBaseTextOutline(t,n),t.text.outline.set(void 0,u(s.color,r),s.alpha)),n.written|=e}},n.prototype.toAdjusted=function(t,n){return 0<=n?$t.brighten(t,+n):$t.darken(t,-n)},n}(En),An=function(t){function n(n,i,r){var e=t.call(this,mn.CHANGE_COLOR,i,n)||this;return e.brightness=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.brightness===i.brightness},n.prototype.toRuntime=function(){return new Cn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=Mn.BRIGHTNESS,r=t.addResource(this.brightness);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(Nn.from(t),pn.toResource(1,t,i.resources),pn.toResource(4,t,i.resources))},n}(gn),Rn=function(t){function n(n){var i=t.call(this,n)||this;return i.color=en.ofNumberOrNull(n.color),i.alpha=en.ofNumberOrNull(n.alpha),i.blend=en.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.color(t,i,rn),e=this.alpha(t,i,rn),u=this.blend(t,i,rn);this.set(t,n,i,r,e,u)}},n}(En),Ln=function(t){function n(n,i,r,e,u){var s=t.call(this,mn.CHANGE_COLOR,i,n)||this;return s.color=r,s.alpha=e,s.blend=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new Rn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=Mn.CODE,r=t.addResource(this.color),e=t.addResource(this.alpha),u=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,",").concat(e,",").concat(u,"]"))},n.deserialize=function(t,i){return new n(Nn.from(t),pn.toResource(1,t,i.resources),pn.toResource(4,t,i.resources),pn.toResource(5,t,i.resources),pn.toResource(6,t,i.resources))},n}(gn),yn=function(t){function n(n){var i=t.call(this,n,tn.CURSOR)||this;return i.name=en.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.name(t,i,rn);null!=r&&(t.cursor=r,n.written|=this.reset)}},n}(sn),kn=function(t){function n(n,i){var r=t.call(this,mn.CHANGE_CURSOR,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new yn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(pn.toResource(1,t,i.resources),pn.toResource(2,t,i.resources))},n}(dn),xn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"AM":"PM"},t}(),Bn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"am":"pm"},t}(),_n=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getDate())},t}(),Pn=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t)},t}(),Un=function(t){this.precision=null!=t?+t.substring(1,t.length):void 0},Fn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toExponential(this.precision)},n}(Un),Gn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toFixed(this.precision)},n}(Un),Hn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){var r=this.toAbs(t,n,i);return r<1e-24?this.$t(t,1,""):r<1e-21?this.$t(t,1e24,"y"):r<1e-18?this.$t(t,1e21,"z"):r<1e-15?this.$t(t,1e18,"a"):r<1e-12?this.$t(t,1e15,"f"):r<1e-9?this.$t(t,1e12,"p"):r<1e-6?this.$t(t,1e9,"n"):r<.001?this.$t(t,1e6,"μ"):r<1?this.$t(t,1e3,"m"):r<1e3?this.$t(t,1,""):r<1e6?this.$t(t,.001,"k"):r<1e9?this.$t(t,1e-6,"M"):r<1e12?this.$t(t,1e-9,"G"):r<1e15?this.$t(t,1e-12,"T"):r<1e18?this.$t(t,1e-15,"P"):r<1e21?this.$t(t,1e-18,"E"):r<1e24?this.$t(t,1e-21,"Z"):this.$t(t,1e-24,"Y")},n.prototype.toAbs=function(t,n,i){return Math.abs(t)},n.prototype.$t=function(t,n,i){return"".concat((t*n).toFixed(this.precision)).concat(i)},n}(Un),zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toPrecision(this.precision)},n}(Un),Vn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours())},t}(),Wn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours()%12)},t}(),Xn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMonth()+1)},t}(),Kn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMinutes())},t}(),Yn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMilliseconds())},t}(),Jn=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(100*t|0,"%")},t}(),Zn=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t,"%")},t}(),qn=function(){function t(t,n,i){this.length=t,this.character=n,this.node=i}return t.prototype.format=function(t,n,i){return Qt(this.node.format(t,n,i),this.length,this.character)},t}(),Qn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"===r[0]?"(".concat(r.substring(1,r.length),")"):r},t}(),$n=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?"+".concat(r):r},t}(),ti=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(100*t),"%")},t}(),ni=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t),"%")},t}(),ii=function(){function t(t,n,i,r,e,u,s){this.Y=t,this.M=n,this.D=i,this.H=r,this.m=e,this.s=u,this.mi=s}return t.prototype.format=function(t,n,i){if(n<1e3)return"".concat(this.s.format(t,n,i),".").concat(this.mi.format(t,n,i));if(n<6e4)return"".concat(this.m.format(t,n,i),":").concat(this.s.format(t,n,i));if(n<36e5)return"".concat(this.H.format(t,n,i),":").concat(this.m.format(t,n,i));if(n<864e5){var r=this.M.format(t,n,i),e=this.D.format(t,n,i);return"".concat(r,"/").concat(e," ").concat(this.H.format(t,n,i))}return n<2592e6?"".concat(this.M.format(t,n,i),"/").concat(this.D.format(t,n,i)):"".concat(this.Y.format(t,n,i),"/").concat(this.M.format(t,n,i))},t}(),ri=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?" ".concat(r):r},t}(),ei=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toAbs=function(t,n,i){return Math.abs(n)},n}(Hn),ui=function(){function t(t){this.str=t}return t.prototype.format=function(t,n,i){return this.str},t}(),si=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear())},t}(),hi=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear()%100)},t}(),oi=function(){function t(){}return t.prototype.format=function(t,n,i){var r=i.getTimezoneOffset(),e=r<=0?"+":"-",u=Qt(String(Math.floor(Math.abs(r)/60)),2,"0"),s=Qt(String(Math.floor(Math.abs(r)%60)),2,"0");return"".concat(e).concat(u,":").concat(s)},t}(),ai=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t))},t}(),ci=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getSeconds())},t}(),fi=void 0,li=function(t,n,i){switch(t){case"_":return new qn(n," ",i);case"-":return i;default:return new qn(n,"0",i)}},vi=function(t,n){switch(t){case"_":return new ri(n);case"+":return new $n(n);case"(":return new Qn(n);default:return n}},bi=function(){function t(t){var n=function(t){for(var n=0,i=!1,r=[],e=function(){var t=fi;return t?t.lastIndex=0:fi=t=/%(0|_|-|\+|\()?(\.\d+)?(Y(?:MD?)?|y(?:MD?)?|MD?|D|H(?:ms?)?|h(?:ms?)?|m(?:i|s)?|a|A|s(?:s?i|dt)?|z|%|f(?:si)?|e|g|d|r(?:d|p)|p|P|RP)/g,t}();;){var u=e.exec(t);if(null==u){n<t.length&&r.push(new ui(t.substring(n,t.length)));break}var s=u.index;n<s&&r.push(new ui(t.substring(n,s))),n=s+u[0].length;var h=u[0],o=u[1],a=u[2];switch(u[3]){case"Y":i=!0,r.push(new si);break;case"YM":i=!0,r.push(new si,new ui("/"),li(o,2,new Xn));break;case"YMD":i=!0,r.push(new si,new ui("/"),li(o,2,new Xn),new ui("/"),li(o,2,new _n));break;case"y":i=!0,r.push(li(o,2,new hi));break;case"yM":i=!0,r.push(li(o,2,new hi),new ui("/"),li(o,2,new Xn));break;case"yMD":r.push(li(o,2,new hi),new ui("/"),li(o,2,new Xn),new ui("/"),li(o,2,new _n));break;case"M":i=!0,r.push(li(o,2,new Xn));break;case"MD":i=!0,r.push(li(o,2,new Xn),new ui("/"),li(o,2,new _n));break;case"D":i=!0,r.push(li(o,2,new _n));break;case"H":i=!0,r.push(li(o,2,new Vn));break;case"Hm":i=!0,r.push(li(o,2,new Vn),new ui(":"),li(o,2,new Kn));break;case"Hms":i=!0,r.push(li(o,2,new Vn),new ui(":"),li(o,2,new Kn),new ui(":"),li(o,2,new ci));break;case"h":i=!0,r.push(li(o,2,new Wn));break;case"hm":i=!0,r.push(li(o,2,new Wn),new ui(":"),li(o,2,new Kn));break;case"hms":i=!0,r.push(li(o,2,new Wn),new ui(":"),li(o,2,new Kn),new ui(":"),li(o,2,new ci));break;case"m":i=!0,r.push(li(o,2,new Kn));break;case"ms":i=!0,r.push(li(o,2,new Kn),new ui(":"),li(o,2,new ci));break;case"mi":i=!0,r.push(li(o,3,new Yn));break;case"a":i=!0,r.push(new Bn);break;case"A":i=!0,r.push(new xn);break;case"s":i=!0,r.push(li(o,2,new ci));break;case"sdt":i=!0,r.push(new ii(new si,li(o,2,new Xn),li(o,2,new _n),li(o,2,new Vn),li(o,2,new Kn),li(o,2,new ci),li(o,3,new Yn)));break;case"z":i=!0,r.push(new oi);break;case"%":r.push(new ui("%"));break;case"f":r.push(vi(o,new Gn(a)));break;case"e":r.push(vi(o,new Fn(a)));break;case"g":r.push(vi(o,new zn(a)));break;case"rd":r.push(vi(o,new ai));break;case"d":r.push(vi(o,new Pn));break;case"P":r.push(vi(o,new Jn));break;case"p":r.push(vi(o,new Zn));break;case"RP":r.push(vi(o,new ti));break;case"rp":r.push(vi(o,new ni));break;case"fsi":r.push(vi(o,new Hn(a)));break;case"ssi":r.push(vi(o,new ei(a)));break;default:r.push(new ui(h))}}return{nodes:r,date:i}}(t);this.date=n.date,this.nodes=n.nodes}return t.prototype.format=function(n,i){var r=this.nodes,e=t.DATE;null==e&&(e=new Date,t.DATE=e),this.date&&e.setTime(n);for(var u="",s=0,h=r.length;s<h;++s)u+=r[s].format(n,i,e);return u},t}(),di=function(){function t(){}return t.create=function(t){return new bi(t)},t}(),gi=function(t){function n(n){var i=t.call(this,n,tn.TEXT)||this;return i.number=en.ofNumber(n.value),i.formatters=new Map,i}return _(n,t),n.prototype.getFormatter=function(t,n){var i=this.formatters,r=n.text.value,e=i.get(r);return void 0===e&&(e=this.newFormatter(r),i.set(r,e)),e},n.prototype.newFormatter=function(t){return 0<(t=t.trim()).length?di.create(t):null},n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.number(t,i,rn),e=this.getFormatter(t,n);t.text.value=null!=e?e.format(r,0):String(r),n.written|=this.reset}},n}(sn),mi=function(t){function n(n){var i=t.call(this,n,tn.TEXT)||this;return i.text=en.ofString(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,rn)&&(t.text.value=this.text(t,i,rn),n.written|=this.reset)},n}(sn),wi={TEXT:0,NUMBER:1},pi=function(t){function n(n,i,r){var e=t.call(this,mn.CHANGE_TEXT,i,n)||this;return e.value=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.value===i.value},n.prototype.toRuntime=function(){switch(this.subtype){case wi.TEXT:return new mi(this);case wi.NUMBER:return new gi(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=pn.toResource(1,t,i.resources),e=pn.toResource(3,t,i.resources);return new n(t[2],r,e)},n}(gn),Oi=function(){function t(t,n,i){this.tn=t,this.nn=i;var r=null==n?void 0:n.background;r&&(this.S=r.color,this.T=r.alpha)}return t.prototype.getTheme=function(){return this.tn},t.prototype.setTheme=function(t){this.tn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getBackgroundColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getBackgroundAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.nn;null!=t&&t()},t}(),Di={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_RIGHT:3,TOP_BOTTOM:5,TOP_LEFT:9,RIGHT_BOTTOM:6,RIGHT_LEFT:10,BOTTOM_LEFT:12,NOT_TOP:14,NOT_RIGHT:13,NOT_BOTTOM:11,NOT_LEFT:7,ALL:15},Ei=function(t,n){return ct(t)?n[t]:t},Mi=function(){function t(t,n,i){this.tn=t,this.nn=i;var r=null==n?void 0:n.border;r&&(this.S=r.color,this.T=r.alpha,this.St=r.width,this.Tt=r.align,this.rn=Ei(r.mask,Di))}return t.prototype.getTheme=function(){return this.tn},t.prototype.setTheme=function(t){this.tn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getBorderColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getBorderAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.St;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getBorderWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Tt;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getBorderAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Tt},set:function(t){this.Tt!==t&&(this.Tt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.rn;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getBorderMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.rn},set:function(t){this.rn!==t&&(this.rn=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.nn;null!=t&&t()},t}(),Si={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},Ti=function(){function t(t,n,i){this.tn=t,this.nn=i;var r=null==n?void 0:n.corner;r&&(wn(r)?(this.qt=r,this.rn=void 0):(this.qt=r.radius,this.rn=Ei(r.mask,Si)))}return t.prototype.getTheme=function(){return this.tn},t.prototype.setTheme=function(t){this.tn=t},t.prototype.getRadius=function(){var t;return null!==(t=this.qt)&&void 0!==t?t:this.tn.getCornerRadius()},Object.defineProperty(t.prototype,"radius",{get:function(){return this.qt},set:function(t){if(this.qt!==t){this.qt=t;var n=this.nn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(){var t;return null!==(t=this.rn)&&void 0!==t?t:this.tn.getCornerMask()},Object.defineProperty(t.prototype,"mask",{get:function(){return this.rn},set:function(t){if(this.rn!==t){this.rn=t;var n=this.nn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;this.qt!==t&&(this.qt=t,i=!0),this.rn!==n&&(this.rn=n,i=!0);var r=this.nn;i&&null!=r&&r()},t}(),ji={NONE:0,SELF:1,CHILDREN:2,BOTH:3},Ni=function(){function t(t,n,i){this.tn=t,this.nn=i;var r=null==n?void 0:n.outline;r&&(this.S=r.color,this.T=r.alpha,this.St=r.width,this.en=r.offset,this.Tt=r.align,this.rn=Ei(r.mask,Di))}return t.prototype.getTheme=function(){return this.tn},t.prototype.setTheme=function(t){this.tn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getOutlineColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){if(this.S!==t){this.S=t;var n=this.nn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getOutlineAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){if(this.T!==t){this.T=t;var n=this.nn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.St;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getOutlineWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){if(this.St!==t){this.St=t;var n=this.nn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getOffset=function(t){var n=this.en;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getOutlineOffset(t)},Object.defineProperty(t.prototype,"offset",{get:function(){return this.en},set:function(t){if(this.en!==t){this.en=t;var n=this.nn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Tt;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getOutlineAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Tt},set:function(t){if(this.Tt!==t){this.Tt=t;var n=this.nn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.rn;if(void 0!==n){if(!at(n))return n;var i=n(t);if(void 0!==i)return i}return this.tn.getOutlineMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.rn},set:function(t){if(this.rn!==t){this.rn=t;var n=this.nn;null!=n&&n()}},enumerable:!1,configurable:!0}),t}(),Ii=function(){function t(t,n,i){this.tn=t,this.nn=i;var r=null==n?void 0:n.padding;null!=r&&(wn(r)?(this.un=r,this.sn=r,this.hn=r,this.an=r):(this.un=r.left,this.sn=r.top,this.hn=r.right,this.an=r.bottom))}return t.prototype.getTheme=function(){return this.tn},t.prototype.setTheme=function(t){this.tn=t},t.prototype.getCallback=function(){return this.nn},t.prototype.getLeft=function(){var t;return null!==(t=this.un)&&void 0!==t?t:this.tn.getPaddingLeft()},Object.defineProperty(t.prototype,"left",{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t,null!=this.nn&&this.nn())},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){var t;return null!==(t=this.sn)&&void 0!==t?t:this.tn.getPaddingTop()},Object.defineProperty(t.prototype,"top",{get:function(){return this.sn},set:function(t){this.sn!==t&&(this.sn=t,null!=this.nn&&this.nn())},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){var t;return null!==(t=this.hn)&&void 0!==t?t:this.tn.getPaddingRight()},Object.defineProperty(t.prototype,"right",{get:function(){return this.hn},set:function(t){this.hn!==t&&(this.hn=t,null!=this.nn&&this.nn())},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){var t;return null!==(t=this.an)&&void 0!==t?t:this.tn.getPaddingBottom()},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.an},set:function(t){this.an!==t&&(this.an=t,null!=this.nn&&this.nn())},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r),null!=this.nn&&this.nn()},t}(),Ci=function(){function t(t,n){this.cn=t,this.Z=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this.cn.x},set:function(t){var n=this.cn,i=n.x;if(i!==t){n.x=t;var r=n.y;this.Z(t,r,i,r)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.cn.y},set:function(t){var n=this.cn,i=n.y;if(i!==t){n.y=t;var r=n.x;this.Z(r,t,r,i)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=this.cn,r=i.x,e=i.y;return r===t&&e===n||(i.set(t,n),this.Z(t,n,r,e)),this},t.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.cn,e=r.x,u=r.y;return e===n&&u===i||(r.copyFrom(t),this.Z(n,i,e,u)),this},t.prototype.copyTo=function(t){return t.copyFrom(this.cn)},t.prototype.copy=function(){return this.copyFrom(arguments[0])},t.prototype.clone=function(n){return new t(this.cn,n||this.Z)},t.prototype.equals=function(t){return this.cn.equals(t)},t}(),Ai=function(t){function n(n,i,r){var e=t.call(this,n,i,r)||this;return e.St=100,e.fn=100,e.ln=0,e.vn=Si.NONE,e.bn=!0,e.dn=1,e.gn=e.getBuffer("aVertexPosition"),e.mn=e.gn.data,e.wn=e.getBuffer("aTextureCoord"),e._uvs=e.wn.data,e.pn=e.getIndex(),e.On=e.pn.data,e}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.bn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.fn},set:function(t){this.fn!==t&&(this.fn=t,this.bn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerRadius",{get:function(){return this.ln},set:function(t){this.ln!==t&&(this.ln=t,this.bn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerMask",{get:function(){return this.vn},set:function(t){this.vn!==t&&(this.vn=t,this.bn=!0)},enumerable:!1,configurable:!0}),n.prototype.getTables=function(){var t=n.TABLES;return null==t&&(t=this.newTables(n.N),n.TABLES=t),t},n.prototype.newTables=function(t){var n=1/(t-1)*.5;return[this.newTable(t,1,n),this.newTable(t,.5,n),this.newTable(t,0,n),this.newTable(t,1.5,n)]},n.prototype.newTable=function(t,n,i){for(var r=[],e=[],u=Math.PI,s=0,h=n;s<t;s+=1,h-=i){var o=h*u,a=+Math.cos(o),c=-Math.sin(o);r.push(a),e.push(c)}return{cos:r,sin:e}},n.N=4,n}(t.MeshGeometry),Ri=function(t){function n(){return t.call(this,new Float32Array(16*Ai.N),new Float32Array(16*Ai.N),new Uint16Array(3*(12*Ai.N-2)))||this}return _(n,t),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a){for(var c=a.cos,f=a.sin,l=c[0],v=f[0],b=c[e-1],d=f[e-1],g=0;g<e;++g){var m=c[g],w=f[g],p=o,O=m*l+w*v;1e-4<O&&(p=Math.min(p,(1/O-1)*h));var D=m*b+w*d;1e-4<D&&(p=Math.min(p,(1/D-1)*h));var E=h+p;t[++i]=u+m*h,t[++i]=s+w*h,t[++i]=u+m*E,t[++i]=s+w*E,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+m),n[++r]=.5*(1+w)}},n.prototype.fillIndices=function(t,n,i,r){for(var e=0;e<r;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2},n.prototype.fillIndicesEnd=function(t,n,i,r){for(var e=0,u=r-1;e<u;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2;t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=2},n.prototype.update=function(t){var n=t.resolution;if(this.bn||this.dn!==n){this.bn=!1,this.dn=n;var i=this.mn,r=this._uvs,e=this.On,u=this.St,s=this.fn,h=Math.min(.5*u,.5*s,this.ln),o=1/n,a=h,c=u-h,f=u,l=h,v=s-h,b=s,d=this.vn,g=!(d&Si.TOP_LEFT),m=!(d&Si.TOP_RIGHT),w=!(d&Si.BOTTOM_LEFT),p=!(d&Si.BOTTOM_RIGHT),O=-1,D=-1,E=0,M=-1,S=Ai.N,T=S<<2,j=S<<1,N=6*S,I=this.getTables(),C=I[0],A=I[1],R=I[2],L=I[3];g?this.fillVertices(i,r,O,D,S,a,l,h,o,C):this.fillVertices(i,r,O,D,S,0,0,0,0,C),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,m?this.fillVertices(i,r,O,D,S,c,l,h,o,A):this.fillVertices(i,r,O,D,S,f,0,0,0,A),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,p?this.fillVertices(i,r,O,D,S,c,v,h,o,R):this.fillVertices(i,r,O,D,S,f,b,0,0,R),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,w?this.fillVertices(i,r,O,D,S,a,v,h,o,L):this.fillVertices(i,r,O,D,S,0,b,0,0,L),this.fillIndicesEnd(e,E,M,S),O+=T,D+=T,E+=j,M+=N,E=2;for(var y=1,k=4*S-1;y<k;y+=1,E+=2)e[++M]=0,e[++M]=E,e[++M]=E+2;this.gn.update(),this.wn.update(),this.pn.update()}},n}(Ai),Li=function(n){function i(i){var r=n.call(this,new Ri,new t.MeshMaterial(i))||this;return i.on("update",(function(){et.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),yi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Dn;return null==i&&((i=new Li(n.getBackgroundTexture())).parent=t,this.Dn=i),i},t.prototype.hide=function(){var t=this.Dn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.background,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=this.get(t,r);c.tint=o,c.alpha=a,c.width=n,c.height=i,c.cornerRadius=u,c.cornerMask=s,c.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Dn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Dn)||void 0===t||t.updateTransform()},t}(),ki=function(t){function n(){var n=t.call(this,new Float32Array(32*Ai.N),new Float32Array(32*Ai.N),new Uint16Array(72*Ai.N))||this;return n.En=0,n.Mn=Di.NONE,n}return _(n,t),Object.defineProperty(n.prototype,"borderWidth",{get:function(){return this.En},set:function(t){this.En!==t&&(this.En=t,this.bn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"borderMask",{get:function(){return this.Mn},set:function(t){this.Mn!==t&&(this.Mn=t,this.bn=!0)},enumerable:!1,configurable:!0}),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=.5*a,l=h-f,v=h+f,b=c.cos,d=c.sin,g=b[0],m=d[0],w=b[e-1],p=d[e-1],O=u+(g+w)*l,D=s+(m+p)*l,E=0;E<e;++E){var M=b[E],S=d[E],T=o,j=o,N=M*g+S*m;if(1e-4<N){var I=1/N-1;T=Math.min(T,I*l),j=Math.min(j,I*v)}var C=M*w+S*p;if(1e-4<C){var A=1/C-1;T=Math.min(T,A*l),j=Math.min(j,A*v)}var R=l+T,L=v+j;0<l?(t[++i]=u+M*l,t[++i]=s+S*l,t[++i]=u+M*R,t[++i]=s+S*R):(t[++i]=O,t[++i]=D,t[++i]=O,t[++i]=D),t[++i]=u+M*v,t[++i]=s+S*v,t[++i]=u+M*L,t[++i]=s+S*L,n[++r]=.5*(1+M),n[++r]=.5*(1+S),n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+M),n[++r]=.5*(1+S)}},n.prototype.fillIndices=function(t,n,i,r,e,u){for(var s=0,h=r-1;s<h;++s)t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2;e?u?(t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=1,t[++i]=1,t[++i]=n+1,t[++i]=2,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=2,t[++i]=2,t[++i]=n+1,t[++i]=3,n+=2):(t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2):(t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=2)},n.prototype.update=function(t){var n=t.resolution;if(this.bn||this.dn!==n){this.bn=!1,this.dn=n;var i=this.mn,r=this._uvs,e=this.On,u=this.St,s=this.fn,h=this.En,o=Math.min(.5*u,.5*s,this.ln),a=1/n,c=o,f=u-o,l=u,v=o,b=s-o,d=s,g=this.Mn,m=!(g&Di.TOP),w=!(g&Di.BOTTOM),p=!(g&Di.LEFT),O=!(g&Di.RIGHT),D=this.vn,E=!(D&Si.TOP_LEFT),M=!(D&Si.TOP_RIGHT),S=!(D&Si.BOTTOM_LEFT),T=!(D&Si.BOTTOM_RIGHT),j=-1,N=-1,I=0,C=-1,A=Ai.N,R=A<<2,L=A<<3,y=18*A,k=this.getTables(),x=k[0],B=k[1],_=k[2],P=k[3];E?p||m?this.fillVertices(i,r,j,N,A,c,v,o,a,h,x):this.fillVertices(i,r,j,N,A,c,v,o,0,0,x):p||m?this.fillVertices(i,r,j,N,A,0,0,0,0,h,x):this.fillVertices(i,r,j,N,A,0,0,0,0,0,x),this.fillIndices(e,I,C,A,m,!1),j+=L,N+=L,I+=R,C+=y,M?m||O?this.fillVertices(i,r,j,N,A,f,v,o,a,h,B):this.fillVertices(i,r,j,N,A,f,v,o,0,0,B):m||O?this.fillVertices(i,r,j,N,A,l,0,0,0,h,B):this.fillVertices(i,r,j,N,A,l,0,0,0,0,B),this.fillIndices(e,I,C,A,O,!1),j+=L,N+=L,I+=R,C+=y,T?O||w?this.fillVertices(i,r,j,N,A,f,b,o,a,h,_):this.fillVertices(i,r,j,N,A,f,b,o,0,0,_):O||w?this.fillVertices(i,r,j,N,A,l,d,0,0,h,_):this.fillVertices(i,r,j,N,A,l,d,0,0,0,_),this.fillIndices(e,I,C,A,w,!1),j+=L,N+=L,I+=R,C+=y,S?w||p?this.fillVertices(i,r,j,N,A,c,b,o,a,h,P):this.fillVertices(i,r,j,N,A,c,b,o,0,0,P):w||p?this.fillVertices(i,r,j,N,A,0,d,0,0,h,P):this.fillVertices(i,r,j,N,A,0,d,0,0,0,P),this.fillIndices(e,I,C,A,p,!0),j+=L,N+=L,I+=R,C+=y,this.gn.update(),this.wn.update(),this.pn.update()}},n}(Ai),xi=function(n){function i(i){var r=n.call(this,new ki,new t.MeshMaterial(i))||this;return i.on("update",(function(){et.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderWidth",{get:function(){return this.geometry.borderWidth},set:function(t){this.geometry.borderWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderMask",{get:function(){return this.geometry.borderMask},set:function(t){this.geometry.borderMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Bi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Dn;return null==i&&((i=new xi(n.getBorderTexture())).parent=t,this.Dn=i),i},t.prototype.hide=function(){var t=this.Dn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.border,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Dn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Dn)||void 0===t||t.updateTransform()},t}(),_i=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Dn;return null==i&&((i=new xi(n.getBorderTexture())).parent=t,this.Dn=i),i},t.prototype.hide=function(){var t=this.Dn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.outline,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=h.getOffset(e)+(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Dn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Dn)||void 0===t||t.updateTransform()},t}(),Pi=function(){function t(t){var n=new yi;this.Sn=n,t.snippet.add(n,!0);var i=new Bi;this.Tn=i,t.snippet.add(i,!0);var r=new _i;this.jn=r,t.snippet.add(r,!1),t.reflowable.add(this)}return t.prototype.onReflow=function(t,n,i){var r=t.theme,e=t.state,u=t.corner,s=u.getRadius(),h=u.getMask();this.Sn.onReflow(t,n,i,r,e,s,h),this.Tn.onReflow(t,n,i,r,e,s,h),this.jn.onReflow(t,n,i,r,e,s,h)},t}(),Ui={NONE:0,BEFORE:1,AFTER:2,BOTH:3},Fi={OPEN:0,CLOSE:1,PARENSESIS:2,ADD_OR_PLUS:3,SUB_OR_MINUS:4,PLUS:5,MINUS:6,ADD:7,SUB:8,MUL:9,DIV:10,MIN:11,MAX:12,COMMA:13,PARENT:14,SELF:15,PADDING:16,CURRENT:17,NUMBER:18},Gi=function(){function t(t){var n=this.toToken(t),i=0;do{i=this.toParensesis(n,i)}while(i<n.length);if(this.toUnary(n),this.toArithmetic(n,Fi.MUL,Fi.DIV),this.toArithmetic(n,Fi.ADD,Fi.SUB),1===n.length){var r=n[0];if(!wn(r))return void(this.Nn=r)}throw new Error("Failed to parse '".concat(t,"'"))}return t.prototype.toParensesis=function(t,n){for(var i=t.length,r=n;r<i;++r)if(t[r]===Fi.OPEN){var e=r,u=Fi.PARENSESIS;if(0<r){var s=t[r-1];s!==Fi.MIN&&s!==Fi.MAX||(e-=1,u=s)}for(var h=r+1;h<i;++h){var o=t[h];if(o===Fi.CLOSE)return t[e]=[u,this.toComma(t,r+1,h)],t.splice(e+1,h-e),e+1;o===Fi.OPEN&&(h=this.toParensesis(t,h)-1,i=t.length)}throw new Error("Malformed parensesis")}return i},t.prototype.toCommaOf=function(t,n,i){var r=i-n;if(r<=0)return[Fi.NUMBER,0];if(r<=1)return t[n];for(var e=[],u=n;u<i;++u)e.push(t[u]);return[Fi.PARENSESIS,e]},t.prototype.toComma=function(t,n,i){for(var r=null,e=n,u=n;u<i;++u)t[u]===Fi.COMMA&&((r=r||[]).push(this.toCommaOf(t,e,u)),e=u+1);if(e<i){if(null==r){var s=[];for(u=e;u<i;++u)s.push(t[u]);return s}r.push(this.toCommaOf(t,e,i))}return r||[]},t.prototype.toUnaryNode=function(t){wn(t)||t[0]!==Fi.PARENSESIS&&t[0]!==Fi.MIN&&t[0]!==Fi.MAX||this.toUnary(t[1])},t.prototype.toUnary=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r===Fi.ADD_OR_PLUS||r===Fi.SUB_OR_MINUS)if(n<=0||wn(t[n-1])){if(!(n+1<i)||wn(t[n+1]))throw new Error("Malformed unary operator");var e=t.splice(n+1,1)[0],u=r===Fi.ADD_OR_PLUS?Fi.PLUS:Fi.MINUS;t[n]=[u,e],i=t.length,this.toUnaryNode(e)}else u=r===Fi.ADD_OR_PLUS?Fi.ADD:Fi.SUB,t[n]=u;else this.toUnaryNode(r),i=t.length}},t.prototype.toArithmeticNode=function(t,n,i){wn(t)||(t[0]===Fi.PARENSESIS||t[0]===Fi.MIN||t[0]===Fi.MAX?this.toArithmetic(t[1],n,i):t[0]===Fi.PLUS||t[0]===Fi.MINUS?this.toArithmeticNode(t[1],n,i):t[0]!==Fi.ADD&&t[0]!==Fi.SUB&&t[0]!==Fi.MUL&&t[0]!==Fi.DIV||(this.toArithmeticNode(t[1],n,i),this.toArithmeticNode(t[2],n,i)))},t.prototype.toArithmetic=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(u===n||u===i){if(0<r&&r+1<e){var s=t[r-1],h=t[r+1];if(!wn(s)&&!wn(h)){t.splice(r,2),t[r-1]=[u,s,h],r-=1,e=t.length,this.toArithmeticNode(s,n,i),this.toArithmeticNode(h,n,i);continue}}throw new Error("Malformed operands for the operator ".concat(u))}this.toArithmeticNode(u,n,i),e=t.length}},t.prototype.toToken=function(n){for(var i=[];;){var r=t.TOKEN_REGEX.exec(n);if(null==r)break;var e=r[0],u=this.toTokenOperator(e);if(null!=u)i.push(u);else{var s=parseFloat(e);if(s!=s)throw new Error("Unexpected token '".concat(e,"' at ").concat(r.index," in '").concat(n,"'"));var h=this.toTokenLiteral(e);null!=h?i.push([h,.01*s]):i.push([Fi.NUMBER,s])}}return i},t.prototype.toTokenOperator=function(t){switch(t){case"+":return Fi.ADD_OR_PLUS;case"-":return Fi.SUB_OR_MINUS;case"*":return Fi.MUL;case"/":return Fi.DIV;case"(":return Fi.OPEN;case")":return Fi.CLOSE;case",":return Fi.COMMA;case"min":return Fi.MIN;case"max":return Fi.MAX}return null},t.prototype.toTokenLiteral=function(t){var n=t.length;if(0<n)switch(t[n-1]){case"%":return Fi.PARENT;case"s":return Fi.SELF;case"p":return Fi.PADDING;case"c":return Fi.CURRENT}return null},t.prototype.evaluate=function(t,n,i,r,e){switch(t[0]){case Fi.PARENSESIS:var u=t[1];return this.evaluate(u[u.length-1],n,i,r,e);case Fi.PLUS:return+this.evaluate(t[1],n,i,r,e);case Fi.MINUS:return-this.evaluate(t[1],n,i,r,e);case Fi.ADD:return this.evaluate(t[1],n,i,r,e)+this.evaluate(t[2],n,i,r,e);case Fi.SUB:return this.evaluate(t[1],n,i,r,e)-this.evaluate(t[2],n,i,r,e);case Fi.MUL:return this.evaluate(t[1],n,i,r,e)*this.evaluate(t[2],n,i,r,e);case Fi.DIV:return this.evaluate(t[1],n,i,r,e)/this.evaluate(t[2],n,i,r,e);case Fi.MIN:if(0<t[1].length){for(var s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.min(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Fi.MAX:if(0<t[1].length){for(s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.max(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Fi.PARENT:return t[1]*n;case Fi.SELF:return t[1]*i;case Fi.PADDING:return t[1]*r;case Fi.CURRENT:return t[1]*e;case Fi.NUMBER:return t[1]}return 0},t.prototype.calculate=function(t,n,i,r){return this.evaluate(this.Nn,t,n,i,r)},t.TOKEN_REGEX=/(?:\+|-|\*|\/|\(|\)|min|max|,|(?:\d+(?:\.\d*)?[%psc]?))/g,t}(),Hi=function(t,n){return.5*(t-n)},zi=function(t,n,i){return i},Vi=function(t){return t},Wi=function(t,n,i){return t-i},Xi=function(){function t(){}return t.position=function(t){if(null==t||wn(t))return null;if(ct(t)){switch(t){case"center":case"CENTER":return Hi;case"padding":case"PADDING":return zi}var n=new Gi(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(at(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t.size=function(t){if(null==t||wn(t))return null;if(ct(t)){switch(t){case"100%":case"maximized":case"MAXIMIZED":return Vi;case"padding":case"PADDING":return Wi}var n=new Gi(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(at(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t}(),Ki=function(){function t(){}return t.isActivateKey=function(t){return"Space"===t.key||"Enter"===t.key||32===t.which||13===t.which},t.isArrowUpKey=function(t){return"ArrowUp"===t.key||38===t.which},t.isArrowDownKey=function(t){return"ArrowDown"===t.key||40===t.which},t.isArrowLeftKey=function(t){return"ArrowLeft"===t.key||37===t.which},t.isArrowRightKey=function(t){return"ArrowRight"===t.key||39===t.which},t.isCancelKey=function(t){return"Esc"===t.key||27===t.which},t.isFocusKey=function(t){return"Tab"===t.key||9===t.which},t.isUndoKey=function(t){return t.ctrlKey&&("z"===t.key||90===t.which)},t.isRedoKey=function(t){return t.ctrlKey&&("y"===t.key||89===t.which)},t.isSaveKey=function(t){return t.ctrlKey&&!t.shiftKey&&("s"===t.key||83===t.which)},t.isSaveAsKey=function(t){return t.ctrlKey&&t.shiftKey&&("S"===t.key||83===t.which)},t.isDeleteKey=function(t){return"Delete"===t.key||46===t.which},t.isSelectAllKey=function(t){return t.ctrlKey&&!t.shiftKey&&("a"===t.key||65===t.which)},t.isOkKey=function(t){return"Enter"===t.key||13===t.which},t.getFocusDirection=function(t){return!0!==t.shiftKey},t.toShortcut=function(t){if(ct(t)){var n,i=t,r=i.indexOf("->"),e=void 0;0<=r?(e=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+2).trim()):e=i.trim().toLowerCase();for(var u=!1,s=!1,h=!1,o="a",a=e.length,c=0,f=1;f<a;++f)if("+"===e.charAt(f)){var l=e.substring(c,f);switch(l){case"alt":u=!0;break;case"ctrl":s=!0;break;case"shift":h=!0;break;default:o=l}c=f+=1}return c!==f&&(o=e.substring(c,f)),function(t){var n=t.key;if(n.length<=1){t.shift&&(t.key=n.toUpperCase());var i=n.charCodeAt(0);t.which=97<=i&&i<=122?i-32:i}else switch(n){case"enter":t.key="Enter",t.which=13;break;case"space":t.key=" ",t.which=32;break;case"escape":t.key="Escape",t.which=27;break;case"f1":t.key="F1",t.which=112;break;case"f2":t.key="F2",t.which=113;break;case"f3":t.key="F3",t.which=114;break;case"f4":t.key="F4",t.which=115;break;case"f5":t.key="F5",t.which=116;break;case"f6":t.key="F6",t.which=117;break;case"f7":t.key="F7",t.which=118;break;case"f8":t.key="F8",t.which=119;break;case"f9":t.key="F9",t.which=120;break;case"f10":t.key="F10",t.which=121;break;case"f11":t.key="F11",t.which=122;break;case"f12":t.key="F12",t.which=123;break;case"capslock":t.key="CapsLock",t.shift?t.which=20:t.which=240;break;case"arrowup":t.key="ArrowUp",t.which=38;break;case"arrowdown":t.key="ArrowDown",t.which=40;break;case"arrowleft":t.key="ArrowLeft",t.which=37;break;case"arrowright":t.key="ArrowRight",t.which=39;break;case"insert":t.key="Insert",t.which=45;break;case"delete":t.key="Delete",t.which=46;break;case"pageup":t.key="PageUp",t.which=33;break;case"pagedown":t.key="PageDown",t.which=34;break;case"backspace":t.key="Backspace",t.which=8;break;case"colon":t.key=":",t.which=186;break;case"semicolon":t.key=";",t.which=187;break;case"pause":t.key="Pause",t.which=19;break;case"scrolllock":t.key="ScrollLock",t.which=145;break;case"tab":t.key="Tab",t.which=9;break;case"plus":t.key="+",t.which=187;break;case"minus":t.key="-",t.which=189}return t}({alt:u,ctrl:s,shift:h,key:o,which:0,event:n})}return t},t.toString=function(t){var n=[];return t.ctrl&&n.push("Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),n.push(t.key.toUpperCase()),n.join("+")},t.on=function(t,n,i){var r=this.toShortcut(n);document.body.addEventListener("keydown",(function(n){n.altKey!==r.alt||n.ctrlKey!==r.ctrl||n.shiftKey!==r.shift||n.key!==r.key&&n.which!==r.which||(t.state.isActionable&&(null!=r.event?t.emit(r.event):null!=i&&i(n)),n.preventDefault())}))},t.moveFocusVertically=function(n,i,r){if(i.state.isActionable){var e=t.isArrowUpKey(n),u=t.isArrowDownKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocusHorizontally=function(n,i,r){if(i.state.isActionable){var e=t.isArrowLeftKey(n),u=t.isArrowRightKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocus=function(t,n,i){var r,e=null!==(r=null==i?void 0:i.picked)&&void 0!==r?r:et.getLayer(n);if(e){var u=e.getFocusController(),s=u.get();if(null!=s){var h=u.find(s,!1,s.state.isFocusRoot||t,t,n);if(null!=h)return u.focus(h),!0}}return!1},t}(),Yi=function(){function t(){}return Object.defineProperty(t,"touchable",{get:function(){return"ontouchstart"in document},enumerable:!1,configurable:!0}),Object.defineProperty(t,"tap",{get:function(){return"pointertap"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"down",{get:function(){return"pointerdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"enter",{get:function(){return"pointerenter"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"leave",{get:function(){return"pointerleave"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"move",{get:function(){return"pointermove"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"out",{get:function(){return"pointerout"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"over",{get:function(){return"pointerover"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"up",{get:function(){return"pointerup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"upoutside",{get:function(){return"pointerupoutside"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cancel",{get:function(){return"pointercancel"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"righttap",{get:function(){return"rightclick"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightdown",{get:function(){return"rightdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightup",{get:function(){return"rightup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightupoutside",{get:function(){return"rightupoutside"},enumerable:!1,configurable:!0}),t.toGlobal=function(t,n,i){if("touches"in t){var r=t.changedTouches,e=r[r.length-1];null!=e?n.mapPositionToPoint(i,e.clientX,e.clientY):n.mapPositionToPoint(i,0,0)}else n.mapPositionToPoint(i,t.clientX,t.clientY);return i},t.onDblClick=function(t,n){var i=this;if(t.addEventListener("dblclick",(function(t){return n(t,!1)})),this.touchable){var r=0,e=0,u=0,s=0;t.addEventListener("touchstart",(function(t){if(0===r||2===r){var n=t.touches,i=n.length;if(i<=0)r=0;else{var s=n.item(i-1);null!=s?(r+=1,e=s.clientX,u=s.clientY):r=0}}else r=0})),t.addEventListener("touchend",(function(t){if(1===r||3===r){var h=t.changedTouches,o=h.length;if(o<=0)r=0;else{var a=h[o-1];if(null!=a){var c=e-a.clientX,f=u-a.clientY;i.CLICK_DISTANCE_THRESHOLD<=Math.abs(c)+Math.abs(f)?r=0:1===r?(s=t.timeStamp,r=2):t.timeStamp-s<i.DBLCLICK_INTERVAL_THRESHOLD?(r=0,n(t,!0)):(s=t.timeStamp,r=2)}else r=0}}else r=0})),t.addEventListener("touchcancel",(function(){r=0}))}},t.contains=function(t,n){for(var i=n;null!=i&&i!==t;)i=i.parent;return i===t},t.CLICK_DISTANCE_THRESHOLD=10,t.DBLCLICK_INTERVAL_THRESHOLD=333,t.LONG_CLICK_THRESHOLD=750,t}(),Ji=function(){function t(){this.In=!1}return Object.defineProperty(t.prototype,"isOff",{get:function(){return!this.In},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOn",{get:function(){return this.In},enumerable:!1,configurable:!0}),t.prototype.toCoordinate=function(t){return this.In?"auto":t},t.prototype.from=function(t){return"auto"===t||"AUTO"===t?(this.In=!0,!0):(this.In=!1,!1)},t}(),Zi=function(){this.width=new Ji,this.height=new Ji},qi=function(){function t(t){this.p=t,this.Cn=[],this.An=[],this.Rn=!0}return Object.defineProperty(t.prototype,"renderable",{get:function(){return this.Rn},set:function(t){this.Rn=t},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){(n?this.Cn:this.An).push(t),"parent"in t&&(t.parent=this.p)},t.prototype.addAt=function(t,n,i){var r=n?this.Cn:this.An;0===i?r.unshift(t):0<i&&i<r.length?r.splice(i,0,t):r.push(t),"parent"in t&&(t.parent=this.p)},t.prototype.remove=function(t,n){var i=n?this.Cn:this.An,r=i.indexOf(t);0<=r&&(i.splice(r,1),"parent"in t&&(t.parent=null))},t.prototype.render=function(t,n){if(this.Rn)for(var i=n?this.Cn:this.An,r=0,e=i.length;r<e;++r){var u=i[r];u.updateTransform(),u.render(t)}},t}(),Qi=function(){function t(){this.Ln=[]}return t.prototype.add=function(t){this.Ln.push(t)},t.prototype.remove=function(t){var n=this.Ln,i=n.indexOf(t);0<=i&&n.splice(i,1)},t.prototype.onReflow=function(t,n,i){for(var r=this.Ln,e=0,u=r.length;e<u;++e)r[e].onReflow(t,n,i)},t}(),$i=function(n){function i(t){var r,e,u,s,h,o,a,c,f,l=this,v=(l=n.call(this)||this).transform;l._=new Ci(v.position,(function(t,n,i,r){l.onMove(t,n,i,r)})),l.yn=new Ci(v.scale,(function(t,n,i,r){l.onScale(t,n,i,r)})),l.kn=new Ci(v.skew,(function(t,n,i,r){l.onSkew(t,n,i,r)})),l.xn=t;var b=l.Bn={};l._n=new Zi,l.bn=!0,l.Pn=!1,l.Un=!1,l.Fn=null,l.name=null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"";var d=function(t){var n=null==t?void 0:t.theme;if(n)return ct(n)?Y.getInstance().get(n):n}(t)||l.getThemeDefault();l.tn=d,l.Gn=new qi(l),l.Hn=new Qi,l.zn=Ei(null!==(e=null==t?void 0:t.clear)&&void 0!==e?e:d.getClearType(),Ui),l.Vn=new Ii(d,t,(function(){l.toParentResized(),l.toHierarchyDirty(),et.update(l)}));var g=function(){l.toDirty(),et.update(l)};l.Sn=new Oi(d,t,g),l.Tn=new Mi(d,t,g),l.jn=new Ni(d,t,g),l.Qt=new Ti(d,t,g);var m=v.position,w=null!==(u=null==t?void 0:t.x)&&void 0!==u?u:d.getX();wn(w)?m.x=w:(m.x=0,b.x=Xi.position(w));var p=null!==(s=null==t?void 0:t.y)&&void 0!==s?s:d.getY();wn(p)?m.y=p:(m.y=0,b.y=Xi.position(p));var O=null!==(h=null==t?void 0:t.width)&&void 0!==h?h:d.getWidth();l._n.width.from(O)?l.St=100:wn(O)?l.St=O:(l.St=100,b.width=Xi.size(O));var D=null!==(o=null==t?void 0:t.height)&&void 0!==o?o:d.getHeight();if(l._n.height.from(D)?l.fn=100:wn(D)?l.fn=D:(l.fn=100,b.height=Xi.size(D)),null!=t){var E=t.visible;null!=E&&(l.visible=E)}if(null!=t){var M=t.renderable;null!=M&&(l.renderable=M)}l.Mt=new lt((function(t,n){l.onStateChange(t,n)}));var S,T=Ei(null!==(a=null==t?void 0:t.interactive)&&void 0!==a?a:d.getInteractive(),ji);if(l.interactive=!!(T&ji.SELF),l.interactiveChildren=!!(T&ji.CHILDREN),null!=t){var j=t.on;if(null!=j)for(var N in j){var I=j[N];I&&l.on(N,I)}}if(l.Wn=null!==(c=null==t?void 0:t.title)&&void 0!==c?c:d.getTitle(),l.Kt=null!==(f=null==t?void 0:t.weight)&&void 0!==f?f:d.getWeight(),l.initReflowable(),l.Xn=function(){et.update(l)},null!=t&&(S=t.shadow),void 0===S&&(S=d.getShadow()),S)if(ct(S))switch(S){case"WEAK":l.shadow=d.newShadowWeak();break;case"DEFAULT":l.shadow=d.newShadow()}else l.shadow=S;l.on(Yi.over,(function(t){l.onOver(t)})),l.on(Yi.out,(function(t){l.onOut(t)})),l.on(Yi.down,(function(t){l.onDown(t)})),l.on(Yi.up,(function(t){l.onUp(t)})),l.on("added",(function(){l.toParentResized(),(l.isDirty()||l.hasDirty())&&l.toParentHasDirty(),l.Un&&l.toParentHierarchyDirty();var t=l.parent;t instanceof i&&(l.state.parent=t.state),et.update(l)})),l.on("removed",(function(){l.blur(!0),l.state.parent=null,et.update(l)}));var C,A=function(t){if(t){var n=t.shortcut,i=t.shortcuts;if(null!=i||null!=n){var r=[];if(null!=n&&r.push(Ki.toShortcut(n)),null!=i)for(var e=0,u=i.length;e<u;++e)r.push(Ki.toShortcut(i[e]));return r}}}(t);if(l.Kn=A,null!=A)for(var R=function(t){l.onShortcut(t)},L=0,y=A.length;L<y;++L)Ki.on(l,A[L],R);if(l.init(t),d.newState(l.Mt),null!=t){var k=t.state;null!=k&&(ct(k)?l.Mt.add(k):l.Mt.addAll(k))}if(null!=t){var x=t.parent;null!=x&&x.addChild(l)}if(null!=t){var B=t.children;if(null!=B)for(L=0,y=B.length;L<y;++L){var _=B[L];null!=_&&l.addChild(_)}}return null!=t&&(C=t.cursor,l.Yn=C),l.cursor=l.toCursor(C,l.Mt),l.emit("init",l),l}return _(i,n),i.prototype.toCursor=function(t,n){if(t)if(at(t)){var i=t(n);if(void 0!==i)return i}else if(void 0!==t)return t;return this.theme.getCursor(n)},Object.defineProperty(i.prototype,"snippet",{get:function(){return this.Gn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"reflowable",{get:function(){return this.Hn},enumerable:!1,configurable:!0}),i.prototype.initReflowable=function(){new Pi(this)},i.prototype.onChildrenChange=function(){this.toHierarchyDirty(),n.prototype.onChildrenChange.call(this)},i.prototype.onShortcut=function(t){this.emit("shortcut",t,this)},i.prototype.init=function(t){},Object.defineProperty(i.prototype,"weight",{get:function(){return this.Kt},enumerable:!1,configurable:!0}),i.prototype.onMove=function(t,n,r,e){for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof i&&o.onParentMove(t,n,r,e)}et.update(this),this.emit("move",t,n,r,e,this)},i.prototype.resize=function(t,n){var i=this.St,r=this.fn,e=null!=t?t:i,u=null!=n?n:r,s=i!==e,h=r!==u;s&&(this.St=e),h&&(this.fn=u);var o,a=s||h;if(a&&this.onResize(e,u,i,r),s&&null!=(o=this.Bn).x){var c=this._,f=this.getParentOfSize();f&&(this._.x=o.x(f.width,e,f.padding.getLeft(),c.x))}if(h&&null!=(o=this.Bn).y){c=this._;var l=this.getParentOfSize();l&&(this._.y=o.y(l.height,u,l.padding.getTop(),c.y))}return a},i.prototype.getClearType=function(){return this.zn},i.prototype.onResize=function(t,n,r,e){this.toDirty(),this.toHierarchyDirty();for(var u=this.Vn,s=this.children,h=0,o=s.length;h<o;++h){var a=s[h];a instanceof i&&a.onParentResize(t,n,u)}et.update(this),this.emit("resize",t,n,r,e,this)},i.prototype.onScale=function(t,n,i,r){et.update(this),this.emit("scale",t,n,i,r,this)},i.prototype.onSkew=function(t,n,i,r){et.update(this),this.emit("skew",t,n,i,r,this)},Object.defineProperty(i.prototype,"type",{get:function(){return this.getType()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"x",{get:function(){return this._.x},set:function(t){this.setX(t)},enumerable:!1,configurable:!0}),i.prototype.getX=function(){var t=this.Bn;return null!=t.x?t.x:this._.x},i.prototype.setX=function(t){var n=this.Bn;if(wn(t)){var i=this._;i.x!==t?(n.x=void 0,i.x=t):void 0!==n.x&&(n.x=void 0,this.toParentResized())}else{var r=Xi.position(t);n.x!==r&&(n.x=r,this.toParentResized())}},Object.defineProperty(i.prototype,"y",{get:function(){return this._.y},set:function(t){this.setY(t)},enumerable:!1,configurable:!0}),i.prototype.getY=function(){var t=this.Bn;return null!=t.y?t.y:this._.y},i.prototype.setY=function(t){var n=this.Bn;if(wn(t)){var i=this._;i.y!==t?(n.y=void 0,i.y=t):void 0!==n.y&&(n.y=void 0,this.toParentResized())}else{var r=Xi.position(t);n.y!==r&&(n.y=r,this.toParentResized())}},Object.defineProperty(i.prototype,"width",{get:function(){return this.St},set:function(t){this.setWidth(t)},enumerable:!1,configurable:!0}),i.prototype.getWidth=function(){return this._n.width.toCoordinate(this.Bn.width||this.St)},i.prototype.setWidth=function(t){var n=this._n.width,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),et.update(this)),!r){var e=this.Bn;if(wn(t)){var u=this.St;if(u!==t){e.width=void 0,this.St=t;var s=this.fn;if(this.onResize(t,s,u,s),null!=e.x){var h=this._,o=this.getParentOfSize();o&&(h.x=e.x(o.width,t,o.padding.getLeft(),h.x))}}else void 0!==e.width&&(e.width=void 0,this.toParentResized())}else{var a=Xi.size(t);e.width!==a&&(e.width=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"height",{get:function(){return this.fn},set:function(t){this.setHeight(t)},enumerable:!1,configurable:!0}),i.prototype.getHeight=function(){return this._n.height.toCoordinate(this.Bn.height||this.fn)},i.prototype.setHeight=function(t){var n=this._n.height,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),et.update(this)),!r){var e=this.Bn;if(wn(t)){var u=this.fn;if(u!==t){e.height=void 0,this.fn=t;var s=this.St;if(this.onResize(s,t,s,u),null!=e.y){var h=this._,o=this.getParentOfSize();o&&(h.y=e.y(o.height,t,o.padding.getTop(),h.y))}}else void 0!==e.height&&(e.height=void 0,this.toParentResized())}else{var a=Xi.size(t);e.height!==a&&(e.height=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.yn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"skew",{get:function(){return this.kn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Vn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"corner",{get:function(){return this.Qt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"background",{get:function(){return this.Sn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"border",{get:function(){return this.Tn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outline",{get:function(){return this.jn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"unsafe",{get:function(){return this.transform},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this.Wn},set:function(t){this.Wn!==t&&(this.Wn=t,this.state.isHovered&&this.applyTitle())},enumerable:!1,configurable:!0}),i.prototype.applyTitle=function(){var t=et.getLayer(this);t&&(t.view.title=this.Wn)},i.prototype.show=function(){return this.visible||(this.visible=!0,this.toParentHierarchyDirty(),et.update(this)),this},i.prototype.isShown=function(){return this.visible},i.prototype.hide=function(){return this.visible&&(this.visible=!1,this.toParentHierarchyDirty(),this.blur(!0),et.update(this)),this},i.prototype.isHidden=function(){return!this.visible},i.prototype.toDirty=function(){return!this.bn&&(this.bn=!0,this.toParentHasDirty(),!0)},i.prototype.toHasDirty=function(){return!this.Pn&&(this.Pn=!0,this.toParentHasDirty(),!0)},i.prototype.toParentHasDirty=function(){var t=this.parent;t instanceof i&&t.toHasDirty()},i.prototype.toHierarchyDirty=function(){return!this.Un&&(this.Un=!0,this.onHierarchyDirty(),this.toParentHierarchyDirty(),!0)},i.prototype.toParentHierarchyDirty=function(){var t=this.parent;t instanceof i&&t.toHierarchyDirty()},i.prototype.isHierarchyDirty=function(){return this.Un},i.prototype.onHierarchyDirty=function(){},i.prototype.isDirty=function(){return this.bn},i.prototype.hasDirty=function(){return this.Pn},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=et.getLayer(this);n&&n.getFocusController().set(this,t)}return this},i.prototype.focus=function(){return this.setFocused(!0)},i.prototype.blur=function(t){if(t){var n=et.getLayer(this);if(n){var r=n.getFocusController().get();if(r instanceof i)for(var e=r;e;){if(e===this){r.setFocused(!1);break}e=e.parent}}}else this.setFocused(!1);return this},i.prototype.onStateChange=function(t,n){var r=this;this.toDirty(),et.update(this),this.emit("statechange",t,n,this);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}t.isFocused?(n.isFocused||this.onFocus(),t.inDisabled&&!n.inDisabled&&setTimeout((function(){r.blur()}),0)):n.isFocused&&this.onBlur(),this.cursor=this.toCursor(this.Yn,t)},i.prototype.onChildFocus=function(t){var n=this.parent;n instanceof i&&n.onChildFocus(t)},i.prototype.onFocus=function(){var t=this.parent;t instanceof i&&t.onChildFocus(this)},i.prototype.onChildBlur=function(t){var n=this.parent;n instanceof i&&n.onChildBlur(t)},i.prototype.onBlur=function(){var t=this.parent;t instanceof i&&t.onChildBlur(this)},Object.defineProperty(i.prototype,"state",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"options",{get:function(){return this.xn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"theme",{get:function(){return this.tn},set:function(t){this.tn!==t&&(this.tn=t,this.Vn.setTheme(t),this.Sn.setTheme(t),this.Tn.setTheme(t),this.jn.setTheme(t),this.Qt.setTheme(t),this.toDirty(),et.update(this))},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){var t=this.bn;t&&(this.onReflow(),this.bn=!1);var n=this.Pn,r=this.Un;if(n||r){this.Pn=!1,this.Un=!1;for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.reflow()}}(t||n||r)&&this.onRefit()},i.prototype.onRefit=function(){var t=this._n,n=t.width.isOn,i=t.height.isOn;if(n&&i){for(var r=0,e=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&(this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width)),this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height)));var h=this.padding;this.resize(r+h.getRight(),e+h.getBottom())}else if(n){for(r=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width));this.resize(r+this.padding.getRight(),void 0)}else if(i){var o;for(e=0,u=0,s=(o=this.children).length;u<s;++u){var a;(a=o[u]).visible&&this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height))}this.resize(void 0,e+this.padding.getBottom())}},i.prototype.isRefitable=function(t){return t instanceof i},i.prototype.hasRefitableHeight=function(t){return this.isRefitable(t)&&!(t instanceof i&&at(t.getHeight()))},i.prototype.hasRefitableWidth=function(t){return this.isRefitable(t)&&!(t instanceof i&&at(t.getWidth()))},i.prototype.onReflow=function(){this.Hn.onReflow(this,this.St,this.fn)},Object.defineProperty(i.prototype,"shadow",{get:function(){return this.Fn},set:function(t){var n=this.Fn;if(n!==t){var i=this.Hn,r=this.Gn,e=this.Xn;null!=n&&(n.off("update",e),i.remove(n),r.remove(n,!0)),this.Fn=t,null!=t&&(t.on("update",e),i.add(t),r.addAt(t,!0,0)),et.update(this)}},enumerable:!1,configurable:!0}),i.prototype.toParentResized=function(){var t=this.getParentOfSize();t&&this.onParentResize(t.width,t.height,t.padding)},i.prototype.getParentOfSize=function(){var t=this.parent;return t instanceof i?t:et.getLayer(this)},i.prototype.onParentResize=function(t,n,i){var r=this.Bn,e=this.transform.position,u=e.x,s=e.y,h=this.St,o=this.fn,a=i.getLeft()+i.getRight(),c=i.getTop()+i.getBottom(),f=null!=r.width?r.width(t,h,a,h):h,l=null!=r.height?r.height(n,o,c,o):o;this.resize(f,l);var v=null!=r.x?r.x(t,this.St,i.getLeft(),u):u,b=null!=r.y?r.y(n,this.fn,i.getTop(),s):s;this.position.set(v,b)},i.prototype.onParentMove=function(t,n,i,r){},i.prototype.onWheel=function(t,n,i){return this.emit("wheel",t,n,i,this),!1},i.prototype.onKeyDown=function(t){return this.emit("keydown",t,this),!1},i.prototype.onKeyUp=function(t){return this.emit("keyup",t,this),!1},i.prototype.isEventTarget=function(t){var n=t.target;if(n===this)return!0;if(null!=n&&!(n instanceof i&&n.interactive)){for(var r=n.parent;null!=r&&!(r instanceof i&&r.interactive);)r=r.parent;return r===this}return!1},i.prototype.onDown=function(t){this.isEventTarget(t)&&this.onDownThis(t),this.emit("down",t,this)},i.prototype.onDownThis=function(n){if("touches"in n.data.originalEvent){var i=this.Jn||new t.Point;this.Jn=i,i.copyFrom(n.data.global)}else this.focusOnClosest()},i.prototype.onUp=function(t){this.isEventTarget(t)&&this.onUpThis(t),this.emit("up",t,this)},i.prototype.onUpThis=function(t){if("touches"in t.data.originalEvent){var n=this.Jn;if(n){var i=t.data.global,r=Math.abs(i.x-n.x),e=Math.abs(i.y-n.y),u=Yi.CLICK_DISTANCE_THRESHOLD;r<u&&e<u&&this.focusOnClosest()}}},i.prototype.focusOnClosest=function(){var t=et.getLayer(this);if(t){var n=t.getFocusController();n.focus(n.findParent(this))}},i.prototype.onOver=function(t){this.state.isHovered=!0,t.target===this&&this.applyTitle(),this.emit("over",t,this)},i.prototype.onOut=function(t){this.state.isHovered=!1,this.emit("out",t,this)},i.prototype.onDblClick=function(t,n){return this.emit("dblclick",t,n,this),!1},i.prototype.render=function(t){if(this.visible&&0<this.worldAlpha&&this.renderable){var i=this.Gn;i.render(t,!0),n.prototype.render.call(this,t),i.render(t,!1)}},i.prototype.getThemeDefault=function(){return Y.getInstance().get(this.getType())},i.prototype.getType=function(){return"DBase"},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,r=this._bounds,e=i.WORK_CONTAINS_POINT;e.set(0,0),t.apply(e,e),r.addPoint(e),e.set(this.St,this.fn),t.apply(e,e),r.addPoint(e),n.prototype._calculateBounds.call(this)},i.prototype.containsPoint=function(t){return this.containsGlobalPoint(t)||this.containsLocalPoint(this.worldTransform.applyInverse(t,i.WORK_CONTAINS_POINT))},i.prototype.containsGlobalPoint=function(t){return!1},i.prototype.containsLocalPoint=function(t){var n=t.x,i=t.y,r=this.St,e=this.fn;return 0<=n&&n<=r&&0<=i&&i<=e},i.prototype.getClippingRect=function(t,n){n.x=0,n.y=0,n.width=this.St,n.height=this.fn},i.prototype.destroy=function(){var t=this.Bn;t.x=null,t.y=null,t.width=null,t.height=null;var i=this.Fn;i&&(this.Fn=null,i.destroy());for(var r=this.children,e=r.length-1;0<=e;--e)r[e].destroy();r.length=0,n.prototype.destroy.call(this)},i.WORK_CONTAINS_POINT=new t.Point,i}(t.Container),tr=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){var r=t.corner,e=Math.max(0,r.getRadius()-.5),u=r.getMask(),s=u&Si.TOP_LEFT?0:e,h=u&Si.TOP_RIGHT?0:e,o=u&Si.BOTTOM_LEFT?0:e,a=u&Si.BOTTOM_RIGHT?0:e;this.clear(),this.beginFill(16777215,1),this.lineStyle(0,0,0,0,!1),s<=0&&h<=0&&o<=0&&a<=0?this.drawRect(0,0,n,i):(this.moveTo(0+s,0),0<h?this.arcTo(0+n,0,0+n,0+i,h):this.lineTo(0+n,0),0<a?this.arcTo(0+n,0+i,0,0+i,a):this.lineTo(0+n,0+i),0<o?this.arcTo(0,0+i,0,0,o):this.lineTo(0,0+i),0<s?this.arcTo(0,0,0+n,0,s):this.lineTo(0,0)),this.endFill()},n}(t.Graphics),nr={NONE:0,CTRL:1,SHIFT:2,ALT:4,AND:8,OR:16,NOT_NONE:23},ir=function(){function t(){}return t.from=function(t){var n="data"in t?t.data.originalEvent:t;return(n.ctrlKey?nr.CTRL:nr.NONE)|(n.altKey?nr.ALT:nr.NONE)|(n.shiftKey?nr.SHIFT:nr.NONE)},t.match=function(n,i){return i&nr.OR?!!(t.from(n)&i):t.from(n)===i},t}(),rr={OFF:0,ON:1,TOUCH:2},er=function(){function n(){this.pointers=new Map,this.center=new t.Point,this.scale=0,this.time=0}return n.prototype.start=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.isUpdatable=function(t){var n=t.data.originalEvent;return!("pointerId"in n)||this.pointers.has(n.pointerId)},n.prototype.update=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.end=function(t){var n=!0,i=t.data.originalEvent;if("touches"in i)n=i.touches.length<=0;else if("pointerId"in i){var r=this.pointers;r.delete(i.pointerId),n=r.size<=0}return this.doUpdate(t),n},n.prototype.bind=function(t){var n=this.interactionManager;if(n){var i=this.onMove;i&&n.on(Yi.move,i);var r=this.onEnd;r&&(n.on(Yi.up,r),n.on(Yi.upoutside,r),n.on(Yi.cancel,r))}},n.prototype.unbind=function(){var t=this.interactionManager;if(t){var n=this.onMove;n&&t.off(Yi.move,n);var i=this.onEnd;i&&(t.off(Yi.up,i),t.off(Yi.upoutside,i),t.off(Yi.cancel,i))}},n.prototype.doUpdate=function(t){var n=this.interactionManager,i=this.center,r=t.data.originalEvent;if(this.scale=0,this.time=r.timeStamp,"touches"in r){var e=r.touches,u=e.length;if(0<u){for(var s=0,h=0,o=0,a=e.length;o<a;++o)s+=(f=e[o]).clientX,h+=f.clientY;if(s/=u,h/=u,n?n.mapPositionToPoint(i,s,h):i.set(s,h),1<u){var c=0;for(o=1,a=e.length;o<a;++o){var f,l=(f=e[o]).clientX-s,v=f.clientY-h;c=Math.max(c,l*l+v*v)}this.scale=Math.sqrt(c)}}}else if("pointerId"in r){var b=this.pointers,d=b.size;if(0<d){var g=0,m=0;if(b.forEach((function(t){g+=t.clientX,m+=t.clientY})),g/=d,m/=d,n?n.mapPositionToPoint(i,g,m):i.set(g,m),1<d){var w=0;b.forEach((function(t){var n=t.clientX-g,i=t.clientY-m;w=Math.max(w,n*n+i*i)})),this.scale=Math.sqrt(w)}}}else i.copyFrom(t.data.global)},n}(),ur=function(){function t(){}return t.LINEAR=function(t){return t},t.ELASTIC=function(t){return t*(3*(1-t)*(1-t)+t*(3*(1-t)+t))},t.QUAD_IN_OUT=function(t){return t<.5?2*t*t:(4-2*t)*t-1},t}(),sr=function(t){function n(n){var i,r,e,u=this;(u=t.call(this)||this).R=null,u.Zn=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,u.qn=0,u.Qn=null!==(r=null==n?void 0:n.duration)&&void 0!==r?r:200,u.$n=1/Math.max(1,u.Qn),u.ti=!1,u.ni=null==n?void 0:n.onTime,u.ii=function(){u.onTimeBase()},u.ri=null==n?void 0:n.onStart,u.ei=null==n?void 0:n.onEnd,u.si=null!==(e=null==n?void 0:n.timing)&&void 0!==e?e:ur.ELASTIC;var s=null==n?void 0:n.on;if(s)for(var h in s){var o=s[h];o&&u.on(h,o)}return u}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.Zn},set:function(t){this.Zn=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return this.Qn},set:function(t){this.Qn=t,this.$n=1/Math.max(1,t)},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.qn=Date.now(),this.ti=t,this.R=window.setTimeout(this.ii,0),this.onStart(t);var n=this.Qn,i=this.toTime(t?n:0);this.onTime(i,t,0)},n.prototype.onStart=function(t){var n=this.ri;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ni;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.ei;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return null!=this.R},n.prototype.isReverse=function(){return this.ti},n.prototype.onTimeBase=function(){if(null!=this.R){this.R=null;var t=Date.now()-this.qn,n=this.Qn,i=this.ti;if(t<n){this.R=window.setTimeout(this.ii,0);var r=this.toTime(i?n-t:t);this.onTime(r,i,t)}else r=this.toTime(i?0:n),this.onTime(r,i,t),this.onEnd(i)}},n.prototype.toTime=function(t){return this.si(t*this.$n,this)},n.prototype.stop=function(){var t=this.R;null!=t&&(this.R=null,window.clearTimeout(t))},n.prototype.end=function(){var t=this.R;if(null!=t){this.R=null,window.clearTimeout(t);var n=this.ti,i=Date.now()-this.qn,r=this.Qn,e=this.toTime(n?0:r);this.onTime(e,n,i),this.onEnd(n)}},n}(t.utils.EventEmitter),hr=function(){function t(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r}return t.prototype.set=function(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r},t}(),or=function(){function t(t,n,i){var r,e=this;this.hi=[],this.oi=[],this.ai=0,this.ci=-1,this.fi=0,this.li=0,this.vi=0,this.bi=0,this.di=0,this._t=0,this.gi=new sr({onTime:function(t){e.onEase(t)},onEnd:function(){e.onEaseEnd()},timing:ur.LINEAR,duration:333*(null!==(r=null==i?void 0:i.duration)&&void 0!==r?r:1)}),this.wi=t,this.ei=n}return t.prototype.onStart=function(){for(var n=this.hi,i=n.length,r=t.HISTORY_CAPACITY;i<r;++i)n.push(new hr(0,0,1,0));this.ai=0,this.ci=-1,this.gi.stop()},t.prototype.onMove=function(n,i,r,e){var u=t.HISTORY_CAPACITY,s=this.ci,h=(s+1)%u;this.ci=h;var o=this.ai;(h<s||0<=s&&s<o)&&(this.ai=(o+1)%u),this.hi[h].set(n,i,r,e)},t.prototype.updateHistoriesSorted=function(t){var n=this.hi,i=this.oi,r=this.ai,e=this.ci,u=n.length;if(e<0)return i.length=0,t;if(e<r){var s=t;i.length=0;for(var h=e;0<=h;--h){var o=n[h];if(!(s+o.dt<160))return s;s+=o.dt,i.push(o)}for(h=u-1;r<=h;--h){var a=n[h];if(!(s+a.dt<160))return s;s+=a.dt,i.push(a)}return s}for(s=t,i.length=0,h=e;r<=h;--h){var c=n[h];if(!(s+c.dt<160))return s;s+=c.dt,i.push(c)}return s},t.prototype.onEnd=function(t){this.updateHistoriesSorted(t);var n=this.oi,i=n.length;if(i<=0)return this.onEaseEnd();for(var r=0,e=0,u=0,s=0,h=0;h<i;++h){var o=n[h];r+=o.dx,e+=o.dy,u+=o.ds,s+=o.dt}if(s<=0)return this.onEaseEnd();var a=1/i;r*=a,e*=a,u*=a,s*=a,this.fi=r,this.li=e,this.vi=u,this.bi=s;var c=this.gi,f=c.duration;this._t=-t/f,this.di=f/s,c.start()},t.prototype.onEase=function(t){var n=this._t;this._t=t;var i=(1-.5*(t+n))*(t-n)*this.di;this.wi(this.fi*i,this.li*i,1+(this.vi-1)*i,t)},t.prototype.onEaseEnd=function(){this.ei()},t.prototype.stop=function(){this.gi.stop()},t.HISTORY_CAPACITY=5,t}(),ar=function(){function t(t){var n,i,r,e=t.on;e&&(this.ri=e.start,this.wi=e.move,this.ei=e.end),this.pi=null!==(n=null==t?void 0:t.modifier)&&void 0!==n?n:nr.NONE;var u=t.checker,s=ir.match;this.Oi=null!==(i=null==u?void 0:u.start)&&void 0!==i?i:s,this.Di=null!==(r=null==u?void 0:u.move)&&void 0!==r?r:s,this.Ei=t.easing,this.Mi=!!t.touch,this.Si=[],this.Ti=new Map;var h=t.bind;null!=h&&this.bind(h)}return t.prototype.newData=function(t){var n=this.Ti,i=n.get(t);if(null!=i)return i;var r=this.Si.pop();if(null!=r)return n.set(t,r),r;var e=new er;return e.easing=this.newEasing(e),e.onMove=this.newOnMove(e),e.onEnd=this.newOnEnd(e),n.set(t,e),e},t.prototype.newEasing=function(t){var n=this,i=this.Ei;if(null==i||!1!==i)return new or((function(i,r,e,u){n.onEasingMove(i,r,e,u,t)}),(function(){n.onEasingEnd(t)}),this.toEasingOptions(i))},t.prototype.toEasingOptions=function(t){return null==t||!0===t?void 0:t},t.prototype.deleteData=function(t){var n=t.target;n&&this.Ti.delete(n)&&(t.target=void 0,t.pointers.clear(),this.Si.push(t))},t.prototype.bind=function(t){var n=this;return t.on(Yi.down,(function(i){n.onDown(t,i)})),this},t.prototype.isTouch=function(t){var n=t.data.originalEvent;return"touches"in n||"pointerId"in n&&"mouse"!==n.pointerType},t.prototype.onDown=function(t,n){var i;if((!this.Mi||this.isTouch(n))&&this.Oi(n,this.pi,t)){var r=et.getLayer(t);if(null!=r)if(n.stopPropagation(),t.state.isGesturing)null===(i=this.Ti.get(t))||void 0===i||i.start(n);else{var e=this.ri;null!=e&&e(t);var u=this.newData(t);u.target=t,t.state.isGesturing=!0;var s=r.renderer.plugins.interaction;u.interactionManager=s,u.start(n);var h=u.easing;h&&h.onStart(),u.bind(n)}}},t.prototype.newOnMove=function(t){var n=this;return function(i){n.onMove(i,t)}},t.prototype.newOnEnd=function(t){var n=this;return function(i){n.onEnd(i,t)}},t.prototype.onMove=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.isUpdatable(t)&&this.Di(t,this.pi,i)){var r=n.center,e=r.x,u=r.y,s=n.scale,h=n.time;n.update(t);var o=r.x,a=r.y,c=n.scale,f=o-e,l=a-u,v=n.time-h,b=1e-5,d=b<s&&b<c?c/s:1,g=n.easing;g&&g.onMove(f,l,d,v);var m=this.wi;null!=m&&(0===f&&0===l&&1===d||m(i,f,l,o,a,d))}},t.prototype.onEnd=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.end(t)){i.state.isGesturing=!1;var r=n.interactionManager;if(n.interactionManager=void 0,r){var e=n.onMove;e&&r.off(Yi.move,e);var u=n.onEnd;u&&(r.off(Yi.up,u),r.off(Yi.cancel,u))}var s=this.ei;null!=s&&s(i);var h=n.easing;h?h.onEnd(t.data.originalEvent.timeStamp-n.time):this.deleteData(n)}},t.prototype.onEasingMove=function(t,n,i,r,e){if(null!=e.target){var u=this.wi;if(null!=u&&(0!==t||0!==n||1!==i)){var s=e.center,h=s.x+t,o=s.y+n;s.set(h,o),u(e.target,t,n,h,o,i)}}},t.prototype.onEasingEnd=function(t){this.deleteData(t)},t.prototype.stop=function(t){var n,i=this.Ti.get(t);null!=i&&(null===(n=i.easing)||void 0===n||n.stop(),this.deleteData(i))},t}(),cr=function(){function t(t,n,i,r,e,u){var s,h,o=this;this.p=t,this.ji=i,this.Ni=r;var a=Ei(null!==(s=null==u?void 0:u.mode)&&void 0!==s?s:e.getGestureMode(),rr),c=Ei(null!==(h=null==u?void 0:u.modifier)&&void 0!==h?h:e.getGestureModifier(),nr);a!==rr.ON&&a!==rr.TOUCH||(this.Ii=new ar({touch:a===rr.TOUCH,modifier:c,checker:u&&u.checker,easing:{duration:null==u?void 0:u.duration},on:{start:function(){o.ji.stop()},move:function(i,r,e,u,s,h){o.onGestureMove(n(t),r,e,u,s,h)}}}))}return t.prototype.onGestureMove=function(t,n,i,r,e,u){if(t){var s=this.ji,h=t.scale,o=h.x,a=h.y,c=s.toNormalizedScale(o*u),f=s.toNormalizedScale(a*u),l=c/o,v=f/a,b=u<1?Math.max(l,v):Math.min(l,v);c=b*o,f=b*a;var d=r-n,g=e-i,m=t.position,w=(m.x-d)*b+r,p=(m.y-g)*b+e;this.Ni(t,w,p,c,f)}},t.prototype.stop=function(){var t;null===(t=this.Ii)||void 0===t||t.stop(this.p)},t.prototype.onDown=function(t){var n;null===(n=this.Ii)||void 0===n||n.onDown(this.p,t)},t}(),fr=function(){function t(t,n,i,r,e){var u=this;this.p=t,this.Ci=n,this.Ni=r,this.Ai=1,this.Ri=1,this.Li=0,this.yi=0,this.ki=1,this.xi=1,this.Bi=0,this._i=0,this.gi=new sr({onTime:function(t){u.onTime(t)},duration:e}),this.ji=i,this.Qn=e}return t.prototype.onTime=function(t){var n=1-t,i=t,r=this.ki*n+this.Ai*i,e=this.xi*n+this.Ri*i,u=this.Bi*n+this.Li*i,s=this._i*n+this.yi*i,h=this.Ci(this.p);null!=h&&this.Ni(h,u,s,r,e)},t.prototype.start=function(t,n,i,r,e,u,s){if(!1!==s&&this.ji.stop(),null==u&&(u=this.Qn),u<=0)this.Ni(t,n,i,r,e);else{var h=t.position,o=t.scale;this.Bi=h.x,this._i=h.y,this.ki=o.x,this.xi=o.y,this.Li=n,this.yi=i,this.Ai=r,this.Ri=e,this.gi.duration=u,this.gi.start()}},t.prototype.stop=function(){this.gi.stop()},t}(),lr=function(){function n(i,r,e){var u,s,h,o,a,c,f,l,v,b,d,g,m,w,p,O,D;this.p=i,this.Ci=r,this.Ni=e&&e.constraint||n.CONSTRAINT,this.Pi=new t.Rectangle;var E=this.toTheme(e)||this.getThemeDefault(),M=null==e?void 0:e.zoom;this.Ui=new t.Point,this.Fi=null!==(u=null==M?void 0:M.min)&&void 0!==u?u:E.getZoomMin(),this.Gi=null!==(s=null==M?void 0:M.max)&&void 0!==s?s:E.getZoomMax(),this.Hi=null!==(h=null==M?void 0:M.keepRatio)&&void 0!==h?h:E.getZoomKeepRatio();var S=null==M?void 0:M.wheel;this.zi=null!==(o=null==S?void 0:S.enable)&&void 0!==o?o:E.isWheelZoomEnabled(),this.Vi=null!==(a=null==S?void 0:S.speed)&&void 0!==a?a:E.getWheelZoomSpeed(),this.Wi=Ei(null!==(c=null==S?void 0:S.modifier)&&void 0!==c?c:E.getWheelZoomModifier(),nr),this.Xi=null!==(f=null==S?void 0:S.checker)&&void 0!==f?f:ir.match;var T=null==M?void 0:M.dblclick;this.Ki=null!==(l=null==T?void 0:T.enable)&&void 0!==l?l:E.isDblClickZoomEnabled(),this.Yi=null!==(v=null==T?void 0:T.amount)&&void 0!==v?v:E.getDblClickZoomSpeed(),this.Ji=Ei(null!==(b=null==T?void 0:T.modifier)&&void 0!==b?b:E.getDblClickZoomModifier(),nr),this.Zi=null!==(d=null==T?void 0:T.checker)&&void 0!==d?d:ir.match,this.qi=null!==(g=null==T?void 0:T.duration)&&void 0!==g?g:E.getDblClickZoomDuration();var j=null===(m=null==e?void 0:e.translation)||void 0===m?void 0:m.wheel;this.Qi=null!==(w=null==j?void 0:j.enable)&&void 0!==w?w:E.isWheelTranslationEnabled(),this.$i=null!==(p=null==j?void 0:j.speed)&&void 0!==p?p:E.getWheelTranslationSpeed(),this.tr=Ei(null!==(O=null==j?void 0:j.modifier)&&void 0!==O?O:E.getWheelTranslationModifier(),nr),this.nr=null!==(D=null==j?void 0:j.checker)&&void 0!==D?D:ir.match,this.ir=new cr(i,r,this,this.Ni,E,null==e?void 0:e.gesture),this.I=new fr(i,r,this,this.Ni,this.qi)}return Object.defineProperty(n.prototype,"gesture",{get:function(){return this.ir},enumerable:!1,configurable:!0}),n.prototype.stop=function(){this.ir.stop(),this.I.stop()},n.prototype.reset=function(t,n){var i=this.p,r=this.Ci(i);if(r){var e=r.getLocalBounds(this.Pi),u=.5*(i.width-e.width)-e.x,s=.5*(i.height-e.height)-e.y;this.I.start(r,u,s,1,1,t,n)}},n.prototype.fit=function(t,n){var i=this.p,r=this.Ci(i);if(r){var e=i.padding,u=i.width,s=i.height,h=r.getLocalBounds(this.Pi),o=h.x,a=h.y,c=h.width,f=h.height,l=(u-e.getLeft()-e.getRight())/c,v=(s-e.getTop()-e.getBottom())/f;if(this.Hi){var b=this.toNormalizedScale(Math.min(l,v));l=b,v=b}else l=this.toNormalizedScale(l),v=this.toNormalizedScale(v);var d=.5*(u-c*l)-o*l,g=.5*(s-f*v)-a*v;this.I.start(r,d,g,l,v,t,n)}},n.prototype.zoomIn=function(t,n){var i=this.Ci(this.p);if(i){var r=this.Yi,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomOut=function(t,n){var i=this.Ci(this.p);if(i){var r=1/this.Yi,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomAt=function(t,n,i,r,e,u){var s=this.Ci(this.p);if(s){var h=s.scale.x,o=s.scale.y,a=this.toNormalizedScale(i),c=this.toNormalizedScale(r),f=a/h,l=c/o,v=(s.position.x-t)*f+t,b=(s.position.y-n)*l+n;this.I.start(s,v,b,a,c,e,u)}},n.prototype.zoomAtGlobal=function(t,n,i,r,e,u){var s=this.Ui;s.set(t,n),this.toLocal(s,s),this.zoomAt(s.x,s.y,i,r,e,u)},n.prototype.zoom=function(t,n,i,r){var e=this.p;this.zoomAt(.5*e.width,.5*e.height,t,n,i,r)},Object.defineProperty(n.prototype,"scale",{get:function(){var n=this.Ci(this.p);return n?n.scale:new t.Point(1,1)},set:function(t){var n=this.Ci(this.p);if(n){var i=this.toNormalizedScale(t.x),r=this.toNormalizedScale(t.y),e=n.position;this.Ni(n,e.x,e.y,i,r)}},enumerable:!1,configurable:!0}),n.prototype.moveTo=function(t,n,i,r){var e=this.Ci(this.p);if(e){var u=e.scale;this.I.start(e,t,n,u.x,u.y,i,r)}},Object.defineProperty(n.prototype,"position",{get:function(){var n=this.Ci(this.p);return n?n.position:new t.Point(0,0)},set:function(t){var n=this.Ci(this.p);if(n){var i=n.scale;this.Ni(n,t.x,t.y,i.x,i.y)}},enumerable:!1,configurable:!0}),n.prototype.transform=function(t,n,i,r,e,u){var s=this.Ci(this.p);s&&this.I.start(s,t,n,i,r,e,u)},n.prototype.toLocal=function(t,n,i){return this.p.toLocal(t,void 0,n,i)},n.prototype.toGlobal=function(t,n,i){return this.p.toGlobal(t,n,i)},n.prototype.toNormalizedScale=function(t){return Math.min(this.Gi,Math.max(this.Fi,t))},n.prototype.onWheel=function(t,n,i){var r;if(this.zi&&this.Xi(t,this.Wi,this.p)&&0!==n.deltaY&&(r=this.Ci(this.p))){var e=n.lowest*this.Vi,u=1+n.deltaY*e,s=r.scale;return this.zoomAtGlobal(i.x,i.y,s.x*u,s.y*u,0),!0}if(this.Qi&&this.nr(t,this.tr,this.p)&&(r=this.Ci(this.p))){this.stop(),e=n.lowest*this.$i;var h=r.position,o=h.x-n.deltaX*e,a=h.y+n.deltaY*e;return s=r.scale,this.Ni(r,o,a,s.x,s.y),!0}return!1},n.prototype.onDown=function(t){this.ir.onDown(t)},n.prototype.onDblClick=function(t,n){if(this.Ki&&this.Zi(t,this.Ji,this.p)){var i=this.Ci(this.p);if(i){var r=this.Ui;Yi.toGlobal(t,n,r);var e=this.Yi,u=i.scale;return this.zoomAtGlobal(r.x,r.y,u.x*e,u.y*e,this.qi),!0}}return!1},n.prototype.toTheme=function(t){if(t&&t.theme){var n=t.theme;return ct(n)?Y.getInstance().get(n):n}return null},n.prototype.getThemeDefault=function(){return Y.getInstance().get(this.getType())},n.prototype.getType=function(){return"DView"},n.CONSTRAINT=function(t,n,i,r,e){t.scale.set(r,e),t.position.set(n,i)},n}(),vr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n),this.rr=null;var e=this.theme;this.er=new lr(this,(function(){return r.rr}),null==n?void 0:n.view);var u=null==n?void 0:n.canvas;u&&(this.canvas=u),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(this.mask=this.getOverflowMask())},n.prototype.getType=function(){return"DCanvasContainer"},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateContentSize(n,i,r,e)},Object.defineProperty(n.prototype,"canvas",{get:function(){return this.rr},set:function(t){var n=this.rr;null!=n&&(this.rr=null,this.removeChild(n),this.emit("unset",n,this),n.destroy()),this.rr=t,null!=t?(this.addChild(t),this.er.reset(0),this.emit("set",t,this)):et.update(this)},enumerable:!1,configurable:!0}),n.prototype.getOverflowMask=function(){return null==this.ur&&(this.ur=new tr(this),this.Hn.add(this.ur),this.toDirty()),this.ur},n.prototype.updateContentSize=function(t,n,i,r){var e=this.rr;if(null!=e){var u=e.x+.5*(t-i),s=e.y+.5*(n-r);e.position.set(u,s)}},Object.defineProperty(n.prototype,"view",{get:function(){return this.er},enumerable:!1,configurable:!0}),n.prototype.onWheel=function(n,i,r){var e=this.er.onWheel(n,i,r),u=t.prototype.onWheel.call(this,n,i,r);return e||u},n.prototype.onDblClick=function(n,i,r){if(!0!==r){var e=this.er.onDblClick(n,i),u=t.prototype.onDblClick.call(this,n,i);return e||u}return t.prototype.onDblClick.call(this,n,i)},n.prototype.onDown=function(n,i){!0!==i&&this.er.onDown(n),t.prototype.onDown.call(this,n)},n.prototype.destroy=function(){var n=this.ur;null!=n&&(this.ur=null,n.destroy()),this.mask=null,t.prototype.destroy.call(this)},n}($i),br={DIAGRAM:0,PAGE:1,EXTENSION:1e3},dr=function(){function t(t){this.sr=this.newSources(t)}return t.prototype.map=function(n,i,r){var e=this.sr;if(null==e)return!1;var u=n.id,s=u.toLowerCase(),h=s.length;if(h!==u.length)return!1;var o=e[0],a=o.length;if(0!==a&&0!==s.indexOf(o))return!1;var c=t.SPANS;c[0]=0,c[1]=a;for(var f=e.length,l=1;l<f;++l){var v=l<<1,b=e[l],d=b.length;if(0===d)c[v]=h,c[v+1]=h;else{var g=s.indexOf(b,c[v-1]);if(g<0)return!1;c[v]=g,c[v+1]=g+d}}if(null!=i){for(var m=i.length,w="",p=(l=0,f);l<p;++l){var O=l<m?i[l]:e[l],D=c[1+(v=l<<1)],E=c[v+2];w+=O+u.substring(D,l+1<p?E:h)}n.id=w}return 0<r.length&&(n.initial=r),!0},t.prototype.newSources=function(n){if(null==n)return null;var i=n.trim();return i.length<=0?null:i.toLowerCase().split(t.WILDCARD)},t.split=function(t){if(null==t)return null;var n=t.trim();return n.length<=0?null:n.split(this.WILDCARD)},t.WILDCARD="*",t.SPANS=[],t}(),gr=function(){function t(t,n,i,r,e){this.resources=t.resources,this.data=t.data||t.tags||t.resources,this.pieces=n,this.pieceData=i,this.mode=r,this.depth=e,this.hr=new Map,this.ar=new Map,this.cr=new Map,this.Pt=new Map,this.lr=new Map,this.vr=new Map,this.br=new Map,this.dr=new Map,this.gr=new Map,this.mr=new Map,this.wr=new Map,this.pr=new Map,this.Or=new Map,this.Dr=new Map,this.Er=new Map,this.Mr=new Map}return t.prototype.getAction=function(t){return this.hr.get(t)},t.prototype.setAction=function(t,n){this.hr.set(t,n)},t.prototype.getFill=function(t){return this.ar.get(t)},t.prototype.setFill=function(t,n){this.ar.set(t,n)},t.prototype.getStroke=function(t){return this.cr.get(t)},t.prototype.setStroke=function(t,n){this.cr.set(t,n)},t.prototype.getData=function(t){return this.Pt.get(t)},t.prototype.setData=function(t,n){this.Pt.set(t,n)},t.prototype.getDataValue=function(t){return this.lr.get(t)},t.prototype.setDataValue=function(t,n){this.lr.set(t,n)},t.prototype.getDataMapping=function(t){return this.vr.get(t)},t.prototype.setDataMapping=function(t,n){this.vr.set(t,n)},t.prototype.getDataMapper=function(t){var n=this.br,i=n.get(t);return void 0===i&&(i=new dr(t),n.set(t,i)),i},t.prototype.getDataDestination=function(t){var n=this.dr,i=n.get(t);return void 0===i&&(i=dr.split(t),n.set(t,i)),i},t.prototype.getDataSystem=function(t){return this.gr.get(t)},t.prototype.setDataSystem=function(t,n){this.gr.set(t,n)},t.prototype.getRange=function(t){return this.mr.get(t)},t.prototype.setRange=function(t,n){this.mr.set(t,n)},t.prototype.getAlign=function(t){return this.wr.get(t)},t.prototype.setAlign=function(t,n){this.wr.set(t,n)},t.prototype.getMargin=function(t){return this.pr.get(t)},t.prototype.setMargin=function(t,n){this.pr.set(t,n)},t.prototype.getText=function(t){return this.Or.get(t)},t.prototype.setText=function(t,n){this.Or.set(t,n)},t.prototype.getTextOutline=function(t){return this.Dr.get(t)},t.prototype.setTextOutline=function(t,n){this.Dr.set(t,n)},t.prototype.getCapability=function(t){return this.Er.get(t)},t.prototype.setCapability=function(t,n){this.Er.set(t,n)},t.prototype.getExtension=function(t){return this.Mr.get(t)},t.prototype.setExtension=function(t,n){this.Mr.set(t,n)},t}(),mr={VIEWER:0,EDITOR_DATA_MAPPED:1,EDITOR:2},wr=function(){function t(){}return t.get=function(t){var n=this.mappings[t];return null!=n?n:pt.PRIMITIVE},t.contains=function(t,n){if(null!=t){var i=this.get(t.type),r=t.getCapability();return null!=r&&(i&=~r.removed,i|=r.added,i&=~r.locked),(i&n)===n}return!1},t.set=function(t,n){this.mappings[t]=n},t.mappings={},t}(),pr=function(){this.localTransform=new t.Matrix,this.internalTransform=new t.Matrix,this.internalTransformParentInverse=new t.Matrix,this.rotation=0,this.size=new t.Point},Or=function(t){return Math.abs(t)<.001?t<0?-.001:.001:t},Dr=function(){function t(){}return t.prepare=function(t){var n=t.editor||new pr;t.editor=n,t.updateTransform();var i=t.parent;i instanceof Dt?i.transform.internalTransform.copyTo(n.internalTransformParentInverse).invert():n.internalTransformParentInverse.identity(),t.transform.internalTransform.copyTo(n.internalTransform),n.rotation=t.transform.rotation,n.size.copyFrom(t.size),t.disallowOnTransformChange()},t.finalize=function(t){t.allowOnTransformChange(!0)},t.apply=function(t,n,i){var r=t.editor;if(null!=r){var e=r.localTransform;r.internalTransformParentInverse.copyTo(e).append(n).append(r.internalTransform),this.applyLocal(t,e,i,r.size)}},t.applyLocal=function(t,n,i,r){t.disallowUploadedUpdate();var e=n.a,u=n.b,s=n.c,h=n.d,o=n.tx,a=n.ty,c=t.transform,f=!!(i&pt.POSITION),l=!!(i&pt.ROTATION),v=!!(i&pt.SKEW),b=!!(i&pt.WIDTH),d=!!(i&pt.HEIGHT);if(l||v){var g=Math.atan2(-s,h),m=Math.atan2(+u,e);if(l&&(c.rotation=.5*(g+m)),v){var w=.5*(m-g);c.skew.set(w,w)}}if(f){var p=c.pivot,O=p.x,D=p.y;c.position.set(o+(e*O+s*D),a+(u*O+h*D))}if(null!=r&&(b||d)){var E=Or(r.x*Math.sqrt(e*e+u*u)),M=Or(r.y*Math.sqrt(s*s+h*h)),S=t.size;b&&d?S.set(E,M):b?S.x=E:S.y=M}t.allowUploadedUpdate()},t}(),Er=function(){function n(n,i,r){this.shape=n,this.base=new t.Point(i,r);var e=n.size;this.shapeBase=new t.Point(e.x,e.y),this.transform=new t.Matrix,n.updateTransform(),n.transform.localTransform.copyTo(this.transform),this.capable=wr.contains(n,pt.POSITION)&&wr.contains(n,pt.WIDTH)&&wr.contains(n,pt.HEIGHT)&&wr.contains(n,pt.ROTATION)&&wr.contains(n,pt.SKEW)}return n.prototype.isCompatible=function(t){return this.shape===t},n.prototype.reset=function(t,n,i){this.base.set(n,i);var r=t.size;this.shapeBase.copyFrom(r),t.updateTransform(),t.transform.localTransform.copyTo(this.transform)},n.prototype.update=function(t,i,r,e,u){if(this.capable){var s=i/this.base.x,h=r/this.base.y,o=this.shapeBase,a=n.WORK_TRANSFORM;a.identity().append(this.transform).translate(-e,-u).scale(s,h).translate(+e,+u),t.disallowOnTransformChange(),Dr.applyLocal(t,a,pt.ALL,o),t.allowOnTransformChange(!1)}},n.WORK_TRANSFORM=new t.Matrix,n}(),Mr=function(){function n(n,i,r,e){this.Sr=new t.Rectangle,this.Tr=new t.Rectangle,this.p=n,this.jr=[],this.j=new t.Point(i,r),this.Nr=e}return n.prototype.init=function(){return this},Object.defineProperty(n.prototype,"x",{get:function(){return this.j.x},set:function(t){var n=this.j;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.j.y},set:function(t){var n=this.j;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.j,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.j;return new n(this.p,t.x,t.y,this.Nr)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.j,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.j.copyTo(t)},n.prototype.equals=function(t){return this.j.equals(t)},n.prototype.fit=function(){return this.Nr&&this.doFit(),this},n.prototype.doFit=function(){var t=this.p;t.disallowOnTransformChange();var n=this.calcRect(this.Tr),i=this.j;i.set(n.width,n.height),t.updateTransform();var r=t.transform,e=n.x+.5*n.width,u=n.y+.5*n.height,s=r.position,h=r.localTransform,o=h.a,a=h.b,c=h.c,f=h.d,l=r.pivot;s.set(s.x+(o*e+c*u)-(o*l.x+c*l.y),s.y+(a*e+f*u)-(a*l.x+f*l.y)),l.set(e,u),this.reset(t.children,this.jr,i),t.allowOnTransformChange(!0)},n.prototype.reset=function(t,n,i){for(var r=0,e=Math.min(n.length,t.length);r<e;++r){var u=t[r],s=n[r];if(!s.isCompatible(u)){n.length=r;break}s.reset(u,i.x,i.y)}t.length<n.length&&(n.length=t.length)},n.prototype.calcRect=function(t){var n=this.p.children;if(n.length<=0)t.x=0,t.y=0,t.width=0,t.height=0;else{var i=this.Sr;n[0].getBoundsLocal(!1,t);for(var r=1,e=n.length;r<e;++r)n[r].getBoundsLocal(!1,i),t.enlarge(i)}return t},n.prototype.onChange=function(t,n){var i=this.p,r=this.j,e=i.transform.pivot;this.Ir(i.children,this.jr,r.x,r.y,e.x,e.y,t,n),i.onSizeChange()},n.prototype.Ir=function(t,n,i,r,e,u,s,h){for(var o=0,a=Math.min(n.length,t.length);o<a;++o){var c=t[o];if(!(f=n[o]).isCompatible(c)){n.length=o;break}f.update(c,i,r,e,u)}for(o=n.length,a=t.length;o<a;++o){var f;c=t[o],(f=this.newLayout(c,s,h)).update(c,i,r,e,u),n.push(f)}n.length!==t.length&&(n.length=t.length)},n.prototype.newLayout=function(t,n,i){return t.layout||new Er(t,n,i)},n}(),Sr=function(){function n(n,i,r,e,u){this.p=n,this._x=i,this._y=r,this.Cr=new t.Point(e,u)}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"base",{get:function(){return this.Cr},enumerable:!1,configurable:!0}),n.prototype.init=function(){return this.Cr.copyFrom(this),this.onChange(),this},n.prototype.clone=function(){var t=this.Cr;return new n(this.p,this._x,this._y,t.x,t.y)},n.prototype.set=function(t,n){var i=!1;return null!=t&&this._x!==t&&(this._x=t,i=!0),null!=n&&this._y!==n&&(this._y=n,i=!0),i&&this.onChange(),this},n.prototype.copyFrom=function(t){return t instanceof n&&this.Cr.copyFrom(t.base),this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.onChange()),this},n.prototype.copyTo=function(t){return t instanceof n&&this.Cr.copyTo(t.base),t.set(this._x,this._y),t},n.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},n.prototype.fit=function(){return this},n.prototype.onChange=function(){var t=this.Cr;this.p.transform.scale.set(this._x/t.x,this._y/t.y)},n}(),Tr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),jr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return Ht.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return s.NONE},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i,r,e,u,s){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!1,color:16777215,alpha:1,width:1,align:0,side:Ht.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),Nr=function(t){function n(n,i,r){var e=t.call(this,r)||this;e.Ar=n,e.Rr=i;var u=e.newData();return e.data=u,e.tag=u,e.size=e.newGroupSize(n,i),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e}return _(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Ar},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"depth",{get:function(){return this.Rr},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t,n){var i=J.SIZE_X,r=J.SIZE_Y;return t!==mr.VIEWER?new Mr(this,i,r,this.isGroupSizeFittable()):new Sr(this,i,r,i,r)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newData=function(){return new xt},n.prototype.newGroupFill=function(){return new Tr},n.prototype.newGroupStroke=function(){return new jr},n.prototype.newGroupText=function(){return new Ut(this,J.TEXT_VALUE,J.TEXT_COLOR,J.TEXT_ALPHA,J.TEXT_FAMILY,J.TEXT_SIZE)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof Sr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){return rt.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Dt),Ir=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED);var s=t.call(this,i,e,u)||this;return s.Lr=n,s.Rr=e,s}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Lr},enumerable:!1,configurable:!0}),n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=J.SIZE_X,r=J.SIZE_Y;return t!==mr.VIEWER&&n<=0?new Mr(this,i,r,this.isGroupSizeFittable()):new Sr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Lr,this.Ar,this.Rr,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=n.addPiece(this.Lr),i},n.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid)},n.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid)},n}(Nr),Cr=function(){function t(t){this.yr=t}return t.prototype.find=function(t){return this.getUuidToShape().get(t)},t.prototype.getUuidToShape=function(){var t=this.kr;return null==t&&(t=this.newUuidToShape(),this.kr=t),t},t.prototype.newUuidToShape=function(){var t=new Map;return this.fillUuidToShape(this.yr,t),t},t.prototype.fillUuidToShape=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];if(n.set(e.uuid,e),!(e instanceof Ir)){var u=e.children;0<u.length&&this.fillUuidToShape(u,n)}}},t}(),Ar=function(t,i){var e=n[t[0]]||n[r.NULL];if(null!=e){var u=e(t,i);if(null!=u)return u}throw new Error("Missing shape deserializers")},Rr=function(t,n){for(var i=[],r=0,e=t.length;r<e;++r)i.push(Ar(t[r],n));return 0<i.length?Promise.all(i).then((function(i){return Lr(t,i,new Cr(i),n),i})):null},Lr=function(t,n,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u],o=n[u],a=i[h[0]];a&&a(h,o,r,e),Lr(h[20],o.children,r,e)}},yr=function(t,n,i,r){this.name=t,this.width=n,this.height=i,this.layer=r},kr=function(){function t(){this.V=new Map}return t.prototype.add=function(t,n,i,r,e,u){return this.V.set(t,{type:n,x:i,y:r,normal:this.toNormal(i,r,e,u)}),!0},t.prototype.toNormal=function(t,n,i,r){if(null!=i&&null!=r)return{x:i,y:r};var e=t*t+n*n;if(1e-5<e){var u=1/Math.sqrt(e);return{x:t*u,y:n*u}}return{x:0,y:0}},t.prototype.remove=function(t){var n=this.V,i=n.get(t);return null!=i?(n.delete(t),i):null},t.prototype.size=function(){return this.V.size},t.prototype.get=function(t,n){return this.V.get(n)||null},t.prototype.each=function(t,n){return this.V.forEach(n),this},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.clear=function(){var t=this.V;return 0<t.size&&(t.clear(),!0)},t}(),xr={TAIL:1,HEAD:2,ALL:3},Br=function(){function t(){}return t.set=function(t,n){var i=this.Br;null==i&&(i=new Map,this.Br=i),i.set(t,n)},t.get=function(t){var n;return(null===(n=this.Br)||void 0===n?void 0:n.get(t))||this.getDefault()},t.getDefault=function(){var t=this._r;return null==t&&(t=this.newDefault(),this._r=t),t},t.newDefault=function(){var t=new kr,n=1/Math.sqrt(2);return t.add("TOP",xr.ALL,0,-.5,0,-1),t.add("LEFT",xr.ALL,-.5,0,-1,0),t.add("RIGHT",xr.ALL,.5,0,1,0),t.add("BOTTOM",xr.ALL,0,.5,0,1),t.add("CENTER",xr.ALL,0,0,0,0),t.add("TOP_LEFT",xr.ALL,-.5,-.5,-n,-n),t.add("TOP_RIGHT",xr.ALL,.5,-.5,n,-n),t.add("BOTTOM_LEFT",xr.ALL,-.5,.5,-n,n),t.add("BOTTOM_RIGHT",xr.ALL,.5,.5,n,n),t},t}(),_r=function(){function t(t){this.p=t,this.Pr=null,this.Ur=null}return Object.defineProperty(t.prototype,"shape",{get:function(){return this.Pr},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this.Ur},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.set(t.shape,t.edge)},t.prototype.set=function(t,n){var i=!1;return void 0!==t&&this.Pr!==t&&(this.Pr=t,i=!0),void 0!==n&&this.Ur!==n&&(this.Ur=n,i=!0),i&&this.p.onAcceptorChange(),this},t}(),Pr=function(){function n(n,i){var r=this;this.p=n,this.Z=i,this.Fr=new _r(this),this.J=new t.ObservablePoint((function(){r.onLocalChange()}),void 0),this.Gr=0,this.Hr=0,this.zr=new t.ObservablePoint((function(){r.onNormalChange()}),void 0),this.Vr=0,this.Wr=0,this.Xr=0,this.Kr=0,this.Yr=!1,this.Jr=!1,this.Zr=!1,this.qr=!1}return n.prototype.lock=function(){this.Kr+=1,1===this.Kr&&(this.Yr=!1,this.Jr=!1,this.Zr=!1,this.qr=!1)},n.prototype.unlock=function(){if(this.Kr-=1,0===this.Kr){var t=!1;this.Jr&&(this.Gr+=1,this.Hr=this.Gr,t=!0),this.Zr&&(this.Vr+=1,this.Wr=this.Vr,t=!0),this.qr&&(t=!0),this.Yr&&(this.Jr||(this.Gr+=1),this.Zr||(this.Vr+=1),this.doFit()&&(t=!1)),t&&this.Z()}},Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"acceptor",{get:function(){return this.Fr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"local",{get:function(){return this.J},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localId",{get:function(){return this.Hr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normal",{get:function(){return this.zr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normalId",{get:function(){return this.Wr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Xr},set:function(t){this.Xr!==t&&(this.Xr=t,this.onOtherChange())},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u,s){this.lock(),this.Fr.set(t,n);var h=this.J;null!=r&&null!=e?h.set(r,e):null!=r?h.x=r:null!=e&&(h.y=e);var o=this.zr;return null!=u&&null!=s?o.set(u,s):null!=u?o.x=u:null!=s&&(o.y=s),null!=i&&(this.margin=i),this.unlock(),this},n.prototype.copy=function(t){return this.lock(),this.Fr.copy(t.acceptor),this.J.copyFrom(t.local),this.zr.copyFrom(t.normal),this.margin=t.margin,this.unlock(),this},n.prototype.serialize=function(t){var n=this.Fr,i=n.shape,r=i?i.uuid:null,e=n.edge,u=null!=e?t.addResource(e):-1,s=this.J,h=this.zr;return t.addResource("[".concat(r,",").concat(u,",").concat(s.x,",").concat(s.y,",").concat(this.Xr,",").concat(h.x,",").concat(h.y,"]"))},n.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e));var u=null,s=e[0];null!=s&&(u=n.find(s)||null),this.lock();var h=this.Fr;h.shape=u;var o=e[1];h.edge=0<=o&&o<r.length?r[o]:null,this.J.set(e[2],e[3]);var a=e[5],c=e[6],f=this.zr;null!=a&&null!=c?f.set(a,c):f.set(1,0),this.margin=e[4]||0,this.unlock(),u&&u.connector.add(this)}},n.prototype.fit=function(t){return t&&(this.Gr+=1,this.Vr+=1),this.doFit(),this},n.prototype.doFit=function(){var t=this.Gr,n=this.Hr!==t,i=this.Vr,r=this.Wr!==i;if(n||r){this.Hr=t,this.Wr=i;var e=this.Fr,u=e.shape,s=e.edge;if(null!=u&&null!=s){var h=Br.get(u.type).get(u,s);if(h){var o=this.toAcceptorTransform(u),a=o.a,c=o.b,f=o.c,l=o.d,v=o.tx,b=o.ty;if(this.lock(),n){var d=u.size,g=u.transform.pivot,m=g.x+d.x*h.x,w=g.y+d.y*h.y;this.J.set(a*m+f*w+v,c*m+l*w+b)}if(r){var p=h.normal,O=p.x,D=p.y,E=a*O+f*D,M=c*O+l*D,S=E*E+M*M,T=this.zr;if(1e-6<S){var j=1/Math.sqrt(S);T.set(E*j,M*j)}else T.set(O,D)}var N=this.Jr||this.Zr;return this.unlock(),N}}}return!1},n.prototype.toAcceptorTransform=function(i){var r;i.updateTransform();var e=this.p,u=e.parent;return u?(e.updateTransform(),(null!==(r=n.WORK_MATRIX)&&void 0!==r?r:n.WORK_MATRIX=new t.Matrix).copyFrom(u.transform.worldTransform).invert().append(i.transform.worldTransform)):i.transform.worldTransform},n.prototype.onAcceptorChange=function(){if(0<this.Kr)return this.Jr=!1,this.Zr=!1,void(this.Yr=!0);this.fit(!0)},n.prototype.onLocalChange=function(){0<this.Kr?this.Jr=!0:(this.Gr+=1,this.Hr=this.Gr,this.Z())},n.prototype.onNormalChange=function(){0<this.Kr?this.Zr=!0:(this.Vr+=1,this.Wr=this.Vr,this.Z())},n.prototype.onOtherChange=function(){0<this.Kr?this.qr=!0:this.Z()},n.prototype.attach=function(){var t=this.Fr.shape;return t&&t.connector.add(this),this},n.prototype.detach=function(){var t=this.Fr.shape;return t&&t.connector.remove(this),this},n}(),Ur=function(){function t(t,n){var i=this;this.p=t,this.Kr=0,this.Ut=!1,this.Z=n;var r=function(){i.onChange()};this.Qr=new Pr(t,r),this.$r=new Pr(t,r)}return t.prototype.lock=function(){return this.Kr+=1,1===this.Kr&&(this.Ut=!1),this},t.prototype.unlock=function(){return this.Kr-=1,0===this.Kr&&this.Ut&&this.Z(),this},t.prototype.onChange=function(){0<this.Kr?this.Ut=!0:this.Z()},Object.defineProperty(t.prototype,"tail",{get:function(){return this.Qr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.$r},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.lock(),this.Qr.copy(t.tail),this.$r.copy(t.head),this.unlock(),this},t.prototype.fit=function(t){return this.lock(),this.Qr.fit(t),this.$r.fit(t),this.unlock(),this},t.prototype.serialize=function(t){var n=this.Qr.serialize(t),i=this.$r.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.lock(),this.Qr.deserialize(e[0],n,i),this.$r.deserialize(e[1],n,i),this.unlock()}},t.prototype.attach=function(){this.lock();var t=this.Qr,n=this.$r;return t.attach(),n.attach(),t.fit(!0),n.fit(!0),this.unlock(),this},t.prototype.detach=function(){return this.lock(),this.Qr.detach(),this.$r.detach(),this.unlock(),this},t}(),Fr=function(t,n){for(var i=0,r=t.length-1;i<=r;){var e=i+(r-i>>1),u=t[e];if(n<u)r=e-1;else{if(!(u<n))return e;i=e+1}}return-1},Gr=2*Math.PI,Hr=.5*Math.PI,zr=function(t,n,i,r){return t*i+n*r},Vr=function(t,n){return Math.sqrt(zr(t,n,t,n))},Wr=function(t,n,i,r){return t*r-n*i},Xr=function(t,n,i,r,e,u,s,h,o,a){var c=a.center;c[0]=t,c[1]=n;var f=a.axis1;f[0]=i,f[1]=r;var l=a.axis2;l[0]=e,l[1]=u;var v=a.angle;return v[0]=s,v[1]=h,v[2]=o,a},Kr=function(t,n){var i=t.center,r=t.axis1,e=t.axis2,u=t.angle;return Xr(i[0],i[1],r[0],r[1],e[0],e[1],u[0],u[1],u[2],n)},Yr=function(t,n){for(var i=t.length,r=0;r<i;++r)n[r]=t[r];return n.length!==i&&(n.length=i),n},Jr=function(){function t(){}return t.set=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){for(var d=Math.max(Math.abs(n-i),Math.abs(s-h)),g=f?Math.max(1,Math.round(c*(d/Hr))):c,m=l?g+1:g,w=0;w<m;++w){var p=w/g,O=1-p,D=p,E=O*n+D*i,M=Math.cos(E),S=Math.sin(E),T=t[0]+M*r[0]+S*e[0],j=t[1]+M*r[1]+S*e[1],N=O*s+D*h,I=Math.cos(N),C=Math.sin(N),A=u[0]+I*o[0]+C*a[0],R=u[1]+I*o[1]+C*a[1],L=Hr*p,y=Math.cos(L),k=Math.sin(L),x=y*y,B=k*k,_=x*T+B*A,P=x*j+B*R;v[++b]=_,v[++b]=P}return b},t.interpolate=function(t,n,i,r,e,u,s,h){var o=h.values,a=h.segments;if(t<=2)return Yr(n,o),Yr(i,a),h;var c=this.WORK_P0||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},f=this.WORK_P1||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},l=this.WORK_P2||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]};this.WORK_P0=c,this.WORK_P1=f,this.WORK_P2=l;var v=-1,b=-1;if(e){r(0,t,n,c),Kr(c,f);for(var d=1;d<t;++d){if(r(d,t,n,l),0<=Fr(i,d)){var g=d-1<<1;o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1}else v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v);var m=f;f=l,l=m}0<=Fr(i,0)?(g=t-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a.unshift(0),b+=1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v)}else{r(1,t,n,c),0<=Fr(i,1)?(o[++v]=n[0],o[++v]=n[1],a[++b]=1):v=this.set(c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v),Kr(c,f),d=2;for(var w=t-1;d<w;++d)r(d,t,n,l),0<=Fr(i,d)?(g=d-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v),m=f,f=l,l=m;0<=Fr(i,t-1)?(g=t-2<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,u,s,!0,o,v)}return v+=1,o.length!==v&&(o.length=v),b+=1,a.length!==b&&(a.length=b),h},t.toCircle=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=a-h,b=c-o,d=f-a,g=l-c,m=h+.5*v,w=o+.5*b,p=a+.5*d,O=c+.5*g,D=-b,E=+v,M=-g,S=+d,T=Wr(D,E,M,S);if(Math.abs(T)<.001){if(0<=zr(v,b,d,g)||n<=2){var j=.01,N=Math.sin(j),I=Vr(v,b),C=Vr(d,g);return Xr(a,c,0,0,d/N,g/N,-j*I/C,0,j,r)}T=.001}var A=(S*(p-m)+M*(w-O))/T,R=m+A*D,L=w+A*E,y=a-R,k=c-L,x=-k,B=+y,_=f-R,P=l-L,U=Math.atan2(zr(x,B,_,P),zr(y,k,_,P)),F=h-R,G=o-L,H=Math.atan2(zr(x,B,F,G),zr(y,k,F,G));return 0<H*U&&(Math.abs(H)<Math.abs(U)&&(0<U?U-=Gr:U+=Gr),Math.abs(U)<Math.abs(H)&&(0<H?H-=Gr:H+=Gr)),Xr(R,L,y,k,x,B,H,0,U,r)},t.toEllipse=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=h-a,b=o-c,d=f-a,g=l-c;if(n<=2){var m=.01,w=Math.sin(m);return Xr(a,c,0,0,d/w,g/w,-m,0,m,r)}for(var p=Vr(v,b),O=Vr(d,g),D=zr(v,b,d,g)/(p*O),E=Math.acos(D),M=.5*E,S=.25*E,T=0,j=0,N=0,I=0,C=Math.max(p,O),A=Math.min(p,O),R=0;R<16;++R){var L=.5*M,y=E-L;T=C*Math.sin(L),j=C*Math.cos(L),N=A*Math.sin(y),1<(1-(I=A*Math.cos(y))/j)*(1-I/j)+N*N/(T*T)?M+=S:M-=S,S*=.5}var k=Math.asin(Math.min(N/T,1));if(p<O){var x=d/O,B=g/O,_=void 0,P=void 0;return 0<Wr(v,b,d,g)?(_=+B,P=-x):(_=-B,P=+x),Xr(z=a-(G=(U=-j*j/O)*x+(F=-j*T/O)*_),V=c-(H=U*B+F*P),G,H,f-z,l-V,-k,0,Hr,r)}var U,F,G,H,z,V,W=v/p,X=b/p;return _=void 0,P=void 0,Wr(v,b,d,g)<0?(_=+X,P=-W):(_=-X,P=+W),Xr(z=a-(G=(U=-j*j/p)*W+(F=-j*T/p)*_),V=c-(H=U*X+F*P),G,H,-(h-z),-(o-V),-Hr,0,k,r)},t.toHybrid=function(n,i,r,e){var u=t.toCircle(n,i,r,e),s=u.angle[0],h=u.angle[2],o=Math.min(s,h),a=Math.max(s,h);return o<-Hr||Hr<a?t.toEllipse(n,i,r,e):u},t}(),Zr=function(t,n,i,r,e){return Jr.interpolate(t,n,i,Jr.toHybrid,!!(r&G.CLOSED),J.CURVE_SEGMENT_COUNT,!0,e),e.length=e.values.length>>1,e.style=r,e},qr=function(t,n){if(2<=t.length){for(var i=t[0],r=t[1],e=i,u=r,s=2,h=t.length;s<h;s+=2){var o=t[s],a=t[s+1];i=Math.min(i,o),r=Math.min(r,a),e=Math.max(e,o),u=Math.max(u,a)}n[0]=i,n[1]=r,n[2]=e,n[3]=u}else n[0]=0,n[1]=0,n[2]=0,n[3]=0;return n},Qr=function(){function n(n){var i=this;this.p=n,this.Kr=0,this.te=!1,this.ne=!1,this.ie=!1,this.Nt=Z.NONE,this.j=new t.ObservablePoint((function(){i.onSizeChange()}),void 0,.15*J.SIZE_X,.15*J.SIZE_Y),this.C=this.newFill(),this.re=0}return n.prototype.newFill=function(){return new q(this,!0,J.FILL_COLOR,1)},n.prototype.lock=function(){return this.Kr+=1,1===this.Kr&&(this.te=!1,this.ne=!1,this.ie=!1),this},n.prototype.unlock=function(){return this.Kr-=1,0===this.Kr&&(this.te?this.onTypeChange():this.ne?this.onSizeChange():this.ie&&this.onFillChange(),this.te=!1,this.ne=!1,this.ie=!1),this},Object.defineProperty(n.prototype,"type",{get:function(){return this.Nt},set:function(t){this.Nt!==t&&(this.Nt=t,this.onTypeChange())},enumerable:!1,configurable:!0}),n.prototype.onTypeChange=function(){0<this.Kr?this.te=!0:this.p.onTypeChange()},Object.defineProperty(n.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),n.prototype.onSizeChange=function(){0<this.Kr?this.ne=!0:this.p.onSizeChange()},Object.defineProperty(n.prototype,"transform",{get:function(){return this.updateTransform()},enumerable:!1,configurable:!0}),n.prototype.updateTransform=function(){var n=this.I;null==n&&(n=new t.Matrix,this.I=n);var i=this.p.parent,r=i.id;if(this.re!==r){this.re=r;var e=i.formatted;2<=e.length?this.toTransform(e.values,n):n.identity()}return n},n.prototype.toTransformMatrix=function(t,n,i,r,e){var u=t-i,s=n-r,h=u*u+s*s;if(1e-5<h){var o=1/Math.sqrt(h),a=u*o,c=s*o;e.set(c,-a,-a,-c,t,n)}else e.set(1,0,0,1,t,n);return e},Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),n.prototype.onFillChange=function(){0<this.Kr?this.ie=!0:this.p.onFillChange()},n.prototype.updateUploaded=function(){this.onFillChange()},n.prototype.copy=function(t){var n=t.size;return this.set(t.type,n.x,n.y),this},n.prototype.set=function(t,n,i){return this.lock(),null!=t&&(this.type=t),this.size.set(n,i),this.unlock(),this},n.prototype.serialize=function(t){var n=this.j,i=this.C.serialize(t);return t.addResource("[".concat(this.Nt,",").concat(n.x,",").concat(n.y,",").concat(i,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.type=r[0],this.j.set(r[1],r[2]),this.C.deserialize(r[3],n),this.unlock()}},n}(),$r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){var i=t.length;return 4<=i?this.toTransformMatrix(t[i-2],t[i-1],t[i-4],t[i-3],n):(n.identity(),n)},n}(Qr),te=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){return 4<=t.length?this.toTransformMatrix(t[0],t[1],t[2],t[3],n):(n.identity(),n)},n}(Qr),ne=function(){function t(t){this.p=t,this.Kr=0,this.te=!1,this.ne=!1,this.ie=!1,this.$r=new $r(this),this.Qr=new te(this)}return t.prototype.lock=function(){return this.Kr+=1,1===this.Kr&&(this.te=!1,this.ne=!1,this.ie=!1),this},t.prototype.unlock=function(){return this.Kr-=1,0===this.Kr&&(this.te?this.onTypeChange():this.ne?this.onSizeChange():this.ie&&this.onFillChange(),this.te=!1,this.ne=!1,this.ie=!1),this},Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.$r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.Qr},enumerable:!1,configurable:!0}),t.prototype.onTypeChange=function(){0<this.Kr?this.te=!0:this.p.onMarkerTypeChange()},t.prototype.onSizeChange=function(){0<this.Kr?this.ne=!0:this.p.onMarkerSizeChange()},t.prototype.onFillChange=function(){0<this.Kr?this.ie=!0:this.p.onMarkerFillChange()},t.prototype.copy=function(t){return this.lock(),this.$r.copy(t.head),this.Qr.copy(t.tail),this.unlock(),this},t.prototype.serialize=function(t){var n=this.$r.serialize(t),i=this.Qr.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.$r.deserialize(r[0],n),this.Qr.deserialize(r[1],n),this.unlock()}},t}(),ie=function(){function n(n){this.p=n,this.ee=0,this.L=[],this.k=[];var i=n.size,r=i.x,e=i.y;this.ue=new t.Point(r,e),this.se=new t.Point(r,e),this.R=0,this.B=G.NONE,this.he=-1}return Object.defineProperty(n.prototype,"length",{get:function(){return this.L.length>>1},enumerable:!1,configurable:!0}),n.prototype.toFitted=function(){this.oe=void 0;var t=this.p.size;this.se.copyFrom(t),this.ue.copyFrom(t)},n.prototype.fit=function(){var t=this.se,n=this.p.size,i=n.x,r=n.y,e=1e-5;if(e<Math.abs(i-t.x)||e<Math.abs(r-t.y)){t.set(i,r);var u=this.ue,s=e<Math.abs(u.x),h=e<Math.abs(u.y);if(s||h){var o=s?i/u.x:1,a=h?r/u.y:1,c=this.L,f=this.oe;if(null==f){f=[],this.oe=f;for(var l=0,v=c.length;l<v;l+=2){var b=c[l],d=c[l+1];c[l]=b*o,c[l+1]=d*a,f.push(b,d)}}else for(l=0,v=c.length;l<v;l+=2)c[l]=f[l]*o,c[l+1]=f[l+1]*a;if(this.R===this.he){var g=this.ae;if(null!=g){var m=g.values,w=this.ce;if(null==w)for(w=[],this.ce=w,l=0,v=m.length;l<v;l+=2)b=m[l],d=m[l+1],m[l]=b*o,m[l+1]=d*a,w.push(b,d);else for(l=0,v=m.length;l<v;l+=2)m[l]=w[l]*o,m[l+1]=w[l+1]*a;var p=g.boundary,O=this.fe;if(null==O)for(O=[0,0,0,0],this.fe=O,l=0,v=p.length;l<v;l+=2)b=p[l],d=p[l+1],p[l]=b*o,p[l+1]=d*a,O[l]=b,O[l+1]=d;else for(l=0,v=p.length;l<v;l+=2)p[l]=O[l]*o,p[l+1]=O[l+1]*a;this.he+=1}}this.R+=1}}},Object.defineProperty(n.prototype,"id",{get:function(){return this.fit(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.fit(),this.L},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.k},set:function(t){this.set(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=this.newMarker(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){return this.A},n.prototype.newMarker=function(){return new ne(this)},n.prototype.onMarkerTypeChange=function(){var t=this.p;t.uploaded=void 0,t.toDirty()},n.prototype.onMarkerSizeChange=function(){this.p.updateUploaded()},n.prototype.onMarkerFillChange=function(){this.p.updateUploaded()},Object.defineProperty(n.prototype,"formatter",{get:function(){return this.le||null},set:function(t){this.le!==t&&(this.he=-1,this.le=t,this.toDirty(!0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){this.fit();var t=this.R,n=this.ae;if(this.he!==t){this.he=t;var i=this.B,r=this.le;if(null==r&&i&G.CURVE&&(r=Zr),null!=r){null==n&&(n={length:0,values:[],segments:[],boundary:[0,0,0,0],style:G.NONE});var e=this.oe,u=this.k;if(null!=e){r(e.length>>1,e,u,i,n),qr(n.values,n.boundary);var s=n.values,h=s.splice(0);this.ce=h;var o=n.boundary,a=[o[0],o[1],o[2],o[3]];this.fe=a,this.toScaled(s,h,o,a)}else{var c=this.L;r(c.length>>1,c,u,i,n),qr(n.values,n.boundary),this.ce=void 0,this.fe=void 0}}else n=void 0,this.ce=void 0,this.fe=void 0;this.ae=n}return n||this},enumerable:!1,configurable:!0}),n.prototype.toScaled=function(t,n,i,r){var e=this.se,u=this.ue,s=1e-5,h=s<Math.abs(u.x),o=s<Math.abs(u.y);if(h||o){for(var a=h?e.x/u.x:1,c=o?e.y/u.y:1,f=0,l=n.length;f<l;f+=2)t[f]=n[f]*a,t[f+1]=n[f+1]*c;for(f=0,l=r.length;f<l;f+=2)i[f]=r[f]*a,i[f+1]=r[f+1]*c}},n.prototype.copy=function(t){this.set(t.values,t.segments,t.style);var n=t.getMarker();return n&&this.marker.copy(n),this},n.prototype.set=function(t,n,i){var r=!1,e=!1,u=this.B,s=u&G.FORMATTER_MASK,h=this.le;if(null!=t){var o=this.L,a=this.ee,c=t.length,f=Math.min(c,a);if(this.toFitted(),o!==t){for(var l=0;l<f;++l)o[l]=t[l];for(l=f;l<c;++l)o.push(t[l]);a!==c?(o.length=c,this.ee=c,r=!0):null!=h||s?r=!0:e=!0}else a!==c?(this.ee=c,r=!0):null!=h||s?r=!0:e=!0}if(null!=n){var v=this.k;if(v!==n){var b=n.length;for(f=Math.min(v.length,b),l=0;l<f;++l)v[l]=n[l];for(l=f;l<b;++l)v.push(n[l]);v.length!==b&&(v.length=b)}null!=h||s?r=!0:e=!0}return null!=i&&u!==i&&(s!==(i&G.FORMATTER_MASK)||(null!=h||s)&&(u&G.CLOSED)!=(i&G.CLOSED)?r=!0:e=!0,this.B=i),(e||r)&&this.toDirty(r),this},n.prototype.toDirty=function(t){if(t){this.R+=1;var n=this.p,i=n.uploaded;i?i.isCompatible(n)?n.updateUploaded():(n.uploaded=void 0,n.toDirty()):n.updateUploaded()}else this.R+=1,this.p.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){var n=JSON.stringify(this.L),i=JSON.stringify(this.k),r=this.B,e=-1,u=this.A;return u&&(e=u.serialize(t)),t.addResource("[".concat(n,",").concat(i,",").concat(r,",").concat(e,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.set(r[0],r[1],r[2]);var e=r[3];null!=e&&0<=e&&this.marker.deserialize(e,n)}},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o){var a=this.formatted,c=a.length;if(2<=c){var f=a.values,l=a.segments,v=a.style,b=0,d=c;if(s){var g=n.WORK_RANGE;s(t,i,u,f,g),b=g[0],d=g[1]}for(var m=b,w=Math.min(d,c-1);m<w;++m){var p;if(Fr(l,m+1)<0&&h(t,i,f[0+(p=m<<1)],f[p+1],f[p+2],f[p+3],m,u,o))return!0}if(2<c&&c<=d&&v&G.CLOSED&&Fr(l,0)<0&&h(t,i,f[0+(p=(m=c-1)<<1)],f[p+1],f[0],f[1],m,u,o))return!0}return!1},n.WORK_RANGE=[0,0],n}(),re=function(){function t(t,n){this.p=t,this.R=0,this.L=[],this.Kr=0,this.Ut=!1,this.Z=n}return t.prototype.lock=function(){this.Kr+=1,1===this.Kr&&(this.Ut=!1)},t.prototype.unlock=function(){this.Kr-=1,0===this.Kr&&(this.Ut&&this.onChange(),this.Ut=!1)},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this.L},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t){if(null!=t){if(this.R+=1,this.L!==t){for(var n=t.length,i=this.L,r=0;r<n;++r)i[r]=t[r];i.length=n}this.onChange()}return this},t.prototype.copy=function(t){return this.set(t.values)},t.prototype.serialize=function(t){return t.addResource(JSON.stringify(this.L))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.set(e)}},t.prototype.onChange=function(){0<this.Kr?this.Ut=!0:this.Z()},t}(),ee=function(t){function n(n){void 0===n&&(n=r.CONNECTOR_LINE);var i=t.call(this,n)||this;i.ve=0,i.be=0,i.de=0,i.ge=0,i.me=0,i.we=0,i.pe=0,i.Kr=0,i.Ut=!1;var e=.5*J.SIZE_X,u=.5*J.SIZE_Y;i.gt=new ie(i).set([-e,-u,+e,+u]);var s=function(){i.onChange()};return i.Ur=new Ur(i,s),i.Oe=new re(i,s),i}return _(n,t),n.prototype.lock=function(){this.Kr+=1,1===this.Kr&&(this.Ut=!1)},n.prototype.unlock=function(){this.Kr-=1,0===this.Kr&&(this.Ut&&this.onChange(),this.Ut=!1)},Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edge",{get:function(){return this.Ur},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this.Oe},enumerable:!1,configurable:!0}),n.prototype.onAttach=function(){t.prototype.onAttach.call(this),this.Ur.attach()},n.prototype.onDetach=function(){this.Ur.detach(),t.prototype.onDetach.call(this)},n.prototype.onChange=function(){var t;if(0<this.Kr)this.Ut=!0;else{var i=this.Ur,r=i.tail,e=r.localId,u=r.normalId,s=r.margin,h=i.head,o=h.localId,a=h.normalId,c=h.margin,f=this.Oe,l=f.id;if(this.ve!==e||this.be!==u||this.de!==s||this.ge!==o||this.me!==a||this.we!==c||this.pe!==l){this.ve=e,this.be=u,this.de=s,this.ge=o,this.me=a,this.we=c,this.pe;var v=this.transform,b=v.position,d=b.x,g=b.y,m=this.gt,w=m.values;this.fillPoints(r,s,h,c,f,d,g,w);var p=null!==(t=n.WORK_BOUNDARY)&&void 0!==t?t:n.WORK_BOUNDARY=[0,0,0,0];qr(w,p);for(var O=.5*(p[2]+p[0]),D=.5*(p[3]+p[1]),E=p[2]-p[0],M=p[3]-p[1],S=0,T=w.length;S<T;S+=2)w[S+0]-=O,w[S+1]-=D;this.disallowUploadedUpdate(),b.set(d+O,g+D),v.scale.set(1,1),v.rotation=0,v.skew.set(0,0),this.size.set(E,M),m.toFitted(),m.set(w),this.allowUploadedUpdate()}}},n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=1e-6,a=t.local,c=a.x-u,f=a.y-s,l=i.local,v=l.x-u,b=l.y-s,d=e.values,g=d.length;if(h[0]=c,h[1]=f,0<g)for(var m=.5*(v+c),w=.5*(b+f),p=v-c,O=b-f,D=Math.atan2(O,p),E=Math.cos(D),M=Math.sin(D),S=Math.sqrt(p*p+O*O),T=0;T<g;T+=2){var j=d[T+0],N=d[T+1];h[T+2]=m+(E*j-M*N)*S,h[T+3]=w+(E*N+M*j)*S}if(h[2+g]=v,h[3+g]=b,0!==n&&o<(p=h[2]-c)*p+(O=h[3]-f)*O){var I=n/Math.sqrt(p*p+O*O);h[0]=c+p*I,h[1]=f+O*I}0!==r&&o<(p=h[0+g]-v)*p+(O=h[1+g]-b)*O&&(I=r/Math.sqrt(p*p+O*O),h[2+g]=v+p*I,h[3+g]=b+O*I),h.length=g+4},n.prototype.copy=function(i,r){return void 0===r&&(r=ht.ALL),t.prototype.copy.call(this,i,r),i instanceof n&&(this.Ur.copy(i.edge),this.Oe.copy(i.body)),this},n.prototype.clone=function(){return new(0,this.constructor)(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.Ur.serialize(n),e=this.Oe.serialize(n),u=this.gt.serialize(n);return i[15]=n.addResource("[".concat(r,",").concat(u,",").concat(e,"]")),i},n}(Kt),ue=function(){function t(){}return t.isConnector=function(t){return t instanceof ee},t.newMapping=function(n,i,r){var e;null==r&&(r=null!==(e=t.De)&&void 0!==e?e:t.De=new Map).clear();for(var u=0,s=n.length;u<s;++u){var h=n[u],o=i[u];r.set(h,o),this.newMapping(h.children,o.children,r)}return r},t.moveAll=function(t,n,i,r,e){for(var u=0,s=i.length;u<s;++u){var h=i[u],o=r[u];if(this.isConnector(h)&&this.isConnector(o)){var a=h.edge,c=o.edge,f=a.head,l=f.acceptor.shape;if(l){null==e&&(e=this.newMapping(t,n));var v=e.get(l);if(v){var b=c.head;b.detach(),b.set(v),b.attach(),v.connector.remove(f)}}var d=a.tail,g=d.acceptor.shape;if(g){null==e&&(e=this.newMapping(t,n));var m=e.get(g);if(m){var w=c.tail;w.detach(),w.set(m),w.attach(),m.connector.remove(d)}}}e=this.moveAll(t,n,h.children,o.children,e)}return e},t.move=function(t,n){var i=t.children,r=n.children;this.moveAll(i,r,i,r)},t}(),se=function(){function n(n,i,r,e,u){this.id=n,this.ref=0;var s=u.resolution;this.frame=new t.Rectangle(0,0,i*s,r*s),this.texture=new t.Texture(u,new t.Rectangle(0,0,1,1)),this.width=i,this.height=r,this.strokeWidth=e}return n.prototype.applyFrame=function(){var t=1/this.texture.baseTexture.resolution;this.texture.frame.x=this.frame.x*t,this.texture.frame.y=this.frame.y*t,this.texture.frame.width=this.width,this.texture.frame.height=this.height,this.texture.updateUvs(),this.texture.emit("update",this)},n.prototype.destroy=function(){this.texture.destroy()},n}(),he=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){},n}(se),oe=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.save(),t.fillStyle="#ffffff",t.fillRect(n.x-1,n.y-1,n.width+2,n.height+2),t.restore()},n}(se),ae=function(){function n(n){var i=this.rr=document.createElement("canvas");i.width=i.height=256;var r=this.Ee=t.BaseTexture.from(i,{mipmap:t.MIPMAP_MODES.OFF,resolution:n});this.Me={},this.Se=[],this.Te={empty:new he("empty",10,10,0,r),white:new oe("white",10,10,0,r)},this.bn=!0}return n.prototype.updateFrames=function(t,n){for(var i=4,r=4,e=0,u=0,s=n.length;u<s;++u){var h=n[u];t<i+h.frame.width+4&&(i=4,r+=e+4,e=0),h.frame.x=0|i,h.frame.y=0|r,i+=h.frame.width+4,e=Math.max(e,h.frame.height)}for(var o=r+e+4,a=256;a<o;)a<<=1;return Math.min(4096,a)},n.prototype.renderFrames=function(t,n,i){var r=this.rr;r.width=t,r.height=n;var e=r.getContext("2d");if(null!=e)for(var u=0,s=i.length;u<s;++u)i[u].render(e)},n.prototype.applyFrames=function(t){for(var n=0,i=t.length;n<i;++n)t[n].applyFrame()},n.prototype.calcCanvasWidth=function(t){for(var n=128,i=t.length-1;0<=i;--i)for(var r=t[i],e=Math.max(r.frame.width,r.frame.height);n<e;)n<<=1;return Math.min(4096,n<<1)},n.prototype.cleanup=function(t){t.sort(n.ITEM_COMPARATOR);for(var i=t.length-1;0<=i;--i)if(0<t[i].ref)return void(t.length=i+1);t.length=0},n.prototype.begin=function(){for(var t=this.Se,n=0,i=t.length;n<i;++n)t[n].ref=0;this.bn=!1},n.prototype.end=function(){for(var t=this.Me,n=this.Se,i=0,r=n.length;i<r;++i){var e=n[i];e.ref<=0&&(e.id in this.Te||e.destroy(),delete t[e.id],this.bn=!0)}},n.prototype.repack=function(t){if(!0===t||this.bn){this.bn=!1;var n=this.Se;this.cleanup(n);var i=this.calcCanvasWidth(n),r=this.updateFrames(i,n);this.renderFrames(i,r,n),this.Ee.setRealSize(i,r),this.applyFrames(n)}},n.prototype.get=function(t){var n=this.Me[t];if(null!=n)return n.ref+=1,n;var i=this.Te[t];return null!=i?(this.set(t,i),i):null},n.prototype.set=function(t,n){var i=this.Me[t];return n.ref+=1,this.Me[t]=n,this.Se.push(n),this.bn=!0,i},n.prototype.toDirty=function(){this.bn=!0},n.prototype.getDefaultTexture=function(){return this.get("white").texture},n.prototype.getBaseTexture=function(){return this.Ee},n.prototype.release=function(t){var n=this.Me,i=n[t];null!=i&&(i.ref-=1,i.ref<=0&&(i.id in this.Te||i.destroy(),delete n[t],this.bn=!0))},n.ITEM_COMPARATOR=function(t,n){return t.ref<=0?n.ref<=0?0:1:n.ref<=0||t.frame.height<n.frame.height?-1:n.frame.height<t.frame.height?1:t.frame.width-n.frame.width},n}(),ce=function(t){function n(n,i){var r=t.call(this,n.id,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.canvas=n.canvas,r}return _(n,t),n.prototype.render=function(t){var n=this.canvas;if(null!=n){var i=this.frame;t.drawImage(n,i.x,i.y,i.width,i.height)}},n}(se),fe="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",le=function(t,n){this.x=t,this.y=n},ve=function(t,n,i,r,e){this.ref=1,this.life=10,this.character=t,this.x=0,this.y=0,this.width=i,this.height=r,this.advance=n,this.origin=new le(0,0),this.type=e},be={RESERVED:1,NON_BREAKING:2,SPACE:4,SPACE_R:5,SPACE_NB:6,SPACE_RNB:7,LETTER:8,LETTER_R:9,LETTER_NB:10,LETTER_RNB:11},de=function(){function t(){var t=this;this.je=null,this.Ne=null,this.Ie=null,this.Ce=NaN,this.Ae=NaN,this.Re=NaN,this.Le=NaN,this.ye=null,this.ke=null;var n=this.rr=document.createElement("canvas");n.width=64,n.height=64,this.xe=function(t){t.preventDefault()},this.Be=function(){t.restore()},this._e=function(){t.destroy()},n.addEventListener("webglcontextlost",this.xe,!1),n.addEventListener("webglcontextrestored",this.Be,!1),window.addEventListener("unload",this._e,!1)}return t.prototype.init=function(){var t=this.rr;if(null!=t&&(null==this.je||this.je.isContextLost())){var n={alpha:!0,antialias:!1,depth:!1,stencil:!1,premultipliedAlpha:!1},i=t.getContext("webgl",n)||t.getContext("experimental-webgl",n);this.je=i,null!=i&&(i.clearColor(1,1,1,0),this.makeVertexBuffer(),this.makeUvBuffer(),this.makeShaders(),this.Ne=null)}return this},t.prototype.restore=function(){this.init()},t.prototype.getCanvas=function(){return this.rr},t.prototype.getShader=function(t,n,i){var r=i?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);return null==r||(t.shaderSource(r,n),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))?r:(console&&console.error("Failed to compile the shader: ".concat(t.getShaderInfoLog(r))),null)},t.prototype.makeShaders=function(){var t=this.je;if(null!=t&&!0!==t.isContextLost()){var n=this.getShader(t,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying mediump vec2 vTextureCoord;\nvoid main(void) {\n\tgl_Position = vec4(aVertexPosition, 0.0, 1.0);\n\tvTextureCoord = aTextureCoord;\n}\n",!1);if(null!=n){var i=this.getShader(t,"\nprecision mediump float;\n\nvarying mediump vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec2 uSize;\n\nfloat calcDistance( float x, float y, float dx, float dy ) {\n\tfloat xd = x + dx;\n\tfloat yd = y + dy;\n\tfloat u = xd / uSize.x;\n\tfloat v = yd / uSize.y;\n\tfloat ul = (xd - 1.0) / uSize.x;\n\tfloat vt = (yd - 1.0) / uSize.y;\n\n\tfloat m = texture2D(uSampler, vec2(u , v )).a;\n\tfloat l = texture2D(uSampler, vec2(ul, v )).a;\n\tfloat t = texture2D(uSampler, vec2(u , vt)).a;\n\tfloat ddx = -(0.5 - m) / (l - m);\n\tfloat ddy = -(0.5 - m) / (t - m);\n\tbool bl = min(l,m) < 0.5 && 0.5 <= max(l,m);\n\tbool bt = min(t,m) < 0.5 && 0.5 <= max(t,m);\n\treturn (\n\t\tbl ?\n\t\t(bt ?\n\t\t\tlength(vec2(dx + ddx * 0.5, dy + ddy * 0.5)) :\n\t\t\tlength(vec2(dx + ddx, dy))\n\t\t) :\n\t\t(bt ?\n\t\t\tlength(vec2(dx, dy + ddy)) :\n\t\t\t100.0\n\t\t)\n\t);\n}\n\nfloat calcDistancesY( float x, float y, float dx ) {\n\tfloat d = 100.0;\n\tfor( float dy=-6.0; dy<6.5; dy++ ) {\n\t\td = min( d, calcDistance( x, y, dx, dy ) );\n\t}\n\treturn d;\n}\n\nfloat calcDistances( float x, float y ) {\n\tfloat d = 100.0;\n\tfor( float dx=-6.0; dx<6.5; dx++ ) {\n\t\td = min( d, calcDistancesY( x, y, dx ) );\n\t}\n\treturn d;\n}\n\nvoid main(void) {\n\tfloat t = texture2D(uSampler, vTextureCoord).a;\n\tfloat x = vTextureCoord.x * uSize.x;\n\tfloat y = vTextureCoord.y * uSize.y;\n\tfloat d = min( 6.0, calcDistances( x, y ) ) / 12.0;\n\td = clamp( mix( 0.5 - d, 0.5 + d, step( 0.5, t ) ), 0.0, 1.0 );\n\tgl_FragColor = vec4(1.0, 1.0, 1.0, d);\n}\n",!0);if(null!=i){var r=this.Ie=t.createProgram();if(null!=r)return t.attachShader(r,n),t.attachShader(r,i),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)?(t.deleteShader(n),t.deleteShader(i),t.useProgram(r),this.Ce=t.getAttribLocation(r,"aVertexPosition"),this.Ae=t.getAttribLocation(r,"aTextureCoord"),this.Re=t.getUniformLocation(r,"uSampler"),this.Le=t.getUniformLocation(r,"uSize"),t.useProgram(null),r):(console&&console.error("Failed to link the program: ".concat(t.getError())),t.deleteShader(n),t.deleteShader(i),null);t.deleteShader(n),t.deleteShader(i)}else t.deleteShader(n)}}return null},t.prototype.destroyShaders=function(){var t=this.je;if(null!=t&&!0!==t.isContextLost()){var n=this.Ie;null!=n&&(this.Ie=null,t.useProgram(null),t.deleteProgram(n))}},t.prototype.updateTexture=function(t){var n=this.je,i=this.rr;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=t.width,e=t.height;i.width===r&&i.height===e||(i.width=r,i.height=e,n.viewport(0,0,r,e));var u=this.Ne;return null==u?(u=this.Ne=n.createTexture(),n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.bindTexture(n.TEXTURE_2D,null)):(n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.bindTexture(n.TEXTURE_2D,null)),u}return null},t.prototype.destroyTexture=function(){var t=this.je,n=this.Ne;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.Ne=null,t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n))},t.prototype.makeVertexBuffer=function(){var t=this.je;if(null!=t&&!0!==t.isContextLost()){var n=this.ye=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,1,1,1,-1,-1,1,-1]),t.STATIC_DRAW),n}return null},t.prototype.destroyVertexBuffer=function(){var t=this.je,n=this.ye;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.ye=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.makeUvBuffer=function(){var t=this.je;if(null!=t&&!0!==t.isContextLost()){var n=this.ke=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),t.STATIC_DRAW),n}return null},t.prototype.destroyUvBuffer=function(){var t=this.je,n=this.ke;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.ke=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.render=function(){var t=this.je,n=this.rr,i=this.Ie,r=this.ye,e=this.ke,u=this.Ne;if(null!=t&&!0!==t.isContextLost()&&null!=n&&null!=i&&null!=r&&null!=e&&null!=u){t.clear(t.COLOR_BUFFER_BIT),t.useProgram(i),t.bindBuffer(t.ARRAY_BUFFER,r);var s=this.Ce;t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,e);var h=this.Ae;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,u),t.uniform1i(this.Re,0),t.uniform2f(this.Le,n.width,n.height),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.bindTexture(t.TEXTURE_2D,null),t.bindBuffer(t.ARRAY_BUFFER,null),t.useProgram(null)}},t.prototype.read=function(t){var n=this.je,i=this.rr;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=i.width,e=i.height;t.width=r,t.height=e;var u=t.getContext("2d");null!=u&&u.drawImage(i,0,0)}},t.prototype.destroy=function(){this.destroyVertexBuffer(),this.destroyUvBuffer(),this.destroyShaders();var t=this.rr;null!=t&&(this.rr=null,t.removeEventListener("webglcontextlost",this.xe,!1),t.removeEventListener("webglcontextrestored",this.Be,!1),window.removeEventListener("unload",this._e,!1));var n=this.je;if(null!=n){this.je=null;var i=n.getExtension("WEBGL_lose_context");null!=i&&i.loseContext()}},t.getInstance=function(){return null==t.Pe&&(t.Pe=new t),t.Pe},t.Pe=null,t}(),ge=function(){function t(n){this.R="font-atlas:".concat(n),this.Ue=de.getInstance().init(),this.rr=document.createElement("canvas"),this.Fe={family:t.toFontFamily(n),size:32,italic:!1},this.Ge={},this.He=0,this.St=1,this.fn=1,this.bn=!0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.Fe},set:function(t){this.Fe.family=t.family,this.Fe.size=t.size,this.Fe.italic=t.italic},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.fn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this.rr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generator",{get:function(){return this.Ue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"characters",{get:function(){return this.Ge},enumerable:!1,configurable:!0}),t.prototype.begin=function(){this.He=0;var t=this.Ge;for(var n in t)t[n].ref=0},t.prototype.end=function(){var t=this.Ge;for(var n in t){var i=t[n];i.ref<=0&&(i.life-=1,i.life<=0&&(delete t[n],this.bn=!0))}},t.prototype.addAscii=function(){this.addChar(" "," ",be.SPACE_R),this.addChar("\t"," ",be.SPACE_R),this.addChar("...","...",be.LETTER_RNB);for(var t=0,n=fe.length;t<n;++t){var i=fe[t];this.addChar(i,i,be.LETTER_RNB)}},t.prototype.addChar=function(t,n,i){var r=this.Ge;if(!this.isIgnored(n)){var e=r[t];null!=e?(e.ref<=0&&(this.He+=1),e.ref+=1):(r[t]=new ve(n,0,1,1,i),this.He+=1,this.bn=!0)}},t.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},t.prototype.add=function(t,n){void 0===n&&(n=be.LETTER);for(var i=b.from(t);i.hasNext();){var r=i.next();this.addChar(r,r,n)}},t.prototype.get=function(t){return this.Ge[t]},t.prototype.update=function(){if(this.bn){var n=this.rr,i=this.Ue;if(null!=n&&null!=i){var r=n.getContext("2d");if(null!=r){this.bn=!1;var e=this.Fe,u=this.Ge,s=e.size+14,h=t.toPowerOf2(Math.ceil(Math.sqrt(this.He))*s);this.St=h;var o=(e.italic?"italic ":"")+e.size+"px "+e.family;r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=0,r.fillStyle="#FFFFFF";var a=s>>1,c=0,f=0;for(var l in u){var v=u[l],b=r.measureText(v.character).width,d=Math.ceil(7+b+7),g=s;h<=c+d&&(c=0,f+=s),v.x=c,v.y=f,v.width=d,v.height=g,v.advance=b,v.origin.x=c+7,v.origin.y=f+a,c+=d}var m=this.fn=f+s;for(var l in n.width=h,n.height=m,r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=4,r.fillStyle="#FFFFFF",r.clearRect(0,0,h,m),u)v=u[l],r.fillText(v.character,v.origin.x,v.origin.y);return i.updateTexture(n),i.render(),i.read(n),!0}}}return!1},Object.defineProperty(t.prototype,"length",{get:function(){return this.He},enumerable:!1,configurable:!0}),t.prototype.toJson=function(){return{width:this.St,height:this.fn,font:this.Fe,characters:this.Ge}},t.prototype.toString=function(){return JSON.stringify(this.toJson())},t.prototype.destroy=function(){null!=this.Ue&&(this.Ue=null),null!=this.rr&&(this.rr=null);var t=this.Ge;for(var n in t)delete t[n]},t.toFontFamily=function(n){return"auto"===n?t.getAutoFontFamily():n},t.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},t.getAutoFontFamily=function(){return null==t.FONT_FAMILY_AUTO&&(t.FONT_FAMILY_AUTO=Y.getInstance().get("DBase").getFontFamilly()),t.FONT_FAMILY_AUTO},t.FONT_FAMILY_AUTO=null,t}(),me=function(){function t(){this.ze={}}return t.prototype.begin=function(){var t=this.ze;for(var n in t)t[n].begin()},t.prototype.end=function(){var t=this.ze;for(var n in t){var i=t[n];0<i.length&&i.addAscii(),i.end(),i.length<=0&&(i.destroy(),delete t[n])}},t.prototype.add=function(t,n){var i=this.ze[t];if(null!=i)i.add(n);else{var r=new ge(t);r.add(n),this.ze[t]=r}},t.prototype.get=function(t){var n=this.ze[t];return null!=n?n:null},t.prototype.update=function(t){var n=this.ze,i=t.getBaseTexture();for(var r in n){var e=n[r];if(e.update()){var u=e.id,s=t.get(u);if(null!=s){var h=e.width,o=e.height,a=i.resolution;s.frame.width=h,s.frame.height=o,s.width=h/a,s.height=o/a,t.toDirty()}else t.set(u,new ce(e,i))}}},t.prototype.destroy=function(){var t=this.ze;for(var n in t)t[n].destroy();this.ze={}},t}(),we=function(t){function n(n,i){var r=t.call(this,n.src,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.image=n,r}return _(n,t),n.prototype.render=function(t){var n=this.frame,i=n.x,r=n.y,e=n.width,u=n.height,s=this.image;t.drawImage(s,i,r,e,u),t.drawImage(s,0,0,1,u,i-1,r-1,1,u+2),t.drawImage(s,0,0,e,1,i,r-1,e,1),t.drawImage(s,e-1,0,1,u,i+e,r-1,1,u+2),t.drawImage(s,0,u-1,e,1,i,r+u,e,1)},n}(se),pe=function(t,n){this.texture=t,this.indexOffset=n},Oe=function(){function t(){this.index=0,this.baseTexture=null,this.units=[]}return t.prototype.begin=function(){this.index=0,this.baseTexture=null},t.prototype.push=function(t,n){if(this.index<this.units.length){var i=this.units[this.index];i.texture=t,i.indexOffset=n}else this.units.push(new pe(t,n));this.index+=1},t.prototype.end=function(){this.units.length!==this.index&&(this.units.length=this.index)},t.prototype.destroy=function(){this.units.length=0},t}(),De=function(){function n(t,n){var i=3*t,r=i;this.vertices=new Float32Array(2*r),this.Ve=r,this.o=0,this.gn=null,this.clippings=new Float32Array(3*r),this.We=null,this.steps=new Float32Array(6*r),this.Xe=null,this.colorFills=new Float32Array(4*r),this.Ke=null,this.colorStrokes=new Float32Array(4*r),this.Ye=null,this.uvs=new Float32Array(2*r),this.wn=null;var e=r<=65535;this.indices=e?new Uint16Array(i):new Uint32Array(i),this.Je=t,this.l=0,this.indexCountRequested=0,this.pn=null,this.Ze=n,this.qe=new Oe,this.Qe=null}return n.prototype.updateVertices=function(){var t=this.gn;t&&t.update()},n.prototype.updateClippings=function(){var t=this.We;t&&t.update()},n.prototype.updateSteps=function(){var t=this.Xe;t&&t.update()},n.prototype.updateColorFills=function(){var t=this.Ke;t&&t.update()},n.prototype.updateColorStrokes=function(){var t=this.Ye;t&&t.update()},n.prototype.updateUvs=function(){var t=this.wn;t&&t.update()},n.prototype.updateIndices=function(){var t=this.pn;t&&t.update()},n.prototype.getGeometry=function(){var n=this.Qe;return null==n&&(this.gn=new t.Buffer(this.vertices,!1,!1),this.We=new t.Buffer(this.clippings,!1,!1),this.Xe=new t.Buffer(this.steps,!1,!1),this.Ke=new t.Buffer(this.colorFills,!1,!1),this.Ye=new t.Buffer(this.colorStrokes,!1,!1),this.wn=new t.Buffer(this.uvs,!1,!1),this.pn=new t.Buffer(this.indices,!1,!0),this.Qe=n=(new t.Geometry).addIndex(this.pn).addAttribute("aPosition",this.gn,2).addAttribute("aClipping",this.We,3).addAttribute("aStep",this.Xe,2).addAttribute("aAntialias",this.Xe,4).addAttribute("aColorFill",this.Ke,4).addAttribute("aColorStroke",this.Ye,4).addAttribute("aUv",this.wn,2)),n},n.prototype.upload=function(){this.Ze.geometry.bind(this.getGeometry())},n.prototype.render=function(n){var i=this.Ze;i.geometry.bind(this.getGeometry());var r=this.qe.units,e=r.length;if(0<e){for(var u=t.DRAW_MODES.TRIANGLES,s=null,h=r[0],o=0,a=3*h.indexOffset,c=0,f=t.Texture.WHITE,l=0,v=e-1;l<v;++l)s=h,o=a,c=(a=3*(h=r[l+1]).indexOffset)-o,f=s.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,o));c=3*this.l-a,f=h.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,a))}},n.prototype.isCompatible=function(t,n,i,r){return n.getBuffer()===this&&n.getVertexOffset()===i&&n.getIndexOffset()===r&&n.isCompatible(t)},n.prototype.update=function(t,n,i){var u=this.qe;u.begin();for(var s=0,h=0,o=t.get();null!=o&&null!=(a=o.uploaded)&&this.isCompatible(o,a,s,h);o=t.next())if(a.update(o),a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i)return t.next(),u.end(),this.o=s,this.l=h,0<u.units.length;for(;null!=o;o=t.next()){var a,c=e[o.type]||e[r.GROUP];if(null==c)break;if(null==(a=c(this,o,s,h,n)))break;if(a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i){t.next();break}}return u.end(),this.o=s,this.l=h,0<u.units.length},n.prototype.check=function(t,n,i,r){return this.indexCountRequested=r,t+i<=this.Ve&&n+r<=this.Je},n.prototype.destroy=function(){var t=this.Qe;t&&t.destroy(),this.qe.destroy()},n}(),Ee=[],Me=function(){this.index=0,this.shapes=Ee,this.current=null},Se=function(){function t(){this.$e=-1,this.tu=new Me,this.Pt=[this.tu],this.nu=null}return t.prototype.reset=function(t,n){this.$e=0;var i=this.Pt[0];return i.index=-1,i.shapes=n,i.current=null,this.tu=i,null!=t?(this.nu=t,t):this.next()},t.prototype.get=function(){return this.nu},t.prototype.next=function(){for(;;){var t=this.tu,n=t.index+=1,i=t.shapes,r=n<i.length?t.current=i[n]:t.current=null;if(null==r)return e=this.$e-=1,u=this.Pt,0<=e?(h=u[e],this.tu=h,this.nu=h.current):this.nu=null;var e,u,s=r.children;if(!(0<s.length))return this.nu=r,r;if((e=this.$e+=1)<(u=this.Pt).length)(h=u[e]).index=-1,h.shapes=s,h.current=null,this.tu=h;else{var h=new Me;u.push(h),h.index=-1,h.shapes=s,h.current=null,this.tu=h}}},t}(),Te=function(n){function i(r){var e=n.call(this,r)||this;return i.SHADER=i.SHADER||t.Shader.from("\nattribute vec2 aPosition;\nattribute vec3 aClipping;\nattribute vec2 aStep;\nattribute vec4 aAntialias;\nattribute vec4 aColorFill;\nattribute vec4 aColorStroke;\nattribute vec2 aUv;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mediump float shapeScale;\nuniform mediump float pixelScale;\nuniform mediump float antialiasWeight;\n\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nvec2 toInverse( in vec2 v ) {\n\treturn vec2( -v.y, v.x );\n}\n\nvec2 toTransformedPosition( in vec2 v ) {\n\treturn (projectionMatrix * translationMatrix * vec3(v, 1.0)).xy;\n}\n\nvec4 toAntialias01( in vec4 antialias ) {\n\t// Taylor series of 1 / ( 1 - a ) = 1 + a + a^2 + ....\n\treturn 1.0 + min( vec4( 1.0 ), antialias * pixelScale );\n}\n\nvec4 toAntialias2( in vec4 antialias, in float strokeWidth ) {\n\tfloat x = min( 0.4, 0.4 / 12.0 * antialias.x * pixelScale * antialiasWeight );\n\tfloat w = clamp( strokeWidth / antialias.y, 0.0, 1.0 ) * 0.4;\n\tfloat p = w * antialias.z + antialias.w;\n\tfloat y = 0.5 - p;\n\tfloat z = 0.5 - p - w;\n\treturn vec4( y, z, y - max( 0.01, y - x ), z - max( 0.01, z - x ) );\n}\n\nvec2 toPosition3456( in float type, in vec2 p, in vec2 pprev, in vec2 pnext, in float strokeWidth, out float shift ) {\n\tvec2 d0 = p - pprev;\n\tvec2 d1 = pnext - p;\n\tfloat l0 = dot( d0, d0 );\n\tfloat l1 = dot( d1, d1 );\n\tvec2 nd0 = normalize( toInverse( d0 ) );\n\tvec2 nd1 = normalize( toInverse( d1 ) );\n\tvec2 nd2 = 0.00001 < l1 ? nd1 : vec2(0.0, 0.0);\n\tvec2 n0 = 0.00001 < l0 ? nd0 : nd2;\n\tvec2 n1 = 0.00001 < l1 ? nd1 : n0;\n\tvec2 n0i = toInverse( n0 );\n\tvec2 n1i = toInverse( n1 );\n\tfloat direction = sign( 4.5 - type );\n\n\t// Offset\n\tfloat cross = dot( n0i, n1 );\n\tfloat crossInverse = ( 0.00001 < abs( cross ) ? 1.0 / cross : 0.0 );\n\tfloat b = dot(n1 - n0, n0) * crossInverse;\n\tfloat offsetSize = direction * strokeWidth * 0.5;\n\tvec2 offset = n1 + n1i * b;\n\n\t// Miter\n\tvec2 pmiter = p + offsetSize * offset;\n\tfloat miterAngle0 = dot( n0i, pmiter - pprev );\n\tfloat miterAngle1 = dot( n1i, pmiter - pnext );\n\tfloat miterLength = dot( offset, offset );\n\tfloat miterSide = direction * cross;\n\n\t// Bevel\n\tvec2 n = ( type == 4.0 || type == 6.0 ? n1 : n0 );\n\tvec2 pbevel = p + offsetSize * n;\n\n\t//\n\tvec2 presult = (\n\t\t0.0 <= miterSide ?\n\t\t( miterAngle0 < 0.0 && 0.0 <= miterAngle1 ? pmiter : pbevel ) :\n\t\t( miterLength < 6.0 ? pmiter : pbevel )\n\t);\n\tvec2 ni = ( type == 4.0 || type == 6.0 ? n1i : n0i );\n\tshift = dot( ni, p - presult );\n\treturn toTransformedPosition( presult );\n}\n\nvec2 toStep3456( in float type ) {\n\treturn ( type < 4.5 ? vec2( 1.0, 0.0 ) : vec2( 0.0, 1.0 ) );\n}\n\nvec4 toAntialias3456( in float strokeWidth ) {\n\tfloat a = antialiasWeight / max( 0.0001, strokeWidth );\n\treturn toAntialias01( vec4( a, a, a, a ) );\n}\n\nfloat toDotAndDashScale( in float scale, in float strokeWidthScale ) {\n\treturn (\n\t\tscale == 4.0 || scale == 5.0 || scale == 6.0 || scale == 7.0 ?\n\t\tstrokeWidthScale : 1.0\n\t);\n}\n\nvec4 toColorStroke3456( in float shift, in float scale ) {\n\tfloat x = aColorFill.x + shift;\n\tfloat y = scale * aColorFill.y;\n\tfloat z = scale * aColorFill.z;\n\tfloat w = aColorFill.w;\n\treturn vec4( x, y, z, w );\n}\n\nfloat toStrokeWidthScale( in float scale ) {\n\treturn (\n\t\tscale == 3.0 || scale == 7.0 ?\n\t\tshapeScale : (\n\t\t\tscale == 1.0 || scale == 5.0 ?\n\t\t\tmin( 1.0, shapeScale ) : (\n\t\t\t\tscale == 2.0 || scale == 6.0 ?\n\t\t\t\tmax( 1.0, shapeScale ) : 1.0\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec2 toStep01(in vec2 size, in vec2 weight, in vec2 strokeWidth) {\n\treturn weight / max(vec2(0.00001), vec2(1.0) - strokeWidth / size);\n}\n\nvec4 toAntialias01b(in vec2 size, in vec2 strokeWidth) {\n\treturn antialiasWeight / max(vec4(0.00001), vec4(size - strokeWidth, size));\n}\n\nvoid main(void) {\n\tvec2 p012 = toTransformedPosition( aPosition );\n\n\tfloat type = aClipping.z;\n\tfloat strokeWidthScale = toStrokeWidthScale( aStep.y );\n\tfloat strokeWidth = strokeWidthScale * aStep.x;\n\n\t// type === 0 or 1\n\tvec2 size01 = aAntialias.xy;\n\tvec2 weight01 = abs(aAntialias.zw - sign(aAntialias.zw));\n\tvec2 strokeWidth01 = step(vec2(0.0), aAntialias.zw) * strokeWidth;\n\tvec2 step01 = toStep01( size01, weight01, strokeWidth01 );\n\tvec4 a01 = toAntialias01( toAntialias01b( size01, strokeWidth01 ) );\n\n\t// type === 2\n\tvec4 a2 = toAntialias2( aAntialias, strokeWidth );\n\n\t// type === 3, 4, 5 or 6\n\tfloat shift3456 = 0.0;\n\tvec2 p3456 = toPosition3456( type, aPosition, aAntialias.xy, aAntialias.zw, strokeWidth, shift3456 );\n\tvec2 step3456 = toStep3456( type );\n\tvec4 a3456 = toAntialias3456( strokeWidth );\n\tvec4 colorStroke3456 = toColorStroke3456( shift3456, toDotAndDashScale( aStep.y, strokeWidthScale ) );\n\n\t//\n\tgl_Position = vec4( ( 2.5 < type ? p3456 : p012 ), 0.0, 1.0 );\n\tvAntialias = ( 1.5 < type ? ( 2.5 < type ? a3456 : a2 ) : a01 );\n\tvClipping = aClipping;\n\tvStep = ( 2.5 < type ? step3456 : step01 );\n\tvColorFill = ( 2.5 < type ? aColorStroke : aColorFill );\n\tvColorStroke = ( 2.5 < type ? colorStroke3456 : aColorStroke );\n\tvUv = aUv;\n}","\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float pixelScale;\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tfloat type = vClipping.z;\n\tvec2 v0 = vStep;\n\tvec2 v1 = vClipping.xy;\n\tvec2 v2 = v0 * vAntialias.xy;\n\tvec2 v3 = v1 * vAntialias.zw;\n\tvec2 d01 = ( v0.x < v0.y ? vec2( v0.y, v2.y ) : vec2( v0.x, v2.x ) );\n\tvec2 d02 = ( v1.x < v1.y ? vec2( v1.y, v3.y ) : vec2( v1.x, v3.x ) );\n\tvec4 d0 = vec4( d01.x, d02.x, d01.y, d02.y );\n\tvec4 d1 = vec4( dot( v0, v0 ), dot( v1, v1 ), dot( v2, v2 ), dot( v3, v3 ) );\n\tvec4 d = ( type == 1.0 ? d1 : d0 );\n\tvec2 s = smoothstep( 1.0 - (d.zw - d.xy), vec2( 1.0 ), d.xy );\n\tvec4 color01 = texture * (vColorStroke * (s.x - s.y) + vColorFill * (1.0 - s.x));\n\n\tfloat l = vColorStroke.x;\n\tfloat lp0 = vColorStroke.y;\n\tfloat lp1 = vColorStroke.z;\n\tfloat lt = vColorStroke.w;\n\tfloat ld = 0.5 * pixelScale;\n\tfloat lm = mod( l, lp0 + lp1 );\n\tfloat ls0 = ( 0.0 < lp1 ? smoothstep( 0.0, ld, lm ) - smoothstep( lp0, lp0 + ld, lm ) : 1.0 );\n\tfloat ls1 = ( 0.0 <= lt ? smoothstep( 0.0, ld, l ) - smoothstep( lt - ld, lt, l ) : 1.0 );\n\tvec4 color3456 = color01 * ls0 * ls1;\n\n\tvec2 a0 = vAntialias.xy;\n\tvec2 a1 = vAntialias.zw;\n\tvec2 a2 = vec2( texture.a );\n\tvec2 a = smoothstep( a0 - a1, a0 + a1, a2 );\n\tvec4 color2 = a.x * vColorFill + ( a.y - a.x ) * vColorStroke;\n\tgl_FragColor = ( type == 2.0 ? color2 : (2.5 < type ? color3456 : color01) );\n}"),e.iu=i.SHADER,e.ru=new Se,e.eu=e.getBufferSizeMax(r),e}return _(i,n),i.prototype.getBufferSizeMax=function(t){var n=t.context,i=n.extensions;return 1<n.webGLVersion||i.uint32ElementIndex?1431655765:21845},i.prototype.updateAtlas=function(t,n,i,r,e){var u=t.imageSrc;if(null!=u){var s=n.get(u);if(null!=s)t.texture=s.texture;else{var h=t.image;if(null!=h){var o=new we(h,e);t.texture=o.texture,n.set(o.id,o)}else t.texture=r}}else t.texture=r;var a=t.text,c=a.value;0<c.length&&i.add(a.family,c)},i.prototype.updateAtlases=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];this.updateAtlas(h,n,i,r,e);for(var o=h.children,a=0,c=o.length;a<c;++a){var f=o[a];this.updateAtlas(f,n,i,r,e),this.updateAtlases(f.children,n,i,r,e)}}},i.prototype.updateFontAtlas=function(t,n,i,r){var e=t.text,u=i.get(e.family);if(null!=u){var s=n.get(u.id);null!=s?(e.atlas=u,e.texture=s.texture):(e.atlas=void 0,e.texture=r)}else e.atlas=void 0,e.texture=r},i.prototype.updateFontAtlases=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];this.updateFontAtlas(s,n,i,r);for(var h=s.children,o=0,a=h.length;o<a;++o){var c=h[o];this.updateFontAtlas(c,n,i,r),this.updateFontAtlases(c.children,n,i,r)}}},i.prototype.uu=function(n,i,r,e){var u=this.renderer,s=this.iu;if(null!=s&&(null!=i||0<r.length)){var h=u.resolution,o=n.getBuffers(),a=n.getAntialiasWeight(h);if(e){var c=n.getAtlas(h),f=n.getFontAtlases();c.begin(),f.begin();var l=c.getDefaultTexture(),v=c.getBaseTexture();this.updateAtlases(r,c,f,l,v),f.end(),f.update(c),this.updateFontAtlases(r,c,f,l),c.end(),c.repack(),this.updateBuffers(i,r,o,u,a)}s.uniforms.shapeScale=n.toShapeScale(),s.uniforms.pixelScale=n.toPixelScale(h),s.uniforms.antialiasWeight=a,s.uniforms.translationMatrix=n.worldTransform.toArray(!0),u.shader.bind(s,!1),u.state.setBlendMode(t.utils.correctBlendMode(t.BLEND_MODES.NORMAL,!0));var b=o.length;if(1<b)for(var d=0;d<b;++d)o[d].upload();for(d=0;d<b;++d)o[d].render(s)}},i.prototype.updateBuffers=function(t,n,i,r,e){var u=this.ru;u.reset(t,n);for(var s=0,h=0,o=5e3,a=this.eu;null!=u.get();){var c=null,f=!1;if(0<h?(c=new De(h,r),i.splice(s,0,c),f=!0):s<i.length?(c=i[s],f=!1):(c=new De(o,r),i.push(c),f=!1),c.update(u,e,f))h=0,s+=1;else{if(!((h=c.indexCountRequested)<=a))break;h=Math.ceil(h/o)*o,h=Math.min(h,a)}}if(s<i.length){for(var l=s,v=i.length;l<v;++l)i[l].destroy();i.length=s}},i.SHADER=null,i}(t.ObjectRenderer),je=function(n){function i(){var i=n.call(this)||this;return i.su=null,i.children=[],i.Pr=null,i.hu=0,i.ou=-1,i.au=null,i.cu=new me,i.fu=1,i.lu=NaN,i.vu=1,i.bu=NaN,i.du=new t.Point,i.gu=[],i}return _(i,n),i.prototype.calculateBounds=function(){this._bounds.clear()},i.prototype.onChildTransformChange=function(){},i.prototype.toDirty=function(){return this.hu+=1},i.prototype.isDirty=function(){return this.ou<this.hu},i.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var n=this.hu,i=this.ou;this.ou=n;var r=i<n,e=this.su;null==e&&(e=this.su=new Te(t)),t.batch.setObjectRenderer(e);var u=this.mask,s=this.Pr,h=this.children;u?(t.mask.push(this,u),e.uu(this,s,h,r),t.mask.pop(this)):e.uu(this,s,h,r)}},i.prototype.containsPoint=function(t){return!1},i.prototype.getFontAtlases=function(){return this.cu},i.prototype.getAtlas=function(t){var n=this.au;return null==n&&(n=new ae(t),this.au=n),n},i.prototype.getBuffers=function(){return this.gu},i.prototype.toShapeScale=function(){this.updateTransform();var t=this.transform,n=t._worldID;if(n!==this.bu){this.bu=n;var i=t.worldTransform,r=i.a,e=i.b;this.vu=1/Math.sqrt(r*r+e*e)}return this.vu},i.prototype.getShapeScale=function(){return this.vu},i.prototype.toPixelScale=function(t){var n=this.toShapeScale(),i=this.bu;return this.lu!==i&&(this.lu=i,this.fu=1/t*n),this.fu},i.prototype.getPixelScale=function(){return this.fu},i.prototype.getAntialiasWeight=function(t){return 1.25/t},i.prototype.hitTest=function(t,n){for(var i=this.du,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible){u.toLocal(t,void 0,i);var s=u.contains(i.x,i.y);if(null!=s&&(null==n||n(s)))return s}}return null},i.prototype.hitTestBBox=function(t,n){for(var i=this.du,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible&&(u.toLocal(t,void 0,i),u.containsBBox(i.x,i.y)&&(null==n||n(u))))return u}return null},i.prototype.destroy=function(){var t=this.gu;if(null!=t)for(var i=0,r=t.length;i<r;++i)t[i].destroy();this.gu.length=0;var e=this.children;for(i=e.length-1;0<=i;--i)e[i].destroy();e.length=0,n.prototype.destroy.call(this)},i}(t.DisplayObject),Ne=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED_LAYER);var s=t.call(this,i,e,u)||this;return s.Lr=n,s}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Lr},enumerable:!1,configurable:!0}),n.prototype.newGroupFill=function(){return new q(this,!1,16777215,1)},n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=J.SIZE_X,r=J.SIZE_Y;return new Sr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}t.onChildTransformChange(),t.toDirty();var u=this.size;if(u instanceof Sr){var s=u.base;t.size.set(s.x,s.y).init().set(u.x,u.y)}else t.size.init();return t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Lr,this.Ar,this.Rr,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n}(Nr),Ie=function(){function t(){}return t.toLayers=function(t,n){var i=[],r=this.toLayer(t);if(r){var e=r.parent;if(e)for(var u=e.children,s=u.length,h=0,o=n.length;h<o;++h){var a=n[h];0<=a&&a<s&&i.push(u[a])}}return i},t.toLayer=function(t){for(var n=t.parent;null!=n;){if(n instanceof je)return n;if(n instanceof Ne)return n;n=n.parent}return null},t.show=function(t){return!t.visible&&(t.visible=!0,!0)},t.showAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible||(e.visible=!0,n=!0)}return n},t.hide=function(t){return!!t.visible&&(t.visible=!1,!0)},t.hideAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible&&(e.visible=!1,n=!0)}return n},t.bringToFront=function(t){var n=t.parent;return!!n&&this.doBringToFront(t,n.children,0)},t.bringAllToFront=function(t){var n=t.length;if(0<n){var i=t[0].parent;if(i){for(var r=!1,e=i.children,u=0;u<n;++u){var s=t[n-1-u];this.doBringToFront(s,e,u)&&(r=!0)}return r}}return!1},t.doBringToFront=function(t,n,i){for(var r=n.length-1-i,e=r;0<=e;--e){var u=n[e];if(u===t){if(e!==r){for(var s=e+1;s<=r;++s)n[s-1]=n[s];return n[r]=u,!0}return!1}}return!1},t}(),Ce={NONE:0,DRAG:1,PINCH:2,ALL:3},Ae=t.interaction.InteractionEvent,Re=function(n){function i(t){var i=n.call(this,t,tn.NONE)||this;return i.mu=new Map,i.wu=t.operationType,i.pu=t.scaleMin,i.Ou=t.scaleMax,i}return _(i,n),i.prototype.initialize=function(t,i){if(n.prototype.initialize.call(this,t,i),null==this.mu.get(t)){var r=Ie.toLayer(t);null!=r&&this.mu.set(t,r)}},i.prototype.onDown=function(t,i,r){if(n.prototype.onDown.call(this,t,i,r),r instanceof Ae){var e=this.mu.get(t),u=r.data.originalEvent.timeStamp;e&&this.condition(t,u,rn)&&this.getGestureUtil().onDown(e,r)}},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new ar({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.wu,c=!1,f=1;if(a&Ce.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Ou,Math.max(this.pu,v*u));f=b/v,l.set(b,b),c=!0}if(a&Ce.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&et.update(t)}},i.prototype.toSize=function(t,n){return"size"in t?n.copyFrom(t.size):n.set(t.width,t.height),n},i}(sn),Le=t.interaction.InteractionEvent,ye=function(n){function i(t){var i=n.call(this,t,tn.NONE)||this;return i.wu=t.operationType,i.pu=t.scaleMin,i.Ou=t.scaleMax,i}return _(i,n),i.prototype.onDown=function(t,i,r){n.prototype.onDown.call(this,t,i,r),r instanceof Le&&this.condition(t,r.data.originalEvent.timeStamp,rn)&&this.getGestureUtil().onDown(t,r)},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new ar({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.wu,c=!1,f=1;if(a&Ce.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Ou,Math.max(this.pu,v*u));f=b/v,l.set(b,b),c=!0}if(a&Ce.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&et.update(t)}},i}(sn),ke={SHAPE:0,LAYER:1},xe={INPUT_TEXT:0,INPUT_INTEGER:1,INPUT_REAL:2,EMIT_EVENT:3,WRITE_BOTH:4,WRITE_LOCAL:5,WRITE_REMOTE:6,HTML_ELEMENT:7,HTML_ELEMENT_WITHOUT_POINTER_EVENTS:8,SHOW_HIDE_LAYER:9,GESTURE_LAYER:10,GESTURE:11,EXECUTE:12},Be=function(t){function n(n,i,r,e,u){void 0===n&&(n=""),void 0===e&&(e=.05),void 0===u&&(u=20);var s=t.call(this,mn.GESTURE,n,i)||this;return s.operationType=r,s.scaleMin=e,s.scaleMax=u,s}return _(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case ke.SHAPE:return new ye(this);case ke.LAYER:return new Re(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.operationType,",").concat(this.scaleMin,",").concat(this.scaleMax,"]"))},n.deserialize=function(t,i){return new n(pn.toResource(1,t,i.resources),this.toSubType(t),t[3],t[4],t[5])},n.toSubType=function(t){if(t[0]!==mn.MISC)return t[2];switch(t[2]){case xe.GESTURE:return ke.SHAPE;case xe.GESTURE_LAYER:return ke.LAYER}},n}(gn),_e={INVISIBLE:"INVISIBLE",INTERACTIVE:"INTERACTIVE",DRAGGABLE:"DRAGGABLE",PINCHABLE:"PINCHABLE"},Pe=function(t,n,i,r,e){var u,s,h,o=function(t,n){if(ct(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""}(t[0],n),a=e?e(o,n):new Ne(o,n.mode,n.depth),c=t[1];null==c||2&c||(a.visible=!1,a.state.add(_e.INVISIBLE));var f=-.5*i+(t[2]||0),l=-.5*r+(t[3]||0);a.transform.position.set(f,l);var v=null!==(u=t[4])&&void 0!==u?u:i,b=null!==(s=t[5])&&void 0!==s?s:r;a.size.set(v,b),a.size.init();var d=t[6];if(null!=d&&a.fill.deserialize(d,n),n.mode===mr.VIEWER){var g=null!==(h=t[7])&&void 0!==h?h:1,m=1&g,w=2&g,p=4&g;if(w||p){var O=(w?Ce.DRAG:Ce.NONE)|(p?Ce.PINCH:Ce.NONE);a.action.add(new Be("",ke.LAYER,O))}(m||w||p)&&(a.interactive=!0)}return a},Ue=function(){function t(t,n){this.children=[],this.St=t,this.fn=n}return t.prototype.hasConnectors=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r instanceof ee)return!0;var e=r.children;if(0<e.length&&this.hasConnectors(e))return!0}return!1},t.prototype.newHasConnectors=function(){for(var t=new Map,n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];t.set(e,this.hasConnectors(e.children))}return t},t.prototype.copyTo=function(t){for(var n,i=null!==(n=this.Du)&&void 0!==n?n:this.Du=this.newHasConnectors(),r=this.children,e=t.children,u=0,s=r.length;u<s;++u){var h=r[u],o=h.clone();o.parent=t,e.push(o),i.get(h)&&ue.move(h,o)}t.onChildTransformChange(),t.toDirty(),t.onAttach()},t.prototype.deserialize=function(t,n){var i=t.length;if(0<i)for(var r=this.St,e=this.fn,u=0;u<i;++u)this.children.push(Pe(t[u],n,r,e))},t}(),Fe=function(){function t(){}return t.toSimple=function(t){return{version:t.version,id:t.id,name:t.name,thumbnail:t.thumbnail,data:JSON.stringify({width:t.width,height:t.height,background:t.background,tile:t.tile,resources:t.resources,data:t.data||t.tags,pieces:t.pieces,layers:t.layers,items:t.items,snap:t.snap})}},t.toSerialized=function(t){if(!("items"in t)){var n=JSON.parse(t.data),i={version:t.version,id:t.id,name:t.name,width:n.width,height:n.height,background:n.background,tile:n.tile,resources:n.resources,data:n.data||n.tags,pieces:n.pieces,layers:n.layers,items:n.items,snap:n.snap,thumbnail:t.thumbnail};if(null==i.data){var r=t.tags;null!=r&&(i.data=JSON.parse(r))}if(null==i.pieces){var e=t.pieces;null!=e&&(i.pieces=JSON.parse(e))}return i}return t},t.newLayer=function(t,n,i){n.deserialize(t.layers,i);var r=t.items,e=Rr(r,i);return null!=e?e.then((function(t){for(var i=n.children,e=0,u=t.length;e<u;++e){var s=r[e],h=t[e];null!=(o=i[s[16]])&&(h.parent=o,h.uploaded=void 0,o.children.push(h))}for(e=0,u=i.length;e<u;++e){var o;(o=i[e]).onChildTransformChange(),o.toDirty();for(var a=o.children,c=0,f=a.length;c<f;++c)a[c].onAttach()}return t})):Promise.resolve([])},t.toPieceData=function(t,n,i){var r=new Map,e=new Map,u=function(){return r};return this.Eu(t,n,r,e,i,0).then(u,u)},t.Eu=function(t,n,i,r,e,u){var s=this,h=[];if(n&&0<n.length&&t)for(var o=function(o,a){var c=n[o],f=r.get(c);if(null!=f)h.push(f);else{var l=t.piece.getByName(c).then((function(n){return s.Mu(t,c,n,e,u+1,i,r)}),(function(){return null}));r.set(c,l),h.push(l)}},a=0,c=n.length;a<c;++a)o(a);return Promise.all(h)},t.Mu=function(t,n,i,r,e,u,s){var h=this,o=this.toSerialized(i),a=o.width,c=o.height,f=new Ue(a,c);u.set(n,new yr(n,a,c,f));var l=o.pieces;return this.Eu(t,l,u,s,r,e).then((function(){return h.newLayer(o,f,new gr(o,l,u,r,e))}))},t}(),Ge={},He=function(){function t(){}return t.isContainer=function(t){return t instanceof vr},t.isEmbedded=function(t){return t instanceof Ir},t.toContainer=function(t){for(var n=t;null!=n;){if(this.isContainer(n))return n;n=n.parent}return null},t.open=function(t,n,i,r){var e=Ge[n];if(null!=e)e(i,r,t);else switch(n){case br.DIAGRAM:var u=this.toContainer(t);if(u){var s=u.controller;s&&s.getByName(i).then((function(t){u.set(Fe.toSerialized(t))}))}break;case br.PAGE:r?window.open(i):window.location.href=i}},t.writeLocal=function(t,n,i,r,e){var u;void 0===e&&(e=It.FOUND);for(var s=t;null!=s;){if(this.isContainer(s))return(s.data.private.set(n,i,r,e)||s.data.protected.set(n,i,r,e)||!!s.data.set(n,i,r,e))&&(et.update(s),!0);if(this.isEmbedded(s)&&(null===(u=s.data.getPrivate())||void 0===u?void 0:u.set(n,i,r,e)))return et.update(s),!0;s=s.parent}return!1},t.writeRemote=function(t,n,i){var r=this.toContainer(t);return!!r&&r.data.remote.set(n,i)},t.emit=function(n,i,r,e){var u=t.toContainer(n);void 0===e?(n.emit(i,n),u&&u.shape.emit(i,n)):(n.emit(i,r,e,n),u&&u.shape.emit(i,r,e,n))},t}(),ze=function(t){function n(n){var i=t.call(this,n,tn.NONE)||this;return i.name=en.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.name(t,i,rn);null!=r&&He.emit(t,r)}},n}(sn),Ve=function(t){function n(n,i){var r=t.call(this,mn.EMIT_EVENT,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new ze(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(pn.toResource(1,t,i.resources),pn.toResource(2,t,i.resources))},n}(dn),We=function(t){function n(n){var i=t.call(this,n,tn.NONE)||this;return i.target=en.ofStringOrNull(n.target),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.target(t,i,rn);null!=r&&He.emit(t,r)}},n}(sn),Xe={NO_POINTER_EVENTS:"NO_POINTER_EVENTS"},Ke=function(){function n(t){var n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg");i.setAttribute("style","position: absolute;"),i.setAttribute("width","0px"),i.setAttribute("height","0px");var r=document.createElementNS(n,"defs"),e=document.createElementNS(n,"clipPath"),u="clipper_ex_".concat(Math.random().toString(32).substring(2));e.setAttribute("id",u),e.setAttribute("clipPathUnits","objectBoundingBox");var s=document.createElementNS(n,"path");this.Su=s,this.Tu="",s.setAttribute("clip-rule","evenodd"),e.appendChild(s),r.appendChild(e),i.appendChild(r),this.R=u,t.appendChild(i)}return Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.update=function(t,n,i){var r=this.toD(t,n,i);this.Tu!=r&&(this.Su.setAttribute("d",r),this.Tu=r)},n.prototype.toD=function(i,r,e){var u,s;if(null==i)return"";var h=i.width,o=i.height,a=1e-4;if(h<a||o<a)return"";if(e.size<=0)return"M0,0 h1 v1 h-1z";var c=null!==(u=n.WORK_MATRIX)&&void 0!==u?u:n.WORK_MATRIX=new t.Matrix;null!=r?(c.copyFrom(r),c.invert()):c.identity(),c.translate(-i.x,-i.y),c.scale(1/h,1/o);for(var f=-1,l=2,v=-1,b=2,d="",g=c.a,m=c.b,w=c.c,p=c.d,O=c.tx,D=c.ty,E=null!==(s=n.WORK_RECTS)&&void 0!==s?s:n.WORK_RECTS=[],M=this.toRects(e,E),S=0;S<M;S+=4){var T=E[S+0],j=E[S+1],N=E[S+2],I=E[S+3],C=g*T+w*j+O,A=m*T+p*j+D,R=g*N+w*j+O,L=m*N+p*j+D,y=g*N+w*I+O,k=m*N+p*I+D,x=g*T+w*I+O,B=m*T+p*I+D;f=Math.min(f,C,R,y,x),l=Math.max(l,C,R,y,x),v=Math.min(v,A,L,k,B),b=Math.max(b,A,L,k,B);var _=C.toFixed(5),P=A.toFixed(5),U=R.toFixed(5),F=L.toFixed(5),G=y.toFixed(5),H=k.toFixed(5),z=x.toFixed(5),V=B.toFixed(5);d+=" M".concat(_,",").concat(P," L").concat(U,",").concat(F," L").concat(G,",").concat(H," L").concat(z,",").concat(V,"Z")}return"M".concat(f,",").concat(v," L").concat(l,",").concat(v," L").concat(l,",").concat(b," L").concat(f,",").concat(b,"Z")+d},n.prototype.toRects=function(t,n){for(var i=t.data,r=t.size<<2,e=0;e<r;e+=4){var u=i[e+0],s=i[e+1],h=i[e+2],o=i[e+3];u<h?(n[e+0]=u,n[e+2]=h):(n[e+0]=h,n[e+2]=u),s<o?(n[e+1]=s,n[e+3]=o):(n[e+1]=o,n[e+3]=s)}for(e=4;e<r;e+=4){u=n[e+0],s=n[e+1],h=n[e+2],o=n[e+3];for(var a=0;a<e;a+=4){var c=n[a+0],f=n[a+1],l=n[a+2],v=n[a+3],b=0,d=0;if(u<=c)if(h<=l){if(h<=c)continue;b=2,d=1}else d=3;else if(h<=l)b=3;else{if(l<=u)continue;b=1,d=2}var g,m,w=0,p=0;if(s<=f)if(o<=v){if(o<=f)continue;w=2,p=1}else p=3;else if(o<=v)w=3;else{if(v<=s)continue;w=1,p=2}if(4==(g=0===b||0===w?0:1===b||2===b?3===w?2:1:3===w?4:2)){e+4<r&&(n[e+0]=n[r+0],n[e+1]=n[r+1],n[e+2]=n[r+2],n[e+3]=n[r+3]),e-=4,r-=4;break}if(4!=(m=0===d||0===p?0:1===d||2===d?3===p?2:1:3===p?4:2))if(0===g)if(0===m){for(O=r-4;a<O;O-=4)n[O+4]=n[O+0],n[O+5]=n[O+1],n[O+6]=n[O+2],n[O+7]=n[O+3];0===d?(n[a+3]=s,n[a+4]=c,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=h,n[a+5]=f,n[a+6]=l,n[a+7]=v),e+=4,r+=4,a+=4}else 2===m&&(1===d?n[a+0]=h:2===d?n[a+2]=u:1===p?n[a+1]=o:2===p&&(n[a+3]=s));else if(1===g){for(O=r-4;a<O;O-=4)n[O+4]=n[O+0],n[O+5]=n[O+1],n[O+6]=n[O+2],n[O+7]=n[O+3];1===d?1===p?(n[a+0]=h,n[a+4]=c,n[a+5]=o,n[a+6]=h,n[a+7]=v):(n[a+0]=h,n[a+4]=c,n[a+5]=f,n[a+6]=h,n[a+7]=s):1===p?(n[a+2]=u,n[a+4]=u,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=u,n[a+5]=f,n[a+6]=l,n[a+7]=s),e+=4,r+=4,a+=4}else 2===g&&(1===b?(n[e+0]=l,u=l):2===b?(n[e+2]=c,h=c):1===w?(n[e+1]=v,s=v):2===w&&(n[e+3]=f,o=f));else{for(var O=a+4;O<r;O+=4)n[O-4]=n[O+0],n[O-3]=n[O+1],n[O-2]=n[O+2],n[O-1]=n[O+3];e-=4,r-=4,a-=4}}}return r},n}(),Ye=function(){function t(){this.Pt=[],this.j=0,this.$e=0,this.bn=!0}return Object.defineProperty(t.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),t.prototype.isDirty=function(){return this.bn},t.prototype.toClean=function(){this.bn=!1},t.prototype.begin=function(){return this.$e=0,this},t.prototype.end=function(){var t=this.$e;this.j=t;var n=this.Pt,i=t<<2;return n.length!==i&&(n.length=i,this.bn=!0),this},t.prototype.add=function(t,n,i,r){var e=this.$e<<2;this.$e+=1;var u=this.Pt;return e<u.length?u[e+0]===t&&u[e+1]===n&&u[e+2]===i&&u[e+3]===r||(u[e+0]=t,u[e+1]=n,u[e+2]=i,u[e+3]=r,this.bn=!0):(u.push(t,n,i,r),this.bn=!0),this},t}(),Je={CLICKED:0,DOUBLE_CLICKED:1,FOCUSED:2,ALWAYS:3},Ze=function(){function n(t,n,i,r){var e=this;this.Zn=t,this.ju=n;var u=this.toData(i,r);this.Pt=u,this.Nu=!1,this.Iu=function(t){e.onElementFocus(t)},this.Cu=function(t){e.onBeforeFocus(t)},this.Au=function(t){e.onAfterFocus(t)},this.Ru=!1,this.Lu=!1,this.yu=function(){e.doSelect()},this.ku=this.Pt.when===Je.ALWAYS,this.xu=function(){e.updateElement(e.Bu)}}return n.prototype.toData=function(t,n){var i,r;return{element:this.toElementData(t,null==n?void 0:n.element),clipper:this.toClipperData(t,null==n?void 0:n.clipper),before:this.toBeforeData(t,null==n?void 0:n.before),after:this.toAfterData(t,null==n?void 0:n.after),when:Ei(null!==(i=null==n?void 0:n.when)&&void 0!==i?i:t.getWhen(),Je),select:null!==(r=null==n?void 0:n.select)&&void 0!==r?r:t.getSelect()}},n.prototype.toElementData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getElementCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newElementStyler(t)}},n.prototype.newElementStyler=function(t){return function(n,i,r,e,u,s,h){return t.setElementStyle(n,i,r,e,u,s,h)}},n.prototype.toClipperData=function(t,n){var i,r,e;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getClipperCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newClipperStyler(t),extended:null!==(e=null==n?void 0:n.extended)&&void 0!==e?e:t.isClipperExEnabled()}},n.prototype.newClipperStyler=function(t){return function(n,i,r,e,u,s,h){return t.setClipperStyle(n,i,r,e,u,s,h)}},n.prototype.toBeforeData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getBeforeCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newBeforeStyler(t)}},n.prototype.newBeforeStyler=function(t){return function(n){t.setBeforeStyle(n)}},n.prototype.toAfterData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getAfterCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newAfterStyler(t)}},n.prototype.newAfterStyler=function(t){return function(n){t.setAfterStyle(n)}},Object.defineProperty(n.prototype,"element",{get:function(){var t;return null!==(t=this._u)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"when",{get:function(){return this.Pt.when},enumerable:!1,configurable:!0}),n.prototype.onDowning=function(t){switch(this.Lu=this.Ru,this.when){case Je.CLICKED:this.start();break;case Je.FOCUSED:this.Zn.state.isFocused&&this.start()}},n.prototype.onDown=function(t){!this.Lu&&this.Ru&&("data"in t?t.data.originalEvent.preventDefault():t.preventDefault())},n.prototype.onDblClick=function(t,n){switch(this.when){case Je.DOUBLE_CLICKED:this.start()}},n.prototype.onFocus=function(){var t;switch(this.when){case Je.FOCUSED:this.start();break;default:null===(t=this._u)||void 0===t||t.focus()}},n.prototype.onBlur=function(){var t;switch(this.when){case Je.CLICKED:case Je.DOUBLE_CLICKED:case Je.FOCUSED:this.onEndByBlur(),this.cancel();break;default:null===(t=this._u)||void 0===t||t.blur()}},n.prototype.isStartable=function(){switch(this.when){case Je.CLICKED:case Je.DOUBLE_CLICKED:case Je.FOCUSED:return this.Zn.state.isActionable;default:return!0}},n.prototype.start=function(){!this.Ru&&this.isStartable()&&(this.Ru=!0,this.Zn.worldVisible?this.doStart():this.ku=!0,et.update(this.Zn))},n.prototype.isShown=function(){return this.Nu},n.prototype.onRender=function(t){(this.ku||!this.Nu&&this.when===Je.ALWAYS)&&(this.ku=!1,this.doStart(t)),this.Ru&&(this.Ru=!1)},n.prototype.getElementRect=function(n){var i=this.cn||new t.Point(0,0);this.cn=i;var r=this.Pu||new t.Rectangle;return this.Pu=r,this.ju.getElementRect(n,i,r)},n.prototype.getElementMatrix=function(){return this.ju.getElementMatrix()},n.prototype.getClipperRect=function(n){var i=this.cn||new t.Point(0,0);this.cn=i;var r=this.Uu||new t.Rectangle;return this.Uu=r,this.ju.getClipperRect(n,i,r)},n.prototype.fillClipperExRects=function(t,n){var i=this.ju;return i.getClipperExRects&&i.getClipperExRects(n),n.isDirty()},n.prototype.doStart=function(t){var n,i;if(!this.Nu){this.Nu=!0;var r=this.Bu;null!=r&&(this.Bu=void 0,r.off("postrender",this.xu));var e=this.Zn;null==t&&(t=null===(n=et.getLayer(e))||void 0===n?void 0:n.renderer),t&&(this.Bu=t,t.on("postrender",this.xu)),this.onStart();var u=this.getClipper();if(u){var s=this.getBefore(u),h=this.getElement(u),o=this.getAfter(u),a=this.getClipperEx(u);if(h){var c=null!==(i=null==t?void 0:t.resolution)&&void 0!==i?i:et.getResolution(e),f=this.getElementRect(c),l=this.getElementMatrix(),v=this.toClipperRectAdjusted(f,l,this.getClipperRect(c)),b=e.state,d=this.ju.getPadding(),g=this.Pt;if(g.clipper.styler(u,b,d,f,l,v,a),g.element.styler(h,b,d,f,l,v,a),s&&g.before.styler(s),o&&g.after.styler(o),this.onElementAttached(h,s,o),a){var m=this.getClipperExRects();m&&this.fillClipperExRects(c,m)&&(a.update(f,l,m),m.toClean())}u.style.display="",b.isFocused&&this.toElementFocused(h),u.scrollTop=0,u.scrollLeft=0,this.Pt.select&&setTimeout(this.yu,0)}}}},n.prototype.toElementFocused=function(t){t.focus({preventScroll:!0})},n.prototype.onStart=function(){this.ju.onStart()},n.prototype.doSelect=function(){var t=this._u;t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select()},n.prototype.cancel=function(){var t;if(this.Nu){this.Nu=!1;var n=this.Bu;null!=n&&(this.Bu=void 0,n.off("postrender",this.xu)),this.onCancel();var i=this.Zn,r=et.getLayer(i);if(r){var e=r.view;switch(this.when){case Je.CLICKED:case Je.DOUBLE_CLICKED:case Je.FOCUSED:document.activeElement===this._u&&e.focus()}var u=i.state,s=r.renderer.plugins.interaction;this.ju.containsPoint(s.mouse.global)&&!u.isHovered&&(u.isHovered=!0,e.style.cursor=null!==(t=i.cursor)&&void 0!==t?t:""),r.update()}var h=this._u;null!=h&&this.onElementDetached(h,this.Fu,this.Gu);var o=this.Hu;null!=o&&(o.style.display="none")}},n.prototype.onCancel=function(){this.ju.onCancel()},n.prototype.onElementAttached=function(t,n,i){null==n||n.addEventListener("focus",this.Cu),null==i||i.addEventListener("focus",this.Au),t.addEventListener("focus",this.Iu,!0)},n.prototype.onElementDetached=function(t,n,i){null==n||n.removeEventListener("focus",this.Cu),null==i||i.removeEventListener("focus",this.Au),t.removeEventListener("focus",this.Iu,!0)},n.prototype.getClipper=function(){var t=this.Hu;if(null==t){var n=et.getLayer(this.Zn);t=n?this.Pt.clipper.creator(n.getElementContainer()):null,this.Hu=t}return t},n.prototype.getClipperEx=function(t){var n=this.zu;return void 0===n&&(n=null!=this.getClipperExRects()?new Ke(t):null,this.zu=n),n},n.prototype.getClipperExRects=function(){var t=this.Vu;return void 0===t&&(t=this.Pt.clipper.extended?new Ye:null,this.Vu=t),t},n.prototype.getElement=function(t){var n=this._u;return null==n&&(n=this.Pt.element.creator(t),this._u=n),n},n.prototype.getBefore=function(t){var n=this.Fu;return null==n&&(n=this.Pt.before.creator(t),this.Fu=n),n},n.prototype.getAfter=function(t){var n=this.Gu;return null==n&&(n=this.Pt.after.creator(t),this.Gu=n),n},n.prototype.onBeforeFocus=function(t){var n=this.Zn,i=et.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!1);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onAfterFocus=function(t){var n=this.Zn,i=et.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!0);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onElementFocus=function(t){if(this.when===Je.ALWAYS){var n=this.Zn;n.state.isFocused||n.focus()}},n.prototype.onEndByBlur=function(){this.onEnd()},n.prototype.onEnd=function(){this.ju.onEnd()},n.prototype.end=function(){this.onEnd(),this.cancel()},n.prototype.select=function(){return this.Nu&&this.Pt.select&&this.doSelect(),this},n.prototype.toClipperRectAdjusted=function(t,n,i){if(i&&t&&null==n){var r=t.x,e=t.y,u=r+t.width,s=e+t.height,h=i.x,o=i.y,a=h+i.width,c=o+i.height,f=Math.min(Math.max(h,r),a),l=Math.min(Math.max(h,u),a),v=Math.min(Math.max(o,e),c),b=Math.min(Math.max(o,s),c);i.x=f,i.y=v,i.width=l-f,i.height=b-v}return i},n.prototype.updateElement=function(t){if(this.Nu){var n=this.Zn;if(n.worldVisible){var i=this._u,r=this.Hu,e=this.zu;if(i&&r){var u=t.resolution,s=this.getElementRect(u),h=this.getElementMatrix(),o=this.toClipperRectAdjusted(s,h,this.getClipperRect(u)),a=n.state,c=this.ju.getPadding(),f=this.Pt;if(f.clipper.styler(r,a,c,s,h,o,e),f.element.styler(i,a,c,s,h,o,e),e){var l=this.getClipperExRects();l&&this.fillClipperExRects(u,l)&&(e.update(s,h,l),l.toClean())}}}else switch(this.when){case Je.ALWAYS:(r=this.Hu)&&(r.style.display="none");break;default:this.cancel()}}},n.getClipperRect=function(t,n,i,r,e){for(var u=!0,s=0,h=0,o=0,a=0,c=t;c instanceof $i;){c.getClippingRect(n,e),r.set(e.x,e.y),c.toGlobal(r,r,!1);var f=(r.x*i|0)/i,l=(r.y*i|0)/i;r.set(e.x+e.width,e.y+e.height),c.toGlobal(r,r,!0);var v=r.x,b=r.y,d=Math.min(f,v),g=Math.min(l,b),m=Math.max(f,v),w=Math.max(l,b);u?(u=!1,s=d,h=g,o=m,a=w):(s=Math.min(Math.max(s,d),m),h=Math.min(Math.max(h,g),w),o=Math.min(Math.max(o,d),m),a=Math.min(Math.max(a,g),w)),c=c.parent}return u?null:(e.x=s,e.y=h,e.width=o-s,e.height=a-h,e)},n}(),qe=function(){function t(t){var n=t.transform,i=n.position;this.x=i.x,this.y=i.y;var r=t.size;this.sizeX=r.x,this.sizeY=r.y,this.rotation=n.rotation,this.actions=[],this.fill=t.fill.toObject(),this.stroke=t.stroke.toObject(),this.text=t.text.toObject(),this.cursor=t.cursor,this.reset=tn.NONE,this.written=tn.NONE,this.effect=NaN,this.isStateChanged=!1,this.interactive=!1}return t.prototype.initialize=function(t){t.disallowUploadedUpdate();for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].initialize(t,this);t.allowUploadedUpdate()},t.prototype.isActionable=function(){return 0<this.actions.length},t.prototype.onResize=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onResize(t,this)},t.prototype.onClick=function(t,n){var i=t.state;i.isActionable&&(i.isClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onClick(t,this,n)},t.prototype.onDblClick=function(t,n,i){var r=t.state;r.isActionable&&(r.isDblClicked=!0);for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onDblClick(t,this,n,i);return!1},t.prototype.onOver=function(t,n){var i=t.state;if(!i.isHovered){i.isHovered=!0;for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onOver(t,this,n)}},t.prototype.onOut=function(t,n){if(t.state.isHovered){t.state.isHovered=!1;for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onOut(t,this,n)}},t.prototype.onDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onDowning(t,this,n);var u=t.state;if(!u.isDown)if(u.isPressed)for(u.addAll(vt.DOWN,ot.PRESSED),(h=et.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onDown(t,this,n),s.onPressed(t,this,n)}else{var h,o;for(u.isDown=!1,(h=et.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onDown(t,this,n)}},t.prototype.onUp=function(t,n){var i=t.state;if(!i.isUp)if(i.isPressed){i.set(vt.UP,ot.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUp(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUp(t,this,n)}},t.prototype.onUpOutside=function(t,n){var i=t.state;if(i.isPressed){i.set(vt.UP_OUTSIDE,ot.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUpOutside(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUpOutside(t,this,n)}},t.prototype.onMove=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onMove(t,this,n)},t.prototype.onKeyDown=function(t,n){Ki.isActivateKey(n)&&this.onDown(t,n);for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onKeyDown(t,this,n);return!1},t.prototype.onKeyUp=function(t,n){if(Ki.isActivateKey(n)){var i=t.state;if(i.isPressed){var r=i.isUp;this.onUp(t,n),!r&&i.isUp&&this.onClick(t,n)}}for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onKeyUp(t,this,n);return!1},t.prototype.onStateChange=function(t,n,i){this.isStateChanged=!0,et.update(t),n.isFocused?i.isFocused||this.onFocus(t):i.isFocused&&this.onBlur(t)},t.prototype.onFocus=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onFocus(t,this)},t.prototype.onBlur=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onBlur(t,this)},t.prototype.onRightClick=function(t,n){var i=t.state;i.isActionable&&(i.isRightClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRightClick(t,this,n)},t.prototype.onRightDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onRightDowning(t,this,n);var u=t.state;if(!u.isRightDown)if(u.isRightPressed)for(u.addAll(vt.RIGHT_DOWN,vt.RIGHT_PRESSED),(h=et.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onRightDown(t,this,n),s.onRightPressed(t,this,n)}else{var h,o;for(u.isRightDown=!1,(h=et.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onRightDown(t,this,n)}},t.prototype.onRightUp=function(t,n){var i=t.state;if(!i.isRightUp)if(i.isRightPressed){i.set(vt.RIGHT_UP,vt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUp(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUp(t,this,n)}},t.prototype.onRightUpOutside=function(t,n){var i=t.state;if(i.isRightPressed){i.set(vt.RIGHT_UP_OUTSIDE,vt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUpOutside(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUpOutside(t,this,n)}},t.prototype.update=function(n,i){var r=n.data,e=this.effect<=i;if(r.isChanged||this.isStateChanged||e){this.isStateChanged=!1,r.isChanged=!1,e&&(this.effect=NaN),n.disallowUploadedUpdate(),this.onUpdate(n,i),n.allowUploadedUpdate();var u=this.isStateChanged;n.state.removeAll(t.TRANSIENT_STATES),this.isStateChanged=u}},t.prototype.onRender=function(t,n,i){for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRender(t,this,n,i);this.update(t,n)},t.prototype.onUpdate=function(t,n){var i=this.actions;if(0<i.length){this.written=tn.NONE;for(var r=0,e=i.length;r<e;++r)i[r].execute(t,this,n);this.doReset(t)}},t.prototype.doReset=function(t){var n=~this.written&this.reset;if(n!==tn.NONE){if(n&tn.POSITION_X&&(t.transform.position.x=this.x),n&tn.POSITION_Y&&(t.transform.position.y=this.y),n&tn.VISIBILITY&&(t.visible=!0),n&tn.COLOR_FILL){var i=this.fill;t.fill.set(void 0,i.color,i.alpha)}if(n&tn.COLOR_STROKE){var r=this.stroke;t.stroke.set(void 0,r.color,r.alpha)}if(n&tn.COLOR_TEXT){var e=this.text;t.text.set(void 0,e.color,e.alpha)}if(n&tn.COLOR_TEXT_OUTLINE){var u=this.text.outline;t.text.outline.set(void 0,u.color,u.alpha)}n&tn.HEIGHT&&(t.size.y=this.sizeY),n&tn.WIDTH&&(t.size.x=this.sizeX),n&tn.ROTATION&&(t.transform.rotation=this.rotation),n&tn.TEXT&&(t.text.value=this.text.value),n&tn.CURSOR&&(t.cursor=this.cursor)}},t.TRANSIENT_STATES=[vt.CLICKED,vt.DBL_CLICKED,vt.DOWN,vt.UP,vt.UP_OUTSIDE,vt.RIGHT_CLICKED,vt.RIGHT_DOWN,vt.RIGHT_UP,vt.RIGHT_UP_OUTSIDE,vt.ACTIVATED,vt.DEACTIVATED],t}(),Qe=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&zt(this,n,i,r,e,u,s)},n}(Ft),$e=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_PIVOTED),t.call(this,n)||this}return _(n,t),n.prototype.toHitTestData=function(n,i){var r=t.prototype.toHitTestData.call(this,n,i);return r.x-=r.width,r.y-=r.height,r},n}(Qe),tu=function(t){function n(n){var i=t.call(this)||this;i.name=n,i.interactive=!1,i.reference=0;var r=i.newShape();return r.parent=i,i.Pr=r,i.interactives=[],i}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.Pr.size.x},set:function(t){this.Pr.size.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.Pr.size.y},set:function(t){this.Pr.size.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"background",{get:function(){return this.Pr.fill},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Pr.state},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){var t=new $e;return t.fill.set(!1,16777215,1),t.stroke.set(!1),t.state.add(_e.INTERACTIVE),t},n.prototype.initialize=function(t){var n=this.interactives,i=this.Pr,r=i.state.is(_e.INTERACTIVE),e=i.state.is(_e.DRAGGABLE),u=i.state.is(_e.PINCHABLE);if(e||u){var s=new qe(i);i.runtime=s;var h=(e?Ce.DRAG:Ce.NONE)|(u?Ce.PINCH:Ce.NONE);s.actions.push(new Be("",ke.LAYER,h).toRuntime()),t.push(i),s.initialize(i)}(r||e||u)&&(i.interactive=!0,n.push(i)),this.doInitialize(this.children,n)},n.prototype.doInitialize=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i],u=e.runtime;if(u)if(e.interactive||u.interactive)n.push(e);else{var s=e.cursor;null!=s&&0<s.length&&n.push(e)}var h=e.children;0<h.length&&this.doInitialize(h,n)}},n.prototype.update=function(t){this.doUpdate(this.children,t)},n.prototype.doUpdate=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];e.update(n);var u=e.children;0<u.length&&this.doUpdate(u,n)}},n.prototype.hitTestInteractives=function(t){for(var n=this.du,i=this.interactives,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible&&(e.toLocal(t,void 0,n),null!=e.contains(n.x,n.y)))return e}return null},n.prototype.addUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},n.prototype.updateUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},n.prototype.destroy=function(){if(!this._destroyed){for(var n=this.children,i=n.length-1;0<=i;--i)n[i].destroy();n.length=0,t.prototype.destroy.call(this)}},n.prototype.serialize=function(t,n,i){for(var r=this.children,e=0,u=r.length;e<u;++e){var s=r[e].serialize(n);s[16]=t,i.push(s)}var h=this.Pr,o=n.addResource(this.name||""),a=(this.visible?1:0)|(h.state.is(_e.INVISIBLE)?0:2),c=this.position,f=h.size,l=h.fill.serialize(n),v=h.state.is(_e.INTERACTIVE)?1:0,b=h.state.is(_e.DRAGGABLE)?2:0,d=h.state.is(_e.PINCHABLE)?4:0;return[o,a,c.x,c.y,f.x,f.y,l,v|b|d]},n.deserialize=function(t,i,r,e){var u,s,h,o=new n(this.deserializeName(t[0],i)),a=o.Pr,c=t[1];if(null!=c){var f=i.mode!==mr.VIEWER;!f||1&c||(o.visible=!1),2&c||(a.state.add(_e.INVISIBLE),f||(o.visible=!1))}var l=t[2],v=t[3];o.position.set(l,v);var b=null!==(u=t[4])&&void 0!==u?u:r,d=null!==(s=t[5])&&void 0!==s?s:e;a.size.set(b,d);var g=t[6];null!=g&&a.fill.deserialize(g,i);var m=null!==(h=t[7])&&void 0!==h?h:1;return a.state.set(_e.INTERACTIVE,!!(1&m)),a.state.set(_e.DRAGGABLE,!!(2&m)),a.state.set(_e.PINCHABLE,!!(4&m)),o},n.deserializeName=function(t,n){if(ct(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""},n}(je),nu=!1,iu=function(){return nu},ru=function(n){function i(t){var i=n.call(this)||this;return i.condition=en.ofString(t.condition),i.utils=new Map,i}return _(i,n),i.prototype.getUtil=function(t,n){var i=this.utils,r=i.get(t);return null==r&&(r=this.newUtil(t,n),i.set(t,r)),r},i.prototype.newUtil=function(t,n){return new Ze(t,this.newOperation(t,n),Y.getInstance().get("DHtmlElement"),this.newUtilOptions(t,n))},i.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},i.prototype.newUtilOptions=function(t,n){return{element:{creator:this.newElementCreator(t,n)},when:this.toWhen(t,n),clipper:{extended:iu()}}},i.prototype.toWhen=function(t,n){var i=this.condition(t,Date.now(),rn);if(null!=i&&i in Je)return Je[i]},i.prototype.containsPoint=function(n,r,e){var u;if(n.visible){var s=null!==(u=i.WORK)&&void 0!==u?u:i.WORK=new t.Point;return n.toLocal(e,void 0,s),null!=n.contains(s.x,s.y)}return!1},i.prototype.getPadding=function(t,n){return null},i.prototype.getElementRect=function(t,n,i,r,e){var u=t.transform.pivot,s=t.size,h=s.x,o=s.y;return e.x=-.5*h+u.x,e.y=-.5*o+u.y,e.width=h,e.height=o,e},i.prototype.getElementMatrix=function(t,n){return t.updateTransform(),t.transform.worldTransform},i.prototype.getClipperToRect=function(t,n,i,r,e){var u=He.toContainer(t);return Ze.getClipperRect(u,t,i,r,e)},i.prototype.getClipperExRects=function(t,n){n.begin();var i=t.root.parent;if(i instanceof tu){var r=i.parent;if(null!=r){var e=r.children,u=e.indexOf(i);if(0<=u)for(var s=u+1,h=e.length;s<h;++s){var o=e[s];if(o.visible){var a=o.width,c=o.height,f=o.transform.worldTransform,l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty;n.add(g,m,l*a+b*c+g,v*a+d*c+m)}}}}n.end()},i.prototype.onRender=function(t,n,i,r){this.getUtil(t,n).onRender(r)},i.prototype.onFocus=function(t,n){this.getUtil(t,n).onFocus()},i.prototype.onBlur=function(t,n){this.getUtil(t,n).onBlur()},i.prototype.onDowning=function(t,n,i){this.getUtil(t,n).onDowning(i)},i.prototype.onDown=function(t,n,i){this.getUtil(t,n).onDown(i)},i.prototype.onDblClick=function(t,n,i,r){this.getUtil(t,n).onDblClick(i,r)},i}(un),eu=function(t){function n(n){var i=t.call(this,n)||this;return i.elementCreator=en.ofElementOrNull(n.value),i.noPointerEvent=n.subtype===xe.HTML_ELEMENT_WITHOUT_POINTER_EVENTS,i}return _(n,t),n.prototype.newUtil=function(n,i){return this.noPointerEvent&&n.state.add(Xe.NO_POINTER_EVENTS),t.prototype.newUtil.call(this,n,i)},n.prototype.newElementCreator=function(t,n){var i=this.elementCreator;if(i)return function(n){return i(t,Date.now(),rn,n)}},n}(ru),uu=function(t){function n(n,i,r,e){var u,s,h,o,a,c,f=this;(f=t.call(this,n,i,r,e)||this).ju=i,f.Wu=function(t){f.onInputKeyDown(t)},f.Xu=function(){f.onInputChange()},f.Ku=function(t){f.onInputInput(t)},f.Yu=null!==(u=null==e?void 0:e.description)&&void 0!==u?u:"";var l=null==e?void 0:e.editing;return f.Ju=null!==(o=null!==(s=null==l?void 0:l.formatter)&&void 0!==s?s:null===(h=null==e?void 0:e.text)||void 0===h?void 0:h.formatter)&&void 0!==o?o:r.getEditingFormatter(),f.Zu=null!==(a=null==l?void 0:l.unformatter)&&void 0!==a?a:r.getEditingUnformatter(),f.qu=null!==(c=null==l?void 0:l.validator)&&void 0!==c?c:r.getEditingValidator(),f}return _(n,t),n.prototype.onEnd=function(){t.prototype.onEnd.call(this),this.onInputChange()},n.prototype.onElementAttached=function(n,i,r){n.value=this.fromValue(this.ju.getValue()),n.addEventListener("change",this.Xu),n.addEventListener("input",this.Ku),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){t.prototype.onElementDetached.call(this,n,i,r),n.removeEventListener("change",this.Xu),n.removeEventListener("input",this.Ku)},n.prototype.onInputKeyDown=function(t){Ki.isOkKey(t)?(this.end(),this.ju.onEnter()):Ki.isCancelKey(t)&&this.cancel()},n.prototype.toElementFocused=function(n){t.prototype.toElementFocused.call(this,n),n.scrollTop=0,n.scrollLeft=0},n.prototype.onInputChange=function(){if(this.isShown()){var t=this.element;if(null!=t){var n=this.ju,i=this.toValue(t.value),r=n.getValue();r!==i&&n.onValueChange(i,r)}}},n.prototype.toValue=function(t){return this.Zu(t,this)},n.prototype.fromValue=function(t){return void 0!==t?this.Ju(t,this):""},n.prototype.onInputInput=function(t){var n=t.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&this.ju.onValueInput(this.toValue(n.value))},n.prototype.validate=function(){var t=this.ju.getValue();if(void 0!==t){var n=this.qu(t,this);if(this.Qu!==n){this.Qu=n;var i=this.Zn.state;i.isInvalid=null!=n,i.isHovered&&this.ju.applyTitle()}return n}return null},n.prototype.applyTitle=function(){var t=this.Qu;if(ct(t)){var n=et.getLayer(this.Zn);return n&&(n.view.title=t),!0}return!1},n}(Ze),su=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.Wu),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.Wu),t.prototype.onElementDetached.call(this,n,i,r)},n}(uu),hu=function(t){function n(n,i,r,e){var u,s,h,o=this;return(o=t.call(this,n,i,r,e)||this).$u=null!==(u=null==e?void 0:e.step)&&void 0!==u?u:r.getStep(),o.ts=null!==(s=null==e?void 0:e.min)&&void 0!==s?s:r.getMin(),o.ns=null!==(h=null==e?void 0:e.max)&&void 0!==h?h:r.getMax(),o}return _(n,t),Object.defineProperty(n.prototype,"step",{get:function(){return this.$u},set:function(t){this.$u!==t&&(this.$u=t,this.onStepChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.ts},set:function(t){this.ts!==t&&(this.ts=t,this.onMinChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.ns},set:function(t){this.ns!==t&&(this.ns=t,this.onMaxChange())},enumerable:!1,configurable:!0}),n.prototype.toValue=function(n){var i=t.prototype.toValue.call(this,n);if(i==i){var r=this.ts;if(null!=r&&i<r)return r;var e=this.ns;return null!=e&&e<i?e:i}return 0},n.prototype.fromValue=function(t){return void 0!==t?this.Ju(t,this):"0"},n.prototype.onStepChange=function(){if(this.isShown()){var t=this.element;t&&this.updateStep(t)}},n.prototype.onMinChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMin(t)}},n.prototype.onMaxChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMax(t)}},n.prototype.updateStep=function(t){var n=this.step;t.step=null!=n?"".concat(n):"any"},n.prototype.updateMin=function(t){var n=this.min;null!=n?t.min="".concat(n):t.removeAttribute("min")},n.prototype.updateMax=function(t){var n=this.max;null!=n?t.max="".concat(n):t.removeAttribute("max")},n.prototype.onElementAttached=function(n,i,r){n.type="number",t.prototype.onElementAttached.call(this,n,i,r),this.updateStep(n),this.updateMin(n),this.updateMax(n)},n}(su),ou={EMIT_EVENT:0,WRITE_BOTH:1,WRITE_LOCAL:2,WRITE_REMOTE:3},au=function(){function t(){}return t.execute=function(t,n,i,r,e){switch(n){case ou.EMIT_EVENT:t.emit(i,t,r),He.emit(t,i,r,e);break;case ou.WRITE_LOCAL:He.writeLocal(t,i,r,e);break;case ou.WRITE_REMOTE:He.writeRemote(t,i,r);break;case ou.WRITE_BOTH:He.writeLocal(t,i,r,e),He.writeRemote(t,i,r)}},t}(),cu=function(t){function n(n){var i=t.call(this,n)||this;return i.target=en.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i}return _(n,t),n.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){t.text.enable=!1},onCancel:function(){t.text.enable=!0},onEnd:function(){},getValue:function(){return i.getUtil(t,n).toValue(t.text.value)},onValueInput:function(t){},onValueChange:function(r,e){i.onValueChange(t,n,r,e)},onEnter:function(){},applyTitle:function(){}}},n.prototype.newElementCreator=function(t,n){},n.prototype.getPadding=function(t,n){return t.text.padding},n.prototype.onValueChange=function(t,n,i,r){t.text.value=this.getUtil(t,n).fromValue(i);var e=Date.now(),u=this.target(t,e,rn);null!=u&&au.execute(t,this.onInputAction,u,i,e)},n}(ru),fu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(cu),lu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(fu),vu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new hu(t,this.newOperation(t,n),Y.getInstance().get("DInputInteger"),this.newUtilOptions(t,n))},n}(lu),bu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new hu(t,this.newOperation(t,n),Y.getInstance().get("DInputReal"),this.newUtilOptions(t,n))},n}(lu),du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.type="text",t.prototype.onElementAttached.call(this,n,i,r)},n}(su),gu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new du(t,this.newOperation(t,n),Y.getInstance().get("DInputText"),this.newUtilOptions(t,n))},n}(fu),mu=function(t){function n(n){var i=t.call(this,n,tn.NONE)||this;return i.target=en.ofStringOrNull(n.target),i.value=en.ofUnknown(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.target(t,i,rn);null!=r&&this.write(t,r,this.value(t,i,rn),i)}},n}(sn),wu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){He.writeLocal(t,n,i,r),He.writeRemote(t,n,i)},n}(mu),pu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){He.writeLocal(t,n,i,r)},n}(mu),Ou=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){He.writeRemote(t,n,i)},n}(mu),Du=function(t){function n(n,i,r,e,u){var s=t.call(this,mn.MISC,i,n)||this;return s.target=r,s.onInputAction=e,s.value=u,s}return _(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case xe.INPUT_TEXT:return new gu(this);case xe.INPUT_INTEGER:return new vu(this);case xe.INPUT_REAL:return new bu(this);case xe.EMIT_EVENT:return new We(this);case xe.WRITE_BOTH:return new wu(this);case xe.WRITE_LOCAL:return new pu(this);case xe.WRITE_REMOTE:return new Ou(this);case xe.HTML_ELEMENT:case xe.HTML_ELEMENT_WITHOUT_POINTER_EVENTS:return new eu(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,"]"))},n.deserialize=function(t,i){var r=i.resources,e=pn.toResource(1,t,r),u=pn.toResource(3,t,r),s=pn.toResource(5,t,r);return new n(t[2],e,u,t[4],s)},n}(gn),Eu=function(t){function n(n){var i=t.call(this,n,tn.NONE)||this;return i.target=en.ofUnknown(n.target),i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,rn)&&this.target(t,i,rn)},n}(sn),Mu=function(t){function n(n,i){var r=t.call(this,mn.MISC,n,xe.EXECUTE)||this;return r.target=i,r}return _(n,t),n.prototype.toRuntime=function(){return new Eu(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=i.resources;return new n(pn.toResource(1,t,r),pn.toResource(3,t,r))},n}(gn),Su=function(t){function n(n,i){var r=t.call(this,n,tn.NONE)||this;return r.subtype=i,r.target=en.ofStringOrNull(n.target),r.inNewWindow=n.inNewWindow,r}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.target(t,i,rn);null!=r&&He.open(t,this.subtype,r,this.inNewWindow)}},n}(sn),Tu={DIAGRAM_LEGACY:0,PAGE_LEGACY:1,PAGE_INPLACE_LEGACY:2,DIALOG_TEXT:3,DIALOG_INTEGER:4,DIALOG_REAL:5,DIALOG_BOOLEAN:6,DIALOG_DATE:7,DIALOG_TIME:8,DIALOG_DATETIME:9,DIAGRAM:10,PAGE:11,DIALOG:12,EXTENSION:br.EXTENSION},ju=function(t){function n(n,i,r,e){var u=t.call(this,mn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){switch(this.subtype){case Tu.DIAGRAM:return new Su(this,br.DIAGRAM);case Tu.PAGE:return new Su(this,br.PAGE)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=pn.toResource(1,t,i.resources),e=pn.toResource(3,t,i.resources);return new n(this.toSubType(t),r,e,this.inNewWindow(t))},n.toSubType=function(t){if(6!==t.length)return t[2];switch(t[2]){case Tu.DIAGRAM_LEGACY:return Tu.DIAGRAM;case Tu.PAGE_LEGACY:case Tu.PAGE_INPLACE_LEGACY:return Tu.PAGE}},n.inNewWindow=function(t){if(6!==t.length)return!!t[4];switch(t[2]){case Tu.DIAGRAM_LEGACY:return!1;case Tu.PAGE_LEGACY:return!0;case Tu.PAGE_INPLACE_LEGACY:return!1}},n}(gn),Nu={TOP:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,LEFT:4,LEFT_TOP:5,LEFT_MIDDLE:6,LEFT_BOTTOM:7,RIGHT:8,RIGHT_TOP:9,RIGHT_MIDDLE:10,RIGHT_BOTTOM:11,BOTTOM:12,BOTTOM_LEFT:13,BOTTOM_CENTER:14,BOTTOM_RIGHT:15,OVER:16},Iu=function(){function t(){}return t.attach=function(t,n,i,r,e,u,s){var h=t.width,o=t.height,a=0;switch(s){case Nu.LEFT:case Nu.LEFT_TOP:case Nu.LEFT_MIDDLE:case Nu.LEFT_BOTTOM:(a=n.left-h-i)<i&&e-i<(a=n.right+i)+h&&(a=i);break;case Nu.RIGHT:case Nu.RIGHT_TOP:case Nu.RIGHT_MIDDLE:case Nu.RIGHT_BOTTOM:e-i<(a=n.right+i)+h&&(a=n.left-h-i)<i&&(a=e-h-i);break;case Nu.TOP:case Nu.TOP_LEFT:case Nu.BOTTOM:case Nu.BOTTOM_LEFT:a=this.adjust(n.left,h,i,e);break;case Nu.TOP_RIGHT:case Nu.BOTTOM_RIGHT:a=this.adjust(n.right-h,h,i,e);break;case Nu.TOP_CENTER:case Nu.BOTTOM_CENTER:case Nu.OVER:a=this.adjust(.5*(n.left+n.right-h),h,i,e)}var c=0;switch(s){case Nu.LEFT:case Nu.LEFT_TOP:case Nu.RIGHT:case Nu.RIGHT_TOP:c=this.adjust(n.top,o,r,u);break;case Nu.LEFT_MIDDLE:case Nu.RIGHT_MIDDLE:case Nu.OVER:c=this.adjust(.5*(n.top+n.bottom-o),o,r,u);break;case Nu.LEFT_BOTTOM:case Nu.RIGHT_BOTTOM:c=this.adjust(n.bottom,o,r,u);break;case Nu.TOP:case Nu.TOP_LEFT:case Nu.TOP_RIGHT:case Nu.TOP_CENTER:(c=n.top-o-r)<r&&u<(c=n.bottom+r)+o&&(c=r);break;case Nu.BOTTOM:case Nu.BOTTOM_LEFT:case Nu.BOTTOM_RIGHT:case Nu.BOTTOM_CENTER:u-r<(c=n.bottom+r)+o&&(c=n.top-o-r)<r&&(c=u-o-r)}t.position.set(a,c)},t.adjust=function(t,n,i,r){return t<i?r-i<t+n?.5*(r-n):i:r-i<t+n?r<n?.5*(r-n):r-n-i:t},t}(),Cu={NONE:0,ESC:1,CLICK_OUTSIDE:2},Au={DIRTY:0,CLEAN:1},Ru=function(){function n(t,n){var i;this.p=t,this.xn=n,n.enable&&(this.rs=this.newUtil()),this.Ar=Ei(null!==(i=n.mode)&&void 0!==i?i:Au.DIRTY,Au),this.es=!0,this.bn=!1}return Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Ar},set:function(t){this.Ar=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"constraint",{get:function(){var t,n,i=this.Ni;return null==i&&(i=null!==(n=null===(t=this.xn)||void 0===t?void 0:t.constraint)&&void 0!==n?n:this.newConstraint(),this.Ni=i),i},set:function(t){this.Ni=t},enumerable:!1,configurable:!0}),n.prototype.newConstraint=function(){var t=this;return function(n,i,r,e){t.toConstrained(n,i,r,e)}},n.prototype.isDirty=function(){return this.bn},n.prototype.isClean=function(){return!this.bn},n.prototype.toClean=function(){this.bn&&(this.bn=!1)},n.prototype.newUtil=function(){var n=this,i=new t.Point,r=this.p,e=r.position;return new ar({bind:r,checker:{start:function(t){if(t.target!==r)return!1;i.copyFrom(t.data.global),r.toLocal(i,void 0,i,!0);var n=i.x,e=i.y;return!(n<0||e<0||r.width<n||r.height<e)}},on:{start:function(){i.copyFrom(e)},move:function(t,u,s){i.set(i.x+u,i.y+s),n.bn||(n.bn=!0,r.setX(e.x),r.setY(e.y));var h=r.layer;null!=h&&n.constraint(r,h,i.x,i.y)}}})},n.prototype.toConstrained=function(i,r,e,u){var s,h=i.position;if(r){var o=i.getBounds(!1,null!==(s=n.WORK_BOUNDS)&&void 0!==s?s:n.WORK_BOUNDS=new t.Rectangle),a=o.x+e-h.x,c=o.y+u-h.y,f=Math.min(Math.max(0,a),r.width-o.width),l=Math.min(Math.max(0,c),r.height-o.height);h.set(e+f-a,u+l-c)}else h.set(e,u)},n}(),Lu={MODAL:0,MODELESS:1,MENU:2},yu={MODAL:"MODAL",MODELESS:"MODELESS",MENU:"MENU"},ku=function(){function n(){}return n.apply=function(t,n){var i=this;t.on(Yi.down,(function(r){if(r.target===t){var e=i.point;e.copyFrom(r.data.global),t.toLocal(e,void 0,e,!0);var u=e.x,s=e.y;(u<0||s<0||t.width<u||t.height<s)&&setTimeout((function(){n(r)}),0)}}))},n.point=new t.Point,n}(),xu=function(){function t(t){this.us=null,this.ss=null==(null==t?void 0:t.parent)?et.last():null}return Object.defineProperty(t.prototype,"picked",{get:function(){return this.us},enumerable:!1,configurable:!0}),t.prototype.pick=function(t){var n=this.us;if(null==n){if(!(n=et.getLayerOverlay(t))){var i=this.ss;n=i?i.getLayerOverlay():et.last().getLayerOverlay()}this.us=n}return n},t}(),Bu=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i,r,e=this;n.prototype.init.call(this,t),this.hs=function(){e.onPrerender()},this.us=null;var u=this.theme,s=Ei(null!==(i=null==t?void 0:t.mode)&&void 0!==i?i:u.getMode(),Lu);this.Ar=s,this.os=null!==(r=null==t?void 0:t.sticky)&&void 0!==r?r:u.isSticky(s);var h=this.toCloseOn(s,u,t);switch(this.cs=h,this.Tt=this.toAlign(s,u,t),this.fs=new xu,this.ir=new Ru(this,this.toGestureOptions(s,u,t)),this.visible=!1,s){case Lu.MODAL:this.state.addAll(ot.FOCUS_ROOT,yu.MODAL);break;case Lu.MODELESS:this.state.add(yu.MODELESS);break;case Lu.MENU:this.state.addAll(ot.FOCUS_ROOT,yu.MENU)}h&Cu.CLICK_OUTSIDE&&ku.apply(this,(function(){e.onCloseOn()}))},i.prototype.toCloseOn=function(t,n,i){var r=null==i?void 0:i.closeOn;if(null==r)return n.closeOn(t);if(Lt(r)){for(var e=Cu.NONE,u=0,s=r.length;u<s;++u)e|=Cu[r[u]];return e}return ct(r)?Cu[r]:r},i.prototype.toAlign=function(t,n,i){var r=null==i?void 0:i.align;return null===r?null:void 0===r?n.getAlign(t):Ei(r,Nu)},Object.defineProperty(i.prototype,"mode",{get:function(){return this.Ar},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"align",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"algin",{set:function(t){this.Tt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gesture",{get:function(){return this.ir},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"layer",{get:function(){return this.us},enumerable:!1,configurable:!0}),i.prototype.toGestureOptions=function(t,n,i){var r=null==i?void 0:i.gesture;return!0===r?{enable:!0,mode:n.getGestureMode(t)}:!1===r?{enable:!1,mode:n.getGestureMode(t)}:null!=r?(void 0===r.enable&&(r.enable=n.isGestureEnabled(t)),void 0===r.mode&&(r.mode=n.getGestureMode(t)),r):{enable:n.isGestureEnabled(t),mode:n.getGestureMode(t)}},i.prototype.onParentResize=function(t,i,r){if(this.isOpened()){var e=this.us;if(null!=e){var u=this.ir;if(u.isDirty()){var s=this.position;u.constraint(this,e,s.x,s.y)}}}n.prototype.onParentResize.call(this,t,i,r)},i.prototype.getAnimation=function(){var t,n,i=this,r=this.gi;return void 0===r&&((r=null!==(n=null===(t=this.xn)||void 0===t?void 0:t.animation)&&void 0!==n?n:this.theme.newAnimation(this.Ar))&&(r.target=this,r.on("end",(function(t){i.onAnimationEnd(t)}))),this.gi=r),r},i.prototype.onAnimationEnd=function(t){if(t)if(this.Ar===Lu.MODELESS)this.hide();else{var n=this.parent;n&&n.removeChild(this)}else{var i=et.getLayer(this);if(i){var r=i.getFocusController();this.ls=r.get(),r.focus(this.findFirstFocusable(r)||this)}}},i.prototype.findFirstFocusable=function(t){return t.find(this,!1,!0,!0)},i.prototype.open=function(t){var n=this,i=this.vs;if(null==i){i=new Promise((function(t,i){n.bs=t,n.gs=i})),this.vs=i,this.ws=t;var r=null;switch(this.Ar){case Lu.MODAL:case Lu.MENU:(r=this.fs.pick(this)).stage.addChild(this);break;case Lu.MODELESS:r=et.getLayer(this),this.show()}this.us=r;var e=this.ir;if(e.mode===Au.CLEAN&&e.toClean(),null!=r)if(e.isClean()){var u=r.renderer,s=this.hs;this.os?u.on("prerender",s):u.once("prerender",s)}else{var h=this.position;e.constraint(this,r,h.x,h.y)}this.onOpen()}return i},i.prototype.onPrerender=function(){var n,r=this.us;if(null!=r){var e=this.Tt,u=this.ws;if(null!=e&&null!=u){var s=this.Ar,h=u.getBounds(!1,null!==(n=i.WORK_BOUNDS)&&void 0!==n?n:i.WORK_BOUNDS=new t.Rectangle),o=this.theme;Iu.attach(this,h,o.getOffsetX(s),o.getOffsetY(s),r.width,r.height,e)}else this.position.set(.5*(r.width-this.width),.5*(r.height-this.height))}},i.prototype.onOpen=function(){this.emit("open",this);var t=this.getAnimation();t?t.start():this.Ar===Lu.MENU&&(this.visible=!0,this.onAnimationEnd(!1))},i.prototype.isOpened=function(){return null!=this.vs},i.prototype.close=function(){this.doReject()},i.prototype.doResolve=function(t){var n=this.bs;n&&(this.vs=void 0,this.bs=void 0,this.gs=void 0,this.onClose(),n(t))},i.prototype.doReject=function(t){var n=this.gs;n&&(this.vs=void 0,this.bs=void 0,this.gs=void 0,this.onClose(),n(t))},i.prototype.onClose=function(){var t=this.us,n=this.ls;if(null!=n)if(this.ls=null,t){var i=et.getLayer(n);null!=i&&t!==i&&i.view.focus(),t.getFocusController().focus(n)}else this.blur(!0);else this.blur(!0);t&&(t.renderer.off("prerender",this.hs),this.us=null),this.ws=null;var r=this.getAnimation();r?r.start(!0):(this.visible=!1,this.onAnimationEnd(!0)),this.emit("close",this)},i.prototype.onKeyDown=function(t){return this.cs&Cu.ESC&&Ki.isCancelKey(t)&&this.onCloseOn(),n.prototype.onKeyDown.call(this,t)},i.prototype.onCloseOn=function(){this.close()},i.prototype.containsGlobalPoint=function(t){switch(this.Ar){case Lu.MODAL:case Lu.MENU:return!0;case Lu.MODELESS:return n.prototype.containsGlobalPoint.call(this,t)}},i.prototype.getType=function(){return"DDialog"},i}($i),_u={VERTICAL:0,HORIZONTAL:1},Pu=function(t){function n(n){var i=t.call(this,n)||this;return i.visible=!1,i}return _(n,t),n.prototype.getType=function(){return"DLayoutSpace"},n}($i),Uu=function(t){return t instanceof $i&&(t.visible||t instanceof Pu)},Fu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n);var i=this.theme;this.Xr=function(t,n){var i,r,e=null==n?void 0:n.margin;if(null!=e){if(wn(e))return{horizontal:e,vertical:e};var u=t.getMargin();return{horizontal:null!==(i=e.horizontal)&&void 0!==i?i:u,vertical:null!==(r=e.vertical)&&void 0!==r?r:u}}return{horizontal:u=t.getMargin(),vertical:u}}(i,n),this.Yt=function(t,n){var i=null==n?void 0:n.direction;return null!=i?ct(i)?_u[i]:i:t.getDirection()}(i,n),this.ps=function(t,n){var i=null==n?void 0:n.corner;if(null!=i&&!wn(i)){var r=i.adjust;if(null!=r)return r}return t.getCornerAdjust()}(i,n),this.Os=function(t,n){if(n){var i=n.row;if(null!=i)return i;var r=n.column;if(null!=r)return r}return t.getMultiplicity()}(i,n),this.ti=function(t,n){var i;return null!==(i=null==n?void 0:n.reverse)&&void 0!==i?i:t.getReverse()}(i,n)},Object.defineProperty(n.prototype,"margin",{get:function(){return this.Xr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"multiplicity",{get:function(){return this.Os},enumerable:!1,configurable:!0}),n.prototype.getWeightTotal=function(){for(var t=this.children,n=0,i=this.Os,r=this.ti,e=0,u=t.length;e<u;){for(var s=-1,h=0;h<i&&e+h<u;++h){var o=t[r?u-1-(e+h):e+h];if(Uu(o)){var a=o.getClearType();if(0!==h&&a&Ui.BEFORE)break;if(s=Math.max(s,o.weight),a&&Ui.AFTER){h+=1;break}}else e+=1,h-=1}e+=h,0<=s&&(n+=s)}return n},n.prototype.getSpaceLeft=function(t,n){var i=this.children,r=this.Os,e=this.ti;if(this.Yt===_u.VERTICAL){for(var u=t,s=0,h=0,o=i.length;h<o;){for(var a=0,c=-1,f=0;f<r&&h+f<o;++f){var l=i[e?o-1-(h+f):h+f];if(Uu(l)){var v=l.getClearType();if(0!==f&&v&Ui.BEFORE)break;if(a=(c=Math.max(c,l.weight))<0?Math.max(a,l.height+s):s,v&Ui.AFTER){f+=1;break}}else h+=1,f-=1}h+=f,u-=a,s=n}return Math.max(0,u)}for(u=t,s=0,h=0,o=i.length;h<o;){var b=0;for(c=-1,f=0;f<r&&h+f<o;++f)if(l=i[e?o-1-(h+f):h+f],Uu(l)){if(v=l.getClearType(),0!==f&&v&Ui.BEFORE)break;if(b=(c=Math.max(c,l.weight))<0?Math.max(b,l.width+s):s,v&Ui.AFTER){f+=1;break}}else h+=1,f-=1;h+=f,u-=b,s=n}return Math.max(0,u)},n.prototype.calcSpaceLeft=function(t,n,i,r){return t?0:this.getSpaceLeft(n-i,r)},n.prototype.onRefit=function(){var i=this.children,r=this.Vn,e=r.getTop(),u=r.getBottom(),s=r.getLeft(),h=r.getRight(),o=this.Xr,a=o.vertical,c=o.horizontal,f=this.getWeightTotal(),l=this.Os,v=this.ti,b=this._n,d=null;if(this.ps){var g=4+(i.length<<1);(null==n.CORNER_ADJUST_WORK||n.CORNER_ADJUST_WORK.length<g)&&(n.CORNER_ADJUST_WORK=new Float32Array(g)),(d=n.CORNER_ADJUST_WORK)[0]=-2,d[1]=-2,d[g-2]=-3,d[g-1]=-3}if(this.Yt===_u.VERTICAL){var m=0,w=e-a;if(0<f){for(var p=1/f,O=this.calcSpaceLeft(b.height.isOn,this.height,e+u,a),D=0,E=i.length;D<E;){for(var M=s-c,S=0,T=0;T<l&&D+T<E;++T){var j=i[v?E-1-(D+T):D+T];if(Uu(j)){var N=j.getClearType();if(0!==T&&N&Ui.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.height=O*(F*p)),M+=c+j.width,S=Math.max(S,j.height),N&Ui.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1}w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],Uu(j)){var I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2;if(!((N=j.getClearType())&Ui.BEFORE)){var R=this.findRowIndexPrevious(H,C,d);this.hasClearTypeAfter(i,R)||(A=d[R])}var L=-2;if(!(N&Ui.AFTER)){var y=this.findRowIndexNext(H,C,d);this.hasClearTypeBefore(i,y)||(L=d[y])}var k=this.countColumn(H,C,d);j.corner.mask=this.toCornerMaskColumn(A,I,L,k)}}else{for(D=0,E=i.length;D<E;){for(M=s-c,S=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Uu(j)){if(N=j.getClearType(),0!==T&&N&Ui.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.height=0),M+=c+j.width,S=Math.max(S,j.height),N&Ui.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1;w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)j=i[v?E-1-D:D],Uu(j)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2,(N=j.getClearType())&Ui.BEFORE||(R=this.findRowIndexPrevious(H,C,d),this.hasClearTypeAfter(i,R)||(A=d[R])),L=-2,N&Ui.AFTER||(y=this.findRowIndexNext(H,C,d),this.hasClearTypeBefore(i,y)||(L=d[y])),k=this.countColumn(H,C,d),j.corner.mask=this.toCornerMaskColumn(A,I,L,k))}}else{var x=0;if(M=s-c,0<f){for(p=1/f,O=this.calcSpaceLeft(b.width.isOn,this.width,s+h,c),D=0,E=i.length;D<E;){w=e-a;var B=0;for(T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Uu(j)){if(N=j.getClearType(),0!==T&&N&Ui.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.width=O*(F*p)),B=Math.max(B,j.width),w+=a+j.height,N&Ui.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1;M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],Uu(j)){I=d[0+(H=2+(D<<1))],C=d[H+1];var _=-2;(N=j.getClearType())&Ui.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1]));var P=-2;N&Ui.AFTER||(y=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,y)||(P=d[y+1]));var U=this.countRow(H,I,d);j.corner.mask=this.toCornerMaskRow(_,C,P,U)}}else{for(D=0,E=i.length;D<E;){for(w=e-a,B=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Uu(j)){var F;if(N=j.getClearType(),0!==T&&N&Ui.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.width=0),B=Math.max(B,j.width),w+=a+j.height,N&Ui.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else{var G;null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1}M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D){var H;j=i[v?E-1-D:D],Uu(j)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],_=-2,(N=j.getClearType())&Ui.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1])),P=-2,N&Ui.AFTER||(y=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,y)||(P=d[y+1])),U=this.countRow(H,I,d),j.corner.mask=this.toCornerMaskRow(_,C,P,U))}}}t.prototype.onRefit.call(this)},n.prototype.hasClearTypeBefore=function(t,n){return this.hasClearType(t,n,Ui.BEFORE)},n.prototype.hasClearTypeAfter=function(t,n){return this.hasClearType(t,n,Ui.AFTER)},n.prototype.hasClearType=function(t,n,i){if(2<=n){var r=n-2>>1;if(0<=r&&r<t.length){var e=t[r];if(e instanceof $i)return!!(e.getClearType()&i)}}return!1},n.prototype.findColumnIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r]!==n)return r;return 0},n.prototype.findColumnIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s]!==u)return s-2;return r}}return i.length-2},n.prototype.countRow=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r]!==n)return i[r-2+1]+1;return 0},n.prototype.findRowIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r+1]!==n)return r;return 0},n.prototype.findRowIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r+1];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s+1]!==u)return s-2;return r}}return i.length-2},n.prototype.countColumn=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r+1]!==n)return i[r-2+0]+1;return 0},n.prototype.toCornerMaskColumn=function(t,n,i,r){var e=Si.NONE;return t+1<n&&0===n&&(e|=Si.TOP_LEFT),i+1<n&&0===n&&(e|=Si.BOTTOM_LEFT),t<n&&n+1===r&&(e|=Si.TOP_RIGHT),i<n&&n+1===r&&(e|=Si.BOTTOM_RIGHT),Si.ALL&~e},n.prototype.toCornerMaskRow=function(t,n,i,r){var e=Si.NONE;return t+1<n&&0===n&&(e|=Si.TOP_LEFT),i+1<n&&0===n&&(e|=Si.TOP_RIGHT),t<n&&n+1===r&&(e|=Si.BOTTOM_LEFT),i<n&&n+1===r&&(e|=Si.BOTTOM_RIGHT),Si.ALL&~e},n.prototype.addSpace=function(t){return this.addChild(new Pu(t))},n.prototype.getType=function(){return"DLayout"},n.CORNER_ADJUST_WORK=null,n}($i),Gu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutVertical"},n}(Fu),Hu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredContent"},n}(Gu),zu={CLICKED:0,DOUBLE_CLICKED:1},Vu=function(){function t(t){this.tn=t}return t.prototype.getImageAlignHorizontal=function(){return this.tn.getSecondaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.tn.getSecondaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.tn.getSecondaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.tn.getSecondaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.tn.getSecondaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.tn.getSecondaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.tn.getSecondaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.tn.getSecondaryImageSource(t)},t}(),Wu=function(){function t(t){this.tn=t}return t.prototype.getImageAlignHorizontal=function(){return this.tn.getTertiaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.tn.getTertiaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.tn.getTertiaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.tn.getTertiaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.tn.getTertiaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.tn.getTertiaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.tn.getTertiaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.tn.getTertiaryImageSource(t)},t}(),Xu={LEFT:0,CENTER:1,RIGHT:2},Ku={TOP:0,MIDDLE:1,BOTTOM:2},Yu={TEXT:0,PADDING:1,BORDER:2},Ju=function(){function n(n,i,r,e){var u=this;this.p=n,this.tn=i,this.Ds=r,this.bt=null,this.Tt=function(t,n){var i,r,e,u=null==n?void 0:n.align;return{with:Ei(null!==(i=null==u?void 0:u.with)&&void 0!==i?i:t.getImageAlignWith(),Yu),vertical:Ei(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getImageAlignVertical(),Ku),horizontal:Ei(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getImageAlignHorizontal(),Xu)}}(i,e),this.Xr=function(t,n){var i,r,e=null==n?void 0:n.margin;return{vertical:null!==(i=null==e?void 0:e.vertical)&&void 0!==i?i:t.getImageMarginVertial(),horizontal:null!==(r=null==e?void 0:e.horizontal)&&void 0!==r?r:t.getImageMarginHorizontal()}}(i,e),this.Es=null==e?void 0:e.tint,this.Ms=new t.Rectangle,this.Ss=null==e?void 0:e.source,this.Ts=null,this.js=function(){u.onUpdate()}}return Object.defineProperty(n.prototype,"image",{get:function(){return this.bt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"align",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Xr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bound",{get:function(){return this.Ms},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"source",{get:function(){return this.Ss},set:function(t){this.Ss!==t&&(this.Ss=t,this.onUpdate())},enumerable:!1,configurable:!0}),n.prototype.computeSource=function(){var t=this.Ss;if(void 0!==t){if(!at(t))return t;var n=t(this.p.state);if(void 0!==n)return n}return this.tn.getImageSource(this.p.state)},n.prototype.onStateChange=function(t,n){this.updateTint()},n.prototype.updateBound=function(){var t=this.Ms,n=this.bt;if(null!=n){n.updateTransform(),n.getLocalBounds(t);var i=t.left,r=t.top,e=t.right,u=t.bottom,s=n.localTransform,h=s.a,o=s.b,a=s.c,c=s.d,f=h*i+a*r,l=o*i+c*r,v=h*e+a*r,b=o*e+c*r,d=h*e+a*u,g=o*e+c*u,m=h*i+a*u,w=o*i+c*u,p=Math.min(f,v,d,m),O=Math.max(f,v,d,m),D=Math.min(l,b,g,w),E=Math.max(l,b,g,w);t.x=p+s.tx,t.y=D+s.ty,t.width=O-p,t.height=E-D}else t.x=0,t.y=0,t.width=0,t.height=0},n.prototype.isTintAware=function(t){return null!=t&&"tint"in t},n.prototype.toTintColor=function(t,n){var i=this.Es;if(i){var r=i.color;if(void 0!==r){if(!at(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintColor(n)},n.prototype.toTintAlpha=function(t,n){var i=this.Es;if(i){var r=i.alpha;if(void 0!==r){if(!at(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintAlpha(n)},n.prototype.updateTint=function(){var t=this.bt;if(t&&this.isTintAware(t)){var n=this.tn,i=this.p.state,r=this.toTintColor(n,i);if(null!=r){var e=!1;t.tint!==r&&(t.tint=r,e=!0);var u=this.toTintAlpha(n,i);return t.alpha!==u&&(t.alpha=u,e=!0),e}}return!1},n.prototype.updateSource=function(){var n=this.computeSource(),i=this.Ts;if(n!==i){this.Ts=n;var r,e=this.p,u=this.bt,s=this.js;if(n instanceof t.Texture)if(i instanceof t.Texture)i.off("update",s),u instanceof t.Sprite&&(u.texture=n,n.on("update",s));else{null!=u&&e.removeChild(u);var h=new t.Sprite(n);(r=e.getOverflowMask())&&(h.mask=r),n.on("update",s),e.addChild(h),this.bt=h}else i instanceof t.Texture?(i.off("update",s),null!=u&&(e.removeChild(u),u.destroy())):null!=u&&e.removeChild(u),null!=n&&((r=e.getOverflowMask())&&(n.mask=r),e.addChild(n)),this.bt=n;return!0}return!1},n.prototype.isRefitable=function(t){return null!=t&&t===this.bt},n.prototype.destroy=function(){var n=this.bt;if(n){this.bt=null;var i=this.Ts;i instanceof t.Texture&&(i.off("update",this.js,this),n.destroy())}},n.prototype.onUpdate=function(){this.p.toDirty(),et.update(this.p)},n}(),Zu=function(){function t(){this.Ns=[],this.j=0,this.Xr=0}return t.prototype.clear=function(){this.Ns.length=0,this.j=0,this.Xr=0,this.Is=void 0},t.prototype.add=function(t,n,i){this.Ns.push(t),this.j+=i+n,this.Xr=i},t.prototype.set=function(t){this.Is=t},Object.defineProperty(t.prototype,"size",{get:function(){return this.j-(null===this.Is?this.Xr:0)},enumerable:!1,configurable:!0}),t}(),qu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t,n){var i=this.Ns,r=n-t;if(void 0!==this.Is)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.height,h.image.y=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.height,h.image.y=r}},n}(Zu),Qu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.add=function(t,n,i){this.Ns.push(t),this.j=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.Ns,u=0,s=e.length;u<s;++u){var h=e[u];h.image.x=r-.5*h.bound.width}},n}(Zu),$u=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t){var n=this.Ns,i=t;if(void 0!==this.Is)for(var r=0,e=n.length;r<e;++r)(u=n[r]).image.x=i,i+=u.bound.width+u.margin.horizontal;else for(r=0,e=n.length;r<e;++r){var u;i+=(u=n[r]).margin.horizontal,u.image.x=i,i+=u.bound.width}},n}(Zu),ts=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.add=function(t,n,i){this.Ns.push(t),this.j=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.Ns,u=0,s=e.length;u<s;++u){var h=e[u];h.image.y=r-.5*h.bound.height}},n}(Zu),ns=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t,n){var i=this.Ns,r=n-t;if(void 0!==this.Is)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.width,h.image.x=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.width,h.image.x=r}},n}(Zu),is=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t){var n=this.Ns,i=t;if(void 0!==this.Is)for(var r=0,e=0,u=n.length;e<u;++e)(s=n[e]).image.y=r+i,i+=s.bound.height,r=s.margin.vertical;else for(e=0,u=n.length;e<u;++e){var s;i+=(s=n[e]).margin.vertical,s.image.y=i,i+=s.bound.height}},n}(Zu),rs=function(){function t(){this.left=new $u,this.center=new Qu,this.right=new ns,this.top=new is,this.middle=new ts,this.bottom=new qu}return t.prototype.clear=function(){this.left.clear(),this.center.clear(),this.right.clear(),this.top.clear(),this.middle.clear(),this.bottom.clear(),this.text=void 0},t.prototype.add=function(t){if(null!=t.image){var n=t.bound,i=n.width,r=n.height,e=t.margin,u=e.horizontal,s=e.vertical,h=t.align;switch(h.horizontal){case Xu.LEFT:this.left.add(t,i,u);break;case Xu.CENTER:this.center.add(t,i,u);break;case Xu.RIGHT:this.right.add(t,i,u)}switch(h.vertical){case Ku.TOP:this.top.add(t,r,s);break;case Ku.MIDDLE:this.middle.add(t,r,s);break;case Ku.BOTTOM:this.bottom.add(t,r,s)}}},t.prototype.set=function(t){this.left.set(t),this.center.set(t),this.right.set(t),this.top.set(t),this.middle.set(t),this.bottom.set(t),this.text=t},Object.defineProperty(t.prototype,"width",{get:function(){var t=this.text,n=this.left.size,i=this.center.size,r=this.right.size;return void 0!==t?null!==t?Math.max(n+t.width+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var t=this.text,n=this.top.size,i=this.middle.size,r=this.bottom.size;return void 0!==t?null!==t?Math.max(n+t.height+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,n,i,r,e,u,s){var h=this.left,o=this.center,a=this.right,c=this.top,f=this.middle,l=this.bottom,v=this.text;if(void 0!==v){var b=h.size,d=a.size,g=c.size,m=l.size,w=0,p=0,O=0;switch(null!=v&&(p=v.width,O=v.height),e.horizontal){case Xu.LEFT:w=t+b;break;case Xu.CENTER:w=t+.5*(u-t-i-(b+p+d))+b;break;case Xu.RIGHT:w=u-i-d-p}var D=0;switch(e.vertical){case Ku.TOP:D=n+g;break;case Ku.MIDDLE:D=n+.5*(s-n-r-(g+O+m))+g;break;case Ku.BOTTOM:D=s-r-m-O}null!=v&&(v.position.set(w,D),v.setClippingDelta(b+d,g+m)),h.execute(w-b),o.execute(0,0,2*w+p),a.execute(0,w+p+d),c.execute(D-g),f.execute(0,0,2*D+O),l.execute(0,D+O+m)}else h.execute(t),o.execute(t,i,u),a.execute(i,u),c.execute(n),f.execute(n,r,s),l.execute(r,s)},t}(),es=function(){function t(){this.text=new rs,this.padding=new rs,this.border=new rs}return t.prototype.clear=function(){this.text.clear(),this.padding.clear(),this.border.clear()},t.prototype.add=function(t){if(t.image)switch(t.align.with){case Yu.TEXT:this.text.add(t);break;case Yu.PADDING:this.padding.add(t);break;case Yu.BORDER:this.border.add(t)}},t.prototype.set=function(t){this.text.set(t)},t.prototype.execute=function(t,n,i,r){var e=t.getLeft(),u=t.getTop(),s=t.getRight(),h=t.getBottom();null==i&&(i=e+this.width+s),null==r&&(r=u+this.height+h),this.border.execute(0,0,0,0,n,i,r),this.padding.execute(e,u,s,h,n,i,r),this.text.execute(e,u,s,h,n,i,r)},Object.defineProperty(t.prototype,"width",{get:function(){return Math.max(this.border.width,this.padding.width,this.text.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return Math.max(this.border.height,this.padding.height,this.text.height)},enumerable:!1,configurable:!0}),t}(),us=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){this.clear(),this.beginFill(16777215,1),this.drawRect(0,0,n,i),this.endFill()},n}(t.Graphics),ss=function(){function t(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r}return t.prototype.set=function(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r},t}(),hs=function(){function t(){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.characters=[],this.clipped=!1,this.x=0,this.y=0}return t.prototype.start=function(t,n){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.clipped=!1,this.x=0,this.y=.5*(t-n)},t.prototype.isPushable=function(t,n){return!(t<this.x+n.advance&&!(n.type&be.SPACE))},t.prototype.isPushableAtNewLine=function(t,n,i){return this.y+1.5*n+.5*i<=t},t.prototype.push=function(t,n){var i=this.x;this.x+=t.advance;var r=this.y,e=this.count,u=this.characters;e<u.length?u[e].set(i,r,t,n):u.push(new ss(i,r,t,n)),this.count+=1,this.countPerLine+=1},t.prototype.newLine=function(t){this.width=Math.max(this.width,this.x),this.x=0,this.y+=t,this.countPerLine=0},t.prototype.wordWrap=function(t){var n=this.countPerLine,i=this.characters;if(0<n){for(var r=this.count,e=r-1,u=r-n;u<e;--e){var s=i[e];if(s.wrappable){var h=s.character.advance,o=s.y+t;s.x=0,s.y=o;for(var a=e+1;a<r;++a)(s=i[a]).x=h,s.y=o,h+=s.character.advance;return this.x=h,this.y=o,this.countPerLine=r-e,!0}}var c=i[r-1];return c.x=0,c.y=c.y+t,this.x=c.character.advance,this.y=c.y,this.countPerLine=1,!1}return!1},t.prototype.pop=function(){var t=this.countPerLine,n=this.characters;if(0<t){var i=n[this.count-1];return this.x-=i.character.advance,this.count-=1,this.countPerLine-=1,!0}return!1},t.prototype.end=function(t,n){this.newLine(t),this.y-=.5*(t-n),this.height=this.y},t}(),os={NONE:0,NORMAL:1,BREAK_ALL:2},as="\n",cs=function(){function t(){}return t.measure=function(n,i,r){var e=t.RESULT||new hs;if(t.RESULT=e,null!=i){var u=b.from(n),s=i.font.height,h=r.lineHeight,o=r.enable,a=r.width,c=r.height,f=r.wordWrap;switch(e.start(h,s),f){case os.BREAK_ALL:o?this.measure1(u,a,c,s,h,i,e):this.measure2(u,a,h,i,e);break;case os.NORMAL:var l=this.newLineBreaker(n);l?o?this.measure1a(l,u,a,c,s,h,i,e):this.measure2a(l,u,a,h,i,e):o?this.measure1b(u,a,c,s,h,i,e):this.measure2b(u,a,h,i,e);break;default:o?this.measure3(u,a,h,i,e):this.measure4(u,h,i,e)}e.end(h,s)}else e.start(0,0),e.end(0,0);return e},t.measure1a=function(t,n,i,r,e,u,s,h){for(var o=t.next();n.hasNext();){var a=n.position,c=n.next();if(c===as)h.newLine(u);else{var f=s.get(c);if(null==f)continue;o=this.advance(a,o,t);var l=this.isWrappable1(a,o);h.isPushable(i,f)?h.push(f,l):h.isPushableAtNewLine(r,u,e)?(h.push(f,l),h.wordWrap(u)):this.measure5(n,i,u,s,h,!0)}}},t.measure1b=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===as)s.newLine(e);else{var o=u.get(h);if(null==o)continue;var a=this.isWrappable2(s,o);s.isPushable(n,o)?s.push(o,a):s.isPushableAtNewLine(i,e,r)?(s.push(o,a),s.wordWrap(e)):this.measure5(t,n,e,u,s,!0)}}},t.measure1=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===as)s.newLine(e);else{var o=u.get(h);if(null==o)continue;s.isPushable(n,o)?s.push(o,!0):s.isPushableAtNewLine(i,e,r)?(s.newLine(e),s.push(o,!0)):this.measure5(t,n,e,u,s,!0)}}},t.measure2a=function(t,n,i,r,e,u){for(var s=t.next();n.hasNext();){var h=n.position,o=n.next();if(o===as)u.newLine(r);else{var a=e.get(o);if(null==a)continue;s=this.advance(h,s,t);var c=this.isWrappable1(h,s);u.isPushable(i,a)?u.push(a,c):(u.push(a,c),u.wordWrap(r))}}},t.measure2b=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===as)e.newLine(i);else{var s=r.get(u);if(null==s)continue;var h=this.isWrappable2(e,s);e.isPushable(n,s)?e.push(s,h):(e.push(s,h),e.wordWrap(i))}}},t.measure2=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===as)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)||e.newLine(i),e.push(s,!1)}}},t.measure3=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===as)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)?e.push(s,!1):this.measure5(t,n,i,r,e,!1)}}},t.measure4=function(t,n,i,r){for(;t.hasNext();){var e=t.next();if(e===as)r.newLine(n);else{var u=i.get(e);if(null==u)continue;r.push(u,!1)}}},t.measure5=function(t,n,i,r,e,u){e.clipped=!0;var s=r.get("...");if(null!=s){for(;!e.isPushable(n,s)&&e.pop(););e.isPushable(n,s)&&e.push(s,!1)}if(u)t.close();else for(;t.hasNext();)if(t.next()===as){e.newLine(i);break}},t.isWrappable2=function(t,n){if(t.countPerLine<=0)return!1;var i=t.characters[t.count-1].character.type,r=n.type;return i&be.SPACE?!(r&be.SPACE||i&be.NON_BREAKING):!(r&be.SPACE||i&be.NON_BREAKING&&r&be.NON_BREAKING)},t.advance=function(t,n,i){return n.done||t<=n.value.end?n:n=i.next()},t.isWrappable1=function(t,n){if(n.done)return!1;var i=n.value;return i.start===t||i.end===t},t.newLineBreaker=function(t){return"css-line-break"in window?window["css-line-break"].LineBreaker(t,{lineBreak:"strict",wordBreak:"normal"}):null},t.RESULT=null,t}(),fs=function(t){function n(){var n=t.call(this,new Float32Array(64),new Float32Array(64),new Uint16Array(48))||this;return n.width=0,n.height=0,n.clipped=!1,n}return _(n,t),n.prototype.update=function(t,n,i){var r=this.getBuffer("aVertexPosition"),e=this.getBuffer("aTextureCoord"),u=this.getIndex(),s=cs.measure(t,n,i),h=Math.ceil(s.count/8)<<3,o=h<<3;r.data.length<o&&(r.data=new Float32Array(o),e.data=new Float32Array(o));var a=6*h;u.data.length<a&&(u.data=new Uint16Array(a));var c=r.data,f=e.data,l=u.data;if(null!=n){for(var v=s.count,b=s.characters,d=0;d<v;++d){var g=b[d],m=g.x,w=g.y,p=g.character,O=n.width,D=n.height;this.writeCharacter(c,f,l,d,m,w,p,O,D)}d=v;for(var E=c.length>>3;d<E;++d)this.writeCharacterEmpty(c,f,l,d);this.width=s.width,this.height=s.height,this.clipped=s.clipped}else{for(d=0,E=c.length>>3;d<E;++d)this.writeCharacterEmpty(c,f,l,d);this.width=0,this.height=0,this.clipped=!1}r.update(),e.update(),u.update()},n.prototype.writeCharacter=function(t,n,i,r,e,u,s,h,o){var a=s.x,c=s.y,f=s.width,l=s.height,v=e+(a-s.origin.x),b=u,d=v+f,g=b+l,m=r<<3;t[m+0]=v,t[m+1]=b,t[m+2]=d,t[m+3]=b,t[m+4]=d,t[m+5]=g,t[m+6]=v,t[m+7]=g;var w=a/h,p=c/o,O=(a+f)/h,D=(c+l)/o;n[m+0]=w,n[m+1]=p,n[m+2]=O,n[m+3]=p,n[m+4]=O,n[m+5]=D,n[m+6]=w,n[m+7]=D;var E=6*r,M=r<<2;i[E+0]=M+0,i[E+1]=M+1,i[E+2]=M+3,i[E+3]=M+1,i[E+4]=M+2,i[E+5]=M+3},n.prototype.writeCharacterEmpty=function(t,n,i,r){var e=r<<3;t[e+0]=0,t[e+1]=0,t[e+2]=0,t[e+3]=0,t[e+4]=0,t[e+5]=0,t[e+6]=0,t[e+7]=0,n[e+0]=0,n[e+1]=0,n[e+2]=0,n[e+3]=0,n[e+4]=0,n[e+5]=0,n[e+6]=0,n[e+7]=0;var u=6*r,s=r<<2;i[u+0]=s+0,i[u+1]=s+1,i[u+2]=s+3,i[u+3]=s+1,i[u+4]=s+2,i[u+5]=s+3},n}(t.MeshGeometry),ls=function(){function t(t,n){var i,r,e,u,s,h,o,a,c,f;this.R=0,this.Cs=-1;var l=this.getDefaultOptions();t?(this.Tt=null!==(i=t.align)&&void 0!==i?i:l.align,this.As=null!==(r=t.fontFamily)&&void 0!==r?r:l.fontFamily,this.Rs=null!==(e=t.fontSize)&&void 0!==e?e:l.fontSize,this.Ls=null!==(u=t.fontStyle)&&void 0!==u?u:l.fontStyle,this.ys=null!==(s=t.fontVariant)&&void 0!==s?s:l.fontVariant,this.ks=null!==(h=t.fontWeight)&&void 0!==h?h:l.fontWeight,this.C=null!==(o=t.fill)&&void 0!==o?o:l.fill,this.Jt=null!==(a=t.clipping)&&void 0!==a?a:l.clipping,this.xs=Ei(null!==(c=t.wordWrap)&&void 0!==c?c:l.wordWrap,os),this.Bs=null!==(f=t.lineHeight)&&void 0!==f?f:l.lineHeight):(this.Tt=l.align,this.As=l.fontFamily,this.Rs=l.fontSize,this.Ls=l.fontStyle,this.ys=l.fontVariant,this.ks=l.fontWeight,this.C=l.fill,this.Jt=l.clipping,this.xs=Ei(l.wordWrap,os),this.Bs=l.lineHeight),this._s=-1,this.Ps="",this.Us="",this.Fs=0,this.Z=n}return t.prototype.getDefaultOptions=function(){var n=t.DEFAULT_OPTIONS;return null==n&&(n=this.newDefaultOptions(),t.DEFAULT_OPTIONS=n),n},t.prototype.newDefaultOptions=function(){var t=Y.getInstance().get("DBase");return{align:"left",fontFamily:t.getFontFamilly(),fontSize:t.getFontSize(),fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fill:t.getColor(new ft),clipping:!0,wordWrap:os.NONE,lineHeight:t.getLineHeight()}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idApproved",{get:function(){return this.Cs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontId",{get:function(){return this.update(),this.Ps},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdApproved",{get:function(){return this.Us},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this.C},set:function(t){this.C!==t&&(this.C=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){this.R+=1,this.Z()},Object.defineProperty(t.prototype,"fillApproved",{get:function(){return this.Fs},enumerable:!1,configurable:!0}),t.prototype.approve=function(){this.update(),this.Cs=this.R,this.Us=this.Ps,this.Fs=this.C},Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this.As},set:function(t){this.As!==t&&(this.As=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.Rs},set:function(t){this.Rs!==t&&(this.Rs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this.Ls},set:function(t){this.Ls!==t&&(this.Ls=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this.ys},set:function(t){this.ys!==t&&(this.ys=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this.ks},set:function(t){this.ks!==t&&(this.ks=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.update=function(){this._s!==this.R&&(this._s=this.R,this.Ps=this.newFontId())},t.prototype.newFontId=function(){return"".concat(this.Ls," ").concat(this.ys," ").concat(this.ks," ").concat(this.Rs,"px ").concat(this.As)},Object.defineProperty(t.prototype,"clipping",{get:function(){return this.Jt},set:function(t){this.Jt!==t&&(this.Jt=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this.xs},set:function(t){this.xs!==t&&(this.xs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.Bs},set:function(t){this.Bs!==t&&(this.Bs=t,this.onChange())},enumerable:!1,configurable:!0}),t}(),vs=function(n){function i(i,r){var e=n.call(this,new fs,new t.MeshMaterial(t.Texture.EMPTY))||this;return e.B=new ls(r,(function(){e.bn=!0,e.Gs=!0,e.au=null,e.Hs()})),e.Is=i,e.zs="",e.bn=!0,e.Gs=!0,e.au=null,e.Vs=0,e.St=0,e.fn=0,e.Jt={enable:!1,wordWrap:os.NONE,width:0,height:0,lineHeight:0,delta:{width:0,height:0}},e.Hs(),e}return _(i,n),i.prototype.Hs=function(){var t=et.getLayer(this);if(t){var n=this.B;if(this.bn){this.bn=!1;var i=this.Is,r=this.zs;this.zs=i;var e=n.fontId,u=n.fontIdApproved,s=n.fontSize,h=n.fill,o=n.fillApproved;n.approve();var a=t.getDynamicFontAtlases();i===r&&e===u&&h===o||(a.add(e,s,h,i),a.remove(u,o,r))}}},Object.defineProperty(i.prototype,"text",{get:function(){return this.Is},set:function(t){this.Is!==t&&(this.Is=t,this.bn=!0,this.Gs=!0,this.Hs())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this.update(),Math.abs(this.scale.x)*this.geometry.width},set:function(t){this.update();var n=this.geometry.width;if(1e-4<n){var i=t/n;this.scale.x=0<=this.scale.x?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.update(),Math.abs(this.scale.y)*this.geometry.height},set:function(t){this.update();var n=this.geometry.height;if(1e-4<n){var i=t/n;this.scale.y=0<=this.scale.y?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clipped",{get:function(){return this.geometry.clipped},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"style",{get:function(){return this.B},enumerable:!1,configurable:!0}),i.prototype.update=function(){this.Hs();var t=this.au;if(null==t){var n=et.getLayer(this);if(n){var i=this.B;null!=(t=n.getDynamicFontAtlases().get(i.fontId,i.fill))&&(this.Vs=t.getRevisionUpdate(),this.au=t,this.texture=t.texture,this.Gs=!0)}}else{var r=t.getRevisionUpdate();r!==this.Vs&&(this.Vs=r,this.Gs=!0)}var e=this.B,u=this.Jt;this.updateClipping(e,u)&&(this.Gs=!0),this.Gs&&(this.Gs=!1,this.geometry.update(this.Is,t,u))},i.prototype.updateClipping=function(t,n){var i=!1,r=t.clipping;n.enable!==r&&(n.enable=r,i=!0);var e=t.wordWrap;n.wordWrap!==e&&(n.wordWrap=e,i=!0);var u=t.lineHeight;if(n.lineHeight!==u&&(n.lineHeight=u,i=!0),r||e){var s=this.parent;if(s instanceof $i){var h=s.width-s.padding.getLeft()-s.padding.getRight()-n.delta.width;n.width!==h&&(n.width=h,i=!0);var o=s.height-s.padding.getTop()-s.padding.getBottom()-n.delta.height;n.height!==o&&(n.height=o,i=!0)}}return i},i.prototype.setClippingDelta=function(t,n){var i=this.Jt.delta;i.width=t,i.height=n},i.prototype._calculateBounds=function(){this.update(),n.prototype._calculateBounds.call(this)},i.prototype._render=function(t){this.update(),n.prototype._render.call(this,t)},i}(t.Mesh),bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u;t.prototype.init.call(this,n);var s=this.theme;this.Ws=null!==(r=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.value)&&void 0!==r?r:s.newTextValue(),this.Xs=this.computeTextValue();var h=null==n?void 0:n.text;this.Ks=null==h?void 0:h.color,this.Ys=null==h?void 0:h.alpha,this.Js=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v=null===(r=null==n?void 0:n.text)||void 0===r?void 0:r.style;return null!=v?{fill:null!==(e=v.fill)&&void 0!==e?e:t.getColor(i),fontSize:null!==(u=v.fontSize)&&void 0!==u?u:t.getFontSize(),fontFamily:null!==(s=v.fontFamily)&&void 0!==s?s:t.getFontFamilly(),fontWeight:null!==(h=v.fontWeight)&&void 0!==h?h:t.getFontWeight(),fontStyle:null!==(o=v.fontStyle)&&void 0!==o?o:t.getFontStyle(),fontVariant:null!==(a=v.fontVariant)&&void 0!==a?a:t.getFontVariant(),clipping:null!==(c=v.clipping)&&void 0!==c?c:t.getTextStyleClipping(),wordWrap:null!==(f=v.wordWrap)&&void 0!==f?f:t.getTextStyleWordWrap(),lineHeight:null!==(l=v.lineHeight)&&void 0!==l?l:t.getLineHeight()}:{fill:t.getColor(i),fontSize:t.getFontSize(),fontFamily:t.getFontFamilly(),fontWeight:t.getFontWeight(),fontStyle:t.getFontStyle(),fontVariant:t.getFontVariant(),clipping:t.getTextStyleClipping(),wordWrap:t.getTextStyleWordWrap(),lineHeight:t.getLineHeight()}}(s,n,this.state),this.Ds=function(t,n){var i,r,e,u=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.align;return{vertical:Ei(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getTextAlignVertical(),Ku),horizontal:Ei(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getTextAlignHorizontal(),Xu)}}(s,n),this.Zs=null!==(e=null==h?void 0:h.formatter)&&void 0!==e?e:s.getTextFormatter(),this.qs=!0,this.Qs=null!==(u=null==n?void 0:n.mask)&&void 0!==u?u:s.isOverflowMaskEnabled(),this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"text",{get:function(){return this.Ws},set:function(t){this.Ws!==t&&(this.Ws=t,this.updateTextValue())},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){},n.prototype.computeTextValue=function(){var t=this.Ws;if(void 0!==t){if(!at(t))return t;var n=t(this.state);if(void 0!==n)return n}return this.theme.getTextValue(this.state)},n.prototype.createOrUpdateText=function(){var t=this.Xs;if(void 0!==t){var n=this.Zs(t,this),i=this.Is;if(null==i){if(0<n.length){var r=this.createText(n);r.visible=this.qs,this.Is=r,this.addChild(r),this.updateTextPosition(r);var e=this.getOverflowMask();e&&(r.mask=e),this.toDirty(),et.update(this)}}else i.text=n,this.toDirty(),et.update(this)}},n.prototype.createText=function(t){return new vs(t,this.Js)},n.prototype.getOverflowMask=function(){return this.Qs?(null==this.ur&&(this.ur=new us(this),this.Hn.add(this.ur),this.toDirty()),this.ur):null},n.prototype.updateTextPosition=function(t){var n=this.Ds,i=this.Vn,r=this._n,e=0,u=i.getLeft(),s=n.horizontal;if(r.width.isOn||s===Xu.LEFT)e=u;else{var h=this.width,o=t.width,a=i.getRight();e=s===Xu.CENTER?u+.5*(h-u-a-o):h-o-a}var c=0,f=i.getTop(),l=n.vertical;if(r.height.isOn||l===Ku.TOP)c=f;else{var v=this.height,b=t.height,d=i.getBottom();c=l===Ku.MIDDLE?f+.5*(v-f-d-b):v-b-d}t.position.set(e,c)},n.prototype.getTextColor=function(t,n){var i=this.Ks;if(void 0!==i){if(!at(i))return i;var r=i(n);if(void 0!==r)return r}return t.getColor(n)},n.prototype.getTextAlpha=function(t,n){var i=this.Ys;if(void 0!==i){if(!at(i))return i;var r=i(n);if(void 0!==r)return r}return t.getAlpha(n)},n.prototype.updateTextColor=function(t){var n=this.theme,i=this.state;t.style.fill=this.getTextColor(n,i),t.alpha=this.getTextAlpha(n,i)},n.prototype.updateTextValue=function(){var t=this.computeTextValue();this.Xs!==t&&(this.Xs=t,this.onTextChange(),this.createOrUpdateText())},n.prototype.updateText=function(){var t=this.Is;t&&(this.updateTextValue(),this.updateTextPosition(t),this.updateTextColor(t))},n.prototype.showText=function(){var t=this.Is;t&&(t.visible=!0),this.qs=!0},n.prototype.hideText=function(){var t=this.Is;t&&(t.visible=!1),this.qs=!1},n.prototype.onReflow=function(){t.prototype.onReflow.call(this),this.updateText()},n.prototype.isRefitable=function(n){return t.prototype.isRefitable.call(this,n)||null!=n&&n===this.Is},n.prototype.applyTitle=function(){var n=this.Is;if(this.Wn.length<=0&&n&&"clipped"in n&&n.clipped){var i=et.getLayer(this);i&&(i.view.title=n.text)}else t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DTextBase"},n.prototype.destroy=function(){var n=this.Is;n&&(this.Is=null,n.destroy());var i=this.ur;i&&(this.ur=null,i.destroy()),t.prototype.destroy.call(this)},n}($i),ds=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){this.$s=this.newImages(this.theme,n),t.prototype.init.call(this,n)},n.prototype.newImages=function(t,n){var i=[];return i.push(this.newImage(t,this.toImageOptions(t,null==n?void 0:n.image))),function(t){return!!t.getSecondaryImageSource}(t)&&i.push(this.newImage(new Vu(t))),function(t){return!!t.getTertiaryImageSource}(t)&&i.push(this.newImage(new Wu(t))),i},n.prototype.toImageOptions=function(t,n){return n},n.prototype.newImage=function(t,n){return new Ju(this,t,this.Ds,n)},Object.defineProperty(n.prototype,"image",{get:function(){return this.$s[0].source},set:function(t){var n=this.$s[0];n.source=t,n.updateSource()},enumerable:!1,configurable:!0}),n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i);for(var r=this.$s,e=0,u=r.length;e<u;++e)r[e].onStateChange(n,i)},n.prototype.updateText=function(){this.updateTextValue(),this.updateTextAndImage()},n.prototype.updateTextAndImage=function(){for(var t,i=this.$s,r=null!==(t=n.LAYOUTER)&&void 0!==t?t:n.LAYOUTER=new es,e=0,u=i.length;e<u;++e){var s=i[e];s.updateSource(),s.updateTint(),s.updateBound(),r.add(s)}var h=this.Is;null!=h?(this.updateTextColor(h),r.set(h)):r.set(null);var o=this._n;r.execute(this.Vn,this.Ds,o.width.isOn?null:this.width,o.height.isOn?null:this.height),r.clear()},n.prototype.isRefitable=function(n){if(t.prototype.isRefitable.call(this,n))return!0;for(var i=this.$s,r=0,e=i.length;r<e;++r)if(i[r].isRefitable(n))return!0;return!1},n.prototype.getType=function(){return"DImageBase"},n.prototype.destroy=function(){for(var n=this.$s,i=0,r=n.length;i<r;++i)n[i].destroy();t.prototype.destroy.call(this)},n}(bs),gs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e=this;t.prototype.init.call(this,n);var u=this.theme;this.th=null!==(i=null==n?void 0:n.toggle)&&void 0!==i?i:u.isToggle(),this.nh=Ei(null!==(r=null==n?void 0:n.when)&&void 0!==r?r:u.getWhen(),zu),this.on(Yi.tap,(function(t){e.onClick(t)})),this.initOnPress();var s=null==n?void 0:n.group;s&&s.add(this)},n.prototype.onShortcut=function(n){this.state.isActionable&&this.activate(n),t.prototype.onShortcut.call(this,n)},Object.defineProperty(n.prototype,"isToggle",{get:function(){return!!this.th},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return!!this.ih},set:function(t){this.ih=t},enumerable:!1,configurable:!0}),n.prototype.initOnPress=function(){var t=this,n=null,i=function(){t.state.isPressed=!1,null!=n&&(n.off(Yi.up,i),n.off(Yi.upoutside,i),n.off(Yi.cancel,i),n=null)};this.on(Yi.down,(function(){if(t.state.isActionable){t.state.isPressed=!0;var r=et.getLayer(t);r&&((n=r.renderer.plugins.interaction).on(Yi.up,i),n.on(Yi.upoutside,i),n.on(Yi.cancel,i))}}))},n.prototype.getType=function(){return"DButton"},n.prototype.onClick=function(t){this.nh===zu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.nh===zu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.th?this.ih&&this.state.isActive||(this.onToggleStart(t),this.onToggleEnd(t)):this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onInactivate=function(t){this.emit("inactive",this)},n.prototype.toggle=function(){this.state.isActionable&&this.th&&(this.onToggleStart(),this.onToggleEnd())},n.prototype.onToggleStart=function(t){this.state.isActive=!this.state.isActive},n.prototype.onToggleEnd=function(t){this.state.isActive?this.onActivate(t):this.onInactivate(t)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.th?this.onToggleStart(t):this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.th?this.onToggleEnd(t):(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1))},n.prototype.onKeyDown=function(n){return Ki.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Ki.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isPressed?i.isPressed||this.onPress():i.isPressed&&this.onUnpress()},n.prototype.onPress=function(){this.emit("press",this)},n.prototype.onUnpress=function(){this.emit("unpress",this)},n.prototype.destroy=function(){var n,i;null===(i=null===(n=this.xn)||void 0===n?void 0:n.group)||void 0===i||i.remove(this),t.prototype.destroy.call(this)},n}(ds),ms=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButton"},n}(gs),ws=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonPrimary"},n}(ms),ps=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutHorizontal"},n}(Fu),Os=function(t){function n(n,i){var r=t.call(this,i)||this;r.p=n;var e=r.buttonOk,u=r.buttonCancel;return null==e&&null==u||(r.addChild(r.newButtonSpace()),u&&r.addChild(u),e&&r.addChild(e),r.addChild(r.newButtonSpace())),r}return _(n,t),Object.defineProperty(n.prototype,"buttonCancel",{get:function(){var t=this.rh;return void 0===t&&(t=this.newButtonCancel(),this.rh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonCancel=function(){var t,n,i=this,r=null===(n=null===(t=this.xn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.cancel;return void 0===r&&(r=this.theme.getButtonCancel()),null!=r?new ws({text:{value:r},on:{active:function(){i.p.cancel()}}}):null},Object.defineProperty(n.prototype,"buttonOk",{get:function(){var t=this.eh;return void 0===t&&(t=this.newButtonOk(),this.eh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonOk=function(){var t,n,i=this,r=null===(n=null===(t=this.xn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.ok;return void 0===r&&(r=this.theme.getButtonOk()),null!=r?null!=this.buttonCancel?new ms({text:{value:r},on:{active:function(){i.p.ok()}}}):new ws({text:{value:r},on:{active:function(){i.p.ok()}}}):null},n.prototype.newButtonSpace=function(){return new Pu({weight:1})},n.prototype.getType=function(){return"DDialogLayeredFooter"},n}(ps),Ds=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonAmbient"},n}(ms),Es=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderButtonClose"},n}(Ds),Ms=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderSeparator"},n}(ds),Ss=function(t){function n(n,i){var r=t.call(this,i)||this;r.p=n;var e=r.separator;e&&r.addChild(e);var u=r.buttonClose;return u&&(r.addChild(u),u.on("active",(function(){r.p.cancel()}))),r}return _(n,t),Object.defineProperty(n.prototype,"buttonClose",{get:function(){var t=this.uh;return void 0===t&&(t=this.newButtonClose(),this.uh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonClose=function(){var t,n;return!1!==(null===(n=null===(t=this.xn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.close)?new Es:null},Object.defineProperty(n.prototype,"separator",{get:function(){var t=this.sh;return void 0===t&&(t=this.newSeparator(),this.sh=t),t},enumerable:!1,configurable:!0}),n.prototype.newSeparator=function(){var t;return!1!==(null===(t=this.xn)||void 0===t?void 0:t.separator)?new Ms:null},n.prototype.getType=function(){return"DDialogLayeredHeader"},n}(ds),Ts=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.addChild(this.layout)},Object.defineProperty(n.prototype,"layout",{get:function(){var t=this.hh;return null==t&&(t=this.newLayout(),this.hh=t),t},enumerable:!1,configurable:!0}),n.prototype.newLayout=function(){return new Gu(this.toLayoutOptions(this.theme,this.xn))},n.prototype.toLayoutOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.layout)&&void 0!==i?i:t.getLayout())&&void 0!==r?r:this.newLayoutOptions(t,n);return void 0===e.children&&(e.children=this.newLayoutChildren(t,n)),e},n.prototype.newLayoutOptions=function(t,n){return{width:"padding",height:"auto",margin:0}},n.prototype.newLayoutChildren=function(t,n){return[this.header,this.content,this.footer]},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.oh;return void 0===t&&(t=this.newHeader(),this.oh=t),t},enumerable:!1,configurable:!0}),n.prototype.newHeader=function(){var t=this.toHeaderOptions(this.theme,this.xn);return null!==t?new Ss(this,t):null},n.prototype.toHeaderOptions=function(t,n){if(n){var i=n.header;if(void 0!==i)return i}return t.getHeader()},Object.defineProperty(n.prototype,"content",{get:function(){var t=this.ah;return null==t&&(t=this.newContent(),this.ah=t),t},enumerable:!1,configurable:!0}),n.prototype.newContent=function(){return new Hu(this.toContentOptions(this.theme,this.xn))},n.prototype.toContentOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.content)&&void 0!==i?i:t.getContent())&&void 0!==r?r:{};return void 0===e.children&&(e.children=this.newContentChildren(t,n)),e},n.prototype.newContentChildren=function(t,n){return[]},Object.defineProperty(n.prototype,"footer",{get:function(){var t=this.fh;return void 0===t&&(t=this.newFooter(),this.fh=t),t},enumerable:!1,configurable:!0}),n.prototype.newFooter=function(){var t=this.toFooterOptions(this.theme,this.xn);return null!==t?new Os(this,t):null},n.prototype.toFooterOptions=function(t,n){if(n){var i=n.footer;if(void 0!==i)return i}return t.getFooter()},n.prototype.findFirstFocusable=function(t){return t.find(this.content,!1,!0,!0)},n.prototype.ok=function(){this.onOk(this.getResolvedValue())},n.prototype.onOk=function(t){this.doResolve(t),this.emit("ok",t,this)},n.prototype.cancel=function(){this.onCancel(this.getRejectReason())},n.prototype.onCancel=function(t){this.doReject(t),this.emit("cancel",t,this)},n.prototype.getRejectReason=function(){},n.prototype.getType=function(){return"DDialogLayered"},n}(Bu),js=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout),r},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.lh;return null==t&&(t=this.newInputLayout(),this.lh=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(){var t=this.toInputMargin(this.theme,this.xn);return new ps({width:"padding",height:"auto",margin:0,children:[new Pu({width:t}),this.input,new Pu({width:t})]})},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.bh;if(null==t){var n=this.xn;t=this.newInput(null==n?void 0:n.input),this.bh=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.input.value},set:function(t){this.input.value=t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.input.value},n.prototype.getType=function(){return"DDialogInput"},n}(Ts),Ns=function(t){function n(n){var i=t.call(this)||this;i.dh=[],i.gh=null,i.mh=function(t){i.active=t};var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i.emit("init",i),i}return _(n,t),n.prototype.add=function(t){if(this.dh.indexOf(t)<0){this.dh.push(t),t.isGrouped=!0;var n=this.es;null!=n&&(t.state.isEnabled=n),t.on("active",this.mh),t.state.isActive&&(this.active=t)}},Object.defineProperty(n.prototype,"active",{get:function(){return this.gh},set:function(t){if((null==t||t.isToggle)&&this.gh!==t){var n=this.gh;this.gh=null;for(var i=this.dh,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u.isToggle&&u.state.isActive&&u.toggle()}this.emit("active",t,n,this)}},enumerable:!1,configurable:!0}),n.prototype.remove=function(t){var n=this.dh,i=n.indexOf(t);0<=i&&(n.splice(i,1),t.isGrouped=!1,t.off("active",this.mh),this.gh===t&&(this.active=null))},n.prototype.contains=function(t){return 0<=this.dh.indexOf(t)},n.prototype.clear=function(){for(var t=this.dh,n=0,i=t.length;n<i;++n)t[n].isGrouped=!1;t.length=0,this.active=null},n.prototype.size=function(){return this.dh.length},n.prototype.each=function(t){for(var n=this.dh,i=0,r=n.length;i<r&&!1!==t(n[i]);++i);},n.prototype.disable=function(){for(var t=this.dh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!0;this.es=!1},n.prototype.enable=function(){for(var t=this.dh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!1;this.es=!0},n.prototype.destroy=function(){this.clear()},n}(t.utils.EventEmitter),Is=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOff"},n}(ms),Cs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOn"},n}(ms),As=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.getButtonOff()),i.addChild(i.getButtonOn());var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i.getButtonGroup().on("active",(function(){var t=i.value;i.emit("change",t,!t,i)})),i}return _(n,t),n.prototype.getButtonGroup=function(){var t=this.wh;return null==t&&(t=this.newButtonGroup(),this.wh=t),t},n.prototype.newButtonGroup=function(){return new Ns},n.prototype.getButtonOn=function(){var t=this.ph;return null==t&&(t=this.newButtonOn(),this.ph=t),t},n.prototype.newButtonOn=function(){return new Cs({weight:1,group:this.getButtonGroup()})},n.prototype.getButtonOff=function(){var t=this.Oh;return null==t&&(t=this.newButtonOff(),this.Oh=t),t},n.prototype.newButtonOff=function(){return new Is({weight:1,group:this.getButtonGroup(),state:ot.ACTIVE})},Object.defineProperty(n.prototype,"value",{get:function(){return this.getButtonOn().state.isActive},set:function(t){this.value!==t&&(t?this.getButtonOn().activate():this.getButtonOff().activate())},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputBoolean"},n}(ps),Rs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){return new As(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputBoolean"},n}(js),Ls=function(t){function n(n){var i=t.call(this,n,tn.NONE)||this;return i.target=en.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i.isOpened=!1,i.step=en.ofNumberOrNull(n.step),i.min=en.ofNumberOrNull(n.min),i.max=en.ofNumberOrNull(n.max),i}return _(n,t),n.prototype.execute=function(t,n,i){var r=this;if(!this.isOpened&&this.condition(t,i,rn)){var e=this.target(t,i,rn);if(null!=e){var u=this.initial(t,i,rn),s=this.step(t,i,rn),h=this.min(t,i,rn),o=this.max(t,i,rn);this.isOpened=!0,setTimeout((function(){r.open(t,e,u,s,h,o).then((function(n){r.isOpened=!1,au.execute(t,r.onInputAction,e,n,i)}),(function(){r.isOpened=!1}))}),0)}}},n}(sn),ys=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=en.ofBooleanOrFalse(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Rs({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Ls),ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getUtil=function(){var t=this.rs;return null==t&&(t=this.newUtil(),this.rs=t),t},n.prototype.newUtil=function(){return new Ze(this,this.newOperation(),this.theme,this.xn)},n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},Object.defineProperty(n.prototype,"element",{get:function(){return this.getUtil().element},enumerable:!1,configurable:!0}),n.prototype.onDownThis=function(n){var i=this.getUtil();i.onDowning(n),t.prototype.onDownThis.call(this,n),i.onDown(n)},n.prototype.onDblClick=function(n,i){return this.getUtil().onDblClick(n,i),t.prototype.onDblClick.call(this,n,i)},n.prototype.onFocus=function(){t.prototype.onFocus.call(this),this.getUtil().onFocus()},n.prototype.onBlur=function(){t.prototype.onBlur.call(this),this.getUtil().onBlur()},n.prototype.start=function(){this.getUtil().start()},n.prototype.render=function(n){this.getUtil().onRender(n),t.prototype.render.call(this,n)},n.prototype.getElementRect=function(t,n,i){return n.set(0,0),this.toGlobal(n,n,!1),i.x=n.x,i.y=n.y,n.set(this.width,this.height),this.toGlobal(n,n,!0),i.width=n.x-i.x,i.height=n.y-i.y,i},n.prototype.getClipperRect=function(t,n,i){return Ze.getClipperRect(this.parent,this,t,n,i)},n.prototype.cancel=function(){this.getUtil().cancel()},n.prototype.end=function(){this.getUtil().end()},n.prototype.select=function(){return this.getUtil().select(),this},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.start(),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Ki.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Ki.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DHtmlElement"},n}(ds),xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){t.hideText()},onCancel:function(){t.showText()},onEnd:function(){},getValue:function(){return t.Xs},onValueInput:function(n){t.onValueInput(n)},onValueChange:function(n,i){t.text=n,t.onValueChange(n,i)},onEnter:function(){t.onEnter()},applyTitle:function(){t.applyTitle()}}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Xs},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){t.prototype.onTextChange.call(this),this.validate()},n.prototype.onValueChange=function(t,n){this.emit("change",t,n,this)},n.prototype.onValueInput=function(t){this.emit("input",t,this)},n.prototype.onEnter=function(){this.emit("enter",this)},n.prototype.validate=function(){return this.getUtil().validate()},n.prototype.applyTitle=function(){this.getUtil().applyTitle()||t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DInput"},n}(ks),Bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInput"},n}(xs),_s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new hu(this,this.newOperation(),this.theme,this.xn)},Object.defineProperty(n.prototype,"step",{get:function(){return this.getUtil().step},set:function(t){this.getUtil().step=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.getUtil().min},set:function(t){this.getUtil().min=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.getUtil().max},set:function(t){this.getUtil().max=t},enumerable:!1,configurable:!0}),n}(Bs),Ps=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInteger"},n}(_s),Us=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new Ps(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputInteger"},n}(js),Fs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=en.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Us({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Ls),Gs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputReal"},n}(_s),Hs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new Gs(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputReal"},n}(js),zs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=en.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Hs({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Ls),Vs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new du(this,this.newOperation(),this.theme,this.xn)},n.prototype.getType=function(){return"DInputText"},n}(Bs),Ws=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new Vs(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputText"},n}(js),Xs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=en.ofString(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Ws({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Ls),Ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogFittedContent"},n}(Hu),Ys=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLayoutOptions=function(t,n){return{width:"auto",height:"auto",margin:0}},n.prototype.newContent=function(){return new Ks(this.toContentOptions(this.theme,this.xn))},n.prototype.getType=function(){return"DDialogFitted"},n}(Ts),Js=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonBack"},n}(Ds),Zs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonDate"},n}(Ds),qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonNext"},n}(Ds),Qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DText"},n}(bs),$s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabel"},n}(Qs),th=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabelDate"},n}(Qs),nh=function(t){function n(n){var i=t.call(this,n)||this;return i.renderable=!1,i}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeSpace"},n}($i),ih={NONE:0,DATE:1,HOURS:2,MINUTES:4,SECONDS:8,TIME:14,ALL:15},rh=function(){function t(){}return t.from=function(t,n){var i=null==n?void 0:n.mask;if(null==i){if(ct(t)){var r=Y.getInstance().get(t);if(null!=r)return r.getMask()}else if(null!=t)return t.getMask();return ih.NONE}if(ct(i))return ih[i];if(wn(i))return i;for(var e=ih.NONE,u=0,s=i.length;u<s;++u)e|=ih[i[u]];return e},t}(),eh=function(){function t(t,n){var i,r;this.Dh=null!==(i=null==t?void 0:t.date)&&void 0!==i?i:null,this.Eh=null!==(r=null==t?void 0:t.inclusive)&&void 0!==r&&r,this.Z=n}return Object.defineProperty(t.prototype,"date",{get:function(){return this.Dh},set:function(t){this.Dh!==t&&(this.Dh=t,this.Z())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inclusive",{get:function(){return this.Eh},set:function(t){this.Eh!==t&&(this.Eh=t,this.Z())},enumerable:!1,configurable:!0}),t}(),uh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&ih.DATE){if(r.getFullYear()<t.getFullYear())return e.hour.min;if(r.getMonth()<t.getMonth())return e.hour.min;if(r.getDate()<t.getDate())return e.hour.min}var s=r.getHours();return i.inclusive||u&ih.SECONDS&&r.getSeconds()<e.second.max||u&ih.MINUTES&&r.getMinutes()<e.minute.max?s:s+1}return e.hour.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&ih.DATE){if(t.getFullYear()<r.getFullYear())return e.hour.max;if(t.getMonth()<r.getMonth())return e.hour.max;if(t.getDate()<r.getDate())return e.hour.max}var s=r.getHours();return i.inclusive||u&ih.SECONDS&&e.second.min<r.getSeconds()||u&ih.MINUTES&&e.minute.min<r.getMinutes()?s:s-1}return e.hour.max},t}(),sh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&ih.DATE){if(r.getFullYear()<t.getFullYear())return e.minute.min;if(r.getMonth()<t.getMonth())return e.minute.min;if(r.getDate()<t.getDate())return e.minute.min}if(u&ih.HOURS&&r.getHours()<t.getHours())return e.minute.min;var s=r.getMinutes();return i.inclusive||u&ih.SECONDS&&r.getSeconds()<e.second.max?s:s+1}return e.minute.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&ih.DATE){if(t.getFullYear()<r.getFullYear())return e.minute.max;if(t.getMonth()<r.getMonth())return e.minute.max;if(t.getDate()<r.getDate())return e.minute.max}if(u&ih.HOURS&&t.getHours()<r.getHours())return e.minute.max;var s=r.getMinutes();return i.inclusive||u&ih.SECONDS&&e.second.min<r.getSeconds()?s:s-1}return e.minute.max},t}(),hh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&ih.DATE){if(r.getFullYear()<t.getFullYear())return e.second.min;if(r.getMonth()<t.getMonth())return e.second.min;if(r.getDate()<t.getDate())return e.second.min}return u&ih.HOURS&&r.getHours()<t.getHours()||u&ih.MINUTES&&r.getMinutes()<t.getMinutes()?e.second.min:r.getSeconds()+(i.inclusive?0:1)}return e.second.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&ih.DATE){if(t.getFullYear()<r.getFullYear())return e.second.max;if(t.getMonth()<r.getMonth())return e.second.max;if(t.getDate()<r.getDate())return e.second.max}return u&ih.HOURS&&t.getHours()<r.getHours()||u&ih.MINUTES&&t.getMinutes()<r.getMinutes()?e.second.max:r.getSeconds()-(i.inclusive?0:1)}return e.second.max},t}(),oh=function(){function t(t,n){this.constant=this.newConstant(),this.lower=new eh(t&&t.lower,n),this.upper=new eh(t&&t.upper,n),this.mask=ih.ALL,this.hours=new uh(this),this.minutes=new sh(this),this.seconds=new hh(this)}return t.prototype.newConstant=function(){return{second:{min:0,max:59},minute:{min:0,max:59},hour:{min:0,max:23}}},t.prototype.adjust=function(t){var n=this.test(t);if(n<0){var i=this.lower,r=i.date;if(r)return t.setTime(r.getTime()),i.inclusive||((e=this.mask)&ih.SECONDS?t.setSeconds(r.getSeconds()+1):e&ih.MINUTES?t.setMinutes(r.getMinutes()+1):e&ih.HOURS?t.setHours(r.getHours()+1):e&ih.DATE&&t.setDate(r.getDate()+1)),!0}else if(0<n){var e,u=this.upper,s=u.date;if(s)return t.setTime(s.getTime()),u.inclusive||((e=this.mask)&ih.SECONDS?t.setSeconds(s.getSeconds()-1):e&ih.MINUTES?t.setMinutes(s.getMinutes()-1):e&ih.HOURS?t.setHours(s.getHours()-1):e&ih.DATE&&t.setDate(s.getDate()-1)),!0}return!1},t.prototype.compare=function(t,n){var i=this.mask;if(i&ih.DATE){var r,e,u,s,h=t.getFullYear(),o=n.getFullYear();if(h!==o)return h<o?-1:1;if((r=t.getMonth())!==(e=n.getMonth()))return r<e?-1:1;if((u=t.getDate())!==(s=n.getDate()))return u<s?-1:1}if(i&ih.HOURS){var a=t.getHours(),c=n.getHours();if(a!==c)return a<c?-1:1}return i&ih.MINUTES&&(r=t.getMinutes())!==(e=n.getMinutes())?r<e?-1:1:i&ih.SECONDS&&(u=t.getSeconds())!==(s=n.getSeconds())?u<s?-1:1:0},t.prototype.test=function(t){var n=this.lower,i=n.date;if(null!=i){var r=this.compare(i,t);return n.inclusive?r<=0?0:-1:r<0?0:-1}var e=this.upper,u=e.date;return null!=u?(r=this.compare(t,u),e.inclusive?r<=0?0:1:r<0?0:1):0},t.prototype.contains=function(t){return 0===this.test(t)},t}(),ah=function(t,n,i){if(t){var r=t.date,e=t.inclusive;return{date:void 0!==r?r:n,inclusive:void 0!==e?e:i}}return{date:n,inclusive:i}},ch=function(t){function n(n){var i=t.call(this,n)||this;return i.onNewChange(),i}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n);var e=this.theme;this.Mh=new Date;var u=this.Mh.getTime();this.Sh=new Date(u),this.Th=new oh(function(t,n){return n?{lower:ah(n.lower,t.getLowerBound(),t.isLowerBoundInclusive()),upper:ah(n.upper,t.getUpperBound(),t.isUpperBoundInclusive())}:{lower:{date:t.getLowerBound(),inclusive:t.isLowerBoundInclusive()},upper:{date:t.getUpperBound(),inclusive:t.isUpperBoundInclusive()}}}(e,null==n?void 0:n.bounds),(function(){r.onNewChange()}));var s=null!==(i=null==n?void 0:n.margin)&&void 0!==i?i:e.getMargin();new Gu({parent:this,x:"padding",y:"padding",width:"auto",height:"auto",margin:s,children:this.newChildren(e,n,s)})},Object.defineProperty(n.prototype,"current",{get:function(){return this.Mh},set:function(t){this.Mh.getTime()!==t.getTime()&&(this.Mh=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.Sh},set:function(t){this.Sh.getTime()!==t.getTime()&&(this.Sh=t,this.onNewChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bounds",{get:function(){return this.Th},enumerable:!1,configurable:!0}),n.prototype.hasHours=function(){return null!=this.jh},n.prototype.hasMinutes=function(){return null!=this.Nh},n.prototype.hasSeconds=function(){return null!=this.Ih},n.prototype.reset=function(){var t=this.Mh.getTime();this.Sh.setTime(t),this.onReset()},n.prototype.onReset=function(){this.onNewChange()},n.prototype.onNewChange=function(){var t=this.Sh,n=this.Th;n.adjust(this.Sh);var i=this.jh;if(i){var r=n.hours;i.value=t.getHours(),i.min=r.min(t),i.max=r.max(t)}var e=this.Nh;if(e){var u=n.minutes;e.value=t.getMinutes(),e.min=u.min(t),e.max=u.max(t)}var s=this.Ih;if(s){var h=n.seconds;s.value=t.getSeconds(),s.min=h.min(t),s.max=h.max(t)}},n.prototype.newChildren=function(t,n,i){var r=rh.from(t,n);return this.Th.mask=r,this.jh=r&ih.HOURS?this.newInputHours(t,n):null,this.Nh=r&ih.MINUTES?this.newInputMinutes(t,n):null,this.Ih=r&ih.SECONDS?this.newInputSeconds(t,n):null,[this.newTimeLayout(this.jh,this.Nh,this.Ih,i)]},n.prototype.newTimeLayout=function(t,n,i,r){var e=this.newTimeLayoutChildren(t,n,i);return 0<e.length?new ps({width:this.getTimeLayoutWidth(),height:this.getTimeLayoutHeight(),margin:r,children:e}):null},n.prototype.getTimeLayoutWidth=function(){return"auto"},n.prototype.getTimeLayoutHeight=function(){return"auto"},n.prototype.newTimeLayoutChildren=function(t,n,i){var r=[];return null!=t&&r.push(t),null!=n&&(0<r.length&&r.push(this.newMinuteSeparator()),r.push(n)),null!=i&&(0<r.length&&r.push(this.newSecondSeparator()),r.push(i)),r},n.prototype.newMinuteSeparator=function(){return new Qs({width:"auto",text:{value:this.getMinuteSeparator()}})},n.prototype.getMinuteSeparator=function(){return":"},n.prototype.newSecondSeparator=function(){return new Qs({width:"auto",text:{value:this.getSecondSeparator()}})},n.prototype.getSecondSeparator=function(){return":"},n.prototype.adjustInputOptions=function(t,n,i){return null==n.step&&(n.step=1),null==n.min&&(n.min=0),null==n.max&&(n.max=i),n},n.prototype.newInputHours=function(t,n){var i,r=this,e=null!==(i=null==n?void 0:n.hours)&&void 0!==i?i:t.getHoursOptions(),u=this.Th.constant.hour.max,s=new Ps(this.adjustInputOptions(t,e,u));return s.on("change",(function(t){r.onHoursChange(t)})),s},n.prototype.onHoursChange=function(t){this.Sh.setHours(t),this.onNewChange()},n.prototype.newInputMinutes=function(t,n){var i=this,r=(null==n?void 0:n.minutes)||t.getMinutesOptions(),e=this.Th.constant.minute.max,u=new Ps(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onMinutesChange(t)})),u},n.prototype.onMinutesChange=function(t){this.Sh.setMinutes(t),this.onNewChange()},n.prototype.newInputSeconds=function(t,n){var i=this,r=(null==n?void 0:n.seconds)||t.getSecondsOptions(),e=this.Th.constant.second.max,u=new Ps(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onSecondsChange(t)})),u},n.prototype.onSecondsChange=function(t){this.Sh.setSeconds(t)},n.prototype.getType=function(){return"DPickerTime"},n}($i),fh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.Ch=new Date(this.Mh.getTime())},n.prototype.newChildren=function(n,i,r){var e,u;this.Ah=this.newDateButtons(n,i),this.Rh=null!==(u=null===(e=null==i?void 0:i.date)||void 0===e?void 0:e.decorator)&&void 0!==u?u:n.getDateDecorator(),this.Lh=this.newLabel(n,i);var s=t.prototype.newChildren.call(this,n,i,r);return s.unshift(new ps({width:"100%",height:"auto",children:[this.newBackButton(n,i),this.Lh,this.newNextButton(n,i)]}),new ps({width:"auto",height:"auto",margin:r,children:this.newDateLabels(n,i)}),new Gu({width:"auto",height:"auto",margin:r,column:7,children:this.Ah})),s},Object.defineProperty(n.prototype,"page",{get:function(){return this.Ch},set:function(t){this.Ch.getTime()!==t.getTime()&&(this.Ch=t,this.onPageChange())},enumerable:!1,configurable:!0}),n.prototype.onReset=function(){this.Ch.setTime(this.Mh.getTime()),t.prototype.onReset.call(this)},n.prototype.next=function(){var t=this.Ch;t.setFullYear(t.getFullYear(),t.getMonth()+1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.back=function(){var t=this.Ch;t.setFullYear(t.getFullYear(),t.getMonth()-1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.onNewChange=function(){this.Th.adjust(this.Ch),t.prototype.onNewChange.call(this),this.onPageChange()},n.prototype.onPageChange=function(){var t=this.Ah,n=this.Th,i=this.Ch,r=this.Sh,e=new Date(i.getTime());e.setDate(1),e.setHours(0,0,0,0);for(var u=this.theme,s=(e.getDay()-u.getDayStart()+7)%7,h=0;h<s;++h)t[h].show();for(h=s;h<7;++h)t[h].hide();var o=this.Rh;e.setFullYear(e.getFullYear(),e.getMonth()+1,0);var a=e.getDate(),c=r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()?r.getDate():0;for(h=0;h<a;++h)e.setDate(h+1),(f=t[h+7]).state.isActive=c===h+1,f.state.isDisabled=!n.contains(e),f.show(),o(e,f);for(h=a;h<31;++h){var f;(f=t[h+7]).state.isActive=!1,f.hide()}e.setTime(i.getTime()),this.Lh.text=e},n.prototype.adjustInputOptions=function(n,i,r){return null==i.weight&&(i.weight=1),t.prototype.adjustInputOptions.call(this,n,i,r)},n.prototype.getTimeLayoutWidth=function(){return"100%"},n.prototype.toLabelOptions=function(t,n){var i=n&&n.label||{};void 0===i.weight&&(i.weight=1),void 0===i.padding&&(i.padding=0);var r=i.text=i.text||{},e=r.align=r.align||{};return void 0===e.horizontal&&(e.horizontal="CENTER"),void 0===r.formatter&&(r.formatter=t.getLabelFormatter()),i},n.prototype.newLabel=function(t,n){return new $s(this.toLabelOptions(t,n))},n.prototype.newBackButton=function(t,n){var i=this,r=null==n?void 0:n.back;if(void 0===r&&(r=t.getBackButtonOptions()),null!=r){var e=new Js(r);return e.on("active",(function(){i.back()})),e}return null},n.prototype.newNextButton=function(t,n){var i=this,r=null==n?void 0:n.next;if(void 0===r&&(r=t.getNextButtonOptions()),null!=r){var e=new qs(r);return e.on("active",(function(){i.next()})),e}return null},n.prototype.newDateLabels=function(t,n){for(var i=t.getDayLabels(),r=t.getDayStart(),e=[],u=0;u<7;++u){var s=i[(r+u)%7];e.push(this.newDateLabel(t,n,s))}return e},n.prototype.newDateLabel=function(t,n,i){return new th({text:{value:i}})},n.prototype.newDateButtons=function(t,n){for(var i=[],r=0;r<7;++r)i.push(this.newSpace(t,n));for(r=1;r<=31;++r)i.push(this.newDateButton(t,n,r));return i},n.prototype.newSpace=function(t,n){return new nh},n.prototype.newDateButton=function(t,n,i){var r=this;return new Zs({text:{value:String(i)},on:{active:function(){r.onDateButtonClicked(i)}}})},n.prototype.onDateButtonClicked=function(t){var n=this.Sh;if(n.getDate()!==t){var i=this.Ch;n.setFullYear(i.getFullYear()),n.setMonth(i.getMonth()),n.setDate(t),this.onNewChange()}},n.prototype.getType=function(){return"DPickerDatetime"},n}(ch),lh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.yh;return null==n&&(n=new fh(null===(t=this.xn)||void 0===t?void 0:t.picker),this.yh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDatetime"},n}(Ys),vh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=en.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;return null==h&&(h=new lh,n.DIALOG=h),h.new=h.current=this.toDate(r),h.open(t).then((function(t){return t.toISOString()}))},n.prototype.toDate=function(t){return ct(t)||wn(t)?new Date(t):t instanceof Date?t:new Date},n}(Ls),bh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.yh;return null==n&&(n=new ch(null===(t=this.xn)||void 0===t?void 0:t.picker),this.yh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogTime"},n}(Ys),dh=function(t){return t!=t},gh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=en.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new bh,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){if(wn(t))return new Date(t);if(ct(t)){var n=new Date,i=this.getPattern().exec(t);if(null!=i){var r=this.toHours(i[1]);null!=r&&n.setHours(r);var e=this.toMinutes(i[2]);null!=e&&n.setMinutes(e);var u=this.toSeconds(i[3]);null!=u&&n.setSeconds(u);var s=this.toMilliseconds(i[4]);null!=s&&n.setMilliseconds(s)}return n}return t instanceof Date?t:new Date},n.prototype.toHours=function(t){return this.toNumber(t,0,23)},n.prototype.toMinutes=function(t){return this.toNumber(t,0,59)},n.prototype.toSeconds=function(t){return this.toNumber(t,0,59)},n.prototype.toMilliseconds=function(t){var n=this.toNumber(t,0,999);if(null!=n){var i=t.length;return 1===i?100*n:2===i?10*n:n}return n},n.prototype.toNumber=function(t,n,i){if(null!=t){var r=+t;if(!dh(r))return Math.min(i,Math.max(n,r))}return null},n.prototype.getPattern=function(){var t=n.PATTERN;return null==t&&(t=this.newPattern(),n.PATTERN=t),t},n.prototype.newPattern=function(){return/^\s*(?:(\d+)(?::(\d+)(?::(\d+))?)?)?(?:\.(\d+))?\s*$/},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return di.create("%Hm")},n}(Ls),mh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDate"},n}(fh),wh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.yh;return null==n&&(n=new mh(null===(t=this.xn)||void 0===t?void 0:t.picker),this.yh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDate"},n}(Ys),ph=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=en.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new wh,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){return ct(t)||wn(t)?new Date(t):t instanceof Date?t:new Date},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return di.create("%Y-%M-%D")},n}(Ls),Oh={TEXT:0,INTEGER:1,REAL:2,BOOLEAN:3,DATE:4,TIME:5,DATETIME:6,EXTENSION:1e3},Dh=function(t){function n(n,i,r,e,u,s,h,o){var a=t.call(this,mn.OPEN,n,Tu.DIALOG)||this;return a.target=i,a.onInputAction=r,a.initial=e,a.step=u,a.min=s,a.max=h,a.dialogType=o,a}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.dialogType===i.dialogType&&this.onInputAction===i.onInputAction&&this.initial===i.initial&&this.step===i.step&&this.min===i.min&&this.max===i.max},n.prototype.toRuntime=function(){switch(this.dialogType){case Oh.TEXT:return new Xs(this);case Oh.INTEGER:return new Fs(this);case Oh.REAL:return new zs(this);case Oh.BOOLEAN:return new ys(this);case Oh.DATE:return new ph(this);case Oh.TIME:return new gh(this);case Oh.DATETIME:return new vh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.initial),e=t.addResource(this.step),u=t.addResource(this.min),s=t.addResource(this.max);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,",").concat(this.dialogType,",").concat(e,",").concat(u,",").concat(s,"]"))},n.deserialize=function(t,i){var r=i.resources,e=pn.toResource(1,t,r),u=pn.toResource(3,t,r),s=pn.toResource(5,t,r),h=pn.toResource(7,t,r),o=pn.toResource(8,t,r),a=pn.toResource(9,t,r);return new n(e,u,t[4],s,h,o,a,this.toDialogType(t))},n.toDialogType=function(t){if(t[2]===Tu.DIALOG)return t[6];switch(t[2]){case Tu.DIALOG_TEXT:return Oh.TEXT;case Tu.DIALOG_INTEGER:return Oh.INTEGER;case Tu.DIALOG_REAL:return Oh.REAL;case Tu.DIALOG_BOOLEAN:return Oh.BOOLEAN;case Tu.DIALOG_DATE:return Oh.DATE;case Tu.DIALOG_TIME:return Oh.TIME;case Tu.DIALOG_DATETIME:return Oh.DATETIME}},n}(gn),Eh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.kh)&&void 0!==n?n:this.kh=new Map).set(t.type,t),(null!==(i=this.Pt)&&void 0!==i?i:this.Pt=[]).push(t)},t.get=function(t){var n=this.kh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Pt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Mh=function(t){function n(n){var i=t.call(this,n,tn.NONE)||this;i.target=en.ofStringOrNull(n.target),i.argument=en.ofUnknown(n.argument);var r=Eh.get(n.dialogType);return r&&(i.opener=r.opener),i}return _(n,t),n.prototype.execute=function(t,n,i){var r=this.opener;if(r&&this.condition(t,i,rn)){var e=this.target(t,i,rn);if(null!=e){var u=this.argument(t,i,rn);setTimeout((function(){r(e,u,t)}),0)}}},n}(sn),Sh=function(t){function n(n,i,r,e){var u=t.call(this,mn.OPEN,n,Tu.DIALOG)||this;return u.target=i,u.argument=r,u.dialogType=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.argument===i.argument&&this.dialogType===i.dialogType},n.prototype.toRuntime=function(){return new Mh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.argument);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",0,-1,").concat(this.dialogType,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(pn.toResource(1,t,i.resources),pn.toResource(3,t,i.resources),pn.toResource(7,t,i.resources),t[6])},n}(gn),Th=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.kh)&&void 0!==n?n:this.kh=new Map).set(t.type,t),(null!==(i=this.Pt)&&void 0!==i?i:this.Pt=[]).push(t),Ge[t.type]=t.opener},t.get=function(t){var n=this.kh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Pt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),jh=function(t){function n(n,i,r,e){var u=t.call(this,mn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){return new Su(this,this.subtype)},n.prototype.toLabel=function(){var t=this.getTheme().toTypeLabel(this.type),n=Th.get(this.subtype);return"".concat(t,": ").concat(null!=n?n.label:"Unknown")},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=pn.toResource(1,t,i.resources),e=pn.toResource(3,t,i.resources);return new n(t[2],r,e,!!t[4])},n}(gn),Nh={SHAPE_SHOW:0,SHAPE_HIDE:1,SHAPE:2,LAYER:3},Ih=function(t){function n(n){var i=t.call(this,n,tn.VISIBILITY)||this;return i.visibility=n.subtype===Nh.SHAPE_SHOW,i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,rn)&&(t.visible=this.visibility,n.written|=this.reset)},n}(sn),Ch=function(t){function n(n,i){return t.call(this,mn.SHOW_HIDE,i,n)||this}return _(n,t),n.prototype.toRuntime=function(){return new Ih(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){var r=pn.toResource(1,t,i.resources);return new n(t[2],r)},n}(gn),Ah=function(t){function n(n){var i=t.call(this,n,tn.NONE)||this;return i.Pt=new Map,i.mu=n.layers,i.xh=n.bringToFront,i}return _(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i);var r=this.Pt.get(n);null==r&&null!=(r=this.newData(n))&&this.Pt.set(n,r)},n.prototype.execute=function(t,n,i){var r=this.Pt.get(t);if(r){var e=this.condition(t,i,rn);if(r.condition!==e){r.condition=e;var u=r.layers;e?r.bringToFront?(Ie.bringAllToFront(u),Ie.showAll(u)):Ie.showAll(u):Ie.hideAll(u)}}},n.prototype.newData=function(t){var n=Ie.toLayers(t,this.mu);if(0<n.length)return{layers:n,bringToFront:this.xh,condition:null}},n}(sn),Rh=function(t){function n(n,i,r){var e=t.call(this,mn.SHOW_HIDE,n,Nh.LAYER)||this;return e.layers=i,e.bringToFront=r,e}return _(n,t),n.prototype.toRuntime=function(){return new Ah(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=this.serializeLayers(t),r=this.bringToFront?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.prototype.serializeLayers=function(t){for(var n=this.layers,i="[",r="",e=0,u=n.length;e<u;++e)i+=r+n[e],r=",";return i+="]",t.addResource(i)},n.deserialize=function(t,i){return new n(pn.toResource(1,t,i.resources),this.deserializeLayers(t[3],i),!!t[4])},n.deserializeLayers=function(t,n){var i=n.resources,r=i.length;return 0<=t&&t<r?JSON.parse(i[t]):[]},n}(gn),Lh=function(t){function n(n){return t.call(this,n,tn.VISIBILITY)||this}return _(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i)},n.prototype.execute=function(t,n,i){t.visible=this.condition(t,i,rn),n.written|=this.reset},n}(sn),yh=function(t){function n(n){return t.call(this,mn.SHOW_HIDE,n,Nh.SHAPE)||this}return _(n,t),n.prototype.toRuntime=function(){return new Lh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){return new n(pn.toResource(1,t,i.resources))},n}(gn),kh=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.amount=en.ofNumber(n.amount),r}return _(n,t),n}(sn),xh=function(t){function n(n){return t.call(this,n,tn.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.amount(t,i,rn);t.transform.position.x=r,n.written|=this.reset}},n}(kh),Bh=function(t){function n(n){return t.call(this,n,tn.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.amount(t,i,rn);t.transform.position.y=r,n.written|=this.reset}},n}(kh),_h=function(t){function n(n){return t.call(this,n,tn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.amount(t,i,rn),e=t.transform,u=e.position,s=!!(n.written&tn.POSITION_X),h=!!(n.written&tn.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o-c.c*r,a-c.d*r),n.written|=this.reset}},n}(kh),Ph=function(t){function n(n){return t.call(this,n,tn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.amount(t,i,rn),e=t.transform,u=e.position,s=!!(n.written&tn.POSITION_X),h=!!(n.written&tn.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o+c.a*r,a+c.b*r),n.written|=this.reset}},n}(kh),Uh=function(t){function n(n){return t.call(this,n,tn.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.amount(t,i,rn),e=!!(n.written&tn.POSITION_X),u=t.transform.position,s=e?u.x:n.x;u.x=s+r,n.written|=this.reset}},n}(kh),Fh=function(t){function n(n){return t.call(this,n,tn.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.amount(t,i,rn),e=!!(n.written&tn.POSITION_Y),u=t.transform.position,s=e?u.y:n.y;u.y=s+r,n.written|=this.reset}},n}(kh),Gh=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r)||this;return u.opetype=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.opetype===i.opetype},n}(gn),Hh={RELATIVE_X:0,RELATIVE_Y:1,ABSOLUTE_X:2,ABSOLUTE_Y:3,FORWARD_OR_BACKWARD:4,LEFT_OR_RIGHT:5},zh={RESIZE:0,MOVE:1,ROTATE:2},Vh=function(t){function n(n,i,r){var e=t.call(this,mn.TRANSFORM,i,zh.MOVE,n)||this;return e.amount=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case Hh.ABSOLUTE_X:return new xh(this);case Hh.ABSOLUTE_Y:return new Bh(this);case Hh.FORWARD_OR_BACKWARD:return new _h(this);case Hh.LEFT_OR_RIGHT:return new Ph(this);case Hh.RELATIVE_X:return new Uh(this);case Hh.RELATIVE_Y:return new Fh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=pn.toResource(1,t,i.resources),e=pn.toResource(4,t,i.resources);return new n(t[3],r,e)},n}(Gh),Wh={RELATIVE_SIZE:0,RELATIVE_HEIGHT:1,RELATIVE_WIDTH:2,ABSOLUTE_SIZE:3,ABSOLUTE_HEIGHT:4,ABSOLUTE_WIDTH:5},Xh=function(t){function n(n,i){var r=t.call(this,n,i)||this;switch(n.opetype){case Wh.RELATIVE_SIZE:r.size=en.ofNumberOrOne(n.amount);break;case Wh.ABSOLUTE_SIZE:r.size=en.ofNumberOrOneHundred(n.amount);break;case Wh.RELATIVE_HEIGHT:r.size=en.ofNumberOrOne(n.amount);break;case Wh.ABSOLUTE_HEIGHT:r.size=en.ofNumberOrOneHundred(n.amount);break;case Wh.RELATIVE_WIDTH:r.size=en.ofNumberOrOne(n.amount);break;case Wh.ABSOLUTE_WIDTH:r.size=en.ofNumberOrOneHundred(n.amount);break;default:r.size=en.ONE}return r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=(-.5+e)*i,h=(-.5+u)*r;t.updateTransform();var o=t.transform,a=o.position,c=o.localTransform,f=!!(n.written&tn.POSITION_X),l=!!(n.written&tn.POSITION_Y),v=f?a.x:n.x,b=l?a.y:n.y;n.written|=tn.POSITION,a.set(v+s*c.a+h*c.c,b+s*c.b+h*c.d)},n}(sn),Kh=function(t){function n(n){var i=t.call(this,n,tn.HEIGHT|tn.POSITION)||this;return i.origin=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.size(t,i,rn),e=t.size,u=n.written&tn.HEIGHT?e.y:n.sizeY;e.y=Or(r),n.written|=tn.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(Xh),Yh=function(t){function n(n){var i=t.call(this,n,tn.HEIGHT|tn.POSITION)||this;return i.origin=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.size(t,i,rn),e=t.size,u=n.written&tn.HEIGHT?e.y:n.sizeY;e.y=Or(u*r),n.written|=tn.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(Xh),Jh=function(t){function n(n){var i=t.call(this,n,tn.SIZE|tn.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=Or(this.size(t,i,rn)),e=t.size,u=!!(n.written&tn.WIDTH),s=!!(n.written&tn.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(r,r),n.written|=tn.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(Xh),Zh=function(t){function n(n){var i=t.call(this,n,tn.SIZE|tn.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.size(t,i,rn),e=t.size,u=!!(n.written&tn.WIDTH),s=!!(n.written&tn.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(Or(h*r),Or(o*r)),n.written|=tn.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(Xh),qh=function(t){function n(n){var i=t.call(this,n,tn.WIDTH|tn.POSITION)||this;return i.origin=n.originX,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.size(t,i,rn),e=t.size,u=n.written&tn.WIDTH?e.x:n.sizeX;e.x=Or(r),n.written|=tn.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(Xh),Qh=function(t){function n(n){var i=t.call(this,n,tn.WIDTH|tn.POSITION)||this;return i.origin=n.originX,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.size(t,i,rn),e=t.size,u=n.written&tn.WIDTH?e.x:n.sizeX;e.x=Or(u*r),n.written|=tn.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(Xh),$h=function(t){function n(n,i,r,e,u){var s=t.call(this,mn.TRANSFORM,i,zh.RESIZE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case Wh.ABSOLUTE_HEIGHT:return new Kh(this);case Wh.ABSOLUTE_WIDTH:return new qh(this);case Wh.ABSOLUTE_SIZE:return new Jh(this);case Wh.RELATIVE_HEIGHT:return new Yh(this);case Wh.RELATIVE_WIDTH:return new Qh(this);case Wh.RELATIVE_SIZE:return new Zh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=pn.toResource(1,t,i.resources),e=pn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(Gh),to=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.originX=n.originX,r.originY=n.originY,r.amount=en.ofNumber("(".concat(n.amount,") * (Math.PI / 180)")),r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=!!(n.written&tn.WIDTH),h=!!(n.written&tn.HEIGHT),o=(-.5+e)*(s?t.size.x:n.sizeX),a=(-.5+u)*(h?t.size.y:n.sizeY),c=Math.sin(i)-Math.sin(r),f=Math.cos(i)-Math.cos(r),l=t.transform.position,v=!!(n.written&tn.POSITION_X),b=!!(n.written&tn.POSITION_Y),d=v?l.x:n.x,g=b?l.y:n.y;n.written|=tn.POSITION,l.set(d+o*f-a*c,g+o*c+a*f)},n}(sn),no=function(t){function n(n){return t.call(this,n,tn.ROTATION|tn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.amount(t,i,rn),e=t.transform,u=n.written&tn.ROTATION?e.rotation:n.rotation;e.rotation=r,n.written|=tn.ROTATION,this.adjustPosition(t,n,u,r,this.originX,this.originY)}},n}(to),io=function(t){function n(n){return t.call(this,n,tn.ROTATION|tn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,rn)){var r=this.amount(t,i,rn),e=t.transform,u=n.written&tn.ROTATION?e.rotation:n.rotation;e.rotation=u+r,n.written|=tn.ROTATION,this.adjustPosition(t,n,u,e.rotation,this.originX,this.originY)}},n}(to),ro={RELATIVE:0,ABSOLUTE:1},eo=function(t){function n(n,i,r,e,u){var s=t.call(this,mn.TRANSFORM,i,zh.ROTATE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case ro.ABSOLUTE:return new no(this);case ro.RELATIVE:return new io(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=pn.toResource(1,t,i.resources),e=pn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(Gh),uo=function(t,n){switch(t[0]){case mn.SHOW_HIDE:switch(t[2]){case Nh.SHAPE_SHOW:case Nh.SHAPE_HIDE:return Ch.deserialize(t,n);case Nh.SHAPE:return yh.deserialize(t,n);case Nh.LAYER:return Rh.deserialize(t,n)}break;case mn.BLINK:return On.deserialize(t,n);case mn.CHANGE_COLOR:case mn.CHANGE_COLOR_LEGACY:switch(t[3]){case Mn.COLOR_AND_ALPHA:case Mn.COLOR:case Mn.ALPHA:return In.deserialize(t,n);case Mn.CODE:return Ln.deserialize(t,n);case Mn.BRIGHTNESS:return An.deserialize(t,n)}break;case mn.CHANGE_TEXT:return pi.deserialize(t,n);case mn.CHANGE_CURSOR:return kn.deserialize(t,n);case mn.EMIT_EVENT:return Ve.deserialize(t,n);case mn.OPEN:switch(t[2]){case Tu.DIALOG_TEXT:case Tu.DIALOG_INTEGER:case Tu.DIALOG_REAL:case Tu.DIALOG_BOOLEAN:case Tu.DIALOG_DATE:case Tu.DIALOG_TIME:case Tu.DIALOG_DATETIME:case Tu.DIALOG:return Oh.EXTENSION<=t[6]?Sh.deserialize(t,n):Dh.deserialize(t,n);case Tu.DIAGRAM_LEGACY:case Tu.PAGE_LEGACY:case Tu.PAGE_INPLACE_LEGACY:case Tu.DIAGRAM:case Tu.PAGE:return ju.deserialize(t,n);default:if(Tu.EXTENSION<=t[2])return jh.deserialize(t,n)}break;case mn.TRANSFORM:switch(t[2]){case zh.MOVE:return Vh.deserialize(t,n);case zh.RESIZE:return $h.deserialize(t,n);case zh.ROTATE:return eo.deserialize(t,n)}break;case mn.GESTURE:return Be.deserialize(t,n);case mn.MISC:switch(t[2]){case xe.GESTURE:return Be.deserialize(t,n);case xe.SHOW_HIDE_LAYER:return Rh.deserialize(t,n);case xe.GESTURE_LAYER:return Be.deserialize(t,n);case xe.EXECUTE:return Mu.deserialize(t,n);default:return Du.deserialize(t,n)}}return null},so={},ho=function(t){try{var n=JSON.parse(t);return Lt(n)&&2<=n.length?n:null}catch(t){return null}},oo=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];ct(e)&&(i.gradient=function(t){var n=function(t){try{return JSON.parse(t)}catch(t){return null}}(t);if(!(null==n||n.length<7)){for(var i=n[0],r=[],e=1,u=n.length;e<u;e+=3)r.push({color:n[e+0],alpha:n[e+1],position:n[e+2]});return{points:r,direction:i}}}(e))}},ao={},co=function(t){var n=ao[t];if(null!=n)return n instanceof HTMLImageElement?Promise.resolve(n):n;var i=new Promise((function(n,i){var r=document.createElement("img");r.onload=function(){ao[t]=r,n(r)},r.onabort=r.onerror=function(){i()},r.src=t}));return ao[t]=i,i},fo=function(t,n,i){var r=n.resources;i.id=r[t[1]]||"";var e=i.transform;e.position.set(t[2],t[3]),e.rotation=t[6],e.skew.set(t[7],t[7]),e.pivot.set(t[21],t[22]),i.size.set(Or(t[4]),Or(t[5])),i.fill.deserialize(t[8],n),i.stroke.deserialize(t[9],n);var u=t[10];i.cursor=0<=u?r[u]:void 0,i.text.deserialize(t[11],n),i.data.deserialize(t[12],n),i.radius=t[13],i.corner=t[14];var s=t[23];i.interactive=!!(1&s);var h=i.state;h.isFocusable=!(2&s),h.isActive=!!(4&s);var o=t[24];i.shortcut=0<=o?r[o]:void 0;var a=t[25];i.title=0<=a?r[a]:void 0;var c=t[26];i.uuid=null!=c?c:0;var f=t[27],l=t[28],v=t[29];(null!=f&&f!==pt.NONE||null!=l&&l!==pt.NONE||null!=v&&v!==pt.NONE)&&i.capability.set(f,l,v);var b=function(t,n,i){if(0<t.length){for(var r=[],e=0,u=t.length;e<u;++e)r.push(Ar(t[e],n));return Promise.all(r).then((function(t){i.children=t;for(var n=0,r=t.length;n<r;++n)t[n].parent=i;return i.onChildTransformChange(),i.toDirty(),i}))}return null}(t[20],n,i);!function(t,n,i){for(var r=i.action,e=n.resources,u=0,s=t.length;u<s;++u){var h=t[u],o=n.getAction(h);if(null!=o)r.add(o);else{var a=e[h];if(null!=a){var c=ho(a);if(null!=c&&0<c.length){var f=c[0],l=mn.EXTENSION<=f?so[f]:uo;if(null!=l){var v=l(c,n);null!=v&&(n.setAction(h,v),r.add(v))}}}}}}(t[17],n,i),oo(t[19],n,i);var d=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];if(ct(e))return co(e).then((function(t){return i.image=t,i}))}return null}(t[18],n,i);return null!=b?null!=d?Promise.all([b,d]).then((function(){return i})):b:null!=d?d:i},lo=function(t,n,i){i=i||new Yt;var r=fo(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=G.NON_SCALING_MASK|G.DOTTED_MASK|G.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},vo=function(){e[r.BAR]=qt,n[r.BAR]=lo},bo={},go=36,mo=[0,0,0],wo=new t.Point,po=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+2,t[++r]=n+1,t[++r]=n+3,t[++r]=n+2,t[++r]=n+4,t[++r]=n+5,t[++r]=n+6,t[++r]=n+5,t[++r]=n+7,t[++r]=n+6,t[++r]=n+8,t[++r]=n+9,t[++r]=n+10,t[++r]=n+9,t[++r]=n+11,t[++r]=n+10,t[++r]=n+12,t[++r]=n+13,t[++r]=n+14,t[++r]=n+13,t[++r]=n+15,t[++r]=n+14,t[++r]=n+16,t[++r]=n+17,t[++r]=n+20,t[++r]=n+17,t[++r]=n+21,t[++r]=n+20,t[++r]=n+17,t[++r]=n+18,t[++r]=n+21,t[++r]=n+18,t[++r]=n+22,t[++r]=n+21,t[++r]=n+19,t[++r]=n+21,t[++r]=n+24,t[++r]=n+21,t[++r]=n+25,t[++r]=n+24,t[++r]=n+21,t[++r]=n+23,t[++r]=n+26,t[++r]=n+23,t[++r]=n+27,t[++r]=n+26,t[++r]=n+24,t[++r]=n+25,t[++r]=n+28,t[++r]=n+25,t[++r]=n+30,t[++r]=n+28,t[++r]=n+26,t[++r]=n+27,t[++r]=n+30,t[++r]=n+27,t[++r]=n+32,t[++r]=n+30,t[++r]=n+29,t[++r]=n+30,t[++r]=n+33,t[++r]=n+30,t[++r]=n+34,t[++r]=n+33,t[++r]=n+30,t[++r]=n+31,t[++r]=n+34,t[++r]=n+31,t[++r]=n+35,t[++r]=n+34},Oo=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.abs(l),d=Math.abs(v),g=o*Math.min(b,d),m=g/b,w=g/d,p=wo;p.set(i-l,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r-v),a.apply(p,p);var M=p.x,S=p.y,T=M-D,j=S-E,N=m*T,I=m*j,C=D+N,A=E+I,R=M+T,L=S+j,y=R-N,k=L-I;p.set(i,r),a.apply(p,p);var x=p.x,B=p.y,_=x-M,P=B-S,U=w*_,F=w*P,G=M+U,H=S+F,z=G-T,V=H-j,W=z+N,X=V+I,K=G+T,Y=H+j,J=K-N,Z=Y-I,q=x-T,Q=B-j,$=x+T,tt=B+j,nt=x+_,it=B+P,rt=nt-U,et=it-F,ut=rt-T,st=et-j,ht=ut+N,ot=st+I,at=rt+T,ct=et+j,ft=at-N,lt=ct-I,vt=nt-T,bt=it-j,dt=vt+N,gt=bt+I,mt=nt+T,wt=it+j,pt=mt-N,Ot=wt-I;c[0]=O(D,E,C,A),c[1]=O(D,E,M,S),c[2]=O(D,E,q,Q);var Dt=2*n-1;t[++Dt]=D,t[++Dt]=E,t[++Dt]=C,t[++Dt]=A,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=y,t[++Dt]=k,t[++Dt]=R,t[++Dt]=L,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=vt,t[++Dt]=bt,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=pt,t[++Dt]=Ot,t[++Dt]=mt,t[++Dt]=wt,t[++Dt]=C,t[++Dt]=A,t[++Dt]=M,t[++Dt]=S,t[++Dt]=y,t[++Dt]=k,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=G,t[++Dt]=H,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=q,t[++Dt]=Q,t[++Dt]=x,t[++Dt]=B,t[++Dt]=x,t[++Dt]=B,t[++Dt]=$,t[++Dt]=tt,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=rt,t[++Dt]=et,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=nt,t[++Dt]=it,t[++Dt]=pt,t[++Dt]=Ot},Do=function(t,n,i,r){var e=3*n-1,u=1-r[0]/r[1],s=1-r[0]/r[2];i&rt.TOP_LEFT?(t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1):(t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0),i&rt.TOP_RIGHT?(t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1):(t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0),i&rt.BOTTOM_LEFT?(t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&rt.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0),t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0},Eo=function(t,n,i,r,e,u,s){var h,a,c,f,l,v,b,d,g,m,w,p,O=o(e),D=s[0],E=s[1],M=s[2],S=Math.max(0,1-s[0]/s[1]),T=Math.max(0,1-s[0]/s[2]);r&Ht.TOP?(h=2,a=1,c=1+T):(h=-2,a=-1,c=-1-T),r&Ht.RIGHT?(f=2,l=1,v=1+S):(f=-2,l=-1,v=-1-S),r&Ht.BOTTOM?(b=2,d=1,g=1+T):(b=-2,d=-1,g=-1-T),r&Ht.LEFT?(m=2,w=1,p=1+S):(m=-2,w=-1,p=-1-S);var j=6*n-1;u&rt.TOP_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c),u&rt.TOP_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c),u&rt.BOTTOM_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b),u&rt.BOTTOM_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=b),t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b},Mo=function(t,n,i,r){var e=i.x0,u=i.x1,s=i.x2,h=i.x3,o=i.y0,a=i.y1,c=i.y2,f=i.y3,l=.5*(e+u),v=.5*(o+a),b=.5*(h+s),d=.5*(f+c),g=.5*r[0]/r[1],m=.5*r[0]/r[2],w=g*(u-e),p=g*(a-o),O=m*(h-e),D=m*(f-o),E=2*n-1;t[++E]=e,t[++E]=o,t[++E]=e+w,t[++E]=o+p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+w+O,t[++E]=o+p+D,t[++E]=u-w,t[++E]=a-p,t[++E]=u,t[++E]=a,t[++E]=u-w+O,t[++E]=a-p+D,t[++E]=u+O,t[++E]=a+D,t[++E]=h-O,t[++E]=f-D,t[++E]=h+w-O,t[++E]=f+p-D,t[++E]=h,t[++E]=f,t[++E]=h+w,t[++E]=f+p,t[++E]=s-w-O,t[++E]=c-p-D,t[++E]=s-O,t[++E]=c-D,t[++E]=s-w,t[++E]=c-p,t[++E]=s,t[++E]=c,t[++E]=e+w,t[++E]=o+p,t[++E]=l,t[++E]=v,t[++E]=u-w,t[++E]=a-p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+O+w,t[++E]=o+D+p,t[++E]=l+O,t[++E]=v+D,t[++E]=u+O-w,t[++E]=a+D-p,t[++E]=u+O,t[++E]=a+D;var M=.5*(e+s),S=.5*(o+c);t[++E]=.5*(e+h),t[++E]=.5*(o+f),t[++E]=M,t[++E]=S,t[++E]=M,t[++E]=S,t[++E]=.5*(u+s),t[++E]=.5*(a+c),t[++E]=h-O,t[++E]=f-D,t[++E]=h-O+w,t[++E]=f-D+p,t[++E]=b-O,t[++E]=d-D,t[++E]=s-O-w,t[++E]=c-D-p,t[++E]=s-O,t[++E]=c-D,t[++E]=h+w,t[++E]=f+p,t[++E]=b,t[++E]=d,t[++E]=s-w,t[++E]=c-p},So=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),po(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=n.radius,s=r!==this.sizeX||e!==this.sizeY||u!==this.radius,h=V(n),o=this.transformLocalId!==h,a=n.stroke,c=a.align,f=a.enable?a.width:0,l=a.side,v=a.style,b=this.strokeAlign!==c||this.strokeWidth!==f||this.strokeSide!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=W(n),w=X(m),p=m!==this.texture||w!==this.textureTransformId,O=s||b;if(O||o||g||p){this.sizeX=r,this.sizeY=e,this.radius=u,this.transformLocalId=h,this.strokeAlign=c,this.strokeWidth=f,this.strokeSide=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Oo(t.vertices,D,0,0,r,e,c,f,u,n.transform.internalTransform,mo),(O||g||o)&&(t.updateSteps(),Eo(t.steps,D,f,l,v,d,mo)),(O||g)&&(t.updateClippings(),Do(t.clippings,D,d,mo)),(O||p)&&(t.updateUvs(),Mo(t.uvs,D,K(m),mo))}},n}(z),To=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=go+h,c=24+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new So(i,r,a-h,c-o),new Zt(i+go,r+24,h,o)]).init(n):null},jo=function(t,n,i,r,e){return To(t,n,i,r)},No=function(t,n,i,r,e,u){var s=-i+e;if(t<=s)return n<=(h=-r+e)&&u&rt.TOP_LEFT?(a=t-s)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&rt.BOTTOM_LEFT?(a=t-s)*a+(c=n-o)*c<=e*e:-i<=t;var h,o,a,c,f=+i-e;return f<=t?n<=(h=-r+e)&&u&rt.TOP_RIGHT?(a=t-f)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&rt.BOTTOM_RIGHT?(a=t-f)*a+(c=n-o)*c<=e*e:t<=+i:-r<=n&&n<=+r},Io=function(t,n,i,r,e,u,s){var h=t.fill;if(h.enable||0<u){var o=t.radius*Math.min(r,e),a=t.corner;if(No(n,i,r,e,o,a)){if(h.enable)return!0;var c=u*s,f=Math.max(0,r-c),l=Math.max(0,e-c),v=Math.max(0,o-c);if(!No(n,i,f,l,v,a)){var b=t.stroke.side;if(b===Ht.ALL)return!0;if(n<=-f+v){var d=!!(b&Ht.LEFT);return i<=-l+v?!(!(g=!!(b&Ht.TOP))||!d)||(g?-f<=i:!!d&&n<=-f):+l-v<=i?!(!(m=!!(b&Ht.BOTTOM))||!d)||(m?+f<=i:!!d&&n<=-f):d}if(+f-v<=n){var g,m,w=!!(b&Ht.RIGHT);return i<=-l+v?!(!(g=!!(b&Ht.TOP))||!w)||(g?-f<=i:!!w&&+f<=n):+l-v<=i?!(!(m=!!(b&Ht.BOTTOM))||!w)||(m?+f<=i:!!w&&+f<=n):w}return i<=-l+v?!!(b&Ht.TOP):+l-v<=i&&!!(b&Ht.BOTTOM)}}}return!1},Co=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Io(this,n,i,r,e,u,s)},n}(Ft),Ao=function(t){function n(n){void 0===n&&(n=r.BUTTON);var i=t.call(this,n)||this;return i.th=!1,i.ih=!1,i}return _(n,t),Object.defineProperty(n.prototype,"isToggle",{get:function(){return this.th},set:function(t){this.th=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return this.ih},set:function(t){this.ih=t},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.th?1:0,e=this.ih?2:0;return i[15]=n.addResource("[".concat(r|e,"]")),i},n}(Co),Ro=function(t,n,i){i=i||new Ao;var r=n.resources,e=t[15];if(0<=e&&e<r.length){var u=n.getExtension(e);null==u&&(u=JSON.parse(r[e]),n.setExtension(e,u)),i.isToggle=!!(1&u[0]),i.isGrouped=!!(2&u[0])}return fo(t,n,i)},Lo=function(t){function n(n){var i=t.call(this,tn.COLOR_FILL_AND_STROKE|tn.COLOR_TEXT|tn.COLOR_TEXT_OUTLINE|tn.CURSOR)||this,r=n.fill,e=r.color,u=i.toOnHovered(e),s=2*u;i.Bh=e,i._h=$t.toGrayscale(e),i.Ph=$t.darken(e,s),i.Uh=$t.darken(e,u);var h=r.alpha;i.Fh=h,i.Gh=.5*h;var o=n.stroke,a=o.color,c=i.toOnHovered(a),f=2*c;i.Hh=a,i.zh=$t.toGrayscale(a),i.Vh=$t.darken(a,f),i.Wh=$t.darken(a,c);var l=o.alpha;i.Xh=l,i.Kh=.5*l;var v=n.text,b=v.color;i.Ks=b,i.Yh=$t.toGrayscale(b);var d=v.alpha;i.Ys=d,i.Jh=.5*d;var g=v.outline,m=g.color;i.Zh=m,i.qh=$t.toGrayscale(m);var w=g.alpha;return i.Qh=w,i.$h=.5*w,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=$t.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this._h:t.isPressed||t.isActive?this.Ph:t.isFocused||t.isHovered?this.Uh:this.Bh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.Gh:this.Fh},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.zh:t.isPressed||t.isActive?this.Vh:t.isFocused||t.isHovered?this.Wh:this.Hh},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.Kh:this.Xh},n.prototype.getTextColor=function(t){return t.inDisabled?this.Yh:this.Ks},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.Jh:this.Ys},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.qh:this.Zh},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.$h:this.Qh},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(un),yo=function(t){function n(n){var i=t.call(this,tn.COLOR_FILL_AND_STROKE|tn.COLOR_TEXT|tn.COLOR_TEXT_OUTLINE|tn.CURSOR)||this,r=n.fill,e=r.color;i.no=e;var u=i.toOnHovered(e),s=2*u;i.io=$t.darken(e,s),i.ro=$t.darken(e,u);var h=15197671;i.Bh=h;var o=i.toOnHovered(h),a=2*o;i.Ph=$t.darken(h,a),i.Uh=$t.darken(h,o);var c=r.alpha;i.Fh=c,i.Gh=.5*c;var f=n.stroke,l=f.color;i.eo=l;var v=i.toOnHovered(l),b=2*v;i.uo=$t.darken(l,b),i.so=$t.darken(l,v);var d=15197671;i.Hh=d;var g=i.toOnHovered(d),m=2*g;i.Vh=$t.darken(d,m),i.ho=$t.darken(d,g);var w=f.alpha;i.Xh=w,i.Kh=.5*w;var p=n.text,O=p.color;i.oo=O,i.Yh=$t.toGrayscale(O),i.Ks=5197647;var D=p.alpha;i.Ys=D,i.Jh=.5*D;var E=p.outline,M=E.color;i.Zh=M,i.qh=$t.toGrayscale(M);var S=E.alpha;return i.Qh=S,i.$h=.5*S,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=$t.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.Bh:t.isActive?t.isPressed?this.io:t.isFocused||t.isHovered?this.ro:this.no:t.isPressed?this.Ph:t.isFocused||t.isHovered?this.Uh:this.Bh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.Gh:this.Fh},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.Hh:t.isActive?t.isPressed?this.uo:t.isFocused||t.isHovered?this.so:this.eo:t.isPressed?this.Vh:t.isFocused||t.isHovered?this.ho:this.Hh},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.Kh:this.Xh},n.prototype.getTextColor=function(t){return t.inDisabled?this.Yh:t.isActive?this.oo:this.Ks},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.Jh:this.Ys},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.qh:this.Zh},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.$h:this.Qh},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(un),ko=function(t){function n(n){var i=t.call(this,n)||this;return n instanceof Ao&&(i.th=n.isToggle,i.ih=n.isGrouped),i}return _(n,t),n.prototype.isActionable=function(){return!0},n.prototype.initialize=function(n){this.actions.unshift(this.th?new yo(this):new Lo(this)),t.prototype.initialize.call(this,n)},n.prototype.onClick=function(n,i){var r=n.state,e=r.isClicked;r.lock(),t.prototype.onClick.call(this,n,i),!e&&r.isClicked&&(this.th?r.isActive=!r.isActive:r.isActive||(r.isActivated=!0)),r.unlock()},n.prototype.onStateChange=function(n,i,r){t.prototype.onStateChange.call(this,n,i,r),this.th&&this.ih&&i.is(vt.ACTIVATED)&&this.onActivated(n)},n.prototype.onActivated=function(t){var n=t.parent;if(null!=n)for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u instanceof Ao&&u.isToggle&&u.isGrouped&&(u.state.isActive=!1)}},n}(qe),xo=function(){e[r.BUTTON]=jo,n[r.BUTTON]=Ro,bo[r.BUTTON]=ko,wr.set(r.BUTTON,pt.PRIMITIVE|pt.STROKE_SIDE|pt.BORDER_RADIUS)},Bo=[0,0],_o=new t.Point,Po=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1},Uo=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Fo=function(t,n,i,r,e,u,s,h,o,a){var c=_o,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D+(D-g),S=E+(E-m),T=D-w,j=E-p,N=2*n-1;t[++N]=b,t[++N]=d,t[++N]=g,t[++N]=m,t[++N]=g+w,t[++N]=m+p,t[++N]=T,t[++N]=j,t[++N]=D,t[++N]=E,t[++N]=D+w,t[++N]=E+p,t[++N]=M-w,t[++N]=S-p,t[++N]=M,t[++N]=S,t[++N]=M+w,t[++N]=S+p,a[0]=O(b,d,g,m),a[1]=O(b,d,T,j)},Go=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<9;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},Ho=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a),t[++f]=s,t[++f]=c,t[++f]=.5*(s+u),t[++f]=.5*(c+a),t[++f]=u,t[++f]=a},zo=function(t){function n(n,i){return t.call(this,n,i,9,8)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;Po(t.clippings,n),Uo(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=V(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),Fo(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,Bo),Go(t.steps,t.clippings,this.vertexOffset,c,f,Bo))},n.prototype.updateUv=function(t,n){var i=W(n),r=X(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=K(i);Ho(t.uvs,this.vertexOffset,e)}},n}(z),Vo=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new zo(i,r),new Zt(i+9,r+8,h,o)]).init(n):null},Wo=function(t){function n(n){return void 0===n&&(n=r.CIRCLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Gt(this,n,i,r,e,u,s)},n}(Ft),Xo=function(t,n,i){return fo(t,n,i||new Wo)},Ko=function(){e[r.CIRCLE]=Vo,n[r.CIRCLE]=Xo},Yo=new t.Point,Jo=function(t){return t?t.formatted.length:0},Zo=function(t){return 12*Math.ceil(Jo(t)/12)},qo=function(t,n){return n?4*t+2:4*t},Qo=function(t,n){return qo(t,n)-2},$o=function(t,n,i,r){for(var e=3*n-1,u=3*(n+i)-1,s=0;s<r;++s)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5,t[++e]=1,t[++e]=0,t[++e]=4,t[++e]=0,t[++e]=1,t[++e]=6;for(;e<u;)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5},ta=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s+0,t[++e]=s+2,t[++e]=s+1,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=2},na=function(t,n,i,r,e,u){for(var s=1/Math.max(1e-5,u),h=e.x0,o=e.x1,a=e.x2,c=e.x3,f=e.y0,l=e.y1,v=e.y2,b=e.y3,d=o-h,g=l-f,m=a-c,w=v-b,p=(i<<1)-1,O=(i+r<<1)-1,D=(i<<2)-8;p<O;){var E=n[D+=8]*s;t[++p]=h+E*d,t[++p]=f+E*g,t[++p]=c+E*m,t[++p]=b+E*w}},ia=function(t,n,i,r,e,u,s,h,o,a,c,f){var l=F;null==l&&(F=l=[]);for(var v=f.a,b=f.b,d=f.c,g=f.d,m=f.tx,w=f.ty,p=0;p<u;++p){var O=p<<1,D=h[O],E=h[O+1];l[O]=v*D+d*E+m,l[O+1]=b*D+g*E+w}return ea(t,n,i,r,e,u,s,l,o,a,c)},ra=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=1]=b,n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=4]=b},ea=function(t,n,i,r,e,u,s,h,o,a,c){var f=o.length;if(0<f){if(s){for(var l=0,v=0,b=r,d=0,g=o[0],m=1;m<f;++m)2<=(d=o[m])-g&&(v=sa(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=qo(d-g,!1)),g=d;return 2<=(d=o[0]+u)-g?(v=sa(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=qo(d-g,!1)):ua(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}for(l=0,v=0,b=r,2<=(d=o[0])&&(v=sa(t,n,i,b,-1,h,0,d,u,a,c,v),l=Math.max(l,v),b+=qo(d,!1)),g=d,m=1;m<f;++m)2<=(d=o[m])-g&&(v=sa(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=qo(d-g,!1)),g=d;return 2<=(d=u)-g?(v=sa(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=qo(d-g,!1)):ua(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}return s?ha(t,n,i,r,e,h,0,u,u,a,c):sa(t,n,i,r,e,h,0,u,u,a,c,0)},ua=function(t,n,i,r,e,u,s,h,a,c,f,l){if(0<=e)for(var v=o(f),b=(r<<1)-1,d=6*r-1,g=(r<<2)-1,m=(r+e<<1)-1,w=s%a<<1,p=u[w],O=u[w+1];b<m;)t[++b]=p,t[++b]=O,n[++d]=0,n[++d]=v,n[++d]=-1,n[++d]=0,n[++d]=1,n[++d]=0,i[++g]=l,i[++g]=0,i[++g]=0,i[++g]=l;return 0},sa=function(t,n,i,r,e,u,s,a,c,f,l,v){var b=o(l),d=s%c<<1,g=u[d],m=u[d+1],w=(s+1)%c<<1,p=u[w],D=u[w+1],E=g-(p-g),M=m-(D-m),S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=0;ra(S,t,T,n,j,i,g,m,f,b,E,M,p,D,v),ra(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;for(var I=s+1,C=a-1;I<C;++I){E=g,M=m,g=p,m=D;var A=(I+1)%c<<1;p=u[A],D=u[A+1],N+=O(E,M,g,m),ra(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),ra(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8}E=g,M=m,p=(g=p)+(g-E),D=(m=D)+(m-M),N+=O(E,M,g,m),ra(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),ra(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;var R=h(N,f,l,Yo),L=R.x,y=R.y,k=(r<<2)-1;for(I=k,C=k+8;I<C;I+=4)i[I+2]=L,i[I+3]=y,i[I+4]=v;for(I=k+8;I<j;I+=4)i[I+2]=L,i[I+3]=y,i[I+4]=N;if(0<=e)for(var x=(r+e<<1)-1;S<x;)t[++S]=g,t[++S]=m,n[++T]=0,n[++T]=b,n[++T]=E,n[++T]=M,n[++T]=p,n[++T]=D,i[++j]=N,i[++j]=L,i[++j]=y,i[++j]=N;return N},ha=function(t,n,i,r,e,u,s,a,c,f,l){for(var v=o(l),b=(a-1)%c<<1,d=0,g=0,m=u[b],w=u[b+1],p=s%c<<1,D=u[p],E=u[p+1],M=0,S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=s;N<a;++N){d=m,g=w,m=D,w=E;var I=(N+1)%c<<1;D=u[I],E=u[I+1],M+=O(d,g,m,w),ra(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),ra(S+=4,t,T+=12,n,j+=8,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8}d=m,g=w,m=D,w=E;var C=(s+1)%c<<1;D=u[C],E=u[C+1],M+=O(d,g,m,w),ra(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8;var A=h(M,f,l,Yo),R=A.x,L=A.y;for(N=(r<<2)-1;N<j;N+=4)i[N+2]=R,i[N+3]=L,i[N+4]=-1;if(0<=e)for(var y=(r+e<<1)-1;S<y;)t[++S]=m,t[++S]=w,n[++T]=f,n[++T]=v,n[++T]=d,n[++T]=g,n[++T]=D,n[++T]=E,i[++j]=M,i[++j]=R,i[++j]=L,i[++j]=-1;return M},oa=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.pointId=-1,u.pointCount=0,u.pointsClosed=!1,u.length=1,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),ta(t.indices,this.vertexOffset,this.indexOffset,this.indexCount)},n.prototype.isCompatible=function(t){return qo(Zo(t.points),!0)===this.vertexCount},n.prototype.update=function(t,n){this.updateLineClipping(t,n),this.updateLineVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateLineUv(t,n)},n.prototype.updateLineClipping=function(t,n){var i=n.points;if(i){var r=i.formatted.length;this.pointCount!==r&&(this.pointCount=r,this.pointId=-1,t.updateClippings(),$o(t.clippings,this.vertexOffset,this.vertexCount,r))}},n.prototype.updateLineVertexStepAndColorFill=function(t,n){var i=n.points;if(i){var r=i.id,e=i.formatted,u=!!(e.style&G.CLOSED),s=r!==this.pointId||u!==this.pointsClosed,h=n.stroke,o=h.enable?h.width:0,a=h.style,c=this.strokeWidth!==o||this.strokeStyle!==a,f=V(n),l=this.transformLocalId!==f;(s||l||c)&&(this.pointId=r,this.pointsClosed=u,this.strokeWidth=o,this.strokeStyle=a,this.transformLocalId=f,s&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),this.length=ia(t.vertices,t.steps,t.colorFills,this.vertexOffset,this.vertexCount,this.pointCount,this.pointsClosed,e.values,e.segments,o,a,n.transform.internalTransform))}},n.prototype.updateLineUv=function(t,n){var i=W(n),r=X(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),na(t.uvs,t.colorFills,this.vertexOffset,this.vertexCount,K(i),this.length))},n}(z),aa=[0,0,0],ca=new t.Point,fa=function(t,n){var i=3*n-1;t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0},la=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+2,t[++r]=n+0,t[++r]=n+3,t[++r]=n+4,t[++r]=n+0,t[++r]=n+5,t[++r]=n+6},va=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=2*f*l/(f+Math.sqrt(f*f+4*l*l)),b=ca;b.set(i,r-l),o.apply(b,b);var d=b.x,g=b.y;b.set(i,r),o.apply(b,b);var m=b.x,w=b.y;b.set(i+f,r),o.apply(b,b);var p=m-d,D=w-g,E=b.x+p,M=b.y+D,S=m+(m-b.x)+p,T=w+(w-b.y)+D;b.set(i,r+l-v),o.apply(b,b);var j=b.x,N=b.y,I=m+p,C=w+D;a[0]=O(I,C,j,N),a[1]=O(E,M,I,C),a[2]=O(d,g,m,w);var A=(n<<1)-1;t[++A]=j,t[++A]=N,t[++A]=d,t[++A]=g,t[++A]=E,t[++A]=M,t[++A]=E,t[++A]=M,t[++A]=S,t[++A]=T,t[++A]=S,t[++A]=T,t[++A]=d,t[++A]=g},ba=function(t,n,i,r,e,u,s){for(var h=o(u),a=s[0],c=6*i-1,f=3*i,l=0;l<r;l+=1,f+=3)t[++c]=e,t[++c]=h,t[++c]=a,t[++c]=a,t[++c]=1+n[f],t[++c]=1+n[f+1]},da=function(t,n,i,r){var e=n.x0,u=n.x1,s=n.x2,h=n.x3,o=n.y0,a=n.y1,c=n.y2,f=n.y3,l=.5*(e+u),v=.5*(o+a),b=1-.5*r[0]/r[2],d=l+b*(h-e),g=v+b*(f-o),m=(i<<1)-1;t[++m]=d,t[++m]=g,t[++m]=l,t[++m]=v,t[++m]=s,t[++m]=c,t[++m]=s,t[++m]=c,t[++m]=h,t[++m]=f,t[++m]=h,t[++m]=f,t[++m]=l,t[++m]=v},ga=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.updateColorFill=function(t,n){var i=n.points;if(null!=i){var r=i.getMarker();if(null!=r){var e=this.toMarker(r).fill,u=n.visible&&e.enable,s=e.color,h=u?e.alpha:0;s===this.colorFill&&h===this.alphaFill||(this.colorFill=s,this.alphaFill=h,t.updateColorFills(),H(s,h,this.vertexOffset,this.vertexCount,t.colorFills))}}},n}(z),ma=function(n){function i(t,i){var r=n.call(this,t,i,7,3)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices(),fa(t.clippings,this.vertexOffset),la(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=V(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=W(r),O=X(p),D=p!==this.texture||O!==this.textureTransformId,E=f||w,M=u.id,S=M!==this.pointId;if(E||v||D||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.texture=p,this.textureTransformId=O,this.pointId=M;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),va(n.vertices,T,0,0,a,c,d,g,j,aa),(E||v)&&(n.updateSteps(),ba(n.steps,n.clippings,T,7,g,m,aa)),(E||D)&&(n.updateUvs(),da(n.uvs,K(p),T,aa))}}}},i}(ga),wa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(ma),pa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(ma),Oa=function(n){function i(t,i){var r=n.call(this,t,i,9,8)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;Po(t.clippings,n),Uo(t.indices,n,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},i.prototype.updateVertexAndStep=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=V(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=u.id,O=p!==this.pointId;if(f||v||w||O){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.pointId=p;var D=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;D.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),n.updateSteps(),Fo(n.vertices,this.vertexOffset,0,0,a,c,d,g,D,Bo),Go(n.steps,n.clippings,this.vertexOffset,g,m,Bo)}}}},i.prototype.updateUv=function(t,n){var i=W(n),r=X(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=K(i);Ho(t.uvs,this.vertexOffset,e)}},i}(ga),Da=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Oa),Ea=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Oa),Ma=function(){function n(t,n){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=0,this.indexCount=0,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=W(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Sa=24,Ta=16,ja=[0,0,0,0],Na=new t.Point,Ia=function(t,n,i){var r=1-i[0],e=1-i[1],u=3*n-1;t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0},Ca=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+4,t[++r]=n+4,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+5,t[++r]=n+2,t[++r]=n+3,t[++r]=n+8,t[++r]=n+6,t[++r]=n+9,t[++r]=n+9,t[++r]=n+6,t[++r]=n+7,t[++r]=n+9,t[++r]=n+7,t[++r]=n+10,t[++r]=n+10,t[++r]=n+7,t[++r]=n+11,t[++r]=n+12,t[++r]=n+16,t[++r]=n+13,t[++r]=n+13,t[++r]=n+16,t[++r]=n+17,t[++r]=n+13,t[++r]=n+17,t[++r]=n+14,t[++r]=n+14,t[++r]=n+17,t[++r]=n+15,t[++r]=n+18,t[++r]=n+20,t[++r]=n+21,t[++r]=n+18,t[++r]=n+21,t[++r]=n+22,t[++r]=n+18,t[++r]=n+22,t[++r]=n+19,t[++r]=n+19,t[++r]=n+22,t[++r]=n+23},Aa=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=Na;v.set(i-f,r-l),o.apply(v,v);var b=v.x,d=v.y;v.set(i+f,r-l),o.apply(v,v);var g=v.x,m=v.y;v.set(i+f,r+l),o.apply(v,v);var w=v.x,p=v.y,D=b+(w-g),E=d+(p-m),M=.5*O(b,d,g,m),S=.5*O(g,m,w,p),T=1,j=1;M<=S?j=M/S:T=S/M,a[0]=T,a[1]=j,a[2]=M,a[3]=S;var N=T*(g-b)*.5,I=T*(m-d)*.5,C=j*(D-b)*.5,A=j*(E-d)*.5,R=(n<<1)-1;t[++R]=b,t[++R]=d,t[++R]=b+N,t[++R]=d+I,t[++R]=g-N,t[++R]=m-I,t[++R]=g,t[++R]=m,t[++R]=b+N+C,t[++R]=d+I+A,t[++R]=g-N+C,t[++R]=m-I+A,t[++R]=D+N-C,t[++R]=E+I-A,t[++R]=w-N-C,t[++R]=p-I-A,t[++R]=D,t[++R]=E,t[++R]=D+N,t[++R]=E+I,t[++R]=w-N,t[++R]=p-I,t[++R]=w,t[++R]=p,t[++R]=b,t[++R]=d,t[++R]=b+C,t[++R]=d+A,t[++R]=D-C,t[++R]=E-A,t[++R]=D,t[++R]=E,t[++R]=b+C+N,t[++R]=d+A+I,t[++R]=D-C+N,t[++R]=E-A+I,t[++R]=g+C-N,t[++R]=m+A-I,t[++R]=w-C-N,t[++R]=p-A-I,t[++R]=g,t[++R]=m,t[++R]=g+C,t[++R]=m+A,t[++R]=w-C,t[++R]=p-A,t[++R]=w,t[++R]=p},Ra=function(t,n,i,r,e,u){var s,h,a,c,f,l,v,b,d=o(e),g=u[0],m=u[1],w=Math.max(0,1-g),p=Math.max(0,1-m),O=u[2],D=u[3];r&Ht.TOP?(s=2,h=1+p):(s=-2,h=-1-p),r&Ht.RIGHT?(a=2,c=1+w):(a=-2,c=-1-w),r&Ht.BOTTOM?(f=2,l=1+p):(f=-2,l=-1-p),r&Ht.LEFT?(v=2,b=1+w):(v=-2,b=-1-w);var E=6*(t-1)-1;La(n,E+=6,i,d,O,D,v,s),La(n,E+=6,i,d,O,D,b,s),La(n,E+=6,i,d,O,D,c,s),La(n,E+=6,i,d,O,D,a,s),La(n,E+=6,i,d,O,D,b,h),La(n,E+=6,i,d,O,D,c,h),La(n,E+=6,i,d,O,D,b,l),La(n,E+=6,i,d,O,D,c,l),La(n,E+=6,i,d,O,D,v,f),La(n,E+=6,i,d,O,D,b,f),La(n,E+=6,i,d,O,D,c,f),La(n,E+=6,i,d,O,D,a,f),La(n,E+=6,i,d,O,D,v,s),La(n,E+=6,i,d,O,D,v,h),La(n,E+=6,i,d,O,D,v,l),La(n,E+=6,i,d,O,D,v,f),La(n,E+=6,i,d,O,D,b,h),La(n,E+=6,i,d,O,D,b,l),La(n,E+=6,i,d,O,D,c,h),La(n,E+=6,i,d,O,D,c,l),La(n,E+=6,i,d,O,D,a,s),La(n,E+=6,i,d,O,D,a,h),La(n,E+=6,i,d,O,D,a,l),La(n,E+=6,i,d,O,D,a,f)},La=function(t,n,i,r,e,u,s,h){t[++n]=i,t[++n]=r,t[++n]=e,t[++n]=u,t[++n]=s,t[++n]=h},ya=function(t,n,i,r){var e=i.x0,u=i.y0,s=i.y1,h=i.x1,o=i.y2,a=i.x2,c=i.y3,f=i.x3,l=r[0],v=r[1],b=l*(h-e)*.5,d=l*(s-u)*.5,g=v*(f-e)*.5,m=v*(c-u)*.5,w=(n<<1)-1;t[++w]=e,t[++w]=u,t[++w]=e+b,t[++w]=u+d,t[++w]=h-b,t[++w]=s-d,t[++w]=h,t[++w]=s,t[++w]=e+b+g,t[++w]=u+d+m,t[++w]=h-b+g,t[++w]=s-d+m,t[++w]=f+b-g,t[++w]=c+d-m,t[++w]=a-b-g,t[++w]=o-d-m,t[++w]=f,t[++w]=c,t[++w]=f+b,t[++w]=c+d,t[++w]=a-b,t[++w]=o-d,t[++w]=a,t[++w]=o,t[++w]=e,t[++w]=u,t[++w]=e+g,t[++w]=u+m,t[++w]=f-g,t[++w]=c-m,t[++w]=f,t[++w]=c,t[++w]=e+g+b,t[++w]=u+m+d,t[++w]=f-g+b,t[++w]=c-m+d,t[++w]=h+g-b,t[++w]=s+m-d,t[++w]=a-g-b,t[++w]=o-m-d,t[++w]=h,t[++w]=s,t[++w]=h+g,t[++w]=s+m,t[++w]=a-g,t[++w]=o-m,t[++w]=a,t[++w]=o},ka=function(n){function i(t,i){var r=n.call(this,t,i,Sa,Ta)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateIndices(),Ca(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexClippingStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=V(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.side,w=b.style,p=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeSide!==m||this.strokeStyle!==w,O=W(r),D=X(O),E=O!==this.texture||D!==this.textureTransformId,M=f||p,S=u.id!==this.pointId;if(M||v||E||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeSide=m,this.strokeStyle=w,this.texture=O,this.textureTransformId=D;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),Aa(n.vertices,T,0,0,a,c,d,g,j,ja),(M||v)&&(n.updateSteps(),Ra(T,n.steps,g,m,w,ja)),M&&(n.updateClippings(),Ia(n.clippings,T,ja)),(M||E)&&(n.updateUvs(),ya(n.uvs,T,K(O),ja))}}}},i}(ga),xa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(ka),Ba=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(ka),_a=function(t){switch(t){case Z.NONE:return 0;case Z.CIRCLE:return 9;case Z.TRIANGLE:return 7;case Z.RECTANGLE:return Sa}return 0},Pa=function(t){switch(t){case Z.NONE:return 0;case Z.CIRCLE:return 8;case Z.TRIANGLE:return 3;case Z.RECTANGLE:return Ta}return 0},Ua=function(t,n,i){switch(t){case Z.NONE:return new Ma(n,i);case Z.CIRCLE:return new Da(n,i);case Z.TRIANGLE:return new wa(n,i);case Z.RECTANGLE:return new Ba(n,i)}return new Ma(n,i)},Fa=function(t,n,i){switch(t){case Z.NONE:return new Ma(n,i);case Z.CIRCLE:return new Ea(n,i);case Z.TRIANGLE:return new pa(n,i);case Z.RECTANGLE:return new xa(n,i)}return new Ma(n,i)},Ga=function(t,n,i,r,e){var s=n.points,h=Zo(s),o=qo(h,!0),a=Qo(h,!0),c=Z.NONE,f=Z.NONE;if(s&&s instanceof ie){var l=s.getMarker();l&&(c=l.tail.type,f=l.head.type)}var v=_a(c),b=Pa(c),d=i+o,g=r+a,m=_a(f),w=Pa(f),p=d+v,O=g+b,D=M(n),E=4*D,S=2*D,T=p+m,j=O+w,N=o+m+v+E,I=a+w+b+S;return t.check(i,r,N,I)?new u(t,i,r,N,I,[new oa(i,r,o,a),Fa(c,d,g),Ua(f,p,O),new Zt(T,j,E,S)]).init(n):null},Ha=function(){function t(t,n,i){this.ao=1e-6,this._x=t,this._y=n,this._z=0,this.L=i,i[0]=t,i[1]=n,this.index=0}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){if(0===this._z||this.ao<Math.abs(this._x-t)){this._x=t;var n=this.index,i=this.L;1===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=1)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){if(0===this._z||this.ao<Math.abs(this._y-t)){this._y=t;var n=this.index,i=this.L;2===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=2)}},enumerable:!1,configurable:!0}),t.prototype.toAxis=function(t,n,i,r){var e=Math.abs(i),u=Math.abs(r),s=this.ao;if(e<s&&u<s)return Math.abs(t)<Math.abs(n)?0<=n?2:0:0<=t?1:3;var h=.2;return 0<=i?0<=r?h<e&&h<u?t<n?2:1:h<e?1:2:h<e&&h<u?t<-n?0:1:h<e?1:0:0<=r?h<e&&h<u?-t<n?2:3:h<e?3:2:h<e&&h<u?n<t?0:3:h<e?3:0},t.prototype.toTailAxis=function(t,n,i,r){return this.toAxis(t-this.x,n-this.y,i,r)},t.prototype.tail=function(t,n,i,r,e,u,s){switch(this.toTailAxis(t,n,i,r)){case 0:this.y-s<=n?(this.y-=Math.max(s,u),this.x=t):this.y=n;break;case 1:t<=this.x+s?(this.x+=Math.max(s,e),this.y=n):this.x=t;break;case 2:n<=this.y+s?(this.y+=Math.max(s,e),this.x=t):this.y=n;break;case 3:this.x-s<=t?(this.x-=Math.max(s,e),this.y=n):this.x=t}},t.prototype.middle=function(t,n){var i=t-this._x,r=n-this._y;Math.abs(i)<Math.abs(r)?this.y=n:this.x=t},t.prototype.toHeadAxis=function(t,n,i,r){return this.toAxis(this.x-t,this.y-n,i,r)},t.prototype.head=function(t,n,i,r,e,u,s){switch(this.toHeadAxis(t,n,i,r)){case 0:n-s<=this.y&&(this.y=n-Math.max(s,u)),this.x=t,this.y=n;break;case 1:this.x<=t+s&&(this.x=t+Math.max(s,e)),this.y=n,this.x=t;break;case 2:this.y<=n+s&&(this.y=n+Math.max(s,u)),this.x=t,this.y=n;break;case 3:t-s<=this.x&&(this.x=t-Math.max(s,e)),this.y=n,this.x=t}},t.prototype.margin=function(t,n){var i=this.L,r=this.index;if(0!==t&&2<=r){var e=i[0],u=i[1],s=(o=i[2]-e)*o+(a=i[3]-u)*a;if((c=this.ao)<s){var h=t/Math.sqrt(o*o+a*a);c<Math.abs(h-1)?(i[0]=e+o*h,i[1]=u+a*h):this.index-=2}}if(r=this.index,0!==n&&2<=r){var o,a,c,f=i[r+0],l=i[r+1];s=(o=i[r-2]-f)*o+(a=i[r-1]-l)*a,(c=this.ao)<s&&(h=n/Math.sqrt(o*o+a*a),c<Math.abs(h-1)?(i[r+0]=f+o*h,i[r+1]=l+a*h):this.index-=2)}i.length=this.index+2},t}(),za=function(t){function n(n){return void 0===n&&(n=r.CONNECTOR_ELBOW),t.call(this,n)||this}return _(n,t),n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=t.local,a=o.x,c=o.y,f=t.normal,l=f.x,v=f.y,b=i.local,d=b.x,g=b.y,m=i.normal,w=m.x,p=m.y,O=e.values,D=O.length,E=a-u,M=c-s,S=d-u,T=g-s,j=.5*(S+E),N=.5*(T+M),I=S-E,C=T-M,A=.5*J.SIZE_X,R=.5*J.SIZE_Y,L=1e-6;if(Math.abs(I)<L&&Math.abs(C)<L)h[0]=E,h[1]=M,h[2]=S,h[3]=T,h.length=4;else{var y=new Ha(E,M,h);if(0<D){var k=Math.atan2(C,I),x=Math.sqrt(I*I+C*C),B=Math.cos(k)*x,_=Math.sin(k)*x,P=O[0],U=O[1],F=j+B*P-_*U,G=N+B*U+_*P;y.tail(F,G,l,v,A,R,n);for(var H=2;H<D;H+=2){var z=O[H+0],V=O[H+1],W=j+B*z-_*V,X=N+B*V+_*z;y.middle(W,X)}y.head(S,T,w,p,A,R,r)}else y.tail(j,N,l,v,A,R,n),y.head(S,T,w,p,A,R,r);y.margin(n,r)}},n}(ee),Va=function(t,n,i){return fo(t,n,i||new za)},Wa=function(){function t(){}return t.from=function(t,n,i){var r=[],e=t.length;if(4<e){var u=1e-6,s=t[0],h=t[1];0!==n&&u<(c=(o=s-t[2])*o+(a=h-t[3])*a)&&(s+=o*(f=n/Math.sqrt(c)),h+=a*f);var o,a,c,f,l=t[e-2],v=t[e-1];0!==i&&u<(c=(o=l-t[e-4])*o+(a=v-t[e-3])*a)&&(l+=o*(f=i/Math.sqrt(c)),v+=a*f);for(var b=.5*(l+s),d=.5*(v+h),g=l-s,m=v-h,w=Math.atan2(m,g),p=Math.cos(w),O=Math.sin(w),D=g*g+m*m,E=u<D?1/Math.sqrt(D):1,M=2,S=e-2;M<S;M+=2){var T=t[M+0]-b,j=t[M+1]-d;r.push((p*T+O*j)*E,(p*j-O*T)*E)}}return r},t}(),Xa=function(t,n,i){return fo(t,n,i||new ee)},Ka=function(t,n,i,r){if(n instanceof ee){var e=r.resources,u=t[15];if(0<=u&&u<e.length){var s=r.getExtension(u);null==s&&(s=JSON.parse(e[u]),r.setExtension(u,s)),n.lock();var h=n.points;h.deserialize(s[1],r);var o=n.edge;o.deserialize(s[0],i,r);var a=n.body,c=s[2];null!=c?a.deserialize(c,i,r):a.set(Wa.from(h.values,o.tail.margin,o.head.margin)),n.unlock()}}},Ya=function(){e[r.CONNECTOR_ELBOW]=Ga,n[r.CONNECTOR_ELBOW]=Va,i[r.CONNECTOR_ELBOW]=Ka,wr.set(r.CONNECTOR_ELBOW,pt.CONNECTOR)},Ja=function(){e[r.CONNECTOR_LINE]=Ga,n[r.CONNECTOR_LINE]=Xa,i[r.CONNECTOR_LINE]=Ka,wr.set(r.CONNECTOR_LINE,pt.CONNECTOR)},Za=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Ca(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=V(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=W(n),d=X(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Aa(t.vertices,w,.5*r,.5*e,r,e,a,c,n.transform.internalTransform,ja),(m||h)&&(t.updateSteps(),Ra(w,t.steps,c,f,l,ja)),m&&(t.updateClippings(),Ia(t.clippings,w,ja)),(m||g)&&(t.updateUvs(),ya(t.uvs,w,K(b),ja))}},n}(z),qa=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=Sa+h,c=Ta+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Za(i,r,a-h,c-o),new Zt(i+Sa,r+Ta,h,o)]).init(n):null},Qa=function(t,n,i,r){var e=M(n),s=4*e,h=2*e,o=s,a=h;return t.check(i,r,o,a)?new u(t,i,r,o,a,[new Zt(i,r,s,h)]).init(n):null},$a=function(t,n){var i=t.data.getMapping();if(null!=i)for(var r=i.values,e=0,u=r.length;e<u;++e){var s=r[e],h=s[0],o=n.getDataMapper(h);if(null!=o){var a=t.children,c=n.getDataDestination(s[1]),f=s[2];tc(a,o,c,f)}}},tc=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){for(var s=t[e],h=s.data,o=0,a=h.size();o<a;++o){var c=h.get(o);c&&c.scope!==Nt.PRIVATE&&n.map(c,i,r)}var f=s.children;0<f.length&&tc(f,n,i,r)}},nc=function(t,n,i){var r=n.pieces,e=t[15];if(r&&0<=e&&e<r.length){var u=n.pieceData;if(u){var s=r[e],h=u.get(s),o=i&&i(s,n);return h?function(t,n,i,r,e,u,s){var h=e.mode,o=e.depth;s=s||new Ir(t,h,o);var a=fo(u,e,s),c=s.size,f=c.x,l=c.y;return s.size.set(n,i),r.copyTo(s),s.size.init(),s.size.set(f,l),h===mr.EDITOR?0<o&&$a(s,e):$a(s,e),a}(s,h.width,h.height,h.layer,n,t,o):function(t,n,i,r){var e=n.mode,u=n.depth;r=r||new Ir(t,e,u);var s=fo(i,n,r),h=r.size,o=h.x,a=h.y,c=r.children,f=new Ne("missing",e,u),l=.5*o,v=.5*o;f.transform.position.set(-l,-v),f.size.set(o,a),f.size.init(),f.parent=r;var b=new Qe;return b.stroke.color=16711680,b.transform.position.set(l,v),b.size.copyFrom(r.size),b.attach(f),c.push(f),r.onChildTransformChange(),r.toDirty(),r.onAttach(),r.size.init(),e===mr.EDITOR?0<u&&$a(r,n):$a(r,n),s}(s,n,t,o)}}return null},ic=function(){e[r.EMBEDDED]=Qa,n[r.EMBEDDED]=nc,wr.set(r.EMBEDDED,pt.EMBEDDED),e[r.EMBEDDED_LAYER]=qa},rc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.p.children;return!(0<t.length)||t[t.length-1].fill.enable},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.color:16777215},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.alpha:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.alpha=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.copy(t)},t.prototype.set=function(t,n,i){for(var r=this.p.children,e=0,u=r.length;e<u;++e)r[e].fill.set(t,n,i)},t.prototype.clone=function(){return new t(this.p)},t.prototype.toObject=function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.toObject():{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ec=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"length",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.length}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.id}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.values}return[]},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.values=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.segments}return[]},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.segments=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.style}return G.NONE},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.style=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marker",{get:function(){for(var t=this.p.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.marker}return $.getInstance()},enumerable:!1,configurable:!0}),t.prototype.getMarker=function(){for(var t=this.p.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.getMarker()}},Object.defineProperty(t.prototype,"formatter",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatter}return null},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.formatter=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formatted",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatted}return this},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&e.copy(t)}return this},t.prototype.set=function(t,n,i){for(var r=this.p.children,e=0,u=r.length;e<u;++e){var s=r[e].points;null!=s&&s.set(t,n,i)}return this},t.prototype.clone=function(n){return new t(n)},t.prototype.toPoints=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.toPoints(t)}return[]},t.prototype.serialize=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.serialize(t)}return-1},t}(),uc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.p.children;return 0<t.length&&t[t.length-1].stroke.enable},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.color:16777215},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.alpha:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.width:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.align:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.side:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.side=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.style:s.NONE},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.style=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.copy(t)},t.prototype.set=function(t,n,i,r,e){for(var u=this.p.children,s=0,h=u.length;s<h;++s)u[s].stroke.set(t,n,i,r,e)},t.prototype.clone=function(){return new t(this.p)},t.prototype.toObject=function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.toObject():{enable:!1,color:16777215,alpha:1,width:1,align:0,side:Ht.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),sc=function(t){function n(n,i){void 0===i&&(i=r.GROUP);var e=t.call(this,i)||this;e.Ar=n;var u=new xt;return e.data=u,e.tag=u,e.size=e.newGroupSize(n),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e.gt=e.newGroupPoints(),e}return _(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Ar},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t){var n=J.SIZE_X,i=J.SIZE_Y;return t!==mr.VIEWER?new Mr(this,n,i,this.isGroupSizeFittable()):new Sr(this,n,i,n,i)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newGroupFill=function(){return new rc(this)},n.prototype.newGroupStroke=function(){return new uc(this)},n.prototype.newGroupText=function(){return new Ut(this,J.TEXT_VALUE,J.TEXT_COLOR,J.TEXT_ALPHA,J.TEXT_FAMILY,J.TEXT_SIZE)},n.prototype.newGroupPoints=function(){return new ec(this)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof Sr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].corner:rt.ALL},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].corner=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].gradient;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].gradient=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].radius:.5},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].radius=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].image;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].image=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n)if(null!=t[n].points)return this.gt},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Ar,this.type)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Dt),hc=function(t,n,i){i=i||new sc(n.mode);var r=fo(t,n,i);return i.size.init(),r},oc=function(){e[r.GROUP]=Qa,n[r.GROUP]=hc,wr.set(r.GROUP,pt.GROUP)},ac=function(){function n(n,i,r){this.p=n,this.j=new t.Point(i,r)}return n.prototype.init=function(){return this},Object.defineProperty(n.prototype,"x",{get:function(){return this.j.x},set:function(t){var n=this.j;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.j.y},set:function(t){var n=this.j;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.j,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.j;return new n(this.p,t.x,t.y)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.j,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.j.copyTo(t)},n.prototype.equals=function(t){return this.j.equals(t)},n.prototype.fit=function(){return this},n.prototype.onChange=function(t,n){this.p.onSizeChange()},n}(),cc=function(t){function n(n,i){return void 0===i&&(i=r.GROUP_SHADOWED),t.call(this,n,i)||this}return _(n,t),n.prototype.newGroupSize=function(n){return n!==mr.VIEWER?new ac(this,J.SIZE_X,J.SIZE_Y):t.prototype.newGroupSize.call(this,n)},n}(sc),fc=function(t,n,i){i=i||new cc(n.mode);var r=fo(t,n,i);return i.size.init(),r},lc=function(){e[r.GROUP_SHADOWED]=Qa,n[r.GROUP_SHADOWED]=fc,wr.set(r.GROUP_SHADOWED,pt.GROUP)},vc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Ca(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=V(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=W(n),d=X(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Aa(t.vertices,w,0,0,r,e,a,c,n.transform.internalTransform,ja),(m||h)&&(t.updateSteps(),Ra(w,t.steps,c,f,l,ja)),m&&(t.updateClippings(),Ia(t.clippings,w,ja)),(m||g)&&(t.updateUvs(),ya(t.uvs,w,K(b),ja))}},n}(z),bc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=Sa+h,c=Ta+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new vc(i,r,a-h,c-o),new Zt(i+Sa,r+Ta,h,o)]).init(n):null},dc=function(t){function n(n,i){void 0===i&&(i=r.IMAGE);var e=t.call(this,i)||this;return null!=n&&(e.image=n,e.size.set(n.width,n.height)),e.fill.alpha=1,e}return _(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(Qe),gc=function(t,n,i){return fo(t,n,i||new dc)},mc=function(){e[r.IMAGE]=bc,n[r.IMAGE]=gc},wc=[0,0],pc=new t.Point,Oc=function(t,n){for(var i=3*n-1,r=3*(n+9)-1;i<r;)t[++i]=0,t[++i]=0,t[++i]=2},Dc=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Ec=function(t,n,i,r,e,u,s,h){var a=o(e),c=u/h[0],f=s/h[1],l=.5*(c+f),v=12,b=-1+i,d=6*n-1;t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0},Mc=function(t,n,i,r,e,u,s,h){var o=pc,a=.5*e,c=.5*u;o.set(i-a,r-c),s.apply(o,o);var f=o.x,l=o.y;o.set(i+a,r-c),s.apply(o,o);var v=o.x,b=o.y;o.set(i+a,r+c),s.apply(o,o);var d=o.x,g=o.y,m=f+(d-v),w=l+(g-b),p=(n<<1)-1;t[++p]=f,t[++p]=l,t[++p]=.5*(f+v),t[++p]=.5*(l+b),t[++p]=v,t[++p]=b,t[++p]=.5*(f+m),t[++p]=.5*(l+w),t[++p]=.5*(f+d),t[++p]=.5*(l+g),t[++p]=.5*(v+d),t[++p]=.5*(b+g),t[++p]=m,t[++p]=w,t[++p]=.5*(m+d),t[++p]=.5*(w+g),t[++p]=d,t[++p]=g,h[0]=.5*O(f,l,v,b),h[1]=.5*O(f,l,m,w)},Sc=function(t,n,i){var r=i.x0,e=i.y0,u=i.x1,s=i.y1,h=i.x2,o=i.y2,a=i.x3,c=i.y3,f=(n<<1)-1;t[++f]=r,t[++f]=e,t[++f]=.5*(u+r),t[++f]=.5*(s+e),t[++f]=u,t[++f]=s,t[++f]=.5*(r+a),t[++f]=.5*(e+c),t[++f]=.5*(r+h),t[++f]=.5*(e+o),t[++f]=.5*(u+h),t[++f]=.5*(s+o),t[++f]=a,t[++f]=c,t[++f]=.5*(a+h),t[++f]=.5*(c+o),t[++f]=h,t[++f]=o},Tc=function(t){function n(n,i){var r=t.call(this,n,i,9,8)||this;return r.textureWidth=-1,r.textureHeight=-1,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset;t.updateClippings(),t.updateIndices(),Oc(t.clippings,n),Dc(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=V(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=W(n),b=v.width*v.resolution,d=v.height*v.resolution,g=this.textureWidth!==b||this.textureHeight!==d;(u||h||l||g)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.textureWidth=b,this.textureHeight=d,t.updateVertices(),Mc(t.vertices,this.vertexOffset,0,0,r,e,n.transform.internalTransform,wc),t.updateSteps(),Ec(t.steps,this.vertexOffset,a,c,f,b,d,wc))},n.prototype.updateUv=function(t,n){var i=W(n),r=X(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),Sc(t.uvs,this.vertexOffset,K(i)))},n}(z),jc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Tc(i,r),new Zt(i+9,r+8,h,o)]).init(n):null},Nc=function(t){function n(n,i){return void 0===i&&(i=r.IMAGE_SDF),t.call(this,n,i)||this}return _(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(dc),Ic=function(t,n,i){return fo(t,n,i||new Nc)},Cc=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=W(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Ac=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=h,c=o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Cc(i,r,a-h,c-o),new Zt(i,r,h,o)]).init(n):null},Rc=function(t){function n(n){return void 0===n&&(n=r.LABEL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Ft),Lc=function(t,n,i){return fo(t,n,i||new Rc)},yc=function(){e[r.LABEL]=Ac,n[r.LABEL]=Lc},kc=function(t){function n(n){void 0===n&&(n=r.LINE);var i=t.call(this,n)||this;return i.gt=new ie(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.gt.serialize(n),i},n}(Kt),xc=function(t,n,i){i=i||new kc;var r=fo(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=G.NON_SCALING_MASK|G.DOTTED_MASK|G.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},Bc=function(){e[r.LINE]=Ga,n[r.LINE]=xc},_c=function(t,n,i){for(var r=3*n,e=3*(n+i);r<e;r+=3)t[r+0]=0,t[r+1]=0,t[r+2]=0},Pc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Uc=function(t,n,i){for(var r=6*n,e=6*(n+i);r<e;r+=6)t[r+0]=0,t[r+1]=0,t[r+2]=0,t[r+3]=0,t[r+4]=0,t[r+5]=0},Fc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Gc=function(t){return 12*Math.ceil(t/12)},Hc=function(t,n,i,r,e,u,s,h){if(u)if(i.isStaticColor()){var o=i.getColor(0,s);if(i.isStaticAlpha()){var a=i.getAlpha(0,h);H(o,a,t,n*r,e)}else for(var c=0,f=t;c<r;c+=1,f+=n)a=i.getAlpha(c,h),H(o,a,f,n,e)}else if(i.isStaticAlpha())for(a=i.getAlpha(0,h),c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),H(o,a,f,n,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),a=i.getAlpha(c,h),H(o,a,f,n,e);else if(i.isStaticColor())o=i.getColor(0,s),H(o,0,t,n*r,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),H(o,0,f,n,e)},zc=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e)||this;return s.pointId=-1,s.pointCount=0,s.pointCountReserved=u,s.pointSizeId=-1,s.pointOffsetId=-1,s.pointFillId=-1,s.pointStrokeId=-1,s}return _(n,t),n.prototype.isCompatible=function(t){return Gc(Jo(t.points))===this.pointCountReserved},n.prototype.updateLineOfAnyColorFill=function(t,n,i,r){var e=i.fill,u=e.id,s=u!==this.pointFillId,h=n.fill,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorFill||c!==this.alphaFill;(s||f)&&(this.colorFill=a,this.alphaFill=c,this.pointFillId=u,t.updateColorFills(),Hc(this.vertexOffset,r,e,this.pointCountReserved,t.colorFills,o,a,c))},n.prototype.updateLineOfAnyColorStroke=function(t,n,i,r){var e=i.stroke,u=e.id,s=u!==this.pointStrokeId,h=n.stroke,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorStroke||c!==this.alphaStroke;(s||f)&&(this.colorStroke=a,this.alphaStroke=c,this.pointStrokeId=u,t.updateColorStrokes(),Hc(this.vertexOffset,r,e,this.pointCountReserved,t.colorStrokes,o,a,c))},n}(z),Vc=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=3*e,h=3*n,o=0;o<i;++o)t[s+0]=t[h+0],t[s+1]=t[h+1],t[s+2]=t[h+2],s+=3,h+=3;e+=i}},Wc=function(t,n,i,r,e){for(var u=n,s=i+r,h=1;h<e;++h){for(var o=3*s,a=3*i,c=0;c<r;++c)t[o+0]=t[a+0]+u,t[o+1]=t[a+1]+u,t[o+2]=t[a+2]+u,o+=3,a+=3;u+=n,s+=r}},Xc=function(t,n,i,r){for(var e=6*n,u=6*(n+i),s=1;s<r;++s)for(var h=e,o=0;o<i;++o)t[u+0]=t[h+0],t[u+1]=t[h+1],t[u+2]=t[h+2],t[u+3]=t[h+3],t[u+4]=t[h+4],t[u+5]=t[h+5],u+=6,h+=6},Kc=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=e<<1,h=n<<1,o=0;o<i;++o)t[s]=t[h],t[s+1]=t[h+1],s+=2,h+=2;e+=i}},Yc=function(t,n,i,r,e,u,s){var h=n.a,o=n.b,a=n.c,c=n.d,f=e-1,l=i+f*r;if(s.isStaticX()&&s.isStaticY())for(var v=s.getX(0),b=s.getY(0);0<=f;--f){for(var d=h*(D=u[O=f<<1]+v)+a*(E=u[O+1]+b),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}else for(;0<=f;--f){var O,D,E;for(d=h*(D=u[O=f<<1]+s.getX(f))+a*(E=u[O+1]+s.getY(f)),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}},Jc=function(t){return wn(t)||null==t},Zc=function(t,n,i){return wn(n)?n:at(n)?n(t):n?n[t%n.length]:i},qc=function(){function t(t){this.p=t,this.R=0,this.S=null,this.T=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.T!==n&&(i=!0,this.T=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getColor=function(t,n){return Zc(t,this.S,n)},t.prototype.getAlpha=function(t,n){return Zc(t,this.T,n)},t.prototype.isStaticColor=function(){return Jc(this.S)},t.prototype.isStaticAlpha=function(){return Jc(this.T)},t.prototype.toDirty=function(){this.R+=1},t}(),Qc=function(){function t(t,n,i){this.p=t,this.R=0,this._x=null,this._y=null,this.co=n,this.fo=i,this.lo=null,this.vo=0,this.bo=-1,this.do=0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"limit",{get:function(){return this.lo},set:function(t){this.lo=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this._x!==t&&(i=!0,this._x=t),void 0!==n&&this._y!==n&&(i=!0,this._y=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getX=function(t){return Zc(t,this._x,this.co)},t.prototype.getY=function(t){return Zc(t,this._y,this.fo)},t.prototype.getLimit=function(){var t=this.lo;return null!=t?t:(this.updateLimitComputed(),this.vo)},t.prototype.updateLimitComputed=function(){var t=this.R,n=this.p.length;this.bo===t&&this.do===n||(this.bo=t,this.do=n,this.vo=Math.max(this.calcLimit(this._x,n,this.co),this.calcLimit(this._y,n,this.fo)))},t.prototype.calcLimit=function(t,n,i){if(wn(t))return Math.abs(t);if(at(t)){if(0<n){for(var r=Math.abs(t(0)),e=1;e<n;++e)r=Math.max(r,Math.abs(t(e)));return r}return 0}if(null!=t){var u=t.length;if(0<u){for(r=t[0],e=1;e<u;++e)r=Math.max(r,Math.abs(t[e]));return r}return 0}return Math.abs(i)},t.prototype.isStaticX=function(){return Jc(this._x)},t.prototype.isStaticY=function(){return Jc(this._y)},t.prototype.toDirty=function(){this.R+=1},t}(),$c=function(){function t(t){this.p=t,this.R=0,this.S=null,this.T=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.T!==n&&(i=!0,this.T=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getColor=function(t,n){return Zc(t,this.S,n)},t.prototype.getAlpha=function(t,n){return Zc(t,this.T,n)},t.prototype.isStaticColor=function(){return Jc(this.S)},t.prototype.isStaticAlpha=function(){return Jc(this.T)},t.prototype.toDirty=function(){this.R+=1},t}(),tf=function(){function n(t){this.p=t,this.L=[],this.mo=0,this.k=[],this.j=new Qc(this,J.SIZE_X,J.SIZE_Y),this.en=new Qc(this,0,0),this.C=new qc(t),this.wo=new $c(t),this.R=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this.L.length>>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.L},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.k},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return G.NONE},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=$.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"offset",{get:function(){return this.en},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"stroke",{get:function(){return this.wo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return this.set(t.values,t.segments,t.style)},n.prototype.set=function(t,n,i){var r=!1,e=!1;if(null!=t){var u=this.L,s=this.mo,h=t.length;if(u!==t){for(var o=Math.min(s,h),a=0;a<o;++a)u[a]=t[a];for(a=o;a<h;++a)u.push(t[a]);s!==h?(u.length=h,this.mo=h,r=!0):e=!0}else s!==h?(this.mo=h,r=!0):e=!0}if(r){this.R+=1;var c=this.p,f=c.uploaded;f?f.isCompatible(c)?c.updateUploaded():(c.uploaded=void 0,c.toDirty()):c.updateUploaded()}else e&&(this.R+=1,this.p.updateUploaded());return this},n.prototype.updateUploaded=function(){this.p.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[]")},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o,a){var c=this.formatted,f=c.length,l=c.values,v=this.j,b=this.en,d=0,g=f;if(h){var m=.5*v.getLimit(),w=b.getLimit(),p=n.WORK_RANGE;h(t,i,m,m,w,w,s,l,p),d=p[0],g=p[1]}for(var O=d,D=Math.min(g,f);O<D;++O){var E=O<<1,M=l[E],S=l[E+1];if(o(t,i,.5*v.getX(O),.5*v.getY(O),b.getX(O),b.getY(O),M,S,r,e,u,O,s,a))return!0}return!1},n.WORK_RANGE=[0,0],n}(),nf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(Po(n,r),Vc(n,r,9,u),Uo(i,r,e),Wc(i,9,e,8,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof tf&&(this.updateVertexAndStep(t,n,i),this.updateLineOfAnyColorFill(t,n,i,9),this.updateLineOfAnyColorStroke(t,n,i,9),this.updateUv(t,n))},n.prototype.updateVertexAndStep=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=V(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p;if(s||a||v||d||O){this.pointId=r;var D=i.formatted;this.pointCount=D.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeStyle=p,t.updateVertices(),t.updateSteps();var E=this.pointCount,M=D.values,S=this.vertexOffset,T=t.vertices,j=t.steps,N=t.clippings,I=n.transform.internalTransform;if(0<E&&h.isStaticX()&&h.isStaticY()){var C=h.getX(0),A=h.getY(0);Fo(T,S,0,0,C,A,m,w,I,Bo),Yc(T,I,S,9,E,M,e),Go(j,N,S,w,p,Bo),Xc(j,S,9,E)}else for(var R=0;R<E;++R){var L=R<<1,y=M[L]+e.getX(R),k=M[L+1]+e.getY(R),x=(C=h.getX(R),A=h.getY(R),S+9*R);Fo(T,x,y,k,C,A,m,w,I,Bo),Go(j,N,x,w,p,Bo)}var B=S+9*E,_=9*(this.pointCountReserved-E);Pc(T,B,_),Uc(j,B,_)}},n.prototype.updateUv=function(t,n){var i=W(n),r=X(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=t.uvs,u=this.vertexOffset,s=K(i),h=this.pointCountReserved;0<h&&(Ho(e,u,s),Kc(e,u,9,h))}},n}(zc),rf=function(t,n,i,r,e,s,h,o){var a=M(n),c=4*a,f=2*a,l=n.points,v=Gc(Jo(l)),b=v*r,d=v*s,g=b+c,m=d+f;return t.check(i,e,g,m)?new u(t,i,e,g,m,[new o(i,e,b,d,v),new Zt(i+b,e+d,c,f)]).init(n):null},ef=function(t,n,i,r,e){return rf(t,n,i,9,r,8,0,nf)},uf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_CIRCLES);var i=t.call(this,n)||this;return i.gt=new tf(i),i.po=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Xt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.po,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Xt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.po,u)},n}(Wo),sf=function(t,n,i){return fo(t,n,i||new uf)},hf=function(){e[r.LINE_OF_CIRCLES]=ef,n[r.LINE_OF_CIRCLES]=sf},of=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(po(n,i,r),Wc(n,go,r,24,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof tf&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,go),this.updateLineOfAnyColorStroke(t,n,i,go))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=n.radius,b=f!==this.sizeX||l!==this.sizeY||v!==this.radius,d=V(n),g=this.transformLocalId!==d,m=n.stroke,w=m.align,p=m.enable?m.width:0,O=m.side,D=m.style,E=this.strokeAlign!==w||this.strokeWidth!==p||this.strokeSide!==O||this.strokeStyle!==D,M=n.corner,S=M!==this.corner,T=W(n),j=X(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||b||E;if(I||g||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=v,this.transformLocalId=d,this.strokeAlign=w,this.strokeWidth=p,this.strokeSide=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||g)&&t.updateSteps(),(I||S)&&t.updateClippings(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,L=this.vertexOffset,y=t.vertices,k=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=K(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var U=h.getX(0),F=h.getY(0);Oo(y,L,0,0,U,F,w,p,v,_,mo),Yc(y,_,L,go,A,R,e),(I||g)&&(Eo(x,L,p,O,D,M,mo),Xc(x,L,go,A)),(I||S)&&(Do(k,L,M,mo),Vc(k,L,go,A)),(I||N)&&(Mo(B,L,P,mo),Kc(B,L,go,A))}else for(var G=0;G<A;++G){var H=G<<1,z=R[H]+e.getX(G),Y=R[H+1]+e.getY(G),J=(U=h.getX(G),F=h.getY(G),L+G*go);Oo(y,J,z,Y,U,F,w,p,v,_,mo),(I||g)&&Eo(x,J,p,O,D,M,mo),(I||S)&&Do(k,J,M,mo),(I||N)&&Mo(B,J,P,mo)}var Z=this.pointCountReserved,q=L+A*go,Q=go*(Z-A);Pc(y,q,Q),Uc(x,q,Q),_c(k,q,Q),Fc(B,q,Q)}},n}(zc),af=function(t,n,i,r,e){return rf(t,n,i,go,r,24,0,of)},cf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.gt=new tf(i),i.po=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Xt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,h,e,u,s,null,this.po,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Xt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.po,u)},n}(Co),ff=function(t,n,i){return fo(t,n,i||new cf)},lf=function(){e[r.LINE_OF_RECTANGLE_ROUNDEDS]=af,n[r.LINE_OF_RECTANGLE_ROUNDEDS]=ff,wr.set(r.LINE_OF_RECTANGLE_ROUNDEDS,pt.PRIMITIVE|pt.STROKE_SIDE|pt.BORDER_RADIUS)},vf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(Ca(n,i,r),Wc(n,Sa,r,Ta,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof tf&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,Sa),this.updateLineOfAnyColorStroke(t,n,i,Sa))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=V(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.side,O=g.style,D=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeSide!==p||this.strokeStyle!==O,E=W(n),M=X(E),S=E!==this.texture||M!==this.textureTransformId,T=s||a||v||D;if(T||d||S){this.pointId=r;var j=i.formatted;this.pointCount=j.length,this.pointOffsetId=u,this.pointSizeId=o,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeSide=p,this.strokeStyle=O,this.texture=E,this.textureTransformId=M,t.updateVertices(),(T||d)&&t.updateSteps(),T&&t.updateClippings(),(T||S)&&t.updateUvs();var N=this.pointCount,I=j.values,C=this.vertexOffset,A=t.vertices,R=t.clippings,L=t.steps,y=t.uvs,k=n.transform.internalTransform,x=K(E);if(0<N&&h.isStaticX()&&h.isStaticY()){var B=h.getX(0),_=h.getY(0);Aa(A,C,0,0,B,_,m,w,k,ja),Yc(A,k,C,Sa,N,I,e),(T||d)&&(Ra(C,L,w,p,O,ja),Xc(L,C,Sa,N)),T&&(Ia(R,C,ja),Vc(R,C,Sa,N)),(T||S)&&(ya(y,C,x,ja),Kc(y,C,Sa,N))}else for(var P=0;P<N;++P){var U=P<<1,F=I[U]+e.getX(P),G=I[U+1]+e.getY(P),H=(B=h.getX(P),_=h.getY(P),C+P*Sa);Aa(A,H,F,G,B,_,m,w,k,ja),(T||d)&&Ra(H,L,w,p,O,ja),T&&Ia(R,H,ja),(T||S)&&ya(y,H,x,ja)}var z=this.pointCountReserved,Y=C+N*Sa,J=Sa*(z-N);Pc(A,Y,J),Uc(L,Y,J),_c(R,Y,J),Fc(y,Y,J)}},n}(zc),bf=function(t,n,i,r,e){return rf(t,n,i,Sa,r,Ta,0,vf)},df=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLES);var i=t.call(this,n)||this;return i.gt=new tf(i),i.po=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Xt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.po,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Xt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.po,u)},n}(Qe),gf=function(t,n,i){return fo(t,n,i||new df)},mf=function(){e[r.LINE_OF_RECTANGLES]=bf,n[r.LINE_OF_RECTANGLES]=gf,wr.set(r.LINE_OF_RECTANGLES,pt.PRIMITIVE|pt.STROKE_SIDE)},wf=22,pf=[0,0,0,0,0],Of=new t.Point,Df=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+6,t[++r]=n+7,t[++r]=n+8,t[++r]=n+9,t[++r]=n+11,t[++r]=n+9,t[++r]=n+10,t[++r]=n+11,t[++r]=n+12,t[++r]=n+13,t[++r]=n+16,t[++r]=n+13,t[++r]=n+14,t[++r]=n+16,t[++r]=n+14,t[++r]=n+15,t[++r]=n+16,t[++r]=n+12,t[++r]=n+16,t[++r]=n+19,t[++r]=n+16,t[++r]=n+17,t[++r]=n+19,t[++r]=n+17,t[++r]=n+18,t[++r]=n+19,t[++r]=n+12,t[++r]=n+19,t[++r]=n+13,t[++r]=n+19,t[++r]=n+20,t[++r]=n+13,t[++r]=n+20,t[++r]=n+21,t[++r]=n+13},Ef=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.sqrt(l*l+4*v*v),d=2*l*v/(l+b),g=d*o/(2*v),m=.5*(b-d)*o/b,w=g*b/(2*l),p=Of;p.set(i,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r),a.apply(p,p);var M=p.x,S=p.y;p.set(i+l,r),a.apply(p,p);var T=M-D,j=S-E,N=p.x+T,I=p.y+j,C=M+(M-p.x)+T,A=S+(S-p.y)+j,R=N-D,L=I-E,y=D+m*R,k=E+m*L,x=N-g*R,B=I-g*L,_=w*(C-N),P=w*(A-I),U=N+_,F=I+P,G=C-_,H=A-P,z=D-C,V=E-A,W=C+g*z,X=A+g*V,K=D-m*z,Y=E-m*V;p.set(i,r+v-d),a.apply(p,p);var J=p.x,Z=p.y,q=D+o*(J-D),Q=E+o*(Z-E),$=N+o*(J-N),tt=I+o*(Z-I),nt=C+o*(J-C),it=A+o*(Z-A),rt=M+T,et=S+j;c[0]=O(rt,et,J,Z),c[1]=w,c[2]=g,c[3]=m,c[4]=1-.5*d/v;var ut=2*n-1;t[++ut]=q,t[++ut]=Q,t[++ut]=K,t[++ut]=Y,t[++ut]=D,t[++ut]=E,t[++ut]=y,t[++ut]=k,t[++ut]=$,t[++ut]=tt,t[++ut]=x,t[++ut]=B,t[++ut]=N,t[++ut]=I,t[++ut]=U,t[++ut]=F,t[++ut]=nt,t[++ut]=it,t[++ut]=G,t[++ut]=H,t[++ut]=C,t[++ut]=A,t[++ut]=W,t[++ut]=X,t[++ut]=J,t[++ut]=Z,t[++ut]=q,t[++ut]=Q,t[++ut]=y,t[++ut]=k,t[++ut]=x,t[++ut]=B,t[++ut]=$,t[++ut]=tt,t[++ut]=U,t[++ut]=F,t[++ut]=G,t[++ut]=H,t[++ut]=nt,t[++ut]=it,t[++ut]=W,t[++ut]=X,t[++ut]=K,t[++ut]=Y},Mf=function(t,n,i,r){var e=3*n-1,u=1-r;i&rt.TOP?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&rt.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&rt.BOTTOM_LEFT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0},Sf=function(t,n,i,r,e,u,s){for(var h=o(e),a=s[0],c=u*a,f=3*i,l=6*i-1,v=0;v<wf;v+=1,f+=3)t[++l]=r,t[++l]=h,.5<n[f+2]?(t[++l]=c,t[++l]=c,t[++l]=1+n[f],t[++l]=1+n[f+1]):(t[++l]=a,t[++l]=a,t[++l]=1+n[f],t[++l]=1+n[f+1])},Tf=function(t,n,i,r,e){var u=i.x0,s=i.x1,h=i.x2,o=i.x3,a=i.y0,c=i.y1,f=i.y2,l=i.y3,v=.5*(u+s),b=.5*(a+c),d=e[4],g=v+d*(o-u),m=b+d*(l-a),w=e[1],p=e[2],O=e[3],D=v+O*(o-v),E=b+O*(l-b),M=v+r*(g-v),S=b+r*(m-b),T=v+O*(h-v),j=b+O*(f-b),N=h+p*(v-h),I=f+p*(b-f),C=h+r*(g-h),A=f+r*(m-f),R=h+w*(o-h),L=f+w*(l-f),y=o+w*(h-o),k=l+w*(f-l),x=o+r*(g-o),B=l+r*(m-l),_=o+p*(v-o),P=l+p*(b-l),U=2*n-1;t[++U]=M,t[++U]=S,t[++U]=D,t[++U]=E,t[++U]=v,t[++U]=b,t[++U]=T,t[++U]=j,t[++U]=C,t[++U]=A,t[++U]=N,t[++U]=I,t[++U]=h,t[++U]=f,t[++U]=R,t[++U]=L,t[++U]=x,t[++U]=B,t[++U]=y,t[++U]=k,t[++U]=o,t[++U]=l,t[++U]=_,t[++U]=P,t[++U]=g,t[++U]=m,t[++U]=M,t[++U]=S,t[++U]=T,t[++U]=j,t[++U]=N,t[++U]=I,t[++U]=C,t[++U]=A,t[++U]=R,t[++U]=L,t[++U]=y,t[++U]=k,t[++U]=x,t[++U]=B,t[++U]=_,t[++U]=P,t[++U]=D,t[++U]=E},jf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=this.vertexOffset,i=this.indexOffset,r=this.pointCountReserved;0<r&&(Df(t.indices,n,i),Wc(t.indices,wf,i,15,r))},n.prototype.update=function(t,n){var i=n.points;i instanceof tf&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,wf),this.updateLineOfAnyColorStroke(t,n,i,wf))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=n.radius,d=b!==this.radius,g=V(n),m=this.transformLocalId!==g,w=n.stroke,p=w.align,O=w.enable?w.width:0,D=w.style,E=this.strokeAlign!==p||this.strokeWidth!==O||this.strokeStyle!==D,M=n.corner,S=this.corner!==M,T=W(n),j=X(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||v||d||E;if(I||m||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=b,this.transformLocalId=g,this.strokeAlign=p,this.strokeWidth=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||S)&&t.updateClippings(),(I||m||S)&&t.updateSteps(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,L=this.vertexOffset,y=t.vertices,k=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=K(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var U=h.getX(0),F=h.getY(0);Ef(y,L,0,0,U,F,p,O,b,_,pf),Yc(y,_,L,wf,A,R,e),(I||S)&&(Mf(k,L,M,b),Vc(k,L,wf,A)),(I||m||S)&&(Sf(x,k,L,O,D,b,pf),Xc(x,L,wf,A)),(I||N)&&(Tf(B,L,P,b,pf),Kc(B,L,wf,A))}else for(var G=0;G<A;++G){var H=G<<1,z=R[H]+e.getX(G),Y=R[H+1]+e.getY(G),J=(U=h.getX(G),F=h.getY(G),L+G*wf);Ef(y,J,z,Y,U,F,p,O,b,_,pf),(I||S)&&Mf(k,J,M,b),(I||m||S)&&Sf(x,k,J,O,D,b,pf),(I||N)&&Tf(B,J,P,b,pf)}var Z=this.pointCountReserved,q=L+A*wf,Q=wf*(Z-A);Pc(y,q,Q),Uc(x,q,Q),_c(k,q,Q),Fc(B,q,Q)}},n}(zc),Nf=function(t,n,i,r,e){return rf(t,n,i,wf,r,15,0,jf)},If=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=u+f*(h-u)-r,w=s+f*(o-s)-e,p=Math.sqrt(m*m+w*w),O=1e-5;if(O<p){var D=1/p,E=m*D,M=w*D,S=(u+l*(a-u)-r)*D,T=(s+l*(c-s)-e)*D,j=E*T-S*M;if(O<Math.abs(j)){var N=1/j,I=n-r,C=i-e;if(function(t,n,i,r,e,u,s){if(t.fill.enable){if(n*n+i*i<=r*r)return!0}else if(0<u){var h=n*n+i*i;if(h<=r*r){var o=Math.max(0,r*(1-u*s/e));if(o*o<=h)return!0}}return!1}(t,(+T*I-S*C)*N,(-M*I+E*C)*N,p,v*b,d,g))return!0}}return!1},Cf=function(t,n,i,r,e,u,s){var h=2*e/r;if(Vt(n,i,h,-e,+e)){var o=Math.sqrt(r*r+4*e*e),a=2*r*e/(r+o),c=t.radius,f=e-a,l=-e,v=+r,b=+e,d=-v,g=+b,m=0+0*c,w=l+c*(f-l),p=v+c*(0-v),O=b+c*(f-b),D=+O,E=-p,M=-h*n+w-i<=0,S=+h*n+w-i<=0,T=i<=O,j=t.corner;if(!M&&!S&&j&rt.TOP){var N=.5*(o-a)*c/o;if(If(t,n,i,m,w,0,l,d,g,v,b,N,N,a,c,u,s))return!0}else if(!M&&!T&&j&rt.BOTTOM_LEFT){if(If(t,n,i,E,D,d,g,v,b,0,l,(I=a*c/(2*e))*o/(2*r),I,a,c,u,s))return!0}else if(!S&&!T&&j&rt.BOTTOM_RIGHT){var I;if(If(t,n,i,p,O,v,b,0,l,d,g,I=a*c/(2*e),I*o/(2*r),a,c,u,s))return!0}else{if(t.fill.enable)return!0;if(0<u){var C=u*s,A=e-a,R=A+(-e-A)*Math.max(0,a-C)/a;if(!Vt(n,i,h,R,e-C))return!0}}}return!1},Af=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Cf(this,n,i,r,e,u,s)},n}(Ft),Rf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.gt=new tf(i),i.po=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Xt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.po,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Xt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.po,u)},n}(Af),Lf=function(t,n,i){return fo(t,n,i||new Rf)},yf=function(){e[r.LINE_OF_TRIANGLE_ROUNDEDS]=Nf,n[r.LINE_OF_TRIANGLE_ROUNDEDS]=Lf,wr.set(r.LINE_OF_TRIANGLE_ROUNDEDS,pt.PRIMITIVE|pt.STROKE_SIDE|pt.BORDER_RADIUS)},kf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(fa(n,r),Vc(n,r,7,u),la(i,r,e),Wc(i,7,e,3,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof tf&&(this.updateVertexStepAndUvs(t,n,i),this.updateLineOfAnyColorFill(t,n,i,7),this.updateLineOfAnyColorStroke(t,n,i,7))},n.prototype.updateVertexStepAndUvs=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=V(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p,D=W(n),E=X(D),M=D!==this.texture||E!==this.textureTransformId,S=s||a||v||O;if(S||d||M){this.pointId=r;var T=i.formatted;this.pointCount=T.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeAlign=m,this.strokeWidth=w,this.strokeStyle=p,t.updateVertices(),(S||d)&&t.updateSteps(),(S||M)&&t.updateUvs();var j=this.pointCount,N=T.values,I=this.vertexOffset,C=t.vertices,A=t.steps,R=t.clippings,L=t.uvs,y=K(D),k=n.transform.internalTransform;if(0<j&&h.isStaticX()&&h.isStaticY()){var x=h.getX(0),B=h.getY(0);va(C,I,0,0,x,B,m,w,k,aa),Yc(C,k,I,7,j,N,e),(S||d)&&(ba(A,R,I,7,w,p,aa),Xc(A,I,7,j)),(S||M)&&(da(L,y,I,aa),Kc(L,I,7,j))}else for(var _=0;_<j;++_){var P=_<<1,U=N[P]+e.getX(_),F=N[P+1]+e.getY(_),G=(x=h.getX(_),B=h.getY(_),I+7*_);va(C,G,U,F,x,B,m,w,k,aa),(S||d)&&ba(A,R,G,7,w,p,aa),(S||M)&&da(L,y,G,aa)}var H=I+7*j,z=7*(this.pointCountReserved-j);Pc(C,H,z),Uc(A,H,z),Fc(L,H,z)}},n}(zc),xf=function(t,n,i,r,e){return rf(t,n,i,7,r,3,0,kf)},Bf=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Wt(this,n,i,r,e,u,s)},n}(Ft),_f=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLES);var i=t.call(this,n)||this;return i.gt=new tf(i),i.po=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Xt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.po,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Xt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.po,u)},n}(Bf),Pf=function(t,n,i){return fo(t,n,i||new _f)},Uf=function(){e[r.LINE_OF_TRIANGLES]=xf,n[r.LINE_OF_TRIANGLES]=Pf},Ff=function(t,n,i,r){return new u(t,i,r,0,0,[new Ma(i,r)]).init(n)},Gf=function(t){function n(n){return void 0===n&&(n=r.NULL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Ft),Hf=function(t,n,i){return fo(t,n,i||new Gf)},zf=function(){e[r.NULL]=Ff,n[r.NULL]=Hf},Vf=function(t,n,i){return fo(t,n,i||new Qe)},Wf=function(){e[r.RECTANGLE]=bc,n[r.RECTANGLE]=Vf,wr.set(r.RECTANGLE,pt.PRIMITIVE|pt.STROKE_SIDE)},Xf=function(t,n,i){return fo(t,n,i||new $e)},Kf=function(t,n,i){return fo(t,n,i||new Co)},Yf=function(){e[r.RECTANGLE_ROUNDED]=To,n[r.RECTANGLE_ROUNDED]=Kf,wr.set(r.RECTANGLE_ROUNDED,pt.PRIMITIVE|pt.STROKE_SIDE|pt.BORDER_RADIUS)},Jf=[0,0],Zf=new t.Point,qf=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1},Qf=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4},$f=function(t,n,i,r,e,u,s,h,o,a){var c=Zf,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D-w,S=E-p,T=2*n-1;t[++T]=b,t[++T]=d,t[++T]=g,t[++T]=m,t[++T]=g+w,t[++T]=m+p,t[++T]=M,t[++T]=S,t[++T]=D,t[++T]=E,t[++T]=D+w,t[++T]=E+p,a[0]=O(b,d,g,m),a[1]=O(b,d,M,S)},tl=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<6;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},nl=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a)},il=function(t){function n(n,i){return t.call(this,n,i,6,4)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;qf(t.clippings,n),Qf(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=V(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),$f(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,Jf),tl(t.steps,t.clippings,this.vertexOffset,c,f,Jf))},n.prototype.updateUv=function(t,n){var i=W(n),r=X(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=K(i);nl(t.uvs,this.vertexOffset,e)}},n}(z),rl=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=6+h,c=4+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new il(i,r),new Zt(i+6,r+4,h,o)]).init(n):null},el=function(t,n,i,r,e,u,s){return i<=0&&Gt(t,n,i,r,e,u,s)},ul=function(t){function n(n){void 0===n&&(n=r.SEMICIRCLE);var i=t.call(this,n)||this;return i.stroke.side=Ht.ALL&~Ht.BOTTOM,i}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&el(this,n,i,r,e,u,s)},n}(Ft),sl=function(t,n,i){return fo(t,n,i||new ul)},hl=function(){e[r.SEMICIRCLE]=rl,n[r.SEMICIRCLE]=sl},ol=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices(),fa(t.clippings,this.vertexOffset),la(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=V(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=W(n),b=X(v),d=v!==this.texture||b!==this.textureTransformId,g=u||l;if(g||h||d){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.texture=v,this.textureTransformId=b;var m=this.vertexOffset;t.updateVertices(),va(t.vertices,m,0,0,r,e,a,c,n.transform.internalTransform,aa),(g||h)&&(t.updateSteps(),ba(t.steps,t.clippings,m,7,c,f,aa)),(g||d)&&(t.updateUvs(),da(t.uvs,K(v),m,aa))}},n}(z),al=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=7+h,c=3+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new ol(i,r,a-h,c-o),new Zt(i+7,r+3,h,o)]).init(n):null},cl=function(t,n,i){return fo(t,n,i||new Bf)},fl=function(){e[r.TRIANGLE]=al,n[r.TRIANGLE]=cl},ll=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Df(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.radius,h=s!==this.radius,o=V(n),a=this.transformLocalId!==o,c=n.stroke,f=c.align,l=c.enable?c.width:0,v=c.style,b=this.strokeAlign!==f||this.strokeWidth!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=W(n),w=X(m),p=m!==this.texture||w!==this.textureTransformId,O=u||h||b;if(O||a||g||p){this.sizeX=r,this.sizeY=e,this.radius=s,this.transformLocalId=o,this.strokeAlign=f,this.strokeWidth=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Ef(t.vertices,D,0,0,r,e,f,l,s,n.transform.internalTransform,pf),(h||g)&&(t.updateClippings(),Mf(t.clippings,D,d,s)),(O||a||g)&&(t.updateSteps(),Sf(t.steps,t.clippings,D,l,v,n.radius,pf)),(O||p)&&(t.updateUvs(),Tf(t.uvs,D,K(m),s,pf))}},n}(z),vl=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=wf+h,c=15+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new ll(i,r,a-h,c-o),new Zt(i+wf,r+15,h,o)]).init(n):null},bl=function(t,n,i){return fo(t,n,i||new Af)},dl=function(){e[r.TRIANGLE_ROUNDED]=vl,n[r.TRIANGLE_ROUNDED]=bl,wr.set(r.TRIANGLE_ROUNDED,pt.PRIMITIVE|pt.STROKE_SIDE|pt.BORDER_RADIUS)},gl=function(){vo(),xo(),Ko(),Ya(),Ja(),ic(),lc(),oc(),mc(),e[r.IMAGE_SDF]=jc,n[r.IMAGE_SDF]=Ic,yc(),Bc(),zf(),e[r.RECTANGLE_PIVOTED]=qa,n[r.RECTANGLE_PIVOTED]=Xf,wr.set(r.RECTANGLE_PIVOTED,pt.PRIMITIVE|pt.STROKE_SIDE),Yf(),Wf(),hl(),dl(),fl(),hf(),lf(),mf(),yf(),Uf()},ml=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DImage"},n}(ds),wl=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).Rt=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:null,r}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.on(Yi.tap,(function(t){i.onClick(t)}))},n.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){this.onSelect(t)},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){this.Rt=t},enumerable:!1,configurable:!0}),n.prototype.hasSelection=function(t){return t&&t.selection&&t.selection.add},n.prototype.getSelection=function(){for(var t=this.parent;t;){if(this.hasSelection(t))return t.selection;t=t.parent}return null},n.prototype.onSelect=function(t){this.emit("select",this.Rt,this);var n=this.getSelection();n&&n.add(this)},n.prototype.onKeyDown=function(n){return Ki.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DMenuItemBase"},n}(ml),pl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getContext=function(){for(var t=this.parent;t;){if(t.getContext)return t.getContext();t=t.parent}return null},n.prototype.getCloseable=function(){for(var t=this.parent;t;){if(t.getCloseable)return t.getCloseable();t=t.parent}return null},n.prototype.getType=function(){return"DMenuItem"},n}(wl),Ol=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.initOnOver(n),this.initShortcuts(n)},n.prototype.initOnOver=function(t){var n=this;this.on(Yi.over,(function(){var t=n.getContext();null!=t&&n.parent instanceof $i&&t.trim(n.getCloseable())}))},n.prototype.initShortcuts=function(t){var n=this.Kn;if(null!=n&&0<n.length){var i=n[0],r=Ki.toString(i);this.Oo=this.createText(r),this.snippet.add(this.Oo,!0)}else this.Oo=null;this.Do=this.theme.getShortcutTextMargin()},n.prototype.updateShortcutText=function(){var t=this.Oo,n=this.Do;if(null!=t&&null!=n){var i,r=this._n;i=r.width.isOn?n:this.width-t.width-n;var e,u=this.Vn,s=u.getTop();e=r.height.isOn?s:s+.5*(this.height-s-u.getBottom()-t.height),t.position.set(i,e)}},n.prototype.updateTextColor=function(n){t.prototype.updateTextColor.call(this,n);var i=this.Oo;if(null!=i){var r=this.theme,e=this.state;i.style.fill=r.getShortcutColor(e),i.alpha=r.getShortcutAlpha(e)}},n.prototype.updateText=function(){t.prototype.updateText.call(this),this.updateShortcutText()},n.prototype.getType=function(){return"DMenuItemText"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n);var i=this.getCloseable();null!=i&&i.emit("select",this.value,this,i)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(pl),Dl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),(null==n?void 0:n.check)&&(this.state.isActive=!0)},n.prototype.getType=function(){return"DMenuItemCheck"},n.prototype.onSelect=function(n){this.state.isActive=!this.state.isActive,t.prototype.onSelect.call(this,n)},n}(Ol),El=function(t){return"check"in t},Ml={OPEN_LINK:0,OPEN_LINK_IN_NEW_WINDOW:1,COPY_LINK_ADDRESS:2},Sl=function(){function n(){}return n.addItemCreator=function(t){this.CREATORS.push(t)},n.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},n.setMenuCreator=function(t){this.MENU_CREATOR=t},n.newItemOf=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e](i,r);if(null!=s)return s}return n?n(i,r):null},n.newItem=function(t,n){return this.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)},n.newItemsOf=function(n,i,r,e){for(var u=0,s=r.length;u<s;++u){var h=r[u];if(h instanceof t.DisplayObject)i.addChild(h);else if(null!=h){var o=n.newItem(h,e);if(null==o)throw new Error("No matching menu item creator found: ".concat(JSON.stringify(h)));i.addChild(o)}}},n.newItems=function(t,n,i){this.newItemsOf(this,t,n,i)},n.newMenu=function(t){if(null!=this.MENU_CREATOR)return this.MENU_CREATOR(t);throw new Error("Missing DMenu creator.")},n.CREATORS=[],n.CREATOR_DEFAULT=null,n}(),Tl=function(){function n(t,n){this.p=t,this.xn=n,this.es=!0}return Object.defineProperty(n.prototype,"enable",{get:function(){return this.es},set:function(t){this.es=t},enumerable:!1,configurable:!0}),n.prototype.open=function(t){this.get().open(t)},n.prototype.get=function(){var t=this,n=this.Eo;return null==n&&(n=this.toMenu(this.xn),this.Eo=n,n.on("select",(function(n,i,r){t.onSelect(n,i,r)}))),n},n.prototype.toMenu=function(n){return n instanceof t.DisplayObject?n:this.newMenu(n)},n.prototype.newMenu=function(t){return Sl.newMenu(t)},n.prototype.onSelect=function(t,n,i){var r=this.p;switch(t){case Ml.OPEN_LINK:r.open(!1);break;case Ml.OPEN_LINK_IN_NEW_WINDOW:r.open(!0);break;case Ml.COPY_LINK_ADDRESS:r.copy()}},n}(),jl={AUTO:0,THIS_WINDOW:1,NEW_WINDOW:2},Nl=function(t){var n=document.getSelection();if(n){var i=document.createRange();i.selectNodeContents(t),n.removeAllRanges(),n.addRange(i)}return n},Il=function(t){return t.clipboardData||window.clipboardData},Cl=function(t){function n(){var n=t.call(this)||this,i=document.body;return i.addEventListener("copy",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("copy",Il(t)))})),i.addEventListener("cut",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("cut",Il(t)))})),i.addEventListener("paste",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("paste",Il(t)))})),n}return _(n,t),n.copy=function(t){var n=navigator.clipboard;n&&n.writeText?n.writeText(t):function(t,n){if("undefined"==typeof ClipboardEvent){var i=t.clipboardData;if(void 0!==i&&void 0!==i.setData)return i.setData("Text",n),!0}return!1}(window,t)||function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important"),n.textContent="Dummy",document.body.appendChild(n);var i=Nl(n),r=!1;if(i){var e=function(i){if(i.target===n){var e=Il(i);e.setData("text/plain",t),r=e.getData("text/plain")===t,i.preventDefault()}};document.addEventListener("copy",e);try{document.execCommand("copy")}finally{document.removeEventListener("copy",e)}i.removeAllRanges()}return document.body.removeChild(n),r}(t)||navigator.userAgent.indexOf("Edge")<0&&function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important");var i=document.createElement("span");i.innerText=t,(n.attachShadow?n.attachShadow({mode:"open"}):n).appendChild(i),document.body.appendChild(n);var r=Nl(n);r&&(document.execCommand("copy"),r.removeAllRanges()),document.body.removeChild(n)}(t)},n}(t.utils.EventEmitter),Al=t.interaction.InteractionEvent,Rl=function(){function t(t){this.xn=t,this.Mo=null==t?void 0:t.url,this.Zn=this.toNormalizedTarget(null==t?void 0:t.target),this.So=null==t?void 0:t.checker,this.es=!0}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.es},set:function(t){this.es=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.Mo},set:function(t){this.Mo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this.Zn},set:function(t){this.Zn=this.toNormalizedTarget(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checker",{get:function(){return this.So},set:function(t){this.So=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"menu",{get:function(){var t=this.Eo;return null==t&&(t=this.newMenu(),this.Eo=t),t},enumerable:!1,configurable:!0}),t.prototype.newMenu=function(){var n=this.xn;if(n){var i=n.menu;if(i)return new Tl(this,i)}var r=t.MENU;return null==r&&(r=new Tl(this,Y.getInstance().get("DLink").getMenuOptions()),t.MENU=r),r},t.prototype.toStringifiedUrl=function(t,n){var i=at(t)?t():t;null!=i&&(ct(i)?n(i):i.then((function(t){null!=t&&n(t)})))},t.prototype.toNormalizedUrl=function(n){var i=t.ANCHOR_ELEMENT||document.createElement("a");return t.ANCHOR_ELEMENT=i,i.href=n,i.href},t.prototype.toNormalizedTarget=function(t){return Ei(null!=t?t:jl.AUTO,jl)},t.prototype.copy=function(){var t=this;this.toStringifiedUrl(this.Mo,(function(n){Cl.copy(t.toNormalizedUrl(n))}))},t.prototype.open=function(t){var n=this;this.toStringifiedUrl(this.Mo,(function(i){var r=!0===t||!1===t?t:n.inNewWindow(t);n.check(i,r,(function(){n.exec(i,r)}))}))},t.prototype.check=function(t,n,i){var r=this.So;if(r){var e=r();!0===e?i():!1===e||e.then((function(t){t&&i()}))}else i()},t.prototype.exec=function(t,n){if(n){var i=document.createElement("a");i.href=t,i.target="_blank",i.style.display="none",i.rel="noopener noreferrer",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),100)}else window.location.href=t},t.prototype.inNewWindow=function(t){switch(this.Zn){case jl.NEW_WINDOW:return!0;case jl.THIS_WINDOW:return!1;case jl.AUTO:if(null!=t){var n=t instanceof Al?t.data.originalEvent:t;return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey||"button"in n&&0!==n.button}return!1}},t.prototype.onClick=function(t,n){if(this.Zn===jl.AUTO){var i=n.data.originalEvent;if("pointerType"in i&&"mouse"!==i.pointerType||"touches"in i){var r=this.menu;if(r.enable)return this.es&&t.state.isActionable&&r.open(t),!0}}return!this.es},t}(),Ll=function(){function t(){}return t.toStateOptions=function(t,n){if(n&&(t===jl.NEW_WINDOW||"NEW_WINDOW"===t)){var i=n.state;null==i?n.state=ot.NEW_WINDOW:ct(i)?i!==ot.NEW_WINDOW&&(n.state=[i,ot.NEW_WINDOW]):i.indexOf(ot.NEW_WINDOW)<0&&i.push(ot.NEW_WINDOW)}return n},t}(),yl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toLinkOptions=function(t){if(t)return{url:this.toUrl(t.url),target:t.target,checker:this.toChecker(t.checker),menu:t.menu}},n.prototype.toUrl=function(t){var n=this;return ct(t)||null==t?t:function(){return t(n)}},n.prototype.toChecker=function(t){var n=this;if(null!=t)return function(){return t(n)}},n.prototype.init=function(n){t.prototype.init.call(this,Ll.toStateOptions(null==n?void 0:n.target,n))},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.To;return null==t&&(t=new Rl(this.toLinkOptions(this.xn)),this.To=t),t},enumerable:!1,configurable:!0}),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},n.prototype.getType=function(){return"DMenuItemLink"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(Ol),kl=function(t){return"url"in t},xl=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t),this.initHover(t)},i.prototype.initHover=function(t){var n=this;this.on(Yi.over,(function(){n.state.isActionable&&n.open()}))},i.prototype.toMenu=function(n){var i=null==n?void 0:n.menu;return i instanceof t.DisplayObject?i:this.newMenu(i)},i.prototype.newMenu=function(t){return Sl.newMenu(t)},Object.defineProperty(i.prototype,"menu",{get:function(){var t=this,n=this.Eo;return null==n&&((n=this.toMenu(this.xn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Eo=n),n},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DMenuItemMenu"},i.prototype.open=function(){var t=this.menu;t.isHidden()&&this.onOpen(t)},i.prototype.onOpen=function(t){var n=this.getContext();null!=n&&t.open(this,this.getCloseable(),n)},i.prototype.close=function(){this.menu.close()},i.prototype.toggle=function(){var t=this.menu;t.isHidden()?this.onOpen(t):t.close()},i.prototype.onSelect=function(t){this.open(),n.prototype.onSelect.call(this,t)},i.prototype.onMenuSelect=function(t,n,i){var r=this.getCloseable();null!=r&&r.emit("select",t,n,r)},i.prototype.onKeyDown=function(t){return Ki.isArrowRightKey(t)&&this.onKeyDownArrowRight(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyDownArrowRight=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},i}(pl),Bl=function(t){return"menu"in t},_l=function(n,i){var r=n.menu;return r instanceof t.DisplayObject||(null==r.sticky&&(r.sticky=i),null==r.align&&(r.align=Nu.RIGHT)),n},Pl=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){var r=t.state,e=t.border,u=e.getWidth(r),s=e.getColor(r);if(null!=s){var h=e.getAlpha(r),o=e.getAlign(r),a=t.padding,c=.5*i;this.clear(),this.lineStyle(u,s,h,o),this.moveTo(a.getLeft(),c),this.lineTo(n-a.getRight(),c),this.visible=!0}else this.clear(),this.visible=!1},n}(t.Graphics),Ul=function(t){return"separator"in t},Fl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){new Pl(this)},n.prototype.getType=function(){return"DMenuItemSeparator"},n}(wl),Gl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemSpace"},n}(Pu),Hl=function(t){return"space"in t},zl=function(){Sl.addItemCreator((function(t){return El(t)?new Dl(t):null})),Sl.addItemCreator((function(t){return kl(t)?new yl(t):null})),Sl.addItemCreator((function(t,n){return Bl(t)?new xl(_l(t,n)):null})),Sl.addItemCreator((function(t){return Ul(t)?new Fl(t):null})),Sl.addItemCreator((function(t){return Hl(t)?new Gl(t):null})),Sl.setItemCreatorDefault((function(t){return new Ol(t)}))},Vl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableBody"},n}(Gu),Wl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuItemExpandableHeader"},n}(wl),Xl=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Sl.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||Sl.newItem(t,n)},t.newItems=function(t,n,i){Sl.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),Kl=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i,r=this;n.prototype.init.call(this,t);var e=this.theme,u=this.toHeader(e,t);this.oh=u,u.on("select",(function(){r.toggle()})),this.addChild(u);var s=this.toBody(e,t);this.Oe=s;var h=null!==(i=null==t?void 0:t.sticky)&&void 0!==i&&i;this.newItems(s,h,e,t),this.addChild(s),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.newItems=function(t,n,i,r){var e=null==r?void 0:r.items;null!=e&&Xl.newItems(t,e,n)},i.prototype.toHeader=function(n,i){return i?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new Wl(n)},i.prototype.toBody=function(n,i){var r=null==i?void 0:i.body;return r?r instanceof t.DisplayObject?r:this.newBody(n,r):this.newBody(n)},i.prototype.newBody=function(t,n){return new Vl(n)},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.Oe;t instanceof $i?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.Oe;t instanceof $i?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.onKeyDown=function(t){if(Ki.isArrowRightKey(t))this.state.isActionable&&!this.state.isActive&&(i=this.oh)instanceof $i&&i.state.isFocused&&(this.state.isActive=!0);else if(Ki.isArrowLeftKey(t)){var i;if(this.state.isActionable&&this.state.isActive)return(i=this.oh)instanceof $i?i.focus():this.focus(),this.state.isActive=!1,n.prototype.onKeyDown.call(this,t),!0}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuItemExpandable"},i}(Gu),Yl=function(t){return"header"in t},Jl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemCheck"},n}(Dl),Zl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemLink"},n}(yl),ql=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSeparator"},n}(Fl),Ql=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSpace"},n}(Gl),$l=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemText"},n}(Ol),tv=function(){Sl.addItemCreator((function(t){return Yl(t)?new Kl(t):null})),Xl.addItemCreator((function(t){return El(t)?new Jl(t):null})),Xl.addItemCreator((function(t){return kl(t)?new Zl(t):null})),Xl.addItemCreator((function(t){return Ul(t)?new ql(t):null})),Xl.addItemCreator((function(t){return Hl(t)?new Ql(t):null})),Xl.setItemCreatorDefault((function(t){return new $l(t)}))},nv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemCheck"},n}(Dl),iv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemLink"},n}(yl),rv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initHover=function(t){},n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=t.prototype.getSelection.call(this);e&&e.add(i)},n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemMenu"},n}(xl),ev=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(Fl),uv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSpace"},n}(Gl),sv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemText"},n}(Ol),hv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Sl.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||Sl.newItem(t,n)},t.newItems=function(t,n,i){Sl.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),ov=function(){hv.setItemCreatorDefault((function(t){return new sv(t)})),hv.addItemCreator((function(t){return Hl(t)?new uv(t):null})),hv.addItemCreator((function(t){return Ul(t)?new ev(t):null})),hv.addItemCreator((function(t,n){return Bl(t)?new rv(_l(t,n)):null})),hv.addItemCreator((function(t){return kl(t)?new iv(t):null})),hv.addItemCreator((function(t){return El(t)?new nv(t):null}))},av=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Sl.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||hv.newItem(t,n)},t.newItems=function(t,n,i){Sl.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),cv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItems=function(t,n,i,r){null!=r&&null!=r.items&&av.newItems(t,r.items,n)},n.prototype.getType=function(){return"DMenuSidedItemExpandable"},n}(Kl),fv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemCheck"},n}(Jl),lv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemLink"},n}(yl),vv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemMenu"},n}(xl),bv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getType=function(){return"DMenuSidedItemExpandableItemMenu"},n}(vv),dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(ql),gv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemSpace"},n}(Ql),mv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemText"},n}($l),wv=function(){hv.addItemCreator((function(t){return Yl(t)?new cv(t):null})),av.addItemCreator((function(t){return El(t)?new fv(t):null})),av.addItemCreator((function(t){return kl(t)?new lv(t):null})),av.addItemCreator((function(t,n){return Bl(t)?new bv(_l(t,n)):null})),av.addItemCreator((function(t){return Ul(t)?new dv(t):null})),av.addItemCreator((function(t){return Hl(t)?new gv(t):null})),av.setItemCreatorDefault((function(t){return new mv(t)}))},pv=function(){zl(),tv(),ov(),wv()},Ov=function(){pv(),gl()},Dv=function(){function t(){}return t.add=function(t,n){var i=this.jo;null==i&&(i=new Map,this.jo=i);var r=i.get(t);null==r?(r=[n],i.set(t,r)):r.push(n)},t.get=function(t){var n=this.jo;if(null!=n)return n.get(t)},t}(),Ev=function(t){function n(n,i){return t.call(this,xe.EMIT_EVENT,n,i,ou.EMIT_EVENT,"")||this}return _(n,t),n}(Du),Mv=function(t){function n(n,i,r){return t.call(this,n,i,"",ou.EMIT_EVENT,r)||this}return _(n,t),n}(Du),Sv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e,"")||this}return _(n,t),n}(Du),Tv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,ou.EMIT_EVENT,e)||this}return _(n,t),n}(Du),jv=function(t,n){return n?co(t).then((function(t){var n=de.getInstance().init();n.updateTexture(t),n.render();var i=document.createElement("canvas");return n.read(i),jv(i.toDataURL(),!1)})):co(t).then((function(t){return new Nc(t)}))},Nv=function(){function t(){}return t.from=function(t,n,i){var r=this,e=Fe.toSerialized(t),u=e.pieces;return Fe.toPieceData(n,u,i).then((function(t){return r.No(e,i,u,t)}))},t.No=function(t,n,i,r){var e=this,u=t.width,s=t.height,h=new Ue(u,s),o=new gr(t,i,r,n,1);return Fe.newLayer(t,h,o).then((function(){return e.create(t.name,u,s,h,n,0)}))},t.create=function(t,n,i,r,e,u){var s=new Ir(t,e,u);return s.size.set(n,i),r.copyTo(s),s.size.init(),s},t}(),Iv=function(t){return"data:image/svg+xml;base64,".concat(btoa(t))},Cv=function(t){return Math.round(100*t)/100},Av=function(){function t(){}return t.add=function(t){var n,i,r;(null!==(n=this.kh)&&void 0!==n?n:this.kh=new Map).set(t.type,t),(null!==(i=this.Me)&&void 0!==i?i:this.Me=new Map).set(t.id,t),(null!==(r=this.Pt)&&void 0!==r?r:this.Pt=[]).push(t)},t.get=function(t){var n=this.kh;if(null!=n)return n.get(t)},t.getById=function(t){var n=this.Me;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Pt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Rv=function(){function t(){}return t.toIndices=function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(t[i].index);return n},t.toDepth=function(t){for(var n=0,i=t.parent;i instanceof Dt;)n+=1,i=i.parent;return n},t.toSharedParent=function(t,n){if(this.toDepth(t)<this.toDepth(n)){for(var i=t.parent;i instanceof Dt;){if(this.isParent(n,i))return i;i=i.parent}return i}for(var r=n.parent;r instanceof Dt;){if(this.isParent(t,r))return r;r=r.parent}return r},t.toOfParent=function(t,n){for(var i=t.parent;i!==n&&i instanceof Dt;)t=i,i=i.parent;return t},t.isParent=function(t,n){for(var i=t.parent;i instanceof Dt;){if(i===n)return!0;i=i.parent}return!1},t.toSelected=function(t){for(var n=t;n instanceof Dt;){if(n.selected)return n;n=n.parent}return null},t.findChildById=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.id===i)return h;if(!0===r){var o=t.findChildById(h,i,r);if(null!=o)return o}}return null},t.findChildByType=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.type===i)return h;if(!0===r){var o=t.findChildByType(h,i,r);if(null!=o)return o}}return null},t.findChild=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(i(h))return h;if(!0===r){var o=t.findChild(h,i,r);if(null!=o)return o}}return null},t.findChildrenByType=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];o.type===i&&e.push(o),!0===r&&t.findChildrenByType(o,i,r,e)}return e},t.findChildren=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];i(o)&&e.push(o),!0===r&&t.findChildren(o,i,r,e)}return e},t.COMPARATOR_INDEX=function(t,n){return t.index-n.index},t}(),Lv=function(){function t(){}return t.delete=function(t,n,i){for(var r=t.children,e=r.length,u=0;u<e;++u)(o=r[u]).selected?o.index=e+u:o.index=u;if(r.sort(Rv.COMPARATOR_INDEX),!0===i){for(u=e-1;0<=u;--u){if(!(o=r[u]).selected){var s=r.length-(u+1);if(0<s){var h=r.splice(u+1,s);return null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h}return null!=n&&(n.length=0),null}o.index-=e,o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(h=r.splice(0,r.length),null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h):(null!=n&&(n.length=0),null)}for(u=e-1;0<=u;--u){var o;if(!(o=r[u]).selected)return r.length=u+1,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),null;o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(r.length=0,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty()):null!=n&&(n.length=0),null},t}(),yv=function(){function t(){}return t.from=function(t){if(ct(t))return G[t];if(wn(t))return t;if(null!=t){for(var n=G.NONE,i=0,r=t.length;i<r;++i)n|=G[t[i]];return n}return G.NONE},t}(),kv=function(){function t(){this.resources=[],this.resourceToIndex=new Map,this.data=[],this.dataToIndex=new Map,this.pieces=[],this.pieceToIndex=new Map,this.uuids=new Set,this.uuidNext=0}return t.prototype.addResource=function(t){return this.Io(t,this.resources,this.resourceToIndex)},t.prototype.addData=function(t){return this.Io(t,this.data,this.dataToIndex)},t.prototype.addPiece=function(t){return this.Io(t,this.pieces,this.pieceToIndex)},t.prototype.addUuid=function(t){if(0!==t){var n=this.uuids;return n.has(t)?0:(n.add(t),t)}return 0},t.prototype.updateUuid=function(t){var n=this.uuids;if(0!==t)return t;var i=this.newUuid();return n.add(i),i},t.prototype.newUuid=function(){for(var t=this.uuids,n=this.uuidNext;;)if(0!==(n+=1)&&!t.has(n))return this.uuidNext=n,n},t.prototype.Io=function(t,n,i){var r=i.get(t);if(null!=r)return r;var e=n.length;return n.push(t),i.set(t,e),e},t}(),xv=function(t){function n(n,i){var r,e,u,s=this;return(s=t.call(this)||this).Co=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapGridVisible(),s.Ao=s.Co,s.Ro=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapGridEnabled(),s.es=s.Ro,s.Lo=null!==(u=null==i?void 0:i.size)&&void 0!==u?u:n.getSnapGridSize(),s.j=s.Lo,s}return _(n,t),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Ao},set:function(t){this.Ao!==t&&(this.Ao=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"enable",{get:function(){return this.es},set:function(t){this.es!==t&&(this.es=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.emit("change",t,this))},enumerable:!1,configurable:!0}),n.prototype.snap=function(t,n){if(this.es){var i=this.j;n.set(t,Math.round(t/i)*i)}},n.prototype.reset=function(){this.Ao=this.Co,this.es=this.Ro,this.j=this.Lo,this.emit("change",this)},n.prototype.serialize=function(){return[this.es?1:0,this.Ao?1:0,this.j]},n.prototype.deserialize=function(t){this.enable=!!t[0],2 in t?(this.visible=!!t[1],this.size=t[2]):(this.visible=!1,this.size=t[1])},n}(t.utils.EventEmitter),Bv=function(){function t(){this.distance=NaN,this.result=0,this.threshold=10}return t.prototype.reset=function(t,n){this.distance=NaN,this.result=t,this.threshold=1e-4<n?10/n:10},t.prototype.set=function(t,n){var i=Math.abs(n-t);if(i<=this.threshold){var r=this.distance;(r!=r||i<r)&&(this.distance=i,this.result=n)}},t}(),_v={HORIZONTAL:0,VERTICAL:1},Pv=function(){function t(t,n){this.type=t,this.position=n}return t.prototype.serialize=function(){return[this.type,this.position]},t}(),Uv=function(t){function n(n,i){var r,e,u=this;return(u=t.call(this)||this).values=[],u.Co=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapTargetVisible(),u.Ao=u.Co,u.Ro=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapTargetEnabled(),u.es=u.Ro,u}return _(n,t),Object.defineProperty(n.prototype,"enable",{get:function(){return this.es},set:function(t){this.es!==t&&(this.es=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Ao},set:function(t){this.Ao!==t&&(this.Ao=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.values.length},enumerable:!1,configurable:!0}),n.prototype.add=function(t,n){null!=n?this.values.splice(n,0,t):this.values.push(t),this.emit("change",this)},n.prototype.remove=function(t){var n=this.values;0<=t&&t<n.length&&(n.splice(t,1),this.emit("change",this))},n.prototype.replace=function(t,n){var i=this.values;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.emit("change",this),r}return null},n.prototype.swap=function(t,n){if(t!==n){var i=this.values,r=i[t];i[t]=i[n],i[n]=r,this.emit("change",this)}},n.prototype.snap=function(t,n,i,r){if(this.es)for(var e=this.values,u=0,s=e.length;u<s;++u){var h=e[u];h.type===_v.VERTICAL?i.set(t,h.position):r.set(n,h.position)}},n.prototype.reset=function(){this.es=this.Ro,this.Ao=this.Co,this.values.length=0,this.emit("change",this)},n.prototype.serialize=function(){for(var t=[],n=this.values,i=0,r=n.length;i<r;++i)t.push(n[i].serialize());return[this.es?1:0,this.Ao?1:0,t]},n.prototype.deserialize=function(t){this.es=!!t[0],this.Ao=!!t[1];var n=t[2],i=this.values;i.length=0;for(var r=0,e=n.length;r<e;++r){var u=n[r];i.push(new Pv(u[0],u[1]))}this.emit("change",this)},n}(t.utils.EventEmitter),Fv=1e-5,Gv={NONE:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,MIDDLE_LEFT:4,MIDDLE_RIGHT:5,BOTTOM_LEFT:6,BOTTOM_CENTER:7,BOTTOM_RIGHT:8,ROTATION:9},Hv=function(n){function i(i,r,e){var u,s=this;return(s=n.call(this)||this).gt=[new t.Point,new t.Point,new t.Point,new t.Point,new t.Point],s.yo=[new t.Point,new t.Point],s.ko=[1,1],s.xo=new t.Point,s.Bo=new Bv,s._o=new Bv,s.Po={distance:0,scale:new t.Point},s.Uo=new t.Point,s.Fo=new t.Rectangle,s.Go=new t.Point,s.grid=new xv(r,null==e?void 0:e.grid),s.target=new Uv(r,null==e?void 0:e.target),s.p=i,s.Ro=null!==(u=null==e?void 0:e.enable)&&void 0!==u?u:r.isSnapEnabled(),s.es=s.Ro,s}return _(i,n),Object.defineProperty(i.prototype,"enable",{get:function(){return this.es},set:function(t){this.es!==t&&(this.es=t,this.emit("change",this))},enumerable:!1,configurable:!0}),i.prototype.prepare=function(t){t.updateTransform();var n=t.transform.localTransform,i=t.width,r=t.height,e=this.gt;e[0].set(0,0),e[1].set(i,0),e[2].set(i,r),e[3].set(0,r),e[4].set(.5*i,.5*r),n.apply(e[0],e[0]),n.apply(e[1],e[1]),n.apply(e[2],e[2]),n.apply(e[3],e[3]),n.apply(e[4],e[4])},i.prototype.prepareForTranslate=function(t){this.es&&this.prepare(t)},i.prototype.snap=function(t,n){var i=t.x,r=t.y,e=this.p.canvas,u=this.Bo,s=this._o;if(null!=e){var h=Math.max(e.scale.x,e.scale.y);u.reset(i,h),s.reset(r,h),u.set(i,0),u.set(i,e.width),s.set(r,0),s.set(r,e.height)}else u.reset(i,1),s.reset(r,1);return this.target.snap(i,r,u,s),this.grid.snap(i,u),this.grid.snap(r,s),n.x=dh(u.distance)?NaN:u.result,n.y=dh(s.distance)?NaN:s.result,n},i.prototype.toSnapped=function(t,n){var i=t.x,r=t.y;if(this.es){this.snap(t,n);var e=n.x,u=n.y;n.set(dh(e)?i:e,dh(u)?r:u)}else n.set(i,r);return n},i.prototype.toTranslationSnapped=function(t,n){var i=t.x,r=t.y,e=NaN,u=NaN;if(this.es)for(var s=this.Uo,h=this.gt,o=0,a=h.length;o<a;++o){var c=h[o];if(s.set(c.x+i,c.y+r),this.snap(s,s),!dh(s.x)){var f=s.x-c.x;(dh(e)||Math.abs(f-i)<Math.abs(e-i))&&(e=f)}if(!dh(s.y)){var l=s.y-c.y;(dh(u)||Math.abs(l-r)<Math.abs(u-r))&&(u=l)}}return n.x=dh(e)?i:e,n.y=dh(u)?r:u,n},i.prototype.prepareForRotate=function(t){},i.prototype.getGridSizeRotation=function(){return 5},i.prototype.toRadian=function(t){return t/180*Math.PI},i.prototype.toDegree=function(t){return t/Math.PI*180},i.prototype.toRotationSnapped=function(t,n){if(this.es){var i=this.getGridSizeRotation(),r=t+n,e=Math.round(this.toDegree(r)),u=e%90;return Math.abs(u)<=i?this.toRadian(e-u)-t:90-i<=u?this.toRadian(e+(90-u))-t:u<=-90+i?this.toRadian(e-(90+u))-t:n}return n},i.prototype.calcNormalizedVector=function(t,n,i){var r=n.x-t.x,e=n.y-t.y,u=Math.sqrt(r*r+e*e);if(Fv<u){var s=1/u;i.x=r*s,i.y=e*s}else i.x=1,i.y=0;return u},i.prototype.prepareForScale=function(t,n){if(this.es){this.prepare(t);var i=this.gt,r=this.yo,e=this.ko;switch(n){case Gv.TOP_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]),e[1]=this.calcNormalizedVector(i[3],i[0],r[1]);break;case Gv.TOP_CENTER:e[0]=this.calcNormalizedVector(i[3],i[0],r[0]);break;case Gv.TOP_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]),e[1]=this.calcNormalizedVector(i[2],i[1],r[1]);break;case Gv.MIDDLE_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]);break;case Gv.NONE:break;case Gv.MIDDLE_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]);break;case Gv.BOTTOM_LEFT:e[0]=this.calcNormalizedVector(i[2],i[3],r[0]),e[1]=this.calcNormalizedVector(i[0],i[3],r[1]);break;case Gv.BOTTOM_CENTER:e[0]=this.calcNormalizedVector(i[0],i[3],r[0]);break;case Gv.BOTTOM_RIGHT:e[0]=this.calcNormalizedVector(i[3],i[2],r[0]),e[1]=this.calcNormalizedVector(i[1],i[2],r[1])}}},i.prototype.setScaleSnappedResult=function(t,n,i,r,e){if(Fv<n&&(dh(e.distance)||t<e.distance)){e.distance=t;var u=1+i/n;r?e.scale.x=u:e.scale.y=u}},i.prototype.calcScaleSnapped1D=function(t,n,i,r,e,u){var s=this.xo;t.apply(n,s);var h=s.x,o=s.y;this.snap(s,s);var a=s.x,c=s.y;if(!dh(a)){var f=Math.abs(i.x);if(Fv<f){var l=(a-h)/i.x,v=Math.abs(l),b=(a-n.x)/i.x;this.setScaleSnappedResult(v,r,b,e,u)}}if(!dh(c)){var d=Math.abs(i.y);if(Fv<d){var g=(c-o)/i.y,m=(v=Math.abs(g),(c-n.y)/i.y);this.setScaleSnappedResult(v,r,m,e,u)}}},i.prototype.calcScaleSnappedX=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!0,e)},i.prototype.calcScaleSnappedY=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!1,e)},i.prototype.calcScaleSnapped2D=function(t,n,i,r,e){var u=this.xo;t.apply(n,u);var s=u.x,h=u.y;this.snap(u,u);var o=u.x,a=u.y;if(dh(o)){if(dh(a))return;o=s}else dh(a)&&(a=h);var c=i[0].x*i[1].y-i[1].x*i[0].y;if(Fv<Math.abs(c)){var f=o-s,l=a-h,v=Math.abs(f*f+l*l);if(dh(e.distance)||v<e.distance){e.distance=v;var b=o-n.x,d=a-n.y,g=(+i[1].y*b-i[1].x*d)/c,m=(-i[0].y*b+i[0].x*d)/c;e.scale.set(1+g/r[0],1+m/r[1])}}},i.prototype.calcScaleSnappedXY=function(t,n,i,r,e,u,s){this.calcScaleSnapped2D(t,n,e,u,s),this.calcScaleSnappedX(t,r,e[0],u[0],s),this.calcScaleSnappedY(t,i,e[1],u[1],s)},i.prototype.toScaleSnapped=function(t,n,i,r){if(this.es){var e=this.gt,u=this.yo,s=this.ko,h=this.Po;switch(h.distance=NaN,h.scale.set(r.x,r.y),n){case Gv.TOP_LEFT:this.calcScaleSnappedXY(t,e[0],e[1],e[3],u,s,h);break;case Gv.TOP_CENTER:this.calcScaleSnappedY(t,e[0],u[0],s[0],h),this.calcScaleSnappedY(t,e[1],u[0],s[0],h);break;case Gv.TOP_RIGHT:this.calcScaleSnappedXY(t,e[1],e[0],e[2],u,s,h);break;case Gv.MIDDLE_LEFT:this.calcScaleSnappedX(t,e[0],u[0],s[0],h),this.calcScaleSnappedX(t,e[3],u[0],s[0],h);break;case Gv.NONE:break;case Gv.MIDDLE_RIGHT:this.calcScaleSnappedX(t,e[1],u[0],s[0],h),this.calcScaleSnappedX(t,e[2],u[0],s[0],h);break;case Gv.BOTTOM_LEFT:this.calcScaleSnappedXY(t,e[3],e[2],e[0],u,s,h);break;case Gv.BOTTOM_CENTER:this.calcScaleSnappedY(t,e[2],u[0],s[0],h),this.calcScaleSnappedY(t,e[3],u[0],s[0],h);break;case Gv.BOTTOM_RIGHT:this.calcScaleSnappedXY(t,e[2],e[3],e[1],u,s,h)}if(!dh(h.distance)){if(r.copyFrom(h.scale),i)switch(n){case Gv.TOP_LEFT:case Gv.TOP_RIGHT:case Gv.BOTTOM_LEFT:case Gv.BOTTOM_RIGHT:r.x=r.y=Math.max(r.x,r.y);break;case Gv.TOP_CENTER:case Gv.BOTTOM_CENTER:r.x=r.y;break;case Gv.MIDDLE_LEFT:case Gv.MIDDLE_RIGHT:r.y=r.x}return!0}}return!1},i.prototype.reset=function(){this.enable=this.Ro,this.target.reset(),this.grid.reset()},i.prototype.serialize=function(){return[this.es?1:0,this.target.serialize(),this.grid.serialize()]},i.prototype.deserialize=function(t){this.enable=!!t[0],this.target.deserialize(t[1]),this.grid.deserialize(t[2])},i}(t.utils.EventEmitter),zv=function(t){function n(n,i,r){var e=t.call(this,n,i.width,i.height,0,r)||this;return e.Is=i,e}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.drawImage(this.Is.canvas,n.x,n.y,n.width,n.height)},n}(se),Vv=function(){function t(){}return t.measure=function(t){var n=this.Ho;null==n&&(n=new Map,this.Ho=n);var i=n.get(t);if(null!=i)return i;var r=this.zo;null==r&&((r=document.createElement("span")).innerText="|ÉqÅ",r.style.border="none",r.style.margin="0px",this.zo=r);var e=this.Vo;null==e&&((e=document.createElement("div")).style.display="inline-block",e.style.width="0px",e.style.height="0px",e.style.border="none",e.style.margin="0px",e.style.verticalAlign="baseline",this.Vo=e);var u=this.Wo;null==u&&((u=document.createElement("div")).style.position="absolute",u.style.padding="0px",u.style.margin="0px",u.style.visibility="hidden",u.appendChild(r),u.appendChild(e),document.body.appendChild(u),this.Wo=u),r.style.font=t;var s=e.getBoundingClientRect().top,h=r.getBoundingClientRect();return i={ascent:s-h.top,descent:h.bottom-s},n.set(t,i),i},t}(),Wv=function(n,i,r,e){this.id=n,this.size=i,this.color=t.utils.hex2string(r),this.height=i+2*e;var u=Vv.measure(n);this.ascent=u.ascent,this.descent=u.descent},Xv=function(){function n(n,i,r,e){this.R=n,this.rr=document.createElement("canvas"),this.Xo=null;var u=this.toPadding(i);this.Vn=u,this.Fe=new Wv(n,i,r,u),this.Ge={},this.He=0,this.Ko=0,this.St=1,this.fn=1,this.Yo=0,this.Jo=0,this.Ne=t.Texture.from(this.rr,{mipmap:t.MIPMAP_MODES.OFF,resolution:e,scaleMode:t.SCALE_MODES.NEAREST});var s=this.Ge;this.Io(" "," ",s,be.SPACE_R),this.Io("\t"," ",s,be.SPACE_R),this.Io("...","...",s,be.LETTER_RNB);for(var h=0,o=fe.length;h<o;++h){var a=fe[h];this.Io(a,a,s,be.LETTER_RNB)}}return n.prototype.toPadding=function(t){return Math.max(3,Math.ceil(.2*t))},Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"font",{get:function(){return this.Fe},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.fn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvas",{get:function(){return this.rr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"characters",{get:function(){return this.Ge},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){return this.Ne},enumerable:!1,configurable:!0}),n.prototype.Io=function(t,n,i,r){if(!this.isIgnored(n)){var e=i[t];if(null!=e)e.type&be.RESERVED||(0===e.ref&&(this.Ko-=1),e.ref+=1);else{var u=this.getAdvance(n),s=this.Vn,h=Math.ceil(s+u+s),o=this.font.height;i[t]=new ve(n,u,h,o,r),this.He+=1,this.Yo+=1}}},n.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},n.prototype.Zo=function(t,n){var i=n[t];null!=i&&!(i.type&be.RESERVED)&&0<i.ref&&(i.ref-=1,0===i.ref&&(this.Ko+=1))},n.prototype.qo=function(){if(this.He>>1<=this.Ko){var t=this.Ge;for(var n in t)t[n].ref<=0&&delete t[n];this.He-=this.Ko,this.Yo+=1,this.Ko=0}},n.prototype.add=function(t,n){void 0===n&&(n=be.LETTER);for(var i=this.Ge,r=b.from(t);r.hasNext();){var e=r.next();this.Io(e,e,i,n)}},n.prototype.remove=function(t){for(var n=this.Ge,i=b.from(t);i.hasNext();)this.Zo(i.next(),n)},n.prototype.get=function(t){return this.Ge[t]},n.prototype.getAdvance=function(t){var n=this.getContext();return null!=n?n.measureText(t).width:0},n.prototype.getContext=function(){var t=this.Xo;if(null==t){var n=this.rr;if(null==n)return null;if(null==(t=this.Xo=n.getContext("2d",{alpha:!0})))return null}var i=this.Fe;return t.font!==i.id&&(t.font=i.id,i.id=t.font,t.textAlign="left",t.textBaseline="alphabetic",t.lineWidth=0,t.lineCap="round",t.lineJoin="miter",t.miterLimit=0,t.fillStyle=i.color,t.strokeStyle="#0000ff"),t},n.prototype.update=function(){if(this.qo(),this.Jo<this.Yo){this.Jo=this.Yo;var t=this.rr;if(null!=t){var n=this.Fe,i=n.height,r=this.Ge,e=this.St=this.toPowerOf2(Math.ceil(Math.sqrt(this.He))*i),u=this.Vn,s=Math.round(.5*(i-(n.ascent+n.descent))+n.ascent),h=0,o=0;for(var a in r)e<=h+(g=r[a]).width&&(h=0,o+=i),g.x=h,g.y=o,g.origin.x=h+u,g.origin.y=o+s,h+=g.width;var c=this.fn=o+i,f=this.Ne.baseTexture,l=f.resolution,v=Math.ceil(e*l),b=Math.ceil(c*l);t.width=v,t.height=b;var d=this.getContext();if(null!=d){for(var a in d.save(),d.scale(l,l),d.clearRect(0,0,e,c),r){var g=r[a];d.fillText(a,g.origin.x,g.origin.y)}d.restore()}return f.setRealSize(v,b),!0}}return!1},n.prototype.getRevision=function(){return this.Yo},n.prototype.getRevisionUpdate=function(){return this.Jo},Object.defineProperty(n.prototype,"length",{get:function(){return this.He},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){null!=this.rr&&(this.rr=null);var t=this.Ge;for(var n in t)delete t[n]},n.prototype.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},n}(),Kv=function(t){t.update()},Yv=function(t){t.forEach(Kv)},Jv=function(t){t.update()},Zv=function(t){t.forEach(Jv)},qv=function(){function t(t){var n=this;this.ze=new Map,this.dn=t.renderer.resolution,t.renderer.on("prerender",(function(){n.update()}))}return t.prototype.add=function(t,n,i,r){var e=this.ze,u=e.get(t);null==u&&(u=new Map,e.set(t,u));var s=u.get(i);null==s&&(s=new Xv(t,n,i,this.dn),u.set(i,s)),s.add(r)},t.prototype.remove=function(t,n,i){var r=this.ze.get(t);if(null!=r){var e=r.get(n);null!=e&&e.remove(i)}},t.prototype.get=function(t,n){var i=this.ze.get(t);if(null==i)return null;var r=i.get(n);return null==r?null:r},t.prototype.update=function(){this.ze.forEach(Yv)},t.prototype.destroy=function(){var t=this.ze;t.forEach(Zv),t.clear()},t}(),Qv=function(t){if("object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)){var n=Object.getPrototypeOf(t);return null==n||n===Object.prototype}return!1},$v=function(){function t(t,n,i){var r=this;this.instance=null,this.newInstance=t,this.options=n,null!=i&&(i.state.isActive&&setTimeout((function(){r.get()}),0),i.on("active",(function(){r.get()})))}return t.prototype.get=function(){var t=this.instance;return null==t&&(t=new this.newInstance(this.options),this.instance=t),t},t}(),tb=function(t,n,i,r){for(var e=0,u=Math.floor(t.length/i)-1;e<=u;){var s=e+(u-e>>1),h=t[s*i+r];if(n<h)u=s-1;else{if(!(h<n))return s;e=s+1}}return Math.max(e,u)},nb=function(t){return Lt(t)?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n[i]=t[i];return n}(t):Qv(t)?function(t){var n={};for(var i in t)Object.hasOwnProperty.call(t,i)&&(n[i]=nb(t[i]));return n}(t):t},ib=function(t){if(null!=t){if(ct(t))return t;if(wn(t))return String(t);if("name"in t)return t.name;if("label"in t)return t.label;if("id"in t)return t.id}return""},rb=function(t,n){if(null!=t){var i=nb(t);if(null!=n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var e=n[r];if(Qv(e))if(Object.prototype.hasOwnProperty.call(i,r)){var u=i[r];Qv(u)&&rb(u,e)}else i[r]=nb(e);else Object.prototype.hasOwnProperty.call(i,r)||(i[r]=e)}return i}return null!=n?nb(n):{}},eb=function(){function n(t,n,i){this.St=t,this.Qo=n,this.Xr=i,this.$o={},this.ta="",this.na=0,this.ia=0,this.fn=0}return Object.defineProperty(n.prototype,"width",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ratio",{get:function(){return this.Qo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Xr},enumerable:!1,configurable:!0}),n.prototype.add=function(n,i,r,e){var u=this.$o;if(!(n in u)){var s=this.Xr,h=this.na,o=this.ia;this.St<=h+i?(h=0,o=this.ia+this.fn+s,this.fn=r,this.ia=o):this.fn=Math.max(this.fn,r),this.na=h+i+s,u[n]=new t.Rectangle(h,o,i,r);var a=this.Qo;return this.ta+='<g transform="translate('.concat(h*a,",").concat(o*a,')">').concat(e,"</g>"),!0}return!1},n.prototype.has=function(t){return t in this.$o},Object.defineProperty(n.prototype,"mappings",{get:function(){return this.build()},enumerable:!1,configurable:!0}),n.prototype.build=function(n){var i,r,e,u=this.ra;if(null==u||(null==n?void 0:n.force)){var s=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1,h=this.St,o=Math.pow(2,Math.ceil(Math.log(this.ia+this.fn)/Math.LN2)),a=h*s,c=o*s,f=this.Qo,l='width="'.concat(a,'"'),v='height="'.concat(c,'"'),b='viewBox="0 0 '.concat(h*f," ").concat(o*f,'"'),d=Iv("<svg ".concat(l," ").concat(v," ").concat(b," ").concat('xmlns="http://www.w3.org/2000/svg"',">").concat(this.ta,"</svg>")),g=null!==(e=null==n?void 0:n.scaling)&&void 0!==e?e:t.SCALE_MODES.NEAREST,m=t.BaseTexture.from(d,{resolution:s,scaleMode:g}),w=this.$o;for(var p in u=this.ra={},w)u[p]=new t.Texture(m,w[p])}return u},n}(),ub=function(){function n(){}return n.toTexture=function(n,i,r,e){var u=n.transform.scale,s=t.RenderTexture.create({width:n.width*u.x,height:n.height*u.y,scaleMode:t.SCALE_MODES.LINEAR,resolution:i}),h=new t.Matrix(void 0,void 0,void 0,void 0,-n.position.x,-n.position.y),o=et.getLayer(n);return o&&o.renderer.render(n,s,r,h,e),s},n.toPixels=function(t,n){var i=t.resolution,r=t.frame,e=Math.floor(r.width*i),u=Math.floor(r.height*i),s=new Uint8Array(4*e*u);n.renderTexture.bind(t);var h=n.gl;return h.readPixels(r.x*i,r.y*i,e,u,h.RGBA,h.UNSIGNED_BYTE,s),{width:e,height:u,array:s}},n.toCanvas=function(n,i,r){var e=n.width,u=n.height,s=n.array,h=new t.utils.CanvasRenderTarget(e,u,1),o=h.context.getImageData(0,0,e,u);if(r?o.data.set(s):t.Extract.arrayPostDivide(s,o.data),h.context.putImageData(o,0,0),null!=i&&1!==i){h.context.scale(i,i),h.context.drawImage(h.canvas,0,0);var a=Math.floor(e*i),c=Math.floor(u*i),f=h.context.getImageData(0,0,a,c);h.resize(a,c),h.context.putImageData(f,0,0)}return h},n.toBase64=function(t,n,i){return t.toDataURL(n,i)},n}(),sb=function(){function t(){}return t.downloadUrl=function(t,n){var i=document.createElement("a");"download"in i?(i.href=n,i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),66)):window.open(n)||(location.href=n)},t.download=function(t,n,i){var r=new Blob(!1!==i?["\ufeff",n]:[n],{type:"text/plain"}),e=window.navigator;"msSaveBlob"in e?e.msSaveBlob(r,t):this.downloadUrl(t,URL.createObjectURL(r))},t}(),hb=function(){function t(){}return t.texture=function(t){var n,i=t.target,r=function(t){var n,i=t.target,r=t.resolution;if(null!=r){if(wn(r))return r;var e=i.transform.scale,u=Math.max(i.width*e.x,i.height*e.y);return Math.min(1,r.size/u)}return null!==(n=window.devicePixelRatio)&&void 0!==n?n:1}(t),e=null===(n=t.transform)||void 0===n?void 0:n.update;return ub.toTexture(i,r,t.clear,e)},t.pixels=function(t){var n=function(t){var n=t.renderer;if(n)return n;var i=t.application;if(i)return i.getLayerBase().renderer;var r=t.layer||et.getLayer(t.target);if(r)return r.renderer;throw new Error("No renderer / application / layer found.")}(t),i=this.texture(t);try{return ub.toPixels(i,n)}finally{i&&i.destroy()}},t.canvas=function(t){var n,i,r=this.pixels(t),e=null===(i=null===(n=t.alpha)||void 0===n?void 0:n.premultiplied)||void 0===i?void 0:i.ignore,u=function(t,n){var i=n.scale;if(null!=i){if(wn(i))return i;var r=i.size;return Math.min(1,r/t.width,r/t.height)}}(r,t);return ub.toCanvas(r,u,e)},t.base64=function(t){var n=this.canvas(t);try{return ub.toBase64(n.canvas,t.format,t.quality)}finally{n&&n.destroy()}},t.file=function(t){sb.downloadUrl(t.filename,this.base64(t))},t}(),ob={TEXT:0,DATA_URL:1,BINARY_STRING:2,ARRAY_BUTTER:3,FILE:4},ab=function(){function t(t,n){this.bh=null,this.ea=t,this.ua=n}return t.prototype.open=function(){var t=this.getOrCreateInput();null!=t?t.click():this.onCancel()},t.prototype.getOrCreateInput=function(){var t=this;if("FileReader"in window&&null==this.bh){var n=document.createElement("input");this.bh=n,n.setAttribute("type","file"),n.setAttribute("style","display:none"),n.addEventListener("change",(function(i){t.onInputChange(n),n.value="",i.stopImmediatePropagation(),i.preventDefault()})),document.body.appendChild(n)}return this.bh},t.prototype.onInputChange=function(t){var n=this,i=t.files;if(null!=i&&0<i.length){var r=i[0];if(this.ea===ob.FILE)this.onOpen(r,r);else{var e=new FileReader;switch(e.onload=function(t){if(null!=t.target){var i=t.target;n.onOpen(i.result,r)}},e.onabort=function(t){n.onAboart(t)},this.ea){case ob.TEXT:e.readAsText(r);break;case ob.DATA_URL:e.readAsDataURL(r);break;case ob.BINARY_STRING:e.readAsBinaryString(r);break;case ob.ARRAY_BUTTER:e.readAsArrayBuffer(r);break;default:e.readAsText(r)}}}else this.onCancel()},t.prototype.onOpen=function(t,n){var i=this.ua;i.emit("open",t,n,i)},t.prototype.onAboart=function(t){var n=this.ua;n.emit("abort",t,n)},t.prototype.onCancel=function(){var t=this.ua;t.emit("cancel",t)},t}(),cb=function(){function t(){}return t.fromRgb=function(t){var n=(16711680&t)>>16,i=(65280&t)>>8,r=255&t|0,e=Math.max(n,i,r),u=e-Math.min(n,i,r),s=0;return 0<u&&(n===e?s=60*(i-r)/u:i===e?s=60*(r-n)/u+120:r===e&&(s=60*(n-i)/u+240),s<0&&(s+=360)),[s,u/e*255,e]},t.toRgb=function(t,n,i){var r=i-n/255*i,e=i-r,u=0,s=0,h=0;return t<=60?(u=i,s=t/60*e+r,h=r):t<=120?(u=(120-t)/60*e+r,s=i,h=r):t<=180?(u=r,s=i,h=(t-120)/60*e+r):t<=240?(u=r,s=(240-t)/60*e+r,h=i):t<=300?(u=(t-240)/60*e+r,s=r,h=i):(u=i,s=r,h=(360-t)/60*e+r),(u=Math.max(0,Math.min(255,u)))<<16|(s=Math.max(0,Math.min(255,s)))<<8|Math.max(0,Math.min(255,h))},t}(),fb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.Wu),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.Wu),t.prototype.onElementDetached.call(this,n,i,r)},n.prototype.onInputKeyDown=function(t){Ki.isOkKey(t)&&this.ju.onEnter()},n}(uu),lb=function(){function t(){}return t.create=function(t){var n=this.Gt;return t in n?"".concat(t," ").concat(++n[t]):(n[t]=1,"".concat(t," 1"))},t.Gt={},t}(),vb=function(){function t(){}return t.toCode=function(t,n){var i=t>>8&255,r=255&t;return"rgba(".concat(t>>16&255,",").concat(i,",").concat(r,",").concat(n,")")},t}(),bb=function(){function t(t,n,i){var r=this;this.sa=new Set,this.Mt=t,this.ha=n,this.oa=i,this.aa=null,this.ca=function(){r.update()}}return t.prototype.start=function(){return null==this.aa&&(this.aa=window.setTimeout(this.ca,this.ha)),this},t.prototype.stop=function(){var t=this.aa;return null!=t&&(this.aa=null,clearTimeout(t)),this},t.prototype.add=function(t){return this.sa.add(t),t.state.set(this.Mt,this.isOn(Date.now())),this},t.prototype.remove=function(t){return!!this.sa.delete(t)&&(t.state.remove(this.Mt),!0)},t.prototype.contains=function(t){return this.sa.has(t)},t.prototype.clear=function(){return this.sa.clear(),this},t.prototype.isOn=function(t){return Math.floor(t/this.oa)%2==0},t.prototype.update=function(){var t=Date.now(),n=this.isOn(t),i=this.Mt;this.sa.forEach((function(t){t.state.set(i,n)}));var r=this.oa;return this.aa=window.setTimeout(this.ca,r-t%r),this},t}(),db=function(){function t(t){var n;this.Qn=null!==(n=null==t?void 0:t.duration)&&void 0!==n?n:300,this.nu=null,this.fa=0,this.la=null}return t.prototype.show=function(t,n){var i=this,r=this.la;null!=r&&clearTimeout(r);var e=this.nu;if(t!==e){var u=this.Qn,s=this.fa,h=Date.now(),o=s+u-h;!0===n||o<=0?this.update(h,t):this.la=window.setTimeout((function(){i.update(Date.now(),t)}),o)}},t.prototype.update=function(t,n){var i=this.nu;i!==n&&(this.fa=t,null!=i&&i.hide(),this.nu=n,null!=n&&n.show())},t.prototype.hide=function(){this.show(null)},t}(),gb=function(){function t(){this.va=null,this.ba=0,this.Bs=null,this.da=null}return t.prototype.getNames=function(){var t=this.ga;return null==t&&(t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DOMMouseScroll","MozMousePixelScroll"],this.ga=t),t},t.prototype.on=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.addEventListener(u,n,i)}},t.prototype.off=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.removeEventListener(u,n,i)}},t.prototype.getLineHeight=function(){if(null==this.Bs){var t=Y.getInstance().get("DBase");this.Bs=t.getLineHeight()}return this.Bs},t.prototype.getPageHeight=function(){return null==this.da&&(this.da=12*this.getLineHeight()),this.da},t.prototype.normalize=function(t){var n=0,i=0;if("detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(n=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(n=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(n=t.deltaX),0===i&&0===n)return null;var r=Math.max(Math.abs(i),Math.abs(n)),e=Date.now();this.ba+200<=e&&(this.va=null),this.ba=e;var u="mousewheel"===t.type&&r%120==0;(!this.va||r<this.va)&&(this.va=r,u&&(this.va/=40)),u&&(r/=40,n/=40,i/=40);var s=this.va;r=Math.floor(r/s),n=Math[1<=n?"floor":"ceil"](n/s),i=Math[1<=i?"floor":"ceil"](i/s);var h=t.deltaMode||0;if(0!==h){var o=1===h?this.getLineHeight():this.getPageHeight();r*=o,n*=o,i*=o}return{mode:h,delta:r,deltaX:n,deltaY:i,lowest:s}},t.getInstance=function(){return null==this.INSTANCE&&(this.INSTANCE=new t),this.INSTANCE},t}(),mb=function(t){function n(n){var i,r=this;return(r=t.call(this)||this).Zn=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,r.ti=!1,r.Ru=!1,r.ni=null==n?void 0:n.onTime,r.ri=null==n?void 0:n.onStart,r.ei=null==n?void 0:n.onEnd,r}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.Zn},set:function(t){this.Zn=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.Ru=!0,this.ti=t,this.onStart(t),this.Ru&&(this.onTime(t?1:0,t,0),this.Ru&&(this.onTime(t?0:1,t,0),this.Ru||this.onEnd(t)))},n.prototype.onStart=function(t){var n=this.ri;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ni;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.ei;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return this.Ru},n.prototype.isReverse=function(){return this.ti},n.prototype.stop=function(){this.Ru=!1},n.prototype.end=function(){if(this.Ru){this.Ru=!1;var t=this.ti,n=t?0:1;this.onTime(n,t,0),this.onEnd(t)}},n}(t.utils.EventEmitter),wb=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).ma=0,e.wa=0,e.pa=0,e.Oa=0,e.Da=null,e.us=null;var u=null==n?void 0:n.shift;return e.Ea=null!==(i=null==u?void 0:u.x)&&void 0!==i?i:0,e.Ma=null!==(r=null==u?void 0:u.y)&&void 0!==r?r:15,e.hs=function(){e.onPrerender()},e.Sa=function(){e.onPostrender()},e}return _(n,t),n.prototype.stop=function(){this.Oa=0,this.removeEventListeners(),t.prototype.stop.call(this)},n.prototype.addEventListeners=function(t){var n=et.getLayer(t);if(n){this.us=n;var i=n.renderer;i.on("prerender",this.hs),i.on("postrender",this.Sa)}},n.prototype.removeEventListeners=function(){var t=this.us;if(t){this.us=null;var n=t.renderer;n.off("prerender",this.hs),n.off("postrender",this.Sa)}},n.prototype.onStart=function(n){var i=this.Da=this.Zn;null!=i&&(this.Oa=0,this.removeEventListeners(),this.addEventListeners(i),n||(i.visible=!0),t.prototype.onStart.call(this,n))},n.prototype.onTime=function(n,i,r){if(null!=this.Da){var e=this.us;e?(this.Oa=n,t.prototype.onTime.call(this,n,i,r),e.update()):(this.Oa=n,t.prototype.onTime.call(this,n,i,r))}},n.prototype.onEnd=function(n){var i=this.Da;null!=i&&(this.removeEventListeners(),n&&(i.visible=!1),t.prototype.onEnd.call(this,n))},n.prototype.onPrerender=function(){var t=this.Da;if(null!=t){var n=this.Oa,i=t.unsafe.position;this.ma=i.x,this.wa=i.y,i.set(i.x-this.Ea*(1-n),i.y-this.Ma*(1-n)),this.pa=t.alpha,t.alpha=n}},n.prototype.onPostrender=function(){var t=this.Da;null!=t&&(t.unsafe.position.set(this.ma,this.wa),t.alpha=this.pa)},n}(sr),pb=function(){function t(t){var n,i,r,e;wn(t)?(this.top=t,this.right=t,this.bottom=t,this.left=t):null!=t?(this.top=null!==(n=t.top)&&void 0!==n?n:6,this.right=null!==(i=t.right)&&void 0!==i?i:6,this.bottom=null!==(r=t.bottom)&&void 0!==r?r:6,this.left=null!==(e=t.left)&&void 0!==e?e:6):(this.top=6,this.right=6,this.bottom=6,this.left=6)}return t.prototype.getTheme=function(){throw new Error("Not supported")},t.prototype.setTheme=function(t){throw new Error("Not supported")},t.prototype.getTop=function(){return this.left},t.prototype.getRight=function(){return this.right},t.prototype.getBottom=function(){return this.bottom},t.prototype.getLeft=function(){return this.left},t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r)},t}(),Ob=function(){function t(t){var n,i=t.root;this.Ta=i,this.fs=t.overlay,this.Vn=new pb(null==t?void 0:t.padding);var r=100,e=100;if(t)if(null!=t.width)r=t.width,e=null!=t.height?t.height:i.getBoundingClientRect().height;else if(null!=t.height)r=i.getBoundingClientRect().width,e=t.height;else{var u;r=(u=i.getBoundingClientRect()).width,e=u.height}else r=(u=i.getBoundingClientRect()).width,e=u.height;var s=null==t?void 0:t.background,h=0,o=!0;if(null!=s){var a=s.color;null!=a&&(h=a,o=!1)}var c=t.resolution,f=null!==(n=null==t?void 0:t.antialias)&&void 0!==n&&n;this.ja={width:r,height:e,autoStart:!1,backgroundColor:h,transparent:o,resolution:c,antialias:f}}return t.prototype.getRootElement=function(){return this.Ta},t.prototype.setRootElement=function(t,n){if(this.Ta!==t&&(this.Ta=t,!1!==n)){var i=t.getBoundingClientRect(),r=this.ja;r.width=i.width,r.height=i.height}return this},t.prototype.getWidth=function(){return this.ja.width},t.prototype.setWidth=function(t){return this.ja.width=t,this},t.prototype.getHeight=function(){return this.ja.height},t.prototype.setHeight=function(t){return this.ja.height=t,this},t.prototype.getPadding=function(){return this.Vn},t.prototype.setPadding=function(t,n,i,r){var e=this.Vn;return e.left=t,e.top=n,e.right=i,e.bottom=r,this},t.prototype.getBackgroundColor=function(){return this.ja.backgroundColor},t.prototype.setBackgroundColor=function(t){return this.ja.backgroundColor=t,this},t.prototype.getAntialias=function(){return this.ja.antialias},t.prototype.setAntialias=function(t){return this.ja.antialias=t,this},t.prototype.isOverlay=function(){return this.fs},t.prototype.getPixiApplicationOptions=function(){return this.ja},t}(),Db=function(){function t(){}return t.prototype.isStorable=function(){return!0},t.prototype.isClear=function(){return!1},t.prototype.isClean=function(){return!1},t.prototype.execute=function(){return!0},t.prototype.merge=function(t){return!1},t.prototype.isMerged=function(){return!1},t.prototype.redo=function(){return!0},t.prototype.undo=function(){return!0},t.prototype.destroy=function(){},t}(),Eb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(Db),Mb=function(t){function n(){var n=t.call(this)||this;return n._=0,n.Na=[],n}return _(n,t),n.prototype.last=function(){var t=this.Na,n=t.length;return 0<n?t[n-1]:null},n.prototype.push=function(t){this.merge(t),this.execute(t)},n.prototype.merge=function(t){var n=this.Na,i=t.isClear(),r=t.isStorable();if(i||r){var e=i?n.length:this._;0<e&&(this.remove(e),this._=0,this.emit("change",this)),this.cleanup()}var u=n.length;0<u&&t.merge(n[u-1])},n.prototype.execute=function(t){return this.emit("executing",t,this),t.execute()?this.onSuccess(t):this.onFail(t)},n.prototype.onSuccess=function(t){t.isStorable()&&(t.isMerged()||this.Na.push(t),t.isClean()||this.emit("dirty",this)),this.emit("change",this),this.emit("executed",t,this)},n.prototype.onFail=function(t){t.destroy(),this.emit("change",this)},n.prototype.cleanup=function(){var t=this.Na,n=t.length-100;if(0<n)for(var i=0;i<n;++i)t[i].destroy(),t.shift()},n.prototype.remove=function(t){var n=this.Na;if(0<t){var i=Math.max(0,n.length-t);if(0<(t=n.length-i)){for(var r=i,e=n.length;r<e;++r)n[r].destroy();return n.splice(i,n.length-i),!0}}return!1},n.prototype.size=function(){return this.Na.length},n.prototype.clear=function(){this.push(new Eb)},n.prototype.redo=function(){this.isRedoable()&&this.doRedo()},n.prototype.doRedo=function(){var t=this.Na;if(0<this._){var n=t[t.length-this._];this._-=1,this.emit("change",this),this.emit("redoing",n,this),!0===n.redo()?this.onRedoSuccess(n):this.onRedoFail(n)}},n.prototype.onRedoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("redoed",t,this)},n.prototype.onRedoFail=function(t){this.emit("change",this)},n.prototype.isRedoable=function(){return 0<this._},n.prototype.undo=function(){this.isUndoable()&&this.doUndo()},n.prototype.doUndo=function(){var t=this.Na;if(this._<t.length){var n=t[t.length-1-this._];this._+=1,this.emit("change",this),this.emit("undoing",n,this),!0===n.undo()?this.onUndoSuccess(n):this.onUndoFail(n)}},n.prototype.onUndoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("undoed",t,this)},n.prototype.onUndoFail=function(t){this.emit("change",this)},n.prototype.isUndoable=function(){return this._<this.Na.length},n}(t.utils.EventEmitter),Sb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t,n,i){var r=this;t.addEventListener("keydown",(function(t){r.emit("keydown",t);var e=i.get();if(null!=e)for(var u=e;null!=u;){if(r.hasOnKeyDown(u)&&u.onKeyDown(t))return;u=u.parent}if(Ki.isFocusKey(t)){var s=Ki.getFocusDirection(t),h=null!=e?i.find(e,!1,e.state.isFocusRoot||s,s):i.find(n,!1,!0,s);null!=h&&(i.focus(h),t.preventDefault(),t.stopImmediatePropagation())}})),t.addEventListener("keyup",(function(t){r.emit("keyup",t);var n=i.get();if(null!=n)for(var e=n;null!=e;){if(r.hasOnKeyUp(e)&&e.onKeyUp(t))return;e=e.parent}}))},n.prototype.hasOnKeyDown=function(t){return"onKeyDown"in t},n.prototype.hasOnKeyUp=function(t){return"onKeyUp"in t},n}(t.utils.EventEmitter),Tb=function(){function t(){}return t.getKeyboardController=function(){return null==this.KEYBOARD&&(this.KEYBOARD=new Sb),this.KEYBOARD},t.setKeyboardController=function(t){var n=this.KEYBOARD;return this.KEYBOARD=t,n},t.getCommandController=function(){return null==this.COMMAND&&(this.COMMAND=new Mb),this.COMMAND},t.setCommandController=function(t){var n=this.COMMAND;return this.COMMAND=t,n},t.getDocumentController=function(){if(null==this.DOCUMENT)throw new Error("Not supported");return this.DOCUMENT},t.setDocumentController=function(t){var n=this.DOCUMENT;return this.DOCUMENT=t,n},t}(),jb=function(n){function i(t,i){var r=n.call(this,i.getPixiApplicationOptions())||this;return r.Ia=null,r.Ca=null,r.xn=i,r.q=!1,r.Ao=!0,r.Aa=i.isOverlay(),r.Vn=i.getPadding(),r.Ra=i.getRootElement(),r.La=5,r.ya=r.newElementContainer(),r.application=t,r.ka=function(){null!=r.Ia&&r.render()},r.initStage(),r.initView(),r.initRootElement(),r.initFocusHandling(),r.initResizeHandling(),r.initWheelHandling(),r.initDoubleClickHandling(),r}return _(i,n),i.prototype.newElementContainer=function(){var t=document.createElement("div");return t.setAttribute("style","position: absolute; top: 0; left: 0; width: 0; height: 0;margin: 0; padding: 0; outline: none;"),t},i.prototype.initStage=function(){var t=this.stage;t.layer=this,t.application=this.application,t.interactive=!0},i.prototype.initView=function(){var t=this.view.style;t.position="absolute",t.top="0",t.left="0",t.width="100%",t.height="100%",t.display="block",t.outline="none",t.webkitTapHighlightColor="rgba(255,255,255,0)",t.webkitUserSelect="none",t.setProperty("-khtml-user-select","none"),t.setProperty("-moz-user-select","none"),t.setProperty("-ms-user-select","none"),t.userSelect="none"},i.prototype.initRootElement=function(){var t=this,n=this.view,i=this.Aa,r=this.Ra,e=this.ya,u=i?2:0,s=r.children;if(u<s.length){var h=s[u];r.insertBefore(n,h),r.insertBefore(e,h)}else r.appendChild(n),r.appendChild(e);if(i){var o=this.stage,a=o.onChildrenChange;o.onChildrenChange=function(){t.onStageDirty(),a.call(o)}}var c=r.style;r!==document.body&&"static"===window.getComputedStyle(r).position&&(c.position="relative"),c.margin="0",c.padding="0",c.overflow="hidden"},i.prototype.initFocusHandling=function(){var t=this.view,n=this.stage,i=this.getFocusController();t.setAttribute("tabindex","0"),Tb.getKeyboardController().init(t,n,i),this.renderer.plugins.interaction.on(Yi.down,(function(t){null!=t.target&&t.target!==n||i.clear()}))},i.prototype.initResizeHandling=function(){var t=this,n=function(){t.onResize()};window.addEventListener("resize",n),window.addEventListener("orientationchange",n)},i.prototype.onResize=function(){var t=this.Ra.getBoundingClientRect(),n=t.width,i=t.height;this.renderer.resize(n,i);for(var r=this.Vn,e=this.stage.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof $i&&h.onParentResize(n,i,r)}this.update()},i.prototype.initWheelHandling=function(){var n=new t.Point,i=gb.getInstance(),r=this.renderer.plugins.interaction;i.on(this.view,(function(t){var e=t;Yi.toGlobal(e,r,n);var u,s=r.hitTest(n),h=i.normalize(t);if(null!=h)for(;null!=s;){if(null!=(u=s)&&null!=u.onWheel&&s.onWheel(e,h,n)){e.preventDefault();break}s=s.parent}}))},i.prototype.initDoubleClickHandling=function(){var t=this.getFocusController(),n=this.renderer.plugins.interaction;Yi.onDblClick(this.view,(function(i){var r,e=t.get();if(null!=e)for(var u=e;null!=u&&(null==(r=u)||null==r.onDblClick||!u.onDblClick(i,n));)u=u.parent}))},i.prototype.lock=function(){this.q=!0},i.prototype.unlock=function(){this.q=!1},i.prototype.update=function(){this.q||null!=this.Ia||(this.Ia=requestAnimationFrame(this.ka))},i.prototype.onStageDirty=function(){this.Aa&&(0<this.stage.children.length?this.Ao||(this.Ao=!0,this.view.style.display="block"):this.Ao&&(this.Ao=!1,this.view.style.display="none"))},i.prototype.render=function(){this.reflow(),this.Ia=null,n.prototype.render.call(this)},Object.defineProperty(i.prototype,"width",{get:function(){return this.screen.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.screen.height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Vn},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){for(var t=this.stage.children,n=0,i=this.La;n<i;++n){for(var r=!1,e=0,u=t.length;e<u;++e){var s=t[e];s instanceof $i&&(s.reflow(),r=r||s.isDirty()||s.hasDirty()||s.isHierarchyDirty())}if(!r)break}},i.prototype.getFocusController=function(){return this.application.getFocusController()},i.prototype.getRootElement=function(){return this.Ra},i.prototype.getElementContainer=function(){return this.ya},i.prototype.getDynamicFontAtlases=function(){return null==this.Ca&&(this.Ca=new qv(this)),this.Ca},i}(t.Application),Nb=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.ls=null,n}return _(n,t),n.prototype.focus=function(t){var n=this.ls;return n!==t?(null!=n&&(n.state.isFocused=!1),this.ls=t,this.isFocusable(t)&&(t.state.isFocused=!0),this.emit("change",t,n,this),n):null},n.prototype.blur=function(t){return null!=t&&this.ls===t?(this.ls=null,t.state.isFocused=!1,this.emit("change",null,t,this),t):null},n.prototype.clear=function(){return this.focus(null)},n.prototype.set=function(t,n){return n?this.focus(t):this.blur(t)},n.prototype.get=function(){return this.ls},n.prototype.findParent=function(t){for(var n=t;null!=n;){if(this.isFocusable(n))return n;n=n.parent}return null},n.prototype.find=function(t,n,i,r,e){if(r){if(null!=(o=this.findNext(t,n,i)))return o;if(this.isFocusRoot(t,e))return null;var u=t.parent;if(null!=u&&0<=(c=(a=u.children).indexOf(t))){var s=a.length;if(this.isFocusReverse(u)){for(var h=c-1;0<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=s-1;c<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}else{for(h=c+1;h<s;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}}}else{var o;if(null!=(o=this.findPrevious(t,n,i)))return o;var a,c,f=t.parent;if(null!=f&&0<=(c=(a=f.children).indexOf(t)))if(s=a.length,this.isFocusReverse(f)){for(h=c+1;h<s;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}else{for(h=c-1;0<=h;--h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=s-1;c<=h;--h){var l;if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}}}return null},n.prototype.findNext=function(t,n,i){if(n&&this.isFocusable(t))return t;if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=e-1;0<=u;--u)if(null!=(s=this.findNext(r[u],!0,!0)))return s}else for(u=0;u<e;++u){var s;if(null!=(s=this.findNext(r[u],!0,!0)))return s}}return null},n.prototype.findPrevious=function(t,n,i){if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=0;u<e;++u)if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}else for(u=e-1;0<=u;--u){var s;if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}}return n&&this.isFocusable(t)?t:null},n.prototype.isFocusable=function(t){return null!=t&&"state"in t&&t.state.inEnabled&&t.state.isFocusable&&t.visible},n.prototype.isFocusableContainer=function(t){return null!=t&&"children"in t},n.prototype.isFocusRoot=function(t,n){return t===n||null!=t&&"state"in t&&t.state.isFocusRoot&&t.visible},n.prototype.isFocusReverse=function(t){return null!=t&&"state"in t&&t.state.isFocusReverse},n}(t.utils.EventEmitter),Ib=function(){function n(n){var i,r;et.add(this);var e=this.toRootElement(n);this.Ta=e,this.initFocusHandling(e);var u=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1;this.dn=u,delete t.Renderer.__plugins.accessibility,this.xn=n;var s=this.newLayerBase(n);this.Cr=s,this.xa=!!(null==n?void 0:n.overlay),this.xa||(this.fs=s)}return Object.defineProperty(n.prototype,"stage",{get:function(){return this.Cr.stage},enumerable:!1,configurable:!0}),n.prototype.getRootElement=function(){return this.Ta},n.prototype.getResolution=function(){return this.dn},n.prototype.toRootElement=function(t){var n=null==t?void 0:t.root;if(null!=n){if(!ct(n))return n;var i=document.querySelector(n);if(i)return i}return document.body},n.prototype.toLayerBaseOptions=function(t){var n=this.Ta,i=this.dn;return new Ob(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:t.background,resolution:i,antialias:t.antialias,overlay:!1}:{root:n,resolution:i,overlay:!1})},n.prototype.getFocusController=function(){return null==this.Ba&&(this.Ba=new Nb),this.Ba},n.prototype.initFocusHandling=function(t){var n=this,i=!1,r=function(){i||n.getFocusController().clear()};t.addEventListener("focus",(function(){i=!0}),!0),t.addEventListener("blur",(function(){i=!1,setTimeout(r,0)}),!0)},n.prototype.newLayerBase=function(t){return new jb(this,this.toLayerBaseOptions(t))},n.prototype.getLayerBase=function(){return this.Cr},n.prototype.toLayerOverlayOptions=function(t){var n=this.Ta,i=this.dn;return new Ob(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:{color:null},resolution:i,antialias:t.antialias,overlay:!0}:{root:n,resolution:i,overlay:!0})},n.prototype.newLayerOverlay=function(t){return new jb(this,this.toLayerOverlayOptions(t))},n.prototype.getLayerOverlay=function(){return this.xa?(null==this.fs&&(this.fs=this.newLayerOverlay(this.xn)),this.fs):this.Cr},n.prototype.update=function(){if(!this.xa)return this.Cr.update();this.Cr.update();var t=this.fs;t&&t.update()},n.prototype.render=function(){if(!this.xa)return this.Cr.render();this.Cr.render();var t=this.fs;t&&t.render()},n}(),Cb=function(){function t(t){this.Zn=t,this.sn=0,this.hn=0,this.an=0,this.un=0,t instanceof Ii&&(this.nn=t.getCallback())}return t.prototype.getTheme=function(){return this.Zn.getTheme()},t.prototype.setTheme=function(t){this.Zn.setTheme(t)},t.prototype.getLeft=function(){return this.Zn.getLeft()+this.un},t.prototype.adjLeft=function(t){if(this.un!==t){this.un=t;var n=this.nn;n&&n()}},Object.defineProperty(t.prototype,"left",{get:function(){return this.Zn.left},set:function(t){this.Zn.left=t},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){return this.Zn.getTop()+this.sn},t.prototype.adjTop=function(t){if(this.sn!==t){this.sn=t;var n=this.nn;n&&n()}},Object.defineProperty(t.prototype,"top",{get:function(){return this.Zn.top},set:function(t){this.Zn.top=t},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){return this.Zn.getRight()+this.hn},t.prototype.adjRight=function(t){if(this.hn!==t){this.hn=t;var n=this.nn;n&&n()}},Object.defineProperty(t.prototype,"right",{get:function(){return this.Zn.right},set:function(t){this.Zn.right=t},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){return this.Zn.getBottom()+this.an},t.prototype.adjBottom=function(t){if(this.an!==t){this.an=t;var n=this.nn;n&&n()}},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.Zn.bottom},set:function(t){this.Zn.bottom=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){var e=this.Zn;null==n?e.set(t):null==i?e.set(t,n):null==r?e.set(t,n,i):e.set(t,n,i,r)},t}(),Ab=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DBoard"},n}($i),Rb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheck"},n}(gs),Lb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheckRight"},n}(Rb),yb=function(){function t(t,n,i,r,e){this.S=t,this.T=n,this._=i,this.nn=e,this.Pa=r}return t.prototype.set=function(t,n,i,r){this.S===t&&this.T===n&&this._===i&&this.Pa===r||(this.S=t,this.T=n,this._=i,this.Pa=r,this.nn(this))},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.nn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.nn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._},set:function(t){this._!==t&&(this._=t,this.nn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this.Pa},set:function(t){this.Pa!==t&&(this.Pa=t,this.nn(this))},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){return{color:this.S,alpha:this.T,position:this._}},t}(),kb=function(t,n){return t.position-n.position},xb=function(n){function i(){var t=n.call(this)||this,i=function(n){t.onChange(n)};t.Ua=i;var r=new yb(16777215,1,0,!1,i),e=new yb(8421504,1,1,!0,i);return t.gt=[r,e],t.Yt=-90,t.Pa=e,t.Fa=[0,0,0],t}return _(i,n),i.prototype.onChange=function(t){var n=t.selected&&this.Pa!==t;if(n){var i=this.Pa;null!=i&&(i.Pa=!1),this.Pa=t}this.gt.sort(kb),n&&this.emit("selectionchange",this.Pa,this),this.emit("change",this)},Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"direction",{get:function(){return this.Yt},set:function(t){this.Yt!==t&&(this.Yt=t,this.emit("directionchange",t,this),this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selected",{get:function(){return this.Pa},enumerable:!1,configurable:!0}),i.prototype.size=function(){return this.gt.length},i.prototype.get=function(t){var n=this.gt;return 0<=t&&t<n.length?n[t]:null},i.prototype.addAt=function(n){for(var i=this.gt,r=null,e=0,u=i.length;e<u;++e){var s=i[e];if(n<=s.position){if(null==r)return this.add(s.color,s.alpha,n,!0);var h=s.position-r.position;if(.001<h){var o=t.utils.hex2rgb(s.color,this.Fa),a=o[0],c=o[1],f=o[2],l=t.utils.hex2rgb(r.color,this.Fa),v=l[0],b=l[1],d=l[2],g=(n-r.position)/h,m=a*g+v*(1-g),w=c*g+b*(1-g),p=f*g+d*(1-g),O=this.Fa;O[0]=m,O[1]=w,O[2]=p;var D=t.utils.rgb2hex(O),E=s.alpha*g+r.alpha*(1-g);return this.add(D,E,n,!0)}}r=s}return null!=r?this.add(r.color,r.alpha,n,!0):this.add(16777215,1,n,!0)},i.prototype.add=function(t,n,i,r){var e=this.Ua,u=new yb(t,n,i,r,e);return this.gt.push(u),e(u),u},i.prototype.remove=function(t){var n=this.gt;if(2<n.length)for(var i=0,r=n.length;i<r;++i)if(n[i]===t){n.splice(i,1);var e=this.Pa===t;return e&&(this.Pa=i+1<r?n[i]:n[i-1]),e&&this.emit("selectionchange",this.Pa,this),this.emit("change",this),!0}return!1},i.prototype.reset=function(){var t=this.Yt;this.Yt=-90;var n=this.gt,i=this.Pa,r=i?n.indexOf(i):-1;n.length=0;var e=this.Ua;if(n.push(new yb(16777215,0,0,!1,e)),n.push(new yb(16777215,0,1,!1,e)),0<=r&&r<n.length)(u=n[r]).Pa=!0,this.Pa=u;else if(0<n.length){var u;(u=n[n.length-1]).Pa=!0,this.Pa=u}else this.Pa=null;return i!==this.Pa&&this.emit("selectionchange",this.Pa,this),t!==this.Yt&&this.emit("directionchange",this.Yt,this),this.emit("change",this),this},i.prototype.toObject=function(){for(var t=[],n=this.gt,i=0,r=n.length;i<r;++i)t.push(n[i].toObject());return{points:t,direction:this.Yt}},i.prototype.fromObject=function(t){var n=this.Yt;this.Yt=t.direction;var i=this.gt,r=this.Pa,e=r?i.indexOf(r):-1;i.length=0;for(var u=this.Ua,s=0,h=t.points.length;s<h;++s){var o=t.points[s],a=new yb(o.color,o.alpha,o.position,!1,u);i.push(a)}return i.sort(kb),0<=e&&e<i.length?((a=i[e]).Pa=!0,this.Pa=a):0<i.length?((a=i[i.length-1]).Pa=!0,this.Pa=a):this.Pa=null,r!==this.Pa&&this.emit("selectionchange",this.Pa,this),n!==this.Yt&&this.emit("directionchange",this.Yt,this),this.emit("change",this),this},i}(t.utils.EventEmitter),Bb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputLabel"},n}(Qs),_b=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.Lh=new Bb(null==n?void 0:n.label)),i.addChild(i.bh=i.createInput(null==n?void 0:n.input));var r=null==n?void 0:n.space;return null!=r&&i.addChild(new Pu(r)),i}return _(n,t),Object.defineProperty(n.prototype,"input",{get:function(){return this.bh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"label",{get:function(){return this.Lh},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputAndLabel"},n}(ps),Pb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new Gs(t)},n}(_b),Ub=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new Vs(t)},n}(_b),Fb=function(){function t(t,n,i){this.Ga=t,this.Ha=n,this.za=i}return Object.defineProperty(t.prototype,"color",{get:function(){return this.Ga.color},set:function(t){if(this.Ga.color!==t){var n=this.Ha;null!=n&&n(t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.Ga.alpha},set:function(t){if(this.Ga.alpha!==t){var n=this.za;null!=n&&n(t)}},enumerable:!1,configurable:!0}),t}(),Gb=function(t){function n(n,i){var r=t.call(this)||this;return r.Va=n,r.yt=i,r}return _(n,t),n.prototype.get=function(t){var n=this.Va;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.Va;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]={color:n.color,alpha:n.alpha},this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.Va,i=0,r=n.length;i<r;++i){var e=n[i];if(e.color===t.color&&e.alpha===t.alpha)return!0}return!1},n.prototype.add=function(t){var n=this.Va;return n.push({color:t.color,alpha:t.alpha}),this.yt<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.Va.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.Va.length},n}(t.utils.EventEmitter),Hb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),Object.defineProperty(i.prototype,"current",{get:function(){return this.Wa},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"new",{get:function(){return this.Xa},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.Ka},enumerable:!1,configurable:!0}),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r),this.Cr=16711680,this.Ya={color:16777215,alpha:1},this.Xa=new Fb(this.Ya,(function(t){e.setColorNew(t)}),(function(t){e.setAlphaNew(t)})),this.nu={color:16777215,alpha:1},this.Wa=new Fb(this.nu,(function(t){e.setColorCurrent(t)}),(function(t){e.setAlphaCurrent(t)}));var u=this.theme,s=this.Vn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.Ja=new t.Point;var f=u.getMainWidth(),l=u.getMainHeight(),v=new t.Sprite(t.Texture.WHITE);this.Za=v,v.x=c,v.y=h,v.width=f,v.height=l,v.interactive=!0,this.addChild(v);var b=new t.Sprite(u.getMainTexture());this.qa=b,b.x=c,b.y=h,b.tint=this.Cr,b.interactive=!1,this.addChild(b),this.Qa=function(t){e.onMainMove(t)},this.$a=function(t){e.onMainUp(t)},v.on(Yi.down,(function(t){e.onMainDown(t)}));var d=new t.Sprite(u.getBaseTexture());this.tc=d,d.x=c,d.y=v.y+v.height+u.getBaseMargin(),d.interactive=!0,this.addChild(d),this.nc=function(t){e.onBaseMove(t)},this.ic=function(t){e.onBaseUp(t)},d.on(Yi.down,(function(t){e.onBaseDown(t)}));var g=new t.Sprite(u.getAlphaCheckerboardTexture());this.rc=g,g.x=s.getLeft(),g.y=d.y+u.getBaseHeight()+u.getBaseMargin(),g.interactive=!1,this.addChild(g);var m=new t.Sprite(u.getAlphaTexture());m.tint=this.Ya.color,m.interactive=!0,g.addChild(m),this.ec=function(t){e.onAlphaMove(t)},this.uc=function(t){e.onAlphaUp(t)},m.on(Yi.down,(function(t){e.onAlphaDown(t)}));var w=new t.Sprite(u.getMainPointerTexture());this.sc=w,w.x=c,w.y=h,w.anchor.x=.5,w.anchor.y=.5,w.tint=u.getMainPointerColor(),w.alpha=u.getMainPointerAlpha(),w.interactive=!1,this.addChild(w);var p=new t.Sprite(u.getAlphaPointerTexture());this.hc=p,p.x=f,p.y=.5*g.height,p.tint=u.getAlphaPointerColor(),p.alpha=u.getAlphaPointerAlpha(),p.anchor.set(.5,.5),p.interactive=!1,g.addChild(p);var O=new t.Sprite(u.getBasePointerTexture());this.oc=O,O.x=0,O.y=.5*d.height,O.tint=u.getBasePointerColor(),O.alpha=u.getBasePointerAlpha(),O.anchor.set(.5,.5),O.interactive=!1,d.addChild(O),this.ac=[];var D=this.ac,E=u.getRecentColorCount(),M=u.getRecentColorWidth(),S=u.getRecentColorHeight(),T=.5*M,j=.5*S,N=u.getRecentColorMargin(),I=g.y+u.getAlphaHeight()+u.getRecentMargin(),C=u.getRecentCheckerboardTexture();null==i.RECENT_COLORS&&(i.RECENT_COLORS=new Gb(u.getRecents().slice(0),E));var A=this.Ka=i.RECENT_COLORS;A.on("change",(function(){e.onRecentChange()}));for(var R=function(n){var i=n.currentTarget;if(i instanceof t.Container){var r=i.children[0];r instanceof t.Sprite&&(e.setColorNew(r.tint),e.setAlphaNew(r.alpha))}},L=0;L<E;++L){var y=c+L*(M+N),k=new t.Sprite(C);k.x=y+T,k.y=I+j,k.anchor.x=.5,k.anchor.y=.5,k.buttonMode=!0,k.interactive=!0,k.on(Yi.tap,R),this.addChild(k);var x=new t.Sprite(t.Texture.WHITE),B=A.get(L);null!=B?(x.tint=B.color,x.alpha=B.alpha):(x.tint=16777215,x.alpha=0),x.width=M,x.height=S,x.anchor.x=.5,x.anchor.y=.5,x.interactive=!1,k.addChild(x),D.push(x)}var _=u.getInputMargin(),P=u.getInputLabelWidth(),U=I+S+_,F=.5*(f-_),G=new Ub({parent:this,x:c,y:U,width:F,label:{width:P,text:{value:"#"},interactive:ji.NONE},input:{weight:1,text:{value:"FFFFFF"},on:{input:function(t){var n=$t.fromCode(t);null!=n&&e.setColorNew(n)}}}});this.cc=G;var H=G.height,z=new Pb({parent:this,x:c,y:U+H+_,width:F,label:{width:P,text:{value:"A"},interactive:ji.NONE},input:{weight:1,text:{value:1},min:0,max:1,on:{input:function(t){e.setAlphaNew(t)}}}});this.fc=z;var V=.5*(F-P-_),W=H+_+H,X=c+.5*(f-_)+_,K=U+.5*(H+_+z.height-W),Y=new t.Sprite(u.getSampleCheckerboardTexture());this.lc=Y,Y.x=X,Y.y=K,Y.width=V,Y.height=W,Y.interactive=!1,this.addChild(Y);var J=this.nu,Z=new t.Sprite(t.Texture.WHITE);this.vc=Z,Z.x=X,Z.y=K,Z.tint=J.color,Z.alpha=J.alpha,Z.width=V,Z.height=W,Z.interactive=!0,Z.buttonMode=!0,Z.on(Yi.tap,(function(){e.setColorNew(J.color),e.setAlphaNew(J.alpha)})),this.addChild(Z);var q=new t.Sprite(u.getSampleCheckerboardTexture());this.bc=q,q.x=X+V,q.y=K,q.width=V,q.height=W,q.interactive=!1,this.addChild(q);var Q=new t.Sprite(t.Texture.WHITE);this.dc=Q,Q.x=X+V,Q.y=K,Q.tint=this.Ya.color,Q.alpha=this.Ya.alpha,Q.width=V,Q.height=W,Q.interactive=!1,this.addChild(Q),null!=r&&null!=r.width||(this.width=c+f+o),null!=r&&null!=r.height||(this.height=U+G.height+_+z.height+a)},i.prototype.onMainDown=function(t){this.onMainPick(t.data.global);var n=et.getLayer(this);if(n){var i=n.stage;i.on(Yi.move,this.Qa),i.on(Yi.up,this.$a)}},i.prototype.onMainMove=function(t){this.onMainPick(t.data.global)},i.prototype.onMainUp=function(t){var n=et.getLayer(this);if(n){var i=n.stage;i.off(Yi.move,this.Qa),i.off(Yi.up,this.$a)}},i.prototype.toMainHex=function(t,n,i,r){return Math.max(0,Math.min(255,255*n+i*(t>>r&255)))<<r},i.prototype.toMainColor=function(t,n,i,r,e){var u=.5*r,s=Math.max(0,Math.min(1,((n-u)*(1-i/e)+u)/r)),h=Math.max(0,Math.min(1,i/e)),o=Math.abs(.5*h-s),a=1-o-h;return this.toMainHex(t,a,o,16)|this.toMainHex(t,a,o,8)|this.toMainHex(t,a,o,0)},i.prototype.onMainPick=function(t){var n=this.Ja,i=this.Vn,r=i.getLeft(),e=i.getTop(),u=this.theme,s=u.getMainWidth(),h=u.getMainHeight();this.toLocal(t,void 0,n);var o=Math.max(0,Math.min(s,n.x-r)),a=Math.max(0,Math.min(h,n.y-e));this.sc.position.set(r+o,e+a),this.onColorNew(this.toMainColor(this.Cr,o,a,s,h))},i.prototype.setColorCurrent=function(t){this.vc.tint=this.nu.color=t},i.prototype.setAlphaCurrent=function(t){this.vc.alpha=this.nu.alpha=t},i.prototype.setColorNew=function(t){var n=this.theme,i=n.getMainWidth(),r=n.getMainHeight(),e=this.Vn,u=cb.fromRgb(t);this.qa.tint=this.Cr=cb.toRgb(u[0],255,255),this.oc.x=Math.max(0,Math.min(1,u[0]/360))*i;var s=Math.max(0,Math.min(1,u[1]/255)),h=Math.max(0,Math.min(1,1-u[2]/255)),o=this.sc;o.tint=h<.45?n.getMainPointerColor():16777215,o.position.set(e.getLeft()+s*i,e.getTop()+h*r),this.onColorNew(t)},i.prototype.onColorNew=function(t){var n=et.getLayer(this);n&&n.lock(),this.dc.tint=this.Ya.color=t,this.cc.input.value=$t.toCode(t),this.emit("newcolorchange",t,this),n&&(n.unlock(),n.update())},i.prototype.onBaseDown=function(t){this.onBasePick(t.data.global);var n=et.getLayer(this);if(n){var i=n.stage;i.on(Yi.move,this.nc),i.on(Yi.up,this.ic)}},i.prototype.onBaseMove=function(t){this.onBasePick(t.data.global)},i.prototype.onBaseUp=function(t){var n=et.getLayer(this);if(n){var i=n.stage;i.off(Yi.move,this.nc),i.off(Yi.up,this.ic)}},i.prototype.toBaseHex=function(t,n){return Math.max(0,Math.min(255,6*t*255))<<n},i.prototype.toBaseColor=function(t){return t<=.167?16711680+this.toBaseHex(t,8):t<=.333?(t=.333-t,65280+this.toBaseHex(t,16)):t<=.5?(t-=.333,65280+this.toBaseHex(t,0)):t<.667?(t=.667-t,255+this.toBaseHex(t,8)):t<.883?(t-=.667,255+this.toBaseHex(t,16)):(t=.883-t,16711680+this.toBaseHex(t,0))},i.prototype.onBasePick=function(t){var n=this.Ja,i=this.Vn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.oc.x=e,this.onColorBase(this.toBaseColor(e/r))},i.prototype.setColorBase=function(t){var n=this.theme.getMainWidth();this.oc.x=Math.max(0,Math.min(1,t/360))*n,this.onColorBase(cb.toRgb(t,255,255))},i.prototype.onColorBase=function(t){this.qa.tint=this.Cr=t;var n=this.sc,i=this.theme,r=i.getMainWidth(),e=i.getMainHeight(),u=this.Vn;this.onColorNew(this.toMainColor(this.Cr,n.x-u.getLeft(),n.y-u.getTop(),r,e))},i.prototype.onAlphaDown=function(t){this.onAlphaPick(t.data.global);var n=et.getLayer(this);if(n){var i=n.stage;i.on(Yi.move,this.ec),i.on(Yi.up,this.uc)}},i.prototype.onAlphaMove=function(t){this.onAlphaPick(t.data.global)},i.prototype.onAlphaUp=function(t){var n=et.getLayer(this);if(n){var i=n.stage;i.off(Yi.move,this.ec),i.off(Yi.up,this.uc)}},i.prototype.onAlphaPick=function(t){var n=this.Ja,i=this.Vn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.hc.x=e,this.onAlphaNew(e/r)},i.prototype.setAlphaNew=function(t){var n=this.theme.getMainWidth();this.hc.x=Math.max(0,Math.min(1,t))*n,this.onAlphaNew(t)},i.prototype.onAlphaNew=function(t){var n=et.getLayer(this);n&&n.lock(),this.dc.alpha=this.Ya.alpha=t,this.fc.input.value=Number(t.toFixed(2)),this.emit("newalphachange",t,this),n&&(n.unlock(),n.update())},i.prototype.onRecentChange=function(){for(var t=this.ac,n=this.Ka,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(i);null!=u?(e.tint=u.color,e.alpha=u.alpha):(e.tint=16777215,e.alpha=0)}},i.prototype.getType=function(){return"DPickerColor"},i.RECENT_COLORS=null,i}($i),zb=function(t,n){if(t.direction!==n.direction)return!1;var i=t.points,r=n.points;if(i.length!==r.length)return!1;for(var e=0,u=i.length;e<u;++e){var s=i[e],h=r[e];if(s.color!==h.color||s.alpha!==h.alpha||s.position!==h.position)return!1}return!0},Vb=function(t){function n(n,i){var r=t.call(this)||this;return r.Va=n,r.yt=i,r}return _(n,t),n.prototype.getCapacity=function(){return this.yt},n.prototype.get=function(t){var n=this.Va;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.Va;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]=n,this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.Va,i=0,r=n.length;i<r;++i)if(zb(n[i],t))return!0;return!1},n.prototype.add=function(t){var n=this.Va;return n.push(t),this.yt<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.Va.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.Va.length},n}(t.utils.EventEmitter),Wb=function(n){function i(i,r,e,u,s,h,o,a){var c=n.call(this,o,a)||this;return c.interactive=!0,c.interactiveChildren=!1,c.cursor="pointer",c.gc=i,c.mn=r,c._uvs=e,c.mc=u,c.On=s,c.wc=-1,c.Fa=[0,0,0],c.Oc=new t.Point,c.Dc=h,a.uniforms.uSampler.on("update",(function(){c.update(),et.update(c)})),c.update(),c}return _(i,n),i.prototype.getRectangle=function(t){var n=this.Dc;return 0<=t&&t<n.length?n[t].rect:null},i.prototype.setRectangle=function(t,n,i,r,e){var u=this.Dc;if(0<=t&&t<u.length){var s=u[t].rect;s.x=n,s.y=i,s.width=r,s.height=e}},i.prototype.getData=function(t){var n=this.Dc;return 0<=t&&t<n.length?n[t].data:null},i.prototype.setData=function(t,n){var i=this.Dc;0<=t&&t<i.length&&(i[t].data=n)},i.prototype.getLastHitIndex=function(){return this.wc},i.prototype.setColors=function(t,n,i,r){n[t+0]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=r,n[t+4]=i[0],n[t+5]=i[1],n[t+6]=i[2],n[t+7]=r},i.prototype.setColorsHex=function(n,i,r,e){var u=t.utils.hex2rgb(r,this.Fa);this.setColors(n,i,u,e)},i.prototype.setColorsWhite=function(t,n){var i=this.Fa;i[0]=1,i[1]=1,i[2]=1,this.setColors(t,n,i,0)},i.prototype.setColorsPoint=function(t,n,i,r){var e=n.points[i];null!=e?this.setColorsHex(t,r,e.color,e.alpha):this.setColorsWhite(t,r)},i.prototype.setVertices=function(t,n,i,r){var e=r.y+r.height*i;n[t+0]=r.x,n[t+1]=e,n[t+2]=r.x+r.width,n[t+3]=e},i.prototype.setUvs=function(t,n,i,r){var e=r.x0+(r.x3-r.x0)*i,u=r.y0+(r.y3-r.y0)*i,s=r.x1+(r.x2-r.x1)*i,h=r.y1+(r.y2-r.y1)*i;n[t+0]=e,n[t+1]=u,n[t+2]=s,n[t+3]=h},i.prototype.newIndices=function(t,n,i,r){for(var e=0;e<i;++e)r[t+0]=n+0,r[t+1]=n+1,r[t+2]=n+2,r[t+3]=n+2,r[t+4]=n+1,r[t+5]=n+3,t+=6,n+=2;return r},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,n=this.Dc[0].rect,i=this._bounds,r=this.Oc;r.set(n.x,n.y),t.apply(r,r),i.addPoint(r),r.set(n.x+n.width,n.y+n.height),t.apply(r,r),i.addPoint(r)},i.prototype.update=function(){var t=this.mn,n=this._uvs,i=this.mc,r=this.On,e=this.shader.uniforms.uSampler;null==e._uvs&&e.updateUvs();for(var u=e._uvs,s=0,h=0,o=0,a=0,c=this.Dc,f=0,l=c.length;f<l;++f){var v=c[f].data,b=c[f].rect;if(null==v)this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsWhite(o,i),this.setVertices(s+4,t,1,b),this.setUvs(s,n,1,u),this.setColorsWhite(o+8,i),this.newIndices(a,h,1,r),s+=8,o+=16,h+=4,a+=6;else{this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsPoint(o,v,0,i),s+=4,o+=8;for(var d=v.points.length,g=0,m=Math.min(d,this.gc);g<m;++g){var w=v.points[g];this.setVertices(s,t,w.position,b),this.setUvs(s,n,w.position,u),this.setColorsHex(o,i,w.color,w.alpha),s+=4,o+=8}this.setVertices(s,t,1,b),this.setUvs(s,n,1,u),this.setColorsPoint(o,v,d-1,i),s+=4,o+=8,this.newIndices(a,h,d+1,r),a+=6*(d+1),h+=2*(d+2)}}this.size=a;var p=this.geometry;p.getBuffer("aPosition").update(),p.getBuffer("aUv").update(),p.getBuffer("aColor").update(),p.getIndex().update()},i.prototype.containsPoint=function(t){for(var n=this.toLocal(t,void 0,this.Oc),i=this.Dc,r=0,e=i.length;r<e;++r)if(i[r].rect.contains(n.x,n.y))return this.wc=r,!0;return!1},i.from=function(n,r,e,u){void 0===u&&(u=t.Texture.WHITE);for(var s=new Float32Array(n*(r+2)*2*2),h=new Float32Array(n*(r+2)*2*2),o=new Float32Array(n*(r+2)*2*4),a=new Uint16Array(n*(r+1)*6),c=[],f=0;f<n;++f)c.push({data:null,rect:new t.Rectangle});return new i(r,s,h,o,a,c,(new t.Geometry).addIndex(new t.Buffer(a,!1,!0)).addAttribute("aPosition",new t.Buffer(s,!1,!1),2).addAttribute("aUv",new t.Buffer(h,!1,!1),2).addAttribute("aColor",new t.Buffer(o,!1,!1),4),t.Shader.from("\nattribute vec2 aPosition;\nattribute vec2 aUv;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\n\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nvoid main(void) {\n\tvec3 position = vec3(aPosition.x, aPosition.y, 1.0);\n\tgl_Position = vec4((projectionMatrix * translationMatrix * position).xy, 0.0, 1.0);\n\tvUv = aUv;\n\tvColor = aColor;\n}\n","\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform vec2 uCheckerColors;\n\nvoid main(void) {\n\tvec4 texture = texture2D(uSampler, vUv);\n\tfloat cy = step( 1.0, mod( gl_FragCoord.y / 10.0, 2.0 ) );\n\tfloat cx = step( 1.0, mod( gl_FragCoord.x / 10.0 + cy, 2.0 ) );\n\tfloat c = mix( uCheckerColors.x, uCheckerColors.y, cx );\n\tgl_FragColor = texture * vec4( mix( vec3( c ), vColor.xyz, vColor.a ), 1.0 );\n}",{uSampler:u,uCheckerColors:e}))},i}(t.Mesh),Xb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r);var u=this.theme,s=this.Vn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.du=new t.Point;var f=u.getGradientPointsWidth(),l=u.getGradientPointsMargin(),v=new Hb({x:c+f+l,y:h});this.yh=v,v.on("newcolorchange",(function(t){e.onAnchorColorChange(t)})),v.on("newalphachange",(function(t){e.onAnchorAlphaChange(t)})),this.addChild(v);var b=this.er=Wb.from(17,10,u.getGradientCheckerColors());b.setRectangle(0,c,h,f,v.height),this.addChild(b),b.on(Yi.down,(function(t){0===b.getLastHitIndex()&&e.onViewDown(t)})),this.Ec=function(t){e.onAnchorDown(t)},this.Mc=function(t){e.onAnchorMove(t)},this.Sc=function(t){e.onAnchorUp(t)},this.Tc=[];var d=u.getGradientRecentColumn(),g=u.getGradientRecentWidth(),m=u.getGradientRecentMargin(),w=g+m,p=v.theme.getInputLabelWidth(),O=g*d+m*(d-1),D=u.getGradientDirectionMargin(),E=u.getGradientDirectionTexture(),M=v.x+v.width+D,S=new Gs({parent:this,x:M+p+5,y:h,width:O-2*(p+5),step:1,image:{source:E,align:{with:Yu.BORDER},margin:{horizontal:-E.width-5}},on:{change:function(t){e.Rt.Yt=t}}}),T=M,j=S.y+S.height+D;null==i.RECENT_COLOR_GRADIENT&&(i.RECENT_COLOR_GRADIENT=new Vb(u.getGradientRecents(),u.getGradientRecentCount())),this.Ka=i.RECENT_COLOR_GRADIENT;for(var N=this.Ka,I=0,C=N.getCapacity();I<C;++I){var A=T+I%d*w,R=j+(I/d|0)*w;b.setRectangle(1+I,A,R,g,g)}N.on("change",(function(){e.onRecentUpdate()})),b.on(Yi.tap,(function(t){var n=b.getLastHitIndex();1<=n&&e.onRecentClick(b.getData(n))}));var L=new xb;this.Rt=L,L.on("change",(function(){e.updateAnchors(),b.update()})),L.on("selectionchange",(function(t){e.onAnchorSelect(t)})),L.on("directionchange",(function(t){S.value=t})),b.setData(0,L),b.update(),S.value=L.direction,this.updateAnchors();var y=L.selected;null!=y&&this.onAnchorSelect(y),null!=r&&null!=r.width||(this.width=c+f+l+v.width+D+(d-1)*m+d*g+o),null!=r&&null!=r.height||(this.height=h+v.height+a)},Object.defineProperty(i.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.Ka},enumerable:!1,configurable:!0}),i.prototype.onRecentClick=function(t){var n=this.Rt;null!=t?n.fromObject(t):n.reset()},i.prototype.onRecentUpdate=function(){for(var t=this.Ka,n=this.er,i=0,r=t.size();i<r;++i)n.setData(1+i,t.get(i));n.update(),et.update(this)},i.prototype.toAnchorPosition=function(t){var n=this.toLocal(t.data.global,void 0,this.du);return Math.max(0,Math.min(1,(n.y-this.padding.getTop())/this.yh.height))},i.prototype.onViewDown=function(t){this.Rt.addAt(this.toAnchorPosition(t)),this.onAnchorDragStart()},i.prototype.onAnchorDown=function(n){var i=n.target;if(i instanceof t.Sprite){var r=this.Rt,e=this.Tc.indexOf(i);0<=e&&e<r.points.length&&(r.points[e].selected=!0,this.onAnchorDragStart())}},i.prototype.onAnchorSelect=function(t){var n=this.yh;n.current.color=t.color,n.current.alpha=t.alpha,n.new.color=t.color,n.new.alpha=t.alpha},i.prototype.onAnchorColorChange=function(t){var n=this.Rt;if(null!=n){var i=n.selected;null!=i&&(i.color=t)}},i.prototype.onAnchorAlphaChange=function(t){var n=this.Rt;if(null!=n){var i=n.selected;null!=i&&(i.alpha=t)}},i.prototype.onAnchorDragStart=function(){var t=et.getLayer(this);if(t){var n=t.stage;n.on(Yi.move,this.Mc),n.on(Yi.up,this.Sc)}},i.prototype.onAnchorMove=function(t){var n=this.Rt;if(null!=n){var i=n.selected;null!=i&&(i.position=this.toAnchorPosition(t))}},i.prototype.onAnchorUp=function(t){var n=et.getLayer(this);if(n){var i=n.stage;i.off(Yi.move,this.Mc),i.off(Yi.up,this.Sc)}},i.prototype.updateAnchors=function(){for(var n=this.theme,i=n.getGradientAnchorTexture(),r=n.getGradientAnchorOutlinedTexture(),e=n.getGradientPointsWidth(),u=this.Rt,s=u.points.length,h=this.Tc,o=h.length,a=o;a<s;++a){var c=new t.Sprite(i);c.anchor.set(.5,.5),c.cursor="pointer",c.interactive=!0,c.on(Yi.down,this.Ec),h.push(c),this.addChild(c)}for(a=o-1;s<=a;--a){var f=h[a];f.off(Yi.down,this.Ec),f.destroy()}h.length=s;var l=this.padding.getTop(),v=this.padding.getLeft()+e,b=this.yh.height;for(a=0;a<s;++a){var d=u.points[a],g=h[a];g.tint=d.color,g.position.set(v,l+b*d.position),g.texture=d.selected?r:i}et.update(this)},i.prototype.onKeyDown=function(t){if(Ki.isDeleteKey(t)){var i=this.Rt;if(null!=i){var r=i.selected;if(null!=r)return i.remove(r),n.prototype.onKeyDown.call(this,t),!0}}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DPickerColorGradient"},i.RECENT_COLOR_GRADIENT=null,i}($i),Kb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.value,e=i.recent;e.contains(r)||e.add(r.toObject())},Object.defineProperty(n.prototype,"value",{get:function(){return this.picker.value},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.yh;return null==n&&(n=new Xb(null===(t=this.xn)||void 0===t?void 0:t.picker),this.yh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.value},n.prototype.onKeyDown=function(n){return this.picker.onKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DDialogColorGradient"},n}(Ys),Yb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r;if(n.prototype.init.call(this,i),void 0===(null===(r=null==i?void 0:i.image)||void 0===r?void 0:r.source)){var e=this.theme,u=e.getViewBaseTexture();if(u instanceof t.Texture){var s=e.getCheckerColors(),h=Wb.from(1,10,s,u);this.er=h,h.setRectangle(0,0,0,u.width,u.height),h.setData(0,this.Xs),h.update(),this.image=h}}},i.prototype.onActivate=function(t){var i=this;n.prototype.onActivate.call(this,t);var r=this.Xs,e=this.dialog;null!=r&&e.value.fromObject(r),e.open(this).then((function(t){i.onValueChange(t,i.toClone(r))}))},i.prototype.toClone=function(t){var n=new xb;return null!=t&&n.fromObject(t),n},i.prototype.onValueChange=function(t,n){var i=this.Xs;null!=i&&i.fromObject(t);var r=this.er;null!=r&&r.update(),this.onTextChange(),this.createOrUpdateText(),et.update(this),this.emit("change",t,n,this)},Object.defineProperty(i.prototype,"dialog",{get:function(){var t,n=this.jc;if(null==n){var r=null===(t=this.xn)||void 0===t?void 0:t.dialog;r?n=this.newDialog(r):(null==i.DIALOG&&(i.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),n=i.DIALOG),this.jc=n}return n},enumerable:!1,configurable:!0}),i.prototype.newDialog=function(t){return new Kb(t)},Object.defineProperty(i.prototype,"value",{get:function(){return this.Xs},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DButtonColorGradient"},i}(ms),Jb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.recent;r.contains(i.new)||r.add(i.new)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.yh;return null==n&&(n=new Hb(null===(t=this.xn)||void 0===t?void 0:t.picker),this.yh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogColor"},n}(Ys),Zb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.dialog,e=this.Xs;if(null!=e){var u=r.current;u.color=e.color,u.alpha=e.alpha;var s=r.new;s.color=e.color,s.alpha=e.alpha}r.open(this).then((function(){i.onValueChange(i.toClone(r.new),i.toClone(r.current))}))},n.prototype.toClone=function(t){return{color:t.color,alpha:t.alpha}},n.prototype.onValueChange=function(t,n){var i=this.Xs;null!=i&&(i.color=t.color,i.alpha=t.alpha),this.onColorChange(),this.emit("change",t,n,this)},n.prototype.toImageTintOptions=function(t){var n=this,i=function(){return n.Xs.color};return t?{color:t.color||i,alpha:t.alpha}:{color:i}},n.prototype.toImageOptions=function(t,n){return n?{source:n.source,tint:this.toImageTintOptions(n.tint),align:n.align,margin:n.margin}:{tint:this.toImageTintOptions()}},n.prototype.onColorChange=function(){this.$s[0].updateTint()&&et.update(this),this.updateTextForcibly()},n.prototype.updateTextForcibly=function(){this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.jc;if(null==i){var r=null===(t=this.xn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.jc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Jb(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Rt;return null==t&&(t=this.newValue(),this.Rt=t),t},enumerable:!1,configurable:!0}),n.prototype.newValue=function(){var t=this,n=this.Xs;return new Fb(n,(function(i){n.color=i,t.onColorChange()}),(function(i){n.alpha=i,t.updateTextForcibly()}))},n.prototype.getType=function(){return"DButtonColor"},n}(ms),qb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonDanger"},n}(ms),Qb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.Xs)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.jc;if(null==i){var r=null===(t=this.xn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.jc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new wh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Xs)&&void 0!==t?t:new Date},set:function(t){var n=this.Xs;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDate"},n}(ms),$b=function(){function t(){}return t.format=function(t){var n=Qt(String(t.getFullYear()),4,"0"),i=Qt(String(t.getMonth()+1),2,"0"),r=Qt(String(t.getDate()),2,"0");return"".concat(n,"/").concat(i,"/").concat(r)},t}(),td=function(){function t(){}return t.format=function(t,n){var i="";return n&ih.HOURS&&(i+=Qt(String(t.getHours()),2,"0")),n&ih.MINUTES&&(0<i.length&&(i+=":"),i+=Qt(String(t.getMinutes()),2,"0")),n&ih.SECONDS&&(0<i.length&&(i+=":"),i+=Qt(String(t.getSeconds()),2,"0")),i},t.toMask=function(t){return rh.from("DPickerTime",t)},t}(),nd=function(){function t(){}return t.format=function(t,n){var i=td.format(t,n);return 0<i.length?"".concat($b.format(t)," ").concat(i):"".concat($b.format(t))},t.toMask=function(t){return rh.from("DPickerDatetime",t)},t}(),id=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.Xs)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.Nc;return null==i&&(i=nd.toMask(null===(n=null===(t=this.xn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Nc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.jc;if(null==i){var r=null===(t=this.xn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.jc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new lh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Xs)&&void 0!==t?t:new Date},set:function(t){var n=this.Xs;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDatetime"},n}(ms),rd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getChecker=function(){var t,n,i=this.So;return void 0===i&&(i=null!==(n=null===(t=this.xn)||void 0===t?void 0:t.checker)&&void 0!==n?n:null,this.So=i),i},n.prototype.getOpener=function(){var t=this.ws;return null==t&&(t=this.newOpener(),this.ws=t),t},n.prototype.newOpener=function(){var t,n;return new ab(Ei(null!==(n=null===(t=this.xn)||void 0===t?void 0:t.as)&&void 0!==n?n:ob.TEXT,ob),this)},n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n),this.check((function(){i.open()}))},n.prototype.check=function(t){var n=this.getChecker();if(null!=n){var i=n();!0===i?t():!1===i||i.then((function(){t()}))}else t()},n.prototype.open=function(){this.getOpener().open()},n.prototype.getType=function(){return"DButtonFile"},n}(ms),ed=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.To;return null==t&&(t=new Rl(this.xn),this.To=t),t},enumerable:!1,configurable:!0}),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.getType=function(){return"DButtonLink"},n}(gs),ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadio"},n}(gs),sd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadioRight"},n}(ud),hd=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=Tb.getCommandController();return r.isDisabled=!e.isRedoable(),e.on("change",(function(){r.isDisabled=!e.isRedoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),Tb.getCommandController().redo()},n}(ms),od=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonSecondary"},n}(ms),ad={NONE:0,SINGLE:1,MULTIPLE:2},cd=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Pt=n,r.on(Yi.tap,(function(t){r.onClick(t)})),r}return _(n,t),Object.defineProperty(n.prototype,"link",{get:function(){var t=this.To;return void 0===t&&(t=this.newLink(),this.To=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t=this.Pt.accessor.link;return t?new Rl(this.toLinkOptions(t)):null},n.prototype.onClick=function(t){var n;!0!==(null===(n=this.link)||void 0===n?void 0:n.onClick(this,t))&&this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){var n=this.Rt;void 0!==n&&this.onSelect(t,n)},n.prototype.toLinkOptions=function(t){return{url:this.toLinkUrl(t.toUrl),target:t.target,checker:this.toLinkChecker(t.checker)}},n.prototype.toLinkUrl=function(t){var n=this;return function(){var i=n.Rt;if(void 0!==i)return t(i)}},n.prototype.toLinkChecker=function(t){var n=this;if(t)return function(){var i=n.Rt;return null!=i&&t(i)}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.$e},enumerable:!1,configurable:!0}),n.prototype.onSelect=function(t,n){var i;this.emit("select",n,this);var r=this.Pt,e=r.selection;if(e.type!==ad.MULTIPLE)e.clearAndAdd(n);else{var u=t&&"data"in t?t.data.originalEvent:t;if(null==u?void 0:u.ctrlKey)e.toggle(n);else if(null==u?void 0:u.shiftKey){var s=r.mapped,h=e.last;if(n===h)e.clearAndAdd(n);else{var o=!1,a=!1,c=[];s.each((function(t){if(o){if(a){if(c.unshift(t),t===n)return!1}else if(c.push(t),t===h)return!1}else t===n?(o=!0,a=!1,c.push(t)):t===h&&(o=!0,a=!0,c.push(t))})),e.clearAndAddAll(c)}}else e.clearAndAdd(n)}null===(i=this.To)||void 0===i||i.open(t)},n.prototype.set=function(t,n,i){var r=this.Pt,e=i||this.Rt!==t;if(e){this.Rt=t,this.$e=n;var u=r.accessor;this.text=u.toLabel(t),this.title=u.toTitle(t)||"",this.image=u.toImage(t)}var s=this.state;s.lock(),s.set(ot.ACTIVE,r.selection.contains(t)),s.remove(ot.DISABLED),s.unlock(),e&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Rt){this.Rt=void 0,this.$e=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ot.DISABLED),t.remove(ot.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onKeyDown=function(n){return Ki.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DListItem"},n}(ds),fd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogSelectListItem"},n}(cd),ld=function(){function t(t,n,i,r){this.Ic=0,this.Cc=!1,this.Ac=!1,this.Rc=-1,this.Lc=-1,this.Os=1,this.yc=0,this.kc=0,this.xc=[],this.Pt=t,this.ah=n,this.Bc=i,this._c=this.toNewItem(r),this.Pc=this.toInitItem(r)}return t.prototype.toNewItem=function(t){return(null==t?void 0:t.newItem)||this.newItem},t.prototype.toInitItem=function(t){return t?t.initItem||(!1!==t.stripe?this.initItem:this.initItemNoStriping):this.initItem},t.prototype.initItem=function(t,n,i){return t.state.isAlternated=n%2==1,t},t.prototype.initItemNoStriping=function(t,n,i){return t},Object.defineProperty(t.prototype,"multiplicity",{get:function(){return this.Os},enumerable:!1,configurable:!0}),t.prototype.lock=function(){this.Ic+=1,1===this.Ic&&(this.Cc=!1,this.Ac=!1)},t.prototype.unlock=function(t){this.Ic-=1,0===this.Ic&&(t&&this.Cc&&this.update(this.Ac),this.Cc=!1,this.Ac=!1)},t.prototype.update=function(t){var n=this;if(0<this.Ic)return this.Cc=!0,void(t&&(this.Ac=!0));var i=this.ah,r=i.parent;if(null!=r){var e=this.Bc,u=e.children,s=r.height,h=this.Pt,o=this.toMapped(h),a=o.size(),c=this.yc,f=this.kc,l=f-c,v=this._c,b=this.Pc,d=this.Rc,g=this.Lc;if(this.Rc<0){var m=void 0;0<u.length?m=u[0]:(m=b(v(h),c,h),e.addChild(m),f+=1,l+=1),d=Math.max(1,m.height),wn(m.getWidth())&&(g=Math.max(1,m.width)),this.Rc=d,this.Lc=g}var w=i.padding,p=w.getTop(),O=w.getBottom(),D=w.getLeft(),E=w.getRight(),M=Math.max(0,i.width-D-E),S=0<g?Math.max(1,Math.floor(M/g)):1;this.Os=S;var T=i!==e?e.transform.position.y:p,j=Math.ceil(a/S)*d,N=Math.max(s,p+j+O),I=Math.max(s-N,i.position.y),C=Math.floor((0-(I+T))*S/d),A=Math.floor((s-(I+T))*S/d),R=C-S;R%2!=0&&(R-=1);var L=A+S+S;L%2!=0&&(L+=1);var y=L-R;if(y<l&&l-2<=y&&(L=R+(y=l)),l<y){for(var k=l;k<y;++k){var x=c+k;m=b(v(h),x,h),e.addChild(m)}f=c+(l=y)}else if(y<l){for(k=l-1;y<=k;--k)e.removeChild(u[k]);f=c+(l=y)}this.yc=R,this.kc=L;var B=R-c,_=Math.abs(B),P=u.length;if(0<_&&_<P){var U=this.xc;if(0<B){for(k=0;k<_;++k)m=u[k],this.reset(m),U.push(m);for(k=_;k<P;++k)u[k-_]=u[k];for(k=0;k<_;++k)u[P-_+k]=U[k]}else{for(k=0;k<_;++k)m=u[P-_+k],this.reset(m),U.push(m);for(k=P-_-1;0<=k;--k)u[k+_]=u[k];for(k=0;k<_;++k)u[k]=U[k]}U.length=0}var F=0,G=0;for(i===e&&(F=D,G=p),o.each((function(i,r){var e=u[r-R],s=r%S,h=Math.floor(r/S);e.position.set(F+s*g,G+h*d),n.set(e,i,r,t)}),R,R+P),k=0;R+k<0&&k<P;++k){m=u[k];var H=(V=R+k)%S,z=Math.floor(V/S);m.position.set(F+H*g,G+z*d),this.unset(m)}for(k=P-1;a<=R+k&&0<=k;--k){var V;m=u[k],H=(V=R+k)%S,z=Math.floor(V/S),m.position.set(F+H*g,G+z*d),this.unset(m)}this.lock(),i.position.y=I,i.height=N,i!==e&&(e.height=j),this.unlock(!1)}},t.prototype.set=function(t,n,i,r){t.set(n,i,r)},t.prototype.unset=function(t){t.unset()},t.prototype.reset=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof $i){var u=e.state;u.lock(),u.isPressed=!1,u.isHovered=!1,u.unlock()}}return t.state.isHovered=!1,t},t.prototype.moveFocus=function(t,n,i,r){if(!i&&!r)return!1;var e=i&&Ki.isArrowUpKey(t),u=i&&Ki.isArrowDownKey(t),s=r&&Ki.isArrowLeftKey(t),h=r&&Ki.isArrowRightKey(t);if(!(e||u||s||h))return!1;if(!n.state.isActionable)return!1;var o=et.getLayer(n);if(null==o)return!1;var a=o.getFocusController(),c=a.get();if(null==c)return!1;var f=this.Bc;if(c.parent!==f)return!1;var l=c,v=l.index;if(null==v)return!1;var b=this.Os,d=this.Pt,g=this.toMapped(d).size(),m=v;if((s||h)&&(s?0<=m-1&&(m-=1):m+1<g&&(m+=1)),(e||u)&&(e?0<=m-b&&(m-=b):m+b<g&&(m+=b)),m===v)return!1;var w=f.children,p=w.indexOf(l);if(p<0)return!1;var O=p+(m-v);if(O<0||w.length<=O)return!1;var D=w[O];return a.focus(D),!0},t}(),vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new cd(t)},n}(ld),bd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItem=function(t){return new fd(t)},n}(vd),dd=function(){function t(t){this.p=t}return t.prototype.size=function(){var t=this.p;return t.before.length+t.items.length+t.after.length},t.prototype.each=function(t,n,i){var r=this.p,e=this.Uc(t,r.before,0,n,i);if(!(e<0)){var u=this.Uc(t,r.items,e,n,i);u<0||this.Uc(t,r.after,u,n,i)}},t.prototype.Uc=function(t,n,i,r,e){for(var u=i+n.length,s=null!=r?Math.max(i,r):i,h=null!=e?Math.min(u,e):u,o=s;o<h;++o)if(!1===t(n[o-i],o))return-1;return h},t}(),gd=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n,e.Fc=i,e.Gc=new Set;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return ad.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.get(0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.Gc;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.Gc;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.Gc;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.Gc;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.Gc;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.Gc;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.Gc,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.Gc=i,this.onChange()),n},n.prototype.contains=function(t){return this.Gc.has(t)},n.prototype.size=function(){return this.Gc.size},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=!1;this.Gc.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.Gc.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toItemIdMap=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];i.set(n(u),u)}},n.prototype.toItemSet=function(t,n){for(var i=0,r=t.length;i<r;++i)n.add(t[i])},n.prototype.onItemChange=function(t,n,i){var r=this.Gc,e=new Set,u=this.Fc.toId;if(u){var s=new Map;this.toItemIdMap(t,u,s),this.toItemIdMap(n,u,s),this.toItemIdMap(i,u,s),r.forEach((function(t){var n=u(t),i=s.get(n);null!=i&&e.add(i)})),this.Gc=e,this.onChange()}else{var h=new Set;this.toItemSet(t,h),this.toItemSet(n,h),this.toItemSet(i,h),r.forEach((function(t){h.has(t)&&e.add(t)})),r.size!==e.size&&(this.Gc=e,this.onChange())}},n.prototype.newItems=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];n.has(u)&&i.add(u)}return i},n}(t.utils.EventEmitter),md=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return ad.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onItemChange=function(t,n,i){},n}(t.utils.EventEmitter),wd=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n,e.Fc=i,e.Hc=null;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return ad.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.Hc:null},n.prototype.add=function(t){return this.Hc!==t&&(this.Hc=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.Hc===t&&(this.Hc=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.Hc===t?this.Hc=null:this.Hc=t,this.onChange(),!0},n.prototype.clear=function(){null!=this.Hc&&(this.Hc=null,this.onChange())},n.prototype.clearAndAdd=function(t){return this.Hc!==t&&(this.Hc=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){var n=t.length;if(0<n){var i=t[n-1];if(this.Hc!==i)return this.Hc=i,this.onChange(),!0}else if(null!=this.Hc)return this.Hc=null,this.onChange(),!0;return!1},n.prototype.contains=function(t){return this.Hc===t},n.prototype.size=function(){return null!=this.Hc?1:0},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=this.Hc;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.Hc;return null!=t?[t]:[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.findById=function(t,n,i){for(var r=0,e=i.length;r<e;++r){var u=i[r];if(t===n(u))return u}return null},n.prototype.find=function(t,n){for(var i=0,r=n.length;i<r;++i){var e=n[i];if(t===e)return e}return null},n.prototype.onItemChange=function(t,n,i){var r=this.Hc;if(null!=r){var e=null,u=this.Fc.toId;if(u){var s=u(r);e=this.findById(s,u,t)||this.findById(s,u,n)||this.findById(s,u,i)}else e=this.find(r,t)||this.find(r,n)||this.find(r,i);r!==e&&(this.Hc=e,this.onChange())}},n}(t.utils.EventEmitter),pd=function(t){return t.image},Od=function(t){return t.title},Dd=function(t){return t.url},Ed=function(){function t(t){this.toLabel=(null==t?void 0:t.toLabel)||ib,this.toTitle=(null==t?void 0:t.toTitle)||Od,this.toImage=(null==t?void 0:t.toImage)||pd,this.toId=null==t?void 0:t.toId,this.link=this.toLink(t)}return t.prototype.toLink=function(t){if(t){var n=t.link;if(n){var i=n.toUrl,r=n.target,e=n.checker;if(void 0!==i||void 0!==r||void 0!==e)return{toUrl:i||Dd,target:r,checker:e}}}},t}(),Md=function(){function t(t,n){this.p=t,n?(this.Fu=n.before||[],this.Gc=n.items||[],this.Gu=n.after||[]):(this.Fu=[],this.Gc=[],this.Gu=[]);var i=new Ed(n);this.Fc=i,this.zc=this.toSelection(i,n),this.Vc=new dd(this)}return t.prototype.toSelection=function(t,n){var i=null==n?void 0:n.selection;switch(null==i?void 0:i.type){case ad.NONE:case"NONE":return new md(this,t,i);case ad.MULTIPLE:case"MULTIPLE":return new gd(this,t,i);default:return new wd(this,t,i)}},Object.defineProperty(t.prototype,"before",{get:function(){return this.Fu},set:function(t){this.Fu=t,this.zc.onItemChange(t,this.Gc,this.Gu),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this.Gc},set:function(t){this.Gc=t,this.zc.onItemChange(this.Fu,t,this.Gu),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.Gu},set:function(t){this.Gu=t,this.zc.onItemChange(this.Fu,this.Gc,t),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.Vc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.Fc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.zc},enumerable:!1,configurable:!0}),t.prototype.update=function(t){this.p.update(t)},t.prototype.size=function(){return this.Gc.length},t.prototype.clear=function(){var t=this.Gc;return 0<t.length&&(t.length=0,this.onChange(),!0)},t.prototype.clearAndAdd=function(t){var n=this.Gc;return 1===n.length?n[0]!==t&&(n[0]=t,this.onChange(),!0):(n.length=0,n.push(t),this.onChange(),!0)},t.prototype.clearAndAddAll=function(t){var n=!1,i=this.Gc;if(0<i.length&&(i.length=0,n=!0),0<t.length){for(var r=0,e=t.length;r<e;++r)i.push(t[r]);n=!0}return!!n&&(this.onChange(),!0)},t.prototype.add=function(t,n){var i=this.Gc;return null==n?(i.push(t),this.onChange(),!0):0<=n&&n<i.length&&(i.splice(n,0,t),this.onChange(),!0)},t.prototype.addAll=function(t,n){if(0<t.length){var i=this.Gc,r=i.length;if(null==n){for(var e=0,u=t.length;e<u;++e)i.push(t[e]);return this.onChange(),!0}if(0<=n&&n<r){for(e=0,u=t.length;e<u;++e)i.splice(n+e,0,t[e]);return this.onChange(),!0}}return!1},t.prototype.get=function(t){var n=this.Gc;return 0<=t&&t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.Gc;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.onChange(),r}return null},t.prototype.remove=function(t){var n=this.Gc;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.onChange(),i}return null},t.prototype.each=function(t,n,i){for(var r=this.Gc,e=r.length,u=null!=n?Math.max(0,n):0,s=null!=i?Math.min(e,i):e,h=u;h<s&&!1!==t(r[h],h);++h);},t.prototype.onChange=function(){this.update()},t}(),Sd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DContent"},n}($i),Td=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Wc=0,e.Xc=1,e.visible=!1,e.Kc=-1,e.Yc=!1,e.Jc=null,e.Zc=null!==(r=null===(i=null==n?void 0:n.fadeOut)||void 0===i?void 0:i.delay)&&void 0!==r?r:e.theme.getFadeOutDelay(),e.qc=!0,e.Qc=function(){e.onFadeOutTimeout()};var u=e.newThumb(null==n?void 0:n.thumb);return u.on("statechange",(function(t,n){e.onThumbStateChange(t,n)})),e.$c=u,e.addChild(u),e}return _(n,t),Object.defineProperty(n.prototype,"thumb",{get:function(){return this.$c},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"start",{get:function(){return this.Wc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"end",{get:function(){return this.Xc},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r){i<1?(t=0,n=1):(t=Math.max(0,Math.min(1,t/i)),n=Math.max(t,Math.min(1,n/i))),this.Wc===t&&this.Xc===n||(this.Wc=t,this.Xc=n,this.onChange(r))},n.prototype.onChange=function(t){this.updateThumb(this.width,this.height),t&&(this.qc=!0),this.Yc||(this.Yc=!0,et.update(this))},n.prototype.touch=function(t){this.onChange(t)},n.prototype.isRegionVisible=function(){return 0<this.Wc||this.Xc<1},n.prototype.render=function(n){if(this.Yc)if(this.Yc=!1,!this.qc&&this.isRegionVisible()){var i=this.Zc;0<=i&&(this.Kc=Date.now(),null==this.Jc&&(this.Jc=window.setTimeout(this.Qc,i))),this.visible||(this.visible=!0)}else this.Zc<0&&this.visible&&(this.visible=!1);this.qc&&(this.qc=!1),t.prototype.render.call(this,n)},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateThumb(n,i)},n.prototype.onFadeOutTimeout=function(){this.Jc=null;var t=this.Zc,n=this.Qc,i=this.state;if(i.isGesturing||i.onHovered||i.isHovered||i.isPressed)this.Jc=window.setTimeout(n,t);else{var r=this.$c.state;if(r.isGesturing||r.isHovered||r.isPressed)this.Jc=window.setTimeout(n,t);else{var e=t-(Date.now()-this.Kc);0<e?this.Jc=window.setTimeout(n,e):this.visible&&(this.visible=!1,et.update(this))}}},n.prototype.onThumbStateChange=function(t,n){t.isGesturing||t.isHovered||t.isPressed||(n.isGesturing||n.isHovered||n.isPressed)&&(this.Kc=Date.now())},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isGesturing||n.isHovered||n.isPressed||(i.isGesturing||i.isHovered||i.isPressed)&&(this.Kc=Date.now())},n.prototype.getType=function(){return"DScrollBar"},n}($i),jd=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r=this;n.prototype.init.call(this,i);var e=new t.Point;this.Ii=new ar({bind:this,on:{start:function(){e.copyFrom(r.position)},move:function(t,n,i){e.set(e.x+n,e.y+i),r.onGestureMove(e.x,e.y)}}})},i.prototype.getMinimumLength=function(){return this.theme.getThumbMinimumLength()},i.prototype.getType=function(){return"DScrollBarThumb"},i}($i),Nd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(0,o*(i-h),n,h),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Id=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",t,this)},n.prototype.initReflowable=function(){new Nd(this)},n}(jd),Cd=function(t){function n(n){var i=t.call(this,n)||this;return i.$c.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.width;if(0<n){var i=this.Xc-this.Wc,r=Math.min(1-i,Math.max(0,t/n));this.Wc!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.width;if(0<i){var r=this.Xc-this.Wc,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.x/i-.5*r));this.Wc!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Id(t)},n.prototype.updateThumb=function(t,n){var i=this.$c,r=Math.min(.5*t,i.getMinimumLength()),e=t-r,u=e*this.Wc,s=e*this.Xc+r-u;i.position.set(u,0),i.resize(s,n)},n}(Td),Ad=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(o*(n-h),0,h,i),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Rd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",n,this)},n.prototype.initReflowable=function(){new Ad(this)},n}(jd),Ld=function(t){function n(n){var i=t.call(this,n)||this;return i.$c.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.height;if(0<n){var i=this.Xc-this.Wc,r=Math.min(1-i,Math.max(0,t/n));this.Wc!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.height;if(0<i){var r=this.Xc-this.Wc,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.y/i-.5*r));this.Wc!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Rd(t)},n.prototype.updateThumb=function(t,n){var i=this.$c,r=Math.min(.5*n,i.getMinimumLength()),e=n-r,u=e*this.Wc,s=e*this.Xc+r-u;i.position.set(0,u),i.resize(t,s),i.updateTransform()},n}(Td),yd=function(){function t(t,n,i){this.p=t,this.tf=i,this.q=0,this.nf=!1,this.vertical=new Ld(null==n?void 0:n.vertical),this.horizontal=new Cd(null==n?void 0:n.horizontal)}return t.prototype.lock=function(){this.q+=1,1===this.q&&(this.nf=!1,this.if=void 0)},t.prototype.unlock=function(t){this.q-=1,0===this.q&&(t&&this.nf&&this.update(this.if),this.nf=!1,this.if=void 0)},t.prototype.update=function(t){if(0<this.q)return this.nf=!0,void(null!=t&&(this.if||(this.if=t)));var n=this.p,i=n.width,r=n.height,e=n.content,u=-e.x,s=-e.y,h=this.vertical,o=h.width,a=this.getOffsetVerticalStart(o),c=this.getOffsetVerticalEnd(o);h.set(s,s+r,e.height,t),h.position.set(i-o,a),h.height=r-a-c;var f=this.horizontal,l=f.height,v=this.getOffsetHorizontalStart(l),b=this.getOffsetHorizontalEnd(l);f.set(u,u+i,e.width,t),f.position.set(v,r-l),f.width=i-v-b,this.tf(h.isRegionVisible()||f.isRegionVisible())},t.prototype.touch=function(t){this.vertical.touch(t),this.horizontal.touch(t)},t.prototype.getOffsetHorizontalStart=function(t){return.5*t},t.prototype.getOffsetHorizontalEnd=function(t){return.5*t},t.prototype.getOffsetVerticalStart=function(t){return.5*t},t.prototype.getOffsetVerticalEnd=function(t){return.5*t},t}(),kd=function(n){function i(t){var i,r=this,e=(r=n.call(this,t)||this).theme;(null!==(i=null==t?void 0:t.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(r.mask=r.getOverflowMask()),r.addChild(r.content);var u=r.scrollbar;return r.addChild(u.vertical),r.addChild(u.horizontal),u.update(),r.initGesture(e,t),r}return _(i,n),i.prototype.initGesture=function(n,i){var r,e,u=this,s=Ei(null!==(e=null===(r=null==i?void 0:i.gesture)||void 0===r?void 0:r.mode)&&void 0!==e?e:n.getGestureMode(),rr);if(s===rr.ON||s===rr.TOUCH){var h=new t.Point,o=this.content;this.Ii=new ar({bind:this,touch:s===rr.TOUCH,on:{start:function(){h.copyFrom(o.position)},move:function(t,n,i){h.set(h.x+n,h.y+i),o.position.set(u.toContentX(o,h.x),u.toContentY(o,h.y))}}})}},Object.defineProperty(i.prototype,"scrollbar",{get:function(){var t,n=this.rf;return null==n&&(n=this.newScrollBar(null===(t=this.xn)||void 0===t?void 0:t.scrollbar),this.initScrollBar(n),this.rf=n),n},enumerable:!1,configurable:!0}),i.prototype.newScrollBar=function(t){var n=this;return new yd(this,t,(function(t){n.onScrollBarUpdate(t)}))},i.prototype.onScrollBarUpdate=function(t){var n=this.ur;if(null!=n){var i=this.content;t?i.mask!==n&&(i.mask=n,et.update(this)):i.mask&&(i.mask=null,et.update(this))}},i.prototype.initScrollBar=function(t){var n=this;t.vertical.on("regionmove",(function(t){n.onScrollBarMoveY(t)})),t.horizontal.on("regionmove",(function(t){n.onScrollBarMoveX(t)}))},i.prototype.onScrollBarMoveX=function(t){var n=this.Ii;null!=n&&n.stop(this);var i=this.content;i.x=-i.width*t},i.prototype.onScrollBarMoveY=function(t){var n=this.Ii;null!=n&&n.stop(this);var i=this.content;i.y=-i.height*t},i.prototype.onOver=function(t){n.prototype.onOver.call(this,t),this.scrollbar.touch()},i.prototype.getType=function(){return"DPane"},Object.defineProperty(i.prototype,"content",{get:function(){var t=this.ah;return null==t&&(t=this.toContent(this.xn),this.initContent(t),this.ah=t),t},enumerable:!1,configurable:!0}),i.prototype.toContent=function(t){var n=null==t?void 0:t.content;return n?n instanceof $i?n:this.newContent(n):this.newContent()},i.prototype.newContent=function(t){return new Sd(t)},i.prototype.initContent=function(t){var n=this;t.on("move",(function(){n.onContentChange()})),t.on("resize",(function(){n.onContentChange()}))},i.prototype.getOverflowMask=function(){var t=this.ur;return null==t&&(t=new tr(this),this.ur=t,this.reflowable.add(t),this.toDirty()),t},i.prototype.onWheel=function(t,n,i){var r=this.content,e=this.getWheelContentX(r,n.deltaX*n.lowest),u=this.getWheelContentY(r,n.deltaY*n.lowest);if(r.x!==e||r.y!==u){var s=this.Ii;return null!=s&&s.stop(this),r.position.set(e,u),!0}return!1},i.prototype.getWheelContentX=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentX(t,t.x-n*i)}return t.x},i.prototype.getWheelContentY=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentY(t,t.y+n*i)}return t.y},i.prototype.toContentX=function(t,n){return Math.min(0,Math.max(this.width-t.width,n))},i.prototype.toContentY=function(t,n){return Math.min(0,Math.max(this.height-t.height,n))},i.prototype.isRefitable=function(t){return n.prototype.isRefitable.call(this,t)&&!(t instanceof Td)},i.prototype.onResize=function(t,i,r,e){var u=this.scrollbar;u.lock(),n.prototype.onResize.call(this,t,i,r,e),u.update(),u.unlock(!0)},i.prototype.onContentChange=function(){this.scrollbar.update()},i.prototype.getFocusedChildClippingRect=function(t,n,i,r,e,u,s,h){return h.x=0,h.y=0,h.width=u,h.height=s,h},i.prototype.onChildFocus=function(r){var e=i.WORK_POINT||new t.Point;i.WORK_POINT=e;var u=this.content,s=u.x,h=u.y,o=u.width,a=u.height;e.set(0,0),r.toGlobal(e,e,!1),u.toLocal(e,void 0,e,!1);var c=s+Math.min(o,Math.max(0,e.x)),f=h+Math.min(a,Math.max(0,e.y));e.set(r.width,r.height),r.toGlobal(e,e,!0),u.toLocal(e,void 0,e,!0);var l=s+Math.min(o,Math.max(0,e.x)),v=h+Math.min(a,Math.max(0,e.y)),b=this.width,d=this.height,g=i.WORK_RECTANGLE||new t.Rectangle;i.WORK_RECTANGLE=g,this.getFocusedChildClippingRect(r,s,h,o,a,b,d,g);var m=g.x,w=g.y,p=m,O=w,D=m+g.width,E=w+g.height,M=null;c<p?l<=D&&(M=s+Math.min(p-c,D-l),M=Math.max(b-o,Math.min(0,M))):D<l&&(M=s-Math.min(c-p,l-D),M=Math.max(b-o,Math.min(0,M)));var S=null;f<O?v<=E&&(S=h+Math.min(O-f,E-v),S=Math.max(d-a,Math.min(0,S))):E<v&&(S=h-Math.min(f-O,v-E),S=Math.max(d-a,Math.min(0,S)));var T=u.position;null!=M?null!=S?T.set(M,S):T.x=M:null!=S&&(T.y=S),n.prototype.onChildFocus.call(this,r)},i.prototype.destroy=function(){var t=this.ur;null!=t&&(this.ur=null,t.destroy()),this.mask=null,n.prototype.destroy.call(this)},i}($i),xd=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.ef;return null==t&&(t=this.newUpdater(this.data,this.content,this.xn),this.ef=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new vd(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Pt;return null==t&&(t=this.toData(this.xn),this.Pt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.items),i=null==t?void 0:t.selection;return null==n?i?new Md(this,{selection:i}):new Md(this):Lt(n)?new Md(this,i?{items:n,selection:i}:{items:n}):"each"in n?n:i?(void 0===n.selection&&(n.selection=i),new Md(this,n)):new Md(this,n)},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!0),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DList"},n}(kd),Bd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUpdater=function(t,n,i){return new bd(t,n,n,null==i?void 0:i.updater)},n.prototype.getType=function(){return"DDialogSelectList"},n}(xd),_d=function(t){function n(n){var i=t.call(this)||this;return i.uf=n||function(t){return Promise.resolve([])},i.R=0,i.sf=0,i}return _(n,t),n.prototype.create=function(t){var n=this,i=++this.R;this.uf(t[0]).then((function(t){n.R===i&&(n.sf=i,n.emit("success",n,t),n.emit("change",n))}),(function(){n.R===i&&(n.sf=i,n.emit("fail",n),n.emit("change",n))})),this.emit("change",this)},n.prototype.isDone=function(){return this.R===this.sf},n}(t.utils.EventEmitter),Pd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputSearch"},n}(Vs),Ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNote"},n}(ds),Fd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmall"},n}(Ud),Gd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallError"},n}(Fd),Hd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallNoItemsFound"},n}(Fd),zd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallSearching"},n}(Fd),Vd=function(t){function n(n,i){var r=t.call(this)||this;return r.Zn=n,r.Rt=i.value,r.hf=i.filter,n.on("change",(function(){r.emit("change",r)})),n.on("success",(function(t,n){r.emit("success",r,r.toDismissable(n))})),n.on("fail",(function(){r.emit("fail",r)})),r}return _(n,t),n.prototype.toDismissValue=function(t){if(null!=t){var n=this.Rt;if(void 0!==n){var i=this.hf;if(null==i||i(n,t[0]))return n}}},n.prototype.toDismissable=function(t){var n=this.toDismissValue(this.af);if(void 0===n)return t;for(var i=[],r=0,e=t.length;r<e;++r)i.push(t[r]);return i.push(n),i},n.prototype.create=function(t){this.af=t,this.Zn.create(t)},n.prototype.isDone=function(){return this.Zn.isDone()},n}(t.utils.EventEmitter),Wd=function(t){function n(n){var i=t.call(this,n)||this;i.Rt=null;var r=new db,e=i.search;return e.on("success",(function(t,n){0<n.length?r.hide():r.show(i.noteNoItemsFound),i.onSearched(n)})),e.on("fail",(function(){r.show(i.noteError),i.onSearched([])})),e.on("change",(function(){if(!e.isDone()){var t=i.noteSearching;t&&r.show(t)}})),i}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout,this.list),r},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.lh;return null==t&&(t=this.newInputLayout(this.input,this.theme,this.xn),this.lh=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(t,n,i){return new ps(this.toInputLayoutOptions(t,n,i))},n.prototype.toInputLayoutOptions=function(t,n,i){var r=this.toInputMargin(n,i);return{width:"padding",height:"auto",children:[new Pu({width:r}),t,new Pu({width:r})]}},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.bh;return null==t&&(t=this.newInput(),this.bh=t),t},enumerable:!1,configurable:!0}),n.prototype.newInput=function(){var t=this,n=new Pd(this.toInputOptions(this.theme,this.xn));return n.on("input",(function(n){t.search.create([n])})),n},n.prototype.toInputOptions=function(t,n){var i=(null==n?void 0:n.input)||{};return void 0===i.width&&void 0===i.weight&&(i.weight=1),i},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"list",{get:function(){var t=this.Ln;return null==t&&(t=this.newList(),this.Ln=t),t},enumerable:!1,configurable:!0}),n.prototype.newList=function(){var t=this,n=new Bd(this.toListOptions(this.theme,this.xn));return n.selection.on("change",(function(n){t.onListSelectionChange(n)})),n},n.prototype.onListSelectionChange=function(t){var n=t.first;if(null!=n){var i=this.xn;if(i){var r=i.dismiss;r&&n===r.value&&(n=null)}this.Rt=n,this.onOk(n)}},n.prototype.toListOptions=function(t,n){var i=(null==n?void 0:n.list)||{};return void 0===i.width&&(i.width="padding"),i},Object.defineProperty(n.prototype,"noteError",{get:function(){var t=this.cf;return null==t&&(t=this.newNoteError(),this.cf=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteError=function(){var t,n,i=null===(n=null===(t=this.xn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.error;return null!==i?new Gd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteNoItemsFound",{get:function(){var t=this.ff;return null==t&&(t=this.newNoteNoItemsFound(),this.ff=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteNoItemsFound=function(){var t,n,i=null===(n=null===(t=this.xn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.noItemsFound;return null!==i?new Hd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteSearching",{get:function(){var t=this.lf;return null==t&&(t=this.newNoteSearching(),this.lf=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteSearching=function(){var t,n,i=null===(n=null===(t=this.xn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.searching;return null!=i?new zd(this.toNoteOptions(this.list,i)):null},n.prototype.toNoteOptions=function(t,n){return null!=n?(null==n.parent&&(n.parent=t),null==n.visible&&(n.visible=!1),n):{parent:t,visible:!1}},Object.defineProperty(n.prototype,"search",{get:function(){var t=this.uf;return null==t&&(t=this.newSearch(),this.uf=t),t},enumerable:!1,configurable:!0}),n.prototype.newSearch=function(){var t=this.xn;if(t){var n=t.controller;if(n){var i=t.dismiss,r=n.search;return"create"in r?null!=i?new Vd(r,i):r:null!=i?new Vd(new _d(r),i):new _d(r)}}return new _d},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),n.prototype.onSearched=function(t){this.list.data.items=t},n.prototype.getResolvedValue=function(){return this.Rt},n.prototype.getType=function(){return"DDialogSelect"},n.prototype.onOpen=function(){t.prototype.onOpen.call(this),this.list.selection.clear(),this.search.create([this.input.value])},n.prototype.onOk=function(n){this.emit("select",n,this),t.prototype.onOk.call(this,n)},n.prototype.destroy=function(){var n=this.bh;n&&n.destroy();var i=this.cf;i&&i.destroy();var r=this.ff;r&&(null==r||r.destroy());var e=this.lf;e&&(null==e||e.destroy());var u=this.Ln;u&&u.destroy(),t.prototype.destroy.call(this)},n}(Ts),Xd=function(t){return t.value},Kd=function(){},Yd=function(t){function n(n){var i,r,e=this;return(e=t.call(this,function(t){var n,i,r;if(t){var e,u=null===(n=t.text)||void 0===n?void 0:n.formatter;if(void 0!==u){if(!(e=t.dialog)||!("open"in e)){var s=(e=e||{}).item=e.item||{};void 0===(o=s.text=s.text||{}).formatter&&(o.formatter=u)}}else if(!(e=t.dialog)||!("open"in e)){var h=null===(r=null===(i=null==e?void 0:e.item)||void 0===i?void 0:i.text)||void 0===r?void 0:r.formatter;if(void 0!==h){var o=t.text||{};t.text=o,void 0===o.formatter&&(o.formatter=h)}}}return t}(n))||this).vf=null!==(i=null==n?void 0:n.getter)&&void 0!==i?i:Xd,e.bf=null!==(r=null==n?void 0:n.setter)&&void 0!==r?r:Kd,e}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.dialog,u=null!==(i=this.Xs)&&void 0!==i?i:null;this.bf(e,u),e.open(this).then((function(){var t=r.vf(e);t!==u&&(r.text=t,r.emit("change",t,u,r))}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.jc;if(null==n){var i=null===(t=this.xn)||void 0===t?void 0:t.dialog;n=i&&"open"in i?i:new Wd(i),this.jc=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Xs)&&void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonSelect"},n}(ms),Jd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.Xs)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.Nc;return null==i&&(i=td.toMask(null===(n=null===(t=this.xn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Nc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.jc;if(null==i){var r=null===(t=this.xn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.jc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new bh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Xs)&&void 0!==t?t:new Date},set:function(t){var n=this.Xs;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonTime"},n}(ms),Zd=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=Tb.getCommandController();return r.isDisabled=!e.isUndoable(),e.on("change",(function(){r.isDisabled=!e.isUndoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),Tb.getCommandController().undo()},n}(ms),qd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DCanvas"},n}($i),Qd={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3},$d=function(){function t(t){this.df=t,this.$e=0}return Object.defineProperty(t.prototype,"shape",{get:function(){var t=this.Pr;return null==t&&(t=this.newShape(),this.Pr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShape=function(){var t,n=this.df,i=n.bar,r=new Yt;return r.points.position=this.newShapePosition(),r.points.style=null!==(t=i.style)&&void 0!==t?t:G.NONE,r.stroke.copy(i.stroke),r.text.copy(n.label),r},t.prototype.newShapePosition=function(){switch(this.df.position){case Qd.LEFT:case Qd.RIGHT:return tt.TOP;default:return tt.LEFT}},t.prototype.bind=function(t,n){this.Bc=t,this.$e=n,this.shape.attach(t.container)},t.prototype.unbind=function(){var t=this.Pr;null!=t&&t.detach(),this.$e=0,this.Bc=void 0},t.prototype.update=function(){var t=this.Bc,n=this.$e,i=this.Pr;if(null!=i&&null!=t){var r=t.plotArea,e=r.width,u=r.height,s=this.df.padding*n;i.disallowUploadedUpdate();var h=i.transform.position,o=i.size;switch(this.df.position){case Qd.TOP:h.set(.5*e,0-s),o.set(e,0);break;case Qd.BOTTOM:h.set(.5*e,u+s),o.set(e,0);break;case Qd.LEFT:h.set(0-s,.5*u),o.set(0,u);break;case Qd.RIGHT:h.set(e+s,.5*u),o.set(0,u)}return i.allowUploadedUpdate(),!0}return!1},t.prototype.destroy=function(){var t=this.Pr;null!=t&&t.destroy(),this.$e=0,this.Bc=void 0},t}(),tg={INSIDE:0,OUTSIDE:1},ng=function(){function t(t,n){var i,r;this.coordinate=null!==(i=null==n?void 0:n.coordinate)&&void 0!==i?i:0,this.position=this.toPosition(t,n),this.tick=this.toTick(t,n),this.label=this.toLabel(t,n),this.padding=null!==(r=null==n?void 0:n.padding)&&void 0!==r?r:t.getPadding(),this.bar=this.toBar(t,n)}return t.prototype.toPosition=function(t,n){var i=null==n?void 0:n.position;return ct(i)?Qd[i]:null!=i?i:t.getPosition()},t.prototype.toBar=function(t,n){var i;return{style:null!==(i=null==n?void 0:n.style)&&void 0!==i?i:t.getStyle(),stroke:this.toBarStroke(t,null==n?void 0:n.stroke)}},t.prototype.toTick=function(t,n){var i,r=null==n?void 0:n.tick;return{enable:null!==(i=null==r?void 0:r.enable)&&void 0!==i?i:t.getTickEnable(),major:this.toTickMajor(t,r),minor:this.toTickMinor(t,r)}},t.prototype.toTickMajor=function(t,n){var i,r,e,u,s,h,o,a,c=null==n?void 0:n.major,f=null!==(r=null!==(i=null==c?void 0:c.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMajorTickPosition(),l=null==n?void 0:n.style,v=yv.from(null!==(u=null!==(e=null==c?void 0:c.style)&&void 0!==e?e:l)&&void 0!==u?u:t.getMajorTickStyle()),b=null==n?void 0:n.stroke,d=this.toTickMajorStroke(t,null==c?void 0:c.stroke,b),g=null!==(s=null==c?void 0:c.count)&&void 0!==s?s:t.getMajorTickCount();return{count:g,capacity:null!==(h=null==c?void 0:c.capacity)&&void 0!==h?h:t.getMajorTickCapacity(g),step:null!==(o=null==c?void 0:c.step)&&void 0!==o?o:t.getMajorTickStep(),size:null!==(a=null==c?void 0:c.size)&&void 0!==a?a:t.getMajorTickSize(),position:this.toTickPosition(f),style:v,stroke:d,text:this.toTickMajorText(t,null==c?void 0:c.text),formatter:this.toTickMajorFormatter(t,c),gridline:this.toTickMajorGridline(t,null==c?void 0:c.gridline,l,b)}},t.prototype.toTickMajorGridline=function(t,n,i,r){var e,u,s,h=yv.from(null!==(u=null!==(e=null==n?void 0:n.style)&&void 0!==e?e:i)&&void 0!==u?u:t.getMajorTickGridlineStyle());return{enable:null!==(s=null==n?void 0:n.enable)&&void 0!==s?s:t.getMajorTickGridlineEnable(),style:h,stroke:this.toTickMajorGridlineStroke(t,null==n?void 0:n.stroke,r)}},t.prototype.toTickPosition=function(t){var n=this.position;if(t===tg.OUTSIDE||"OUTSIDE"===t)switch(n){case Qd.TOP:return tt.BOTTOM;case Qd.BOTTOM:return tt.TOP;case Qd.LEFT:return tt.RIGHT;case Qd.RIGHT:return tt.LEFT;default:return tt.TOP}else switch(n){case Qd.TOP:return tt.TOP;case Qd.BOTTOM:return tt.BOTTOM;case Qd.LEFT:return tt.LEFT;case Qd.RIGHT:return tt.RIGHT;default:return tt.TOP}},t.prototype.toTickMinor=function(t,n){var i,r,e,u,s,h,o,a=null==n?void 0:n.minor,c=null!==(r=null!==(i=null==a?void 0:a.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMinorTickPosition(),f=yv.from(null!==(u=null!==(e=null==a?void 0:a.style)&&void 0!==e?e:null==n?void 0:n.style)&&void 0!==u?u:t.getMinorTickStyle());return{count:null!==(s=null==a?void 0:a.count)&&void 0!==s?s:t.getMinorTickCount(),step:null!==(h=null==a?void 0:a.step)&&void 0!==h?h:t.getMinorTickStep(),size:null!==(o=null==a?void 0:a.size)&&void 0!==o?o:t.getMinorTickSize(),position:this.toTickPosition(c),style:f,stroke:this.toTickMinorStroke(t,null==a?void 0:a.stroke,null==n?void 0:n.stroke),text:this.toTickMinorText(t,null==a?void 0:a.text),formatter:this.toTickMinorFormatter(t,a)}},t.prototype.toBarStroke=function(t,n){return this.toStroke(n,void 0,t.getStrokeEnable(),t.getStrokeColor(),t.getStrokeAlpha(),t.getStrokeWidth(),t.getStrokeAlign(),t.getStrokeSide(),t.getStrokeStyle())},t.prototype.toTickMajorStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickStrokeEnable(),t.getMajorTickStrokeColor(),t.getMajorTickStrokeAlpha(),t.getMajorTickStrokeWidth(),t.getMajorTickStrokeAlign(),t.getMajorTickStrokeSide(),t.getMajorTickStrokeStyle())},t.prototype.toTickMajorGridlineStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickGridlineStrokeEnable(),t.getMajorTickGridlineStrokeColor(),t.getMajorTickGridlineStrokeAlpha(),t.getMajorTickGridlineStrokeWidth(),t.getMajorTickGridlineStrokeAlign(),t.getMajorTickGridlineStrokeSide(),t.getMajorTickGridlineStrokeStyle())},t.prototype.toTickMinorStroke=function(t,n,i){return this.toStroke(n,i,t.getMinorTickStrokeEnable(),t.getMinorTickStrokeColor(),t.getMinorTickStrokeAlpha(),t.getMinorTickStrokeWidth(),t.getMinorTickStrokeAlign(),t.getMinorTickStrokeSide(),t.getMinorTickStrokeStyle())},t.prototype.toStroke=function(t,n,i,r,e,u,s,h,o){var a,c,f,l,v,b,d,g,m,w,p,O,D,E,M,S,T,j,N,I,C,A,R,L,y,k,x,B;return t?n?{enable:null!==(c=null!==(a=t.enable)&&void 0!==a?a:n.enable)&&void 0!==c?c:i,color:null!==(l=null!==(f=t.color)&&void 0!==f?f:n.color)&&void 0!==l?l:r,alpha:null!==(b=null!==(v=t.alpha)&&void 0!==v?v:n.alpha)&&void 0!==b?b:e,width:null!==(g=null!==(d=t.width)&&void 0!==d?d:n.width)&&void 0!==g?g:u,align:null!==(w=null!==(m=t.align)&&void 0!==m?m:n.align)&&void 0!==w?w:s,side:null!==(O=null!==(p=t.side)&&void 0!==p?p:n.side)&&void 0!==O?O:h,style:this.toStrokeStyle(null!==(E=null!==(D=t.style)&&void 0!==D?D:n.style)&&void 0!==E?E:o)}:{enable:null!==(M=t.enable)&&void 0!==M?M:i,color:null!==(S=t.color)&&void 0!==S?S:r,alpha:null!==(T=t.alpha)&&void 0!==T?T:e,width:null!==(j=t.width)&&void 0!==j?j:u,align:null!==(N=t.align)&&void 0!==N?N:s,side:null!==(I=t.side)&&void 0!==I?I:h,style:this.toStrokeStyle(null!==(C=t.style)&&void 0!==C?C:o)}:n?{enable:null!==(A=n.enable)&&void 0!==A?A:i,color:null!==(R=n.color)&&void 0!==R?R:r,alpha:null!==(L=n.alpha)&&void 0!==L?L:e,width:null!==(y=n.width)&&void 0!==y?y:u,align:null!==(k=n.align)&&void 0!==k?k:s,side:null!==(x=n.side)&&void 0!==x?x:h,style:this.toStrokeStyle(null!==(B=n.style)&&void 0!==B?B:o)}:{enable:i,color:r,alpha:e,width:u,align:s,side:h,style:o}},t.prototype.toStrokeStyle=function(t){if(ct(t))return s[t];if(Lt(t)){for(var n=s.NONE,i=0,r=t.length;i<r;++i)n|=s[t[i]];return n}return t},t.prototype.toTickMajorFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null===r)return;if(null!=r)return di.create(r);var e=i.formatter;if(e)return{format:e}}var u=t.getMajorTickTextFormat();if(null!=u)return di.create(u)},t.prototype.toTickMajorText=function(t,n){return{format:(n=n||{}).format,color:this.toTickMajorTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:Ei(n.weight,d),align:this.toTickMajorTextAlign(t,n.align),offset:this.toTickMajorTextOffset(t,n.offset),style:Ei(n.style,g),outline:this.toTickMajorTextOutline(t,n.outline),spacing:this.toTickMajorTextSpacing(t,n.spacing),direction:this.toTickMajorTextDirection(t,n.direction),padding:this.toTickMajorTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toTickMajorTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toTickMajorTextAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextAlignVertical(e)}},t.prototype.toTickMajorTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMajorTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMajorTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextPaddingVertical()}},t.prototype.toTickMajorTextDirection=function(t,n){return Ei(null!=n?n:t.getMajorTickTextDirection(),p)},t.prototype.toTickMajorTextColor=function(t,n){return null!=n?n:t.getMajorTickTextColor()},t.prototype.toTickMinorFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null===r)return;if(null!=r)return di.create(r);var e=i.formatter;if(e)return{format:e}}var u=t.getMinorTickTextFormat();if(null!=u)return di.create(u)},t.prototype.toTickMinorText=function(t,n){return{format:(n=n||{}).format,color:this.toTickMinorTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:Ei(n.weight,d),align:this.toTickMinorTextAlign(t,n.align),offset:this.toTickMinorTextOffset(t,n.offset),style:Ei(n.style,g),outline:this.toTickMinorTextOutline(t,n.outline),spacing:this.toTickMinorTextSpacing(t,n.spacing),direction:this.toTickMinorTextDirection(t,n.direction),padding:this.toTickMinorTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toTickMinorTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toTickMinorTextAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMinorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMinorTickTextAlignVertical(e)}},t.prototype.toTickMinorTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMinorTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMinorTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMinorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMinorTickTextPaddingVertical()}},t.prototype.toTickMinorTextDirection=function(t,n){return Ei(null!=n?n:t.getMinorTickTextDirection(),p)},t.prototype.toTickMinorTextColor=function(t,n){return null!=n?n:t.getMinorTickTextColor()},t.prototype.toLabel=function(t,n){var i=null==n?void 0:n.label;if(i)return{value:i.value,color:this.toLabelColor(t,i.color),alpha:i.alpha,family:i.family,size:i.size,weight:Ei(i.weight,d),align:this.toLabelAlign(t,i.align),offset:this.toLabelOffset(t,i.offset),style:Ei(i.style,g),outline:this.toLabelOutline(t,i.outline),spacing:this.toLabelSpacing(t,i.spacing),direction:this.toLabelDirection(t,i.direction),padding:this.toLabelPadding(t,i.padding),clipping:i.clipping}},t.prototype.toLabelOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toLabelAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelAlignVertical(e)}},t.prototype.toLabelOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelPaddingVertical()}},t.prototype.toLabelDirection=function(t,n){return Ei(null!=n?n:t.getLabelDirection(),p)},t.prototype.toLabelColor=function(t,n){return null!=n?n:t.getLabelColor()},t}(),ig=function(){function t(t){this.df=t,this.$e=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.yr;return null==t&&(t=this.newShapes(),this.yr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.df.tick,r=i.major,e=r.gridline;if(i.enable&&e.enable)for(var u=r.capacity,s=null!==(t=e.style)&&void 0!==t?t:G.NONE,h=this.newShapePosition(),o=0;o<u;++o){var a=new Yt;a.points.position=h,a.points.style=s,a.stroke.copy(e.stroke),n.push(a)}return n},t.prototype.newShapePosition=function(){switch(this.df.position){case Qd.LEFT:case Qd.RIGHT:return tt.LEFT;default:return tt.TOP}},t.prototype.bind=function(t,n){this.Bc=t,this.$e=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.yr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.$e=0,this.Bc=void 0},t.prototype.destroy=function(){var t=this.yr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.$e=0,this.Bc=void 0},t}(),rg=function(){function t(t){this.df=t,this.$e=0,this.gf=new ig(t)}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.yr;return null==t&&(t=this.newShapes(),this.yr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.df.tick;if(i.enable)for(var r=i.major,e=r.capacity,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:G.NONE,o=0;o<e;++o){var a=new Yt;a.points.position=s,a.points.size=u,a.points.style=h,a.stroke.copy(r.stroke),a.text.copy(r.text),a.size.set(0,0),n.push(a)}return n},Object.defineProperty(t.prototype,"gridline",{get:function(){return this.gf},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.Bc=t,this.$e=n,this.gf.bind(t,n);for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.yr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.gf.unbind(),this.$e=0,this.Bc=void 0},t.prototype.destroy=function(){var t=this.yr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.gf.destroy(),this.$e=0,this.Bc=void 0},t}(),eg=function(){function t(t){this.df=t,this.$e=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.yr;return null==t&&(t=this.newShapes(),this.yr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.df.tick;if(i.enable)for(var r=i.minor,e=r.count,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:G.NONE,o=0,a=(i.major.capacity+1)*e;o<a;++o){var c=new Yt;c.points.position=s,c.points.size=u,c.points.style=h,c.stroke.copy(r.stroke),c.text.copy(r.text),c.size.set(0,0),n.push(c)}return n},t.prototype.bind=function(t,n){this.Bc=t,this.$e=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.yr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.$e=0,this.Bc=void 0},t.prototype.destroy=function(){var t=this.yr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.$e=0,this.Bc=void 0},t}(),ug=function(){function t(t,n){this.from=t,this.to=n}return t.prototype.set=function(t,n){return null!=t&&(this.from=t),null!=n&&(this.to=n),this},t.prototype.add=function(t,n){return dh(t)||(this.from=dh(this.from)?t:Math.min(this.from,t)),dh(n)||(this.to=dh(this.to)?n:Math.max(this.to,n)),this},t.prototype.clear=function(){return this.from=NaN,this.to=NaN,this},t}(),sg=function(){function t(t,n){this.df=t,this.$e=0,this.mf=this.newMajor(t,n),this.wf=this.newMinor(t,n),this.pf=[],this.Of=[],this.du=new ug(0,0)}return Object.defineProperty(t.prototype,"major",{get:function(){return this.mf},enumerable:!1,configurable:!0}),t.prototype.newMajor=function(t,n){return new rg(t)},Object.defineProperty(t.prototype,"minor",{get:function(){return this.wf},enumerable:!1,configurable:!0}),t.prototype.newMinor=function(t,n){return new eg(t)},t.prototype.bind=function(t,n){this.Bc=t,this.$e=n,this.mf.bind(t,n),this.wf.bind(t,n)},t.prototype.unbind=function(){this.wf.unbind(),this.mf.unbind(),this.$e=0,this.Bc=void 0},t.prototype.update=function(){var t=this.Bc,n=this.mf.shapes,i=this.wf.shapes;if(null!=t&&n&&i){var r=t.plotArea,e=r.container.transform.localTransform,u=this.mf.gridline.shapes,s=this.df,h=s.padding*this.$e,o=this.du,a=void 0;switch(s.position){case Qd.TOP:if(a=r.coordinate.x.get(s.coordinate)){var c=(d=this.getDomain(r,a,o)).from,f=d.to,l=(g=this.getDomainVisible(r,a,o)).from,v=g.to,b=r.height;return this.updateX(c,f,l,v,a,n,i,u,0-h,e,b)}break;case Qd.BOTTOM:var d,g;if(a=r.coordinate.x.get(s.coordinate))return c=(d=this.getDomain(r,a,o)).from,f=d.to,l=(g=this.getDomainVisible(r,a,o)).from,v=g.to,b=r.height,this.updateX(c,f,l,v,a,n,i,u,b+h,e,b);break;case Qd.LEFT:if(a=r.coordinate.y.get(s.coordinate)){var m=(E=this.getRange(r,a,o)).from,w=E.to,p=(M=this.getRangeVisible(r,a,o)).from,O=M.to,D=r.width;return this.updateY(m,w,p,O,a,n,i,u,0-h,e,D)}break;case Qd.RIGHT:var E,M;if(a=r.coordinate.y.get(s.coordinate))return m=(E=this.getRange(r,a,o)).from,w=E.to,p=(M=this.getRangeVisible(r,a,o)).from,O=M.to,D=r.width,this.updateY(m,w,p,O,a,n,i,u,D+h,e,D)}}return!1},t.prototype.getDomain=function(t,n,i){var r=t.getBoundsInContainer(),e=n.transform;return i.set(n.unmap(e.unmap(r.x)),n.unmap(e.unmap(r.x+r.width)))},t.prototype.getDomainVisible=function(t,n,i){return i},t.prototype.getRange=function(t,n,i){var r=t.getBoundsInContainer(),e=n.transform;return i.set(n.unmap(e.unmap(r.y)),n.unmap(e.unmap(r.y+r.height)))},t.prototype.getRangeVisible=function(t,n,i){return i},t.prototype.updateX=function(t,n,i,r,e,u,s,h,o,a,c){var f=this.df.tick,l=f.major,v=l.count,b=l.capacity,d=l.step,g=l.formatter,m=f.minor,w=m.count,p=(b+1)*w,O=m.step,D=m.formatter,E=this.pf,M=this.Of;this.newTicks(e,t,n,i,r,v,b,d,w,p,O,E,M);for(var S=a.a,T=a.tx,j=0;j<b;++j){var N=u[j],I=3*j,C=E[I+0];if(isNaN(C))this.hideMajor(N),j<h.length&&this.hideMajorGridline(h[j]);else{var A=S*E[I+1]+T,R=E[I+2];this.showMajor(N,A,o,null==g?void 0:g.format(C,R)),j<h.length&&this.showMajorGridline(h[j],C,A,.5*c,0,c)}}for(j=0;j<p;++j){var L=s[j],y=3*j,k=M[y+0];if(isNaN(k))this.hideMinor(L);else{var x=S*M[y+1]+T,B=M[y+2];this.showMinor(L,x,o,null==D?void 0:D.format(k,B))}}return!0},t.prototype.updateY=function(t,n,i,r,e,u,s,h,o,a,c){var f=this.df.tick,l=f.major,v=l.count,b=l.capacity,d=l.step,g=l.formatter,m=f.minor,w=m.count,p=(b+1)*w,O=m.step,D=m.formatter,E=this.pf,M=this.Of;this.newTicks(e,t,n,i,r,v,b,d,w,p,O,E,M);for(var S=a.d,T=a.ty,j=0;j<b;++j){var N=u[j],I=3*j,C=E[I+0];if(isNaN(C))this.hideMajor(N),j<h.length&&this.hideMajorGridline(h[j]);else{var A=S*E[I+1]+T,R=E[I+2];this.showMajor(N,o,A,null==g?void 0:g.format(C,R)),j<h.length&&this.showMajorGridline(h[j],C,.5*c,A,c,0)}}for(j=0;j<p;++j){var L=s[j],y=3*j,k=M[y+0];if(isNaN(k))this.hideMinor(L);else{var x=S*M[y+1]+T,B=M[y+2];this.showMinor(L,o,x,null==D?void 0:D.format(k,B))}}return!0},t.prototype.showMajor=function(t,n,i,r){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(n,i),t.text.value=null!=r?r:"",t.allowUploadedUpdate()},t.prototype.showMajorGridline=function(t,n,i,r,e,u){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(i,r),t.size.set(e,u),t.allowUploadedUpdate()},t.prototype.hideMajor=function(t){t.visible=!1},t.prototype.hideMajorGridline=function(t){t.visible=!1},t.prototype.showMinor=function(t,n,i,r){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(n,i),t.text.value=null!=r?r:"",t.allowUploadedUpdate()},t.prototype.hideMinor=function(t){t.visible=!1},t.prototype.newTicks=function(t,n,i,r,e,u,s,h,o,a,c,f,l){t.ticks(n,i,r,e,u,s,h,o,a,c,f,l)},t.prototype.destroy=function(){this.mf.destroy(),this.wf.destroy(),this.$e=0,this.Bc=void 0},t}(),hg=function(){function t(t){var n=this.toTheme(t);this.tn=n;var i=this.newParser(n,t);this.df=i,this.$e=0,this.Df=this.newBar(i,n,t),this.Ef=this.newTick(i,n,t)}return t.prototype.newParser=function(t,n){return new ng(t,n)},Object.defineProperty(t.prototype,"position",{get:function(){return this.df.position},set:function(t){this.df.position=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"coordinate",{get:function(){return this.df.coordinate},set:function(t){this.df.coordinate=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this.df.padding},set:function(t){this.df.padding=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bar",{get:function(){return this.Df},enumerable:!1,configurable:!0}),t.prototype.newBar=function(t,n,i){return new $d(t)},Object.defineProperty(t.prototype,"tick",{get:function(){return this.Ef},enumerable:!1,configurable:!0}),t.prototype.newTick=function(t,n,i){return new sg(t)},t.prototype.bind=function(t,n){this.Bc=t,this.$e=n,this.Df.bind(t,n),this.Ef.bind(t,n)},t.prototype.unbind=function(){this.Ef.unbind(),this.Df.unbind(),this.$e=0,this.Bc=void 0},t.prototype.update=function(){var t=this.Df.update(),n=this.Ef.update();if(t||n){var i=this.Bc;i&&et.update(i.plotArea)}},t.prototype.onRender=function(){this.Df.update(),this.Ef.update()},t.prototype.destroy=function(){this.Df.destroy(),this.Ef.destroy(),this.Bc=void 0},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Y.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartAxisBase"},t}(),og=function(){function t(t,n){this.Mf=t,this.Bc=new je,this.Ln=new Map}return Object.defineProperty(t.prototype,"container",{get:function(){return this.Bc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Mf},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var n=this.Ln,i=n.get(t.position);null==i&&(i=[],n.set(t.position,i)),i.push(t),t.bind(this,i.length-1)},t.prototype.get=function(t,n){var i=this.Ln.get(Ei(t,Qd));return i&&0<=n&&n<i.length?i[n]:null},t.prototype.indexOf=function(t){var n=this.Ln.get(t.position);return n?n.indexOf(t):-1},t.prototype.clear=function(t){var n=this.Ln.get(Ei(t,Qd));if(n){for(var i=0,r=n.length;i<r;++i)n[i].destroy();n.length=0}return this},t.prototype.size=function(t){var n=this.Ln.get(Ei(t,Qd));return n?n.length:0},t.prototype.update=function(){this.Ln.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].update()}))},t.prototype.onRender=function(){this.Ln.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].onRender()}))},t.prototype.destroy=function(){this.Ln.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].destroy();t.length=0}))},t}(),ag=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisX"},n}(hg),cg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisXDatetime"},n}(ag),fg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisY"},n}(hg),lg=[1095651,16667680,15778578,1858929],vg=[lg[0],$t.brighten(lg[0],.4),lg[1],$t.brighten(lg[1],.4),lg[2],$t.brighten(lg[2],.4),lg[3],$t.brighten(lg[3],.4)],bg=function(t){return vg[t%vg.length]},dg={X:0,Y:1},gg=function(){function t(t){this.tn=this.toTheme(t),this.R=0,this.Sf=null==t?void 0:t.translation,this.Tf=0,this.jf=null==t?void 0:t.scaling,this.yn=1,this.Nf=0,this.If=1}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translate",{get:function(){return this.Tf},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this.yn},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.set(0,n===dg.X?1:-1)},t.prototype.unbind=function(){},t.prototype.set=function(t,n){var i=!1;null!=t&&!1!==this.Sf&&this.Tf!==t&&(i=!0,this.Tf=t),null!=n&&!1!==this.jf&&this.yn!==n&&(i=!0,this.yn=n),i&&(this.R+=1,this.If=this.tn.isZero(this.yn)?0:1/this.yn,this.Nf=-this.Tf*this.If)},t.prototype.blend=function(t,n){var i=1-t,r=n.newTranslate*t+n.oldTranslate*i,e=n.newScale*t+n.oldScale*i;this.set(r,e)},t.prototype.map=function(t){return this.Tf+this.yn*t},t.prototype.mapAll=function(t,n,i,r,e){for(var u=this.Tf,s=this.yn,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.unmap=function(t){return this.Nf+this.If*t},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=this.Nf,s=this.If,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Y.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTransform"},t}(),mg=function(){function t(){this.oldTranslate=0,this.oldScale=1,this.newTranslate=0,this.newScale=1}return t.prototype.set=function(t,n){null!=t&&(this.newTranslate=t),null!=n&&(this.newScale=n)},t}(),wg=function(){function t(t){this.R=0,this.Yt=dg.X,this.tn=this.toTheme(t),this.I=this.newTransform(null==t?void 0:t.transform),this.Ef=this.newTick(null==t?void 0:t.tick),this.du=this.newRegion(),this.Cf=this.newMark(),this.It=null==t?void 0:t.from,this.Ct=null==t?void 0:t.to}return t.prototype.newTransform=function(t){return new gg(t)},t.prototype.newRegion=function(){return new ug(NaN,NaN)},t.prototype.newMark=function(){return new mg},Object.defineProperty(t.prototype,"from",{get:function(){return this.It},set:function(t){this.It=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},set:function(t){this.Ct=t},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.Bc=t,this.Yt=n,this.I.bind(t,n)},t.prototype.unbind=function(){this.Bc=void 0,this.I.unbind()},t.prototype.fit=function(t,n){this.doFit(t,n,this.I)},t.prototype.mark=function(t,n){var i=this.Cf,r=this.I;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.I.blend(t,this.Cf)},t.prototype.doFit=function(t,n,i){var r=this.Bc;if(r){var e=r.container.plotArea,u=this.du;switch(this.Yt){case dg.X:this.getPixelDomain(e,u),this.Af(u.from,u.to,this.toFitDomain(t,n,e,u),i);break;case dg.Y:this.getPixelRange(e,u),this.Af(u.from,u.to,this.toFitRange(t,n,e,u),i)}}},t.prototype.getPixelDomain=function(t,n){var i=t.padding;return n.set(i.getLeft(),t.width-i.getRight())},t.prototype.getPixelRange=function(t,n){var i=t.padding;return n.set(t.height-i.getBottom(),i.getTop())},t.prototype.toFitDomain=function(t,n,i,r){return null==t&&(t=this.It),null==n&&(n=this.Ct),null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null==t&&(t=this.It),null==n&&(n=this.Ct),null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.Af=function(t,n,i,r){var e=i.from,u=i.to;if(!dh(e)&&!dh(u)){var s,h=this.map(e),o=this.map(u)-h,a=t-h*(s=this.tn.isZero(o)?n<t?-1:1:(n-t)/o);r.set(a,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.I},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return t},t.prototype.mapAll=function(t,n,i,r,e){},t.prototype.unmap=function(t){return t},t.prototype.unmapAll=function(t,n,i,r,e){},t.prototype.ticks=function(t,n,i,r,e,u,s,h,o,a,c,f){this.Ef.calculate(t,n,i,r,e,u,s,h,o,a,c,f,this)},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Y.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinate"},t}(),pg=function(){function t(t,n){this.Bc=t,this.Yt=n,this.Ln=[]}return Object.defineProperty(t.prototype,"container",{get:function(){return this.Bc},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.Ln;return null==n?i.push(t):0<=n&&n<i.length?i.splice(n,0,t):i.push(t),t.bind(this,this.Yt),this},t.prototype.get=function(t){var n=this.Ln;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Ln.indexOf(t)},t.prototype.remove=function(t){var n=this.Ln;if(wn(t)){if(0<=(r=t)&&r<n.length){var i=n.splice(r,1)[0];return i.unbind(),i}}else{var r,e=t;if(0<=(r=n.indexOf(e)))return n.splice(r,1),e.unbind(),e}return null},t.prototype.clear=function(){for(var t=this.Ln,n=0,i=t.length;n<i;++n)t[n].unbind();return t.length=0,this},t.prototype.destroy=function(){return this.clear()},t.prototype.size=function(){return this.Ln.length},t.prototype.fit=function(t,n){for(var i=this.Ln,r=0,e=i.length;r<e;++r)i[r].fit(t,n);return this},t.prototype.mark=function(t,n){for(var i=this.Ln,r=0,e=i.length;r<e;++r)i[r].mark(t,n);return this},t.prototype.blend=function(t){for(var n=this.Ln,i=0,r=n.length;i<r;++i)n[i].blend(t);return this},t}(),Og=function(){function t(t,n){this.Mf=t;var i=new pg(this,dg.X);this._x=i;var r=new pg(this,dg.Y);if(this._y=r,n){var e=n.x;if(e)if(Lt(e))for(var u=0,s=e.length;u<s;++u)i.add(e[u]);else i.add(e);var h=n.y;if(h)if(Lt(h))for(u=0,s=h.length;u<s;++u)r.add(h[u]);else r.add(h)}}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Mf},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n,i,r){return this._x.fit(t,n),this._y.fit(i,r),this},t.prototype.mark=function(t,n,i,r){return this._x.mark(t,n),this._y.mark(i,r),this},t.prototype.blend=function(t){return this._x.blend(t),this._y.blend(t),this},t}(),Dg=function(){function t(t){this.tn=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.tn.toStep(t,n,i):-1:wn(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:wn(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c,f,l){if(!(e<=0)){var v=l.transform,b=Math.min(t,n),d=Math.max(t,n),g=Math.min(i,r),m=Math.max(i,r),w=l.map(g),p=l.map(m),O=Math.min(w,p),D=Math.max(w,p),E=l.map(b),M=l.map(d),S=Math.min(E,M),T=Math.max(E,M),j=Math.max(O,S),N=Math.min(D,T),I=0,C=0,A=this.toMajorStep(E,M,e,s);if(A<=0)j<=E&&E<=N&&(c[0]=b,c[1]=v.map(E),c[2]=0,I+=1);else for(var R=Math.floor(E/A)-1,L=Math.ceil(M/A)+1,y=this.toMinorStep(A,h,a),k=R;k<=L;++k){var x=k*A;I<u&&j<=x&&x<=N&&(c[0+(P=3*I)]=l.unmap(x),c[P+1]=v.map(x),c[P+2]=A,I+=1);for(var B=0;B<h;B+=1)if(C<o){var _=x+(B+1)*y;j<=_&&_<=N&&(f[0+(U=3*C)]=l.unmap(_),f[U+1]=v.map(_),f[U+2]=y,C+=1)}}for(k=I;k<u;++k){var P;c[0+(P=3*k)]=NaN,c[P+1]=NaN,c[P+2]=NaN}for(k=C;k<o;++k){var U;f[0+(U=3*k)]=NaN,f[U+1]=NaN,f[U+2]=NaN}}},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Y.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),Eg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newTick=function(t){return new Dg(t)},n}(wg),Mg=function(){function t(t){this.tn=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.tn.toStep(t,n,i):-1:wn(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:wn(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c,f,l){if(!(e<=0)){var v=l.transform,b=Math.min(t,n),d=Math.max(t,n),g=Math.min(i,r),m=Math.max(i,r),w=l.map(g),p=l.map(m),O=Math.min(w,p),D=Math.max(w,p),E=l.map(b),M=l.map(d),S=Math.min(E,M),T=Math.max(E,M),j=Math.max(O,S),N=Math.min(D,T),I=0,C=0,A=this.toMajorStep(E,M,e,s);if(A<=0)j<=E&&E<=N&&(c[0]=b,c[1]=v.map(E),c[2]=0,I+=1);else for(var R=Math.floor(E/A)-1,L=Math.ceil(M/A)+1,y=this.toMinorStep(A,h,a),k=R;k<=L;++k){var x=k*A;I<u&&j<=x&&x<=N&&(c[0+(P=3*I)]=l.unmap(x),c[P+1]=v.map(x),c[P+2]=l.unmap(x-1),I+=1);for(var B=0;B<h;B+=1)if(C<o){var _=x+(B+1)*y;j<=_&&_<=N&&(f[0+(U=3*C)]=l.unmap(_),f[U+1]=v.map(_),f[U+2]=l.unmap(_-1),C+=1)}}for(k=I;k<u;++k){var P;c[0+(P=3*k)]=NaN,c[P+1]=NaN,c[P+2]=NaN}for(k=C;k<o;++k){var U;f[0+(U=3*k)]=NaN,f[U+1]=NaN,f[U+2]=NaN}}},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Y.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),Sg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newTick=function(t){return new Mg(t)},n.prototype.map=function(t){return Math.log(Math.max(0,t))/Math.LN10},n.prototype.mapAll=function(t,n,i,r,e){for(var u=1/Math.LN10,s=n+e;s<i;s+=r){var h=t[s];t[s]=Math.log(Math.max(0,h))*u}},n.prototype.unmap=function(t){return Math.pow(10,t)},n.prototype.unmapAll=function(t,n,i,r,e){for(var u=n+e;u<i;u+=r)t[u]=Math.pow(10,t[u])},n}(wg),Tg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegendItem"},n}($i),jg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegend"},n}($i),Ng=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartOverview"},n}($i),Ig=function(n){function i(i){var r=n.call(this)||this,e=r.transform;return r._=new Ci(e.position,i),r.yn=new Ci(e.scale,i),r.Pi=new t.Rectangle,r}return _(i,n),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.yn},enumerable:!1,configurable:!0}),i.prototype.getBounds=function(t,i){return this._lastBoundsID=-1,n.prototype.getBounds.call(this,t,i)},i.prototype.calculateBounds=function(){var t=this._bounds,n=this.du,i=this.Pi,r=this.transform.worldTransform,e=0,u=0,s=0,h=0,o=this.children;if(0<o.length)for(var a=!0,c=0,f=o.length;c<f;++c){var l=o[c];l.visible&&(l.getBoundsInternal(!1,i),a?(a=!1,e=i.x,s=i.y,u=i.x+i.width,h=i.y+i.height):(e=Math.min(e,i.x),s=Math.min(s,i.y),u=Math.max(u,i.x+i.width),h=Math.max(h,i.y+i.height)))}t.clear(),n.set(e,s),r.apply(n,n),t.addPoint(n),n.set(u,h),r.apply(n,n),t.addPoint(n)},i}(je),Cg=function(){function t(){this.shape=null,this.x=0,this.y=0,this.p0x=0,this.p0y=0,this.p1x=0,this.p1y=0,this.index=0,this.t=0,this.distance=0}return t.prototype.copyFrom=function(t){return this.shape=t.shape,this.x=t.x,this.y=t.y,this.p0x=t.p0x,this.p0y=t.p0y,this.p1x=t.p1x,this.p1y=t.p1y,this.index=t.index,this.t=t.t,this.distance=t.distance,this},t}(),Ag=function(){function t(t,n,i){this.enable=t,this.color=n,this.alpha=i}return t.from=function(n,i,r){var e,u,s;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i))},t}(),Rg=function(){function t(){}return t.from=function(t,n){return Lt(t)?function(n){return t[n%t.length]}:at(t)?t:null!=t?function(){return t}:Lt(n)?function(t){return n[t%n.length]}:at(n)?n:function(){return n}},t}(),Lg=function(t){this.enable=Rg.from(null==t?void 0:t.enable,!0),this.color=Rg.from(null==t?void 0:t.color,bg),this.alpha=Rg.from(null==t?void 0:t.alpha,J.FILL_ALPHA)},yg=function(){function t(t,n){this.outer=t,this.inner=n}return t.from=function(n,i,r){var e,u;return new t(null!==(e=null==r?void 0:r.outer)&&void 0!==e?e:n.outer(i),null!==(u=null==r?void 0:r.inner)&&void 0!==u?u:n.inner(i))},t}(),kg=function(t){this.outer=Rg.from(null==t?void 0:t.outer,.2),this.inner=Rg.from(null==t?void 0:t.inner,.1)},xg=function(){function t(t,n){this.x=t,this.y=n}return t.from=function(n,i,r,e,u){var s,h;return new t(null!==(s=null==r?void 0:r.x)&&void 0!==s?s:null!=n.x?n.x(i):e,null!==(h=null==r?void 0:r.y)&&void 0!==h?h:null!=n.y?n.y(i):u)},t}(),Bg=function(t){t&&(null!=t.x&&(this.x=Rg.from(t.x,0)),null!=t.y&&(this.y=Rg.from(t.y,0)))},_g=function(){function t(t,n,i,r,e,u,s){this.enable=t,this.color=n,this.alpha=i,this.width=r,this.align=e,this.side=u,this.style=s}return t.from=function(n,i,r){var e,u,s,h,o,a,c;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i),null!==(h=null==r?void 0:r.width)&&void 0!==h?h:n.width(i),null!==(o=null==r?void 0:r.align)&&void 0!==o?o:n.align(i),null!==(a=null==r?void 0:r.side)&&void 0!==a?a:n.side(i),null!==(c=null==r?void 0:r.style)&&void 0!==c?c:n.style(i))},t}(),Pg=function(t){this.enable=Rg.from(null==t?void 0:t.enable,!0),this.color=Rg.from(null==t?void 0:t.color,bg),this.alpha=Rg.from(null==t?void 0:t.alpha,J.STROKE_ALPHA),this.width=Rg.from(null==t?void 0:t.width,J.STROKE_WIDTH),this.align=Rg.from(null==t?void 0:t.width,J.STROKE_ALIGN),this.side=Rg.from(null==t?void 0:t.side,Ht.ALL),this.style=Rg.from(null==t?void 0:t.style,s.NON_SCALING)},Ug=function(){function t(t,n){var i;this.Mf=t,this.Rf=new ug(NaN,NaN),this.Lf=new ug(NaN,NaN),this.zc=null!==(i=null==n?void 0:n.selection)&&void 0!==i?i:null,this.C=new Lg(null==n?void 0:n.fill),this.wo=new Pg(null==n?void 0:n.stroke),this.j=new Bg(null==n?void 0:n.size),this.en=new Bg(null==n?void 0:n.offset),this.Vn=new kg(null==n?void 0:n.padding),this.Ln=[]}return t.prototype.newFill=function(t,n){return Ag.from(this.C,t,n)},t.prototype.newStroke=function(t,n){return _g.from(this.wo,t,n)},t.prototype.newSize=function(t,n,i,r){return xg.from(this.j,t,n,i,r)},t.prototype.newOffset=function(t,n,i,r){return xg.from(this.en,t,n,i,r)},t.prototype.newPadding=function(t,n){return yg.from(this.Vn,t,n)},Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Mf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.zc},enumerable:!1,configurable:!0}),t.prototype.update=function(){for(var t=this.Ln,n=0,i=t.length;n<i;++n)t[n].update();var r=this.zc;r&&r.update()},t.prototype.onRender=function(){for(var t=this.Ln,n=0,i=t.length;n<i;++n)t[n].onRender();var r=this.zc;r&&r.onRender()},t.prototype.add=function(t){var n=this.Ln;t.bind(this,n.length),n.push(t)},t.prototype.get=function(t){var n=this.Ln;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Ln.indexOf(t)},t.prototype.clear=function(){for(var t=this.Ln,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Ln.length},t.prototype.destroy=function(){this.clear();var t=this.zc;t&&t.unbind()},t.prototype.getDomain=function(t,n){n.clear();for(var i=this.Ln,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.x===t){var s=u.domain;n.add(s.from,s.to)}}return n},t.prototype.getRange=function(t,n){n.clear();for(var i=this.Ln,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.y===t){var s=u.range;n.add(s.from,s.to)}}return n},Object.defineProperty(t.prototype,"domain",{get:function(){var t=this.Rf;t.clear();for(var n=this.Ln,i=0,r=n.length;i<r;++i){var e=n[i].domain;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.Lf;t.clear();for(var n=this.Ln,i=0,r=n.length;i<r;++i){var e=n[i].range;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(t,n){for(var i=this.Ln,r=i.length-1;0<=r;--r){var e=i[r];if(e.hitTest(t,n))return e}return null},t.prototype.calcHitPoint=function(n,i,r){var e=r,u=t.WORK_CALCHITPOINT,s=this.Ln,h=null;u.distance=1/0;for(var o=s.length-1;0<=o;--o){var a=s[o];if(a.calcHitPoint(n,i,e)&&e.distance<u.distance){h=a;var c=e;e=u,u=c}}return h&&u!==r&&r.copyFrom(u),h},t.WORK_CALCHITPOINT=new Cg,t}(),Fg=function(n){function i(t,i){var r=n.call(this,i)||this;return r.yf=t,r.kf=0,r.xf=1e3,r.Bf=null,r._f=function(){r.onBlend()},r}return _(i,n),i.prototype.init=function(i){var r,e=this;n.prototype.init.call(this,i),this.Pf=!0,this.Uf=new t.Rectangle,this.Oc=new t.Point;var u=new Ig((function(){e.Ff=!0,e.Pf=!0,et.update(e)}));this.Bc=u,this.addChild(u),this.Ff=!0,this.er=new lr(this,(function(){return u}),null==i?void 0:i.view),this.Gf=new Og(this,null==i?void 0:i.coordinate);var s=new Ug(this,null==i?void 0:i.series);this.Hf=s;var h=new og(this,null==i?void 0:i.axis);this.zf=h,this.addChild(h.container);var o=s.selection;if(o&&o.bind(s),(null!==(r=null==i?void 0:i.mask)&&void 0!==r?r:this.theme.isOverflowMaskEnabled())&&(u.mask=this.getOverflowMask()),null!=i){var a=i.series;if(null!=a&&(l=a.list)){var c=l.length;if(0<c){for(var f=0;f<c;++f)s.add(l[f]);s.update()}}var l,v=i.axis;if(null!=v&&(l=v.list)){f=0;for(var b=l.length;f<b;++f)h.add(l[f])}}},i.prototype.onResize=function(t,i,r,e){this.Ff=!0,this.Pf=!0,n.prototype.onResize.call(this,t,i,r,e)},i.prototype.getOverflowMask=function(){return null==this.ur&&(this.ur=new tr(this),this.reflowable.add(this.ur),this.toDirty()),this.ur},Object.defineProperty(i.prototype,"chart",{get:function(){return this.yf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.Gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"series",{get:function(){return this.Hf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"container",{get:function(){return this.Bc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"axis",{get:function(){return this.zf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"view",{get:function(){return this.er},enumerable:!1,configurable:!0}),i.prototype.onWheel=function(t,i,r){var e=this.er.onWheel(t,i,r),u=n.prototype.onWheel.call(this,t,i,r);return e||u},i.prototype.onDblClick=function(t,i){var r=this.er.onDblClick(t,i),e=n.prototype.onDblClick.call(this,t,i);return r||e},i.prototype.onDown=function(t){this.er.onDown(t),n.prototype.onDown.call(this,t)},i.prototype.render=function(t){this.Ff&&(this.Ff=!1,this.Gf.fit(),this.zf.onRender(),this.Hf.onRender()),n.prototype.render.call(this,t)},i.prototype.destroy=function(){this.Bc.destroy(),this.Hf.destroy(),this.zf.destroy()},i.prototype.getType=function(){return"DChartPlotArea"},i.prototype.getBoundsInContainer=function(){var t=this.Uf;if(this.Pf){this.Pf=!1;var n=this.container;n.updateTransform();var i=n.transform.localTransform,r=this.Oc;r.set(0,0),i.applyInverse(r,r),t.x=r.x,t.y=r.y,r.set(this.width,this.height),i.applyInverse(r,r),t.width=r.x-t.x,t.height=r.y-t.y}return t},i.prototype.fit=function(t,n,i,r,e){var u=this.Gf,s=this.zf,h=this.Hf;if(null!=t&&t<=0)u.fit(n,i,r,e),s.update(),h.update();else{this.xf=null!=t?t:200,this.kf=Date.now(),u.mark(n,i,r,e);var o=this.Bf;null!=o&&window.clearTimeout(o),this.Bf=window.setTimeout(this._f,0)}return this},i.prototype.onBlend=function(){var t=(Date.now()-this.kf)/this.xf;t<1?this.Bf=window.setTimeout(this._f,0):(this.Bf=null,t=1),this.Gf.blend(ur.ELASTIC(t)),this.zf.update(),this.Hf.update()},i}($i),Gg=function(){function t(t,n,i){this.It=t,this.Ct=n,this.Z=i}return Object.defineProperty(t.prototype,"from",{get:function(){return this.It},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;return null!=t&&this.It!==t&&(dh(this.It)&&dh(t)||(this.It=t,i=!0)),null!=n&&this.Ct!==n&&(dh(this.Ct)&&dh(n)||(this.Ct=n,i=!0)),i&&this.Z(),this},t.prototype.add=function(t,n){var i,r;return dh(t)||(i=dh(this.from)?t:Math.min(this.from,t)),dh(n)||(r=dh(this.to)?n:Math.max(this.to,n)),this.set(i,r)},t.prototype.clear=function(){return this.set(NaN,NaN)},t}(),Hg=function(){function t(t,n){this._x=t,this._y=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),t.prototype.bind=function(t){this._x.bind(t),this._y.bind(t)},t.prototype.unbind=function(){this._x.unbind(),this._y.unbind()},t.prototype.set=function(t,n,i,r){this._x.set(t,n,i,r),this._y.set(t,n,i,r)},t.prototype.unset=function(){this._x.unset(),this._y.unset()},t.prototype.update=function(t,n,i){var r=this._x.update(t,n,i),e=this._y.update(t,n,i);return r||e},t}(),zg=function(){function t(t){var n,i,r,e=this.toTheme(t);this.tn=e;var u=(new ft).add(null!==(n=null==t?void 0:t.state)&&void 0!==n?n:ot.HOVERED);if(this.Mt=u,this.es=null!==(i=null==t?void 0:t.enable)&&void 0!==i?i:e.isEnabled(u),null!=t){var s=t.shape;null!=s&&(at(s)?this.Vf=s:this.Pr=s)}this.B=null!==(r=null==t?void 0:t.style)&&void 0!==r?r:this.setStyle}return t.prototype.bind=function(t){if(this.es){var n=this.Pr;if(null==n){var i=this.Mt,r=this.Vf;n=null!=r?r(i):this.newShape(i,this.tn)}this.Pr=n,n.attach(t.plotArea.axis.container),n.visible=!1}},t.prototype.unbind=function(){var t=this.Pr;t&&t.detach()},t.prototype.newShape=function(t,n){return n.newShape(t)},t.prototype.set=function(t,n,i,r){this.update(t,n,i);var e=this.Pr;e&&this.B(e,r)},t.prototype.setStyle=function(t,n){},t.prototype.unset=function(){var t=this.Pr;t&&(t.visible=!1)},t.prototype.toTheme=function(t){var n=null==t?void 0:t.theme;return ct(n)?this.getTheme(n):null!=n?n:this.getTheme(this.getType())},t.prototype.getTheme=function(t){return Y.getInstance().get(t)},t}(),Vg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Pr;if(r){var e=i.x,u=t.plotArea.height;return r.transform.position.set(e,.5*u),r.size.set(0,u),r.visible=this.isVisible(t,n,i),!0}return!1},n.prototype.isVisible=function(t,n,i){var r=i.x;return 0<=r&&r<=t.plotArea.width},n.prototype.getType=function(){return"DChartSelectionGridlineX"},n}(zg),Wg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Pr;if(r){var e=i.y,u=t.plotArea.width;return r.transform.position.set(.5*u,e),r.size.set(u,0),r.visible=this.isVisible(t,n,i),!0}return!1},n.prototype.isVisible=function(t,n,i){var r=i.y;return 0<=r&&r<=t.plotArea.height},n.prototype.getType=function(){return"DChartSelectionGridlineY"},n}(zg),Xg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Pr;return!!r&&(r.transform.position.copyFrom(i),r.visible=this.isVisible(t,n,i),!0)},n.prototype.isVisible=function(t,n,i){var r=i.x,e=i.y,u=t.plotArea;return 0<=r&&r<=u.width&&0<=e&&e<=u.height},n.prototype.getType=function(){return"DChartSelectionMarker"},n}(zg),Kg={PREVIOUS:0,NEXT:1,CLOSER:2,INTERSECTION:3},Yg=function(n){function i(i){var r,e,u,s,h,o=this;(o=n.call(this)||this).Bc=null,o.Hf=null,o.es=null===(r=i.enable)||void 0===r||r,o.gf=new Hg(new Vg(null===(e=i.gridline)||void 0===e?void 0:e.x),new Wg(null===(u=i.gridline)||void 0===u?void 0:u.y)),o.A=new Xg(i.marker),o.Mt=null!==(s=i.state)&&void 0!==s?s:ot.HOVERED,o.Wf=null,o.Xf=null,o._=new t.Point,o.cn=null!==(h=i.point)&&void 0!==h?h:Kg.CLOSER,o.du=new t.Point;var a=i.on;if(a)for(var c in a){var f=a[c];f&&o.on(c,f)}return o}return _(i,n),i.prototype.bind=function(t){this.es&&(this.Bc=t,this.gf.bind(t),this.A.bind(t))},i.prototype.unbind=function(){this.A.unbind(),this.gf.unbind(),this.Bc=null,this.Wf=null,this.Xf=null},Object.defineProperty(i.prototype,"series",{get:function(){return this.Hf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gridline",{get:function(){return this.gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"marker",{get:function(){return this.A},enumerable:!1,configurable:!0}),i.prototype.set=function(t,n){var i=this.Bc,r=this.Wf=t.coordinate.x,e=this.Xf=t.coordinate.y;if(i&&r&&e){var u=i.plotArea.container.localTransform,s=this._,h=this.du;if(n instanceof Cg){var o=n.x,a=n.y;switch(this.cn){case Kg.PREVIOUS:o=n.p0x,a=n.p0y;break;case Kg.NEXT:o=n.p1x,a=n.p1y;break;case Kg.CLOSER:Math.abs(n.p0x-n.x)<Math.abs(n.p1x-n.x)?(o=n.p0x,a=n.p0y):(o=n.p1x,a=n.p1y)}h.set(o,a),u.apply(h,h),s.set(r.unmap(r.transform.unmap(o)),e.unmap(e.transform.unmap(a)))}else s.copyFrom(n.position),h.set(r.transform.map(r.map(s.x)),e.transform.map(e.map(s.y))),u.apply(h,h);this.gf.set(i,s,h,t),this.A.set(i,s,h,t),et.update(i.plotArea)}var c=this.Hf;if(c!==t){var f=this.Mt;c&&c.state.remove(f),this.Hf=t,t.state.add(f)}this.emit("change",this)},i.prototype.unset=function(){var t=this.Hf;t&&(this.Hf=null,this.Wf=null,this.Xf=null,t.state.remove(this.Mt),this.gf.unset(),this.A.unset(),this.emit("change",this))},i.prototype.update=function(){var t=this.Bc,n=this.Wf,i=this.Xf;if(t&&n&&i){var r=this._,e=this.du;e.set(n.transform.map(n.map(r.x)),i.transform.map(i.map(r.y))),t.plotArea.container.localTransform.apply(e,e);var u=this.gf.update(t,r,e),s=this.A.update(t,r,e);return u||s}return!1},i}(t.utils.EventEmitter),Jg=function(t){function n(n){var i,r=this;(r=t.call(this)||this).Bc=null;var e=Ei(null!==(i=null==n?void 0:n.point)&&void 0!==i?i:Kg.CLOSER,Kg);r.Pa=r.newSelected(e,null==n?void 0:n.selected),r.Kf=r.newHovered(e,null==n?void 0:n.hovered);var u=null==n?void 0:n.on;if(null!=u)for(var s in u){var h=u[s];h&&r.on(s,h)}return r.Yf=function(t){r.onMove(t)},r.Jf=function(t){r.onClick(t)},r}return _(n,t),n.prototype.newSelected=function(t,n){return new Yg(this.toSelectedOptions(t,n))},n.prototype.newHovered=function(t,n){return new Yg(this.toHoveredOptions(t,n))},n.prototype.toSelectedOptions=function(t,n){return this.toSubOptions(t,n,ot.ACTIVE)},n.prototype.toHoveredOptions=function(t,n){return this.toSubOptions(t,n,ot.HOVERED)},n.prototype.toSubOptions=function(t,n,i){var r,e,u,s,h,o,a;null==(n=n||{}).point&&(n.point=t),null==n.state&&(n.state=i);var c=null!==(r=n.gridline)&&void 0!==r?r:n.gridline={},f=null!==(e=c.x)&&void 0!==e?e:c.x={};null==f.state&&(f.state=i);var l=null!==(u=c.y)&&void 0!==u?u:c.y={};null==l.state&&(l.state=i);var v=null!==(s=n.marker)&&void 0!==s?s:n.marker={};null==v.state&&(v.state=i);var b=null!==(h=n.label)&&void 0!==h?h:n.label={},d=null!==(o=b.x)&&void 0!==o?o:b.x={};null==d.state&&(d.state=i);var g=null!==(a=b.y)&&void 0!==a?a:b.y={};return null==g.state&&(g.state=i),n},n.prototype.onClick=function(t){var i=this.Bc;if(i&&t.target===i.plotArea){var r=n.WORK_SELECT,e=t.data.global,u=i.calcHitPoint(e.x,e.y,r),s=this.Pa;u?s.set(u,r):s.unset()}},n.prototype.onMove=function(t){var i=this.Bc;if(i){var r=this.Kf;if(t.target===i.plotArea){var e=n.WORK_SELECT,u=t.data.global,s=i.calcHitPoint(u.x,u.y,e);s?r.set(s,e):r.unset()}else r.unset()}},n.prototype.bind=function(t){this.Bc=t,this.Pa.bind(t),this.Kf.bind(t);var n=t.plotArea;n.on(Yi.move,this.Yf),n.on(Yi.tap,this.Jf)},n.prototype.unbind=function(){var t=this.Bc;this.Bc=null,t&&t.plotArea.off(Yi.move,this.Yf),this.Pa.unbind(),this.Kf.unbind()},Object.defineProperty(n.prototype,"selected",{get:function(){return this.Pa},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hovered",{get:function(){return this.Kf},enumerable:!1,configurable:!0}),n.prototype.update=function(){var t=this.Pa.update(),n=this.Kf.update();if(t||n){var i=this.Bc;null!=i&&et.update(i.plotArea)}},n.prototype.onRender=function(){this.Pa.update(),this.Kf.update()},n.WORK_SELECT=new Cg,n}(t.utils.EventEmitter),Zg=function(){function t(t,n){var i,r;this.p=t,this.Zf=null!==(i=null==n?void 0:n.x)&&void 0!==i?i:0,this.qf=null!==(r=null==n?void 0:n.y)&&void 0!==r?r:0,this.Qf=NaN,this.$f=NaN,this.tl=NaN,this.nl=NaN}return Object.defineProperty(t.prototype,"x",{get:function(){var t=this.p.container;return t?t.plotArea.coordinate.x.get(this.Zf):null},set:function(t){var n=this.toIndexX(t);this.Zf!==n&&(this.Zf=n,this.Qf=NaN,this.tl=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexX=function(t){if(wn(t))return t;if(null!=t){var n=this.p.container;if(n)return n.plotArea.coordinate.x.indexOf(t)}return-1},Object.defineProperty(t.prototype,"y",{get:function(){var t=this.p.container;return t?t.plotArea.coordinate.y.get(this.qf):null},set:function(t){var n=this.toIndexY(t);this.qf!==n&&(this.qf=n,this.$f=NaN,this.nl=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexY=function(t){if(wn(t))return t;if(null!=t){var n=this.p.container;if(n)return n.plotArea.coordinate.y.indexOf(t)}return-1},t.prototype.isDirty=function(t,n){var i=t.id,r=n.id,e=i!==this.Qf,u=r!==this.$f;return this.Qf=i,this.$f=r,e||u},t.prototype.isTransformDirty=function(t,n){var i=t.transform.id,r=n.transform.id,e=i!==this.tl,u=r!==this.nl;return this.tl=i,this.nl=r,e||u},t.prototype.reset=function(){this.Qf=NaN,this.$f=NaN},t.prototype.destroy=function(){this.reset()},t}(),qg=function(t){function n(n){var i=t.call(this)||this;i.Gf=new Zg(i,null==n?void 0:n.coordinate),i.$e=0,i.Rf=new ug(NaN,NaN),i.Lf=new ug(NaN,NaN),i.il=NaN,i.rl=!0,i.Mt=new lt((function(t,n){i.onStateChange(t,n)}));var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i}return _(n,t),n.prototype.bind=function(t,n){this.Bc=t,this.Gf.reset(),this.$e=n;var i=t.plotArea.chart;return i&&(this.Mt.parent=i.state),this},n.prototype.unbind=function(){return this.Bc=void 0,this},Object.defineProperty(n.prototype,"domain",{get:function(){return this.updateRegion(),this.Rf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"range",{get:function(){return this.updateRegion(),this.Lf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"container",{get:function(){return this.Bc||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.$e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinate",{get:function(){return this.Gf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),n.prototype.show=function(){return!0!==this.rl&&(this.rl=!0,this.onShow()),this},n.prototype.onShow=function(){var t=this.shape;null!=t&&(t.visible=!0)},n.prototype.isShown=function(){return this.rl},n.prototype.hide=function(){return!1!==this.rl&&(this.rl=!1,this.onHide()),this},n.prototype.onHide=function(){var t=this.shape;null!=t&&(t.visible=!1)},n.prototype.isHidden=function(){return!this.rl},n.prototype.destroy=function(){return this.Bc=void 0,this.Gf.destroy(),this},n.prototype.hitTest=function(t,n){return!1},n.prototype.calcHitPoint=function(t,n,i){return!1},n.prototype.onStateChange=function(t,n){var i;this.toDirty();var r=null===(i=this.Bc)||void 0===i?void 0:i.plotArea.chart;et.update(r),this.emit("statechange",t,n,this)},n}(t.utils.EventEmitter),Qg=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).el=null,r.xn=t,r.gt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.ul=0,r.sl=NaN,r}return _(i,n),i.prototype.getSizeDefault=function(){return 10},i.prototype.getOffsetDefault=function(){return 0},i.prototype.bind=function(t,i){var r=this.el;if(!r){(r=this.el=this.newLineOfAny()).visible=this.rl;var e=this.xn;this.initLine(r,e,t,i)}return r.attach(t.plotArea.container,i),this.sl=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.initLine=function(t,n,i,r){var e=i.newFill(r,null==n?void 0:n.fill);this.C=e,t.fill.copy(e);var u=i.newStroke(r,null==n?void 0:n.stroke);this.wo=u,t.stroke.copy(u);var s=this.getSizeDefault(),h=i.newSize(r,null==n?void 0:n.size,s,s);this.j=h,t.points.size.set(h.x,h.y);var o=this.getOffsetDefault(),a=i.newOffset(r,n&&n.offset,o,o);this.en=a,t.points.offset.set(a.x,a.y)},i.prototype.unbind=function(){var t=this.el;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},set:function(t){this.gt=t,this.ul+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.ul+=1,this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.el;if(n){var i=this.Gf,r=i.x,e=i.y;if(r&&e){var u=this.ul,s=u!==this.sl,h=i.isDirty(r,e),o=i.isTransformDirty(r,e);if(s||h||o)return this.sl=u,this.doUpdateLine(n,r,e),t&&et.update(n),!0}}return!1},i.prototype.doUpdateLine=function(t,n,r){for(var e=t.points.values,u=e.length,s=0,h=this.gt,o=NaN,a=NaN,c=NaN,f=NaN,l=0,v=h.length;l<v;l+=2){var b=h[l],d=h[l+1];null!=b&&null!=d&&(s<u?(e[s]=b,e[s+1]=d):e.push(b,d),s+=2,o!=o?(o=b,a=b,c=d,f=d):(o=Math.min(o,b),a=Math.max(a,b),c=Math.min(c,d),f=Math.max(f,d)))}e.length!==s&&(e.length=s),n.mapAll(e,0,s,2,0),r.mapAll(e,0,s,2,1),n.transform.mapAll(e,0,s,2,0),r.transform.mapAll(e,0,s,2,1),o!=o&&(o=0,a=0,c=0,f=0);var g=i.WORK_REGION||{xmin:0,xmax:0,ymin:0,ymax:0};i.WORK_REGION=g,this.adjustLineRegion(o,a,c,f,g),o=n.transform.map(n.map(g.xmin)),a=n.transform.map(n.map(g.xmax)),c=r.transform.map(r.map(g.ymin)),f=r.transform.map(r.map(g.ymax));var m=Math.abs(a-o),w=Math.abs(f-c),p=.5*(o+a),O=.5*(c+f);for(l=0,v=e.length;l<v;l+=2)e[l+0]-=p,e[l+1]-=O;t.disallowUploadedUpdate(),this.applyLine(t,n,r,m,w,p,O,e),t.allowUploadedUpdate()},i.prototype.adjustLineRegion=function(t,n,i,r,e){return e.xmin=t,e.xmax=n,e.ymin=i,e.ymax=r,e},i.prototype.applyLine=function(t,n,i,r,e,u,s,h){t.points.set(h),t.size.set(r,e),t.transform.position.set(u,s)},i.prototype.updateRegion=function(){var t=this.ul;if(this.il!==t){this.il=t;var n=this.gt,i=this.Rf,r=this.Lf;i.clear(),r.clear(),this.calcRegion(n,i,r)}},i.prototype.calcRegion=function(t,n,i){for(var r=0,e=t.length;r<e;r+=2){var u=t[r];null!=u&&n.add(u,u);var s=t[r+1];null!=s&&i.add(s,s)}},i.prototype.destroy=function(){var t=this.el;return t&&(this.el=null,t.detach(),t.destroy()),this.gt.length=0,this.ul=0,this.sl=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.el;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.el;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,null,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.calcHitPointTestRange=function(t,n,i,r,e,u,s,h,o){for(var a=tb(h,t+i+e,2,0),c=0,f=a-1,l=f<<1;0<=f;f-=1,l-=2)if(h[l]<=t-i){c=f;break}return o[0]=c,o[1]=c!==a?a:Math.min(h.length<<1,a+1),o},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v){var b=v.shape;if(b.containsPointAbs(t,n,i,r,e,u,s,h,o,a,c)){var d=b.transform,g=d.position,m=d.scale;v.x=v.p0x=v.p1x=g.x+m.x*s,v.y=v.p0y=v.p1y=g.y+m.y*h,v.t=l,v.index=f;var w=t-(s+e),p=n-(h+u);return v.distance=Math.sqrt(w*w+p*p),!0}return!1},i.WORK=new t.Point,i}(qg),$g=function(t){function n(n){var i=t.call(this,n)||this;return i.hl=-1,i.ol=-1,i.al=-1,i.cl=-1,i.fl=!1!==(n&&n.size&&n.size.auto),i}return _(n,t),n.prototype.bind=function(n,i){return this.hl=-1,this.ol=-1,this.al=-1,this.cl=-1,t.prototype.bind.call(this,n,i),this},n.prototype.initLine=function(n,i,r,e){t.prototype.initLine.call(this,n,i,r,e),this.Vn=r.newPadding(e,i&&i.padding)},n.prototype.newLineOfAny=function(){return new df},n.prototype.getSizeDefault=function(){return 1},n.prototype.adjustLineRegion=function(n,i,r,e,u){return t.prototype.adjustLineRegion.call(this,n,i,Math.min(0,r),Math.max(0,e),u)},n.prototype.updateBarCountAndIndex=function(){if(this.ol<0||this.hl<0){var t=0,i=0,r=this.Bc;if(r)for(var e=0,u=r.size();e<u;++e){var s=r.get(e);s===this&&(t=i),s instanceof n&&(i+=1)}return i=Math.max(1,i),this.hl=i,this.ol=t,!0}return!1},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=n.points,c=a.offset,f=a.size,l=this.j,v=this.en,b=this.Vn;if(l&&v&&b){var d=i.id,g=i.transform.id;if(this.updateBarCountAndIndex()||this.al!==d||this.cl!==g){var m=this.hl,w=this.ol;this.al=d,this.cl=g;var p=i.transform.map(i.map(0)),O=i.transform.map(i.map(l.x)),D=Math.abs(p-O)*(1-b.outer);if(m<=1)c.x=v.x,f.x=D;else{var E=D*(1-b.inner),M=E/m,S=M*(w+.5)+w*((D-E)/(m-1));c.x=v.x+S-.5*D,f.x=M}}}var T=f.y;Lt(T)||(T=[]);var j=T.length,N=c.y;Lt(N)||(N=[]);for(var I=N.length,C=0,A=r.transform.map(r.map(0))-h,R=0,L=o.length;R<L;R+=2,C+=1){var y=o[R+1]-A,k=Math.abs(y);C<j?T[C]=k:T.push(k);var x=-.5*y;C<I?N[C]=x:N.push(x)}T.length!==C&&(T.length=C),N.length!==C&&(N.length=C),c.y=N,f.y=T,t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n.prototype.calcSizeX=function(t){var n=this.gt;if(2<n.length)for(var i=n.length,r=n[i-2],e=i-4;0<=e;e-=2){var u=n[e];if(null!=r&&null!=u)return Math.abs(r-u);r=u}return t},n.prototype.calcRegion=function(n,i,r){t.prototype.calcRegion.call(this,n,i,r);var e=this.j;if(e){var u=e.x;this.fl&&(u=this.calcSizeX(u),e.x=u);var s=.5*u;i.set(i.from-s,i.to+s)}r.add(0,0)},n}(Qg),tm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new uf},n}(Qg),nm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new cf},n}(Qg),im=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new df},n}(Qg),rm=function(t){function n(n){var i=t.call(this,n)||this;return i.ll=0,i}return _(n,t),n.prototype.newLineOfAny=function(){return new _f},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=this.j,c=this.en;a&&c&&this.ll!==a.y&&(this.ll=a.y,n.points.offset.y=c.y-.2*a.y),t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n}(Qg),em=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Rf},n}(rm),um=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).el=null,r.xn=t,r.gt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.ul=0,r.sl=NaN,r.vl=0,r.bl=0,r}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.el;if(!e){var u=t.newStroke(i,null===(r=this.xn)||void 0===r?void 0:r.stroke);this.wo=u,(e=new kc).stroke.copy(u),e.visible=this.rl,this.el=e}return e.attach(t.plotArea.container,i),this.sl=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.el;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},set:function(t){this.gt=t,this.ul+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.ul+=1,this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.el;if(n){var i=this.Gf,r=i.x,e=i.y;if(r&&e){var u=this.ul,s=u!==this.sl,h=i.isDirty(r,e),o=i.isTransformDirty(r,e);if(s||h||o)return this.sl=u,this.doUpdateLine(n,r,e,s||h),t&&et.update(n),!0}}return!1},i.prototype.doUpdateLine=function(t,n,i,r){if(t.disallowUploadedUpdate(),r){for(var e=t.points.values,u=t.points.segments,s=e.length,h=u.length,o=0,a=0,c=this.gt,f=NaN,l=NaN,v=NaN,b=NaN,d=0,g=c.length;d<g;d+=2){var m=c[d],w=c[d+1];if(null!=m&&null!=w)o<s?(e[o]=m,e[o+1]=w):e.push(m,w),o+=2,f!=f?(f=m,l=m,v=w,b=w):(f=Math.min(f,m),l=Math.max(l,m),v=Math.min(v,w),b=Math.max(b,w));else{var p=(d>>1)-a;a<h?u[a]=p:u.push(p),a+=1}}e.length!==o&&(e.length=o),u.length!==a&&(u.length=a),n.mapAll(e,0,o,2,0),i.mapAll(e,0,o,2,1),f!=f&&(f=0,l=0,v=0,b=0),f=n.map(f),l=n.map(l),v=i.map(v),b=i.map(b);var O=Math.abs(l-f),D=Math.abs(b-v),E=.5*(f+l),M=.5*(v+b);for(d=0,g=e.length;d<g;d+=2)e[d+0]-=E,e[d+1]-=M;t.size.set(O,D),t.points.set(e,u),this.vl=E,this.bl=M}t.transform.position.set(n.transform.map(this.vl),i.transform.map(this.bl)),t.transform.scale.set(n.transform.scale,i.transform.scale),t.allowUploadedUpdate()},i.prototype.updateRegion=function(){var t=this.ul;if(this.il!==t){this.il=t;var n=this.gt,i=this.Rf,r=this.Lf;if(i.clear(),r.clear(),null!=n)for(var e=0,u=n.length;e<u;e+=2){var s=n[e];null!=s&&i.add(s,s);var h=n[e+1];null!=h&&r.add(h,h)}}},i.prototype.destroy=function(){var t=this.el;return t&&(this.el=null,t.detach(),t.destroy()),this.gt.length=0,this.ul=0,this.sl=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.el;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.el;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointTestRange=function(t,n,i,r,e){var u=tb(r,t,2,0);return e[0]=Math.max(0,u-1),e[1]=u,e},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=g+p*f,o.y=m+O*l,o.p0x=g+p*i,o.p0y=m+O*r,o.p1x=g+p*e,o.p1y=m+O*u,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(qg),sm=function(){function t(t,n,i,r){this.R=0,this.dl=NaN,this._a=t,this._b=n,this._x0=i,this._y0=r}return Object.defineProperty(t.prototype,"a",{get:function(){return this._a},set:function(t){this._a!==t&&(this.R+=1,this._a=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},set:function(t){this._b!==t&&(this.R+=1,this._b=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x0",{get:function(){return this._x0},set:function(t){this._x0!==t&&(this.R+=1,this._x0=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y0",{get:function(){return this._y0},set:function(t){this._y0!==t&&(this.R+=1,this._y0=t)},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.R+=1},t.prototype.isDirty=function(){return this.R!==this.dl},t.prototype.toClean=function(){this.dl=this.R},t.from=function(n){var i,r,e,u;return new t(null!==(i=null==n?void 0:n.a)&&void 0!==i?i:1,null!==(r=null==n?void 0:n.b)&&void 0!==r?r:1,null!==(e=null==n?void 0:n.x0)&&void 0!==e?e:0,null!==(u=null==n?void 0:n.y0)&&void 0!==u?u:0)},t}(),hm=function(n){function i(t){var i=n.call(this,t)||this;return i.el=null,i.xn=t,i.ml=sm.from(t),i}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.el;if(!e){var u=t.newStroke(i,null===(r=this.xn)||void 0===r?void 0:r.stroke);this.wo=u,(e=new kc).stroke.copy(u),e.visible=this.rl,this.el=e}return e.attach(t.plotArea.container,i),n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.el;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parameters",{get:function(){return this.ml},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.ml.toDirty(),this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.el,i=this.Bc;if(n&&i){var r=this.Gf,e=r.x,u=r.y;if(e&&u)return this.doUpdateLine(n,i,e,u),t&&et.update(n),!0}return!1},i.prototype.doUpdateLine=function(t,n,i,r){var e=t.points.values,u=t.points.segments,s=this.ml,h=s.a,o=s.b,a=s.x0,c=s.y0,f=Math.abs(h),l=Math.abs(o),v=NaN,b=NaN,d=NaN,g=NaN,m=1e-5,w=n.plotArea.getBoundsInContainer();if(l<=f){var p=i.unmap(i.transform.unmap(w.x)),O=i.unmap(i.transform.unmap(w.x+w.width));v=Math.min(p,O),d=Math.max(p,O);var D=r.unmap(r.transform.unmap(w.y)),E=r.unmap(r.transform.unmap(w.y+w.height));if(b=Math.min(D,E),g=Math.max(D,E),m<l){var M=(N=o/h)*(D-c)+a,S=N*(E-c)+a,T=Math.min(M,S),j=Math.max(M,S);b=(I=1/N)*((v=Math.max(v,T))-a)+o*c,g=I*((d=Math.min(d,j))-a)+o*c}else v=a,d=a}else if(D=r.unmap(r.transform.unmap(w.y)),E=r.unmap(r.transform.unmap(w.y+w.height)),b=Math.min(D,E),g=Math.max(D,E),p=i.unmap(i.transform.unmap(w.x)),O=i.unmap(i.transform.unmap(w.x+w.width)),v=Math.min(p,O),d=Math.max(p,O),m<f){var N,I,C=(N=h/o)*(p-a)+c,A=N*(O-a)+c,R=Math.min(C,A),L=Math.max(C,A);v=(I=1/N)*((b=Math.max(b,R))-c)+h*a,d=I*((g=Math.min(g,L))-c)+h*a}else b=c,g=c;v=i.transform.map(i.map(v)),b=r.transform.map(r.map(b));var y=.5*(v+(d=i.transform.map(i.map(d)))),k=.5*(b+(g=r.transform.map(r.map(g)))),x=Math.abs(d-v),B=Math.abs(g-b);v-=y,b-=k,d-=y,g-=k,4!==e.length?(e.length=0,e.push(v,b,d,g)):(e[0]=v,e[1]=b,e[2]=d,e[3]=g),0<u.length&&(u.length=0),t.disallowUploadedUpdate(),t.points.set(e,u),t.size.set(x,B),t.points.toFitted(),t.transform.position.set(y,k),t.allowUploadedUpdate()},i.prototype.updateRegion=function(){},i.prototype.destroy=function(){var t=this.el;return t&&(this.el=null,t.detach(),t.destroy()),n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.el;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.el;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,null,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=o.p0x=o.p1x=g+p*f,o.y=o.p0y=o.p1y=m+O*l,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(qg),om=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n);var r=this.plotArea;this.addChild(r),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:this.theme.isOverflowMaskEnabled())&&(r.axis.container.mask=this.getOverflowMask())},n.prototype.getOverflowMask=function(){return null==this.ur&&(this.ur=new tr(this),this.reflowable.add(this.ur),this.toDirty()),this.ur},Object.defineProperty(n.prototype,"plotArea",{get:function(){var t=this.Mf;return null==t&&(t=this.newPlotArea(),this.Mf=t),t},enumerable:!1,configurable:!0}),n.prototype.newPlotArea=function(){var t;return new Fg(this,null===(t=this.xn)||void 0===t?void 0:t.plotArea)},n.prototype.getType=function(){return"DChart"},n.prototype.destroy=function(){var n;this._destroyed||(null===(n=this.Mf)||void 0===n||n.destroy(),t.prototype.destroy.call(this))},n}($i),am=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(Db),cm=function(t){function n(n){var i=t.call(this)||this;return i.Lr=n,i}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Lr},enumerable:!1,configurable:!0}),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return Tb.getDocumentController().saveAs(this.Lr),!0},n}(Db),fm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return Tb.getDocumentController().save(),!0},n}(Db),lm=function(t){function n(n,i){var r=t.call(this)||this;r.p=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),n.prototype.createAsUrl=function(t){return null==t||wn(t)?this.create({size:t,extractor:function(t){return hb.base64({target:t})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(t){return hb.base64({target:t})}})},n.prototype.createAsFile=function(t,n){ct(t)?this.create({extractor:function(n){hb.file({target:n,filename:t})}}):null===t||wn(t)?this.create({size:t,extractor:function(t){hb.file({target:t,filename:n})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(n){hb.file({target:n,filename:t.filename})}})},n.prototype.toScale=function(t,n){return null==t?1:t/et.getResolution(n)/Math.max(n.width,n.height)},n.prototype.toCleanupSnap=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.snap},n.prototype.toCleanupBackground=function(t){if(null==t)return!1;var n=t.cleanup;return null!=n&&!1!==n&&(!0===n||!0===n.background)},n.prototype.toCleanupReflow=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.reflow},n.prototype.create=function(t){var n=this.p,i=n.canvas;if(i){var r=n.view,e=r.position,u=r.scale,s=e.x,h=e.y,o=u.x,a=u.y,c=this.toScale(t.size,i);r.transform(0,0,c,c,0);var f=void 0;if(this.toCleanupSnap(t)&&"snap"in i){var l=i.snap;null!=l&&((f=l.container).renderable?f.renderable=!1:f=void 0)}var v=void 0;if(this.toCleanupBackground(t)&&((v=i.snippet).renderable?v.renderable=!1:v=void 0),this.toCleanupReflow(t)){var b=et.getLayer(i);b&&b.reflow()}this.emit("taking",i,this);var d=t.extractor(i);return this.emit("took",i,null,this),v&&(v.renderable=!0),null!=f&&(f.renderable=!0),r.transform(s,h,o,a,0),d}},n}(t.utils.EventEmitter),vm=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).wl=null,r.pl=null==n?void 0:n.tile,r.Ol=null==n?void 0:n.controller,r.Dl=null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:r.theme.isAmbient(),r.El=new lm(r,null==n?void 0:n.snapshot),r.Ar=r.toMode(n),r}return _(n,t),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.El},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"controller",{get:function(){return this.Ol||null},enumerable:!1,configurable:!0}),n.prototype.set=function(t){var n=this,i=this.wl;if(i!==t){if(i&&(this.wl=null,this.canvas&&(this.canvas=null),this.onUnset()),this.wl=t,t){var r=this.newCanvas(t),e=t.pieces,u=this.Ar,s=Fe.toPieceData(this.Ol,e,u).then((function(i){return n.newLayer(t,r,u,e,i)}));return this.onSet(t,r),this.canvas=r,s}return Promise.resolve(null)}return Promise.resolve(this.canvas)},n.prototype.onSet=function(t,n){},n.prototype.newLayer=function(t,n,i,r,e){var u=this,s=new gr(t,r,e,i,0),h=Fe.newLayer(t,n.layer,s).then((function(t){return u.initLayer(n,t)}));if(this.Dl){var o=this.toCanvasBaseBackgroundOptions(t,this.theme,!1);this.background.color=o.color,this.background.alpha=o.alpha}return h},n.prototype.initLayer=function(t,n,i){return t.layer.init(),t.initialize(n,i),et.update(this),this.emit("ready",this),t},n.prototype.toCanvasBaseOptions=function(t){var n,i=this.theme,r=this.Dl;return{name:t.name,width:t.width,height:t.height,background:this.toCanvasBaseBackgroundOptions(t,i,r),border:r?{color:null}:void 0,outline:r?{color:null}:void 0,shadow:r?null:i.getCanvasShadow(),tile:{factory:this.pl,mapping:null===(n=t.tile)||void 0===n?void 0:n.mapping},ambient:r}},n.prototype.toCanvasBaseBackgroundOptions=function(t,n,i){var r,e;if(i)return{color:null};var u=t.background;return{color:null!==(r=null==u?void 0:u.color)&&void 0!==r?r:n.getCanvasBackgroundColor(),alpha:null!==(e=null==u?void 0:u.alpha)&&void 0!==e?e:n.getCanvasBackgroundAlpha()}},n.prototype.onUnset=function(){},n.prototype.get=function(){return this.wl},Object.defineProperty(n.prototype,"layer",{get:function(){var t=this.canvas;return t?t.layer.active:null},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DDiagramBase"},n}(vr),bm=function(){function t(t,n){this.Zn=t,this.Cr=n}return t.prototype.getTheme=function(){return this.Zn.getTheme()},t.prototype.setTheme=function(t){this.Zn.setTheme(t)},t.prototype.getBaseColor=function(){return this.Cr},t.prototype.setBaseColor=function(t){this.Cr=t},t.prototype.getColor=function(t){var n=this.Zn,i=this.Cr,r=n.getColor(t);return null!=i?null!=r?$t.blend(i,r,n.getAlpha(t)):i:r},Object.defineProperty(t.prototype,"color",{get:function(){return this.Zn.color},set:function(t){this.Zn.color=t},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){return null!=this.Cr?1:this.Zn.getAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.Zn.alpha},set:function(t){this.Zn.alpha=t},enumerable:!1,configurable:!0}),t}(),dm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),Object.defineProperty(n.prototype,"lon",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lat",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!0}),n.prototype.toObject=function(){return{lon:this.x,lat:this.y}},n}(t.ObservablePoint),gm=function(){function t(t,n,i,r,e,u){if(this.Ml=t,!0===n||!1===n)this.O=n,this.It=new dm(t,null,i,r),this.Ct=new dm(t,null,e,u);else if(null!=n){this.O=n.enable;var s=n.from,h=n.to;this.It=new dm(t,null,s.lon,s.lat),this.Ct=new dm(t,null,h.lon,h.lat)}else this.O=!1,this.It=new dm(t,null,-180,85.05112877980659),this.Ct=new dm(t,null,180,-85.05112877980659)}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.Ml())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.It},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{enable:this.O,from:this.It.toObject(),to:this.Ct.toObject()}},t}(),mm=function(){function t(t,n){var i=this;this.rr=t,this.Sl=null==n?void 0:n.factory,this.Gt=new gm((function(){i.onMappingChange()}),null==n?void 0:n.mapping)}return t.prototype.init=function(){this.onMappingChange()},t.prototype.onMappingChange=function(){var t=this.Sl;if(t){var n,i=this.Gt;i.enable?(n=this.Tl)?n.mapping=i:this.Tl=t(this.rr).fit():(n=this.Tl)&&(this.Tl=void 0,n.destroy())}},Object.defineProperty(t.prototype,"pyramid",{get:function(){return this.Tl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"factory",{get:function(){return this.Sl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapping",{get:function(){return this.Gt},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{mapping:this.Gt.serialize()}},t.prototype.destroy=function(){var t=this.Tl;null!=t&&(this.Tl=void 0,t.destroy())},t}(),wm=function(t){function n(n,i){var r=t.call(this)||this;return r.gh=null,r.St=n,r.fn=i,r.interactive=!1,r.interactiveChildren=!1,r}return _(n,t),n.prototype.init=function(){if(null==this.gh){var t=this.children,n=t.length;0<n&&(this.gh=t[n-1])}},Object.defineProperty(n.prototype,"active",{get:function(){return this.gh},set:function(t){this.gh!==t&&(null==t||0<=this.children.indexOf(t))&&(this.gh=t,this.onLayerChange())},enumerable:!1,configurable:!0}),n.prototype.create=function(t,n){var i=new tu(t);return this.attach(i,n),i},n.prototype.attach=function(t,n){this.addChild(t),!0===n&&(this.gh=t),this.onLayerChange(),et.update(this)},n.prototype.attachAt=function(t,n,i){this.addChildAt(t,n),!0===i&&(this.gh=t),this.onLayerChange(),et.update(this)},n.prototype.detach=function(t,n){var i=this.children,r=i.indexOf(t);0<=r&&(this.gh=n,i.splice(r,1),t.parent=void 0,this.onLayerChange(),et.update(this))},n.prototype.delete=function(t,n){var i=this.children,r=i.indexOf(t);return 0<=r&&(i.splice(r,1),t.parent=void 0,this.gh===t&&(!0===n?r<i.length?this.gh=i[r]:0<i.length?this.gh=i[r-1]:this.gh=null:this.gh=null),this.onLayerChange(),et.update(this)),r},n.prototype.get=function(t){var n=this.children[t];return null!=n?n:null},n.prototype.clear=function(){var t=this.children;if(0<t.length){for(var n=t.length-1;0<=n;--n){var i=t[n];i.parent=null,i.destroy()}t.length=0,this.onLayerChange(),et.update(this)}},n.prototype.destroy=function(){this._destroyed||(this.clear(),t.prototype.destroy.call(this))},n.prototype.size=function(){return this.children.length},n.prototype.onLayerChange=function(){this.emit("change",this)},n.prototype.serialize=function(t,n){for(var i=[],r=this.children,e=0,u=r.length;e<u;++e)r[e].addUuid(t);for(e=0,u=r.length;e<u;++e)r[e].updateUuid(t);for(e=0,u=r.length;e<u;++e)i.push(r[e].serialize(e,t,n));return i},n.prototype.deserialize=function(t,n){var i=t.length;if(0<i){for(var r=this.St,e=this.fn,u=0;u<i;++u)this.addChild(tu.deserialize(t[u],n,r,e));this.onLayerChange(),et.update(this)}},n}(t.Container),pm=function(t){function n(n){var i=t.call(this,n)||this,r=i.theme;i.isAmbient(r,n)||(i.Sn=new bm(i.Sn,i.toBackgroundBase(r,n)));var e=new wm(i.width,i.height);i.us=e,i.addChild(e);var u=new mm(i,null==n?void 0:n.tile);return i.jl=u,u.init(),i}return _(n,t),n.prototype.isAmbient=function(t,n){var i;return null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:t.isAmbient()},n.prototype.toBackgroundBase=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.background)||void 0===i?void 0:i.base)&&void 0!==r?r:t.getBackgroundBase()},Object.defineProperty(n.prototype,"tile",{get:function(){return this.jl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"layer",{get:function(){return this.us},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,n){},n.prototype.destroy=function(){this._destroyed||(this.onDestroy(),t.prototype.destroy.call(this))},n.prototype.onDestroy=function(){this.jl.destroy(),this.us.destroy()},n.prototype.hitTest=function(t,n){for(var i=this.us.children,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible){var u=e.hitTest(t,n);if(null!=u)return u}}return null},n.prototype.getType=function(){return"DDiagramCanvasBase"},n}(qd),Om=function(){function t(t){this.rr=t}return t.prototype.each=function(t,n){for(var i=this.rr.layer.children,r=0,e=i.length;r<e&&!1!==this.Uc(i[r].children,t,n);++r);return this},t.prototype.Uc=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(!1===n(u))return!1;if(i||wr.contains(u,pt.CHILDREN)){var s=u.children;if(0<s.length&&!1===this.Uc(s,n,i))return!1}}},t}(),Dm=function(){function t(){}return Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Ht;return null==t&&(t=this.newPrivate(),this.Ht=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new yt},Object.defineProperty(t.prototype,"protected",{get:function(){var t=this.Nl;return null==t&&(t=this.newProtected(),this.Nl=t),t},enumerable:!1,configurable:!0}),t.prototype.newProtected=function(){return new yt},Object.defineProperty(t.prototype,"extended",{get:function(){var t=this.Il;return null==t&&(t=this.newExtended(),this.Il=t),t},enumerable:!1,configurable:!0}),t.prototype.newExtended=function(){return new yt},Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Pt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Pt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t.prototype.add=function(t,n){var i,r=null!==(i=this.Pt)&&void 0!==i?i:this.Pt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Pt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),void 0!==n&&(c.value=n)}return!0},t.prototype.get=function(t){var n=this.Pt;if(null==n)return null;var i=n.get(t);return null==i?null:i},t.prototype.clear=function(t){var n=this.Pt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].clear();return!0},t.prototype.toDirty=function(t){var n=this.Pt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Pt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.times=i),void 0!==r&&(c.states=r),void 0!==n&&(c.values=n)}return!0},t.prototype.setValue=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].value=n;return!0},t.prototype.setValues=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].values=n;return!0},t.prototype.setTime=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].time=n;return!0},t.prototype.setTimes=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].times=n;return!0},t.prototype.setState=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].state=n;return!0},t.prototype.setStates=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].states=n;return!0},t.prototype.setRange=function(t,n,i){var r=this.Pt;if(null==r)return!1;var e=r.get(t);if(null==e)return!1;var u=e.length;if(u<=0)return!1;for(var s=0;s<u;++s){var h=e[s].range;void 0!==n&&(null!==n?(h.type|=Mt.FROM,h.from=n):h.type&=~Mt.FROM),void 0!==i&&(null!==i?(h.type|=Mt.TO,h.to=i):h.type&=~Mt.TO)}return!0},t}(),Em=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Om),Mm=function(){function t(t,n,i){var r=this;this.p=t;var e=i.controller;this.Ol=e;var u=function(){r.onChange()};e.grid.on("change",u),e.target.on("change",u);var s=new je;s.visible=!1,this.Bc=s,t.addChildAt(s,t.children.length-1),this.Cl=this.toGrid(n,i.grid),this.Zn=this.toTarget(n,i.target)}return t.prototype.toGrid=function(t,n){var i;return{major:this.toGridMajor(t,null==n?void 0:n.major),minor:this.toGridMinor(t,null==n?void 0:n.minor),size:null!==(i=null==n?void 0:n.size)&&void 0!==i?i:t.getSnapGridSize()}},t.prototype.toGridMajor=function(t,n){var i,r,e,u,s;return{interval:null!==(i=null==n?void 0:n.interval)&&void 0!==i?i:t.getSnapGridMajorInterval(),color:null!==(r=null==n?void 0:n.color)&&void 0!==r?r:t.getSnapGridMajorColor(),alpha:null!==(e=null==n?void 0:n.alpha)&&void 0!==e?e:t.getSnapGridMajorAlpha(),width:null!==(u=null==n?void 0:n.width)&&void 0!==u?u:t.getSnapGridMajorWidth(),style:null!==(s=null==n?void 0:n.style)&&void 0!==s?s:t.getSnapGridMajorStyle()}},t.prototype.toGridMinor=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapGridMinorColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapGridMinorAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapGridMinorWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapGridMinorStyle()}},t.prototype.toTarget=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapTargetColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapTargetAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapTargetWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapTargetStyle()}},t.prototype.onChange=function(){var t=this.p;t.toDirty(),et.update(t)},Object.defineProperty(t.prototype,"container",{get:function(){return this.Bc},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return this.Ol.serialize()},t.prototype.onReflow=function(){var t=this.p,n=this.Bc,i=this.Ol,r=i.grid.visible,e=i.target.visible;if(r||e){var u=t.width,s=t.height,h=.5*u,o=.5*s,a=tt.TOP,c=tt.LEFT,f=n.children,l=0;if(r){for(var v=this.Cl,b=v.major,d=v.minor,g=b.interval,m=v.size(i.grid.size,u,s),w=m,p=1;w<u;w+=m,p+=1,l+=1){var O=p%g==0?b:d;this.update(n,f,l,w,o,a,u,s,O)}for(var D=m,E=1;D<s;D+=m,E+=1,l+=1)O=E%g==0?b:d,this.update(n,f,l,h,D,c,u,s,O)}if(e)for(var M=i.target.values,S=this.Zn,T=0,j=M.length;T<j;T+=1,l+=1){var N=M[T],I=N.position;N.type===_v.VERTICAL?this.update(n,f,l,I,o,a,u,s,S):this.update(n,f,l,h,I,c,u,s,S)}for(T=l,j=f.length;T<j;++T)f[T].visible=!1;n.visible=!0}else n.visible=!1},t.prototype.update=function(t,n,i,r,e,u,s,h,o){var a=null;i<n.length?((a=n[i]).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate()):((a=new Yt).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate(),a.attach(t))},t}(),Sm=function(t){function n(n){var i=t.call(this,n)||this;return i.Al=i.toSnap(i.theme,n.snap),i}return _(n,t),n.prototype.toSnap=function(t,n){return n?new Mm(this,t,n):null},Object.defineProperty(n.prototype,"snap",{get:function(){return this.Al},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shape",{get:function(){var t=this.Pr;return null==t&&(t=this.newShape(),this.Pr=t),t},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){return new Em(this)},n.prototype.serialize=function(t,n){var i,r=new kv,e=[],u=this.Sn,s=u.color,h=u.alpha;return{version:1,id:t,name:this.name,width:this.width,height:this.height,background:{color:wn(s)?s:16777215,alpha:wn(h)?h:0},tile:this.jl.serialize(),resources:r.resources,data:r.data,pieces:r.pieces,layers:this.us.serialize(r,e),items:e,snap:null===(i=this.Al)||void 0===i?void 0:i.serialize(),thumbnail:null==n?void 0:n.serialize()}},n.prototype.onReflow=function(){var n;t.prototype.onReflow.call(this),null===(n=this.Al)||void 0===n||n.onReflow()},n.prototype.getType=function(){return"DDiagramCanvasEditor"},n}(pm),Tm=function(t){function n(n){var i=t.call(this,n)||this;return i.Pt=new Map,i}return _(n,t),n.prototype.add=function(t,n){var i=this.Pt,r=i.get(t);null==r?i.set(t,[n]):r.push(n)},n.prototype.get=function(t){var n=this.Pt.get(t);return n&&0<n.length?n[0]:null},n.prototype.getAll=function(t){return this.Pt.get(t)||[]},n}(Om),jm=function(){function t(t,n){var i=this;this.p=t,this.L=[],this.oa=n,this.Rl=function(){i.onTime()}}return t.prototype.add=function(t){this.L.push(t)},t.prototype.start=function(){null==this.Ll&&this.onTime()},t.prototype.getInterval=function(){var t=Date.now(),n=this.oa;return Math.max(0,n-t%n)},t.prototype.onTime=function(){var t=this.L;if(0<t.length){for(var n=Date.now()/this.oa,i=0,r=t.length;i<r;++i)t[i].value=n;et.update(this.p)}this.Ll=window.setTimeout(this.Rl,this.getInterval())},t.prototype.stop=function(){var t=this.Ll;null!=t&&(clearTimeout(t),this.Ll=void 0)},t}(),Nm=function(){function t(t){this.p=t,this.Pt=new Map}return t.prototype.add=function(t){var n=this.Pt,i=this.toNormalized(t),r=n.get(i);if(null!=r)return r;var e=new jm(this.p,i);return n.set(i,e),e},t.prototype.toNormalized=function(t){return wn(t)?Math.max(1,Math.round(t)):1e3},t.prototype.start=function(){this.Pt.forEach((function(t){t.start()}))},t.prototype.stop=function(){this.Pt.forEach((function(t){t.stop()}))},t}(),Im="[]",Cm=function(){return 0},Am=function(){return[]},Rm=function(){return""},Lm=function(){return{}},ym=function(){return!1},km=function(n){function i(t){var i=n.call(this,t)||this;return i.Pt=new Dm,i.Pr=new Tm(i),i.yl=new Nm(i),i.kl=[],i.xl=new Set,i.ca=function(){et.update(i)},i}return _(i,n),Object.defineProperty(i.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"shape",{get:function(){return this.Pr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ticker",{get:function(){return this.yl},enumerable:!1,configurable:!0}),i.prototype.initialize=function(t,n){var i=this,r=this.kl,e=this.Pt;this.Bl(t,null,null,n,new Map,new Map,new Map,this.yl,this.Pr,e,r);for(var u=this.us.children,s=u.length,h=0;h<s;++h)u[h].initialize(r);rn.isInitializing=!0;var o=Date.now();for(h=0;h<s;++h)u[h].update(o);rn.isInitializing=!1,e.extended.each((function(t){var n=Av.getById(t);if(n){var r=n.start;r&&r(i)}})),this.yl.start()},i.prototype.Bl=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=function(f,v){var b=t[f],d=b.id;0<d.length&&o.add(d,b),l.initData(b,n,i,r,e,u,h,a);var g=new(bo[b.type]||qe)(b);b.runtime=g,l.initActions(b,g,s),g.initialize(b);var m=b.shortcut;null!=m&&Ki.on(b,m,(function(t){g.onClick(b,t)})),g.isActionable()&&c.push(b);var w=b.children;if(0<w.length){var p=n,O=i;b instanceof Ir&&(null==p&&(p=b),O=b),l.Bl(w,p,O,r,e,u,s,h,o,a,c)}},l=this,v=0,b=t.length;v<b;++v)f(v)},i.prototype.initData=function(t,n,i,r,e,u,s,h){for(var o=t.data,a=0,c=o.size();a<c;++a){var f=o.get(a);if(null!=f)switch(f.type){case jt.BOOLEAN:case jt.BOOLEAN_ARRAY:case jt.NUMBER:case jt.NUMBER_ARRAY:case jt.STRING:case jt.STRING_ARRAY:case jt.OBJECT:case jt.OBJECT_ARRAY:this.initDataValue(f,t,n,i,r,e,u,h);break;case jt.TICKER:this.initDataTicker(f,u,s);break;default:this.initDataExtension(f,h)}}},i.prototype.initDataValue=function(t,n,i,r,e,u,s,h){if(t.scope===Nt.PRIVATE)0<(o=t.id).length&&(r?r.data.private.add(o,t):h.private.add(o,t));else if(t.scope===Nt.PROTECTED)0<(o=t.id).length&&h.protected.add(o,t);else{var o;e&&e(t,i||n),0<(o=t.id).length&&h.add(o,t)}var a=t.format,c=t.initial,f=u.get(t.type);null==f&&(f=new Map,u.set(t.type,f));var l=f.get(a);if(null!=l)t.formatter=l;else if(0<a.length){var v=this.calcFormatter(t,a,c);f.set(a,v),t.formatter=v}var b=s.get(t.type);null==b&&(b=new Map,s.set(t.type,b));var d=b.get(c);if(null!=d)t.value=d();else{var g=this.calcInitial(t,c);b.set(c,g),t.value=g()}},i.prototype.initDataTicker=function(t,n,i){var r=t.initial,e=n.get(t.type);null==e&&(e=new Map,n.set(t.type,e));var u=e.get(r);if(void 0!==u)t.value=0,i.add(u()).add(t);else{var s=this.calcInitial(t,r);e.set(r,s),t.value=0,i.add(s()).add(t)}},i.prototype.initDataExtension=function(t,n){var i=Av.get(t.type);i&&(n.extended.add(i.id,t),t.value=i.initial)},i.prototype.initActions=function(t,n,i){var r=t.action.values,e=n.actions,u=Dv.get(t.type);if(null!=u)for(var s=0,h=u.length;s<h;++s){var o=u[s];e.push(o),n.reset|=o.reset}for(s=0,h=r.length;s<h;++s){var a=r[s],c=i.get(a);null==c?null!=(c=a.toRuntime())&&(i.set(a,c),e.push(c),n.reset|=c.reset):(e.push(c),n.reset|=c.reset)}},i.prototype.calcFormatter=function(t,n,i){var r=this.toInitial(t);try{return Function("value","try {"+"return (".concat(n,");")+"} catch( e1 ) {try {"+"return (".concat(0<i.length?i:r,");")+"} catch( e2 ) {"+"return ".concat(r,";")+"}}")}catch(n){return this.toInitializer(t)}},i.prototype.calcInitial=function(t,n){if(n.length<=0)return this.toInitializer(t);try{return Function("try {"+"return (".concat(n,");")+"} catch( e ) {"+"return ".concat(this.toInitial(t),";")+"}")}catch(n){return this.toInitializer(t)}},i.prototype.toInitial=function(t){switch(t.type){case jt.BOOLEAN:return"false";case jt.BOOLEAN_ARRAY:return Im;case jt.NUMBER:return"0";case jt.NUMBER_ARRAY:return Im;case jt.STRING:return'""';case jt.STRING_ARRAY:return Im;case jt.OBJECT:return"{}";case jt.OBJECT_ARRAY:return Im;case jt.TICKER:default:return"0"}},i.prototype.toInitializer=function(t){switch(t.type){case jt.BOOLEAN:return ym;case jt.BOOLEAN_ARRAY:return Am;case jt.NUMBER:return Cm;case jt.NUMBER_ARRAY:return Am;case jt.STRING:return Rm;case jt.STRING_ARRAY:return Am;case jt.OBJECT:return Lm;case jt.OBJECT_ARRAY:return Am;case jt.TICKER:default:return Cm}},i.prototype.onDestroy=function(){var t=this;this.Pt.extended.each((function(n){var i=Av.getById(n);if(i){var r=i.stop;r&&r(t)}})),this.yl.stop(),n.prototype.onDestroy.call(this)},i.prototype.hitTestInteractives=function(t){for(var n=this.us.children,i=n.length-1;0<=i;--i){var r=n[i];if(r.visible){var e=r.hitTestInteractives(t);if(null!=e)return e}}return null},i.prototype.onShapeMove=function(t){var n=this.hitTestInteractives(t.data.global);this.cursor=this.Yn=this.toShapeCursor(n);var i=et.getLayer(this);if(i){var r=this.toShapeTitle(n),e=i.view;e.title!==r&&(e.title=r)}var u=this._l;if(this._l=n,n===u){if(null!=n){var s=n.runtime;s&&s.onMove(n,t)}}else this.onShapeOut(t,u,n),this.onShapeOver(t,n);return null!=n},i.prototype.toShapeCursor=function(t){if(null!=t)for(var n=t;;){var i=n.cursor;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof Dt))break;n=r}return"auto"},i.prototype.toShapeTitle=function(t){if(null!=t)for(var n=t;;){var i=n.title;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof Dt))break;n=r}return""},i.prototype.onShapeOut=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Dt;){var r=n.runtime;r&&r.onOut(n,t),n=n.parent}},i.prototype.onShapeOver=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Dt;){var r=n.runtime;r&&r.onOver(n,t),n=n.parent}},i.prototype.onShapeDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Pl=n,n){this.xl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onDown(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}return!0}return!1},i.prototype.onShapeUp=function(t){var n=this.xl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onUp(r,t);var u=r.parent;if(!(u instanceof Dt))break;r=u}}return this.onShapeCancel(t),null!=i},i.prototype.onShapeCancel=function(t){var n=this.xl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onUpOutside(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}})),n.clear(),!0)},i.prototype.onShapeClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Pl===n){for(var i=n;;){var r=i.runtime;r&&r.onClick(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}return!0}return!1},i.prototype.onShapeDblClick=function(n,r){var e,u=null!==(e=i.WORK_DBLCLICK)&&void 0!==e?e:i.WORK_DBLCLICK=new t.Point;Yi.toGlobal(n,r,u);var s=this.hitTestInteractives(u);if(s){for(var h=s;;){var o=h.runtime;o&&o.onDblClick(h,n,r);var a=h.parent;if(!(a instanceof Dt))break;h=a}return!0}return!1},i.prototype.onShapeRightClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Pl===n){for(var i=n;;){var r=i.runtime;r&&r.onRightClick(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}return!0}return!1},i.prototype.onShapeRightDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Pl=n,n){this.xl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onRightDown(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}return!0}return!1},i.prototype.onShapeRightUp=function(t){var n=this.xl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onRightUp(r,t);var u=r.parent;if(!(u instanceof Dt))break;r=u}}return this.onShapeRightCancel(t),null!=i},i.prototype.onShapeRightCancel=function(t){var n=this.xl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onRightUpOutside(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}})),n.clear(),!0)},i.prototype.update=function(){var t=this.kl;if(0<t.length){for(var n=-1,i=Date.now(),r=0,e=t.length;r<e;++r){var u=t[r];u.update(i);var s=u.runtime;if(s){var h=s.effect;i<h&&(n=n<0?h:Math.min(n,h))}}0<=n&&window.setTimeout(this.ca,n-Date.now())}},i.prototype.onRender=function(t){var n=this.kl;if(0<n.length){for(var i=-1,r=Date.now(),e=0,u=n.length;e<u;++e){var s=n[e];s.onRender(r,t);var h=s.runtime;if(h){var o=h.effect;r<o&&(i=i<0?o:Math.min(i,o))}}0<=i&&window.setTimeout(this.ca,i-Date.now())}},i.prototype.getType=function(){return"DDiagramCanvas"},i}(pm),xm=function(){function t(t){this.Ul=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Ul.canvas;return null!=t?t.data.private.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Ul.canvas;return null!=s&&s.data.private.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Ul.canvas;return null!=n&&n.data.private.toDirty(t)},t.prototype.each=function(t){var n=this.Ul.canvas;return null!=n?n.data.private.each(t):null},t}(),Bm=function(){function t(t){this.Ul=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Ul.canvas;return null!=t?t.data.protected.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Ul.canvas;return null!=s&&s.data.protected.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Ul.canvas;return null!=n&&n.data.protected.toDirty(t)},t.prototype.each=function(t){var n=this.Ul.canvas;return null!=n?n.data.protected.each(t):null},t}(),_m=function(){function t(t){this.Ol=t&&t.controller}return t.prototype.set=function(t,n){var i=this.Ol;return!!i&&(i.write(t,n),!0)},t}(),Pm=function(){function t(t){this.Ul=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Ul.canvas;return null!=t?t.data.extended.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Ul.canvas;return null!=s&&s.data.extended.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Ul.canvas;return null!=n&&n.data.extended.toDirty(t)},t.prototype.each=function(t){var n=this.Ul.canvas;return null!=n?n.data.extended.each(t):null},t}(),Um=function(){function t(t,n){this.Ul=t,this.Fl=n&&n.mapper||null,this.Gl=new _m(n&&n.remote),this.Ht=new xm(t),this.Nl=new Bm(t),this.Il=new Pm(t)}return t.prototype.update=function(){},Object.defineProperty(t.prototype,"mapper",{get:function(){return this.Fl},set:function(t){this.Fl=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remote",{get:function(){return this.Gl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"private",{get:function(){return this.Ht},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protected",{get:function(){return this.Nl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extended",{get:function(){return this.Il},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Ul.canvas;return t?t.data.ids:[]},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Ul.canvas;return null!=n?n.data.each(t):null},t.prototype.set=function(t,n,i,r,e,u){var s=this.Ul.canvas;return null!=s&&s.data.set(t,n,i,r,e,u)},t.prototype.get=function(t){var n=this.Ul.canvas;return null!=n?n.data.get(t):null},t.prototype.clear=function(t){var n=this.Ul.canvas;return null!=n&&n.data.clear(t)},t.prototype.toDirty=function(t){var n=this.Ul.canvas;return null!=n&&n.data.toDirty(t)},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Ul.canvas;return null!=s&&s.data.setAll(t,n,i,r,e,u)},t.prototype.setValue=function(t,n){var i=this.Ul.canvas;return null!=i&&i.data.setValue(t,n)},t.prototype.setValues=function(t,n){var i=this.Ul.canvas;return null!=i&&i.data.setValues(t,n)},t.prototype.setTime=function(t,n){var i=this.Ul.canvas;return null!=i&&i.data.setTime(t,n)},t.prototype.setTimes=function(t,n){var i=this.Ul.canvas;return null!=i&&i.data.setTimes(t,n)},t.prototype.setState=function(t,n){var i=this.Ul.canvas;return null!=i&&i.data.setState(t,n)},t.prototype.setStates=function(t,n){var i=this.Ul.canvas;return null!=i&&i.data.setStates(t,n)},t.prototype.setRange=function(t,n,i){var r=this.Ul.canvas;return null!=r&&r.data.setRange(t,n,i)},t}(),Fm=function(){function t(t,n,i){this.El=t,this.es=this.toIsEnabled(n,i),this.xn=this.toCreateAsUrlOptions(n,i)}return t.prototype.toIsEnabled=function(t,n){var i;return null!==(i=null==n?void 0:n.enable)&&void 0!==i?i:t.isThumbnailEnabled()},t.prototype.toSize=function(t,n){return void 0!==n?n:t.getThumbnailSize()},t.prototype.toCleanup=function(t,n){var i,r;return null==n||!0===n?{snap:!0,background:!0}:!1===n?{snap:!1,background:!1}:{snap:null===(i=n.snap)||void 0===i||i,background:null===(r=n.background)||void 0===r||r}},t.prototype.toCreateAsUrlOptions=function(t,n){return{size:this.toSize(t,null==n?void 0:n.size),cleanup:this.toCleanup(t,null==n?void 0:n.cleanup)}},Object.defineProperty(t.prototype,"enable",{get:function(){return this.es},set:function(t){this.es=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.xn.size},set:function(t){this.xn.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cleanup",{get:function(){return this.xn.cleanup},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){if(this.es)return this.El.createAsUrl(this.xn)},t}(),Gm=function(t){function n(n){var i=t.call(this,n)||this;i.Ut=!1,i.Ut=!1,Tb.getCommandController().on("dirty",(function(){!0!==i.Ut&&(i.Ut=!0,i.emit("change",i))}));var r=i.theme;return i.Hl=new Hv(i,r,null==n?void 0:n.snapper),i.zl=new Fm(i.El,r,null==n?void 0:n.thumbnail),i}return _(n,t),Object.defineProperty(n.prototype,"thumbnail",{get:function(){return this.zl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"snapper",{get:function(){return this.Hl},enumerable:!1,configurable:!0}),n.prototype.toMode=function(t){return(null==t?void 0:t.mapping)?mr.EDITOR_DATA_MAPPED:mr.EDITOR},n.prototype.newCanvas=function(t){return new Sm(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){var n=this.toCanvasBaseOptions(t),i=this.Hl,r=n.snap;return null==r?n.snap={controller:i}:null==r.controller&&(r.controller=i),n},n.prototype.serialize=function(){var t=this.canvas,n=this.wl;if(null!=t&&null!=n){this.emit("serializing",t,this);try{var i=t.serialize(n.id,this.zl);return this.emit("serialized",t,null,this),i}catch(n){return this.emit("serialized",t,"exception",this),null}}return null},n.prototype.save=function(){var t=this,n=this.serialize();if(null!=n){var i=this.Ol;if(i){var r=Fe.toSimple(n);return this.emit("saving",r,this),i.save(r).then((function(i){t.Ut=!1,n.id=i,t.wl=n,t.emit("change",t),t.emit("saved",null,t)}),(function(n){t.emit("saved",n,t)}))}return this.emit("saved","no-controller",this),Promise.reject()}return this.emit("saved",null,this),Promise.resolve()},n.prototype.saveAs=function(t){var n=this,i=this.serialize();if(null!=i){var r=this.Ol;if(r){i.id=void 0,i.name=t;var e=Fe.toSimple(i);return this.emit("saving",e,this),r.save(e).then((function(r){n.Ut=!1,i.id=r,n.wl=i;var e=n.canvas;null!=e&&(e.name=t),n.emit("change",n),n.emit("saved",null,n)}),(function(t){n.emit("saved",t,n)}))}return this.emit("saved","no-controller",this),Promise.reject("no-controller")}return this.emit("saved",null,this),Promise.resolve()},n.prototype.delete=function(){var t=this,n=this.wl;if(n&&null!=n.id){var i=this.Ol;return i?(this.emit("deleting",this),i.delete(n.id).then((function(){var n=t.set(null);return t.emit("deleted",null,t),n}),(function(n){return t.emit("deleted",n,t),Promise.reject(n)}))):(this.emit("deleted","no-controller",this),Promise.reject("no-controller"))}return this.set(null),this.emit("deleted",null,this),Promise.resolve(null)},n.prototype.create=function(t,n,i){return this.set({version:1,id:void 0,name:t,width:n,height:i,resources:[],data:[],layers:[["Default layer"]],items:[],snap:void 0})},n.prototype.onSet=function(n,i){t.prototype.onSet.call(this,n,i);var r=n.snap,e=this.Hl;null!=r?e.deserialize(r):e.reset(),this.Dl&&(e.target.visible=!1,e.grid.visible=!1),this.Ut=!1,this.emit("change",this)},n.prototype.onUnset=function(){t.prototype.onUnset.call(this),this.Ut=!1,this.emit("change",this)},n.prototype.open=function(t){var n=this,i=this.Ol;return i?(this.emit("opening",this),i.get(t).then((function(t){var i=n.set(Fe.toSerialized(t));return n.emit("opened",null,n),i}),(function(t){return n.emit("opened",t,n),Promise.reject(t)}))):(this.emit("opened","no-controller",this),Promise.reject("no-controller"))},n.prototype.close=function(){return this.set(null)},n.prototype.isChanged=function(){return this.Ut||this.isNew()},n.prototype.isNew=function(){var t=this.wl;return null!=t&&null==t.id},n.prototype.getName=function(){var t=this.wl;return null!=t?t.name:null},n.prototype.getType=function(){return"DDiagramEditor"},n}(vm),Hm=function(t){function n(n){var i=t.call(this)||this;return i.Ul=n,i.ca=function(){et.update(n)},i}return _(n,t),n.prototype.update=function(){var t=this.Ul.canvas;t&&t.update()},n.prototype.onRender=function(t){var n=this.Ul.canvas;n&&n.onRender(t)},n.prototype.get=function(t){var n=this.Ul.canvas;return n?n.shape.get(t):null},n.prototype.getAll=function(t){var n=this.Ul.canvas;return n?n.shape.getAll(t):[]},n.prototype.each=function(t,n){void 0===n&&(n=!1);var i=this.Ul.canvas;if(null!=i){var r=i.layer.children;if(n){for(e=r.length-1;0<=e;--e)for(h=(s=r[e].children).length-1;0<=h;--h)if(!1===t(a=s[h]))return a}else for(var e=0,u=r.length;e<u;++e)for(var s,h=0,o=(s=r[e].children).length;h<o;++h){var a;if(!1===t(a=s[h]))return a}}return null},n}(t.utils.EventEmitter),zm=function(t){function n(n){var i=t.call(this,n)||this;i.on(Yi.move,(function(t){i.onShapeMove(t)})),i.on(Yi.up,(function(t){i.onShapeUp(t)})),i.on(Yi.upoutside,(function(t){i.onShapeCancel(t)})),i.on(Yi.cancel,(function(t){i.onShapeCancel(t)})),i.on(Yi.tap,(function(t){i.onShapeClick(t)})),i.on(Yi.righttap,(function(t){i.onShapeRightClick(t)})),i.on(Yi.rightdown,(function(t){i.onShapeRightDown(t)})),i.on(Yi.rightup,(function(t){i.onShapeRightUp(t)})),i.on(Yi.rightupoutside,(function(t){i.onShapeRightCancel(t)}));var r=new Um(i,n&&(n.data||n.tag));return i.data=r,i.tag=r,i.shape=new Hm(i),i}return _(n,t),n.prototype.initLayer=function(n,i,r){return t.prototype.initLayer.call(this,n,i,r||this.data.mapper)},n.prototype.toMode=function(t){return mr.VIEWER},n.prototype.newCanvas=function(t){return new km(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){return this.toCanvasBaseOptions(t)},n.prototype.onDown=function(n){var i=this.canvas;i?t.prototype.onDown.call(this,n,i.onShapeDown(n)):t.prototype.onDown.call(this,n)},n.prototype.onShapeMove=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeMove(t)}},n.prototype.onShapeUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeUp(t)}},n.prototype.onShapeCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeCancel(t)}},n.prototype.onShapeClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeClick(t)}},n.prototype.onShapeRightClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightClick(t)}},n.prototype.onShapeRightDown=function(t){var n=this.canvas;n&&n.onShapeRightDown(t)},n.prototype.onShapeRightUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightUp(t)}},n.prototype.onShapeRightCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightCancel(t)}},n.prototype.onDblClick=function(n,i){var r=this.canvas;return r?t.prototype.onDblClick.call(this,n,i,r.onShapeDblClick(n,i)):t.prototype.onDblClick.call(this,n,i)},n.prototype.render=function(n){this.shape.onRender(n),t.prototype.render.call(this,n)},n.prototype.getType=function(){return"DDiagram"},n}(vm),Vm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmMessage"},n}(ml),Wm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.message),r},n.prototype.toMessage=function(t,n){var i=null==n?void 0:n.message;return null!=i?ct(i)||at(i)?this.newMessage(this.toMessageOptions(i)):i instanceof $i?i:this.newMessage(this.toMessageOptionsMerged(i,t.getMessage())):this.newMessage(this.toMessageOptions(t.getMessage()))},n.prototype.toMessageOptionsMerged=function(t,n){var i=t.text;return null==i&&(i={},t.text=i),void 0===i.value&&(i.value=n),t},n.prototype.toMessageOptions=function(t){return{text:{value:t}}},n.prototype.newMessage=function(t){return new Vm(t)},Object.defineProperty(n.prototype,"message",{get:function(){var t=this.Vl;return null==t&&(t=this.toMessage(this.theme,this.xn),this.Vl=t),t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){},n.prototype.getType=function(){return"DDialogConfirm"},n}(Ts),Xm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDelete"},n}(Wm),Km=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDiscard"},n}(Wm),Ym=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogMessage"},n}(Wm),Jm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogProcessingMessage"},n}(Vm),Zm=function(t){function n(n){var i,r=this;(r=t.call(this,n)||this).Wl=!0,r.qn=0;var e=null==n?void 0:n.delay;r.Xl=null!==(i=null==e?void 0:e.done)&&void 0!==i?i:r.theme.getDoneDelay();var u=null==e?void 0:e.close;return r.Kl=void 0!==u?u:r.theme.getCloseDelay(),r.Yl=r.message.text,r}return _(n,t),n.prototype.newMessage=function(t){return new Jm(t)},n.prototype.onOpen=function(){this.Wl=!1,this.qn=Date.now();var n=this.Ll;null!=n&&clearTimeout(n);var i=this.Jl;null!=i&&clearTimeout(i);var r=this.message;r.text=this.Yl,r.state.removeAll(ot.SUCCEEDED,ot.FAILED);var e=this.fh;null!=e&&e.hide(),t.prototype.onOpen.call(this)},n.prototype.onDone=function(t){var n=this;null!=t?this.Jl=window.setTimeout((function(){n.close()}),t):this.close()},n.prototype.onResolved=function(t){null!=t&&(this.message.text=t),this.message.state.set(ot.SUCCEEDED,ot.FAILED);var n=this.Kl;if(null!=n)this.onDone(n);else{var i=this.fh;null!=i?i.show():this.close()}},n.prototype.onRejected=function(t){null!=t&&(this.message.text=t),this.message.state.set(ot.FAILED,ot.SUCCEEDED);var n=this.fh;null!=n?n.show():this.onDone(this.Kl)},n.prototype.resolve=function(t){var n=this;if(!this.Wl){this.Wl=!0;var i=Date.now()-this.qn,r=this.Xl-i;0<r?this.Ll=window.setTimeout((function(){n.Ll=void 0,n.onResolved(t)}),r):this.onResolved(t)}},n.prototype.reject=function(t){var n=this;if(!this.Wl){this.Wl=!0;var i=Date.now()-this.qn,r=this.Xl-i;0<r?this.Ll=window.setTimeout((function(){n.Ll=void 0,n.onRejected(t)}),r):this.onRejected(t)}},n.prototype.onCloseOn=function(){this.Wl&&t.prototype.onCloseOn.call(this)},n.prototype.getType=function(){return"DDialogProcessing"},n}(Wm),qm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(){var n=Tb.getDocumentController().getName();null!=n&&(this.input.value=n),t.prototype.onOpen.call(this)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=Tb.getCommandController();ct(n)?i.push(new cm(n)):n.then((function(t){i.push(new cm(t))}))},n.prototype.getType=function(){return"DDialogSaveAs"},n}(Ws),Qm=function(){function t(t){this.Zl=t,this.ql=[]}return t.prototype.indexOf=function(t){return this.ql.indexOf(t)},t.prototype.close=function(t){for(var n=this.ql,i=Math.max(0,t),r=n.length-1;i<=r;--r)n[r].close()},t.prototype.add=function(t){this.ql.push(t)},t.prototype.trim=function(t){this.close(this.indexOf(t)+1)},t.prototype.remove=function(t){var n=this.indexOf(t);0<=n&&(this.close(n+1),this.ql.splice(n,1))},t}(),$m=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u=this;t.prototype.init.call(this,n),this.hs=function(){u.onPrerender()},this.Tt=Ei(null!==(i=null==n?void 0:n.align)&&void 0!==i?i:Nu.BOTTOM,Nu),this.Ql=null!==(r=null==n?void 0:n.fit)&&void 0!==r&&r,this.os=null!==(e=null==n?void 0:n.sticky)&&void 0!==e&&e,this.$l=!1,this.Zl=null,this.Xo=null,this.visible=!1,ku.apply(this,(function(){u.close()})),this.on("select",(function(){u.close()}));var s=null==n?void 0:n.items;s&&Sl.newItems(this,s,this.os),this.fs=new xu(n)},n.prototype.findItem=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof pl&&e.value===t)return e}return null},n.prototype.getType=function(){return"DMenu"},n.prototype.getContext=function(){return this.Xo},n.prototype.getCloseable=function(){return this},n.prototype.open=function(n,i,r){if(this.isHidden()){var e=this.fs.pick(this);this.Zl=n;for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof $i&&o.state.removeAll(ot.FOCUSED,ot.HOVERED)}var a=e.renderer,c=this.hs;if(this.os?a.on("prerender",c):a.once("prerender",c),this.Ql){var f=n.getBounds();null!=f&&(this.width=f.width)}this.$l=null!=r,r=r||new Qm(n),null!=i&&r.trim(i),r.add(this),this.Xo=r,e.stage.addChild(this),this.ls=e.getFocusController().get(),this.focus(),t.prototype.show.call(this),this.emit("open",this)}return this},n.prototype.onPrerender=function(){var t=this.Zl;if(t){var n=t.getBounds();if(n){this.Ql&&(this.width=n.width);var i=this.fs.picked;if(i){var r=this.theme;Iu.attach(this,n,r.getOffsetX(),r.getOffsetY(),i.width,i.height,this.Tt)}}}},n.prototype.close=function(){if(this.isShown()){var n=this.Xo;n&&n.remove(this);var i=this.fs.picked;i&&i.renderer.off("prerender",this.hs),this.Zl=null;var r=this.ls;if(null!=r)if(this.ls=null,i){var e=et.getLayer(r);null!=e&&i!==e&&e.view.focus(),i.getFocusController().focus(r)}else this.blur(!0);else this.blur(!0);t.prototype.hide.call(this);var u=this.parent;u&&u.removeChild(this),this.emit("close",this)}return this},n.prototype.onKeyDown=function(n){return Ki.moveFocusVertically(n,this,this.fs),this.state.isActionable&&(Ki.isArrowLeftKey(n)||Ki.isCancelKey(n))&&this.close(),t.prototype.onKeyDown.call(this,n)},n.prototype.containsGlobalPoint=function(t){return!this.$l},n}(Gu);Sl.setMenuCreator((function(t){return new $m(t)}));var tw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this)},n.prototype.onMenuClose=function(t){if(t){var n=this.tv;n&&t.off("select",n);var i=this.nv;i&&t.off("close",i)}},n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof $m?i:new $m(this.toMenuOptions(t,i))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!0),n):{fit:!0}},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this.Eo;return null==t&&(t=this.toMenu(this.theme,this.xn),this.Eo=t),t},set:function(t){var n=this.Eo;n!=t&&(this.Eo=t,this.onMenuReplaced(t,n))},enumerable:!1,configurable:!0}),n.prototype.onMenuReplaced=function(t,n){null!=n&&this.onMenuClose(n)},n.prototype.getType=function(){return"DDropdownBase"},n.prototype.onKeyDown=function(n){return Ki.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){var t=this,n=this.menu;if(n.isHidden()){var i=this.tv;null==i&&(i=function(n,i,r){t.onMenuSelect(n,i,r)},this.tv=i);var r=this.nv;null==r&&(r=function(){t.onMenuClose(t.Eo)}),n.on("select",i),n.on("close",r),n.open(this),this.emit("open",n,this)}},n.prototype.close=function(){this.menu.close()},n}(gs),nw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDropdown"},n}(tw),iw=function(t){function n(n){var i=t.call(this,n)||this;return i.on(Yi.down,(function(t){i.state.isActionable&&i.onSelect(t)})),i}return _(n,t),n.prototype.onSelect=function(t){this.emit("select",this)},n.prototype.onKeyDown=function(n){return Ki.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},n.prototype.getType=function(){return"DExpandableHeader"},n}(ml),rw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i=this;n.prototype.init.call(this,t);var r=this.theme,e=this.toHeader(r,t);this.oh=e,e.on("select",(function(){i.toggle()})),this.addChild(e);var u=this.toBody(r,t);this.Oe=u,this.addChild(u),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.toHeader=function(n,i){return i&&i.header?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new iw(n)},i.prototype.toBody=function(t,n){return n.body},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.Oe;t instanceof $i?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.Oe;t instanceof $i?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.getType=function(){return"DExpandable"},i}(Gu),ew=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new Ps(t)},n}(_b),uw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new fb(this,this.newOperation(),this.theme,this.xn)},n.prototype.getType=function(){return"DInputTextArea"},n}(xs),sw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DListItemAmbient"},n}(cd),hw=function(){function t(t){void 0===t&&(t=256),this.iv=t}return t.prototype.getTileSize=function(){return this.iv},t.prototype.lonLatToMeters=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x*r/180,i.y=Math.log(Math.tan((90+n.y)*Math.PI/360))*r/Math.PI,i},t.prototype.metersToLonLat=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x/r*180,i.y=360*Math.atan(Math.exp(n.y*Math.PI/r))/Math.PI-90,i},t.prototype.pixelsToMeters=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=n.x*u-s,e.y=s-n.y*u,e},t.prototype.metersToPixels=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=(n.x+s)/u,e.y=(s-n.y)/u,e},t.prototype.pixelsToTile=function(t,n,i){return i.x=Math.ceil(t.x/n)-1,i.y=Math.ceil(t.y/n)-1,i},t.prototype.metersToTile=function(n,i,r){var e=t.CIRCUMFERENCE_HALF,u=1<<i;return r.x=Math.ceil(.5*(n.x/e+1)*u)-1,r.y=Math.ceil(.5*(1-n.y/e)*u)-1,r},t.prototype.lonLatToTile=function(t,n,i){return this.metersToTile(this.lonLatToMeters(t,i),n,i)},t.prototype.lonLatToPixels=function(t,n,i,r){return this.metersToPixels(this.lonLatToMeters(t,r),n,i,r)},t.prototype.pixelsToLonLat=function(t,n,i,r){return this.metersToLonLat(this.pixelsToMeters(t,n,i,r),r)},t.prototype.tileToPixels=function(t,n,i){return i.x=t.x*n,i.y=t.y*n,i},t.prototype.tileToMeters=function(n,i,r){var e=this.toResolutionMeter(i),u=t.CIRCUMFERENCE_HALF;return r.x=n.x*e+u,r.y=u-n.y*e,r},t.prototype.toResolutionMeter=function(n){return 2*t.CIRCUMFERENCE_HALF/(1<<n)},t.prototype.toResolution=function(n,i){return 2*t.CIRCUMFERENCE_HALF/(i<<n)},t.prototype.toTileCount=function(t){return 1<<t},t.prototype.toTileCode=function(t,n,i){return(n<<t)+i},t.CIRCUMFERENCE_HALF=6378137*Math.PI,t}(),ow=function(){function t(){}return Object.defineProperty(t,"DEFAULT",{get:function(){return null==this._r&&(this._r=new hw),this._r},enumerable:!1,configurable:!0}),t}(),aw=function(){function n(n,i,r,e,u,s){this.tx=i,this.ty=r;var h=new t.Sprite(t.Texture.EMPTY);h.parent=n,h.position.set(e,u),h.scale.set(s,s),this.rv=h}return n.prototype.load=function(n,i){var r=t.Texture.from(n,{resolution:1});this.rv.texture=r,r.valid?i():r.on("update",i)},n.prototype.transform=function(t,n,i){var r=this.rv;r.position.set(t,n),r.scale.set(i,i)},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.rv.texture.valid},enumerable:!1,configurable:!0}),n.prototype.render=function(t){var n=this.rv;n.updateTransform(),n.render(t)},n.prototype.destroy=function(){var n=this.rv,i=n.texture,r=i.baseTexture.resource,e=null;r instanceof t.resources.BaseImageResource&&r.source instanceof HTMLImageElement&&(e=r.source),i.destroy(!0),n.destroy(),e&&(e.src="")},n}(),cw=function(){function n(t,n,i,r,e,u){var s=this;this.p=t,this.qe=n,this.ev=u,this.uv=!1,this.sv=!0,this.hv=function(){s.onLoaded()},this.ov=i,this._lon0=NaN,this._lat0=NaN,this._lon1=NaN,this._lat1=NaN,this.av=new Map,this.cv=function(t){s.renderTile(t)},this.fv=NaN,this.lv=NaN,this.vv=NaN,this.bv=NaN,this.dv=function(t,n,i){s.deleteTile(t,n,i)},this.gv=function(t){s.destroyTile(t)},this.mv=function(t){t.loaded||(s.wv=!1)},this.pv=e.toTileCount(i),this.Ov=1/this.pv,this.Dv=r.scale*this.Ov,this.iv=e.getTileSize()*r.scale,this.Gt=r,this.Gf=e,this.wv=!0}return n.prototype.newTile=function(t,n,i,r,e){return new aw(this.p,t,n,i,r,e)},n.prototype.renderTile=function(t){t.render(this.Ze)},Object.defineProperty(n.prototype,"tz",{get:function(){return this.ov},enumerable:!1,configurable:!0}),n.prototype.render=function(t){this.Ze=t,this.av.forEach(this.cv)},n.prototype.move=function(t,i,r,e){var u=this._lon0,s=this._lat0,h=this._lon1,o=this._lat1;if(u!==t||s!==i||h!==r||o!==e){this._lon0=t,this._lat0=i,this._lon1=r,this._lat1=e;var a=this.ov,c=this.Gf,f=n.WORK;f.set(t,i),c.lonLatToTile(f,a,f);var l=f.x,v=f.y;f.set(r,e),c.lonLatToTile(f,a,f);var b=f.x,d=f.y,g=this.pv,m=Math.max(0,l),w=Math.min(g-1,b),p=Math.max(0,v),O=Math.min(g-1,d),D=m-this.fv,E=w-this.lv,M=p-this.vv,S=O-this.bv,T=D!=D||D<0||1<D,j=E!=E||0<E||E<-1,N=M!=M||M<0||1<M,I=S!=S||0<S||S<-1;if(T||j||N||I){T?this.fv=m:m=this.fv,j?this.lv=w:w=this.lv,N?this.vv=p:p=this.vv,I?this.bv=O:O=this.bv,this.av.forEach(this.dv);var C=m+w>>1,A=p+O>>1,R=Math.max(C-m,w-C),L=Math.max(A-p,O-A),y=Math.max(R,L);this.toOffset(f);var k=f.x,x=f.y;this.uv=!1,this.sv=!1,this.loadTile(a,C,A,k,x,f);for(var B=1;B<=y;++B){var _=C-B;m<=_&&this.loadTilesY(a,_,A,B,p,O,k,x,f);var P=C+B;P<=w&&this.loadTilesY(a,P,A,B,p,O,k,x,f);var U=A-B;p<=U&&this.loadTilesX(a,C,B-1,m,w,U,k,x,f);var F=A+B;F<=O&&this.loadTilesX(a,C,B-1,m,w,F,k,x,f)}this.sv=!0,this.uv&&this.onLoaded()}}},n.prototype.loadTilesX=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,u,s,h,o);for(var a=1;a<=i;++a){var c=n-a;r<=c&&this.loadTile(t,c,u,s,h,o);var f=n+a;f<=e&&this.loadTile(t,f,u,s,h,o)}},n.prototype.loadTilesY=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,i,s,h,o);for(var a=1;a<=r;++a){var c=i-a;e<=c&&this.loadTile(t,n,c,s,h,o);var f=i+a;f<=u&&this.loadTile(t,n,f,s,h,o)}},n.prototype.loadTile=function(t,n,i,r,e,u){var s=this.Gf.toTileCode(t,n,i),h=this.av,o=h.get(s);null==o&&(this.toTilePosition(n,i,r,e,u),o=this.newTile(n,i,u.x,u.y,this.Dv),h.set(s,o),o.load(this.qe(t,n,i),this.hv),this.wv=!1)},n.prototype.toTilePosition=function(t,n,i,r,e){var u=this.iv,s=this.Ov;return e.set(t,n),this.Gf.tileToPixels(e,u,e),e.set(e.x*s+i,e.y*s+r),e},n.prototype.toOffset=function(t){var n=this.p,i=this.Gt,r=this.iv;return t.set(-i.x*r+.5*n.width,-i.y*r+.5*n.height),t},n.prototype.deleteTile=function(t,n,i){var r=t.tx,e=t.ty;(r<this.fv||this.lv<r||e<this.vv||this.bv<e)&&(i.delete(n),t.destroy())},n.prototype.destroy=function(){var t=this.av;t.forEach(this.gv),t.clear()},n.prototype.destroyTile=function(t){t.destroy()},n.prototype.updateLoadingState=function(){this.wv=!0,this.av.forEach(this.mv)},n.prototype.onLoaded=function(){this.sv?this.ev():this.uv=!0},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.wv||this.updateLoadingState(),this.wv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mapping",{get:function(){return this.Gt},set:function(t){var i=this,r=this.Gf,e=t.scale*this.Ov,u=r.getTileSize()*t.scale;this.Dv=e,this.iv=u,this.Gt=t;var s=n.WORK;this.toOffset(s);var h=s.x,o=s.y;this.av.forEach((function(t){i.toTilePosition(t.tx,t.ty,h,o,s),t.transform(s.x,s.y,e)}))},enumerable:!1,configurable:!0}),n.WORK=new t.Point,n}(),fw=function(n){function i(t){var i=n.call(this)||this,r=t.canvas;i.rr=r,i.qe=t.builder;var e=t.mapping;i.Gt=e;var u=t.coordinate;i.Gf=u,i.Ev=i.toMapping(r,e,u),i._z=NaN,i.ov=NaN,i.Mv=t.plane.min,i.Sv=t.plane.max,i.Tv=[],i.hv=function(){i.onLoaded()},i.jv=function(){i.Nv=void 0,i.fit()},i.Iv=t.plane.throttle;var s=function(){i.fitThrottled()};return i.Cv=s,r.on("scale",s),r.on("move",s),r.snippet.add(i,!0),i}return _(i,n),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.Gf},enumerable:!1,configurable:!0}),i.prototype.fitThrottled=function(){null==this.Nv&&(this.Nv=window.setTimeout(this.jv,this.Iv))},i.prototype.toMapping=function(t,n,r){var e=i.WORK_LONLAT,u=r.getTileSize();e.set(n.from.lon,n.from.lat),r.lonLatToPixels(e,0,u,e);var s=e.x,h=e.y;e.set(n.to.lon,n.to.lat),r.lonLatToPixels(e,0,u,e);var o=e.x,a=e.y,c=Math.abs(o-s),f=Math.abs(a-h),l=1e-7,v=1;return l<c?v=l<f?Math.max(t.width/c,t.height/f):t.width/c:l<f&&(v=t.height/f),{scale:v,x:.5*(o+s)/u,y:.5*(a+h)/u}},Object.defineProperty(i.prototype,"mapping",{get:function(){return this.Gt},set:function(t){var n=this.Ev,i=this.toMapping(this.rr,t,this.Gf),r=1e-7;if(r<Math.abs(n.scale-i.scale)||r<Math.abs(n.x-i.x)||r<Math.abs(n.y-i.y)){this.Ev=i;for(var e=this.Tv,u=0,s=e.length;u<s;++u){var h=e[u];h&&(h.mapping=i)}et.update(this.rr),this.Cv()}},enumerable:!1,configurable:!0}),i.prototype.newPlane=function(t){return new cw(this.rr,this.qe,t,this.Ev,this.Gf,this.hv)},i.prototype.render=function(t){for(var n=this.ov,i=this.Tv,r=0;r<n;++r)null!=(e=i[r])&&e.render(t);for(r=i.length-1;n<r;--r){var e;null!=(e=i[r])&&e.render(t)}var u=i[n];null!=u&&u.render(t)},i.prototype.toTileZ=function(t){return Math.min(this.Sv,Math.max(this.Mv,Math.floor(t)))},i.prototype.updateTransform=function(){},i.prototype.toZ=function(t){return Math.log(this.Ev.scale*t)/Math.log(2)},i.prototype.move=function(t,n,i,r,e){var u=this.Tv,s=this.toZ(t);if(this._z!==s){this._z=s;var h=this.toTileZ(s);if(this.ov!==h){this.ov=h;var o=u[h];null==o&&(o=this.newPlane(h),u[h]=o)}}var a=u[this.ov];return null!=a&&a.move(n,i,r,e),this},i.prototype.fit=function(){var t=this.rr;if(null!=t){var n=t.parent;if(null!=n){var r=t.scale,e=r.x,u=r.y,s=t.x,h=t.y,o=this.Gf,a=this.Ev,c=o.getTileSize()*a.scale,f=a.x*c-(s/e+.5*t.width),l=f+n.width/e,v=a.y*c-(h/u+.5*t.height),b=v+n.height/u,d=i.WORK_LONLAT;d.set(f,v),o.pixelsToLonLat(d,0,c,d);var g=d.x,m=d.y;d.set(l,b),o.pixelsToLonLat(d,0,c,d);var w=d.x,p=d.y;this.move(e,g,m,w,p)}}return this},i.prototype.destroyPlanesBefore=function(t,n){for(var i=0;i<t;++i){var r=n[i];r&&(r.destroy(),n[i]=void 0)}},i.prototype.destroyPlanesAfter=function(t,n){for(var i=t+1,r=n.length;i<r;++i){var e=n[i];e&&(e.destroy(),n[i]=void 0)}},i.prototype.cleanup=function(){var t=this.ov,n=this.Tv,i=n[t];if(i&&i.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(t,n);for(var r=t+1,e=n.length;r<e;++r)if((u=n[r])&&u.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(r,n);for(r=t-1;0<=r;--r){var u;if((u=n[r])&&u.loaded)return void this.destroyPlanesBefore(r,n)}},i.prototype.onLoaded=function(){this.cleanup(),et.update(this.rr)},i.prototype.destroy=function(){for(var t=this.Tv,n=0,i=t.length;n<i;++n){var r=t[n];r&&(r.destroy(),t[n]=void 0)}var e=this.rr,u=this.Cv;return e.off("scale",u),e.off("move",u),e.snippet.remove(this,!0),this},i.WORK_LONLAT=new t.Point,i}(t.utils.EventEmitter),lw=function(t,n,i){return"https://j.tile.openstreetmap.jp/".concat(t,"/").concat(n,"/").concat(i,".png")},vw=function(){function t(){}return t.toPlaneOptions=function(t){var n,i,r,e=t.plane;return{min:null!==(n=null==e?void 0:e.min)&&void 0!==n?n:this.MIN,max:null!==(i=null==e?void 0:e.max)&&void 0!==i?i:this.MAX,throttle:null!==(r=null==e?void 0:e.throttle)&&void 0!==r?r:this.THROTTLE}},t.from=function(t){return new fw({canvas:t.canvas,builder:t.builder||lw,mapping:t.canvas.tile.mapping,coordinate:t.coordinate||ow.DEFAULT,plane:this.toPlaneOptions(t)})},t.MIN=0,t.MAX=18,t.THROTTLE=333,t}(),bw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof $m?i:new $m(this.toMenuOptions(t,i))},n.prototype.newMenu=function(t,n){return new $m(this.toMenuOptions(t,n))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!1),n):{fit:!1}},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){this.menu.open(this)},n.prototype.close=function(){this.menu.close()},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this,n=this.Eo;return null==n&&((n=this.toMenu(this.theme,this.xn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Eo=n),n},enumerable:!1,configurable:!0}),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this);var r=this.parent;r&&r.emit("select",t,n,r)},n.prototype.onKeyDown=function(n){return Ki.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onActivate(t),0))},n.prototype.getType=function(){return"DMenuBarItem"},n}(ms),dw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t);var i=null==t?void 0:t.items;if(i)for(var r=0,e=i.length;r<e;++r){var u=this.toItem(i[r]);u&&this.addChild(u)}},i.prototype.toItem=function(n){return null==n?null:n instanceof t.DisplayObject?n:"space"in n?new Pu(n):new bw(n)},i.prototype.onKeyDown=function(t){return Ki.moveFocusHorizontally(t,this),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuBar"},i}(ps),gw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DMenuSidedContent"},n}(ps),mw={NONE:0,SINGLE:1,SINGLE_ONCE:2},ww=function(){return!0},pw=function(n){function i(t,i){var r,e,u,s=this;(s=n.call(this)||this).ah=t,s.Hc=null,s.bn=!0,s.Nt=Ei(null!==(e=null!==(r=null==i?void 0:i.mode)&&void 0!==r?r:null==i?void 0:i.type)&&void 0!==e?e:mw.SINGLE_ONCE,mw),s.hf=null!==(u=null==i?void 0:i.filter)&&void 0!==u?u:s.getFilterDefault();var h=null==i?void 0:i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return _(i,n),i.prototype.first=function(){return this.Hc},i.prototype.toDirty=function(){this.bn=!0},i.prototype.update=function(){this.bn&&(this.bn=!1,this.Hs(this.ah))},i.prototype.hasMenu=function(t){return t&&t.menu instanceof $m},i.prototype.Hs=function(n){for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u instanceof wl&&u.state.isActive&&this.Av(u,!1),u instanceof t.Container&&this.Hs(u),this.hasMenu(u)&&this.Hs(u.menu)}},i.prototype.add=function(t){this.update(),this.Av(t,!0)},i.prototype.set=function(t){this.update(),this.Av(t,!0)},i.prototype.get=function(t){return this.update(),this.Hc},i.prototype.getIndex=function(t){return null},i.prototype.size=function(){return this.Hc?1:0},i.prototype.isEmpty=function(){return null==this.Hc},i.prototype.remove=function(t){this.update(),this.Hc===t&&this.Av(null,!0)},i.prototype.clear=function(){this.update(),this.Av(null,!0)},i.prototype.getFilterDefault=function(){return ww},i.prototype.Av=function(t,n){var i=this.Hc,r=this.Nt;r!==mw.NONE&&this.hf(t)&&i!==t&&(this.setState(i,r,!1),this.Hc=t,this.setState(t,r,!0),n&&this.emit("change",this))},i.prototype.setState=function(t,n,i){t&&(n===mw.SINGLE?t.state.isActive=i:i?t.state.addAll(ot.ACTIVE,ot.READ_ONLY):t.state.removeAll(ot.ACTIVE,ot.READ_ONLY))},i}(t.utils.EventEmitter),Ow=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=new Qm(r);r.Xo=e,e.add(r);var u=null==n?void 0:n.items;if(null!=u){var s=null!==(i=null==n?void 0:n.sticky)&&void 0!==i&&i;r.newItems(u,s)}var h=null==n?void 0:n.selection;return r.zc=h instanceof pw?h:r.newSelection(h),r}return _(n,t),n.prototype.newSelection=function(t){return new pw(this.content,t)},n.prototype.onHierarchyDirty=function(){var n=this.zc;null!=n&&n.toDirty(),t.prototype.onHierarchyDirty.call(this)},n.prototype.newItems=function(t,n){hv.newItems(this.content,t,n)},n.prototype.newContent=function(t){return new gw(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.zc},enumerable:!1,configurable:!0}),n.prototype.getContext=function(){return this.Xo},n.prototype.getCloseable=function(){return this},n.prototype.open=function(){},n.prototype.close=function(){},n.prototype.onKeyDown=function(n){return Ki.moveFocusVertically(n,this),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DMenuSided"},n}(kd),Dw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteError"},n}(Ud),Ew=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteNoItemsFound"},n}(Ud),Mw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSearching"},n}(Ud),Sw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}($i),Tw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonLast"},n}(Ds),jw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonNext"},n}(Ds),Nw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonPage"},n}(Ds),Iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonPrevious"},n}(Ds),Cw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonTop"},n}(Ds),Aw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationDots"},n}(ds),Rw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationPage"},n}(ds),Lw=function(t){function n(n){var i,r,e,u,s=this;s=t.call(this,n)||this,null!=n?(s.j=null!==(r=null!==(i=n.size)&&void 0!==i?i:n.total)&&void 0!==r?r:10,s.Rt=null!==(u=null!==(e=n.value)&&void 0!==e?e:n.selected)&&void 0!==u?u:0):(s.j=10,s.Rt=0);var h=s.buttonTop,o=s.buttonPrevious;null!=h&&s.addChild(h),null!=o&&s.addChild(o),null==h&&null==o||s.addChild(s.newSpace());var a=s.buttonPages0,c=a.length;s.addChild(a[c-1]),s.addChild(s.dots0);for(var f=c-2;0<=f;--f)s.addChild(a[f]);s.addChild(s.page);for(var l=s.buttonPages1,v=l.length,b=(f=0,v-1);f<b;++f)s.addChild(l[f]);s.addChild(s.dots1),s.addChild(l[v-1]);var d=s.buttonNext,g=s.buttonLast;return null==d&&null==g||s.addChild(s.newSpace()),null!=d&&s.addChild(d),null!=g&&s.addChild(g),s.update(),s}return _(n,t),n.prototype.newSpace=function(){var t,n,i;return new Pu({width:null!==(i=null===(n=null===(t=this.xn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.space)&&void 0!==i?i:this.theme.getButtonSpace()})},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){0<=t&&t<this.j&&this.Rt!==t&&(this.Rt=t,this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){0<=t&&this.j!==t&&(this.j=t,this.Rt=0===t?-1:Math.max(0,Math.min(this.j-1,this.Rt)),this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"total",{get:function(){return this.size},set:function(t){this.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots0",{get:function(){var t=this._dots0;return null==t&&(t=this.newDots(),this._dots0=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots1",{get:function(){var t=this._dots1;return null==t&&(t=this.newDots(),this._dots1=t),t},enumerable:!1,configurable:!0}),n.prototype.newDots=function(){return new Aw},Object.defineProperty(n.prototype,"buttonLast",{get:function(){var t=this.Rv;return void 0===t&&(t=this.newButtonLast(),this.Rv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonLast=function(){var t,n,i=this,r=null===(n=null===(t=this.xn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.last;if(null!==r&&!1!==r&&void 0!==r){var e=new Tw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonLastActive()})),e}return null},n.prototype.onButtonLastActive=function(){this.moveTo(this.j-1)},n.prototype.moveTo=function(t){if(0<=t&&t<this.j&&this.Rt!==t){var n=this.Rt;this.Rt=t,this.emit("change",t,n,this),this.update()}},Object.defineProperty(n.prototype,"buttonNext",{get:function(){var t=this.Lv;return void 0===t&&(t=this.newButtonNext(),this.Lv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonNext=function(){var t,n,i=this,r=null===(n=null===(t=this.xn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.next;if(null!==r&&!1!==r){var e=new jw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonNextActive()})),e}return null},n.prototype.onButtonNextActive=function(){this.moveTo(this.Rt+1)},Object.defineProperty(n.prototype,"buttonPrevious",{get:function(){var t=this.yv;return void 0===t&&(t=this.newButtonPrevious(),this.yv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPrevious=function(){var t,n,i=this,r=null===(n=null===(t=this.xn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.previous;if(null!==r&&!1!==r){var e=new Iw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonPreviousActive()})),e}return null},n.prototype.onButtonPreviousActive=function(){this.moveTo(this.Rt-1)},Object.defineProperty(n.prototype,"buttonTop",{get:function(){var t=this.kv;return void 0===t&&(t=this.newButtonTop(),this.kv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonTop=function(){var t,n,i=this,r=null===(n=null===(t=this.xn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.top;if(null!==r&&!1!==r&&void 0!==r){var e=new Cw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonTopActive()})),e}return null},n.prototype.onButtonTopActive=function(){this.moveTo(0)},n.prototype.newButtonPage=function(){var t,n,i=this,r=new Nw(null===(n=null===(t=this.xn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.page);return r.on("active",(function(){i.onButtonPageActive(r)})),r},Object.defineProperty(n.prototype,"buttonPages0",{get:function(){var t=this._buttonPages0;return null==t&&(t=this.newButtonPages0(),this._buttonPages0=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages0=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"buttonPages1",{get:function(){var t=this._buttonPages1;return null==t&&(t=this.newButtonPages1(),this._buttonPages1=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages1=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"page",{get:function(){var t=this.xv;return null==t&&(t=this.newPage(),this.xv=t),t},enumerable:!1,configurable:!0}),n.prototype.newPage=function(){var t;return new Rw(null===(t=this.xn)||void 0===t?void 0:t.page)},n.prototype.onButtonPageActive=function(t){var n=t.text;wn(n)&&(this.moveTo(n-1),t.state.isFocused&&(t.state.isHovered=!1,this.page.focus()))},n.prototype.update=function(){var t=this.j,n=this.Rt;if(t<=0){null!=(o=this.buttonTop)&&(o.state.isEnabled=!1),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=!1),this.hideDots(this.dots0);for(var i=0,r=(l=this.buttonPages0).length;i<r;++i)this.hidePage(l[i]);for(this.hidePage(this.page),i=0,r=(v=this.buttonPages1).length;i<r;++i)this.hidePage(v[i]);this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=!1),(f=this.buttonLast)&&(f.state.isEnabled=!1)}else{var e=n-2,u=n+2;if(e<0)u-=e,e=0;else if(t<=u){var s=u-t+1;u-=s,e-=s}var h=!1;0<e&&(h=!0,e=Math.min(e+1,n));var o,a,c,f,l,v,b=!1;for(u<t-1&&(b=!0,u=Math.max(u-1,n)),null!=(o=this.buttonTop)&&(o.state.isEnabled=0<n),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=0<n),h?this.showDots(this.dots0,1,e-1):this.hideDots(this.dots0),i=0,r=(l=this.buttonPages0).length;i<r;++i){var d=n-i-1,g=l[i];e<=d&&d<=u&&0<=d?this.showPage(g,d):h&&i===r-1?this.showPage(g,0):this.hidePage(g)}for(this.showPage(this.page,n),i=0,r=(v=this.buttonPages1).length;i<r;++i)d=n+i+1,g=v[i],e<=d&&d<=u&&d<t?this.showPage(g,d):b&&i===r-1?this.showPage(g,t-1):this.hidePage(g);b?this.showDots(this.dots1,u+1,t-2):this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=n<t-1),null!=(f=this.buttonLast)&&(f.state.isEnabled=n<t-1)}},n.prototype.showPage=function(t,n){t.text=n+1,t.show()},n.prototype.hidePage=function(t){t.hide()},n.prototype.showDots=function(t,n,i){t.show()},n.prototype.hideDots=function(t){t.hide()},n.prototype.getType=function(){return"DPagination"},n}(ps),yw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}($i),kw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}($i),xw=function(t){function n(n){var i=t.call(this,n)||this;i.L=[];var r=null==n?void 0:n.values;return r&&(i.values=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){if(t.prototype.onMenuSelect.call(this,n,i,r),i instanceof Dl){var e=this.L,u=[],s=[];i.state.isActive?this.updateMenuItems(r,e,n,void 0,u,s):this.updateMenuItems(r,e,void 0,n,u,s),this.L=u,this.text=s,this.onValueChange(u,e,s)}},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.L,e=[],u=[];this.updateMenuItems(n,r,void 0,void 0,e,u),this.L=e,this.text=u},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.open=function(){this.updateMenuItems(this.menu,this.L),t.prototype.open.call(this)},Object.defineProperty(n.prototype,"values",{get:function(){return this.L},set:function(t){var n=this.L;if(!this.isSameValues(t,n)){var i=[],r=[];this.updateMenuItems(this.menu,t,void 0,void 0,i,r),this.L=i,this.text=r}},enumerable:!1,configurable:!0}),n.prototype.isSameValues=function(t,n){if(t.length===n.length)for(var i=0,r=t.length;i<r;++i)if(n.indexOf(t[i])<0)return!1;return!1},n.prototype.updateMenuItems=function(t,n,i,r,e,u){for(var s=t.children,h=0,o=s.length;h<o;++h){var a=s[h];if(a instanceof xl)this.updateMenuItems(a.menu,n,i,r,e,u);else if(a instanceof Dl){var c=a.value;void 0!==r&&r===c?a.state.isActive=!1:void 0!==i&&a.value===i||0<=n.indexOf(a.value)?(e&&e.push(a.value),u&&u.push(a),a.state.isActive=!0):a.state.isActive=!1}}},n.prototype.getType=function(){return"DSelectMultiple"},n}(tw),Bw=function(t){function n(n){var i=t.call(this,n)||this;i.Rt=null;var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=this.Rt;e!==n&&(this.Rt=n,this.text=i,this.onValueChange(n,e,i))},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.Rt;if(null!=r){var e=this.findMenuItem(n,r);null!=e?(this.Rt=r,this.text=e):(this.Rt=null,this.text=null)}else this.Rt=null,this.text=null},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.findMenuItem=function(t,n){for(var i=t.children,r=0,e=i.length;r<e;++r){var u=i[r];if(u instanceof xl){var s=this.findMenuItem(u.menu,n);if(null!=s)return s}else if(u instanceof pl&&u.value===n)return u}return null},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){if(this.Rt!==t){var n=this.findMenuItem(this.menu,t);null!=n?(this.Rt=t,this.text=n):(this.Rt=null,this.text=null)}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSelect"},n}(tw),_w=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,i,r)||this;return s.Bv=e,s._v=u,s.Ea=.5*i,s.Ma=.5*r,s.interactive=!1,s.interactiveChildren=!1,n.on("update",(function(){s.onTextureUpdate()})),s}return _(n,t),n.prototype.onTextureUpdate=function(){this.emit("update",this)},n.prototype.onReflow=function(t,n,i){var r=this.Ea,e=this.Ma;this.x=-r+this.Bv,this.y=-e+this._v,this.width=r+n+r,this.height=e+i+e},n.prototype.render=function(n){var i=this.parent;if(i){var r=i.alpha;this.alpha=r*r*r}t.prototype.render.call(this,n)},n}(t.NineSlicePlane),Pw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n),this.Rt=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){this.Rt=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderLabel"},n}(bs),Uw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderThumb"},n}(ms),Fw=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).Rt=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0,e.Pv=e.toRounder(n),e.Uv=null!==(r=null==n?void 0:n.delta)&&void 0!==r?r:1,e}return _(n,t),n.prototype.toRounder=function(t){var n,i=null==t?void 0:t.rounder;if(i)return i;var r=null!==(n=null==t?void 0:t.precision)&&void 0!==n?n:this.theme.getPrecision(),e=Math.pow(10,r);return function(t){return Math.round(t*e)/e}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){this.Rt=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rounder",{get:function(){return this.Pv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"delta",{get:function(){return this.Uv},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderValue"},n}(bs),Gw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.Fv=0,this.Gv=this.newTrack(n),this.addChild(this.Gv),this.Hv=this.newTrackSelected(n),this.Hv.state.isActive=!0,this.addChild(this.Hv),this.$c=this.newThumb(n),this.addChild(this.$c),this.ts=this.newLabelMin(n),this.addChild(this.ts),this.ns=this.newLabelMax(n),this.addChild(this.ns),this.Rt=this.newValue(n),this.addChild(this.Rt),this.Gv.on(Yi.down,(function(t){i.Rt.visible=i.state.inEnabled,i.onTrackDown(t.data.global)})),this.Hv.on(Yi.down,(function(t){i.Rt.visible=i.state.inEnabled,i.onTrackSelectedDown(t.data.global)})),this.zv=function(t){i.onTrackUpBound(t),i.Rt.visible=!1},this.Vv=function(t){i.onTrackSelectedUpBound(t),i.Rt.visible=!1},this.$c.on(Yi.down,(function(t){i.Rt.visible=!0,i.onThumbDown(t)})),this.Wv=function(t){i.onThumbMove(t)},this.Xv=function(t){i.onThumbUp(t),i.Rt.visible=!1},this.onValuesChange()},n.prototype.newThumb=function(t){return new Uw(null==t?void 0:t.thumb)},n.prototype.newValue=function(t){return new Fw(this.toValueOptions(null==t?void 0:t.value))},n.prototype.toValueOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value=t.value),null==t.visible&&(t.visible=!1),t},n.prototype.newLabelMin=function(t){return new Pw(this.toLabelMinOptions(null==t?void 0:t.min))},n.prototype.toLabelMinOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.newLabelMax=function(t){return new Pw(this.toLabelMaxOptions(null==t?void 0:t.max))},n.prototype.toLabelMaxOptions=function(t){null==(t=t||{}).value&&(t.value=1);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.getValueMargin=function(){return 14},n.prototype.onTrackDown=function(t){if(!this.state.inDisabled){var n=et.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.Kv=i;var r=this.zv;i.on(Yi.up,r),i.on(Yi.upoutside,r),i.on(Yi.cancel,r)}this.onPick(t)}},n.prototype.onTrackSelectedDown=function(t){if(!this.state.inDisabled){var n=et.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.Kv=i;var r=this.Vv;i.on(Yi.up,r),i.on(Yi.upoutside,r),i.on(Yi.cancel,r)}this.onPick(t)}},n.prototype.onTrackUpBound=function(t){var n=this.Kv;if(n){this.Kv=void 0;var i=this.zv;n.off(Yi.up,i),n.off(Yi.upoutside,i),n.off(Yi.cancel,i)}},n.prototype.onTrackSelectedUpBound=function(t){var n=this.Kv;if(n){this.Kv=void 0;var i=this.Vv;n.off(Yi.up,i),n.off(Yi.upoutside,i),n.off(Yi.cancel,i)}},n.prototype.onThumbMove=function(t){this.state.inDisabled||this.onPick(t.data.global)},n.prototype.onThumbDown=function(t){var n=et.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.Kv=i;var r=this.Wv;i.on(Yi.move,r);var e=this.Xv;i.on(Yi.up,e),i.on(Yi.upoutside,e),i.on(Yi.cancel,e)}},n.prototype.onThumbUp=function(t){var n=this.Kv;if(n){this.Kv=void 0;var i=this.Wv;n.off(Yi.move,i);var r=this.Xv;n.off(Yi.up,r),n.off(Yi.upoutside,r),n.off(Yi.cancel,r)}},n.prototype.updateValue=function(){var t=this.ts.value,n=this.ns.value,i=this.Rt,r=i.rounder(t+this.Fv*(n-t)),e=i.value;r!==e&&(i.value=r,i.text=i.value,this.emit("change",r,e,this))},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.onValuesChange()},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt.value},set:function(t){t=Math.max(this.ts.value,Math.min(this.ns.value,t)),this.Rt.value!==t&&(this.Rt.value=t,this.onValuesChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.ts.value},set:function(t){var n=this.ts;if(t=Math.min(this.ns.value,t),n.value!==t){var i=this.Rt;n.text=n.value=t,i.value=Math.max(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.ns.value},set:function(t){var n=this.ns;if(t=Math.max(this.ts.value,t),n.value!==t){var i=this.Rt;n.text=n.value=t,i.value=Math.min(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSlider"},n}($i),Hw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrack"},n}(ms),zw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackHorizontal"},n}(Hw),Vw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new zw(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new zw(null==t?void 0:t.track)},i.prototype.toValueOptions=function(t){var i=this;return null==(t=n.prototype.toValueOptions.call(this,t)).y&&(t.y=function(t,n){return.5*t-n-i.getValueMargin()}),t},i.prototype.toLabelMinOptions=function(t){return null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return.5*-n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.toLabelMaxOptions=function(t){return null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return t-.5*n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=Math.max(0,Math.min(this.Gv.width,i.x));this.Fv=r/this.Gv.width,this.moveThumbPosition(r)},i.prototype.onValuesChange=function(){var t=this.ts.value,n=this.ns.value,i=this.Rt.value;this.Fv=(i-t)/(n-t);var r=this.Fv*this.Gv.width;this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.$c;n.x=t-.5*n.width,this.Hv.width=t;var i=this.Rt;i.x=t-.5*i.width,this.updateValue()},i.prototype.onKeyDown=function(t){return Ki.isArrowRightKey(t)?this.value+=this.Rt.delta:Ki.isArrowLeftKey(t)&&(this.value-=this.Rt.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderHorizontal"},i}(Gw),Ww=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackVertical"},n}(Hw),Xw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new Ww(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new Ww(null==t?void 0:t.track)},i.prototype.toLabelMinOptions=function(t){null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return t-.5*n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=Xu.RIGHT),t},i.prototype.toLabelMaxOptions=function(t){null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return.5*-n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=Xu.RIGHT),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=this.height,e=Math.max(0,Math.min(r,i.y));this.Fv=(r-e)/r,this.moveThumbPosition(e)},i.prototype.onValuesChange=function(){var t=this.ts.value,n=this.ns.value,i=this.Rt.value;this.Fv=(i-t)/(n-t);var r=this.height*(1-this.Fv);this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.$c;n.y=t-.5*n.height;var i=this.Hv;i.y=t,i.height=this.height-t;var r=this.Rt;r.y=t-r.height-this.getValueMargin(),this.updateValue()},i.prototype.onKeyDown=function(t){return Ki.isArrowUpKey(t)?this.value+=this.Rt.delta:Ki.isArrowDownKey(t)&&(this.value-=this.Rt.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderVertical"},i}(Gw),Kw=function(){function t(){}return t.set=function(t,n,i,r,e){var u,s=this.toRenderable(n,i,r);t.renderable=s;var h=t.state;h.lock(),h.isDisabled=!s,!1!==e&&(h.isReadOnly=this.toReadOnly(n,i,r));var o=null===(u=r.state)||void 0===u?void 0:u.modifier;o&&o(n,i,t.state),h.unlock()},t.toReadOnly=function(t,n,i){var r=i.editing.enable;return!0!==r&&(!1===r||!r(t,n))},t.toRenderable=function(t,n,i){var r=i.renderable;return!0===r||!1!==r&&r(t,n)},t}(),Yw=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).Yv=-1,s.Jv=n,s.Zv=i,s.Z=r,s.qv=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.Zv.selecting,u=e.dialog;if(u){var s=null!==(i=this.Xs)&&void 0!==i?i:null;e.setter(u,s),u.open(this).then((function(){var t=e.getter(u);r.qv?t!==s&&(r.text=t,r.onValueChange(t,s)):r.onValueChange(t,null)}))}},n.prototype.onValueChange=function(t,n){var i=this.Qv;if(void 0!==i){var r=this.Yv,e=this.Jv;this.Zv.setter(i,e,t),this.emit("change",t,n,this),this.Z(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Xs;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,u?(this.Ws=t,this.Xs=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectDialog"},n}(ms),Jw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionDialog"},n}(Yw),Zw=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){var e=this.Qv;if(void 0!==e){var u=this.Yv,s=this.Jv;this.Zv.setter(e,s,n),t.prototype.onMenuSelect.call(this,n,i,r),this.Z(n,null,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,this.text=t,Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellActionMenu"},n}(nw),qw=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).Yv=-1,s.Jv=n,s.Zv=i,s.Z=r,s.qv=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.Zv.selecting.promise;r&&r().then((function(t){var n;if(i.qv){var r=null!==(n=i.Xs)&&void 0!==n?n:null;t!==r&&(i.text=t,i.onValueChange(t,r))}else i.onValueChange(t,null)}))},n.prototype.onValueChange=function(t,n){var i=this.Qv;if(void 0!==i){var r=this.Yv,e=this.Jv;this.Zv.setter(i,e,t),this.emit("change",t,n,this),this.Z(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Xs;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,u?(this.Ws=t,this.Xs=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectPromise"},n}(ms),Qw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionPromise"},n}(qw),$w=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,this.text=t,Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellText"},n}(ds),tp=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,e)||this).nh=Ei(null!==(u=null==e?void 0:e.when)&&void 0!==u?u:zu.CLICKED,zu),s.on(Yi.tap,(function(t){s.onClick(t)})),s}return _(n,t),n.prototype.onClick=function(t){this.nh===zu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.nh===zu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this);var n=this.Qv;if(void 0!==n){var i=this.Yv,r=this.Jv;this.emit("change",null,null,this),this.Z(null,null,n,i,r,this)}},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Ki.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Ki.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTableBodyCellButton"},n}($w),np={INDEX:0,TEXT:1,INTEGER:2,REAL:3,CHECK:4,CHECK_SINGLE:5,COLOR:6,BUTTON:7,SELECT:8,DATE:9,DATETIME:10,TIME:11,ACTION:12,LINK:13,TREE:14},ip=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.onValueChange(!0,!1)},n.prototype.onInactivate=function(n){t.prototype.onInactivate.call(this,n),this.onValueChange(!1,!0)},n.prototype.onValueChange=function(t,n){var i=this.Qv;if(void 0!==i){var r=this.Yv,e=this.Jv,u=this.Zv;u.setter(i,e,t),this.emit("change",t,n,this);var s=this.Z;s(t,n,i,r,e,this),t&&u.type===np.CHECK_SINGLE&&this.onChangeSingle(r,e,u,s)}},n.prototype.onChangeSingle=function(t,n,i,r){var e=this,u=this.parent;if(u){var s=u.parent;if(s){var h=!1,o=i.getter,a=i.setter;s.data.each((function(i,u){return t===u||!o(i,n)||(a(i,n,!1),h=!0,r(!1,!0,i,u,n,e),!1)})),h&&s.update(!0)}}},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,this.state.isActive=!!t,Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellCheck"},n}(Rb),rp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.Qv;if(void 0!==r){var e=this.Yv,u=this.Jv;this.Zv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r;var s=this.value;if(wn(t))s.color=t,s.alpha=1;else if(ct(t)){var h=Number(t);s.color=h==h?h:16777215,s.alpha=1}else if(null!=t){var o=t.color,a=t.alpha;s.color=wn(o)?o:16777215,s.alpha=wn(a)?a:1}else s.color=16777215,s.alpha=1;Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellColor"},n}(Zb),ep=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.Qv;if(void 0!==r){var e=this.Yv,u=this.Jv;this.Zv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.Qv=n,this.Yv=r,t instanceof Date)u?(this.Ws=t,this.Xs=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(wn(t)){var s=this.Xs;void 0===s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellDate"},n}(Qb),up=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.Qv;if(void 0!==r){var e=this.Yv,u=this.Jv;this.Zv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.Qv=n,this.Yv=r,t instanceof Date)u?(this.Ws=t,this.Xs=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(wn(t)){var s=this.Xs;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellDatetime"},n}(id),sp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,this.text=r,Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellIndex"},n}(ds),hp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.Qv;if(void 0!==r){var e=this.Yv,u=this.Jv;this.Zv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,this.text=Number(t),Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellInputInteger"},n}(Ps),op=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.Qv;if(void 0!==r){var e=this.Yv,u=this.Jv;this.Zv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,this.text=Number(t),Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellInputReal"},n}(Gs),ap=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.Qv;if(void 0!==r){var e=this.Yv,u=this.Jv;this.Zv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,this.text=String(t),Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellInputText"},n}(Vs),cp=function(t){function n(n){var i=t.call(this,n)||this;return i.Vn=new Cb(i.Vn),i}return _(n,t),Object.defineProperty(n.prototype,"padding",{get:function(){return this.Vn},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellInputTreeInput"},n}(Vs),fp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellInputTreeMarker"},n}(gs),lp={START:"START",END:"END",FROZEN:"FROZEN",FROZEN_END:"FROZEN_END",SORTABLE:"SORTABLE",SORTED_ASCENDING:"SORTED_ASCENDING",SORTED_DESCENDING:"SORTED_DESCENDING",HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED",CHECKABLE:"CHECKABLE",SELECTABLE:"SELECTABLE"},vp=function(t){function n(n,i,r,e){var u=t.call(this,function(t){if(null!=t)return{weight:t.weight,width:t.width}}(e))||this;u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r;var s=u.newInput(e);u.bh=s,u.addChild(s);var h=u.newMarker(e);return u.A=h,u.addChild(h),u}return _(n,t),n.prototype.newInput=function(t){return new cp(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){var n=this;return{weight:1,text:null==t?void 0:t.text,editing:null==t?void 0:t.editing,when:null==t?void 0:t.when,cursor:null==t?void 0:t.cursor,on:{change:function(t,i){n.onInputChange(t,i)}}}},n.prototype.onInputChange=function(t,n){var i=this.Qv;if(void 0!==i){var r=this.Yv,e=this.Jv;this.Zv.setter(i,e,t),this.emit("change",t,n,this),this.Z(t,n,i,r,e,this)}},n.prototype.newMarker=function(t){var n=this;return new fp({visible:!1,on:{active:function(){n.onMarkerActive()}}})},n.prototype.onMarkerActive=function(){this.A.state.is(lp.HAS_CHILDREN)&&this.toggle()},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.Qv;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.bh.padding.getLeft()},n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r;var s=this.bh;s.visible=!0,s.text=String(t);var h=this.A;if(wn(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=h.state;f.lock(),f.set(lp.HAS_CHILDREN,a),f.set(ot.DISABLED,!a),f.set(lp.OPENED,o),f.unlock();var l=this.theme.getLevelPadding(c);h.width=l,a?h.show():h.hide(),s.padding.adjLeft(l)}else h.state.removeAll(lp.OPENED,lp.HAS_CHILDREN),h.hide(),s.padding.adjLeft(0);Kw.set(this.bh,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1,this.bh.visible=!1,this.A.hide()},n.prototype.getType=function(){return"DTableBodyCellInputTree"},n}($i),bp=function(t,n){if(n)return{url:dp(t,n.url),target:n.target,checker:gp(t,n.checker),menu:n.menu}},dp=function(t,n){return ct(n)||null==n?n:function(){var i=t.row;return void 0!==i?n(i,t.rowIndex,t.columnIndex,t):null}},gp=function(t,n){if(null!=n)return function(){var i=t.row;return void 0!==i&&n(i,t.rowIndex,t.columnIndex,t)}},mp=function(t){function n(n,i,r,e){var u;return t.call(this,n,i,r,Ll.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this}return _(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t,n=this.To;return null==n&&(n=new Rl(bp(this,null===(t=this.xn)||void 0===t?void 0:t.link)),this.To=n),n},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellLink"},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n}(tp),wp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.Qv;if(void 0!==e){var u=this.Yv,s=this.Jv;this.Zv.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.Z(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,this.value=t,Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMenu"},n}(Bw),pp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.Qv;if(void 0!==e){var u=this.Yv,s=this.Jv;this.Zv.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.Z(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,this.values=t,Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMultiple"},n}(xw),Op=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Yv=-1,u.Jv=n,u.Zv=i,u.Z=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.Qv;if(void 0!==r){var e=this.Yv,u=this.Jv;this.Zv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.Qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Yv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.Qv=n,this.Yv=r,t instanceof Date)u?(this.Ws=t,this.Xs=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(wn(t)){var s=this.Xs;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}Kw.set(this,n,e,this.Zv)},n.prototype.unset=function(){this.Qv=void 0,this.Yv=-1},n.prototype.getType=function(){return"DTableBodyCellTime"},n}(Jd),Dp=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,Ll.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this).Vn=new Cb(s.Vn),s}return _(n,t),n.prototype.onClick=function(n){var i;!0!==(null===(i=this.link)||void 0===i?void 0:i.onClick(this,n))&&t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.To;return void 0===t&&(t=this.newLink(),this.To=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t,n=null===(t=this.xn)||void 0===t?void 0:t.link;return n?new Rl(bp(this,n)):null},n.prototype.onActivate=function(n){var i;t.prototype.onActivate.call(this,n),this.state.is(lp.HAS_CHILDREN)?this.toggle():null===(i=this.link)||void 0===i||i.open(n)},n.prototype.toggle=function(){var t=this.Qv;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.padding.getLeft()&&(this.toggle(),!0)},n.prototype.set=function(t,n,i,r,e,u){this.Qv=n,this.Yv=r,this.text=t,Kw.set(this,n,e,this.Zv,!1);var s=this.link,h=this.Vn;if(wn(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=this.state;f.lock(),f.set(lp.HAS_CHILDREN,a),f.set(lp.OPENED,o),f.unlock(),h.adjLeft(this.theme.getLevelPadding(c)),s&&(s.menu.enable=!a)}else this.state.removeAll(lp.OPENED,lp.HAS_CHILDREN),h.adjLeft(0),s&&(s.menu.enable=!1)},n.prototype.getType=function(){return"DTableBodyCellTree"},n}(tp),Ep={NONE:0,SINGLE:1,MULTIPLE:2},Mp=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).ti=!0,e.$v=null!==(i=n.frozen)&&void 0!==i?i:0,e.tb=null!==(r=n.columns)&&void 0!==r?r:[],e}return _(n,t),n.prototype.initCells=function(t,n,i){for(var r=this.toIndexEnd(n),e=n.length-1;0<=e;--e){var u=this.newCell(e,n[e],n,t),s=u.state;s.lock(!1),0===e&&s.add(lp.START),e===r&&s.add(lp.END),e<i&&s.add(lp.FROZEN),e===i-1&&s.add(lp.FROZEN_END),s.unlock(),this.addChild(u)}},n.prototype.toIndexEnd=function(t){for(var n=t.length,i=0;i<n;++i)if(void 0!==t[i].weight)return n-1;return n},n.prototype.onRefit=function(){t.prototype.onRefit.call(this),this.resetFrozenCellPosition()},n.prototype.updateFrozenCellPosition=function(t){for(var n=this.tb,i=this.children,r=i.length,e=this.$v,u=0;u<e;++u){var s=n[u];i[r-1-u].position.x=-t+s.offset}},n.prototype.resetFrozenCellPosition=function(){for(var t=this.tb,n=this.children,i=n.length,r=this.$v,e=this.getContentPositionX(),u=0;u<r;++u){var s=t[u],h=n[i-1-u];s.offset=h.position.x,h.position.x=-e+s.offset}},n.prototype.getClippingRect=function(n,i){t.prototype.getClippingRect.call(this,n,i);var r=this.$v;if(0<r){var e=n;if(e&&e.parent===this){var u=this.children,s=u.indexOf(e);if(0<=s&&r<=u.length-1-s){var h=u[s+1],o=h.position.x+h.width;i.x+=o,i.width-=o}}}},n.prototype.getType=function(){return"DTableRow"},n}(ps),Sp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.$e=-1,u.nb=function(t,i,r,e,s){u.emit("change",t,i,r,e,s,u),n(t,i,r,e,s,u)},u.ib=r,u.state.isAlternated=!i,u.initCells(e,u.tb,u.$v),u}return _(n,t),n.prototype.newCell=function(t,n,i,r){var e=this.nb,u=this.ib,s=u.get(t);if(null==s&&(s=this.toCellOptions(t,n,r),u.set(t,s)),!1!==n.editing.enable)return this.newCellEditable(t,n,e,s);var h=this.newCellUnediable(t,n,e,s);return n.type!==np.TREE&&(h.state.isReadOnly=!0),h},n.prototype.newCellEditable=function(t,n,i,r){switch(n.type){case np.INDEX:return new sp(t,n,i,r);case np.TEXT:return new ap(t,n,i,r);case np.TREE:return new vp(t,n,i,r);case np.INTEGER:return new hp(t,n,i,r);case np.REAL:return new op(t,n,i,r);case np.CHECK:case np.CHECK_SINGLE:return new ip(t,n,i,r);case np.COLOR:return new rp(t,n,i,r);case np.BUTTON:return new tp(t,n,i,r);case np.LINK:return new mp(t,n,i,r);case np.SELECT:return this.newCellSelect(t,n,i,r);case np.ACTION:return this.newCellAction(t,n,i,r);case np.DATE:return new ep(t,n,i,r);case np.DATETIME:return new up(t,n,i,r);case np.TIME:return new Op(t,n,i,r);default:return new $w(t,n,i,r)}},n.prototype.newCellUnediable=function(t,n,i,r){switch(n.type){case np.INDEX:return new sp(t,n,i,r);case np.TEXT:return new $w(t,n,i,r);case np.TREE:return new Dp(t,n,i,r);case np.INTEGER:case np.REAL:return new $w(t,n,i,r);case np.CHECK:case np.CHECK_SINGLE:return new ip(t,n,i,r);case np.COLOR:return new rp(t,n,i,r);case np.BUTTON:return new tp(t,n,i,r);case np.LINK:return new mp(t,n,i,r);case np.SELECT:return this.newCellSelect(t,n,i,r);case np.ACTION:return this.newCellAction(t,n,i,r);case np.DATE:return new ep(t,n,i,r);case np.DATETIME:return new up(t,n,i,r);case np.TIME:return new Op(t,n,i,r);default:return new $w(t,n,i,r)}},n.prototype.newCellSelect=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new wp(t,n,i,r):null!=e.multiple?new pp(t,n,i,r):null!=e.dialog?new Yw(t,n,i,r):null!=e.promise?new qw(t,n,i,r):new $w(t,n,i,r)},n.prototype.newCellAction=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new Zw(t,n,i,r):null!=e.dialog?new Jw(t,n,i,r):null!=e.promise?new Qw(t,n,i,r):new $w(t,n,i,r)},n.prototype.toCellOptions=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v,b,d,g,m=rb(n.body,i.cell);m.weight=n.weight,m.width=n.width,null!==(r=m.state)&&void 0!==r||(m.state=n.state.initial);var w=n.formatter;null!=w&&(null!==(u=(O=null!==(e=m.text)&&void 0!==e?e:m.text={}).formatter)&&void 0!==u||(O.formatter=w));var p=n.align;if(null!=p){var O,D=null!==(h=(O=null!==(s=m.text)&&void 0!==s?s:m.text={}).align)&&void 0!==h?h:O.align={};null!==(o=D.horizontal)&&void 0!==o||(D.horizontal=p)}var E=n.editing;if(!1!==E.enable){var M=null!==(a=(g=m).editing)&&void 0!==a?a:g.editing={};null!==(c=M.formatter)&&void 0!==c||(M.formatter=E.formatter),null!==(f=M.unformatter)&&void 0!==f||(M.unformatter=E.unformatter),null!==(l=M.validator)&&void 0!==l||(M.validator=E.validator)}var S=n.link;void 0!==S&&(m.link=S);var T=n.selecting,j=null!==(v=T.menu)&&void 0!==v?v:T.multiple;return void 0!==j&&(m.menu=j),(null!==(d=null===(b=null==i?void 0:i.selection)||void 0===b?void 0:b.type)&&void 0!==d?d:Ep.NONE)!==Ep.NONE&&(m.when="DOUBLE_CLICKED",m.cursor=function(t){if(t.in(lp.SELECTABLE))return"pointer"}),m},n.prototype.getType=function(){return"DTableBodyRow"},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.$e},enumerable:!1,configurable:!0}),n.prototype.isCell=function(t){return null!=t&&"set"in t},n.prototype.set=function(t,n,i,r){if(r||this.Rt!==t||this.$e!==i){this.Rt=t,this.$e=i;for(var e=this.children,u=e.length,s=this.tb,h=s.length,o=0;o<u;++o){var a=e[o],c=h-1-o,f=s[c];this.isCell(a)&&a.set(f.getter(t,c),t,n,i,c,r)}this.onSet(t,i)}},n.prototype.onSet=function(t,n){this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Rt){this.Rt=void 0,this.$e=-1;for(var t=this.children,n=t.length,i=0;i<n;++i){var r=t[i];this.isCell(r)&&r.unset()}this.onUnset()}},n.prototype.onUnset=function(){this.emit("unset",this)},n.prototype.getContentPositionX=function(){var t=this.parent;if(t){var n=t.parent;if(n)return n.position.x}return 0},n}(Mp),Tp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.dl=-1,i.rb=!1,i.eb=-1,i.p=n,i.hf=null,i.ub=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.rb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.rb&&(this.rb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.rb},n.prototype.newFiltered=function(){var t=this.hf;if(null!=t){var n,i=[],r=this.p,e=r.sorter,u=r.rows;if(at(t))if(n=e.indices)for(var s=0,h=n.length;s<h;++s)t(u[o=n[s]],o)&&i.push(s);else for(s=0,h=u.length;s<h;++s)t(u[s],s)&&i.push(s);else if(n=e.indices)for(s=0,h=n.length;s<h;++s){var o=n[s];t.test(u[o],o)&&i.push(s)}else for(s=0,h=u.length;s<h;++s)t.test(u[s],s)&&i.push(s);return i}return null},n.prototype.get=function(){return this.hf},n.prototype.set=function(t){this.hf!==t&&(this.hf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R===this.dl&&this.p.sorter.id===this.eb||(this.dl=this.R,this.eb=this.p.sorter.id,this.rb?(this.ub=this.newFiltered(),this.emit("change",this)):null!=this.ub&&(this.ub=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.ub},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),jp=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"rows",{get:function(){var t=[];return this.each((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),t.prototype.map=function(t){var n=this.p,i=n.sorter.map(t);return null!=i?n.filter.map(i):null},t.prototype.unmap=function(t){var n=this.p;return n.sorter.unmap(n.filter.unmap(t))},t.prototype.size=function(){var t=this.p,n=t.filter.indices;return null!=n?n.length:t.size()},t.prototype.get=function(t){return this.p.get(this.unmap(t))},t.prototype.each=function(t,n,i){var r=this.p,e=r.rows,u=r.supplimentals,s=r.filter.indices,h=r.sorter.indices;if(n=null!=n?Math.max(0,n):0,s){var o=s.length;if(i=null!=i?Math.min(o,i):o,h)for(var a=n;a<i&&!1!==t(e[c=h[s[a]]],u?u[c]:null,a,c);++a);else for(a=n;a<i&&!1!==t(e[c=s[a]],u?u[c]:null,a,c);++a);}else if(o=e.length,i=null!=i?Math.min(o,i):o,h)for(a=n;a<i;++a){var c;if(!1===t(e[c=h[a]],u?u[c]:null,a,c))break}else for(a=n;a<i&&!1!==t(e[a],u?u[a]:null,a,a);++a);},t}(),Np=function(t,n){return t[0]-n[0]},Ip=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).p=n,e.Nt=Ei(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:Ep.NONE,Ep),e.On=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.Nt},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.On;n.has(t)?n.delete(t):n.add(t),this.onChange()},n.prototype.add=function(t){var n=this.On,i=n.size;n.add(t),i!==n.size&&this.onChange()},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.On;if(0<t.size){var n=NaN;return t.forEach((function(t){n!=n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.On;if(0<t.size){var n=0;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.On,u=e.size;if(t<i)for(var s=i+(r?1:0),h=t+(n?0:1);h<s;++h)e.add(h);else for(s=t+(n?1:0),h=i+(r?0:1);h<s;++h)e.add(h);u!==e.size&&this.onChange()},n.prototype.addAll=function(t){for(var n=this.On,i=n.size,r=0,e=t.length;r<e;++r)n.add(t[r]);i!==n.size&&this.onChange()},n.prototype.contains=function(t){return this.On.has(t)},n.prototype.remove=function(t){this.On.delete(t)&&this.onChange()},n.prototype.clear=function(){var t=this.On;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.On;n.has(t)&&1===n.size||(n.clear(),n.add(t),this.onChange())},n.prototype.clearAndAddAll=function(t){var n=this.On;if(0<n.size||0<t.length){n.clear();for(var i=0,r=t.length;i<r;++i)n.add(t[i]);this.onChange()}},n.prototype.shift=function(t,n){var i=[],r=this.On;if(r.forEach((function(n){t<=n&&i.push(n)})),0<i.length){for(var e=0,u=i.length;e<u;++e)r.delete(i[e]);for(e=0,u=i.length;e<u;++e)r.add(i[e]+n);this.onChange()}},n.prototype.size=function(){return this.On.size},n.prototype.isEmpty=function(){return 0===this.On.size},n.prototype.each=function(t){var n=!1;this.On.forEach((function(i){n||!1===t(i)&&(n=!0)}))},Object.defineProperty(n.prototype,"indices",{get:function(){var t=[];return this.On.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[],n=this.p;return this.On.forEach((function(i){t.push(n.get(i))})),t},enumerable:!1,configurable:!0}),n.prototype.toArray=function(){var t=[],n=this.p;return this.On.forEach((function(i){t.push([i,n.get(i)])})),t},n.prototype.toSortedArray=function(){return this.toArray().sort(Np)},n.prototype.toObject=function(){var t={},n=this.p;return this.On.forEach((function(i){t[i]=n.get(i)})),t},n.prototype.toMap=function(){var t=new Map,n=this.p;return this.On.forEach((function(i){t.set(i,n.get(i))})),t},n}(t.utils.EventEmitter),Cp={ASCENDING:0,DESCENDING:1},Ap=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.dl=-1,i.rb=!1,i.p=n,i.sb=null,i.hb=null,i.kt=Cp.ASCENDING,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return this.kt},set:function(t){this.kt=t},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.rb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.rb&&(this.rb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.rb},n.prototype.newSorted=function(){var t=this.sb;if(null!=t){for(var n=[],i=this.p.rows,r=0,e=i.length;r<e;++r)n.push(r);return n.sort(this.toComparator(i,t)),n}return null},n.prototype.toComparator=function(t,n){var i=this.kt;return at(n)?i===Cp.ASCENDING?function(i,r){return n(t[i],t[r],i,r)}:function(i,r){return n(t[r],t[i],r,i)}:i===Cp.ASCENDING?function(i,r){return n.compare(t[i],t[r],i,r)}:function(i,r){return n.compare(t[r],t[i],r,i)}},n.prototype.get=function(){return this.sb},n.prototype.set=function(t){this.sb!==t&&(this.sb=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.dl&&(this.dl=this.R,this.rb?(this.hb=this.newSorted(),this.emit("change",this)):null!=this.hb&&(this.hb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.hb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Rp=function(n){function i(t){var i=n.call(this)||this;if(i.p=null,i.ob=i.toRows(null==t?void 0:t.rows),i.Vc=new jp(i),i.zc=i.toSelection(null==t?void 0:t.selection),i.hf=new Tp(i),i.ab=new Ap(i),t){var r=t.filter;r&&i.hf.set(r);var e=t.comparator;e&&i.ab.set(e);var u=t.on;if(u)for(var s in u){var h=u[s];h&&i.on(s,h)}}return i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:at(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new Ip(this,t)},i.prototype.bind=function(t){this.p=t},i.prototype.toRows=function(t){var n=[];if(null!=t)for(var i=0,r=t.length;i<r;++i)n.push(t[i]);return n},Object.defineProperty(i.prototype,"rows",{get:function(){return this.ob},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this.p;t&&t.update()},i.prototype.lock=function(){var t=this.p;t&&t.lock()},i.prototype.unlock=function(){var t=this.p;t&&(t.unlock(!1),t.update())},i.prototype.size=function(){return this.ob.length},i.prototype.clear=function(){var t=this.ob;0<t.length&&(t.length=0,this.lock(),this.zc.clear(),this.ab.toDirty(),this.hf.toDirty(),this.unlock())},i.prototype.clearAndAdd=function(t){var n=this.ob;n.length=0,n.push(t),this.lock(),this.zc.clear(),this.ab.toDirty(),this.hf.toDirty(),this.unlock()},i.prototype.clearAndAddAll=function(t){var n=this.ob;n.length=0;for(var i=0,r=t.length;i<r;++i)n.push(t[i]);this.lock(),this.zc.clear(),this.ab.toDirty(),this.hf.toDirty(),this.unlock()},i.prototype.add=function(t,n){var i=this.ob,r=this.zc,e=this.ab,u=this.hf;null==n?(i.push(t),this.lock(),e.toDirty(),u.toDirty(),this.unlock()):0<=n&&n<i.length&&(i.splice(n,0,t),this.lock(),r.shift(n,1),e.toDirty(),u.toDirty(),this.unlock())},i.prototype.addAll=function(t,n){var i=this.ob,r=i.length,e=this.zc,u=this.ab,s=this.hf;if(null==n){for(var h=0,o=a=t.length;h<o;++h)i.push(t[h]);this.lock(),u.toDirty(),s.toDirty(),this.unlock()}else if(0<=n&&n<r){var a=t.length;for(h=0;h<a;++h)i.splice(n+h,0,t[h]);this.lock(),e.shift(n,a),u.toDirty(),s.toDirty(),this.unlock()}},i.prototype.get=function(t){var n=this.ob;return 0<=t&&t<n.length?n[t]:null},i.prototype.set=function(t,n){var i=this.ob;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.lock(),this.ab.toDirty(),this.hf.toDirty(),this.unlock(),r}return null},i.prototype.remove=function(t){var n=this.ob;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.lock(),this.zc.remove(t),this.ab.toDirty(),this.hf.toDirty(),this.unlock(),i}return null},i.prototype.each=function(t,n,i){var r=this.ob;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.zc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.hf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.Vc},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),Lp=function(n){function i(t){var i,r=this;(r=n.call(this,t)||this).transform.position.y=null!==(i=t.offset)&&void 0!==i?i:0;var e=r.toData(t.data);r.Pt=e,e.bind(r);var u=r.theme,s=function(t,n,i){var r=n.columns||[],e=n.row;return null!=e?(null==e.height&&(e.height=t.getRowHeight()),void 0===e.columns&&(e.columns=r),null==e.frozen&&(e.frozen=n.frozen),void 0===e.selection?e.selection={type:i}:void 0===e.selection.type&&(e.selection.type=i)):e={columns:r,height:t.getRowHeight(),frozen:n.frozen,selection:{type:i}},e}(u,t,e.selection.type);return r.cb=s,r.fb=null!=s.height?s.height:u.getRowHeight(),r.tb=s.columns||[],r.lb=0,r.vb=0,r.bb=0,r.gb=!1,r.mb=!1,r.wb=[],r.pb=function(t,n,i,r,u){e.emit("change",t,n,i,r,u,e)},r.ib=new Map,r.Pt.emit("init",r.Pt),r}return _(i,n),i.prototype.toData=function(t){return this.isData(t)?t:new Rp(t)},i.prototype.isData=function(t){return null!=t&&"mapped"in t},i.prototype.onResize=function(t,i,r,e){n.prototype.onResize.call(this,t,i,r,e),this.update()},Object.defineProperty(i.prototype,"selection",{get:function(){return this.Pt.selection},enumerable:!1,configurable:!0}),i.prototype.lock=function(){this.bb+=1,1===this.bb&&(this.gb=!1,this.mb=!1)},i.prototype.unlock=function(t){this.bb-=1,0===this.bb&&(t&&this.gb&&this.update(this.mb),this.gb=!1,this.mb=!1)},i.prototype.update=function(t){if(0<this.bb)return this.gb=!0,void(t&&(this.mb=!0));var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=this.children,e=i.height,u=this.fb,s=this.Pt,h=s.mapped.size(),o=this.lb,a=this.vb,c=a-o,f=this.transform.position.y,l=f+h*u,v=Math.max(e,l),b=Math.max(e-v,n.position.y),d=-b/u,g=(e-(b+f))/u,m=Math.floor(d);m-=m%2==0?2:1;var w=Math.floor(g),p=(w+=(w-m)%2==1?3:2)-m;if(p<c&&c-2<=p&&(w=m+(p=c)),c<p){for(var O=c;O<p;++O){var D=o+O,E=this.newRow(D%2==0);this.addChild(E)}a=o+(c=p)}else if(p<c){for(O=c-1;p<=O;--O)this.removeChild(r[O]);a=o+(c=p)}this.lb=m,this.vb=w;var M=m-o,S=Math.abs(M),T=r.length;if(0<S&&S<T){var j=this.wb;if(0<M){for(O=0;O<S;++O)j.push(this.resetRow(r[O]));for(O=S;O<T;++O)r[O-S]=r[O];for(O=0;O<S;++O)r[T-S+O]=j[O]}else{for(O=0;O<S;++O)j.push(this.resetRow(r[T-S+O]));for(O=T-S-1;0<=O;--O)r[O+S]=r[O];for(O=0;O<S;++O)r[O]=j[O]}j.length=0}var N=s.selection,I=N.type!==Ep.NONE;for(s.mapped.each((function(n,i,e,s){var h=r[e-m];h.position.y=e*u;var o=h.state;o.lock(),o.set(lp.SELECTABLE,I),o.set(ot.ACTIVE,N.contains(s)),o.remove(ot.DISABLED),o.unlock(),h.set(n,i,s,t)}),m,m+T),O=0;m+O<0&&O<T;++O)(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ot.DISABLED),A.removeAll(lp.SELECTABLE,ot.ACTIVE),A.unlock(),C.unset();for(O=T-1;h<=m+O&&0<=O;--O){var C,A;(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ot.DISABLED),A.removeAll(lp.SELECTABLE,ot.ACTIVE),A.unlock(),C.unset()}this.lock(),n.position.y=b,n.height=v,this.height=l,this.unlock(!1),this.emit("update",d,g,this)}}},i.prototype.resetRow=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];e instanceof $i&&(e.state.isPressed=!1)}return t},i.prototype.newRow=function(t){return new Sp(this.pb,t,this.ib,this.cb)},i.prototype.onParentMove=function(t,i,r,e){n.prototype.onParentMove.call(this,t,i,r,e),this.updateFrozenCellPosition(t)},i.prototype.updateFrozenCellPosition=function(t){var n=this.cb.frozen;if(null!=n&&0<n)for(var i=this.children,r=0,e=i.length;r<e;++r)i[r].updateFrozenCellPosition(t)},i.prototype.getClippingRect=function(t,i){n.prototype.getClippingRect.call(this,t,i);var r=this.parent;if(r){var e=-r.transform.position.y;i.y+=e,i.height-=e}},i.prototype.scrollTo=function(t){var n=this.parent;if(null==n)return!1;var i=n.parent;if(null==i)return!1;var r=-1;return wn(t)?0<=t&&t<this.data.mapped.size()&&(r=t):this.data.mapped.each((function(n,i,e){return n!==t||(r=e,!1)})),!(r<0||(n.position.y=Math.max(Math.min(0,i.height-n.height),-r*this.fb),et.update(this),0))},i.prototype.toRowIndexMapped=function(t){return 0<=this.parent.position.y+t.y?Math.floor(t.y/this.fb):-1},i.prototype.toRow=function(t){var n=t-this.lb,i=this.children;return 0<=n&&n<i.length?i[n]:null},i.prototype.toCell=function(t,n){for(var i=t.children,r=i.length,e=this.tb.length,u=0,s=Math.min(r,e);u<s;++u){var h=i[r-u-1],o=n.x-h.position.x;if(0<=o&&o<=h.width)return h}return null},i.prototype.onRowClick=function(t){if(this.state.isActionable){var n=i.WORK_ON_CLICK;n.copyFrom(t.data.global),this.toLocal(n,void 0,n,!1);var r=this.toRowIndexMapped(n);if(0<=r&&r<this.Pt.mapped.size()){var e=this.toRow(r);if(e){var u=this.toCell(e,n);if(u&&u.onRowSelect&&u.onRowSelect(t,n))return}this.onRowSelect(t,r)}}},i.prototype.onRowSelect=function(t,n){var i=this.Pt,r=i.selection,e=r.type===Ep.SINGLE,u=!e,s=i.mapped.unmap(n),h=t.data.originalEvent,o=h.ctrlKey,a=h.shiftKey;if(e||r.isEmpty()||!u||!o&&!a)r.clearAndAdd(s);else if(o)r.toggle(s);else if(a){var c=r.last;if(null!=c){var f=i.sorter,l=i.filter,v=f.map(s),b=f.map(c);if(null!=v&&null!=b){var d=b+1,g=v+1;if(v<b&&(d=v,g=b),d<g){var m=[],w=l.indices,p=f.indices;if(w)if(p)for(var O=0,D=w.length;O<D;++O)d<=(E=w[O])&&E<g&&m.push(p[E]);else for(O=0,D=w.length;O<D;++O){var E;d<=(E=w[O])&&E<g&&m.push(E)}else if(p)for(O=d;O<g;++O)m.push(p[O]);else for(O=d;O<g;++O)m.push(O);r.addAll(m)}}}}},i.prototype.onDblClick=function(t,i){return n.prototype.onDblClick.call(this,t,i)},i.prototype.getType=function(){return"DTableBody"},Object.defineProperty(i.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),i.WORK_ON_CLICK=new t.Point,i}($i),yp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableCategoryCell"},n}(ml),kp=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=null!==(i=n.offset)&&void 0!==i?i:0;return r.en=e,r.transform.position.y=e,r.initCells(n,r.tb,r.$v),r}return _(n,t),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.en,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new yp(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=i.cell;if(r){r.weight=n.weight,r.width=n.width;var e=r.text||{};return r.text=e,e.value=e.value||n.label,r}return{weight:n.weight,width:n.width,text:{value:n.label}}},n.prototype.getType=function(){return"DTableCategory"},n}(Mp),xp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.dl=-1,i.rb=!1,i.p=n,i.hf=null,i.ub=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.rb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.rb&&(this.rb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.rb},n.prototype.isFiltered=function(t,n,i){return at(i)?i(t,n):i.test(t,n)},n.prototype.hasFiltered=function(t,n,i){for(var r=this.p.accessor,e=r.toChildren,u=r.hasChildren,s=0,h=n.length;s<h;++s){var o=n[s];if(this.isFiltered(o,-1,i))return!0;var a=e(o);if(u(o,a)&&this.hasFiltered(t,a,i))return!0}return!1},n.prototype.addAllToFiltered=function(t,n,i,r){for(var e=this.p.accessor,u=e.toChildren,s=e.hasChildren,h=0,o=n.length;h<o;++h){var a=n[h];i.push(r[0]),r[0]+=1;var c=u(a);s(a,c)&&t.isOpened(a)&&this.addAllToFiltered(t,c,i,r)}},n.prototype.newFilteredSub=function(t,n,i,r,e){for(var u=!1,s=this.p.accessor,h=s.toChildren,o=s.hasChildren,a=0,c=n.length;a<c;++a){var f=n[a],l=e[0];e[0]+=1;var v=this.isFiltered(f,l,i),b=h(f);if(o(f,b))if(t.isOpened(f))if(v)r.push(l),u=!0,this.addAllToFiltered(t,b,r,e);else{var d=r.length;this.newFilteredSub(t,b,i,r,e)&&(r.splice(d,0,l),u=!0)}else(v||this.hasFiltered(t,b,i))&&(r.push(l),u=!0);else v&&(r.push(l),u=!0)}return u},n.prototype.newFiltered=function(){var t=this.hf;if(null!=t){var n=[],i=this.p,r=i.nodes;return r&&this.newFilteredSub(i,r,t,n,[0]),n}return null},n.prototype.get=function(){return this.hf},n.prototype.set=function(t){this.hf!==t&&(this.hf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.dl&&(this.dl=this.R,this.rb?(this.ub=this.newFiltered(),this.emit("change",this)):null!=this.ub&&(this.ub=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.ub},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Bp=function(t){return t.parent},_p=function(t){return t.children},Pp=function(t,n){return null!=n&&0<n.length},Up=function(t){null!=t?(this.toParent=t.toParent||Bp,this.toChildren=t.toChildren||_p,this.hasChildren=t.hasChildren||Pp):(this.toParent=Bp,this.toChildren=_p,this.hasChildren=Pp)},Fp=function(t,n){return t[0]-n[0]},Gp=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).p=n,e.Nt=Ei(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:Ep.NONE,Ep),e.ob=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),n.prototype.onNodeChange=function(t){if(null!=t){var n=this.p.accessor,i=n.toChildren,r=n.hasChildren,e=this.ob,u=this.newRows(t,i,r,e,new Set);e.size!==u.size&&(this.ob=u,this.onChange())}else{var s=this.ob;0<s.size&&(s.clear(),this.onChange())}},n.prototype.newRows=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];r.has(h)&&e.add(h);var o=n(h);i(h,o)&&this.newRows(o,n,i,r,e)}return e},Object.defineProperty(n.prototype,"indices",{get:function(){var t=this.ob,n=[];return this.p.each((function(i,r){t.has(i)&&n.push(r)})),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[];return this.ob.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.Nt},enumerable:!1,configurable:!0}),n.prototype.getFirst=function(){var t=this.ob;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},n.prototype.getLast=function(){var t=this.ob;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},n.prototype.toIndex=function(t){var n=null;return this.p.each((function(i,r){return t!==i||(n=r,!1)})),n},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.getFirst();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.getLast();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.p.get(t);if(n){var i=this.ob;i.has(n)?i.delete(n):i.add(n),this.onChange()}},n.prototype.add=function(t){var n=this.p.get(t);if(n){var i=this.ob;i.has(n)||(i.add(n),this.onChange())}},n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.ob,u=e.size,s=this.p;t<i?s.each((function(t){e.add(t)}),t+(n?0:1),i+(r?1:0)):s.each((function(t){e.add(t)}),i+(r?0:1),t+(n?1:0)),u!==e.size&&this.onChange()},n.prototype.addAll=function(t){if(0<t.length){for(var n=this.ob,i=this.p,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.contains=function(t){var n=this.p.get(t);return!!n&&this.ob.has(n)},n.prototype.remove=function(t){var n=this.p.get(t);if(n){var i=this.ob;i.has(n)&&(i.delete(n),this.onChange())}},n.prototype.clear=function(){var t=this.ob;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.p.get(t);if(n){var i=this.ob;i.has(n)?1<i.size&&(i.clear(),i.add(n),this.onChange()):(i.clear(),i.add(n),this.onChange())}},n.prototype.clearAndAddAll=function(t){var n=this.ob;if(0<n.size||0<t.length){n.clear();for(var i=this.p,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.shift=function(t,n){},n.prototype.size=function(){return this.ob.size},n.prototype.isEmpty=function(){return this.ob.size<=0},n.prototype.each=function(t){var n=this.ob;this.p.each((function(i,r){return!n.has(i)||!1!==t(r)}))},n.prototype.toArray=function(){var t=this.ob,n=[];return this.p.each((function(i,r){t.has(i)&&n.push([r,i])})),n},n.prototype.toSortedArray=function(){return this.toArray().sort(Fp)},n.prototype.toObject=function(){var t=this.ob,n={};return this.p.each((function(i,r){t.has(i)&&(n[r]=i)})),n},n.prototype.toMap=function(){var t=this.ob,n=new Map;return this.p.each((function(i,r){t.has(i)&&n.set(r,i)})),n},n}(t.utils.EventEmitter),Hp=function(t){function n(){return t.call(this)||this}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return Cp.ASCENDING},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.apply=function(){},n.prototype.unapply=function(){},n.prototype.isApplied=function(){return!1},n.prototype.get=function(){return null},n.prototype.set=function(t){},n.prototype.toDirty=function(){},n.prototype.update=function(){},Object.defineProperty(n.prototype,"indices",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.map=function(t){return t},n.prototype.unmap=function(t){return t},n}(t.utils.EventEmitter),zp=function(n){function i(t){var i=n.call(this)||this;if(i.p=null,i.Fc=i.toAccessor(t),i.Vc=new jp(i),i.ob=[],i.Ob=!1,i.Db=[],i.Eb=new WeakMap,i.ti=!!(null==t?void 0:t.reverse),i.zc=i.toSelection(null==t?void 0:t.selection),i.hf=new xp(i),i.ab=new Hp,t){var r=t.filter;r&&i.hf.set(r);var e=t.on;if(e)for(var u in e){var s=e[u];s&&i.on(u,s)}}return i.nodes=null==t?void 0:t.nodes,i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:at(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new Gp(this,t)},i.prototype.toAccessor=function(t){return new Up(t)},i.prototype.bind=function(t){this.p=t},Object.defineProperty(i.prototype,"nodes",{get:function(){return this.Mb},set:function(t){this.Mb=t,this.Ob=!0,this.zc.onNodeChange(t),this.hf.toDirty(),this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rows",{get:function(){return this.Ob&&(this.Ob=!1,this.updateRows(this.Mb)),this.ob},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supplimentals",{get:function(){return this.Db},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"accessor",{get:function(){return this.Fc},enumerable:!1,configurable:!0}),i.prototype.updateRows=function(t){var n=this.ob,i=this.Db,r=this.Eb;if(null!=t){var e=this.Fc,u=this.newRows(t,0,0,n,i,r,this.ti,e.toChildren,e.hasChildren);u!==n.length&&(n.length=u,i.length=u)}else n.length=0,i.length=0},i.prototype.toSupplimental=function(t,n,i){return t<<2|(n?2:0)|(i?1:0)},i.prototype.newRows=function(t,n,i,r,e,u,s,h,o){for(var a=t.length,c=s?-1:1,f=s?a-1:0;0<=f&&f<a;f+=c){var l=t[f],v=h(l),b=u.has(l),d=this.toSupplimental(i,o(l,v),b);n<r.length?(r[n]=l,e[n]=d):(r.push(l),e.push(d)),n+=1,b&&v&&(n=this.newRows(v,n,i+1,r,e,u,s,h,o))}return n},i.prototype.update=function(t){var n=this.p;n&&n.update(t)},i.prototype.size=function(){return this.rows.length},i.prototype.get=function(t){var n=this.rows;return 0<=t&&t<n.length?n[t]:null},i.prototype.expand=function(t){var n=this.Eb;return!n.has(t)&&(n.set(t,1),this.Ob=!0,this.hf.toDirty(),this.update(!0),!0)},i.prototype.collapse=function(t){var n=this.Eb;return!!n.has(t)&&(n.delete(t),this.Ob=!0,this.hf.toDirty(),this.update(!0),!0)},i.prototype.isCollapsed=function(t){return!this.Eb.has(t)},i.prototype.isExpanded=function(t){return this.Eb.has(t)},i.prototype.toggle=function(t){return this.isExpanded(t)?this.collapse(t):this.expand(t)},i.prototype.open=function(t){return this.expand(t)},i.prototype.close=function(t){return this.collapse(t)},i.prototype.isOpened=function(t){return this.isExpanded(t)},i.prototype.each=function(t,n,i){var r=this.rows;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.zc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.hf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.Vc},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),Vp=function(){function t(t,n){var i,r,e;this.p=t,this.es=null!==(i=null==n?void 0:n.enable)&&void 0!==i&&i,this.Sb=null===(r=null==n?void 0:n.filterable)||void 0===r||r,this.Tb=null===(e=null==n?void 0:n.emittable)||void 0===e||e}return Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this.es},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFilterable",{get:function(){return this.Sb},set:function(t){this.Sb=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmittable",{get:function(){return this.Tb},set:function(t){this.Tb=t},enumerable:!1,configurable:!0}),t.prototype.newIteratee=function(t,n){var i=this.p,r=i.column,e=i.columnIndex;if(null!=r&&null!=e){var u=r.getter,s=r.setter;if(this.Tb){var h=t.data;return function(t,i){return u(t,e)!==n&&(s(t,e,n),h.emit("change",n,!n,t,i,e,h),!0)}}return function(t){return u(t,e)!==n&&(s(t,e,n),!0)}}return null},t.prototype.execute=function(t){var n,i=null===(n=this.p.header)||void 0===n?void 0:n.table;if(i){var r=this.newIteratee(i,t);if(r){var e=!1;this.Sb?i.data.mapped.each((function(t,n,i,u){r(t,u)&&(e=!0)})):i.data.each((function(t,n){r(t,n)&&(e=!0)})),e&&i.body.update(!0)}}},t}(),Wp=t.interaction.InteractionEvent,Xp=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){null!=t?(this.oh=t.header,this.Zv=t.column,this.Jv=t.columnIndex,this.jb=new Vp(this,t.check)):this.jb=new Vp(this),n.prototype.init.call(this,t),this.initOnClick(t)},Object.defineProperty(i.prototype,"column",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"columnIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"header",{get:function(){return this.oh},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"check",{get:function(){return this.jb},enumerable:!1,configurable:!0}),i.prototype.initOnClick=function(t){var n=this,i=this.Zv;if(i){var r=i.sorting.enable,e=this.jb.isEnabled;if(e||r){this.on(Yi.tap,(function(t){n.onClick(t)}));var u=this.state;u.lock(),u.set(lp.SORTABLE,r),u.set(lp.CHECKABLE,e),u.unlock()}}},Object.defineProperty(i.prototype,"sorter",{get:function(){var t=this,n=this.ab;if(null==n){var i=this.oh;if(!i)return null;var r=i.table;if(!r)return null;n=r.data.sorter,this.ab=n,this.Nb=this.Nb||function(){t.onSorterChange()},n.on("change",this.Nb)}return n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comparator",{get:function(){var t=this.Zv;return t&&t.sorting.comparator||null},enumerable:!1,configurable:!0}),i.prototype.onSorterChange=function(){var t=this.comparator;if(t){var n=this.ab;if(n){var i=lp.SORTED_ASCENDING,r=lp.SORTED_DESCENDING;n.isApplied()&&n.get()===t?n.order===Cp.ASCENDING?this.state.set(i,r):this.state.set(r,i):this.state.removeAll(i,r)}}},i.prototype.toClickPosition=function(n){var i=this.Ib||new t.Point;return this.Ib=i,n.data.getLocalPosition(this,i).x},i.prototype.isCheckClicked=function(t){if(t instanceof Wp&&this.jb.isEnabled){if(!this.isSortable)return!0;var n=this.$s[1];if(n&&null!=n.image){var i=this.toClickPosition(t),r=n.bound,e=n.margin.horizontal;return r.left-e<=i&&i<=r.right+e}}return!1},i.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},i.prototype.activate=function(t){this.onActivate(t)},i.prototype.onActivate=function(t){this.isCheckClicked(t)?(this.onToggleStart(),this.onToggleEnd()):(this.doSort(t),this.emit("active",this))},i.prototype.doSort=function(t){if(this.isSortable){var n=this.comparator;if(n){var i=this.sorter;i&&(i.get()===n?i.order===Cp.ASCENDING?(i.order=Cp.DESCENDING,i.apply()):(i.set(null),i.apply()):(i.set(n),i.order=Cp.ASCENDING,i.apply()))}}},Object.defineProperty(i.prototype,"isSortable",{get:function(){var t=this.Zv;return!!t&&t.sorting.enable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isToggle",{get:function(){return this.jb.isEnabled},enumerable:!1,configurable:!0}),i.prototype.toggle=function(){this.state.isActionable&&this.isToggle&&(this.onToggleStart(),this.onToggleEnd())},i.prototype.onToggleStart=function(){this.state.isActive=!this.state.isActive},i.prototype.onToggleEnd=function(){this.state.isActive?(this.jb.execute(!0),this.emit("active",this)):(this.jb.execute(!1),this.emit("inactive",this))},i.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.isToggle?this.onToggleStart():this.state.isPressed=!0)},i.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.isToggle?this.onToggleEnd():(this.state.isPressed&&this.activate(t),this.state.isPressed=!1))},i.prototype.onKeyDown=function(t){return Ki.isActivateKey(t)&&this.onActivateKeyDown(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyUp=function(t){return Ki.isActivateKey(t)&&this.onActivateKeyUp(t),n.prototype.onKeyUp.call(this,t)},i.prototype.getType=function(){return"DTableHeaderCell"},i.prototype.destroy=function(){var t=this.ab,i=this.Nb;t&&i&&t.off("change",i),this.ab=void 0,this.Nb=void 0,n.prototype.destroy.call(this)},i}(ml),Kp=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Cb=null!==(i=n.table)&&void 0!==i?i:null;var u=null!==(r=n.offset)&&void 0!==r?r:0;return e.en=u,e.transform.position.y=u,e.initCells(n,e.tb,e.$v),e}return _(n,t),Object.defineProperty(n.prototype,"table",{get:function(){return this.Cb},enumerable:!1,configurable:!0}),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.en,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new Xp(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=n.header||i.cell;return null!=r?(void 0===r.weight&&(r.weight=n.weight),void 0===r.width&&(r.width=n.width),void 0===r.text?r.text={value:n.label}:void 0===r.text.value&&(r.text.value=n.label),void 0===r.header&&(r.header=this),void 0===r.column&&(r.column=n),void 0===r.columnIndex&&(r.columnIndex=t),r):{weight:n.weight,width:n.width,text:{value:n.label},header:this,column:n,columnIndex:t}},n.prototype.getType=function(){return"DTableHeader"},n}(Mp),Yp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getOffsetVerticalStart=function(t){return.5*t+this.p.body.position.y},n}(yd),Jp=function(t,n){return t[n]},Zp=function(t,n,i){t[n]=i},qp=function(){return""},Qp=function(){},$p=function(t){if(null!=t){var n=t.length;if(n<=1){var i=t[0];return function(t){return Object.prototype.hasOwnProperty.call(t,i)}}return function(i){for(var r=0;r<n;++r){var e=t[r];if(!(e in i))return!1;i=i[e]}return!0}}return function(t,n){return n<t.length}},tO=function(t,n){return ct(t)?$p(n):null!=t&&t},nO=function(t,n){var i,r=t.editing,e=t.editable;return r?{enable:tO(null!==(i=r.enable)&&void 0!==i?i:e,n),formatter:r.formatter,unformatter:r.unformatter,validator:r.validator}:{enable:tO(e,n)}},iO=function(t,n){return function(i,r){var e=t(i,n),u=t(r,n);return e<u?-1:u<e?1:0}},rO=function(t,n,i){var r=i.sorting,e=i.sortable;return r?r.enable||e?{enable:!0,comparator:r.comparator||iO(t,n)}:{enable:!1}:e?{enable:!0,comparator:iO(t,n)}:{enable:!1}},eO=function(t){return null==t?void 0:t instanceof $m?t:new $m(t)},uO=function(t){return null==t?void 0:"open"in t?t:new Wd(t)},sO=function(t){return t.value},hO=function(){},oO=function(t){return t?{getter:t.getter||sO,setter:t.setter||hO,menu:eO(t.menu),multiple:eO(t.multiple),dialog:uO(t.dialog),promise:t.promise}:{getter:sO,setter:hO}},aO=function(t){var n=t.state;return null!=n?ct(n)||Lt(n)?{initial:n,modifier:void 0}:{initial:void 0,modifier:n}:{initial:void 0,modifier:void 0}},cO=function(t,n){var i=t.renderable;return ct(i)?$p(n):null==i||i},fO=function(t,n){var i,r=n.weight,e=n.width;null!=r?null!=e&&(e=void 0):null==e&&(r=1);var u=Ei(null!==(i=n.type)&&void 0!==i?i:np.TEXT,np),s=function(t,n){var i=t.align;if(null!=i)return ct(i)?Xu[i]:i;switch(n){case np.TEXT:return Xu.LEFT;case np.REAL:case np.INTEGER:return Xu.RIGHT;case np.BUTTON:case np.INDEX:case np.SELECT:case np.ACTION:case np.LINK:case np.CHECK:case np.CHECK_SINGLE:case np.COLOR:return Xu.CENTER;default:return Xu.LEFT}}(n,u),h=n.label||"",o=function(t){return null!=t.path?t.path.split("."):null}(n),a=function(t,n,i){var r=t.getter;if(r)return r;switch(n){case np.ACTION:case np.LINK:return qp;default:return null==i?Jp:function(t,n){if(t.length<=1){var i=t[0];return void 0===n?function(t){return t[i]}:function(t){return Object.prototype.hasOwnProperty.call(t,i)?t[i]:n}}return void 0===n?function(n){for(var i=0,r=t.length-1;i<r;++i)n=n[t[i]];return n[t[t.length-1]]}:function(i){for(var r=0,e=t.length-1;r<e;++r)i=i[t[r]];var u=t[t.length-1];return Object.prototype.hasOwnProperty.call(i,u)?i[u]:n}}(i,t.default)}}(n,u,o);return{weight:r,width:e,type:u,label:h,getter:a,setter:function(t,n,i){var r=t.setter;if(r)return r;switch(n){case np.BUTTON:case np.ACTION:case np.LINK:return Qp;default:return null==i?Zp:function(t){if(t.length<=1){var n=t[0];return function(t,i,r){t[n]=r}}return function(n,i,r){for(var e=0,u=t.length-1;e<u;++e)n=n[t[e]]||{};n[t[t.length-1]]=r}}(i)}}(n,u,o),formatter:n.formatter,renderable:cO(n,o),align:s,state:aO(n),editing:nO(n,o),sorting:rO(a,t,n),header:n.header,body:n.body,selecting:oO(n.selecting),category:n.category,frozen:n.frozen,offset:0,link:n.link}},lO=function(t){function n(n){var i=t.call(this,n)||this,r=i.content;r.setWidth(i.toContentWidth(n));var e=i.body;r.addChild(e),e.data.selection.type!==Ep.NONE&&i.on(Yi.tap,(function(t){e.onRowClick(t)}));var u=i.header;u&&r.addChild(u);for(var s=i.categories,h=s.length-1;0<=h;--h)r.addChild(s[h]);return e.update(),i}return _(n,t),Object.defineProperty(n.prototype,"columns",{get:function(){var t=this.tb;if(null==t){var n=this.xn;t=n?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(fO(i,t[i]));return n}(n.columns):[],this.tb=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"frozen",{get:function(){var t=this.$v;return null==t&&(t=function(t){for(var n=t.length-1;0<=n;--n)if(!0===t[n].frozen)return n+1;return 0}(this.columns),this.$v=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"categories",{get:function(){var t=this.Ab;return null==t&&(t=this.newCategories(this.xn,this.columns,this.frozen),this.Ab=t),t},enumerable:!1,configurable:!0}),n.prototype.initContent=function(n){t.prototype.initContent.call(this,n),n.state.isFocusReverse=!0},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.body.update()},n.prototype.onResize=function(n,i,r,e){var u=this.scrollbar;u.lock();var s=this.body;s.lock(),t.prototype.onResize.call(this,n,i,r,e),s.update(),s.unlock(!0),u.unlock(!0)},n.prototype.getCategoryCount=function(t){for(var n=0,i=0,r=t.length;i<r;++i){var e=t[i].category;if(null!=e){var u=ct(e)?1:e.length;n=Math.max(n,u)}}return n},n.prototype.toCategoryLabel=function(t,n){if(n)if(ct(n)){if(0===t)return n}else if(t<n.length)return n[t]},n.prototype.isSameCategory=function(t,n,i){if(null!=n){if(null!=i){if(ct(n))return ct(i)?0<t||n===i:0<t?i.length<=t:1===i.length&&n===i[0];if(ct(i))return 0<t?n.length<=t:1===n.length&&n[0]===i;if(n.length<=t&&i.length<=t)return!0;if(i.length===n.length){for(var r=t,e=n.length;r<e;++r)if(n[r]!==i[r])return!1;return!0}return!1}return ct(n)?0<t:n.length<=t}return null==i||(ct(i)?0<t:i.length<=t)},n.prototype.toCategoryColumns=function(t,n,i){for(var r=[],e=null,u=null,s=0,h=n.length;s<h;++s){var o=n[s];s!==i&&u&&e&&this.isSameCategory(t,e.category,o.category)?null!=u.weight&&null!=o.weight?u.weight+=o.weight:null!=u.width&&null!=o.width?u.width+=o.width:(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u)):(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u))}return r},n.prototype.toCategoryOptions=function(t,n,i,r,e){return n?(void 0===n.columns&&(n.columns=this.toCategoryColumns(t,i,r)),null==n.frozen&&(n.frozen=r),null==n.offset&&(n.offset=e),n):{columns:this.toCategoryColumns(t,i,r),frozen:r,offset:e}},n.prototype.newCategories=function(t,n,i){for(var r=[],e=0,u=this.getCategoryCount(n)-1;0<=u;--u){var s=new kp(this.toCategoryOptions(u,null==t?void 0:t.category,n,i,e));r.push(s),e+=s.height}return r},n.prototype.onDblClick=function(n,i){var r=this.body.onDblClick(n,i);return t.prototype.onDblClick.call(this,n,i)||r},n.prototype.newScrollBar=function(t){var n=this;return new Yp(this,t,(function(t){n.onScrollBarUpdate(t)}))},n.prototype.toContentWidth=function(t){var n=0,i=null==t?void 0:t.columns;if(i)for(var r=0,e=i.length;r<e;++r){var u=i[r].width;null!=u&&(n+=u)}return 0<n?function(t){return Math.max(t,n)}:"100%"},n.prototype.getHeaderOffset=function(){var t=this.Rb;return null==t&&(t=this.newHeaderOffset(),this.Rb=t),t},n.prototype.newHeaderOffset=function(){for(var t=0,n=this.categories,i=0,r=n.length;i<r;++i)t+=n[i].height;return t},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.oh;return void 0===t&&(t=this.newHeader(this.xn,this.columns,this.frozen,this.getHeaderOffset()),this.oh=t),t},enumerable:!1,configurable:!0}),n.prototype.hasHeader=function(t){if(t)for(var n=t.columns,i=0,r=n.length;i<r;++i)if(null!=n[i].label)return!0;return!1},n.prototype.newHeader=function(t,n,i,r){return this.hasHeader(t)?new Kp(this.toHeaderOptions(null==t?void 0:t.header,n,i,r)):null},n.prototype.toHeaderOptions=function(t,n,i,r){return t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.table&&(t.table=this),t):{columns:n,frozen:i,offset:r,table:this}},n.prototype.getBodyOffset=function(){var t=this.Lb;return null==t&&(t=this.newBodyOffset(),this.Lb=t),t},n.prototype.newBodyOffset=function(){var t,n;return this.getHeaderOffset()+(null!==(n=null===(t=this.header)||void 0===t?void 0:t.height)&&void 0!==n?n:0)},Object.defineProperty(n.prototype,"body",{get:function(){var t=this.Oe;return null==t&&(t=this.newBody(this.xn,this.columns,this.frozen,this.getBodyOffset()),this.Oe=t),t},enumerable:!1,configurable:!0}),n.prototype.newBody=function(t,n,i,r){return new Lp(this.toBodyOptions(null==t?void 0:t.body,n,i,r,null==t?void 0:t.data))},n.prototype.toBodyOptions=function(t,n,i,r,e){return null!=t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.data&&void 0!==e&&(Lt(e)?t.data={rows:e}:t.data=e),void 0===t.height&&void 0===t.weight&&(t.weight=1),t):Lt(e)?{columns:n,frozen:i,offset:r,data:{rows:e},weight:1}:{columns:n,frozen:i,offset:r,data:e,weight:1}},Object.defineProperty(n.prototype,"data",{get:function(){return this.body.data},enumerable:!1,configurable:!0}),n.prototype.getFocusedChildClippingRect=function(n,i,r,e,u,s,h,o){t.prototype.getFocusedChildClippingRect.call(this,n,i,r,e,u,s,h,o);var a=this.toCell(n);if(a){var c=i+this.toFrozenCellX(a)-o.x;if(0<c&&(o.x+=c,o.width-=c),a.parent.parent===this.body){var f=this.getBodyOffset();o.y+=f,o.height-=f}}return o},n.prototype.toFrozenCellX=function(t){var n=this.frozen;if(0<n){var i=t.parent.children,r=i.indexOf(t);if(0<=r){var e=i.length;if(n<=e-1-r){var u=i[e-n];return u.position.x+u.width}}}return 0},n.prototype.onKeyDown=function(n){Ki.moveFocusHorizontally(n,this);var i=Ki.isArrowUpKey(n),r=Ki.isArrowDownKey(n);return(i||r)&&this.onKeyDownArrowUpOrDown(n,r),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowUpOrDown=function(t,n){var i=et.getLayer(this);if(null==i)return!1;var r=i.getFocusController(),e=r.get();if(null==e)return!1;var u=this.toCell(e);if(null==u)return!1;var s=u.parent;if(null==s)return!1;var h=r.find(s,!1,!1,n,this);if(null==h)return!1;var o=this.toCell(h);if(null==o)return!1;var a=o.parent;if(null==a)return!1;var c=s.children.indexOf(u);if(c<0)return!1;var f=a.children[c];if(null==f||f===u||!("state"in f))return!1;var l=r.find(f,!0,!0,n,this);return null!=l&&(r.focus(l),!0)},n.prototype.toCell=function(t){for(var n=t;null!=n;){var i=n.parent;if(i instanceof Mp)return n instanceof $i?n:null;n=i}return null},n.prototype.getType=function(){return"DTable"},n}(kd),vO=function(t){var n=t.text;if(ct(n))return n;var i=t.label;if(ct(i))return i;var r=t.name;return ct(r)?r:void 0},bO=function(t){var n=t.title;if(ct(n))return n},dO=function(t){return t.image},gO=function(t){return t.children},mO=function(t){return t.children=[]},wO=function(t){var n,i,r,e,u;this.toLabel=null!==(n=null==t?void 0:t.toLabel)&&void 0!==n?n:vO,this.toTitle=null!==(i=null==t?void 0:t.toTitle)&&void 0!==i?i:bO,this.toImage=null!==(r=null==t?void 0:t.toImage)&&void 0!==r?r:dO,this.toChildren=null!==(e=null==t?void 0:t.toChildren)&&void 0!==e?e:gO,this.newChildren=null!==(u=null==t?void 0:t.newChildren)&&void 0!==u?u:mO},pO={NONE:0,SINGLE:1,MULTIPLE:2},OO=function(){function t(t,n){this.p=t,this.Mb=[],this.yb=[],this.ti=n,this.bn=!1}return Object.defineProperty(t.prototype,"nodes",{get:function(){return this.update(),this.Mb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"levels",{get:function(){return this.update(),this.yb},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.bn=!0},t.prototype.size=function(){return this.update(),this.Mb.length},t.prototype.each=function(t,n,i){this.update();for(var r=this.Mb,e=null!=n?Math.max(0,n):0,u=null!=i?Math.min(r.length,i):r.length,s=e;s<u&&!1!==t(r[s],s);++s);},t.prototype.update=function(){if(this.bn){this.bn=!1;var t=this.p,n=t.nodes,i=t.accessor.toChildren,r=this.Mb,e=this.yb,u=this.newNodes(t,n,0,0,r,e,this.ti,i);r.length!==u&&(r.length=u,e.length=u)}},t.prototype.newNodes=function(t,n,i,r,e,u,s,h){for(var o=n.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=n[c];i<e.length?(e[i]=f,u[i]=r):(e.push(f),u.push(r)),i+=1;var l=h(f);l&&t.isExpanded(f)&&(i=this.newNodes(t,l,i,r+1,e,u,s,h))}return i},t}(),DO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n,r.Mb=new Set;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return pO.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){var t=this.Mb;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.Mb;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.Mb;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.Mb;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.Mb;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.Mb;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.Mb;return 0<t.size&&(t.clear(),this.onChange(),!0)},n.prototype.clearAndAdd=function(t){var n=this.Mb;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.Mb,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.Mb=i,this.onChange()),n},n.prototype.contains=function(t){return this.Mb.has(t)},n.prototype.size=function(){return this.Mb.size},n.prototype.isEmpty=function(){return this.Mb.size<=0},n.prototype.each=function(t){var n=!1;this.Mb.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.Mb.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.Mb;if(0<n.size){var i=this.newNodes(t,n,new Set);n.size!==i.size&&(this.Mb=i,this.onChange())}},n.prototype.newNodes=function(t,n,i){for(var r=this.p.accessor.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];n.has(s)&&i.add(s);var h=r(s);h&&this.newNodes(h,n,i)}return i},n}(t.utils.EventEmitter),EO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n,r.Nn=null;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return pO.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.Nn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.Nn},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.Nn:null},n.prototype.add=function(t){return this.Nn!==t&&(this.Nn=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.Nn===t&&(this.Nn=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.Nn===t?this.Nn=null:this.Nn=t,this.onChange(),!0},n.prototype.clear=function(){return null!=this.Nn&&(this.Nn=null,this.onChange(),!0)},n.prototype.clearAndAdd=function(t){return this.Nn!==t&&(this.Nn=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){if(0<t.length){var n=t[t.length-1];return this.clearAndAdd(n)}return this.clear()},n.prototype.contains=function(t){return this.Nn===t},n.prototype.size=function(){return null!=this.Nn?1:0},n.prototype.isEmpty=function(){return null==this.Nn},n.prototype.each=function(t){var n=this.Nn;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.Nn;return null!=t?[t]:[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.Nn;if(null!=n){var i=this.newNode(t,n);n!==i&&(this.Nn=i,this.onChange())}},n.prototype.newNode=function(t,n){for(var i=this.p.accessor.toChildren,r=0,e=t.length;r<e;++r){var u=t[r];if(n===u)return u;var s=i(u);if(s){var h=this.newNode(s,n);if(null!=h)return h}}return null},n}(t.utils.EventEmitter),MO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return pO.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){return!1},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onNodeChange=function(t){},n}(t.utils.EventEmitter),SO=function(){function t(t,n){this.p=t,this.kb=new WeakMap,this.zc=this.toSelection(n),this.Fc=new wO(n);var i=new OO(this,!!(null==n?void 0:n.reverse));this.Vc=i;var r=null==n?void 0:n.nodes;null!=r?(this.Mb=r,i.toDirty()):this.Mb=[]}return t.prototype.toSelection=function(t){var n=null==t?void 0:t.selection;switch(null==n?void 0:n.type){case pO.NONE:case"NONE":return new MO(this,n);case pO.MULTIPLE:case"MULTIPLE":return new DO(this,n);default:return new EO(this,n)}},Object.defineProperty(t.prototype,"nodes",{get:function(){return this.Mb},set:function(t){this.Mb=t,this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.Vc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.Fc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.zc},enumerable:!1,configurable:!0}),t.prototype.update=function(t){t&&(this.Vc.toDirty(),this.zc.onNodeChange(this.Mb)),this.p.update(t)},t.prototype.toggle=function(t){var n=this.kb;return n.has(t)?n.delete(t):n.set(t,1),this.Vc.toDirty(),this.update(),!0},t.prototype.expand=function(t){var n=this.kb;return!n.has(t)&&(n.set(t,1),this.Vc.toDirty(),this.update(),!0)},t.prototype.collapse=function(t){var n=this.kb;return!!n.has(t)&&(n.delete(t),this.Vc.toDirty(),this.update(),!0)},t.prototype.expandAll=function(){var t=!1,n=this.kb;return this.each((function(i){n.has(i)||(n.set(i,1),t=!0)})),!!t&&(this.Vc.toDirty(),this.update(),!0)},t.prototype.collapseAll=function(){var t=!1,n=this.kb;return this.each((function(i){n.has(i)&&(n.delete(i),t=!0)})),!!t&&(this.Vc.toDirty(),this.update(),!0)},t.prototype.isCollapsed=function(t){return!this.isExpanded(t)},t.prototype.isExpanded=function(t){return this.kb.has(t)},t.prototype.clear=function(){var t=this.Mb;return 0<t.length&&(t.length=0,this.Vc.toDirty(),this.zc.clear(),this.update(),!0)},t.prototype.remove=function(t){var n=!1;return this.each((function(i,r,e){return i!==t||(e.splice(r,1),n=!0,!1)})),!!n&&(this.Vc.toDirty(),this.zc.remove(t),this.update(),!0)},t.prototype.add=function(t,n){var i=!1;if(n){var r=this.Fc,e=r.toChildren(n);if(e)e.push(t),i=!0;else{var u=r.newChildren(n);u&&(u.push(t),i=!0)}}else{var s=this.Mb;s?s.push(t):this.Mb=[t],i=!0}return i&&(this.Vc.toDirty(),this.update()),!0},t.prototype.addBefore=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e,0,t),i=!0,!1)})),i&&(this.Vc.toDirty(),this.update()),i},t.prototype.addAfter=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e+1,0,t),i=!0,!1)})),i&&(this.Vc.toDirty(),this.update()),i},t.prototype.each=function(t){var n=this.Mb;n&&this.Uc(n,null,t)},t.prototype.Uc=function(t,n,i){for(var r=this.Fc.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];if(!1===i(s,e,t,n))return;var h=r(s);h&&this.Uc(h,s,i)}},t}(),TO={HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED"},jO=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Vn=new Cb(r.Vn),r.Pt=n,r}return _(n,t),Object.defineProperty(n.prototype,"node",{get:function(){return this.Nn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.Nn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.$e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.Nn;void 0!==t&&this.Pt.toggle(t)},n.prototype.set=function(t,n,i){var r,e=this.Pt,u=i||this.Nn!==t;if(u){this.Nn=t,this.$e=n;var s=e.accessor;this.text=s.toLabel(t),this.title=null!==(r=s.toTitle(t))&&void 0!==r?r:"",this.image=s.toImage(t)}var h=e.mapped.levels[n];this.Vn.adjLeft(this.theme.getLevelPadding(h));var o=e.accessor.toChildren(t),a=!!(o&&0<o.length),c=this.state;c.lock(),c.set(ot.ACTIVE,e.selection.contains(t)),c.remove(ot.DISABLED),c.set(TO.HAS_CHILDREN,a),c.set(TO.OPENED,e.isExpanded(t)),c.unlock(),u&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Nn){this.Nn=void 0,this.$e=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ot.DISABLED),t.remove(ot.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onSelect=function(t,n){var i=this.Pt,r=i.selection;if(r.type!==pO.MULTIPLE)r.clearAndAdd(n);else{var e=t&&"data"in t?t.data.originalEvent:t;if(null==e?void 0:e.ctrlKey)r.toggle(n);else if(null==e?void 0:e.shiftKey){var u=i.mapped,s=r.last;if(n===s)r.clearAndAdd(n);else{var h=!1,o=!1,a=[];u.each((function(t){if(h){if(o){if(a.unshift(t),t===n)return!1}else if(a.push(t),t===s)return!1}else t===n?(h=!0,o=!1,a.push(t)):t===s&&(h=!0,o=!0,a.push(t))})),r.clearAndAddAll(a)}}else r.clearAndAdd(n)}},n.prototype.onKeyDown=function(n){var i;return Ki.isActivateKey(n)&&this.onKeyDownActivate(n),Ki.isArrowRightKey(n)&&void 0!==(i=this.Nn)&&this.state.is(TO.HAS_CHILDREN)&&this.Pt.expand(i),Ki.isArrowLeftKey(n)&&void 0!==(i=this.Nn)&&this.state.is(TO.HAS_CHILDREN)&&this.Pt.collapse(i),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){if(this.state.isActionable&&this.state.isFocused){var n=this.Nn;return void 0!==n&&this.onSelect(t,n),!0}return!1},n.prototype.getType=function(){return"DTreeItemText"},n}(ds),NO=function(t){function n(n,i){var r,e=this;return(e=t.call(this,n,i)||this).nh=Ei(null!==(r=null==i?void 0:i.when)&&void 0!==r?r:zu.CLICKED,zu),e.on(Yi.tap,(function(t){e.onClick(t)})),e}return _(n,t),n.prototype.onClick=function(t){this.nh===zu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.nh===zu.DOUBLE_CLICKED&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.activate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Ki.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Ki.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTreeItemButton"},n}(jO),IO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(i){t.prototype.onActivate.call(this,i);var r=this.Nn;void 0!==r&&(this.state.is(TO.HAS_CHILDREN)?i&&"data"in i&&(this.toLocal(i.data.global,void 0,n.WORK_CONTAINS_POINT).x<=this.padding.getLeft()?this.toggle():this.onSelect(i,r)):this.onSelect(i,r))},n.prototype.getType=function(){return"DTreeItemNonEditable"},n}(NO),CO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new IO(t)},n}(ld),AO=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.ef;return null==t&&(t=this.newUpdater(this.data,this.content,this.xn),this.ef=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new CO(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Pt;return null==t&&(t=this.toData(this.xn),this.Pt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.nodes||t.value)||[];return Lt(n)?new SO(this,{nodes:n}):"add"in n?n:new SO(this,n)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nodes",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),n.prototype.toggle=function(t){return this.data.toggle(t)},n.prototype.expand=function(t){return this.data.expand(t)},n.prototype.collapse=function(t){return this.data.collapse(t)},n.prototype.expandAll=function(){return this.data.expandAll()},n.prototype.collapseAll=function(){return this.data.collapseAll()},n.prototype.isCollapsed=function(t){return this.data.isCollapsed(t)},n.prototype.isExpanded=function(t){return this.data.isExpanded(t)},n.prototype.clear=function(){return this.data.clear()},n.prototype.remove=function(t){return this.data.remove(t)},n.prototype.add=function(t,n){return this.data.add(t,n)},n.prototype.addBefore=function(t,n){return this.data.addBefore(t,n)},n.prototype.addAfter=function(t,n){return this.data.addAfter(t,n)},n.prototype.each=function(t){return this.data.each(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!1),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DTree"},n}(kd),RO={__proto__:null,loadAll:Ov,loadMenuItemAll:pv,loadMenuItemExpandable:tv,loadMenuItem:zl,loadMenuSidedItemExpandable:wv,loadMenuSidedItem:ov,deserializeActionValue:uo,EShapeActionBases:nn,EShapeActionEnvironment:rn,EShapeActionExpressions:en,EShapeActionOpenDialogExtensions:Eh,EShapeActionOpenExtensions:Th,EShapeActionOpenOpeners:Ge,EShapeActionRuntimeBase:un,EShapeActionRuntimeBlinkBrighten:on,EShapeActionRuntimeBlinkColorFill:an,EShapeActionRuntimeBlinkColorStroke:cn,EShapeActionRuntimeBlinkDarken:fn,EShapeActionRuntimeBlinkOpacity:ln,EShapeActionRuntimeBlinkVisibility:vn,EShapeActionRuntimeBlink:hn,EShapeActionRuntimeChangeColorBrightness:Cn,EShapeActionRuntimeChangeColorCode:Rn,EShapeActionRuntimeChangeColor:Sn,EShapeActionRuntimeChangeCursor:yn,EShapeActionRuntimeChangeTextNumber:gi,EShapeActionRuntimeChangeTextText:mi,EShapeActionRuntimeConditional:sn,EShapeActionRuntimeEmitEvent:ze,EShapeActionRuntimeGestureLayer:Re,EShapeActionRuntimeGestureShape:ye,EShapeActionRuntimeMiscEmitEvent:We,EShapeActionRuntimeMiscExecute:Eu,EShapeActionRuntimeMiscHtmlElement:eu,EShapeActionRuntimeMiscInputInput:fu,EShapeActionRuntimeMiscInputInteger:vu,EShapeActionRuntimeMiscInputNumber:lu,EShapeActionRuntimeMiscInputReal:bu,EShapeActionRuntimeMiscInputText:gu,EShapeActionRuntimeMiscInput:cu,EShapeActionRuntimeMiscWriteBoth:wu,EShapeActionRuntimeMiscWriteLocal:pu,EShapeActionRuntimeMiscWriteRemote:Ou,EShapeActionRuntimeMiscWrite:mu,EShapeActionRuntimeOpenDialogBoolean:ys,EShapeActionRuntimeOpenDialogDate:ph,EShapeActionRuntimeOpenDialogDatetime:vh,EShapeActionRuntimeOpenDialogExtension:Mh,EShapeActionRuntimeOpenDialogInteger:Fs,EShapeActionRuntimeOpenDialogReal:zs,EShapeActionRuntimeOpenDialogText:Xs,EShapeActionRuntimeOpenDialogTime:gh,EShapeActionRuntimeOpenDialog:Ls,EShapeActionRuntimeOpen:Su,EShapeActionRuntimeShowHideLayer:Ah,EShapeActionRuntimeShowHideShape:Lh,EShapeActionRuntimeShowHide:Ih,EShapeActionRuntimeTransformMoveAbsoluteX:xh,EShapeActionRuntimeTransformMoveAbsoluteY:Bh,EShapeActionRuntimeTransformMoveForwardOrBackward:_h,EShapeActionRuntimeTransformMoveLeftOrRight:Ph,EShapeActionRuntimeTransformMoveRelativeX:Uh,EShapeActionRuntimeTransformMoveRelativeY:Fh,EShapeActionRuntimeTransformMove:kh,EShapeActionRuntimeTransformResizeHeightAbsolute:Kh,EShapeActionRuntimeTransformResizeHeightRelative:Yh,EShapeActionRuntimeTransformResizeSizeAbsolute:Jh,EShapeActionRuntimeTransformResizeSizeRelative:Zh,EShapeActionRuntimeTransformResizeWidthAbsolute:qh,EShapeActionRuntimeTransformResizeWidthRelative:Qh,EShapeActionRuntimeTransformResize:Xh,EShapeActionRuntimeTransformRotateAbsolute:no,EShapeActionRuntimeTransformRotateRelative:io,EShapeActionRuntimeTransformRotate:to,EShapeActionRuntimes:Dv,EShapeActionValueBase:dn,EShapeActionValueBlinkType:bn,EShapeActionValueBlink:On,EShapeActionValueChangeColorBrightness:An,EShapeActionValueChangeColorCode:Ln,EShapeActionValueChangeColorTarget:Mn,EShapeActionValueChangeColorTypeLegacy:jn,EShapeActionValueChangeColorType:Tn,EShapeActionValueChangeColorTypes:Nn,EShapeActionValueChangeColor:In,EShapeActionValueChangeCursor:kn,EShapeActionValueChangeTextType:wi,EShapeActionValueChangeText:pi,EShapeActionValueDeserializers:so,EShapeActionValueEmitEvent:Ve,EShapeActionValueGestureOperationType:Ce,EShapeActionValueGestureType:ke,EShapeActionValueGesture:Be,EShapeActionValueMiscEmitEvent:Ev,EShapeActionValueMiscExecute:Mu,EShapeActionValueMiscHtmlElement:Mv,EShapeActionValueMiscInput:Sv,EShapeActionValueMiscType:xe,EShapeActionValueMiscWrite:Tv,EShapeActionValueMisc:Du,EShapeActionValueOnInputAction:ou,EShapeActionValueOnInputActions:au,EShapeActionValueOpenDialogExtension:Sh,EShapeActionValueOpenDialogType:Oh,EShapeActionValueOpenDialog:Dh,EShapeActionValueOpenExtension:jh,EShapeActionValueOpenType:Tu,EShapeActionValueOpen:ju,EShapeActionValueOpetyped:Gh,EShapeActionValueShowHideLayer:Rh,EShapeActionValueShowHideShape:yh,EShapeActionValueShowHideType:Nh,EShapeActionValueShowHide:Ch,EShapeActionValueSubtyped:gn,EShapeActionValueTransformMoveType:Hh,EShapeActionValueTransformMove:Vh,EShapeActionValueTransformResizeType:Wh,EShapeActionValueTransformResize:$h,EShapeActionValueTransformRotateType:ro,EShapeActionValueTransformRotate:eo,EShapeActionValueTransformType:zh,EShapeActionValueType:mn,EShapeActionValues:pn,EShapeAction:ut,EShapeActions:He,loadShapeAll:gl,loadShapeBar:vo,loadShapeButton:xo,loadShapeCircle:Ko,loadShapeClipperEx:function(){nu=!0},isShapeClipperExLoaded:iu,loadShapeConnectorElbow:Ya,loadShapeConnectorLine:Ja,loadShapeEmbedded:ic,loadShapeGroupShadowed:lc,loadShapeGroup:oc,loadShapeImage:mc,loadShapeLabel:yc,loadShapeLineOfCircles:hf,loadShapeLineOfRectangleRoundeds:lf,loadShapeLineOfRectangles:mf,loadShapeLineOfTriangleRoundeds:yf,loadShapeLineOfTriangles:Uf,loadShapeLine:Bc,loadShapeNull:zf,loadShapeRectangleRounded:Yf,loadShapeRectangle:Wf,loadShapeSemicircle:hl,loadShapeTriangleRounded:dl,loadShapeTriangle:fl,BAR_VERTEX_COUNT:4,BAR_INDEX_COUNT:2,buildBarClipping:c,buildBarIndex:f,buildBarVertexStepAndColorFill:l,buildBarUv:v,CIRCLE_VERTEX_COUNT:9,CIRCLE_INDEX_COUNT:8,CIRCLE_WORLD_SIZE:Bo,buildCircleClipping:Po,buildCircleIndex:Uo,buildCircleVertex:Fo,buildCircleStep:Go,buildCircleUv:Ho,buildColor:H,IMAGE_SDF_VERTEX_COUNT:9,IMAGE_SDF_INDEX_COUNT:8,IMAGE_SDF_WORLD_SIZE:wc,buildImageSdfClipping:Oc,buildImageSdfIndex:Dc,buildImageSdfStep:Ec,buildImageSdfVertex:Mc,buildImageSdfUv:Sc,toLineOfAnyPointCount:Gc,buildLineOfAnyColor:Hc,toPointsCount:Jo,toLinePointCount:Zo,toLineVertexCount:qo,toLineIndexCount:Qo,buildLineClipping:$o,buildLineIndex:ta,buildLineUv:na,buildLineVertexStepAndColorFill:ia,buildNullClipping:_c,buildNullIndex:function(t,n,i,r){for(var e=3*i,u=3*(i+r);e<u;e+=3)t[e+0]=n,t[e+1]=n,t[e+2]=n},buildNullVertex:Pc,buildNullStep:Uc,buildNullUv:Fc,RECTANGLE_ROUNDED_VERTEX_COUNT:go,RECTANGLE_ROUNDED_INDEX_COUNT:24,RECTANGLE_ROUNDED_WORLD_SIZE:mo,buildRectangleRoundedIndex:po,buildRectangleRoundedVertex:Oo,buildRectangleRoundedClipping:Do,buildRectangleRoundedStep:Eo,buildRectangleRoundedUv:Mo,RECTANGLE_VERTEX_COUNT:Sa,RECTANGLE_INDEX_COUNT:Ta,RECTANGLE_WORLD_SIZE:ja,buildRectangleClipping:Ia,buildRectangleIndex:Ca,buildRectangleVertex:Aa,buildRectangleStep:Ra,buildRectangleUv:ya,SEMICIRCLE_VERTEX_COUNT:6,SEMICIRCLE_INDEX_COUNT:4,SEMICIRCLE_WORLD_SIZE:Jf,buildSemicircleClipping:qf,buildSemicircleIndex:Qf,buildSemicircleVertex:$f,buildSemicircleStep:tl,buildSemicircleUv:nl,TEXT_VERTEX_COUNT:4,TEXT_INDEX_COUNT:2,TEXT_FMIN:D,toTextBufferCount:M,buildTextClipping:S,buildTextIndex:T,buildTextStep:j,buildTextVertex:I,TRIANGLE_ROUNDED_VERTEX_COUNT:wf,TRIANGLE_ROUNDED_INDEX_COUNT:15,TRIANGLE_ROUNDED_WORLD_SIZE:pf,buildTriangleRoundedIndex:Df,buildTriangleRoundedVertex:Ef,buildTriangleRoundedClipping:Mf,buildTriangleRoundedStep:Sf,buildTriangleRoundedUv:Tf,TRIANGLE_VERTEX_COUNT:7,TRIANGLE_INDEX_COUNT:3,TRIANGLE_WORLD_SIZE:aa,buildTriangleClipping:fa,buildTriangleIndex:la,buildTriangleVertex:va,buildTriangleStep:ba,buildTriangleUv:da,BuilderBar:Jt,BuilderBase:z,BuilderCircle:zo,BuilderImageSdf:Tc,BuilderLabel:Cc,BuilderLineOfAny:zc,BuilderLineOfCircles:nf,BuilderLineOfRectangleRoundeds:of,BuilderLineOfRectangles:vf,BuilderLineOfTriangleRoundeds:jf,BuilderLineOfTriangles:kf,BuilderLine:oa,BuilderMarkerCircleHead:Da,BuilderMarkerCircleTail:Ea,BuilderMarkerCircle:Oa,BuilderMarkerRectangleHead:Ba,BuilderMarkerRectangleTail:xa,BuilderMarkerRectangle:ka,BuilderMarkerTriangleHead:wa,BuilderMarkerTriangleTail:pa,BuilderMarkerTriangle:ma,BuilderNull:Ma,BuilderRectanglePivoted:Za,BuilderRectangleRounded:So,BuilderRectangle:vc,BuilderSemicircle:il,BuilderText:Zt,BuilderTriangleRounded:ll,BuilderTriangle:ol,toTransformLocalId:V,toTexture:W,toTextureTransformId:X,toTextureUvs:K,copyClipping:Vc,copyIndex:Wc,copyStep:Xc,copyUvs:Kc,copyVertex:Yc,createBarUploaded:qt,createButtonUploaded:jo,createCircleUploaded:Vo,createRectanglePivotedUploaded:qa,createGroupUploaded:Qa,createImageSdfUploaded:jc,createImageSdf:jv,createImage:function(t){return co(t).then((function(t){return new dc(t)}))},createLabelUploaded:Ac,createLineOfAnyUploaded:rf,createLineOfCirclesUploaded:ef,createLineOfRectangleRoundedsUploaded:af,createLineOfRectanglesUploaded:bf,createLineOfTriangleRoundedsUploaded:Nf,createLineOfTrianglesUploaded:xf,createLineUploaded:Ga,createLine:function(t,n,i,r){for(var e=qr(t,[0,0,0,0]),u=.5*(e[2]+e[0]),s=.5*(e[3]+e[1]),h=e[2]-e[0],o=e[3]-e[1],a=[],c=0,f=t.length;c<f;c+=2)a.push(t[c]-u,t[c+1]-s);var l=new kc;return l.stroke.set(!0,void 0,void 0,i),l.transform.position.set(u,s),l.size.set(h,o),l.points.set(a,n,r),l},createNullUploaded:Ff,createRectangleRoundedUploaded:To,createRectangleUploaded:bc,createSemicircleUploaded:rl,createTriangleRoundedUploaded:vl,createTriangleUploaded:al,deserializeAll:Rr,deserializeBar:lo,deserializeBase:fo,deserializeButton:Ro,deserializeCircle:Xo,deserializeConnectorElbow:Va,deserializeConnectorLine:Xa,onDeserializedConnectorLine:Ka,deserializeEmbedded:nc,deserializeEmbeddedLayer:Pe,deserializeGradient:oo,deserializeGroupShadowed:fc,deserializeGroup:hc,deserializeImageSdf:Ic,deserializeImage:gc,deserializeLabel:Lc,deserializeLineOfCircles:sf,deserializeLineOfRectangleRoundeds:ff,deserializeLineOfRectangles:gf,deserializeLineOfTriangleRoundeds:Lf,deserializeLineOfTriangles:Pf,deserializeLine:xc,deserializeNull:Hf,deserializeRectanglePivoted:Xf,deserializeRectangleRounded:Kf,deserializeRectangle:Vf,deserializeSemicircle:sl,deserializeTriangleRounded:bl,deserializeTriangle:cl,deserialize:Ar,EShapeBarPoints:nt,EShapeBarPosition:tt,EShapeBar:Yt,EShapeBaseHitTestData:gt,EShapeBase:Dt,EShapeButtonRuntimeActionToggle:yo,EShapeButtonRuntimeAction:Lo,EShapeButtonRuntime:ko,EShapeButton:Ao,EShapeCircle:Wo,EShapeConnectorElbowPointsFiller:Ha,EShapeConnectorElbow:za,EShapeConnectorLine:ee,EShapeEmbeddedDatum:yr,EShapeEmbeddedLayerContainer:Ue,EShapeEmbeddedLayer:Ne,EShapeEmbedded:Ir,EShapeEmbeddeds:Nv,EShapeFillImpl:q,EShapeGroupFillEditor:rc,EShapeGroupFillViewer:Tr,EShapeGroupPoints:ec,EShapeGroupShadowed:cc,EShapeGroupSizeEditor:Mr,EShapeGroupSizeLayout:Er,EShapeGroupSizeShadowed:ac,EShapeGroupSizeViewer:Sr,EShapeGroupStrokeEditor:uc,EShapeGroupStrokeViewer:jr,EShapeGroupViewer:Nr,EShapeGroup:sc,EShapeImageSdf:Nc,EShapeImage:dc,EShapeLabel:Rc,EShapeLineBaseHitPart:it,EShapeLineBase:Kt,EShapeLineOfAnyPointsFillImpl:qc,EShapeLineOfAnyPointsImpl:tf,EShapeLineOfAnyPointsPointImpl:Qc,EShapeLineOfAnyPointsStrokeImpl:$c,EShapeLineOfCircles:uf,EShapeLineOfRectangleRoundeds:cf,EShapeLineOfRectangles:df,EShapeLineOfTriangleRoundeds:Rf,EShapeLineOfTriangles:_f,EShapeLinePoints:ie,EShapeLine:kc,EShapeNull:Gf,EShapePrimitive:Ft,EShapeRectanglePivoted:$e,EShapeRectangleRounded:Co,EShapeRectangle:Qe,EShapeSemicircle:ul,EShapeStrokeImpl:Et,EShapeTextAlignImpl:Bt,EShapeTextImpl:Ut,EShapeTextOffsetImpl:_t,EShapeTextOutlineImpl:Pt,EShapeTriangleRounded:Af,EShapeTriangle:Bf,hitTestBBox:mt,hitTestCircle:Gt,hitTestSemicircle:el,hitTestRectangleRounded:Io,hitTestRectangle:zt,hitTestTriangleRounded:Cf,hitTestTriangleFilled:Vt,hitTestTriangle:Wt,isStatic:Jc,toComputed:Zc,toDash:h,toGradientImageUrl:function(t){for(var n=t.direction,i=t.points,r="",e=0,u=i.length;e<u;++e){var s=i[e],h=$t.toCode(s.color),o=s.alpha,a=100*s.position;r+='<stop offset="'.concat(a,'%" stop-color="#').concat(h,'" stop-opacity="').concat(o,'" />')}var c=n*Math.PI/180,f=.5*Math.cos(c),l=-.5*Math.sin(c);return Iv('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><defs>'+'<linearGradient id="o2glkm3aeu2oio" x1="'.concat(.5-f,'" x2="').concat(.5+f,'" y1="').concat(.5-l,'" y2="').concat(.5+l,'">')+r+'</linearGradient></defs><rect x="0" y="0" width="32" height="32" stroke="none" fill="url(#o2glkm3aeu2oio)" /></svg>')},toGradientSerialized:wt,toImageElement:co,toLength:O,toResized:function(t,n,i,r,e){var u=wr.contains(t,pt.POSITION),s=wr.contains(t,pt.WIDTH),h=wr.contains(t,pt.HEIGHT);t.disallowUploadedUpdate();var o=t.transform.position;if(r){var a=Math.abs(i.x-n.x),c=Math.abs(i.y-n.y);if(e){var f=Math.max(a,c),l=Or(f+f),v=Cv(n.x),b=Cv(n.y),d=t.size;s&&h?d.set(l,l):s?d.x=l:h&&(d.y=l),u&&o.set(v,b)}else{var g=Or(a+a),m=Or(c+c);v=Cv(n.x),b=Cv(n.y),d=t.size,s&&h?d.set(g,m):s?d.x=g:h&&(d.y=m),u&&o.set(v,b)}}else if(e){a=i.x-n.x,c=i.y-n.y,f=Math.max(Math.abs(a),Math.abs(c));var w=n.x+(a<0?-f:+f),p=n.y+(c<0?-f:+f),O=.5*f;l=Or(f),v=Cv(Math.min(n.x,w)+O),b=Cv(Math.min(n.y,p)+O),d=t.size,s&&h?d.set(l,l):s?d.x=l:h&&(d.y=l),u&&o.set(v,b)}else{var D=Math.min(n.x,i.x),E=Math.min(n.y,i.y),M=.5*(a=Math.max(n.x,i.x)-D),S=.5*(c=Math.max(n.y,i.y)-E);g=Or(a),m=Or(c),v=Cv(D+M),b=Cv(E+S),d=t.size,s&&h?d.set(g,m):s?d.x=g:h&&(d.y=m),u&&o.set(v,b)}t.allowUploadedUpdate()},toScaleInvariant:o,toSizeNormalized:Or,toSizeRounded:Cv,toThresholdDefault:Xt,EShapeAcceptorImpl:kr,EShapeAcceptorType:xr,EShapeAcceptors:Br,EShapeBufferUnitBuilder:Oe,EShapeBufferUnit:pe,EShapeBuffer:De,EShapeCapabilities:wr,EShapeCapability:pt,EShapeConnectorBodies:Wa,EShapeConnectorBodyImpl:re,EShapeConnectorContainerImpl:st,EShapeConnectorEdgeAcceptorImpl:_r,EShapeConnectorEdgeContainerImpl:Ur,EShapeConnectorEdgeImpl:Pr,EShapeConnectors:ue,EShapeContainer:je,EShapeCopyPart:ht,EShapeCorner:rt,EShapeDataImpl:xt,EShapeDataMapperImpl:dr,EShapeDataMappingImpl:Rt,EShapeDataScopedImpl:yt,EShapeDataSystemImpl:kt,EShapeDataValueExtensions:Av,EShapeDataValueImpl:At,EShapeDataValueOrder:Tt,EShapeDataValueRangeImpl:St,EShapeDataValueRangeType:Mt,EShapeDataValueScope:Nt,EShapeDataValueState:It,EShapeDataValueType:jt,EShapeDefaults:J,EShapeDeleter:Lv,EShapeDeserializers:n,EShapeOnDeserializeds:i,EShapeEditor:pr,EShapeLayerState:_e,toPointsBoundary:qr,eShapePointsFormatterCurve:Zr,EShapePointsMarkerBase:Qr,EShapePointsMarkerContainerImplNoop:$,EShapePointsMarkerContainerImpl:ne,EShapePointsMarkerHead:$r,EShapePointsMarkerNoop:Q,EShapePointsMarkerTail:te,EShapePointsMarkerType:Z,EShapePointsStyle:G,EShapePointsStyles:yv,EShapeRendererIteratorDatum:Me,EShapeRendererIterator:Se,EShapeRenderer:Te,EShapeResourceManagerDeserializationMode:mr,EShapeResourceManagerDeserialization:gr,EShapeResourceManagerSerialization:kv,EShapeRuntimeImpl:qe,EShapeRuntimeReset:tn,EShapeRuntimes:bo,EShapeSearch:Rv,EShapeStateSetImplObservable:bt,EShapeState:vt,EShapeStrokeSide:Ht,EShapeStrokeStyle:s,EShapeTextAlignHorizontal:m,EShapeTextAlignVertical:w,EShapeTextDirection:p,EShapeTextWeight:d,EShapeTextStyle:g,EShapeTransformImpl:dt,EShapeTransforms:Dr,EShapeType:r,EShapeUploadedImpl:u,EShapeUploadeds:e,EShapeUuidMappingImpl:Cr,ESnapperGrid:xv,ESnapperResultScale:function(){this.distance=NaN,this.scale=new t.Point},ESnapperResult:Bv,ESnapperTargetValueType:_v,ESnapperTargetValue:Pv,ESnapperTarget:Uv,ESnapperModifierAnchor:Gv,ESnapper:Hv,DThemes:Y,FormatNodeA:xn,FormatNodea:Bn,FormatNodeD:_n,FormatNoded:Pn,FormatNodee:Fn,FormatNodef:Gn,FormatNodefsi:Hn,FormatNodeg:zn,FormatNodeH:Vn,FormatNodeh:Wn,FormatNodeM:Xn,FormatNodem:Kn,FormatNodemi:Yn,FormatNodeP:Jn,FormatNodep:Zn,FormatNodePadding:qn,FormatNodeParenthesis:Qn,FormatNodePlus:$n,FormatNodePrecision:Un,FormatNoderd:ai,FormatNodeRP:ti,FormatNoderp:ni,FormatNodesdt:ii,FormatNodeSpace:ri,FormatNodessi:ei,FormatNodeString:ui,FormatNodeY:si,FormatNodey:hi,FormatNodez:oi,FormatNodes:ci,DynamicAtlasItemEmpty:he,DynamicAtlasItemFontAtlas:ce,DynamicAtlasItemImage:we,DynamicAtlasItemText:zv,DynamicAtlasItemWhite:oe,DynamicAtlasItem:se,DynamicAtlas:ae,DynamicFontAtlasCharacterOrigin:le,DynamicFontAtlasCharacterType:be,DynamicFontAtlasCharacter:ve,DynamicFontAtlasFont:Wv,DynamicFontAtlas:Xv,DynamicFontAtlases:qv,DynamicSDFFontAtlas:ge,DynamicSDFFontAtlases:me,DynamicSDFFontGenerator:de,isArray:Lt,isFunction:at,isNaN:dh,isNumber:wn,isObject:Qv,isString:ct,Lazy:$v,NumberFormatterImpl:bi,NumberFormatters:di,toCeilingIndex:tb,toCloned:nb,toEnum:Ei,toIndexOf:Fr,toLabel:ib,toMerged:rb,toPadded:Qt,toString:function(t){return null!=t?String(t):""},toSvgTexture:function(n,i){return t.Texture.from(Iv(n),{resolution:i})},toSvgUrl:Iv,UtilAlpha:Dn,UtilSvgAtlasBuilder:eb,UtilAttachAlign:Nu,UtilAttach:Iu,UtilCharacterIterator:b,UtilClickOutside:ku,UtilClipboard:Cl,UtilGestureData:er,UtilGestureEasingHistory:hr,UtilGestureEasing:or,UtilGestureMode:rr,UtilGestureModifier:nr,UtilGestureModifiers:ir,UtilGesture:ar,UtilExtract:hb,UtilExtractor:ub,UtilFileDownloader:sb,UtilFileAs:ob,UtilFileOpener:ab,UtilFont:Vv,UtilHsv:cb,UtilHtmlElementClipperExImpl:Ke,UtilHtmlElementClipperExRectsImpl:Ye,UtilHtmlElementWhen:Je,UtilHtmlElement:Ze,UtilInputInput:su,UtilInputNumber:hu,UtilInputTextArea:fb,UtilInputText:du,UtilInput:uu,UtilKeyboardEvent:Ki,UtilName:lb,UtilOverlay:xu,UtilPointerEvent:Yi,UtilRgb:$t,UtilRgba:vb,UtilStateBlinker:bb,UtilTransition:db,UtilWheelEvent:gb,DAlignHorizontal:Xu,DAlignVertical:Ku,DAlignWith:Yu,DAnimationBase:sr,DAnimationEmpty:mb,DAnimationFadeIn:wb,DAnimationTimings:ur,DApplicationLayerOptions:Ob,DApplicationLayer:jb,DApplicationPadding:pb,DApplication:Ib,DApplications:et,DBaseAutoSet:Zi,DBaseAuto:Ji,DBaseBackgroundMeshGeometry:Ri,DBaseBackgroundMesh:Li,DBaseBackgroundSnippet:yi,DBaseBackground:Oi,DBaseBorderMeshGeometry:ki,DBaseBorderMesh:xi,DBaseBorderSnippet:Bi,DBaseBorder:Mi,DBaseCorner:Ti,DBaseInteractive:ji,DBaseMeshGeometry:Ai,DBaseOutlineSnippet:_i,DBaseOutline:Ni,DBaseOverflowMaskSimple:us,DBaseOverflowMask:tr,DBasePaddingAdjustable:Cb,DBasePadding:Ii,DBasePoint:Ci,DBaseReflowableContainer:Qi,DBaseReflowableImpl:Pi,DBaseSnippetContainer:qi,DBaseStateSetImplObservable:lt,DBaseStateSetImpl:ft,DBaseState:ot,DBase:$i,DBoard:Ab,DBorderMask:Di,DButtonAmbient:Ds,DButtonBaseWhen:zu,DButtonBase:gs,DButtonCheckRight:Lb,DButtonCheck:Rb,DButtonColorGradient:Yb,DButtonColor:Zb,DButtonDanger:qb,DButtonDate:Qb,DButtonDatetime:id,DButtonFileAs:ob,DButtonFile:rd,DButtonGroup:Ns,DButtonLink:ed,DButtonPrimary:ws,DButtonRadioRight:sd,DButtonRadio:ud,DButtonRedo:hd,DButtonSecondary:od,DButtonSelect:Yd,DButtonTime:Jd,DButtonUndo:Zd,DButton:ms,DCanvasContainer:vr,DCanvas:qd,DChartAxisBaseBar:$d,DChartAxisBaseOptionParser:ng,DChartAxisBaseTickContainer:sg,DChartAxisBaseTickMajorGridline:ig,DChartAxisBaseTickMajor:rg,DChartAxisBaseTickMinor:eg,DChartAxisBase:hg,DChartAxisContainerImpl:og,DChartAxisPosition:Qd,DChartAxisTickPosition:tg,DChartAxisXDatetime:cg,DChartAxisX:ag,DChartAxisY:fg,DChartColorSet1:function(t){return lg[t%lg.length]},DChartColorSet2:bg,DChartCoordinateBase:wg,DChartCoordinateContainerImpl:Og,DChartCoordinateContainerSubImpl:pg,DChartCoordinateDirection:dg,DChartCoordinateLinearTick:Dg,DChartCoordinateLinear:Eg,DChartCoordinateLogTick:Mg,DChartCoordinateLog:Sg,DChartCoordinateTransformImpl:gg,DChartCoordinateTransformMarkImpl:mg,DChartLegendItem:Tg,DChartLegend:jg,DChartOverview:Ng,DChartPlotAreaContainer:Ig,DChartPlotAreaImpl:Fg,DChartRegionImplObservable:Gg,DChartRegionImpl:ug,DChartSelectionContainerImpl:Hg,DChartSelectionGridlineX:Vg,DChartSelectionGridlineY:Wg,DChartSelectionMarker:Xg,DChartSelectionShapeBase:zg,DChartSelectionSimple:Jg,DChartSelectionSubImpl:Yg,DChartSelectionPoint:Kg,DChartSeriesBar:$g,DChartSeriesBaseCoordinateContainer:Zg,DChartSeriesBase:qg,DChartSeriesContainerImpl:Ug,DChartSeriesFillComputedImpl:Ag,DChartSeriesFillImpl:Lg,DChartSeriesLineOfAny:Qg,DChartSeriesLineOfCircles:tm,DChartSeriesLineOfRectangleRoundeds:nm,DChartSeriesLineOfRectangles:im,DChartSeriesLineOfTriangleRoundeds:em,DChartSeriesLineOfTriangles:rm,DChartSeriesLine:um,DChartSeriesExpressionParametersImpl:sm,DChartSeriesLinear:hm,DChartSeriesPaddingComputedImpl:yg,DChartSeriesPaddingImpl:kg,DChartSeriesPointComputedImpl:xg,DChartSeriesPointImpl:Bg,DChartSeriesScalars:Rg,DChartSeriesStrokeComputedImpl:_g,DChartSeriesStrokeImpl:Pg,DChartSeriesHitResult:Cg,DChart:om,DColorGradientObservable:xb,DColorGradientPointObservable:yb,DCommandBase:Db,DCommandClear:Eb,DCommandCreate:am,DCommandSaveAs:cm,DCommandSave:fm,DContent:Sd,DControllerCommandImpl:Mb,DControllerFocusImpl:Nb,DControllerKeyboardImpl:Sb,DControllers:Tb,DCornerMask:Si,DDiagramBaseControllerOpenType:br,DDiagramBase:vm,DDiagramCanvasBase:pm,DDiagramCanvasBaseShapeImpl:Om,DDiagramCanvasDataImpl:Dm,DDiagramCanvasEditorBackground:bm,DDiagramCanvasEditorShapeImpl:Em,DDiagramCanvasEditorSnap:Mm,DDiagramCanvasEditor:Sm,DDiagramCanvasTileMappingImpl:gm,DDiagramCanvasTileMappingPointImpl:dm,DDiagramCanvasShapeImpl:Tm,DDiagramCanvasTickerImpl:Nm,DDiagramCanvasTile:mm,DDiagramCanvas:km,DDiagramDataImpl:Um,DDiagramDataPrivateImpl:xm,DDiagramDataRemoteImpl:_m,DDiagramEditorThumbnail:Fm,DDiagramEditor:Gm,DDiagramLayerContainer:wm,DDiagramLayer:tu,DDiagramLayers:Ie,DDiagramSerializedVersion:1,DDiagramShape:Hm,DDiagramSnapshot:lm,DDiagramTicker:jm,DDiagram:zm,DDiagrams:Fe,DDialogAlign:Nu,DDialogCloseOn:Cu,DDialogColorGradient:Kb,DDialogColor:Jb,DDialogConfirmDelete:Xm,DDialogConfirmDiscard:Km,DDialogConfirmMessage:Vm,DDialogConfirm:Wm,DDialogDate:wh,DDialogDatetime:lh,DDialogFittedContent:Ks,DDialogFitted:Ys,DDialogGestureImpl:Ru,DDialogGestureMode:Au,DDialogInputBoolean:Rs,DDialogInputInteger:Us,DDialogInputReal:Hs,DDialogInputText:Ws,DDialogInput:js,DDialogLayeredContent:Hu,DDialogLayeredFooter:Os,DDialogLayeredHeaderButtonClose:Es,DDialogLayeredHeaderSeparator:Ms,DDialogLayeredHeader:Ss,DDialogLayered:Ts,DDialogMessage:Ym,DDialogMode:Lu,DDialogProcessingMessage:Jm,DDialogProcessing:Zm,DDialogSaveAs:qm,DDialogSelectListItemUpdater:bd,DDialogSelectListItem:fd,DDialogSelectList:Bd,DDialogSelectSearhDismissableImpl:Vd,DDialogSelectSearhImpl:_d,DDialogSelect:Wd,DDialogState:yu,DDialogTime:bh,DDialog:Bu,DDropdownBase:tw,DDropdown:nw,DDynamicTextGeometry:fs,DDynamicTextMeasureResultCharacter:ss,DDynamicTextMeasureResult:hs,DDynamicTextMeasure:cs,DDynamicTextStyleWordWrap:os,DDynamicTextStyle:ls,DDynamicText:vs,DExpandableHeader:iw,DExpandable:rw,DHtmlElementState:Xe,DHtmlElement:ks,DImageBaseThemeWrapperSecondary:Vu,DImageBaseThemeWrapperTertiary:Wu,DImageBase:ds,DImagePieceLayouterPartBottom:qu,DImagePieceLayouterPartCenter:Qu,DImagePieceLayouterPartContainer:rs,DImagePieceLayouterPartLeft:$u,DImagePieceLayouterPartMiddle:ts,DImagePieceLayouterPartRight:ns,DImagePieceLayouterPartTop:is,DImagePieceLayouterPart:Zu,DImagePieceLayouter:es,DImagePiece:Ju,DImage:ml,DInputAndLabel:_b,DInputBooleanButtonOff:Is,DInputBooleanButtonOn:Cs,DInputBoolean:As,DInputInput:Bs,DInputIntegerAndLabel:ew,DInputInteger:Ps,DInputLabel:Bb,DInputNumber:_s,DInputRealAndLabel:Pb,DInputReal:Gs,DInputSearch:Pd,DInputTextAndLabel:Ub,DInputTextArea:uw,DInputText:Vs,DInput:xs,DItemUpdater:ld,DLayoutClearType:Ui,DLayoutDirection:_u,DLayoutHorizontal:ps,DLayoutSpace:Pu,DLayoutVertical:Gu,DLayout:Fu,DLinkMenuItemId:Ml,DLinkMenu:Tl,DLinkTarget:jl,DLink:Rl,DLinks:Ll,DListDataImpl:Md,DListDataMappedImpl:dd,DListDataSelectionMultiple:gd,DListDataSelectionNone:md,DListDataSelectionSingle:wd,DListDataSelectionType:ad,DListItemAccessorImpl:Ed,DListItemAmbient:sw,DListItemUpdater:vd,DListItem:cd,DList:xd,DMapCoordinateEPSG3857:hw,DMapCoordinates:ow,DMapTilePlane:cw,DMapTilePyramidImpl:fw,DMapTileUrlBuilderKokudo:function(t,n,i){return 5<=t?"https://cyberjapandata.gsi.go.jp/xyz/pale/".concat(t,"/").concat(n,"/").concat(i,".png"):2<=t?"https://cyberjapandata.gsi.go.jp/xyz/std/".concat(t,"/").concat(n,"/").concat(i,".png"):"https://cyberjapandata.gsi.go.jp/xyz/earthhillshade/".concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsm:function(t,n,i){return"https://".concat("abc"[(n+i)%3],".tile.openstreetmap.org/").concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsmfj:lw,DMapTilePyramids:vw,DMapTile:aw,DMenuAlign:Nu,DMenuBarItem:bw,DMenuBar:dw,DMenuContext:Qm,DMenuItemBase:wl,DMenuItemCheckIsCompatible:El,DMenuItemCheck:Dl,DMenuItemExpandableBody:Vl,DMenuItemExpandableHeader:Wl,DMenuItemExpandableIsCompatible:Yl,DMenuItemExpandableItemCheck:Jl,DMenuItemExpandableItemLink:Zl,DMenuItemExpandableItemMenu:vv,DMenuItemExpandableItemSeparator:ql,DMenuItemExpandableItemSpace:Ql,DMenuItemExpandableItemText:$l,DMenuItemExpandable:Kl,DMenuItemExpandables:Xl,DMenuItemLinkIsCompatible:kl,DMenuItemLink:yl,DMenuItemMenuIsCompatible:Bl,DMenuItemMenuToSubMenuOptions:_l,DMenuItemMenu:xl,DMenuItemSeparatorReflowable:Pl,DMenuItemSeparatorIsCompatible:Ul,DMenuItemSeparator:Fl,DMenuItemSpaceIsCompatible:Hl,DMenuItemSpace:Gl,DMenuItemText:Ol,DMenuItem:pl,DMenuSidedContent:gw,DMenuSidedItemCheck:nv,DMenuSidedItemExpandableItemCheck:fv,DMenuSidedItemExpandableItemLink:lv,DMenuSidedItemExpandableItemMenu:bv,DMenuSidedItemExpandableItemSeparator:dv,DMenuSidedItemExpandableItemSpace:gv,DMenuSidedItemExpandableItemText:mv,DMenuSidedItemExpandable:cv,DMenuSidedItemExpandables:av,DMenuSidedItemLink:iv,DMenuSidedItemMenu:rv,DMenuSidedItemSeparator:ev,DMenuSidedItemSpace:uv,DMenuSidedItemText:sv,DMenuSidedSelectionType:mw,DMenuSidedSelection:pw,DMenuSided:Ow,DMenuSideds:hv,DMenu:$m,DMenus:Sl,DNoteError:Dw,DNoteNoItemsFound:Ew,DNoteSearching:Mw,DNoteSmallError:Gd,DNoteSmallNoItemsFound:Hd,DNoteSmallSearching:zd,DNoteSmall:Fd,DNote:Ud,DNotification:Sw,DPaginationButtonLast:Tw,DPaginationButtonNext:jw,DPaginationButtonPage:Nw,DPaginationButtonPrevious:Iw,DPaginationButtonTop:Cw,DPaginationDots:Aw,DPaginationPage:Rw,DPagination:Lw,DPaneScrollBar:yd,DPane:kd,DPickerColorAndAlpha:Fb,DPickerColorGradientRecent:Vb,DPickerColorGradientView:Wb,DPickerColorGradient:Xb,DPickerColorRecent:Gb,DPickerColor:Hb,DPickerDate:mh,DPickerDates:$b,DPickerDatetimeButtonBack:Js,DPickerDatetimeButtonDate:Zs,DPickerDatetimeButtonNext:qs,DPickerDatetimeLabelDate:th,DPickerDatetimeLabel:$s,DPickerDatetimeMask:ih,DPickerDatetimeMasks:rh,DPickerDatetimeRange:yw,DPickerDatetimeSpace:nh,DPickerDatetime:fh,DPickerDatetimes:nd,DPickerTimeBoundHours:uh,DPickerTimeBoundMinutes:sh,DPickerTimeBoundSeconds:hh,DPickerTimeBound:eh,DPickerTimeBounds:oh,DPickerTimeRange:kw,DPickerTime:ch,DPickerTimes:td,DScalarExpressionNodeType:Fi,DScalarExpression:Gi,DScalarFunctions:Xi,DScrollBarHorizontal:Cd,DScrollBarThumbHorizontal:Id,DScrollBarThumbReflowableHorizontal:Nd,DScrollBarThumbReflowableVertical:Ad,DScrollBarThumbVertical:Rd,DScrollBarThumb:jd,DScrollBarVertical:Ld,DScrollBar:Td,DSelectMultiple:xw,DSelect:Bw,DShadowImpl:_w,DSliderHorizontal:Vw,DSliderLabel:Pw,DSliderThumb:Uw,DSliderTrackHorizontal:zw,DSliderTrackVertical:Ww,DSliderTrack:Hw,DSliderValue:Fw,DSliderVertical:Xw,DSlider:Gw,DTableBodyCellActionDialog:Jw,DTableBodyCellActionMenu:Zw,DTableBodyCellActionPromise:Qw,DTableBodyCellButton:tp,DTableBodyCellCheck:ip,DTableBodyCellColor:rp,DTableBodyCellDate:ep,DTableBodyCellDatetime:up,DTableBodyCellIndex:sp,DTableBodyCellInputInteger:hp,DTableBodyCellInputReal:op,DTableBodyCellInputText:ap,DTableBodyCellInputTreeInput:cp,DTableBodyCellInputTreeMarker:fp,DTableBodyCellInputTree:vp,toLinkOptions:bp,toUrl:dp,toChecker:gp,DTableBodyCellLink:mp,DTableBodyCellSelectDialog:Yw,DTableBodyCellSelectMenu:wp,DTableBodyCellSelectMultiple:pp,DTableBodyCellSelectPromise:qw,DTableBodyCellText:$w,DTableBodyCellTime:Op,DTableBodyCellTree:Dp,DTableBodyCells:Kw,DTableBodyRow:Sp,DTableBody:Lp,DTableCategoryCell:yp,DTableCategory:kp,DTableColumnType:np,DTableDataListFilter:Tp,DTableDataListMapped:jp,DTableDataListSelection:Ip,DTableDataListSorter:Ap,DTableDataList:Rp,DTableDataSelectionType:Ep,DTableDataOrder:Cp,DTableDataTreeFilter:xp,DTableDataTreeItemAccessor:Up,DTableDataTreeSelectionImpl:Gp,DTableDataTreeSorter:Hp,DTableDataTree:zp,DTableHeaderCellCheck:Vp,DTableHeaderCell:Xp,DTableHeader:Kp,DTableRow:Mp,DTableScrollBar:Yp,DTableState:lp,DTable:lO,DTextBase:bs,DText:Qs,DTreeDataImpl:SO,DTreeDataMappedImpl:OO,DTreeDataSelectionMultiple:DO,DTreeDataSelectionNone:MO,DTreeDataSelectionSingle:EO,DTreeDataSelectionType:pO,DTreeItemButton:NO,DTreeItemNonEditable:IO,DTreeItemState:TO,DTreeItemText:jO,DTreeItemUpdater:CO,DTreeNodeAccessorImpl:wO,DTree:AO,DViewGestureImpl:cr,DViewImpl:lr,DViewTransformImpl:fr};Ov();var LO=window;LO.wcardinal=LO.wcardinal||{},LO.wcardinal.ui=RO}(PIXI);
9
+ !function(t){"use strict";var n={},i={},r={CIRCLE:0,RECTANGLE:1,RECTANGLE_ROUNDED:2,TRIANGLE:3,TRIANGLE_ROUNDED:4,LINE:5,IMAGE:6,IMAGE_SDF:7,GROUP:8,BAR:9,LABEL:10,NULL:11,GROUP_SHADOWED:12,LINE_OF_CIRCLES:13,LINE_OF_RECTANGLES:14,LINE_OF_RECTANGLE_ROUNDEDS:15,LINE_OF_TRIANGLES:16,LINE_OF_TRIANGLE_ROUNDEDS:17,EMBEDDED:18,EMBEDDED_LAYER:19,BUTTON:20,RECTANGLE_PIVOTED:21,CONNECTOR_LINE:22,CONNECTOR_ELBOW:23,SEMICIRCLE:24,EXTENSION:1e3},e={},u=function(){function t(t,n,i,r,e,u){this.buffer=t,this.i=u,this.u=n,this.h=i,this.o=r,this.l=e}return t.prototype.init=function(t){t.uploaded=this;for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].init(n);return this.update(t),this},t.prototype.update=function(t){for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].update(n,t)},t.prototype.isCompatible=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)if(!n[i].isCompatible(t))return!1;return!0},t.prototype.getBuffer=function(){return this.buffer},t.prototype.getVertexOffset=function(){return this.u},t.prototype.getVertexCount=function(){return this.o},t.prototype.getIndexOffset=function(){return this.h},t.prototype.getIndexCount=function(){return this.l},t.prototype.buildUnit=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)n[i].buildUnit(t)},t}(),s={NONE:0,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING:14,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896},h=function(t,n,i,r){return i&s.DOTTED_MASK?i&s.DOTTED?r.set(n,n):i&s.DOTTED_DENSELY?r.set(n,.5*n):r.set(n,2*n):i&s.DASHED_MASK?i&s.DASHED?r.set(2*n,n):i&s.DASHED_DENSELY?r.set(2*n,.5*n):r.set(2*n,2*n):r.set(2*t,0),r},o=function(t){var n=t&s.NON_EXPANDING_WIDTH?1:0,i=t&s.NON_SHRINKING_WIDTH?2:0;return t&(s.DOTTED_MASK||s.DASHED_MASK)?n|i|(t&s.NON_SCALING_DOT_AND_DASH?4:0):n|i},a=new t.Point,c=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5,t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5},f=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+2,t[++r]=n+1,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3},l=function(t,n,i,r,e,u,s,c,f){var l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty,w=e[0],p=e[1],O=l*w+b*p+g,D=v*w+d*p+m,E=e[2],M=e[3],S=l*E+b*M+g,j=v*E+d*M+m,T=S-O,N=j-D,I=Math.sqrt(T*T+N*N),C=I;if(0<=u&&1e-5<I){var A=u/I;S=O+(T*=A),j=D+(N*=A),C=u}var R=O-T,k=D-N,L=S+T,y=j+N,x=o(c),B=h(C,s,c,a),_=B.x,P=B.y,F=(r<<1)-1,U=(r<<2)-1,G=6*r-1;t[++F]=O,t[++F]=D,t[++F]=O,t[++F]=D,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=k,n[++G]=S,n[++G]=j,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=k,n[++G]=S,n[++G]=j,i[++U]=0,i[++U]=_,i[++U]=P,i[++U]=C,i[++U]=0,i[++U]=_,i[++U]=P,i[++U]=C,t[++F]=S,t[++F]=j,t[++F]=S,t[++F]=j,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=L,n[++G]=y,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=L,n[++G]=y,i[++U]=C,i[++U]=_,i[++U]=P,i[++U]=C,i[++U]=C,i[++U]=_,i[++U]=P,i[++U]=C},v=function(t,n,i){var r=(n<<1)-1;t[++r]=i.x0,t[++r]=i.y0,t[++r]=i.x3,t[++r]=i.y3,t[++r]=i.x1,t[++r]=i.y1,t[++r]=i.x2,t[++r]=i.y2},b=function(){function t(){this.target="",this.position=0}return t.prototype.init=function(t){this.target=t,this.position=0},t.prototype.hasNext=function(){return this.position<this.target.length},t.prototype.findNextBreak=function(t,n){for(var i=t.length,r=n;r<i;++r){var e=t.charCodeAt(r);if(!this.isLowSurrogate(e)&&!this.isVariationSelector(e))return r}return i},t.prototype.isHighSurrogate=function(t){return 55296<=t&&t<=56319},t.prototype.isLowSurrogate=function(t){return 56320<=t&&t<=57343},t.prototype.isVariationSelector=function(t){return 65024<=t&&t<=65039},t.prototype.next=function(){var t=this.target,n=this.position,i=this.findNextBreak(t,n+1),r=t.substring(n,i);return this.position=i,r},t.prototype.advance=function(t){var n=this.target,i=this.position,r=this.findNextBreak(n,i+1);return n.substring(i,r)!==t&&(this.position=r,!0)},t.prototype.close=function(){var t=this.target.length;return this.position<t&&(this.position=t,!0)},t.from=function(n){null==t.v&&(t.v=new t);var i=t.v;return i.init(n),i},t.v=null,t}(),d={NORMAL:0,BOLD:1},g={NORMAL:0,ITALIC:1},m={LEFT:0,CENTER:1,RIGHT:2,OUTSIDE_LEFT:3,OUTSIDE_RIGHT:4},w={TOP:0,MIDDLE:1,BOTTOM:2,OUTSIDE_TOP:3,OUTSIDE_BOTTOM:4},p={LEFT_TO_RIGHT:0,TOP_TO_BOTTOM:1,BOTTOM_TO_TOP:2,RIGHT_TO_LEFT:3},O=function(t,n,i,r){var e=i-t,u=r-n;return Math.sqrt(e*e+u*u)},D=1e-5,E=new t.Point,M=function(t){return 12*Math.ceil(t.text.value.length/12)},S=function(t,n,i){for(var r=3*n-1,e=3*(n+i)-1;r<e;)t[++r]=0,t[++r]=0,t[++r]=2},j=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s,t[++e]=s+1,t[++e]=s+3,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=4},T=function(t,n,i,r,e,u,h,a,c){var f=6*n-1,l=6*(n+i)-1,v=o(s.NONE);if(null!=r)for(var b=r.font.size/(e*(a+c)*.5),g=h===d.NORMAL?0:.05;f<l;)t[++f]=u,t[++f]=v,t[++f]=b,t[++f]=1,t[++f]=0,t[++f]=g;else for(;f<l;)t[++f]=0,t[++f]=v,t[++f]=0,t[++f]=1,t[++f]=0,t[++f]=0},N=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g,p,O,D,E){switch(t){case m.LEFT:switch(n){case w.TOP:E.x=o+g*(i+e)+O*(r+u),E.y=a+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i+e)+O*(r-.5*h),E.y=.5*(a+d)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i+e)+O*(r-u-h),E.y=d+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i+e)+O*(r-u-h),E.y=a+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i+e)+O*(r+u),E.y=d+p*(i+e)+D*(r+u)}break;case m.CENTER:switch(n){case w.TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r+u),E.y=.5*(a+f)+p*(i-.5*s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+l)+g*(i-.5*s)+O*(r-.5*h),E.y=.5*(a+v)+p*(i-.5*s)+D*(r-.5*h);break;case w.BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(d+v)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(a+f)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r+u),E.y=.5*(d+v)+p*(i-.5*s)+D*(r+u)}break;case m.RIGHT:switch(n){case w.TOP:E.x=c+g*(i-e-s)+O*(r+u),E.y=f+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(f+v)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i-e-s)+O*(r-u-h),E.y=v+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i-e-s)+O*(r-u-h),E.y=f+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i-e-s)+O*(r+u),E.y=v+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_LEFT:switch(n){case w.TOP:E.x=o+g*(i-e-s)+O*(r+u),E.y=a+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(a+d)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i-e-s)+O*(r-u-h),E.y=d+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i-e-s)+O*(r-u-h),E.y=a+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i-e-s)+O*(r+u),E.y=d+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_RIGHT:switch(n){case w.TOP:E.x=c+g*(i+e)+O*(r+u),E.y=f+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i+e)+O*(r-.5*h),E.y=.5*(f+v)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i+e)+O*(r-u-h),E.y=v+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i+e)+O*(r-u-h),E.y=f+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i+e)+O*(r+u),E.y=v+p*(i+e)+D*(r+u)}}},I=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,d,M,S,j,T,I,k,L,y,B,_,P){var F=.5*s,U=.5*h,G=P.a,H=P.b,z=P.c,V=P.d,W=P.tx,X=P.ty,K=e-F,Y=u-U,J=e+F,Z=u-U,q=e+F,Q=u+U,$=G*K+z*Y+W,tt=H*K+V*Y+X,nt=G*J+z*Z+W,it=H*J+V*Z+X,rt=G*q+z*Q+W,et=H*q+V*Q+X,ut=$+(rt-nt),st=tt+(et-it),ht=O($,tt,nt,it),ot=O(0,0,G,H),at=1,ct=0;if(D<ot){var ft=1/ot;at=G*ft,ct=H*ft}var lt=O($,tt,ut,st),vt=O(0,0,z,V),bt=0,dt=1;if(D<ot){var gt=1/vt;bt=z*gt,dt=V*gt}var mt=E;switch(T){case p.LEFT_TO_RIGHT:break;case p.TOP_TO_BOTTOM:mt.set(bt,dt),bt=-at,dt=-ct,at=mt.x,ct=mt.y,mt.x=vt,vt=ot,ot=mt.x;break;case p.BOTTOM_TO_TOP:mt.set(bt,dt),bt=at,dt=ct,at=-mt.x,ct=-mt.y,mt.x=vt,vt=ot,ot=mt.x;break;case p.RIGHT_TO_LEFT:at=-at,ct=-ct,bt=-bt,dt=-dt}for(var wt=0,pt=0,Ot=0,Dt=a*vt,Et=Math.max(0,a+j)*vt,Mt=0,St=1,jt=o.characters,Tt=b.from(c),Nt=0;Tt.hasNext();)"\n"!==(vn=Tt.next())?(0<Nt&&(Mt+=Math.max(0,Nt+S)),(dn=jt[vn])?(Nt=dn.advance,Ot=dn.height):Nt=0):(Mt+=Nt,Nt=0,wt=Math.max(wt,Mt),Mt=0,pt+=Et,St+=1);if(Mt+=Nt,wt=Math.max(wt,Mt),pt+=Dt,Mt=0,y&&C(l,v)){var It=0,Ct=0;switch(T){case p.LEFT_TO_RIGHT:case p.RIGHT_TO_LEFT:It=Math.max(0,ht-2*I),Ct=Math.max(0,lt-2*k);break;case p.TOP_TO_BOTTOM:case p.BOTTOM_TO_TOP:It=Math.max(0,lt-2*k),Ct=Math.max(0,ht-2*I)}var At=wt*ot*(a/o.font.size),Rt=pt,kt=Math.min(1,Math.min(It/At,Ct/Rt));a*=kt,Dt*=kt,Et*=kt,pt*=kt}var Lt=a/o.font.size,yt=ot*Lt;wt*=yt,Ot*=vt*Lt;var xt=0,Bt=0,_t=NaN;switch(T){case p.LEFT_TO_RIGHT:N(l,v,d,M,I,k,wt,pt,$,tt,nt,it,rt,et,ut,st,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=ht-2*I);break;case p.TOP_TO_BOTTOM:N(function(t){switch(t){case w.TOP:return m.LEFT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.RIGHT;case w.OUTSIDE_TOP:return m.OUTSIDE_LEFT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_RIGHT}}(v),function(t){switch(t){case m.LEFT:return w.BOTTOM;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.TOP;case m.OUTSIDE_LEFT:return w.OUTSIDE_BOTTOM;case m.OUTSIDE_RIGHT:return w.OUTSIDE_TOP}}(l),M,d,k,I,wt,pt,nt,it,rt,et,ut,st,$,tt,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=lt-2*k);break;case p.BOTTOM_TO_TOP:N(function(t){switch(t){case w.TOP:return m.RIGHT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.LEFT;case w.OUTSIDE_TOP:return m.OUTSIDE_RIGHT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_LEFT}}(v),function(t){switch(t){case m.LEFT:return w.TOP;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.BOTTOM;case m.OUTSIDE_LEFT:return w.OUTSIDE_TOP;case m.OUTSIDE_RIGHT:return w.OUTSIDE_BOTTOM}}(l),M,d,k,I,wt,pt,ut,st,$,tt,nt,it,rt,et,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=lt-2*k);break;case p.RIGHT_TO_LEFT:N(function(t){switch(t){case m.LEFT:return m.RIGHT;case m.CENTER:return m.CENTER;case m.RIGHT:return m.LEFT;case m.OUTSIDE_LEFT:return m.OUTSIDE_RIGHT;case m.OUTSIDE_RIGHT:return m.OUTSIDE_LEFT}}(l),function(t){switch(t){case w.TOP:return w.BOTTOM;case w.MIDDLE:return w.MIDDLE;case w.BOTTOM:return w.TOP;case w.OUTSIDE_TOP:return w.OUTSIDE_BOTTOM;case w.OUTSIDE_BOTTOM:return w.OUTSIDE_TOP}}(v),d,M,I,k,wt,pt,rt,et,ut,st,$,tt,nt,it,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=ht-2*I)}if(_t<wt){var Pt=.5*(wt-_t);B[0]=xt+at*Pt,B[1]=Bt+ct*Pt,B[2]=at,B[3]=ct,B[4]=bt,B[5]=dt,B[6]=_t,B[7]=pt,B[8]=ot,B[9]=vt}else B[0]=xt,B[1]=Bt,B[2]=at,B[3]=ct,B[4]=bt,B[5]=dt,B[6]=wt,B[7]=pt,B[8]=ot,B[9]=vt;var Ft=_.x0,Ut=_.x1,Gt=_.x3,Ht=_.y0,zt=_.y1,Vt=_.y3,Wt=Ut-Ft,Xt=zt-Ht,Kt=Gt-Ft,Yt=Vt-Ht,Jt=Et*bt,Zt=Et*dt,qt=yt*at,Qt=yt*ct,$t=.5*(Ot-Dt),tn=$t*bt,nn=$t*dt,rn=f===g.NORMAL?0:.25*a,en=xt-tn+rn*qt,un=Bt-nn+rn*Qt,sn=xt+tn+Dt*bt,hn=Bt+nn+Dt*dt,on=en,an=un,cn=sn,fn=hn;Mt=0,Nt=0,Tt.position=0,St=0;for(var ln=2*i;Tt.hasNext();ln+=8){var vn;if("\n"!==(vn=Tt.next())){var bn=Mt;0<Nt&&(Mt+=Math.max(0,Nt+S));var dn,gn=Mt*qt,mn=Mt*Qt;if(on=en+gn,an=un+mn,cn=sn+gn,fn=hn+mn,St+=1,dn=jt[vn]){var wn=dn.advance;if(_t<(Mt+wn)*yt){var pn=jt["..."];if(pn){if(1<St&&_t<(Mt+pn.advance)*yt){ln-=8,St-=1;var On=(Mt=bn)*qt,Dn=Mt*Qt;on=en+On,an=un+Dn,cn=sn+On,fn=hn+Dn}for(Nt=pn.advance,R(t,n,ln,pn,o,qt,Qt,on,an,cn,fn,Wt,Xt,Kt,Yt,Ft,Ht),ln+=8;;ln+=8){if(!Tt.hasNext()||!Tt.advance("\n")){ln-=8;break}A(t,n,ln,on,an,cn,fn,Ft,Ht,Gt,Vt),St+=1}}else Nt=wn,A(t,n,ln,on,an,cn,fn,Ft,Ht,Gt,Vt)}else Nt=wn,R(t,n,ln,dn,o,qt,Qt,on,an,cn,fn,Wt,Xt,Kt,Yt,Ft,Ht)}else Nt=0,A(t,n,ln,on,an,cn,fn,Ft,Ht,Gt,Vt)}else Mt+=Nt,Nt=0,A(t,n,ln,on=en+=Jt,an=un+=Zt,cn=sn+=Jt,fn=hn+=Zt,Ft,Ht,Gt,Vt),x(t,at,ct,St,ln,wt-Mt*yt,T,l,v),Mt=0,St=0}x(t,at,ct,St,ln,wt-(Mt+=Nt)*yt,T,l,v);for(var En=2*(i+r);ln<En;ln+=2)t[ln+0]=xt,t[ln+1]=Bt,n[ln+0]=Ft,n[ln+1]=Ht},C=function(t,n){switch(t){case m.LEFT:case m.CENTER:case m.RIGHT:switch(n){case w.TOP:case w.MIDDLE:case w.BOTTOM:return!0}}return!1},A=function(t,n,i,r,e,u,s,h,o,a,c){t[i+0]=r,t[i+1]=e,t[i+2]=r,t[i+3]=e,t[i+4]=u,t[i+5]=s,t[i+6]=u,t[i+7]=s,n[i+0]=h,n[i+1]=o,n[i+2]=h,n[i+3]=o,n[i+4]=a,n[i+5]=c,n[i+6]=a,n[i+7]=c},R=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=r.x-r.origin.x,w=r.width,p=m*u,O=m*s,D=(m+w)*u,E=(m+w)*s;t[i+0]=h+p,t[i+1]=o+O,t[i+2]=h+D,t[i+3]=o+E,t[i+4]=a+D,t[i+5]=c+E,t[i+6]=a+p,t[i+7]=c+O;var M=r.x/e.width,S=r.y/e.height,j=(r.x+r.width)/e.width,T=(r.y+r.height)/e.height,N=f*M,I=l*M,C=f*j,A=l*j,R=v*S,k=b*S,L=v*T,y=b*T;n[i+0]=d+N+R,n[i+1]=g+I+k,n[i+2]=d+C+R,n[i+3]=g+A+k,n[i+4]=d+C+L,n[i+5]=g+A+y,n[i+6]=d+N+L,n[i+7]=g+I+y},k=function(t,n,i,r,e){for(var u=n-8*i-1,s=0;s<i;++s)t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e},L=function(t,n,i,r,e,u){k(t,n,i,(r*=.5)*e,r*u)},y=function(t,n,i,r,e,u){k(t,n,i,r*e,r*u)},x=function(t,n,i,r,e,u,s,h,o){if(D<u)switch(s){case p.LEFT_TO_RIGHT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:break;case m.CENTER:L(t,e,r,u,n,i);break;case m.OUTSIDE_LEFT:case m.RIGHT:y(t,e,r,u,n,i)}break;case p.TOP_TO_BOTTOM:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:break;case w.MIDDLE:L(t,e,r,u,n,i);break;case w.OUTSIDE_TOP:case w.BOTTOM:y(t,e,r,u,n,i)}break;case p.BOTTOM_TO_TOP:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:y(t,e,r,u,n,i);break;case w.MIDDLE:L(t,e,r,u,n,i)}break;case p.RIGHT_TO_LEFT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:y(t,e,r,u,n,i);break;case m.CENTER:L(t,e,r,u,n,i)}}},B=function(t,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};function _(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}B(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var P,F,U,G,H,z={NONE:0,CLOSED:1,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896,CURVE:1024,FORMATTER_MASK:1024},V=function(t,n,i,r,e){for(var u=(t>>16&255)/255*n,s=(t>>8&255)/255*n,h=(t>>0&255)/255*n,o=n,a=(i<<2)-1,c=(i+r<<2)-1;a<c;)e[++a]=u,e[++a]=s,e[++a]=h,e[++a]=o},W=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=-1,this.strokeAlign=NaN,this.strokeWidth=NaN,this.strokeSide=NaN,this.strokeStyle=NaN,this.colorFill=NaN,this.alphaFill=-1,this.colorStroke=NaN,this.alphaStroke=-1,this.texture=null,this.textureTransformId=NaN}return n.prototype.isCompatible=function(t){return!0},n.prototype.updateColorFill=function(t,n){var i=n.fill,r=n.visible&&i.enable,e=i.color,u=r?i.alpha:0;e===this.colorFill&&u===this.alphaFill||(this.colorFill=e,this.alphaFill=u,t.updateColorFills(),V(e,u,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.stroke,r=n.visible&&i.enable&&0<i.width,e=i.color,u=r?i.alpha:0;e===this.colorStroke&&u===this.alphaStroke||(this.colorStroke=e,this.alphaStroke=u,t.updateColorStrokes(),V(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),X=function(t){return t.updateTransform(),t.transform.getLocalId()},K=function(n){return n.texture||t.Texture.WHITE},Y=function(t){var n=t;return null==n._uvs&&t.updateUvs(),n._updateID},J=function(t){return t._uvs},Z=function(){function t(){}return t.setDefaultThemeClass=function(t){this.DEFAULT_THEME_CLASS=t},t.getDefaultThemeClass=function(){return this.DEFAULT_THEME_CLASS},t.getInstance=function(){if(null==this.INSTANCE){var t=this.getDefaultThemeClass();if(null==t)throw new Error("No default theme class found");this.INSTANCE=new t}return this.INSTANCE},t.setInstance=function(t){var n=this.INSTANCE;return this.INSTANCE=t,n},t.get=function(t){return this.getInstance().get(t)},t.set=function(t,n){this.getInstance().set(t,n)},t.getClass=function(t){return this.getInstance().getClass(t)},t.setClass=function(t,n){this.getInstance().setClass(t,n)},t.getAtlas=function(){return this.getInstance().getAtlas()},t.DEFAULT_THEME_CLASS=null,t.INSTANCE=null,t}(),q=function(){function t(){}return Object.defineProperty(t,"THEME",{get:function(){var t=this.g;if(null!=t)return t;var n=Z.getInstance().get("EShape");return this.g=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_COLOR",{get:function(){return this.THEME.getFillColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_ALPHA",{get:function(){return this.THEME.getFillAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_COLOR",{get:function(){return this.THEME.getStrokeColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALPHA",{get:function(){return this.THEME.getStrokeAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_WIDTH",{get:function(){return this.THEME.getStrokeWidth()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALIGN",{get:function(){return this.THEME.getStrokeAlign()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_SIDE",{get:function(){return this.THEME.getStrokeSide()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_STYLE",{get:function(){return this.THEME.getStrokeStyle()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_VALUE",{get:function(){return this.THEME.getTextValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_COLOR",{get:function(){return this.THEME.getTextColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_ALPHA",{get:function(){return this.THEME.getTextAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_FAMILY",{get:function(){return this.THEME.getTextFamily()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_SIZE",{get:function(){return this.THEME.getTextSize()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"RADIUS",{get:function(){return this.THEME.getRadius()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_X",{get:function(){return this.THEME.getSizeX()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_Y",{get:function(){return this.THEME.getSizeY()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HIGHLIGHT_COLOR",{get:function(){return this.THEME.getHighlightColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"CURVE_SEGMENT_COUNT",{get:function(){return this.THEME.getCurveSegmentCount()},enumerable:!1,configurable:!0}),t}(),Q={NONE:0,CIRCLE:1,TRIANGLE:2,RECTANGLE:3},$=function(){function t(t,n,i,r){this.p=t,this.O=n,this.S=i,this.j=r}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha)},t.prototype.set=function(t,n,i){var r=!1;void 0!==t&&this.O!==t&&(this.O=t,r=!0),void 0!==n&&this.S!==n&&(this.S=n,r=!0),void 0!==i&&this.j!==i&&(this.j=i,r=!0),r&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.j)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.j}},t.prototype.serialize=function(t){var n="[".concat(this.O?1:0,",").concat(this.S,",").concat(this.j,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getFill(t);if(null!=r)this.set(!!r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setFill(t,e),this.set(!!e[0],e[1],e[2])}}},t}(),tt=function(){function n(){}return n.prototype.lock=function(){return this},n.prototype.unlock=function(){return this},Object.defineProperty(n.prototype,"type",{get:function(){return Q.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var n=this.T;return null==n&&(n=new t.Point,this.T=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transform",{get:function(){var n=this.I;return null==n&&(n=new t.Matrix,this.I=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){var t=this.C;return null==t&&(t=new $(this,!0,q.FILL_COLOR,1),this.C=t),t},enumerable:!1,configurable:!0}),n.prototype.updateUploaded=function(){},n.prototype.copy=function(t){return this},n.prototype.set=function(t,n,i){return this},n.prototype.serialize=function(t){return-1},n.prototype.deserialize=function(t,n){},n}(),nt=function(){function t(){this.A=new tt}return t.prototype.lock=function(){return this},t.prototype.unlock=function(){return this},Object.defineProperty(t.prototype,"head",{get:function(){return this.A},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.A},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t.getInstance=function(){var n=this.INSTANCE;return null==n&&(n=new t,this.INSTANCE=n),n},t}(),it={TOP:0,LEFT:1,RIGHT:2,BOTTOM:3},rt=function(){function n(t){this.p=t,this.R=0,this.k=[0,0,0,0],this.L=[],this.B=z.NONE,this.T=-1,this._=it.TOP,this.P=NaN,this.F=NaN,this.U=NaN,this.G=NaN}return n.prototype.getComputedSize=function(t,n,i,r){if(0<=t)return t;switch(n){case it.TOP:case it.BOTTOM:return Math.abs(r);case it.RIGHT:case it.LEFT:return Math.abs(i)}return 0},n.prototype.update=function(){var t=this.p.size,n=t.x,i=t.y,r=this._,e=this.T;if(this.P!==e||this.F!==n||this.U!==i||this.G!==r){this.R+=1,this.P=e,this.F=n,this.U=i,this.G=r;var u=.5*n,s=.5*i,h=this.getComputedSize(e,r,n,i),o=this.k;switch(r){case it.TOP:o[0]=0,o[1]=-s,o[2]=0,o[3]=-s+h;break;case it.RIGHT:o[0]=u,o[1]=0,o[2]=u-h,o[3]=0;break;case it.BOTTOM:o[0]=0,o[1]=s,o[2]=0,o[3]=s-h;break;case it.LEFT:o[0]=-u,o[1]=0,o[2]=-u+h,o[3]=0}}},Object.defineProperty(n.prototype,"length",{get:function(){return 2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.update(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.update(),this.k},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.T},set:function(t){this.moveTo(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"position",{get:function(){return this._},set:function(t){this.moveTo(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.moveTo(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=nt.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return t instanceof n?this.moveTo(t.position,t.size,t.style):this.moveTo(void 0,void 0,t.style)},n.prototype.set=function(t,n,i){var r,e;if(null!=t){var u=t[0];if(0===u){var s=t[1];r=s<=0?it.TOP:it.BOTTOM,e=Math.abs(t[3]-s)}else r=u<=0?it.LEFT:it.RIGHT,e=Math.abs(t[2]-u)}return this.moveTo(r,e,i)},n.prototype.moveTo=function(t,n,i){var r=!1;return null!=i&&this.B!==i&&(this.B=i,r=!0),null!=t&&this._!==t&&(this._=t,r=!0),null!=n&&this.T!==n&&(this.T=n,r=!0),r&&this.p.updateUploaded(),this},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[".concat(this._,",").concat(this.T,",").concat(this.B,"]"))},n.prototype.deserialize=function(t,n){if(0<=t&&t<n.resources.length){var i=n.resources[t],r=JSON.parse(i);this.moveTo(r[0],r[1],r[2])}},n.prototype.calcHitPointAbs=function(t,n,i,r,e,u,s,h){if(2<=this.length){var o=this.k;if(s(t,n,o[0],o[1],o[2],o[3],0,e,h))return!0}return!1},n}(),et={NONE:0,LINE:1,MARKER_TAIL:2,MARKER_HEAD:3,TEXT:4,CHILDREN:5},ut={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},st=function(){function t(){}return t.add=function(n){t.INSTANCES.push(n)},t.first=function(){var n=t.INSTANCES;if(0<n.length)return n[0];throw new Error("No application found.")},t.last=function(){var n=t.INSTANCES;if(0<n.length)return n[n.length-1];throw new Error("No application found.")},t.get=function(n){var i=t.INSTANCES;return 0<=n&&n<i.length?i[n]:null},t.indexOf=function(n){return t.INSTANCES.indexOf(n)},t.size=function(){return t.INSTANCES.length},t.getStage=function(t){for(var n=t;n.parent;)n=n.parent;return"application"in n&&"layer"in n?n:null},t.find=function(t){var n=this.getStage(t);return n?n.layer.application:null},t.getLayerBase=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerBase():null},t.getLayerOverlay=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerOverlay():null},t.getLayer=function(t){var n=this.getStage(t);return n?n.layer:null},t.getResolution=function(t){var n,i=this.getLayer(t);return i?i.renderer.resolution:null!==(n=window.devicePixelRatio)&&void 0!==n?n:1},t.update=function(n){if(n){var i=this.getStage(n);i&&i.layer.update()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].update()},t.render=function(n){if(n){var i=this.getStage(n);i&&i.layer.render()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].render()},t.INSTANCES=[],t}(),ht=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if(n[i]===t)return i;for(i=0,r=n.length;i<r;++i)if(n[i].isEquals(t))return i;return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.serialize=function(t){for(var n=[],i=this.values,r=0,e=i.length;r<e;++r)n.push(i[r].serialize(t));return n},t}(),ot=function(){function t(t){this.p=t,this.V=new Set}return t.prototype.add=function(t){var n=this.V;return!n.has(t)&&(n.add(t),!0)},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.size=function(){return this.V.size},t.prototype.remove=function(t){return this.V.delete(t)},t.prototype.clear=function(){return 0<this.V.size&&(this.V.clear(),!0)},t.prototype.copy=function(t){var n=this.V;return n.clear(),t.each((function(t){n.add(t)})),this},t.prototype.each=function(t){return this.V.forEach(t),this},t.prototype.fit=function(t){this.V.forEach(this.toOnFitBound(t))},t.prototype.toOnFitBound=function(t){var n;return t?(null==(n=this.W)&&(n=this.newOnFitBound(!0),this.W=n),n):(null==(n=this.K)&&(n=this.newOnFitBound(!1),this.K=n),n)},t.prototype.newOnFitBound=function(t){var n=this;return function(i){n.onFit(i,t)}},t.prototype.onFit=function(t,n){t.fit(n)},t.prototype.attach=function(){var t=this.p;return this.V.forEach((function(n){n.set(t)})),this},t.prototype.detach=function(){return this.V.forEach((function(t){t.set(null)})),this},t}(),at={NONE:0,TRANSFORM:1,SIZE:2,STYLE:4,ACTION:8,POINTS:16,STATE:32,IMAGE:64,DATA:128,TAG:128,CONNECTOR:256,CAPABILITY:512,ALL:1023},ct={HOVERED:"HOVERED",ACTIVE:"ACTIVE",FOCUSED:"FOCUSED",UNFOCUSABLE:"UNFOCUSABLE",FOCUS_ROOT:"FOCUS_ROOT",FOCUS_REVERSE:"FOCUS_REVERSE",READ_ONLY:"READ_ONLY",DISABLED:"DISABLED",GESTURING:"GESTURING",PRESSED:"PRESSED",INVALID:"INVALID",SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",WARNED:"WARNED",CHANGED:"CHANGED",ALTERNATED:"ALTERNATED",NEW_WINDOW:"NEW_WINDOW"},ft=function(){function t(t){var n=this;this.J=new Map,this.Z=t,this.q=function(){return n.onTime()}}return Object.defineProperty(t.prototype,"interval",{get:function(){return this.Z},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.J,r=i.get(t);return null==r?((r=new Set).add(n),i.set(t,r),i.size<=1&&this.start()):r.add(n),this},t.prototype.remove=function(t,n){var i=this.J,r=i.get(t);return null!=r&&r.has(n)&&(r.delete(n),n.remove(t),r.size<=0&&i.delete(t),i.size<=0&&this.stop()),this},t.prototype.start=function(){return null==this.$&&this.onTime(),this},t.prototype.stop=function(){var t=this.$;return null!=t&&(clearTimeout(t),this.$=void 0),this},t.prototype.onTime=function(){var t=Date.now(),n=this.interval,i=this.newValue(t,n),r=this.newOn(t,n);this.J.forEach((function(t,n){t.forEach((function(t){t.set(n,i,r)}))})),this.$=window.setTimeout(this.q,Math.max(0,n-t%n))},t}(),lt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newValue=function(t,n){return null},n.prototype.newOn=function(t,n){return Math.round(t/n)%2==0},n}(ft),vt=function(){function t(t,n){this.p=t,this.tt=new Map,this.nt=n}return t.prototype.add=function(t,n){var i=this.tt,r=i.get(t);if(r===n)return this;if(null!=r){i.delete(t);var e=this.nt.get(r);null!=e&&e.remove(t,this.p)}i.set(t,n);var u=this.nt.get(n);return null==u&&(u=this.newDatum(n),this.nt.set(n,u)),u.add(t,this.p),this},t.prototype.remove=function(t){var n=this.tt.get(t);if(null==n)return this;this.tt.delete(t);var i=this.nt.get(n);return null==i||i.remove(t,this.p),this},t.prototype.set=function(t,n,i){return i?this.add(t,n):this.remove(t)},t.prototype.has=function(t){return this.tt.has(t)},t.prototype.clear=function(){var t=this,n=this.p,i=this.tt;return i.forEach((function(i,r){var e=t.nt.get(i);null!=e&&e.remove(r,n)})),i.clear(),this},t}(),bt=function(t){function n(n){return t.call(this,n,null!=P?P:P=new Map)||this}return _(n,t),n.prototype.newDatum=function(t){return new lt(t)},n}(vt),dt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newValue=function(t,n){return Math.round(t/n)},n.prototype.newOn=function(t,n){return!0},n}(ft),gt=function(t){function n(n){return t.call(this,n,null!=F?F:F=new Map)||this}return _(n,t),n.prototype.newDatum=function(t){return new dt(t)},n}(vt),mt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},wt=function(t){return"function"==typeof t},pt=function(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)},Ot=function(t){return"string"==typeof t||"[object String]"===Object.prototype.toString.call(t)},Dt=function(){function t(){this.it=new Map,this.p=null}return Object.defineProperty(t.prototype,"local",{get:function(){return this.it},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},set:function(t){this.p!==t&&(this.begin(),this.p=t,this.end())},enumerable:!1,configurable:!0}),t.prototype.onParentChange=function(t,n){this.p=n,this.begin(),this.p=t,this.end()},Object.defineProperty(t.prototype,"blinker",{get:function(){var t=this.rt;return null==t&&(t=this.newBlinker(),this.rt=t),t},enumerable:!1,configurable:!0}),t.prototype.newBlinker=function(){return new bt(this)},Object.defineProperty(t.prototype,"ticker",{get:function(){var t=this.et;return null==t&&(t=this.newTicker(),this.et=t),t},enumerable:!1,configurable:!0}),t.prototype.newTicker=function(){return new gt(this)},t.prototype.is=function(t,n){var i=this.it.get(t);return void 0!==i&&(void 0===n||n===i)},t.prototype.in=function(t,n){return this.is(t,n)||this.under(t,n)},t.prototype.on=function(t,n){var i=this.p;return null!=i&&i.is(t,n)},t.prototype.under=function(t,n){var i=this.p;return null!=i&&i.in(t,n)},t.prototype.lock=function(t){return this},t.prototype.unlock=function(){return this},t.prototype.begin=function(){return this},t.prototype.end=function(){return this},t.prototype.checkAdded=function(t,n){var i=this.it.get(t);return void 0===i||i!==n},t.prototype.add=function(t,n){return void 0===n&&(n=null),this.checkAdded(t,n)&&(this.begin(),this.it.set(t,n),this.end()),this},t.prototype.checkAddedsString=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i){var e=n.get(t[i]);if(void 0===e||null!==e)return!0}return!1},t.prototype.checkAddedsObject=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(e.state);if(void 0===u||u!==e.value)return!0}return!1},t.prototype.addAll=function(t){if(Ot(t))return this.addAllString(arguments);if(mt(t)){if(0<t.length){var n=t[0];return Ot(n)?this.addAllString(t):this.addAllObject(t)}return this}return this.addAllObject(arguments)},t.prototype.addAllString=function(t){if(this.checkAddedsString(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i)n.set(t[i],null);this.end()}return this},t.prototype.addAllObject=function(t){if(this.checkAddedsObject(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i){var e=t[i];n.set(e.state,e.value)}this.end()}return this},t.prototype.checkRemoved=function(t){return this.it.has(t)},t.prototype.remove=function(t){return this.checkRemoved(t)&&(this.begin(),this.it.delete(t),this.end()),this},t.prototype.checkRemovedsString=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i)if(n.has(t[i]))return!0;return!1},t.prototype.checkRemovedsObject=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i)if(n.has(t[i].state))return!0;return!1},t.prototype.removeAll=function(t){if(wt(t))return this.removeAllMatcher(t);if(Ot(t))return this.removeAllString(arguments);if(mt(t)){if(0<t.length){var n=t[0];return Ot(n)?this.removeAllString(t):this.removeAllObject(t)}return this}return this.removeAllObject(arguments)},t.prototype.removeAllMatcher=function(t){var n=this,i=!1,r=this.it;return r.forEach((function(e,u){t(u)&&(i||(i=!0,n.begin()),r.delete(u))})),i&&this.end(),this},t.prototype.removeAllString=function(t){if(this.checkRemovedsString(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i)n.delete(t[i]);this.end()}return this},t.prototype.removeAllObject=function(t){if(this.checkRemovedsObject(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i)n.delete(t[i].state);this.end()}return this},t.prototype.set=function(t,n,i){if(!0===n)null!=t&&this.add(t);else if(!1===n)null!=t&&this.remove(t);else{if(null!=n&&!pt(n))return this.doSet(t,null,n);if(!0===i)null!=t&&this.add(t,n);else{if(!1!==i)return this.doSet(t,n,i);null!=t&&this.remove(t)}}return this},t.prototype.doSet=function(t,n,i){return null!=t?null!=i?(this.checkAdded(t,n)||this.checkRemoved(i))&&(this.begin(),this.it.set(t,n).delete(i),this.end()):this.add(t,n):null!=i&&this.remove(i),this},t.prototype.setAll=function(t,n){if(!0===n)null!=t&&this.addAll(t);else if(!1===n)null!=t&&this.removeAll(t);else if(null!=t&&0<t.length){if(null!=n&&0<n.length){var i=t[0];return Ot(i)?this.setAllString(t,n):this.setAllObject(t,n)}this.addAll(t)}else null!=n&&this.removeAll(n);return this},t.prototype.setAllString=function(t,n){if(this.checkAddedsString(t)||this.checkRemovedsString(n)){this.begin();for(var i=this.it,r=0,e=t.length;r<e;++r)i.set(t[r],null);for(r=0,e=n.length;r<e;++r)i.delete(n[r]);this.end()}return this},t.prototype.setAllObject=function(t,n){if(this.checkAddedsObject(t)||this.checkRemovedsString(n)){this.begin();for(var i=this.it,r=0,e=t.length;r<e;++r){var u=t[r];i.set(u.state,u.value)}for(r=0,e=n.length;r<e;++r)i.delete(n[r]);this.end()}return this},t.prototype.clear=function(){var t=this.it;return 0<t.size&&(this.begin(),t.clear(),this.end()),this},t.prototype.valueOf=function(t,n){var i=this.it.get(t);if(void 0!==i)return i;var r=this.p;return null!=r?r.valueOf(t,n):n},t.prototype.each=function(t){return this.it.forEach((function(n,i){t(i,n)})),this},t.prototype.size=function(){return this.it.size},t.prototype.copy=function(n){if(n instanceof t){this.begin();var i=this.it;i.clear(),n.local.forEach((function(t,n){i.set(n,t)})),this.p=n.parent,this.end()}return this},Object.defineProperty(t.prototype,"isHovered",{get:function(){return this.is(ct.HOVERED)},set:function(t){this.set(ct.HOVERED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inHovered",{get:function(){return this.in(ct.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHovered",{get:function(){return this.on(ct.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underHovered",{get:function(){return this.under(ct.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this.is(ct.ACTIVE)},set:function(t){this.set(ct.ACTIVE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inActive",{get:function(){return this.in(ct.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onActive",{get:function(){return this.on(ct.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underActive",{get:function(){return this.under(ct.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPressed",{get:function(){return this.is(ct.PRESSED)},set:function(t){this.set(ct.PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inPressed",{get:function(){return this.in(ct.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onPressed",{get:function(){return this.on(ct.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underPressed",{get:function(){return this.under(ct.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return this.is(ct.READ_ONLY)},set:function(t){this.set(ct.READ_ONLY,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inReadOnly",{get:function(){return this.in(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onReadOnly",{get:function(){return this.on(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underReadOnly",{get:function(){return this.under(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return!this.is(ct.DISABLED)},set:function(t){this.set(ct.DISABLED,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inEnabled",{get:function(){return!this.in(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onEnabled",{get:function(){return!this.on(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underEnabled",{get:function(){return!this.under(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.is(ct.DISABLED)},set:function(t){this.set(ct.DISABLED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisabled",{get:function(){return this.in(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDisabled",{get:function(){return this.on(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underDisabled",{get:function(){return this.under(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActionable",{get:function(){return!this.in(ct.DISABLED)&&!this.in(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGesturing",{get:function(){return this.is(ct.GESTURING)},set:function(t){this.set(ct.GESTURING,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inGesturing",{get:function(){return this.in(ct.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onGesturing",{get:function(){return this.on(ct.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underGesturing",{get:function(){return this.under(ct.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocused",{get:function(){return this.is(ct.FOCUSED)},set:function(t){this.set(ct.FOCUSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocused",{get:function(){return this.in(ct.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocused",{get:function(){return this.on(ct.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocused",{get:function(){return this.under(ct.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusRoot",{get:function(){return this.is(ct.FOCUS_ROOT)},set:function(t){this.set(ct.FOCUS_ROOT,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusRoot",{get:function(){return this.in(ct.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusRoot",{get:function(){return this.on(ct.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusRoot",{get:function(){return this.under(ct.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusReverse",{get:function(){return this.is(ct.FOCUS_REVERSE)},set:function(t){this.set(ct.FOCUS_REVERSE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusReverse",{get:function(){return this.in(ct.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusReverse",{get:function(){return this.on(ct.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusReverse",{get:function(){return this.under(ct.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusable",{get:function(){return!this.is(ct.UNFOCUSABLE)},set:function(t){this.set(ct.UNFOCUSABLE,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusable",{get:function(){return!this.in(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusable",{get:function(){return!this.on(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusable",{get:function(){return!this.under(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUnfocusable",{get:function(){return this.is(ct.UNFOCUSABLE)},set:function(t){this.set(ct.UNFOCUSABLE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inUnfocusable",{get:function(){return this.in(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUnfocusable",{get:function(){return this.on(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underUnfocusable",{get:function(){return this.under(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isInvalid",{get:function(){return this.is(ct.INVALID)},set:function(t){this.set(ct.INVALID,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inInvalid",{get:function(){return this.in(ct.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onInvalid",{get:function(){return this.on(ct.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underInvalid",{get:function(){return this.on(ct.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSucceeded",{get:function(){return this.is(ct.SUCCEEDED)},set:function(t){this.set(ct.SUCCEEDED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inSucceeded",{get:function(){return this.in(ct.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSucceeded",{get:function(){return this.on(ct.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underSucceeded",{get:function(){return this.under(ct.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFailed",{get:function(){return this.is(ct.FAILED)},set:function(t){this.set(ct.FAILED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFailed",{get:function(){return this.in(ct.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFailed",{get:function(){return this.on(ct.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFailed",{get:function(){return this.under(ct.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isWarned",{get:function(){return this.is(ct.WARNED)},set:function(t){this.set(ct.WARNED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inWarned",{get:function(){return this.in(ct.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onWarned",{get:function(){return this.on(ct.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underWarned",{get:function(){return this.on(ct.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.is(ct.CHANGED)},set:function(t){this.set(ct.CHANGED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inChanged",{get:function(){return this.in(ct.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onChanged",{get:function(){return this.on(ct.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underChanged",{get:function(){return this.on(ct.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlternated",{get:function(){return this.is(ct.ALTERNATED)},set:function(t){this.set(ct.ALTERNATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inAlternated",{get:function(){return this.in(ct.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAlternated",{get:function(){return this.on(ct.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underAlternated",{get:function(){return this.on(ct.ALTERNATED)},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){var t=[];return this.it.forEach((function(n,i){t.push(i)})),{local:t}},t.prototype.toString=function(){return JSON.stringify(this.toObject())},t}(),Et=function(t){function n(n){var i=t.call(this)||this;return i.ut=n,i.st=0,i.ht=!1,i.ot=!0,i}return _(n,t),n.prototype.lock=function(t){return this.st+=1,!1===t&&(this.ot=!1),this},n.prototype.unlock=function(){return this.st-=1,this.end()},Object.defineProperty(n.prototype,"saved",{get:function(){var t=this.ct;return null==t&&(t=new Dt,this.ct=t),t},enumerable:!1,configurable:!0}),n.prototype.begin=function(){return this.ot&&!this.ht&&(this.ht=!0,this.saved.copy(this)),this},n.prototype.end=function(){return this.st<=0&&(this.ot=!0,this.ht&&(this.ht=!1,this.onChange(this,this.saved))),this},n.prototype.onChange=function(t,n){this.ut(t,n)},n}(Dt),Mt={CLICKED:"CLICKED",DBL_CLICKED:"DBL_CLICKED",DOWN:"DOWN",UP:"UP",UP_OUTSIDE:"UP_OUTSIDE",RIGHT_CLICKED:"RIGHT_CLICKED",RIGHT_DOWN:"RIGHT_DOWN",RIGHT_UP:"RIGHT_UP",RIGHT_UP_OUTSIDE:"RIGHT_UP_OUTSIDE",RIGHT_PRESSED:"RIGHT_PRESSED",ACTIVATED:"ACTIVATED",DEACTIVATED:"DEACTIVATED"},St=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onChange=function(n,i){n.isActive?i.isActive||this.it.set(Mt.ACTIVATED,null).delete(Mt.DEACTIVATED):i.isActive&&this.it.set(Mt.DEACTIVATED,null).delete(Mt.ACTIVATED),t.prototype.onChange.call(this,n,i)},Object.defineProperty(n.prototype,"isClicked",{get:function(){return this.is(Mt.CLICKED)},set:function(t){this.set(Mt.CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inClicked",{get:function(){return this.in(Mt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onClicked",{get:function(){return this.on(Mt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underClicked",{get:function(){return this.under(Mt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDblClicked",{get:function(){return this.is(Mt.DBL_CLICKED)},set:function(t){this.set(Mt.DBL_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDblClicked",{get:function(){return this.in(Mt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDblClicked",{get:function(){return this.on(Mt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDblClicked",{get:function(){return this.under(Mt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDown",{get:function(){return this.is(Mt.DOWN)},set:function(t){this.set(Mt.DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDown",{get:function(){return this.in(Mt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDown",{get:function(){return this.on(Mt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDown",{get:function(){return this.under(Mt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUp",{get:function(){return this.is(Mt.UP)},set:function(t){this.set(Mt.UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUp",{get:function(){return this.in(Mt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUp",{get:function(){return this.on(Mt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUp",{get:function(){return this.under(Mt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUpOutside",{get:function(){return this.is(Mt.UP_OUTSIDE)},set:function(t){this.set(Mt.UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUpOutside",{get:function(){return this.in(Mt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUpOutside",{get:function(){return this.on(Mt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUpOutside",{get:function(){return this.under(Mt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightClicked",{get:function(){return this.is(Mt.RIGHT_CLICKED)},set:function(t){this.set(Mt.RIGHT_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightClicked",{get:function(){return this.in(Mt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightClicked",{get:function(){return this.on(Mt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightClicked",{get:function(){return this.under(Mt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightDown",{get:function(){return this.is(Mt.RIGHT_DOWN)},set:function(t){this.set(Mt.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightDown",{get:function(){return this.in(Mt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightDown",{get:function(){return this.on(Mt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightDown",{get:function(){return this.under(Mt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUp",{get:function(){return this.is(Mt.RIGHT_UP)},set:function(t){this.set(Mt.RIGHT_UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUp",{get:function(){return this.in(Mt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUp",{get:function(){return this.on(Mt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUp",{get:function(){return this.under(Mt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUpOutside",{get:function(){return this.is(Mt.RIGHT_UP_OUTSIDE)},set:function(t){this.set(Mt.RIGHT_UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUpOutside",{get:function(){return this.in(Mt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUpOutside",{get:function(){return this.on(Mt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUpOutside",{get:function(){return this.under(Mt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightPressed",{get:function(){return this.is(Mt.RIGHT_PRESSED)},set:function(t){this.set(Mt.RIGHT_PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightPressed",{get:function(){return this.in(Mt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightPressed",{get:function(){return this.on(Mt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightPressed",{get:function(){return this.under(Mt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isActivated",{get:function(){return this.is(Mt.ACTIVATED)},set:function(t){this.set(Mt.ACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inActivated",{get:function(){return this.in(Mt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onActivated",{get:function(){return this.on(Mt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underActivated",{get:function(){return this.under(Mt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDeactivated",{get:function(){return this.is(Mt.DEACTIVATED)},set:function(t){this.set(Mt.DEACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDeactivated",{get:function(){return this.in(Mt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDeactivated",{get:function(){return this.on(Mt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDeactivated",{get:function(){return this.under(Mt.DEACTIVATED)},enumerable:!1,configurable:!0}),n}(Et),jt=function(n){function i(i){var r=n.call(this)||this;return r.internalTransform=new t.Matrix,r.p=i,r}return _(i,n),i.prototype.onChange=function(){n.prototype.onChange.call(this),this.p.onTransformChange()},i.prototype.updateSkew=function(){n.prototype.updateSkew.call(this),this.p.onTransformChange()},i.prototype.getLocalIdCurrent=function(){return this._currentLocalID},i.prototype.getLocalId=function(){return this._localID},i.prototype.getParentId=function(){return this._parentID},i.prototype.getWorldId=function(){return this._worldID},i.prototype.updateTransform=function(t){var r=this._currentLocalID,e=this._worldID;n.prototype.updateTransform.call(this,t);var u=this._currentLocalID,s=this._worldID;if(r!==u){var h=this.localTransform,o=this.internalTransform;h.copyTo(o),t instanceof i&&o.prepend(t.internalTransform)}else e!==s&&(h=this.localTransform,o=this.internalTransform,t instanceof i&&(h.copyTo(o).prepend(t.internalTransform),this._currentLocalID+=1,this._localID=this._currentLocalID))},i}(t.Transform),Tt=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0,this.strokeWidth=0,this.strokeScale=1,this.strokeAlign=0}return t.prototype.set=function(t,n,i,r,e,u,s){return this.x=t,this.y=n,this.width=i,this.height=r,this.strokeWidth=e,this.strokeScale=u,this.strokeAlign=s,this},t}(),Nt=function(t,n,i,r){return-i<=t&&t<=+i&&-r<=n&&n<=+r},It=function(t){for(var n=t.points,i="[".concat(t.direction),r=0,e=n.length,u=1;r<e;r+=1,u+=3){var s=n[r];i+=",".concat(s.color,",").concat(s.alpha,",").concat(s.position)}return i+"]"},Ct={NONE:0,ID:1,POSITION:2,WIDTH:4,HEIGHT:8,ROTATION:16,SKEW:32,ALIGN:0,REPLACING:64,GROUPING:128,UNGROUPING:256,FILL:512,STROKE:1024,STROKE_SIDE:2048,BORDER_RADIUS:4096,TEXT:8192,TEXTURE:16384,TAG:32768,DATA:32768,DATA_MAPPING:1048576,ACTION:65536,CURSOR:131072,ORDER_IN_LAYER:262144,CHILDREN:524288,COORDINATE:62,SHAPE:1728,LAYER:262144,PRIMITIVE:1042175,GROUP:1042431,EMBEDDED:1417471,CONNECTOR:1041985,ALL:2097151},At=function(){function t(){this.added=Ct.NONE,this.removed=Ct.NONE,this.locked=Ct.NONE}return t.prototype.add=function(t){return this.removed&=~t,this.added|=t,this},t.prototype.remove=function(t){return this.added&=~t,this.removed|=t,this},t.prototype.lock=function(t){return this.locked|=t,this},t.prototype.unlock=function(t){return this.locked&=~t,this},t.prototype.clear=function(){return this.added=Ct.NONE,this.removed=Ct.NONE,this.locked=Ct.NONE,this},t.prototype.set=function(t,n,i){return null!=t&&(this.added=t),null!=n&&(this.removed=n),null!=i&&(this.locked=i),this},t.prototype.copy=function(t){return this.added=t.added,this.removed=t.removed,this.locked=t.locked,this},t}(),Rt=function(n){function i(t){var i=n.call(this)||this;return i.id="",i.uuid=0,i.type=t,i.transform=i.newTransform(),i.ft=0,i.lt=!1,i.action=new ht,i.vt=!0,i.bt=0,i.gt=!1,i.wt=!1,i.Ot=NaN,i.Dt=NaN,i.Et=NaN,i.interactive=!1,i.parent=null,i.children=[],i.selected=!1,i.index=0,i.reference=0,i}return _(i,n),i.prototype.newTransform=function(){return new jt(this)},i.prototype.onSizeChange=function(){this.Ot=NaN,this.Dt=NaN,this.Et=NaN,this.Mt(),this.updateUploaded();var t=this.St;null!=t&&t.fit(!0);var n=this.runtime;null!=n&&n.onResize(this)},i.prototype.onTransformChange=function(){this.Mt(),this.onParentTransformChange()},i.prototype.onParentTransformChange=function(){this.updateUploaded();var t=this.St;null!=t&&t.fit(!0);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onParentTransformChange()},i.prototype.Mt=function(){if(0===this.ft){var t=this.parent;null!=t&&t.onChildTransformChange()}else this.lt=!0},i.prototype.disallowOnTransformChange=function(){this.ft+=1,1===this.ft&&(this.lt=!1)},i.prototype.allowOnTransformChange=function(t){this.ft-=1,0===this.ft&&this.lt&&(this.lt=!1,t&&this.onTransformChange())},i.prototype.onChildTransformChange=function(){},i.prototype.disallowUploadedUpdate=function(){this.bt+=1,1===this.bt&&(this.gt=!1,this.wt=!1)},i.prototype.allowUploadedUpdate=function(){this.bt-=1,0===this.bt&&(this.wt?(this.wt=!1,this.gt=!1,this.updateUploadedRecursively()):this.gt&&(this.gt=!1,this.updateUploaded()))},i.prototype.updateUploadedRecursively=function(){if(0===this.bt){this.updateUploaded();for(var t=this.children,n=0,i=t.length;n<i;++n)t[n].updateUploadedRecursively()}else this.wt=!0},i.prototype.updateUploaded=function(){if(0===this.bt){var t=this.uploaded;null!=t&&t.update(this)}else this.gt=!0},Object.defineProperty(i.prototype,"image",{get:function(){return this.jt},set:function(t){this.jt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){for(var t=this;t.parent instanceof i;)t=t.parent;return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"connector",{get:function(){var t=this.St;return null==t&&(t=new ot(this),this.St=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){if(this.vt){var t=this.parent;return!(t instanceof i)||t.visible}return!1},set:function(t){this.vt!==t&&(this.vt=t,this.updateUploadedRecursively())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"worldVisible",{get:function(){if(this.vt){var t=this.parent;return!t||t.worldVisible}return!1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){var t=this.parent;null!=t&&t.toDirty()},i.prototype.attach=function(t,n){this.detach(),this.parent=t;var i=t.children;return null!=n&&0<=n&&n<i.length?i.splice(n,0,this):i.push(this),t.onChildTransformChange(),t.toDirty(),this.onAttach(),this},i.prototype.onAttach=function(){this.uploaded=void 0;var t=this.St;t&&(t.attach(),t.fit(!0));for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onAttach()},i.prototype.detach=function(){var t=this.parent;if(t){this.parent=null;var n=t.children,i=n.indexOf(this);0<=i&&(n.splice(i,1),t.onChildTransformChange(),t.toDirty(),this.onDetach())}return this},i.prototype.onDetach=function(){this.uploaded=void 0;var t=this.St;t&&t.detach();for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onDetach()},i.prototype.updateTransform=function(){var n=this.parent;n?(n.parent&&n.updateTransform(),this.transform.updateTransform(n.transform)):this.transform.updateTransform(t.Transform.IDENTITY)},i.prototype.serializeChildren=function(t){for(var n=this.children,i=[],r=0,e=n.length;r<e;++r){var u=n[r];i.push(u.serialize(t))}return i},i.prototype.serializeImage=function(t){var n=this.jt;return null!=n?t.addResource(n.src):-1},i.prototype.serializeGradient=function(t){var n=this.gradient;return null!=n?(null==n.serialized&&(n.serialized=It(n)),t.addResource(n.serialized)):-1},i.prototype.serializeState=function(t){var n=this.state;return(this.interactive?1:0)|(n.isFocusable?0:2)|(n.isActive?4:0)},i.prototype.serialize=function(t){var n=this.transform,i=n.position,r=n.pivot,e=this.size,u=this.shortcut,s=null!=u?t.addResource(u):-1,h=this.cursor,o=null!=h?t.addResource(h):-1,a=this.title,c=null!=a?t.addResource(a):-1,f=Ct.NONE,l=Ct.NONE,v=Ct.NONE,b=this.Nt;return null!=b&&(f=b.added,l=b.removed,v=b.locked),[this.type,t.addResource(this.id),i.x,i.y,e.x,e.y,n.rotation,n.skew.x,this.fill.serialize(t),this.stroke.serialize(t),o,this.text.serialize(t),this.data.serialize(t),this.radius,this.corner,-1,-1,this.action.serialize(t),this.serializeImage(t),this.serializeGradient(t),this.serializeChildren(t),r.x,r.y,this.serializeState(t),s,c,this.uuid,f,l,v]},i.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},i.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},i.prototype.getShapeScale=function(){var t=this.root.parent;return null!=t&&null!=t.getShapeScale?t.getShapeScale():1},i.prototype.getStrokeWidthScale=function(t){return t&s.NON_EXPANDING_WIDTH?t&s.NON_SHRINKING_WIDTH?this.getShapeScale():Math.min(1,this.getShapeScale()):t&s.NON_SHRINKING_WIDTH?Math.max(1,this.getShapeScale()):1},i.prototype.getHitTestSize=function(t){var n=this.size;return t.width=.5*n.x,t.height=.5*n.y,t},i.prototype.toHitTestData=function(t,n){var r,e=this.getHitTestSize(null!==(r=i.WORK_HIT_TEST_DATA)&&void 0!==r?r:i.WORK_HIT_TEST_DATA=new Tt),u=e.width,s=e.height,h=this.transform.pivot,o=t-h.x,a=n-h.y,c=this.stroke,f=c.enable?c.width:0,l=this.getStrokeWidthScale(c.style),v=c.align,b=f*l*v;return e.set(0<=u?+o:-o,0<=s?+a:-a,Math.abs(u)+b,Math.abs(s)+b,f,l,v)},i.prototype.contains=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbs(i.x,i.y,i.width,i.height,i.strokeWidth,i.strokeScale,i.strokeAlign)?this:this.containsText(t,n)||this.containsChildren(t,n)},i.prototype.containsText=function(t,n){var i=this.text;if(null!=i.atlas){var r=i.world;if(null!=r){var e=this.transform.internalTransform,u=e.a*t+e.c*n+e.tx-r[0],s=e.b*t+e.d*n+e.ty-r[1],h=r[2]*u+r[3]*s,o=r[4]*u+r[5]*s,a=r[6],c=r[7];if(0<=h&&h<=a&&0<=o&&o<=c)return this}}return null},i.prototype.containsChildren=function(t,n){for(var i=this.children,r=i.length-1;0<=r;--r){var e=i[r];e.updateTransform();var u=e.transform.localTransform,s=u.a,h=u.b,o=u.c,a=u.d,c=u.tx,f=u.ty,l=1/(s*a-o*h),v=(a*t-o*n+f*o-c*a)*l,b=(s*n-h*t-f*s+c*h)*l,d=e.contains(v,b);if(null!=d)return d}return null},i.prototype.containsBBox=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbsBBox(i.x,i.y,i.width,i.height)},i.prototype.containsAbs=function(t,n,i,r,e,u,s){return this.containsAbsBBox(t,n,i,r)},i.prototype.containsAbsBBox=function(t,n,i,r){return Nt(t,n,i,r)},i.prototype.select=function(t){return!1},i.prototype.toGlobal=function(t,n,i){return!0!==i&&this.updateTransform(),n.copyFrom(t),this.transform.worldTransform.apply(n,n),n},i.prototype.toLocal=function(n,i,r,e){return!0!==e&&this.updateTransform(),void 0===r&&(r=new t.Point),r.copyFrom(n),this.transform.worldTransform.applyInverse(r,r),r},i.prototype.getBounds=function(n,i){!0!==n&&this.updateTransform();var r=this._bounds||new t.Rectangle;this._bounds=r;var e=this.transform.getWorldId();return e!==this.Ot&&(this.Ot=e,this.It(this.transform.worldTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsInternal=function(n,i){!0!==n&&this.updateTransform();var r=this.Ct||new t.Rectangle;this.Ct=r;var e=this.transform.getLocalIdCurrent();return e!==this.Dt&&(this.Dt=e,this.It(this.transform.internalTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsLocal=function(n,i){!0!==n&&this.updateTransform();var r=this.At||new t.Rectangle;this.At=r;var e=this.transform.getLocalIdCurrent();return e!==this.Et&&(this.Et=e,this.It(this.transform.localTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsSize=function(){return this.size},i.prototype.It=function(t,n){var i=this.transform.pivot,r=i.x,e=i.y,u=this.getBoundsSize(),s=.5*u.x,h=.5*u.y,o=t.a,a=t.b,c=t.c,f=t.d,l=-s+r,v=-h+e,b=o*l+c*v,d=a*l+f*v,g=o*(l=+s+r)+c*(v=-h+e),m=a*l+f*v,w=o*(l=-s+r)+c*(v=+h+e),p=a*l+f*v,O=o*(l=+s+r)+c*(v=+h+e),D=a*l+f*v,E=Math.min(b,g,w,O),M=Math.min(d,m,p,D),S=Math.max(b,g,w,O),j=Math.max(d,m,p,D);return n.x=E+t.tx,n.y=M+t.ty,n.width=S-E,n.height=j-M,n},i.prototype.destroy=function(){for(var t=this.children,n=t.length-1;0<=n;--n)t[n].destroy();t.length=0},i.prototype.onStateChange=function(t,n){var r=this.runtime;null!=r&&r.onStateChange(this,t,n);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}},Object.defineProperty(i.prototype,"state",{get:function(){var t=this,n=this.Rt;return null==n&&(n=new St((function(n,i){t.onStateChange(n,i)})),this.Rt=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"capability",{get:function(){var t=this.Nt;return null==t&&(t=new At,this.Nt=t),t},enumerable:!1,configurable:!0}),i.prototype.getCapability=function(){return this.Nt},i.prototype.focus=function(){return this.setFocused(!0),this},i.prototype.blur=function(){return this.setFocused(!1),this},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=st.getLayer(this);n&&n.getFocusController().set(this,t)}},i.prototype.onKeyDown=function(t){var n=this.runtime;return!!n&&n.onKeyDown(this,t)},i.prototype.onKeyUp=function(t){var n=this.runtime;return!!n&&n.onKeyUp(this,t)},i.prototype.update=function(t){var n=this.runtime;n&&n.update(this,t)},i.prototype.onRender=function(t,n){var i=this.runtime;i&&i.onRender(this,t,n)},i.prototype.updateRecursively=function(t){this.update(t);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].update(t)},i.prototype.copy=function(t,n){if(void 0===n&&(n=at.ALL),this.id=t.id,this.uuid=t.uuid,n&at.TRANSFORM){var r=this.transform,e=t.transform;r.position.copyFrom(e.position),r.rotation=e.rotation,r.skew.copyFrom(e.skew),r.pivot.copyFrom(e.pivot),r.scale.copyFrom(e.scale)}if(n&at.SIZE&&this.size.copyFrom(t.size),n&at.STYLE&&(this.fill.copy(t.fill),this.stroke.copy(t.stroke),this.text.copy(t.text),this.radius=t.radius,this.corner=t.corner),n&at.DATA&&this.data.copy(t.data),n&at.IMAGE&&(this.image=t.image),n&at.ACTION&&(this.action.clearAndAddAll(t.action.values),this.interactive=t.interactive,this.cursor=t.cursor,this.shortcut=t.shortcut),n&at.POINTS){var u=t.points;if(null!=u){var s=this.points;null!=s&&s.copy(u)}}if(n&at.STATE&&this.state.lock(!1).copy(t.state).unlock(),n&at.CONNECTOR)if(t instanceof i){var h=t.St;h?this.connector.copy(h):(o=this.St)&&o.clear()}else{var o;(o=this.St)&&o.clear()}if(n&at.CAPABILITY){var a=t.getCapability();if(null!=a)this.capability.copy(a);else{var c=this.Nt;null!=c&&c.clear()}}return this},i}(t.utils.EventEmitter),kt=function(){function t(t,n,i,r,e,u,s,h){this.p=t,this.O=n,this.S=i,this.j=r,this.kt=e,this.Lt=u,this.yt=s,this.B=h}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this.Lt},set:function(t){this.Lt!==t&&(this.Lt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return this.yt},set:function(t){this.yt!==t&&(this.yt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width,t.align,t.side,t.style)},t.prototype.set=function(t,n,i,r,e,u,s){var h=!1;void 0!==t&&this.O!==t&&(this.O=t,h=!0),void 0!==n&&this.S!==n&&(this.S=n,h=!0),void 0!==i&&this.j!==i&&(this.j=i,h=!0),void 0!==r&&this.kt!==r&&(this.kt=r,h=!0),void 0!==e&&this.Lt!==e&&(this.Lt=e,h=!0),void 0!==u&&this.yt!==u&&(this.yt=u,h=!0),void 0!==s&&this.B!==s&&(this.B=s,h=!0),h&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.j,this.kt,this.Lt,this.yt,this.B)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.j,width:this.kt,align:this.Lt,side:this.yt,style:this.B}},t.prototype.serialize=function(t){var n=this.O?1:0,i="[".concat(n,",").concat(this.S,",").concat(this.j,",").concat(this.kt,",").concat(this.Lt,",").concat(this.yt,",").concat(this.B,"]");return t.addResource(i)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getStroke(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3],r[4],r[5],r[6]);else{var e=JSON.parse(i[t]);n.setStroke(t,e),this.set(!!e[0],e[1],e[2],e[3],e[4],e[5],e[6])}}},t}(),Lt={NONE:0,FROM:1,TO:2,FROM_TO:3},yt=function(){function t(){this.xt=Lt.NONE,this.Bt=0,this.Pt=1}return Object.defineProperty(t.prototype,"type",{get:function(){return this.xt},set:function(t){if(this.xt!==t){this.xt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},set:function(t){if(this.Bt!==t){this.Bt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},set:function(t){if(this.Pt!==t){this.Pt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;if(void 0!==t&&void 0!==n)if(null!==t&&null!==n){var r=this.xt|Lt.FROM|Lt.TO;this.xt===r&&this.Bt===t&&this.Pt===n||(this.xt=r,this.Bt=t,this.Pt=n,i=!0)}else null!==t?(r=(this.xt|Lt.FROM)&~Lt.TO,this.xt===r&&this.Bt===t||(this.xt=r,this.Bt=t,i=!0)):null!==n?(r=(this.xt|Lt.TO)&~Lt.FROM,this.xt===r&&this.Bt===t||(this.xt=r,this.Pt=n,i=!0)):(r=this.xt&~(Lt.TO|Lt.FROM),this.xt!==r&&(this.xt=r,i=!0));else void 0!==t?null!==t?(r=this.xt|Lt.FROM,this.xt===r&&this.Bt===t||(this.xt=r,this.Bt=t,i=!0)):(r=this.xt&~Lt.FROM,this.xt!==r&&(this.xt=r,i=!0)):void 0!==n&&(null!==n?(r=this.xt|Lt.TO,this.xt===r&&this.Pt===n||(this.xt=r,this.Pt=n,i=!0)):(r=this.xt&~Lt.TO,this.xt!==r&&(this.xt=r,i=!0)));if(i){var e=this.parent;null!=e&&(e.isChanged=!0)}return i},t.prototype.normalize=function(t){var n=this.xt,i=this.Bt,r=this.Pt;switch(n){case Lt.FROM_TO:return(t-i)/(r-i);case Lt.FROM:return t-i;case Lt.TO:return r-t;case Lt.NONE:default:return t}},t.prototype.isEquals=function(t){return this.xt===t.type&&this.Bt===t.from&&this.Pt===t.to},t.prototype.copy=function(t){return this.Ft(t.type,t.from,t.to)},t.prototype.Ft=function(t,n,i){var r=!1;if(this.xt!==t&&(this.xt=t,r=!0),this.Bt!==n&&(this.Bt=n,r=!0),this.Pt!==i&&(this.Pt=i,r=!0),r){var e=this.parent;null!=e&&(e.isChanged=!0)}return this},t.prototype.toObject=function(){return{type:this.type,from:this.from,to:this.to}},t.prototype.serialize=function(t){var n="[".concat(this.xt,",").concat(this.Bt,",").concat(this.Pt,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getRange(t);if(null!=r)this.Ft(r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setRange(t,e),this.Ft(e[0],e[1],e[2])}}},t}(),xt={ASCENDING:0,DESCENDING:1},Bt={BOOLEAN:7,BOOLEAN_ARRAY:8,NUMBER:0,NUMBER_ARRAY:1,STRING:2,STRING_ARRAY:3,OBJECT:4,OBJECT_ARRAY:5,TICKER:6,EXTENSION:1e3},_t={PRIVATE:0,PUBLIC:1,PROTECTED:2},Pt={UNKNOWN:-1,FOUND:0,NOT_FOUND:1,BAD_REQUEST:2,SERVER_ERROR:3,SERVICE_UNAVAILABLE:4,FORBIDDEN:5,NOT_DEFINED:6},Ft=function(t,n){return t-n},Ut=function(){function t(){this.id="",this.as="",this.type=Bt.NUMBER,this.scope=_t.PUBLIC,this.initial="",this.format="",this.range=new yt,this.Ut=0,this.Gt=0,this.Rt=Pt.UNKNOWN,this.Ht=0,this.zt=xt.ASCENDING}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},set:function(t){this.p!==t&&(this.p=t,this.range.parent=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Ut},set:function(t){var n=this.formatter;null!=n&&(t=n(t));var i=this.Ht;if(i<=0){if(this.Ut!==t){this.Ut=t;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.k;null==e&&(e=[],this.k=e),this.Ut=t;var u=this.zt;u===xt.ASCENDING?e.push(t):e.unshift(t);var s=e.length-i;if(0<s)if(u===xt.ASCENDING)for(var h=0;h<s;++h)e.shift();else e.length=i;var o=this.parent;null!=o&&(o.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){return this.range.normalize(this.Ut)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.k;return null==t&&(t=[],this.k=t),t},set:function(t){var n=t.length;if(0<n){var i=this.Ht;if(i<=0){var r=t[n-1];if(null!=(s=this.formatter)&&(r=s(r)),this.Ut!==r){this.Ut=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.k;null==u&&(u=[],this.k=u);var s,h=this.zt;if(null!=(s=this.formatter))if(this.Ut=s(t[n-1]),h===xt.ASCENDING)for(var o=0;o<n;++o)u.push(s(t[o]));else for(o=0;o<n;++o)u.unshift(s(t[o]));else if(this.Ut=t[n-1],h===xt.ASCENDING)for(o=0;o<n;++o)u.push(t[o]);else for(o=0;o<n;++o)u.unshift(t[o]);var a=u.length-i;if(0<a)if(h===xt.ASCENDING)for(o=0;o<a;++o)u.shift();else u.length=i;var c=this.parent;null!=c&&(c.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.Gt},set:function(t){var n=this.Ht;if(n<=0){if(this.Gt!==t){this.Gt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Vt;null==r&&(r=[],this.Vt=r),this.Gt=t;var e=this.zt;e===xt.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===xt.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"times",{get:function(){var t=this.Vt;return null==t&&(t=[],this.Vt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.Ht;if(i<=0){var r=t[n-1];if(this.Gt!==r){this.Gt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.Vt;null==u&&(u=[],this.Vt=u),this.Gt=t[n-1];var s=this.zt;if(s===xt.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===xt.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.Rt},set:function(t){var n=this.Ht;if(n<=0){if(this.Rt!==t){this.Rt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Wt;null==r&&(r=[],this.Wt=r),this.Rt=t;var e=this.zt;e===xt.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===xt.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"states",{get:function(){var t=this.Wt;return null==t&&(t=[],this.Wt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.Ht;if(i<=0){var r=t[n-1];if(this.Rt!==r){this.Rt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.Wt;null==u&&(u=[],this.Wt=u),this.Rt=t[n-1];var s=this.zt;if(s===xt.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===xt.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){return this.Ht},set:function(t){if(this.Ht<t)this.Ht=t;else if(t<this.Ht){this.Ht=t;var n=!1,i=this.zt,r=this.k;if(null!=r&&0<(s=r.length-t)){if(i===xt.ASCENDING)for(var e=0;e<s;++e)r.shift();else r.length=t;n=!0}var u=this.Vt;if(null!=u&&0<(s=u.length-t)){if(i===xt.ASCENDING)for(e=0;e<s;++e)u.shift();else u.length=t;n=!0}var s,h=this.Wt;if(null!=h&&0<(s=h.length-t)){if(i===xt.ASCENDING)for(e=0;e<s;++e)h.shift();else h.length=t;n=!0}if(n){var o=this.parent;null!=o&&(o.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.zt},set:function(t){this.zt=t},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){var n=!1,i=this.k;null!=i&&0<=t&&t<i.length&&(i.splice(t,1),n=!0);var r=this.Vt;null!=r&&0<=t&&t<r.length&&(r.splice(t,1),n=!0);var e=this.Wt;if(null!=e&&0<=t&&t<e.length&&(e.splice(t,1),n=!0),n){var u=this.parent;null!=u&&(u.isChanged=!0)}},t.prototype.removeAll=function(t){var n=!1,i=t.slice(0).sort(Ft),r=i.length,e=this.k;if(null!=e)for(var u=r-1;0<=u;--u)0<=(o=i[u])&&o<e.length&&(e.splice(o,1),n=!0);var s=this.Vt;if(null!=s)for(u=r-1;0<=u;--u)0<=(o=i[u])&&o<s.length&&(s.splice(o,1),n=!0);var h=this.Wt;if(null!=h)for(u=r-1;0<=u;--u){var o;0<=(o=i[u])&&o<h.length&&(h.splice(o,1),n=!0)}if(n){var a=this.parent;null!=a&&(a.isChanged=!0)}},t.prototype.clear=function(){var t=!1,n=this.k;null!=n&&(n.length=0,t=!0);var i=this.Vt;null!=i&&(i.length=0,t=!0);var r=this.Wt;if(null!=r&&(r.length=0,t=!0),t){var e=this.parent;null!=e&&(e.isChanged=!0)}},t.prototype.toDirty=function(){var t=this.parent;null!=t&&(t.isChanged=!0)},t.prototype.copy=function(t){return this.id=t.id,this.as=t.as,this.type=t.type,this.scope=t.scope,this.initial=t.initial,this.format=t.format,this.formatter=t.formatter,this.range.copy(t.range),this.Ut=t.value,this.Gt=t.time,this.Rt=t.state,this.Ht=t.capacity,this},t.prototype.isEquals=function(t){return this.id===t.id&&this.as===t.as&&this.type===t.type&&this.scope===t.scope&&this.initial===t.initial&&this.formatter===t.formatter&&this.range.isEquals(t.range)},t.prototype.serialize=function(t){var n=t.addData(this.id),i=t.addResource(this.as),r=t.addResource(this.initial),e=t.addResource(this.format.trim()),u=this.range.serialize(t);return t.addResource("[".concat(n,",").concat(r,",").concat(e,",").concat(u,",").concat(this.Ht,",").concat(this.zt,",").concat(this.type,",").concat(this.scope,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i,r,e=n.resources;if(0<=t&&t<e.length){var u=n.getDataValue(t);null==u&&(u=JSON.parse(e[t]),n.setDataValue(t,u)),this.id=n.data[u[0]]||"";var s=u[8];this.as=null!=s&&e[s]||"",this.type=null!==(i=u[6])&&void 0!==i?i:Bt.NUMBER,this.scope=null!==(r=u[7])&&void 0!==r?r:_t.PUBLIC,this.initial=e[u[1]]||"",this.format=e[u[2]]||"",this.range.deserialize(u[3],n),this.Ht=u[4],this.zt=u[5]}return this},t}(),Gt=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if((e=n[i])===t)return i;for(i=0,r=n.length;i<r;++i){var e;if((e=n[i])[0]===t[0]&&e[1]===t[1]&&e[2]===t[2])return i}return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.copy=function(t){this.clearAndAddAll(t.values)},t.prototype.serialize=function(t){var n=this.values;if(n.length<=0)return-1;for(var i="[",r="",e=0,u=n.length;e<u;++e){var s=n[e],h=t.addResource(s[0]),o=t.addResource(s[1]),a=t.addResource(s[2]);i+="".concat(r).concat(h,",").concat(o,",").concat(a),r=","}return i+="]",t.addResource(i)},t.prototype.deserialize=function(t,n){var i=this.values;i.length=0;var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataMapping(t);null==u&&(u=JSON.parse(r[t]),n.setDataMapping(t,u));for(var s=0,h=u.length;s<h;s+=3){var o=u[s],a=u[s+1],c=u[s+2];i.push([0<=o&&o<e?r[o]:"",0<=a&&a<e?r[a]:"",0<=c&&c<e?r[c]:""])}}},t}(),Ht=function(){function t(){}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Xt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i,r=null!==(i=this.Xt)&&void 0!==i?i:this.Xt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Xt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),c.value=n}return!0},t.prototype.toDirty=function(t){var n=this.Xt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.each=function(t){var n=this.Xt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t}(),zt=function(){function t(){this.Xt=new Map}return t.prototype.set=function(t,n){return this.Xt.set(t,n),this},t.prototype.get=function(t){var n;return null!==(n=this.Xt.get(t))&&void 0!==n?n:null},t.prototype.contains=function(t){return this.Xt.has(t)},t.prototype.remove=function(t){var n=this.Xt,i=n.get(t);return n.delete(t),null!=i?i:null},t.prototype.clear=function(){return this.Xt.clear(),this},t.prototype.size=function(){return this.Xt.size},t.prototype.each=function(t){var n=!1;return this.Xt.forEach((function(i,r){n||!1===t(i,r)&&(n=!0)})),this},t.prototype.copy=function(t){var n=this.Xt;return n.clear(),t.each((function(t,i){n.set(i,t)})),this},t.prototype.serialize=function(t){var n=this.Xt;if(n.size<=0)return-1;var i=[];return n.forEach((function(n,r){var e=t.addResource(n),u=t.addResource(r);i.push(u,e)})),t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=this.Xt;i.clear();var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataSystem(t);null==u&&(u=JSON.parse(r[t]),n.setDataSystem(t,u));for(var s=0,h=u.length;s<h;s+=2){var o=u[s];if(0<=o&&o<e){var a=r[o],c=u[s+1];0<=c&&c<e&&i.set(a,r[c])}}}},t}(),Vt=function(){function t(){this.k=[],this.Kt=!0}return Object.defineProperty(t.prototype,"values",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.Kt},set:function(t){this.Kt=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.k;return 0<t.length?t[0].id:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"as",{get:function(){var t=this.k;return 0<t.length?t[0].as:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var t=this.k;return 0<t.length?t[0].type:Bt.NUMBER},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scope",{get:function(){var t=this.k;return 0<t.length?t[0].scope:_t.PRIVATE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initial",{get:function(){var t=this.k;return 0<t.length?t[0].initial:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){var t=this.k;return 0<t.length?t[0].format:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.k;return 0<t.length?t[0].range:null!=U?U:U=new yt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this.k;return 0<t.length?t[0].value:0},set:function(t){var n=this.k;0<n.length&&(n[0].value=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){var t=this.k;return 0<t.length?t[0].nvalue:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){var t=this.k;return 0<t.length?t[0].time:0},set:function(t){var n=this.k;0<n.length&&(n[0].time=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){var t=this.k;return 0<t.length?t[0].state:Pt.UNKNOWN},set:function(t){var n=this.k;0<n.length&&(n[0].state=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){var t=this.k;return 0<t.length?t[0].capacity:0},set:function(t){var n=this.k;0<n.length&&(n[0].capacity=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alias",{get:function(){var t=this.Yt;return null==t&&(t=this.newAlias(),this.Yt=t),t},enumerable:!1,configurable:!0}),t.prototype.newAlias=function(){var t=this.k,n=t.length;if(0<n){for(var i={},r=0;r<n;++r){var e=t[r];i[e.as||e.id]=e}return i}return null!=G?G:G={}},Object.defineProperty(t.prototype,"mapping",{get:function(){var t=this.Jt;return null==t&&(t=this.newMapping(),this.Jt=t),t},enumerable:!1,configurable:!0}),t.prototype.newMapping=function(){return new Gt},t.prototype.getMapping=function(){return this.Jt},Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Zt;return null==t&&(t=this.newPrivate(),this.Zt=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new Ht},t.prototype.getPrivate=function(){return this.Zt},Object.defineProperty(t.prototype,"system",{get:function(){var t=this.qt;return null==t&&(t=this.newSystem(),this.qt=t),t},enumerable:!1,configurable:!0}),t.prototype.newSystem=function(){return new zt},t.prototype.getSystem=function(){return this.qt},t.prototype.add=function(t,n){var i=this.k;t.parent=this,void 0===n?i.push(t):i.splice(n,0,t)},t.prototype.set=function(t,n){var i=this.k;if(0<=t&&t<i.length){var r=i[t];return n.parent=this,i[t]=n,r.parent=void 0,r}return null},t.prototype.remove=function(t){var n=this.k;0<=t&&t<n.length&&(n.splice(t,1)[0].parent=void 0)},t.prototype.indexOf=function(t){for(var n=this.k,i=n.length,r=0;r<i;++r)if(n[r]===t)return r;for(r=0;r<i;++r)if(n[r].isEquals(t))return r;for(r=0;r<i;++r)if(n[r].id===t.id)return r;return-1},t.prototype.get=function(t){var n=this.k;return 0<=t&&t<n.length?n[t]:null},t.prototype.size=function(){return this.k.length},t.prototype.swap=function(t,n){var i=this.k,r=i[n];i[n]=i[t],i[t]=r},t.prototype.copy=function(t){var n=this.k;n.length=0;for(var i=0,r=t.size();i<r;++i){var e=t.get(i);if(null!=e){var u=(new Ut).copy(e);u.parent=this,n.push(u)}}var s=t.getMapping();s&&this.mapping.copy(s);var h=t.getSystem();return h&&this.system.copy(h),this},t.prototype.serialize=function(t){for(var n=this.k,i=[],r=0,e=n.length;r<e;++r)i.push(n[r].serialize(t));var u,s=this.Jt;return null!=s?(i.push(s.serialize(t)),null!=(u=this.qt)?t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]")):t.addResource("[".concat(JSON.stringify(i),"]"))):null!=(u=this.qt)?(i.push(-1),t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]"))):t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getData(t);null==r&&(r=JSON.parse(i[t]),n.setData(t,r));var e=this.k;if(e.length=0,this.isMapped(r)){for(var u=r[0],s=u.length,h=0,o=s-1;h<o;++h){var a=u[h];(l=new Ut).parent=this,l.deserialize(a,n),e.push(l)}var c=u[s-1];0<=c&&this.mapping.deserialize(c,n);var f=r[1];null!=f&&0<=f&&this.system.deserialize(f,n)}else for(h=0,o=r.length;h<o;++h){var l;a=r[h],(l=new Ut).parent=this,l.deserialize(a,n),e.push(l)}}},t.prototype.isMapped=function(t){return 0<t.length&&mt(t[0])},t}(),Wt=function(){function t(t,n,i){this.p=t,this.Qt=n,this.$t=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Qt},set:function(t){this.Qt!==t&&(this.Qt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.$t},set:function(t){this.$t!==t&&(this.$t=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Qt!==t&&(this.Qt=t,i=!0),null!=n&&this.$t!==n&&(this.$t=n,i=!0),i&&this.p.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Qt,vertical:this.$t}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Qt,",").concat(this.$t,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getAlign(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setAlign(t,e),this.set(e[0],e[1])}}},t}(),Xt=function(){function t(t,n,i){this.p=t,this.Qt=n,this.$t=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Qt},set:function(t){this.Qt!==t&&(this.Qt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.$t},set:function(t){this.$t!==t&&(this.$t=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Qt!==t&&(this.Qt=t,i=!0),null!=n&&this.$t!==n&&(this.$t=n,i=!0),i&&this.p.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Qt,vertical:this.$t}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Qt,",").concat(this.$t,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getMargin(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setMargin(t,e),this.set(e[0],e[1])}}},t}(),Kt=function(){function t(t,n,i,r,e){this.p=t,this.O=n,this.S=i,this.j=r,this.kt=e}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width)},t.prototype.set=function(t,n,i,r){var e=!1;void 0!==t&&this.O!==t&&(this.O=t,e=!0),void 0!==n&&this.S!==n&&(this.S=n,e=!0),void 0!==i&&this.j!==i&&(this.j=i,e=!0),void 0!==r&&this.kt!==r&&(this.kt=r,e=!0),e&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.j,this.kt)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.j,width:this.kt}},t.prototype.serialize=function(t){var n="[".concat(this.O?1:0,",").concat(this.S,",").concat(this.j,",").concat(this.kt,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getTextOutline(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3]);else{var e=JSON.parse(i[t]);n.setTextOutline(t,e),this.set(!!e[0],e[1],e[2],e[3])}}},t}(),Yt=function(){function t(t,n,i,r,e,u){this.p=t,this.O=!0,this.Ut=n,this.S=i,this.j=r,this.tn=e,this.T=u,this.nn=d.NORMAL,this.align=new Wt(t,m.CENTER,w.MIDDLE),this.offset=new Xt(t,0,0),this.B=g.NORMAL,this.spacing=new Xt(t,0,0),this.outline=new Kt(t,!1,16777215,1,.5),this.rn=p.LEFT_TO_RIGHT,this.padding=new Xt(t,10,10),this.en=!1,this.un=!1}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Ut},set:function(t){if(this.Ut!==t){this.Ut=t;var n=this.p,i=n.uploaded;if(null==i||!i.isCompatible(n))return this.atlas=void 0,void n.toDirty();var r=this.atlas,e=r&&r.characters;if(null==e)return this.atlas=void 0,void n.toDirty();for(var u=0,s=t.length;u<s;++u)if(!(t[u]in e))return this.atlas=void 0,void n.toDirty();n.updateUploaded()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){return this.tn},set:function(t){this.tn!==t&&(this.tn=t,this.p.toDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this.nn},set:function(t){this.nn!==t&&(this.nn=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this.rn},set:function(t){this.rn!==t&&(this.rn=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){return this.en},set:function(t){this.en!==t&&(this.en=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fitting",{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return t&&(this.set(t.value,t.color,t.alpha,t.family,t.size,t.weight,t.style,t.direction,t.clipping,t.fitting),this.align.copy(t.align),this.offset.copy(t.offset),this.outline.copy(t.outline),this.spacing.copy(t.spacing),this.padding.copy(t.padding)),this},t.prototype.set=function(t,n,i,r,e,u,s,h,o,a){var c=!1,f=!1;return null!=t&&this.Ut!==t&&(this.Ut=t,c=!0),null!=n&&this.S!==n&&(this.S=n,f=!0),null!=i&&this.j!==i&&(this.j=i,f=!0),null!=r&&this.tn!==r&&(this.tn=r,c=!0),null!=e&&this.T!==e&&(this.T=e,f=!0),null!=u&&this.nn!==u&&(this.nn=u,f=!0),null!=s&&this.B!==s&&(this.B=s,f=!0),null!=h&&this.rn!==h&&(this.rn=h,f=!0),null!=o&&this.en!==o&&(this.en=o,f=!0),null!=a&&this.un!==a&&(this.un=a,f=!0),c?this.p.toDirty():f&&this.p.updateUploaded(),this},t.prototype.toObject=function(){return{value:this.Ut,color:this.S,alpha:this.j,family:this.tn,size:this.T,weight:this.nn,align:this.align.toObject(),offset:this.offset.toObject(),style:this.B,outline:this.outline.toObject(),direction:this.rn,spacing:this.spacing.toObject(),padding:this.padding.toObject(),clipping:this.en,fitting:this.un}},t.prototype.serialize=function(t){var n=t.addResource(this.Ut),i=t.addResource(this.tn),r=this.align.serialize(t),e=this.offset.serialize(t),u=this.outline.serialize(t),s=this.spacing.serialize(t),h=this.padding.serialize(t),o=this.en?1:0,a=this.un?1:0,c="[".concat(n,",").concat(this.S,",").concat(this.j,",").concat(i,",").concat(this.T,",")+"".concat(this.nn,",").concat(r,",").concat(e,",").concat(this.B,",").concat(u,",")+"".concat(s,",").concat(this.rn,",").concat(h,",").concat(o,",").concat(a,"]");return t.addResource(c)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getText(t);null==r&&(r=JSON.parse(i[t]),n.setText(t,r)),this.set(i[r[0]]||"",r[1],r[2],i[r[3]]||"auto",r[4],r[5],r[8],r[11],!!r[13],!!r[14]),this.align.deserialize(r[6],n),this.offset.deserialize(r[7],n),this.outline.deserialize(r[9],n),this.spacing.deserialize(r[10],n),this.padding.deserialize(r[12],n)}},t}(),Jt=function(n){function i(t){var i=n.call(this,t)||this;i.size=i.newSize(),i.fill=i.newFill(),i.stroke=i.newStroke(),i.sn=q.RADIUS,i.hn=ut.ALL;var r=new Vt;return i.data=r,i.tag=r,i.text=i.newText(),i}return _(i,n),i.prototype.newSize=function(){var n=this;return new t.ObservablePoint((function(){n.onSizeChange()}),void 0,q.SIZE_X,q.SIZE_Y)},i.prototype.newFill=function(){return new $(this,!0,q.FILL_COLOR,q.FILL_ALPHA)},i.prototype.newStroke=function(){return new kt(this,!0,q.STROKE_COLOR,q.STROKE_ALPHA,q.STROKE_WIDTH,q.STROKE_ALIGN,q.STROKE_SIDE,q.STROKE_STYLE)},i.prototype.newText=function(){return new Yt(this,q.TEXT_VALUE,q.TEXT_COLOR,q.TEXT_ALPHA,q.TEXT_FAMILY,q.TEXT_SIZE)},Object.defineProperty(i.prototype,"corner",{get:function(){return this.hn},set:function(t){this.hn!==t&&(this.hn=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"radius",{get:function(){return this.sn},set:function(t){this.sn!==t&&(this.sn=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"image",{get:function(){return this.jt},set:function(t){if(this.jt!==t){null!=t?(this.jt=t,this.imageSrc=t.src):(this.jt=void 0,this.imageSrc=void 0);var n=this.parent;null!=n&&n.toDirty()}},enumerable:!1,configurable:!0}),i}(Rt),Zt=function(t,n,i,r,e,u,s){if(t.fill.enable){if((c=n*n)*(o=e*e)+(f=i*i)*(h=r*r)<=h*o)return!0}else if(0<u){var h,o,a=u*s,c=n*n,f=i*i,l=Math.max(0,r-a),v=Math.max(0,e-a),b=l*l,d=v*v;if(b*d<=c*d+f*b&&c*(o=e*e)+f*(h=r*r)<=h*o)return!0}return!1},qt={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_OR_LEFT:9,TOP_OR_RIGHT:3,BOTTOM_OR_LEFT:12,BOTTOM_OR_RIGHT:6,ALL:15},Qt=function(t,n,i,r,e,u,s){if(Nt(n,i,r,e)){if(t.fill.enable)return!0;var h=t.stroke.side;if(0<u&&h!==qt.NONE){var o=u*s,a=Math.max(0,r-o),c=Math.max(0,e-o);if(!Nt(n,i,a,c))return!(h!==qt.ALL&&!(n<=-a?i<=-c?h&qt.TOP_OR_LEFT:+c<=i?h&qt.BOTTOM_OR_LEFT:h&qt.LEFT:+a<=n?i<=-c?h&qt.TOP_OR_RIGHT:+c<=i?h&qt.BOTTOM_OR_RIGHT:h&qt.RIGHT:i<=-c?h&qt.TOP:+c<=i&&h&qt.BOTTOM))}}return!1},$t=function(t,n,i,r,e){return+i*t+r-n<=0&&-i*t+r-n<=0&&n<=e},tn=function(t,n,i,r,e,u,s){var h=2*e/r;if(t.fill.enable){if($t(n,i,h,-e,+e))return!0}else if(0<u){var o=u*s;if($t(n,i,h,-e,+e)){var a=2*r*e/(r+Math.sqrt(r*r+4*e*e)),c=e-a,f=c+(-e-c)*Math.max(0,a-o)/a;if(!$t(n,i,h,f,e-o))return!0}}return!1},nn=function(t,n,i){return.5*(i+t*n)},rn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getHitTestSize=function(n){var i=this.Tt.formatted;if("boundary"in i){var r=i.boundary;n.width=Math.max(Math.abs(r[0]),Math.abs(r[2])),n.height=Math.max(Math.abs(r[1]),Math.abs(r[3]))}else t.prototype.getHitTestSize.call(this,n);return n},n.prototype.toMarkerSize=function(t){var n=0,i=t.getMarker();if(i){var r=i.head;if(r.type!==Q.NONE){var e=r.size;n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y)))}var u=i.tail;u.type!==Q.NONE&&(e=u.size,n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y))))}return n},n.prototype.containsAbsMarker=function(t,n,i,r,e,u){var s=t.type;if(s!==Q.NONE){var h=t.transform,o=h.a,a=h.b,c=h.c,f=h.d,l=h.tx,v=h.ty,b=1/(o*f-c*a),d=(f*n-c*i+v*c-l*f)*b,g=(o*i-a*n-v*o+l*a)*b,m=t.size,w=.5*m.x,p=.5*m.y;w<0&&(w=-w,n=-n),p<0&&(p=-p,i=-i);var O=r*e*u;switch(w+=O,p+=O,s){case Q.CIRCLE:return Zt(this,d,g,w,p,r,e);case Q.TRIANGLE:return tn(this,d,g,w,p,r,e);case Q.RECTANGLE:return Qt(this,d,g,w,p,r,e)}}return!1},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=this.Tt,o=nn(e,u,0),a=o+this.toMarkerSize(h);if(this.containsAbsBBox(t,n,i+a,r+a)){var c=h.getMarker();if(c){if(this.containsAbsMarker(c.head,t,n,e,u,s))return!0;if(this.containsAbsMarker(c.tail,t,n,e,u,s))return!0}var f=this.calcHitPointAbsHitTester;return h.calcHitPointAbs(t,n,i,r,o,null,f,null)}return!1},n.prototype.calcHitPart=function(t,n){var i=this.toHitTestData(t,n),r=i.strokeWidth,e=i.strokeScale,u=nn(r,e,0),s=this.Tt,h=u+this.toMarkerSize(s),o=i.x,a=i.y,c=i.width,f=i.height;if(this.containsAbsBBox(o,a,c+h,f+h)){var l=s.getMarker();if(l){var v=i.strokeAlign;if(this.containsAbsMarker(l.head,o,a,r,e,v))return et.MARKER_HEAD;if(this.containsAbsMarker(l.tail,o,a,r,e,v))return et.MARKER_TAIL}var b=this.calcHitPointAbsHitTester;if(s.calcHitPointAbs(o,a,c,f,u,null,b,null))return et.LINE}return this.containsText(t,n)?et.TEXT:this.containsChildren(t,n)?et.CHILDREN:et.NONE},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.Tt,h=this.toHitTestData(t,n),o=(i||nn)(h.strokeWidth,h.strokeScale,0);return!!this.containsAbsBBox(h.x,h.y,h.width+o,h.height+o)&&s.calcHitPointAbs(h.x,h.y,h.width,h.height,o,r,e,u)},n.prototype.calcHitPointAbsHitTester=function(t,n,i,r,e,u,s,h,o){var a=e-i,c=u-r,f=t-i,l=n-r,v=a*a+c*c,b=a*f+c*l,d=f*f+l*l;if(1e-4<v){var g=Math.max(0,Math.min(1,b/v));if(v*g*g-2*b*g+d<h*h)return!0}return!1},n}(Jt),en=function(t){function n(n){void 0===n&&(n=r.BAR);var i=t.call(this,n)||this;return i.Tt=new rt(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbsBBox=function(n,i,r,e){var u=Math.max(0,this.Tt.size);return t.prototype.containsAbsBBox.call(this,n,i,r+u,e+u)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.Tt.serialize(n),i},n}(rn),un=function(t){function n(n,i){var r=t.call(this,n,i,4,2)||this;return r.pointsId=NaN,r.pointsStyle=z.NONE,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset,i=this.indexOffset;t.updateClippings(),t.updateIndices(),c(t.clippings,n),f(t.indices,n,i)},n.prototype.update=function(t,n){this.updateVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexStepAndColorFill=function(t,n){if(n instanceof en){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.stroke,h=s.enable?s.width:0,o=s.style,a=h!==this.strokeWidth||o!==this.strokeStyle,c=X(n),f=this.transformLocalId!==c,v=n.points,b=v.id,d=b!==this.pointsId,g=v.style,m=g!==this.pointsStyle;(u||f||a||d||m)&&(this.sizeX=r,this.sizeY=e,this.strokeWidth=h,this.strokeStyle=o,this.transformLocalId=c,this.pointsId=b,this.pointsStyle=g,d&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),l(t.vertices,t.steps,t.colorFills,this.vertexOffset,v.values,v.size,h,o,n.transform.internalTransform))}},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),v(t.uvs,this.vertexOffset,J(i)))},n}(W),sn=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=NaN,this.scaleX=1,this.scaleY=1,this.size=NaN,this.family="auto",this.value="",this.texture=null,this.textureTransformId=NaN,this.color=NaN,this.alpha=NaN,this.weight=NaN,this.style=NaN,this.alignHorizontal=NaN,this.alignVertical=NaN,this.offsetHorizontal=NaN,this.offsetVertical=NaN,this.outlineWidth=NaN,this.outlineColor=NaN,this.outlineAlpha=NaN,this.spacingHorizontal=NaN,this.spacingVertical=NaN,this.direction=NaN,this.paddingHorizontal=NaN,this.paddingVertical=NaN,this.clipping=!1,this.fitting=!1}return n.prototype.init=function(t){var n=this.vertexCount;if(0<n){var i=this.vertexOffset;t.updateClippings(),S(t.clippings,i,n),t.updateIndices(),j(t.indices,i,this.indexOffset,this.indexCount)}},n.prototype.isCompatible=function(t){return 4*M(t)===this.vertexCount},n.prototype.update=function(t,n){if(0<this.vertexCount){var i=n.text.atlas;null!=i&&(this.updateVertex(t,n,i),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateStep(t,n))}},n.prototype.updateVertex=function(n,i,r){var e=i.size,u=e.x,s=e.y,h=u!==this.sizeX||s!==this.sizeY,o=X(i),a=this.transformLocalId!==o,c=i.text,f=c.size,l=c.family,v=c.value,b=c.style,d=c.align.horizontal,g=c.align.vertical,m=c.offset.horizontal,w=c.offset.vertical,p=c.spacing.horizontal,O=c.spacing.vertical,D=c.direction,E=c.padding.horizontal,M=c.padding.vertical,S=c.clipping,j=c.fitting,T=c.texture||t.Texture.WHITE,N=Y(T),C=v!==this.value||l!==this.family,A=f!==this.size,R=b!==this.style,k=d!==this.alignHorizontal||g!==this.alignVertical,L=m!==this.offsetHorizontal||w!==this.offsetVertical,y=p!==this.spacingHorizontal||O!==this.spacingVertical||E!==this.paddingHorizontal||M!==this.paddingVertical,x=D!==this.direction,B=this.clipping!==S,_=this.fitting!==j,P=T!==this.texture||N!==this.textureTransformId;if(h||a||C||A||R||k||L||y||x||B||_||P){this.size=f,this.family=l,this.value=v,this.style=b,this.alignHorizontal=d,this.alignVertical=g,this.offsetHorizontal=m,this.offsetVertical=w,this.spacingHorizontal=p,this.spacingVertical=O,this.direction=D,this.paddingHorizontal=E,this.paddingVertical=M,this.clipping=S,this.fitting=j,this.texture=T,this.textureTransformId=N,(A||_||j&&h)&&(this.weight=NaN),n.updateVertices(),n.updateUvs();var F=i.size,U=c.world;null==U&&(U=[0,0,0,0,0,0,0,0],c.world=U),I(n.vertices,n.uvs,this.vertexOffset,this.vertexCount,0,0,F.x,F.y,r,f,v,b,d,g,m,w,p,O,D,E,M,S,j,U,J(T),i.transform.internalTransform)}},n.prototype.updateColorFill=function(t,n){var i=n.text,r=i.color,e=n.visible&&i.enable?i.alpha:0;r===this.color&&e===this.alpha||(this.color=r,this.alpha=e,t.updateColorFills(),V(r,e,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.text,r=i.outline,e=r.color,u=n.visible&&i.enable?r.alpha:0;e===this.outlineColor&&u===this.outlineAlpha||(this.outlineColor=e,this.outlineAlpha=u,t.updateColorStrokes(),V(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.updateStep=function(t,n){var i=n.text,r=i.outline,e=r.enable?r.width:0,u=e!==this.outlineWidth,s=i.weight,h=s!==this.weight,o=1,a=1,c=i.world;null!=c&&(o=c[8],a=c[9]);var f=D<Math.abs(this.scaleX-o)||D<Math.abs(this.scaleY-a);(h||u||f)&&(this.weight=s,this.outlineWidth=e,this.scaleX=o,this.scaleY=a,t.updateSteps(),T(t.steps,this.vertexOffset,this.vertexCount,i.atlas,i.size,e,s,this.scaleX,this.scaleY))},n.prototype.buildUnit=function(n){if(0<this.vertexCount){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;r!==n.baseTexture&&(n.baseTexture=r,n.push(i,this.indexOffset))}},n}(),hn=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=4+h,c=2+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new un(i,r),new sn(i+4,r+2,h,o)]).init(n):null},on=function(t,n,i){var r=t.length;if(n<r)return t;for(var e="",u=0,s=n-r;u<s;++u)e+=i;return e+t},an=function(){function t(){}return t.toCode=function(t){return on(t.toString(16).toUpperCase(),6,"0")},t.fromCode=function(t){var n=t.trim().toLowerCase();if(6===n.length){var i=Number("0x".concat(n));if(i==i)return i}return null},t.fromRgb=function(t,n,i){return 255*t<<16|255*n<<8|255*i|0},t.blend=function(t,n,i){var r=t>>16&255,e=t>>8&255,u=255&(0|t),s=n>>16&255,h=n>>8&255,o=255&(0|n),a=Math.max(0,Math.min(1,i)),c=1-a;return Math.max(0,Math.min(255,r*c+s*a))<<16|Math.max(0,Math.min(255,e*c+h*a))<<8|0|Math.max(0,Math.min(255,u*c+o*a))},t.brighten=function(t,n){return 0<=n?this.blend(t,16777215,n):this.blend(t,0,-n)},t.darken=function(t,n){return 0<=n?this.blend(t,0,n):this.blend(t,16777215,-n)},t.toGrayscale=function(t){var n=this.toLuma(t);return n<<16|n<<8|n},t.toLuma=function(t){return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(255&(0|t))&255},t}(),cn={NONE:0,POSITION_X:1,POSITION_Y:2,POSITION:3,ROTATION:4,COLOR_FILL:8,COLOR_STROKE:16,COLOR_FILL_AND_STROKE:24,COLOR_TEXT:32,COLOR_TEXT_OUTLINE:64,COLOR:120,VISIBILITY:128,HEIGHT:256,WIDTH:512,SIZE:768,TEXT:1024,CURSOR:2048},fn=function(){function t(){}return t.toBaseFill=function(t,n){return(n.written&cn.COLOR_FILL?t:n).fill},t.toBaseStroke=function(t,n){return(n.written&cn.COLOR_STROKE?t:n).stroke},t.toBaseText=function(t,n){return(n.written&cn.COLOR_TEXT?t:n).text},t.toBaseTextOutline=function(t,n){return(n.written&cn.COLOR_TEXT_OUTLINE?t:n).text.outline},t}(),ln={isInitializing:!1},vn=function(){function t(){}return t.from=function(t,n,i,r,e,u){if(t.trim().length<=0)return i;try{var s="try {with (shape) {with (state) {with (data.alias) {with (environment) {"+(e?"var result = (".concat(t,");")+"return (result != null ? ".concat(n,"(result) : null);"):"return ".concat(n,"(").concat(t,");"))+"}}}}} catch (e) {"+"return ".concat(r,";")+"}";return null==u?Function("shape","time","environment",s):Function("shape","time","environment",u,s)}catch(t){return i}},t.ofNumberOrNull=function(t){return this.from(t,"Number",this.NULL,"null",!0)},t.ofStringOrNull=function(t){return this.from(t,"String",this.NULL,"null",!0)},t.ofUnknown=function(t){return this.from(t,"",this.NULL,"null",!1)},t.ofNumber=function(t){return this.from(t,"Number",this.ZERO,"0",!1)},t.ofNumberOrOne=function(t){return this.from(t,"Number",this.ONE,"1",!1)},t.ofNumberOrOneHundred=function(t){return this.from(t,"Number",this.ONE_HUNDRED,"100",!1)},t.ofString=function(t){return this.from(t,"String",this.EMPTY,'""',!1)},t.ofBoolean=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrTrue=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrFalse=function(t){return this.from(t,"Boolean",this.FALSE,"false",!1)},t.ofElementOrNull=function(t){return this.from(t,"",void 0,"null",!1,"container")},t.NULL=function(){return null},t.ZERO=function(){return 0},t.ONE=function(){return 1},t.ONE_HUNDRED=function(){return 100},t.EMPTY=function(){return""},t.TRUE=function(){return!0},t.FALSE=function(){return!1},t}(),bn=function(){function t(t){this.reset=t||cn.NONE}return t.prototype.initialize=function(t,n){},t.prototype.execute=function(t,n,i){},t.prototype.onResize=function(t,n){},t.prototype.onFocus=function(t,n){},t.prototype.onBlur=function(t,n){},t.prototype.onClick=function(t,n,i){},t.prototype.onDblClick=function(t,n,i,r){},t.prototype.onDowning=function(t,n,i){},t.prototype.onDown=function(t,n,i){},t.prototype.onMove=function(t,n,i){},t.prototype.onOver=function(t,n,i){},t.prototype.onOut=function(t,n,i){},t.prototype.onUp=function(t,n,i){},t.prototype.onUpOutside=function(t,n,i){},t.prototype.onPressed=function(t,n,i){},t.prototype.onUnpressed=function(t,n,i){},t.prototype.onKeyDown=function(t,n,i){},t.prototype.onKeyUp=function(t,n,i){},t.prototype.onRightClick=function(t,n,i){},t.prototype.onRightDowning=function(t,n,i){},t.prototype.onRightDown=function(t,n,i){},t.prototype.onRightUp=function(t,n,i){},t.prototype.onRightUpOutside=function(t,n,i){},t.prototype.onRightPressed=function(t,n,i){},t.prototype.onRightUnpressed=function(t,n,i){},t.prototype.onRender=function(t,n,i,r){},t}(),dn=function(t){function n(n,i){var r=t.call(this,i)||this;return r.condition=vn.ofBoolean(n.condition),r}return _(n,t),n}(bn),gn=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.interval=n.interval,r}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.interval,e=r<<1,u=i%e;u<r?(this.toOff(t,n),n.effect=i+(r-u)):(this.toOn(t,n),n.effect=i+(e-u))}},n.prototype.toOn=function(t,n){},n.prototype.toOff=function(t,n){},n}(dn),mn=function(t){function n(n){return t.call(this,n,cn.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=fn.toBaseFill(t,n);t.fill.set(void 0,an.brighten(i.color,.5),i.alpha);var r=fn.toBaseStroke(t,n);t.stroke.set(void 0,an.brighten(r.color,.5),r.alpha);var e=fn.toBaseText(t,n);t.text.set(void 0,an.brighten(e.color,.5),e.alpha);var u=fn.toBaseTextOutline(t,n);t.text.outline.set(void 0,an.brighten(u.color,.5),u.alpha),n.written|=this.reset},n}(gn),wn=function(t){function n(n){var i=t.call(this,n,cn.COLOR_FILL)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.fill.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(gn),pn=function(t){function n(n){var i=t.call(this,n,cn.COLOR_STROKE)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.stroke.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(gn),On=function(t){function n(n){return t.call(this,n,cn.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=fn.toBaseFill(t,n);t.fill.set(void 0,an.darken(i.color,.5),i.alpha);var r=fn.toBaseStroke(t,n);t.stroke.set(void 0,an.darken(r.color,.5),r.alpha);var e=fn.toBaseText(t,n);t.text.set(void 0,an.darken(e.color,.5),e.alpha);var u=fn.toBaseTextOutline(t,n);t.text.outline.set(void 0,an.darken(u.color,.5),u.alpha),n.written|=this.reset},n}(gn),Dn=function(t){function n(n){return t.call(this,n,cn.COLOR_FILL_AND_STROKE)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=fn.toBaseFill(t,n);t.fill.set(void 0,i.color,.5*i.alpha);var r=fn.toBaseStroke(t,n);t.stroke.set(void 0,r.color,.5*r.alpha),n.written|=this.reset},n}(gn),En=function(t){function n(n){return t.call(this,n,cn.VISIBILITY)||this}return _(n,t),n.prototype.toOn=function(t,n){t.visible=!0,n.written|=this.reset},n.prototype.toOff=function(t,n){t.visible=!1,n.written|=this.reset},n}(gn),Mn={VISIBILITY:0,BRIGHTEN:1,DARKEN:2,OPACITY:3,COLOR_FILL:4,COLOR_STROKE:5},Sn=function(){function t(t,n){this.type=t,this.condition=n}return t.prototype.isEquals=function(t){return this.type===t.type&&this.condition===t.condition},t.prototype.toLabel=function(){return this.getTheme().toLabel(this)},t.prototype.getTheme=function(){var n;return null!==(n=t.THEME)&&void 0!==n?n:t.THEME=Z.getInstance().get("EShapeActionValue")},t}(),jn=function(t){function n(n,i,r){var e=t.call(this,n,i)||this;return e.subtype=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.subtype===i.subtype},n}(Sn),Tn={SHOW_HIDE:0,BLINK:1,TRANSFORM:2,OPEN:3,EMIT_EVENT:4,CHANGE_COLOR_LEGACY:5,CHANGE_TEXT:6,CHANGE_CURSOR:7,MISC:8,CHANGE_COLOR:9,GESTURE:10,EXTENSION:1e3},Nn=function(){function t(){}return t.toResource=function(t,n,i){if(0<=t&&t<n.length){var r=n[t];if(pt(r)&&0<=r&&r<i.length)return i[r]}return""},t}(),In=function(t){function n(n,i,r,e,u){var s=t.call(this,Tn.BLINK,i,n)||this;return s.interval=r,s.color=e,s.alpha=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.interval===i.interval&&this.color===i.color&&this.alpha===i.alpha},n.prototype.toRuntime=function(){switch(this.subtype){case Mn.BRIGHTEN:return new mn(this);case Mn.COLOR_FILL:return new wn(this);case Mn.COLOR_STROKE:return new pn(this);case Mn.DARKEN:return new On(this);case Mn.OPACITY:return new Dn(this);case Mn.VISIBILITY:return new En(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.interval,",").concat(this.color,",").concat(this.alpha,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources);return new n(t[2],r,t[3],t[4],t[5])},n}(jn),Cn=function(){function t(){}return t.blend=function(t,n,i){var r=Math.max(0,Math.min(1,i));return Math.max(0,Math.min(1,t*(1-r)+n*r))},t}(),An=function(t){function n(n){return t.call(this,n,n.subtype<<3)||this}return _(n,t),n.prototype.set=function(t,n,i,r,e,u){var s=this.reset;if(null!=r){if(null!=e)if(null!=u){if(s&cn.COLOR_FILL){var h=fn.toBaseFill(t,n);t.fill.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u))}s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u)))}else s&cn.COLOR_FILL&&t.fill.set(void 0,r,e),s&cn.COLOR_STROKE&&t.stroke.set(void 0,r,e),s&cn.COLOR_TEXT&&t.text.set(void 0,r,e),s&cn.COLOR_TEXT_OUTLINE&&t.text.outline.set(void 0,r,e);else null!=u?(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,an.blend(h.color,r,u),h.alpha)),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,an.blend(h.color,r,u),h.alpha)),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,an.blend(h.color,r,u),h.alpha)),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,an.blend(h.color,r,u),h.alpha))):(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,r,h.alpha)),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,r,h.alpha)),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,r,h.alpha)),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,r,h.alpha)));n.written|=s}else null!=e&&(null!=u?(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,h.color,Cn.blend(h.alpha,e,u))),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,h.color,Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,Cn.blend(h.alpha,e,u)))):(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,h.color,e)),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,e)),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,h.color,e)),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,e))),n.written|=s)},n}(dn),Rn={COLOR_AND_ALPHA:0,COLOR:1,ALPHA:2,CODE:3,BRIGHTNESS:4},kn=function(t){function n(n){var i=t.call(this,n)||this;switch(n.target){case Rn.COLOR:i.color=n.color,i.alpha=null;break;case Rn.ALPHA:i.color=null,i.alpha=n.alpha;break;default:i.color=n.color,i.alpha=n.alpha}return i.blend=vn.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.color,e=this.alpha,u=this.blend(t,i,ln);this.set(t,n,i,r,e,u)}},n}(An),Ln={NONE:0,FILL:1,STROKE:2,TEXT:4,TEXT_OUTLINE:8,FILL_AND_STROKE:3,ALL:15},yn={FILL:0,STROKE:1,FILL_AND_STROKE:2,TEXT:3,TEXT_OUTLINE:4,ALL:5},xn=function(){function t(){}return t.from=function(t){if(t[0]===Tn.CHANGE_COLOR)return t[2];switch(t[2]){case yn.FILL:return Ln.FILL;case yn.STROKE:return Ln.STROKE;case yn.FILL_AND_STROKE:return Ln.FILL_AND_STROKE;case yn.TEXT:return Ln.TEXT;case yn.TEXT_OUTLINE:return Ln.TEXT_OUTLINE;case yn.ALL:return Ln.ALL}},t.unpack=function(t){var n=[];return t&Ln.FILL&&n.push(Ln.FILL),t&Ln.STROKE&&n.push(Ln.STROKE),t&Ln.TEXT&&n.push(Ln.TEXT),t&Ln.TEXT_OUTLINE&&n.push(Ln.TEXT_OUTLINE),n},t.pack=function(t){for(var n=Ln.NONE,i=0,r=t.length;i<r;++i)n|=t[i];return n},t}(),Bn=function(t){function n(n,i,r,e,u,s){var h=t.call(this,Tn.CHANGE_COLOR,i,n)||this;return h.target=r,h.color=e,h.alpha=u,h.blend=s,h}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new kn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.target,",").concat(this.color,",").concat(this.alpha,",").concat(i,"]"))},n.deserialize=function(t,i){var r=xn.from(t),e=Nn.toResource(1,t,i.resources),u=Nn.toResource(6,t,i.resources);return new n(r,e,t[3],t[4],t[5],u)},n}(jn),_n=function(t){function n(n){var i=t.call(this,n)||this;return i.brightness=vn.ofNumberOrNull(n.brightness),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.brightness(t,i,ln);this.set(t,n,i,r)}},n.prototype.set=function(t,n,i,r){var e=this.reset;if(null!=r){var u=this.toAdjusted;if(e&cn.COLOR_FILL){var s=fn.toBaseFill(t,n);t.fill.set(void 0,u(s.color,r),s.alpha)}e&cn.COLOR_STROKE&&(s=fn.toBaseStroke(t,n),t.stroke.set(void 0,u(s.color,r),s.alpha)),e&cn.COLOR_TEXT&&(s=fn.toBaseText(t,n),t.text.set(void 0,u(s.color,r),s.alpha)),e&cn.COLOR_TEXT_OUTLINE&&(s=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,u(s.color,r),s.alpha)),n.written|=e}},n.prototype.toAdjusted=function(t,n){return 0<=n?an.brighten(t,+n):an.darken(t,-n)},n}(An),Pn=function(t){function n(n,i,r){var e=t.call(this,Tn.CHANGE_COLOR,i,n)||this;return e.brightness=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.brightness===i.brightness},n.prototype.toRuntime=function(){return new _n(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=Rn.BRIGHTNESS,r=t.addResource(this.brightness);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(xn.from(t),Nn.toResource(1,t,i.resources),Nn.toResource(4,t,i.resources))},n}(jn),Fn=function(t){function n(n){var i=t.call(this,n)||this;return i.color=vn.ofNumberOrNull(n.color),i.alpha=vn.ofNumberOrNull(n.alpha),i.blend=vn.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.color(t,i,ln),e=this.alpha(t,i,ln),u=this.blend(t,i,ln);this.set(t,n,i,r,e,u)}},n}(An),Un=function(t){function n(n,i,r,e,u){var s=t.call(this,Tn.CHANGE_COLOR,i,n)||this;return s.color=r,s.alpha=e,s.blend=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new Fn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=Rn.CODE,r=t.addResource(this.color),e=t.addResource(this.alpha),u=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,",").concat(e,",").concat(u,"]"))},n.deserialize=function(t,i){return new n(xn.from(t),Nn.toResource(1,t,i.resources),Nn.toResource(4,t,i.resources),Nn.toResource(5,t,i.resources),Nn.toResource(6,t,i.resources))},n}(jn),Gn=function(t){function n(n){var i=t.call(this,n,cn.CURSOR)||this;return i.name=vn.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.name(t,i,ln);null!=r&&(t.cursor=r,n.written|=this.reset)}},n}(dn),Hn=function(t){function n(n,i){var r=t.call(this,Tn.CHANGE_CURSOR,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new Gn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),Nn.toResource(2,t,i.resources))},n}(Sn),zn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"AM":"PM"},t}(),Vn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"am":"pm"},t}(),Wn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getDate())},t}(),Xn=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t)},t}(),Kn=function(t){this.precision=null!=t?+t.substring(1,t.length):void 0},Yn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toExponential(this.precision)},n}(Kn),Jn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toFixed(this.precision)},n}(Kn),Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){var r=this.toAbs(t,n,i);return r<1e-24?this.an(t,1,""):r<1e-21?this.an(t,1e24,"y"):r<1e-18?this.an(t,1e21,"z"):r<1e-15?this.an(t,1e18,"a"):r<1e-12?this.an(t,1e15,"f"):r<1e-9?this.an(t,1e12,"p"):r<1e-6?this.an(t,1e9,"n"):r<.001?this.an(t,1e6,"μ"):r<1?this.an(t,1e3,"m"):r<1e3?this.an(t,1,""):r<1e6?this.an(t,.001,"k"):r<1e9?this.an(t,1e-6,"M"):r<1e12?this.an(t,1e-9,"G"):r<1e15?this.an(t,1e-12,"T"):r<1e18?this.an(t,1e-15,"P"):r<1e21?this.an(t,1e-18,"E"):r<1e24?this.an(t,1e-21,"Z"):this.an(t,1e-24,"Y")},n.prototype.toAbs=function(t,n,i){return Math.abs(t)},n.prototype.an=function(t,n,i){return"".concat((t*n).toFixed(this.precision)).concat(i)},n}(Kn),qn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toPrecision(this.precision)},n}(Kn),Qn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours())},t}(),$n=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours()%12)},t}(),ti=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMonth()+1)},t}(),ni=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMinutes())},t}(),ii=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMilliseconds())},t}(),ri=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(100*t|0,"%")},t}(),ei=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t,"%")},t}(),ui=function(){function t(t,n,i){this.length=t,this.character=n,this.node=i}return t.prototype.format=function(t,n,i){return on(this.node.format(t,n,i),this.length,this.character)},t}(),si=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"===r[0]?"(".concat(r.substring(1,r.length),")"):r},t}(),hi=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?"+".concat(r):r},t}(),oi=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(100*t),"%")},t}(),ai=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t),"%")},t}(),ci=function(){function t(t,n,i,r,e,u,s){this.Y=t,this.M=n,this.D=i,this.H=r,this.m=e,this.s=u,this.mi=s}return t.prototype.format=function(t,n,i){if(n<1e3)return"".concat(this.s.format(t,n,i),".").concat(this.mi.format(t,n,i));if(n<6e4)return"".concat(this.m.format(t,n,i),":").concat(this.s.format(t,n,i));if(n<36e5)return"".concat(this.H.format(t,n,i),":").concat(this.m.format(t,n,i));if(n<864e5){var r=this.M.format(t,n,i),e=this.D.format(t,n,i);return"".concat(r,"/").concat(e," ").concat(this.H.format(t,n,i))}return n<2592e6?"".concat(this.M.format(t,n,i),"/").concat(this.D.format(t,n,i)):"".concat(this.Y.format(t,n,i),"/").concat(this.M.format(t,n,i))},t}(),fi=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?" ".concat(r):r},t}(),li=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toAbs=function(t,n,i){return Math.abs(n)},n}(Zn),vi=function(){function t(t){this.str=t}return t.prototype.format=function(t,n,i){return this.str},t}(),bi=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear())},t}(),di=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear()%100)},t}(),gi=function(){function t(){}return t.prototype.format=function(t,n,i){var r=i.getTimezoneOffset(),e=r<=0?"+":"-",u=on(String(Math.floor(Math.abs(r)/60)),2,"0"),s=on(String(Math.floor(Math.abs(r)%60)),2,"0");return"".concat(e).concat(u,":").concat(s)},t}(),mi=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t))},t}(),wi=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getSeconds())},t}(),pi=void 0,Oi=function(t,n,i){switch(t){case"_":return new ui(n," ",i);case"-":return i;default:return new ui(n,"0",i)}},Di=function(t,n){switch(t){case"_":return new fi(n);case"+":return new hi(n);case"(":return new si(n);default:return n}},Ei=function(){function t(t){var n=function(t){for(var n=0,i=!1,r=[],e=function(){var t=pi;return t?t.lastIndex=0:pi=t=/%(0|_|-|\+|\()?(\.\d+)?(Y(?:MD?)?|y(?:MD?)?|MD?|D|H(?:ms?)?|h(?:ms?)?|m(?:i|s)?|a|A|s(?:s?i|dt)?|z|%|f(?:si)?|e|g|d|r(?:d|p)|p|P|RP)/g,t}();;){var u=e.exec(t);if(null==u){n<t.length&&r.push(new vi(t.substring(n,t.length)));break}var s=u.index;n<s&&r.push(new vi(t.substring(n,s))),n=s+u[0].length;var h=u[0],o=u[1],a=u[2];switch(u[3]){case"Y":i=!0,r.push(new bi);break;case"YM":i=!0,r.push(new bi,new vi("/"),Oi(o,2,new ti));break;case"YMD":i=!0,r.push(new bi,new vi("/"),Oi(o,2,new ti),new vi("/"),Oi(o,2,new Wn));break;case"y":i=!0,r.push(Oi(o,2,new di));break;case"yM":i=!0,r.push(Oi(o,2,new di),new vi("/"),Oi(o,2,new ti));break;case"yMD":r.push(Oi(o,2,new di),new vi("/"),Oi(o,2,new ti),new vi("/"),Oi(o,2,new Wn));break;case"M":i=!0,r.push(Oi(o,2,new ti));break;case"MD":i=!0,r.push(Oi(o,2,new ti),new vi("/"),Oi(o,2,new Wn));break;case"D":i=!0,r.push(Oi(o,2,new Wn));break;case"H":i=!0,r.push(Oi(o,2,new Qn));break;case"Hm":i=!0,r.push(Oi(o,2,new Qn),new vi(":"),Oi(o,2,new ni));break;case"Hms":i=!0,r.push(Oi(o,2,new Qn),new vi(":"),Oi(o,2,new ni),new vi(":"),Oi(o,2,new wi));break;case"h":i=!0,r.push(Oi(o,2,new $n));break;case"hm":i=!0,r.push(Oi(o,2,new $n),new vi(":"),Oi(o,2,new ni));break;case"hms":i=!0,r.push(Oi(o,2,new $n),new vi(":"),Oi(o,2,new ni),new vi(":"),Oi(o,2,new wi));break;case"m":i=!0,r.push(Oi(o,2,new ni));break;case"ms":i=!0,r.push(Oi(o,2,new ni),new vi(":"),Oi(o,2,new wi));break;case"mi":i=!0,r.push(Oi(o,3,new ii));break;case"a":i=!0,r.push(new Vn);break;case"A":i=!0,r.push(new zn);break;case"s":i=!0,r.push(Oi(o,2,new wi));break;case"sdt":i=!0,r.push(new ci(new bi,Oi(o,2,new ti),Oi(o,2,new Wn),Oi(o,2,new Qn),Oi(o,2,new ni),Oi(o,2,new wi),Oi(o,3,new ii)));break;case"z":i=!0,r.push(new gi);break;case"%":r.push(new vi("%"));break;case"f":r.push(Di(o,new Jn(a)));break;case"e":r.push(Di(o,new Yn(a)));break;case"g":r.push(Di(o,new qn(a)));break;case"rd":r.push(Di(o,new mi));break;case"d":r.push(Di(o,new Xn));break;case"P":r.push(Di(o,new ri));break;case"p":r.push(Di(o,new ei));break;case"RP":r.push(Di(o,new oi));break;case"rp":r.push(Di(o,new ai));break;case"fsi":r.push(Di(o,new Zn(a)));break;case"ssi":r.push(Di(o,new li(a)));break;default:r.push(new vi(h))}}return{nodes:r,date:i}}(t);this.date=n.date,this.nodes=n.nodes}return t.prototype.format=function(n,i){var r=this.nodes,e=t.DATE;null==e&&(e=new Date,t.DATE=e),this.date&&e.setTime(n);for(var u="",s=0,h=r.length;s<h;++s)u+=r[s].format(n,i,e);return u},t}(),Mi=function(){function t(){}return t.create=function(t){return new Ei(t)},t}(),Si=function(t){function n(n){var i=t.call(this,n,cn.TEXT)||this;return i.number=vn.ofNumber(n.value),i.formatters=new Map,i}return _(n,t),n.prototype.getFormatter=function(t,n){var i=this.formatters,r=n.text.value,e=i.get(r);return void 0===e&&(e=this.newFormatter(r),i.set(r,e)),e},n.prototype.newFormatter=function(t){return 0<(t=t.trim()).length?Mi.create(t):null},n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.number(t,i,ln),e=this.getFormatter(t,n);t.text.value=null!=e?e.format(r,0):String(r),n.written|=this.reset}},n}(dn),ji=function(t){function n(n){var i=t.call(this,n,cn.TEXT)||this;return i.text=vn.ofString(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,ln)&&(t.text.value=this.text(t,i,ln),n.written|=this.reset)},n}(dn),Ti={TEXT:0,NUMBER:1},Ni=function(t){function n(n,i,r){var e=t.call(this,Tn.CHANGE_TEXT,i,n)||this;return e.value=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.value===i.value},n.prototype.toRuntime=function(){switch(this.subtype){case Ti.TEXT:return new ji(this);case Ti.NUMBER:return new Si(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(3,t,i.resources);return new n(t[2],r,e)},n}(jn),Ii=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.background;r&&(this.S=r.color,this.j=r.alpha)}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBackgroundColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.j;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBackgroundAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.fn;null!=t&&t()},t}(),Ci={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_RIGHT:3,TOP_BOTTOM:5,TOP_LEFT:9,RIGHT_BOTTOM:6,RIGHT_LEFT:10,BOTTOM_LEFT:12,NOT_TOP:14,NOT_RIGHT:13,NOT_BOTTOM:11,NOT_LEFT:7,ALL:15},Ai=function(t,n){return Ot(t)?n[t]:t},Ri=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.border;r&&(this.S=r.color,this.j=r.alpha,this.kt=r.width,this.Lt=r.align,this.ln=Ai(r.mask,Ci))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.j;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.kt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Lt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Lt},set:function(t){this.Lt!==t&&(this.Lt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.ln;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.ln},set:function(t){this.ln!==t&&(this.ln=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.fn;null!=t&&t()},t}(),ki={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},Li=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.corner;r&&(pt(r)?(this.sn=r,this.ln=void 0):(this.sn=r.radius,this.ln=Ai(r.mask,ki)))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getRadius=function(){var t;return null!==(t=this.sn)&&void 0!==t?t:this.cn.getCornerRadius()},Object.defineProperty(t.prototype,"radius",{get:function(){return this.sn},set:function(t){if(this.sn!==t){this.sn=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(){var t;return null!==(t=this.ln)&&void 0!==t?t:this.cn.getCornerMask()},Object.defineProperty(t.prototype,"mask",{get:function(){return this.ln},set:function(t){if(this.ln!==t){this.ln=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;this.sn!==t&&(this.sn=t,i=!0),this.ln!==n&&(this.ln=n,i=!0);var r=this.fn;i&&null!=r&&r()},t}(),yi={NONE:0,SELF:1,CHILDREN:2,BOTH:3},xi=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.outline;r&&(this.S=r.color,this.j=r.alpha,this.kt=r.width,this.vn=r.offset,this.Lt=r.align,this.ln=Ai(r.mask,Ci))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){if(this.S!==t){this.S=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.j;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){if(this.j!==t){this.j=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.kt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){if(this.kt!==t){this.kt=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getOffset=function(t){var n=this.vn;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineOffset(t)},Object.defineProperty(t.prototype,"offset",{get:function(){return this.vn},set:function(t){if(this.vn!==t){this.vn=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Lt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Lt},set:function(t){if(this.Lt!==t){this.Lt=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.ln;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.ln},set:function(t){if(this.ln!==t){this.ln=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t}(),Bi=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.padding;null!=r&&(pt(r)?(this.bn=r,this.dn=r,this.gn=r,this.mn=r):(this.bn=r.left,this.dn=r.top,this.gn=r.right,this.mn=r.bottom))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getCallback=function(){return this.fn},t.prototype.getLeft=function(){var t;return null!==(t=this.bn)&&void 0!==t?t:this.cn.getPaddingLeft()},Object.defineProperty(t.prototype,"left",{get:function(){return this.bn},set:function(t){this.bn!==t&&(this.bn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){var t;return null!==(t=this.dn)&&void 0!==t?t:this.cn.getPaddingTop()},Object.defineProperty(t.prototype,"top",{get:function(){return this.dn},set:function(t){this.dn!==t&&(this.dn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){var t;return null!==(t=this.gn)&&void 0!==t?t:this.cn.getPaddingRight()},Object.defineProperty(t.prototype,"right",{get:function(){return this.gn},set:function(t){this.gn!==t&&(this.gn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){var t;return null!==(t=this.mn)&&void 0!==t?t:this.cn.getPaddingBottom()},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.mn},set:function(t){this.mn!==t&&(this.mn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r),null!=this.fn&&this.fn()},t}(),_i=function(){function t(t,n){this.wn=t,this.ut=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this.wn.x},set:function(t){var n=this.wn,i=n.x;if(i!==t){n.x=t;var r=n.y;this.ut(t,r,i,r)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.wn.y},set:function(t){var n=this.wn,i=n.y;if(i!==t){n.y=t;var r=n.x;this.ut(r,t,r,i)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=this.wn,r=i.x,e=i.y;return r===t&&e===n||(i.set(t,n),this.ut(t,n,r,e)),this},t.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.wn,e=r.x,u=r.y;return e===n&&u===i||(r.copyFrom(t),this.ut(n,i,e,u)),this},t.prototype.copyTo=function(t){return t.copyFrom(this.wn)},t.prototype.copy=function(){return this.copyFrom(arguments[0])},t.prototype.clone=function(n){return new t(this.wn,n||this.ut)},t.prototype.equals=function(t){return this.wn.equals(t)},t}(),Pi=function(t){function n(n,i,r){var e=t.call(this,n,i,r)||this;return e.kt=100,e.pn=100,e.On=0,e.Dn=ki.NONE,e.En=!0,e.Mn=1,e.Sn=e.getBuffer("aVertexPosition"),e.jn=e.Sn.data,e.Tn=e.getBuffer("aTextureCoord"),e._uvs=e.Tn.data,e.Nn=e.getIndex(),e.In=e.Nn.data,e}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.pn},set:function(t){this.pn!==t&&(this.pn=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerRadius",{get:function(){return this.On},set:function(t){this.On!==t&&(this.On=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerMask",{get:function(){return this.Dn},set:function(t){this.Dn!==t&&(this.Dn=t,this.En=!0)},enumerable:!1,configurable:!0}),n.prototype.getTables=function(){var t=n.TABLES;return null==t&&(t=this.newTables(n.N),n.TABLES=t),t},n.prototype.newTables=function(t){var n=1/(t-1)*.5;return[this.newTable(t,1,n),this.newTable(t,.5,n),this.newTable(t,0,n),this.newTable(t,1.5,n)]},n.prototype.newTable=function(t,n,i){for(var r=[],e=[],u=Math.PI,s=0,h=n;s<t;s+=1,h-=i){var o=h*u,a=+Math.cos(o),c=-Math.sin(o);r.push(a),e.push(c)}return{cos:r,sin:e}},n.N=4,n}(t.MeshGeometry),Fi=function(t){function n(){return t.call(this,new Float32Array(16*Pi.N),new Float32Array(16*Pi.N),new Uint16Array(3*(12*Pi.N-2)))||this}return _(n,t),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a){for(var c=a.cos,f=a.sin,l=c[0],v=f[0],b=c[e-1],d=f[e-1],g=0;g<e;++g){var m=c[g],w=f[g],p=o,O=m*l+w*v;1e-4<O&&(p=Math.min(p,(1/O-1)*h));var D=m*b+w*d;1e-4<D&&(p=Math.min(p,(1/D-1)*h));var E=h+p;t[++i]=u+m*h,t[++i]=s+w*h,t[++i]=u+m*E,t[++i]=s+w*E,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+m),n[++r]=.5*(1+w)}},n.prototype.fillIndices=function(t,n,i,r){for(var e=0;e<r;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2},n.prototype.fillIndicesEnd=function(t,n,i,r){for(var e=0,u=r-1;e<u;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2;t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=2},n.prototype.update=function(t){var n=t.resolution;if(this.En||this.Mn!==n){this.En=!1,this.Mn=n;var i=this.jn,r=this._uvs,e=this.In,u=this.kt,s=this.pn,h=Math.min(.5*u,.5*s,this.On),o=1/n,a=h,c=u-h,f=u,l=h,v=s-h,b=s,d=this.Dn,g=!(d&ki.TOP_LEFT),m=!(d&ki.TOP_RIGHT),w=!(d&ki.BOTTOM_LEFT),p=!(d&ki.BOTTOM_RIGHT),O=-1,D=-1,E=0,M=-1,S=Pi.N,j=S<<2,T=S<<1,N=6*S,I=this.getTables(),C=I[0],A=I[1],R=I[2],k=I[3];g?this.fillVertices(i,r,O,D,S,a,l,h,o,C):this.fillVertices(i,r,O,D,S,0,0,0,0,C),this.fillIndices(e,E,M,S),O+=j,D+=j,E+=T,M+=N,m?this.fillVertices(i,r,O,D,S,c,l,h,o,A):this.fillVertices(i,r,O,D,S,f,0,0,0,A),this.fillIndices(e,E,M,S),O+=j,D+=j,E+=T,M+=N,p?this.fillVertices(i,r,O,D,S,c,v,h,o,R):this.fillVertices(i,r,O,D,S,f,b,0,0,R),this.fillIndices(e,E,M,S),O+=j,D+=j,E+=T,M+=N,w?this.fillVertices(i,r,O,D,S,a,v,h,o,k):this.fillVertices(i,r,O,D,S,0,b,0,0,k),this.fillIndicesEnd(e,E,M,S),O+=j,D+=j,E+=T,M+=N,E=2;for(var L=1,y=4*S-1;L<y;L+=1,E+=2)e[++M]=0,e[++M]=E,e[++M]=E+2;this.Sn.update(),this.Tn.update(),this.Nn.update()}},n}(Pi),Ui=function(n){function i(i){var r=n.call(this,new Fi,new t.MeshMaterial(i))||this;return i.on("update",(function(){st.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Gi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Cn;return null==i&&((i=new Ui(n.getBackgroundTexture())).parent=t,this.Cn=i),i},t.prototype.hide=function(){var t=this.Cn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.background,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=this.get(t,r);c.tint=o,c.alpha=a,c.width=n,c.height=i,c.cornerRadius=u,c.cornerMask=s,c.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Cn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Cn)||void 0===t||t.updateTransform()},t}(),Hi=function(t){function n(){var n=t.call(this,new Float32Array(32*Pi.N),new Float32Array(32*Pi.N),new Uint16Array(72*Pi.N))||this;return n.An=0,n.Rn=Ci.NONE,n}return _(n,t),Object.defineProperty(n.prototype,"borderWidth",{get:function(){return this.An},set:function(t){this.An!==t&&(this.An=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"borderMask",{get:function(){return this.Rn},set:function(t){this.Rn!==t&&(this.Rn=t,this.En=!0)},enumerable:!1,configurable:!0}),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=.5*a,l=h-f,v=h+f,b=c.cos,d=c.sin,g=b[0],m=d[0],w=b[e-1],p=d[e-1],O=u+(g+w)*l,D=s+(m+p)*l,E=0;E<e;++E){var M=b[E],S=d[E],j=o,T=o,N=M*g+S*m;if(1e-4<N){var I=1/N-1;j=Math.min(j,I*l),T=Math.min(T,I*v)}var C=M*w+S*p;if(1e-4<C){var A=1/C-1;j=Math.min(j,A*l),T=Math.min(T,A*v)}var R=l+j,k=v+T;0<l?(t[++i]=u+M*l,t[++i]=s+S*l,t[++i]=u+M*R,t[++i]=s+S*R):(t[++i]=O,t[++i]=D,t[++i]=O,t[++i]=D),t[++i]=u+M*v,t[++i]=s+S*v,t[++i]=u+M*k,t[++i]=s+S*k,n[++r]=.5*(1+M),n[++r]=.5*(1+S),n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+M),n[++r]=.5*(1+S)}},n.prototype.fillIndices=function(t,n,i,r,e,u){for(var s=0,h=r-1;s<h;++s)t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2;e?u?(t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=1,t[++i]=1,t[++i]=n+1,t[++i]=2,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=2,t[++i]=2,t[++i]=n+1,t[++i]=3,n+=2):(t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2):(t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=2)},n.prototype.update=function(t){var n=t.resolution;if(this.En||this.Mn!==n){this.En=!1,this.Mn=n;var i=this.jn,r=this._uvs,e=this.In,u=this.kt,s=this.pn,h=this.An,o=Math.min(.5*u,.5*s,this.On),a=1/n,c=o,f=u-o,l=u,v=o,b=s-o,d=s,g=this.Rn,m=!(g&Ci.TOP),w=!(g&Ci.BOTTOM),p=!(g&Ci.LEFT),O=!(g&Ci.RIGHT),D=this.Dn,E=!(D&ki.TOP_LEFT),M=!(D&ki.TOP_RIGHT),S=!(D&ki.BOTTOM_LEFT),j=!(D&ki.BOTTOM_RIGHT),T=-1,N=-1,I=0,C=-1,A=Pi.N,R=A<<2,k=A<<3,L=18*A,y=this.getTables(),x=y[0],B=y[1],_=y[2],P=y[3];E?p||m?this.fillVertices(i,r,T,N,A,c,v,o,a,h,x):this.fillVertices(i,r,T,N,A,c,v,o,0,0,x):p||m?this.fillVertices(i,r,T,N,A,0,0,0,0,h,x):this.fillVertices(i,r,T,N,A,0,0,0,0,0,x),this.fillIndices(e,I,C,A,m,!1),T+=k,N+=k,I+=R,C+=L,M?m||O?this.fillVertices(i,r,T,N,A,f,v,o,a,h,B):this.fillVertices(i,r,T,N,A,f,v,o,0,0,B):m||O?this.fillVertices(i,r,T,N,A,l,0,0,0,h,B):this.fillVertices(i,r,T,N,A,l,0,0,0,0,B),this.fillIndices(e,I,C,A,O,!1),T+=k,N+=k,I+=R,C+=L,j?O||w?this.fillVertices(i,r,T,N,A,f,b,o,a,h,_):this.fillVertices(i,r,T,N,A,f,b,o,0,0,_):O||w?this.fillVertices(i,r,T,N,A,l,d,0,0,h,_):this.fillVertices(i,r,T,N,A,l,d,0,0,0,_),this.fillIndices(e,I,C,A,w,!1),T+=k,N+=k,I+=R,C+=L,S?w||p?this.fillVertices(i,r,T,N,A,c,b,o,a,h,P):this.fillVertices(i,r,T,N,A,c,b,o,0,0,P):w||p?this.fillVertices(i,r,T,N,A,0,d,0,0,h,P):this.fillVertices(i,r,T,N,A,0,d,0,0,0,P),this.fillIndices(e,I,C,A,p,!0),T+=k,N+=k,I+=R,C+=L,this.Sn.update(),this.Tn.update(),this.Nn.update()}},n}(Pi),zi=function(n){function i(i){var r=n.call(this,new Hi,new t.MeshMaterial(i))||this;return i.on("update",(function(){st.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderWidth",{get:function(){return this.geometry.borderWidth},set:function(t){this.geometry.borderWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderMask",{get:function(){return this.geometry.borderMask},set:function(t){this.geometry.borderMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Vi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Cn;return null==i&&((i=new zi(n.getBorderTexture())).parent=t,this.Cn=i),i},t.prototype.hide=function(){var t=this.Cn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.border,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Cn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Cn)||void 0===t||t.updateTransform()},t}(),Wi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Cn;return null==i&&((i=new zi(n.getBorderTexture())).parent=t,this.Cn=i),i},t.prototype.hide=function(){var t=this.Cn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.outline,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=h.getOffset(e)+(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Cn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Cn)||void 0===t||t.updateTransform()},t}(),Xi=function(){function t(t){var n=new Gi;this.kn=n,t.snippet.add(n,!0);var i=new Vi;this.Ln=i,t.snippet.add(i,!0);var r=new Wi;this.yn=r,t.snippet.add(r,!1),t.reflowable.add(this)}return t.prototype.onReflow=function(t,n,i){var r=t.theme,e=t.state,u=t.corner,s=u.getRadius(),h=u.getMask();this.kn.onReflow(t,n,i,r,e,s,h),this.Ln.onReflow(t,n,i,r,e,s,h),this.yn.onReflow(t,n,i,r,e,s,h)},t}(),Ki={NONE:0,BEFORE:1,AFTER:2,BOTH:3},Yi={OPEN:0,CLOSE:1,PARENSESIS:2,ADD_OR_PLUS:3,SUB_OR_MINUS:4,PLUS:5,MINUS:6,ADD:7,SUB:8,MUL:9,DIV:10,MIN:11,MAX:12,COMMA:13,PARENT:14,SELF:15,PADDING:16,CURRENT:17,NUMBER:18},Ji=function(){function t(t){var n=this.toToken(t),i=0;do{i=this.toParensesis(n,i)}while(i<n.length);if(this.toUnary(n),this.toArithmetic(n,Yi.MUL,Yi.DIV),this.toArithmetic(n,Yi.ADD,Yi.SUB),1===n.length){var r=n[0];if(!pt(r))return void(this.xn=r)}throw new Error("Failed to parse '".concat(t,"'"))}return t.prototype.toParensesis=function(t,n){for(var i=t.length,r=n;r<i;++r)if(t[r]===Yi.OPEN){var e=r,u=Yi.PARENSESIS;if(0<r){var s=t[r-1];s!==Yi.MIN&&s!==Yi.MAX||(e-=1,u=s)}for(var h=r+1;h<i;++h){var o=t[h];if(o===Yi.CLOSE)return t[e]=[u,this.toComma(t,r+1,h)],t.splice(e+1,h-e),e+1;o===Yi.OPEN&&(h=this.toParensesis(t,h)-1,i=t.length)}throw new Error("Malformed parensesis")}return i},t.prototype.toCommaOf=function(t,n,i){var r=i-n;if(r<=0)return[Yi.NUMBER,0];if(r<=1)return t[n];for(var e=[],u=n;u<i;++u)e.push(t[u]);return[Yi.PARENSESIS,e]},t.prototype.toComma=function(t,n,i){for(var r=null,e=n,u=n;u<i;++u)t[u]===Yi.COMMA&&((r=r||[]).push(this.toCommaOf(t,e,u)),e=u+1);if(e<i){if(null==r){var s=[];for(u=e;u<i;++u)s.push(t[u]);return s}r.push(this.toCommaOf(t,e,i))}return r||[]},t.prototype.toUnaryNode=function(t){pt(t)||t[0]!==Yi.PARENSESIS&&t[0]!==Yi.MIN&&t[0]!==Yi.MAX||this.toUnary(t[1])},t.prototype.toUnary=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r===Yi.ADD_OR_PLUS||r===Yi.SUB_OR_MINUS)if(n<=0||pt(t[n-1])){if(!(n+1<i)||pt(t[n+1]))throw new Error("Malformed unary operator");var e=t.splice(n+1,1)[0],u=r===Yi.ADD_OR_PLUS?Yi.PLUS:Yi.MINUS;t[n]=[u,e],i=t.length,this.toUnaryNode(e)}else u=r===Yi.ADD_OR_PLUS?Yi.ADD:Yi.SUB,t[n]=u;else this.toUnaryNode(r),i=t.length}},t.prototype.toArithmeticNode=function(t,n,i){pt(t)||(t[0]===Yi.PARENSESIS||t[0]===Yi.MIN||t[0]===Yi.MAX?this.toArithmetic(t[1],n,i):t[0]===Yi.PLUS||t[0]===Yi.MINUS?this.toArithmeticNode(t[1],n,i):t[0]!==Yi.ADD&&t[0]!==Yi.SUB&&t[0]!==Yi.MUL&&t[0]!==Yi.DIV||(this.toArithmeticNode(t[1],n,i),this.toArithmeticNode(t[2],n,i)))},t.prototype.toArithmetic=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(u===n||u===i){if(0<r&&r+1<e){var s=t[r-1],h=t[r+1];if(!pt(s)&&!pt(h)){t.splice(r,2),t[r-1]=[u,s,h],r-=1,e=t.length,this.toArithmeticNode(s,n,i),this.toArithmeticNode(h,n,i);continue}}throw new Error("Malformed operands for the operator ".concat(u))}this.toArithmeticNode(u,n,i),e=t.length}},t.prototype.toToken=function(n){for(var i=[];;){var r=t.TOKEN_REGEX.exec(n);if(null==r)break;var e=r[0],u=this.toTokenOperator(e);if(null!=u)i.push(u);else{var s=parseFloat(e);if(s!=s)throw new Error("Unexpected token '".concat(e,"' at ").concat(r.index," in '").concat(n,"'"));var h=this.toTokenLiteral(e);null!=h?i.push([h,.01*s]):i.push([Yi.NUMBER,s])}}return i},t.prototype.toTokenOperator=function(t){switch(t){case"+":return Yi.ADD_OR_PLUS;case"-":return Yi.SUB_OR_MINUS;case"*":return Yi.MUL;case"/":return Yi.DIV;case"(":return Yi.OPEN;case")":return Yi.CLOSE;case",":return Yi.COMMA;case"min":return Yi.MIN;case"max":return Yi.MAX}return null},t.prototype.toTokenLiteral=function(t){var n=t.length;if(0<n)switch(t[n-1]){case"%":return Yi.PARENT;case"s":return Yi.SELF;case"p":return Yi.PADDING;case"c":return Yi.CURRENT}return null},t.prototype.evaluate=function(t,n,i,r,e){switch(t[0]){case Yi.PARENSESIS:var u=t[1];return this.evaluate(u[u.length-1],n,i,r,e);case Yi.PLUS:return+this.evaluate(t[1],n,i,r,e);case Yi.MINUS:return-this.evaluate(t[1],n,i,r,e);case Yi.ADD:return this.evaluate(t[1],n,i,r,e)+this.evaluate(t[2],n,i,r,e);case Yi.SUB:return this.evaluate(t[1],n,i,r,e)-this.evaluate(t[2],n,i,r,e);case Yi.MUL:return this.evaluate(t[1],n,i,r,e)*this.evaluate(t[2],n,i,r,e);case Yi.DIV:return this.evaluate(t[1],n,i,r,e)/this.evaluate(t[2],n,i,r,e);case Yi.MIN:if(0<t[1].length){for(var s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.min(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Yi.MAX:if(0<t[1].length){for(s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.max(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Yi.PARENT:return t[1]*n;case Yi.SELF:return t[1]*i;case Yi.PADDING:return t[1]*r;case Yi.CURRENT:return t[1]*e;case Yi.NUMBER:return t[1]}return 0},t.prototype.calculate=function(t,n,i,r){return this.evaluate(this.xn,t,n,i,r)},t.TOKEN_REGEX=/(?:\+|-|\*|\/|\(|\)|min|max|,|(?:\d+(?:\.\d*)?[%psc]?))/g,t}(),Zi=function(t,n){return.5*(t-n)},qi=function(t,n,i){return i},Qi=function(t){return t},$i=function(t,n,i){return t-i},tr=function(){function t(){}return t.position=function(t){if(null==t||pt(t))return null;if(Ot(t)){switch(t){case"center":case"CENTER":return Zi;case"padding":case"PADDING":return qi}var n=new Ji(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(wt(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t.size=function(t){if(null==t||pt(t))return null;if(Ot(t)){switch(t){case"100%":case"maximized":case"MAXIMIZED":return Qi;case"padding":case"PADDING":return $i}var n=new Ji(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(wt(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t}(),nr=function(){function t(){}return t.isActivateKey=function(t){return"Space"===t.key||"Enter"===t.key||32===t.which||13===t.which},t.isArrowUpKey=function(t){return"ArrowUp"===t.key||38===t.which},t.isArrowDownKey=function(t){return"ArrowDown"===t.key||40===t.which},t.isArrowLeftKey=function(t){return"ArrowLeft"===t.key||37===t.which},t.isArrowRightKey=function(t){return"ArrowRight"===t.key||39===t.which},t.isCancelKey=function(t){return"Esc"===t.key||27===t.which},t.isFocusKey=function(t){return"Tab"===t.key||9===t.which},t.isUndoKey=function(t){return t.ctrlKey&&("z"===t.key||90===t.which)},t.isRedoKey=function(t){return t.ctrlKey&&("y"===t.key||89===t.which)},t.isSaveKey=function(t){return t.ctrlKey&&!t.shiftKey&&("s"===t.key||83===t.which)},t.isSaveAsKey=function(t){return t.ctrlKey&&t.shiftKey&&("S"===t.key||83===t.which)},t.isDeleteKey=function(t){return"Delete"===t.key||46===t.which},t.isSelectAllKey=function(t){return t.ctrlKey&&!t.shiftKey&&("a"===t.key||65===t.which)},t.isOkKey=function(t){return"Enter"===t.key||13===t.which},t.getFocusDirection=function(t){return!0!==t.shiftKey},t.toShortcut=function(t){if(Ot(t)){var n,i=t,r=i.indexOf("->"),e=void 0;0<=r?(e=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+2).trim()):e=i.trim().toLowerCase();for(var u=!1,s=!1,h=!1,o="a",a=e.length,c=0,f=1;f<a;++f)if("+"===e.charAt(f)){var l=e.substring(c,f);switch(l){case"alt":u=!0;break;case"ctrl":s=!0;break;case"shift":h=!0;break;default:o=l}c=f+=1}return c!==f&&(o=e.substring(c,f)),function(t){var n=t.key;if(n.length<=1){t.shift&&(t.key=n.toUpperCase());var i=n.charCodeAt(0);t.which=97<=i&&i<=122?i-32:i}else switch(n){case"enter":t.key="Enter",t.which=13;break;case"space":t.key=" ",t.which=32;break;case"escape":t.key="Escape",t.which=27;break;case"f1":t.key="F1",t.which=112;break;case"f2":t.key="F2",t.which=113;break;case"f3":t.key="F3",t.which=114;break;case"f4":t.key="F4",t.which=115;break;case"f5":t.key="F5",t.which=116;break;case"f6":t.key="F6",t.which=117;break;case"f7":t.key="F7",t.which=118;break;case"f8":t.key="F8",t.which=119;break;case"f9":t.key="F9",t.which=120;break;case"f10":t.key="F10",t.which=121;break;case"f11":t.key="F11",t.which=122;break;case"f12":t.key="F12",t.which=123;break;case"capslock":t.key="CapsLock",t.shift?t.which=20:t.which=240;break;case"arrowup":t.key="ArrowUp",t.which=38;break;case"arrowdown":t.key="ArrowDown",t.which=40;break;case"arrowleft":t.key="ArrowLeft",t.which=37;break;case"arrowright":t.key="ArrowRight",t.which=39;break;case"insert":t.key="Insert",t.which=45;break;case"delete":t.key="Delete",t.which=46;break;case"pageup":t.key="PageUp",t.which=33;break;case"pagedown":t.key="PageDown",t.which=34;break;case"backspace":t.key="Backspace",t.which=8;break;case"colon":t.key=":",t.which=186;break;case"semicolon":t.key=";",t.which=187;break;case"pause":t.key="Pause",t.which=19;break;case"scrolllock":t.key="ScrollLock",t.which=145;break;case"tab":t.key="Tab",t.which=9;break;case"plus":t.key="+",t.which=187;break;case"minus":t.key="-",t.which=189}return t}({alt:u,ctrl:s,shift:h,key:o,which:0,event:n})}return t},t.toString=function(t){var n=[];return t.ctrl&&n.push("Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),n.push(t.key.toUpperCase()),n.join("+")},t.on=function(t,n,i){var r=this.toShortcut(n);document.body.addEventListener("keydown",(function(n){n.altKey!==r.alt||n.ctrlKey!==r.ctrl||n.shiftKey!==r.shift||n.key!==r.key&&n.which!==r.which||(t.state.isActionable&&(null!=r.event?t.emit(r.event):null!=i&&i(n)),n.preventDefault())}))},t.moveFocusVertically=function(n,i,r){if(i.state.isActionable){var e=t.isArrowUpKey(n),u=t.isArrowDownKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocusHorizontally=function(n,i,r){if(i.state.isActionable){var e=t.isArrowLeftKey(n),u=t.isArrowRightKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocus=function(t,n,i){var r,e=null!==(r=null==i?void 0:i.picked)&&void 0!==r?r:st.getLayer(n);if(e){var u=e.getFocusController(),s=u.get();if(null!=s){var h=u.find(s,!1,s.state.isFocusRoot||t,t,n);if(null!=h)return u.focus(h),!0}}return!1},t}(),ir=function(){function t(){}return Object.defineProperty(t,"touchable",{get:function(){return"ontouchstart"in document},enumerable:!1,configurable:!0}),Object.defineProperty(t,"tap",{get:function(){return"pointertap"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"down",{get:function(){return"pointerdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"enter",{get:function(){return"pointerenter"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"leave",{get:function(){return"pointerleave"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"move",{get:function(){return"pointermove"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"out",{get:function(){return"pointerout"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"over",{get:function(){return"pointerover"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"up",{get:function(){return"pointerup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"upoutside",{get:function(){return"pointerupoutside"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cancel",{get:function(){return"pointercancel"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"righttap",{get:function(){return"rightclick"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightdown",{get:function(){return"rightdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightup",{get:function(){return"rightup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightupoutside",{get:function(){return"rightupoutside"},enumerable:!1,configurable:!0}),t.toGlobal=function(t,n,i){if("touches"in t){var r=t.changedTouches,e=r[r.length-1];null!=e?n.mapPositionToPoint(i,e.clientX,e.clientY):n.mapPositionToPoint(i,0,0)}else n.mapPositionToPoint(i,t.clientX,t.clientY);return i},t.onDblClick=function(t,n){var i=this;if(t.addEventListener("dblclick",(function(t){return n(t,!1)})),this.touchable){var r=0,e=0,u=0,s=0;t.addEventListener("touchstart",(function(t){if(0===r||2===r){var n=t.touches,i=n.length;if(i<=0)r=0;else{var s=n.item(i-1);null!=s?(r+=1,e=s.clientX,u=s.clientY):r=0}}else r=0})),t.addEventListener("touchend",(function(t){if(1===r||3===r){var h=t.changedTouches,o=h.length;if(o<=0)r=0;else{var a=h[o-1];if(null!=a){var c=e-a.clientX,f=u-a.clientY;i.CLICK_DISTANCE_THRESHOLD<=Math.abs(c)+Math.abs(f)?r=0:1===r?(s=t.timeStamp,r=2):t.timeStamp-s<i.DBLCLICK_INTERVAL_THRESHOLD?(r=0,n(t,!0)):(s=t.timeStamp,r=2)}else r=0}}else r=0})),t.addEventListener("touchcancel",(function(){r=0}))}},t.contains=function(t,n){for(var i=n;null!=i&&i!==t;)i=i.parent;return i===t},t.CLICK_DISTANCE_THRESHOLD=10,t.DBLCLICK_INTERVAL_THRESHOLD=333,t.LONG_CLICK_THRESHOLD=750,t}(),rr=function(){function t(){this.Bn=!1}return Object.defineProperty(t.prototype,"isOff",{get:function(){return!this.Bn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOn",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),t.prototype.toCoordinate=function(t){return this.Bn?"auto":t},t.prototype.from=function(t){return"auto"===t||"AUTO"===t?(this.Bn=!0,!0):(this.Bn=!1,!1)},t}(),er=function(){this.width=new rr,this.height=new rr},ur=function(){function t(t){this.p=t,this._n=[],this.Pn=[],this.Fn=!0}return Object.defineProperty(t.prototype,"renderable",{get:function(){return this.Fn},set:function(t){this.Fn=t},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){(n?this._n:this.Pn).push(t),"parent"in t&&(t.parent=this.p)},t.prototype.addAt=function(t,n,i){var r=n?this._n:this.Pn;0===i?r.unshift(t):0<i&&i<r.length?r.splice(i,0,t):r.push(t),"parent"in t&&(t.parent=this.p)},t.prototype.remove=function(t,n){var i=n?this._n:this.Pn,r=i.indexOf(t);0<=r&&(i.splice(r,1),"parent"in t&&(t.parent=null))},t.prototype.render=function(t,n){if(this.Fn)for(var i=n?this._n:this.Pn,r=0,e=i.length;r<e;++r){var u=i[r];u.updateTransform(),u.render(t)}},t}(),sr=function(){function t(){this.Un=[]}return t.prototype.add=function(t){this.Un.push(t)},t.prototype.remove=function(t){var n=this.Un,i=n.indexOf(t);0<=i&&n.splice(i,1)},t.prototype.onReflow=function(t,n,i){for(var r=this.Un,e=0,u=r.length;e<u;++e)r[e].onReflow(t,n,i)},t}(),hr=function(n){function i(t){var r,e,u,s,h,o,a,c,f,l=this,v=(l=n.call(this)||this).transform;l._=new _i(v.position,(function(t,n,i,r){l.onMove(t,n,i,r)})),l.Gn=new _i(v.scale,(function(t,n,i,r){l.onScale(t,n,i,r)})),l.Hn=new _i(v.skew,(function(t,n,i,r){l.onSkew(t,n,i,r)})),l.zn=t;var b=l.Vn={};l.Wn=new er,l.En=!0,l.Xn=!1,l.Kn=!1,l.Yn=null,l.name=null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"";var d=function(t){var n=null==t?void 0:t.theme;if(n)return Ot(n)?Z.getInstance().get(n):n}(t)||l.getThemeDefault();l.cn=d,l.Jn=new ur(l),l.Zn=new sr,l.qn=Ai(null!==(e=null==t?void 0:t.clear)&&void 0!==e?e:d.getClearType(),Ki),l.Qn=new Bi(d,t,(function(){l.toParentResized(),l.toHierarchyDirty(),st.update(l)}));var g=function(){l.toDirty(),st.update(l)};l.kn=new Ii(d,t,g),l.Ln=new Ri(d,t,g),l.yn=new xi(d,t,g),l.hn=new Li(d,t,g);var m=v.position,w=null!==(u=null==t?void 0:t.x)&&void 0!==u?u:d.getX();pt(w)?m.x=w:(m.x=0,b.x=tr.position(w));var p=null!==(s=null==t?void 0:t.y)&&void 0!==s?s:d.getY();pt(p)?m.y=p:(m.y=0,b.y=tr.position(p));var O=null!==(h=null==t?void 0:t.width)&&void 0!==h?h:d.getWidth();l.Wn.width.from(O)?l.kt=100:pt(O)?l.kt=O:(l.kt=100,b.width=tr.size(O));var D=null!==(o=null==t?void 0:t.height)&&void 0!==o?o:d.getHeight();if(l.Wn.height.from(D)?l.pn=100:pt(D)?l.pn=D:(l.pn=100,b.height=tr.size(D)),null!=t){var E=t.visible;null!=E&&(l.visible=E)}if(null!=t){var M=t.renderable;null!=M&&(l.renderable=M)}l.Rt=new Et((function(t,n){l.onStateChange(t,n)}));var S,j=Ai(null!==(a=null==t?void 0:t.interactive)&&void 0!==a?a:d.getInteractive(),yi);if(l.interactive=!!(j&yi.SELF),l.interactiveChildren=!!(j&yi.CHILDREN),null!=t){var T=t.on;if(null!=T)for(var N in T){var I=T[N];I&&l.on(N,I)}}if(l.$n=null!==(c=null==t?void 0:t.title)&&void 0!==c?c:d.getTitle(),l.nn=null!==(f=null==t?void 0:t.weight)&&void 0!==f?f:d.getWeight(),l.initReflowable(),l.ti=function(){st.update(l)},null!=t&&(S=t.shadow),void 0===S&&(S=d.getShadow()),S)if(Ot(S))switch(S){case"WEAK":l.shadow=d.newShadowWeak();break;case"DEFAULT":l.shadow=d.newShadow()}else l.shadow=S;l.on(ir.over,(function(t){l.onOver(t)})),l.on(ir.out,(function(t){l.onOut(t)})),l.on(ir.down,(function(t){l.onDown(t)})),l.on(ir.up,(function(t){l.onUp(t)})),l.on("added",(function(){l.toParentResized(),(l.isDirty()||l.hasDirty())&&l.toParentHasDirty(),l.Kn&&l.toParentHierarchyDirty();var t=l.parent;t instanceof i&&(l.state.parent=t.state),st.update(l)})),l.on("removed",(function(){l.blur(!0),l.state.parent=null,st.update(l)}));var C,A=function(t){if(t){var n=t.shortcut,i=t.shortcuts;if(null!=i||null!=n){var r=[];if(null!=n&&r.push(nr.toShortcut(n)),null!=i)for(var e=0,u=i.length;e<u;++e)r.push(nr.toShortcut(i[e]));return r}}}(t);if(l.ni=A,null!=A)for(var R=function(t){l.onShortcut(t)},k=0,L=A.length;k<L;++k)nr.on(l,A[k],R);if(l.init(t),d.newState(l.Rt),null!=t){var y=t.state;if(null!=y){var x=l.Rt;if(Ot(y))x.add(y);else if(mt(y))x.addAll(y);else{var B=y.values;null!=B&&(Ot(B)?x.add(B):x.addAll(B));var _=y.blinkers;if(null!=_){var P=x.blinker;for(k=0,L=_.length;k<L;++k){var F=_[k];P.add(F.state,F.interval)}}var U=y.tickers;if(null!=U){var G=x.ticker;for(k=0,L=U.length;k<L;++k){var H=U[k];G.add(H.state,H.interval)}}}}}if(null!=t){var z=t.parent;null!=z&&z.addChild(l)}if(null!=t){var V=t.children;if(null!=V)for(k=0,L=V.length;k<L;++k){var W=V[k];null!=W&&l.addChild(W)}}return null!=t&&(C=t.cursor,l.ii=C),l.cursor=l.toCursor(C,l.Rt),l.emit("init",l),l}return _(i,n),i.prototype.toCursor=function(t,n){if(t)if(wt(t)){var i=t(n);if(void 0!==i)return i}else if(void 0!==t)return t;return this.theme.getCursor(n)},Object.defineProperty(i.prototype,"snippet",{get:function(){return this.Jn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"reflowable",{get:function(){return this.Zn},enumerable:!1,configurable:!0}),i.prototype.initReflowable=function(){new Xi(this)},i.prototype.onChildrenChange=function(){this.toHierarchyDirty(),n.prototype.onChildrenChange.call(this)},i.prototype.onShortcut=function(t){this.emit("shortcut",t,this)},i.prototype.init=function(t){},Object.defineProperty(i.prototype,"weight",{get:function(){return this.nn},enumerable:!1,configurable:!0}),i.prototype.onMove=function(t,n,r,e){for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof i&&o.onParentMove(t,n,r,e)}st.update(this),this.emit("move",t,n,r,e,this)},i.prototype.resize=function(t,n){var i=this.kt,r=this.pn,e=null!=t?t:i,u=null!=n?n:r,s=i!==e,h=r!==u;s&&(this.kt=e),h&&(this.pn=u);var o,a=s||h;if(a&&this.onResize(e,u,i,r),s&&null!=(o=this.Vn).x){var c=this._,f=this.getParentOfSize();f&&(this._.x=o.x(f.width,e,f.padding.getLeft(),c.x))}if(h&&null!=(o=this.Vn).y){c=this._;var l=this.getParentOfSize();l&&(this._.y=o.y(l.height,u,l.padding.getTop(),c.y))}return a},i.prototype.getClearType=function(){return this.qn},i.prototype.onResize=function(t,n,r,e){this.toDirty(),this.toHierarchyDirty();for(var u=this.Qn,s=this.children,h=0,o=s.length;h<o;++h){var a=s[h];a instanceof i&&a.onParentResize(t,n,u)}st.update(this),this.emit("resize",t,n,r,e,this)},i.prototype.onScale=function(t,n,i,r){st.update(this),this.emit("scale",t,n,i,r,this)},i.prototype.onSkew=function(t,n,i,r){st.update(this),this.emit("skew",t,n,i,r,this)},Object.defineProperty(i.prototype,"type",{get:function(){return this.getType()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"x",{get:function(){return this._.x},set:function(t){this.setX(t)},enumerable:!1,configurable:!0}),i.prototype.getX=function(){var t=this.Vn;return null!=t.x?t.x:this._.x},i.prototype.setX=function(t){var n=this.Vn;if(pt(t)){var i=this._;i.x!==t?(n.x=void 0,i.x=t):void 0!==n.x&&(n.x=void 0,this.toParentResized())}else{var r=tr.position(t);n.x!==r&&(n.x=r,this.toParentResized())}},Object.defineProperty(i.prototype,"y",{get:function(){return this._.y},set:function(t){this.setY(t)},enumerable:!1,configurable:!0}),i.prototype.getY=function(){var t=this.Vn;return null!=t.y?t.y:this._.y},i.prototype.setY=function(t){var n=this.Vn;if(pt(t)){var i=this._;i.y!==t?(n.y=void 0,i.y=t):void 0!==n.y&&(n.y=void 0,this.toParentResized())}else{var r=tr.position(t);n.y!==r&&(n.y=r,this.toParentResized())}},Object.defineProperty(i.prototype,"width",{get:function(){return this.kt},set:function(t){this.setWidth(t)},enumerable:!1,configurable:!0}),i.prototype.getWidth=function(){return this.Wn.width.toCoordinate(this.Vn.width||this.kt)},i.prototype.setWidth=function(t){var n=this.Wn.width,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),st.update(this)),!r){var e=this.Vn;if(pt(t)){var u=this.kt;if(u!==t){e.width=void 0,this.kt=t;var s=this.pn;if(this.onResize(t,s,u,s),null!=e.x){var h=this._,o=this.getParentOfSize();o&&(h.x=e.x(o.width,t,o.padding.getLeft(),h.x))}}else void 0!==e.width&&(e.width=void 0,this.toParentResized())}else{var a=tr.size(t);e.width!==a&&(e.width=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"height",{get:function(){return this.pn},set:function(t){this.setHeight(t)},enumerable:!1,configurable:!0}),i.prototype.getHeight=function(){return this.Wn.height.toCoordinate(this.Vn.height||this.pn)},i.prototype.setHeight=function(t){var n=this.Wn.height,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),st.update(this)),!r){var e=this.Vn;if(pt(t)){var u=this.pn;if(u!==t){e.height=void 0,this.pn=t;var s=this.kt;if(this.onResize(s,t,s,u),null!=e.y){var h=this._,o=this.getParentOfSize();o&&(h.y=e.y(o.height,t,o.padding.getTop(),h.y))}}else void 0!==e.height&&(e.height=void 0,this.toParentResized())}else{var a=tr.size(t);e.height!==a&&(e.height=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Gn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"skew",{get:function(){return this.Hn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Qn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"corner",{get:function(){return this.hn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"background",{get:function(){return this.kn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"border",{get:function(){return this.Ln},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outline",{get:function(){return this.yn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"unsafe",{get:function(){return this.transform},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this.$n},set:function(t){this.$n!==t&&(this.$n=t,this.state.isHovered&&this.applyTitle())},enumerable:!1,configurable:!0}),i.prototype.applyTitle=function(){var t=st.getLayer(this);t&&(t.view.title=this.$n)},i.prototype.show=function(){return this.visible||(this.visible=!0,this.toParentHierarchyDirty(),st.update(this)),this},i.prototype.isShown=function(){return this.visible},i.prototype.hide=function(){return this.visible&&(this.visible=!1,this.toParentHierarchyDirty(),this.blur(!0),st.update(this)),this},i.prototype.isHidden=function(){return!this.visible},i.prototype.toDirty=function(){return!this.En&&(this.En=!0,this.toParentHasDirty(),!0)},i.prototype.toHasDirty=function(){return!this.Xn&&(this.Xn=!0,this.toParentHasDirty(),!0)},i.prototype.toParentHasDirty=function(){var t=this.parent;t instanceof i&&t.toHasDirty()},i.prototype.toHierarchyDirty=function(){return!this.Kn&&(this.Kn=!0,this.onHierarchyDirty(),this.toParentHierarchyDirty(),!0)},i.prototype.toParentHierarchyDirty=function(){var t=this.parent;t instanceof i&&t.toHierarchyDirty()},i.prototype.isHierarchyDirty=function(){return this.Kn},i.prototype.onHierarchyDirty=function(){},i.prototype.isDirty=function(){return this.En},i.prototype.hasDirty=function(){return this.Xn},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=st.getLayer(this);n&&n.getFocusController().set(this,t)}return this},i.prototype.focus=function(){return this.setFocused(!0)},i.prototype.blur=function(t){if(t){var n=st.getLayer(this);if(n){var r=n.getFocusController().get();if(r instanceof i)for(var e=r;e;){if(e===this){r.setFocused(!1);break}e=e.parent}}}else this.setFocused(!1);return this},i.prototype.onStateChange=function(t,n){var r=this;this.toDirty(),st.update(this),this.emit("statechange",t,n,this);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}t.isFocused?(n.isFocused||this.onFocus(),t.inDisabled&&!n.inDisabled&&setTimeout((function(){r.blur()}),0)):n.isFocused&&this.onBlur(),this.cursor=this.toCursor(this.ii,t)},i.prototype.onChildFocus=function(t){var n=this.parent;n instanceof i&&n.onChildFocus(t)},i.prototype.onFocus=function(){var t=this.parent;t instanceof i&&t.onChildFocus(this)},i.prototype.onChildBlur=function(t){var n=this.parent;n instanceof i&&n.onChildBlur(t)},i.prototype.onBlur=function(){var t=this.parent;t instanceof i&&t.onChildBlur(this)},Object.defineProperty(i.prototype,"state",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"options",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"theme",{get:function(){return this.cn},set:function(t){this.cn!==t&&(this.cn=t,this.Qn.setTheme(t),this.kn.setTheme(t),this.Ln.setTheme(t),this.yn.setTheme(t),this.hn.setTheme(t),this.toDirty(),st.update(this))},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){var t=this.En;t&&(this.onReflow(),this.En=!1);var n=this.Xn,r=this.Kn;if(n||r){this.Xn=!1,this.Kn=!1;for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.reflow()}}(t||n||r)&&this.onRefit()},i.prototype.onRefit=function(){var t=this.Wn,n=t.width.isOn,i=t.height.isOn;if(n&&i){for(var r=0,e=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&(this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width)),this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height)));var h=this.padding;this.resize(r+h.getRight(),e+h.getBottom())}else if(n){for(r=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width));this.resize(r+this.padding.getRight(),void 0)}else if(i){var o;for(e=0,u=0,s=(o=this.children).length;u<s;++u){var a;(a=o[u]).visible&&this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height))}this.resize(void 0,e+this.padding.getBottom())}},i.prototype.isRefitable=function(t){return t instanceof i},i.prototype.hasRefitableHeight=function(t){return this.isRefitable(t)&&!(t instanceof i&&wt(t.getHeight()))},i.prototype.hasRefitableWidth=function(t){return this.isRefitable(t)&&!(t instanceof i&&wt(t.getWidth()))},i.prototype.onReflow=function(){this.Zn.onReflow(this,this.kt,this.pn)},Object.defineProperty(i.prototype,"shadow",{get:function(){return this.Yn},set:function(t){var n=this.Yn;if(n!==t){var i=this.Zn,r=this.Jn,e=this.ti;null!=n&&(n.off("update",e),i.remove(n),r.remove(n,!0)),this.Yn=t,null!=t&&(t.on("update",e),i.add(t),r.addAt(t,!0,0)),st.update(this)}},enumerable:!1,configurable:!0}),i.prototype.toParentResized=function(){var t=this.getParentOfSize();t&&this.onParentResize(t.width,t.height,t.padding)},i.prototype.getParentOfSize=function(){var t=this.parent;return t instanceof i?t:st.getLayer(this)},i.prototype.onParentResize=function(t,n,i){var r=this.Vn,e=this.transform.position,u=e.x,s=e.y,h=this.kt,o=this.pn,a=i.getLeft()+i.getRight(),c=i.getTop()+i.getBottom(),f=null!=r.width?r.width(t,h,a,h):h,l=null!=r.height?r.height(n,o,c,o):o;this.resize(f,l);var v=null!=r.x?r.x(t,this.kt,i.getLeft(),u):u,b=null!=r.y?r.y(n,this.pn,i.getTop(),s):s;this.position.set(v,b)},i.prototype.onParentMove=function(t,n,i,r){},i.prototype.onWheel=function(t,n,i){return this.emit("wheel",t,n,i,this),!1},i.prototype.onKeyDown=function(t){return this.emit("keydown",t,this),!1},i.prototype.onKeyUp=function(t){return this.emit("keyup",t,this),!1},i.prototype.isEventTarget=function(t){var n=t.target;if(n===this)return!0;if(null!=n&&!(n instanceof i&&n.interactive)){for(var r=n.parent;null!=r&&!(r instanceof i&&r.interactive);)r=r.parent;return r===this}return!1},i.prototype.onDown=function(t){this.isEventTarget(t)&&this.onDownThis(t),this.emit("down",t,this)},i.prototype.onDownThis=function(n){if("touches"in n.data.originalEvent){var i=this.ri||new t.Point;this.ri=i,i.copyFrom(n.data.global)}else this.focusOnClosest()},i.prototype.onUp=function(t){this.isEventTarget(t)&&this.onUpThis(t),this.emit("up",t,this)},i.prototype.onUpThis=function(t){if("touches"in t.data.originalEvent){var n=this.ri;if(n){var i=t.data.global,r=Math.abs(i.x-n.x),e=Math.abs(i.y-n.y),u=ir.CLICK_DISTANCE_THRESHOLD;r<u&&e<u&&this.focusOnClosest()}}},i.prototype.focusOnClosest=function(){var t=st.getLayer(this);if(t){var n=t.getFocusController();n.focus(n.findParent(this))}},i.prototype.onOver=function(t){this.state.isHovered=!0,t.target===this&&this.applyTitle(),this.emit("over",t,this)},i.prototype.onOut=function(t){this.state.isHovered=!1,this.emit("out",t,this)},i.prototype.onDblClick=function(t,n){return this.emit("dblclick",t,n,this),!1},i.prototype.render=function(t){if(this.visible&&0<this.worldAlpha&&this.renderable){var i=this.Jn;i.render(t,!0),n.prototype.render.call(this,t),i.render(t,!1)}},i.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},i.prototype.getType=function(){return"DBase"},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,r=this._bounds,e=i.WORK_CONTAINS_POINT;e.set(0,0),t.apply(e,e),r.addPoint(e),e.set(this.kt,this.pn),t.apply(e,e),r.addPoint(e),n.prototype._calculateBounds.call(this)},i.prototype.containsPoint=function(t){return this.containsGlobalPoint(t)||this.containsLocalPoint(this.worldTransform.applyInverse(t,i.WORK_CONTAINS_POINT))},i.prototype.containsGlobalPoint=function(t){return!1},i.prototype.containsLocalPoint=function(t){var n=t.x,i=t.y,r=this.kt,e=this.pn;return 0<=n&&n<=r&&0<=i&&i<=e},i.prototype.getClippingRect=function(t,n){n.x=0,n.y=0,n.width=this.kt,n.height=this.pn},i.prototype.destroy=function(){var t=this.Vn;t.x=null,t.y=null,t.width=null,t.height=null;var i=this.Yn;i&&(this.Yn=null,i.destroy());for(var r=this.children,e=r.length-1;0<=e;--e)r[e].destroy();r.length=0,n.prototype.destroy.call(this)},i.WORK_CONTAINS_POINT=new t.Point,i}(t.Container),or=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){var r=t.corner,e=Math.max(0,r.getRadius()-.5),u=r.getMask(),s=u&ki.TOP_LEFT?0:e,h=u&ki.TOP_RIGHT?0:e,o=u&ki.BOTTOM_LEFT?0:e,a=u&ki.BOTTOM_RIGHT?0:e;this.clear(),this.beginFill(16777215,1),this.lineStyle(0,0,0,0,!1),s<=0&&h<=0&&o<=0&&a<=0?this.drawRect(0,0,n,i):(this.moveTo(0+s,0),0<h?this.arcTo(0+n,0,0+n,0+i,h):this.lineTo(0+n,0),0<a?this.arcTo(0+n,0+i,0,0+i,a):this.lineTo(0+n,0+i),0<o?this.arcTo(0,0+i,0,0,o):this.lineTo(0,0+i),0<s?this.arcTo(0,0,0+n,0,s):this.lineTo(0,0)),this.endFill()},n}(t.Graphics),ar={NONE:0,CTRL:1,SHIFT:2,ALT:4,AND:8,OR:16,NOT_NONE:23},cr=function(){function t(){}return t.from=function(t){var n="data"in t?t.data.originalEvent:t;return(n.ctrlKey?ar.CTRL:ar.NONE)|(n.altKey?ar.ALT:ar.NONE)|(n.shiftKey?ar.SHIFT:ar.NONE)},t.match=function(n,i){return i&ar.OR?!!(t.from(n)&i):t.from(n)===i},t}(),fr={OFF:0,ON:1,TOUCH:2},lr=function(){function n(){this.pointers=new Map,this.center=new t.Point,this.scale=0,this.time=0}return n.prototype.start=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.isUpdatable=function(t){var n=t.data.originalEvent;return!("pointerId"in n)||this.pointers.has(n.pointerId)},n.prototype.update=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.end=function(t){var n=!0,i=t.data.originalEvent;if("touches"in i)n=i.touches.length<=0;else if("pointerId"in i){var r=this.pointers;r.delete(i.pointerId),n=r.size<=0}return this.doUpdate(t),n},n.prototype.bind=function(t){var n=this.interactionManager;if(n){var i=this.onMove;i&&n.on(ir.move,i);var r=this.onEnd;r&&(n.on(ir.up,r),n.on(ir.upoutside,r),n.on(ir.cancel,r))}},n.prototype.unbind=function(){var t=this.interactionManager;if(t){var n=this.onMove;n&&t.off(ir.move,n);var i=this.onEnd;i&&(t.off(ir.up,i),t.off(ir.upoutside,i),t.off(ir.cancel,i))}},n.prototype.doUpdate=function(t){var n=this.interactionManager,i=this.center,r=t.data.originalEvent;if(this.scale=0,this.time=r.timeStamp,"touches"in r){var e=r.touches,u=e.length;if(0<u){for(var s=0,h=0,o=0,a=e.length;o<a;++o)s+=(f=e[o]).clientX,h+=f.clientY;if(s/=u,h/=u,n?n.mapPositionToPoint(i,s,h):i.set(s,h),1<u){var c=0;for(o=1,a=e.length;o<a;++o){var f,l=(f=e[o]).clientX-s,v=f.clientY-h;c=Math.max(c,l*l+v*v)}this.scale=Math.sqrt(c)}}}else if("pointerId"in r){var b=this.pointers,d=b.size;if(0<d){var g=0,m=0;if(b.forEach((function(t){g+=t.clientX,m+=t.clientY})),g/=d,m/=d,n?n.mapPositionToPoint(i,g,m):i.set(g,m),1<d){var w=0;b.forEach((function(t){var n=t.clientX-g,i=t.clientY-m;w=Math.max(w,n*n+i*i)})),this.scale=Math.sqrt(w)}}}else i.copyFrom(t.data.global)},n}(),vr=function(){function t(){}return t.LINEAR=function(t){return t},t.ELASTIC=function(t){return t*(3*(1-t)*(1-t)+t*(3*(1-t)+t))},t.QUAD_IN_OUT=function(t){return t<.5?2*t*t:(4-2*t)*t-1},t}(),br=function(t){function n(n){var i,r,e,u=this;(u=t.call(this)||this).R=null,u.ei=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,u.si=0,u.hi=null!==(r=null==n?void 0:n.duration)&&void 0!==r?r:200,u.oi=1/Math.max(1,u.hi),u.ai=!1,u.ci=null==n?void 0:n.onTime,u.fi=function(){u.onTimeBase()},u.li=null==n?void 0:n.onStart,u.vi=null==n?void 0:n.onEnd,u.bi=null!==(e=null==n?void 0:n.timing)&&void 0!==e?e:vr.ELASTIC;var s=null==n?void 0:n.on;if(s)for(var h in s){var o=s[h];o&&u.on(h,o)}return u}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.ei},set:function(t){this.ei=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return this.hi},set:function(t){this.hi=t,this.oi=1/Math.max(1,t)},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.si=Date.now(),this.ai=t,this.R=window.setTimeout(this.fi,0),this.onStart(t);var n=this.hi,i=this.toTime(t?n:0);this.onTime(i,t,0)},n.prototype.onStart=function(t){var n=this.li;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ci;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.vi;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return null!=this.R},n.prototype.isReverse=function(){return this.ai},n.prototype.onTimeBase=function(){if(null!=this.R){this.R=null;var t=Date.now()-this.si,n=this.hi,i=this.ai;if(t<n){this.R=window.setTimeout(this.fi,0);var r=this.toTime(i?n-t:t);this.onTime(r,i,t)}else r=this.toTime(i?0:n),this.onTime(r,i,t),this.onEnd(i)}},n.prototype.toTime=function(t){return this.bi(t*this.oi,this)},n.prototype.stop=function(){var t=this.R;null!=t&&(this.R=null,window.clearTimeout(t))},n.prototype.end=function(){var t=this.R;if(null!=t){this.R=null,window.clearTimeout(t);var n=this.ai,i=Date.now()-this.si,r=this.hi,e=this.toTime(n?0:r);this.onTime(e,n,i),this.onEnd(n)}},n}(t.utils.EventEmitter),dr=function(){function t(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r}return t.prototype.set=function(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r},t}(),gr=function(){function t(t,n,i){var r,e=this;this.di=[],this.gi=[],this.wi=0,this.pi=-1,this.Oi=0,this.Di=0,this.Ei=0,this.Mi=0,this.Si=0,this._t=0,this.ji=new br({onTime:function(t){e.onEase(t)},onEnd:function(){e.onEaseEnd()},timing:vr.LINEAR,duration:333*(null!==(r=null==i?void 0:i.duration)&&void 0!==r?r:1)}),this.Ti=t,this.vi=n}return t.prototype.onStart=function(){for(var n=this.di,i=n.length,r=t.HISTORY_CAPACITY;i<r;++i)n.push(new dr(0,0,1,0));this.wi=0,this.pi=-1,this.ji.stop()},t.prototype.onMove=function(n,i,r,e){var u=t.HISTORY_CAPACITY,s=this.pi,h=(s+1)%u;this.pi=h;var o=this.wi;(h<s||0<=s&&s<o)&&(this.wi=(o+1)%u),this.di[h].set(n,i,r,e)},t.prototype.updateHistoriesSorted=function(t){var n=this.di,i=this.gi,r=this.wi,e=this.pi,u=n.length;if(e<0)return i.length=0,t;if(e<r){var s=t;i.length=0;for(var h=e;0<=h;--h){var o=n[h];if(!(s+o.dt<160))return s;s+=o.dt,i.push(o)}for(h=u-1;r<=h;--h){var a=n[h];if(!(s+a.dt<160))return s;s+=a.dt,i.push(a)}return s}for(s=t,i.length=0,h=e;r<=h;--h){var c=n[h];if(!(s+c.dt<160))return s;s+=c.dt,i.push(c)}return s},t.prototype.onEnd=function(t){this.updateHistoriesSorted(t);var n=this.gi,i=n.length;if(i<=0)return this.onEaseEnd();for(var r=0,e=0,u=0,s=0,h=0;h<i;++h){var o=n[h];r+=o.dx,e+=o.dy,u+=o.ds,s+=o.dt}if(s<=0)return this.onEaseEnd();var a=1/i;r*=a,e*=a,u*=a,s*=a,this.Oi=r,this.Di=e,this.Ei=u,this.Mi=s;var c=this.ji,f=c.duration;this._t=-t/f,this.Si=f/s,c.start()},t.prototype.onEase=function(t){var n=this._t;this._t=t;var i=(1-.5*(t+n))*(t-n)*this.Si;this.Ti(this.Oi*i,this.Di*i,1+(this.Ei-1)*i,t)},t.prototype.onEaseEnd=function(){this.vi()},t.prototype.stop=function(){this.ji.stop()},t.HISTORY_CAPACITY=5,t}(),mr=function(){function t(t){var n,i,r,e=t.on;e&&(this.li=e.start,this.Ti=e.move,this.vi=e.end),this.Ni=null!==(n=null==t?void 0:t.modifier)&&void 0!==n?n:ar.NONE;var u=t.checker,s=cr.match;this.Ii=null!==(i=null==u?void 0:u.start)&&void 0!==i?i:s,this.Ci=null!==(r=null==u?void 0:u.move)&&void 0!==r?r:s,this.Ai=t.easing,this.Ri=!!t.touch,this.ki=[],this.Li=new Map;var h=t.bind;null!=h&&this.bind(h)}return t.prototype.newData=function(t){var n=this.Li,i=n.get(t);if(null!=i)return i;var r=this.ki.pop();if(null!=r)return n.set(t,r),r;var e=new lr;return e.easing=this.newEasing(e),e.onMove=this.newOnMove(e),e.onEnd=this.newOnEnd(e),n.set(t,e),e},t.prototype.newEasing=function(t){var n=this,i=this.Ai;if(null==i||!1!==i)return new gr((function(i,r,e,u){n.onEasingMove(i,r,e,u,t)}),(function(){n.onEasingEnd(t)}),this.toEasingOptions(i))},t.prototype.toEasingOptions=function(t){return null==t||!0===t?void 0:t},t.prototype.deleteData=function(t){var n=t.target;n&&this.Li.delete(n)&&(t.target=void 0,t.pointers.clear(),this.ki.push(t))},t.prototype.bind=function(t){var n=this;return t.on(ir.down,(function(i){n.onDown(t,i)})),this},t.prototype.isTouch=function(t){var n=t.data.originalEvent;return"touches"in n||"pointerId"in n&&"mouse"!==n.pointerType},t.prototype.onDown=function(t,n){var i;if((!this.Ri||this.isTouch(n))&&this.Ii(n,this.Ni,t)){var r=st.getLayer(t);if(null!=r)if(n.stopPropagation(),t.state.isGesturing)null===(i=this.Li.get(t))||void 0===i||i.start(n);else{var e=this.li;null!=e&&e(t);var u=this.newData(t);u.target=t,t.state.isGesturing=!0;var s=r.renderer.plugins.interaction;u.interactionManager=s,u.start(n);var h=u.easing;h&&h.onStart(),u.bind(n)}}},t.prototype.newOnMove=function(t){var n=this;return function(i){n.onMove(i,t)}},t.prototype.newOnEnd=function(t){var n=this;return function(i){n.onEnd(i,t)}},t.prototype.onMove=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.isUpdatable(t)&&this.Ci(t,this.Ni,i)){var r=n.center,e=r.x,u=r.y,s=n.scale,h=n.time;n.update(t);var o=r.x,a=r.y,c=n.scale,f=o-e,l=a-u,v=n.time-h,b=1e-5,d=b<s&&b<c?c/s:1,g=n.easing;g&&g.onMove(f,l,d,v);var m=this.Ti;null!=m&&(0===f&&0===l&&1===d||m(i,f,l,o,a,d))}},t.prototype.onEnd=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.end(t)){i.state.isGesturing=!1;var r=n.interactionManager;if(n.interactionManager=void 0,r){var e=n.onMove;e&&r.off(ir.move,e);var u=n.onEnd;u&&(r.off(ir.up,u),r.off(ir.cancel,u))}var s=this.vi;null!=s&&s(i);var h=n.easing;h?h.onEnd(t.data.originalEvent.timeStamp-n.time):this.deleteData(n)}},t.prototype.onEasingMove=function(t,n,i,r,e){if(null!=e.target){var u=this.Ti;if(null!=u&&(0!==t||0!==n||1!==i)){var s=e.center,h=s.x+t,o=s.y+n;s.set(h,o),u(e.target,t,n,h,o,i)}}},t.prototype.onEasingEnd=function(t){this.deleteData(t)},t.prototype.stop=function(t){var n,i=this.Li.get(t);null!=i&&(null===(n=i.easing)||void 0===n||n.stop(),this.deleteData(i))},t}(),wr=function(){function t(t,n,i,r,e,u){var s,h,o=this;this.p=t,this.yi=i,this.xi=r;var a=Ai(null!==(s=null==u?void 0:u.mode)&&void 0!==s?s:e.getGestureMode(),fr),c=Ai(null!==(h=null==u?void 0:u.modifier)&&void 0!==h?h:e.getGestureModifier(),ar);a!==fr.ON&&a!==fr.TOUCH||(this.Bi=new mr({touch:a===fr.TOUCH,modifier:c,checker:u&&u.checker,easing:{duration:null==u?void 0:u.duration},on:{start:function(){o.yi.stop()},move:function(i,r,e,u,s,h){o.onGestureMove(n(t),r,e,u,s,h)}}}))}return t.prototype.onGestureMove=function(t,n,i,r,e,u){if(t){var s=this.yi,h=t.scale,o=h.x,a=h.y,c=s.toNormalizedScale(o*u),f=s.toNormalizedScale(a*u),l=c/o,v=f/a,b=u<1?Math.max(l,v):Math.min(l,v);c=b*o,f=b*a;var d=r-n,g=e-i,m=t.position,w=(m.x-d)*b+r,p=(m.y-g)*b+e;this.xi(t,w,p,c,f)}},t.prototype.stop=function(){var t;null===(t=this.Bi)||void 0===t||t.stop(this.p)},t.prototype.onDown=function(t){var n;null===(n=this.Bi)||void 0===n||n.onDown(this.p,t)},t}(),pr=function(){function t(t,n,i,r,e){var u=this;this.p=t,this._i=n,this.xi=r,this.Pi=1,this.Fi=1,this.Ui=0,this.Gi=0,this.Hi=1,this.zi=1,this.Vi=0,this.Wi=0,this.ji=new br({onTime:function(t){u.onTime(t)},duration:e}),this.yi=i,this.hi=e}return t.prototype.onTime=function(t){var n=1-t,i=t,r=this.Hi*n+this.Pi*i,e=this.zi*n+this.Fi*i,u=this.Vi*n+this.Ui*i,s=this.Wi*n+this.Gi*i,h=this._i(this.p);null!=h&&this.xi(h,u,s,r,e)},t.prototype.start=function(t,n,i,r,e,u,s){if(!1!==s&&this.yi.stop(),null==u&&(u=this.hi),u<=0)this.xi(t,n,i,r,e);else{var h=t.position,o=t.scale;this.Vi=h.x,this.Wi=h.y,this.Hi=o.x,this.zi=o.y,this.Ui=n,this.Gi=i,this.Pi=r,this.Fi=e,this.ji.duration=u,this.ji.start()}},t.prototype.stop=function(){this.ji.stop()},t}(),Or=function(){function n(i,r,e){var u,s,h,o,a,c,f,l,v,b,d,g,m,w,p,O,D;this.p=i,this._i=r,this.xi=e&&e.constraint||n.CONSTRAINT,this.Xi=new t.Rectangle;var E=this.toTheme(e)||this.getThemeDefault(),M=null==e?void 0:e.zoom;this.Ki=new t.Point,this.Yi=null!==(u=null==M?void 0:M.min)&&void 0!==u?u:E.getZoomMin(),this.Ji=null!==(s=null==M?void 0:M.max)&&void 0!==s?s:E.getZoomMax(),this.Zi=null!==(h=null==M?void 0:M.keepRatio)&&void 0!==h?h:E.getZoomKeepRatio();var S=null==M?void 0:M.wheel;this.qi=null!==(o=null==S?void 0:S.enable)&&void 0!==o?o:E.isWheelZoomEnabled(),this.Qi=null!==(a=null==S?void 0:S.speed)&&void 0!==a?a:E.getWheelZoomSpeed(),this.$i=Ai(null!==(c=null==S?void 0:S.modifier)&&void 0!==c?c:E.getWheelZoomModifier(),ar),this.tr=null!==(f=null==S?void 0:S.checker)&&void 0!==f?f:cr.match;var j=null==M?void 0:M.dblclick;this.nr=null!==(l=null==j?void 0:j.enable)&&void 0!==l?l:E.isDblClickZoomEnabled(),this.ir=null!==(v=null==j?void 0:j.amount)&&void 0!==v?v:E.getDblClickZoomSpeed(),this.rr=Ai(null!==(b=null==j?void 0:j.modifier)&&void 0!==b?b:E.getDblClickZoomModifier(),ar),this.er=null!==(d=null==j?void 0:j.checker)&&void 0!==d?d:cr.match,this.ur=null!==(g=null==j?void 0:j.duration)&&void 0!==g?g:E.getDblClickZoomDuration();var T=null===(m=null==e?void 0:e.translation)||void 0===m?void 0:m.wheel;this.sr=null!==(w=null==T?void 0:T.enable)&&void 0!==w?w:E.isWheelTranslationEnabled(),this.hr=null!==(p=null==T?void 0:T.speed)&&void 0!==p?p:E.getWheelTranslationSpeed(),this.ar=Ai(null!==(O=null==T?void 0:T.modifier)&&void 0!==O?O:E.getWheelTranslationModifier(),ar),this.cr=null!==(D=null==T?void 0:T.checker)&&void 0!==D?D:cr.match,this.lr=new wr(i,r,this,this.xi,E,null==e?void 0:e.gesture),this.I=new pr(i,r,this,this.xi,this.ur)}return Object.defineProperty(n.prototype,"gesture",{get:function(){return this.lr},enumerable:!1,configurable:!0}),n.prototype.stop=function(){this.lr.stop(),this.I.stop()},n.prototype.reset=function(t,n){var i=this.p,r=this._i(i);if(r){var e=r.getLocalBounds(this.Xi),u=.5*(i.width-e.width)-e.x,s=.5*(i.height-e.height)-e.y;this.I.start(r,u,s,1,1,t,n)}},n.prototype.fit=function(t,n){var i=this.p,r=this._i(i);if(r){var e=i.padding,u=i.width,s=i.height,h=r.getLocalBounds(this.Xi),o=h.x,a=h.y,c=h.width,f=h.height,l=(u-e.getLeft()-e.getRight())/c,v=(s-e.getTop()-e.getBottom())/f;if(this.Zi){var b=this.toNormalizedScale(Math.min(l,v));l=b,v=b}else l=this.toNormalizedScale(l),v=this.toNormalizedScale(v);var d=.5*(u-c*l)-o*l,g=.5*(s-f*v)-a*v;this.I.start(r,d,g,l,v,t,n)}},n.prototype.zoomIn=function(t,n){var i=this._i(this.p);if(i){var r=this.ir,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomOut=function(t,n){var i=this._i(this.p);if(i){var r=1/this.ir,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomAt=function(t,n,i,r,e,u){var s=this._i(this.p);if(s){var h=s.scale.x,o=s.scale.y,a=this.toNormalizedScale(i),c=this.toNormalizedScale(r),f=a/h,l=c/o,v=(s.position.x-t)*f+t,b=(s.position.y-n)*l+n;this.I.start(s,v,b,a,c,e,u)}},n.prototype.zoomAtGlobal=function(t,n,i,r,e,u){var s=this.Ki;s.set(t,n),this.toLocal(s,s),this.zoomAt(s.x,s.y,i,r,e,u)},n.prototype.zoom=function(t,n,i,r){var e=this.p;this.zoomAt(.5*e.width,.5*e.height,t,n,i,r)},Object.defineProperty(n.prototype,"scale",{get:function(){var n=this._i(this.p);return n?n.scale:new t.Point(1,1)},set:function(t){var n=this._i(this.p);if(n){var i=this.toNormalizedScale(t.x),r=this.toNormalizedScale(t.y),e=n.position;this.xi(n,e.x,e.y,i,r)}},enumerable:!1,configurable:!0}),n.prototype.moveTo=function(t,n,i,r){var e=this._i(this.p);if(e){var u=e.scale;this.I.start(e,t,n,u.x,u.y,i,r)}},Object.defineProperty(n.prototype,"position",{get:function(){var n=this._i(this.p);return n?n.position:new t.Point(0,0)},set:function(t){var n=this._i(this.p);if(n){var i=n.scale;this.xi(n,t.x,t.y,i.x,i.y)}},enumerable:!1,configurable:!0}),n.prototype.transform=function(t,n,i,r,e,u){var s=this._i(this.p);s&&this.I.start(s,t,n,i,r,e,u)},n.prototype.toLocal=function(t,n,i){return this.p.toLocal(t,void 0,n,i)},n.prototype.toGlobal=function(t,n,i){return this.p.toGlobal(t,n,i)},n.prototype.toNormalizedScale=function(t){return Math.min(this.Ji,Math.max(this.Yi,t))},n.prototype.onWheel=function(t,n,i){var r;if(this.qi&&this.tr(t,this.$i,this.p)&&0!==n.deltaY&&(r=this._i(this.p))){var e=n.lowest*this.Qi,u=1+n.deltaY*e,s=r.scale;return this.zoomAtGlobal(i.x,i.y,s.x*u,s.y*u,0),!0}if(this.sr&&this.cr(t,this.ar,this.p)&&(r=this._i(this.p))){this.stop(),e=n.lowest*this.hr;var h=r.position,o=h.x-n.deltaX*e,a=h.y+n.deltaY*e;return s=r.scale,this.xi(r,o,a,s.x,s.y),!0}return!1},n.prototype.onDown=function(t){this.lr.onDown(t)},n.prototype.onDblClick=function(t,n){if(this.nr&&this.er(t,this.rr,this.p)){var i=this._i(this.p);if(i){var r=this.Ki;ir.toGlobal(t,n,r);var e=this.ir,u=i.scale;return this.zoomAtGlobal(r.x,r.y,u.x*e,u.y*e,this.ur),!0}}return!1},n.prototype.toTheme=function(t){if(t&&t.theme){var n=t.theme;return Ot(n)?Z.getInstance().get(n):n}return null},n.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},n.prototype.getType=function(){return"DView"},n.CONSTRAINT=function(t,n,i,r,e){t.scale.set(r,e),t.position.set(n,i)},n}(),Dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n),this.vr=null;var e=this.theme;this.br=new Or(this,(function(){return r.vr}),null==n?void 0:n.view);var u=null==n?void 0:n.canvas;u&&(this.canvas=u),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(this.mask=this.getOverflowMask())},n.prototype.getType=function(){return"DCanvasContainer"},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateContentSize(n,i,r,e)},Object.defineProperty(n.prototype,"canvas",{get:function(){return this.vr},set:function(t){var n=this.vr;null!=n&&(this.vr=null,this.removeChild(n),this.emit("unset",n,this),n.destroy()),this.vr=t,null!=t?(this.addChild(t),this.br.reset(0),this.emit("set",t,this)):st.update(this)},enumerable:!1,configurable:!0}),n.prototype.getOverflowMask=function(){return null==this.dr&&(this.dr=new or(this),this.Zn.add(this.dr),this.toDirty()),this.dr},n.prototype.updateContentSize=function(t,n,i,r){var e=this.vr;if(null!=e){var u=e.x+.5*(t-i),s=e.y+.5*(n-r);e.position.set(u,s)}},Object.defineProperty(n.prototype,"view",{get:function(){return this.br},enumerable:!1,configurable:!0}),n.prototype.onWheel=function(n,i,r){var e=this.br.onWheel(n,i,r),u=t.prototype.onWheel.call(this,n,i,r);return e||u},n.prototype.onDblClick=function(n,i,r){if(!0!==r){var e=this.br.onDblClick(n,i),u=t.prototype.onDblClick.call(this,n,i);return e||u}return t.prototype.onDblClick.call(this,n,i)},n.prototype.onDown=function(n,i){!0!==i&&this.br.onDown(n),t.prototype.onDown.call(this,n)},n.prototype.destroy=function(){var n=this.dr;null!=n&&(this.dr=null,n.destroy()),this.mask=null,t.prototype.destroy.call(this)},n}(hr),Er={DIAGRAM:0,PAGE:1,EXTENSION:1e3},Mr=function(){function t(t){this.gr=this.newSources(t)}return t.prototype.map=function(n,i,r){var e=this.gr;if(null==e)return!1;var u=n.id,s=u.toLowerCase(),h=s.length;if(h!==u.length)return!1;var o=e[0],a=o.length;if(0!==a&&0!==s.indexOf(o))return!1;var c=t.SPANS;c[0]=0,c[1]=a;for(var f=e.length,l=1;l<f;++l){var v=l<<1,b=e[l],d=b.length;if(0===d)c[v]=h,c[v+1]=h;else{var g=s.indexOf(b,c[v-1]);if(g<0)return!1;c[v]=g,c[v+1]=g+d}}if(null!=i){for(var m=i.length,w="",p=(l=0,f);l<p;++l){var O=l<m?i[l]:e[l],D=c[1+(v=l<<1)],E=c[v+2];w+=O+u.substring(D,l+1<p?E:h)}n.id=w}return 0<r.length&&(n.initial=r),!0},t.prototype.newSources=function(n){if(null==n)return null;var i=n.trim();return i.length<=0?null:i.toLowerCase().split(t.WILDCARD)},t.split=function(t){if(null==t)return null;var n=t.trim();return n.length<=0?null:n.split(this.WILDCARD)},t.WILDCARD="*",t.SPANS=[],t}(),Sr=function(){function t(t,n,i,r,e){this.resources=t.resources,this.data=t.data||t.tags||t.resources,this.pieces=n,this.pieceData=i,this.mode=r,this.depth=e,this.mr=new Map,this.wr=new Map,this.pr=new Map,this.Xt=new Map,this.Or=new Map,this.Dr=new Map,this.Er=new Map,this.Mr=new Map,this.Sr=new Map,this.jr=new Map,this.Tr=new Map,this.Nr=new Map,this.Ir=new Map,this.Cr=new Map,this.Ar=new Map,this.Rr=new Map}return t.prototype.getAction=function(t){return this.mr.get(t)},t.prototype.setAction=function(t,n){this.mr.set(t,n)},t.prototype.getFill=function(t){return this.wr.get(t)},t.prototype.setFill=function(t,n){this.wr.set(t,n)},t.prototype.getStroke=function(t){return this.pr.get(t)},t.prototype.setStroke=function(t,n){this.pr.set(t,n)},t.prototype.getData=function(t){return this.Xt.get(t)},t.prototype.setData=function(t,n){this.Xt.set(t,n)},t.prototype.getDataValue=function(t){return this.Or.get(t)},t.prototype.setDataValue=function(t,n){this.Or.set(t,n)},t.prototype.getDataMapping=function(t){return this.Dr.get(t)},t.prototype.setDataMapping=function(t,n){this.Dr.set(t,n)},t.prototype.getDataMapper=function(t){var n=this.Er,i=n.get(t);return void 0===i&&(i=new Mr(t),n.set(t,i)),i},t.prototype.getDataDestination=function(t){var n=this.Mr,i=n.get(t);return void 0===i&&(i=Mr.split(t),n.set(t,i)),i},t.prototype.getDataSystem=function(t){return this.Sr.get(t)},t.prototype.setDataSystem=function(t,n){this.Sr.set(t,n)},t.prototype.getRange=function(t){return this.jr.get(t)},t.prototype.setRange=function(t,n){this.jr.set(t,n)},t.prototype.getAlign=function(t){return this.Tr.get(t)},t.prototype.setAlign=function(t,n){this.Tr.set(t,n)},t.prototype.getMargin=function(t){return this.Nr.get(t)},t.prototype.setMargin=function(t,n){this.Nr.set(t,n)},t.prototype.getText=function(t){return this.Ir.get(t)},t.prototype.setText=function(t,n){this.Ir.set(t,n)},t.prototype.getTextOutline=function(t){return this.Cr.get(t)},t.prototype.setTextOutline=function(t,n){this.Cr.set(t,n)},t.prototype.getCapability=function(t){return this.Ar.get(t)},t.prototype.setCapability=function(t,n){this.Ar.set(t,n)},t.prototype.getExtension=function(t){return this.Rr.get(t)},t.prototype.setExtension=function(t,n){this.Rr.set(t,n)},t}(),jr={VIEWER:0,EDITOR_DATA_MAPPED:1,EDITOR:2},Tr=function(){function t(){}return t.get=function(t){var n=this.mappings[t];return null!=n?n:Ct.PRIMITIVE},t.contains=function(t,n){if(null!=t){var i=this.get(t.type),r=t.getCapability();return null!=r&&(i&=~r.removed,i|=r.added,i&=~r.locked),(i&n)===n}return!1},t.set=function(t,n){this.mappings[t]=n},t.mappings={},t}(),Nr=function(){this.localTransform=new t.Matrix,this.internalTransform=new t.Matrix,this.internalTransformParentInverse=new t.Matrix,this.rotation=0,this.size=new t.Point},Ir=function(t){return Math.abs(t)<.001?t<0?-.001:.001:t},Cr=function(){function t(){}return t.prepare=function(t){var n=t.editor||new Nr;t.editor=n,t.updateTransform();var i=t.parent;i instanceof Rt?i.transform.internalTransform.copyTo(n.internalTransformParentInverse).invert():n.internalTransformParentInverse.identity(),t.transform.internalTransform.copyTo(n.internalTransform),n.rotation=t.transform.rotation,n.size.copyFrom(t.size),t.disallowOnTransformChange()},t.finalize=function(t){t.allowOnTransformChange(!0)},t.apply=function(t,n,i){var r=t.editor;if(null!=r){var e=r.localTransform;r.internalTransformParentInverse.copyTo(e).append(n).append(r.internalTransform),this.applyLocal(t,e,i,r.size)}},t.applyLocal=function(t,n,i,r){t.disallowUploadedUpdate();var e=n.a,u=n.b,s=n.c,h=n.d,o=n.tx,a=n.ty,c=t.transform,f=!!(i&Ct.POSITION),l=!!(i&Ct.ROTATION),v=!!(i&Ct.SKEW),b=!!(i&Ct.WIDTH),d=!!(i&Ct.HEIGHT);if(l||v){var g=Math.atan2(-s,h),m=Math.atan2(+u,e);if(l&&(c.rotation=.5*(g+m)),v){var w=.5*(m-g);c.skew.set(w,w)}}if(f){var p=c.pivot,O=p.x,D=p.y;c.position.set(o+(e*O+s*D),a+(u*O+h*D))}if(null!=r&&(b||d)){var E=Ir(r.x*Math.sqrt(e*e+u*u)),M=Ir(r.y*Math.sqrt(s*s+h*h)),S=t.size;b&&d?S.set(E,M):b?S.x=E:S.y=M}t.allowUploadedUpdate()},t}(),Ar=function(){function n(n,i,r){this.shape=n,this.base=new t.Point(i,r);var e=n.size;this.shapeBase=new t.Point(e.x,e.y),this.transform=new t.Matrix,n.updateTransform(),n.transform.localTransform.copyTo(this.transform),this.capable=Tr.contains(n,Ct.POSITION)&&Tr.contains(n,Ct.WIDTH)&&Tr.contains(n,Ct.HEIGHT)&&Tr.contains(n,Ct.ROTATION)&&Tr.contains(n,Ct.SKEW)}return n.prototype.isCompatible=function(t){return this.shape===t},n.prototype.reset=function(t,n,i){this.base.set(n,i);var r=t.size;this.shapeBase.copyFrom(r),t.updateTransform(),t.transform.localTransform.copyTo(this.transform)},n.prototype.update=function(t,i,r,e,u){if(this.capable){var s=i/this.base.x,h=r/this.base.y,o=this.shapeBase,a=n.WORK_TRANSFORM;a.identity().append(this.transform).translate(-e,-u).scale(s,h).translate(+e,+u),t.disallowOnTransformChange(),Cr.applyLocal(t,a,Ct.ALL,o),t.allowOnTransformChange(!1)}},n.WORK_TRANSFORM=new t.Matrix,n}(),Rr=function(){function n(n,i,r,e){this.kr=new t.Rectangle,this.Lr=new t.Rectangle,this.p=n,this.yr=[],this.T=new t.Point(i,r),this.Br=e}return n.prototype.init=function(){return this},Object.defineProperty(n.prototype,"x",{get:function(){return this.T.x},set:function(t){var n=this.T;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.T.y},set:function(t){var n=this.T;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.T,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.T;return new n(this.p,t.x,t.y,this.Br)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.T,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.T.copyTo(t)},n.prototype.equals=function(t){return this.T.equals(t)},n.prototype.fit=function(){return this.Br&&this.doFit(),this},n.prototype.doFit=function(){var t=this.p;t.disallowOnTransformChange();var n=this.calcRect(this.Lr),i=this.T;i.set(n.width,n.height),t.updateTransform();var r=t.transform,e=n.x+.5*n.width,u=n.y+.5*n.height,s=r.position,h=r.localTransform,o=h.a,a=h.b,c=h.c,f=h.d,l=r.pivot;s.set(s.x+(o*e+c*u)-(o*l.x+c*l.y),s.y+(a*e+f*u)-(a*l.x+f*l.y)),l.set(e,u),this.reset(t.children,this.yr,i),t.allowOnTransformChange(!0)},n.prototype.reset=function(t,n,i){for(var r=0,e=Math.min(n.length,t.length);r<e;++r){var u=t[r],s=n[r];if(!s.isCompatible(u)){n.length=r;break}s.reset(u,i.x,i.y)}t.length<n.length&&(n.length=t.length)},n.prototype.calcRect=function(t){var n=this.p.children;if(n.length<=0)t.x=0,t.y=0,t.width=0,t.height=0;else{var i=this.kr;n[0].getBoundsLocal(!1,t);for(var r=1,e=n.length;r<e;++r)n[r].getBoundsLocal(!1,i),t.enlarge(i)}return t},n.prototype.onChange=function(t,n){var i=this.p,r=this.T,e=i.transform.pivot;this._r(i.children,this.yr,r.x,r.y,e.x,e.y,t,n),i.onSizeChange()},n.prototype._r=function(t,n,i,r,e,u,s,h){for(var o=0,a=Math.min(n.length,t.length);o<a;++o){var c=t[o];if(!(f=n[o]).isCompatible(c)){n.length=o;break}f.update(c,i,r,e,u)}for(o=n.length,a=t.length;o<a;++o){var f;c=t[o],(f=this.newLayout(c,s,h)).update(c,i,r,e,u),n.push(f)}n.length!==t.length&&(n.length=t.length)},n.prototype.newLayout=function(t,n,i){return t.layout||new Ar(t,n,i)},n}(),kr=function(){function n(n,i,r,e,u){this.p=n,this._x=i,this._y=r,this.Pr=new t.Point(e,u)}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"base",{get:function(){return this.Pr},enumerable:!1,configurable:!0}),n.prototype.init=function(){return this.Pr.copyFrom(this),this.onChange(),this},n.prototype.clone=function(){var t=this.Pr;return new n(this.p,this._x,this._y,t.x,t.y)},n.prototype.set=function(t,n){var i=!1;return null!=t&&this._x!==t&&(this._x=t,i=!0),null!=n&&this._y!==n&&(this._y=n,i=!0),i&&this.onChange(),this},n.prototype.copyFrom=function(t){return t instanceof n&&this.Pr.copyFrom(t.base),this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.onChange()),this},n.prototype.copyTo=function(t){return t instanceof n&&this.Pr.copyTo(t.base),t.set(this._x,this._y),t},n.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},n.prototype.fit=function(){return this},n.prototype.onChange=function(){var t=this.Pr;this.p.transform.scale.set(this._x/t.x,this._y/t.y)},n}(),Lr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),yr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return qt.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return s.NONE},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i,r,e,u,s){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!1,color:16777215,alpha:1,width:1,align:0,side:qt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),xr=function(t){function n(n,i,r){var e=t.call(this,r)||this;e.Fr=n,e.Ur=i;var u=e.newData();return e.data=u,e.tag=u,e.size=e.newGroupSize(n,i),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e}return _(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Fr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"depth",{get:function(){return this.Ur},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t,n){var i=q.SIZE_X,r=q.SIZE_Y;return t!==jr.VIEWER?new Rr(this,i,r,this.isGroupSizeFittable()):new kr(this,i,r,i,r)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newData=function(){return new Vt},n.prototype.newGroupFill=function(){return new Lr},n.prototype.newGroupStroke=function(){return new yr},n.prototype.newGroupText=function(){return new Yt(this,q.TEXT_VALUE,q.TEXT_COLOR,q.TEXT_ALPHA,q.TEXT_FAMILY,q.TEXT_SIZE)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof kr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){return ut.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Rt),Br=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED);var s=t.call(this,i,e,u)||this;return s.Gr=n,s.Ur=e,s}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=q.SIZE_X,r=q.SIZE_Y;return t!==jr.VIEWER&&n<=0?new Rr(this,i,r,this.isGroupSizeFittable()):new kr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Gr,this.Fr,this.Ur,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=n.addPiece(this.Gr),i},n.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid)},n.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid)},n}(xr),_r=function(){function t(t){this.Hr=t}return t.prototype.find=function(t){return this.getUuidToShape().get(t)},t.prototype.getUuidToShape=function(){var t=this.zr;return null==t&&(t=this.newUuidToShape(),this.zr=t),t},t.prototype.newUuidToShape=function(){var t=new Map;return this.fillUuidToShape(this.Hr,t),t},t.prototype.fillUuidToShape=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];if(n.set(e.uuid,e),!(e instanceof Br)){var u=e.children;0<u.length&&this.fillUuidToShape(u,n)}}},t}(),Pr=function(t,i){var e=n[t[0]]||n[r.NULL];if(null!=e){var u=e(t,i);if(null!=u)return u}throw new Error("Missing shape deserializers")},Fr=function(t,n){for(var i=[],r=0,e=t.length;r<e;++r)i.push(Pr(t[r],n));return 0<i.length?Promise.all(i).then((function(i){return Ur(t,i,new _r(i),n),i})):null},Ur=function(t,n,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u],o=n[u],a=i[h[0]];a&&a(h,o,r,e),Ur(h[20],o.children,r,e)}},Gr=function(t,n,i,r){this.name=t,this.width=n,this.height=i,this.layer=r},Hr=function(){function t(){this.V=new Map}return t.prototype.add=function(t,n,i,r,e,u){return this.V.set(t,{type:n,x:i,y:r,normal:this.toNormal(i,r,e,u)}),!0},t.prototype.toNormal=function(t,n,i,r){if(null!=i&&null!=r)return{x:i,y:r};var e=t*t+n*n;if(1e-5<e){var u=1/Math.sqrt(e);return{x:t*u,y:n*u}}return{x:0,y:0}},t.prototype.remove=function(t){var n=this.V,i=n.get(t);return null!=i?(n.delete(t),i):null},t.prototype.size=function(){return this.V.size},t.prototype.get=function(t,n){return this.V.get(n)||null},t.prototype.each=function(t,n){return this.V.forEach(n),this},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.clear=function(){var t=this.V;return 0<t.size&&(t.clear(),!0)},t}(),zr={TAIL:1,HEAD:2,ALL:3},Vr=function(){function t(){}return t.set=function(t,n){var i=this.Vr;null==i&&(i=new Map,this.Vr=i),i.set(t,n)},t.get=function(t){var n;return(null===(n=this.Vr)||void 0===n?void 0:n.get(t))||this.getDefault()},t.getDefault=function(){var t=this.Wr;return null==t&&(t=this.newDefault(),this.Wr=t),t},t.newDefault=function(){var t=new Hr,n=1/Math.sqrt(2);return t.add("TOP",zr.ALL,0,-.5,0,-1),t.add("LEFT",zr.ALL,-.5,0,-1,0),t.add("RIGHT",zr.ALL,.5,0,1,0),t.add("BOTTOM",zr.ALL,0,.5,0,1),t.add("CENTER",zr.ALL,0,0,0,0),t.add("TOP_LEFT",zr.ALL,-.5,-.5,-n,-n),t.add("TOP_RIGHT",zr.ALL,.5,-.5,n,-n),t.add("BOTTOM_LEFT",zr.ALL,-.5,.5,-n,n),t.add("BOTTOM_RIGHT",zr.ALL,.5,.5,n,n),t},t}(),Wr=function(){function t(t){this.p=t,this.Xr=null,this.Kr=null}return Object.defineProperty(t.prototype,"shape",{get:function(){return this.Xr},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this.Kr},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.set(t.shape,t.edge)},t.prototype.set=function(t,n){var i=!1;return void 0!==t&&this.Xr!==t&&(this.Xr=t,i=!0),void 0!==n&&this.Kr!==n&&(this.Kr=n,i=!0),i&&this.p.onAcceptorChange(),this},t}(),Xr=function(){function n(n,i){var r=this;this.p=n,this.ut=i,this.Yr=new Wr(this),this.it=new t.ObservablePoint((function(){r.onLocalChange()}),void 0),this.Jr=0,this.Zr=0,this.qr=new t.ObservablePoint((function(){r.onNormalChange()}),void 0),this.Qr=0,this.$r=0,this.te=0,this.ne=0,this.ie=!1,this.re=!1,this.ee=!1,this.ue=!1}return n.prototype.lock=function(){this.ne+=1,1===this.ne&&(this.ie=!1,this.re=!1,this.ee=!1,this.ue=!1)},n.prototype.unlock=function(){if(this.ne-=1,0===this.ne){var t=!1;this.re&&(this.Jr+=1,this.Zr=this.Jr,t=!0),this.ee&&(this.Qr+=1,this.$r=this.Qr,t=!0),this.ue&&(t=!0),this.ie&&(this.re||(this.Jr+=1),this.ee||(this.Qr+=1),this.doFit()&&(t=!1)),t&&this.ut()}},Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"acceptor",{get:function(){return this.Yr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"local",{get:function(){return this.it},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localId",{get:function(){return this.Zr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normal",{get:function(){return this.qr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normalId",{get:function(){return this.$r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},set:function(t){this.te!==t&&(this.te=t,this.onOtherChange())},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u,s){this.lock(),this.Yr.set(t,n);var h=this.it;null!=r&&null!=e?h.set(r,e):null!=r?h.x=r:null!=e&&(h.y=e);var o=this.qr;return null!=u&&null!=s?o.set(u,s):null!=u?o.x=u:null!=s&&(o.y=s),null!=i&&(this.margin=i),this.unlock(),this},n.prototype.copy=function(t){return this.lock(),this.Yr.copy(t.acceptor),this.it.copyFrom(t.local),this.qr.copyFrom(t.normal),this.margin=t.margin,this.unlock(),this},n.prototype.serialize=function(t){var n=this.Yr,i=n.shape,r=i?i.uuid:null,e=n.edge,u=null!=e?t.addResource(e):-1,s=this.it,h=this.qr;return t.addResource("[".concat(r,",").concat(u,",").concat(s.x,",").concat(s.y,",").concat(this.te,",").concat(h.x,",").concat(h.y,"]"))},n.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e));var u=null,s=e[0];null!=s&&(u=n.find(s)||null),this.lock();var h=this.Yr;h.shape=u;var o=e[1];h.edge=0<=o&&o<r.length?r[o]:null,this.it.set(e[2],e[3]);var a=e[5],c=e[6],f=this.qr;null!=a&&null!=c?f.set(a,c):f.set(1,0),this.margin=e[4]||0,this.unlock(),u&&u.connector.add(this)}},n.prototype.fit=function(t){return t&&(this.Jr+=1,this.Qr+=1),this.doFit(),this},n.prototype.doFit=function(){var t=this.Jr,n=this.Zr!==t,i=this.Qr,r=this.$r!==i;if(n||r){this.Zr=t,this.$r=i;var e=this.Yr,u=e.shape,s=e.edge;if(null!=u&&null!=s){var h=Vr.get(u.type).get(u,s);if(h){var o=this.toAcceptorTransform(u),a=o.a,c=o.b,f=o.c,l=o.d,v=o.tx,b=o.ty;if(this.lock(),n){var d=u.size,g=u.transform.pivot,m=g.x+d.x*h.x,w=g.y+d.y*h.y;this.it.set(a*m+f*w+v,c*m+l*w+b)}if(r){var p=h.normal,O=p.x,D=p.y,E=a*O+f*D,M=c*O+l*D,S=E*E+M*M,j=this.qr;if(1e-6<S){var T=1/Math.sqrt(S);j.set(E*T,M*T)}else j.set(O,D)}var N=this.re||this.ee;return this.unlock(),N}}}return!1},n.prototype.toAcceptorTransform=function(i){var r;i.updateTransform();var e=this.p,u=e.parent;return u?(e.updateTransform(),(null!==(r=n.WORK_MATRIX)&&void 0!==r?r:n.WORK_MATRIX=new t.Matrix).copyFrom(u.transform.worldTransform).invert().append(i.transform.worldTransform)):i.transform.worldTransform},n.prototype.onAcceptorChange=function(){if(0<this.ne)return this.re=!1,this.ee=!1,void(this.ie=!0);this.fit(!0)},n.prototype.onLocalChange=function(){0<this.ne?this.re=!0:(this.Jr+=1,this.Zr=this.Jr,this.ut())},n.prototype.onNormalChange=function(){0<this.ne?this.ee=!0:(this.Qr+=1,this.$r=this.Qr,this.ut())},n.prototype.onOtherChange=function(){0<this.ne?this.ue=!0:this.ut()},n.prototype.attach=function(){var t=this.Yr.shape;return t&&t.connector.add(this),this},n.prototype.detach=function(){var t=this.Yr.shape;return t&&t.connector.remove(this),this},n}(),Kr=function(){function t(t,n){var i=this;this.p=t,this.ne=0,this.Kt=!1,this.ut=n;var r=function(){i.onChange()};this.se=new Xr(t,r),this.he=new Xr(t,r)}return t.prototype.lock=function(){return this.ne+=1,1===this.ne&&(this.Kt=!1),this},t.prototype.unlock=function(){return this.ne-=1,0===this.ne&&this.Kt&&this.ut(),this},t.prototype.onChange=function(){0<this.ne?this.Kt=!0:this.ut()},Object.defineProperty(t.prototype,"tail",{get:function(){return this.se},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.he},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.lock(),this.se.copy(t.tail),this.he.copy(t.head),this.unlock(),this},t.prototype.fit=function(t){return this.lock(),this.se.fit(t),this.he.fit(t),this.unlock(),this},t.prototype.serialize=function(t){var n=this.se.serialize(t),i=this.he.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.lock(),this.se.deserialize(e[0],n,i),this.he.deserialize(e[1],n,i),this.unlock()}},t.prototype.attach=function(){this.lock();var t=this.se,n=this.he;return t.attach(),n.attach(),t.fit(!0),n.fit(!0),this.unlock(),this},t.prototype.detach=function(){return this.lock(),this.se.detach(),this.he.detach(),this.unlock(),this},t}(),Yr=function(t,n){for(var i=0,r=t.length-1;i<=r;){var e=i+(r-i>>1),u=t[e];if(n<u)r=e-1;else{if(!(u<n))return e;i=e+1}}return-1},Jr=2*Math.PI,Zr=.5*Math.PI,qr=function(t,n,i,r){return t*i+n*r},Qr=function(t,n){return Math.sqrt(qr(t,n,t,n))},$r=function(t,n,i,r){return t*r-n*i},te=function(t,n,i,r,e,u,s,h,o,a){var c=a.center;c[0]=t,c[1]=n;var f=a.axis1;f[0]=i,f[1]=r;var l=a.axis2;l[0]=e,l[1]=u;var v=a.angle;return v[0]=s,v[1]=h,v[2]=o,a},ne=function(t,n){var i=t.center,r=t.axis1,e=t.axis2,u=t.angle;return te(i[0],i[1],r[0],r[1],e[0],e[1],u[0],u[1],u[2],n)},ie=function(t,n){for(var i=t.length,r=0;r<i;++r)n[r]=t[r];return n.length!==i&&(n.length=i),n},re=function(){function t(){}return t.set=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){for(var d=Math.max(Math.abs(n-i),Math.abs(s-h)),g=f?Math.max(1,Math.round(c*(d/Zr))):c,m=l?g+1:g,w=0;w<m;++w){var p=w/g,O=1-p,D=p,E=O*n+D*i,M=Math.cos(E),S=Math.sin(E),j=t[0]+M*r[0]+S*e[0],T=t[1]+M*r[1]+S*e[1],N=O*s+D*h,I=Math.cos(N),C=Math.sin(N),A=u[0]+I*o[0]+C*a[0],R=u[1]+I*o[1]+C*a[1],k=Zr*p,L=Math.cos(k),y=Math.sin(k),x=L*L,B=y*y,_=x*j+B*A,P=x*T+B*R;v[++b]=_,v[++b]=P}return b},t.interpolate=function(t,n,i,r,e,u,s,h){var o=h.values,a=h.segments;if(t<=2)return ie(n,o),ie(i,a),h;var c=this.WORK_P0||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},f=this.WORK_P1||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},l=this.WORK_P2||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]};this.WORK_P0=c,this.WORK_P1=f,this.WORK_P2=l;var v=-1,b=-1;if(e){r(0,t,n,c),ne(c,f);for(var d=1;d<t;++d){if(r(d,t,n,l),0<=Yr(i,d)){var g=d-1<<1;o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1}else v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v);var m=f;f=l,l=m}0<=Yr(i,0)?(g=t-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a.unshift(0),b+=1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v)}else{r(1,t,n,c),0<=Yr(i,1)?(o[++v]=n[0],o[++v]=n[1],a[++b]=1):v=this.set(c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v),ne(c,f),d=2;for(var w=t-1;d<w;++d)r(d,t,n,l),0<=Yr(i,d)?(g=d-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v),m=f,f=l,l=m;0<=Yr(i,t-1)?(g=t-2<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,u,s,!0,o,v)}return v+=1,o.length!==v&&(o.length=v),b+=1,a.length!==b&&(a.length=b),h},t.toCircle=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=a-h,b=c-o,d=f-a,g=l-c,m=h+.5*v,w=o+.5*b,p=a+.5*d,O=c+.5*g,D=-b,E=+v,M=-g,S=+d,j=$r(D,E,M,S);if(Math.abs(j)<.001){if(0<=qr(v,b,d,g)||n<=2){var T=.01,N=Math.sin(T),I=Qr(v,b),C=Qr(d,g);return te(a,c,0,0,d/N,g/N,-T*I/C,0,T,r)}j=.001}var A=(S*(p-m)+M*(w-O))/j,R=m+A*D,k=w+A*E,L=a-R,y=c-k,x=-y,B=+L,_=f-R,P=l-k,F=Math.atan2(qr(x,B,_,P),qr(L,y,_,P)),U=h-R,G=o-k,H=Math.atan2(qr(x,B,U,G),qr(L,y,U,G));return 0<H*F&&(Math.abs(H)<Math.abs(F)&&(0<F?F-=Jr:F+=Jr),Math.abs(F)<Math.abs(H)&&(0<H?H-=Jr:H+=Jr)),te(R,k,L,y,x,B,H,0,F,r)},t.toEllipse=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=h-a,b=o-c,d=f-a,g=l-c;if(n<=2){var m=.01,w=Math.sin(m);return te(a,c,0,0,d/w,g/w,-m,0,m,r)}for(var p=Qr(v,b),O=Qr(d,g),D=qr(v,b,d,g)/(p*O),E=Math.acos(D),M=.5*E,S=.25*E,j=0,T=0,N=0,I=0,C=Math.max(p,O),A=Math.min(p,O),R=0;R<16;++R){var k=.5*M,L=E-k;j=C*Math.sin(k),T=C*Math.cos(k),N=A*Math.sin(L),1<(1-(I=A*Math.cos(L))/T)*(1-I/T)+N*N/(j*j)?M+=S:M-=S,S*=.5}var y=Math.asin(Math.min(N/j,1));if(p<O){var x=d/O,B=g/O,_=void 0,P=void 0;return 0<$r(v,b,d,g)?(_=+B,P=-x):(_=-B,P=+x),te(z=a-(G=(F=-T*T/O)*x+(U=-T*j/O)*_),V=c-(H=F*B+U*P),G,H,f-z,l-V,-y,0,Zr,r)}var F,U,G,H,z,V,W=v/p,X=b/p;return _=void 0,P=void 0,$r(v,b,d,g)<0?(_=+X,P=-W):(_=-X,P=+W),te(z=a-(G=(F=-T*T/p)*W+(U=-T*j/p)*_),V=c-(H=F*X+U*P),G,H,-(h-z),-(o-V),-Zr,0,y,r)},t.toHybrid=function(n,i,r,e){var u=t.toCircle(n,i,r,e),s=u.angle[0],h=u.angle[2],o=Math.min(s,h),a=Math.max(s,h);return o<-Zr||Zr<a?t.toEllipse(n,i,r,e):u},t}(),ee=function(t,n,i,r,e){return re.interpolate(t,n,i,re.toHybrid,!!(r&z.CLOSED),q.CURVE_SEGMENT_COUNT,!0,e),e.length=e.values.length>>1,e.style=r,e},ue=function(t,n){if(2<=t.length){for(var i=t[0],r=t[1],e=i,u=r,s=2,h=t.length;s<h;s+=2){var o=t[s],a=t[s+1];i=Math.min(i,o),r=Math.min(r,a),e=Math.max(e,o),u=Math.max(u,a)}n[0]=i,n[1]=r,n[2]=e,n[3]=u}else n[0]=0,n[1]=0,n[2]=0,n[3]=0;return n},se=function(){function n(n){var i=this;this.p=n,this.ne=0,this.oe=!1,this.ae=!1,this.ce=!1,this.xt=Q.NONE,this.T=new t.ObservablePoint((function(){i.onSizeChange()}),void 0,.15*q.SIZE_X,.15*q.SIZE_Y),this.C=this.newFill(),this.fe=0}return n.prototype.newFill=function(){return new $(this,!0,q.FILL_COLOR,1)},n.prototype.lock=function(){return this.ne+=1,1===this.ne&&(this.oe=!1,this.ae=!1,this.ce=!1),this},n.prototype.unlock=function(){return this.ne-=1,0===this.ne&&(this.oe?this.onTypeChange():this.ae?this.onSizeChange():this.ce&&this.onFillChange(),this.oe=!1,this.ae=!1,this.ce=!1),this},Object.defineProperty(n.prototype,"type",{get:function(){return this.xt},set:function(t){this.xt!==t&&(this.xt=t,this.onTypeChange())},enumerable:!1,configurable:!0}),n.prototype.onTypeChange=function(){0<this.ne?this.oe=!0:this.p.onTypeChange()},Object.defineProperty(n.prototype,"size",{get:function(){return this.T},enumerable:!1,configurable:!0}),n.prototype.onSizeChange=function(){0<this.ne?this.ae=!0:this.p.onSizeChange()},Object.defineProperty(n.prototype,"transform",{get:function(){return this.updateTransform()},enumerable:!1,configurable:!0}),n.prototype.updateTransform=function(){var n=this.I;null==n&&(n=new t.Matrix,this.I=n);var i=this.p.parent,r=i.id;if(this.fe!==r){this.fe=r;var e=i.formatted;2<=e.length?this.toTransform(e.values,n):n.identity()}return n},n.prototype.toTransformMatrix=function(t,n,i,r,e){var u=t-i,s=n-r,h=u*u+s*s;if(1e-5<h){var o=1/Math.sqrt(h),a=u*o,c=s*o;e.set(c,-a,-a,-c,t,n)}else e.set(1,0,0,1,t,n);return e},Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),n.prototype.onFillChange=function(){0<this.ne?this.ce=!0:this.p.onFillChange()},n.prototype.updateUploaded=function(){this.onFillChange()},n.prototype.copy=function(t){var n=t.size;return this.set(t.type,n.x,n.y),this},n.prototype.set=function(t,n,i){return this.lock(),null!=t&&(this.type=t),this.size.set(n,i),this.unlock(),this},n.prototype.serialize=function(t){var n=this.T,i=this.C.serialize(t);return t.addResource("[".concat(this.xt,",").concat(n.x,",").concat(n.y,",").concat(i,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.type=r[0],this.T.set(r[1],r[2]),this.C.deserialize(r[3],n),this.unlock()}},n}(),he=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){var i=t.length;return 4<=i?this.toTransformMatrix(t[i-2],t[i-1],t[i-4],t[i-3],n):(n.identity(),n)},n}(se),oe=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){return 4<=t.length?this.toTransformMatrix(t[0],t[1],t[2],t[3],n):(n.identity(),n)},n}(se),ae=function(){function t(t){this.p=t,this.ne=0,this.oe=!1,this.ae=!1,this.ce=!1,this.he=new he(this),this.se=new oe(this)}return t.prototype.lock=function(){return this.ne+=1,1===this.ne&&(this.oe=!1,this.ae=!1,this.ce=!1),this},t.prototype.unlock=function(){return this.ne-=1,0===this.ne&&(this.oe?this.onTypeChange():this.ae?this.onSizeChange():this.ce&&this.onFillChange(),this.oe=!1,this.ae=!1,this.ce=!1),this},Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.he},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.se},enumerable:!1,configurable:!0}),t.prototype.onTypeChange=function(){0<this.ne?this.oe=!0:this.p.onMarkerTypeChange()},t.prototype.onSizeChange=function(){0<this.ne?this.ae=!0:this.p.onMarkerSizeChange()},t.prototype.onFillChange=function(){0<this.ne?this.ce=!0:this.p.onMarkerFillChange()},t.prototype.copy=function(t){return this.lock(),this.he.copy(t.head),this.se.copy(t.tail),this.unlock(),this},t.prototype.serialize=function(t){var n=this.he.serialize(t),i=this.se.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.he.deserialize(r[0],n),this.se.deserialize(r[1],n),this.unlock()}},t}(),ce=function(){function n(n){this.p=n,this.le=0,this.k=[],this.L=[];var i=n.size,r=i.x,e=i.y;this.ve=new t.Point(r,e),this.be=new t.Point(r,e),this.R=0,this.B=z.NONE,this.de=-1}return Object.defineProperty(n.prototype,"length",{get:function(){return this.k.length>>1},enumerable:!1,configurable:!0}),n.prototype.toFitted=function(){this.ge=void 0;var t=this.p.size;this.be.copyFrom(t),this.ve.copyFrom(t)},n.prototype.fit=function(){var t=this.be,n=this.p.size,i=n.x,r=n.y,e=1e-5;if(e<Math.abs(i-t.x)||e<Math.abs(r-t.y)){t.set(i,r);var u=this.ve,s=e<Math.abs(u.x),h=e<Math.abs(u.y);if(s||h){var o=s?i/u.x:1,a=h?r/u.y:1,c=this.k,f=this.ge;if(null==f){f=[],this.ge=f;for(var l=0,v=c.length;l<v;l+=2){var b=c[l],d=c[l+1];c[l]=b*o,c[l+1]=d*a,f.push(b,d)}}else for(l=0,v=c.length;l<v;l+=2)c[l]=f[l]*o,c[l+1]=f[l+1]*a;if(this.R===this.de){var g=this.me;if(null!=g){var m=g.values,w=this.we;if(null==w)for(w=[],this.we=w,l=0,v=m.length;l<v;l+=2)b=m[l],d=m[l+1],m[l]=b*o,m[l+1]=d*a,w.push(b,d);else for(l=0,v=m.length;l<v;l+=2)m[l]=w[l]*o,m[l+1]=w[l+1]*a;var p=g.boundary,O=this.pe;if(null==O)for(O=[0,0,0,0],this.pe=O,l=0,v=p.length;l<v;l+=2)b=p[l],d=p[l+1],p[l]=b*o,p[l+1]=d*a,O[l]=b,O[l+1]=d;else for(l=0,v=p.length;l<v;l+=2)p[l]=O[l]*o,p[l+1]=O[l+1]*a;this.de+=1}}this.R+=1}}},Object.defineProperty(n.prototype,"id",{get:function(){return this.fit(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.fit(),this.k},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.L},set:function(t){this.set(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=this.newMarker(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){return this.A},n.prototype.newMarker=function(){return new ae(this)},n.prototype.onMarkerTypeChange=function(){var t=this.p;t.uploaded=void 0,t.toDirty()},n.prototype.onMarkerSizeChange=function(){this.p.updateUploaded()},n.prototype.onMarkerFillChange=function(){this.p.updateUploaded()},Object.defineProperty(n.prototype,"formatter",{get:function(){return this.Oe||null},set:function(t){this.Oe!==t&&(this.de=-1,this.Oe=t,this.toDirty(!0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){this.fit();var t=this.R,n=this.me;if(this.de!==t){this.de=t;var i=this.B,r=this.Oe;if(null==r&&i&z.CURVE&&(r=ee),null!=r){null==n&&(n={length:0,values:[],segments:[],boundary:[0,0,0,0],style:z.NONE});var e=this.ge,u=this.L;if(null!=e){r(e.length>>1,e,u,i,n),ue(n.values,n.boundary);var s=n.values,h=s.splice(0);this.we=h;var o=n.boundary,a=[o[0],o[1],o[2],o[3]];this.pe=a,this.toScaled(s,h,o,a)}else{var c=this.k;r(c.length>>1,c,u,i,n),ue(n.values,n.boundary),this.we=void 0,this.pe=void 0}}else n=void 0,this.we=void 0,this.pe=void 0;this.me=n}return n||this},enumerable:!1,configurable:!0}),n.prototype.toScaled=function(t,n,i,r){var e=this.be,u=this.ve,s=1e-5,h=s<Math.abs(u.x),o=s<Math.abs(u.y);if(h||o){for(var a=h?e.x/u.x:1,c=o?e.y/u.y:1,f=0,l=n.length;f<l;f+=2)t[f]=n[f]*a,t[f+1]=n[f+1]*c;for(f=0,l=r.length;f<l;f+=2)i[f]=r[f]*a,i[f+1]=r[f+1]*c}},n.prototype.copy=function(t){this.set(t.values,t.segments,t.style);var n=t.getMarker();return n&&this.marker.copy(n),this},n.prototype.set=function(t,n,i){var r=!1,e=!1,u=this.B,s=u&z.FORMATTER_MASK,h=this.Oe;if(null!=t){var o=this.k,a=this.le,c=t.length,f=Math.min(c,a);if(this.toFitted(),o!==t){for(var l=0;l<f;++l)o[l]=t[l];for(l=f;l<c;++l)o.push(t[l]);a!==c?(o.length=c,this.le=c,r=!0):null!=h||s?r=!0:e=!0}else a!==c?(this.le=c,r=!0):null!=h||s?r=!0:e=!0}if(null!=n){var v=this.L;if(v!==n){var b=n.length;for(f=Math.min(v.length,b),l=0;l<f;++l)v[l]=n[l];for(l=f;l<b;++l)v.push(n[l]);v.length!==b&&(v.length=b)}null!=h||s?r=!0:e=!0}return null!=i&&u!==i&&(s!==(i&z.FORMATTER_MASK)||(null!=h||s)&&(u&z.CLOSED)!=(i&z.CLOSED)?r=!0:e=!0,this.B=i),(e||r)&&this.toDirty(r),this},n.prototype.toDirty=function(t){if(t){this.R+=1;var n=this.p,i=n.uploaded;i?i.isCompatible(n)?n.updateUploaded():(n.uploaded=void 0,n.toDirty()):n.updateUploaded()}else this.R+=1,this.p.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){var n=JSON.stringify(this.k),i=JSON.stringify(this.L),r=this.B,e=-1,u=this.A;return u&&(e=u.serialize(t)),t.addResource("[".concat(n,",").concat(i,",").concat(r,",").concat(e,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.set(r[0],r[1],r[2]);var e=r[3];null!=e&&0<=e&&this.marker.deserialize(e,n)}},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o){var a=this.formatted,c=a.length;if(2<=c){var f=a.values,l=a.segments,v=a.style,b=0,d=c;if(s){var g=n.WORK_RANGE;s(t,i,u,f,g),b=g[0],d=g[1]}for(var m=b,w=Math.min(d,c-1);m<w;++m){var p;if(Yr(l,m+1)<0&&h(t,i,f[0+(p=m<<1)],f[p+1],f[p+2],f[p+3],m,u,o))return!0}if(2<c&&c<=d&&v&z.CLOSED&&Yr(l,0)<0&&h(t,i,f[0+(p=(m=c-1)<<1)],f[p+1],f[0],f[1],m,u,o))return!0}return!1},n.WORK_RANGE=[0,0],n}(),fe=function(){function t(t,n){this.p=t,this.R=0,this.k=[],this.ne=0,this.Kt=!1,this.ut=n}return t.prototype.lock=function(){this.ne+=1,1===this.ne&&(this.Kt=!1)},t.prototype.unlock=function(){this.ne-=1,0===this.ne&&(this.Kt&&this.onChange(),this.Kt=!1)},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this.k},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t){if(null!=t){if(this.R+=1,this.k!==t){for(var n=t.length,i=this.k,r=0;r<n;++r)i[r]=t[r];i.length=n}this.onChange()}return this},t.prototype.copy=function(t){return this.set(t.values)},t.prototype.serialize=function(t){return t.addResource(JSON.stringify(this.k))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.set(e)}},t.prototype.onChange=function(){0<this.ne?this.Kt=!0:this.ut()},t}(),le=function(t){function n(n){void 0===n&&(n=r.CONNECTOR_LINE);var i=t.call(this,n)||this;i.De=0,i.Ee=0,i.Me=0,i.Se=0,i.je=0,i.Te=0,i.Ne=0,i.ne=0,i.Kt=!1;var e=.5*q.SIZE_X,u=.5*q.SIZE_Y;i.Tt=new ce(i).set([-e,-u,+e,+u]);var s=function(){i.onChange()};return i.Kr=new Kr(i,s),i.Ie=new fe(i,s),i}return _(n,t),n.prototype.lock=function(){this.ne+=1,1===this.ne&&(this.Kt=!1)},n.prototype.unlock=function(){this.ne-=1,0===this.ne&&(this.Kt&&this.onChange(),this.Kt=!1)},Object.defineProperty(n.prototype,"points",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edge",{get:function(){return this.Kr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this.Ie},enumerable:!1,configurable:!0}),n.prototype.onAttach=function(){t.prototype.onAttach.call(this),this.Kr.attach()},n.prototype.onDetach=function(){this.Kr.detach(),t.prototype.onDetach.call(this)},n.prototype.onChange=function(){var t;if(0<this.ne)this.Kt=!0;else{var i=this.Kr,r=i.tail,e=r.localId,u=r.normalId,s=r.margin,h=i.head,o=h.localId,a=h.normalId,c=h.margin,f=this.Ie,l=f.id;if(this.De!==e||this.Ee!==u||this.Me!==s||this.Se!==o||this.je!==a||this.Te!==c||this.Ne!==l){this.De=e,this.Ee=u,this.Me=s,this.Se=o,this.je=a,this.Te=c,this.Ne;var v=this.transform,b=v.position,d=b.x,g=b.y,m=this.Tt,w=m.values;this.fillPoints(r,s,h,c,f,d,g,w);var p=null!==(t=n.WORK_BOUNDARY)&&void 0!==t?t:n.WORK_BOUNDARY=[0,0,0,0];ue(w,p);for(var O=.5*(p[2]+p[0]),D=.5*(p[3]+p[1]),E=p[2]-p[0],M=p[3]-p[1],S=0,j=w.length;S<j;S+=2)w[S+0]-=O,w[S+1]-=D;this.disallowUploadedUpdate(),b.set(d+O,g+D),v.scale.set(1,1),v.rotation=0,v.skew.set(0,0),this.size.set(E,M),m.toFitted(),m.set(w),this.allowUploadedUpdate()}}},n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=1e-6,a=t.local,c=a.x-u,f=a.y-s,l=i.local,v=l.x-u,b=l.y-s,d=e.values,g=d.length;if(h[0]=c,h[1]=f,0<g)for(var m=.5*(v+c),w=.5*(b+f),p=v-c,O=b-f,D=Math.atan2(O,p),E=Math.cos(D),M=Math.sin(D),S=Math.sqrt(p*p+O*O),j=0;j<g;j+=2){var T=d[j+0],N=d[j+1];h[j+2]=m+(E*T-M*N)*S,h[j+3]=w+(E*N+M*T)*S}if(h[2+g]=v,h[3+g]=b,0!==n&&o<(p=h[2]-c)*p+(O=h[3]-f)*O){var I=n/Math.sqrt(p*p+O*O);h[0]=c+p*I,h[1]=f+O*I}0!==r&&o<(p=h[0+g]-v)*p+(O=h[1+g]-b)*O&&(I=r/Math.sqrt(p*p+O*O),h[2+g]=v+p*I,h[3+g]=b+O*I),h.length=g+4},n.prototype.copy=function(i,r){return void 0===r&&(r=at.ALL),t.prototype.copy.call(this,i,r),i instanceof n&&(this.Kr.copy(i.edge),this.Ie.copy(i.body)),this},n.prototype.clone=function(){return new(0,this.constructor)(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.Kr.serialize(n),e=this.Ie.serialize(n),u=this.Tt.serialize(n);return i[15]=n.addResource("[".concat(r,",").concat(u,",").concat(e,"]")),i},n}(rn),ve=function(){function t(){}return t.isConnector=function(t){return t instanceof le},t.newMapping=function(n,i,r){var e;null==r&&(r=null!==(e=t.Ce)&&void 0!==e?e:t.Ce=new Map).clear();for(var u=0,s=n.length;u<s;++u){var h=n[u],o=i[u];r.set(h,o),this.newMapping(h.children,o.children,r)}return r},t.moveAll=function(t,n,i,r,e){for(var u=0,s=i.length;u<s;++u){var h=i[u],o=r[u];if(this.isConnector(h)&&this.isConnector(o)){var a=h.edge,c=o.edge,f=a.head,l=f.acceptor.shape;if(l){null==e&&(e=this.newMapping(t,n));var v=e.get(l);if(v){var b=c.head;b.detach(),b.set(v),b.attach(),v.connector.remove(f)}}var d=a.tail,g=d.acceptor.shape;if(g){null==e&&(e=this.newMapping(t,n));var m=e.get(g);if(m){var w=c.tail;w.detach(),w.set(m),w.attach(),m.connector.remove(d)}}}e=this.moveAll(t,n,h.children,o.children,e)}return e},t.move=function(t,n){var i=t.children,r=n.children;this.moveAll(i,r,i,r)},t}(),be=function(){function n(n,i,r,e,u){this.id=n,this.ref=0;var s=u.resolution;this.frame=new t.Rectangle(0,0,i*s,r*s),this.texture=new t.Texture(u,new t.Rectangle(0,0,1,1)),this.width=i,this.height=r,this.strokeWidth=e}return n.prototype.applyFrame=function(){var t=1/this.texture.baseTexture.resolution;this.texture.frame.x=this.frame.x*t,this.texture.frame.y=this.frame.y*t,this.texture.frame.width=this.width,this.texture.frame.height=this.height,this.texture.updateUvs(),this.texture.emit("update",this)},n.prototype.destroy=function(){this.texture.destroy()},n}(),de=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){},n}(be),ge=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.save(),t.fillStyle="#ffffff",t.fillRect(n.x-1,n.y-1,n.width+2,n.height+2),t.restore()},n}(be),me=function(){function n(n){var i=this.vr=document.createElement("canvas");i.width=i.height=256;var r=this.Ae=t.BaseTexture.from(i,{mipmap:t.MIPMAP_MODES.OFF,resolution:n});this.Re={},this.ke=[],this.Le={empty:new de("empty",10,10,0,r),white:new ge("white",10,10,0,r)},this.En=!0}return n.prototype.updateFrames=function(t,n){for(var i=4,r=4,e=0,u=0,s=n.length;u<s;++u){var h=n[u];t<i+h.frame.width+4&&(i=4,r+=e+4,e=0),h.frame.x=0|i,h.frame.y=0|r,i+=h.frame.width+4,e=Math.max(e,h.frame.height)}for(var o=r+e+4,a=256;a<o;)a<<=1;return Math.min(4096,a)},n.prototype.renderFrames=function(t,n,i){var r=this.vr;r.width=t,r.height=n;var e=r.getContext("2d");if(null!=e)for(var u=0,s=i.length;u<s;++u)i[u].render(e)},n.prototype.applyFrames=function(t){for(var n=0,i=t.length;n<i;++n)t[n].applyFrame()},n.prototype.calcCanvasWidth=function(t){for(var n=128,i=t.length-1;0<=i;--i)for(var r=t[i],e=Math.max(r.frame.width,r.frame.height);n<e;)n<<=1;return Math.min(4096,n<<1)},n.prototype.cleanup=function(t){t.sort(n.ITEM_COMPARATOR);for(var i=t.length-1;0<=i;--i)if(0<t[i].ref)return void(t.length=i+1);t.length=0},n.prototype.begin=function(){for(var t=this.ke,n=0,i=t.length;n<i;++n)t[n].ref=0;this.En=!1},n.prototype.end=function(){for(var t=this.Re,n=this.ke,i=0,r=n.length;i<r;++i){var e=n[i];e.ref<=0&&(e.id in this.Le||e.destroy(),delete t[e.id],this.En=!0)}},n.prototype.repack=function(t){if(!0===t||this.En){this.En=!1;var n=this.ke;this.cleanup(n);var i=this.calcCanvasWidth(n),r=this.updateFrames(i,n);this.renderFrames(i,r,n),this.Ae.setRealSize(i,r),this.applyFrames(n)}},n.prototype.get=function(t){var n=this.Re[t];if(null!=n)return n.ref+=1,n;var i=this.Le[t];return null!=i?(this.set(t,i),i):null},n.prototype.set=function(t,n){var i=this.Re[t];return n.ref+=1,this.Re[t]=n,this.ke.push(n),this.En=!0,i},n.prototype.toDirty=function(){this.En=!0},n.prototype.getDefaultTexture=function(){return this.get("white").texture},n.prototype.getBaseTexture=function(){return this.Ae},n.prototype.release=function(t){var n=this.Re,i=n[t];null!=i&&(i.ref-=1,i.ref<=0&&(i.id in this.Le||i.destroy(),delete n[t],this.En=!0))},n.ITEM_COMPARATOR=function(t,n){return t.ref<=0?n.ref<=0?0:1:n.ref<=0||t.frame.height<n.frame.height?-1:n.frame.height<t.frame.height?1:t.frame.width-n.frame.width},n}(),we=function(t){function n(n,i){var r=t.call(this,n.id,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.canvas=n.canvas,r}return _(n,t),n.prototype.render=function(t){var n=this.canvas;if(null!=n){var i=this.frame;t.drawImage(n,i.x,i.y,i.width,i.height)}},n}(be),pe="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",Oe=function(t,n){this.x=t,this.y=n},De=function(t,n,i,r,e){this.ref=1,this.life=10,this.character=t,this.x=0,this.y=0,this.width=i,this.height=r,this.advance=n,this.origin=new Oe(0,0),this.type=e},Ee={RESERVED:1,NON_BREAKING:2,SPACE:4,SPACE_R:5,SPACE_NB:6,SPACE_RNB:7,LETTER:8,LETTER_R:9,LETTER_NB:10,LETTER_RNB:11},Me=function(){function t(){var t=this;this.ye=null,this.xe=null,this.Be=null,this._e=NaN,this.Pe=NaN,this.Fe=NaN,this.Ue=NaN,this.Ge=null,this.He=null;var n=this.vr=document.createElement("canvas");n.width=64,n.height=64,this.ze=function(t){t.preventDefault()},this.Ve=function(){t.restore()},this.We=function(){t.destroy()},n.addEventListener("webglcontextlost",this.ze,!1),n.addEventListener("webglcontextrestored",this.Ve,!1),window.addEventListener("unload",this.We,!1)}return t.prototype.init=function(){var t=this.vr;if(null!=t&&(null==this.ye||this.ye.isContextLost())){var n={alpha:!0,antialias:!1,depth:!1,stencil:!1,premultipliedAlpha:!1},i=t.getContext("webgl",n)||t.getContext("experimental-webgl",n);this.ye=i,null!=i&&(i.clearColor(1,1,1,0),this.makeVertexBuffer(),this.makeUvBuffer(),this.makeShaders(),this.xe=null)}return this},t.prototype.restore=function(){this.init()},t.prototype.getCanvas=function(){return this.vr},t.prototype.getShader=function(t,n,i){var r=i?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);return null==r||(t.shaderSource(r,n),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))?r:(console&&console.error("Failed to compile the shader: ".concat(t.getShaderInfoLog(r))),null)},t.prototype.makeShaders=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.getShader(t,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying mediump vec2 vTextureCoord;\nvoid main(void) {\n\tgl_Position = vec4(aVertexPosition, 0.0, 1.0);\n\tvTextureCoord = aTextureCoord;\n}\n",!1);if(null!=n){var i=this.getShader(t,"\nprecision mediump float;\n\nvarying mediump vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec2 uSize;\n\nfloat calcDistance( float x, float y, float dx, float dy ) {\n\tfloat xd = x + dx;\n\tfloat yd = y + dy;\n\tfloat u = xd / uSize.x;\n\tfloat v = yd / uSize.y;\n\tfloat ul = (xd - 1.0) / uSize.x;\n\tfloat vt = (yd - 1.0) / uSize.y;\n\n\tfloat m = texture2D(uSampler, vec2(u , v )).a;\n\tfloat l = texture2D(uSampler, vec2(ul, v )).a;\n\tfloat t = texture2D(uSampler, vec2(u , vt)).a;\n\tfloat ddx = -(0.5 - m) / (l - m);\n\tfloat ddy = -(0.5 - m) / (t - m);\n\tbool bl = min(l,m) < 0.5 && 0.5 <= max(l,m);\n\tbool bt = min(t,m) < 0.5 && 0.5 <= max(t,m);\n\treturn (\n\t\tbl ?\n\t\t(bt ?\n\t\t\tlength(vec2(dx + ddx * 0.5, dy + ddy * 0.5)) :\n\t\t\tlength(vec2(dx + ddx, dy))\n\t\t) :\n\t\t(bt ?\n\t\t\tlength(vec2(dx, dy + ddy)) :\n\t\t\t100.0\n\t\t)\n\t);\n}\n\nfloat calcDistancesY( float x, float y, float dx ) {\n\tfloat d = 100.0;\n\tfor( float dy=-6.0; dy<6.5; dy++ ) {\n\t\td = min( d, calcDistance( x, y, dx, dy ) );\n\t}\n\treturn d;\n}\n\nfloat calcDistances( float x, float y ) {\n\tfloat d = 100.0;\n\tfor( float dx=-6.0; dx<6.5; dx++ ) {\n\t\td = min( d, calcDistancesY( x, y, dx ) );\n\t}\n\treturn d;\n}\n\nvoid main(void) {\n\tfloat t = texture2D(uSampler, vTextureCoord).a;\n\tfloat x = vTextureCoord.x * uSize.x;\n\tfloat y = vTextureCoord.y * uSize.y;\n\tfloat d = min( 6.0, calcDistances( x, y ) ) / 12.0;\n\td = clamp( mix( 0.5 - d, 0.5 + d, step( 0.5, t ) ), 0.0, 1.0 );\n\tgl_FragColor = vec4(1.0, 1.0, 1.0, d);\n}\n",!0);if(null!=i){var r=this.Be=t.createProgram();if(null!=r)return t.attachShader(r,n),t.attachShader(r,i),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)?(t.deleteShader(n),t.deleteShader(i),t.useProgram(r),this._e=t.getAttribLocation(r,"aVertexPosition"),this.Pe=t.getAttribLocation(r,"aTextureCoord"),this.Fe=t.getUniformLocation(r,"uSampler"),this.Ue=t.getUniformLocation(r,"uSize"),t.useProgram(null),r):(console&&console.error("Failed to link the program: ".concat(t.getError())),t.deleteShader(n),t.deleteShader(i),null);t.deleteShader(n),t.deleteShader(i)}else t.deleteShader(n)}}return null},t.prototype.destroyShaders=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.Be;null!=n&&(this.Be=null,t.useProgram(null),t.deleteProgram(n))}},t.prototype.updateTexture=function(t){var n=this.ye,i=this.vr;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=t.width,e=t.height;i.width===r&&i.height===e||(i.width=r,i.height=e,n.viewport(0,0,r,e));var u=this.xe;return null==u?(u=this.xe=n.createTexture(),n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.bindTexture(n.TEXTURE_2D,null)):(n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.bindTexture(n.TEXTURE_2D,null)),u}return null},t.prototype.destroyTexture=function(){var t=this.ye,n=this.xe;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.xe=null,t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n))},t.prototype.makeVertexBuffer=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.Ge=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,1,1,1,-1,-1,1,-1]),t.STATIC_DRAW),n}return null},t.prototype.destroyVertexBuffer=function(){var t=this.ye,n=this.Ge;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.Ge=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.makeUvBuffer=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.He=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),t.STATIC_DRAW),n}return null},t.prototype.destroyUvBuffer=function(){var t=this.ye,n=this.He;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.He=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.render=function(){var t=this.ye,n=this.vr,i=this.Be,r=this.Ge,e=this.He,u=this.xe;if(null!=t&&!0!==t.isContextLost()&&null!=n&&null!=i&&null!=r&&null!=e&&null!=u){t.clear(t.COLOR_BUFFER_BIT),t.useProgram(i),t.bindBuffer(t.ARRAY_BUFFER,r);var s=this._e;t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,e);var h=this.Pe;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,u),t.uniform1i(this.Fe,0),t.uniform2f(this.Ue,n.width,n.height),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.bindTexture(t.TEXTURE_2D,null),t.bindBuffer(t.ARRAY_BUFFER,null),t.useProgram(null)}},t.prototype.read=function(t){var n=this.ye,i=this.vr;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=i.width,e=i.height;t.width=r,t.height=e;var u=t.getContext("2d");null!=u&&u.drawImage(i,0,0)}},t.prototype.destroy=function(){this.destroyVertexBuffer(),this.destroyUvBuffer(),this.destroyShaders();var t=this.vr;null!=t&&(this.vr=null,t.removeEventListener("webglcontextlost",this.ze,!1),t.removeEventListener("webglcontextrestored",this.Ve,!1),window.removeEventListener("unload",this.We,!1));var n=this.ye;if(null!=n){this.ye=null;var i=n.getExtension("WEBGL_lose_context");null!=i&&i.loseContext()}},t.getInstance=function(){return null==t.Xe&&(t.Xe=new t),t.Xe},t.Xe=null,t}(),Se=function(){function t(n){this.R="font-atlas:".concat(n),this.Ke=Me.getInstance().init(),this.vr=document.createElement("canvas"),this.Ye={family:t.toFontFamily(n),size:32,italic:!1},this.Je={},this.Ze=0,this.kt=1,this.pn=1,this.En=!0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.Ye},set:function(t){this.Ye.family=t.family,this.Ye.size=t.size,this.Ye.italic=t.italic},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this.vr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generator",{get:function(){return this.Ke},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"characters",{get:function(){return this.Je},enumerable:!1,configurable:!0}),t.prototype.begin=function(){this.Ze=0;var t=this.Je;for(var n in t)t[n].ref=0},t.prototype.end=function(){var t=this.Je;for(var n in t){var i=t[n];i.ref<=0&&(i.life-=1,i.life<=0&&(delete t[n],this.En=!0))}},t.prototype.addAscii=function(){this.addChar(" "," ",Ee.SPACE_R),this.addChar("\t"," ",Ee.SPACE_R),this.addChar("...","...",Ee.LETTER_RNB);for(var t=0,n=pe.length;t<n;++t){var i=pe[t];this.addChar(i,i,Ee.LETTER_RNB)}},t.prototype.addChar=function(t,n,i){var r=this.Je;if(!this.isIgnored(n)){var e=r[t];null!=e?(e.ref<=0&&(this.Ze+=1),e.ref+=1):(r[t]=new De(n,0,1,1,i),this.Ze+=1,this.En=!0)}},t.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},t.prototype.add=function(t,n){void 0===n&&(n=Ee.LETTER);for(var i=b.from(t);i.hasNext();){var r=i.next();this.addChar(r,r,n)}},t.prototype.get=function(t){return this.Je[t]},t.prototype.update=function(){if(this.En){var n=this.vr,i=this.Ke;if(null!=n&&null!=i){var r=n.getContext("2d");if(null!=r){this.En=!1;var e=this.Ye,u=this.Je,s=e.size+14,h=t.toPowerOf2(Math.ceil(Math.sqrt(this.Ze))*s);this.kt=h;var o=(e.italic?"italic ":"")+e.size+"px "+e.family;r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=0,r.fillStyle="#FFFFFF";var a=s>>1,c=0,f=0;for(var l in u){var v=u[l],b=r.measureText(v.character).width,d=Math.ceil(7+b+7),g=s;h<=c+d&&(c=0,f+=s),v.x=c,v.y=f,v.width=d,v.height=g,v.advance=b,v.origin.x=c+7,v.origin.y=f+a,c+=d}var m=this.pn=f+s;for(var l in n.width=h,n.height=m,r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=4,r.fillStyle="#FFFFFF",r.clearRect(0,0,h,m),u)v=u[l],r.fillText(v.character,v.origin.x,v.origin.y);return i.updateTexture(n),i.render(),i.read(n),!0}}}return!1},Object.defineProperty(t.prototype,"length",{get:function(){return this.Ze},enumerable:!1,configurable:!0}),t.prototype.toJson=function(){return{width:this.kt,height:this.pn,font:this.Ye,characters:this.Je}},t.prototype.toString=function(){return JSON.stringify(this.toJson())},t.prototype.destroy=function(){null!=this.Ke&&(this.Ke=null),null!=this.vr&&(this.vr=null);var t=this.Je;for(var n in t)delete t[n]},t.toFontFamily=function(n){return"auto"===n?t.getAutoFontFamily():n},t.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},t.getAutoFontFamily=function(){return null==t.FONT_FAMILY_AUTO&&(t.FONT_FAMILY_AUTO=Z.getInstance().get("DBase").getFontFamilly()),t.FONT_FAMILY_AUTO},t.FONT_FAMILY_AUTO=null,t}(),je=function(){function t(){this.qe={}}return t.prototype.begin=function(){var t=this.qe;for(var n in t)t[n].begin()},t.prototype.end=function(){var t=this.qe;for(var n in t){var i=t[n];0<i.length&&i.addAscii(),i.end(),i.length<=0&&(i.destroy(),delete t[n])}},t.prototype.add=function(t,n){var i=this.qe[t];if(null!=i)i.add(n);else{var r=new Se(t);r.add(n),this.qe[t]=r}},t.prototype.get=function(t){var n=this.qe[t];return null!=n?n:null},t.prototype.update=function(t){var n=this.qe,i=t.getBaseTexture();for(var r in n){var e=n[r];if(e.update()){var u=e.id,s=t.get(u);if(null!=s){var h=e.width,o=e.height,a=i.resolution;s.frame.width=h,s.frame.height=o,s.width=h/a,s.height=o/a,t.toDirty()}else t.set(u,new we(e,i))}}},t.prototype.destroy=function(){var t=this.qe;for(var n in t)t[n].destroy();this.qe={}},t}(),Te=function(t){function n(n,i){var r=t.call(this,n.src,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.image=n,r}return _(n,t),n.prototype.render=function(t){var n=this.frame,i=n.x,r=n.y,e=n.width,u=n.height,s=this.image;t.drawImage(s,i,r,e,u),t.drawImage(s,0,0,1,u,i-1,r-1,1,u+2),t.drawImage(s,0,0,e,1,i,r-1,e,1),t.drawImage(s,e-1,0,1,u,i+e,r-1,1,u+2),t.drawImage(s,0,u-1,e,1,i,r+u,e,1)},n}(be),Ne=function(t,n){this.texture=t,this.indexOffset=n},Ie=function(){function t(){this.index=0,this.baseTexture=null,this.units=[]}return t.prototype.begin=function(){this.index=0,this.baseTexture=null},t.prototype.push=function(t,n){if(this.index<this.units.length){var i=this.units[this.index];i.texture=t,i.indexOffset=n}else this.units.push(new Ne(t,n));this.index+=1},t.prototype.end=function(){this.units.length!==this.index&&(this.units.length=this.index)},t.prototype.destroy=function(){this.units.length=0},t}(),Ce=function(){function n(t,n){var i=3*t,r=i;this.vertices=new Float32Array(2*r),this.Qe=r,this.o=0,this.Sn=null,this.clippings=new Float32Array(3*r),this.$e=null,this.steps=new Float32Array(6*r),this.tu=null,this.colorFills=new Float32Array(4*r),this.nu=null,this.colorStrokes=new Float32Array(4*r),this.iu=null,this.uvs=new Float32Array(2*r),this.Tn=null;var e=r<=65535;this.indices=e?new Uint16Array(i):new Uint32Array(i),this.ru=t,this.l=0,this.indexCountRequested=0,this.Nn=null,this.eu=n,this.uu=new Ie,this.su=null}return n.prototype.updateVertices=function(){var t=this.Sn;t&&t.update()},n.prototype.updateClippings=function(){var t=this.$e;t&&t.update()},n.prototype.updateSteps=function(){var t=this.tu;t&&t.update()},n.prototype.updateColorFills=function(){var t=this.nu;t&&t.update()},n.prototype.updateColorStrokes=function(){var t=this.iu;t&&t.update()},n.prototype.updateUvs=function(){var t=this.Tn;t&&t.update()},n.prototype.updateIndices=function(){var t=this.Nn;t&&t.update()},n.prototype.getGeometry=function(){var n=this.su;return null==n&&(this.Sn=new t.Buffer(this.vertices,!1,!1),this.$e=new t.Buffer(this.clippings,!1,!1),this.tu=new t.Buffer(this.steps,!1,!1),this.nu=new t.Buffer(this.colorFills,!1,!1),this.iu=new t.Buffer(this.colorStrokes,!1,!1),this.Tn=new t.Buffer(this.uvs,!1,!1),this.Nn=new t.Buffer(this.indices,!1,!0),this.su=n=(new t.Geometry).addIndex(this.Nn).addAttribute("aPosition",this.Sn,2).addAttribute("aClipping",this.$e,3).addAttribute("aStep",this.tu,2).addAttribute("aAntialias",this.tu,4).addAttribute("aColorFill",this.nu,4).addAttribute("aColorStroke",this.iu,4).addAttribute("aUv",this.Tn,2)),n},n.prototype.upload=function(){this.eu.geometry.bind(this.getGeometry())},n.prototype.render=function(n){var i=this.eu;i.geometry.bind(this.getGeometry());var r=this.uu.units,e=r.length;if(0<e){for(var u=t.DRAW_MODES.TRIANGLES,s=null,h=r[0],o=0,a=3*h.indexOffset,c=0,f=t.Texture.WHITE,l=0,v=e-1;l<v;++l)s=h,o=a,c=(a=3*(h=r[l+1]).indexOffset)-o,f=s.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,o));c=3*this.l-a,f=h.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,a))}},n.prototype.isCompatible=function(t,n,i,r){return n.getBuffer()===this&&n.getVertexOffset()===i&&n.getIndexOffset()===r&&n.isCompatible(t)},n.prototype.update=function(t,n,i){var u=this.uu;u.begin();for(var s=0,h=0,o=t.get();null!=o&&null!=(a=o.uploaded)&&this.isCompatible(o,a,s,h);o=t.next())if(a.update(o),a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i)return t.next(),u.end(),this.o=s,this.l=h,0<u.units.length;for(;null!=o;o=t.next()){var a,c=e[o.type]||e[r.GROUP];if(null==c)break;if(null==(a=c(this,o,s,h,n)))break;if(a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i){t.next();break}}return u.end(),this.o=s,this.l=h,0<u.units.length},n.prototype.check=function(t,n,i,r){return this.indexCountRequested=r,t+i<=this.Qe&&n+r<=this.ru},n.prototype.destroy=function(){var t=this.su;t&&t.destroy(),this.uu.destroy()},n}(),Ae=[],Re=function(){this.index=0,this.shapes=Ae,this.current=null},ke=function(){function t(){this.hu=-1,this.ou=new Re,this.Xt=[this.ou],this.au=null}return t.prototype.reset=function(t,n){this.hu=0;var i=this.Xt[0];return i.index=-1,i.shapes=n,i.current=null,this.ou=i,null!=t?(this.au=t,t):this.next()},t.prototype.get=function(){return this.au},t.prototype.next=function(){for(;;){var t=this.ou,n=t.index+=1,i=t.shapes,r=n<i.length?t.current=i[n]:t.current=null;if(null==r)return e=this.hu-=1,u=this.Xt,0<=e?(h=u[e],this.ou=h,this.au=h.current):this.au=null;var e,u,s=r.children;if(!(0<s.length))return this.au=r,r;if((e=this.hu+=1)<(u=this.Xt).length)(h=u[e]).index=-1,h.shapes=s,h.current=null,this.ou=h;else{var h=new Re;u.push(h),h.index=-1,h.shapes=s,h.current=null,this.ou=h}}},t}(),Le=function(n){function i(r){var e=n.call(this,r)||this;return i.SHADER=i.SHADER||t.Shader.from("\nattribute vec2 aPosition;\nattribute vec3 aClipping;\nattribute vec2 aStep;\nattribute vec4 aAntialias;\nattribute vec4 aColorFill;\nattribute vec4 aColorStroke;\nattribute vec2 aUv;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mediump float shapeScale;\nuniform mediump float pixelScale;\nuniform mediump float antialiasWeight;\n\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nvec2 toInverse( in vec2 v ) {\n\treturn vec2( -v.y, v.x );\n}\n\nvec2 toTransformedPosition( in vec2 v ) {\n\treturn (projectionMatrix * translationMatrix * vec3(v, 1.0)).xy;\n}\n\nvec4 toAntialias01( in vec4 antialias ) {\n\t// Taylor series of 1 / ( 1 - a ) = 1 + a + a^2 + ....\n\treturn 1.0 + min( vec4( 1.0 ), antialias * pixelScale );\n}\n\nvec4 toAntialias2( in vec4 antialias, in float strokeWidth ) {\n\tfloat x = min( 0.4, 0.4 / 12.0 * antialias.x * pixelScale * antialiasWeight );\n\tfloat w = clamp( strokeWidth / antialias.y, 0.0, 1.0 ) * 0.4;\n\tfloat p = w * antialias.z + antialias.w;\n\tfloat y = 0.5 - p;\n\tfloat z = 0.5 - p - w;\n\treturn vec4( y, z, y - max( 0.01, y - x ), z - max( 0.01, z - x ) );\n}\n\nvec2 toPosition3456( in float type, in vec2 p, in vec2 pprev, in vec2 pnext, in float strokeWidth, out float shift ) {\n\tvec2 d0 = p - pprev;\n\tvec2 d1 = pnext - p;\n\tfloat l0 = dot( d0, d0 );\n\tfloat l1 = dot( d1, d1 );\n\tvec2 nd0 = normalize( toInverse( d0 ) );\n\tvec2 nd1 = normalize( toInverse( d1 ) );\n\tvec2 nd2 = 0.00001 < l1 ? nd1 : vec2(0.0, 0.0);\n\tvec2 n0 = 0.00001 < l0 ? nd0 : nd2;\n\tvec2 n1 = 0.00001 < l1 ? nd1 : n0;\n\tvec2 n0i = toInverse( n0 );\n\tvec2 n1i = toInverse( n1 );\n\tfloat direction = sign( 4.5 - type );\n\n\t// Offset\n\tfloat cross = dot( n0i, n1 );\n\tfloat crossInverse = ( 0.00001 < abs( cross ) ? 1.0 / cross : 0.0 );\n\tfloat b = dot(n1 - n0, n0) * crossInverse;\n\tfloat offsetSize = direction * strokeWidth * 0.5;\n\tvec2 offset = n1 + n1i * b;\n\n\t// Miter\n\tvec2 pmiter = p + offsetSize * offset;\n\tfloat miterAngle0 = dot( n0i, pmiter - pprev );\n\tfloat miterAngle1 = dot( n1i, pmiter - pnext );\n\tfloat miterLength = dot( offset, offset );\n\tfloat miterSide = direction * cross;\n\n\t// Bevel\n\tvec2 n = ( type == 4.0 || type == 6.0 ? n1 : n0 );\n\tvec2 pbevel = p + offsetSize * n;\n\n\t//\n\tvec2 presult = (\n\t\t0.0 <= miterSide ?\n\t\t( miterAngle0 < 0.0 && 0.0 <= miterAngle1 ? pmiter : pbevel ) :\n\t\t( miterLength < 6.0 ? pmiter : pbevel )\n\t);\n\tvec2 ni = ( type == 4.0 || type == 6.0 ? n1i : n0i );\n\tshift = dot( ni, p - presult );\n\treturn toTransformedPosition( presult );\n}\n\nvec2 toStep3456( in float type ) {\n\treturn ( type < 4.5 ? vec2( 1.0, 0.0 ) : vec2( 0.0, 1.0 ) );\n}\n\nvec4 toAntialias3456( in float strokeWidth ) {\n\tfloat a = antialiasWeight / max( 0.0001, strokeWidth );\n\treturn toAntialias01( vec4( a, a, a, a ) );\n}\n\nfloat toDotAndDashScale( in float scale, in float strokeWidthScale ) {\n\treturn (\n\t\tscale == 4.0 || scale == 5.0 || scale == 6.0 || scale == 7.0 ?\n\t\tstrokeWidthScale : 1.0\n\t);\n}\n\nvec4 toColorStroke3456( in float shift, in float scale ) {\n\tfloat x = aColorFill.x + shift;\n\tfloat y = scale * aColorFill.y;\n\tfloat z = scale * aColorFill.z;\n\tfloat w = aColorFill.w;\n\treturn vec4( x, y, z, w );\n}\n\nfloat toStrokeWidthScale( in float scale ) {\n\treturn (\n\t\tscale == 3.0 || scale == 7.0 ?\n\t\tshapeScale : (\n\t\t\tscale == 1.0 || scale == 5.0 ?\n\t\t\tmin( 1.0, shapeScale ) : (\n\t\t\t\tscale == 2.0 || scale == 6.0 ?\n\t\t\t\tmax( 1.0, shapeScale ) : 1.0\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec2 toStep01(in vec2 size, in vec2 weight, in vec2 strokeWidth) {\n\treturn weight / max(vec2(0.00001), vec2(1.0) - strokeWidth / size);\n}\n\nvec4 toAntialias01b(in vec2 size, in vec2 strokeWidth) {\n\treturn antialiasWeight / max(vec4(0.00001), vec4(size - strokeWidth, size));\n}\n\nvoid main(void) {\n\tvec2 p012 = toTransformedPosition( aPosition );\n\n\tfloat type = aClipping.z;\n\tfloat strokeWidthScale = toStrokeWidthScale( aStep.y );\n\tfloat strokeWidth = strokeWidthScale * aStep.x;\n\n\t// type === 0 or 1\n\tvec2 size01 = aAntialias.xy;\n\tvec2 weight01 = abs(aAntialias.zw - sign(aAntialias.zw));\n\tvec2 strokeWidth01 = step(vec2(0.0), aAntialias.zw) * strokeWidth;\n\tvec2 step01 = toStep01( size01, weight01, strokeWidth01 );\n\tvec4 a01 = toAntialias01( toAntialias01b( size01, strokeWidth01 ) );\n\n\t// type === 2\n\tvec4 a2 = toAntialias2( aAntialias, strokeWidth );\n\n\t// type === 3, 4, 5 or 6\n\tfloat shift3456 = 0.0;\n\tvec2 p3456 = toPosition3456( type, aPosition, aAntialias.xy, aAntialias.zw, strokeWidth, shift3456 );\n\tvec2 step3456 = toStep3456( type );\n\tvec4 a3456 = toAntialias3456( strokeWidth );\n\tvec4 colorStroke3456 = toColorStroke3456( shift3456, toDotAndDashScale( aStep.y, strokeWidthScale ) );\n\n\t//\n\tgl_Position = vec4( ( 2.5 < type ? p3456 : p012 ), 0.0, 1.0 );\n\tvAntialias = ( 1.5 < type ? ( 2.5 < type ? a3456 : a2 ) : a01 );\n\tvClipping = aClipping;\n\tvStep = ( 2.5 < type ? step3456 : step01 );\n\tvColorFill = ( 2.5 < type ? aColorStroke : aColorFill );\n\tvColorStroke = ( 2.5 < type ? colorStroke3456 : aColorStroke );\n\tvUv = aUv;\n}","\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float pixelScale;\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tfloat type = vClipping.z;\n\tvec2 v0 = vStep;\n\tvec2 v1 = vClipping.xy;\n\tvec2 v2 = v0 * vAntialias.xy;\n\tvec2 v3 = v1 * vAntialias.zw;\n\tvec2 d01 = ( v0.x < v0.y ? vec2( v0.y, v2.y ) : vec2( v0.x, v2.x ) );\n\tvec2 d02 = ( v1.x < v1.y ? vec2( v1.y, v3.y ) : vec2( v1.x, v3.x ) );\n\tvec4 d0 = vec4( d01.x, d02.x, d01.y, d02.y );\n\tvec4 d1 = vec4( dot( v0, v0 ), dot( v1, v1 ), dot( v2, v2 ), dot( v3, v3 ) );\n\tvec4 d = ( type == 1.0 ? d1 : d0 );\n\tvec2 s = smoothstep( 1.0 - (d.zw - d.xy), vec2( 1.0 ), d.xy );\n\tvec4 color01 = texture * (vColorStroke * (s.x - s.y) + vColorFill * (1.0 - s.x));\n\n\tfloat l = vColorStroke.x;\n\tfloat lp0 = vColorStroke.y;\n\tfloat lp1 = vColorStroke.z;\n\tfloat lt = vColorStroke.w;\n\tfloat ld = 0.5 * pixelScale;\n\tfloat lm = mod( l, lp0 + lp1 );\n\tfloat ls0 = ( 0.0 < lp1 ? smoothstep( 0.0, ld, lm ) - smoothstep( lp0, lp0 + ld, lm ) : 1.0 );\n\tfloat ls1 = ( 0.0 <= lt ? smoothstep( 0.0, ld, l ) - smoothstep( lt - ld, lt, l ) : 1.0 );\n\tvec4 color3456 = color01 * ls0 * ls1;\n\n\tvec2 a0 = vAntialias.xy;\n\tvec2 a1 = vAntialias.zw;\n\tvec2 a2 = vec2( texture.a );\n\tvec2 a = smoothstep( a0 - a1, a0 + a1, a2 );\n\tvec4 color2 = a.x * vColorFill + ( a.y - a.x ) * vColorStroke;\n\tgl_FragColor = ( type == 2.0 ? color2 : (2.5 < type ? color3456 : color01) );\n}"),e.cu=i.SHADER,e.fu=new ke,e.lu=e.getBufferSizeMax(r),e}return _(i,n),i.prototype.getBufferSizeMax=function(t){var n=t.context,i=n.extensions;return 1<n.webGLVersion||i.uint32ElementIndex?1431655765:21845},i.prototype.updateAtlas=function(t,n,i,r,e){var u=t.imageSrc;if(null!=u){var s=n.get(u);if(null!=s)t.texture=s.texture;else{var h=t.image;if(null!=h){var o=new Te(h,e);t.texture=o.texture,n.set(o.id,o)}else t.texture=r}}else t.texture=r;var a=t.text,c=a.value;0<c.length&&i.add(a.family,c)},i.prototype.updateAtlases=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];this.updateAtlas(h,n,i,r,e);for(var o=h.children,a=0,c=o.length;a<c;++a){var f=o[a];this.updateAtlas(f,n,i,r,e),this.updateAtlases(f.children,n,i,r,e)}}},i.prototype.updateFontAtlas=function(t,n,i,r){var e=t.text,u=i.get(e.family);if(null!=u){var s=n.get(u.id);null!=s?(e.atlas=u,e.texture=s.texture):(e.atlas=void 0,e.texture=r)}else e.atlas=void 0,e.texture=r},i.prototype.updateFontAtlases=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];this.updateFontAtlas(s,n,i,r);for(var h=s.children,o=0,a=h.length;o<a;++o){var c=h[o];this.updateFontAtlas(c,n,i,r),this.updateFontAtlases(c.children,n,i,r)}}},i.prototype.vu=function(n,i,r,e){var u=this.renderer,s=this.cu;if(null!=s&&(null!=i||0<r.length)){var h=u.resolution,o=n.getBuffers(),a=n.getAntialiasWeight(h);if(e){var c=n.getAtlas(h),f=n.getFontAtlases();c.begin(),f.begin();var l=c.getDefaultTexture(),v=c.getBaseTexture();this.updateAtlases(r,c,f,l,v),f.end(),f.update(c),this.updateFontAtlases(r,c,f,l),c.end(),c.repack(),this.updateBuffers(i,r,o,u,a)}s.uniforms.shapeScale=n.toShapeScale(),s.uniforms.pixelScale=n.toPixelScale(h),s.uniforms.antialiasWeight=a,s.uniforms.translationMatrix=n.worldTransform.toArray(!0),u.shader.bind(s,!1),u.state.setBlendMode(t.utils.correctBlendMode(t.BLEND_MODES.NORMAL,!0));var b=o.length;if(1<b)for(var d=0;d<b;++d)o[d].upload();for(d=0;d<b;++d)o[d].render(s)}},i.prototype.updateBuffers=function(t,n,i,r,e){var u=this.fu;u.reset(t,n);for(var s=0,h=0,o=5e3,a=this.lu;null!=u.get();){var c=null,f=!1;if(0<h?(c=new Ce(h,r),i.splice(s,0,c),f=!0):s<i.length?(c=i[s],f=!1):(c=new Ce(o,r),i.push(c),f=!1),c.update(u,e,f))h=0,s+=1;else{if(!((h=c.indexCountRequested)<=a))break;h=Math.ceil(h/o)*o,h=Math.min(h,a)}}if(s<i.length){for(var l=s,v=i.length;l<v;++l)i[l].destroy();i.length=s}},i.SHADER=null,i}(t.ObjectRenderer),ye=function(n){function i(){var i=n.call(this)||this;return i.bu=null,i.children=[],i.Xr=null,i.du=0,i.gu=-1,i.mu=null,i.wu=new je,i.pu=1,i.Ou=NaN,i.Du=1,i.Eu=NaN,i.Mu=new t.Point,i.Su=[],i}return _(i,n),i.prototype.calculateBounds=function(){this._bounds.clear()},i.prototype.onChildTransformChange=function(){},i.prototype.toDirty=function(){return this.du+=1},i.prototype.isDirty=function(){return this.gu<this.du},i.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var n=this.du,i=this.gu;this.gu=n;var r=i<n,e=this.bu;null==e&&(e=this.bu=new Le(t)),t.batch.setObjectRenderer(e);var u=this.mask,s=this.Xr,h=this.children;u?(t.mask.push(this,u),e.vu(this,s,h,r),t.mask.pop(this)):e.vu(this,s,h,r)}},i.prototype.containsPoint=function(t){return!1},i.prototype.getFontAtlases=function(){return this.wu},i.prototype.getAtlas=function(t){var n=this.mu;return null==n&&(n=new me(t),this.mu=n),n},i.prototype.getBuffers=function(){return this.Su},i.prototype.toShapeScale=function(){this.updateTransform();var t=this.transform,n=t._worldID;if(n!==this.Eu){this.Eu=n;var i=t.worldTransform,r=i.a,e=i.b;this.Du=1/Math.sqrt(r*r+e*e)}return this.Du},i.prototype.getShapeScale=function(){return this.Du},i.prototype.toPixelScale=function(t){var n=this.toShapeScale(),i=this.Eu;return this.Ou!==i&&(this.Ou=i,this.pu=1/t*n),this.pu},i.prototype.getPixelScale=function(){return this.pu},i.prototype.getAntialiasWeight=function(t){return 1.25/t},i.prototype.hitTest=function(t,n){for(var i=this.Mu,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible){u.toLocal(t,void 0,i);var s=u.contains(i.x,i.y);if(null!=s&&(null==n||n(s)))return s}}return null},i.prototype.hitTestBBox=function(t,n){for(var i=this.Mu,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible&&(u.toLocal(t,void 0,i),u.containsBBox(i.x,i.y)&&(null==n||n(u))))return u}return null},i.prototype.destroy=function(){var t=this.Su;if(null!=t)for(var i=0,r=t.length;i<r;++i)t[i].destroy();this.Su.length=0;var e=this.children;for(i=e.length-1;0<=i;--i)e[i].destroy();e.length=0,n.prototype.destroy.call(this)},i}(t.DisplayObject),xe=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED_LAYER);var s=t.call(this,i,e,u)||this;return s.Gr=n,s}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),n.prototype.newGroupFill=function(){return new $(this,!1,16777215,1)},n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=q.SIZE_X,r=q.SIZE_Y;return new kr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}t.onChildTransformChange(),t.toDirty();var u=this.size;if(u instanceof kr){var s=u.base;t.size.set(s.x,s.y).init().set(u.x,u.y)}else t.size.init();return t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Gr,this.Fr,this.Ur,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n}(xr),Be=function(){function t(){}return t.toLayers=function(t,n){var i=[],r=this.toLayer(t);if(r){var e=r.parent;if(e)for(var u=e.children,s=u.length,h=0,o=n.length;h<o;++h){var a=n[h];0<=a&&a<s&&i.push(u[a])}}return i},t.toLayer=function(t){for(var n=t.parent;null!=n;){if(n instanceof ye)return n;if(n instanceof xe)return n;n=n.parent}return null},t.show=function(t){return!t.visible&&(t.visible=!0,!0)},t.showAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible||(e.visible=!0,n=!0)}return n},t.hide=function(t){return!!t.visible&&(t.visible=!1,!0)},t.hideAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible&&(e.visible=!1,n=!0)}return n},t.bringToFront=function(t){var n=t.parent;return!!n&&this.doBringToFront(t,n.children,0)},t.bringAllToFront=function(t){var n=t.length;if(0<n){var i=t[0].parent;if(i){for(var r=!1,e=i.children,u=0;u<n;++u){var s=t[n-1-u];this.doBringToFront(s,e,u)&&(r=!0)}return r}}return!1},t.doBringToFront=function(t,n,i){for(var r=n.length-1-i,e=r;0<=e;--e){var u=n[e];if(u===t){if(e!==r){for(var s=e+1;s<=r;++s)n[s-1]=n[s];return n[r]=u,!0}return!1}}return!1},t}(),_e={NONE:0,DRAG:1,PINCH:2,ALL:3},Pe=t.interaction.InteractionEvent,Fe=function(n){function i(t){var i=n.call(this,t,cn.NONE)||this;return i.ju=new Map,i.Tu=t.operationType,i.Nu=t.scaleMin,i.Iu=t.scaleMax,i}return _(i,n),i.prototype.initialize=function(t,i){if(n.prototype.initialize.call(this,t,i),null==this.ju.get(t)){var r=Be.toLayer(t);null!=r&&this.ju.set(t,r)}},i.prototype.onDown=function(t,i,r){if(n.prototype.onDown.call(this,t,i,r),r instanceof Pe){var e=this.ju.get(t),u=r.data.originalEvent.timeStamp;e&&this.condition(t,u,ln)&&this.getGestureUtil().onDown(e,r)}},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new mr({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.Tu,c=!1,f=1;if(a&_e.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Iu,Math.max(this.Nu,v*u));f=b/v,l.set(b,b),c=!0}if(a&_e.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&st.update(t)}},i.prototype.toSize=function(t,n){return"size"in t?n.copyFrom(t.size):n.set(t.width,t.height),n},i}(dn),Ue=t.interaction.InteractionEvent,Ge=function(n){function i(t){var i=n.call(this,t,cn.NONE)||this;return i.Tu=t.operationType,i.Nu=t.scaleMin,i.Iu=t.scaleMax,i}return _(i,n),i.prototype.onDown=function(t,i,r){n.prototype.onDown.call(this,t,i,r),r instanceof Ue&&this.condition(t,r.data.originalEvent.timeStamp,ln)&&this.getGestureUtil().onDown(t,r)},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new mr({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.Tu,c=!1,f=1;if(a&_e.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Iu,Math.max(this.Nu,v*u));f=b/v,l.set(b,b),c=!0}if(a&_e.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&st.update(t)}},i}(dn),He={SHAPE:0,LAYER:1},ze={INPUT_TEXT:0,INPUT_INTEGER:1,INPUT_REAL:2,EMIT_EVENT:3,WRITE_BOTH:4,WRITE_LOCAL:5,WRITE_REMOTE:6,HTML_ELEMENT:7,HTML_ELEMENT_WITHOUT_POINTER_EVENTS:8,SHOW_HIDE_LAYER:9,GESTURE_LAYER:10,GESTURE:11,EXECUTE:12},Ve=function(t){function n(n,i,r,e,u){void 0===n&&(n=""),void 0===e&&(e=.05),void 0===u&&(u=20);var s=t.call(this,Tn.GESTURE,n,i)||this;return s.operationType=r,s.scaleMin=e,s.scaleMax=u,s}return _(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case He.SHAPE:return new Ge(this);case He.LAYER:return new Fe(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.operationType,",").concat(this.scaleMin,",").concat(this.scaleMax,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),this.toSubType(t),t[3],t[4],t[5])},n.toSubType=function(t){if(t[0]!==Tn.MISC)return t[2];switch(t[2]){case ze.GESTURE:return He.SHAPE;case ze.GESTURE_LAYER:return He.LAYER}},n}(jn),We={INVISIBLE:"INVISIBLE",INTERACTIVE:"INTERACTIVE",DRAGGABLE:"DRAGGABLE",PINCHABLE:"PINCHABLE"},Xe=function(t,n,i,r,e){var u,s,h,o=function(t,n){if(Ot(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""}(t[0],n),a=e?e(o,n):new xe(o,n.mode,n.depth),c=t[1];null==c||2&c||(a.visible=!1,a.state.add(We.INVISIBLE));var f=-.5*i+(t[2]||0),l=-.5*r+(t[3]||0);a.transform.position.set(f,l);var v=null!==(u=t[4])&&void 0!==u?u:i,b=null!==(s=t[5])&&void 0!==s?s:r;a.size.set(v,b),a.size.init();var d=t[6];if(null!=d&&a.fill.deserialize(d,n),n.mode===jr.VIEWER){var g=null!==(h=t[7])&&void 0!==h?h:1,m=1&g,w=2&g,p=4&g;if(w||p){var O=(w?_e.DRAG:_e.NONE)|(p?_e.PINCH:_e.NONE);a.action.add(new Ve("",He.LAYER,O))}(m||w||p)&&(a.interactive=!0)}return a},Ke=function(){function t(t,n){this.children=[],this.kt=t,this.pn=n}return t.prototype.hasConnectors=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r instanceof le)return!0;var e=r.children;if(0<e.length&&this.hasConnectors(e))return!0}return!1},t.prototype.newHasConnectors=function(){for(var t=new Map,n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];t.set(e,this.hasConnectors(e.children))}return t},t.prototype.copyTo=function(t){for(var n,i=null!==(n=this.Cu)&&void 0!==n?n:this.Cu=this.newHasConnectors(),r=this.children,e=t.children,u=0,s=r.length;u<s;++u){var h=r[u],o=h.clone();o.parent=t,e.push(o),i.get(h)&&ve.move(h,o)}t.onChildTransformChange(),t.toDirty(),t.onAttach()},t.prototype.deserialize=function(t,n){var i=t.length;if(0<i)for(var r=this.kt,e=this.pn,u=0;u<i;++u)this.children.push(Xe(t[u],n,r,e))},t}(),Ye=function(){function t(){}return t.toSimple=function(t){return{version:t.version,id:t.id,name:t.name,thumbnail:t.thumbnail,data:JSON.stringify({width:t.width,height:t.height,background:t.background,tile:t.tile,resources:t.resources,data:t.data||t.tags,pieces:t.pieces,layers:t.layers,items:t.items,snap:t.snap})}},t.toSerialized=function(t){if(!("items"in t)){var n=JSON.parse(t.data),i={version:t.version,id:t.id,name:t.name,width:n.width,height:n.height,background:n.background,tile:n.tile,resources:n.resources,data:n.data||n.tags,pieces:n.pieces,layers:n.layers,items:n.items,snap:n.snap,thumbnail:t.thumbnail};if(null==i.data){var r=t.tags;null!=r&&(i.data=JSON.parse(r))}if(null==i.pieces){var e=t.pieces;null!=e&&(i.pieces=JSON.parse(e))}return i}return t},t.newLayer=function(t,n,i){n.deserialize(t.layers,i);var r=t.items,e=Fr(r,i);return null!=e?e.then((function(t){for(var i=n.children,e=0,u=t.length;e<u;++e){var s=r[e],h=t[e];null!=(o=i[s[16]])&&(h.parent=o,h.uploaded=void 0,o.children.push(h))}for(e=0,u=i.length;e<u;++e){var o;(o=i[e]).onChildTransformChange(),o.toDirty();for(var a=o.children,c=0,f=a.length;c<f;++c)a[c].onAttach()}return t})):Promise.resolve([])},t.toPieceData=function(t,n,i){var r=new Map,e=new Map,u=function(){return r};return this.Au(t,n,r,e,i,0).then(u,u)},t.Au=function(t,n,i,r,e,u){var s=this,h=[];if(n&&0<n.length&&t)for(var o=function(o,a){var c=n[o],f=r.get(c);if(null!=f)h.push(f);else{var l=t.piece.getByName(c).then((function(n){return s.Ru(t,c,n,e,u+1,i,r)}),(function(){return null}));r.set(c,l),h.push(l)}},a=0,c=n.length;a<c;++a)o(a);return Promise.all(h)},t.Ru=function(t,n,i,r,e,u,s){var h=this,o=this.toSerialized(i),a=o.width,c=o.height,f=new Ke(a,c);u.set(n,new Gr(n,a,c,f));var l=o.pieces;return this.Au(t,l,u,s,r,e).then((function(){return h.newLayer(o,f,new Sr(o,l,u,r,e))}))},t}(),Je={},Ze=function(){function t(){}return t.isContainer=function(t){return t instanceof Dr},t.isEmbedded=function(t){return t instanceof Br},t.toContainer=function(t){for(var n=t;null!=n;){if(this.isContainer(n))return n;n=n.parent}return null},t.open=function(t,n,i,r){var e=Je[n];if(null!=e)e(i,r,t);else switch(n){case Er.DIAGRAM:var u=this.toContainer(t);if(u){var s=u.controller;s&&s.getByName(i).then((function(t){u.set(Ye.toSerialized(t))}))}break;case Er.PAGE:r?window.open(i):window.location.href=i}},t.writeLocal=function(t,n,i,r,e){var u;void 0===e&&(e=Pt.FOUND);for(var s=t;null!=s;){if(this.isContainer(s))return(s.data.private.set(n,i,r,e)||s.data.protected.set(n,i,r,e)||!!s.data.set(n,i,r,e))&&(st.update(s),!0);if(this.isEmbedded(s)&&(null===(u=s.data.getPrivate())||void 0===u?void 0:u.set(n,i,r,e)))return st.update(s),!0;s=s.parent}return!1},t.writeRemote=function(t,n,i){var r=this.toContainer(t);return!!r&&r.data.remote.set(n,i)},t.emit=function(n,i,r,e){var u=t.toContainer(n);void 0===e?(n.emit(i,n),u&&u.shape.emit(i,n)):(n.emit(i,r,e,n),u&&u.shape.emit(i,r,e,n))},t}(),qe=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.name=vn.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.name(t,i,ln);null!=r&&Ze.emit(t,r)}},n}(dn),Qe=function(t){function n(n,i){var r=t.call(this,Tn.EMIT_EVENT,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new qe(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),Nn.toResource(2,t,i.resources))},n}(Sn),$e=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofStringOrNull(n.target),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.target(t,i,ln);null!=r&&Ze.emit(t,r)}},n}(dn),tu={NO_POINTER_EVENTS:"NO_POINTER_EVENTS"},nu=function(){function n(t){var n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg");i.setAttribute("style","position: absolute;"),i.setAttribute("width","0px"),i.setAttribute("height","0px");var r=document.createElementNS(n,"defs"),e=document.createElementNS(n,"clipPath"),u="clipper_ex_".concat(Math.random().toString(32).substring(2));e.setAttribute("id",u),e.setAttribute("clipPathUnits","objectBoundingBox");var s=document.createElementNS(n,"path");this.ku=s,this.Lu="",s.setAttribute("clip-rule","evenodd"),e.appendChild(s),r.appendChild(e),i.appendChild(r),this.R=u,t.appendChild(i)}return Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.update=function(t,n,i){var r=this.toD(t,n,i);this.Lu!=r&&(this.ku.setAttribute("d",r),this.Lu=r)},n.prototype.toD=function(i,r,e){var u,s;if(null==i)return"";var h=i.width,o=i.height,a=1e-4;if(h<a||o<a)return"";if(e.size<=0)return"M0,0 h1 v1 h-1z";var c=null!==(u=n.WORK_MATRIX)&&void 0!==u?u:n.WORK_MATRIX=new t.Matrix;null!=r?(c.copyFrom(r),c.invert()):c.identity(),c.translate(-i.x,-i.y),c.scale(1/h,1/o);for(var f=-1,l=2,v=-1,b=2,d="",g=c.a,m=c.b,w=c.c,p=c.d,O=c.tx,D=c.ty,E=null!==(s=n.WORK_RECTS)&&void 0!==s?s:n.WORK_RECTS=[],M=this.toRects(e,E),S=0;S<M;S+=4){var j=E[S+0],T=E[S+1],N=E[S+2],I=E[S+3],C=g*j+w*T+O,A=m*j+p*T+D,R=g*N+w*T+O,k=m*N+p*T+D,L=g*N+w*I+O,y=m*N+p*I+D,x=g*j+w*I+O,B=m*j+p*I+D;f=Math.min(f,C,R,L,x),l=Math.max(l,C,R,L,x),v=Math.min(v,A,k,y,B),b=Math.max(b,A,k,y,B);var _=C.toFixed(5),P=A.toFixed(5),F=R.toFixed(5),U=k.toFixed(5),G=L.toFixed(5),H=y.toFixed(5),z=x.toFixed(5),V=B.toFixed(5);d+=" M".concat(_,",").concat(P," L").concat(F,",").concat(U," L").concat(G,",").concat(H," L").concat(z,",").concat(V,"Z")}return"M".concat(f,",").concat(v," L").concat(l,",").concat(v," L").concat(l,",").concat(b," L").concat(f,",").concat(b,"Z")+d},n.prototype.toRects=function(t,n){for(var i=t.data,r=t.size<<2,e=0;e<r;e+=4){var u=i[e+0],s=i[e+1],h=i[e+2],o=i[e+3];u<h?(n[e+0]=u,n[e+2]=h):(n[e+0]=h,n[e+2]=u),s<o?(n[e+1]=s,n[e+3]=o):(n[e+1]=o,n[e+3]=s)}for(e=4;e<r;e+=4){u=n[e+0],s=n[e+1],h=n[e+2],o=n[e+3];for(var a=0;a<e;a+=4){var c=n[a+0],f=n[a+1],l=n[a+2],v=n[a+3],b=0,d=0;if(u<=c)if(h<=l){if(h<=c)continue;b=2,d=1}else d=3;else if(h<=l)b=3;else{if(l<=u)continue;b=1,d=2}var g,m,w=0,p=0;if(s<=f)if(o<=v){if(o<=f)continue;w=2,p=1}else p=3;else if(o<=v)w=3;else{if(v<=s)continue;w=1,p=2}if(4==(g=0===b||0===w?0:1===b||2===b?3===w?2:1:3===w?4:2)){e+4<r&&(n[e+0]=n[r+0],n[e+1]=n[r+1],n[e+2]=n[r+2],n[e+3]=n[r+3]),e-=4,r-=4;break}if(4!=(m=0===d||0===p?0:1===d||2===d?3===p?2:1:3===p?4:2))if(0===g)if(0===m){for(O=r-4;a<O;O-=4)n[O+4]=n[O+0],n[O+5]=n[O+1],n[O+6]=n[O+2],n[O+7]=n[O+3];0===d?(n[a+3]=s,n[a+4]=c,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=h,n[a+5]=f,n[a+6]=l,n[a+7]=v),e+=4,r+=4,a+=4}else 2===m&&(1===d?n[a+0]=h:2===d?n[a+2]=u:1===p?n[a+1]=o:2===p&&(n[a+3]=s));else if(1===g){for(O=r-4;a<O;O-=4)n[O+4]=n[O+0],n[O+5]=n[O+1],n[O+6]=n[O+2],n[O+7]=n[O+3];1===d?1===p?(n[a+0]=h,n[a+4]=c,n[a+5]=o,n[a+6]=h,n[a+7]=v):(n[a+0]=h,n[a+4]=c,n[a+5]=f,n[a+6]=h,n[a+7]=s):1===p?(n[a+2]=u,n[a+4]=u,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=u,n[a+5]=f,n[a+6]=l,n[a+7]=s),e+=4,r+=4,a+=4}else 2===g&&(1===b?(n[e+0]=l,u=l):2===b?(n[e+2]=c,h=c):1===w?(n[e+1]=v,s=v):2===w&&(n[e+3]=f,o=f));else{for(var O=a+4;O<r;O+=4)n[O-4]=n[O+0],n[O-3]=n[O+1],n[O-2]=n[O+2],n[O-1]=n[O+3];e-=4,r-=4,a-=4}}}return r},n}(),iu=function(){function t(){this.Xt=[],this.T=0,this.hu=0,this.En=!0}return Object.defineProperty(t.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.T},enumerable:!1,configurable:!0}),t.prototype.isDirty=function(){return this.En},t.prototype.toClean=function(){this.En=!1},t.prototype.begin=function(){return this.hu=0,this},t.prototype.end=function(){var t=this.hu;this.T=t;var n=this.Xt,i=t<<2;return n.length!==i&&(n.length=i,this.En=!0),this},t.prototype.add=function(t,n,i,r){var e=this.hu<<2;this.hu+=1;var u=this.Xt;return e<u.length?u[e+0]===t&&u[e+1]===n&&u[e+2]===i&&u[e+3]===r||(u[e+0]=t,u[e+1]=n,u[e+2]=i,u[e+3]=r,this.En=!0):(u.push(t,n,i,r),this.En=!0),this},t}(),ru={CLICKED:0,DOUBLE_CLICKED:1,FOCUSED:2,ALWAYS:3},eu=function(){function n(t,n,i,r){var e=this;this.ei=t,this.yu=n;var u=this.toData(i,r);this.Xt=u,this.xu=!1,this.Bu=function(t){e.onElementFocus(t)},this._u=function(t){e.onBeforeFocus(t)},this.Pu=function(t){e.onAfterFocus(t)},this.Fu=!1,this.Uu=!1,this.Gu=function(){e.doSelect()},this.Hu=this.Xt.when===ru.ALWAYS,this.zu=function(){e.updateElement(e.Vu)}}return n.prototype.toData=function(t,n){var i,r;return{element:this.toElementData(t,null==n?void 0:n.element),clipper:this.toClipperData(t,null==n?void 0:n.clipper),before:this.toBeforeData(t,null==n?void 0:n.before),after:this.toAfterData(t,null==n?void 0:n.after),when:Ai(null!==(i=null==n?void 0:n.when)&&void 0!==i?i:t.getWhen(),ru),select:null!==(r=null==n?void 0:n.select)&&void 0!==r?r:t.getSelect()}},n.prototype.toElementData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getElementCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newElementStyler(t)}},n.prototype.newElementStyler=function(t){return function(n,i,r,e,u,s,h){return t.setElementStyle(n,i,r,e,u,s,h)}},n.prototype.toClipperData=function(t,n){var i,r,e;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getClipperCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newClipperStyler(t),extended:null!==(e=null==n?void 0:n.extended)&&void 0!==e?e:t.isClipperExEnabled()}},n.prototype.newClipperStyler=function(t){return function(n,i,r,e,u,s,h){return t.setClipperStyle(n,i,r,e,u,s,h)}},n.prototype.toBeforeData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getBeforeCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newBeforeStyler(t)}},n.prototype.newBeforeStyler=function(t){return function(n){t.setBeforeStyle(n)}},n.prototype.toAfterData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getAfterCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newAfterStyler(t)}},n.prototype.newAfterStyler=function(t){return function(n){t.setAfterStyle(n)}},Object.defineProperty(n.prototype,"element",{get:function(){var t;return null!==(t=this.Wu)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"when",{get:function(){return this.Xt.when},enumerable:!1,configurable:!0}),n.prototype.onDowning=function(t){switch(this.Uu=this.Fu,this.when){case ru.CLICKED:this.start();break;case ru.FOCUSED:this.ei.state.isFocused&&this.start()}},n.prototype.onDown=function(t){!this.Uu&&this.Fu&&("data"in t?t.data.originalEvent.preventDefault():t.preventDefault())},n.prototype.onDblClick=function(t,n){switch(this.when){case ru.DOUBLE_CLICKED:this.start()}},n.prototype.onFocus=function(){var t;switch(this.when){case ru.FOCUSED:this.start();break;default:null===(t=this.Wu)||void 0===t||t.focus()}},n.prototype.onBlur=function(){var t;switch(this.when){case ru.CLICKED:case ru.DOUBLE_CLICKED:case ru.FOCUSED:this.onEndByBlur(),this.cancel();break;default:null===(t=this.Wu)||void 0===t||t.blur()}},n.prototype.isStartable=function(){switch(this.when){case ru.CLICKED:case ru.DOUBLE_CLICKED:case ru.FOCUSED:return this.ei.state.isActionable;default:return!0}},n.prototype.start=function(){!this.Fu&&this.isStartable()&&(this.Fu=!0,this.ei.worldVisible?this.doStart():this.Hu=!0,st.update(this.ei))},n.prototype.isShown=function(){return this.xu},n.prototype.onRender=function(t){(this.Hu||!this.xu&&this.when===ru.ALWAYS)&&(this.Hu=!1,this.doStart(t)),this.Fu&&(this.Fu=!1)},n.prototype.getElementRect=function(n){var i=this.wn||new t.Point(0,0);this.wn=i;var r=this.Xu||new t.Rectangle;return this.Xu=r,this.yu.getElementRect(n,i,r)},n.prototype.getElementMatrix=function(){return this.yu.getElementMatrix()},n.prototype.getClipperRect=function(n){var i=this.wn||new t.Point(0,0);this.wn=i;var r=this.Ku||new t.Rectangle;return this.Ku=r,this.yu.getClipperRect(n,i,r)},n.prototype.fillClipperExRects=function(t,n){var i=this.yu;return i.getClipperExRects&&i.getClipperExRects(n),n.isDirty()},n.prototype.doStart=function(t){var n,i;if(!this.xu){this.xu=!0;var r=this.Vu;null!=r&&(this.Vu=void 0,r.off("postrender",this.zu));var e=this.ei;null==t&&(t=null===(n=st.getLayer(e))||void 0===n?void 0:n.renderer),t&&(this.Vu=t,t.on("postrender",this.zu)),this.onStart();var u=this.getClipper();if(u){var s=this.getBefore(u),h=this.getElement(u),o=this.getAfter(u),a=this.getClipperEx(u);if(h){var c=null!==(i=null==t?void 0:t.resolution)&&void 0!==i?i:st.getResolution(e),f=this.getElementRect(c),l=this.getElementMatrix(),v=this.toClipperRectAdjusted(f,l,this.getClipperRect(c)),b=e.state,d=this.yu.getPadding(),g=this.Xt;if(g.clipper.styler(u,b,d,f,l,v,a),g.element.styler(h,b,d,f,l,v,a),s&&g.before.styler(s),o&&g.after.styler(o),this.onElementAttached(h,s,o),a){var m=this.getClipperExRects();m&&this.fillClipperExRects(c,m)&&(a.update(f,l,m),m.toClean())}u.style.display="",b.isFocused&&this.toElementFocused(h),u.scrollTop=0,u.scrollLeft=0,this.Xt.select&&setTimeout(this.Gu,0)}}}},n.prototype.toElementFocused=function(t){t.focus({preventScroll:!0})},n.prototype.onStart=function(){this.yu.onStart()},n.prototype.doSelect=function(){var t=this.Wu;t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select()},n.prototype.cancel=function(){var t;if(this.xu){this.xu=!1;var n=this.Vu;null!=n&&(this.Vu=void 0,n.off("postrender",this.zu)),this.onCancel();var i=this.ei,r=st.getLayer(i);if(r){var e=r.view;switch(this.when){case ru.CLICKED:case ru.DOUBLE_CLICKED:case ru.FOCUSED:document.activeElement===this.Wu&&e.focus()}var u=i.state,s=r.renderer.plugins.interaction;this.yu.containsPoint(s.mouse.global)&&!u.isHovered&&(u.isHovered=!0,e.style.cursor=null!==(t=i.cursor)&&void 0!==t?t:""),r.update()}var h=this.Wu;null!=h&&this.onElementDetached(h,this.Yu,this.Ju);var o=this.Zu;null!=o&&(o.style.display="none")}},n.prototype.onCancel=function(){this.yu.onCancel()},n.prototype.onElementAttached=function(t,n,i){null==n||n.addEventListener("focus",this._u),null==i||i.addEventListener("focus",this.Pu),t.addEventListener("focus",this.Bu,!0)},n.prototype.onElementDetached=function(t,n,i){null==n||n.removeEventListener("focus",this._u),null==i||i.removeEventListener("focus",this.Pu),t.removeEventListener("focus",this.Bu,!0)},n.prototype.getClipper=function(){var t=this.Zu;if(null==t){var n=st.getLayer(this.ei);t=n?this.Xt.clipper.creator(n.getElementContainer()):null,this.Zu=t}return t},n.prototype.getClipperEx=function(t){var n=this.qu;return void 0===n&&(n=null!=this.getClipperExRects()?new nu(t):null,this.qu=n),n},n.prototype.getClipperExRects=function(){var t=this.Qu;return void 0===t&&(t=this.Xt.clipper.extended?new iu:null,this.Qu=t),t},n.prototype.getElement=function(t){var n=this.Wu;return null==n&&(n=this.Xt.element.creator(t),this.Wu=n),n},n.prototype.getBefore=function(t){var n=this.Yu;return null==n&&(n=this.Xt.before.creator(t),this.Yu=n),n},n.prototype.getAfter=function(t){var n=this.Ju;return null==n&&(n=this.Xt.after.creator(t),this.Ju=n),n},n.prototype.onBeforeFocus=function(t){var n=this.ei,i=st.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!1);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onAfterFocus=function(t){var n=this.ei,i=st.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!0);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onElementFocus=function(t){if(this.when===ru.ALWAYS){var n=this.ei;n.state.isFocused||n.focus()}},n.prototype.onEndByBlur=function(){this.onEnd()},n.prototype.onEnd=function(){this.yu.onEnd()},n.prototype.end=function(){this.onEnd(),this.cancel()},n.prototype.select=function(){return this.xu&&this.Xt.select&&this.doSelect(),this},n.prototype.toClipperRectAdjusted=function(t,n,i){if(i&&t&&null==n){var r=t.x,e=t.y,u=r+t.width,s=e+t.height,h=i.x,o=i.y,a=h+i.width,c=o+i.height,f=Math.min(Math.max(h,r),a),l=Math.min(Math.max(h,u),a),v=Math.min(Math.max(o,e),c),b=Math.min(Math.max(o,s),c);i.x=f,i.y=v,i.width=l-f,i.height=b-v}return i},n.prototype.updateElement=function(t){if(this.xu){var n=this.ei;if(n.worldVisible){var i=this.Wu,r=this.Zu,e=this.qu;if(i&&r){var u=t.resolution,s=this.getElementRect(u),h=this.getElementMatrix(),o=this.toClipperRectAdjusted(s,h,this.getClipperRect(u)),a=n.state,c=this.yu.getPadding(),f=this.Xt;if(f.clipper.styler(r,a,c,s,h,o,e),f.element.styler(i,a,c,s,h,o,e),e){var l=this.getClipperExRects();l&&this.fillClipperExRects(u,l)&&(e.update(s,h,l),l.toClean())}}}else switch(this.when){case ru.ALWAYS:(r=this.Zu)&&(r.style.display="none");break;default:this.cancel()}}},n.getClipperRect=function(t,n,i,r,e){for(var u=!0,s=0,h=0,o=0,a=0,c=t;c instanceof hr;){c.getClippingRect(n,e),r.set(e.x,e.y),c.toGlobal(r,r,!1);var f=(r.x*i|0)/i,l=(r.y*i|0)/i;r.set(e.x+e.width,e.y+e.height),c.toGlobal(r,r,!0);var v=r.x,b=r.y,d=Math.min(f,v),g=Math.min(l,b),m=Math.max(f,v),w=Math.max(l,b);u?(u=!1,s=d,h=g,o=m,a=w):(s=Math.min(Math.max(s,d),m),h=Math.min(Math.max(h,g),w),o=Math.min(Math.max(o,d),m),a=Math.min(Math.max(a,g),w)),c=c.parent}return u?null:(e.x=s,e.y=h,e.width=o-s,e.height=a-h,e)},n}(),uu=function(){function t(t){var n=t.transform,i=n.position;this.x=i.x,this.y=i.y;var r=t.size;this.sizeX=r.x,this.sizeY=r.y,this.rotation=n.rotation,this.actions=[],this.fill=t.fill.toObject(),this.stroke=t.stroke.toObject(),this.text=t.text.toObject(),this.cursor=t.cursor,this.reset=cn.NONE,this.written=cn.NONE,this.effect=NaN,this.isStateChanged=!1,this.interactive=!1}return t.prototype.initialize=function(t){t.disallowUploadedUpdate();for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].initialize(t,this);t.allowUploadedUpdate()},t.prototype.isActionable=function(){return 0<this.actions.length},t.prototype.onResize=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onResize(t,this)},t.prototype.onClick=function(t,n){var i=t.state;i.isActionable&&(i.isClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onClick(t,this,n)},t.prototype.onDblClick=function(t,n,i){var r=t.state;r.isActionable&&(r.isDblClicked=!0);for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onDblClick(t,this,n,i);return!1},t.prototype.onOver=function(t,n){var i=t.state;if(!i.isHovered){i.isHovered=!0;for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onOver(t,this,n)}},t.prototype.onOut=function(t,n){if(t.state.isHovered){t.state.isHovered=!1;for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onOut(t,this,n)}},t.prototype.onDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onDowning(t,this,n);var u=t.state;if(!u.isDown)if(u.isPressed)for(u.addAll(Mt.DOWN,ct.PRESSED),(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onDown(t,this,n),s.onPressed(t,this,n)}else{var h,o;for(u.isDown=!1,(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onDown(t,this,n)}},t.prototype.onUp=function(t,n){var i=t.state;if(!i.isUp)if(i.isPressed){i.set(Mt.UP,ct.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUp(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUp(t,this,n)}},t.prototype.onUpOutside=function(t,n){var i=t.state;if(i.isPressed){i.set(Mt.UP_OUTSIDE,ct.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUpOutside(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUpOutside(t,this,n)}},t.prototype.onMove=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onMove(t,this,n)},t.prototype.onKeyDown=function(t,n){nr.isActivateKey(n)&&this.onDown(t,n);for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onKeyDown(t,this,n);return!1},t.prototype.onKeyUp=function(t,n){if(nr.isActivateKey(n)){var i=t.state;if(i.isPressed){var r=i.isUp;this.onUp(t,n),!r&&i.isUp&&this.onClick(t,n)}}for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onKeyUp(t,this,n);return!1},t.prototype.onStateChange=function(t,n,i){this.isStateChanged=!0,st.update(t),n.isFocused?i.isFocused||this.onFocus(t):i.isFocused&&this.onBlur(t)},t.prototype.onFocus=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onFocus(t,this)},t.prototype.onBlur=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onBlur(t,this)},t.prototype.onRightClick=function(t,n){var i=t.state;i.isActionable&&(i.isRightClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRightClick(t,this,n)},t.prototype.onRightDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onRightDowning(t,this,n);var u=t.state;if(!u.isRightDown)if(u.isRightPressed)for(u.addAll(Mt.RIGHT_DOWN,Mt.RIGHT_PRESSED),(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onRightDown(t,this,n),s.onRightPressed(t,this,n)}else{var h,o;for(u.isRightDown=!1,(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onRightDown(t,this,n)}},t.prototype.onRightUp=function(t,n){var i=t.state;if(!i.isRightUp)if(i.isRightPressed){i.set(Mt.RIGHT_UP,Mt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUp(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUp(t,this,n)}},t.prototype.onRightUpOutside=function(t,n){var i=t.state;if(i.isRightPressed){i.set(Mt.RIGHT_UP_OUTSIDE,Mt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUpOutside(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUpOutside(t,this,n)}},t.prototype.update=function(n,i){var r=n.data,e=this.effect<=i;if(r.isChanged||this.isStateChanged||e){this.isStateChanged=!1,r.isChanged=!1,e&&(this.effect=NaN),n.disallowUploadedUpdate(),this.onUpdate(n,i),n.allowUploadedUpdate();var u=this.isStateChanged;n.state.removeAll(t.TRANSIENT_STATES),this.isStateChanged=u}},t.prototype.onRender=function(t,n,i){for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRender(t,this,n,i);this.update(t,n)},t.prototype.onUpdate=function(t,n){var i=this.actions;if(0<i.length){this.written=cn.NONE;for(var r=0,e=i.length;r<e;++r)i[r].execute(t,this,n);this.doReset(t)}},t.prototype.doReset=function(t){var n=~this.written&this.reset;if(n!==cn.NONE){if(n&cn.POSITION_X&&(t.transform.position.x=this.x),n&cn.POSITION_Y&&(t.transform.position.y=this.y),n&cn.VISIBILITY&&(t.visible=!0),n&cn.COLOR_FILL){var i=this.fill;t.fill.set(void 0,i.color,i.alpha)}if(n&cn.COLOR_STROKE){var r=this.stroke;t.stroke.set(void 0,r.color,r.alpha)}if(n&cn.COLOR_TEXT){var e=this.text;t.text.set(void 0,e.color,e.alpha)}if(n&cn.COLOR_TEXT_OUTLINE){var u=this.text.outline;t.text.outline.set(void 0,u.color,u.alpha)}n&cn.HEIGHT&&(t.size.y=this.sizeY),n&cn.WIDTH&&(t.size.x=this.sizeX),n&cn.ROTATION&&(t.transform.rotation=this.rotation),n&cn.TEXT&&(t.text.value=this.text.value),n&cn.CURSOR&&(t.cursor=this.cursor)}},t.TRANSIENT_STATES=[Mt.CLICKED,Mt.DBL_CLICKED,Mt.DOWN,Mt.UP,Mt.UP_OUTSIDE,Mt.RIGHT_CLICKED,Mt.RIGHT_DOWN,Mt.RIGHT_UP,Mt.RIGHT_UP_OUTSIDE,Mt.ACTIVATED,Mt.DEACTIVATED],t}(),su=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Qt(this,n,i,r,e,u,s)},n}(Jt),hu=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_PIVOTED),t.call(this,n)||this}return _(n,t),n.prototype.toHitTestData=function(n,i){var r=t.prototype.toHitTestData.call(this,n,i);return r.x-=r.width,r.y-=r.height,r},n}(su),ou=function(t){function n(n){var i=t.call(this)||this;i.name=n,i.interactive=!1,i.reference=0;var r=i.newShape();return r.parent=i,i.Xr=r,i.interactives=[],i}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.Xr.size.x},set:function(t){this.Xr.size.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.Xr.size.y},set:function(t){this.Xr.size.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"background",{get:function(){return this.Xr.fill},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Xr.state},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){var t=new hu;return t.fill.set(!1,16777215,1),t.stroke.set(!1),t.state.add(We.INTERACTIVE),t},n.prototype.initialize=function(t){var n=this.interactives,i=this.Xr,r=i.state.is(We.INTERACTIVE),e=i.state.is(We.DRAGGABLE),u=i.state.is(We.PINCHABLE);if(e||u){var s=new uu(i);i.runtime=s;var h=(e?_e.DRAG:_e.NONE)|(u?_e.PINCH:_e.NONE);s.actions.push(new Ve("",He.LAYER,h).toRuntime()),t.push(i),s.initialize(i)}(r||e||u)&&(i.interactive=!0,n.push(i)),this.doInitialize(this.children,n)},n.prototype.doInitialize=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i],u=e.runtime;if(u)if(e.interactive||u.interactive)n.push(e);else{var s=e.cursor;null!=s&&0<s.length&&n.push(e)}var h=e.children;0<h.length&&this.doInitialize(h,n)}},n.prototype.update=function(t){this.doUpdate(this.children,t)},n.prototype.doUpdate=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];e.update(n);var u=e.children;0<u.length&&this.doUpdate(u,n)}},n.prototype.hitTestInteractives=function(t){for(var n=this.Mu,i=this.interactives,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible&&(e.toLocal(t,void 0,n),null!=e.contains(n.x,n.y)))return e}return null},n.prototype.addUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},n.prototype.updateUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},n.prototype.destroy=function(){if(!this._destroyed){for(var n=this.children,i=n.length-1;0<=i;--i)n[i].destroy();n.length=0,t.prototype.destroy.call(this)}},n.prototype.serialize=function(t,n,i){for(var r=this.children,e=0,u=r.length;e<u;++e){var s=r[e].serialize(n);s[16]=t,i.push(s)}var h=this.Xr,o=n.addResource(this.name||""),a=(this.visible?1:0)|(h.state.is(We.INVISIBLE)?0:2),c=this.position,f=h.size,l=h.fill.serialize(n),v=h.state.is(We.INTERACTIVE)?1:0,b=h.state.is(We.DRAGGABLE)?2:0,d=h.state.is(We.PINCHABLE)?4:0;return[o,a,c.x,c.y,f.x,f.y,l,v|b|d]},n.deserialize=function(t,i,r,e){var u,s,h,o=new n(this.deserializeName(t[0],i)),a=o.Xr,c=t[1];if(null!=c){var f=i.mode!==jr.VIEWER;!f||1&c||(o.visible=!1),2&c||(a.state.add(We.INVISIBLE),f||(o.visible=!1))}var l=t[2],v=t[3];o.position.set(l,v);var b=null!==(u=t[4])&&void 0!==u?u:r,d=null!==(s=t[5])&&void 0!==s?s:e;a.size.set(b,d);var g=t[6];null!=g&&a.fill.deserialize(g,i);var m=null!==(h=t[7])&&void 0!==h?h:1;return a.state.set(We.INTERACTIVE,!!(1&m)),a.state.set(We.DRAGGABLE,!!(2&m)),a.state.set(We.PINCHABLE,!!(4&m)),o},n.deserializeName=function(t,n){if(Ot(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""},n}(ye),au=!1,cu=function(){return au},fu=function(n){function i(t){var i=n.call(this)||this;return i.condition=vn.ofString(t.condition),i.utils=new Map,i}return _(i,n),i.prototype.getUtil=function(t,n){var i=this.utils,r=i.get(t);return null==r&&(r=this.newUtil(t,n),i.set(t,r)),r},i.prototype.newUtil=function(t,n){return new eu(t,this.newOperation(t,n),Z.getInstance().get("DHtmlElement"),this.newUtilOptions(t,n))},i.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},i.prototype.newUtilOptions=function(t,n){return{element:{creator:this.newElementCreator(t,n)},when:this.toWhen(t,n),clipper:{extended:cu()}}},i.prototype.toWhen=function(t,n){var i=this.condition(t,Date.now(),ln);if(null!=i&&i in ru)return ru[i]},i.prototype.containsPoint=function(n,r,e){var u;if(n.visible){var s=null!==(u=i.WORK)&&void 0!==u?u:i.WORK=new t.Point;return n.toLocal(e,void 0,s),null!=n.contains(s.x,s.y)}return!1},i.prototype.getPadding=function(t,n){return null},i.prototype.getElementRect=function(t,n,i,r,e){var u=t.transform.pivot,s=t.size,h=s.x,o=s.y;return e.x=-.5*h+u.x,e.y=-.5*o+u.y,e.width=h,e.height=o,e},i.prototype.getElementMatrix=function(t,n){return t.updateTransform(),t.transform.worldTransform},i.prototype.getClipperToRect=function(t,n,i,r,e){var u=Ze.toContainer(t);return eu.getClipperRect(u,t,i,r,e)},i.prototype.getClipperExRects=function(t,n){n.begin();var i=t.root.parent;if(i instanceof ou){var r=i.parent;if(null!=r){var e=r.children,u=e.indexOf(i);if(0<=u)for(var s=u+1,h=e.length;s<h;++s){var o=e[s];if(o.visible){var a=o.width,c=o.height,f=o.transform.worldTransform,l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty;n.add(g,m,l*a+b*c+g,v*a+d*c+m)}}}}n.end()},i.prototype.onRender=function(t,n,i,r){this.getUtil(t,n).onRender(r)},i.prototype.onFocus=function(t,n){this.getUtil(t,n).onFocus()},i.prototype.onBlur=function(t,n){this.getUtil(t,n).onBlur()},i.prototype.onDowning=function(t,n,i){this.getUtil(t,n).onDowning(i)},i.prototype.onDown=function(t,n,i){this.getUtil(t,n).onDown(i)},i.prototype.onDblClick=function(t,n,i,r){this.getUtil(t,n).onDblClick(i,r)},i}(bn),lu=function(t){function n(n){var i=t.call(this,n)||this;return i.elementCreator=vn.ofElementOrNull(n.value),i.noPointerEvent=n.subtype===ze.HTML_ELEMENT_WITHOUT_POINTER_EVENTS,i}return _(n,t),n.prototype.newUtil=function(n,i){return this.noPointerEvent&&n.state.add(tu.NO_POINTER_EVENTS),t.prototype.newUtil.call(this,n,i)},n.prototype.newElementCreator=function(t,n){var i=this.elementCreator;if(i)return function(n){return i(t,Date.now(),ln,n)}},n}(fu),vu=function(t){function n(n,i,r,e){var u,s,h,o,a,c,f=this;(f=t.call(this,n,i,r,e)||this).yu=i,f.$u=function(t){f.onInputKeyDown(t)},f.ts=function(){f.onInputChange()},f.ns=function(t){f.onInputInput(t)},f.rs=null!==(u=null==e?void 0:e.description)&&void 0!==u?u:"";var l=null==e?void 0:e.editing;return f.es=null!==(o=null!==(s=null==l?void 0:l.formatter)&&void 0!==s?s:null===(h=null==e?void 0:e.text)||void 0===h?void 0:h.formatter)&&void 0!==o?o:r.getEditingFormatter(),f.us=null!==(a=null==l?void 0:l.unformatter)&&void 0!==a?a:r.getEditingUnformatter(),f.ss=null!==(c=null==l?void 0:l.validator)&&void 0!==c?c:r.getEditingValidator(),f}return _(n,t),n.prototype.onEnd=function(){t.prototype.onEnd.call(this),this.onInputChange()},n.prototype.onElementAttached=function(n,i,r){n.value=this.fromValue(this.yu.getValue()),n.addEventListener("change",this.ts),n.addEventListener("input",this.ns),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){t.prototype.onElementDetached.call(this,n,i,r),n.removeEventListener("change",this.ts),n.removeEventListener("input",this.ns)},n.prototype.onInputKeyDown=function(t){nr.isOkKey(t)?(this.end(),this.yu.onEnter()):nr.isCancelKey(t)&&this.cancel()},n.prototype.toElementFocused=function(n){t.prototype.toElementFocused.call(this,n),n.scrollTop=0,n.scrollLeft=0},n.prototype.onInputChange=function(){if(this.isShown()){var t=this.element;if(null!=t){var n=this.yu,i=this.toValue(t.value),r=n.getValue();r!==i&&n.onValueChange(i,r)}}},n.prototype.toValue=function(t){return this.us(t,this)},n.prototype.fromValue=function(t){return void 0!==t?this.es(t,this):""},n.prototype.onInputInput=function(t){var n=t.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&this.yu.onValueInput(this.toValue(n.value))},n.prototype.validate=function(){var t=this.yu.getValue();if(void 0!==t){var n=this.ss(t,this);if(this.hs!==n){this.hs=n;var i=this.ei.state;i.isInvalid=null!=n,i.isHovered&&this.yu.applyTitle()}return n}return null},n.prototype.applyTitle=function(){var t=this.hs;if(Ot(t)){var n=st.getLayer(this.ei);return n&&(n.view.title=t),!0}return!1},n}(eu),bu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.$u),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.$u),t.prototype.onElementDetached.call(this,n,i,r)},n}(vu),du=function(t){function n(n,i,r,e){var u,s,h,o=this;return(o=t.call(this,n,i,r,e)||this).os=null!==(u=null==e?void 0:e.step)&&void 0!==u?u:r.getStep(),o.cs=null!==(s=null==e?void 0:e.min)&&void 0!==s?s:r.getMin(),o.fs=null!==(h=null==e?void 0:e.max)&&void 0!==h?h:r.getMax(),o}return _(n,t),Object.defineProperty(n.prototype,"step",{get:function(){return this.os},set:function(t){this.os!==t&&(this.os=t,this.onStepChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.cs},set:function(t){this.cs!==t&&(this.cs=t,this.onMinChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.fs},set:function(t){this.fs!==t&&(this.fs=t,this.onMaxChange())},enumerable:!1,configurable:!0}),n.prototype.toValue=function(n){var i=t.prototype.toValue.call(this,n);if(i==i){var r=this.cs;if(null!=r&&i<r)return r;var e=this.fs;return null!=e&&e<i?e:i}return 0},n.prototype.fromValue=function(t){return void 0!==t?this.es(t,this):"0"},n.prototype.onStepChange=function(){if(this.isShown()){var t=this.element;t&&this.updateStep(t)}},n.prototype.onMinChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMin(t)}},n.prototype.onMaxChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMax(t)}},n.prototype.updateStep=function(t){var n=this.step;t.step=null!=n?"".concat(n):"any"},n.prototype.updateMin=function(t){var n=this.min;null!=n?t.min="".concat(n):t.removeAttribute("min")},n.prototype.updateMax=function(t){var n=this.max;null!=n?t.max="".concat(n):t.removeAttribute("max")},n.prototype.onElementAttached=function(n,i,r){n.type="number",t.prototype.onElementAttached.call(this,n,i,r),this.updateStep(n),this.updateMin(n),this.updateMax(n)},n}(bu),gu={EMIT_EVENT:0,WRITE_BOTH:1,WRITE_LOCAL:2,WRITE_REMOTE:3},mu=function(){function t(){}return t.execute=function(t,n,i,r,e){switch(n){case gu.EMIT_EVENT:t.emit(i,t,r),Ze.emit(t,i,r,e);break;case gu.WRITE_LOCAL:Ze.writeLocal(t,i,r,e);break;case gu.WRITE_REMOTE:Ze.writeRemote(t,i,r);break;case gu.WRITE_BOTH:Ze.writeLocal(t,i,r,e),Ze.writeRemote(t,i,r)}},t}(),wu=function(t){function n(n){var i=t.call(this,n)||this;return i.target=vn.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i}return _(n,t),n.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){t.text.enable=!1},onCancel:function(){t.text.enable=!0},onEnd:function(){},getValue:function(){return i.getUtil(t,n).toValue(t.text.value)},onValueInput:function(t){},onValueChange:function(r,e){i.onValueChange(t,n,r,e)},onEnter:function(){},applyTitle:function(){}}},n.prototype.newElementCreator=function(t,n){},n.prototype.getPadding=function(t,n){return t.text.padding},n.prototype.onValueChange=function(t,n,i,r){t.text.value=this.getUtil(t,n).fromValue(i);var e=Date.now(),u=this.target(t,e,ln);null!=u&&mu.execute(t,this.onInputAction,u,i,e)},n}(fu),pu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(wu),Ou=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(pu),Du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new du(t,this.newOperation(t,n),Z.getInstance().get("DInputInteger"),this.newUtilOptions(t,n))},n}(Ou),Eu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new du(t,this.newOperation(t,n),Z.getInstance().get("DInputReal"),this.newUtilOptions(t,n))},n}(Ou),Mu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.type="text",t.prototype.onElementAttached.call(this,n,i,r)},n}(bu),Su=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new Mu(t,this.newOperation(t,n),Z.getInstance().get("DInputText"),this.newUtilOptions(t,n))},n}(pu),ju=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofStringOrNull(n.target),i.value=vn.ofUnknown(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.target(t,i,ln);null!=r&&this.write(t,r,this.value(t,i,ln),i)}},n}(dn),Tu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){Ze.writeLocal(t,n,i,r),Ze.writeRemote(t,n,i)},n}(ju),Nu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){Ze.writeLocal(t,n,i,r)},n}(ju),Iu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){Ze.writeRemote(t,n,i)},n}(ju),Cu=function(t){function n(n,i,r,e,u){var s=t.call(this,Tn.MISC,i,n)||this;return s.target=r,s.onInputAction=e,s.value=u,s}return _(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case ze.INPUT_TEXT:return new Su(this);case ze.INPUT_INTEGER:return new Du(this);case ze.INPUT_REAL:return new Eu(this);case ze.EMIT_EVENT:return new $e(this);case ze.WRITE_BOTH:return new Tu(this);case ze.WRITE_LOCAL:return new Nu(this);case ze.WRITE_REMOTE:return new Iu(this);case ze.HTML_ELEMENT:case ze.HTML_ELEMENT_WITHOUT_POINTER_EVENTS:return new lu(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,"]"))},n.deserialize=function(t,i){var r=i.resources,e=Nn.toResource(1,t,r),u=Nn.toResource(3,t,r),s=Nn.toResource(5,t,r);return new n(t[2],e,u,t[4],s)},n}(jn),Au=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofUnknown(n.target),i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,ln)&&this.target(t,i,ln)},n}(dn),Ru=function(t){function n(n,i){var r=t.call(this,Tn.MISC,n,ze.EXECUTE)||this;return r.target=i,r}return _(n,t),n.prototype.toRuntime=function(){return new Au(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=i.resources;return new n(Nn.toResource(1,t,r),Nn.toResource(3,t,r))},n}(jn),ku=function(t){function n(n,i){var r=t.call(this,n,cn.NONE)||this;return r.subtype=i,r.target=vn.ofStringOrNull(n.target),r.inNewWindow=n.inNewWindow,r}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.target(t,i,ln);null!=r&&Ze.open(t,this.subtype,r,this.inNewWindow)}},n}(dn),Lu={DIAGRAM_LEGACY:0,PAGE_LEGACY:1,PAGE_INPLACE_LEGACY:2,DIALOG_TEXT:3,DIALOG_INTEGER:4,DIALOG_REAL:5,DIALOG_BOOLEAN:6,DIALOG_DATE:7,DIALOG_TIME:8,DIALOG_DATETIME:9,DIAGRAM:10,PAGE:11,DIALOG:12,EXTENSION:Er.EXTENSION},yu=function(t){function n(n,i,r,e){var u=t.call(this,Tn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){switch(this.subtype){case Lu.DIAGRAM:return new ku(this,Er.DIAGRAM);case Lu.PAGE:return new ku(this,Er.PAGE)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(3,t,i.resources);return new n(this.toSubType(t),r,e,this.inNewWindow(t))},n.toSubType=function(t){if(6!==t.length)return t[2];switch(t[2]){case Lu.DIAGRAM_LEGACY:return Lu.DIAGRAM;case Lu.PAGE_LEGACY:case Lu.PAGE_INPLACE_LEGACY:return Lu.PAGE}},n.inNewWindow=function(t){if(6!==t.length)return!!t[4];switch(t[2]){case Lu.DIAGRAM_LEGACY:return!1;case Lu.PAGE_LEGACY:return!0;case Lu.PAGE_INPLACE_LEGACY:return!1}},n}(jn),xu={TOP:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,LEFT:4,LEFT_TOP:5,LEFT_MIDDLE:6,LEFT_BOTTOM:7,RIGHT:8,RIGHT_TOP:9,RIGHT_MIDDLE:10,RIGHT_BOTTOM:11,BOTTOM:12,BOTTOM_LEFT:13,BOTTOM_CENTER:14,BOTTOM_RIGHT:15,OVER:16},Bu=function(){function t(){}return t.attach=function(t,n,i,r,e,u,s){var h=t.width,o=t.height,a=0;switch(s){case xu.LEFT:case xu.LEFT_TOP:case xu.LEFT_MIDDLE:case xu.LEFT_BOTTOM:(a=n.left-h-i)<i&&e-i<(a=n.right+i)+h&&(a=i);break;case xu.RIGHT:case xu.RIGHT_TOP:case xu.RIGHT_MIDDLE:case xu.RIGHT_BOTTOM:e-i<(a=n.right+i)+h&&(a=n.left-h-i)<i&&(a=e-h-i);break;case xu.TOP:case xu.TOP_LEFT:case xu.BOTTOM:case xu.BOTTOM_LEFT:a=this.adjust(n.left,h,i,e);break;case xu.TOP_RIGHT:case xu.BOTTOM_RIGHT:a=this.adjust(n.right-h,h,i,e);break;case xu.TOP_CENTER:case xu.BOTTOM_CENTER:case xu.OVER:a=this.adjust(.5*(n.left+n.right-h),h,i,e)}var c=0;switch(s){case xu.LEFT:case xu.LEFT_TOP:case xu.RIGHT:case xu.RIGHT_TOP:c=this.adjust(n.top,o,r,u);break;case xu.LEFT_MIDDLE:case xu.RIGHT_MIDDLE:case xu.OVER:c=this.adjust(.5*(n.top+n.bottom-o),o,r,u);break;case xu.LEFT_BOTTOM:case xu.RIGHT_BOTTOM:c=this.adjust(n.bottom,o,r,u);break;case xu.TOP:case xu.TOP_LEFT:case xu.TOP_RIGHT:case xu.TOP_CENTER:(c=n.top-o-r)<r&&u<(c=n.bottom+r)+o&&(c=r);break;case xu.BOTTOM:case xu.BOTTOM_LEFT:case xu.BOTTOM_RIGHT:case xu.BOTTOM_CENTER:u-r<(c=n.bottom+r)+o&&(c=n.top-o-r)<r&&(c=u-o-r)}t.position.set(a,c)},t.adjust=function(t,n,i,r){return t<i?r-i<t+n?.5*(r-n):i:r-i<t+n?r<n?.5*(r-n):r-n-i:t},t}(),_u={NONE:0,ESC:1,CLICK_OUTSIDE:2},Pu={DIRTY:0,CLEAN:1},Fu=function(){function n(t,n){var i;this.p=t,this.zn=n,n.enable&&(this.ls=this.newUtil()),this.Fr=Ai(null!==(i=n.mode)&&void 0!==i?i:Pu.DIRTY,Pu),this.vs=!0,this.En=!1}return Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Fr},set:function(t){this.Fr=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"constraint",{get:function(){var t,n,i=this.xi;return null==i&&(i=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.constraint)&&void 0!==n?n:this.newConstraint(),this.xi=i),i},set:function(t){this.xi=t},enumerable:!1,configurable:!0}),n.prototype.newConstraint=function(){var t=this;return function(n,i,r,e){t.toConstrained(n,i,r,e)}},n.prototype.isDirty=function(){return this.En},n.prototype.isClean=function(){return!this.En},n.prototype.toClean=function(){this.En&&(this.En=!1)},n.prototype.newUtil=function(){var n=this,i=new t.Point,r=this.p,e=r.position;return new mr({bind:r,checker:{start:function(t){if(t.target!==r)return!1;i.copyFrom(t.data.global),r.toLocal(i,void 0,i,!0);var n=i.x,e=i.y;return!(n<0||e<0||r.width<n||r.height<e)}},on:{start:function(){i.copyFrom(e)},move:function(t,u,s){i.set(i.x+u,i.y+s),n.En||(n.En=!0,r.setX(e.x),r.setY(e.y));var h=r.layer;null!=h&&n.constraint(r,h,i.x,i.y)}}})},n.prototype.toConstrained=function(i,r,e,u){var s,h=i.position;if(r){var o=i.getBounds(!1,null!==(s=n.WORK_BOUNDS)&&void 0!==s?s:n.WORK_BOUNDS=new t.Rectangle),a=o.x+e-h.x,c=o.y+u-h.y,f=Math.min(Math.max(0,a),r.width-o.width),l=Math.min(Math.max(0,c),r.height-o.height);h.set(e+f-a,u+l-c)}else h.set(e,u)},n}(),Uu={MODAL:0,MODELESS:1,MENU:2},Gu={MODAL:"MODAL",MODELESS:"MODELESS",MENU:"MENU"},Hu=function(){function n(){}return n.apply=function(t,n){var i=this;t.on(ir.down,(function(r){if(r.target===t){var e=i.point;e.copyFrom(r.data.global),t.toLocal(e,void 0,e,!0);var u=e.x,s=e.y;(u<0||s<0||t.width<u||t.height<s)&&setTimeout((function(){n(r)}),0)}}))},n.point=new t.Point,n}(),zu=function(){function t(t){this.bs=null,this.gs=null==(null==t?void 0:t.parent)?st.last():null}return Object.defineProperty(t.prototype,"picked",{get:function(){return this.bs},enumerable:!1,configurable:!0}),t.prototype.pick=function(t){var n=this.bs;if(null==n){if(!(n=st.getLayerOverlay(t))){var i=this.gs;n=i?i.getLayerOverlay():st.last().getLayerOverlay()}this.bs=n}return n},t}(),Vu=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i,r,e=this;n.prototype.init.call(this,t),this.ws=function(){e.onPrerender()},this.bs=null;var u=this.theme,s=Ai(null!==(i=null==t?void 0:t.mode)&&void 0!==i?i:u.getMode(),Uu);this.Fr=s,this.ps=null!==(r=null==t?void 0:t.sticky)&&void 0!==r?r:u.isSticky(s);var h=this.toCloseOn(s,u,t);switch(this.Os=h,this.Lt=this.toAlign(s,u,t),this.Ds=new zu,this.lr=new Fu(this,this.toGestureOptions(s,u,t)),this.visible=!1,s){case Uu.MODAL:this.state.addAll(ct.FOCUS_ROOT,Gu.MODAL);break;case Uu.MODELESS:this.state.add(Gu.MODELESS);break;case Uu.MENU:this.state.addAll(ct.FOCUS_ROOT,Gu.MENU)}h&_u.CLICK_OUTSIDE&&Hu.apply(this,(function(){e.onCloseOn()}))},i.prototype.toCloseOn=function(t,n,i){var r=null==i?void 0:i.closeOn;if(null==r)return n.closeOn(t);if(mt(r)){for(var e=_u.NONE,u=0,s=r.length;u<s;++u)e|=_u[r[u]];return e}return Ot(r)?_u[r]:r},i.prototype.toAlign=function(t,n,i){var r=null==i?void 0:i.align;return null===r?null:void 0===r?n.getAlign(t):Ai(r,xu)},Object.defineProperty(i.prototype,"mode",{get:function(){return this.Fr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"align",{get:function(){return this.Lt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"algin",{set:function(t){this.Lt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gesture",{get:function(){return this.lr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"layer",{get:function(){return this.bs},enumerable:!1,configurable:!0}),i.prototype.toGestureOptions=function(t,n,i){var r=null==i?void 0:i.gesture;return!0===r?{enable:!0,mode:n.getGestureMode(t)}:!1===r?{enable:!1,mode:n.getGestureMode(t)}:null!=r?(void 0===r.enable&&(r.enable=n.isGestureEnabled(t)),void 0===r.mode&&(r.mode=n.getGestureMode(t)),r):{enable:n.isGestureEnabled(t),mode:n.getGestureMode(t)}},i.prototype.onParentResize=function(t,i,r){if(this.isOpened()){var e=this.bs;if(null!=e){var u=this.lr;if(u.isDirty()){var s=this.position;u.constraint(this,e,s.x,s.y)}}}n.prototype.onParentResize.call(this,t,i,r)},i.prototype.getAnimation=function(){var t,n,i=this,r=this.ji;return void 0===r&&((r=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.animation)&&void 0!==n?n:this.theme.newAnimation(this.Fr))&&(r.target=this,r.on("end",(function(t){i.onAnimationEnd(t)}))),this.ji=r),r},i.prototype.onAnimationEnd=function(t){if(t)if(this.Fr===Uu.MODELESS)this.hide();else{var n=this.parent;n&&n.removeChild(this)}else{var i=st.getLayer(this);if(i){var r=i.getFocusController();this.Es=r.get(),r.focus(this.findFirstFocusable(r)||this)}}},i.prototype.findFirstFocusable=function(t){return t.find(this,!1,!0,!0)},i.prototype.open=function(t){var n=this,i=this.Ms;if(null==i){i=new Promise((function(t,i){n.Ss=t,n.js=i})),this.Ms=i,this.Ts=t;var r=null;switch(this.Fr){case Uu.MODAL:case Uu.MENU:(r=this.Ds.pick(this)).stage.addChild(this);break;case Uu.MODELESS:r=st.getLayer(this),this.show()}this.bs=r;var e=this.lr;if(e.mode===Pu.CLEAN&&e.toClean(),null!=r)if(e.isClean()){var u=r.renderer,s=this.ws;this.ps?u.on("prerender",s):u.once("prerender",s)}else{var h=this.position;e.constraint(this,r,h.x,h.y)}this.onOpen()}return i},i.prototype.onPrerender=function(){var n,r=this.bs;if(null!=r){var e=this.Lt,u=this.Ts;if(null!=e&&null!=u){var s=this.Fr,h=u.getBounds(!1,null!==(n=i.WORK_BOUNDS)&&void 0!==n?n:i.WORK_BOUNDS=new t.Rectangle),o=this.theme;Bu.attach(this,h,o.getOffsetX(s),o.getOffsetY(s),r.width,r.height,e)}else this.position.set(.5*(r.width-this.width),.5*(r.height-this.height))}},i.prototype.onOpen=function(){this.emit("open",this);var t=this.getAnimation();t?t.start():this.Fr===Uu.MENU&&(this.visible=!0,this.onAnimationEnd(!1))},i.prototype.isOpened=function(){return null!=this.Ms},i.prototype.close=function(){this.doReject()},i.prototype.doResolve=function(t){var n=this.Ss;n&&(this.Ms=void 0,this.Ss=void 0,this.js=void 0,this.onClose(),n(t))},i.prototype.doReject=function(t){var n=this.js;n&&(this.Ms=void 0,this.Ss=void 0,this.js=void 0,this.onClose(),n(t))},i.prototype.onClose=function(){var t=this.bs,n=this.Es;if(null!=n)if(this.Es=null,t){var i=st.getLayer(n);null!=i&&t!==i&&i.view.focus(),t.getFocusController().focus(n)}else this.blur(!0);else this.blur(!0);t&&(t.renderer.off("prerender",this.ws),this.bs=null),this.Ts=null;var r=this.getAnimation();r?r.start(!0):(this.visible=!1,this.onAnimationEnd(!0)),this.emit("close",this)},i.prototype.onKeyDown=function(t){return this.Os&_u.ESC&&nr.isCancelKey(t)&&this.onCloseOn(),n.prototype.onKeyDown.call(this,t)},i.prototype.onCloseOn=function(){this.close()},i.prototype.containsGlobalPoint=function(t){switch(this.Fr){case Uu.MODAL:case Uu.MENU:return!0;case Uu.MODELESS:return n.prototype.containsGlobalPoint.call(this,t)}},i.prototype.getType=function(){return"DDialog"},i}(hr),Wu={VERTICAL:0,HORIZONTAL:1},Xu=function(t){function n(n){var i=t.call(this,n)||this;return i.visible=!1,i}return _(n,t),n.prototype.getType=function(){return"DLayoutSpace"},n}(hr),Ku=function(t){return t instanceof hr&&(t.visible||t instanceof Xu)},Yu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n);var i=this.theme;this.te=function(t,n){var i,r,e=null==n?void 0:n.margin;if(null!=e){if(pt(e))return{horizontal:e,vertical:e};var u=t.getMargin();return{horizontal:null!==(i=e.horizontal)&&void 0!==i?i:u,vertical:null!==(r=e.vertical)&&void 0!==r?r:u}}return{horizontal:u=t.getMargin(),vertical:u}}(i,n),this.rn=function(t,n){var i=null==n?void 0:n.direction;return null!=i?Ot(i)?Wu[i]:i:t.getDirection()}(i,n),this.Ns=function(t,n){var i=null==n?void 0:n.corner;if(null!=i&&!pt(i)){var r=i.adjust;if(null!=r)return r}return t.getCornerAdjust()}(i,n),this.Is=function(t,n){if(n){var i=n.row;if(null!=i)return i;var r=n.column;if(null!=r)return r}return t.getMultiplicity()}(i,n),this.ai=function(t,n){var i;return null!==(i=null==n?void 0:n.reverse)&&void 0!==i?i:t.getReverse()}(i,n)},Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"multiplicity",{get:function(){return this.Is},enumerable:!1,configurable:!0}),n.prototype.getWeightTotal=function(){for(var t=this.children,n=0,i=this.Is,r=this.ai,e=0,u=t.length;e<u;){for(var s=-1,h=0;h<i&&e+h<u;++h){var o=t[r?u-1-(e+h):e+h];if(Ku(o)){var a=o.getClearType();if(0!==h&&a&Ki.BEFORE)break;if(s=Math.max(s,o.weight),a&&Ki.AFTER){h+=1;break}}else e+=1,h-=1}e+=h,0<=s&&(n+=s)}return n},n.prototype.getSpaceLeft=function(t,n){var i=this.children,r=this.Is,e=this.ai;if(this.rn===Wu.VERTICAL){for(var u=t,s=0,h=0,o=i.length;h<o;){for(var a=0,c=-1,f=0;f<r&&h+f<o;++f){var l=i[e?o-1-(h+f):h+f];if(Ku(l)){var v=l.getClearType();if(0!==f&&v&Ki.BEFORE)break;if(a=(c=Math.max(c,l.weight))<0?Math.max(a,l.height+s):s,v&Ki.AFTER){f+=1;break}}else h+=1,f-=1}h+=f,u-=a,s=n}return Math.max(0,u)}for(u=t,s=0,h=0,o=i.length;h<o;){var b=0;for(c=-1,f=0;f<r&&h+f<o;++f)if(l=i[e?o-1-(h+f):h+f],Ku(l)){if(v=l.getClearType(),0!==f&&v&Ki.BEFORE)break;if(b=(c=Math.max(c,l.weight))<0?Math.max(b,l.width+s):s,v&Ki.AFTER){f+=1;break}}else h+=1,f-=1;h+=f,u-=b,s=n}return Math.max(0,u)},n.prototype.calcSpaceLeft=function(t,n,i,r){return t?0:this.getSpaceLeft(n-i,r)},n.prototype.onRefit=function(){var i=this.children,r=this.Qn,e=r.getTop(),u=r.getBottom(),s=r.getLeft(),h=r.getRight(),o=this.te,a=o.vertical,c=o.horizontal,f=this.getWeightTotal(),l=this.Is,v=this.ai,b=this.Wn,d=null;if(this.Ns){var g=4+(i.length<<1);(null==n.CORNER_ADJUST_WORK||n.CORNER_ADJUST_WORK.length<g)&&(n.CORNER_ADJUST_WORK=new Float32Array(g)),(d=n.CORNER_ADJUST_WORK)[0]=-2,d[1]=-2,d[g-2]=-3,d[g-1]=-3}if(this.rn===Wu.VERTICAL){var m=0,w=e-a;if(0<f){for(var p=1/f,O=this.calcSpaceLeft(b.height.isOn,this.height,e+u,a),D=0,E=i.length;D<E;){for(var M=s-c,S=0,j=0;j<l&&D+j<E;++j){var T=i[v?E-1-(D+j):D+j];if(Ku(T)){var N=T.getClearType();if(0!==j&&N&Ki.BEFORE)break;if(T.position.set(c+M,a+w),0<=(U=T.weight)&&(T.height=O*(U*p)),M+=c+T.width,S=Math.max(S,T.height),N&Ki.AFTER){null!=d&&(d[0+(G=D+j+1<<1)]=j,d[G+1]=m),j+=1;break}null!=d&&(d[0+(G=D+j+1<<1)]=j,d[G+1]=m)}else null!=d&&(d[0+(G=D+j+1<<1)]=j-1,d[G+1]=m),D+=1,j-=1}w+=a+S,D+=j,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(T=i[v?E-1-D:D],Ku(T)){var I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2;if(!((N=T.getClearType())&Ki.BEFORE)){var R=this.findRowIndexPrevious(H,C,d);this.hasClearTypeAfter(i,R)||(A=d[R])}var k=-2;if(!(N&Ki.AFTER)){var L=this.findRowIndexNext(H,C,d);this.hasClearTypeBefore(i,L)||(k=d[L])}var y=this.countColumn(H,C,d);T.corner.mask=this.toCornerMaskColumn(A,I,k,y)}}else{for(D=0,E=i.length;D<E;){for(M=s-c,S=0,j=0;j<l&&D+j<E;++j)if(T=i[v?E-1-(D+j):D+j],Ku(T)){if(N=T.getClearType(),0!==j&&N&Ki.BEFORE)break;if(T.position.set(c+M,a+w),0<=(U=T.weight)&&(T.height=0),M+=c+T.width,S=Math.max(S,T.height),N&Ki.AFTER){null!=d&&(d[0+(G=D+j+1<<1)]=j,d[G+1]=m),j+=1;break}null!=d&&(d[0+(G=D+j+1<<1)]=j,d[G+1]=m)}else null!=d&&(d[0+(G=D+j+1<<1)]=j-1,d[G+1]=m),D+=1,j-=1;w+=a+S,D+=j,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)T=i[v?E-1-D:D],Ku(T)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2,(N=T.getClearType())&Ki.BEFORE||(R=this.findRowIndexPrevious(H,C,d),this.hasClearTypeAfter(i,R)||(A=d[R])),k=-2,N&Ki.AFTER||(L=this.findRowIndexNext(H,C,d),this.hasClearTypeBefore(i,L)||(k=d[L])),y=this.countColumn(H,C,d),T.corner.mask=this.toCornerMaskColumn(A,I,k,y))}}else{var x=0;if(M=s-c,0<f){for(p=1/f,O=this.calcSpaceLeft(b.width.isOn,this.width,s+h,c),D=0,E=i.length;D<E;){w=e-a;var B=0;for(j=0;j<l&&D+j<E;++j)if(T=i[v?E-1-(D+j):D+j],Ku(T)){if(N=T.getClearType(),0!==j&&N&Ki.BEFORE)break;if(T.position.set(c+M,a+w),0<=(U=T.weight)&&(T.width=O*(U*p)),B=Math.max(B,T.width),w+=a+T.height,N&Ki.AFTER){null!=d&&(d[0+(G=D+j+1<<1)]=x,d[G+1]=j),j+=1;break}null!=d&&(d[0+(G=D+j+1<<1)]=x,d[G+1]=j)}else null!=d&&(d[0+(G=D+j+1<<1)]=x,d[G+1]=j-1),D+=1,j-=1;M+=c+B,D+=j,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(T=i[v?E-1-D:D],Ku(T)){I=d[0+(H=2+(D<<1))],C=d[H+1];var _=-2;(N=T.getClearType())&Ki.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1]));var P=-2;N&Ki.AFTER||(L=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,L)||(P=d[L+1]));var F=this.countRow(H,I,d);T.corner.mask=this.toCornerMaskRow(_,C,P,F)}}else{for(D=0,E=i.length;D<E;){for(w=e-a,B=0,j=0;j<l&&D+j<E;++j)if(T=i[v?E-1-(D+j):D+j],Ku(T)){var U;if(N=T.getClearType(),0!==j&&N&Ki.BEFORE)break;if(T.position.set(c+M,a+w),0<=(U=T.weight)&&(T.width=0),B=Math.max(B,T.width),w+=a+T.height,N&Ki.AFTER){null!=d&&(d[0+(G=D+j+1<<1)]=x,d[G+1]=j),j+=1;break}null!=d&&(d[0+(G=D+j+1<<1)]=x,d[G+1]=j)}else{var G;null!=d&&(d[0+(G=D+j+1<<1)]=x,d[G+1]=j-1),D+=1,j-=1}M+=c+B,D+=j,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D){var H;T=i[v?E-1-D:D],Ku(T)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],_=-2,(N=T.getClearType())&Ki.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1])),P=-2,N&Ki.AFTER||(L=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,L)||(P=d[L+1])),F=this.countRow(H,I,d),T.corner.mask=this.toCornerMaskRow(_,C,P,F))}}}t.prototype.onRefit.call(this)},n.prototype.hasClearTypeBefore=function(t,n){return this.hasClearType(t,n,Ki.BEFORE)},n.prototype.hasClearTypeAfter=function(t,n){return this.hasClearType(t,n,Ki.AFTER)},n.prototype.hasClearType=function(t,n,i){if(2<=n){var r=n-2>>1;if(0<=r&&r<t.length){var e=t[r];if(e instanceof hr)return!!(e.getClearType()&i)}}return!1},n.prototype.findColumnIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r]!==n)return r;return 0},n.prototype.findColumnIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s]!==u)return s-2;return r}}return i.length-2},n.prototype.countRow=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r]!==n)return i[r-2+1]+1;return 0},n.prototype.findRowIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r+1]!==n)return r;return 0},n.prototype.findRowIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r+1];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s+1]!==u)return s-2;return r}}return i.length-2},n.prototype.countColumn=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r+1]!==n)return i[r-2+0]+1;return 0},n.prototype.toCornerMaskColumn=function(t,n,i,r){var e=ki.NONE;return t+1<n&&0===n&&(e|=ki.TOP_LEFT),i+1<n&&0===n&&(e|=ki.BOTTOM_LEFT),t<n&&n+1===r&&(e|=ki.TOP_RIGHT),i<n&&n+1===r&&(e|=ki.BOTTOM_RIGHT),ki.ALL&~e},n.prototype.toCornerMaskRow=function(t,n,i,r){var e=ki.NONE;return t+1<n&&0===n&&(e|=ki.TOP_LEFT),i+1<n&&0===n&&(e|=ki.TOP_RIGHT),t<n&&n+1===r&&(e|=ki.BOTTOM_LEFT),i<n&&n+1===r&&(e|=ki.BOTTOM_RIGHT),ki.ALL&~e},n.prototype.addSpace=function(t){return this.addChild(new Xu(t))},n.prototype.getType=function(){return"DLayout"},n.CORNER_ADJUST_WORK=null,n}(hr),Ju=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutVertical"},n}(Yu),Zu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredContent"},n}(Ju),qu={CLICKED:0,DOUBLE_CLICKED:1},Qu=function(){function t(t){this.cn=t}return t.prototype.getImageAlignHorizontal=function(){return this.cn.getSecondaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.cn.getSecondaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.cn.getSecondaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.cn.getSecondaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.cn.getSecondaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.cn.getSecondaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.cn.getSecondaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.cn.getSecondaryImageSource(t)},t}(),$u=function(){function t(t){this.cn=t}return t.prototype.getImageAlignHorizontal=function(){return this.cn.getTertiaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.cn.getTertiaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.cn.getTertiaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.cn.getTertiaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.cn.getTertiaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.cn.getTertiaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.cn.getTertiaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.cn.getTertiaryImageSource(t)},t}(),ts={LEFT:0,CENTER:1,RIGHT:2},ns={TOP:0,MIDDLE:1,BOTTOM:2},is={TEXT:0,PADDING:1,BORDER:2},rs=function(){function n(n,i,r,e){var u=this;this.p=n,this.cn=i,this.Cs=r,this.jt=null,this.Lt=function(t,n){var i,r,e,u=null==n?void 0:n.align;return{with:Ai(null!==(i=null==u?void 0:u.with)&&void 0!==i?i:t.getImageAlignWith(),is),vertical:Ai(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getImageAlignVertical(),ns),horizontal:Ai(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getImageAlignHorizontal(),ts)}}(i,e),this.te=function(t,n){var i,r,e=null==n?void 0:n.margin;return{vertical:null!==(i=null==e?void 0:e.vertical)&&void 0!==i?i:t.getImageMarginVertial(),horizontal:null!==(r=null==e?void 0:e.horizontal)&&void 0!==r?r:t.getImageMarginHorizontal()}}(i,e),this.As=null==e?void 0:e.tint,this.Rs=new t.Rectangle,this.ks=null==e?void 0:e.source,this.Ls=null,this.ys=function(){u.onUpdate()}}return Object.defineProperty(n.prototype,"image",{get:function(){return this.jt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"align",{get:function(){return this.Lt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bound",{get:function(){return this.Rs},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"source",{get:function(){return this.ks},set:function(t){this.ks!==t&&(this.ks=t,this.onUpdate())},enumerable:!1,configurable:!0}),n.prototype.computeSource=function(){var t=this.ks;if(void 0!==t){if(!wt(t))return t;var n=t(this.p.state);if(void 0!==n)return n}return this.cn.getImageSource(this.p.state)},n.prototype.onStateChange=function(t,n){this.updateTint()},n.prototype.updateBound=function(){var t=this.Rs,n=this.jt;if(null!=n){n.updateTransform(),n.getLocalBounds(t);var i=t.left,r=t.top,e=t.right,u=t.bottom,s=n.localTransform,h=s.a,o=s.b,a=s.c,c=s.d,f=h*i+a*r,l=o*i+c*r,v=h*e+a*r,b=o*e+c*r,d=h*e+a*u,g=o*e+c*u,m=h*i+a*u,w=o*i+c*u,p=Math.min(f,v,d,m),O=Math.max(f,v,d,m),D=Math.min(l,b,g,w),E=Math.max(l,b,g,w);t.x=p+s.tx,t.y=D+s.ty,t.width=O-p,t.height=E-D}else t.x=0,t.y=0,t.width=0,t.height=0},n.prototype.isTintAware=function(t){return null!=t&&"tint"in t},n.prototype.toTintColor=function(t,n){var i=this.As;if(i){var r=i.color;if(void 0!==r){if(!wt(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintColor(n)},n.prototype.toTintAlpha=function(t,n){var i=this.As;if(i){var r=i.alpha;if(void 0!==r){if(!wt(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintAlpha(n)},n.prototype.updateTint=function(){var t=this.jt;if(t&&this.isTintAware(t)){var n=this.cn,i=this.p.state,r=this.toTintColor(n,i);if(null!=r){var e=!1;t.tint!==r&&(t.tint=r,e=!0);var u=this.toTintAlpha(n,i);return t.alpha!==u&&(t.alpha=u,e=!0),e}}return!1},n.prototype.updateSource=function(){var n=this.computeSource(),i=this.Ls;if(n!==i){this.Ls=n;var r,e=this.p,u=this.jt,s=this.ys;if(n instanceof t.Texture)if(i instanceof t.Texture)i.off("update",s),u instanceof t.Sprite&&(u.texture=n,n.on("update",s));else{null!=u&&e.removeChild(u);var h=new t.Sprite(n);(r=e.getOverflowMask())&&(h.mask=r),n.on("update",s),e.addChild(h),this.jt=h}else i instanceof t.Texture?(i.off("update",s),null!=u&&(e.removeChild(u),u.destroy())):null!=u&&e.removeChild(u),null!=n&&((r=e.getOverflowMask())&&(n.mask=r),e.addChild(n)),this.jt=n;return!0}return!1},n.prototype.isRefitable=function(t){return null!=t&&t===this.jt},n.prototype.destroy=function(){var n=this.jt;if(n){this.jt=null;var i=this.Ls;i instanceof t.Texture&&(i.off("update",this.ys,this),n.destroy())}},n.prototype.onUpdate=function(){this.p.toDirty(),st.update(this.p)},n}(),es=function(){function t(){this.xs=[],this.T=0,this.te=0}return t.prototype.clear=function(){this.xs.length=0,this.T=0,this.te=0,this.Bs=void 0},t.prototype.add=function(t,n,i){this.xs.push(t),this.T+=i+n,this.te=i},t.prototype.set=function(t){this.Bs=t},Object.defineProperty(t.prototype,"size",{get:function(){return this.T-(null===this.Bs?this.te:0)},enumerable:!1,configurable:!0}),t}(),us=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t,n){var i=this.xs,r=n-t;if(void 0!==this.Bs)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.height,h.image.y=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.height,h.image.y=r}},n}(es),ss=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.add=function(t,n,i){this.xs.push(t),this.T=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.xs,u=0,s=e.length;u<s;++u){var h=e[u];h.image.x=r-.5*h.bound.width}},n}(es),hs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t){var n=this.xs,i=t;if(void 0!==this.Bs)for(var r=0,e=n.length;r<e;++r)(u=n[r]).image.x=i,i+=u.bound.width+u.margin.horizontal;else for(r=0,e=n.length;r<e;++r){var u;i+=(u=n[r]).margin.horizontal,u.image.x=i,i+=u.bound.width}},n}(es),os=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.add=function(t,n,i){this.xs.push(t),this.T=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.xs,u=0,s=e.length;u<s;++u){var h=e[u];h.image.y=r-.5*h.bound.height}},n}(es),as=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t,n){var i=this.xs,r=n-t;if(void 0!==this.Bs)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.width,h.image.x=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.width,h.image.x=r}},n}(es),cs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t){var n=this.xs,i=t;if(void 0!==this.Bs)for(var r=0,e=0,u=n.length;e<u;++e)(s=n[e]).image.y=r+i,i+=s.bound.height,r=s.margin.vertical;else for(e=0,u=n.length;e<u;++e){var s;i+=(s=n[e]).margin.vertical,s.image.y=i,i+=s.bound.height}},n}(es),fs=function(){function t(){this.left=new hs,this.center=new ss,this.right=new as,this.top=new cs,this.middle=new os,this.bottom=new us}return t.prototype.clear=function(){this.left.clear(),this.center.clear(),this.right.clear(),this.top.clear(),this.middle.clear(),this.bottom.clear(),this.text=void 0},t.prototype.add=function(t){if(null!=t.image){var n=t.bound,i=n.width,r=n.height,e=t.margin,u=e.horizontal,s=e.vertical,h=t.align;switch(h.horizontal){case ts.LEFT:this.left.add(t,i,u);break;case ts.CENTER:this.center.add(t,i,u);break;case ts.RIGHT:this.right.add(t,i,u)}switch(h.vertical){case ns.TOP:this.top.add(t,r,s);break;case ns.MIDDLE:this.middle.add(t,r,s);break;case ns.BOTTOM:this.bottom.add(t,r,s)}}},t.prototype.set=function(t){this.left.set(t),this.center.set(t),this.right.set(t),this.top.set(t),this.middle.set(t),this.bottom.set(t),this.text=t},Object.defineProperty(t.prototype,"width",{get:function(){var t=this.text,n=this.left.size,i=this.center.size,r=this.right.size;return void 0!==t?null!==t?Math.max(n+t.width+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var t=this.text,n=this.top.size,i=this.middle.size,r=this.bottom.size;return void 0!==t?null!==t?Math.max(n+t.height+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,n,i,r,e,u,s){var h=this.left,o=this.center,a=this.right,c=this.top,f=this.middle,l=this.bottom,v=this.text;if(void 0!==v){var b=h.size,d=a.size,g=c.size,m=l.size,w=0,p=0,O=0;switch(null!=v&&(p=v.width,O=v.height),e.horizontal){case ts.LEFT:w=t+b;break;case ts.CENTER:w=t+.5*(u-t-i-(b+p+d))+b;break;case ts.RIGHT:w=u-i-d-p}var D=0;switch(e.vertical){case ns.TOP:D=n+g;break;case ns.MIDDLE:D=n+.5*(s-n-r-(g+O+m))+g;break;case ns.BOTTOM:D=s-r-m-O}null!=v&&(v.position.set(w,D),v.setClippingDelta(b+d,g+m)),h.execute(w-b),o.execute(0,0,2*w+p),a.execute(0,w+p+d),c.execute(D-g),f.execute(0,0,2*D+O),l.execute(0,D+O+m)}else h.execute(t),o.execute(t,i,u),a.execute(i,u),c.execute(n),f.execute(n,r,s),l.execute(r,s)},t}(),ls=function(){function t(){this.text=new fs,this.padding=new fs,this.border=new fs}return t.prototype.clear=function(){this.text.clear(),this.padding.clear(),this.border.clear()},t.prototype.add=function(t){if(t.image)switch(t.align.with){case is.TEXT:this.text.add(t);break;case is.PADDING:this.padding.add(t);break;case is.BORDER:this.border.add(t)}},t.prototype.set=function(t){this.text.set(t)},t.prototype.execute=function(t,n,i,r){var e=t.getLeft(),u=t.getTop(),s=t.getRight(),h=t.getBottom();null==i&&(i=e+this.width+s),null==r&&(r=u+this.height+h),this.border.execute(0,0,0,0,n,i,r),this.padding.execute(e,u,s,h,n,i,r),this.text.execute(e,u,s,h,n,i,r)},Object.defineProperty(t.prototype,"width",{get:function(){return Math.max(this.border.width,this.padding.width,this.text.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return Math.max(this.border.height,this.padding.height,this.text.height)},enumerable:!1,configurable:!0}),t}(),vs=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){this.clear(),this.beginFill(16777215,1),this.drawRect(0,0,n,i),this.endFill()},n}(t.Graphics),bs=function(){function t(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r}return t.prototype.set=function(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r},t}(),ds=function(){function t(){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.characters=[],this.scale=1,this.scaled=!1,this.clipped=!1,this.x=0,this.y=0}return t.prototype.start=function(t,n){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.scale=1,this.scaled=!1,this.clipped=!1,this.x=0,this.y=.5*(t-n)},t.prototype.isPushable=function(t,n){return!(t<this.x+n.advance&&!(n.type&Ee.SPACE))},t.prototype.isPushableAtNewLine=function(t,n,i){return this.y+1.5*n+.5*i<=t},t.prototype.push=function(t,n){var i=this.x;this.x+=t.advance;var r=this.y,e=this.count,u=this.characters;e<u.length?u[e].set(i,r,t,n):u.push(new bs(i,r,t,n)),this.count+=1,this.countPerLine+=1},t.prototype.newLine=function(t){this.width=Math.max(this.width,this.x),this.x=0,this.y+=t,this.countPerLine=0},t.prototype.wordWrap=function(t){var n=this.countPerLine,i=this.characters;if(0<n){for(var r=this.count,e=r-1,u=r-n;u<e;--e){var s=i[e];if(s.wrappable){var h=s.character.advance,o=s.y+t;s.x=0,s.y=o;for(var a=e+1;a<r;++a)(s=i[a]).x=h,s.y=o,h+=s.character.advance;return this.x=h,this.y=o,this.countPerLine=r-e,!0}}var c=i[r-1];return c.x=0,c.y=c.y+t,this.x=c.character.advance,this.y=c.y,this.countPerLine=1,!1}return!1},t.prototype.pop=function(){var t=this.countPerLine,n=this.characters;if(0<t){var i=n[this.count-1];return this.x-=i.character.advance,this.count-=1,this.countPerLine-=1,!0}return!1},t.prototype.fit=function(t,n){var i=this.width,r=this.height;1e-4<i&&t<i?1e-4<r&&n<r?(this.scale=Math.min(t/i,n/r),this.scaled=!0):(this.scale=t/i,this.scaled=!0):1e-4<r&&n<r&&(this.scale=n/r,this.scaled=!0)},t.prototype.end=function(t,n){this.newLine(t),this.y-=.5*(t-n),this.height=this.y},t}(),gs={NONE:0,NORMAL:1,BREAK_ALL:2},ms="\n",ws=function(){function t(){}return t.measure=function(n,i,r){var e=t.RESULT||new ds;if(t.RESULT=e,null!=i){var u=b.from(n),s=i.font.height,h=r.lineHeight,o=r.fitting,a=!o&&r.clipping,c=r.width,f=r.height,l=!o&&r.wordWrap;switch(e.start(h,s),l){case gs.BREAK_ALL:a?this.measure1(u,c,f,s,h,i,e):this.measure2(u,c,h,i,e);break;case gs.NORMAL:var v=this.newLineBreaker(n);v?a?this.measure1a(v,u,c,f,s,h,i,e):this.measure2a(v,u,c,h,i,e):a?this.measure1b(u,c,f,s,h,i,e):this.measure2b(u,c,h,i,e);break;default:a?this.measure3(u,c,h,i,e):this.measure4(u,h,i,e)}e.end(h,s),o&&e.fit(c,f)}else e.start(0,0),e.end(0,0);return e},t.measure1a=function(t,n,i,r,e,u,s,h){for(var o=t.next();n.hasNext();){var a=n.position,c=n.next();if(c===ms)h.newLine(u);else{var f=s.get(c);if(null==f)continue;o=this.advance(a,o,t);var l=this.isWrappable1(a,o);h.isPushable(i,f)?h.push(f,l):h.isPushableAtNewLine(r,u,e)?(h.push(f,l),h.wordWrap(u)):this.measure5(n,i,u,s,h,!0)}}},t.measure1b=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===ms)s.newLine(e);else{var o=u.get(h);if(null==o)continue;var a=this.isWrappable2(s,o);s.isPushable(n,o)?s.push(o,a):s.isPushableAtNewLine(i,e,r)?(s.push(o,a),s.wordWrap(e)):this.measure5(t,n,e,u,s,!0)}}},t.measure1=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===ms)s.newLine(e);else{var o=u.get(h);if(null==o)continue;s.isPushable(n,o)?s.push(o,!0):s.isPushableAtNewLine(i,e,r)?(s.newLine(e),s.push(o,!0)):this.measure5(t,n,e,u,s,!0)}}},t.measure2a=function(t,n,i,r,e,u){for(var s=t.next();n.hasNext();){var h=n.position,o=n.next();if(o===ms)u.newLine(r);else{var a=e.get(o);if(null==a)continue;s=this.advance(h,s,t);var c=this.isWrappable1(h,s);u.isPushable(i,a)?u.push(a,c):(u.push(a,c),u.wordWrap(r))}}},t.measure2b=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===ms)e.newLine(i);else{var s=r.get(u);if(null==s)continue;var h=this.isWrappable2(e,s);e.isPushable(n,s)?e.push(s,h):(e.push(s,h),e.wordWrap(i))}}},t.measure2=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===ms)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)||e.newLine(i),e.push(s,!1)}}},t.measure3=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===ms)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)?e.push(s,!1):this.measure5(t,n,i,r,e,!1)}}},t.measure4=function(t,n,i,r){for(;t.hasNext();){var e=t.next();if(e===ms)r.newLine(n);else{var u=i.get(e);if(null==u)continue;r.push(u,!1)}}},t.measure5=function(t,n,i,r,e,u){e.clipped=!0;var s=r.get("...");if(null!=s){for(;!e.isPushable(n,s)&&e.pop(););e.isPushable(n,s)&&e.push(s,!1)}if(u)t.close();else for(;t.hasNext();)if(t.next()===ms){e.newLine(i);break}},t.isWrappable2=function(t,n){if(t.countPerLine<=0)return!1;var i=t.characters[t.count-1].character.type,r=n.type;return i&Ee.SPACE?!(r&Ee.SPACE||i&Ee.NON_BREAKING):!(r&Ee.SPACE||i&Ee.NON_BREAKING&&r&Ee.NON_BREAKING)},t.advance=function(t,n,i){return n.done||t<=n.value.end?n:n=i.next()},t.isWrappable1=function(t,n){if(n.done)return!1;var i=n.value;return i.start===t||i.end===t},t.newLineBreaker=function(t){return"css-line-break"in window?window["css-line-break"].LineBreaker(t,{lineBreak:"strict",wordBreak:"normal"}):null},t.RESULT=null,t}(),ps=function(t){function n(){var n=t.call(this,new Float32Array(64),new Float32Array(64),new Uint16Array(48))||this;return n.width=0,n.height=0,n.scale=1,n.scaled=!1,n.clipped=!1,n}return _(n,t),n.prototype.update=function(t,n,i){var r=this.getBuffer("aVertexPosition"),e=this.getBuffer("aTextureCoord"),u=this.getIndex(),s=ws.measure(t,n,i),h=Math.ceil(s.count/8)<<3,o=h<<3;r.data.length<o&&(r.data=new Float32Array(o),e.data=new Float32Array(o));var a=6*h;u.data.length<a&&(u.data=new Uint16Array(a));var c=r.data,f=e.data,l=u.data;if(null!=n){for(var v=s.count,b=s.characters,d=s.scale,g=0;g<v;++g){var m=b[g],w=m.x,p=m.y,O=m.character,D=n.width,E=n.height;this.writeCharacter(c,f,l,g,w,p,d,O,D,E)}g=v;for(var M=c.length>>3;g<M;++g)this.writeCharacterEmpty(c,f,l,g);this.width=s.width*d,this.height=s.height*d,this.scale=d,this.scaled=s.scaled,this.clipped=s.clipped}else{for(g=0,M=c.length>>3;g<M;++g)this.writeCharacterEmpty(c,f,l,g);this.width=0,this.height=0,this.scale=1,this.scaled=!1,this.clipped=!1}r.update(),e.update(),u.update()},n.prototype.writeCharacter=function(t,n,i,r,e,u,s,h,o,a){var c=h.x,f=h.y,l=h.width,v=h.height,b=(e+(c-h.origin.x))*s,d=u*s,g=b+l*s,m=d+v*s,w=r<<3;t[w+0]=b,t[w+1]=d,t[w+2]=g,t[w+3]=d,t[w+4]=g,t[w+5]=m,t[w+6]=b,t[w+7]=m;var p=c/o,O=f/a,D=(c+l)/o,E=(f+v)/a;n[w+0]=p,n[w+1]=O,n[w+2]=D,n[w+3]=O,n[w+4]=D,n[w+5]=E,n[w+6]=p,n[w+7]=E;var M=6*r,S=r<<2;i[M+0]=S+0,i[M+1]=S+1,i[M+2]=S+3,i[M+3]=S+1,i[M+4]=S+2,i[M+5]=S+3},n.prototype.writeCharacterEmpty=function(t,n,i,r){var e=r<<3;t[e+0]=0,t[e+1]=0,t[e+2]=0,t[e+3]=0,t[e+4]=0,t[e+5]=0,t[e+6]=0,t[e+7]=0,n[e+0]=0,n[e+1]=0,n[e+2]=0,n[e+3]=0,n[e+4]=0,n[e+5]=0,n[e+6]=0,n[e+7]=0;var u=6*r,s=r<<2;i[u+0]=s+0,i[u+1]=s+1,i[u+2]=s+3,i[u+3]=s+1,i[u+4]=s+2,i[u+5]=s+3},n}(t.MeshGeometry),Os=function(){function t(t,n){var i,r,e,u,s,h,o,a,c,f,l;this.R=0,this._s=-1;var v=this.getDefaultOptions();t?(this.Lt=null!==(i=t.align)&&void 0!==i?i:v.align,this.Ps=null!==(r=t.fontFamily)&&void 0!==r?r:v.fontFamily,this.Fs=null!==(e=t.fontSize)&&void 0!==e?e:v.fontSize,this.Us=null!==(u=t.fontStyle)&&void 0!==u?u:v.fontStyle,this.Gs=null!==(s=t.fontVariant)&&void 0!==s?s:v.fontVariant,this.Hs=null!==(h=t.fontWeight)&&void 0!==h?h:v.fontWeight,this.C=null!==(o=t.fill)&&void 0!==o?o:v.fill,this.en=null!==(a=t.clipping)&&void 0!==a?a:v.clipping,this.un=null!==(c=t.fitting)&&void 0!==c?c:v.fitting,this.zs=Ai(null!==(f=t.wordWrap)&&void 0!==f?f:v.wordWrap,gs),this.Vs=null!==(l=t.lineHeight)&&void 0!==l?l:v.lineHeight):(this.Lt=v.align,this.Ps=v.fontFamily,this.Fs=v.fontSize,this.Us=v.fontStyle,this.Gs=v.fontVariant,this.Hs=v.fontWeight,this.C=v.fill,this.en=v.clipping,this.un=v.fitting,this.zs=Ai(v.wordWrap,gs),this.Vs=v.lineHeight),this.Ws=this.Fs,this.Xs=this.Vs,this.Ks=!1,this.Ys=this.Fs,this.Js=-1,this.Zs="",this.qs="",this.Qs=0,this.ut=n}return t.prototype.getDefaultOptions=function(){var n=t.DEFAULT_OPTIONS;return null==n&&(n=this.newDefaultOptions(),t.DEFAULT_OPTIONS=n),n},t.prototype.newDefaultOptions=function(){var t=Z.getInstance().get("DBase");return{align:"left",fontFamily:t.getFontFamilly(),fontSize:t.getFontSize(),fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fill:t.getColor(new Dt),clipping:!0,fitting:!1,wordWrap:gs.NONE,lineHeight:t.getLineHeight()}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idApproved",{get:function(){return this._s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontId",{get:function(){return this.update(),this.Zs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdFontSize",{get:function(){return this.update(),this.Ws},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdApproved",{get:function(){return this.qs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this.C},set:function(t){this.C!==t&&(this.C=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){this.R+=1,this.ut()},Object.defineProperty(t.prototype,"fillApproved",{get:function(){return this.Qs},enumerable:!1,configurable:!0}),t.prototype.approve=function(){this.update(),this._s=this.R,this.qs=this.Zs,this.Qs=this.C},Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this.Ps},set:function(t){this.Ps!==t&&(this.Ps=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.Fs},set:function(t){this.Fs!==t&&(this.Fs=t,this.Ws=t,this.Xs=this.Vs,this.Ks=!1,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSizeFitted",{get:function(){return this.Ws},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFontFitted",{get:function(){return this.Ks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this.Us},set:function(t){this.Us!==t&&(this.Us=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this.Gs},set:function(t){this.Gs!==t&&(this.Gs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this.Hs},set:function(t){this.Hs!==t&&(this.Hs=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.update=function(){if(this.Js!==this.R){this.Js=this.R;var t=this.un?this.Ws:this.Fs;this.Ys=t,this.Zs=this.toFontId(t)}},t.prototype.toFontId=function(t){return"".concat(this.Us," ").concat(this.Gs," ").concat(this.Hs," ").concat(t,"px ").concat(this.Ps)},Object.defineProperty(t.prototype,"clipping",{get:function(){return this.en},set:function(t){this.en!==t&&(this.en=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fitting",{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this.zs},set:function(t){this.zs!==t&&(this.zs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.Vs},set:function(t){this.Vs!==t&&(this.Vs=t,this.Ws=this.Fs,this.Xs=t,this.Ks=!1,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeightFitted",{get:function(){return this.Xs},set:function(t){this.Xs!==t&&(this.Xs=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n){var i=!1;return t<this.Ws&&(this.Ws=t,i=!0),this.Xs!==n&&(this.Xs=n,i=!0),!0!==this.Ks&&(this.Ks=!0,i=!0),i&&this.onChange(),i},t.prototype.unfit=function(){var t=!1;return!1!==this.Ks&&(this.Ks=!1,t=!0),this.Ws!==this.Fs&&(this.Ws=this.Fs,t=!0),this.Xs!==this.Vs&&(this.Xs=this.Vs,t=!0),t&&this.onChange(),t},t}(),Ds=function(){function t(){}return t.measure=function(t){var n=this.$s;null==n&&(n=new Map,this.$s=n);var i=n.get(t);if(null!=i)return i;this.setup(t);var r=this.th.getBoundingClientRect().top,e=this.nh.getBoundingClientRect();return i={ascent:r-e.top,descent:e.bottom-r},n.set(t,i),i},t.toSize=function(t){return this.setup(t),parseFloat(window.getComputedStyle(this.nh).fontSize)},t.setup=function(t){var n=this.nh;null==n&&((n=document.createElement("span")).innerText="|ÉqÅ",n.style.border="none",n.style.margin="0px",this.nh=n);var i=this.th;null==i&&((i=document.createElement("div")).style.display="inline-block",i.style.width="0px",i.style.height="0px",i.style.border="none",i.style.margin="0px",i.style.verticalAlign="baseline",this.th=i);var r=this.ih;null==r&&((r=document.createElement("div")).style.position="absolute",r.style.padding="0px",r.style.margin="0px",r.style.visibility="hidden",r.appendChild(n),r.appendChild(i),document.body.appendChild(r),this.ih=r),n.style.font=t},t}(),Es=function(n){function i(i,r){var e=n.call(this,new ps,new t.MeshMaterial(t.Texture.EMPTY))||this;return e.B=new Os(r,(function(){e.En=!0,e.rh=!0,e.mu=null,e.eh()})),e.Bs=i,e.uh="",e.En=!0,e.rh=!0,e.mu=null,e.sh=0,e.kt=0,e.pn=0,e.Ni={clipping:!1,fitting:!1,wordWrap:gs.NONE,width:0,height:0,lineHeight:0,delta:{width:0,height:0}},e.eh(),e}return _(i,n),i.prototype.eh=function(){var t=st.getLayer(this);if(t){var n=this.B;if(this.En){this.En=!1;var i=this.Bs,r=this.uh;this.uh=i;var e=n.fontId,u=n.fontIdApproved,s=n.fontIdFontSize,h=n.fill,o=n.fillApproved;n.approve();var a=t.getDynamicFontAtlases();i===r&&e===u&&h===o||(a.add(e,s,h,i),a.remove(u,o,r))}}},Object.defineProperty(i.prototype,"text",{get:function(){return this.Bs},set:function(t){this.Bs!==t&&(this.Bs=t,this.B.unfit()||(this.En=!0,this.rh=!0,this.eh()))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this.update(),Math.abs(this.scale.x)*this.geometry.width},set:function(t){this.update();var n=this.geometry.width;if(1e-4<n){var i=t/n;this.scale.x=0<=this.scale.x?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.update(),Math.abs(this.scale.y)*this.geometry.height},set:function(t){this.update();var n=this.geometry.height;if(1e-4<n){var i=t/n;this.scale.y=0<=this.scale.y?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clipped",{get:function(){return this.geometry.clipped},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"style",{get:function(){return this.B},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this;this.eh();var n=this.B,i=this.mu;if(null==i){var r=st.getLayer(this);r&&null!=(i=r.getDynamicFontAtlases().get(n.fontId,n.fill))&&(this.sh=i.getRevisionUpdate(),this.mu=i,this.texture=i.texture,this.rh=!0)}else{var e=i.getRevisionUpdate();e!==this.sh&&(this.sh=e,this.rh=!0)}var u=this.Ni;if(this.updateClipping(n,u)&&(this.rh=!0),this.rh){this.rh=!1;var s=this.geometry;if(s.update(this.Bs,i,u),u.fitting&&!n.isFontFitted&&s.scaled){var h=s.scale,o=n.fontSize,a=n.toFontId(Math.ceil(o*h*1e3)/1e3),c=Ds.toSize(a),f=c/o,l=n.lineHeight*f;n.fit(c,l)&&setTimeout((function(){st.update(t)}),0)}}},i.prototype.updateClipping=function(t,n){var i=!1,r=t.clipping;n.clipping!==r&&(n.clipping=r,i=!0);var e=t.fitting;n.fitting!==e&&(n.fitting=e,i=!0);var u=t.wordWrap;n.wordWrap!==u&&(n.wordWrap=u,i=!0);var s=e?t.lineHeightFitted:t.lineHeight;if(n.lineHeight!==s&&(n.lineHeight=s,i=!0),r||e||u){var h=this.parent;if(h instanceof hr){var o=h.width-h.padding.getLeft()-h.padding.getRight()-n.delta.width;n.width!==o&&(n.width=o,i=!0);var a=h.height-h.padding.getTop()-h.padding.getBottom()-n.delta.height;n.height!==a&&(n.height=a,i=!0)}}return i},i.prototype.setClippingDelta=function(t,n){var i=this.Ni.delta;i.width=t,i.height=n},i.prototype._calculateBounds=function(){this.update(),n.prototype._calculateBounds.call(this)},i.prototype._render=function(t){this.update(),n.prototype._render.call(this,t)},i}(t.Mesh),Ms=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u;t.prototype.init.call(this,n);var s=this.theme;this.hh=null!==(r=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.value)&&void 0!==r?r:s.newTextValue(),this.oh=this.computeTextValue();var h=null==n?void 0:n.text;this.ah=null==h?void 0:h.color,this.fh=null==h?void 0:h.alpha,this.lh=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v,b=null===(r=null==n?void 0:n.text)||void 0===r?void 0:r.style;return null!=b?{fill:null!==(e=b.fill)&&void 0!==e?e:t.getColor(i),fontSize:null!==(u=b.fontSize)&&void 0!==u?u:t.getFontSize(),fontFamily:null!==(s=b.fontFamily)&&void 0!==s?s:t.getFontFamilly(),fontWeight:null!==(h=b.fontWeight)&&void 0!==h?h:t.getFontWeight(),fontStyle:null!==(o=b.fontStyle)&&void 0!==o?o:t.getFontStyle(),fontVariant:null!==(a=b.fontVariant)&&void 0!==a?a:t.getFontVariant(),clipping:null!==(c=b.clipping)&&void 0!==c?c:t.getTextStyleClipping(),fitting:null!==(f=b.fitting)&&void 0!==f?f:t.getTextStyleFitting(),wordWrap:null!==(l=b.wordWrap)&&void 0!==l?l:t.getTextStyleWordWrap(),lineHeight:null!==(v=b.lineHeight)&&void 0!==v?v:t.getLineHeight()}:{fill:t.getColor(i),fontSize:t.getFontSize(),fontFamily:t.getFontFamilly(),fontWeight:t.getFontWeight(),fontStyle:t.getFontStyle(),fontVariant:t.getFontVariant(),clipping:t.getTextStyleClipping(),fitting:t.getTextStyleFitting(),wordWrap:t.getTextStyleWordWrap(),lineHeight:t.getLineHeight()}}(s,n,this.state),this.Cs=function(t,n){var i,r,e,u=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.align;return{vertical:Ai(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getTextAlignVertical(),ns),horizontal:Ai(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getTextAlignHorizontal(),ts)}}(s,n),this.bh=null!==(e=null==h?void 0:h.formatter)&&void 0!==e?e:s.getTextFormatter(),this.dh=!0,this.gh=null!==(u=null==n?void 0:n.mask)&&void 0!==u?u:s.isOverflowMaskEnabled(),this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"text",{get:function(){return this.hh},set:function(t){this.hh!==t&&(this.hh=t,this.updateTextValue())},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){},n.prototype.computeTextValue=function(){var t=this.hh;if(void 0!==t){if(!wt(t))return t;var n=t(this.state);if(void 0!==n)return n}return this.theme.getTextValue(this.state)},n.prototype.createOrUpdateText=function(){var t=this.oh;if(void 0!==t){var n=this.bh(t,this),i=this.Bs;if(null==i){if(0<n.length){var r=this.createText(n);r.visible=this.dh,this.Bs=r,this.addChild(r),this.updateTextPosition(r);var e=this.getOverflowMask();e&&(r.mask=e),this.toDirty(),st.update(this)}}else i.text=n,this.toDirty(),st.update(this)}},n.prototype.createText=function(t){return new Es(t,this.lh)},n.prototype.getOverflowMask=function(){return this.gh?(null==this.dr&&(this.dr=new vs(this),this.Zn.add(this.dr),this.toDirty()),this.dr):null},n.prototype.updateTextPosition=function(t){var n=this.Cs,i=this.Qn,r=this.Wn,e=0,u=i.getLeft(),s=n.horizontal;if(r.width.isOn||s===ts.LEFT)e=u;else{var h=this.width,o=t.width,a=i.getRight();e=s===ts.CENTER?u+.5*(h-u-a-o):h-o-a}var c=0,f=i.getTop(),l=n.vertical;if(r.height.isOn||l===ns.TOP)c=f;else{var v=this.height,b=t.height,d=i.getBottom();c=l===ns.MIDDLE?f+.5*(v-f-d-b):v-b-d}t.position.set(e,c)},n.prototype.getTextColor=function(t,n){var i=this.ah;if(void 0!==i){if(!wt(i))return i;var r=i(n);if(void 0!==r)return r}return t.getColor(n)},n.prototype.getTextAlpha=function(t,n){var i=this.fh;if(void 0!==i){if(!wt(i))return i;var r=i(n);if(void 0!==r)return r}return t.getAlpha(n)},n.prototype.updateTextColor=function(t){var n=this.theme,i=this.state;t.style.fill=this.getTextColor(n,i),t.alpha=this.getTextAlpha(n,i)},n.prototype.updateTextValue=function(){var t=this.computeTextValue();this.oh!==t&&(this.oh=t,this.onTextChange(),this.createOrUpdateText())},n.prototype.updateText=function(){var t=this.Bs;t&&(this.updateTextValue(),this.updateTextPosition(t),this.updateTextColor(t))},n.prototype.showText=function(){var t=this.Bs;t&&(t.visible=!0),this.dh=!0},n.prototype.hideText=function(){var t=this.Bs;t&&(t.visible=!1),this.dh=!1},n.prototype.onReflow=function(){t.prototype.onReflow.call(this),this.updateText()},n.prototype.isRefitable=function(n){return t.prototype.isRefitable.call(this,n)||null!=n&&n===this.Bs},n.prototype.applyTitle=function(){var n=this.Bs;if(this.$n.length<=0&&n&&"clipped"in n&&n.clipped){var i=st.getLayer(this);i&&(i.view.title=n.text)}else t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DTextBase"},n.prototype.destroy=function(){var n=this.Bs;n&&(this.Bs=null,n.destroy());var i=this.dr;i&&(this.dr=null,i.destroy()),t.prototype.destroy.call(this)},n}(hr),Ss=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){this.mh=this.newImages(this.theme,n),t.prototype.init.call(this,n)},n.prototype.newImages=function(t,n){var i=[];return i.push(this.newImage(t,this.toImageOptions(t,null==n?void 0:n.image))),function(t){return!!t.getSecondaryImageSource}(t)&&i.push(this.newImage(new Qu(t))),function(t){return!!t.getTertiaryImageSource}(t)&&i.push(this.newImage(new $u(t))),i},n.prototype.toImageOptions=function(t,n){return n},n.prototype.newImage=function(t,n){return new rs(this,t,this.Cs,n)},Object.defineProperty(n.prototype,"image",{get:function(){return this.mh[0].source},set:function(t){var n=this.mh[0];n.source=t,n.updateSource()},enumerable:!1,configurable:!0}),n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i);for(var r=this.mh,e=0,u=r.length;e<u;++e)r[e].onStateChange(n,i)},n.prototype.updateText=function(){this.updateTextValue(),this.updateTextAndImage()},n.prototype.updateTextAndImage=function(){for(var t,i=this.mh,r=null!==(t=n.LAYOUTER)&&void 0!==t?t:n.LAYOUTER=new ls,e=0,u=i.length;e<u;++e){var s=i[e];s.updateSource(),s.updateTint(),s.updateBound(),r.add(s)}var h=this.Bs;null!=h?(this.updateTextColor(h),r.set(h)):r.set(null);var o=this.Wn;r.execute(this.Qn,this.Cs,o.width.isOn?null:this.width,o.height.isOn?null:this.height),r.clear()},n.prototype.isRefitable=function(n){if(t.prototype.isRefitable.call(this,n))return!0;for(var i=this.mh,r=0,e=i.length;r<e;++r)if(i[r].isRefitable(n))return!0;return!1},n.prototype.getType=function(){return"DImageBase"},n.prototype.destroy=function(){for(var n=this.mh,i=0,r=n.length;i<r;++i)n[i].destroy();t.prototype.destroy.call(this)},n}(Ms),js=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e=this;t.prototype.init.call(this,n);var u=this.theme;this.wh=null!==(i=null==n?void 0:n.toggle)&&void 0!==i?i:u.isToggle(),this.ph=Ai(null!==(r=null==n?void 0:n.when)&&void 0!==r?r:u.getWhen(),qu),this.on(ir.tap,(function(t){e.onClick(t)})),this.initOnPress();var s=null==n?void 0:n.group;s&&s.add(this)},n.prototype.onShortcut=function(n){this.state.isActionable&&this.activate(n),t.prototype.onShortcut.call(this,n)},Object.defineProperty(n.prototype,"isToggle",{get:function(){return!!this.wh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return!!this.Oh},set:function(t){this.Oh=t},enumerable:!1,configurable:!0}),n.prototype.initOnPress=function(){var t=this,n=null,i=function(){t.state.isPressed=!1,null!=n&&(n.off(ir.up,i),n.off(ir.upoutside,i),n.off(ir.cancel,i),n=null)};this.on(ir.down,(function(){if(t.state.isActionable){t.state.isPressed=!0;var r=st.getLayer(t);r&&((n=r.renderer.plugins.interaction).on(ir.up,i),n.on(ir.upoutside,i),n.on(ir.cancel,i))}}))},n.prototype.getType=function(){return"DButton"},n.prototype.onClick=function(t){this.ph===qu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.ph===qu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.wh?this.Oh&&this.state.isActive||(this.onToggleStart(t),this.onToggleEnd(t)):this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onInactivate=function(t){this.emit("inactive",this)},n.prototype.toggle=function(){this.state.isActionable&&this.wh&&(this.onToggleStart(),this.onToggleEnd())},n.prototype.onToggleStart=function(t){this.state.isActive=!this.state.isActive},n.prototype.onToggleEnd=function(t){this.state.isActive?this.onActivate(t):this.onInactivate(t)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.wh?this.onToggleStart(t):this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.wh?this.onToggleEnd(t):(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1))},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isPressed?i.isPressed||this.onPress():i.isPressed&&this.onUnpress()},n.prototype.onPress=function(){this.emit("press",this)},n.prototype.onUnpress=function(){this.emit("unpress",this)},n.prototype.destroy=function(){var n,i;null===(i=null===(n=this.zn)||void 0===n?void 0:n.group)||void 0===i||i.remove(this),t.prototype.destroy.call(this)},n}(Ss),Ts=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButton"},n}(js),Ns=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonPrimary"},n}(Ts),Is=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutHorizontal"},n}(Yu),Cs=function(t){function n(n,i){var r=t.call(this,i)||this;r.p=n;var e=r.buttonOk,u=r.buttonCancel;return null==e&&null==u||(r.addChild(r.newButtonSpace()),u&&r.addChild(u),e&&r.addChild(e),r.addChild(r.newButtonSpace())),r}return _(n,t),Object.defineProperty(n.prototype,"buttonCancel",{get:function(){var t=this.Dh;return void 0===t&&(t=this.newButtonCancel(),this.Dh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonCancel=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.cancel;return void 0===r&&(r=this.theme.getButtonCancel()),null!=r?new Ns({text:{value:r},on:{active:function(){i.p.cancel()}}}):null},Object.defineProperty(n.prototype,"buttonOk",{get:function(){var t=this.Eh;return void 0===t&&(t=this.newButtonOk(),this.Eh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonOk=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.ok;return void 0===r&&(r=this.theme.getButtonOk()),null!=r?null!=this.buttonCancel?new Ts({text:{value:r},on:{active:function(){i.p.ok()}}}):new Ns({text:{value:r},on:{active:function(){i.p.ok()}}}):null},n.prototype.newButtonSpace=function(){return new Xu({weight:1})},n.prototype.getType=function(){return"DDialogLayeredFooter"},n}(Is),As=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonAmbient"},n}(Ts),Rs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderButtonClose"},n}(As),ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderSeparator"},n}(Ss),Ls=function(t){function n(n,i){var r=t.call(this,i)||this;r.p=n;var e=r.separator;e&&r.addChild(e);var u=r.buttonClose;return u&&(r.addChild(u),u.on("active",(function(){r.p.cancel()}))),r}return _(n,t),Object.defineProperty(n.prototype,"buttonClose",{get:function(){var t=this.Mh;return void 0===t&&(t=this.newButtonClose(),this.Mh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonClose=function(){var t,n;return!1!==(null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.close)?new Rs:null},Object.defineProperty(n.prototype,"separator",{get:function(){var t=this.Sh;return void 0===t&&(t=this.newSeparator(),this.Sh=t),t},enumerable:!1,configurable:!0}),n.prototype.newSeparator=function(){var t;return!1!==(null===(t=this.zn)||void 0===t?void 0:t.separator)?new ks:null},n.prototype.getType=function(){return"DDialogLayeredHeader"},n}(Ss),ys=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.addChild(this.layout)},Object.defineProperty(n.prototype,"layout",{get:function(){var t=this.jh;return null==t&&(t=this.newLayout(),this.jh=t),t},enumerable:!1,configurable:!0}),n.prototype.newLayout=function(){return new Ju(this.toLayoutOptions(this.theme,this.zn))},n.prototype.toLayoutOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.layout)&&void 0!==i?i:t.getLayout())&&void 0!==r?r:this.newLayoutOptions(t,n);return void 0===e.children&&(e.children=this.newLayoutChildren(t,n)),e},n.prototype.newLayoutOptions=function(t,n){return{width:"padding",height:"auto",margin:0}},n.prototype.newLayoutChildren=function(t,n){return[this.header,this.content,this.footer]},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.Th;return void 0===t&&(t=this.newHeader(),this.Th=t),t},enumerable:!1,configurable:!0}),n.prototype.newHeader=function(){var t=this.toHeaderOptions(this.theme,this.zn);return null!==t?new Ls(this,t):null},n.prototype.toHeaderOptions=function(t,n){if(n){var i=n.header;if(void 0!==i)return i}return t.getHeader()},Object.defineProperty(n.prototype,"content",{get:function(){var t=this.Nh;return null==t&&(t=this.newContent(),this.Nh=t),t},enumerable:!1,configurable:!0}),n.prototype.newContent=function(){return new Zu(this.toContentOptions(this.theme,this.zn))},n.prototype.toContentOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.content)&&void 0!==i?i:t.getContent())&&void 0!==r?r:{};return void 0===e.children&&(e.children=this.newContentChildren(t,n)),e},n.prototype.newContentChildren=function(t,n){return[]},Object.defineProperty(n.prototype,"footer",{get:function(){var t=this.Ih;return void 0===t&&(t=this.newFooter(),this.Ih=t),t},enumerable:!1,configurable:!0}),n.prototype.newFooter=function(){var t=this.toFooterOptions(this.theme,this.zn);return null!==t?new Cs(this,t):null},n.prototype.toFooterOptions=function(t,n){if(n){var i=n.footer;if(void 0!==i)return i}return t.getFooter()},n.prototype.findFirstFocusable=function(t){return t.find(this.content,!1,!0,!0)},n.prototype.ok=function(){this.onOk(this.getResolvedValue())},n.prototype.onOk=function(t){this.doResolve(t),this.emit("ok",t,this)},n.prototype.cancel=function(){this.onCancel(this.getRejectReason())},n.prototype.onCancel=function(t){this.doReject(t),this.emit("cancel",t,this)},n.prototype.getRejectReason=function(){},n.prototype.getType=function(){return"DDialogLayered"},n}(Vu),xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout),r},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.Ch;return null==t&&(t=this.newInputLayout(),this.Ch=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(){var t=this.toInputMargin(this.theme,this.zn);return new Is({width:"padding",height:"auto",margin:0,children:[new Xu({width:t}),this.input,new Xu({width:t})]})},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.Ah;if(null==t){var n=this.zn;t=this.newInput(null==n?void 0:n.input),this.Ah=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.input.value},set:function(t){this.input.value=t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.input.value},n.prototype.getType=function(){return"DDialogInput"},n}(ys),Bs=function(t){function n(n){var i=t.call(this)||this;i.Rh=[],i.kh=null,i.Lh=function(t){i.active=t};var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i.emit("init",i),i}return _(n,t),n.prototype.add=function(t){if(this.Rh.indexOf(t)<0){this.Rh.push(t),t.isGrouped=!0;var n=this.vs;null!=n&&(t.state.isEnabled=n),t.on("active",this.Lh),t.state.isActive&&(this.active=t)}},Object.defineProperty(n.prototype,"active",{get:function(){return this.kh},set:function(t){if((null==t||t.isToggle)&&this.kh!==t){var n=this.kh;this.kh=null;for(var i=this.Rh,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u.isToggle&&u.state.isActive&&u.toggle()}this.emit("active",t,n,this)}},enumerable:!1,configurable:!0}),n.prototype.remove=function(t){var n=this.Rh,i=n.indexOf(t);0<=i&&(n.splice(i,1),t.isGrouped=!1,t.off("active",this.Lh),this.kh===t&&(this.active=null))},n.prototype.contains=function(t){return 0<=this.Rh.indexOf(t)},n.prototype.clear=function(){for(var t=this.Rh,n=0,i=t.length;n<i;++n)t[n].isGrouped=!1;t.length=0,this.active=null},n.prototype.size=function(){return this.Rh.length},n.prototype.each=function(t){for(var n=this.Rh,i=0,r=n.length;i<r&&!1!==t(n[i]);++i);},n.prototype.disable=function(){for(var t=this.Rh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!0;this.vs=!1},n.prototype.enable=function(){for(var t=this.Rh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!1;this.vs=!0},n.prototype.destroy=function(){this.clear()},n}(t.utils.EventEmitter),_s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOff"},n}(Ts),Ps=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOn"},n}(Ts),Fs=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.getButtonOff()),i.addChild(i.getButtonOn());var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i.getButtonGroup().on("active",(function(){var t=i.value;i.emit("change",t,!t,i)})),i}return _(n,t),n.prototype.getButtonGroup=function(){var t=this.yh;return null==t&&(t=this.newButtonGroup(),this.yh=t),t},n.prototype.newButtonGroup=function(){return new Bs},n.prototype.getButtonOn=function(){var t=this.xh;return null==t&&(t=this.newButtonOn(),this.xh=t),t},n.prototype.newButtonOn=function(){return new Ps({weight:1,group:this.getButtonGroup()})},n.prototype.getButtonOff=function(){var t=this.Bh;return null==t&&(t=this.newButtonOff(),this.Bh=t),t},n.prototype.newButtonOff=function(){return new _s({weight:1,group:this.getButtonGroup(),state:ct.ACTIVE})},Object.defineProperty(n.prototype,"value",{get:function(){return this.getButtonOn().state.isActive},set:function(t){this.value!==t&&(t?this.getButtonOn().activate():this.getButtonOff().activate())},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputBoolean"},n}(Is),Us=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){return new Fs(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputBoolean"},n}(xs),Gs=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i.isOpened=!1,i.step=vn.ofNumberOrNull(n.step),i.min=vn.ofNumberOrNull(n.min),i.max=vn.ofNumberOrNull(n.max),i}return _(n,t),n.prototype.execute=function(t,n,i){var r=this;if(!this.isOpened&&this.condition(t,i,ln)){var e=this.target(t,i,ln);if(null!=e){var u=this.initial(t,i,ln),s=this.step(t,i,ln),h=this.min(t,i,ln),o=this.max(t,i,ln);this.isOpened=!0,setTimeout((function(){r.open(t,e,u,s,h,o).then((function(n){r.isOpened=!1,mu.execute(t,r.onInputAction,e,n,i)}),(function(){r.isOpened=!1}))}),0)}}},n}(dn),Hs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofBooleanOrFalse(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Us({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Gs),zs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getUtil=function(){var t=this.ls;return null==t&&(t=this.newUtil(),this.ls=t),t},n.prototype.newUtil=function(){return new eu(this,this.newOperation(),this.theme,this.zn)},n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},Object.defineProperty(n.prototype,"element",{get:function(){return this.getUtil().element},enumerable:!1,configurable:!0}),n.prototype.onDownThis=function(n){var i=this.getUtil();i.onDowning(n),t.prototype.onDownThis.call(this,n),i.onDown(n)},n.prototype.onDblClick=function(n,i){return this.getUtil().onDblClick(n,i),t.prototype.onDblClick.call(this,n,i)},n.prototype.onFocus=function(){t.prototype.onFocus.call(this),this.getUtil().onFocus()},n.prototype.onBlur=function(){t.prototype.onBlur.call(this),this.getUtil().onBlur()},n.prototype.start=function(){this.getUtil().start()},n.prototype.render=function(n){this.getUtil().onRender(n),t.prototype.render.call(this,n)},n.prototype.getElementRect=function(t,n,i){return n.set(0,0),this.toGlobal(n,n,!1),i.x=n.x,i.y=n.y,n.set(this.width,this.height),this.toGlobal(n,n,!0),i.width=n.x-i.x,i.height=n.y-i.y,i},n.prototype.getClipperRect=function(t,n,i){return eu.getClipperRect(this.parent,this,t,n,i)},n.prototype.cancel=function(){this.getUtil().cancel()},n.prototype.end=function(){this.getUtil().end()},n.prototype.select=function(){return this.getUtil().select(),this},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.start(),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DHtmlElement"},n}(Ss),Vs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){t.hideText()},onCancel:function(){t.showText()},onEnd:function(){},getValue:function(){return t.oh},onValueInput:function(n){t.onValueInput(n)},onValueChange:function(n,i){t.text=n,t.onValueChange(n,i)},onEnter:function(){t.onEnter()},applyTitle:function(){t.applyTitle()}}},Object.defineProperty(n.prototype,"value",{get:function(){return this.oh},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){t.prototype.onTextChange.call(this),this.validate()},n.prototype.onValueChange=function(t,n){this.emit("change",t,n,this)},n.prototype.onValueInput=function(t){this.emit("input",t,this)},n.prototype.onEnter=function(){this.emit("enter",this)},n.prototype.validate=function(){return this.getUtil().validate()},n.prototype.applyTitle=function(){this.getUtil().applyTitle()||t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DInput"},n}(zs),Ws=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInput"},n}(Vs),Xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new du(this,this.newOperation(),this.theme,this.zn)},Object.defineProperty(n.prototype,"step",{get:function(){return this.getUtil().step},set:function(t){this.getUtil().step=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.getUtil().min},set:function(t){this.getUtil().min=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.getUtil().max},set:function(t){this.getUtil().max=t},enumerable:!1,configurable:!0}),n}(Ws),Ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInteger"},n}(Xs),Ys=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new Ks(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputInteger"},n}(xs),Js=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Ys({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Gs),Zs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputReal"},n}(Xs),qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new Zs(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputReal"},n}(xs),Qs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new qs({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Gs),$s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Mu(this,this.newOperation(),this.theme,this.zn)},n.prototype.getType=function(){return"DInputText"},n}(Ws),th=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new $s(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputText"},n}(xs),nh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofString(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new th({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Gs),ih=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogFittedContent"},n}(Zu),rh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLayoutOptions=function(t,n){return{width:"auto",height:"auto",margin:0}},n.prototype.newContent=function(){return new ih(this.toContentOptions(this.theme,this.zn))},n.prototype.getType=function(){return"DDialogFitted"},n}(ys),eh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonBack"},n}(As),uh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonDate"},n}(As),sh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonNext"},n}(As),hh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DText"},n}(Ms),oh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabel"},n}(hh),ah=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabelDate"},n}(hh),ch=function(t){function n(n){var i=t.call(this,n)||this;return i.renderable=!1,i}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeSpace"},n}(hr),fh={NONE:0,DATE:1,HOURS:2,MINUTES:4,SECONDS:8,TIME:14,ALL:15},lh=function(){function t(){}return t.from=function(t,n){var i=null==n?void 0:n.mask;if(null==i){if(Ot(t)){var r=Z.getInstance().get(t);if(null!=r)return r.getMask()}else if(null!=t)return t.getMask();return fh.NONE}if(Ot(i))return fh[i];if(pt(i))return i;for(var e=fh.NONE,u=0,s=i.length;u<s;++u)e|=fh[i[u]];return e},t}(),vh=function(){function t(t,n){var i,r;this._h=null!==(i=null==t?void 0:t.date)&&void 0!==i?i:null,this.Ph=null!==(r=null==t?void 0:t.inclusive)&&void 0!==r&&r,this.ut=n}return Object.defineProperty(t.prototype,"date",{get:function(){return this._h},set:function(t){this._h!==t&&(this._h=t,this.ut())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inclusive",{get:function(){return this.Ph},set:function(t){this.Ph!==t&&(this.Ph=t,this.ut())},enumerable:!1,configurable:!0}),t}(),bh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&fh.DATE){if(r.getFullYear()<t.getFullYear())return e.hour.min;if(r.getMonth()<t.getMonth())return e.hour.min;if(r.getDate()<t.getDate())return e.hour.min}var s=r.getHours();return i.inclusive||u&fh.SECONDS&&r.getSeconds()<e.second.max||u&fh.MINUTES&&r.getMinutes()<e.minute.max?s:s+1}return e.hour.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&fh.DATE){if(t.getFullYear()<r.getFullYear())return e.hour.max;if(t.getMonth()<r.getMonth())return e.hour.max;if(t.getDate()<r.getDate())return e.hour.max}var s=r.getHours();return i.inclusive||u&fh.SECONDS&&e.second.min<r.getSeconds()||u&fh.MINUTES&&e.minute.min<r.getMinutes()?s:s-1}return e.hour.max},t}(),dh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&fh.DATE){if(r.getFullYear()<t.getFullYear())return e.minute.min;if(r.getMonth()<t.getMonth())return e.minute.min;if(r.getDate()<t.getDate())return e.minute.min}if(u&fh.HOURS&&r.getHours()<t.getHours())return e.minute.min;var s=r.getMinutes();return i.inclusive||u&fh.SECONDS&&r.getSeconds()<e.second.max?s:s+1}return e.minute.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&fh.DATE){if(t.getFullYear()<r.getFullYear())return e.minute.max;if(t.getMonth()<r.getMonth())return e.minute.max;if(t.getDate()<r.getDate())return e.minute.max}if(u&fh.HOURS&&t.getHours()<r.getHours())return e.minute.max;var s=r.getMinutes();return i.inclusive||u&fh.SECONDS&&e.second.min<r.getSeconds()?s:s-1}return e.minute.max},t}(),gh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&fh.DATE){if(r.getFullYear()<t.getFullYear())return e.second.min;if(r.getMonth()<t.getMonth())return e.second.min;if(r.getDate()<t.getDate())return e.second.min}return u&fh.HOURS&&r.getHours()<t.getHours()||u&fh.MINUTES&&r.getMinutes()<t.getMinutes()?e.second.min:r.getSeconds()+(i.inclusive?0:1)}return e.second.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&fh.DATE){if(t.getFullYear()<r.getFullYear())return e.second.max;if(t.getMonth()<r.getMonth())return e.second.max;if(t.getDate()<r.getDate())return e.second.max}return u&fh.HOURS&&t.getHours()<r.getHours()||u&fh.MINUTES&&t.getMinutes()<r.getMinutes()?e.second.max:r.getSeconds()-(i.inclusive?0:1)}return e.second.max},t}(),mh=function(){function t(t,n){this.constant=this.newConstant(),this.lower=new vh(t&&t.lower,n),this.upper=new vh(t&&t.upper,n),this.mask=fh.ALL,this.hours=new bh(this),this.minutes=new dh(this),this.seconds=new gh(this)}return t.prototype.newConstant=function(){return{second:{min:0,max:59},minute:{min:0,max:59},hour:{min:0,max:23}}},t.prototype.adjust=function(t){var n=this.test(t);if(n<0){var i=this.lower,r=i.date;if(r)return t.setTime(r.getTime()),i.inclusive||((e=this.mask)&fh.SECONDS?t.setSeconds(r.getSeconds()+1):e&fh.MINUTES?t.setMinutes(r.getMinutes()+1):e&fh.HOURS?t.setHours(r.getHours()+1):e&fh.DATE&&t.setDate(r.getDate()+1)),!0}else if(0<n){var e,u=this.upper,s=u.date;if(s)return t.setTime(s.getTime()),u.inclusive||((e=this.mask)&fh.SECONDS?t.setSeconds(s.getSeconds()-1):e&fh.MINUTES?t.setMinutes(s.getMinutes()-1):e&fh.HOURS?t.setHours(s.getHours()-1):e&fh.DATE&&t.setDate(s.getDate()-1)),!0}return!1},t.prototype.compare=function(t,n){var i=this.mask;if(i&fh.DATE){var r,e,u,s,h=t.getFullYear(),o=n.getFullYear();if(h!==o)return h<o?-1:1;if((r=t.getMonth())!==(e=n.getMonth()))return r<e?-1:1;if((u=t.getDate())!==(s=n.getDate()))return u<s?-1:1}if(i&fh.HOURS){var a=t.getHours(),c=n.getHours();if(a!==c)return a<c?-1:1}return i&fh.MINUTES&&(r=t.getMinutes())!==(e=n.getMinutes())?r<e?-1:1:i&fh.SECONDS&&(u=t.getSeconds())!==(s=n.getSeconds())?u<s?-1:1:0},t.prototype.test=function(t){var n=this.lower,i=n.date;if(null!=i){var r=this.compare(i,t);return n.inclusive?r<=0?0:-1:r<0?0:-1}var e=this.upper,u=e.date;return null!=u?(r=this.compare(t,u),e.inclusive?r<=0?0:1:r<0?0:1):0},t.prototype.contains=function(t){return 0===this.test(t)},t}(),wh=function(t,n,i){if(t){var r=t.date,e=t.inclusive;return{date:void 0!==r?r:n,inclusive:void 0!==e?e:i}}return{date:n,inclusive:i}},ph=function(t){function n(n){var i=t.call(this,n)||this;return i.onNewChange(),i}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n);var e=this.theme;this.Fh=new Date;var u=this.Fh.getTime();this.Uh=new Date(u),this.Gh=new mh(function(t,n){return n?{lower:wh(n.lower,t.getLowerBound(),t.isLowerBoundInclusive()),upper:wh(n.upper,t.getUpperBound(),t.isUpperBoundInclusive())}:{lower:{date:t.getLowerBound(),inclusive:t.isLowerBoundInclusive()},upper:{date:t.getUpperBound(),inclusive:t.isUpperBoundInclusive()}}}(e,null==n?void 0:n.bounds),(function(){r.onNewChange()}));var s=null!==(i=null==n?void 0:n.margin)&&void 0!==i?i:e.getMargin();new Ju({parent:this,x:"padding",y:"padding",width:"auto",height:"auto",margin:s,children:this.newChildren(e,n,s)})},Object.defineProperty(n.prototype,"current",{get:function(){return this.Fh},set:function(t){this.Fh.getTime()!==t.getTime()&&(this.Fh=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.Uh},set:function(t){this.Uh.getTime()!==t.getTime()&&(this.Uh=t,this.onNewChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bounds",{get:function(){return this.Gh},enumerable:!1,configurable:!0}),n.prototype.hasHours=function(){return null!=this.Hh},n.prototype.hasMinutes=function(){return null!=this.zh},n.prototype.hasSeconds=function(){return null!=this.Vh},n.prototype.reset=function(){var t=this.Fh.getTime();this.Uh.setTime(t),this.onReset()},n.prototype.onReset=function(){this.onNewChange()},n.prototype.onNewChange=function(){var t=this.Uh,n=this.Gh;n.adjust(this.Uh);var i=this.Hh;if(i){var r=n.hours;i.value=t.getHours(),i.min=r.min(t),i.max=r.max(t)}var e=this.zh;if(e){var u=n.minutes;e.value=t.getMinutes(),e.min=u.min(t),e.max=u.max(t)}var s=this.Vh;if(s){var h=n.seconds;s.value=t.getSeconds(),s.min=h.min(t),s.max=h.max(t)}},n.prototype.newChildren=function(t,n,i){var r=lh.from(t,n);return this.Gh.mask=r,this.Hh=r&fh.HOURS?this.newInputHours(t,n):null,this.zh=r&fh.MINUTES?this.newInputMinutes(t,n):null,this.Vh=r&fh.SECONDS?this.newInputSeconds(t,n):null,[this.newTimeLayout(this.Hh,this.zh,this.Vh,i)]},n.prototype.newTimeLayout=function(t,n,i,r){var e=this.newTimeLayoutChildren(t,n,i);return 0<e.length?new Is({width:this.getTimeLayoutWidth(),height:this.getTimeLayoutHeight(),margin:r,children:e}):null},n.prototype.getTimeLayoutWidth=function(){return"auto"},n.prototype.getTimeLayoutHeight=function(){return"auto"},n.prototype.newTimeLayoutChildren=function(t,n,i){var r=[];return null!=t&&r.push(t),null!=n&&(0<r.length&&r.push(this.newMinuteSeparator()),r.push(n)),null!=i&&(0<r.length&&r.push(this.newSecondSeparator()),r.push(i)),r},n.prototype.newMinuteSeparator=function(){return new hh({width:"auto",text:{value:this.getMinuteSeparator()}})},n.prototype.getMinuteSeparator=function(){return":"},n.prototype.newSecondSeparator=function(){return new hh({width:"auto",text:{value:this.getSecondSeparator()}})},n.prototype.getSecondSeparator=function(){return":"},n.prototype.adjustInputOptions=function(t,n,i){return null==n.step&&(n.step=1),null==n.min&&(n.min=0),null==n.max&&(n.max=i),n},n.prototype.newInputHours=function(t,n){var i,r=this,e=null!==(i=null==n?void 0:n.hours)&&void 0!==i?i:t.getHoursOptions(),u=this.Gh.constant.hour.max,s=new Ks(this.adjustInputOptions(t,e,u));return s.on("change",(function(t){r.onHoursChange(t)})),s},n.prototype.onHoursChange=function(t){this.Uh.setHours(t),this.onNewChange()},n.prototype.newInputMinutes=function(t,n){var i=this,r=(null==n?void 0:n.minutes)||t.getMinutesOptions(),e=this.Gh.constant.minute.max,u=new Ks(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onMinutesChange(t)})),u},n.prototype.onMinutesChange=function(t){this.Uh.setMinutes(t),this.onNewChange()},n.prototype.newInputSeconds=function(t,n){var i=this,r=(null==n?void 0:n.seconds)||t.getSecondsOptions(),e=this.Gh.constant.second.max,u=new Ks(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onSecondsChange(t)})),u},n.prototype.onSecondsChange=function(t){this.Uh.setSeconds(t)},n.prototype.getType=function(){return"DPickerTime"},n}(hr),Oh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.Wh=new Date(this.Fh.getTime())},n.prototype.newChildren=function(n,i,r){var e,u;this.Xh=this.newDateButtons(n,i),this.Kh=null!==(u=null===(e=null==i?void 0:i.date)||void 0===e?void 0:e.decorator)&&void 0!==u?u:n.getDateDecorator(),this.Yh=this.newLabel(n,i);var s=t.prototype.newChildren.call(this,n,i,r);return s.unshift(new Is({width:"100%",height:"auto",children:[this.newBackButton(n,i),this.Yh,this.newNextButton(n,i)]}),new Is({width:"auto",height:"auto",margin:r,children:this.newDateLabels(n,i)}),new Ju({width:"auto",height:"auto",margin:r,column:7,children:this.Xh})),s},Object.defineProperty(n.prototype,"page",{get:function(){return this.Wh},set:function(t){this.Wh.getTime()!==t.getTime()&&(this.Wh=t,this.onPageChange())},enumerable:!1,configurable:!0}),n.prototype.onReset=function(){this.Wh.setTime(this.Fh.getTime()),t.prototype.onReset.call(this)},n.prototype.next=function(){var t=this.Wh;t.setFullYear(t.getFullYear(),t.getMonth()+1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.back=function(){var t=this.Wh;t.setFullYear(t.getFullYear(),t.getMonth()-1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.onNewChange=function(){this.Gh.adjust(this.Wh),t.prototype.onNewChange.call(this),this.onPageChange()},n.prototype.onPageChange=function(){var t=this.Xh,n=this.Gh,i=this.Wh,r=this.Uh,e=new Date(i.getTime());e.setDate(1),e.setHours(0,0,0,0);for(var u=this.theme,s=(e.getDay()-u.getDayStart()+7)%7,h=0;h<s;++h)t[h].show();for(h=s;h<7;++h)t[h].hide();var o=this.Kh;e.setFullYear(e.getFullYear(),e.getMonth()+1,0);var a=e.getDate(),c=r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()?r.getDate():0;for(h=0;h<a;++h)e.setDate(h+1),(f=t[h+7]).state.isActive=c===h+1,f.state.isDisabled=!n.contains(e),f.show(),o(e,f);for(h=a;h<31;++h){var f;(f=t[h+7]).state.isActive=!1,f.hide()}e.setTime(i.getTime()),this.Yh.text=e},n.prototype.adjustInputOptions=function(n,i,r){return null==i.weight&&(i.weight=1),t.prototype.adjustInputOptions.call(this,n,i,r)},n.prototype.getTimeLayoutWidth=function(){return"100%"},n.prototype.toLabelOptions=function(t,n){var i=n&&n.label||{};void 0===i.weight&&(i.weight=1),void 0===i.padding&&(i.padding=0);var r=i.text=i.text||{},e=r.align=r.align||{};return void 0===e.horizontal&&(e.horizontal="CENTER"),void 0===r.formatter&&(r.formatter=t.getLabelFormatter()),i},n.prototype.newLabel=function(t,n){return new oh(this.toLabelOptions(t,n))},n.prototype.newBackButton=function(t,n){var i=this,r=null==n?void 0:n.back;if(void 0===r&&(r=t.getBackButtonOptions()),null!=r){var e=new eh(r);return e.on("active",(function(){i.back()})),e}return null},n.prototype.newNextButton=function(t,n){var i=this,r=null==n?void 0:n.next;if(void 0===r&&(r=t.getNextButtonOptions()),null!=r){var e=new sh(r);return e.on("active",(function(){i.next()})),e}return null},n.prototype.newDateLabels=function(t,n){for(var i=t.getDayLabels(),r=t.getDayStart(),e=[],u=0;u<7;++u){var s=i[(r+u)%7];e.push(this.newDateLabel(t,n,s))}return e},n.prototype.newDateLabel=function(t,n,i){return new ah({text:{value:i}})},n.prototype.newDateButtons=function(t,n){for(var i=[],r=0;r<7;++r)i.push(this.newSpace(t,n));for(r=1;r<=31;++r)i.push(this.newDateButton(t,n,r));return i},n.prototype.newSpace=function(t,n){return new ch},n.prototype.newDateButton=function(t,n,i){var r=this;return new uh({text:{value:String(i)},on:{active:function(){r.onDateButtonClicked(i)}}})},n.prototype.onDateButtonClicked=function(t){var n=this.Uh;if(n.getDate()!==t){var i=this.Wh;n.setFullYear(i.getFullYear()),n.setMonth(i.getMonth()),n.setDate(t),this.onNewChange()}},n.prototype.getType=function(){return"DPickerDatetime"},n}(ph),Dh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new Oh(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDatetime"},n}(rh),Eh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;return null==h&&(h=new Dh,n.DIALOG=h),h.new=h.current=this.toDate(r),h.open(t).then((function(t){return t.toISOString()}))},n.prototype.toDate=function(t){return Ot(t)||pt(t)?new Date(t):t instanceof Date?t:new Date},n}(Gs),Mh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new ph(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogTime"},n}(rh),Sh=function(t){return t!=t},jh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new Mh,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){if(pt(t))return new Date(t);if(Ot(t)){var n=new Date,i=this.getPattern().exec(t);if(null!=i){var r=this.toHours(i[1]);null!=r&&n.setHours(r);var e=this.toMinutes(i[2]);null!=e&&n.setMinutes(e);var u=this.toSeconds(i[3]);null!=u&&n.setSeconds(u);var s=this.toMilliseconds(i[4]);null!=s&&n.setMilliseconds(s)}return n}return t instanceof Date?t:new Date},n.prototype.toHours=function(t){return this.toNumber(t,0,23)},n.prototype.toMinutes=function(t){return this.toNumber(t,0,59)},n.prototype.toSeconds=function(t){return this.toNumber(t,0,59)},n.prototype.toMilliseconds=function(t){var n=this.toNumber(t,0,999);if(null!=n){var i=t.length;return 1===i?100*n:2===i?10*n:n}return n},n.prototype.toNumber=function(t,n,i){if(null!=t){var r=+t;if(!Sh(r))return Math.min(i,Math.max(n,r))}return null},n.prototype.getPattern=function(){var t=n.PATTERN;return null==t&&(t=this.newPattern(),n.PATTERN=t),t},n.prototype.newPattern=function(){return/^\s*(?:(\d+)(?::(\d+)(?::(\d+))?)?)?(?:\.(\d+))?\s*$/},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return Mi.create("%Hm")},n}(Gs),Th=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDate"},n}(Oh),Nh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new Th(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDate"},n}(rh),Ih=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new Nh,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){return Ot(t)||pt(t)?new Date(t):t instanceof Date?t:new Date},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return Mi.create("%Y-%M-%D")},n}(Gs),Ch={TEXT:0,INTEGER:1,REAL:2,BOOLEAN:3,DATE:4,TIME:5,DATETIME:6,EXTENSION:1e3},Ah=function(t){function n(n,i,r,e,u,s,h,o){var a=t.call(this,Tn.OPEN,n,Lu.DIALOG)||this;return a.target=i,a.onInputAction=r,a.initial=e,a.step=u,a.min=s,a.max=h,a.dialogType=o,a}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.dialogType===i.dialogType&&this.onInputAction===i.onInputAction&&this.initial===i.initial&&this.step===i.step&&this.min===i.min&&this.max===i.max},n.prototype.toRuntime=function(){switch(this.dialogType){case Ch.TEXT:return new nh(this);case Ch.INTEGER:return new Js(this);case Ch.REAL:return new Qs(this);case Ch.BOOLEAN:return new Hs(this);case Ch.DATE:return new Ih(this);case Ch.TIME:return new jh(this);case Ch.DATETIME:return new Eh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.initial),e=t.addResource(this.step),u=t.addResource(this.min),s=t.addResource(this.max);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,",").concat(this.dialogType,",").concat(e,",").concat(u,",").concat(s,"]"))},n.deserialize=function(t,i){var r=i.resources,e=Nn.toResource(1,t,r),u=Nn.toResource(3,t,r),s=Nn.toResource(5,t,r),h=Nn.toResource(7,t,r),o=Nn.toResource(8,t,r),a=Nn.toResource(9,t,r);return new n(e,u,t[4],s,h,o,a,this.toDialogType(t))},n.toDialogType=function(t){if(t[2]===Lu.DIALOG)return t[6];switch(t[2]){case Lu.DIALOG_TEXT:return Ch.TEXT;case Lu.DIALOG_INTEGER:return Ch.INTEGER;case Lu.DIALOG_REAL:return Ch.REAL;case Lu.DIALOG_BOOLEAN:return Ch.BOOLEAN;case Lu.DIALOG_DATE:return Ch.DATE;case Lu.DIALOG_TIME:return Ch.TIME;case Lu.DIALOG_DATETIME:return Ch.DATETIME}},n}(jn),Rh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.Zh)&&void 0!==n?n:this.Zh=new Map).set(t.type,t),(null!==(i=this.Xt)&&void 0!==i?i:this.Xt=[]).push(t)},t.get=function(t){var n=this.Zh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Xt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),kh=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;i.target=vn.ofStringOrNull(n.target),i.argument=vn.ofUnknown(n.argument);var r=Rh.get(n.dialogType);return r&&(i.opener=r.opener),i}return _(n,t),n.prototype.execute=function(t,n,i){var r=this.opener;if(r&&this.condition(t,i,ln)){var e=this.target(t,i,ln);if(null!=e){var u=this.argument(t,i,ln);setTimeout((function(){r(e,u,t)}),0)}}},n}(dn),Lh=function(t){function n(n,i,r,e){var u=t.call(this,Tn.OPEN,n,Lu.DIALOG)||this;return u.target=i,u.argument=r,u.dialogType=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.argument===i.argument&&this.dialogType===i.dialogType},n.prototype.toRuntime=function(){return new kh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.argument);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",0,-1,").concat(this.dialogType,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),Nn.toResource(3,t,i.resources),Nn.toResource(7,t,i.resources),t[6])},n}(jn),yh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.Zh)&&void 0!==n?n:this.Zh=new Map).set(t.type,t),(null!==(i=this.Xt)&&void 0!==i?i:this.Xt=[]).push(t),Je[t.type]=t.opener},t.get=function(t){var n=this.Zh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Xt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),xh=function(t){function n(n,i,r,e){var u=t.call(this,Tn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){return new ku(this,this.subtype)},n.prototype.toLabel=function(){var t=this.getTheme().toTypeLabel(this.type),n=yh.get(this.subtype);return"".concat(t,": ").concat(null!=n?n.label:"Unknown")},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(3,t,i.resources);return new n(t[2],r,e,!!t[4])},n}(jn),Bh={SHAPE_SHOW:0,SHAPE_HIDE:1,SHAPE:2,LAYER:3},_h=function(t){function n(n){var i=t.call(this,n,cn.VISIBILITY)||this;return i.visibility=n.subtype===Bh.SHAPE_SHOW,i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,ln)&&(t.visible=this.visibility,n.written|=this.reset)},n}(dn),Ph=function(t){function n(n,i){return t.call(this,Tn.SHOW_HIDE,i,n)||this}return _(n,t),n.prototype.toRuntime=function(){return new _h(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources);return new n(t[2],r)},n}(jn),Fh=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.Xt=new Map,i.ju=n.layers,i.qh=n.bringToFront,i}return _(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i);var r=this.Xt.get(n);null==r&&null!=(r=this.newData(n))&&this.Xt.set(n,r)},n.prototype.execute=function(t,n,i){var r=this.Xt.get(t);if(r){var e=this.condition(t,i,ln);if(r.condition!==e){r.condition=e;var u=r.layers;e?r.bringToFront?(Be.bringAllToFront(u),Be.showAll(u)):Be.showAll(u):Be.hideAll(u)}}},n.prototype.newData=function(t){var n=Be.toLayers(t,this.ju);if(0<n.length)return{layers:n,bringToFront:this.qh,condition:null}},n}(dn),Uh=function(t){function n(n,i,r){var e=t.call(this,Tn.SHOW_HIDE,n,Bh.LAYER)||this;return e.layers=i,e.bringToFront=r,e}return _(n,t),n.prototype.toRuntime=function(){return new Fh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=this.serializeLayers(t),r=this.bringToFront?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.prototype.serializeLayers=function(t){for(var n=this.layers,i="[",r="",e=0,u=n.length;e<u;++e)i+=r+n[e],r=",";return i+="]",t.addResource(i)},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),this.deserializeLayers(t[3],i),!!t[4])},n.deserializeLayers=function(t,n){var i=n.resources,r=i.length;return 0<=t&&t<r?JSON.parse(i[t]):[]},n}(jn),Gh=function(t){function n(n){return t.call(this,n,cn.VISIBILITY)||this}return _(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i)},n.prototype.execute=function(t,n,i){t.visible=this.condition(t,i,ln),n.written|=this.reset},n}(dn),Hh=function(t){function n(n){return t.call(this,Tn.SHOW_HIDE,n,Bh.SHAPE)||this}return _(n,t),n.prototype.toRuntime=function(){return new Gh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources))},n}(jn),zh=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.amount=vn.ofNumber(n.amount),r}return _(n,t),n}(dn),Vh=function(t){function n(n){return t.call(this,n,cn.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln);t.transform.position.x=r,n.written|=this.reset}},n}(zh),Wh=function(t){function n(n){return t.call(this,n,cn.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln);t.transform.position.y=r,n.written|=this.reset}},n}(zh),Xh=function(t){function n(n){return t.call(this,n,cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=e.position,s=!!(n.written&cn.POSITION_X),h=!!(n.written&cn.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o-c.c*r,a-c.d*r),n.written|=this.reset}},n}(zh),Kh=function(t){function n(n){return t.call(this,n,cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=e.position,s=!!(n.written&cn.POSITION_X),h=!!(n.written&cn.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o+c.a*r,a+c.b*r),n.written|=this.reset}},n}(zh),Yh=function(t){function n(n){return t.call(this,n,cn.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=!!(n.written&cn.POSITION_X),u=t.transform.position,s=e?u.x:n.x;u.x=s+r,n.written|=this.reset}},n}(zh),Jh=function(t){function n(n){return t.call(this,n,cn.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=!!(n.written&cn.POSITION_Y),u=t.transform.position,s=e?u.y:n.y;u.y=s+r,n.written|=this.reset}},n}(zh),Zh=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r)||this;return u.opetype=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.opetype===i.opetype},n}(jn),qh={RELATIVE_X:0,RELATIVE_Y:1,ABSOLUTE_X:2,ABSOLUTE_Y:3,FORWARD_OR_BACKWARD:4,LEFT_OR_RIGHT:5},Qh={RESIZE:0,MOVE:1,ROTATE:2},$h=function(t){function n(n,i,r){var e=t.call(this,Tn.TRANSFORM,i,Qh.MOVE,n)||this;return e.amount=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case qh.ABSOLUTE_X:return new Vh(this);case qh.ABSOLUTE_Y:return new Wh(this);case qh.FORWARD_OR_BACKWARD:return new Xh(this);case qh.LEFT_OR_RIGHT:return new Kh(this);case qh.RELATIVE_X:return new Yh(this);case qh.RELATIVE_Y:return new Jh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(4,t,i.resources);return new n(t[3],r,e)},n}(Zh),to={RELATIVE_SIZE:0,RELATIVE_HEIGHT:1,RELATIVE_WIDTH:2,ABSOLUTE_SIZE:3,ABSOLUTE_HEIGHT:4,ABSOLUTE_WIDTH:5},no=function(t){function n(n,i){var r=t.call(this,n,i)||this;switch(n.opetype){case to.RELATIVE_SIZE:r.size=vn.ofNumberOrOne(n.amount);break;case to.ABSOLUTE_SIZE:r.size=vn.ofNumberOrOneHundred(n.amount);break;case to.RELATIVE_HEIGHT:r.size=vn.ofNumberOrOne(n.amount);break;case to.ABSOLUTE_HEIGHT:r.size=vn.ofNumberOrOneHundred(n.amount);break;case to.RELATIVE_WIDTH:r.size=vn.ofNumberOrOne(n.amount);break;case to.ABSOLUTE_WIDTH:r.size=vn.ofNumberOrOneHundred(n.amount);break;default:r.size=vn.ONE}return r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=(-.5+e)*i,h=(-.5+u)*r;t.updateTransform();var o=t.transform,a=o.position,c=o.localTransform,f=!!(n.written&cn.POSITION_X),l=!!(n.written&cn.POSITION_Y),v=f?a.x:n.x,b=l?a.y:n.y;n.written|=cn.POSITION,a.set(v+s*c.a+h*c.c,b+s*c.b+h*c.d)},n}(dn),io=function(t){function n(n){var i=t.call(this,n,cn.HEIGHT|cn.POSITION)||this;return i.origin=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.HEIGHT?e.y:n.sizeY;e.y=Ir(r),n.written|=cn.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(no),ro=function(t){function n(n){var i=t.call(this,n,cn.HEIGHT|cn.POSITION)||this;return i.origin=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.HEIGHT?e.y:n.sizeY;e.y=Ir(u*r),n.written|=cn.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(no),eo=function(t){function n(n){var i=t.call(this,n,cn.SIZE|cn.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=Ir(this.size(t,i,ln)),e=t.size,u=!!(n.written&cn.WIDTH),s=!!(n.written&cn.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(r,r),n.written|=cn.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(no),uo=function(t){function n(n){var i=t.call(this,n,cn.SIZE|cn.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=!!(n.written&cn.WIDTH),s=!!(n.written&cn.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(Ir(h*r),Ir(o*r)),n.written|=cn.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(no),so=function(t){function n(n){var i=t.call(this,n,cn.WIDTH|cn.POSITION)||this;return i.origin=n.originX,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.WIDTH?e.x:n.sizeX;e.x=Ir(r),n.written|=cn.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(no),ho=function(t){function n(n){var i=t.call(this,n,cn.WIDTH|cn.POSITION)||this;return i.origin=n.originX,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.WIDTH?e.x:n.sizeX;e.x=Ir(u*r),n.written|=cn.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(no),oo=function(t){function n(n,i,r,e,u){var s=t.call(this,Tn.TRANSFORM,i,Qh.RESIZE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case to.ABSOLUTE_HEIGHT:return new io(this);case to.ABSOLUTE_WIDTH:return new so(this);case to.ABSOLUTE_SIZE:return new eo(this);case to.RELATIVE_HEIGHT:return new ro(this);case to.RELATIVE_WIDTH:return new ho(this);case to.RELATIVE_SIZE:return new uo(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(Zh),ao=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.originX=n.originX,r.originY=n.originY,r.amount=vn.ofNumber("(".concat(n.amount,") * (Math.PI / 180)")),r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=!!(n.written&cn.WIDTH),h=!!(n.written&cn.HEIGHT),o=(-.5+e)*(s?t.size.x:n.sizeX),a=(-.5+u)*(h?t.size.y:n.sizeY),c=Math.sin(i)-Math.sin(r),f=Math.cos(i)-Math.cos(r),l=t.transform.position,v=!!(n.written&cn.POSITION_X),b=!!(n.written&cn.POSITION_Y),d=v?l.x:n.x,g=b?l.y:n.y;n.written|=cn.POSITION,l.set(d+o*f-a*c,g+o*c+a*f)},n}(dn),co=function(t){function n(n){return t.call(this,n,cn.ROTATION|cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=n.written&cn.ROTATION?e.rotation:n.rotation;e.rotation=r,n.written|=cn.ROTATION,this.adjustPosition(t,n,u,r,this.originX,this.originY)}},n}(ao),fo=function(t){function n(n){return t.call(this,n,cn.ROTATION|cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=n.written&cn.ROTATION?e.rotation:n.rotation;e.rotation=u+r,n.written|=cn.ROTATION,this.adjustPosition(t,n,u,e.rotation,this.originX,this.originY)}},n}(ao),lo={RELATIVE:0,ABSOLUTE:1},vo=function(t){function n(n,i,r,e,u){var s=t.call(this,Tn.TRANSFORM,i,Qh.ROTATE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case lo.ABSOLUTE:return new co(this);case lo.RELATIVE:return new fo(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(Zh),bo=function(t,n){switch(t[0]){case Tn.SHOW_HIDE:switch(t[2]){case Bh.SHAPE_SHOW:case Bh.SHAPE_HIDE:return Ph.deserialize(t,n);case Bh.SHAPE:return Hh.deserialize(t,n);case Bh.LAYER:return Uh.deserialize(t,n)}break;case Tn.BLINK:return In.deserialize(t,n);case Tn.CHANGE_COLOR:case Tn.CHANGE_COLOR_LEGACY:switch(t[3]){case Rn.COLOR_AND_ALPHA:case Rn.COLOR:case Rn.ALPHA:return Bn.deserialize(t,n);case Rn.CODE:return Un.deserialize(t,n);case Rn.BRIGHTNESS:return Pn.deserialize(t,n)}break;case Tn.CHANGE_TEXT:return Ni.deserialize(t,n);case Tn.CHANGE_CURSOR:return Hn.deserialize(t,n);case Tn.EMIT_EVENT:return Qe.deserialize(t,n);case Tn.OPEN:switch(t[2]){case Lu.DIALOG_TEXT:case Lu.DIALOG_INTEGER:case Lu.DIALOG_REAL:case Lu.DIALOG_BOOLEAN:case Lu.DIALOG_DATE:case Lu.DIALOG_TIME:case Lu.DIALOG_DATETIME:case Lu.DIALOG:return Ch.EXTENSION<=t[6]?Lh.deserialize(t,n):Ah.deserialize(t,n);case Lu.DIAGRAM_LEGACY:case Lu.PAGE_LEGACY:case Lu.PAGE_INPLACE_LEGACY:case Lu.DIAGRAM:case Lu.PAGE:return yu.deserialize(t,n);default:if(Lu.EXTENSION<=t[2])return xh.deserialize(t,n)}break;case Tn.TRANSFORM:switch(t[2]){case Qh.MOVE:return $h.deserialize(t,n);case Qh.RESIZE:return oo.deserialize(t,n);case Qh.ROTATE:return vo.deserialize(t,n)}break;case Tn.GESTURE:return Ve.deserialize(t,n);case Tn.MISC:switch(t[2]){case ze.GESTURE:return Ve.deserialize(t,n);case ze.SHOW_HIDE_LAYER:return Uh.deserialize(t,n);case ze.GESTURE_LAYER:return Ve.deserialize(t,n);case ze.EXECUTE:return Ru.deserialize(t,n);default:return Cu.deserialize(t,n)}}return null},go={},mo=function(t){try{var n=JSON.parse(t);return mt(n)&&2<=n.length?n:null}catch(t){return null}},wo=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];Ot(e)&&(i.gradient=function(t){var n=function(t){try{return JSON.parse(t)}catch(t){return null}}(t);if(!(null==n||n.length<7)){for(var i=n[0],r=[],e=1,u=n.length;e<u;e+=3)r.push({color:n[e+0],alpha:n[e+1],position:n[e+2]});return{points:r,direction:i}}}(e))}},po={},Oo=function(t){var n=po[t];if(null!=n)return n instanceof HTMLImageElement?Promise.resolve(n):n;var i=new Promise((function(n,i){var r=document.createElement("img");r.onload=function(){po[t]=r,n(r)},r.onabort=r.onerror=function(){i()},r.src=t}));return po[t]=i,i},Do=function(t,n,i){var r=n.resources;i.id=r[t[1]]||"";var e=i.transform;e.position.set(t[2],t[3]),e.rotation=t[6],e.skew.set(t[7],t[7]),e.pivot.set(t[21],t[22]),i.size.set(Ir(t[4]),Ir(t[5])),i.fill.deserialize(t[8],n),i.stroke.deserialize(t[9],n);var u=t[10];i.cursor=0<=u?r[u]:void 0,i.text.deserialize(t[11],n),i.data.deserialize(t[12],n),i.radius=t[13],i.corner=t[14];var s=t[23];i.interactive=!!(1&s);var h=i.state;h.isFocusable=!(2&s),h.isActive=!!(4&s);var o=t[24];i.shortcut=0<=o?r[o]:void 0;var a=t[25];i.title=0<=a?r[a]:void 0;var c=t[26];i.uuid=null!=c?c:0;var f=t[27],l=t[28],v=t[29];(null!=f&&f!==Ct.NONE||null!=l&&l!==Ct.NONE||null!=v&&v!==Ct.NONE)&&i.capability.set(f,l,v);var b=function(t,n,i){if(0<t.length){for(var r=[],e=0,u=t.length;e<u;++e)r.push(Pr(t[e],n));return Promise.all(r).then((function(t){i.children=t;for(var n=0,r=t.length;n<r;++n)t[n].parent=i;return i.onChildTransformChange(),i.toDirty(),i}))}return null}(t[20],n,i);!function(t,n,i){for(var r=i.action,e=n.resources,u=0,s=t.length;u<s;++u){var h=t[u],o=n.getAction(h);if(null!=o)r.add(o);else{var a=e[h];if(null!=a){var c=mo(a);if(null!=c&&0<c.length){var f=c[0],l=Tn.EXTENSION<=f?go[f]:bo;if(null!=l){var v=l(c,n);null!=v&&(n.setAction(h,v),r.add(v))}}}}}}(t[17],n,i),wo(t[19],n,i);var d=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];if(Ot(e))return Oo(e).then((function(t){return i.image=t,i}))}return null}(t[18],n,i);return null!=b?null!=d?Promise.all([b,d]).then((function(){return i})):b:null!=d?d:i},Eo=function(t,n,i){i=i||new en;var r=Do(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=z.NON_SCALING_MASK|z.DOTTED_MASK|z.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},Mo=function(){e[r.BAR]=hn,n[r.BAR]=Eo},So={},jo=36,To=[0,0,0],No=new t.Point,Io=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+2,t[++r]=n+1,t[++r]=n+3,t[++r]=n+2,t[++r]=n+4,t[++r]=n+5,t[++r]=n+6,t[++r]=n+5,t[++r]=n+7,t[++r]=n+6,t[++r]=n+8,t[++r]=n+9,t[++r]=n+10,t[++r]=n+9,t[++r]=n+11,t[++r]=n+10,t[++r]=n+12,t[++r]=n+13,t[++r]=n+14,t[++r]=n+13,t[++r]=n+15,t[++r]=n+14,t[++r]=n+16,t[++r]=n+17,t[++r]=n+20,t[++r]=n+17,t[++r]=n+21,t[++r]=n+20,t[++r]=n+17,t[++r]=n+18,t[++r]=n+21,t[++r]=n+18,t[++r]=n+22,t[++r]=n+21,t[++r]=n+19,t[++r]=n+21,t[++r]=n+24,t[++r]=n+21,t[++r]=n+25,t[++r]=n+24,t[++r]=n+21,t[++r]=n+23,t[++r]=n+26,t[++r]=n+23,t[++r]=n+27,t[++r]=n+26,t[++r]=n+24,t[++r]=n+25,t[++r]=n+28,t[++r]=n+25,t[++r]=n+30,t[++r]=n+28,t[++r]=n+26,t[++r]=n+27,t[++r]=n+30,t[++r]=n+27,t[++r]=n+32,t[++r]=n+30,t[++r]=n+29,t[++r]=n+30,t[++r]=n+33,t[++r]=n+30,t[++r]=n+34,t[++r]=n+33,t[++r]=n+30,t[++r]=n+31,t[++r]=n+34,t[++r]=n+31,t[++r]=n+35,t[++r]=n+34},Co=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.abs(l),d=Math.abs(v),g=o*Math.min(b,d),m=g/b,w=g/d,p=No;p.set(i-l,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r-v),a.apply(p,p);var M=p.x,S=p.y,j=M-D,T=S-E,N=m*j,I=m*T,C=D+N,A=E+I,R=M+j,k=S+T,L=R-N,y=k-I;p.set(i,r),a.apply(p,p);var x=p.x,B=p.y,_=x-M,P=B-S,F=w*_,U=w*P,G=M+F,H=S+U,z=G-j,V=H-T,W=z+N,X=V+I,K=G+j,Y=H+T,J=K-N,Z=Y-I,q=x-j,Q=B-T,$=x+j,tt=B+T,nt=x+_,it=B+P,rt=nt-F,et=it-U,ut=rt-j,st=et-T,ht=ut+N,ot=st+I,at=rt+j,ct=et+T,ft=at-N,lt=ct-I,vt=nt-j,bt=it-T,dt=vt+N,gt=bt+I,mt=nt+j,wt=it+T,pt=mt-N,Ot=wt-I;c[0]=O(D,E,C,A),c[1]=O(D,E,M,S),c[2]=O(D,E,q,Q);var Dt=2*n-1;t[++Dt]=D,t[++Dt]=E,t[++Dt]=C,t[++Dt]=A,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=L,t[++Dt]=y,t[++Dt]=R,t[++Dt]=k,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=vt,t[++Dt]=bt,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=pt,t[++Dt]=Ot,t[++Dt]=mt,t[++Dt]=wt,t[++Dt]=C,t[++Dt]=A,t[++Dt]=M,t[++Dt]=S,t[++Dt]=L,t[++Dt]=y,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=G,t[++Dt]=H,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=q,t[++Dt]=Q,t[++Dt]=x,t[++Dt]=B,t[++Dt]=x,t[++Dt]=B,t[++Dt]=$,t[++Dt]=tt,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=rt,t[++Dt]=et,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=nt,t[++Dt]=it,t[++Dt]=pt,t[++Dt]=Ot},Ao=function(t,n,i,r){var e=3*n-1,u=1-r[0]/r[1],s=1-r[0]/r[2];i&ut.TOP_LEFT?(t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1):(t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0),i&ut.TOP_RIGHT?(t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1):(t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0),i&ut.BOTTOM_LEFT?(t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&ut.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0),t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0},Ro=function(t,n,i,r,e,u,s){var h,a,c,f,l,v,b,d,g,m,w,p,O=o(e),D=s[0],E=s[1],M=s[2],S=Math.max(0,1-s[0]/s[1]),j=Math.max(0,1-s[0]/s[2]);r&qt.TOP?(h=2,a=1,c=1+j):(h=-2,a=-1,c=-1-j),r&qt.RIGHT?(f=2,l=1,v=1+S):(f=-2,l=-1,v=-1-S),r&qt.BOTTOM?(b=2,d=1,g=1+j):(b=-2,d=-1,g=-1-j),r&qt.LEFT?(m=2,w=1,p=1+S):(m=-2,w=-1,p=-1-S);var T=6*n-1;u&ut.TOP_LEFT?(t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=m,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=w,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=m,t[++T]=a,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=w,t[++T]=a):(t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=m,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=p,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=m,t[++T]=c,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=p,t[++T]=c),u&ut.TOP_RIGHT?(t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=l,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=f,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=l,t[++T]=a,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=f,t[++T]=a):(t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=v,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=f,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=v,t[++T]=c,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=f,t[++T]=c),u&ut.BOTTOM_LEFT?(t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=m,t[++T]=d,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=w,t[++T]=d,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=m,t[++T]=b,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=w,t[++T]=b):(t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=m,t[++T]=g,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=p,t[++T]=g,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=m,t[++T]=b,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=p,t[++T]=b),u&ut.BOTTOM_RIGHT?(t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=l,t[++T]=d,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=f,t[++T]=d,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=l,t[++T]=b,t[++T]=i,t[++T]=O,t[++T]=D,t[++T]=D,t[++T]=f,t[++T]=b):(t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=v,t[++T]=g,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=f,t[++T]=g,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=v,t[++T]=b,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=f,t[++T]=b),t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=p,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=w,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=v,t[++T]=h,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=m,t[++T]=c,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=p,t[++T]=c,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=w,t[++T]=c,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=v,t[++T]=c,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=f,t[++T]=c,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=m,t[++T]=a,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=w,t[++T]=a,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=l,t[++T]=d,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=f,t[++T]=d,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=m,t[++T]=g,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=p,t[++T]=g,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=d,t[++T]=g,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=v,t[++T]=g,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=f,t[++T]=g,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=p,t[++T]=b,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=d,t[++T]=b,t[++T]=i,t[++T]=O,t[++T]=E,t[++T]=M,t[++T]=v,t[++T]=b},ko=function(t,n,i,r){var e=i.x0,u=i.x1,s=i.x2,h=i.x3,o=i.y0,a=i.y1,c=i.y2,f=i.y3,l=.5*(e+u),v=.5*(o+a),b=.5*(h+s),d=.5*(f+c),g=.5*r[0]/r[1],m=.5*r[0]/r[2],w=g*(u-e),p=g*(a-o),O=m*(h-e),D=m*(f-o),E=2*n-1;t[++E]=e,t[++E]=o,t[++E]=e+w,t[++E]=o+p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+w+O,t[++E]=o+p+D,t[++E]=u-w,t[++E]=a-p,t[++E]=u,t[++E]=a,t[++E]=u-w+O,t[++E]=a-p+D,t[++E]=u+O,t[++E]=a+D,t[++E]=h-O,t[++E]=f-D,t[++E]=h+w-O,t[++E]=f+p-D,t[++E]=h,t[++E]=f,t[++E]=h+w,t[++E]=f+p,t[++E]=s-w-O,t[++E]=c-p-D,t[++E]=s-O,t[++E]=c-D,t[++E]=s-w,t[++E]=c-p,t[++E]=s,t[++E]=c,t[++E]=e+w,t[++E]=o+p,t[++E]=l,t[++E]=v,t[++E]=u-w,t[++E]=a-p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+O+w,t[++E]=o+D+p,t[++E]=l+O,t[++E]=v+D,t[++E]=u+O-w,t[++E]=a+D-p,t[++E]=u+O,t[++E]=a+D;var M=.5*(e+s),S=.5*(o+c);t[++E]=.5*(e+h),t[++E]=.5*(o+f),t[++E]=M,t[++E]=S,t[++E]=M,t[++E]=S,t[++E]=.5*(u+s),t[++E]=.5*(a+c),t[++E]=h-O,t[++E]=f-D,t[++E]=h-O+w,t[++E]=f-D+p,t[++E]=b-O,t[++E]=d-D,t[++E]=s-O-w,t[++E]=c-D-p,t[++E]=s-O,t[++E]=c-D,t[++E]=h+w,t[++E]=f+p,t[++E]=b,t[++E]=d,t[++E]=s-w,t[++E]=c-p},Lo=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Io(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=n.radius,s=r!==this.sizeX||e!==this.sizeY||u!==this.radius,h=X(n),o=this.transformLocalId!==h,a=n.stroke,c=a.align,f=a.enable?a.width:0,l=a.side,v=a.style,b=this.strokeAlign!==c||this.strokeWidth!==f||this.strokeSide!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=K(n),w=Y(m),p=m!==this.texture||w!==this.textureTransformId,O=s||b;if(O||o||g||p){this.sizeX=r,this.sizeY=e,this.radius=u,this.transformLocalId=h,this.strokeAlign=c,this.strokeWidth=f,this.strokeSide=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Co(t.vertices,D,0,0,r,e,c,f,u,n.transform.internalTransform,To),(O||g||o)&&(t.updateSteps(),Ro(t.steps,D,f,l,v,d,To)),(O||g)&&(t.updateClippings(),Ao(t.clippings,D,d,To)),(O||p)&&(t.updateUvs(),ko(t.uvs,D,J(m),To))}},n}(W),yo=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=jo+h,c=24+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Lo(i,r,a-h,c-o),new sn(i+jo,r+24,h,o)]).init(n):null},xo=function(t,n,i,r,e){return yo(t,n,i,r)},Bo=function(t,n,i,r,e,u){var s=-i+e;if(t<=s)return n<=(h=-r+e)&&u&ut.TOP_LEFT?(a=t-s)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&ut.BOTTOM_LEFT?(a=t-s)*a+(c=n-o)*c<=e*e:-i<=t;var h,o,a,c,f=+i-e;return f<=t?n<=(h=-r+e)&&u&ut.TOP_RIGHT?(a=t-f)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&ut.BOTTOM_RIGHT?(a=t-f)*a+(c=n-o)*c<=e*e:t<=+i:-r<=n&&n<=+r},_o=function(t,n,i,r,e,u,s){var h=t.fill;if(h.enable||0<u){var o=t.radius*Math.min(r,e),a=t.corner;if(Bo(n,i,r,e,o,a)){if(h.enable)return!0;var c=u*s,f=Math.max(0,r-c),l=Math.max(0,e-c),v=Math.max(0,o-c);if(!Bo(n,i,f,l,v,a)){var b=t.stroke.side;if(b===qt.ALL)return!0;if(n<=-f+v){var d=!!(b&qt.LEFT);return i<=-l+v?!(!(g=!!(b&qt.TOP))||!d)||(g?-f<=i:!!d&&n<=-f):+l-v<=i?!(!(m=!!(b&qt.BOTTOM))||!d)||(m?+f<=i:!!d&&n<=-f):d}if(+f-v<=n){var g,m,w=!!(b&qt.RIGHT);return i<=-l+v?!(!(g=!!(b&qt.TOP))||!w)||(g?-f<=i:!!w&&+f<=n):+l-v<=i?!(!(m=!!(b&qt.BOTTOM))||!w)||(m?+f<=i:!!w&&+f<=n):w}return i<=-l+v?!!(b&qt.TOP):+l-v<=i&&!!(b&qt.BOTTOM)}}}return!1},Po=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&_o(this,n,i,r,e,u,s)},n}(Jt),Fo=function(t){function n(n){void 0===n&&(n=r.BUTTON);var i=t.call(this,n)||this;return i.wh=!1,i.Oh=!1,i}return _(n,t),Object.defineProperty(n.prototype,"isToggle",{get:function(){return this.wh},set:function(t){this.wh=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return this.Oh},set:function(t){this.Oh=t},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.wh?1:0,e=this.Oh?2:0;return i[15]=n.addResource("[".concat(r|e,"]")),i},n}(Po),Uo=function(t,n,i){i=i||new Fo;var r=n.resources,e=t[15];if(0<=e&&e<r.length){var u=n.getExtension(e);null==u&&(u=JSON.parse(r[e]),n.setExtension(e,u)),i.isToggle=!!(1&u[0]),i.isGrouped=!!(2&u[0])}return Do(t,n,i)},Go=function(t){function n(n){var i=t.call(this,cn.COLOR_FILL_AND_STROKE|cn.COLOR_TEXT|cn.COLOR_TEXT_OUTLINE|cn.CURSOR)||this,r=n.fill,e=r.color,u=i.toOnHovered(e),s=2*u;i.Qh=e,i.$h=an.toGrayscale(e),i.no=an.darken(e,s),i.io=an.darken(e,u);var h=r.alpha;i.ro=h,i.eo=.5*h;var o=n.stroke,a=o.color,c=i.toOnHovered(a),f=2*c;i.uo=a,i.so=an.toGrayscale(a),i.ho=an.darken(a,f),i.oo=an.darken(a,c);var l=o.alpha;i.ao=l,i.co=.5*l;var v=n.text,b=v.color;i.ah=b,i.fo=an.toGrayscale(b);var d=v.alpha;i.fh=d,i.lo=.5*d;var g=v.outline,m=g.color;i.vo=m,i.bo=an.toGrayscale(m);var w=g.alpha;return i.do=w,i.mo=.5*w,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=an.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.$h:t.isPressed||t.isActive?this.no:t.isFocused||t.isHovered?this.io:this.Qh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.eo:this.ro},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.so:t.isPressed||t.isActive?this.ho:t.isFocused||t.isHovered?this.oo:this.uo},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.co:this.ao},n.prototype.getTextColor=function(t){return t.inDisabled?this.fo:this.ah},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.lo:this.fh},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.bo:this.vo},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.mo:this.do},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(bn),Ho=function(t){function n(n){var i=t.call(this,cn.COLOR_FILL_AND_STROKE|cn.COLOR_TEXT|cn.COLOR_TEXT_OUTLINE|cn.CURSOR)||this,r=n.fill,e=r.color;i.wo=e;var u=i.toOnHovered(e),s=2*u;i.po=an.darken(e,s),i.Oo=an.darken(e,u);var h=15197671;i.Qh=h;var o=i.toOnHovered(h),a=2*o;i.no=an.darken(h,a),i.io=an.darken(h,o);var c=r.alpha;i.ro=c,i.eo=.5*c;var f=n.stroke,l=f.color;i.Do=l;var v=i.toOnHovered(l),b=2*v;i.Eo=an.darken(l,b),i.Mo=an.darken(l,v);var d=15197671;i.uo=d;var g=i.toOnHovered(d),m=2*g;i.ho=an.darken(d,m),i.So=an.darken(d,g);var w=f.alpha;i.ao=w,i.co=.5*w;var p=n.text,O=p.color;i.jo=O,i.fo=an.toGrayscale(O),i.ah=5197647;var D=p.alpha;i.fh=D,i.lo=.5*D;var E=p.outline,M=E.color;i.vo=M,i.bo=an.toGrayscale(M);var S=E.alpha;return i.do=S,i.mo=.5*S,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=an.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.Qh:t.isActive?t.isPressed?this.po:t.isFocused||t.isHovered?this.Oo:this.wo:t.isPressed?this.no:t.isFocused||t.isHovered?this.io:this.Qh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.eo:this.ro},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.uo:t.isActive?t.isPressed?this.Eo:t.isFocused||t.isHovered?this.Mo:this.Do:t.isPressed?this.ho:t.isFocused||t.isHovered?this.So:this.uo},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.co:this.ao},n.prototype.getTextColor=function(t){return t.inDisabled?this.fo:t.isActive?this.jo:this.ah},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.lo:this.fh},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.bo:this.vo},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.mo:this.do},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(bn),zo=function(t){function n(n){var i=t.call(this,n)||this;return n instanceof Fo&&(i.wh=n.isToggle,i.Oh=n.isGrouped),i}return _(n,t),n.prototype.isActionable=function(){return!0},n.prototype.initialize=function(n){this.actions.unshift(this.wh?new Ho(this):new Go(this)),t.prototype.initialize.call(this,n)},n.prototype.onClick=function(n,i){var r=n.state,e=r.isClicked;r.lock(),t.prototype.onClick.call(this,n,i),!e&&r.isClicked&&(this.wh?r.isActive=!r.isActive:r.isActive||(r.isActivated=!0)),r.unlock()},n.prototype.onStateChange=function(n,i,r){t.prototype.onStateChange.call(this,n,i,r),this.wh&&this.Oh&&i.is(Mt.ACTIVATED)&&this.onActivated(n)},n.prototype.onActivated=function(t){var n=t.parent;if(null!=n)for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u instanceof Fo&&u.isToggle&&u.isGrouped&&(u.state.isActive=!1)}},n}(uu),Vo=function(){e[r.BUTTON]=xo,n[r.BUTTON]=Uo,So[r.BUTTON]=zo,Tr.set(r.BUTTON,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},Wo=[0,0],Xo=new t.Point,Ko=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1},Yo=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Jo=function(t,n,i,r,e,u,s,h,o,a){var c=Xo,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D+(D-g),S=E+(E-m),j=D-w,T=E-p,N=2*n-1;t[++N]=b,t[++N]=d,t[++N]=g,t[++N]=m,t[++N]=g+w,t[++N]=m+p,t[++N]=j,t[++N]=T,t[++N]=D,t[++N]=E,t[++N]=D+w,t[++N]=E+p,t[++N]=M-w,t[++N]=S-p,t[++N]=M,t[++N]=S,t[++N]=M+w,t[++N]=S+p,a[0]=O(b,d,g,m),a[1]=O(b,d,j,T)},Zo=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<9;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},qo=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a),t[++f]=s,t[++f]=c,t[++f]=.5*(s+u),t[++f]=.5*(c+a),t[++f]=u,t[++f]=a},Qo=function(t){function n(n,i){return t.call(this,n,i,9,8)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;Ko(t.clippings,n),Yo(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),Jo(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,Wo),Zo(t.steps,t.clippings,this.vertexOffset,c,f,Wo))},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=J(i);qo(t.uvs,this.vertexOffset,e)}},n}(W),$o=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Qo(i,r),new sn(i+9,r+8,h,o)]).init(n):null},ta=function(t){function n(n){return void 0===n&&(n=r.CIRCLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Zt(this,n,i,r,e,u,s)},n}(Jt),na=function(t,n,i){return Do(t,n,i||new ta)},ia=function(){e[r.CIRCLE]=$o,n[r.CIRCLE]=na},ra=new t.Point,ea=function(t){return t?t.formatted.length:0},ua=function(t){return 12*Math.ceil(ea(t)/12)},sa=function(t,n){return n?4*t+2:4*t},ha=function(t,n){return sa(t,n)-2},oa=function(t,n,i,r){for(var e=3*n-1,u=3*(n+i)-1,s=0;s<r;++s)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5,t[++e]=1,t[++e]=0,t[++e]=4,t[++e]=0,t[++e]=1,t[++e]=6;for(;e<u;)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5},aa=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s+0,t[++e]=s+2,t[++e]=s+1,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=2},ca=function(t,n,i,r,e,u){for(var s=1/Math.max(1e-5,u),h=e.x0,o=e.x1,a=e.x2,c=e.x3,f=e.y0,l=e.y1,v=e.y2,b=e.y3,d=o-h,g=l-f,m=a-c,w=v-b,p=(i<<1)-1,O=(i+r<<1)-1,D=(i<<2)-8;p<O;){var E=n[D+=8]*s;t[++p]=h+E*d,t[++p]=f+E*g,t[++p]=c+E*m,t[++p]=b+E*w}},fa=function(t,n,i,r,e,u,s,h,o,a,c,f){var l=H;null==l&&(H=l=[]);for(var v=f.a,b=f.b,d=f.c,g=f.d,m=f.tx,w=f.ty,p=0;p<u;++p){var O=p<<1,D=h[O],E=h[O+1];l[O]=v*D+d*E+m,l[O+1]=b*D+g*E+w}return va(t,n,i,r,e,u,s,l,o,a,c)},la=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=1]=b,n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=4]=b},va=function(t,n,i,r,e,u,s,h,o,a,c){var f=o.length;if(0<f){if(s){for(var l=0,v=0,b=r,d=0,g=o[0],m=1;m<f;++m)2<=(d=o[m])-g&&(v=da(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=sa(d-g,!1)),g=d;return 2<=(d=o[0]+u)-g?(v=da(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=sa(d-g,!1)):ba(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}for(l=0,v=0,b=r,2<=(d=o[0])&&(v=da(t,n,i,b,-1,h,0,d,u,a,c,v),l=Math.max(l,v),b+=sa(d,!1)),g=d,m=1;m<f;++m)2<=(d=o[m])-g&&(v=da(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=sa(d-g,!1)),g=d;return 2<=(d=u)-g?(v=da(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=sa(d-g,!1)):ba(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}return s?ga(t,n,i,r,e,h,0,u,u,a,c):da(t,n,i,r,e,h,0,u,u,a,c,0)},ba=function(t,n,i,r,e,u,s,h,a,c,f,l){if(0<=e)for(var v=o(f),b=(r<<1)-1,d=6*r-1,g=(r<<2)-1,m=(r+e<<1)-1,w=s%a<<1,p=u[w],O=u[w+1];b<m;)t[++b]=p,t[++b]=O,n[++d]=0,n[++d]=v,n[++d]=-1,n[++d]=0,n[++d]=1,n[++d]=0,i[++g]=l,i[++g]=0,i[++g]=0,i[++g]=l;return 0},da=function(t,n,i,r,e,u,s,a,c,f,l,v){var b=o(l),d=s%c<<1,g=u[d],m=u[d+1],w=(s+1)%c<<1,p=u[w],D=u[w+1],E=g-(p-g),M=m-(D-m),S=(r<<1)-1,j=6*r-1,T=(r<<2)-1,N=0;la(S,t,j,n,T,i,g,m,f,b,E,M,p,D,v),la(S+=4,t,j+=12,n,T+=8,i,g,m,f,b,E,M,p,D,N),S+=4,j+=12,T+=8;for(var I=s+1,C=a-1;I<C;++I){E=g,M=m,g=p,m=D;var A=(I+1)%c<<1;p=u[A],D=u[A+1],N+=O(E,M,g,m),la(S,t,j,n,T,i,g,m,f,b,E,M,p,D,N),la(S+=4,t,j+=12,n,T+=8,i,g,m,f,b,E,M,p,D,N),S+=4,j+=12,T+=8}E=g,M=m,p=(g=p)+(g-E),D=(m=D)+(m-M),N+=O(E,M,g,m),la(S,t,j,n,T,i,g,m,f,b,E,M,p,D,N),la(S+=4,t,j+=12,n,T+=8,i,g,m,f,b,E,M,p,D,N),S+=4,j+=12,T+=8;var R=h(N,f,l,ra),k=R.x,L=R.y,y=(r<<2)-1;for(I=y,C=y+8;I<C;I+=4)i[I+2]=k,i[I+3]=L,i[I+4]=v;for(I=y+8;I<T;I+=4)i[I+2]=k,i[I+3]=L,i[I+4]=N;if(0<=e)for(var x=(r+e<<1)-1;S<x;)t[++S]=g,t[++S]=m,n[++j]=0,n[++j]=b,n[++j]=E,n[++j]=M,n[++j]=p,n[++j]=D,i[++T]=N,i[++T]=k,i[++T]=L,i[++T]=N;return N},ga=function(t,n,i,r,e,u,s,a,c,f,l){for(var v=o(l),b=(a-1)%c<<1,d=0,g=0,m=u[b],w=u[b+1],p=s%c<<1,D=u[p],E=u[p+1],M=0,S=(r<<1)-1,j=6*r-1,T=(r<<2)-1,N=s;N<a;++N){d=m,g=w,m=D,w=E;var I=(N+1)%c<<1;D=u[I],E=u[I+1],M+=O(d,g,m,w),la(S,t,j,n,T,i,m,w,f,v,d,g,D,E,M),la(S+=4,t,j+=12,n,T+=8,i,m,w,f,v,d,g,D,E,M),S+=4,j+=12,T+=8}d=m,g=w,m=D,w=E;var C=(s+1)%c<<1;D=u[C],E=u[C+1],M+=O(d,g,m,w),la(S,t,j,n,T,i,m,w,f,v,d,g,D,E,M),S+=4,j+=12,T+=8;var A=h(M,f,l,ra),R=A.x,k=A.y;for(N=(r<<2)-1;N<T;N+=4)i[N+2]=R,i[N+3]=k,i[N+4]=-1;if(0<=e)for(var L=(r+e<<1)-1;S<L;)t[++S]=m,t[++S]=w,n[++j]=f,n[++j]=v,n[++j]=d,n[++j]=g,n[++j]=D,n[++j]=E,i[++T]=M,i[++T]=R,i[++T]=k,i[++T]=-1;return M},ma=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.pointId=-1,u.pointCount=0,u.pointsClosed=!1,u.length=1,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),aa(t.indices,this.vertexOffset,this.indexOffset,this.indexCount)},n.prototype.isCompatible=function(t){return sa(ua(t.points),!0)===this.vertexCount},n.prototype.update=function(t,n){this.updateLineClipping(t,n),this.updateLineVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateLineUv(t,n)},n.prototype.updateLineClipping=function(t,n){var i=n.points;if(i){var r=i.formatted.length;this.pointCount!==r&&(this.pointCount=r,this.pointId=-1,t.updateClippings(),oa(t.clippings,this.vertexOffset,this.vertexCount,r))}},n.prototype.updateLineVertexStepAndColorFill=function(t,n){var i=n.points;if(i){var r=i.id,e=i.formatted,u=!!(e.style&z.CLOSED),s=r!==this.pointId||u!==this.pointsClosed,h=n.stroke,o=h.enable?h.width:0,a=h.style,c=this.strokeWidth!==o||this.strokeStyle!==a,f=X(n),l=this.transformLocalId!==f;(s||l||c)&&(this.pointId=r,this.pointsClosed=u,this.strokeWidth=o,this.strokeStyle=a,this.transformLocalId=f,s&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),this.length=fa(t.vertices,t.steps,t.colorFills,this.vertexOffset,this.vertexCount,this.pointCount,this.pointsClosed,e.values,e.segments,o,a,n.transform.internalTransform))}},n.prototype.updateLineUv=function(t,n){var i=K(n),r=Y(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),ca(t.uvs,t.colorFills,this.vertexOffset,this.vertexCount,J(i),this.length))},n}(W),wa=[0,0,0],pa=new t.Point,Oa=function(t,n){var i=3*n-1;t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0},Da=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+2,t[++r]=n+0,t[++r]=n+3,t[++r]=n+4,t[++r]=n+0,t[++r]=n+5,t[++r]=n+6},Ea=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=2*f*l/(f+Math.sqrt(f*f+4*l*l)),b=pa;b.set(i,r-l),o.apply(b,b);var d=b.x,g=b.y;b.set(i,r),o.apply(b,b);var m=b.x,w=b.y;b.set(i+f,r),o.apply(b,b);var p=m-d,D=w-g,E=b.x+p,M=b.y+D,S=m+(m-b.x)+p,j=w+(w-b.y)+D;b.set(i,r+l-v),o.apply(b,b);var T=b.x,N=b.y,I=m+p,C=w+D;a[0]=O(I,C,T,N),a[1]=O(E,M,I,C),a[2]=O(d,g,m,w);var A=(n<<1)-1;t[++A]=T,t[++A]=N,t[++A]=d,t[++A]=g,t[++A]=E,t[++A]=M,t[++A]=E,t[++A]=M,t[++A]=S,t[++A]=j,t[++A]=S,t[++A]=j,t[++A]=d,t[++A]=g},Ma=function(t,n,i,r,e,u,s){for(var h=o(u),a=s[0],c=6*i-1,f=3*i,l=0;l<r;l+=1,f+=3)t[++c]=e,t[++c]=h,t[++c]=a,t[++c]=a,t[++c]=1+n[f],t[++c]=1+n[f+1]},Sa=function(t,n,i,r){var e=n.x0,u=n.x1,s=n.x2,h=n.x3,o=n.y0,a=n.y1,c=n.y2,f=n.y3,l=.5*(e+u),v=.5*(o+a),b=1-.5*r[0]/r[2],d=l+b*(h-e),g=v+b*(f-o),m=(i<<1)-1;t[++m]=d,t[++m]=g,t[++m]=l,t[++m]=v,t[++m]=s,t[++m]=c,t[++m]=s,t[++m]=c,t[++m]=h,t[++m]=f,t[++m]=h,t[++m]=f,t[++m]=l,t[++m]=v},ja=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.updateColorFill=function(t,n){var i=n.points;if(null!=i){var r=i.getMarker();if(null!=r){var e=this.toMarker(r).fill,u=n.visible&&e.enable,s=e.color,h=u?e.alpha:0;s===this.colorFill&&h===this.alphaFill||(this.colorFill=s,this.alphaFill=h,t.updateColorFills(),V(s,h,this.vertexOffset,this.vertexCount,t.colorFills))}}},n}(W),Ta=function(n){function i(t,i){var r=n.call(this,t,i,7,3)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices(),Oa(t.clippings,this.vertexOffset),Da(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=X(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=K(r),O=Y(p),D=p!==this.texture||O!==this.textureTransformId,E=f||w,M=u.id,S=M!==this.pointId;if(E||v||D||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.texture=p,this.textureTransformId=O,this.pointId=M;var j=this.vertexOffset,T=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;T.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),Ea(n.vertices,j,0,0,a,c,d,g,T,wa),(E||v)&&(n.updateSteps(),Ma(n.steps,n.clippings,j,7,g,m,wa)),(E||D)&&(n.updateUvs(),Sa(n.uvs,J(p),j,wa))}}}},i}(ja),Na=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Ta),Ia=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Ta),Ca=function(n){function i(t,i){var r=n.call(this,t,i,9,8)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;Ko(t.clippings,n),Yo(t.indices,n,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},i.prototype.updateVertexAndStep=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=X(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=u.id,O=p!==this.pointId;if(f||v||w||O){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.pointId=p;var D=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;D.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),n.updateSteps(),Jo(n.vertices,this.vertexOffset,0,0,a,c,d,g,D,Wo),Zo(n.steps,n.clippings,this.vertexOffset,g,m,Wo)}}}},i.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=J(i);qo(t.uvs,this.vertexOffset,e)}},i}(ja),Aa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Ca),Ra=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Ca),ka=function(){function n(t,n){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=0,this.indexCount=0,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=K(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),La=24,ya=16,xa=[0,0,0,0],Ba=new t.Point,_a=function(t,n,i){var r=1-i[0],e=1-i[1],u=3*n-1;t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0},Pa=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+4,t[++r]=n+4,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+5,t[++r]=n+2,t[++r]=n+3,t[++r]=n+8,t[++r]=n+6,t[++r]=n+9,t[++r]=n+9,t[++r]=n+6,t[++r]=n+7,t[++r]=n+9,t[++r]=n+7,t[++r]=n+10,t[++r]=n+10,t[++r]=n+7,t[++r]=n+11,t[++r]=n+12,t[++r]=n+16,t[++r]=n+13,t[++r]=n+13,t[++r]=n+16,t[++r]=n+17,t[++r]=n+13,t[++r]=n+17,t[++r]=n+14,t[++r]=n+14,t[++r]=n+17,t[++r]=n+15,t[++r]=n+18,t[++r]=n+20,t[++r]=n+21,t[++r]=n+18,t[++r]=n+21,t[++r]=n+22,t[++r]=n+18,t[++r]=n+22,t[++r]=n+19,t[++r]=n+19,t[++r]=n+22,t[++r]=n+23},Fa=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=Ba;v.set(i-f,r-l),o.apply(v,v);var b=v.x,d=v.y;v.set(i+f,r-l),o.apply(v,v);var g=v.x,m=v.y;v.set(i+f,r+l),o.apply(v,v);var w=v.x,p=v.y,D=b+(w-g),E=d+(p-m),M=.5*O(b,d,g,m),S=.5*O(g,m,w,p),j=1,T=1;M<=S?T=M/S:j=S/M,a[0]=j,a[1]=T,a[2]=M,a[3]=S;var N=j*(g-b)*.5,I=j*(m-d)*.5,C=T*(D-b)*.5,A=T*(E-d)*.5,R=(n<<1)-1;t[++R]=b,t[++R]=d,t[++R]=b+N,t[++R]=d+I,t[++R]=g-N,t[++R]=m-I,t[++R]=g,t[++R]=m,t[++R]=b+N+C,t[++R]=d+I+A,t[++R]=g-N+C,t[++R]=m-I+A,t[++R]=D+N-C,t[++R]=E+I-A,t[++R]=w-N-C,t[++R]=p-I-A,t[++R]=D,t[++R]=E,t[++R]=D+N,t[++R]=E+I,t[++R]=w-N,t[++R]=p-I,t[++R]=w,t[++R]=p,t[++R]=b,t[++R]=d,t[++R]=b+C,t[++R]=d+A,t[++R]=D-C,t[++R]=E-A,t[++R]=D,t[++R]=E,t[++R]=b+C+N,t[++R]=d+A+I,t[++R]=D-C+N,t[++R]=E-A+I,t[++R]=g+C-N,t[++R]=m+A-I,t[++R]=w-C-N,t[++R]=p-A-I,t[++R]=g,t[++R]=m,t[++R]=g+C,t[++R]=m+A,t[++R]=w-C,t[++R]=p-A,t[++R]=w,t[++R]=p},Ua=function(t,n,i,r,e,u){var s,h,a,c,f,l,v,b,d=o(e),g=u[0],m=u[1],w=Math.max(0,1-g),p=Math.max(0,1-m),O=u[2],D=u[3];r&qt.TOP?(s=2,h=1+p):(s=-2,h=-1-p),r&qt.RIGHT?(a=2,c=1+w):(a=-2,c=-1-w),r&qt.BOTTOM?(f=2,l=1+p):(f=-2,l=-1-p),r&qt.LEFT?(v=2,b=1+w):(v=-2,b=-1-w);var E=6*(t-1)-1;Ga(n,E+=6,i,d,O,D,v,s),Ga(n,E+=6,i,d,O,D,b,s),Ga(n,E+=6,i,d,O,D,c,s),Ga(n,E+=6,i,d,O,D,a,s),Ga(n,E+=6,i,d,O,D,b,h),Ga(n,E+=6,i,d,O,D,c,h),Ga(n,E+=6,i,d,O,D,b,l),Ga(n,E+=6,i,d,O,D,c,l),Ga(n,E+=6,i,d,O,D,v,f),Ga(n,E+=6,i,d,O,D,b,f),Ga(n,E+=6,i,d,O,D,c,f),Ga(n,E+=6,i,d,O,D,a,f),Ga(n,E+=6,i,d,O,D,v,s),Ga(n,E+=6,i,d,O,D,v,h),Ga(n,E+=6,i,d,O,D,v,l),Ga(n,E+=6,i,d,O,D,v,f),Ga(n,E+=6,i,d,O,D,b,h),Ga(n,E+=6,i,d,O,D,b,l),Ga(n,E+=6,i,d,O,D,c,h),Ga(n,E+=6,i,d,O,D,c,l),Ga(n,E+=6,i,d,O,D,a,s),Ga(n,E+=6,i,d,O,D,a,h),Ga(n,E+=6,i,d,O,D,a,l),Ga(n,E+=6,i,d,O,D,a,f)},Ga=function(t,n,i,r,e,u,s,h){t[++n]=i,t[++n]=r,t[++n]=e,t[++n]=u,t[++n]=s,t[++n]=h},Ha=function(t,n,i,r){var e=i.x0,u=i.y0,s=i.y1,h=i.x1,o=i.y2,a=i.x2,c=i.y3,f=i.x3,l=r[0],v=r[1],b=l*(h-e)*.5,d=l*(s-u)*.5,g=v*(f-e)*.5,m=v*(c-u)*.5,w=(n<<1)-1;t[++w]=e,t[++w]=u,t[++w]=e+b,t[++w]=u+d,t[++w]=h-b,t[++w]=s-d,t[++w]=h,t[++w]=s,t[++w]=e+b+g,t[++w]=u+d+m,t[++w]=h-b+g,t[++w]=s-d+m,t[++w]=f+b-g,t[++w]=c+d-m,t[++w]=a-b-g,t[++w]=o-d-m,t[++w]=f,t[++w]=c,t[++w]=f+b,t[++w]=c+d,t[++w]=a-b,t[++w]=o-d,t[++w]=a,t[++w]=o,t[++w]=e,t[++w]=u,t[++w]=e+g,t[++w]=u+m,t[++w]=f-g,t[++w]=c-m,t[++w]=f,t[++w]=c,t[++w]=e+g+b,t[++w]=u+m+d,t[++w]=f-g+b,t[++w]=c-m+d,t[++w]=h+g-b,t[++w]=s+m-d,t[++w]=a-g-b,t[++w]=o-m-d,t[++w]=h,t[++w]=s,t[++w]=h+g,t[++w]=s+m,t[++w]=a-g,t[++w]=o-m,t[++w]=a,t[++w]=o},za=function(n){function i(t,i){var r=n.call(this,t,i,La,ya)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateIndices(),Pa(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexClippingStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=X(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.side,w=b.style,p=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeSide!==m||this.strokeStyle!==w,O=K(r),D=Y(O),E=O!==this.texture||D!==this.textureTransformId,M=f||p,S=u.id!==this.pointId;if(M||v||E||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeSide=m,this.strokeStyle=w,this.texture=O,this.textureTransformId=D;var j=this.vertexOffset,T=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;T.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),Fa(n.vertices,j,0,0,a,c,d,g,T,xa),(M||v)&&(n.updateSteps(),Ua(j,n.steps,g,m,w,xa)),M&&(n.updateClippings(),_a(n.clippings,j,xa)),(M||E)&&(n.updateUvs(),Ha(n.uvs,j,J(O),xa))}}}},i}(ja),Va=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(za),Wa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(za),Xa=function(t){switch(t){case Q.NONE:return 0;case Q.CIRCLE:return 9;case Q.TRIANGLE:return 7;case Q.RECTANGLE:return La}return 0},Ka=function(t){switch(t){case Q.NONE:return 0;case Q.CIRCLE:return 8;case Q.TRIANGLE:return 3;case Q.RECTANGLE:return ya}return 0},Ya=function(t,n,i){switch(t){case Q.NONE:return new ka(n,i);case Q.CIRCLE:return new Aa(n,i);case Q.TRIANGLE:return new Na(n,i);case Q.RECTANGLE:return new Wa(n,i)}return new ka(n,i)},Ja=function(t,n,i){switch(t){case Q.NONE:return new ka(n,i);case Q.CIRCLE:return new Ra(n,i);case Q.TRIANGLE:return new Ia(n,i);case Q.RECTANGLE:return new Va(n,i)}return new ka(n,i)},Za=function(t,n,i,r,e){var s=n.points,h=ua(s),o=sa(h,!0),a=ha(h,!0),c=Q.NONE,f=Q.NONE;if(s&&s instanceof ce){var l=s.getMarker();l&&(c=l.tail.type,f=l.head.type)}var v=Xa(c),b=Ka(c),d=i+o,g=r+a,m=Xa(f),w=Ka(f),p=d+v,O=g+b,D=M(n),E=4*D,S=2*D,j=p+m,T=O+w,N=o+m+v+E,I=a+w+b+S;return t.check(i,r,N,I)?new u(t,i,r,N,I,[new ma(i,r,o,a),Ja(c,d,g),Ya(f,p,O),new sn(j,T,E,S)]).init(n):null},qa=function(){function t(t,n,i){this.To=1e-6,this._x=t,this._y=n,this._z=0,this.k=i,i[0]=t,i[1]=n,this.index=0}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){if(0===this._z||this.To<Math.abs(this._x-t)){this._x=t;var n=this.index,i=this.k;1===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=1)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){if(0===this._z||this.To<Math.abs(this._y-t)){this._y=t;var n=this.index,i=this.k;2===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=2)}},enumerable:!1,configurable:!0}),t.prototype.toAxis=function(t,n,i,r){var e=Math.abs(i),u=Math.abs(r),s=this.To;if(e<s&&u<s)return Math.abs(t)<Math.abs(n)?0<=n?2:0:0<=t?1:3;var h=.2;return 0<=i?0<=r?h<e&&h<u?t<n?2:1:h<e?1:2:h<e&&h<u?t<-n?0:1:h<e?1:0:0<=r?h<e&&h<u?-t<n?2:3:h<e?3:2:h<e&&h<u?n<t?0:3:h<e?3:0},t.prototype.toTailAxis=function(t,n,i,r){return this.toAxis(t-this.x,n-this.y,i,r)},t.prototype.tail=function(t,n,i,r,e,u,s){switch(this.toTailAxis(t,n,i,r)){case 0:this.y-s<=n?(this.y-=Math.max(s,u),this.x=t):this.y=n;break;case 1:t<=this.x+s?(this.x+=Math.max(s,e),this.y=n):this.x=t;break;case 2:n<=this.y+s?(this.y+=Math.max(s,e),this.x=t):this.y=n;break;case 3:this.x-s<=t?(this.x-=Math.max(s,e),this.y=n):this.x=t}},t.prototype.middle=function(t,n){var i=t-this._x,r=n-this._y;Math.abs(i)<Math.abs(r)?this.y=n:this.x=t},t.prototype.toHeadAxis=function(t,n,i,r){return this.toAxis(this.x-t,this.y-n,i,r)},t.prototype.head=function(t,n,i,r,e,u,s){switch(this.toHeadAxis(t,n,i,r)){case 0:n-s<=this.y&&(this.y=n-Math.max(s,u)),this.x=t,this.y=n;break;case 1:this.x<=t+s&&(this.x=t+Math.max(s,e)),this.y=n,this.x=t;break;case 2:this.y<=n+s&&(this.y=n+Math.max(s,u)),this.x=t,this.y=n;break;case 3:t-s<=this.x&&(this.x=t-Math.max(s,e)),this.y=n,this.x=t}},t.prototype.margin=function(t,n){var i=this.k,r=this.index;if(0!==t&&2<=r){var e=i[0],u=i[1],s=(o=i[2]-e)*o+(a=i[3]-u)*a;if((c=this.To)<s){var h=t/Math.sqrt(o*o+a*a);c<Math.abs(h-1)?(i[0]=e+o*h,i[1]=u+a*h):this.index-=2}}if(r=this.index,0!==n&&2<=r){var o,a,c,f=i[r+0],l=i[r+1];s=(o=i[r-2]-f)*o+(a=i[r-1]-l)*a,(c=this.To)<s&&(h=n/Math.sqrt(o*o+a*a),c<Math.abs(h-1)?(i[r+0]=f+o*h,i[r+1]=l+a*h):this.index-=2)}i.length=this.index+2},t}(),Qa=function(t){function n(n){return void 0===n&&(n=r.CONNECTOR_ELBOW),t.call(this,n)||this}return _(n,t),n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=t.local,a=o.x,c=o.y,f=t.normal,l=f.x,v=f.y,b=i.local,d=b.x,g=b.y,m=i.normal,w=m.x,p=m.y,O=e.values,D=O.length,E=a-u,M=c-s,S=d-u,j=g-s,T=.5*(S+E),N=.5*(j+M),I=S-E,C=j-M,A=.5*q.SIZE_X,R=.5*q.SIZE_Y,k=1e-6;if(Math.abs(I)<k&&Math.abs(C)<k)h[0]=E,h[1]=M,h[2]=S,h[3]=j,h.length=4;else{var L=new qa(E,M,h);if(0<D){var y=Math.atan2(C,I),x=Math.sqrt(I*I+C*C),B=Math.cos(y)*x,_=Math.sin(y)*x,P=O[0],F=O[1],U=T+B*P-_*F,G=N+B*F+_*P;L.tail(U,G,l,v,A,R,n);for(var H=2;H<D;H+=2){var z=O[H+0],V=O[H+1],W=T+B*z-_*V,X=N+B*V+_*z;L.middle(W,X)}L.head(S,j,w,p,A,R,r)}else L.tail(T,N,l,v,A,R,n),L.head(S,j,w,p,A,R,r);L.margin(n,r)}},n}(le),$a=function(t,n,i){return Do(t,n,i||new Qa)},tc=function(){function t(){}return t.from=function(t,n,i){var r=[],e=t.length;if(4<e){var u=1e-6,s=t[0],h=t[1];0!==n&&u<(c=(o=s-t[2])*o+(a=h-t[3])*a)&&(s+=o*(f=n/Math.sqrt(c)),h+=a*f);var o,a,c,f,l=t[e-2],v=t[e-1];0!==i&&u<(c=(o=l-t[e-4])*o+(a=v-t[e-3])*a)&&(l+=o*(f=i/Math.sqrt(c)),v+=a*f);for(var b=.5*(l+s),d=.5*(v+h),g=l-s,m=v-h,w=Math.atan2(m,g),p=Math.cos(w),O=Math.sin(w),D=g*g+m*m,E=u<D?1/Math.sqrt(D):1,M=2,S=e-2;M<S;M+=2){var j=t[M+0]-b,T=t[M+1]-d;r.push((p*j+O*T)*E,(p*T-O*j)*E)}}return r},t}(),nc=function(t,n,i){return Do(t,n,i||new le)},ic=function(t,n,i,r){if(n instanceof le){var e=r.resources,u=t[15];if(0<=u&&u<e.length){var s=r.getExtension(u);null==s&&(s=JSON.parse(e[u]),r.setExtension(u,s)),n.lock();var h=n.points;h.deserialize(s[1],r);var o=n.edge;o.deserialize(s[0],i,r);var a=n.body,c=s[2];null!=c?a.deserialize(c,i,r):a.set(tc.from(h.values,o.tail.margin,o.head.margin)),n.unlock()}}},rc=function(){e[r.CONNECTOR_ELBOW]=Za,n[r.CONNECTOR_ELBOW]=$a,i[r.CONNECTOR_ELBOW]=ic,Tr.set(r.CONNECTOR_ELBOW,Ct.CONNECTOR)},ec=function(){e[r.CONNECTOR_LINE]=Za,n[r.CONNECTOR_LINE]=nc,i[r.CONNECTOR_LINE]=ic,Tr.set(r.CONNECTOR_LINE,Ct.CONNECTOR)},uc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Pa(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=K(n),d=Y(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Fa(t.vertices,w,.5*r,.5*e,r,e,a,c,n.transform.internalTransform,xa),(m||h)&&(t.updateSteps(),Ua(w,t.steps,c,f,l,xa)),m&&(t.updateClippings(),_a(t.clippings,w,xa)),(m||g)&&(t.updateUvs(),Ha(t.uvs,w,J(b),xa))}},n}(W),sc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=La+h,c=ya+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new uc(i,r,a-h,c-o),new sn(i+La,r+ya,h,o)]).init(n):null},hc=function(t,n,i,r){var e=M(n),s=4*e,h=2*e,o=s,a=h;return t.check(i,r,o,a)?new u(t,i,r,o,a,[new sn(i,r,s,h)]).init(n):null},oc=function(t,n){var i=t.data.getMapping();if(null!=i)for(var r=i.values,e=0,u=r.length;e<u;++e){var s=r[e],h=s[0],o=n.getDataMapper(h);if(null!=o){var a=t.children,c=n.getDataDestination(s[1]),f=s[2];ac(a,o,c,f)}}},ac=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){for(var s=t[e],h=s.data,o=0,a=h.size();o<a;++o){var c=h.get(o);c&&c.scope!==_t.PRIVATE&&n.map(c,i,r)}var f=s.children;0<f.length&&ac(f,n,i,r)}},cc=function(t,n,i){var r=n.pieces,e=t[15];if(r&&0<=e&&e<r.length){var u=n.pieceData;if(u){var s=r[e],h=u.get(s),o=i&&i(s,n);return h?function(t,n,i,r,e,u,s){var h=e.mode,o=e.depth;s=s||new Br(t,h,o);var a=Do(u,e,s),c=s.size,f=c.x,l=c.y;return s.size.set(n,i),r.copyTo(s),s.size.init(),s.size.set(f,l),h===jr.EDITOR?0<o&&oc(s,e):oc(s,e),a}(s,h.width,h.height,h.layer,n,t,o):function(t,n,i,r){var e=n.mode,u=n.depth;r=r||new Br(t,e,u);var s=Do(i,n,r),h=r.size,o=h.x,a=h.y,c=r.children,f=new xe("missing",e,u),l=.5*o,v=.5*o;f.transform.position.set(-l,-v),f.size.set(o,a),f.size.init(),f.parent=r;var b=new su;return b.stroke.color=16711680,b.transform.position.set(l,v),b.size.copyFrom(r.size),b.attach(f),c.push(f),r.onChildTransformChange(),r.toDirty(),r.onAttach(),r.size.init(),e===jr.EDITOR?0<u&&oc(r,n):oc(r,n),s}(s,n,t,o)}}return null},fc=function(){e[r.EMBEDDED]=hc,n[r.EMBEDDED]=cc,Tr.set(r.EMBEDDED,Ct.EMBEDDED),e[r.EMBEDDED_LAYER]=sc},lc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.p.children;return!(0<t.length)||t[t.length-1].fill.enable},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.color:16777215},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.alpha:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.alpha=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.copy(t)},t.prototype.set=function(t,n,i){for(var r=this.p.children,e=0,u=r.length;e<u;++e)r[e].fill.set(t,n,i)},t.prototype.clone=function(){return new t(this.p)},t.prototype.toObject=function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.toObject():{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),vc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"length",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.length}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.id}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.values}return[]},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.values=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.segments}return[]},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.segments=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.style}return z.NONE},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.style=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marker",{get:function(){for(var t=this.p.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.marker}return nt.getInstance()},enumerable:!1,configurable:!0}),t.prototype.getMarker=function(){for(var t=this.p.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.getMarker()}},Object.defineProperty(t.prototype,"formatter",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatter}return null},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.formatter=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formatted",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatted}return this},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&e.copy(t)}return this},t.prototype.set=function(t,n,i){for(var r=this.p.children,e=0,u=r.length;e<u;++e){var s=r[e].points;null!=s&&s.set(t,n,i)}return this},t.prototype.clone=function(n){return new t(n)},t.prototype.toPoints=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.toPoints(t)}return[]},t.prototype.serialize=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.serialize(t)}return-1},t}(),bc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.p.children;return 0<t.length&&t[t.length-1].stroke.enable},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.color:16777215},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.alpha:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.width:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.align:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.side:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.side=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.style:s.NONE},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.style=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.copy(t)},t.prototype.set=function(t,n,i,r,e){for(var u=this.p.children,s=0,h=u.length;s<h;++s)u[s].stroke.set(t,n,i,r,e)},t.prototype.clone=function(){return new t(this.p)},t.prototype.toObject=function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.toObject():{enable:!1,color:16777215,alpha:1,width:1,align:0,side:qt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),dc=function(t){function n(n,i){void 0===i&&(i=r.GROUP);var e=t.call(this,i)||this;e.Fr=n;var u=new Vt;return e.data=u,e.tag=u,e.size=e.newGroupSize(n),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e.Tt=e.newGroupPoints(),e}return _(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Fr},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t){var n=q.SIZE_X,i=q.SIZE_Y;return t!==jr.VIEWER?new Rr(this,n,i,this.isGroupSizeFittable()):new kr(this,n,i,n,i)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newGroupFill=function(){return new lc(this)},n.prototype.newGroupStroke=function(){return new bc(this)},n.prototype.newGroupText=function(){return new Yt(this,q.TEXT_VALUE,q.TEXT_COLOR,q.TEXT_ALPHA,q.TEXT_FAMILY,q.TEXT_SIZE)},n.prototype.newGroupPoints=function(){return new vc(this)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof kr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].corner:ut.ALL},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].corner=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].gradient;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].gradient=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].radius:.5},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].radius=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].image;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].image=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n)if(null!=t[n].points)return this.Tt},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Fr,this.type)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Rt),gc=function(t,n,i){i=i||new dc(n.mode);var r=Do(t,n,i);return i.size.init(),r},mc=function(){e[r.GROUP]=hc,n[r.GROUP]=gc,Tr.set(r.GROUP,Ct.GROUP)},wc=function(){function n(n,i,r){this.p=n,this.T=new t.Point(i,r)}return n.prototype.init=function(){return this},Object.defineProperty(n.prototype,"x",{get:function(){return this.T.x},set:function(t){var n=this.T;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.T.y},set:function(t){var n=this.T;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.T,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.T;return new n(this.p,t.x,t.y)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.T,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.T.copyTo(t)},n.prototype.equals=function(t){return this.T.equals(t)},n.prototype.fit=function(){return this},n.prototype.onChange=function(t,n){this.p.onSizeChange()},n}(),pc=function(t){function n(n,i){return void 0===i&&(i=r.GROUP_SHADOWED),t.call(this,n,i)||this}return _(n,t),n.prototype.newGroupSize=function(n){return n!==jr.VIEWER?new wc(this,q.SIZE_X,q.SIZE_Y):t.prototype.newGroupSize.call(this,n)},n}(dc),Oc=function(t,n,i){i=i||new pc(n.mode);var r=Do(t,n,i);return i.size.init(),r},Dc=function(){e[r.GROUP_SHADOWED]=hc,n[r.GROUP_SHADOWED]=Oc,Tr.set(r.GROUP_SHADOWED,Ct.GROUP)},Ec=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Pa(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=K(n),d=Y(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Fa(t.vertices,w,0,0,r,e,a,c,n.transform.internalTransform,xa),(m||h)&&(t.updateSteps(),Ua(w,t.steps,c,f,l,xa)),m&&(t.updateClippings(),_a(t.clippings,w,xa)),(m||g)&&(t.updateUvs(),Ha(t.uvs,w,J(b),xa))}},n}(W),Mc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=La+h,c=ya+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Ec(i,r,a-h,c-o),new sn(i+La,r+ya,h,o)]).init(n):null},Sc=function(t){function n(n,i){void 0===i&&(i=r.IMAGE);var e=t.call(this,i)||this;return null!=n&&(e.image=n,e.size.set(n.width,n.height)),e.fill.alpha=1,e}return _(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(su),jc=function(t,n,i){return Do(t,n,i||new Sc)},Tc=function(){e[r.IMAGE]=Mc,n[r.IMAGE]=jc},Nc=[0,0],Ic=new t.Point,Cc=function(t,n){for(var i=3*n-1,r=3*(n+9)-1;i<r;)t[++i]=0,t[++i]=0,t[++i]=2},Ac=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Rc=function(t,n,i,r,e,u,s,h){var a=o(e),c=u/h[0],f=s/h[1],l=.5*(c+f),v=12,b=-1+i,d=6*n-1;t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0},kc=function(t,n,i,r,e,u,s,h){var o=Ic,a=.5*e,c=.5*u;o.set(i-a,r-c),s.apply(o,o);var f=o.x,l=o.y;o.set(i+a,r-c),s.apply(o,o);var v=o.x,b=o.y;o.set(i+a,r+c),s.apply(o,o);var d=o.x,g=o.y,m=f+(d-v),w=l+(g-b),p=(n<<1)-1;t[++p]=f,t[++p]=l,t[++p]=.5*(f+v),t[++p]=.5*(l+b),t[++p]=v,t[++p]=b,t[++p]=.5*(f+m),t[++p]=.5*(l+w),t[++p]=.5*(f+d),t[++p]=.5*(l+g),t[++p]=.5*(v+d),t[++p]=.5*(b+g),t[++p]=m,t[++p]=w,t[++p]=.5*(m+d),t[++p]=.5*(w+g),t[++p]=d,t[++p]=g,h[0]=.5*O(f,l,v,b),h[1]=.5*O(f,l,m,w)},Lc=function(t,n,i){var r=i.x0,e=i.y0,u=i.x1,s=i.y1,h=i.x2,o=i.y2,a=i.x3,c=i.y3,f=(n<<1)-1;t[++f]=r,t[++f]=e,t[++f]=.5*(u+r),t[++f]=.5*(s+e),t[++f]=u,t[++f]=s,t[++f]=.5*(r+a),t[++f]=.5*(e+c),t[++f]=.5*(r+h),t[++f]=.5*(e+o),t[++f]=.5*(u+h),t[++f]=.5*(s+o),t[++f]=a,t[++f]=c,t[++f]=.5*(a+h),t[++f]=.5*(c+o),t[++f]=h,t[++f]=o},yc=function(t){function n(n,i){var r=t.call(this,n,i,9,8)||this;return r.textureWidth=-1,r.textureHeight=-1,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset;t.updateClippings(),t.updateIndices(),Cc(t.clippings,n),Ac(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=K(n),b=v.width*v.resolution,d=v.height*v.resolution,g=this.textureWidth!==b||this.textureHeight!==d;(u||h||l||g)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.textureWidth=b,this.textureHeight=d,t.updateVertices(),kc(t.vertices,this.vertexOffset,0,0,r,e,n.transform.internalTransform,Nc),t.updateSteps(),Rc(t.steps,this.vertexOffset,a,c,f,b,d,Nc))},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),Lc(t.uvs,this.vertexOffset,J(i)))},n}(W),xc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new yc(i,r),new sn(i+9,r+8,h,o)]).init(n):null},Bc=function(t){function n(n,i){return void 0===i&&(i=r.IMAGE_SDF),t.call(this,n,i)||this}return _(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(Sc),_c=function(t,n,i){return Do(t,n,i||new Bc)},Pc=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=K(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Fc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=h,c=o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Pc(i,r,a-h,c-o),new sn(i,r,h,o)]).init(n):null},Uc=function(t){function n(n){return void 0===n&&(n=r.LABEL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Jt),Gc=function(t,n,i){return Do(t,n,i||new Uc)},Hc=function(){e[r.LABEL]=Fc,n[r.LABEL]=Gc},zc=function(t){function n(n){void 0===n&&(n=r.LINE);var i=t.call(this,n)||this;return i.Tt=new ce(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.Tt.serialize(n),i},n}(rn),Vc=function(t,n,i){i=i||new zc;var r=Do(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=z.NON_SCALING_MASK|z.DOTTED_MASK|z.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},Wc=function(){e[r.LINE]=Za,n[r.LINE]=Vc},Xc=function(t,n,i){for(var r=3*n,e=3*(n+i);r<e;r+=3)t[r+0]=0,t[r+1]=0,t[r+2]=0},Kc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Yc=function(t,n,i){for(var r=6*n,e=6*(n+i);r<e;r+=6)t[r+0]=0,t[r+1]=0,t[r+2]=0,t[r+3]=0,t[r+4]=0,t[r+5]=0},Jc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Zc=function(t){return 12*Math.ceil(t/12)},qc=function(t,n,i,r,e,u,s,h){if(u)if(i.isStaticColor()){var o=i.getColor(0,s);if(i.isStaticAlpha()){var a=i.getAlpha(0,h);V(o,a,t,n*r,e)}else for(var c=0,f=t;c<r;c+=1,f+=n)a=i.getAlpha(c,h),V(o,a,f,n,e)}else if(i.isStaticAlpha())for(a=i.getAlpha(0,h),c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),V(o,a,f,n,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),a=i.getAlpha(c,h),V(o,a,f,n,e);else if(i.isStaticColor())o=i.getColor(0,s),V(o,0,t,n*r,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),V(o,0,f,n,e)},Qc=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e)||this;return s.pointId=-1,s.pointCount=0,s.pointCountReserved=u,s.pointSizeId=-1,s.pointOffsetId=-1,s.pointFillId=-1,s.pointStrokeId=-1,s}return _(n,t),n.prototype.isCompatible=function(t){return Zc(ea(t.points))===this.pointCountReserved},n.prototype.updateLineOfAnyColorFill=function(t,n,i,r){var e=i.fill,u=e.id,s=u!==this.pointFillId,h=n.fill,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorFill||c!==this.alphaFill;(s||f)&&(this.colorFill=a,this.alphaFill=c,this.pointFillId=u,t.updateColorFills(),qc(this.vertexOffset,r,e,this.pointCountReserved,t.colorFills,o,a,c))},n.prototype.updateLineOfAnyColorStroke=function(t,n,i,r){var e=i.stroke,u=e.id,s=u!==this.pointStrokeId,h=n.stroke,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorStroke||c!==this.alphaStroke;(s||f)&&(this.colorStroke=a,this.alphaStroke=c,this.pointStrokeId=u,t.updateColorStrokes(),qc(this.vertexOffset,r,e,this.pointCountReserved,t.colorStrokes,o,a,c))},n}(W),$c=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=3*e,h=3*n,o=0;o<i;++o)t[s+0]=t[h+0],t[s+1]=t[h+1],t[s+2]=t[h+2],s+=3,h+=3;e+=i}},tf=function(t,n,i,r,e){for(var u=n,s=i+r,h=1;h<e;++h){for(var o=3*s,a=3*i,c=0;c<r;++c)t[o+0]=t[a+0]+u,t[o+1]=t[a+1]+u,t[o+2]=t[a+2]+u,o+=3,a+=3;u+=n,s+=r}},nf=function(t,n,i,r){for(var e=6*n,u=6*(n+i),s=1;s<r;++s)for(var h=e,o=0;o<i;++o)t[u+0]=t[h+0],t[u+1]=t[h+1],t[u+2]=t[h+2],t[u+3]=t[h+3],t[u+4]=t[h+4],t[u+5]=t[h+5],u+=6,h+=6},rf=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=e<<1,h=n<<1,o=0;o<i;++o)t[s]=t[h],t[s+1]=t[h+1],s+=2,h+=2;e+=i}},ef=function(t,n,i,r,e,u,s){var h=n.a,o=n.b,a=n.c,c=n.d,f=e-1,l=i+f*r;if(s.isStaticX()&&s.isStaticY())for(var v=s.getX(0),b=s.getY(0);0<=f;--f){for(var d=h*(D=u[O=f<<1]+v)+a*(E=u[O+1]+b),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}else for(;0<=f;--f){var O,D,E;for(d=h*(D=u[O=f<<1]+s.getX(f))+a*(E=u[O+1]+s.getY(f)),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}},uf=function(t){return pt(t)||null==t},sf=function(t,n,i){return pt(n)?n:wt(n)?n(t):n?n[t%n.length]:i},hf=function(){function t(t){this.p=t,this.R=0,this.S=null,this.j=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.j!==n&&(i=!0,this.j=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getColor=function(t,n){return sf(t,this.S,n)},t.prototype.getAlpha=function(t,n){return sf(t,this.j,n)},t.prototype.isStaticColor=function(){return uf(this.S)},t.prototype.isStaticAlpha=function(){return uf(this.j)},t.prototype.toDirty=function(){this.R+=1},t}(),of=function(){function t(t,n,i){this.p=t,this.R=0,this._x=null,this._y=null,this.No=n,this.Io=i,this.Co=null,this.Ao=0,this.Ro=-1,this.ko=0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"limit",{get:function(){return this.Co},set:function(t){this.Co=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this._x!==t&&(i=!0,this._x=t),void 0!==n&&this._y!==n&&(i=!0,this._y=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getX=function(t){return sf(t,this._x,this.No)},t.prototype.getY=function(t){return sf(t,this._y,this.Io)},t.prototype.getLimit=function(){var t=this.Co;return null!=t?t:(this.updateLimitComputed(),this.Ao)},t.prototype.updateLimitComputed=function(){var t=this.R,n=this.p.length;this.Ro===t&&this.ko===n||(this.Ro=t,this.ko=n,this.Ao=Math.max(this.calcLimit(this._x,n,this.No),this.calcLimit(this._y,n,this.Io)))},t.prototype.calcLimit=function(t,n,i){if(pt(t))return Math.abs(t);if(wt(t)){if(0<n){for(var r=Math.abs(t(0)),e=1;e<n;++e)r=Math.max(r,Math.abs(t(e)));return r}return 0}if(null!=t){var u=t.length;if(0<u){for(r=t[0],e=1;e<u;++e)r=Math.max(r,Math.abs(t[e]));return r}return 0}return Math.abs(i)},t.prototype.isStaticX=function(){return uf(this._x)},t.prototype.isStaticY=function(){return uf(this._y)},t.prototype.toDirty=function(){this.R+=1},t}(),af=function(){function t(t){this.p=t,this.R=0,this.S=null,this.j=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.j!==n&&(i=!0,this.j=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getColor=function(t,n){return sf(t,this.S,n)},t.prototype.getAlpha=function(t,n){return sf(t,this.j,n)},t.prototype.isStaticColor=function(){return uf(this.S)},t.prototype.isStaticAlpha=function(){return uf(this.j)},t.prototype.toDirty=function(){this.R+=1},t}(),cf=function(){function n(t){this.p=t,this.k=[],this.Lo=0,this.L=[],this.T=new of(this,q.SIZE_X,q.SIZE_Y),this.vn=new of(this,0,0),this.C=new hf(t),this.yo=new af(t),this.R=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this.k.length>>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.k},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return z.NONE},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=nt.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"size",{get:function(){return this.T},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"offset",{get:function(){return this.vn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"stroke",{get:function(){return this.yo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return this.set(t.values,t.segments,t.style)},n.prototype.set=function(t,n,i){var r=!1,e=!1;if(null!=t){var u=this.k,s=this.Lo,h=t.length;if(u!==t){for(var o=Math.min(s,h),a=0;a<o;++a)u[a]=t[a];for(a=o;a<h;++a)u.push(t[a]);s!==h?(u.length=h,this.Lo=h,r=!0):e=!0}else s!==h?(this.Lo=h,r=!0):e=!0}if(r){this.R+=1;var c=this.p,f=c.uploaded;f?f.isCompatible(c)?c.updateUploaded():(c.uploaded=void 0,c.toDirty()):c.updateUploaded()}else e&&(this.R+=1,this.p.updateUploaded());return this},n.prototype.updateUploaded=function(){this.p.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[]")},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o,a){var c=this.formatted,f=c.length,l=c.values,v=this.T,b=this.vn,d=0,g=f;if(h){var m=.5*v.getLimit(),w=b.getLimit(),p=n.WORK_RANGE;h(t,i,m,m,w,w,s,l,p),d=p[0],g=p[1]}for(var O=d,D=Math.min(g,f);O<D;++O){var E=O<<1,M=l[E],S=l[E+1];if(o(t,i,.5*v.getX(O),.5*v.getY(O),b.getX(O),b.getY(O),M,S,r,e,u,O,s,a))return!0}return!1},n.WORK_RANGE=[0,0],n}(),ff=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(Ko(n,r),$c(n,r,9,u),Yo(i,r,e),tf(i,9,e,8,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof cf&&(this.updateVertexAndStep(t,n,i),this.updateLineOfAnyColorFill(t,n,i,9),this.updateLineOfAnyColorStroke(t,n,i,9),this.updateUv(t,n))},n.prototype.updateVertexAndStep=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=X(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p;if(s||a||v||d||O){this.pointId=r;var D=i.formatted;this.pointCount=D.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeStyle=p,t.updateVertices(),t.updateSteps();var E=this.pointCount,M=D.values,S=this.vertexOffset,j=t.vertices,T=t.steps,N=t.clippings,I=n.transform.internalTransform;if(0<E&&h.isStaticX()&&h.isStaticY()){var C=h.getX(0),A=h.getY(0);Jo(j,S,0,0,C,A,m,w,I,Wo),ef(j,I,S,9,E,M,e),Zo(T,N,S,w,p,Wo),nf(T,S,9,E)}else for(var R=0;R<E;++R){var k=R<<1,L=M[k]+e.getX(R),y=M[k+1]+e.getY(R),x=(C=h.getX(R),A=h.getY(R),S+9*R);Jo(j,x,L,y,C,A,m,w,I,Wo),Zo(T,N,x,w,p,Wo)}var B=S+9*E,_=9*(this.pointCountReserved-E);Kc(j,B,_),Yc(T,B,_)}},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=t.uvs,u=this.vertexOffset,s=J(i),h=this.pointCountReserved;0<h&&(qo(e,u,s),rf(e,u,9,h))}},n}(Qc),lf=function(t,n,i,r,e,s,h,o){var a=M(n),c=4*a,f=2*a,l=n.points,v=Zc(ea(l)),b=v*r,d=v*s,g=b+c,m=d+f;return t.check(i,e,g,m)?new u(t,i,e,g,m,[new o(i,e,b,d,v),new sn(i+b,e+d,c,f)]).init(n):null},vf=function(t,n,i,r,e){return lf(t,n,i,9,r,8,0,ff)},bf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_CIRCLES);var i=t.call(this,n)||this;return i.Tt=new cf(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.Tt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.Tt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.Tt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.Tt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(ta),df=function(t,n,i){return Do(t,n,i||new bf)},gf=function(){e[r.LINE_OF_CIRCLES]=vf,n[r.LINE_OF_CIRCLES]=df},mf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(Io(n,i,r),tf(n,jo,r,24,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof cf&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,jo),this.updateLineOfAnyColorStroke(t,n,i,jo))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=n.radius,b=f!==this.sizeX||l!==this.sizeY||v!==this.radius,d=X(n),g=this.transformLocalId!==d,m=n.stroke,w=m.align,p=m.enable?m.width:0,O=m.side,D=m.style,E=this.strokeAlign!==w||this.strokeWidth!==p||this.strokeSide!==O||this.strokeStyle!==D,M=n.corner,S=M!==this.corner,j=K(n),T=Y(j),N=j!==this.texture||T!==this.textureTransformId,I=s||a||b||E;if(I||g||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=v,this.transformLocalId=d,this.strokeAlign=w,this.strokeWidth=p,this.strokeSide=O,this.strokeStyle=D,this.corner=M,this.texture=j,this.textureTransformId=T,t.updateVertices(),(I||g)&&t.updateSteps(),(I||S)&&t.updateClippings(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,k=this.vertexOffset,L=t.vertices,y=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=J(j);if(0<A&&h.isStaticX()&&h.isStaticY()){var F=h.getX(0),U=h.getY(0);Co(L,k,0,0,F,U,w,p,v,_,To),ef(L,_,k,jo,A,R,e),(I||g)&&(Ro(x,k,p,O,D,M,To),nf(x,k,jo,A)),(I||S)&&(Ao(y,k,M,To),$c(y,k,jo,A)),(I||N)&&(ko(B,k,P,To),rf(B,k,jo,A))}else for(var G=0;G<A;++G){var H=G<<1,z=R[H]+e.getX(G),V=R[H+1]+e.getY(G),W=(F=h.getX(G),U=h.getY(G),k+G*jo);Co(L,W,z,V,F,U,w,p,v,_,To),(I||g)&&Ro(x,W,p,O,D,M,To),(I||S)&&Ao(y,W,M,To),(I||N)&&ko(B,W,P,To)}var Z=this.pointCountReserved,q=k+A*jo,Q=jo*(Z-A);Kc(L,q,Q),Yc(x,q,Q),Xc(y,q,Q),Jc(B,q,Q)}},n}(Qc),wf=function(t,n,i,r,e){return lf(t,n,i,jo,r,24,0,mf)},pf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.Tt=new cf(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.Tt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.Tt.calcHitPointAbs(t,n,h,e,u,s,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.Tt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.Tt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(Po),Of=function(t,n,i){return Do(t,n,i||new pf)},Df=function(){e[r.LINE_OF_RECTANGLE_ROUNDEDS]=wf,n[r.LINE_OF_RECTANGLE_ROUNDEDS]=Of,Tr.set(r.LINE_OF_RECTANGLE_ROUNDEDS,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},Ef=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(Pa(n,i,r),tf(n,La,r,ya,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof cf&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,La),this.updateLineOfAnyColorStroke(t,n,i,La))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=X(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.side,O=g.style,D=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeSide!==p||this.strokeStyle!==O,E=K(n),M=Y(E),S=E!==this.texture||M!==this.textureTransformId,j=s||a||v||D;if(j||d||S){this.pointId=r;var T=i.formatted;this.pointCount=T.length,this.pointOffsetId=u,this.pointSizeId=o,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeSide=p,this.strokeStyle=O,this.texture=E,this.textureTransformId=M,t.updateVertices(),(j||d)&&t.updateSteps(),j&&t.updateClippings(),(j||S)&&t.updateUvs();var N=this.pointCount,I=T.values,C=this.vertexOffset,A=t.vertices,R=t.clippings,k=t.steps,L=t.uvs,y=n.transform.internalTransform,x=J(E);if(0<N&&h.isStaticX()&&h.isStaticY()){var B=h.getX(0),_=h.getY(0);Fa(A,C,0,0,B,_,m,w,y,xa),ef(A,y,C,La,N,I,e),(j||d)&&(Ua(C,k,w,p,O,xa),nf(k,C,La,N)),j&&(_a(R,C,xa),$c(R,C,La,N)),(j||S)&&(Ha(L,C,x,xa),rf(L,C,La,N))}else for(var P=0;P<N;++P){var F=P<<1,U=I[F]+e.getX(P),G=I[F+1]+e.getY(P),H=(B=h.getX(P),_=h.getY(P),C+P*La);Fa(A,H,U,G,B,_,m,w,y,xa),(j||d)&&Ua(H,k,w,p,O,xa),j&&_a(R,H,xa),(j||S)&&Ha(L,H,x,xa)}var z=this.pointCountReserved,V=C+N*La,W=La*(z-N);Kc(A,V,W),Yc(k,V,W),Xc(R,V,W),Jc(L,V,W)}},n}(Qc),Mf=function(t,n,i,r,e){return lf(t,n,i,La,r,ya,0,Ef)},Sf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLES);var i=t.call(this,n)||this;return i.Tt=new cf(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.Tt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.Tt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.Tt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.Tt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(su),jf=function(t,n,i){return Do(t,n,i||new Sf)},Tf=function(){e[r.LINE_OF_RECTANGLES]=Mf,n[r.LINE_OF_RECTANGLES]=jf,Tr.set(r.LINE_OF_RECTANGLES,Ct.PRIMITIVE|Ct.STROKE_SIDE)},Nf=22,If=[0,0,0,0,0],Cf=new t.Point,Af=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+6,t[++r]=n+7,t[++r]=n+8,t[++r]=n+9,t[++r]=n+11,t[++r]=n+9,t[++r]=n+10,t[++r]=n+11,t[++r]=n+12,t[++r]=n+13,t[++r]=n+16,t[++r]=n+13,t[++r]=n+14,t[++r]=n+16,t[++r]=n+14,t[++r]=n+15,t[++r]=n+16,t[++r]=n+12,t[++r]=n+16,t[++r]=n+19,t[++r]=n+16,t[++r]=n+17,t[++r]=n+19,t[++r]=n+17,t[++r]=n+18,t[++r]=n+19,t[++r]=n+12,t[++r]=n+19,t[++r]=n+13,t[++r]=n+19,t[++r]=n+20,t[++r]=n+13,t[++r]=n+20,t[++r]=n+21,t[++r]=n+13},Rf=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.sqrt(l*l+4*v*v),d=2*l*v/(l+b),g=d*o/(2*v),m=.5*(b-d)*o/b,w=g*b/(2*l),p=Cf;p.set(i,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r),a.apply(p,p);var M=p.x,S=p.y;p.set(i+l,r),a.apply(p,p);var j=M-D,T=S-E,N=p.x+j,I=p.y+T,C=M+(M-p.x)+j,A=S+(S-p.y)+T,R=N-D,k=I-E,L=D+m*R,y=E+m*k,x=N-g*R,B=I-g*k,_=w*(C-N),P=w*(A-I),F=N+_,U=I+P,G=C-_,H=A-P,z=D-C,V=E-A,W=C+g*z,X=A+g*V,K=D-m*z,Y=E-m*V;p.set(i,r+v-d),a.apply(p,p);var J=p.x,Z=p.y,q=D+o*(J-D),Q=E+o*(Z-E),$=N+o*(J-N),tt=I+o*(Z-I),nt=C+o*(J-C),it=A+o*(Z-A),rt=M+j,et=S+T;c[0]=O(rt,et,J,Z),c[1]=w,c[2]=g,c[3]=m,c[4]=1-.5*d/v;var ut=2*n-1;t[++ut]=q,t[++ut]=Q,t[++ut]=K,t[++ut]=Y,t[++ut]=D,t[++ut]=E,t[++ut]=L,t[++ut]=y,t[++ut]=$,t[++ut]=tt,t[++ut]=x,t[++ut]=B,t[++ut]=N,t[++ut]=I,t[++ut]=F,t[++ut]=U,t[++ut]=nt,t[++ut]=it,t[++ut]=G,t[++ut]=H,t[++ut]=C,t[++ut]=A,t[++ut]=W,t[++ut]=X,t[++ut]=J,t[++ut]=Z,t[++ut]=q,t[++ut]=Q,t[++ut]=L,t[++ut]=y,t[++ut]=x,t[++ut]=B,t[++ut]=$,t[++ut]=tt,t[++ut]=F,t[++ut]=U,t[++ut]=G,t[++ut]=H,t[++ut]=nt,t[++ut]=it,t[++ut]=W,t[++ut]=X,t[++ut]=K,t[++ut]=Y},kf=function(t,n,i,r){var e=3*n-1,u=1-r;i&ut.TOP?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&ut.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&ut.BOTTOM_LEFT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0},Lf=function(t,n,i,r,e,u,s){for(var h=o(e),a=s[0],c=u*a,f=3*i,l=6*i-1,v=0;v<Nf;v+=1,f+=3)t[++l]=r,t[++l]=h,.5<n[f+2]?(t[++l]=c,t[++l]=c,t[++l]=1+n[f],t[++l]=1+n[f+1]):(t[++l]=a,t[++l]=a,t[++l]=1+n[f],t[++l]=1+n[f+1])},yf=function(t,n,i,r,e){var u=i.x0,s=i.x1,h=i.x2,o=i.x3,a=i.y0,c=i.y1,f=i.y2,l=i.y3,v=.5*(u+s),b=.5*(a+c),d=e[4],g=v+d*(o-u),m=b+d*(l-a),w=e[1],p=e[2],O=e[3],D=v+O*(o-v),E=b+O*(l-b),M=v+r*(g-v),S=b+r*(m-b),j=v+O*(h-v),T=b+O*(f-b),N=h+p*(v-h),I=f+p*(b-f),C=h+r*(g-h),A=f+r*(m-f),R=h+w*(o-h),k=f+w*(l-f),L=o+w*(h-o),y=l+w*(f-l),x=o+r*(g-o),B=l+r*(m-l),_=o+p*(v-o),P=l+p*(b-l),F=2*n-1;t[++F]=M,t[++F]=S,t[++F]=D,t[++F]=E,t[++F]=v,t[++F]=b,t[++F]=j,t[++F]=T,t[++F]=C,t[++F]=A,t[++F]=N,t[++F]=I,t[++F]=h,t[++F]=f,t[++F]=R,t[++F]=k,t[++F]=x,t[++F]=B,t[++F]=L,t[++F]=y,t[++F]=o,t[++F]=l,t[++F]=_,t[++F]=P,t[++F]=g,t[++F]=m,t[++F]=M,t[++F]=S,t[++F]=j,t[++F]=T,t[++F]=N,t[++F]=I,t[++F]=C,t[++F]=A,t[++F]=R,t[++F]=k,t[++F]=L,t[++F]=y,t[++F]=x,t[++F]=B,t[++F]=_,t[++F]=P,t[++F]=D,t[++F]=E},xf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=this.vertexOffset,i=this.indexOffset,r=this.pointCountReserved;0<r&&(Af(t.indices,n,i),tf(t.indices,Nf,i,15,r))},n.prototype.update=function(t,n){var i=n.points;i instanceof cf&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,Nf),this.updateLineOfAnyColorStroke(t,n,i,Nf))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=n.radius,d=b!==this.radius,g=X(n),m=this.transformLocalId!==g,w=n.stroke,p=w.align,O=w.enable?w.width:0,D=w.style,E=this.strokeAlign!==p||this.strokeWidth!==O||this.strokeStyle!==D,M=n.corner,S=this.corner!==M,j=K(n),T=Y(j),N=j!==this.texture||T!==this.textureTransformId,I=s||a||v||d||E;if(I||m||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=b,this.transformLocalId=g,this.strokeAlign=p,this.strokeWidth=O,this.strokeStyle=D,this.corner=M,this.texture=j,this.textureTransformId=T,t.updateVertices(),(I||S)&&t.updateClippings(),(I||m||S)&&t.updateSteps(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,k=this.vertexOffset,L=t.vertices,y=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=J(j);if(0<A&&h.isStaticX()&&h.isStaticY()){var F=h.getX(0),U=h.getY(0);Rf(L,k,0,0,F,U,p,O,b,_,If),ef(L,_,k,Nf,A,R,e),(I||S)&&(kf(y,k,M,b),$c(y,k,Nf,A)),(I||m||S)&&(Lf(x,y,k,O,D,b,If),nf(x,k,Nf,A)),(I||N)&&(yf(B,k,P,b,If),rf(B,k,Nf,A))}else for(var G=0;G<A;++G){var H=G<<1,z=R[H]+e.getX(G),V=R[H+1]+e.getY(G),W=(F=h.getX(G),U=h.getY(G),k+G*Nf);Rf(L,W,z,V,F,U,p,O,b,_,If),(I||S)&&kf(y,W,M,b),(I||m||S)&&Lf(x,y,W,O,D,b,If),(I||N)&&yf(B,W,P,b,If)}var Z=this.pointCountReserved,q=k+A*Nf,Q=Nf*(Z-A);Kc(L,q,Q),Yc(x,q,Q),Xc(y,q,Q),Jc(B,q,Q)}},n}(Qc),Bf=function(t,n,i,r,e){return lf(t,n,i,Nf,r,15,0,xf)},_f=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=u+f*(h-u)-r,w=s+f*(o-s)-e,p=Math.sqrt(m*m+w*w),O=1e-5;if(O<p){var D=1/p,E=m*D,M=w*D,S=(u+l*(a-u)-r)*D,j=(s+l*(c-s)-e)*D,T=E*j-S*M;if(O<Math.abs(T)){var N=1/T,I=n-r,C=i-e;if(function(t,n,i,r,e,u,s){if(t.fill.enable){if(n*n+i*i<=r*r)return!0}else if(0<u){var h=n*n+i*i;if(h<=r*r){var o=Math.max(0,r*(1-u*s/e));if(o*o<=h)return!0}}return!1}(t,(+j*I-S*C)*N,(-M*I+E*C)*N,p,v*b,d,g))return!0}}return!1},Pf=function(t,n,i,r,e,u,s){var h=2*e/r;if($t(n,i,h,-e,+e)){var o=Math.sqrt(r*r+4*e*e),a=2*r*e/(r+o),c=t.radius,f=e-a,l=-e,v=+r,b=+e,d=-v,g=+b,m=0+0*c,w=l+c*(f-l),p=v+c*(0-v),O=b+c*(f-b),D=+O,E=-p,M=-h*n+w-i<=0,S=+h*n+w-i<=0,j=i<=O,T=t.corner;if(!M&&!S&&T&ut.TOP){var N=.5*(o-a)*c/o;if(_f(t,n,i,m,w,0,l,d,g,v,b,N,N,a,c,u,s))return!0}else if(!M&&!j&&T&ut.BOTTOM_LEFT){if(_f(t,n,i,E,D,d,g,v,b,0,l,(I=a*c/(2*e))*o/(2*r),I,a,c,u,s))return!0}else if(!S&&!j&&T&ut.BOTTOM_RIGHT){var I;if(_f(t,n,i,p,O,v,b,0,l,d,g,I=a*c/(2*e),I*o/(2*r),a,c,u,s))return!0}else{if(t.fill.enable)return!0;if(0<u){var C=u*s,A=e-a,R=A+(-e-A)*Math.max(0,a-C)/a;if(!$t(n,i,h,R,e-C))return!0}}}return!1},Ff=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Pf(this,n,i,r,e,u,s)},n}(Jt),Uf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.Tt=new cf(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.Tt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.Tt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.Tt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.Tt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(Ff),Gf=function(t,n,i){return Do(t,n,i||new Uf)},Hf=function(){e[r.LINE_OF_TRIANGLE_ROUNDEDS]=Bf,n[r.LINE_OF_TRIANGLE_ROUNDEDS]=Gf,Tr.set(r.LINE_OF_TRIANGLE_ROUNDEDS,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},zf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(Oa(n,r),$c(n,r,7,u),Da(i,r,e),tf(i,7,e,3,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof cf&&(this.updateVertexStepAndUvs(t,n,i),this.updateLineOfAnyColorFill(t,n,i,7),this.updateLineOfAnyColorStroke(t,n,i,7))},n.prototype.updateVertexStepAndUvs=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=X(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p,D=K(n),E=Y(D),M=D!==this.texture||E!==this.textureTransformId,S=s||a||v||O;if(S||d||M){this.pointId=r;var j=i.formatted;this.pointCount=j.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeAlign=m,this.strokeWidth=w,this.strokeStyle=p,t.updateVertices(),(S||d)&&t.updateSteps(),(S||M)&&t.updateUvs();var T=this.pointCount,N=j.values,I=this.vertexOffset,C=t.vertices,A=t.steps,R=t.clippings,k=t.uvs,L=J(D),y=n.transform.internalTransform;if(0<T&&h.isStaticX()&&h.isStaticY()){var x=h.getX(0),B=h.getY(0);Ea(C,I,0,0,x,B,m,w,y,wa),ef(C,y,I,7,T,N,e),(S||d)&&(Ma(A,R,I,7,w,p,wa),nf(A,I,7,T)),(S||M)&&(Sa(k,L,I,wa),rf(k,I,7,T))}else for(var _=0;_<T;++_){var P=_<<1,F=N[P]+e.getX(_),U=N[P+1]+e.getY(_),G=(x=h.getX(_),B=h.getY(_),I+7*_);Ea(C,G,F,U,x,B,m,w,y,wa),(S||d)&&Ma(A,R,G,7,w,p,wa),(S||M)&&Sa(k,L,G,wa)}var H=I+7*T,z=7*(this.pointCountReserved-T);Kc(C,H,z),Yc(A,H,z),Jc(k,H,z)}},n}(Qc),Vf=function(t,n,i,r,e){return lf(t,n,i,7,r,3,0,zf)},Wf=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&tn(this,n,i,r,e,u,s)},n}(Jt),Xf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLES);var i=t.call(this,n)||this;return i.Tt=new cf(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.Tt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.Tt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.Tt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.Tt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(Wf),Kf=function(t,n,i){return Do(t,n,i||new Xf)},Yf=function(){e[r.LINE_OF_TRIANGLES]=Vf,n[r.LINE_OF_TRIANGLES]=Kf},Jf=function(t,n,i,r){return new u(t,i,r,0,0,[new ka(i,r)]).init(n)},Zf=function(t){function n(n){return void 0===n&&(n=r.NULL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Jt),qf=function(t,n,i){return Do(t,n,i||new Zf)},Qf=function(){e[r.NULL]=Jf,n[r.NULL]=qf},$f=function(t,n,i){return Do(t,n,i||new su)},tl=function(){e[r.RECTANGLE]=Mc,n[r.RECTANGLE]=$f,Tr.set(r.RECTANGLE,Ct.PRIMITIVE|Ct.STROKE_SIDE)},nl=function(t,n,i){return Do(t,n,i||new hu)},il=function(t,n,i){return Do(t,n,i||new Po)},rl=function(){e[r.RECTANGLE_ROUNDED]=yo,n[r.RECTANGLE_ROUNDED]=il,Tr.set(r.RECTANGLE_ROUNDED,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},el=[0,0],ul=new t.Point,sl=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1},hl=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4},ol=function(t,n,i,r,e,u,s,h,o,a){var c=ul,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D-w,S=E-p,j=2*n-1;t[++j]=b,t[++j]=d,t[++j]=g,t[++j]=m,t[++j]=g+w,t[++j]=m+p,t[++j]=M,t[++j]=S,t[++j]=D,t[++j]=E,t[++j]=D+w,t[++j]=E+p,a[0]=O(b,d,g,m),a[1]=O(b,d,M,S)},al=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<6;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},cl=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a)},fl=function(t){function n(n,i){return t.call(this,n,i,6,4)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;sl(t.clippings,n),hl(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),ol(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,el),al(t.steps,t.clippings,this.vertexOffset,c,f,el))},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=J(i);cl(t.uvs,this.vertexOffset,e)}},n}(W),ll=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=6+h,c=4+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new fl(i,r),new sn(i+6,r+4,h,o)]).init(n):null},vl=function(t,n,i,r,e,u,s){return i<=0&&Zt(t,n,i,r,e,u,s)},bl=function(t){function n(n){void 0===n&&(n=r.SEMICIRCLE);var i=t.call(this,n)||this;return i.stroke.side=qt.ALL&~qt.BOTTOM,i}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&vl(this,n,i,r,e,u,s)},n}(Jt),dl=function(t,n,i){return Do(t,n,i||new bl)},gl=function(){e[r.SEMICIRCLE]=ll,n[r.SEMICIRCLE]=dl},ml=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices(),Oa(t.clippings,this.vertexOffset),Da(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=K(n),b=Y(v),d=v!==this.texture||b!==this.textureTransformId,g=u||l;if(g||h||d){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.texture=v,this.textureTransformId=b;var m=this.vertexOffset;t.updateVertices(),Ea(t.vertices,m,0,0,r,e,a,c,n.transform.internalTransform,wa),(g||h)&&(t.updateSteps(),Ma(t.steps,t.clippings,m,7,c,f,wa)),(g||d)&&(t.updateUvs(),Sa(t.uvs,J(v),m,wa))}},n}(W),wl=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=7+h,c=3+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new ml(i,r,a-h,c-o),new sn(i+7,r+3,h,o)]).init(n):null},pl=function(t,n,i){return Do(t,n,i||new Wf)},Ol=function(){e[r.TRIANGLE]=wl,n[r.TRIANGLE]=pl},Dl=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Af(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.radius,h=s!==this.radius,o=X(n),a=this.transformLocalId!==o,c=n.stroke,f=c.align,l=c.enable?c.width:0,v=c.style,b=this.strokeAlign!==f||this.strokeWidth!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=K(n),w=Y(m),p=m!==this.texture||w!==this.textureTransformId,O=u||h||b;if(O||a||g||p){this.sizeX=r,this.sizeY=e,this.radius=s,this.transformLocalId=o,this.strokeAlign=f,this.strokeWidth=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Rf(t.vertices,D,0,0,r,e,f,l,s,n.transform.internalTransform,If),(h||g)&&(t.updateClippings(),kf(t.clippings,D,d,s)),(O||a||g)&&(t.updateSteps(),Lf(t.steps,t.clippings,D,l,v,n.radius,If)),(O||p)&&(t.updateUvs(),yf(t.uvs,D,J(m),s,If))}},n}(W),El=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=Nf+h,c=15+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Dl(i,r,a-h,c-o),new sn(i+Nf,r+15,h,o)]).init(n):null},Ml=function(t,n,i){return Do(t,n,i||new Ff)},Sl=function(){e[r.TRIANGLE_ROUNDED]=El,n[r.TRIANGLE_ROUNDED]=Ml,Tr.set(r.TRIANGLE_ROUNDED,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},jl=function(){Mo(),Vo(),ia(),rc(),ec(),fc(),Dc(),mc(),Tc(),e[r.IMAGE_SDF]=xc,n[r.IMAGE_SDF]=_c,Hc(),Wc(),Qf(),e[r.RECTANGLE_PIVOTED]=sc,n[r.RECTANGLE_PIVOTED]=nl,Tr.set(r.RECTANGLE_PIVOTED,Ct.PRIMITIVE|Ct.STROKE_SIDE),rl(),tl(),gl(),Sl(),Ol(),gf(),Df(),Tf(),Hf(),Yf()},Tl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DImage"},n}(Ss),Nl=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).Ut=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:null,r}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.on(ir.tap,(function(t){i.onClick(t)}))},n.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){this.onSelect(t)},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),n.prototype.hasSelection=function(t){return t&&t.selection&&t.selection.add},n.prototype.getSelection=function(){for(var t=this.parent;t;){if(this.hasSelection(t))return t.selection;t=t.parent}return null},n.prototype.onSelect=function(t){this.emit("select",this.Ut,this);var n=this.getSelection();n&&n.add(this)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DMenuItemBase"},n}(Tl),Il=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getContext=function(){for(var t=this.parent;t;){if(t.getContext)return t.getContext();t=t.parent}return null},n.prototype.getCloseable=function(){for(var t=this.parent;t;){if(t.getCloseable)return t.getCloseable();t=t.parent}return null},n.prototype.getType=function(){return"DMenuItem"},n}(Nl),Cl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.initOnOver(n),this.initShortcuts(n)},n.prototype.initOnOver=function(t){var n=this;this.on(ir.over,(function(){var t=n.getContext();null!=t&&n.parent instanceof hr&&t.trim(n.getCloseable())}))},n.prototype.initShortcuts=function(t){var n=this.ni;if(null!=n&&0<n.length){var i=n[0],r=nr.toString(i);this.Bo=this.createText(r),this.snippet.add(this.Bo,!0)}else this.Bo=null;this._o=this.theme.getShortcutTextMargin()},n.prototype.updateShortcutText=function(){var t=this.Bo,n=this._o;if(null!=t&&null!=n){var i,r=this.Wn;i=r.width.isOn?n:this.width-t.width-n;var e,u=this.Qn,s=u.getTop();e=r.height.isOn?s:s+.5*(this.height-s-u.getBottom()-t.height),t.position.set(i,e)}},n.prototype.updateTextColor=function(n){t.prototype.updateTextColor.call(this,n);var i=this.Bo;if(null!=i){var r=this.theme,e=this.state;i.style.fill=r.getShortcutColor(e),i.alpha=r.getShortcutAlpha(e)}},n.prototype.updateText=function(){t.prototype.updateText.call(this),this.updateShortcutText()},n.prototype.getType=function(){return"DMenuItemText"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n);var i=this.getCloseable();null!=i&&i.emit("select",this.value,this,i)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(Il),Al=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),(null==n?void 0:n.check)&&(this.state.isActive=!0)},n.prototype.getType=function(){return"DMenuItemCheck"},n.prototype.onSelect=function(n){this.state.isActive=!this.state.isActive,t.prototype.onSelect.call(this,n)},n}(Cl),Rl=function(t){return"check"in t},kl={OPEN_LINK:0,OPEN_LINK_IN_NEW_WINDOW:1,COPY_LINK_ADDRESS:2},Ll=function(){function n(){}return n.addItemCreator=function(t){this.CREATORS.push(t)},n.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},n.setMenuCreator=function(t){this.MENU_CREATOR=t},n.newItemOf=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e](i,r);if(null!=s)return s}return n?n(i,r):null},n.newItem=function(t,n){return this.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)},n.newItemsOf=function(n,i,r,e){for(var u=0,s=r.length;u<s;++u){var h=r[u];if(h instanceof t.DisplayObject)i.addChild(h);else if(null!=h){var o=n.newItem(h,e);if(null==o)throw new Error("No matching menu item creator found: ".concat(JSON.stringify(h)));i.addChild(o)}}},n.newItems=function(t,n,i){this.newItemsOf(this,t,n,i)},n.newMenu=function(t){if(null!=this.MENU_CREATOR)return this.MENU_CREATOR(t);throw new Error("Missing DMenu creator.")},n.CREATORS=[],n.CREATOR_DEFAULT=null,n}(),yl=function(){function n(t,n){this.p=t,this.zn=n,this.vs=!0}return Object.defineProperty(n.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs=t},enumerable:!1,configurable:!0}),n.prototype.open=function(t){this.get().open(t)},n.prototype.get=function(){var t=this,n=this.Po;return null==n&&(n=this.toMenu(this.zn),this.Po=n,n.on("select",(function(n,i,r){t.onSelect(n,i,r)}))),n},n.prototype.toMenu=function(n){return n instanceof t.DisplayObject?n:this.newMenu(n)},n.prototype.newMenu=function(t){return Ll.newMenu(t)},n.prototype.onSelect=function(t,n,i){var r=this.p;switch(t){case kl.OPEN_LINK:r.open(!1);break;case kl.OPEN_LINK_IN_NEW_WINDOW:r.open(!0);break;case kl.COPY_LINK_ADDRESS:r.copy()}},n}(),xl={AUTO:0,THIS_WINDOW:1,NEW_WINDOW:2},Bl=function(t){var n=document.getSelection();if(n){var i=document.createRange();i.selectNodeContents(t),n.removeAllRanges(),n.addRange(i)}return n},_l=function(t){return t.clipboardData||window.clipboardData},Pl=function(t){function n(){var n=t.call(this)||this,i=document.body;return i.addEventListener("copy",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("copy",_l(t)))})),i.addEventListener("cut",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("cut",_l(t)))})),i.addEventListener("paste",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("paste",_l(t)))})),n}return _(n,t),n.copy=function(t){var n=navigator.clipboard;n&&n.writeText?n.writeText(t):function(t,n){if("undefined"==typeof ClipboardEvent){var i=t.clipboardData;if(void 0!==i&&void 0!==i.setData)return i.setData("Text",n),!0}return!1}(window,t)||function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important"),n.textContent="Dummy",document.body.appendChild(n);var i=Bl(n),r=!1;if(i){var e=function(i){if(i.target===n){var e=_l(i);e.setData("text/plain",t),r=e.getData("text/plain")===t,i.preventDefault()}};document.addEventListener("copy",e);try{document.execCommand("copy")}finally{document.removeEventListener("copy",e)}i.removeAllRanges()}return document.body.removeChild(n),r}(t)||navigator.userAgent.indexOf("Edge")<0&&function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important");var i=document.createElement("span");i.innerText=t,(n.attachShadow?n.attachShadow({mode:"open"}):n).appendChild(i),document.body.appendChild(n);var r=Bl(n);r&&(document.execCommand("copy"),r.removeAllRanges()),document.body.removeChild(n)}(t)},n}(t.utils.EventEmitter),Fl=t.interaction.InteractionEvent,Ul=function(){function t(t){this.zn=t,this.Fo=null==t?void 0:t.url,this.ei=this.toNormalizedTarget(null==t?void 0:t.target),this.Uo=null==t?void 0:t.checker,this.vs=!0}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.Fo},set:function(t){this.Fo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this.ei},set:function(t){this.ei=this.toNormalizedTarget(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checker",{get:function(){return this.Uo},set:function(t){this.Uo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"menu",{get:function(){var t=this.Po;return null==t&&(t=this.newMenu(),this.Po=t),t},enumerable:!1,configurable:!0}),t.prototype.newMenu=function(){var n=this.zn;if(n){var i=n.menu;if(i)return new yl(this,i)}var r=t.MENU;return null==r&&(r=new yl(this,Z.getInstance().get("DLink").getMenuOptions()),t.MENU=r),r},t.prototype.toStringifiedUrl=function(t,n){var i=wt(t)?t():t;null!=i&&(Ot(i)?n(i):i.then((function(t){null!=t&&n(t)})))},t.prototype.toNormalizedUrl=function(n){var i=t.ANCHOR_ELEMENT||document.createElement("a");return t.ANCHOR_ELEMENT=i,i.href=n,i.href},t.prototype.toNormalizedTarget=function(t){return Ai(null!=t?t:xl.AUTO,xl)},t.prototype.copy=function(){var t=this;this.toStringifiedUrl(this.Fo,(function(n){Pl.copy(t.toNormalizedUrl(n))}))},t.prototype.open=function(t){var n=this;this.toStringifiedUrl(this.Fo,(function(i){var r=!0===t||!1===t?t:n.inNewWindow(t);n.check(i,r,(function(){n.exec(i,r)}))}))},t.prototype.check=function(t,n,i){var r=this.Uo;if(r){var e=r();!0===e?i():!1===e||e.then((function(t){t&&i()}))}else i()},t.prototype.exec=function(t,n){if(n){var i=document.createElement("a");i.href=t,i.target="_blank",i.style.display="none",i.rel="noopener noreferrer",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),100)}else window.location.href=t},t.prototype.inNewWindow=function(t){switch(this.ei){case xl.NEW_WINDOW:return!0;case xl.THIS_WINDOW:return!1;case xl.AUTO:if(null!=t){var n=t instanceof Fl?t.data.originalEvent:t;return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey||"button"in n&&0!==n.button}return!1}},t.prototype.onClick=function(t,n){if(this.ei===xl.AUTO){var i=n.data.originalEvent;if("pointerType"in i&&"mouse"!==i.pointerType||"touches"in i){var r=this.menu;if(r.enable)return this.vs&&t.state.isActionable&&r.open(t),!0}}return!this.vs},t}(),Gl=function(){function t(){}return t.toStateOptions=function(t,n){if(n&&(t===xl.NEW_WINDOW||"NEW_WINDOW"===t)){var i=n.state;if(null==i)n.state=ct.NEW_WINDOW;else if(Ot(i))i!==ct.NEW_WINDOW&&(n.state=[i,ct.NEW_WINDOW]);else if(mt(i))i.indexOf(ct.NEW_WINDOW)<0&&i.push(ct.NEW_WINDOW);else{var r=i.values;null==r?i.values=ct.NEW_WINDOW:Ot(r)?r!==ct.NEW_WINDOW&&(i.values=[r,ct.NEW_WINDOW]):r.indexOf(ct.NEW_WINDOW)<0&&r.push(ct.NEW_WINDOW)}}return n},t}(),Hl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toLinkOptions=function(t){if(t)return{url:this.toUrl(t.url),target:t.target,checker:this.toChecker(t.checker),menu:t.menu}},n.prototype.toUrl=function(t){var n=this;return Ot(t)||null==t?t:function(){return t(n)}},n.prototype.toChecker=function(t){var n=this;if(null!=t)return function(){return t(n)}},n.prototype.init=function(n){t.prototype.init.call(this,Gl.toStateOptions(null==n?void 0:n.target,n))},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return null==t&&(t=new Ul(this.toLinkOptions(this.zn)),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},n.prototype.getType=function(){return"DMenuItemLink"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(Cl),zl=function(t){return"url"in t},Vl=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t),this.initHover(t)},i.prototype.initHover=function(t){var n=this;this.on(ir.over,(function(){n.state.isActionable&&n.open()}))},i.prototype.toMenu=function(n){var i=null==n?void 0:n.menu;return i instanceof t.DisplayObject?i:this.newMenu(i)},i.prototype.newMenu=function(t){return Ll.newMenu(t)},Object.defineProperty(i.prototype,"menu",{get:function(){var t=this,n=this.Po;return null==n&&((n=this.toMenu(this.zn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Po=n),n},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DMenuItemMenu"},i.prototype.open=function(){var t=this.menu;t.isHidden()&&this.onOpen(t)},i.prototype.onOpen=function(t){var n=this.getContext();null!=n&&t.open(this,this.getCloseable(),n)},i.prototype.close=function(){this.menu.close()},i.prototype.toggle=function(){var t=this.menu;t.isHidden()?this.onOpen(t):t.close()},i.prototype.onSelect=function(t){this.open(),n.prototype.onSelect.call(this,t)},i.prototype.onMenuSelect=function(t,n,i){var r=this.getCloseable();null!=r&&r.emit("select",t,n,r)},i.prototype.onKeyDown=function(t){return nr.isArrowRightKey(t)&&this.onKeyDownArrowRight(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyDownArrowRight=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},i}(Il),Wl=function(t){return"menu"in t},Xl=function(n,i){var r=n.menu;return r instanceof t.DisplayObject||(null==r.sticky&&(r.sticky=i),null==r.align&&(r.align=xu.RIGHT)),n},Kl=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){var r=t.state,e=t.border,u=e.getWidth(r),s=e.getColor(r);if(null!=s){var h=e.getAlpha(r),o=e.getAlign(r),a=t.padding,c=.5*i;this.clear(),this.lineStyle(u,s,h,o),this.moveTo(a.getLeft(),c),this.lineTo(n-a.getRight(),c),this.visible=!0}else this.clear(),this.visible=!1},n}(t.Graphics),Yl=function(t){return"separator"in t},Jl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){new Kl(this)},n.prototype.getType=function(){return"DMenuItemSeparator"},n}(Nl),Zl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemSpace"},n}(Xu),ql=function(t){return"space"in t},Ql=function(){Ll.addItemCreator((function(t){return Rl(t)?new Al(t):null})),Ll.addItemCreator((function(t){return zl(t)?new Hl(t):null})),Ll.addItemCreator((function(t,n){return Wl(t)?new Vl(Xl(t,n)):null})),Ll.addItemCreator((function(t){return Yl(t)?new Jl(t):null})),Ll.addItemCreator((function(t){return ql(t)?new Zl(t):null})),Ll.setItemCreatorDefault((function(t){return new Cl(t)}))},$l=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableBody"},n}(Ju),tv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuItemExpandableHeader"},n}(Nl),nv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Ll.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||Ll.newItem(t,n)},t.newItems=function(t,n,i){Ll.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),iv=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i,r=this;n.prototype.init.call(this,t);var e=this.theme,u=this.toHeader(e,t);this.Th=u,u.on("select",(function(){r.toggle()})),this.addChild(u);var s=this.toBody(e,t);this.Ie=s;var h=null!==(i=null==t?void 0:t.sticky)&&void 0!==i&&i;this.newItems(s,h,e,t),this.addChild(s),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.newItems=function(t,n,i,r){var e=null==r?void 0:r.items;null!=e&&nv.newItems(t,e,n)},i.prototype.toHeader=function(n,i){return i?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new tv(n)},i.prototype.toBody=function(n,i){var r=null==i?void 0:i.body;return r?r instanceof t.DisplayObject?r:this.newBody(n,r):this.newBody(n)},i.prototype.newBody=function(t,n){return new $l(n)},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.Ie;t instanceof hr?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.Ie;t instanceof hr?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.onKeyDown=function(t){if(nr.isArrowRightKey(t))this.state.isActionable&&!this.state.isActive&&(i=this.Th)instanceof hr&&i.state.isFocused&&(this.state.isActive=!0);else if(nr.isArrowLeftKey(t)){var i;if(this.state.isActionable&&this.state.isActive)return(i=this.Th)instanceof hr?i.focus():this.focus(),this.state.isActive=!1,n.prototype.onKeyDown.call(this,t),!0}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuItemExpandable"},i}(Ju),rv=function(t){return"header"in t},ev=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemCheck"},n}(Al),uv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemLink"},n}(Hl),sv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSeparator"},n}(Jl),hv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSpace"},n}(Zl),ov=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemText"},n}(Cl),av=function(){Ll.addItemCreator((function(t){return rv(t)?new iv(t):null})),nv.addItemCreator((function(t){return Rl(t)?new ev(t):null})),nv.addItemCreator((function(t){return zl(t)?new uv(t):null})),nv.addItemCreator((function(t){return Yl(t)?new sv(t):null})),nv.addItemCreator((function(t){return ql(t)?new hv(t):null})),nv.setItemCreatorDefault((function(t){return new ov(t)}))},cv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemCheck"},n}(Al),fv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemLink"},n}(Hl),lv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initHover=function(t){},n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=t.prototype.getSelection.call(this);e&&e.add(i)},n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemMenu"},n}(Vl),vv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(Jl),bv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSpace"},n}(Zl),dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemText"},n}(Cl),gv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Ll.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||Ll.newItem(t,n)},t.newItems=function(t,n,i){Ll.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),mv=function(){gv.setItemCreatorDefault((function(t){return new dv(t)})),gv.addItemCreator((function(t){return ql(t)?new bv(t):null})),gv.addItemCreator((function(t){return Yl(t)?new vv(t):null})),gv.addItemCreator((function(t,n){return Wl(t)?new lv(Xl(t,n)):null})),gv.addItemCreator((function(t){return zl(t)?new fv(t):null})),gv.addItemCreator((function(t){return Rl(t)?new cv(t):null}))},wv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Ll.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||gv.newItem(t,n)},t.newItems=function(t,n,i){Ll.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),pv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItems=function(t,n,i,r){null!=r&&null!=r.items&&wv.newItems(t,r.items,n)},n.prototype.getType=function(){return"DMenuSidedItemExpandable"},n}(iv),Ov=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemCheck"},n}(ev),Dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemLink"},n}(Hl),Ev=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemMenu"},n}(Vl),Mv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getType=function(){return"DMenuSidedItemExpandableItemMenu"},n}(Ev),Sv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(sv),jv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemSpace"},n}(hv),Tv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemText"},n}(ov),Nv=function(){gv.addItemCreator((function(t){return rv(t)?new pv(t):null})),wv.addItemCreator((function(t){return Rl(t)?new Ov(t):null})),wv.addItemCreator((function(t){return zl(t)?new Dv(t):null})),wv.addItemCreator((function(t,n){return Wl(t)?new Mv(Xl(t,n)):null})),wv.addItemCreator((function(t){return Yl(t)?new Sv(t):null})),wv.addItemCreator((function(t){return ql(t)?new jv(t):null})),wv.setItemCreatorDefault((function(t){return new Tv(t)}))},Iv=function(){Ql(),av(),mv(),Nv()},Cv=function(){Iv(),jl()},Av=function(){function t(){}return t.add=function(t,n){var i=this.Ho;null==i&&(i=new Map,this.Ho=i);var r=i.get(t);null==r?(r=[n],i.set(t,r)):r.push(n)},t.get=function(t){var n=this.Ho;if(null!=n)return n.get(t)},t}(),Rv=function(t){function n(n,i){return t.call(this,ze.EMIT_EVENT,n,i,gu.EMIT_EVENT,"")||this}return _(n,t),n}(Cu),kv=function(t){function n(n,i,r){return t.call(this,n,i,"",gu.EMIT_EVENT,r)||this}return _(n,t),n}(Cu),Lv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e,"")||this}return _(n,t),n}(Cu),yv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,gu.EMIT_EVENT,e)||this}return _(n,t),n}(Cu),xv=function(t,n){return n?Oo(t).then((function(t){var n=Me.getInstance().init();n.updateTexture(t),n.render();var i=document.createElement("canvas");return n.read(i),xv(i.toDataURL(),!1)})):Oo(t).then((function(t){return new Bc(t)}))},Bv=function(){function t(){}return t.from=function(t,n,i){var r=this,e=Ye.toSerialized(t),u=e.pieces;return Ye.toPieceData(n,u,i).then((function(t){return r.zo(e,i,u,t)}))},t.zo=function(t,n,i,r){var e=this,u=t.width,s=t.height,h=new Ke(u,s),o=new Sr(t,i,r,n,1);return Ye.newLayer(t,h,o).then((function(){return e.create(t.name,u,s,h,n,0)}))},t.create=function(t,n,i,r,e,u){var s=new Br(t,e,u);return s.size.set(n,i),r.copyTo(s),s.size.init(),s},t}(),_v=function(t){return"data:image/svg+xml;base64,".concat(btoa(t))},Pv=function(t){return Math.round(100*t)/100},Fv=function(){function t(){}return t.add=function(t){var n,i,r;(null!==(n=this.Zh)&&void 0!==n?n:this.Zh=new Map).set(t.type,t),(null!==(i=this.Re)&&void 0!==i?i:this.Re=new Map).set(t.id,t),(null!==(r=this.Xt)&&void 0!==r?r:this.Xt=[]).push(t)},t.get=function(t){var n=this.Zh;if(null!=n)return n.get(t)},t.getById=function(t){var n=this.Re;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Xt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Uv=function(){function t(){}return t.toIndices=function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(t[i].index);return n},t.toDepth=function(t){for(var n=0,i=t.parent;i instanceof Rt;)n+=1,i=i.parent;return n},t.toSharedParent=function(t,n){if(this.toDepth(t)<this.toDepth(n)){for(var i=t.parent;i instanceof Rt;){if(this.isParent(n,i))return i;i=i.parent}return i}for(var r=n.parent;r instanceof Rt;){if(this.isParent(t,r))return r;r=r.parent}return r},t.toOfParent=function(t,n){for(var i=t.parent;i!==n&&i instanceof Rt;)t=i,i=i.parent;return t},t.isParent=function(t,n){for(var i=t.parent;i instanceof Rt;){if(i===n)return!0;i=i.parent}return!1},t.toSelected=function(t){for(var n=t;n instanceof Rt;){if(n.selected)return n;n=n.parent}return null},t.findChildById=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.id===i)return h;if(!0===r){var o=t.findChildById(h,i,r);if(null!=o)return o}}return null},t.findChildByType=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.type===i)return h;if(!0===r){var o=t.findChildByType(h,i,r);if(null!=o)return o}}return null},t.findChild=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(i(h))return h;if(!0===r){var o=t.findChild(h,i,r);if(null!=o)return o}}return null},t.findChildrenByType=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];o.type===i&&e.push(o),!0===r&&t.findChildrenByType(o,i,r,e)}return e},t.findChildren=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];i(o)&&e.push(o),!0===r&&t.findChildren(o,i,r,e)}return e},t.COMPARATOR_INDEX=function(t,n){return t.index-n.index},t}(),Gv=function(){function t(){}return t.delete=function(t,n,i){for(var r=t.children,e=r.length,u=0;u<e;++u)(o=r[u]).selected?o.index=e+u:o.index=u;if(r.sort(Uv.COMPARATOR_INDEX),!0===i){for(u=e-1;0<=u;--u){if(!(o=r[u]).selected){var s=r.length-(u+1);if(0<s){var h=r.splice(u+1,s);return null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h}return null!=n&&(n.length=0),null}o.index-=e,o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(h=r.splice(0,r.length),null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h):(null!=n&&(n.length=0),null)}for(u=e-1;0<=u;--u){var o;if(!(o=r[u]).selected)return r.length=u+1,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),null;o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(r.length=0,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty()):null!=n&&(n.length=0),null},t}(),Hv=function(){function t(){}return t.from=function(t){if(Ot(t))return z[t];if(pt(t))return t;if(null!=t){for(var n=z.NONE,i=0,r=t.length;i<r;++i)n|=z[t[i]];return n}return z.NONE},t}(),zv=function(){function t(){this.resources=[],this.resourceToIndex=new Map,this.data=[],this.dataToIndex=new Map,this.pieces=[],this.pieceToIndex=new Map,this.uuids=new Set,this.uuidNext=0}return t.prototype.addResource=function(t){return this.Vo(t,this.resources,this.resourceToIndex)},t.prototype.addData=function(t){return this.Vo(t,this.data,this.dataToIndex)},t.prototype.addPiece=function(t){return this.Vo(t,this.pieces,this.pieceToIndex)},t.prototype.addUuid=function(t){if(0!==t){var n=this.uuids;return n.has(t)?0:(n.add(t),t)}return 0},t.prototype.updateUuid=function(t){var n=this.uuids;if(0!==t)return t;var i=this.newUuid();return n.add(i),i},t.prototype.newUuid=function(){for(var t=this.uuids,n=this.uuidNext;;)if(0!==(n+=1)&&!t.has(n))return this.uuidNext=n,n},t.prototype.Vo=function(t,n,i){var r=i.get(t);if(null!=r)return r;var e=n.length;return n.push(t),i.set(t,e),e},t}(),Vv=function(t){function n(n,i){var r,e,u,s=this;return(s=t.call(this)||this).Wo=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapGridVisible(),s.Xo=s.Wo,s.Ko=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapGridEnabled(),s.vs=s.Ko,s.Yo=null!==(u=null==i?void 0:i.size)&&void 0!==u?u:n.getSnapGridSize(),s.T=s.Yo,s}return _(n,t),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Xo},set:function(t){this.Xo!==t&&(this.Xo=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs!==t&&(this.vs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.emit("change",t,this))},enumerable:!1,configurable:!0}),n.prototype.snap=function(t,n){if(this.vs){var i=this.T;n.set(t,Math.round(t/i)*i)}},n.prototype.reset=function(){this.Xo=this.Wo,this.vs=this.Ko,this.T=this.Yo,this.emit("change",this)},n.prototype.serialize=function(){return[this.vs?1:0,this.Xo?1:0,this.T]},n.prototype.deserialize=function(t){this.enable=!!t[0],2 in t?(this.visible=!!t[1],this.size=t[2]):(this.visible=!1,this.size=t[1])},n}(t.utils.EventEmitter),Wv=function(){function t(){this.distance=NaN,this.result=0,this.threshold=10}return t.prototype.reset=function(t,n){this.distance=NaN,this.result=t,this.threshold=1e-4<n?10/n:10},t.prototype.set=function(t,n){var i=Math.abs(n-t);if(i<=this.threshold){var r=this.distance;(r!=r||i<r)&&(this.distance=i,this.result=n)}},t}(),Xv={HORIZONTAL:0,VERTICAL:1},Kv=function(){function t(t,n){this.type=t,this.position=n}return t.prototype.serialize=function(){return[this.type,this.position]},t}(),Yv=function(t){function n(n,i){var r,e,u=this;return(u=t.call(this)||this).values=[],u.Wo=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapTargetVisible(),u.Xo=u.Wo,u.Ko=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapTargetEnabled(),u.vs=u.Ko,u}return _(n,t),Object.defineProperty(n.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs!==t&&(this.vs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Xo},set:function(t){this.Xo!==t&&(this.Xo=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.values.length},enumerable:!1,configurable:!0}),n.prototype.add=function(t,n){null!=n?this.values.splice(n,0,t):this.values.push(t),this.emit("change",this)},n.prototype.remove=function(t){var n=this.values;0<=t&&t<n.length&&(n.splice(t,1),this.emit("change",this))},n.prototype.replace=function(t,n){var i=this.values;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.emit("change",this),r}return null},n.prototype.swap=function(t,n){if(t!==n){var i=this.values,r=i[t];i[t]=i[n],i[n]=r,this.emit("change",this)}},n.prototype.snap=function(t,n,i,r){if(this.vs)for(var e=this.values,u=0,s=e.length;u<s;++u){var h=e[u];h.type===Xv.VERTICAL?i.set(t,h.position):r.set(n,h.position)}},n.prototype.reset=function(){this.vs=this.Ko,this.Xo=this.Wo,this.values.length=0,this.emit("change",this)},n.prototype.serialize=function(){for(var t=[],n=this.values,i=0,r=n.length;i<r;++i)t.push(n[i].serialize());return[this.vs?1:0,this.Xo?1:0,t]},n.prototype.deserialize=function(t){this.vs=!!t[0],this.Xo=!!t[1];var n=t[2],i=this.values;i.length=0;for(var r=0,e=n.length;r<e;++r){var u=n[r];i.push(new Kv(u[0],u[1]))}this.emit("change",this)},n}(t.utils.EventEmitter),Jv=1e-5,Zv={NONE:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,MIDDLE_LEFT:4,MIDDLE_RIGHT:5,BOTTOM_LEFT:6,BOTTOM_CENTER:7,BOTTOM_RIGHT:8,ROTATION:9},qv=function(n){function i(i,r,e){var u,s=this;return(s=n.call(this)||this).Tt=[new t.Point,new t.Point,new t.Point,new t.Point,new t.Point],s.Jo=[new t.Point,new t.Point],s.Zo=[1,1],s.qo=new t.Point,s.Qo=new Wv,s.$o=new Wv,s.ta={distance:0,scale:new t.Point},s.na=new t.Point,s.ia=new t.Rectangle,s.ra=new t.Point,s.grid=new Vv(r,null==e?void 0:e.grid),s.target=new Yv(r,null==e?void 0:e.target),s.p=i,s.Ko=null!==(u=null==e?void 0:e.enable)&&void 0!==u?u:r.isSnapEnabled(),s.vs=s.Ko,s}return _(i,n),Object.defineProperty(i.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs!==t&&(this.vs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),i.prototype.prepare=function(t){t.updateTransform();var n=t.transform.localTransform,i=t.width,r=t.height,e=this.Tt;e[0].set(0,0),e[1].set(i,0),e[2].set(i,r),e[3].set(0,r),e[4].set(.5*i,.5*r),n.apply(e[0],e[0]),n.apply(e[1],e[1]),n.apply(e[2],e[2]),n.apply(e[3],e[3]),n.apply(e[4],e[4])},i.prototype.prepareForTranslate=function(t){this.vs&&this.prepare(t)},i.prototype.snap=function(t,n){var i=t.x,r=t.y,e=this.p.canvas,u=this.Qo,s=this.$o;if(null!=e){var h=Math.max(e.scale.x,e.scale.y);u.reset(i,h),s.reset(r,h),u.set(i,0),u.set(i,e.width),s.set(r,0),s.set(r,e.height)}else u.reset(i,1),s.reset(r,1);return this.target.snap(i,r,u,s),this.grid.snap(i,u),this.grid.snap(r,s),n.x=Sh(u.distance)?NaN:u.result,n.y=Sh(s.distance)?NaN:s.result,n},i.prototype.toSnapped=function(t,n){var i=t.x,r=t.y;if(this.vs){this.snap(t,n);var e=n.x,u=n.y;n.set(Sh(e)?i:e,Sh(u)?r:u)}else n.set(i,r);return n},i.prototype.toTranslationSnapped=function(t,n){var i=t.x,r=t.y,e=NaN,u=NaN;if(this.vs)for(var s=this.na,h=this.Tt,o=0,a=h.length;o<a;++o){var c=h[o];if(s.set(c.x+i,c.y+r),this.snap(s,s),!Sh(s.x)){var f=s.x-c.x;(Sh(e)||Math.abs(f-i)<Math.abs(e-i))&&(e=f)}if(!Sh(s.y)){var l=s.y-c.y;(Sh(u)||Math.abs(l-r)<Math.abs(u-r))&&(u=l)}}return n.x=Sh(e)?i:e,n.y=Sh(u)?r:u,n},i.prototype.prepareForRotate=function(t){},i.prototype.getGridSizeRotation=function(){return 5},i.prototype.toRadian=function(t){return t/180*Math.PI},i.prototype.toDegree=function(t){return t/Math.PI*180},i.prototype.toRotationSnapped=function(t,n){if(this.vs){var i=this.getGridSizeRotation(),r=t+n,e=Math.round(this.toDegree(r)),u=e%90;return Math.abs(u)<=i?this.toRadian(e-u)-t:90-i<=u?this.toRadian(e+(90-u))-t:u<=-90+i?this.toRadian(e-(90+u))-t:n}return n},i.prototype.calcNormalizedVector=function(t,n,i){var r=n.x-t.x,e=n.y-t.y,u=Math.sqrt(r*r+e*e);if(Jv<u){var s=1/u;i.x=r*s,i.y=e*s}else i.x=1,i.y=0;return u},i.prototype.prepareForScale=function(t,n){if(this.vs){this.prepare(t);var i=this.Tt,r=this.Jo,e=this.Zo;switch(n){case Zv.TOP_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]),e[1]=this.calcNormalizedVector(i[3],i[0],r[1]);break;case Zv.TOP_CENTER:e[0]=this.calcNormalizedVector(i[3],i[0],r[0]);break;case Zv.TOP_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]),e[1]=this.calcNormalizedVector(i[2],i[1],r[1]);break;case Zv.MIDDLE_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]);break;case Zv.NONE:break;case Zv.MIDDLE_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]);break;case Zv.BOTTOM_LEFT:e[0]=this.calcNormalizedVector(i[2],i[3],r[0]),e[1]=this.calcNormalizedVector(i[0],i[3],r[1]);break;case Zv.BOTTOM_CENTER:e[0]=this.calcNormalizedVector(i[0],i[3],r[0]);break;case Zv.BOTTOM_RIGHT:e[0]=this.calcNormalizedVector(i[3],i[2],r[0]),e[1]=this.calcNormalizedVector(i[1],i[2],r[1])}}},i.prototype.setScaleSnappedResult=function(t,n,i,r,e){if(Jv<n&&(Sh(e.distance)||t<e.distance)){e.distance=t;var u=1+i/n;r?e.scale.x=u:e.scale.y=u}},i.prototype.calcScaleSnapped1D=function(t,n,i,r,e,u){var s=this.qo;t.apply(n,s);var h=s.x,o=s.y;this.snap(s,s);var a=s.x,c=s.y;if(!Sh(a)){var f=Math.abs(i.x);if(Jv<f){var l=(a-h)/i.x,v=Math.abs(l),b=(a-n.x)/i.x;this.setScaleSnappedResult(v,r,b,e,u)}}if(!Sh(c)){var d=Math.abs(i.y);if(Jv<d){var g=(c-o)/i.y,m=(v=Math.abs(g),(c-n.y)/i.y);this.setScaleSnappedResult(v,r,m,e,u)}}},i.prototype.calcScaleSnappedX=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!0,e)},i.prototype.calcScaleSnappedY=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!1,e)},i.prototype.calcScaleSnapped2D=function(t,n,i,r,e){var u=this.qo;t.apply(n,u);var s=u.x,h=u.y;this.snap(u,u);var o=u.x,a=u.y;if(Sh(o)){if(Sh(a))return;o=s}else Sh(a)&&(a=h);var c=i[0].x*i[1].y-i[1].x*i[0].y;if(Jv<Math.abs(c)){var f=o-s,l=a-h,v=Math.abs(f*f+l*l);if(Sh(e.distance)||v<e.distance){e.distance=v;var b=o-n.x,d=a-n.y,g=(+i[1].y*b-i[1].x*d)/c,m=(-i[0].y*b+i[0].x*d)/c;e.scale.set(1+g/r[0],1+m/r[1])}}},i.prototype.calcScaleSnappedXY=function(t,n,i,r,e,u,s){this.calcScaleSnapped2D(t,n,e,u,s),this.calcScaleSnappedX(t,r,e[0],u[0],s),this.calcScaleSnappedY(t,i,e[1],u[1],s)},i.prototype.toScaleSnapped=function(t,n,i,r){if(this.vs){var e=this.Tt,u=this.Jo,s=this.Zo,h=this.ta;switch(h.distance=NaN,h.scale.set(r.x,r.y),n){case Zv.TOP_LEFT:this.calcScaleSnappedXY(t,e[0],e[1],e[3],u,s,h);break;case Zv.TOP_CENTER:this.calcScaleSnappedY(t,e[0],u[0],s[0],h),this.calcScaleSnappedY(t,e[1],u[0],s[0],h);break;case Zv.TOP_RIGHT:this.calcScaleSnappedXY(t,e[1],e[0],e[2],u,s,h);break;case Zv.MIDDLE_LEFT:this.calcScaleSnappedX(t,e[0],u[0],s[0],h),this.calcScaleSnappedX(t,e[3],u[0],s[0],h);break;case Zv.NONE:break;case Zv.MIDDLE_RIGHT:this.calcScaleSnappedX(t,e[1],u[0],s[0],h),this.calcScaleSnappedX(t,e[2],u[0],s[0],h);break;case Zv.BOTTOM_LEFT:this.calcScaleSnappedXY(t,e[3],e[2],e[0],u,s,h);break;case Zv.BOTTOM_CENTER:this.calcScaleSnappedY(t,e[2],u[0],s[0],h),this.calcScaleSnappedY(t,e[3],u[0],s[0],h);break;case Zv.BOTTOM_RIGHT:this.calcScaleSnappedXY(t,e[2],e[3],e[1],u,s,h)}if(!Sh(h.distance)){if(r.copyFrom(h.scale),i)switch(n){case Zv.TOP_LEFT:case Zv.TOP_RIGHT:case Zv.BOTTOM_LEFT:case Zv.BOTTOM_RIGHT:r.x=r.y=Math.max(r.x,r.y);break;case Zv.TOP_CENTER:case Zv.BOTTOM_CENTER:r.x=r.y;break;case Zv.MIDDLE_LEFT:case Zv.MIDDLE_RIGHT:r.y=r.x}return!0}}return!1},i.prototype.reset=function(){this.enable=this.Ko,this.target.reset(),this.grid.reset()},i.prototype.serialize=function(){return[this.vs?1:0,this.target.serialize(),this.grid.serialize()]},i.prototype.deserialize=function(t){this.enable=!!t[0],this.target.deserialize(t[1]),this.grid.deserialize(t[2])},i}(t.utils.EventEmitter),Qv=function(t){function n(n,i,r){var e=t.call(this,n,i.width,i.height,0,r)||this;return e.Bs=i,e}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.drawImage(this.Bs.canvas,n.x,n.y,n.width,n.height)},n}(be),$v=function(n,i,r,e){this.id=n,this.size=i,this.color=t.utils.hex2string(r),this.height=i+2*e;var u=Ds.measure(n);this.ascent=u.ascent,this.descent=u.descent},tb=function(){function n(n,i,r,e){this.R=n,this.vr=document.createElement("canvas"),this.ea=null;var u=this.toPadding(i);this.Qn=u,this.Ye=new $v(n,i,r,u),this.Je={},this.Ze=0,this.ua=0,this.kt=1,this.pn=1,this.sa=0,this.ha=0,this.xe=t.Texture.from(this.vr,{mipmap:t.MIPMAP_MODES.OFF,resolution:e,scaleMode:t.SCALE_MODES.NEAREST});var s=this.Je;this.Vo(" "," ",s,Ee.SPACE_R),this.Vo("\t"," ",s,Ee.SPACE_R),this.Vo("...","...",s,Ee.LETTER_RNB);for(var h=0,o=pe.length;h<o;++h){var a=pe[h];this.Vo(a,a,s,Ee.LETTER_RNB)}}return n.prototype.toPadding=function(t){return Math.max(3,Math.ceil(.2*t))},Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"font",{get:function(){return this.Ye},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this.kt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvas",{get:function(){return this.vr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"characters",{get:function(){return this.Je},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){return this.xe},enumerable:!1,configurable:!0}),n.prototype.Vo=function(t,n,i,r){if(!this.isIgnored(n)){var e=i[t];if(null!=e)e.type&Ee.RESERVED||(0===e.ref&&(this.ua-=1),e.ref+=1);else{var u=this.getAdvance(n),s=this.Qn,h=Math.ceil(s+u+s),o=this.font.height;i[t]=new De(n,u,h,o,r),this.Ze+=1,this.sa+=1}}},n.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},n.prototype.oa=function(t,n){var i=n[t];null!=i&&!(i.type&Ee.RESERVED)&&0<i.ref&&(i.ref-=1,0===i.ref&&(this.ua+=1))},n.prototype.aa=function(){if(this.Ze>>1<=this.ua){var t=this.Je;for(var n in t)t[n].ref<=0&&delete t[n];this.Ze-=this.ua,this.sa+=1,this.ua=0}},n.prototype.add=function(t,n){void 0===n&&(n=Ee.LETTER);for(var i=this.Je,r=b.from(t);r.hasNext();){var e=r.next();this.Vo(e,e,i,n)}},n.prototype.remove=function(t){for(var n=this.Je,i=b.from(t);i.hasNext();)this.oa(i.next(),n)},n.prototype.get=function(t){return this.Je[t]},n.prototype.getAdvance=function(t){var n=this.getContext();return null!=n?n.measureText(t).width:0},n.prototype.getContext=function(){var t=this.ea;if(null==t){var n=this.vr;if(null==n)return null;if(null==(t=this.ea=n.getContext("2d",{alpha:!0})))return null}var i=this.Ye;return t.font!==i.id&&(t.font=i.id,i.id=t.font,t.textAlign="left",t.textBaseline="alphabetic",t.lineWidth=0,t.lineCap="round",t.lineJoin="miter",t.miterLimit=0,t.fillStyle=i.color,t.strokeStyle="#0000ff"),t},n.prototype.update=function(){if(this.aa(),this.ha<this.sa){this.ha=this.sa;var t=this.vr;if(null!=t){var n=this.Ye,i=n.height,r=this.Je,e=this.kt=this.toPowerOf2(Math.ceil(Math.sqrt(this.Ze))*i),u=this.Qn,s=Math.round(.5*(i-(n.ascent+n.descent))+n.ascent),h=0,o=0;for(var a in r)e<=h+(g=r[a]).width&&(h=0,o+=i),g.x=h,g.y=o,g.origin.x=h+u,g.origin.y=o+s,h+=g.width;var c=this.pn=o+i,f=this.xe.baseTexture,l=f.resolution,v=Math.ceil(e*l),b=Math.ceil(c*l);t.width=v,t.height=b;var d=this.getContext();if(null!=d){for(var a in d.save(),d.scale(l,l),d.clearRect(0,0,e,c),r){var g=r[a];d.fillText(a,g.origin.x,g.origin.y)}d.restore()}return f.setRealSize(v,b),!0}}return!1},n.prototype.getRevision=function(){return this.sa},n.prototype.getRevisionUpdate=function(){return this.ha},Object.defineProperty(n.prototype,"length",{get:function(){return this.Ze},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){null!=this.vr&&(this.vr=null);var t=this.Je;for(var n in t)delete t[n]},n.prototype.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},n}(),nb=function(t){t.update()},ib=function(t){t.forEach(nb)},rb=function(t){t.update()},eb=function(t){t.forEach(rb)},ub=function(){function t(t){var n=this;this.qe=new Map,this.Mn=t.renderer.resolution,t.renderer.on("prerender",(function(){n.update()}))}return t.prototype.add=function(t,n,i,r){var e=this.qe,u=e.get(t);null==u&&(u=new Map,e.set(t,u));var s=u.get(i);null==s&&(s=new tb(t,n,i,this.Mn),u.set(i,s)),s.add(r)},t.prototype.remove=function(t,n,i){var r=this.qe.get(t);if(null!=r){var e=r.get(n);null!=e&&e.remove(i)}},t.prototype.get=function(t,n){var i=this.qe.get(t);if(null==i)return null;var r=i.get(n);return null==r?null:r},t.prototype.update=function(){this.qe.forEach(ib)},t.prototype.destroy=function(){var t=this.qe;t.forEach(eb),t.clear()},t}(),sb=function(t){if("object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)){var n=Object.getPrototypeOf(t);return null==n||n===Object.prototype}return!1},hb=function(){function t(t,n,i){var r=this;this.instance=null,this.newInstance=t,this.options=n,null!=i&&(i.state.isActive&&setTimeout((function(){r.get()}),0),i.on("active",(function(){r.get()})))}return t.prototype.get=function(){var t=this.instance;return null==t&&(t=new this.newInstance(this.options),this.instance=t),t},t}(),ob=function(t,n,i,r){for(var e=0,u=Math.floor(t.length/i)-1;e<=u;){var s=e+(u-e>>1),h=t[s*i+r];if(n<h)u=s-1;else{if(!(h<n))return s;e=s+1}}return Math.max(e,u)},ab=function(t){return mt(t)?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n[i]=t[i];return n}(t):sb(t)?function(t){var n={};for(var i in t)Object.hasOwnProperty.call(t,i)&&(n[i]=ab(t[i]));return n}(t):t},cb=function(t){if(null!=t){if(Ot(t))return t;if(pt(t))return String(t);if("name"in t)return t.name;if("label"in t)return t.label;if("id"in t)return t.id}return""},fb=function(t,n){if(null!=t){var i=ab(t);if(null!=n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var e=n[r];if(sb(e))if(Object.prototype.hasOwnProperty.call(i,r)){var u=i[r];sb(u)&&fb(u,e)}else i[r]=ab(e);else Object.prototype.hasOwnProperty.call(i,r)||(i[r]=e)}return i}return null!=n?ab(n):{}},lb=function(){function n(t,n,i){this.kt=t,this.ca=n,this.te=i,this.fa={},this.la="",this.va=0,this.ba=0,this.pn=0}return Object.defineProperty(n.prototype,"width",{get:function(){return this.kt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ratio",{get:function(){return this.ca},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},enumerable:!1,configurable:!0}),n.prototype.add=function(n,i,r,e){var u=this.fa;if(!(n in u)){var s=this.te,h=this.va,o=this.ba;this.kt<=h+i?(h=0,o=this.ba+this.pn+s,this.pn=r,this.ba=o):this.pn=Math.max(this.pn,r),this.va=h+i+s,u[n]=new t.Rectangle(h,o,i,r);var a=this.ca;return this.la+='<g transform="translate('.concat(h*a,",").concat(o*a,')">').concat(e,"</g>"),!0}return!1},n.prototype.has=function(t){return t in this.fa},Object.defineProperty(n.prototype,"mappings",{get:function(){return this.build()},enumerable:!1,configurable:!0}),n.prototype.build=function(n){var i,r,e,u=this.da;if(null==u||(null==n?void 0:n.force)){var s=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1,h=this.kt,o=Math.pow(2,Math.ceil(Math.log(this.ba+this.pn)/Math.LN2)),a=h*s,c=o*s,f=this.ca,l='width="'.concat(a,'"'),v='height="'.concat(c,'"'),b='viewBox="0 0 '.concat(h*f," ").concat(o*f,'"'),d=_v("<svg ".concat(l," ").concat(v," ").concat(b," ").concat('xmlns="http://www.w3.org/2000/svg"',">").concat(this.la,"</svg>")),g=null!==(e=null==n?void 0:n.scaling)&&void 0!==e?e:t.SCALE_MODES.NEAREST,m=t.BaseTexture.from(d,{resolution:s,scaleMode:g}),w=this.fa;for(var p in u=this.da={},w)u[p]=new t.Texture(m,w[p])}return u},n}(),vb=function(){function n(){}return n.toTexture=function(n,i,r,e){var u=n.transform.scale,s=t.RenderTexture.create({width:n.width*u.x,height:n.height*u.y,scaleMode:t.SCALE_MODES.LINEAR,resolution:i}),h=new t.Matrix(void 0,void 0,void 0,void 0,-n.position.x,-n.position.y),o=st.getLayer(n);return o&&o.renderer.render(n,s,r,h,e),s},n.toPixels=function(t,n){var i=t.resolution,r=t.frame,e=Math.floor(r.width*i),u=Math.floor(r.height*i),s=new Uint8Array(4*e*u);n.renderTexture.bind(t);var h=n.gl;return h.readPixels(r.x*i,r.y*i,e,u,h.RGBA,h.UNSIGNED_BYTE,s),{width:e,height:u,array:s}},n.toCanvas=function(n,i,r){var e=n.width,u=n.height,s=n.array,h=new t.utils.CanvasRenderTarget(e,u,1),o=h.context.getImageData(0,0,e,u);if(r?o.data.set(s):t.Extract.arrayPostDivide(s,o.data),h.context.putImageData(o,0,0),null!=i&&1!==i){h.context.scale(i,i),h.context.drawImage(h.canvas,0,0);var a=Math.floor(e*i),c=Math.floor(u*i),f=h.context.getImageData(0,0,a,c);h.resize(a,c),h.context.putImageData(f,0,0)}return h},n.toBase64=function(t,n,i){return t.toDataURL(n,i)},n}(),bb=function(){function t(){}return t.downloadUrl=function(t,n){var i=document.createElement("a");"download"in i?(i.href=n,i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),66)):window.open(n)||(location.href=n)},t.download=function(t,n,i){var r=new Blob(!1!==i?["\ufeff",n]:[n],{type:"text/plain"}),e=window.navigator;"msSaveBlob"in e?e.msSaveBlob(r,t):this.downloadUrl(t,URL.createObjectURL(r))},t}(),db=function(){function t(){}return t.texture=function(t){var n,i=t.target,r=function(t){var n,i=t.target,r=t.resolution;if(null!=r){if(pt(r))return r;var e=i.transform.scale,u=Math.max(i.width*e.x,i.height*e.y);return Math.min(1,r.size/u)}return null!==(n=window.devicePixelRatio)&&void 0!==n?n:1}(t),e=null===(n=t.transform)||void 0===n?void 0:n.update;return vb.toTexture(i,r,t.clear,e)},t.pixels=function(t){var n=function(t){var n=t.renderer;if(n)return n;var i=t.application;if(i)return i.getLayerBase().renderer;var r=t.layer||st.getLayer(t.target);if(r)return r.renderer;throw new Error("No renderer / application / layer found.")}(t),i=this.texture(t);try{return vb.toPixels(i,n)}finally{i&&i.destroy()}},t.canvas=function(t){var n,i,r=this.pixels(t),e=null===(i=null===(n=t.alpha)||void 0===n?void 0:n.premultiplied)||void 0===i?void 0:i.ignore,u=function(t,n){var i=n.scale;if(null!=i){if(pt(i))return i;var r=i.size;return Math.min(1,r/t.width,r/t.height)}}(r,t);return vb.toCanvas(r,u,e)},t.base64=function(t){var n=this.canvas(t);try{return vb.toBase64(n.canvas,t.format,t.quality)}finally{n&&n.destroy()}},t.file=function(t){bb.downloadUrl(t.filename,this.base64(t))},t}(),gb={TEXT:0,DATA_URL:1,BINARY_STRING:2,ARRAY_BUTTER:3,FILE:4},mb=function(){function t(t,n){this.Ah=null,this.ga=t,this.ma=n}return t.prototype.open=function(){var t=this.getOrCreateInput();null!=t?t.click():this.onCancel()},t.prototype.getOrCreateInput=function(){var t=this;if("FileReader"in window&&null==this.Ah){var n=document.createElement("input");this.Ah=n,n.setAttribute("type","file"),n.setAttribute("style","display:none"),n.addEventListener("change",(function(i){t.onInputChange(n),n.value="",i.stopImmediatePropagation(),i.preventDefault()})),document.body.appendChild(n)}return this.Ah},t.prototype.onInputChange=function(t){var n=this,i=t.files;if(null!=i&&0<i.length){var r=i[0];if(this.ga===gb.FILE)this.onOpen(r,r);else{var e=new FileReader;switch(e.onload=function(t){if(null!=t.target){var i=t.target;n.onOpen(i.result,r)}},e.onabort=function(t){n.onAboart(t)},this.ga){case gb.TEXT:e.readAsText(r);break;case gb.DATA_URL:e.readAsDataURL(r);break;case gb.BINARY_STRING:e.readAsBinaryString(r);break;case gb.ARRAY_BUTTER:e.readAsArrayBuffer(r);break;default:e.readAsText(r)}}}else this.onCancel()},t.prototype.onOpen=function(t,n){var i=this.ma;i.emit("open",t,n,i)},t.prototype.onAboart=function(t){var n=this.ma;n.emit("abort",t,n)},t.prototype.onCancel=function(){var t=this.ma;t.emit("cancel",t)},t}(),wb=function(){function t(){}return t.fromRgb=function(t){var n=(16711680&t)>>16,i=(65280&t)>>8,r=255&t|0,e=Math.max(n,i,r),u=e-Math.min(n,i,r),s=0;return 0<u&&(n===e?s=60*(i-r)/u:i===e?s=60*(r-n)/u+120:r===e&&(s=60*(n-i)/u+240),s<0&&(s+=360)),[s,u/e*255,e]},t.toRgb=function(t,n,i){var r=i-n/255*i,e=i-r,u=0,s=0,h=0;return t<=60?(u=i,s=t/60*e+r,h=r):t<=120?(u=(120-t)/60*e+r,s=i,h=r):t<=180?(u=r,s=i,h=(t-120)/60*e+r):t<=240?(u=r,s=(240-t)/60*e+r,h=i):t<=300?(u=(t-240)/60*e+r,s=r,h=i):(u=i,s=r,h=(360-t)/60*e+r),(u=Math.max(0,Math.min(255,u)))<<16|(s=Math.max(0,Math.min(255,s)))<<8|Math.max(0,Math.min(255,h))},t}(),pb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.$u),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.$u),t.prototype.onElementDetached.call(this,n,i,r)},n.prototype.onInputKeyDown=function(t){nr.isOkKey(t)&&this.yu.onEnter()},n}(vu),Ob=function(){function t(){}return t.create=function(t){var n=this.Jt;return t in n?"".concat(t," ").concat(++n[t]):(n[t]=1,"".concat(t," 1"))},t.Jt={},t}(),Db=function(){function t(){}return t.toCode=function(t,n){var i=t>>8&255,r=255&t;return"rgba(".concat(t>>16&255,",").concat(i,",").concat(r,",").concat(n,")")},t}(),Eb=function(){function t(t,n,i){var r=this;this.wa=new Set,this.Rt=t,this.pa=n,this.Z=i,this.Oa=null,this.Da=function(){r.update()}}return t.prototype.start=function(){return null==this.Oa&&(this.Oa=window.setTimeout(this.Da,this.pa)),this},t.prototype.stop=function(){var t=this.Oa;return null!=t&&(this.Oa=null,clearTimeout(t)),this},t.prototype.add=function(t){return this.wa.add(t),t.state.set(this.Rt,this.isOn(Date.now())),this},t.prototype.remove=function(t){return!!this.wa.delete(t)&&(t.state.remove(this.Rt),!0)},t.prototype.contains=function(t){return this.wa.has(t)},t.prototype.clear=function(){return this.wa.clear(),this},t.prototype.isOn=function(t){return Math.floor(t/this.Z)%2==0},t.prototype.update=function(){var t=Date.now(),n=this.isOn(t),i=this.Rt;this.wa.forEach((function(t){t.state.set(i,n)}));var r=this.Z;return this.Oa=window.setTimeout(this.Da,r-t%r),this},t}(),Mb=function(){function t(t){var n;this.hi=null!==(n=null==t?void 0:t.duration)&&void 0!==n?n:300,this.au=null,this.Ea=0,this.Ma=null}return t.prototype.show=function(t,n){var i=this,r=this.Ma;null!=r&&clearTimeout(r);var e=this.au;if(t!==e){var u=this.hi,s=this.Ea,h=Date.now(),o=s+u-h;!0===n||o<=0?this.update(h,t):this.Ma=window.setTimeout((function(){i.update(Date.now(),t)}),o)}},t.prototype.update=function(t,n){var i=this.au;i!==n&&(this.Ea=t,null!=i&&i.hide(),this.au=n,null!=n&&n.show())},t.prototype.hide=function(){this.show(null)},t}(),Sb=function(){function t(){this.Sa=null,this.ja=0,this.Vs=null,this.Ta=null}return t.prototype.getNames=function(){var t=this.Na;return null==t&&(t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DOMMouseScroll","MozMousePixelScroll"],this.Na=t),t},t.prototype.on=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.addEventListener(u,n,i)}},t.prototype.off=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.removeEventListener(u,n,i)}},t.prototype.getLineHeight=function(){if(null==this.Vs){var t=Z.getInstance().get("DBase");this.Vs=t.getLineHeight()}return this.Vs},t.prototype.getPageHeight=function(){return null==this.Ta&&(this.Ta=12*this.getLineHeight()),this.Ta},t.prototype.normalize=function(t){var n=0,i=0;if("detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(n=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(n=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(n=t.deltaX),0===i&&0===n)return null;var r=Math.max(Math.abs(i),Math.abs(n)),e=Date.now();this.ja+200<=e&&(this.Sa=null),this.ja=e;var u="mousewheel"===t.type&&r%120==0;(!this.Sa||r<this.Sa)&&(this.Sa=r,u&&(this.Sa/=40)),u&&(r/=40,n/=40,i/=40);var s=this.Sa;r=Math.floor(r/s),n=Math[1<=n?"floor":"ceil"](n/s),i=Math[1<=i?"floor":"ceil"](i/s);var h=t.deltaMode||0;if(0!==h){var o=1===h?this.getLineHeight():this.getPageHeight();r*=o,n*=o,i*=o}return{mode:h,delta:r,deltaX:n,deltaY:i,lowest:s}},t.getInstance=function(){return null==this.INSTANCE&&(this.INSTANCE=new t),this.INSTANCE},t}(),jb=function(t){function n(n){var i,r=this;return(r=t.call(this)||this).ei=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,r.ai=!1,r.Fu=!1,r.ci=null==n?void 0:n.onTime,r.li=null==n?void 0:n.onStart,r.vi=null==n?void 0:n.onEnd,r}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.ei},set:function(t){this.ei=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.Fu=!0,this.ai=t,this.onStart(t),this.Fu&&(this.onTime(t?1:0,t,0),this.Fu&&(this.onTime(t?0:1,t,0),this.Fu||this.onEnd(t)))},n.prototype.onStart=function(t){var n=this.li;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ci;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.vi;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return this.Fu},n.prototype.isReverse=function(){return this.ai},n.prototype.stop=function(){this.Fu=!1},n.prototype.end=function(){if(this.Fu){this.Fu=!1;var t=this.ai,n=t?0:1;this.onTime(n,t,0),this.onEnd(t)}},n}(t.utils.EventEmitter),Tb=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Ia=0,e.Ca=0,e.Aa=0,e.Ra=0,e.ka=null,e.bs=null;var u=null==n?void 0:n.shift;return e.La=null!==(i=null==u?void 0:u.x)&&void 0!==i?i:0,e.ya=null!==(r=null==u?void 0:u.y)&&void 0!==r?r:15,e.ws=function(){e.onPrerender()},e.xa=function(){e.onPostrender()},e}return _(n,t),n.prototype.stop=function(){this.Ra=0,this.removeEventListeners(),t.prototype.stop.call(this)},n.prototype.addEventListeners=function(t){var n=st.getLayer(t);if(n){this.bs=n;var i=n.renderer;i.on("prerender",this.ws),i.on("postrender",this.xa)}},n.prototype.removeEventListeners=function(){var t=this.bs;if(t){this.bs=null;var n=t.renderer;n.off("prerender",this.ws),n.off("postrender",this.xa)}},n.prototype.onStart=function(n){var i=this.ka=this.ei;null!=i&&(this.Ra=0,this.removeEventListeners(),this.addEventListeners(i),n||(i.visible=!0),t.prototype.onStart.call(this,n))},n.prototype.onTime=function(n,i,r){if(null!=this.ka){var e=this.bs;e?(this.Ra=n,t.prototype.onTime.call(this,n,i,r),e.update()):(this.Ra=n,t.prototype.onTime.call(this,n,i,r))}},n.prototype.onEnd=function(n){var i=this.ka;null!=i&&(this.removeEventListeners(),n&&(i.visible=!1),t.prototype.onEnd.call(this,n))},n.prototype.onPrerender=function(){var t=this.ka;if(null!=t){var n=this.Ra,i=t.unsafe.position;this.Ia=i.x,this.Ca=i.y,i.set(i.x-this.La*(1-n),i.y-this.ya*(1-n)),this.Aa=t.alpha,t.alpha=n}},n.prototype.onPostrender=function(){var t=this.ka;null!=t&&(t.unsafe.position.set(this.Ia,this.Ca),t.alpha=this.Aa)},n}(br),Nb=function(){function t(t){var n,i,r,e;pt(t)?(this.top=t,this.right=t,this.bottom=t,this.left=t):null!=t?(this.top=null!==(n=t.top)&&void 0!==n?n:6,this.right=null!==(i=t.right)&&void 0!==i?i:6,this.bottom=null!==(r=t.bottom)&&void 0!==r?r:6,this.left=null!==(e=t.left)&&void 0!==e?e:6):(this.top=6,this.right=6,this.bottom=6,this.left=6)}return t.prototype.getTheme=function(){throw new Error("Not supported")},t.prototype.setTheme=function(t){throw new Error("Not supported")},t.prototype.getTop=function(){return this.left},t.prototype.getRight=function(){return this.right},t.prototype.getBottom=function(){return this.bottom},t.prototype.getLeft=function(){return this.left},t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r)},t}(),Ib=function(){function t(t){var n,i=t.root;this.Ba=i,this.Ds=t.overlay,this.Qn=new Nb(null==t?void 0:t.padding);var r=100,e=100;if(t)if(null!=t.width)r=t.width,e=null!=t.height?t.height:i.getBoundingClientRect().height;else if(null!=t.height)r=i.getBoundingClientRect().width,e=t.height;else{var u;r=(u=i.getBoundingClientRect()).width,e=u.height}else r=(u=i.getBoundingClientRect()).width,e=u.height;var s=null==t?void 0:t.background,h=0,o=!0;if(null!=s){var a=s.color;null!=a&&(h=a,o=!1)}var c=t.resolution,f=null!==(n=null==t?void 0:t.antialias)&&void 0!==n&&n;this.Pa={width:r,height:e,autoStart:!1,backgroundColor:h,transparent:o,resolution:c,antialias:f}}return t.prototype.getRootElement=function(){return this.Ba},t.prototype.setRootElement=function(t,n){if(this.Ba!==t&&(this.Ba=t,!1!==n)){var i=t.getBoundingClientRect(),r=this.Pa;r.width=i.width,r.height=i.height}return this},t.prototype.getWidth=function(){return this.Pa.width},t.prototype.setWidth=function(t){return this.Pa.width=t,this},t.prototype.getHeight=function(){return this.Pa.height},t.prototype.setHeight=function(t){return this.Pa.height=t,this},t.prototype.getPadding=function(){return this.Qn},t.prototype.setPadding=function(t,n,i,r){var e=this.Qn;return e.left=t,e.top=n,e.right=i,e.bottom=r,this},t.prototype.getBackgroundColor=function(){return this.Pa.backgroundColor},t.prototype.setBackgroundColor=function(t){return this.Pa.backgroundColor=t,this},t.prototype.getAntialias=function(){return this.Pa.antialias},t.prototype.setAntialias=function(t){return this.Pa.antialias=t,this},t.prototype.isOverlay=function(){return this.Ds},t.prototype.getPixiApplicationOptions=function(){return this.Pa},t}(),Cb=function(){function t(){}return t.prototype.isStorable=function(){return!0},t.prototype.isClear=function(){return!1},t.prototype.isClean=function(){return!1},t.prototype.execute=function(){return!0},t.prototype.merge=function(t){return!1},t.prototype.isMerged=function(){return!1},t.prototype.redo=function(){return!0},t.prototype.undo=function(){return!0},t.prototype.destroy=function(){},t}(),Ab=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(Cb),Rb=function(t){function n(){var n=t.call(this)||this;return n._=0,n.Fa=[],n}return _(n,t),n.prototype.last=function(){var t=this.Fa,n=t.length;return 0<n?t[n-1]:null},n.prototype.push=function(t){this.merge(t),this.execute(t)},n.prototype.merge=function(t){var n=this.Fa,i=t.isClear(),r=t.isStorable();if(i||r){var e=i?n.length:this._;0<e&&(this.remove(e),this._=0,this.emit("change",this)),this.cleanup()}var u=n.length;0<u&&t.merge(n[u-1])},n.prototype.execute=function(t){return this.emit("executing",t,this),t.execute()?this.onSuccess(t):this.onFail(t)},n.prototype.onSuccess=function(t){t.isStorable()&&(t.isMerged()||this.Fa.push(t),t.isClean()||this.emit("dirty",this)),this.emit("change",this),this.emit("executed",t,this)},n.prototype.onFail=function(t){t.destroy(),this.emit("change",this)},n.prototype.cleanup=function(){var t=this.Fa,n=t.length-100;if(0<n)for(var i=0;i<n;++i)t[i].destroy(),t.shift()},n.prototype.remove=function(t){var n=this.Fa;if(0<t){var i=Math.max(0,n.length-t);if(0<(t=n.length-i)){for(var r=i,e=n.length;r<e;++r)n[r].destroy();return n.splice(i,n.length-i),!0}}return!1},n.prototype.size=function(){return this.Fa.length},n.prototype.clear=function(){this.push(new Ab)},n.prototype.redo=function(){this.isRedoable()&&this.doRedo()},n.prototype.doRedo=function(){var t=this.Fa;if(0<this._){var n=t[t.length-this._];this._-=1,this.emit("change",this),this.emit("redoing",n,this),!0===n.redo()?this.onRedoSuccess(n):this.onRedoFail(n)}},n.prototype.onRedoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("redoed",t,this)},n.prototype.onRedoFail=function(t){this.emit("change",this)},n.prototype.isRedoable=function(){return 0<this._},n.prototype.undo=function(){this.isUndoable()&&this.doUndo()},n.prototype.doUndo=function(){var t=this.Fa;if(this._<t.length){var n=t[t.length-1-this._];this._+=1,this.emit("change",this),this.emit("undoing",n,this),!0===n.undo()?this.onUndoSuccess(n):this.onUndoFail(n)}},n.prototype.onUndoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("undoed",t,this)},n.prototype.onUndoFail=function(t){this.emit("change",this)},n.prototype.isUndoable=function(){return this._<this.Fa.length},n}(t.utils.EventEmitter),kb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t,n,i){var r=this;t.addEventListener("keydown",(function(t){r.emit("keydown",t);var e=i.get();if(null!=e)for(var u=e;null!=u;){if(r.hasOnKeyDown(u)&&u.onKeyDown(t))return;u=u.parent}if(nr.isFocusKey(t)){var s=nr.getFocusDirection(t),h=null!=e?i.find(e,!1,e.state.isFocusRoot||s,s):i.find(n,!1,!0,s);null!=h&&(i.focus(h),t.preventDefault(),t.stopImmediatePropagation())}})),t.addEventListener("keyup",(function(t){r.emit("keyup",t);var n=i.get();if(null!=n)for(var e=n;null!=e;){if(r.hasOnKeyUp(e)&&e.onKeyUp(t))return;e=e.parent}}))},n.prototype.hasOnKeyDown=function(t){return"onKeyDown"in t},n.prototype.hasOnKeyUp=function(t){return"onKeyUp"in t},n}(t.utils.EventEmitter),Lb=function(){function t(){}return t.getKeyboardController=function(){return null==this.KEYBOARD&&(this.KEYBOARD=new kb),this.KEYBOARD},t.setKeyboardController=function(t){var n=this.KEYBOARD;return this.KEYBOARD=t,n},t.getCommandController=function(){return null==this.COMMAND&&(this.COMMAND=new Rb),this.COMMAND},t.setCommandController=function(t){var n=this.COMMAND;return this.COMMAND=t,n},t.getDocumentController=function(){if(null==this.DOCUMENT)throw new Error("Not supported");return this.DOCUMENT},t.setDocumentController=function(t){var n=this.DOCUMENT;return this.DOCUMENT=t,n},t}(),yb=function(n){function i(t,i){var r=n.call(this,i.getPixiApplicationOptions())||this;return r.Ua=null,r.Ga=null,r.zn=i,r.st=!1,r.Xo=!0,r.Ha=i.isOverlay(),r.Qn=i.getPadding(),r.za=i.getRootElement(),r.Va=5,r.Wa=r.newElementContainer(),r.application=t,r.Xa=function(){null!=r.Ua&&r.render()},r.initStage(),r.initView(),r.initRootElement(),r.initFocusHandling(),r.initResizeHandling(),r.initWheelHandling(),r.initDoubleClickHandling(),r}return _(i,n),i.prototype.newElementContainer=function(){var t=document.createElement("div");return t.setAttribute("style","position: absolute; top: 0; left: 0; width: 0; height: 0;margin: 0; padding: 0; outline: none;"),t},i.prototype.initStage=function(){var t=this.stage;t.layer=this,t.application=this.application,t.interactive=!0},i.prototype.initView=function(){var t=this.view.style;t.position="absolute",t.top="0",t.left="0",t.width="100%",t.height="100%",t.display="block",t.outline="none",t.webkitTapHighlightColor="rgba(255,255,255,0)",t.webkitUserSelect="none",t.setProperty("-khtml-user-select","none"),t.setProperty("-moz-user-select","none"),t.setProperty("-ms-user-select","none"),t.userSelect="none"},i.prototype.initRootElement=function(){var t=this,n=this.view,i=this.Ha,r=this.za,e=this.Wa,u=i?2:0,s=r.children;if(u<s.length){var h=s[u];r.insertBefore(n,h),r.insertBefore(e,h)}else r.appendChild(n),r.appendChild(e);if(i){var o=this.stage,a=o.onChildrenChange;o.onChildrenChange=function(){t.onStageDirty(),a.call(o)}}var c=r.style;r!==document.body&&"static"===window.getComputedStyle(r).position&&(c.position="relative"),c.margin="0",c.padding="0",c.overflow="hidden"},i.prototype.initFocusHandling=function(){var t=this.view,n=this.stage,i=this.getFocusController();t.setAttribute("tabindex","0"),Lb.getKeyboardController().init(t,n,i),this.renderer.plugins.interaction.on(ir.down,(function(t){null!=t.target&&t.target!==n||i.clear()}))},i.prototype.initResizeHandling=function(){var t=this,n=function(){t.onResize()};window.addEventListener("resize",n),window.addEventListener("orientationchange",n)},i.prototype.onResize=function(){var t=this.za.getBoundingClientRect(),n=t.width,i=t.height;this.renderer.resize(n,i);for(var r=this.Qn,e=this.stage.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof hr&&h.onParentResize(n,i,r)}this.update()},i.prototype.initWheelHandling=function(){var n=new t.Point,i=Sb.getInstance(),r=this.renderer.plugins.interaction;i.on(this.view,(function(t){var e=t;ir.toGlobal(e,r,n);var u,s=r.hitTest(n),h=i.normalize(t);if(null!=h)for(;null!=s;){if(null!=(u=s)&&null!=u.onWheel&&s.onWheel(e,h,n)){e.preventDefault();break}s=s.parent}}))},i.prototype.initDoubleClickHandling=function(){var t=this.getFocusController(),n=this.renderer.plugins.interaction;ir.onDblClick(this.view,(function(i){var r,e=t.get();if(null!=e)for(var u=e;null!=u&&(null==(r=u)||null==r.onDblClick||!u.onDblClick(i,n));)u=u.parent}))},i.prototype.lock=function(){this.st=!0},i.prototype.unlock=function(){this.st=!1},i.prototype.update=function(){this.st||null!=this.Ua||(this.Ua=requestAnimationFrame(this.Xa))},i.prototype.onStageDirty=function(){this.Ha&&(0<this.stage.children.length?this.Xo||(this.Xo=!0,this.view.style.display="block"):this.Xo&&(this.Xo=!1,this.view.style.display="none"))},i.prototype.render=function(){this.reflow(),this.Ua=null,n.prototype.render.call(this)},Object.defineProperty(i.prototype,"width",{get:function(){return this.screen.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.screen.height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Qn},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){for(var t=this.stage.children,n=0,i=this.Va;n<i;++n){for(var r=!1,e=0,u=t.length;e<u;++e){var s=t[e];s instanceof hr&&(s.reflow(),r=r||s.isDirty()||s.hasDirty()||s.isHierarchyDirty())}if(!r)break}},i.prototype.getFocusController=function(){return this.application.getFocusController()},i.prototype.getRootElement=function(){return this.za},i.prototype.getElementContainer=function(){return this.Wa},i.prototype.getDynamicFontAtlases=function(){return null==this.Ga&&(this.Ga=new ub(this)),this.Ga},i}(t.Application),xb=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.Es=null,n}return _(n,t),n.prototype.focus=function(t){var n=this.Es;return n!==t?(null!=n&&(n.state.isFocused=!1),this.Es=t,this.isFocusable(t)&&(t.state.isFocused=!0),this.emit("change",t,n,this),n):null},n.prototype.blur=function(t){return null!=t&&this.Es===t?(this.Es=null,t.state.isFocused=!1,this.emit("change",null,t,this),t):null},n.prototype.clear=function(){return this.focus(null)},n.prototype.set=function(t,n){return n?this.focus(t):this.blur(t)},n.prototype.get=function(){return this.Es},n.prototype.findParent=function(t){for(var n=t;null!=n;){if(this.isFocusable(n))return n;n=n.parent}return null},n.prototype.find=function(t,n,i,r,e){if(r){if(null!=(o=this.findNext(t,n,i)))return o;if(this.isFocusRoot(t,e))return null;var u=t.parent;if(null!=u&&0<=(c=(a=u.children).indexOf(t))){var s=a.length;if(this.isFocusReverse(u)){for(var h=c-1;0<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=s-1;c<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}else{for(h=c+1;h<s;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}}}else{var o;if(null!=(o=this.findPrevious(t,n,i)))return o;var a,c,f=t.parent;if(null!=f&&0<=(c=(a=f.children).indexOf(t)))if(s=a.length,this.isFocusReverse(f)){for(h=c+1;h<s;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}else{for(h=c-1;0<=h;--h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=s-1;c<=h;--h){var l;if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}}}return null},n.prototype.findNext=function(t,n,i){if(n&&this.isFocusable(t))return t;if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=e-1;0<=u;--u)if(null!=(s=this.findNext(r[u],!0,!0)))return s}else for(u=0;u<e;++u){var s;if(null!=(s=this.findNext(r[u],!0,!0)))return s}}return null},n.prototype.findPrevious=function(t,n,i){if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=0;u<e;++u)if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}else for(u=e-1;0<=u;--u){var s;if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}}return n&&this.isFocusable(t)?t:null},n.prototype.isFocusable=function(t){return null!=t&&"state"in t&&t.state.inEnabled&&t.state.isFocusable&&t.visible},n.prototype.isFocusableContainer=function(t){return null!=t&&"children"in t},n.prototype.isFocusRoot=function(t,n){return t===n||null!=t&&"state"in t&&t.state.isFocusRoot&&t.visible},n.prototype.isFocusReverse=function(t){return null!=t&&"state"in t&&t.state.isFocusReverse},n}(t.utils.EventEmitter),Bb=function(){function n(n){var i,r;st.add(this);var e=this.toRootElement(n);this.Ba=e,this.initFocusHandling(e);var u=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1;this.Mn=u,delete t.Renderer.__plugins.accessibility,this.zn=n;var s=this.newLayerBase(n);this.Pr=s,this.Ka=!!(null==n?void 0:n.overlay),this.Ka||(this.Ds=s)}return Object.defineProperty(n.prototype,"stage",{get:function(){return this.Pr.stage},enumerable:!1,configurable:!0}),n.prototype.getRootElement=function(){return this.Ba},n.prototype.getResolution=function(){return this.Mn},n.prototype.toRootElement=function(t){var n=null==t?void 0:t.root;if(null!=n){if(!Ot(n))return n;var i=document.querySelector(n);if(i)return i}return document.body},n.prototype.toLayerBaseOptions=function(t){var n=this.Ba,i=this.Mn;return new Ib(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:t.background,resolution:i,antialias:t.antialias,overlay:!1}:{root:n,resolution:i,overlay:!1})},n.prototype.getFocusController=function(){return null==this.Ya&&(this.Ya=new xb),this.Ya},n.prototype.initFocusHandling=function(t){var n=this,i=!1,r=function(){i||n.getFocusController().clear()};t.addEventListener("focus",(function(){i=!0}),!0),t.addEventListener("blur",(function(){i=!1,setTimeout(r,0)}),!0)},n.prototype.newLayerBase=function(t){return new yb(this,this.toLayerBaseOptions(t))},n.prototype.getLayerBase=function(){return this.Pr},n.prototype.toLayerOverlayOptions=function(t){var n=this.Ba,i=this.Mn;return new Ib(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:{color:null},resolution:i,antialias:t.antialias,overlay:!0}:{root:n,resolution:i,overlay:!0})},n.prototype.newLayerOverlay=function(t){return new yb(this,this.toLayerOverlayOptions(t))},n.prototype.getLayerOverlay=function(){return this.Ka?(null==this.Ds&&(this.Ds=this.newLayerOverlay(this.zn)),this.Ds):this.Pr},n.prototype.update=function(){if(!this.Ka)return this.Pr.update();this.Pr.update();var t=this.Ds;t&&t.update()},n.prototype.render=function(){if(!this.Ka)return this.Pr.render();this.Pr.render();var t=this.Ds;t&&t.render()},n}(),_b=function(){function t(t){this.ei=t,this.dn=0,this.gn=0,this.mn=0,this.bn=0,t instanceof Bi&&(this.fn=t.getCallback())}return t.prototype.getTheme=function(){return this.ei.getTheme()},t.prototype.setTheme=function(t){this.ei.setTheme(t)},t.prototype.getLeft=function(){return this.ei.getLeft()+this.bn},t.prototype.adjLeft=function(t){if(this.bn!==t){this.bn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"left",{get:function(){return this.ei.left},set:function(t){this.ei.left=t},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){return this.ei.getTop()+this.dn},t.prototype.adjTop=function(t){if(this.dn!==t){this.dn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"top",{get:function(){return this.ei.top},set:function(t){this.ei.top=t},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){return this.ei.getRight()+this.gn},t.prototype.adjRight=function(t){if(this.gn!==t){this.gn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"right",{get:function(){return this.ei.right},set:function(t){this.ei.right=t},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){return this.ei.getBottom()+this.mn},t.prototype.adjBottom=function(t){if(this.mn!==t){this.mn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.ei.bottom},set:function(t){this.ei.bottom=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){var e=this.ei;null==n?e.set(t):null==i?e.set(t,n):null==r?e.set(t,n,i):e.set(t,n,i,r)},t}(),Pb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DBoard"},n}(hr),Fb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheck"},n}(js),Ub=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheckRight"},n}(Fb),Gb=function(){function t(t,n,i,r,e){this.S=t,this.j=n,this._=i,this.fn=e,this.Ja=r}return t.prototype.set=function(t,n,i,r){this.S===t&&this.j===n&&this._===i&&this.Ja===r||(this.S=t,this.j=n,this._=i,this.Ja=r,this.fn(this))},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.fn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.fn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._},set:function(t){this._!==t&&(this._=t,this.fn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this.Ja},set:function(t){this.Ja!==t&&(this.Ja=t,this.fn(this))},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){return{color:this.S,alpha:this.j,position:this._}},t}(),Hb=function(t,n){return t.position-n.position},zb=function(n){function i(){var t=n.call(this)||this,i=function(n){t.onChange(n)};t.Za=i;var r=new Gb(16777215,1,0,!1,i),e=new Gb(8421504,1,1,!0,i);return t.Tt=[r,e],t.rn=-90,t.Ja=e,t.qa=[0,0,0],t}return _(i,n),i.prototype.onChange=function(t){var n=t.selected&&this.Ja!==t;if(n){var i=this.Ja;null!=i&&(i.Ja=!1),this.Ja=t}this.Tt.sort(Hb),n&&this.emit("selectionchange",this.Ja,this),this.emit("change",this)},Object.defineProperty(i.prototype,"points",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"direction",{get:function(){return this.rn},set:function(t){this.rn!==t&&(this.rn=t,this.emit("directionchange",t,this),this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selected",{get:function(){return this.Ja},enumerable:!1,configurable:!0}),i.prototype.size=function(){return this.Tt.length},i.prototype.get=function(t){var n=this.Tt;return 0<=t&&t<n.length?n[t]:null},i.prototype.addAt=function(n){for(var i=this.Tt,r=null,e=0,u=i.length;e<u;++e){var s=i[e];if(n<=s.position){if(null==r)return this.add(s.color,s.alpha,n,!0);var h=s.position-r.position;if(.001<h){var o=t.utils.hex2rgb(s.color,this.qa),a=o[0],c=o[1],f=o[2],l=t.utils.hex2rgb(r.color,this.qa),v=l[0],b=l[1],d=l[2],g=(n-r.position)/h,m=a*g+v*(1-g),w=c*g+b*(1-g),p=f*g+d*(1-g),O=this.qa;O[0]=m,O[1]=w,O[2]=p;var D=t.utils.rgb2hex(O),E=s.alpha*g+r.alpha*(1-g);return this.add(D,E,n,!0)}}r=s}return null!=r?this.add(r.color,r.alpha,n,!0):this.add(16777215,1,n,!0)},i.prototype.add=function(t,n,i,r){var e=this.Za,u=new Gb(t,n,i,r,e);return this.Tt.push(u),e(u),u},i.prototype.remove=function(t){var n=this.Tt;if(2<n.length)for(var i=0,r=n.length;i<r;++i)if(n[i]===t){n.splice(i,1);var e=this.Ja===t;return e&&(this.Ja=i+1<r?n[i]:n[i-1]),e&&this.emit("selectionchange",this.Ja,this),this.emit("change",this),!0}return!1},i.prototype.reset=function(){var t=this.rn;this.rn=-90;var n=this.Tt,i=this.Ja,r=i?n.indexOf(i):-1;n.length=0;var e=this.Za;if(n.push(new Gb(16777215,0,0,!1,e)),n.push(new Gb(16777215,0,1,!1,e)),0<=r&&r<n.length)(u=n[r]).Ja=!0,this.Ja=u;else if(0<n.length){var u;(u=n[n.length-1]).Ja=!0,this.Ja=u}else this.Ja=null;return i!==this.Ja&&this.emit("selectionchange",this.Ja,this),t!==this.rn&&this.emit("directionchange",this.rn,this),this.emit("change",this),this},i.prototype.toObject=function(){for(var t=[],n=this.Tt,i=0,r=n.length;i<r;++i)t.push(n[i].toObject());return{points:t,direction:this.rn}},i.prototype.fromObject=function(t){var n=this.rn;this.rn=t.direction;var i=this.Tt,r=this.Ja,e=r?i.indexOf(r):-1;i.length=0;for(var u=this.Za,s=0,h=t.points.length;s<h;++s){var o=t.points[s],a=new Gb(o.color,o.alpha,o.position,!1,u);i.push(a)}return i.sort(Hb),0<=e&&e<i.length?((a=i[e]).Ja=!0,this.Ja=a):0<i.length?((a=i[i.length-1]).Ja=!0,this.Ja=a):this.Ja=null,r!==this.Ja&&this.emit("selectionchange",this.Ja,this),n!==this.rn&&this.emit("directionchange",this.rn,this),this.emit("change",this),this},i}(t.utils.EventEmitter),Vb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputLabel"},n}(hh),Wb=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.Yh=new Vb(null==n?void 0:n.label)),i.addChild(i.Ah=i.createInput(null==n?void 0:n.input));var r=null==n?void 0:n.space;return null!=r&&i.addChild(new Xu(r)),i}return _(n,t),Object.defineProperty(n.prototype,"input",{get:function(){return this.Ah},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"label",{get:function(){return this.Yh},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputAndLabel"},n}(Is),Xb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new Zs(t)},n}(Wb),Kb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new $s(t)},n}(Wb),Yb=function(){function t(t,n,i){this.Qa=t,this.$a=n,this.tc=i}return Object.defineProperty(t.prototype,"color",{get:function(){return this.Qa.color},set:function(t){if(this.Qa.color!==t){var n=this.$a;null!=n&&n(t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.Qa.alpha},set:function(t){if(this.Qa.alpha!==t){var n=this.tc;null!=n&&n(t)}},enumerable:!1,configurable:!0}),t}(),Jb=function(t){function n(n,i){var r=t.call(this)||this;return r.nc=n,r.Ht=i,r}return _(n,t),n.prototype.get=function(t){var n=this.nc;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.nc;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]={color:n.color,alpha:n.alpha},this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.nc,i=0,r=n.length;i<r;++i){var e=n[i];if(e.color===t.color&&e.alpha===t.alpha)return!0}return!1},n.prototype.add=function(t){var n=this.nc;return n.push({color:t.color,alpha:t.alpha}),this.Ht<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.nc.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.nc.length},n}(t.utils.EventEmitter),Zb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),Object.defineProperty(i.prototype,"current",{get:function(){return this.ic},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"new",{get:function(){return this.rc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.ec},enumerable:!1,configurable:!0}),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r),this.Pr=16711680,this.uc={color:16777215,alpha:1},this.rc=new Yb(this.uc,(function(t){e.setColorNew(t)}),(function(t){e.setAlphaNew(t)})),this.au={color:16777215,alpha:1},this.ic=new Yb(this.au,(function(t){e.setColorCurrent(t)}),(function(t){e.setAlphaCurrent(t)}));var u=this.theme,s=this.Qn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.sc=new t.Point;var f=u.getMainWidth(),l=u.getMainHeight(),v=new t.Sprite(t.Texture.WHITE);this.hc=v,v.x=c,v.y=h,v.width=f,v.height=l,v.interactive=!0,this.addChild(v);var b=new t.Sprite(u.getMainTexture());this.oc=b,b.x=c,b.y=h,b.tint=this.Pr,b.interactive=!1,this.addChild(b),this.ac=function(t){e.onMainMove(t)},this.cc=function(t){e.onMainUp(t)},v.on(ir.down,(function(t){e.onMainDown(t)}));var d=new t.Sprite(u.getBaseTexture());this.fc=d,d.x=c,d.y=v.y+v.height+u.getBaseMargin(),d.interactive=!0,this.addChild(d),this.lc=function(t){e.onBaseMove(t)},this.vc=function(t){e.onBaseUp(t)},d.on(ir.down,(function(t){e.onBaseDown(t)}));var g=new t.Sprite(u.getAlphaCheckerboardTexture());this.bc=g,g.x=s.getLeft(),g.y=d.y+u.getBaseHeight()+u.getBaseMargin(),g.interactive=!1,this.addChild(g);var m=new t.Sprite(u.getAlphaTexture());m.tint=this.uc.color,m.interactive=!0,g.addChild(m),this.dc=function(t){e.onAlphaMove(t)},this.gc=function(t){e.onAlphaUp(t)},m.on(ir.down,(function(t){e.onAlphaDown(t)}));var w=new t.Sprite(u.getMainPointerTexture());this.mc=w,w.x=c,w.y=h,w.anchor.x=.5,w.anchor.y=.5,w.tint=u.getMainPointerColor(),w.alpha=u.getMainPointerAlpha(),w.interactive=!1,this.addChild(w);var p=new t.Sprite(u.getAlphaPointerTexture());this.wc=p,p.x=f,p.y=.5*g.height,p.tint=u.getAlphaPointerColor(),p.alpha=u.getAlphaPointerAlpha(),p.anchor.set(.5,.5),p.interactive=!1,g.addChild(p);var O=new t.Sprite(u.getBasePointerTexture());this.Oc=O,O.x=0,O.y=.5*d.height,O.tint=u.getBasePointerColor(),O.alpha=u.getBasePointerAlpha(),O.anchor.set(.5,.5),O.interactive=!1,d.addChild(O),this.Dc=[];var D=this.Dc,E=u.getRecentColorCount(),M=u.getRecentColorWidth(),S=u.getRecentColorHeight(),j=.5*M,T=.5*S,N=u.getRecentColorMargin(),I=g.y+u.getAlphaHeight()+u.getRecentMargin(),C=u.getRecentCheckerboardTexture();null==i.RECENT_COLORS&&(i.RECENT_COLORS=new Jb(u.getRecents().slice(0),E));var A=this.ec=i.RECENT_COLORS;A.on("change",(function(){e.onRecentChange()}));for(var R=function(n){var i=n.currentTarget;if(i instanceof t.Container){var r=i.children[0];r instanceof t.Sprite&&(e.setColorNew(r.tint),e.setAlphaNew(r.alpha))}},k=0;k<E;++k){var L=c+k*(M+N),y=new t.Sprite(C);y.x=L+j,y.y=I+T,y.anchor.x=.5,y.anchor.y=.5,y.buttonMode=!0,y.interactive=!0,y.on(ir.tap,R),this.addChild(y);var x=new t.Sprite(t.Texture.WHITE),B=A.get(k);null!=B?(x.tint=B.color,x.alpha=B.alpha):(x.tint=16777215,x.alpha=0),x.width=M,x.height=S,x.anchor.x=.5,x.anchor.y=.5,x.interactive=!1,y.addChild(x),D.push(x)}var _=u.getInputMargin(),P=u.getInputLabelWidth(),F=I+S+_,U=.5*(f-_),G=new Kb({parent:this,x:c,y:F,width:U,label:{width:P,text:{value:"#"},interactive:yi.NONE},input:{weight:1,text:{value:"FFFFFF"},on:{input:function(t){var n=an.fromCode(t);null!=n&&e.setColorNew(n)}}}});this.Ec=G;var H=G.height,z=new Xb({parent:this,x:c,y:F+H+_,width:U,label:{width:P,text:{value:"A"},interactive:yi.NONE},input:{weight:1,text:{value:1},min:0,max:1,on:{input:function(t){e.setAlphaNew(t)}}}});this.Mc=z;var V=.5*(U-P-_),W=H+_+H,X=c+.5*(f-_)+_,K=F+.5*(H+_+z.height-W),Y=new t.Sprite(u.getSampleCheckerboardTexture());this.Sc=Y,Y.x=X,Y.y=K,Y.width=V,Y.height=W,Y.interactive=!1,this.addChild(Y);var J=this.au,Z=new t.Sprite(t.Texture.WHITE);this.jc=Z,Z.x=X,Z.y=K,Z.tint=J.color,Z.alpha=J.alpha,Z.width=V,Z.height=W,Z.interactive=!0,Z.buttonMode=!0,Z.on(ir.tap,(function(){e.setColorNew(J.color),e.setAlphaNew(J.alpha)})),this.addChild(Z);var q=new t.Sprite(u.getSampleCheckerboardTexture());this.Tc=q,q.x=X+V,q.y=K,q.width=V,q.height=W,q.interactive=!1,this.addChild(q);var Q=new t.Sprite(t.Texture.WHITE);this.Nc=Q,Q.x=X+V,Q.y=K,Q.tint=this.uc.color,Q.alpha=this.uc.alpha,Q.width=V,Q.height=W,Q.interactive=!1,this.addChild(Q),null!=r&&null!=r.width||(this.width=c+f+o),null!=r&&null!=r.height||(this.height=F+G.height+_+z.height+a)},i.prototype.onMainDown=function(t){this.onMainPick(t.data.global);var n=st.getLayer(this);if(n){var i=n.stage;i.on(ir.move,this.ac),i.on(ir.up,this.cc)}},i.prototype.onMainMove=function(t){this.onMainPick(t.data.global)},i.prototype.onMainUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.ac),i.off(ir.up,this.cc)}},i.prototype.toMainHex=function(t,n,i,r){return Math.max(0,Math.min(255,255*n+i*(t>>r&255)))<<r},i.prototype.toMainColor=function(t,n,i,r,e){var u=.5*r,s=Math.max(0,Math.min(1,((n-u)*(1-i/e)+u)/r)),h=Math.max(0,Math.min(1,i/e)),o=Math.abs(.5*h-s),a=1-o-h;return this.toMainHex(t,a,o,16)|this.toMainHex(t,a,o,8)|this.toMainHex(t,a,o,0)},i.prototype.onMainPick=function(t){var n=this.sc,i=this.Qn,r=i.getLeft(),e=i.getTop(),u=this.theme,s=u.getMainWidth(),h=u.getMainHeight();this.toLocal(t,void 0,n);var o=Math.max(0,Math.min(s,n.x-r)),a=Math.max(0,Math.min(h,n.y-e));this.mc.position.set(r+o,e+a),this.onColorNew(this.toMainColor(this.Pr,o,a,s,h))},i.prototype.setColorCurrent=function(t){this.jc.tint=this.au.color=t},i.prototype.setAlphaCurrent=function(t){this.jc.alpha=this.au.alpha=t},i.prototype.setColorNew=function(t){var n=this.theme,i=n.getMainWidth(),r=n.getMainHeight(),e=this.Qn,u=wb.fromRgb(t);this.oc.tint=this.Pr=wb.toRgb(u[0],255,255),this.Oc.x=Math.max(0,Math.min(1,u[0]/360))*i;var s=Math.max(0,Math.min(1,u[1]/255)),h=Math.max(0,Math.min(1,1-u[2]/255)),o=this.mc;o.tint=h<.45?n.getMainPointerColor():16777215,o.position.set(e.getLeft()+s*i,e.getTop()+h*r),this.onColorNew(t)},i.prototype.onColorNew=function(t){var n=st.getLayer(this);n&&n.lock(),this.Nc.tint=this.uc.color=t,this.Ec.input.value=an.toCode(t),this.emit("newcolorchange",t,this),n&&(n.unlock(),n.update())},i.prototype.onBaseDown=function(t){this.onBasePick(t.data.global);var n=st.getLayer(this);if(n){var i=n.stage;i.on(ir.move,this.lc),i.on(ir.up,this.vc)}},i.prototype.onBaseMove=function(t){this.onBasePick(t.data.global)},i.prototype.onBaseUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.lc),i.off(ir.up,this.vc)}},i.prototype.toBaseHex=function(t,n){return Math.max(0,Math.min(255,6*t*255))<<n},i.prototype.toBaseColor=function(t){return t<=.167?16711680+this.toBaseHex(t,8):t<=.333?(t=.333-t,65280+this.toBaseHex(t,16)):t<=.5?(t-=.333,65280+this.toBaseHex(t,0)):t<.667?(t=.667-t,255+this.toBaseHex(t,8)):t<.883?(t-=.667,255+this.toBaseHex(t,16)):(t=.883-t,16711680+this.toBaseHex(t,0))},i.prototype.onBasePick=function(t){var n=this.sc,i=this.Qn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.Oc.x=e,this.onColorBase(this.toBaseColor(e/r))},i.prototype.setColorBase=function(t){var n=this.theme.getMainWidth();this.Oc.x=Math.max(0,Math.min(1,t/360))*n,this.onColorBase(wb.toRgb(t,255,255))},i.prototype.onColorBase=function(t){this.oc.tint=this.Pr=t;var n=this.mc,i=this.theme,r=i.getMainWidth(),e=i.getMainHeight(),u=this.Qn;this.onColorNew(this.toMainColor(this.Pr,n.x-u.getLeft(),n.y-u.getTop(),r,e))},i.prototype.onAlphaDown=function(t){this.onAlphaPick(t.data.global);var n=st.getLayer(this);if(n){var i=n.stage;i.on(ir.move,this.dc),i.on(ir.up,this.gc)}},i.prototype.onAlphaMove=function(t){this.onAlphaPick(t.data.global)},i.prototype.onAlphaUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.dc),i.off(ir.up,this.gc)}},i.prototype.onAlphaPick=function(t){var n=this.sc,i=this.Qn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.wc.x=e,this.onAlphaNew(e/r)},i.prototype.setAlphaNew=function(t){var n=this.theme.getMainWidth();this.wc.x=Math.max(0,Math.min(1,t))*n,this.onAlphaNew(t)},i.prototype.onAlphaNew=function(t){var n=st.getLayer(this);n&&n.lock(),this.Nc.alpha=this.uc.alpha=t,this.Mc.input.value=Number(t.toFixed(2)),this.emit("newalphachange",t,this),n&&(n.unlock(),n.update())},i.prototype.onRecentChange=function(){for(var t=this.Dc,n=this.ec,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(i);null!=u?(e.tint=u.color,e.alpha=u.alpha):(e.tint=16777215,e.alpha=0)}},i.prototype.getType=function(){return"DPickerColor"},i.RECENT_COLORS=null,i}(hr),qb=function(t,n){if(t.direction!==n.direction)return!1;var i=t.points,r=n.points;if(i.length!==r.length)return!1;for(var e=0,u=i.length;e<u;++e){var s=i[e],h=r[e];if(s.color!==h.color||s.alpha!==h.alpha||s.position!==h.position)return!1}return!0},Qb=function(t){function n(n,i){var r=t.call(this)||this;return r.nc=n,r.Ht=i,r}return _(n,t),n.prototype.getCapacity=function(){return this.Ht},n.prototype.get=function(t){var n=this.nc;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.nc;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]=n,this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.nc,i=0,r=n.length;i<r;++i)if(qb(n[i],t))return!0;return!1},n.prototype.add=function(t){var n=this.nc;return n.push(t),this.Ht<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.nc.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.nc.length},n}(t.utils.EventEmitter),$b=function(n){function i(i,r,e,u,s,h,o,a){var c=n.call(this,o,a)||this;return c.interactive=!0,c.interactiveChildren=!1,c.cursor="pointer",c.Ic=i,c.jn=r,c._uvs=e,c.Cc=u,c.In=s,c.Ac=-1,c.qa=[0,0,0],c.Rc=new t.Point,c.kc=h,a.uniforms.uSampler.on("update",(function(){c.update(),st.update(c)})),c.update(),c}return _(i,n),i.prototype.getRectangle=function(t){var n=this.kc;return 0<=t&&t<n.length?n[t].rect:null},i.prototype.setRectangle=function(t,n,i,r,e){var u=this.kc;if(0<=t&&t<u.length){var s=u[t].rect;s.x=n,s.y=i,s.width=r,s.height=e}},i.prototype.getData=function(t){var n=this.kc;return 0<=t&&t<n.length?n[t].data:null},i.prototype.setData=function(t,n){var i=this.kc;0<=t&&t<i.length&&(i[t].data=n)},i.prototype.getLastHitIndex=function(){return this.Ac},i.prototype.setColors=function(t,n,i,r){n[t+0]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=r,n[t+4]=i[0],n[t+5]=i[1],n[t+6]=i[2],n[t+7]=r},i.prototype.setColorsHex=function(n,i,r,e){var u=t.utils.hex2rgb(r,this.qa);this.setColors(n,i,u,e)},i.prototype.setColorsWhite=function(t,n){var i=this.qa;i[0]=1,i[1]=1,i[2]=1,this.setColors(t,n,i,0)},i.prototype.setColorsPoint=function(t,n,i,r){var e=n.points[i];null!=e?this.setColorsHex(t,r,e.color,e.alpha):this.setColorsWhite(t,r)},i.prototype.setVertices=function(t,n,i,r){var e=r.y+r.height*i;n[t+0]=r.x,n[t+1]=e,n[t+2]=r.x+r.width,n[t+3]=e},i.prototype.setUvs=function(t,n,i,r){var e=r.x0+(r.x3-r.x0)*i,u=r.y0+(r.y3-r.y0)*i,s=r.x1+(r.x2-r.x1)*i,h=r.y1+(r.y2-r.y1)*i;n[t+0]=e,n[t+1]=u,n[t+2]=s,n[t+3]=h},i.prototype.newIndices=function(t,n,i,r){for(var e=0;e<i;++e)r[t+0]=n+0,r[t+1]=n+1,r[t+2]=n+2,r[t+3]=n+2,r[t+4]=n+1,r[t+5]=n+3,t+=6,n+=2;return r},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,n=this.kc[0].rect,i=this._bounds,r=this.Rc;r.set(n.x,n.y),t.apply(r,r),i.addPoint(r),r.set(n.x+n.width,n.y+n.height),t.apply(r,r),i.addPoint(r)},i.prototype.update=function(){var t=this.jn,n=this._uvs,i=this.Cc,r=this.In,e=this.shader.uniforms.uSampler;null==e._uvs&&e.updateUvs();for(var u=e._uvs,s=0,h=0,o=0,a=0,c=this.kc,f=0,l=c.length;f<l;++f){var v=c[f].data,b=c[f].rect;if(null==v)this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsWhite(o,i),this.setVertices(s+4,t,1,b),this.setUvs(s,n,1,u),this.setColorsWhite(o+8,i),this.newIndices(a,h,1,r),s+=8,o+=16,h+=4,a+=6;else{this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsPoint(o,v,0,i),s+=4,o+=8;for(var d=v.points.length,g=0,m=Math.min(d,this.Ic);g<m;++g){var w=v.points[g];this.setVertices(s,t,w.position,b),this.setUvs(s,n,w.position,u),this.setColorsHex(o,i,w.color,w.alpha),s+=4,o+=8}this.setVertices(s,t,1,b),this.setUvs(s,n,1,u),this.setColorsPoint(o,v,d-1,i),s+=4,o+=8,this.newIndices(a,h,d+1,r),a+=6*(d+1),h+=2*(d+2)}}this.size=a;var p=this.geometry;p.getBuffer("aPosition").update(),p.getBuffer("aUv").update(),p.getBuffer("aColor").update(),p.getIndex().update()},i.prototype.containsPoint=function(t){for(var n=this.toLocal(t,void 0,this.Rc),i=this.kc,r=0,e=i.length;r<e;++r)if(i[r].rect.contains(n.x,n.y))return this.Ac=r,!0;return!1},i.from=function(n,r,e,u){void 0===u&&(u=t.Texture.WHITE);for(var s=new Float32Array(n*(r+2)*2*2),h=new Float32Array(n*(r+2)*2*2),o=new Float32Array(n*(r+2)*2*4),a=new Uint16Array(n*(r+1)*6),c=[],f=0;f<n;++f)c.push({data:null,rect:new t.Rectangle});return new i(r,s,h,o,a,c,(new t.Geometry).addIndex(new t.Buffer(a,!1,!0)).addAttribute("aPosition",new t.Buffer(s,!1,!1),2).addAttribute("aUv",new t.Buffer(h,!1,!1),2).addAttribute("aColor",new t.Buffer(o,!1,!1),4),t.Shader.from("\nattribute vec2 aPosition;\nattribute vec2 aUv;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\n\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nvoid main(void) {\n\tvec3 position = vec3(aPosition.x, aPosition.y, 1.0);\n\tgl_Position = vec4((projectionMatrix * translationMatrix * position).xy, 0.0, 1.0);\n\tvUv = aUv;\n\tvColor = aColor;\n}\n","\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform vec2 uCheckerColors;\n\nvoid main(void) {\n\tvec4 texture = texture2D(uSampler, vUv);\n\tfloat cy = step( 1.0, mod( gl_FragCoord.y / 10.0, 2.0 ) );\n\tfloat cx = step( 1.0, mod( gl_FragCoord.x / 10.0 + cy, 2.0 ) );\n\tfloat c = mix( uCheckerColors.x, uCheckerColors.y, cx );\n\tgl_FragColor = texture * vec4( mix( vec3( c ), vColor.xyz, vColor.a ), 1.0 );\n}",{uSampler:u,uCheckerColors:e}))},i}(t.Mesh),td=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r);var u=this.theme,s=this.Qn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.Mu=new t.Point;var f=u.getGradientPointsWidth(),l=u.getGradientPointsMargin(),v=new Zb({x:c+f+l,y:h});this.Jh=v,v.on("newcolorchange",(function(t){e.onAnchorColorChange(t)})),v.on("newalphachange",(function(t){e.onAnchorAlphaChange(t)})),this.addChild(v);var b=this.br=$b.from(17,10,u.getGradientCheckerColors());b.setRectangle(0,c,h,f,v.height),this.addChild(b),b.on(ir.down,(function(t){0===b.getLastHitIndex()&&e.onViewDown(t)})),this.Lc=function(t){e.onAnchorDown(t)},this.yc=function(t){e.onAnchorMove(t)},this.xc=function(t){e.onAnchorUp(t)},this.Bc=[];var d=u.getGradientRecentColumn(),g=u.getGradientRecentWidth(),m=u.getGradientRecentMargin(),w=g+m,p=v.theme.getInputLabelWidth(),O=g*d+m*(d-1),D=u.getGradientDirectionMargin(),E=u.getGradientDirectionTexture(),M=v.x+v.width+D,S=new Zs({parent:this,x:M+p+5,y:h,width:O-2*(p+5),step:1,image:{source:E,align:{with:is.BORDER},margin:{horizontal:-E.width-5}},on:{change:function(t){e.Ut.rn=t}}}),j=M,T=S.y+S.height+D;null==i.RECENT_COLOR_GRADIENT&&(i.RECENT_COLOR_GRADIENT=new Qb(u.getGradientRecents(),u.getGradientRecentCount())),this.ec=i.RECENT_COLOR_GRADIENT;for(var N=this.ec,I=0,C=N.getCapacity();I<C;++I){var A=j+I%d*w,R=T+(I/d|0)*w;b.setRectangle(1+I,A,R,g,g)}N.on("change",(function(){e.onRecentUpdate()})),b.on(ir.tap,(function(t){var n=b.getLastHitIndex();1<=n&&e.onRecentClick(b.getData(n))}));var k=new zb;this.Ut=k,k.on("change",(function(){e.updateAnchors(),b.update()})),k.on("selectionchange",(function(t){e.onAnchorSelect(t)})),k.on("directionchange",(function(t){S.value=t})),b.setData(0,k),b.update(),S.value=k.direction,this.updateAnchors();var L=k.selected;null!=L&&this.onAnchorSelect(L),null!=r&&null!=r.width||(this.width=c+f+l+v.width+D+(d-1)*m+d*g+o),null!=r&&null!=r.height||(this.height=h+v.height+a)},Object.defineProperty(i.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.ec},enumerable:!1,configurable:!0}),i.prototype.onRecentClick=function(t){var n=this.Ut;null!=t?n.fromObject(t):n.reset()},i.prototype.onRecentUpdate=function(){for(var t=this.ec,n=this.br,i=0,r=t.size();i<r;++i)n.setData(1+i,t.get(i));n.update(),st.update(this)},i.prototype.toAnchorPosition=function(t){var n=this.toLocal(t.data.global,void 0,this.Mu);return Math.max(0,Math.min(1,(n.y-this.padding.getTop())/this.Jh.height))},i.prototype.onViewDown=function(t){this.Ut.addAt(this.toAnchorPosition(t)),this.onAnchorDragStart()},i.prototype.onAnchorDown=function(n){var i=n.target;if(i instanceof t.Sprite){var r=this.Ut,e=this.Bc.indexOf(i);0<=e&&e<r.points.length&&(r.points[e].selected=!0,this.onAnchorDragStart())}},i.prototype.onAnchorSelect=function(t){var n=this.Jh;n.current.color=t.color,n.current.alpha=t.alpha,n.new.color=t.color,n.new.alpha=t.alpha},i.prototype.onAnchorColorChange=function(t){var n=this.Ut;if(null!=n){var i=n.selected;null!=i&&(i.color=t)}},i.prototype.onAnchorAlphaChange=function(t){var n=this.Ut;if(null!=n){var i=n.selected;null!=i&&(i.alpha=t)}},i.prototype.onAnchorDragStart=function(){var t=st.getLayer(this);if(t){var n=t.stage;n.on(ir.move,this.yc),n.on(ir.up,this.xc)}},i.prototype.onAnchorMove=function(t){var n=this.Ut;if(null!=n){var i=n.selected;null!=i&&(i.position=this.toAnchorPosition(t))}},i.prototype.onAnchorUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.yc),i.off(ir.up,this.xc)}},i.prototype.updateAnchors=function(){for(var n=this.theme,i=n.getGradientAnchorTexture(),r=n.getGradientAnchorOutlinedTexture(),e=n.getGradientPointsWidth(),u=this.Ut,s=u.points.length,h=this.Bc,o=h.length,a=o;a<s;++a){var c=new t.Sprite(i);c.anchor.set(.5,.5),c.cursor="pointer",c.interactive=!0,c.on(ir.down,this.Lc),h.push(c),this.addChild(c)}for(a=o-1;s<=a;--a){var f=h[a];f.off(ir.down,this.Lc),f.destroy()}h.length=s;var l=this.padding.getTop(),v=this.padding.getLeft()+e,b=this.Jh.height;for(a=0;a<s;++a){var d=u.points[a],g=h[a];g.tint=d.color,g.position.set(v,l+b*d.position),g.texture=d.selected?r:i}st.update(this)},i.prototype.onKeyDown=function(t){if(nr.isDeleteKey(t)){var i=this.Ut;if(null!=i){var r=i.selected;if(null!=r)return i.remove(r),n.prototype.onKeyDown.call(this,t),!0}}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DPickerColorGradient"},i.RECENT_COLOR_GRADIENT=null,i}(hr),nd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.value,e=i.recent;e.contains(r)||e.add(r.toObject())},Object.defineProperty(n.prototype,"value",{get:function(){return this.picker.value},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new td(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.value},n.prototype.onKeyDown=function(n){return this.picker.onKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DDialogColorGradient"},n}(rh),id=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r;if(n.prototype.init.call(this,i),void 0===(null===(r=null==i?void 0:i.image)||void 0===r?void 0:r.source)){var e=this.theme,u=e.getViewBaseTexture();if(u instanceof t.Texture){var s=e.getCheckerColors(),h=$b.from(1,10,s,u);this.br=h,h.setRectangle(0,0,0,u.width,u.height),h.setData(0,this.oh),h.update(),this.image=h}}},i.prototype.onActivate=function(t){var i=this;n.prototype.onActivate.call(this,t);var r=this.oh,e=this.dialog;null!=r&&e.value.fromObject(r),e.open(this).then((function(t){i.onValueChange(t,i.toClone(r))}))},i.prototype.toClone=function(t){var n=new zb;return null!=t&&n.fromObject(t),n},i.prototype.onValueChange=function(t,n){var i=this.oh;null!=i&&i.fromObject(t);var r=this.br;null!=r&&r.update(),this.onTextChange(),this.createOrUpdateText(),st.update(this),this.emit("change",t,n,this)},Object.defineProperty(i.prototype,"dialog",{get:function(){var t,n=this._c;if(null==n){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?n=this.newDialog(r):(null==i.DIALOG&&(i.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),n=i.DIALOG),this._c=n}return n},enumerable:!1,configurable:!0}),i.prototype.newDialog=function(t){return new nd(t)},Object.defineProperty(i.prototype,"value",{get:function(){return this.oh},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DButtonColorGradient"},i}(Ts),rd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.recent;r.contains(i.new)||r.add(i.new)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new Zb(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogColor"},n}(rh),ed=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.dialog,e=this.oh;if(null!=e){var u=r.current;u.color=e.color,u.alpha=e.alpha;var s=r.new;s.color=e.color,s.alpha=e.alpha}r.open(this).then((function(){i.onValueChange(i.toClone(r.new),i.toClone(r.current))}))},n.prototype.toClone=function(t){return{color:t.color,alpha:t.alpha}},n.prototype.onValueChange=function(t,n){var i=this.oh;null!=i&&(i.color=t.color,i.alpha=t.alpha),this.onColorChange(),this.emit("change",t,n,this)},n.prototype.toImageTintOptions=function(t){var n=this,i=function(){return n.oh.color};return t?{color:t.color||i,alpha:t.alpha}:{color:i}},n.prototype.toImageOptions=function(t,n){return n?{source:n.source,tint:this.toImageTintOptions(n.tint),align:n.align,margin:n.margin}:{tint:this.toImageTintOptions()}},n.prototype.onColorChange=function(){this.mh[0].updateTint()&&st.update(this),this.updateTextForcibly()},n.prototype.updateTextForcibly=function(){this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new rd(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Ut;return null==t&&(t=this.newValue(),this.Ut=t),t},enumerable:!1,configurable:!0}),n.prototype.newValue=function(){var t=this,n=this.oh;return new Yb(n,(function(i){n.color=i,t.onColorChange()}),(function(i){n.alpha=i,t.updateTextForcibly()}))},n.prototype.getType=function(){return"DButtonColor"},n}(Ts),ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonDanger"},n}(Ts),sd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.oh)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Nh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:new Date},set:function(t){var n=this.oh;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDate"},n}(Ts),hd=function(){function t(){}return t.format=function(t){var n=on(String(t.getFullYear()),4,"0"),i=on(String(t.getMonth()+1),2,"0"),r=on(String(t.getDate()),2,"0");return"".concat(n,"/").concat(i,"/").concat(r)},t}(),od=function(){function t(){}return t.format=function(t,n){var i="";return n&fh.HOURS&&(i+=on(String(t.getHours()),2,"0")),n&fh.MINUTES&&(0<i.length&&(i+=":"),i+=on(String(t.getMinutes()),2,"0")),n&fh.SECONDS&&(0<i.length&&(i+=":"),i+=on(String(t.getSeconds()),2,"0")),i},t.toMask=function(t){return lh.from("DPickerTime",t)},t}(),ad=function(){function t(){}return t.format=function(t,n){var i=od.format(t,n);return 0<i.length?"".concat(hd.format(t)," ").concat(i):"".concat(hd.format(t))},t.toMask=function(t){return lh.from("DPickerDatetime",t)},t}(),cd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.oh)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.Pc;return null==i&&(i=ad.toMask(null===(n=null===(t=this.zn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Pc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Dh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:new Date},set:function(t){var n=this.oh;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDatetime"},n}(Ts),fd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getChecker=function(){var t,n,i=this.Uo;return void 0===i&&(i=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.checker)&&void 0!==n?n:null,this.Uo=i),i},n.prototype.getOpener=function(){var t=this.Ts;return null==t&&(t=this.newOpener(),this.Ts=t),t},n.prototype.newOpener=function(){var t,n;return new mb(Ai(null!==(n=null===(t=this.zn)||void 0===t?void 0:t.as)&&void 0!==n?n:gb.TEXT,gb),this)},n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n),this.check((function(){i.open()}))},n.prototype.check=function(t){var n=this.getChecker();if(null!=n){var i=n();!0===i?t():!1===i||i.then((function(){t()}))}else t()},n.prototype.open=function(){this.getOpener().open()},n.prototype.getType=function(){return"DButtonFile"},n}(Ts),ld=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return null==t&&(t=new Ul(this.zn),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.getType=function(){return"DButtonLink"},n}(js),vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadio"},n}(js),bd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadioRight"},n}(vd),dd=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=Lb.getCommandController();return r.isDisabled=!e.isRedoable(),e.on("change",(function(){r.isDisabled=!e.isRedoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),Lb.getCommandController().redo()},n}(Ts),gd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonSecondary"},n}(Ts),md={NONE:0,SINGLE:1,MULTIPLE:2},wd=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Xt=n,r.on(ir.tap,(function(t){r.onClick(t)})),r}return _(n,t),Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return void 0===t&&(t=this.newLink(),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t=this.Xt.accessor.link;return t?new Ul(this.toLinkOptions(t)):null},n.prototype.onClick=function(t){var n;!0!==(null===(n=this.link)||void 0===n?void 0:n.onClick(this,t))&&this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){var n=this.Ut;void 0!==n&&this.onSelect(t,n)},n.prototype.toLinkOptions=function(t){return{url:this.toLinkUrl(t.toUrl),target:t.target,checker:this.toLinkChecker(t.checker)}},n.prototype.toLinkUrl=function(t){var n=this;return function(){var i=n.Ut;if(void 0!==i)return t(i)}},n.prototype.toLinkChecker=function(t){var n=this;if(t)return function(){var i=n.Ut;return null!=i&&t(i)}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),n.prototype.onSelect=function(t,n){var i;this.emit("select",n,this);var r=this.Xt,e=r.selection;if(e.type!==md.MULTIPLE)e.clearAndAdd(n);else{var u=t&&"data"in t?t.data.originalEvent:t;if(null==u?void 0:u.ctrlKey)e.toggle(n);else if(null==u?void 0:u.shiftKey){var s=r.mapped,h=e.last;if(n===h)e.clearAndAdd(n);else{var o=!1,a=!1,c=[];s.each((function(t){if(o){if(a){if(c.unshift(t),t===n)return!1}else if(c.push(t),t===h)return!1}else t===n?(o=!0,a=!1,c.push(t)):t===h&&(o=!0,a=!0,c.push(t))})),e.clearAndAddAll(c)}}else e.clearAndAdd(n)}null===(i=this.Go)||void 0===i||i.open(t)},n.prototype.set=function(t,n,i){var r=this.Xt,e=i||this.Ut!==t;if(e){this.Ut=t,this.hu=n;var u=r.accessor;this.text=u.toLabel(t),this.title=u.toTitle(t)||"",this.image=u.toImage(t)}var s=this.state;s.lock(),s.set(ct.ACTIVE,r.selection.contains(t)),s.remove(ct.DISABLED),s.unlock(),e&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Ut){this.Ut=void 0,this.hu=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ct.DISABLED),t.remove(ct.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DListItem"},n}(Ss),pd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogSelectListItem"},n}(wd),Od=function(){function t(t,n,i,r){this.Fc=0,this.Uc=!1,this.Gc=!1,this.Hc=-1,this.zc=-1,this.Is=1,this.Vc=0,this.Wc=0,this.Xc=[],this.Xt=t,this.Nh=n,this.Kc=i,this.Yc=this.toNewItem(r),this.Jc=this.toInitItem(r)}return t.prototype.toNewItem=function(t){return(null==t?void 0:t.newItem)||this.newItem},t.prototype.toInitItem=function(t){return t?t.initItem||(!1!==t.stripe?this.initItem:this.initItemNoStriping):this.initItem},t.prototype.initItem=function(t,n,i){return t.state.isAlternated=n%2==1,t},t.prototype.initItemNoStriping=function(t,n,i){return t},Object.defineProperty(t.prototype,"multiplicity",{get:function(){return this.Is},enumerable:!1,configurable:!0}),t.prototype.lock=function(){this.Fc+=1,1===this.Fc&&(this.Uc=!1,this.Gc=!1)},t.prototype.unlock=function(t){this.Fc-=1,0===this.Fc&&(t&&this.Uc&&this.update(this.Gc),this.Uc=!1,this.Gc=!1)},t.prototype.update=function(t){var n=this;if(0<this.Fc)return this.Uc=!0,void(t&&(this.Gc=!0));var i=this.Nh,r=i.parent;if(null!=r){var e=this.Kc,u=e.children,s=r.height,h=this.Xt,o=this.toMapped(h),a=o.size(),c=this.Vc,f=this.Wc,l=f-c,v=this.Yc,b=this.Jc,d=this.Hc,g=this.zc;if(this.Hc<0){var m=void 0;0<u.length?m=u[0]:(m=b(v(h),c,h),e.addChild(m),f+=1,l+=1),d=Math.max(1,m.height),pt(m.getWidth())&&(g=Math.max(1,m.width)),this.Hc=d,this.zc=g}var w=i.padding,p=w.getTop(),O=w.getBottom(),D=w.getLeft(),E=w.getRight(),M=Math.max(0,i.width-D-E),S=0<g?Math.max(1,Math.floor(M/g)):1;this.Is=S;var j=i!==e?e.transform.position.y:p,T=Math.ceil(a/S)*d,N=Math.max(s,p+T+O),I=Math.max(s-N,i.position.y),C=Math.floor((0-(I+j))*S/d),A=Math.floor((s-(I+j))*S/d),R=C-S;R%2!=0&&(R-=1);var k=A+S+S;k%2!=0&&(k+=1);var L=k-R;if(L<l&&l-2<=L&&(k=R+(L=l)),l<L){for(var y=l;y<L;++y){var x=c+y;m=b(v(h),x,h),e.addChild(m)}f=c+(l=L)}else if(L<l){for(y=l-1;L<=y;--y)e.removeChild(u[y]);f=c+(l=L)}this.Vc=R,this.Wc=k;var B=R-c,_=Math.abs(B),P=u.length;if(0<_&&_<P){var F=this.Xc;if(0<B){for(y=0;y<_;++y)m=u[y],this.reset(m),F.push(m);for(y=_;y<P;++y)u[y-_]=u[y];for(y=0;y<_;++y)u[P-_+y]=F[y]}else{for(y=0;y<_;++y)m=u[P-_+y],this.reset(m),F.push(m);for(y=P-_-1;0<=y;--y)u[y+_]=u[y];for(y=0;y<_;++y)u[y]=F[y]}F.length=0}var U=0,G=0;for(i===e&&(U=D,G=p),o.each((function(i,r){var e=u[r-R],s=r%S,h=Math.floor(r/S);e.position.set(U+s*g,G+h*d),n.set(e,i,r,t)}),R,R+P),y=0;R+y<0&&y<P;++y){m=u[y];var H=(V=R+y)%S,z=Math.floor(V/S);m.position.set(U+H*g,G+z*d),this.unset(m)}for(y=P-1;a<=R+y&&0<=y;--y){var V;m=u[y],H=(V=R+y)%S,z=Math.floor(V/S),m.position.set(U+H*g,G+z*d),this.unset(m)}this.lock(),i.position.y=I,i.height=N,i!==e&&(e.height=T),this.unlock(!1)}},t.prototype.set=function(t,n,i,r){t.set(n,i,r)},t.prototype.unset=function(t){t.unset()},t.prototype.reset=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof hr){var u=e.state;u.lock(),u.isPressed=!1,u.isHovered=!1,u.unlock()}}return t.state.isHovered=!1,t},t.prototype.moveFocus=function(t,n,i,r){if(!i&&!r)return!1;var e=i&&nr.isArrowUpKey(t),u=i&&nr.isArrowDownKey(t),s=r&&nr.isArrowLeftKey(t),h=r&&nr.isArrowRightKey(t);if(!(e||u||s||h))return!1;if(!n.state.isActionable)return!1;var o=st.getLayer(n);if(null==o)return!1;var a=o.getFocusController(),c=a.get();if(null==c)return!1;var f=this.Kc;if(c.parent!==f)return!1;var l=c,v=l.index;if(null==v)return!1;var b=this.Is,d=this.Xt,g=this.toMapped(d).size(),m=v;if((s||h)&&(s?0<=m-1&&(m-=1):m+1<g&&(m+=1)),(e||u)&&(e?0<=m-b&&(m-=b):m+b<g&&(m+=b)),m===v)return!1;var w=f.children,p=w.indexOf(l);if(p<0)return!1;var O=p+(m-v);if(O<0||w.length<=O)return!1;var D=w[O];return a.focus(D),!0},t}(),Dd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new wd(t)},n}(Od),Ed=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItem=function(t){return new pd(t)},n}(Dd),Md=function(){function t(t){this.p=t}return t.prototype.size=function(){var t=this.p;return t.before.length+t.items.length+t.after.length},t.prototype.each=function(t,n,i){var r=this.p,e=this.Zc(t,r.before,0,n,i);if(!(e<0)){var u=this.Zc(t,r.items,e,n,i);u<0||this.Zc(t,r.after,u,n,i)}},t.prototype.Zc=function(t,n,i,r,e){for(var u=i+n.length,s=null!=r?Math.max(i,r):i,h=null!=e?Math.min(u,e):u,o=s;o<h;++o)if(!1===t(n[o-i],o))return-1;return h},t}(),Sd=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n,e.qc=i,e.Qc=new Set;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return md.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.get(0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.Qc;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.Qc;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.Qc;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.Qc;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.Qc;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.Qc;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.Qc,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.Qc=i,this.onChange()),n},n.prototype.contains=function(t){return this.Qc.has(t)},n.prototype.size=function(){return this.Qc.size},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=!1;this.Qc.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.Qc.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toItemIdMap=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];i.set(n(u),u)}},n.prototype.toItemSet=function(t,n){for(var i=0,r=t.length;i<r;++i)n.add(t[i])},n.prototype.onItemChange=function(t,n,i){var r=this.Qc,e=new Set,u=this.qc.toId;if(u){var s=new Map;this.toItemIdMap(t,u,s),this.toItemIdMap(n,u,s),this.toItemIdMap(i,u,s),r.forEach((function(t){var n=u(t),i=s.get(n);null!=i&&e.add(i)})),this.Qc=e,this.onChange()}else{var h=new Set;this.toItemSet(t,h),this.toItemSet(n,h),this.toItemSet(i,h),r.forEach((function(t){h.has(t)&&e.add(t)})),r.size!==e.size&&(this.Qc=e,this.onChange())}},n.prototype.newItems=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];n.has(u)&&i.add(u)}return i},n}(t.utils.EventEmitter),jd=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return md.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onItemChange=function(t,n,i){},n}(t.utils.EventEmitter),Td=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n,e.qc=i,e.$c=null;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return md.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.$c},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.$c:null},n.prototype.add=function(t){return this.$c!==t&&(this.$c=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.$c===t&&(this.$c=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.$c===t?this.$c=null:this.$c=t,this.onChange(),!0},n.prototype.clear=function(){null!=this.$c&&(this.$c=null,this.onChange())},n.prototype.clearAndAdd=function(t){return this.$c!==t&&(this.$c=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){var n=t.length;if(0<n){var i=t[n-1];if(this.$c!==i)return this.$c=i,this.onChange(),!0}else if(null!=this.$c)return this.$c=null,this.onChange(),!0;return!1},n.prototype.contains=function(t){return this.$c===t},n.prototype.size=function(){return null!=this.$c?1:0},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=this.$c;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.$c;return null!=t?[t]:[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.findById=function(t,n,i){for(var r=0,e=i.length;r<e;++r){var u=i[r];if(t===n(u))return u}return null},n.prototype.find=function(t,n){for(var i=0,r=n.length;i<r;++i){var e=n[i];if(t===e)return e}return null},n.prototype.onItemChange=function(t,n,i){var r=this.$c;if(null!=r){var e=null,u=this.qc.toId;if(u){var s=u(r);e=this.findById(s,u,t)||this.findById(s,u,n)||this.findById(s,u,i)}else e=this.find(r,t)||this.find(r,n)||this.find(r,i);r!==e&&(this.$c=e,this.onChange())}},n}(t.utils.EventEmitter),Nd=function(t){return t.image},Id=function(t){return t.title},Cd=function(t){return t.url},Ad=function(){function t(t){this.toLabel=(null==t?void 0:t.toLabel)||cb,this.toTitle=(null==t?void 0:t.toTitle)||Id,this.toImage=(null==t?void 0:t.toImage)||Nd,this.toId=null==t?void 0:t.toId,this.link=this.toLink(t)}return t.prototype.toLink=function(t){if(t){var n=t.link;if(n){var i=n.toUrl,r=n.target,e=n.checker;if(void 0!==i||void 0!==r||void 0!==e)return{toUrl:i||Cd,target:r,checker:e}}}},t}(),Rd=function(){function t(t,n){this.p=t,n?(this.Yu=n.before||[],this.Qc=n.items||[],this.Ju=n.after||[]):(this.Yu=[],this.Qc=[],this.Ju=[]);var i=new Ad(n);this.qc=i,this.tf=this.toSelection(i,n),this.nf=new Md(this)}return t.prototype.toSelection=function(t,n){var i=null==n?void 0:n.selection;switch(null==i?void 0:i.type){case md.NONE:case"NONE":return new jd(this,t,i);case md.MULTIPLE:case"MULTIPLE":return new Sd(this,t,i);default:return new Td(this,t,i)}},Object.defineProperty(t.prototype,"before",{get:function(){return this.Yu},set:function(t){this.Yu=t,this.tf.onItemChange(t,this.Qc,this.Ju),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this.Qc},set:function(t){this.Qc=t,this.tf.onItemChange(this.Yu,t,this.Ju),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.Ju},set:function(t){this.Ju=t,this.tf.onItemChange(this.Yu,this.Qc,t),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.qc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),t.prototype.update=function(t){this.p.update(t)},t.prototype.size=function(){return this.Qc.length},t.prototype.clear=function(){var t=this.Qc;return 0<t.length&&(t.length=0,this.onChange(),!0)},t.prototype.clearAndAdd=function(t){var n=this.Qc;return 1===n.length?n[0]!==t&&(n[0]=t,this.onChange(),!0):(n.length=0,n.push(t),this.onChange(),!0)},t.prototype.clearAndAddAll=function(t){var n=!1,i=this.Qc;if(0<i.length&&(i.length=0,n=!0),0<t.length){for(var r=0,e=t.length;r<e;++r)i.push(t[r]);n=!0}return!!n&&(this.onChange(),!0)},t.prototype.add=function(t,n){var i=this.Qc;return null==n?(i.push(t),this.onChange(),!0):0<=n&&n<i.length&&(i.splice(n,0,t),this.onChange(),!0)},t.prototype.addAll=function(t,n){if(0<t.length){var i=this.Qc,r=i.length;if(null==n){for(var e=0,u=t.length;e<u;++e)i.push(t[e]);return this.onChange(),!0}if(0<=n&&n<r){for(e=0,u=t.length;e<u;++e)i.splice(n+e,0,t[e]);return this.onChange(),!0}}return!1},t.prototype.get=function(t){var n=this.Qc;return 0<=t&&t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.Qc;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.onChange(),r}return null},t.prototype.remove=function(t){var n=this.Qc;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.onChange(),i}return null},t.prototype.each=function(t,n,i){for(var r=this.Qc,e=r.length,u=null!=n?Math.max(0,n):0,s=null!=i?Math.min(e,i):e,h=u;h<s&&!1!==t(r[h],h);++h);},t.prototype.onChange=function(){this.update()},t}(),kd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DContent"},n}(hr),Ld=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).if=0,e.rf=1,e.visible=!1,e.ef=-1,e.uf=!1,e.sf=null,e.hf=null!==(r=null===(i=null==n?void 0:n.fadeOut)||void 0===i?void 0:i.delay)&&void 0!==r?r:e.theme.getFadeOutDelay(),e.af=!0,e.cf=function(){e.onFadeOutTimeout()};var u=e.newThumb(null==n?void 0:n.thumb);return u.on("statechange",(function(t,n){e.onThumbStateChange(t,n)})),e.ff=u,e.addChild(u),e}return _(n,t),Object.defineProperty(n.prototype,"thumb",{get:function(){return this.ff},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"start",{get:function(){return this.if},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"end",{get:function(){return this.rf},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r){i<1?(t=0,n=1):(t=Math.max(0,Math.min(1,t/i)),n=Math.max(t,Math.min(1,n/i))),this.if===t&&this.rf===n||(this.if=t,this.rf=n,this.onChange(r))},n.prototype.onChange=function(t){this.updateThumb(this.width,this.height),t&&(this.af=!0),this.uf||(this.uf=!0,st.update(this))},n.prototype.touch=function(t){this.onChange(t)},n.prototype.isRegionVisible=function(){return 0<this.if||this.rf<1},n.prototype.render=function(n){if(this.uf)if(this.uf=!1,!this.af&&this.isRegionVisible()){var i=this.hf;0<=i&&(this.ef=Date.now(),null==this.sf&&(this.sf=window.setTimeout(this.cf,i))),this.visible||(this.visible=!0)}else this.hf<0&&this.visible&&(this.visible=!1);this.af&&(this.af=!1),t.prototype.render.call(this,n)},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateThumb(n,i)},n.prototype.onFadeOutTimeout=function(){this.sf=null;var t=this.hf,n=this.cf,i=this.state;if(i.isGesturing||i.onHovered||i.isHovered||i.isPressed)this.sf=window.setTimeout(n,t);else{var r=this.ff.state;if(r.isGesturing||r.isHovered||r.isPressed)this.sf=window.setTimeout(n,t);else{var e=t-(Date.now()-this.ef);0<e?this.sf=window.setTimeout(n,e):this.visible&&(this.visible=!1,st.update(this))}}},n.prototype.onThumbStateChange=function(t,n){t.isGesturing||t.isHovered||t.isPressed||(n.isGesturing||n.isHovered||n.isPressed)&&(this.ef=Date.now())},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isGesturing||n.isHovered||n.isPressed||(i.isGesturing||i.isHovered||i.isPressed)&&(this.ef=Date.now())},n.prototype.getType=function(){return"DScrollBar"},n}(hr),yd=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r=this;n.prototype.init.call(this,i);var e=new t.Point;this.Bi=new mr({bind:this,on:{start:function(){e.copyFrom(r.position)},move:function(t,n,i){e.set(e.x+n,e.y+i),r.onGestureMove(e.x,e.y)}}})},i.prototype.getMinimumLength=function(){return this.theme.getThumbMinimumLength()},i.prototype.getType=function(){return"DScrollBarThumb"},i}(hr),xd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(0,o*(i-h),n,h),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Bd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",t,this)},n.prototype.initReflowable=function(){new xd(this)},n}(yd),_d=function(t){function n(n){var i=t.call(this,n)||this;return i.ff.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.width;if(0<n){var i=this.rf-this.if,r=Math.min(1-i,Math.max(0,t/n));this.if!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.width;if(0<i){var r=this.rf-this.if,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.x/i-.5*r));this.if!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Bd(t)},n.prototype.updateThumb=function(t,n){var i=this.ff,r=Math.min(.5*t,i.getMinimumLength()),e=t-r,u=e*this.if,s=e*this.rf+r-u;i.position.set(u,0),i.resize(s,n)},n}(Ld),Pd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(o*(n-h),0,h,i),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Fd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",n,this)},n.prototype.initReflowable=function(){new Pd(this)},n}(yd),Ud=function(t){function n(n){var i=t.call(this,n)||this;return i.ff.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.height;if(0<n){var i=this.rf-this.if,r=Math.min(1-i,Math.max(0,t/n));this.if!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.height;if(0<i){var r=this.rf-this.if,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.y/i-.5*r));this.if!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Fd(t)},n.prototype.updateThumb=function(t,n){var i=this.ff,r=Math.min(.5*n,i.getMinimumLength()),e=n-r,u=e*this.if,s=e*this.rf+r-u;i.position.set(0,u),i.resize(t,s),i.updateTransform()},n}(Ld),Gd=function(){function t(t,n,i){this.p=t,this.lf=i,this.st=0,this.vf=!1,this.vertical=new Ud(null==n?void 0:n.vertical),this.horizontal=new _d(null==n?void 0:n.horizontal)}return t.prototype.lock=function(){this.st+=1,1===this.st&&(this.vf=!1,this.bf=void 0)},t.prototype.unlock=function(t){this.st-=1,0===this.st&&(t&&this.vf&&this.update(this.bf),this.vf=!1,this.bf=void 0)},t.prototype.update=function(t){if(0<this.st)return this.vf=!0,void(null!=t&&(this.bf||(this.bf=t)));var n=this.p,i=n.width,r=n.height,e=n.content,u=-e.x,s=-e.y,h=this.vertical,o=h.width,a=this.getOffsetVerticalStart(o),c=this.getOffsetVerticalEnd(o);h.set(s,s+r,e.height,t),h.position.set(i-o,a),h.height=r-a-c;var f=this.horizontal,l=f.height,v=this.getOffsetHorizontalStart(l),b=this.getOffsetHorizontalEnd(l);f.set(u,u+i,e.width,t),f.position.set(v,r-l),f.width=i-v-b,this.lf(h.isRegionVisible()||f.isRegionVisible())},t.prototype.touch=function(t){this.vertical.touch(t),this.horizontal.touch(t)},t.prototype.getOffsetHorizontalStart=function(t){return.5*t},t.prototype.getOffsetHorizontalEnd=function(t){return.5*t},t.prototype.getOffsetVerticalStart=function(t){return.5*t},t.prototype.getOffsetVerticalEnd=function(t){return.5*t},t}(),Hd=function(n){function i(t){var i,r=this,e=(r=n.call(this,t)||this).theme;(null!==(i=null==t?void 0:t.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(r.mask=r.getOverflowMask()),r.addChild(r.content);var u=r.scrollbar;return r.addChild(u.vertical),r.addChild(u.horizontal),u.update(),r.initGesture(e,t),r}return _(i,n),i.prototype.initGesture=function(n,i){var r,e,u=this,s=Ai(null!==(e=null===(r=null==i?void 0:i.gesture)||void 0===r?void 0:r.mode)&&void 0!==e?e:n.getGestureMode(),fr);if(s===fr.ON||s===fr.TOUCH){var h=new t.Point,o=this.content;this.Bi=new mr({bind:this,touch:s===fr.TOUCH,on:{start:function(){h.copyFrom(o.position)},move:function(t,n,i){h.set(h.x+n,h.y+i),o.position.set(u.toContentX(o,h.x),u.toContentY(o,h.y))}}})}},Object.defineProperty(i.prototype,"scrollbar",{get:function(){var t,n=this.df;return null==n&&(n=this.newScrollBar(null===(t=this.zn)||void 0===t?void 0:t.scrollbar),this.initScrollBar(n),this.df=n),n},enumerable:!1,configurable:!0}),i.prototype.newScrollBar=function(t){var n=this;return new Gd(this,t,(function(t){n.onScrollBarUpdate(t)}))},i.prototype.onScrollBarUpdate=function(t){var n=this.dr;if(null!=n){var i=this.content;t?i.mask!==n&&(i.mask=n,st.update(this)):i.mask&&(i.mask=null,st.update(this))}},i.prototype.initScrollBar=function(t){var n=this;t.vertical.on("regionmove",(function(t){n.onScrollBarMoveY(t)})),t.horizontal.on("regionmove",(function(t){n.onScrollBarMoveX(t)}))},i.prototype.onScrollBarMoveX=function(t){var n=this.Bi;null!=n&&n.stop(this);var i=this.content;i.x=-i.width*t},i.prototype.onScrollBarMoveY=function(t){var n=this.Bi;null!=n&&n.stop(this);var i=this.content;i.y=-i.height*t},i.prototype.onOver=function(t){n.prototype.onOver.call(this,t),this.scrollbar.touch()},i.prototype.getType=function(){return"DPane"},Object.defineProperty(i.prototype,"content",{get:function(){var t=this.Nh;return null==t&&(t=this.toContent(this.zn),this.initContent(t),this.Nh=t),t},enumerable:!1,configurable:!0}),i.prototype.toContent=function(t){var n=null==t?void 0:t.content;return n?n instanceof hr?n:this.newContent(n):this.newContent()},i.prototype.newContent=function(t){return new kd(t)},i.prototype.initContent=function(t){var n=this;t.on("move",(function(){n.onContentChange()})),t.on("resize",(function(){n.onContentChange()}))},i.prototype.getOverflowMask=function(){var t=this.dr;return null==t&&(t=new or(this),this.dr=t,this.reflowable.add(t),this.toDirty()),t},i.prototype.onWheel=function(t,n,i){var r=this.content,e=this.getWheelContentX(r,n.deltaX*n.lowest),u=this.getWheelContentY(r,n.deltaY*n.lowest);if(r.x!==e||r.y!==u){var s=this.Bi;return null!=s&&s.stop(this),r.position.set(e,u),!0}return!1},i.prototype.getWheelContentX=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentX(t,t.x-n*i)}return t.x},i.prototype.getWheelContentY=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentY(t,t.y+n*i)}return t.y},i.prototype.toContentX=function(t,n){return Math.min(0,Math.max(this.width-t.width,n))},i.prototype.toContentY=function(t,n){return Math.min(0,Math.max(this.height-t.height,n))},i.prototype.isRefitable=function(t){return n.prototype.isRefitable.call(this,t)&&!(t instanceof Ld)},i.prototype.onResize=function(t,i,r,e){var u=this.scrollbar;u.lock(),n.prototype.onResize.call(this,t,i,r,e),u.update(),u.unlock(!0)},i.prototype.onContentChange=function(){this.scrollbar.update()},i.prototype.getFocusedChildClippingRect=function(t,n,i,r,e,u,s,h){return h.x=0,h.y=0,h.width=u,h.height=s,h},i.prototype.onChildFocus=function(r){var e=i.WORK_POINT||new t.Point;i.WORK_POINT=e;var u=this.content,s=u.x,h=u.y,o=u.width,a=u.height;e.set(0,0),r.toGlobal(e,e,!1),u.toLocal(e,void 0,e,!1);var c=s+Math.min(o,Math.max(0,e.x)),f=h+Math.min(a,Math.max(0,e.y));e.set(r.width,r.height),r.toGlobal(e,e,!0),u.toLocal(e,void 0,e,!0);var l=s+Math.min(o,Math.max(0,e.x)),v=h+Math.min(a,Math.max(0,e.y)),b=this.width,d=this.height,g=i.WORK_RECTANGLE||new t.Rectangle;i.WORK_RECTANGLE=g,this.getFocusedChildClippingRect(r,s,h,o,a,b,d,g);var m=g.x,w=g.y,p=m,O=w,D=m+g.width,E=w+g.height,M=null;c<p?l<=D&&(M=s+Math.min(p-c,D-l),M=Math.max(b-o,Math.min(0,M))):D<l&&(M=s-Math.min(c-p,l-D),M=Math.max(b-o,Math.min(0,M)));var S=null;f<O?v<=E&&(S=h+Math.min(O-f,E-v),S=Math.max(d-a,Math.min(0,S))):E<v&&(S=h-Math.min(f-O,v-E),S=Math.max(d-a,Math.min(0,S)));var j=u.position;null!=M?null!=S?j.set(M,S):j.x=M:null!=S&&(j.y=S),n.prototype.onChildFocus.call(this,r)},i.prototype.destroy=function(){var t=this.dr;null!=t&&(this.dr=null,t.destroy()),this.mask=null,n.prototype.destroy.call(this)},i}(hr),zd=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.gf;return null==t&&(t=this.newUpdater(this.data,this.content,this.zn),this.gf=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new Dd(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Xt;return null==t&&(t=this.toData(this.zn),this.Xt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.items),i=null==t?void 0:t.selection;return null==n?i?new Rd(this,{selection:i}):new Rd(this):mt(n)?new Rd(this,i?{items:n,selection:i}:{items:n}):"each"in n?n:i?(void 0===n.selection&&(n.selection=i),new Rd(this,n)):new Rd(this,n)},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!0),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DList"},n}(Hd),Vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUpdater=function(t,n,i){return new Ed(t,n,n,null==i?void 0:i.updater)},n.prototype.getType=function(){return"DDialogSelectList"},n}(zd),Wd=function(t){function n(n){var i=t.call(this)||this;return i.mf=n||function(t){return Promise.resolve([])},i.R=0,i.wf=0,i}return _(n,t),n.prototype.create=function(t){var n=this,i=++this.R;this.mf(t[0]).then((function(t){n.R===i&&(n.wf=i,n.emit("success",n,t),n.emit("change",n))}),(function(){n.R===i&&(n.wf=i,n.emit("fail",n),n.emit("change",n))})),this.emit("change",this)},n.prototype.isDone=function(){return this.R===this.wf},n}(t.utils.EventEmitter),Xd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputSearch"},n}($s),Kd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNote"},n}(Ss),Yd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmall"},n}(Kd),Jd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallError"},n}(Yd),Zd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallNoItemsFound"},n}(Yd),qd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallSearching"},n}(Yd),Qd=function(t){function n(n,i){var r=t.call(this)||this;return r.ei=n,r.Ut=i.value,r.pf=i.filter,n.on("change",(function(){r.emit("change",r)})),n.on("success",(function(t,n){r.emit("success",r,r.toDismissable(n))})),n.on("fail",(function(){r.emit("fail",r)})),r}return _(n,t),n.prototype.toDismissValue=function(t){if(null!=t){var n=this.Ut;if(void 0!==n){var i=this.pf;if(null==i||i(n,t[0]))return n}}},n.prototype.toDismissable=function(t){var n=this.toDismissValue(this.Of);if(void 0===n)return t;for(var i=[],r=0,e=t.length;r<e;++r)i.push(t[r]);return i.push(n),i},n.prototype.create=function(t){this.Of=t,this.ei.create(t)},n.prototype.isDone=function(){return this.ei.isDone()},n}(t.utils.EventEmitter),$d=function(t){function n(n){var i=t.call(this,n)||this;i.Ut=null;var r=new Mb,e=i.search;return e.on("success",(function(t,n){0<n.length?r.hide():r.show(i.noteNoItemsFound),i.onSearched(n)})),e.on("fail",(function(){r.show(i.noteError),i.onSearched([])})),e.on("change",(function(){if(!e.isDone()){var t=i.noteSearching;t&&r.show(t)}})),i}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout,this.list),r},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.Ch;return null==t&&(t=this.newInputLayout(this.input,this.theme,this.zn),this.Ch=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(t,n,i){return new Is(this.toInputLayoutOptions(t,n,i))},n.prototype.toInputLayoutOptions=function(t,n,i){var r=this.toInputMargin(n,i);return{width:"padding",height:"auto",children:[new Xu({width:r}),t,new Xu({width:r})]}},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.Ah;return null==t&&(t=this.newInput(),this.Ah=t),t},enumerable:!1,configurable:!0}),n.prototype.newInput=function(){var t=this,n=new Xd(this.toInputOptions(this.theme,this.zn));return n.on("input",(function(n){t.search.create([n])})),n},n.prototype.toInputOptions=function(t,n){var i=(null==n?void 0:n.input)||{};return void 0===i.width&&void 0===i.weight&&(i.weight=1),i},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"list",{get:function(){var t=this.Un;return null==t&&(t=this.newList(),this.Un=t),t},enumerable:!1,configurable:!0}),n.prototype.newList=function(){var t=this,n=new Vd(this.toListOptions(this.theme,this.zn));return n.selection.on("change",(function(n){t.onListSelectionChange(n)})),n},n.prototype.onListSelectionChange=function(t){var n=t.first;if(null!=n){var i=this.zn;if(i){var r=i.dismiss;r&&n===r.value&&(n=null)}this.Ut=n,this.onOk(n)}},n.prototype.toListOptions=function(t,n){var i=(null==n?void 0:n.list)||{};return void 0===i.width&&(i.width="padding"),i},Object.defineProperty(n.prototype,"noteError",{get:function(){var t=this.Df;return null==t&&(t=this.newNoteError(),this.Df=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteError=function(){var t,n,i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.error;return null!==i?new Jd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteNoItemsFound",{get:function(){var t=this.Ef;return null==t&&(t=this.newNoteNoItemsFound(),this.Ef=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteNoItemsFound=function(){var t,n,i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.noItemsFound;return null!==i?new Zd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteSearching",{get:function(){var t=this.Mf;return null==t&&(t=this.newNoteSearching(),this.Mf=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteSearching=function(){var t,n,i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.searching;return null!=i?new qd(this.toNoteOptions(this.list,i)):null},n.prototype.toNoteOptions=function(t,n){return null!=n?(null==n.parent&&(n.parent=t),null==n.visible&&(n.visible=!1),n):{parent:t,visible:!1}},Object.defineProperty(n.prototype,"search",{get:function(){var t=this.mf;return null==t&&(t=this.newSearch(),this.mf=t),t},enumerable:!1,configurable:!0}),n.prototype.newSearch=function(){var t=this.zn;if(t){var n=t.controller;if(n){var i=t.dismiss,r=n.search;return"create"in r?null!=i?new Qd(r,i):r:null!=i?new Qd(new Wd(r),i):new Wd(r)}}return new Wd},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),n.prototype.onSearched=function(t){this.list.data.items=t},n.prototype.getResolvedValue=function(){return this.Ut},n.prototype.getType=function(){return"DDialogSelect"},n.prototype.onOpen=function(){t.prototype.onOpen.call(this),this.list.selection.clear(),this.search.create([this.input.value])},n.prototype.onOk=function(n){this.emit("select",n,this),t.prototype.onOk.call(this,n)},n.prototype.destroy=function(){var n=this.Ah;n&&n.destroy();var i=this.Df;i&&i.destroy();var r=this.Ef;r&&(null==r||r.destroy());var e=this.Mf;e&&(null==e||e.destroy());var u=this.Un;u&&u.destroy(),t.prototype.destroy.call(this)},n}(ys),tg=function(t){return t.value},ng=function(){},ig=function(t){function n(n){var i,r,e=this;return(e=t.call(this,function(t){var n,i,r;if(t){var e,u=null===(n=t.text)||void 0===n?void 0:n.formatter;if(void 0!==u){if(!(e=t.dialog)||!("open"in e)){var s=(e=e||{}).item=e.item||{};void 0===(o=s.text=s.text||{}).formatter&&(o.formatter=u)}}else if(!(e=t.dialog)||!("open"in e)){var h=null===(r=null===(i=null==e?void 0:e.item)||void 0===i?void 0:i.text)||void 0===r?void 0:r.formatter;if(void 0!==h){var o=t.text||{};t.text=o,void 0===o.formatter&&(o.formatter=h)}}}return t}(n))||this).Sf=null!==(i=null==n?void 0:n.getter)&&void 0!==i?i:tg,e.jf=null!==(r=null==n?void 0:n.setter)&&void 0!==r?r:ng,e}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.dialog,u=null!==(i=this.oh)&&void 0!==i?i:null;this.jf(e,u),e.open(this).then((function(){var t=r.Sf(e);t!==u&&(r.text=t,r.emit("change",t,u,r))}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this._c;if(null==n){var i=null===(t=this.zn)||void 0===t?void 0:t.dialog;n=i&&"open"in i?i:new $d(i),this._c=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonSelect"},n}(Ts),rg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.oh)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.Pc;return null==i&&(i=od.toMask(null===(n=null===(t=this.zn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Pc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Mh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:new Date},set:function(t){var n=this.oh;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonTime"},n}(Ts),eg=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=Lb.getCommandController();return r.isDisabled=!e.isUndoable(),e.on("change",(function(){r.isDisabled=!e.isUndoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),Lb.getCommandController().undo()},n}(Ts),ug=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DCanvas"},n}(hr),sg={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3},hg=function(){function t(t){this.Tf=t,this.hu=0}return Object.defineProperty(t.prototype,"shape",{get:function(){var t=this.Xr;return null==t&&(t=this.newShape(),this.Xr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShape=function(){var t,n=this.Tf,i=n.bar,r=new en;return r.points.position=this.newShapePosition(),r.points.style=null!==(t=i.style)&&void 0!==t?t:z.NONE,r.stroke.copy(i.stroke),r.text.copy(n.label),r},t.prototype.newShapePosition=function(){switch(this.Tf.position){case sg.LEFT:case sg.RIGHT:return it.TOP;default:return it.LEFT}},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.shape.attach(t.container)},t.prototype.unbind=function(){var t=this.Xr;null!=t&&t.detach(),this.hu=0,this.Kc=void 0},t.prototype.update=function(){var t=this.Kc,n=this.hu,i=this.Xr;if(null!=i&&null!=t){var r=t.plotArea,e=r.width,u=r.height,s=this.Tf.padding*n;i.disallowUploadedUpdate();var h=i.transform.position,o=i.size;switch(this.Tf.position){case sg.TOP:h.set(.5*e,0-s),o.set(e,0);break;case sg.BOTTOM:h.set(.5*e,u+s),o.set(e,0);break;case sg.LEFT:h.set(0-s,.5*u),o.set(0,u);break;case sg.RIGHT:h.set(e+s,.5*u),o.set(0,u)}return i.allowUploadedUpdate(),!0}return!1},t.prototype.destroy=function(){var t=this.Xr;null!=t&&t.destroy(),this.hu=0,this.Kc=void 0},t}(),og=function(){function t(t){this.Nf=t,this.hu=0,this.Un=[]}return t.prototype.add=function(t){this.Un.push(t);var n=this.Kc,i=this.hu;return null!=n&&t.bind(n,i,this.Nf),this},t.prototype.get=function(t){var n=this.Un;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Un.indexOf(t)},t.prototype.clear=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Un.length},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n;for(var i=this.Nf,r=this.Un,e=0,u=r.length;e<u;++e)r[e].bind(t,n,i)},t.prototype.unbind=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].unbind();this.hu=0,this.Kc=void 0},t.prototype.update=function(){for(var t=!1,n=this.Un,i=0,r=n.length;i<r;++i)n[i].update()&&(t=!0);return t},t.prototype.destroy=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].destroy();this.hu=0,this.Kc=void 0},t}(),ag={INSIDE:0,OUTSIDE:1},cg=function(){function t(t,n){var i,r;this.coordinate=null!==(i=null==n?void 0:n.coordinate)&&void 0!==i?i:0,this.position=this.toPosition(t,n),this.tick=this.toTick(t,n),this.label=this.toLabel(t,n),this.padding=null!==(r=null==n?void 0:n.padding)&&void 0!==r?r:t.getPadding(),this.bar=this.toBar(t,n),this.guide=this.toGuide(t,n)}return t.prototype.toPosition=function(t,n){var i=null==n?void 0:n.position;return Ot(i)?sg[i]:null!=i?i:t.getPosition()},t.prototype.toGuide=function(t,n){var i,r;return{list:null!==(r=null===(i=null==n?void 0:n.guide)||void 0===i?void 0:i.list)&&void 0!==r?r:[]}},t.prototype.toBar=function(t,n){var i;return{style:null!==(i=null==n?void 0:n.style)&&void 0!==i?i:t.getStyle(),stroke:this.toBarStroke(t,null==n?void 0:n.stroke)}},t.prototype.toTick=function(t,n){var i,r=null==n?void 0:n.tick;return{enable:null!==(i=null==r?void 0:r.enable)&&void 0!==i?i:t.getTickEnable(),major:this.toTickMajor(t,r),minor:this.toTickMinor(t,r)}},t.prototype.toTickMajor=function(t,n){var i,r,e,u,s,h,o,a,c=null==n?void 0:n.major,f=null!==(r=null!==(i=null==c?void 0:c.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMajorTickPosition(),l=null==n?void 0:n.style,v=Hv.from(null!==(u=null!==(e=null==c?void 0:c.style)&&void 0!==e?e:l)&&void 0!==u?u:t.getMajorTickStyle()),b=null==n?void 0:n.stroke,d=this.toTickMajorStroke(t,null==c?void 0:c.stroke,b),g=null!==(s=null==c?void 0:c.count)&&void 0!==s?s:t.getMajorTickCount();return{count:g,capacity:null!==(h=null==c?void 0:c.capacity)&&void 0!==h?h:t.getMajorTickCapacity(g),step:null!==(o=null==c?void 0:c.step)&&void 0!==o?o:t.getMajorTickStep(),size:null!==(a=null==c?void 0:c.size)&&void 0!==a?a:t.getMajorTickSize(),position:this.toTickPosition(f),style:v,stroke:d,text:this.toTickMajorText(t,null==c?void 0:c.text),formatter:this.toTickMajorFormatter(t,c),gridline:this.toTickMajorGridline(t,null==c?void 0:c.gridline,l,b)}},t.prototype.toTickMajorGridline=function(t,n,i,r){var e,u,s,h=Hv.from(null!==(u=null!==(e=null==n?void 0:n.style)&&void 0!==e?e:i)&&void 0!==u?u:t.getMajorTickGridlineStyle());return{enable:null!==(s=null==n?void 0:n.enable)&&void 0!==s?s:t.getMajorTickGridlineEnable(),style:h,stroke:this.toTickMajorGridlineStroke(t,null==n?void 0:n.stroke,r)}},t.prototype.toTickPosition=function(t){var n=this.position;if(t===ag.OUTSIDE||"OUTSIDE"===t)switch(n){case sg.TOP:return it.BOTTOM;case sg.BOTTOM:return it.TOP;case sg.LEFT:return it.RIGHT;case sg.RIGHT:return it.LEFT;default:return it.TOP}else switch(n){case sg.TOP:return it.TOP;case sg.BOTTOM:return it.BOTTOM;case sg.LEFT:return it.LEFT;case sg.RIGHT:return it.RIGHT;default:return it.TOP}},t.prototype.toTickMinor=function(t,n){var i,r,e,u,s,h,o,a=null==n?void 0:n.minor,c=null!==(r=null!==(i=null==a?void 0:a.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMinorTickPosition(),f=Hv.from(null!==(u=null!==(e=null==a?void 0:a.style)&&void 0!==e?e:null==n?void 0:n.style)&&void 0!==u?u:t.getMinorTickStyle());return{count:null!==(s=null==a?void 0:a.count)&&void 0!==s?s:t.getMinorTickCount(),step:null!==(h=null==a?void 0:a.step)&&void 0!==h?h:t.getMinorTickStep(),size:null!==(o=null==a?void 0:a.size)&&void 0!==o?o:t.getMinorTickSize(),position:this.toTickPosition(c),style:f,stroke:this.toTickMinorStroke(t,null==a?void 0:a.stroke,null==n?void 0:n.stroke),text:this.toTickMinorText(t,null==a?void 0:a.text),formatter:this.toTickMinorFormatter(t,a)}},t.prototype.toBarStroke=function(t,n){return this.toStroke(n,void 0,t.getStrokeEnable(),t.getStrokeColor(),t.getStrokeAlpha(),t.getStrokeWidth(),t.getStrokeAlign(),t.getStrokeSide(),t.getStrokeStyle())},t.prototype.toTickMajorStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickStrokeEnable(),t.getMajorTickStrokeColor(),t.getMajorTickStrokeAlpha(),t.getMajorTickStrokeWidth(),t.getMajorTickStrokeAlign(),t.getMajorTickStrokeSide(),t.getMajorTickStrokeStyle())},t.prototype.toTickMajorGridlineStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickGridlineStrokeEnable(),t.getMajorTickGridlineStrokeColor(),t.getMajorTickGridlineStrokeAlpha(),t.getMajorTickGridlineStrokeWidth(),t.getMajorTickGridlineStrokeAlign(),t.getMajorTickGridlineStrokeSide(),t.getMajorTickGridlineStrokeStyle())},t.prototype.toTickMinorStroke=function(t,n,i){return this.toStroke(n,i,t.getMinorTickStrokeEnable(),t.getMinorTickStrokeColor(),t.getMinorTickStrokeAlpha(),t.getMinorTickStrokeWidth(),t.getMinorTickStrokeAlign(),t.getMinorTickStrokeSide(),t.getMinorTickStrokeStyle())},t.prototype.toStroke=function(t,n,i,r,e,u,s,h,o){var a,c,f,l,v,b,d,g,m,w,p,O,D,E,M,S,j,T,N,I,C,A,R,k,L,y,x,B;return t?n?{enable:null!==(c=null!==(a=t.enable)&&void 0!==a?a:n.enable)&&void 0!==c?c:i,color:null!==(l=null!==(f=t.color)&&void 0!==f?f:n.color)&&void 0!==l?l:r,alpha:null!==(b=null!==(v=t.alpha)&&void 0!==v?v:n.alpha)&&void 0!==b?b:e,width:null!==(g=null!==(d=t.width)&&void 0!==d?d:n.width)&&void 0!==g?g:u,align:null!==(w=null!==(m=t.align)&&void 0!==m?m:n.align)&&void 0!==w?w:s,side:null!==(O=null!==(p=t.side)&&void 0!==p?p:n.side)&&void 0!==O?O:h,style:this.toStrokeStyle(null!==(E=null!==(D=t.style)&&void 0!==D?D:n.style)&&void 0!==E?E:o)}:{enable:null!==(M=t.enable)&&void 0!==M?M:i,color:null!==(S=t.color)&&void 0!==S?S:r,alpha:null!==(j=t.alpha)&&void 0!==j?j:e,width:null!==(T=t.width)&&void 0!==T?T:u,align:null!==(N=t.align)&&void 0!==N?N:s,side:null!==(I=t.side)&&void 0!==I?I:h,style:this.toStrokeStyle(null!==(C=t.style)&&void 0!==C?C:o)}:n?{enable:null!==(A=n.enable)&&void 0!==A?A:i,color:null!==(R=n.color)&&void 0!==R?R:r,alpha:null!==(k=n.alpha)&&void 0!==k?k:e,width:null!==(L=n.width)&&void 0!==L?L:u,align:null!==(y=n.align)&&void 0!==y?y:s,side:null!==(x=n.side)&&void 0!==x?x:h,style:this.toStrokeStyle(null!==(B=n.style)&&void 0!==B?B:o)}:{enable:i,color:r,alpha:e,width:u,align:s,side:h,style:o}},t.prototype.toStrokeStyle=function(t){if(Ot(t))return s[t];if(mt(t)){for(var n=s.NONE,i=0,r=t.length;i<r;++i)n|=s[t[i]];return n}return t},t.prototype.toTickMajorFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null===r)return;if(null!=r)return Mi.create(r);var e=i.formatter;if(e)return{format:e}}var u=t.getMajorTickTextFormat();if(null!=u)return Mi.create(u)},t.prototype.toTickMajorText=function(t,n){return{format:(n=n||{}).format,color:this.toTickMajorTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:Ai(n.weight,d),align:this.toTickMajorTextAlign(t,n.align),offset:this.toTickMajorTextOffset(t,n.offset),style:Ai(n.style,g),outline:this.toTickMajorTextOutline(t,n.outline),spacing:this.toTickMajorTextSpacing(t,n.spacing),direction:this.toTickMajorTextDirection(t,n.direction),padding:this.toTickMajorTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toTickMajorTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toTickMajorTextAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextAlignVertical(e)}},t.prototype.toTickMajorTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMajorTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMajorTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextPaddingVertical()}},t.prototype.toTickMajorTextDirection=function(t,n){return Ai(null!=n?n:t.getMajorTickTextDirection(),p)},t.prototype.toTickMajorTextColor=function(t,n){return null!=n?n:t.getMajorTickTextColor()},t.prototype.toTickMinorFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null===r)return;if(null!=r)return Mi.create(r);var e=i.formatter;if(e)return{format:e}}var u=t.getMinorTickTextFormat();if(null!=u)return Mi.create(u)},t.prototype.toTickMinorText=function(t,n){return{format:(n=n||{}).format,color:this.toTickMinorTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:Ai(n.weight,d),align:this.toTickMinorTextAlign(t,n.align),offset:this.toTickMinorTextOffset(t,n.offset),style:Ai(n.style,g),outline:this.toTickMinorTextOutline(t,n.outline),spacing:this.toTickMinorTextSpacing(t,n.spacing),direction:this.toTickMinorTextDirection(t,n.direction),padding:this.toTickMinorTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toTickMinorTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toTickMinorTextAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMinorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMinorTickTextAlignVertical(e)}},t.prototype.toTickMinorTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMinorTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMinorTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMinorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMinorTickTextPaddingVertical()}},t.prototype.toTickMinorTextDirection=function(t,n){return Ai(null!=n?n:t.getMinorTickTextDirection(),p)},t.prototype.toTickMinorTextColor=function(t,n){return null!=n?n:t.getMinorTickTextColor()},t.prototype.toLabel=function(t,n){var i=null==n?void 0:n.label;if(i)return{value:i.value,color:this.toLabelColor(t,i.color),alpha:i.alpha,family:i.family,size:i.size,weight:Ai(i.weight,d),align:this.toLabelAlign(t,i.align),offset:this.toLabelOffset(t,i.offset),style:Ai(i.style,g),outline:this.toLabelOutline(t,i.outline),spacing:this.toLabelSpacing(t,i.spacing),direction:this.toLabelDirection(t,i.direction),padding:this.toLabelPadding(t,i.padding),clipping:i.clipping}},t.prototype.toLabelOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toLabelAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelAlignVertical(e)}},t.prototype.toLabelOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelPaddingVertical()}},t.prototype.toLabelDirection=function(t,n){return Ai(null!=n?n:t.getLabelDirection(),p)},t.prototype.toLabelColor=function(t,n){return null!=n?n:t.getLabelColor()},t}(),fg=function(){function t(t){this.Tf=t,this.hu=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Hr;return null==t&&(t=this.newShapes(),this.Hr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.Tf.tick,r=i.major,e=r.gridline;if(i.enable&&e.enable)for(var u=r.capacity,s=null!==(t=e.style)&&void 0!==t?t:z.NONE,h=this.newShapePosition(),o=0;o<u;++o){var a=new en;a.points.position=h,a.points.style=s,a.stroke.copy(e.stroke),n.push(a)}return n},t.prototype.newShapePosition=function(){switch(this.Tf.position){case sg.LEFT:case sg.RIGHT:return it.LEFT;default:return it.TOP}},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.hu=0,this.Kc=void 0},t.prototype.destroy=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.hu=0,this.Kc=void 0},t}(),lg=function(){function t(t){this.Tf=t,this.hu=0,this.If=new fg(t)}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Hr;return null==t&&(t=this.newShapes(),this.Hr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.Tf.tick;if(i.enable)for(var r=i.major,e=r.capacity,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:z.NONE,o=0;o<e;++o){var a=new en;a.points.position=s,a.points.size=u,a.points.style=h,a.stroke.copy(r.stroke),a.text.copy(r.text),a.size.set(0,0),n.push(a)}return n},Object.defineProperty(t.prototype,"gridline",{get:function(){return this.If},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.If.bind(t,n);for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.If.unbind(),this.hu=0,this.Kc=void 0},t.prototype.destroy=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.If.destroy(),this.hu=0,this.Kc=void 0},t}(),vg=function(){function t(t){this.Tf=t,this.hu=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Hr;return null==t&&(t=this.newShapes(),this.Hr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.Tf.tick;if(i.enable)for(var r=i.minor,e=r.count,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:z.NONE,o=0,a=(i.major.capacity+1)*e;o<a;++o){var c=new en;c.points.position=s,c.points.size=u,c.points.style=h,c.stroke.copy(r.stroke),c.text.copy(r.text),c.size.set(0,0),n.push(c)}return n},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.hu=0,this.Kc=void 0},t.prototype.destroy=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.hu=0,this.Kc=void 0},t}(),bg=function(){function t(t,n){this.from=t,this.to=n}return t.prototype.set=function(t,n){return null!=t&&(this.from=t),null!=n&&(this.to=n),this},t.prototype.add=function(t,n){return Sh(t)||(this.from=Sh(this.from)?t:Math.min(this.from,t)),Sh(n)||(this.to=Sh(this.to)?n:Math.max(this.to,n)),this},t.prototype.clear=function(){return this.from=NaN,this.to=NaN,this},t}(),dg=function(){function t(t,n){this.Tf=t,this.hu=0,this.Cf=this.newMajor(t,n),this.Af=this.newMinor(t,n),this.Rf=[],this.kf=[],this.Mu=new bg(0,0)}return Object.defineProperty(t.prototype,"major",{get:function(){return this.Cf},enumerable:!1,configurable:!0}),t.prototype.newMajor=function(t,n){return new lg(t)},Object.defineProperty(t.prototype,"minor",{get:function(){return this.Af},enumerable:!1,configurable:!0}),t.prototype.newMinor=function(t,n){return new vg(t)},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.Cf.bind(t,n),this.Af.bind(t,n)},t.prototype.unbind=function(){this.Af.unbind(),this.Cf.unbind(),this.hu=0,this.Kc=void 0},t.prototype.update=function(){var t=this.Kc,n=this.Cf.shapes,i=this.Af.shapes;if(null!=t&&n&&i){var r=t.plotArea,e=r.container.transform.localTransform,u=this.Cf.gridline.shapes,s=this.Tf,h=s.padding*this.hu,o=this.Mu,a=void 0;switch(s.position){case sg.TOP:if(a=r.coordinate.x.get(s.coordinate)){var c=(d=this.getDomain(r,a,o)).from,f=d.to,l=(g=this.getDomainVisible(r,a,o)).from,v=g.to,b=r.height;return this.updateX(c,f,l,v,a,n,i,u,0-h,e,b)}break;case sg.BOTTOM:var d,g;if(a=r.coordinate.x.get(s.coordinate))return c=(d=this.getDomain(r,a,o)).from,f=d.to,l=(g=this.getDomainVisible(r,a,o)).from,v=g.to,b=r.height,this.updateX(c,f,l,v,a,n,i,u,b+h,e,b);break;case sg.LEFT:if(a=r.coordinate.y.get(s.coordinate)){var m=(E=this.getRange(r,a,o)).from,w=E.to,p=(M=this.getRangeVisible(r,a,o)).from,O=M.to,D=r.width;return this.updateY(m,w,p,O,a,n,i,u,0-h,e,D)}break;case sg.RIGHT:var E,M;if(a=r.coordinate.y.get(s.coordinate))return m=(E=this.getRange(r,a,o)).from,w=E.to,p=(M=this.getRangeVisible(r,a,o)).from,O=M.to,D=r.width,this.updateY(m,w,p,O,a,n,i,u,D+h,e,D)}}return!1},t.prototype.getDomain=function(t,n,i){var r=t.getBoundsInContainer(),e=n.transform;return i.set(n.unmap(e.unmap(r.x)),n.unmap(e.unmap(r.x+r.width)))},t.prototype.getDomainVisible=function(t,n,i){return i},t.prototype.getRange=function(t,n,i){var r=t.getBoundsInContainer(),e=n.transform;return i.set(n.unmap(e.unmap(r.y)),n.unmap(e.unmap(r.y+r.height)))},t.prototype.getRangeVisible=function(t,n,i){return i},t.prototype.updateX=function(t,n,i,r,e,u,s,h,o,a,c){var f=this.Tf.tick,l=f.major,v=l.count,b=l.capacity,d=l.step,g=l.formatter,m=f.minor,w=m.count,p=(b+1)*w,O=m.step,D=m.formatter,E=this.Rf,M=this.kf;this.newTicks(e,t,n,i,r,v,b,d,w,p,O,E,M);for(var S=a.a,j=a.tx,T=0;T<b;++T){var N=u[T],I=3*T,C=E[I+0];if(isNaN(C))this.hideMajor(N),T<h.length&&this.hideMajorGridline(h[T]);else{var A=S*E[I+1]+j,R=E[I+2];this.showMajor(N,A,o,null==g?void 0:g.format(C,R)),T<h.length&&this.showMajorGridline(h[T],C,A,.5*c,0,c)}}for(T=0;T<p;++T){var k=s[T],L=3*T,y=M[L+0];if(isNaN(y))this.hideMinor(k);else{var x=S*M[L+1]+j,B=M[L+2];this.showMinor(k,x,o,null==D?void 0:D.format(y,B))}}return!0},t.prototype.updateY=function(t,n,i,r,e,u,s,h,o,a,c){var f=this.Tf.tick,l=f.major,v=l.count,b=l.capacity,d=l.step,g=l.formatter,m=f.minor,w=m.count,p=(b+1)*w,O=m.step,D=m.formatter,E=this.Rf,M=this.kf;this.newTicks(e,t,n,i,r,v,b,d,w,p,O,E,M);for(var S=a.d,j=a.ty,T=0;T<b;++T){var N=u[T],I=3*T,C=E[I+0];if(isNaN(C))this.hideMajor(N),T<h.length&&this.hideMajorGridline(h[T]);else{var A=S*E[I+1]+j,R=E[I+2];this.showMajor(N,o,A,null==g?void 0:g.format(C,R)),T<h.length&&this.showMajorGridline(h[T],C,.5*c,A,c,0)}}for(T=0;T<p;++T){var k=s[T],L=3*T,y=M[L+0];if(isNaN(y))this.hideMinor(k);else{var x=S*M[L+1]+j,B=M[L+2];this.showMinor(k,o,x,null==D?void 0:D.format(y,B))}}return!0},t.prototype.showMajor=function(t,n,i,r){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(n,i),t.text.value=null!=r?r:"",t.allowUploadedUpdate()},t.prototype.showMajorGridline=function(t,n,i,r,e,u){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(i,r),t.size.set(e,u),t.allowUploadedUpdate()},t.prototype.hideMajor=function(t){t.visible=!1},t.prototype.hideMajorGridline=function(t){t.visible=!1},t.prototype.showMinor=function(t,n,i,r){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(n,i),t.text.value=null!=r?r:"",t.allowUploadedUpdate()},t.prototype.hideMinor=function(t){t.visible=!1},t.prototype.newTicks=function(t,n,i,r,e,u,s,h,o,a,c,f,l){t.ticks(n,i,r,e,u,s,h,o,a,c,f,l)},t.prototype.destroy=function(){this.Cf.destroy(),this.Af.destroy(),this.hu=0,this.Kc=void 0},t}(),gg=function(){function t(t){var n=this.toTheme(t);this.cn=n;var i=this.newParser(n,t);this.Tf=i,this.hu=0,this.Lf=this.newBar(i,n,t),this.yf=this.newTick(i,n,t),this.xf=this.newGuide(i,n,t)}return t.prototype.newParser=function(t,n){return new cg(t,n)},Object.defineProperty(t.prototype,"position",{get:function(){return this.Tf.position},set:function(t){this.Tf.position=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"coordinate",{get:function(){return this.Tf.coordinate},set:function(t){this.Tf.coordinate=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this.Tf.padding},set:function(t){this.Tf.padding=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bar",{get:function(){return this.Lf},enumerable:!1,configurable:!0}),t.prototype.newBar=function(t,n,i){return new hg(t)},Object.defineProperty(t.prototype,"tick",{get:function(){return this.yf},enumerable:!1,configurable:!0}),t.prototype.newTick=function(t,n,i){return new dg(t)},Object.defineProperty(t.prototype,"guide",{get:function(){return this.xf},enumerable:!1,configurable:!0}),t.prototype.newGuide=function(t,n,i){for(var r=new og(this),e=t.guide.list,u=0,s=e.length;u<s;++u)r.add(e[u]);return r},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.Lf.bind(t,n),this.yf.bind(t,n),this.xf.bind(t,n)},t.prototype.unbind=function(){this.xf.unbind(),this.yf.unbind(),this.Lf.unbind(),this.hu=0,this.Kc=void 0},t.prototype.update=function(){var t=this.Lf.update(),n=this.yf.update(),i=this.xf.update();if(t||n||i){var r=this.Kc;r&&st.update(r.plotArea)}},t.prototype.onRender=function(){this.Lf.update(),this.yf.update(),this.xf.update()},t.prototype.destroy=function(){this.Lf.destroy(),this.yf.destroy(),this.xf.destroy(),this.Kc=void 0},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartAxisBase"},t}(),mg=function(){function t(t,n){this.Bf=t,this.Kc=new ye,this.Un=new Map}return Object.defineProperty(t.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Bf},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var n=this.Un,i=n.get(t.position);null==i&&(i=[],n.set(t.position,i)),i.push(t),t.bind(this,i.length-1)},t.prototype.get=function(t,n){var i=this.Un.get(Ai(t,sg));return i&&0<=n&&n<i.length?i[n]:null},t.prototype.indexOf=function(t){var n=this.Un.get(t.position);return n?n.indexOf(t):-1},t.prototype.clear=function(t){var n=this.Un.get(Ai(t,sg));if(n){for(var i=0,r=n.length;i<r;++i)n[i].destroy();n.length=0}return this},t.prototype.size=function(t){var n=this.Un.get(Ai(t,sg));return n?n.length:0},t.prototype.update=function(){this.Un.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].update()}))},t.prototype.onRender=function(){this.Un.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].onRender()}))},t.prototype.destroy=function(){this.Un.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].destroy();t.length=0}))},t}(),wg=function(){function t(t){this.zn=t}return Object.defineProperty(t.prototype,"bar",{get:function(){var t=this.Lf;return void 0===t&&(t=this.newBar(),this.Lf=t),t},enumerable:!1,configurable:!0}),t.prototype.newBar=function(){var t,n,i=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.bar)&&void 0!==n?n:{};if(!1!==i.enable){var r=new en;return r.stroke.copy(this.toStrokeOptions(i.stroke,s.DASHED)),r.text.copy(this.toTextOptions(i.text)),r}return null},t.prototype.toStrokeOptions=function(t,n){var i;return{enable:(t=t||{}).enable,color:t.color,alpha:t.alpha,width:t.width,align:t.align,side:Ai(t.side,qt),style:Ai(null!==(i=t.style)&&void 0!==i?i:n,s)}},t.prototype.toTextOptions=function(t){return{value:(t=t||{}).value,color:t.color,alpha:t.alpha,family:t.family,size:t.size,weight:Ai(t.weight,d),align:this.toTextAlignOptions(t.align),offset:t.offset,style:Ai(t.style,g),outline:t.outline,spacing:t.spacing,direction:Ai(t.direction,p),padding:t.padding,clipping:t.clipping,fitting:t.fitting}},t.prototype.toTextAlignOptions=function(t){return{horizontal:Ai(null==(t=t||{})?void 0:t.horizontal,m),vertical:Ai(null==t?void 0:t.vertical,w)}},t.prototype.toBarPosition=function(t){switch(t.position){case sg.LEFT:case sg.RIGHT:return it.LEFT;default:return it.TOP}},Object.defineProperty(t.prototype,"label",{get:function(){var t=this.Yh;return void 0===t&&(t=this.newLabel(),this.Yh=t),t},enumerable:!1,configurable:!0}),t.prototype.newLabel=function(){var t,n,i,r,e=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.label)&&void 0!==n?n:{};if(!0===e.enable){var u=new Po;return u.stroke.copy(this.toStrokeOptions(e.stroke)),u.fill.copy(e.fill),u.text.copy(this.toTextOptions(e.text)),u.size.set(null!==(i=e.width)&&void 0!==i?i:50,null!==(r=e.height)&&void 0!==r?r:30),u}return null},Object.defineProperty(t.prototype,"labelMargin",{get:function(){var t=this._f;return null==t&&(t=this.newLabelMargin(),this._f=t),t},enumerable:!1,configurable:!0}),t.prototype.newLabelMargin=function(){var t=this.zn;if(null!=t){var n=t.label;if(null!=n){var i=n.margin;if(null!=i)return i}}return 10},Object.defineProperty(t.prototype,"tick",{get:function(){var t=this.yf;return void 0===t&&(t=this.newTick(),this.yf=t),t},enumerable:!1,configurable:!0}),t.prototype.newTick=function(){var t,n,i,r=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.tick)&&void 0!==n?n:{};if(!0===r.enable){var e=new en;e.stroke.copy(this.toStrokeOptions(r.stroke)),e.text.copy(this.toTextOptions(r.text));var u=null!==(i=r.size)&&void 0!==i?i:5;return e.size.set(u,u),e}return null},Object.defineProperty(t.prototype,"tickMargin",{get:function(){var t=this.Pf;return null==t&&(t=this.newTickMargin(),this.Pf=t),t},enumerable:!1,configurable:!0}),t.prototype.newTickMargin=function(){var t=this.zn;if(null!=t){var n=t.tick;if(null!=n){var i=n.margin;if(null!=i)return i}}return 0},t.prototype.toTickPosition=function(t){switch(t.position){case sg.LEFT:case sg.RIGHT:return it.LEFT;default:return it.TOP}},t.prototype.bind=function(t,n,i){var r=this.bar;null!=r&&(r.points.position=this.toBarPosition(i),r.attach(t.container));var e=this.label;null!=e&&e.attach(t.container);var u=this.tick;null!=u&&(u.points.position=this.toTickPosition(i),u.attach(t.container))},t.prototype.unbind=function(){var t=this.Lf;null!=t&&t.detach();var n=this.Yh;null!=n&&n.detach();var i=this.yf;null!=i&&i.detach()},t.prototype.update=function(t,n,i,r,e,u,s){var h=this.Lf;if(null!=h){switch(h.disallowUploadedUpdate(),t){case sg.TOP:case sg.BOTTOM:h.transform.position.set(n,i),h.size.set(0,u),h.visible=r;break;case sg.LEFT:case sg.RIGHT:h.transform.position.set(n,i),h.size.set(e,0),h.visible=r}h.allowUploadedUpdate()}var o=this.Yh;if(null!=o){var a=this.labelMargin,c=s+.5*(v=o.size).x+a,f=s+.5*v.y+a;switch(o.disallowUploadedUpdate(),t){case sg.TOP:o.transform.position.set(n,-f),o.visible=r;break;case sg.BOTTOM:o.transform.position.set(n,u+f),o.visible=r;break;case sg.LEFT:o.transform.position.set(-c,i),o.visible=r;break;case sg.RIGHT:o.transform.position.set(e+c,i),o.visible=r}o.allowUploadedUpdate()}var l=this.yf;if(null!=l){var v;switch(a=this.tickMargin,c=s+.5*(v=l.size).x+a,f=s+.5*v.y+a,l.disallowUploadedUpdate(),t){case sg.TOP:l.transform.position.set(n,-f),l.visible=r;break;case sg.BOTTOM:l.transform.position.set(n,u+f),l.visible=r;break;case sg.LEFT:l.transform.position.set(-c,i),l.visible=r;break;case sg.RIGHT:l.transform.position.set(e+c,i),l.visible=r}l.allowUploadedUpdate()}return!0},t.prototype.destroy=function(){var t=this.Lf;null!=t&&t.destroy();var n=this.Yh;null!=n&&n.destroy();var i=this.yf;null!=i&&i.destroy()},t}(),pg=function(){function n(n){var i;this.zn=n,this.hu=0,this._=null!==(i=null==n?void 0:n.position)&&void 0!==i?i:0,this.Mu=new t.Point,this.Ff=!0}return Object.defineProperty(n.prototype,"shape",{get:function(){var t=this.Xr;return null==t&&(t=this.newShape(),this.Xr=t),t},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){return new wg(this.zn)},Object.defineProperty(n.prototype,"position",{get:function(){return this._},set:function(t){this._=t},enumerable:!1,configurable:!0}),n.prototype.show=function(){return this.Ff=!0,this},n.prototype.isShown=function(){return this.Ff},n.prototype.hide=function(){return this.Ff=!1,this},n.prototype.isHidden=function(){return!this.Ff},n.prototype.bind=function(t,n,i){this.Kc=t,this.hu=n,this.Nf=i,this.shape.bind(t,n,i)},n.prototype.unbind=function(){var t=this.Xr;null!=t&&t.unbind(),this.Nf=void 0,this.hu=0,this.Kc=void 0},n.prototype.update=function(){var t=this.Kc,n=this.hu,i=this.Xr,r=this.Nf;if(null!=i&&null!=t&&null!=r){var e=t.plotArea,u=e.container.transform.localTransform,s=e.width,h=e.height,o=r.padding*n;switch(r.position){case sg.TOP:case sg.BOTTOM:var a=e.coordinate.x.get(r.coordinate);if(a){(l=this.Mu).set(a.transform.map(a.map(this._)),0),u.apply(l,l);var c=l.x;i.update(r.position,c,.5*h,this.Ff&&0<=c&&c<=s,s,h,o)}else i.update(r.position,0,.5*h,!1,s,h,o);break;case sg.LEFT:case sg.RIGHT:var f=e.coordinate.y.get(r.coordinate);if(f){var l;(l=this.Mu).set(0,f.transform.map(f.map(this._))),u.apply(l,l);var v=l.y;i.update(r.position,.5*s,v,this.Ff&&0<=v&&v<=h,s,h,o)}else i.update(r.position,.5*s,0,!1,s,h,o)}return!0}return!1},n.prototype.destroy=function(){var t=this.Xr;null!=t&&t.destroy(),this.hu=0,this.Kc=void 0},n}(),Og=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisX"},n}(gg),Dg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisXDatetime"},n}(Og),Eg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisY"},n}(gg),Mg=[1095651,16667680,15778578,1858929],Sg=[Mg[0],an.brighten(Mg[0],.4),Mg[1],an.brighten(Mg[1],.4),Mg[2],an.brighten(Mg[2],.4),Mg[3],an.brighten(Mg[3],.4)],jg=function(t){return Sg[t%Sg.length]},Tg={X:0,Y:1},Ng=function(){function t(t){this.cn=this.toTheme(t),this.R=0,this.Uf=null==t?void 0:t.translation,this.Gf=0,this.Hf=null==t?void 0:t.scaling,this.Gn=1,this.zf=0,this.Vf=1}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translate",{get:function(){return this.Gf},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this.Gn},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.set(0,n===Tg.X?1:-1)},t.prototype.unbind=function(){},t.prototype.set=function(t,n){var i=!1;null!=t&&!1!==this.Uf&&this.Gf!==t&&(i=!0,this.Gf=t),null!=n&&!1!==this.Hf&&this.Gn!==n&&(i=!0,this.Gn=n),i&&(this.R+=1,this.Vf=this.cn.isZero(this.Gn)?0:1/this.Gn,this.zf=-this.Gf*this.Vf)},t.prototype.blend=function(t,n){var i=1-t,r=n.newTranslate*t+n.oldTranslate*i,e=n.newScale*t+n.oldScale*i;this.set(r,e)},t.prototype.map=function(t){return this.Gf+this.Gn*t},t.prototype.mapAll=function(t,n,i,r,e){for(var u=this.Gf,s=this.Gn,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.unmap=function(t){return this.zf+this.Vf*t},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=this.zf,s=this.Vf,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTransform"},t}(),Ig=function(){function t(){this.oldTranslate=0,this.oldScale=1,this.newTranslate=0,this.newScale=1}return t.prototype.set=function(t,n){null!=t&&(this.newTranslate=t),null!=n&&(this.newScale=n)},t}(),Cg=function(){function t(t){this.R=0,this.rn=Tg.X,this.cn=this.toTheme(t),this.I=this.newTransform(null==t?void 0:t.transform),this.yf=this.newTick(null==t?void 0:t.tick),this.Mu=this.newRegion(),this.Wf=this.newMark(),this.Bt=null==t?void 0:t.from,this.Pt=null==t?void 0:t.to}return t.prototype.newTransform=function(t){return new Ng(t)},t.prototype.newRegion=function(){return new bg(NaN,NaN)},t.prototype.newMark=function(){return new Ig},Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},set:function(t){this.Bt=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},set:function(t){this.Pt=t},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.Kc=t,this.rn=n,this.I.bind(t,n)},t.prototype.unbind=function(){this.Kc=void 0,this.I.unbind()},t.prototype.fit=function(t,n){this.doFit(t,n,this.I)},t.prototype.mark=function(t,n){var i=this.Wf,r=this.I;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.I.blend(t,this.Wf)},t.prototype.doFit=function(t,n,i){var r=this.Kc;if(r){var e=r.container.plotArea,u=this.Mu;switch(this.rn){case Tg.X:this.getPixelDomain(e,u),this.Xf(u.from,u.to,this.toFitDomain(t,n,e,u),i);break;case Tg.Y:this.getPixelRange(e,u),this.Xf(u.from,u.to,this.toFitRange(t,n,e,u),i)}}},t.prototype.getPixelDomain=function(t,n){var i=t.padding;return n.set(i.getLeft(),t.width-i.getRight())},t.prototype.getPixelRange=function(t,n){var i=t.padding;return n.set(t.height-i.getBottom(),i.getTop())},t.prototype.toFitDomain=function(t,n,i,r){return null==t&&(t=this.Bt),null==n&&(n=this.Pt),null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null==t&&(t=this.Bt),null==n&&(n=this.Pt),null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.Xf=function(t,n,i,r){var e=i.from,u=i.to;if(!Sh(e)&&!Sh(u)){var s,h=this.map(e),o=this.map(u)-h,a=t-h*(s=this.cn.isZero(o)?n<t?-1:1:(n-t)/o);r.set(a,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.I},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return t},t.prototype.mapAll=function(t,n,i,r,e){},t.prototype.unmap=function(t){return t},t.prototype.unmapAll=function(t,n,i,r,e){},t.prototype.ticks=function(t,n,i,r,e,u,s,h,o,a,c,f){this.yf.calculate(t,n,i,r,e,u,s,h,o,a,c,f,this)},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinate"},t}(),Ag=function(){function t(t,n){this.Kc=t,this.rn=n,this.Un=[]}return Object.defineProperty(t.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.Un;return null==n?i.push(t):0<=n&&n<i.length?i.splice(n,0,t):i.push(t),t.bind(this,this.rn),this},t.prototype.get=function(t){var n=this.Un;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Un.indexOf(t)},t.prototype.remove=function(t){var n=this.Un;if(pt(t)){if(0<=(r=t)&&r<n.length){var i=n.splice(r,1)[0];return i.unbind(),i}}else{var r,e=t;if(0<=(r=n.indexOf(e)))return n.splice(r,1),e.unbind(),e}return null},t.prototype.clear=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].unbind();return t.length=0,this},t.prototype.destroy=function(){return this.clear()},t.prototype.size=function(){return this.Un.length},t.prototype.fit=function(t,n){for(var i=this.Un,r=0,e=i.length;r<e;++r)i[r].fit(t,n);return this},t.prototype.mark=function(t,n){for(var i=this.Un,r=0,e=i.length;r<e;++r)i[r].mark(t,n);return this},t.prototype.blend=function(t){for(var n=this.Un,i=0,r=n.length;i<r;++i)n[i].blend(t);return this},t}(),Rg=function(){function t(t,n){this.Bf=t;var i=new Ag(this,Tg.X);this._x=i;var r=new Ag(this,Tg.Y);if(this._y=r,n){var e=n.x;if(e)if(mt(e))for(var u=0,s=e.length;u<s;++u)i.add(e[u]);else i.add(e);var h=n.y;if(h)if(mt(h))for(u=0,s=h.length;u<s;++u)r.add(h[u]);else r.add(h)}}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Bf},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n,i,r){return this._x.fit(t,n),this._y.fit(i,r),this},t.prototype.mark=function(t,n,i,r){return this._x.mark(t,n),this._y.mark(i,r),this},t.prototype.blend=function(t){return this._x.blend(t),this._y.blend(t),this},t}(),kg=function(){function t(t){this.cn=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.cn.toStep(t,n,i):-1:pt(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:pt(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c,f,l){if(!(e<=0)){var v=l.transform,b=Math.min(t,n),d=Math.max(t,n),g=Math.min(i,r),m=Math.max(i,r),w=l.map(g),p=l.map(m),O=Math.min(w,p),D=Math.max(w,p),E=l.map(b),M=l.map(d),S=Math.min(E,M),j=Math.max(E,M),T=Math.max(O,S),N=Math.min(D,j),I=0,C=0,A=this.toMajorStep(E,M,e,s);if(A<=0)T<=E&&E<=N&&(c[0]=b,c[1]=v.map(E),c[2]=0,I+=1);else for(var R=Math.floor(E/A)-1,k=Math.ceil(M/A)+1,L=this.toMinorStep(A,h,a),y=R;y<=k;++y){var x=y*A;I<u&&T<=x&&x<=N&&(c[0+(P=3*I)]=l.unmap(x),c[P+1]=v.map(x),c[P+2]=A,I+=1);for(var B=0;B<h;B+=1)if(C<o){var _=x+(B+1)*L;T<=_&&_<=N&&(f[0+(F=3*C)]=l.unmap(_),f[F+1]=v.map(_),f[F+2]=L,C+=1)}}for(y=I;y<u;++y){var P;c[0+(P=3*y)]=NaN,c[P+1]=NaN,c[P+2]=NaN}for(y=C;y<o;++y){var F;f[0+(F=3*y)]=NaN,f[F+1]=NaN,f[F+2]=NaN}}},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),Lg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newTick=function(t){return new kg(t)},n}(Cg),yg=function(){function t(t){this.cn=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.cn.toStep(t,n,i):-1:pt(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:pt(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c,f,l){if(!(e<=0)){var v=l.transform,b=Math.min(t,n),d=Math.max(t,n),g=Math.min(i,r),m=Math.max(i,r),w=l.map(g),p=l.map(m),O=Math.min(w,p),D=Math.max(w,p),E=l.map(b),M=l.map(d),S=Math.min(E,M),j=Math.max(E,M),T=Math.max(O,S),N=Math.min(D,j),I=0,C=0,A=this.toMajorStep(E,M,e,s);if(A<=0)T<=E&&E<=N&&(c[0]=b,c[1]=v.map(E),c[2]=0,I+=1);else for(var R=Math.floor(E/A)-1,k=Math.ceil(M/A)+1,L=this.toMinorStep(A,h,a),y=R;y<=k;++y){var x=y*A;I<u&&T<=x&&x<=N&&(c[0+(P=3*I)]=l.unmap(x),c[P+1]=v.map(x),c[P+2]=l.unmap(x-1),I+=1);for(var B=0;B<h;B+=1)if(C<o){var _=x+(B+1)*L;T<=_&&_<=N&&(f[0+(F=3*C)]=l.unmap(_),f[F+1]=v.map(_),f[F+2]=l.unmap(_-1),C+=1)}}for(y=I;y<u;++y){var P;c[0+(P=3*y)]=NaN,c[P+1]=NaN,c[P+2]=NaN}for(y=C;y<o;++y){var F;f[0+(F=3*y)]=NaN,f[F+1]=NaN,f[F+2]=NaN}}},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),xg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newTick=function(t){return new yg(t)},n.prototype.map=function(t){return Math.log(Math.max(0,t))/Math.LN10},n.prototype.mapAll=function(t,n,i,r,e){for(var u=1/Math.LN10,s=n+e;s<i;s+=r){var h=t[s];t[s]=Math.log(Math.max(0,h))*u}},n.prototype.unmap=function(t){return Math.pow(10,t)},n.prototype.unmapAll=function(t,n,i,r,e){for(var u=n+e;u<i;u+=r)t[u]=Math.pow(10,t[u])},n}(Cg),Bg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegendItem"},n}(hr),_g=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegend"},n}(hr),Pg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartOverview"},n}(hr),Fg=function(n){function i(i){var r=n.call(this)||this,e=r.transform;return r._=new _i(e.position,i),r.Gn=new _i(e.scale,i),r.Xi=new t.Rectangle,r}return _(i,n),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Gn},enumerable:!1,configurable:!0}),i.prototype.getBounds=function(t,i){return this._lastBoundsID=-1,n.prototype.getBounds.call(this,t,i)},i.prototype.calculateBounds=function(){var t=this._bounds,n=this.Mu,i=this.Xi,r=this.transform.worldTransform,e=0,u=0,s=0,h=0,o=this.children;if(0<o.length)for(var a=!0,c=0,f=o.length;c<f;++c){var l=o[c];l.visible&&(l.getBoundsInternal(!1,i),a?(a=!1,e=i.x,s=i.y,u=i.x+i.width,h=i.y+i.height):(e=Math.min(e,i.x),s=Math.min(s,i.y),u=Math.max(u,i.x+i.width),h=Math.max(h,i.y+i.height)))}t.clear(),n.set(e,s),r.apply(n,n),t.addPoint(n),n.set(u,h),r.apply(n,n),t.addPoint(n)},i}(ye),Ug=function(){function t(){this.shape=null,this.x=0,this.y=0,this.p0x=0,this.p0y=0,this.p1x=0,this.p1y=0,this.index=0,this.t=0,this.distance=0}return t.prototype.copyFrom=function(t){return this.shape=t.shape,this.x=t.x,this.y=t.y,this.p0x=t.p0x,this.p0y=t.p0y,this.p1x=t.p1x,this.p1y=t.p1y,this.index=t.index,this.t=t.t,this.distance=t.distance,this},t}(),Gg=function(){function t(t,n,i){this.enable=t,this.color=n,this.alpha=i}return t.from=function(n,i,r){var e,u,s;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i))},t}(),Hg=function(){function t(){}return t.from=function(t,n){return mt(t)?function(n){return t[n%t.length]}:wt(t)?t:null!=t?function(){return t}:mt(n)?function(t){return n[t%n.length]}:wt(n)?n:function(){return n}},t}(),zg=function(t){this.enable=Hg.from(null==t?void 0:t.enable,!0),this.color=Hg.from(null==t?void 0:t.color,jg),this.alpha=Hg.from(null==t?void 0:t.alpha,q.FILL_ALPHA)},Vg=function(){function t(t,n){this.outer=t,this.inner=n}return t.from=function(n,i,r){var e,u;return new t(null!==(e=null==r?void 0:r.outer)&&void 0!==e?e:n.outer(i),null!==(u=null==r?void 0:r.inner)&&void 0!==u?u:n.inner(i))},t}(),Wg=function(t){this.outer=Hg.from(null==t?void 0:t.outer,.2),this.inner=Hg.from(null==t?void 0:t.inner,.1)},Xg=function(){function t(t,n){this.x=t,this.y=n}return t.from=function(n,i,r,e,u){var s,h;return new t(null!==(s=null==r?void 0:r.x)&&void 0!==s?s:null!=n.x?n.x(i):e,null!==(h=null==r?void 0:r.y)&&void 0!==h?h:null!=n.y?n.y(i):u)},t}(),Kg=function(t){t&&(null!=t.x&&(this.x=Hg.from(t.x,0)),null!=t.y&&(this.y=Hg.from(t.y,0)))},Yg=function(){function t(t,n,i,r,e,u,s){this.enable=t,this.color=n,this.alpha=i,this.width=r,this.align=e,this.side=u,this.style=s}return t.from=function(n,i,r){var e,u,s,h,o,a,c;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i),null!==(h=null==r?void 0:r.width)&&void 0!==h?h:n.width(i),null!==(o=null==r?void 0:r.align)&&void 0!==o?o:n.align(i),null!==(a=null==r?void 0:r.side)&&void 0!==a?a:n.side(i),null!==(c=null==r?void 0:r.style)&&void 0!==c?c:n.style(i))},t}(),Jg=function(t){this.enable=Hg.from(null==t?void 0:t.enable,!0),this.color=Hg.from(null==t?void 0:t.color,jg),this.alpha=Hg.from(null==t?void 0:t.alpha,q.STROKE_ALPHA),this.width=Hg.from(null==t?void 0:t.width,q.STROKE_WIDTH),this.align=Hg.from(null==t?void 0:t.width,q.STROKE_ALIGN),this.side=Hg.from(null==t?void 0:t.side,qt.ALL),this.style=Hg.from(null==t?void 0:t.style,s.NON_SCALING)},Zg=function(){function t(t,n){var i;this.Bf=t,this.Kf=new bg(NaN,NaN),this.Yf=new bg(NaN,NaN),this.tf=null!==(i=null==n?void 0:n.selection)&&void 0!==i?i:null,this.C=new zg(null==n?void 0:n.fill),this.yo=new Jg(null==n?void 0:n.stroke),this.T=new Kg(null==n?void 0:n.size),this.vn=new Kg(null==n?void 0:n.offset),this.Qn=new Wg(null==n?void 0:n.padding),this.Un=[]}return t.prototype.newFill=function(t,n){return Gg.from(this.C,t,n)},t.prototype.newStroke=function(t,n){return Yg.from(this.yo,t,n)},t.prototype.newSize=function(t,n,i,r){return Xg.from(this.T,t,n,i,r)},t.prototype.newOffset=function(t,n,i,r){return Xg.from(this.vn,t,n,i,r)},t.prototype.newPadding=function(t,n){return Vg.from(this.Qn,t,n)},Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Bf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),t.prototype.update=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].update();var r=this.tf;r&&r.update()},t.prototype.onRender=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].onRender();var r=this.tf;r&&r.onRender()},t.prototype.add=function(t){var n=this.Un;t.bind(this,n.length),n.push(t)},t.prototype.get=function(t){var n=this.Un;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Un.indexOf(t)},t.prototype.clear=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Un.length},t.prototype.destroy=function(){this.clear();var t=this.tf;t&&t.unbind()},t.prototype.getDomain=function(t,n){n.clear();for(var i=this.Un,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.x===t){var s=u.domain;n.add(s.from,s.to)}}return n},t.prototype.getRange=function(t,n){n.clear();for(var i=this.Un,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.y===t){var s=u.range;n.add(s.from,s.to)}}return n},Object.defineProperty(t.prototype,"domain",{get:function(){var t=this.Kf;t.clear();for(var n=this.Un,i=0,r=n.length;i<r;++i){var e=n[i].domain;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.Yf;t.clear();for(var n=this.Un,i=0,r=n.length;i<r;++i){var e=n[i].range;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(t,n){for(var i=this.Un,r=i.length-1;0<=r;--r){var e=i[r];if(e.hitTest(t,n))return e}return null},t.prototype.calcHitPoint=function(n,i,r){var e=r,u=t.WORK_CALCHITPOINT,s=this.Un,h=null;u.distance=1/0;for(var o=s.length-1;0<=o;--o){var a=s[o];if(a.calcHitPoint(n,i,e)&&e.distance<u.distance){h=a;var c=e;e=u,u=c}}return h&&u!==r&&r.copyFrom(u),h},t.WORK_CALCHITPOINT=new Ug,t}(),qg=function(n){function i(t,i){var r=n.call(this,i)||this;return r.Jf=t,r.Zf=0,r.qf=1e3,r.Qf=null,r.$f=function(){r.onBlend()},r}return _(i,n),i.prototype.init=function(i){var r,e=this;n.prototype.init.call(this,i),this.tl=!0,this.nl=new t.Rectangle,this.Rc=new t.Point;var u=new Fg((function(){e.il=!0,e.tl=!0,st.update(e)}));this.Kc=u,this.addChild(u),this.il=!0,this.br=new Or(this,(function(){return u}),null==i?void 0:i.view),this.rl=new Rg(this,null==i?void 0:i.coordinate);var s=new Zg(this,null==i?void 0:i.series);this.el=s;var h=new mg(this,null==i?void 0:i.axis);this.Nf=h,this.addChild(h.container);var o=s.selection;if(o&&o.bind(s),(null!==(r=null==i?void 0:i.mask)&&void 0!==r?r:this.theme.isOverflowMaskEnabled())&&(u.mask=this.getOverflowMask()),null!=i){var a=i.series;if(null!=a&&(l=a.list)){var c=l.length;if(0<c){for(var f=0;f<c;++f)s.add(l[f]);s.update()}}var l,v=i.axis;if(null!=v&&(l=v.list)){f=0;for(var b=l.length;f<b;++f)h.add(l[f])}}},i.prototype.onResize=function(t,i,r,e){this.il=!0,this.tl=!0,n.prototype.onResize.call(this,t,i,r,e)},i.prototype.getOverflowMask=function(){return null==this.dr&&(this.dr=new or(this),this.reflowable.add(this.dr),this.toDirty()),this.dr},Object.defineProperty(i.prototype,"chart",{get:function(){return this.Jf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"series",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"axis",{get:function(){return this.Nf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"view",{get:function(){return this.br},enumerable:!1,configurable:!0}),i.prototype.onWheel=function(t,i,r){var e=this.br.onWheel(t,i,r),u=n.prototype.onWheel.call(this,t,i,r);return e||u},i.prototype.onDblClick=function(t,i){var r=this.br.onDblClick(t,i),e=n.prototype.onDblClick.call(this,t,i);return r||e},i.prototype.onDown=function(t){this.br.onDown(t),n.prototype.onDown.call(this,t)},i.prototype.render=function(t){this.il&&(this.il=!1,this.rl.fit(),this.Nf.onRender(),this.el.onRender()),n.prototype.render.call(this,t)},i.prototype.destroy=function(){this.Kc.destroy(),this.el.destroy(),this.Nf.destroy()},i.prototype.getType=function(){return"DChartPlotArea"},i.prototype.getBoundsInContainer=function(){var t=this.nl;if(this.tl){this.tl=!1;var n=this.container;n.updateTransform();var i=n.transform.localTransform,r=this.Rc;r.set(0,0),i.applyInverse(r,r),t.x=r.x,t.y=r.y,r.set(this.width,this.height),i.applyInverse(r,r),t.width=r.x-t.x,t.height=r.y-t.y}return t},i.prototype.fit=function(t,n,i,r,e){var u=this.rl,s=this.Nf,h=this.el;if(null!=t&&t<=0)u.fit(n,i,r,e),s.update(),h.update();else{this.qf=null!=t?t:200,this.Zf=Date.now(),u.mark(n,i,r,e);var o=this.Qf;null!=o&&window.clearTimeout(o),this.Qf=window.setTimeout(this.$f,0)}return this},i.prototype.onBlend=function(){var t=(Date.now()-this.Zf)/this.qf;t<1?this.Qf=window.setTimeout(this.$f,0):(this.Qf=null,t=1),this.rl.blend(vr.ELASTIC(t)),this.Nf.update(),this.el.update()},i}(hr),Qg=function(){function t(t,n,i){this.Bt=t,this.Pt=n,this.ut=i}return Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;return null!=t&&this.Bt!==t&&(Sh(this.Bt)&&Sh(t)||(this.Bt=t,i=!0)),null!=n&&this.Pt!==n&&(Sh(this.Pt)&&Sh(n)||(this.Pt=n,i=!0)),i&&this.ut(),this},t.prototype.add=function(t,n){var i,r;return Sh(t)||(i=Sh(this.from)?t:Math.min(this.from,t)),Sh(n)||(r=Sh(this.to)?n:Math.max(this.to,n)),this.set(i,r)},t.prototype.clear=function(){return this.set(NaN,NaN)},t}(),$g=function(){function t(t,n){this._x=t,this._y=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),t.prototype.bind=function(t){this._x.bind(t),this._y.bind(t)},t.prototype.unbind=function(){this._x.unbind(),this._y.unbind()},t.prototype.set=function(t,n,i,r){this._x.set(t,n,i,r),this._y.set(t,n,i,r)},t.prototype.unset=function(){this._x.unset(),this._y.unset()},t.prototype.update=function(t,n,i){var r=this._x.update(t,n,i),e=this._y.update(t,n,i);return r||e},t}(),tm=function(){function t(t){var n,i,r,e=this.toTheme(t);this.cn=e;var u=(new Dt).add(null!==(n=null==t?void 0:t.state)&&void 0!==n?n:ct.HOVERED);if(this.Rt=u,this.vs=null!==(i=null==t?void 0:t.enable)&&void 0!==i?i:e.isEnabled(u),null!=t){var s=t.shape;null!=s&&(wt(s)?this.ul=s:this.Xr=s)}this.B=null!==(r=null==t?void 0:t.style)&&void 0!==r?r:this.setStyle}return t.prototype.bind=function(t){if(this.vs){var n=this.Xr;if(null==n){var i=this.Rt,r=this.ul;n=null!=r?r(i):this.newShape(i,this.cn)}this.Xr=n,n.attach(t.plotArea.axis.container),n.visible=!1}},t.prototype.unbind=function(){var t=this.Xr;t&&t.detach()},t.prototype.newShape=function(t,n){return n.newShape(t)},t.prototype.set=function(t,n,i,r){this.update(t,n,i);var e=this.Xr;e&&this.B(e,r)},t.prototype.setStyle=function(t,n){},t.prototype.unset=function(){var t=this.Xr;t&&(t.visible=!1)},t.prototype.toTheme=function(t){var n=null==t?void 0:t.theme;return Ot(n)?this.getTheme(n):null!=n?n:this.getTheme(this.getType())},t.prototype.getTheme=function(t){return Z.getInstance().get(t)},t}(),nm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Xr;if(r){var e=i.x,u=t.plotArea.height;return r.transform.position.set(e,.5*u),r.size.set(0,u),r.visible=this.isVisible(t,n,i),!0}return!1},n.prototype.isVisible=function(t,n,i){var r=i.x;return 0<=r&&r<=t.plotArea.width},n.prototype.getType=function(){return"DChartSelectionGridlineX"},n}(tm),im=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Xr;if(r){var e=i.y,u=t.plotArea.width;return r.transform.position.set(.5*u,e),r.size.set(u,0),r.visible=this.isVisible(t,n,i),!0}return!1},n.prototype.isVisible=function(t,n,i){var r=i.y;return 0<=r&&r<=t.plotArea.height},n.prototype.getType=function(){return"DChartSelectionGridlineY"},n}(tm),rm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Xr;return!!r&&(r.transform.position.copyFrom(i),r.visible=this.isVisible(t,n,i),!0)},n.prototype.isVisible=function(t,n,i){var r=i.x,e=i.y,u=t.plotArea;return 0<=r&&r<=u.width&&0<=e&&e<=u.height},n.prototype.getType=function(){return"DChartSelectionMarker"},n}(tm),em={PREVIOUS:0,NEXT:1,CLOSER:2,INTERSECTION:3},um=function(n){function i(i){var r,e,u,s,h,o=this;(o=n.call(this)||this).Kc=null,o.el=null,o.vs=null===(r=i.enable)||void 0===r||r,o.If=new $g(new nm(null===(e=i.gridline)||void 0===e?void 0:e.x),new im(null===(u=i.gridline)||void 0===u?void 0:u.y)),o.A=new rm(i.marker),o.Rt=null!==(s=i.state)&&void 0!==s?s:ct.HOVERED,o.sl=null,o.hl=null,o._=new t.Point,o.wn=null!==(h=i.point)&&void 0!==h?h:em.CLOSER,o.Mu=new t.Point;var a=i.on;if(a)for(var c in a){var f=a[c];f&&o.on(c,f)}return o}return _(i,n),i.prototype.bind=function(t){this.vs&&(this.Kc=t,this.If.bind(t),this.A.bind(t))},i.prototype.unbind=function(){this.A.unbind(),this.If.unbind(),this.Kc=null,this.sl=null,this.hl=null},Object.defineProperty(i.prototype,"series",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gridline",{get:function(){return this.If},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"marker",{get:function(){return this.A},enumerable:!1,configurable:!0}),i.prototype.set=function(t,n){var i=this.Kc,r=this.sl=t.coordinate.x,e=this.hl=t.coordinate.y;if(i&&r&&e){var u=i.plotArea.container.localTransform,s=this._,h=this.Mu;if(n instanceof Ug){var o=n.x,a=n.y;switch(this.wn){case em.PREVIOUS:o=n.p0x,a=n.p0y;break;case em.NEXT:o=n.p1x,a=n.p1y;break;case em.CLOSER:Math.abs(n.p0x-n.x)<Math.abs(n.p1x-n.x)?(o=n.p0x,a=n.p0y):(o=n.p1x,a=n.p1y)}h.set(o,a),u.apply(h,h),s.set(r.unmap(r.transform.unmap(o)),e.unmap(e.transform.unmap(a)))}else s.copyFrom(n.position),h.set(r.transform.map(r.map(s.x)),e.transform.map(e.map(s.y))),u.apply(h,h);this.If.set(i,s,h,t),this.A.set(i,s,h,t),st.update(i.plotArea)}var c=this.el;if(c!==t){var f=this.Rt;c&&c.state.remove(f),this.el=t,t.state.add(f)}this.emit("change",this)},i.prototype.unset=function(){var t=this.el;t&&(this.el=null,this.sl=null,this.hl=null,t.state.remove(this.Rt),this.If.unset(),this.A.unset(),this.emit("change",this))},i.prototype.update=function(){var t=this.Kc,n=this.sl,i=this.hl;if(t&&n&&i){var r=this._,e=this.Mu;e.set(n.transform.map(n.map(r.x)),i.transform.map(i.map(r.y))),t.plotArea.container.localTransform.apply(e,e);var u=this.If.update(t,r,e),s=this.A.update(t,r,e);return u||s}return!1},i}(t.utils.EventEmitter),sm=function(t){function n(n){var i,r=this;(r=t.call(this)||this).Kc=null;var e=Ai(null!==(i=null==n?void 0:n.point)&&void 0!==i?i:em.CLOSER,em);r.Ja=r.newSelected(e,null==n?void 0:n.selected),r.ol=r.newHovered(e,null==n?void 0:n.hovered);var u=null==n?void 0:n.on;if(null!=u)for(var s in u){var h=u[s];h&&r.on(s,h)}return r.al=function(t){r.onMove(t)},r.cl=function(t){r.onClick(t)},r}return _(n,t),n.prototype.newSelected=function(t,n){return new um(this.toSelectedOptions(t,n))},n.prototype.newHovered=function(t,n){return new um(this.toHoveredOptions(t,n))},n.prototype.toSelectedOptions=function(t,n){return this.toSubOptions(t,n,ct.ACTIVE)},n.prototype.toHoveredOptions=function(t,n){return this.toSubOptions(t,n,ct.HOVERED)},n.prototype.toSubOptions=function(t,n,i){var r,e,u,s,h,o,a;null==(n=n||{}).point&&(n.point=t),null==n.state&&(n.state=i);var c=null!==(r=n.gridline)&&void 0!==r?r:n.gridline={},f=null!==(e=c.x)&&void 0!==e?e:c.x={};null==f.state&&(f.state=i);var l=null!==(u=c.y)&&void 0!==u?u:c.y={};null==l.state&&(l.state=i);var v=null!==(s=n.marker)&&void 0!==s?s:n.marker={};null==v.state&&(v.state=i);var b=null!==(h=n.label)&&void 0!==h?h:n.label={},d=null!==(o=b.x)&&void 0!==o?o:b.x={};null==d.state&&(d.state=i);var g=null!==(a=b.y)&&void 0!==a?a:b.y={};return null==g.state&&(g.state=i),n},n.prototype.onClick=function(t){var i=this.Kc;if(i&&t.target===i.plotArea){var r=n.WORK_SELECT,e=t.data.global,u=i.calcHitPoint(e.x,e.y,r),s=this.Ja;u?s.set(u,r):s.unset()}},n.prototype.onMove=function(t){var i=this.Kc;if(i){var r=this.ol;if(t.target===i.plotArea){var e=n.WORK_SELECT,u=t.data.global,s=i.calcHitPoint(u.x,u.y,e);s?r.set(s,e):r.unset()}else r.unset()}},n.prototype.bind=function(t){this.Kc=t,this.Ja.bind(t),this.ol.bind(t);var n=t.plotArea;n.on(ir.move,this.al),n.on(ir.tap,this.cl)},n.prototype.unbind=function(){var t=this.Kc;this.Kc=null,t&&t.plotArea.off(ir.move,this.al),this.Ja.unbind(),this.ol.unbind()},Object.defineProperty(n.prototype,"selected",{get:function(){return this.Ja},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hovered",{get:function(){return this.ol},enumerable:!1,configurable:!0}),n.prototype.update=function(){var t=this.Ja.update(),n=this.ol.update();if(t||n){var i=this.Kc;null!=i&&st.update(i.plotArea)}},n.prototype.onRender=function(){this.Ja.update(),this.ol.update()},n.WORK_SELECT=new Ug,n}(t.utils.EventEmitter),hm=function(){function t(t,n){var i,r;this.p=t,this.fl=null!==(i=null==n?void 0:n.x)&&void 0!==i?i:0,this.ll=null!==(r=null==n?void 0:n.y)&&void 0!==r?r:0,this.vl=NaN,this.bl=NaN,this.dl=NaN,this.ml=NaN}return Object.defineProperty(t.prototype,"x",{get:function(){var t=this.p.container;return t?t.plotArea.coordinate.x.get(this.fl):null},set:function(t){var n=this.toIndexX(t);this.fl!==n&&(this.fl=n,this.vl=NaN,this.dl=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexX=function(t){if(pt(t))return t;if(null!=t){var n=this.p.container;if(n)return n.plotArea.coordinate.x.indexOf(t)}return-1},Object.defineProperty(t.prototype,"y",{get:function(){var t=this.p.container;return t?t.plotArea.coordinate.y.get(this.ll):null},set:function(t){var n=this.toIndexY(t);this.ll!==n&&(this.ll=n,this.bl=NaN,this.ml=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexY=function(t){if(pt(t))return t;if(null!=t){var n=this.p.container;if(n)return n.plotArea.coordinate.y.indexOf(t)}return-1},t.prototype.isDirty=function(t,n){var i=t.id,r=n.id,e=i!==this.vl,u=r!==this.bl;return this.vl=i,this.bl=r,e||u},t.prototype.isTransformDirty=function(t,n){var i=t.transform.id,r=n.transform.id,e=i!==this.dl,u=r!==this.ml;return this.dl=i,this.ml=r,e||u},t.prototype.reset=function(){this.vl=NaN,this.bl=NaN},t.prototype.destroy=function(){this.reset()},t}(),om=function(t){function n(n){var i=t.call(this)||this;i.rl=new hm(i,null==n?void 0:n.coordinate),i.hu=0,i.Kf=new bg(NaN,NaN),i.Yf=new bg(NaN,NaN),i.wl=NaN,i.Ff=!0,i.Rt=new Et((function(t,n){i.onStateChange(t,n)}));var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i}return _(n,t),n.prototype.bind=function(t,n){this.Kc=t,this.rl.reset(),this.hu=n;var i=t.plotArea.chart;return i&&(this.Rt.parent=i.state),this},n.prototype.unbind=function(){return this.Kc=void 0,this},Object.defineProperty(n.prototype,"domain",{get:function(){return this.updateRegion(),this.Kf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"range",{get:function(){return this.updateRegion(),this.Yf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"container",{get:function(){return this.Kc||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinate",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),n.prototype.show=function(){return!0!==this.Ff&&(this.Ff=!0,this.onShow()),this},n.prototype.onShow=function(){var t=this.shape;null!=t&&(t.visible=!0)},n.prototype.isShown=function(){return this.Ff},n.prototype.hide=function(){return!1!==this.Ff&&(this.Ff=!1,this.onHide()),this},n.prototype.onHide=function(){var t=this.shape;null!=t&&(t.visible=!1)},n.prototype.isHidden=function(){return!this.Ff},n.prototype.destroy=function(){return this.Kc=void 0,this.rl.destroy(),this},n.prototype.hitTest=function(t,n){return!1},n.prototype.calcHitPoint=function(t,n,i){return!1},n.prototype.onStateChange=function(t,n){var i;this.toDirty();var r=null===(i=this.Kc)||void 0===i?void 0:i.plotArea.chart;st.update(r),this.emit("statechange",t,n,this)},n}(t.utils.EventEmitter),am=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).pl=null,r.zn=t,r.Tt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.Ol=0,r.Dl=NaN,r}return _(i,n),i.prototype.getSizeDefault=function(){return 10},i.prototype.getOffsetDefault=function(){return 0},i.prototype.bind=function(t,i){var r=this.pl;if(!r){(r=this.pl=this.newLineOfAny()).visible=this.Ff;var e=this.zn;this.initLine(r,e,t,i)}return r.attach(t.plotArea.container,i),this.Dl=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.initLine=function(t,n,i,r){var e=i.newFill(r,null==n?void 0:n.fill);this.C=e,t.fill.copy(e);var u=i.newStroke(r,null==n?void 0:n.stroke);this.yo=u,t.stroke.copy(u);var s=this.getSizeDefault(),h=i.newSize(r,null==n?void 0:n.size,s,s);this.T=h,t.points.size.set(h.x,h.y);var o=this.getOffsetDefault(),a=i.newOffset(r,n&&n.offset,o,o);this.vn=a,t.points.offset.set(a.x,a.y)},i.prototype.unbind=function(){var t=this.pl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.pl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.Tt},set:function(t){this.Tt=t,this.Ol+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.Ol+=1,this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.pl;if(n){var i=this.rl,r=i.x,e=i.y;if(r&&e){var u=this.Ol,s=u!==this.Dl,h=i.isDirty(r,e),o=i.isTransformDirty(r,e);if(s||h||o)return this.Dl=u,this.doUpdateLine(n,r,e),t&&st.update(n),!0}}return!1},i.prototype.doUpdateLine=function(t,n,r){for(var e=t.points.values,u=e.length,s=0,h=this.Tt,o=NaN,a=NaN,c=NaN,f=NaN,l=0,v=h.length;l<v;l+=2){var b=h[l],d=h[l+1];null!=b&&null!=d&&(s<u?(e[s]=b,e[s+1]=d):e.push(b,d),s+=2,o!=o?(o=b,a=b,c=d,f=d):(o=Math.min(o,b),a=Math.max(a,b),c=Math.min(c,d),f=Math.max(f,d)))}e.length!==s&&(e.length=s),n.mapAll(e,0,s,2,0),r.mapAll(e,0,s,2,1),n.transform.mapAll(e,0,s,2,0),r.transform.mapAll(e,0,s,2,1),o!=o&&(o=0,a=0,c=0,f=0);var g=i.WORK_REGION||{xmin:0,xmax:0,ymin:0,ymax:0};i.WORK_REGION=g,this.adjustLineRegion(o,a,c,f,g),o=n.transform.map(n.map(g.xmin)),a=n.transform.map(n.map(g.xmax)),c=r.transform.map(r.map(g.ymin)),f=r.transform.map(r.map(g.ymax));var m=Math.abs(a-o),w=Math.abs(f-c),p=.5*(o+a),O=.5*(c+f);for(l=0,v=e.length;l<v;l+=2)e[l+0]-=p,e[l+1]-=O;t.disallowUploadedUpdate(),this.applyLine(t,n,r,m,w,p,O,e),t.allowUploadedUpdate()},i.prototype.adjustLineRegion=function(t,n,i,r,e){return e.xmin=t,e.xmax=n,e.ymin=i,e.ymax=r,e},i.prototype.applyLine=function(t,n,i,r,e,u,s,h){t.points.set(h),t.size.set(r,e),t.transform.position.set(u,s)},i.prototype.updateRegion=function(){var t=this.Ol;if(this.wl!==t){this.wl=t;var n=this.Tt,i=this.Kf,r=this.Yf;i.clear(),r.clear(),this.calcRegion(n,i,r)}},i.prototype.calcRegion=function(t,n,i){for(var r=0,e=t.length;r<e;r+=2){var u=t[r];null!=u&&n.add(u,u);var s=t[r+1];null!=s&&i.add(s,s)}},i.prototype.destroy=function(){var t=this.pl;return t&&(this.pl=null,t.detach(),t.destroy()),this.Tt.length=0,this.Ol=0,this.Dl=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.pl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.pl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,null,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.calcHitPointTestRange=function(t,n,i,r,e,u,s,h,o){for(var a=ob(h,t+i+e,2,0),c=0,f=a-1,l=f<<1;0<=f;f-=1,l-=2)if(h[l]<=t-i){c=f;break}return o[0]=c,o[1]=c!==a?a:Math.min(h.length<<1,a+1),o},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v){var b=v.shape;if(b.containsPointAbs(t,n,i,r,e,u,s,h,o,a,c)){var d=b.transform,g=d.position,m=d.scale;v.x=v.p0x=v.p1x=g.x+m.x*s,v.y=v.p0y=v.p1y=g.y+m.y*h,v.t=l,v.index=f;var w=t-(s+e),p=n-(h+u);return v.distance=Math.sqrt(w*w+p*p),!0}return!1},i.WORK=new t.Point,i}(om),cm=function(t){function n(n){var i=t.call(this,n)||this;return i.El=-1,i.Ml=-1,i.Sl=-1,i.jl=-1,i.Tl=!1!==(n&&n.size&&n.size.auto),i}return _(n,t),n.prototype.bind=function(n,i){return this.El=-1,this.Ml=-1,this.Sl=-1,this.jl=-1,t.prototype.bind.call(this,n,i),this},n.prototype.initLine=function(n,i,r,e){t.prototype.initLine.call(this,n,i,r,e),this.Qn=r.newPadding(e,i&&i.padding)},n.prototype.newLineOfAny=function(){return new Sf},n.prototype.getSizeDefault=function(){return 1},n.prototype.adjustLineRegion=function(n,i,r,e,u){return t.prototype.adjustLineRegion.call(this,n,i,Math.min(0,r),Math.max(0,e),u)},n.prototype.updateBarCountAndIndex=function(){if(this.Ml<0||this.El<0){var t=0,i=0,r=this.Kc;if(r)for(var e=0,u=r.size();e<u;++e){var s=r.get(e);s===this&&(t=i),s instanceof n&&(i+=1)}return i=Math.max(1,i),this.El=i,this.Ml=t,!0}return!1},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=n.points,c=a.offset,f=a.size,l=this.T,v=this.vn,b=this.Qn;if(l&&v&&b){var d=i.id,g=i.transform.id;if(this.updateBarCountAndIndex()||this.Sl!==d||this.jl!==g){var m=this.El,w=this.Ml;this.Sl=d,this.jl=g;var p=i.transform.map(i.map(0)),O=i.transform.map(i.map(l.x)),D=Math.abs(p-O)*(1-b.outer);if(m<=1)c.x=v.x,f.x=D;else{var E=D*(1-b.inner),M=E/m,S=M*(w+.5)+w*((D-E)/(m-1));c.x=v.x+S-.5*D,f.x=M}}}var j=f.y;mt(j)||(j=[]);var T=j.length,N=c.y;mt(N)||(N=[]);for(var I=N.length,C=0,A=r.transform.map(r.map(0))-h,R=0,k=o.length;R<k;R+=2,C+=1){var L=o[R+1]-A,y=Math.abs(L);C<T?j[C]=y:j.push(y);var x=-.5*L;C<I?N[C]=x:N.push(x)}j.length!==C&&(j.length=C),N.length!==C&&(N.length=C),c.y=N,f.y=j,t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n.prototype.calcSizeX=function(t){var n=this.Tt;if(2<n.length)for(var i=n.length,r=n[i-2],e=i-4;0<=e;e-=2){var u=n[e];if(null!=r&&null!=u)return Math.abs(r-u);r=u}return t},n.prototype.calcRegion=function(n,i,r){t.prototype.calcRegion.call(this,n,i,r);var e=this.T;if(e){var u=e.x;this.Tl&&(u=this.calcSizeX(u),e.x=u);var s=.5*u;i.set(i.from-s,i.to+s)}r.add(0,0)},n}(am),fm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new bf},n}(am),lm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new pf},n}(am),vm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Sf},n}(am),bm=function(t){function n(n){var i=t.call(this,n)||this;return i.Nl=0,i}return _(n,t),n.prototype.newLineOfAny=function(){return new Xf},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=this.T,c=this.vn;a&&c&&this.Nl!==a.y&&(this.Nl=a.y,n.points.offset.y=c.y-.2*a.y),t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n}(am),dm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Uf},n}(bm),gm=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).pl=null,r.zn=t,r.Tt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.Ol=0,r.Dl=NaN,r.Il=0,r.Cl=0,r}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.pl;if(!e){var u=t.newStroke(i,null===(r=this.zn)||void 0===r?void 0:r.stroke);this.yo=u,(e=new zc).stroke.copy(u),e.visible=this.Ff,this.pl=e}return e.attach(t.plotArea.container,i),this.Dl=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.pl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.pl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.Tt},set:function(t){this.Tt=t,this.Ol+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.Ol+=1,this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.pl;if(n){var i=this.rl,r=i.x,e=i.y;if(r&&e){var u=this.Ol,s=u!==this.Dl,h=i.isDirty(r,e),o=i.isTransformDirty(r,e);if(s||h||o)return this.Dl=u,this.doUpdateLine(n,r,e,s||h),t&&st.update(n),!0}}return!1},i.prototype.doUpdateLine=function(t,n,i,r){if(t.disallowUploadedUpdate(),r){for(var e=t.points.values,u=t.points.segments,s=e.length,h=u.length,o=0,a=0,c=this.Tt,f=NaN,l=NaN,v=NaN,b=NaN,d=0,g=c.length;d<g;d+=2){var m=c[d],w=c[d+1];if(null!=m&&null!=w)o<s?(e[o]=m,e[o+1]=w):e.push(m,w),o+=2,f!=f?(f=m,l=m,v=w,b=w):(f=Math.min(f,m),l=Math.max(l,m),v=Math.min(v,w),b=Math.max(b,w));else{var p=(d>>1)-a;a<h?u[a]=p:u.push(p),a+=1}}e.length!==o&&(e.length=o),u.length!==a&&(u.length=a),n.mapAll(e,0,o,2,0),i.mapAll(e,0,o,2,1),f!=f&&(f=0,l=0,v=0,b=0),f=n.map(f),l=n.map(l),v=i.map(v),b=i.map(b);var O=Math.abs(l-f),D=Math.abs(b-v),E=.5*(f+l),M=.5*(v+b);for(d=0,g=e.length;d<g;d+=2)e[d+0]-=E,e[d+1]-=M;t.size.set(O,D),t.points.set(e,u),this.Il=E,this.Cl=M}t.transform.position.set(n.transform.map(this.Il),i.transform.map(this.Cl)),t.transform.scale.set(n.transform.scale,i.transform.scale),t.allowUploadedUpdate()},i.prototype.updateRegion=function(){var t=this.Ol;if(this.wl!==t){this.wl=t;var n=this.Tt,i=this.Kf,r=this.Yf;if(i.clear(),r.clear(),null!=n)for(var e=0,u=n.length;e<u;e+=2){var s=n[e];null!=s&&i.add(s,s);var h=n[e+1];null!=h&&r.add(h,h)}}},i.prototype.destroy=function(){var t=this.pl;return t&&(this.pl=null,t.detach(),t.destroy()),this.Tt.length=0,this.Ol=0,this.Dl=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.pl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.pl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointTestRange=function(t,n,i,r,e){var u=ob(r,t,2,0);return e[0]=Math.max(0,u-1),e[1]=u,e},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=g+p*f,o.y=m+O*l,o.p0x=g+p*i,o.p0y=m+O*r,o.p1x=g+p*e,o.p1y=m+O*u,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(om),mm=function(){function t(t,n,i,r){this.R=0,this.Al=NaN,this._a=t,this._b=n,this._x0=i,this._y0=r}return Object.defineProperty(t.prototype,"a",{get:function(){return this._a},set:function(t){this._a!==t&&(this.R+=1,this._a=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},set:function(t){this._b!==t&&(this.R+=1,this._b=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x0",{get:function(){return this._x0},set:function(t){this._x0!==t&&(this.R+=1,this._x0=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y0",{get:function(){return this._y0},set:function(t){this._y0!==t&&(this.R+=1,this._y0=t)},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.R+=1},t.prototype.isDirty=function(){return this.R!==this.Al},t.prototype.toClean=function(){this.Al=this.R},t.from=function(n){var i,r,e,u;return new t(null!==(i=null==n?void 0:n.a)&&void 0!==i?i:1,null!==(r=null==n?void 0:n.b)&&void 0!==r?r:1,null!==(e=null==n?void 0:n.x0)&&void 0!==e?e:0,null!==(u=null==n?void 0:n.y0)&&void 0!==u?u:0)},t}(),wm=function(n){function i(t){var i=n.call(this,t)||this;return i.pl=null,i.zn=t,i.Rl=mm.from(t),i}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.pl;if(!e){var u=t.newStroke(i,null===(r=this.zn)||void 0===r?void 0:r.stroke);this.yo=u,(e=new zc).stroke.copy(u),e.visible=this.Ff,this.pl=e}return e.attach(t.plotArea.container,i),n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.pl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.pl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parameters",{get:function(){return this.Rl},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.Rl.toDirty(),this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.pl,i=this.Kc;if(n&&i){var r=this.rl,e=r.x,u=r.y;if(e&&u)return this.doUpdateLine(n,i,e,u),t&&st.update(n),!0}return!1},i.prototype.doUpdateLine=function(t,n,i,r){var e=t.points.values,u=t.points.segments,s=this.Rl,h=s.a,o=s.b,a=s.x0,c=s.y0,f=Math.abs(h),l=Math.abs(o),v=NaN,b=NaN,d=NaN,g=NaN,m=1e-5,w=n.plotArea.getBoundsInContainer();if(l<=f){var p=i.unmap(i.transform.unmap(w.x)),O=i.unmap(i.transform.unmap(w.x+w.width));v=Math.min(p,O),d=Math.max(p,O);var D=r.unmap(r.transform.unmap(w.y)),E=r.unmap(r.transform.unmap(w.y+w.height));if(b=Math.min(D,E),g=Math.max(D,E),m<l){var M=(N=o/h)*(D-c)+a,S=N*(E-c)+a,j=Math.min(M,S),T=Math.max(M,S);b=(I=1/N)*((v=Math.max(v,j))-a)+o*c,g=I*((d=Math.min(d,T))-a)+o*c}else v=a,d=a}else if(D=r.unmap(r.transform.unmap(w.y)),E=r.unmap(r.transform.unmap(w.y+w.height)),b=Math.min(D,E),g=Math.max(D,E),p=i.unmap(i.transform.unmap(w.x)),O=i.unmap(i.transform.unmap(w.x+w.width)),v=Math.min(p,O),d=Math.max(p,O),m<f){var N,I,C=(N=h/o)*(p-a)+c,A=N*(O-a)+c,R=Math.min(C,A),k=Math.max(C,A);v=(I=1/N)*((b=Math.max(b,R))-c)+h*a,d=I*((g=Math.min(g,k))-c)+h*a}else b=c,g=c;v=i.transform.map(i.map(v)),b=r.transform.map(r.map(b));var L=.5*(v+(d=i.transform.map(i.map(d)))),y=.5*(b+(g=r.transform.map(r.map(g)))),x=Math.abs(d-v),B=Math.abs(g-b);v-=L,b-=y,d-=L,g-=y,4!==e.length?(e.length=0,e.push(v,b,d,g)):(e[0]=v,e[1]=b,e[2]=d,e[3]=g),0<u.length&&(u.length=0),t.disallowUploadedUpdate(),t.points.set(e,u),t.size.set(x,B),t.points.toFitted(),t.transform.position.set(L,y),t.allowUploadedUpdate()},i.prototype.updateRegion=function(){},i.prototype.destroy=function(){var t=this.pl;return t&&(this.pl=null,t.detach(),t.destroy()),n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.pl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.pl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,null,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=o.p0x=o.p1x=g+p*f,o.y=o.p0y=o.p1y=m+O*l,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(om),pm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n);var r=this.plotArea;this.addChild(r),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:this.theme.isOverflowMaskEnabled())&&(r.axis.container.mask=this.getOverflowMask())},n.prototype.getOverflowMask=function(){return null==this.dr&&(this.dr=new or(this),this.reflowable.add(this.dr),this.toDirty()),this.dr},Object.defineProperty(n.prototype,"plotArea",{get:function(){var t=this.Bf;return null==t&&(t=this.newPlotArea(),this.Bf=t),t},enumerable:!1,configurable:!0}),n.prototype.newPlotArea=function(){var t;return new qg(this,null===(t=this.zn)||void 0===t?void 0:t.plotArea)},n.prototype.getType=function(){return"DChart"},n.prototype.destroy=function(){var n;this._destroyed||(null===(n=this.Bf)||void 0===n||n.destroy(),t.prototype.destroy.call(this))},n}(hr),Om=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(Cb),Dm=function(t){function n(n){var i=t.call(this)||this;return i.Gr=n,i}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return Lb.getDocumentController().saveAs(this.Gr),!0},n}(Cb),Em=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return Lb.getDocumentController().save(),!0},n}(Cb),Mm=function(t){function n(n,i){var r=t.call(this)||this;r.p=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),n.prototype.createAsUrl=function(t){return null==t||pt(t)?this.create({size:t,extractor:function(t){return db.base64({target:t})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(t){return db.base64({target:t})}})},n.prototype.createAsFile=function(t,n){Ot(t)?this.create({extractor:function(n){db.file({target:n,filename:t})}}):null===t||pt(t)?this.create({size:t,extractor:function(t){db.file({target:t,filename:n})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(n){db.file({target:n,filename:t.filename})}})},n.prototype.toScale=function(t,n){return null==t?1:t/st.getResolution(n)/Math.max(n.width,n.height)},n.prototype.toCleanupSnap=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.snap},n.prototype.toCleanupBackground=function(t){if(null==t)return!1;var n=t.cleanup;return null!=n&&!1!==n&&(!0===n||!0===n.background)},n.prototype.toCleanupReflow=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.reflow},n.prototype.create=function(t){var n=this.p,i=n.canvas;if(i){var r=n.view,e=r.position,u=r.scale,s=e.x,h=e.y,o=u.x,a=u.y,c=this.toScale(t.size,i);r.transform(0,0,c,c,0);var f=void 0;if(this.toCleanupSnap(t)&&"snap"in i){var l=i.snap;null!=l&&((f=l.container).renderable?f.renderable=!1:f=void 0)}var v=void 0;if(this.toCleanupBackground(t)&&((v=i.snippet).renderable?v.renderable=!1:v=void 0),this.toCleanupReflow(t)){var b=st.getLayer(i);b&&b.reflow()}this.emit("taking",i,this);var d=t.extractor(i);return this.emit("took",i,null,this),v&&(v.renderable=!0),null!=f&&(f.renderable=!0),r.transform(s,h,o,a,0),d}},n}(t.utils.EventEmitter),Sm=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).kl=null,r.Ll=null==n?void 0:n.tile,r.yl=null==n?void 0:n.controller,r.xl=null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:r.theme.isAmbient(),r.Bl=new Mm(r,null==n?void 0:n.snapshot),r.Fr=r.toMode(n),r}return _(n,t),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.Bl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"controller",{get:function(){return this.yl||null},enumerable:!1,configurable:!0}),n.prototype.set=function(t){var n=this,i=this.kl;if(i!==t){if(i&&(this.kl=null,this.canvas&&(this.canvas=null),this.onUnset()),this.kl=t,t){var r=this.newCanvas(t),e=t.pieces,u=this.Fr,s=Ye.toPieceData(this.yl,e,u).then((function(i){return n.newLayer(t,r,u,e,i)}));return this.onSet(t,r),this.canvas=r,s}return Promise.resolve(null)}return Promise.resolve(this.canvas)},n.prototype.onSet=function(t,n){},n.prototype.newLayer=function(t,n,i,r,e){var u=this,s=new Sr(t,r,e,i,0),h=Ye.newLayer(t,n.layer,s).then((function(t){return u.initLayer(n,t)}));if(this.xl){var o=this.toCanvasBaseBackgroundOptions(t,this.theme,!1);this.background.color=o.color,this.background.alpha=o.alpha}return h},n.prototype.initLayer=function(t,n,i){return t.layer.init(),t.initialize(n,i),st.update(this),this.emit("ready",this),t},n.prototype.toCanvasBaseOptions=function(t){var n,i=this.theme,r=this.xl;return{name:t.name,width:t.width,height:t.height,background:this.toCanvasBaseBackgroundOptions(t,i,r),border:r?{color:null}:void 0,outline:r?{color:null}:void 0,shadow:r?null:i.getCanvasShadow(),tile:{factory:this.Ll,mapping:null===(n=t.tile)||void 0===n?void 0:n.mapping},ambient:r}},n.prototype.toCanvasBaseBackgroundOptions=function(t,n,i){var r,e;if(i)return{color:null};var u=t.background;return{color:null!==(r=null==u?void 0:u.color)&&void 0!==r?r:n.getCanvasBackgroundColor(),alpha:null!==(e=null==u?void 0:u.alpha)&&void 0!==e?e:n.getCanvasBackgroundAlpha()}},n.prototype.onUnset=function(){},n.prototype.get=function(){return this.kl},Object.defineProperty(n.prototype,"layer",{get:function(){var t=this.canvas;return t?t.layer.active:null},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DDiagramBase"},n}(Dr),jm=function(){function t(t,n){this.ei=t,this.Pr=n}return t.prototype.getTheme=function(){return this.ei.getTheme()},t.prototype.setTheme=function(t){this.ei.setTheme(t)},t.prototype.getBaseColor=function(){return this.Pr},t.prototype.setBaseColor=function(t){this.Pr=t},t.prototype.getColor=function(t){var n=this.ei,i=this.Pr,r=n.getColor(t);return null!=i?null!=r?an.blend(i,r,n.getAlpha(t)):i:r},Object.defineProperty(t.prototype,"color",{get:function(){return this.ei.color},set:function(t){this.ei.color=t},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){return null!=this.Pr?1:this.ei.getAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.ei.alpha},set:function(t){this.ei.alpha=t},enumerable:!1,configurable:!0}),t}(),Tm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),Object.defineProperty(n.prototype,"lon",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lat",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!0}),n.prototype.toObject=function(){return{lon:this.x,lat:this.y}},n}(t.ObservablePoint),Nm=function(){function t(t,n,i,r,e,u){if(this._l=t,!0===n||!1===n)this.O=n,this.Bt=new Tm(t,null,i,r),this.Pt=new Tm(t,null,e,u);else if(null!=n){this.O=n.enable;var s=n.from,h=n.to;this.Bt=new Tm(t,null,s.lon,s.lat),this.Pt=new Tm(t,null,h.lon,h.lat)}else this.O=!1,this.Bt=new Tm(t,null,-180,85.05112877980659),this.Pt=new Tm(t,null,180,-85.05112877980659)}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this._l())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{enable:this.O,from:this.Bt.toObject(),to:this.Pt.toObject()}},t}(),Im=function(){function t(t,n){var i=this;this.vr=t,this.Pl=null==n?void 0:n.factory,this.Jt=new Nm((function(){i.onMappingChange()}),null==n?void 0:n.mapping)}return t.prototype.init=function(){this.onMappingChange()},t.prototype.onMappingChange=function(){var t=this.Pl;if(t){var n,i=this.Jt;i.enable?(n=this.Fl)?n.mapping=i:this.Fl=t(this.vr).fit():(n=this.Fl)&&(this.Fl=void 0,n.destroy())}},Object.defineProperty(t.prototype,"pyramid",{get:function(){return this.Fl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"factory",{get:function(){return this.Pl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapping",{get:function(){return this.Jt},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{mapping:this.Jt.serialize()}},t.prototype.destroy=function(){var t=this.Fl;null!=t&&(this.Fl=void 0,t.destroy())},t}(),Cm=function(t){function n(n,i){var r=t.call(this)||this;return r.kh=null,r.kt=n,r.pn=i,r.interactive=!1,r.interactiveChildren=!1,r}return _(n,t),n.prototype.init=function(){if(null==this.kh){var t=this.children,n=t.length;0<n&&(this.kh=t[n-1])}},Object.defineProperty(n.prototype,"active",{get:function(){return this.kh},set:function(t){this.kh!==t&&(null==t||0<=this.children.indexOf(t))&&(this.kh=t,this.onLayerChange())},enumerable:!1,configurable:!0}),n.prototype.create=function(t,n){var i=new ou(t);return this.attach(i,n),i},n.prototype.attach=function(t,n){this.addChild(t),!0===n&&(this.kh=t),this.onLayerChange(),st.update(this)},n.prototype.attachAt=function(t,n,i){this.addChildAt(t,n),!0===i&&(this.kh=t),this.onLayerChange(),st.update(this)},n.prototype.detach=function(t,n){var i=this.children,r=i.indexOf(t);0<=r&&(this.kh=n,i.splice(r,1),t.parent=void 0,this.onLayerChange(),st.update(this))},n.prototype.delete=function(t,n){var i=this.children,r=i.indexOf(t);return 0<=r&&(i.splice(r,1),t.parent=void 0,this.kh===t&&(!0===n?r<i.length?this.kh=i[r]:0<i.length?this.kh=i[r-1]:this.kh=null:this.kh=null),this.onLayerChange(),st.update(this)),r},n.prototype.get=function(t){var n=this.children[t];return null!=n?n:null},n.prototype.clear=function(){var t=this.children;if(0<t.length){for(var n=t.length-1;0<=n;--n){var i=t[n];i.parent=null,i.destroy()}t.length=0,this.onLayerChange(),st.update(this)}},n.prototype.destroy=function(){this._destroyed||(this.clear(),t.prototype.destroy.call(this))},n.prototype.size=function(){return this.children.length},n.prototype.onLayerChange=function(){this.emit("change",this)},n.prototype.serialize=function(t,n){for(var i=[],r=this.children,e=0,u=r.length;e<u;++e)r[e].addUuid(t);for(e=0,u=r.length;e<u;++e)r[e].updateUuid(t);for(e=0,u=r.length;e<u;++e)i.push(r[e].serialize(e,t,n));return i},n.prototype.deserialize=function(t,n){var i=t.length;if(0<i){for(var r=this.kt,e=this.pn,u=0;u<i;++u)this.addChild(ou.deserialize(t[u],n,r,e));this.onLayerChange(),st.update(this)}},n}(t.Container),Am=function(t){function n(n){var i=t.call(this,n)||this,r=i.theme;i.isAmbient(r,n)||(i.kn=new jm(i.kn,i.toBackgroundBase(r,n)));var e=new Cm(i.width,i.height);i.bs=e,i.addChild(e);var u=new Im(i,null==n?void 0:n.tile);return i.Ul=u,u.init(),i}return _(n,t),n.prototype.isAmbient=function(t,n){var i;return null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:t.isAmbient()},n.prototype.toBackgroundBase=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.background)||void 0===i?void 0:i.base)&&void 0!==r?r:t.getBackgroundBase()},Object.defineProperty(n.prototype,"tile",{get:function(){return this.Ul},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"layer",{get:function(){return this.bs},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,n){},n.prototype.destroy=function(){this._destroyed||(this.onDestroy(),t.prototype.destroy.call(this))},n.prototype.onDestroy=function(){this.Ul.destroy(),this.bs.destroy()},n.prototype.hitTest=function(t,n){for(var i=this.bs.children,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible){var u=e.hitTest(t,n);if(null!=u)return u}}return null},n.prototype.getType=function(){return"DDiagramCanvasBase"},n}(ug),Rm=function(){function t(t){this.vr=t}return t.prototype.each=function(t,n){for(var i=this.vr.layer.children,r=0,e=i.length;r<e&&!1!==this.Zc(i[r].children,t,n);++r);return this},t.prototype.Zc=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(!1===n(u))return!1;if(i||Tr.contains(u,Ct.CHILDREN)){var s=u.children;if(0<s.length&&!1===this.Zc(s,n,i))return!1}}},t}(),km=function(){function t(){}return Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Zt;return null==t&&(t=this.newPrivate(),this.Zt=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new Ht},Object.defineProperty(t.prototype,"protected",{get:function(){var t=this.Gl;return null==t&&(t=this.newProtected(),this.Gl=t),t},enumerable:!1,configurable:!0}),t.prototype.newProtected=function(){return new Ht},Object.defineProperty(t.prototype,"extended",{get:function(){var t=this.Hl;return null==t&&(t=this.newExtended(),this.Hl=t),t},enumerable:!1,configurable:!0}),t.prototype.newExtended=function(){return new Ht},Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Xt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Xt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t.prototype.add=function(t,n){var i,r=null!==(i=this.Xt)&&void 0!==i?i:this.Xt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Xt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),void 0!==n&&(c.value=n)}return!0},t.prototype.get=function(t){var n=this.Xt;if(null==n)return null;var i=n.get(t);return null==i?null:i},t.prototype.clear=function(t){var n=this.Xt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].clear();return!0},t.prototype.toDirty=function(t){var n=this.Xt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Xt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.times=i),void 0!==r&&(c.states=r),void 0!==n&&(c.values=n)}return!0},t.prototype.setValue=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].value=n;return!0},t.prototype.setValues=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].values=n;return!0},t.prototype.setTime=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].time=n;return!0},t.prototype.setTimes=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].times=n;return!0},t.prototype.setState=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].state=n;return!0},t.prototype.setStates=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].states=n;return!0},t.prototype.setRange=function(t,n,i){var r=this.Xt;if(null==r)return!1;var e=r.get(t);if(null==e)return!1;var u=e.length;if(u<=0)return!1;for(var s=0;s<u;++s){var h=e[s].range;void 0!==n&&(null!==n?(h.type|=Lt.FROM,h.from=n):h.type&=~Lt.FROM),void 0!==i&&(null!==i?(h.type|=Lt.TO,h.to=i):h.type&=~Lt.TO)}return!0},t}(),Lm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Rm),ym=function(){function t(t,n,i){var r=this;this.p=t;var e=i.controller;this.yl=e;var u=function(){r.onChange()};e.grid.on("change",u),e.target.on("change",u);var s=new ye;s.visible=!1,this.Kc=s,t.addChildAt(s,t.children.length-1),this.zl=this.toGrid(n,i.grid),this.ei=this.toTarget(n,i.target)}return t.prototype.toGrid=function(t,n){var i;return{major:this.toGridMajor(t,null==n?void 0:n.major),minor:this.toGridMinor(t,null==n?void 0:n.minor),size:null!==(i=null==n?void 0:n.size)&&void 0!==i?i:t.getSnapGridSize()}},t.prototype.toGridMajor=function(t,n){var i,r,e,u,s;return{interval:null!==(i=null==n?void 0:n.interval)&&void 0!==i?i:t.getSnapGridMajorInterval(),color:null!==(r=null==n?void 0:n.color)&&void 0!==r?r:t.getSnapGridMajorColor(),alpha:null!==(e=null==n?void 0:n.alpha)&&void 0!==e?e:t.getSnapGridMajorAlpha(),width:null!==(u=null==n?void 0:n.width)&&void 0!==u?u:t.getSnapGridMajorWidth(),style:null!==(s=null==n?void 0:n.style)&&void 0!==s?s:t.getSnapGridMajorStyle()}},t.prototype.toGridMinor=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapGridMinorColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapGridMinorAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapGridMinorWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapGridMinorStyle()}},t.prototype.toTarget=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapTargetColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapTargetAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapTargetWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapTargetStyle()}},t.prototype.onChange=function(){var t=this.p;t.toDirty(),st.update(t)},Object.defineProperty(t.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return this.yl.serialize()},t.prototype.onReflow=function(){var t=this.p,n=this.Kc,i=this.yl,r=i.grid.visible,e=i.target.visible;if(r||e){var u=t.width,s=t.height,h=.5*u,o=.5*s,a=it.TOP,c=it.LEFT,f=n.children,l=0;if(r){for(var v=this.zl,b=v.major,d=v.minor,g=b.interval,m=v.size(i.grid.size,u,s),w=m,p=1;w<u;w+=m,p+=1,l+=1){var O=p%g==0?b:d;this.update(n,f,l,w,o,a,u,s,O)}for(var D=m,E=1;D<s;D+=m,E+=1,l+=1)O=E%g==0?b:d,this.update(n,f,l,h,D,c,u,s,O)}if(e)for(var M=i.target.values,S=this.ei,j=0,T=M.length;j<T;j+=1,l+=1){var N=M[j],I=N.position;N.type===Xv.VERTICAL?this.update(n,f,l,I,o,a,u,s,S):this.update(n,f,l,h,I,c,u,s,S)}for(j=l,T=f.length;j<T;++j)f[j].visible=!1;n.visible=!0}else n.visible=!1},t.prototype.update=function(t,n,i,r,e,u,s,h,o){var a=null;i<n.length?((a=n[i]).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate()):((a=new en).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate(),a.attach(t))},t}(),xm=function(t){function n(n){var i=t.call(this,n)||this;return i.Vl=i.toSnap(i.theme,n.snap),i}return _(n,t),n.prototype.toSnap=function(t,n){return n?new ym(this,t,n):null},Object.defineProperty(n.prototype,"snap",{get:function(){return this.Vl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shape",{get:function(){var t=this.Xr;return null==t&&(t=this.newShape(),this.Xr=t),t},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){return new Lm(this)},n.prototype.serialize=function(t,n){var i,r=new zv,e=[],u=this.kn,s=u.color,h=u.alpha;return{version:1,id:t,name:this.name,width:this.width,height:this.height,background:{color:pt(s)?s:16777215,alpha:pt(h)?h:0},tile:this.Ul.serialize(),resources:r.resources,data:r.data,pieces:r.pieces,layers:this.bs.serialize(r,e),items:e,snap:null===(i=this.Vl)||void 0===i?void 0:i.serialize(),thumbnail:null==n?void 0:n.serialize()}},n.prototype.onReflow=function(){var n;t.prototype.onReflow.call(this),null===(n=this.Vl)||void 0===n||n.onReflow()},n.prototype.getType=function(){return"DDiagramCanvasEditor"},n}(Am),Bm=function(t){function n(n){var i=t.call(this,n)||this;return i.Xt=new Map,i}return _(n,t),n.prototype.add=function(t,n){var i=this.Xt,r=i.get(t);null==r?i.set(t,[n]):r.push(n)},n.prototype.get=function(t){var n=this.Xt.get(t);return n&&0<n.length?n[0]:null},n.prototype.getAll=function(t){return this.Xt.get(t)||[]},n}(Rm),_m=function(){function t(t,n){var i=this;this.p=t,this.k=[],this.Z=n,this.q=function(){i.onTime()}}return t.prototype.add=function(t){this.k.push(t)},t.prototype.start=function(){null==this.$&&this.onTime()},t.prototype.getInterval=function(){var t=Date.now(),n=this.Z;return Math.max(0,n-t%n)},t.prototype.onTime=function(){var t=this.k;if(0<t.length){for(var n=Date.now()/this.Z,i=0,r=t.length;i<r;++i)t[i].value=n;st.update(this.p)}this.$=window.setTimeout(this.q,this.getInterval())},t.prototype.stop=function(){var t=this.$;null!=t&&(clearTimeout(t),this.$=void 0)},t}(),Pm=function(){function t(t){this.p=t,this.Xt=new Map}return t.prototype.add=function(t){var n=this.Xt,i=this.toNormalized(t),r=n.get(i);if(null!=r)return r;var e=new _m(this.p,i);return n.set(i,e),e},t.prototype.toNormalized=function(t){return pt(t)?Math.max(1,Math.round(t)):1e3},t.prototype.start=function(){this.Xt.forEach((function(t){t.start()}))},t.prototype.stop=function(){this.Xt.forEach((function(t){t.stop()}))},t}(),Fm="[]",Um=function(){return 0},Gm=function(){return[]},Hm=function(){return""},zm=function(){return{}},Vm=function(){return!1},Wm=function(n){function i(t){var i=n.call(this,t)||this;return i.Xt=new km,i.Xr=new Bm(i),i.et=new Pm(i),i.Wl=[],i.Xl=new Set,i.Da=function(){st.update(i)},i}return _(i,n),Object.defineProperty(i.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"shape",{get:function(){return this.Xr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ticker",{get:function(){return this.et},enumerable:!1,configurable:!0}),i.prototype.initialize=function(t,n){var i=this,r=this.Wl,e=this.Xt;this.Kl(t,null,null,n,new Map,new Map,new Map,this.et,this.Xr,e,r);for(var u=this.bs.children,s=u.length,h=0;h<s;++h)u[h].initialize(r);ln.isInitializing=!0;var o=Date.now();for(h=0;h<s;++h)u[h].update(o);ln.isInitializing=!1,e.extended.each((function(t){var n=Fv.getById(t);if(n){var r=n.start;r&&r(i)}})),this.et.start()},i.prototype.Kl=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=function(f,v){var b=t[f],d=b.id;0<d.length&&o.add(d,b),l.initData(b,n,i,r,e,u,h,a);var g=new(So[b.type]||uu)(b);b.runtime=g,l.initActions(b,g,s),g.initialize(b);var m=b.shortcut;null!=m&&nr.on(b,m,(function(t){g.onClick(b,t)})),g.isActionable()&&c.push(b);var w=b.children;if(0<w.length){var p=n,O=i;b instanceof Br&&(null==p&&(p=b),O=b),l.Kl(w,p,O,r,e,u,s,h,o,a,c)}},l=this,v=0,b=t.length;v<b;++v)f(v)},i.prototype.initData=function(t,n,i,r,e,u,s,h){for(var o=t.data,a=0,c=o.size();a<c;++a){var f=o.get(a);if(null!=f)switch(f.type){case Bt.BOOLEAN:case Bt.BOOLEAN_ARRAY:case Bt.NUMBER:case Bt.NUMBER_ARRAY:case Bt.STRING:case Bt.STRING_ARRAY:case Bt.OBJECT:case Bt.OBJECT_ARRAY:this.initDataValue(f,t,n,i,r,e,u,h);break;case Bt.TICKER:this.initDataTicker(f,u,s);break;default:this.initDataExtension(f,h)}}},i.prototype.initDataValue=function(t,n,i,r,e,u,s,h){if(t.scope===_t.PRIVATE)0<(o=t.id).length&&(r?r.data.private.add(o,t):h.private.add(o,t));else if(t.scope===_t.PROTECTED)0<(o=t.id).length&&h.protected.add(o,t);else{var o;e&&e(t,i||n),0<(o=t.id).length&&h.add(o,t)}var a=t.format,c=t.initial,f=u.get(t.type);null==f&&(f=new Map,u.set(t.type,f));var l=f.get(a);if(null!=l)t.formatter=l;else if(0<a.length){var v=this.calcFormatter(t,a,c);f.set(a,v),t.formatter=v}var b=s.get(t.type);null==b&&(b=new Map,s.set(t.type,b));var d=b.get(c);if(null!=d)t.value=d();else{var g=this.calcInitial(t,c);b.set(c,g),t.value=g()}},i.prototype.initDataTicker=function(t,n,i){var r=t.initial,e=n.get(t.type);null==e&&(e=new Map,n.set(t.type,e));var u=e.get(r);if(void 0!==u)t.value=0,i.add(u()).add(t);else{var s=this.calcInitial(t,r);e.set(r,s),t.value=0,i.add(s()).add(t)}},i.prototype.initDataExtension=function(t,n){var i=Fv.get(t.type);i&&(n.extended.add(i.id,t),t.value=i.initial)},i.prototype.initActions=function(t,n,i){var r=t.action.values,e=n.actions,u=Av.get(t.type);if(null!=u)for(var s=0,h=u.length;s<h;++s){var o=u[s];e.push(o),n.reset|=o.reset}for(s=0,h=r.length;s<h;++s){var a=r[s],c=i.get(a);null==c?null!=(c=a.toRuntime())&&(i.set(a,c),e.push(c),n.reset|=c.reset):(e.push(c),n.reset|=c.reset)}},i.prototype.calcFormatter=function(t,n,i){var r=this.toInitial(t);try{return Function("value","try {"+"return (".concat(n,");")+"} catch( e1 ) {try {"+"return (".concat(0<i.length?i:r,");")+"} catch( e2 ) {"+"return ".concat(r,";")+"}}")}catch(n){return this.toInitializer(t)}},i.prototype.calcInitial=function(t,n){if(n.length<=0)return this.toInitializer(t);try{return Function("try {"+"return (".concat(n,");")+"} catch( e ) {"+"return ".concat(this.toInitial(t),";")+"}")}catch(n){return this.toInitializer(t)}},i.prototype.toInitial=function(t){switch(t.type){case Bt.BOOLEAN:return"false";case Bt.BOOLEAN_ARRAY:return Fm;case Bt.NUMBER:return"0";case Bt.NUMBER_ARRAY:return Fm;case Bt.STRING:return'""';case Bt.STRING_ARRAY:return Fm;case Bt.OBJECT:return"{}";case Bt.OBJECT_ARRAY:return Fm;case Bt.TICKER:default:return"0"}},i.prototype.toInitializer=function(t){switch(t.type){case Bt.BOOLEAN:return Vm;case Bt.BOOLEAN_ARRAY:return Gm;case Bt.NUMBER:return Um;case Bt.NUMBER_ARRAY:return Gm;case Bt.STRING:return Hm;case Bt.STRING_ARRAY:return Gm;case Bt.OBJECT:return zm;case Bt.OBJECT_ARRAY:return Gm;case Bt.TICKER:default:return Um}},i.prototype.onDestroy=function(){var t=this;this.Xt.extended.each((function(n){var i=Fv.getById(n);if(i){var r=i.stop;r&&r(t)}})),this.et.stop(),n.prototype.onDestroy.call(this)},i.prototype.hitTestInteractives=function(t){for(var n=this.bs.children,i=n.length-1;0<=i;--i){var r=n[i];if(r.visible){var e=r.hitTestInteractives(t);if(null!=e)return e}}return null},i.prototype.onShapeMove=function(t){var n=this.hitTestInteractives(t.data.global);this.cursor=this.ii=this.toShapeCursor(n);var i=st.getLayer(this);if(i){var r=this.toShapeTitle(n),e=i.view;e.title!==r&&(e.title=r)}var u=this.Yl;if(this.Yl=n,n===u){if(null!=n){var s=n.runtime;s&&s.onMove(n,t)}}else this.onShapeOut(t,u,n),this.onShapeOver(t,n);return null!=n},i.prototype.toShapeCursor=function(t){if(null!=t)for(var n=t;;){var i=n.cursor;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof Rt))break;n=r}return"auto"},i.prototype.toShapeTitle=function(t){if(null!=t)for(var n=t;;){var i=n.title;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof Rt))break;n=r}return""},i.prototype.onShapeOut=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Rt;){var r=n.runtime;r&&r.onOut(n,t),n=n.parent}},i.prototype.onShapeOver=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Rt;){var r=n.runtime;r&&r.onOver(n,t),n=n.parent}},i.prototype.onShapeDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Jl=n,n){this.Xl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onDown(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeUp=function(t){var n=this.Xl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onUp(r,t);var u=r.parent;if(!(u instanceof Rt))break;r=u}}return this.onShapeCancel(t),null!=i},i.prototype.onShapeCancel=function(t){var n=this.Xl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onUpOutside(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}})),n.clear(),!0)},i.prototype.onShapeClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Jl===n){for(var i=n;;){var r=i.runtime;r&&r.onClick(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeDblClick=function(n,r){var e,u=null!==(e=i.WORK_DBLCLICK)&&void 0!==e?e:i.WORK_DBLCLICK=new t.Point;ir.toGlobal(n,r,u);var s=this.hitTestInteractives(u);if(s){for(var h=s;;){var o=h.runtime;o&&o.onDblClick(h,n,r);var a=h.parent;if(!(a instanceof Rt))break;h=a}return!0}return!1},i.prototype.onShapeRightClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Jl===n){for(var i=n;;){var r=i.runtime;r&&r.onRightClick(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeRightDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Jl=n,n){this.Xl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onRightDown(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeRightUp=function(t){var n=this.Xl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onRightUp(r,t);var u=r.parent;if(!(u instanceof Rt))break;r=u}}return this.onShapeRightCancel(t),null!=i},i.prototype.onShapeRightCancel=function(t){var n=this.Xl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onRightUpOutside(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}})),n.clear(),!0)},i.prototype.update=function(){var t=this.Wl;if(0<t.length){for(var n=-1,i=Date.now(),r=0,e=t.length;r<e;++r){var u=t[r];u.update(i);var s=u.runtime;if(s){var h=s.effect;i<h&&(n=n<0?h:Math.min(n,h))}}0<=n&&window.setTimeout(this.Da,n-Date.now())}},i.prototype.onRender=function(t){var n=this.Wl;if(0<n.length){for(var i=-1,r=Date.now(),e=0,u=n.length;e<u;++e){var s=n[e];s.onRender(r,t);var h=s.runtime;if(h){var o=h.effect;r<o&&(i=i<0?o:Math.min(i,o))}}0<=i&&window.setTimeout(this.Da,i-Date.now())}},i.prototype.getType=function(){return"DDiagramCanvas"},i}(Am),Xm=function(){function t(t){this.Zl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return null!=t?t.data.private.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.private.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.private.toDirty(t)},t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.private.each(t):null},t}(),Km=function(){function t(t){this.Zl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return null!=t?t.data.protected.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.protected.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.protected.toDirty(t)},t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.protected.each(t):null},t}(),Ym=function(){function t(t){this.yl=t&&t.controller}return t.prototype.set=function(t,n){var i=this.yl;return!!i&&(i.write(t,n),!0)},t}(),Jm=function(){function t(t){this.Zl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return null!=t?t.data.extended.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.extended.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.extended.toDirty(t)},t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.extended.each(t):null},t}(),Zm=function(){function t(t,n){this.Zl=t,this.ql=n&&n.mapper||null,this.Ql=new Ym(n&&n.remote),this.Zt=new Xm(t),this.Gl=new Km(t),this.Hl=new Jm(t)}return t.prototype.update=function(){},Object.defineProperty(t.prototype,"mapper",{get:function(){return this.ql},set:function(t){this.ql=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remote",{get:function(){return this.Ql},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"private",{get:function(){return this.Zt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protected",{get:function(){return this.Gl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extended",{get:function(){return this.Hl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return t?t.data.ids:[]},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.each(t):null},t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.set(t,n,i,r,e,u)},t.prototype.get=function(t){var n=this.Zl.canvas;return null!=n?n.data.get(t):null},t.prototype.clear=function(t){var n=this.Zl.canvas;return null!=n&&n.data.clear(t)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.toDirty(t)},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.setAll(t,n,i,r,e,u)},t.prototype.setValue=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setValue(t,n)},t.prototype.setValues=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setValues(t,n)},t.prototype.setTime=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setTime(t,n)},t.prototype.setTimes=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setTimes(t,n)},t.prototype.setState=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setState(t,n)},t.prototype.setStates=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setStates(t,n)},t.prototype.setRange=function(t,n,i){var r=this.Zl.canvas;return null!=r&&r.data.setRange(t,n,i)},t}(),qm=function(){function t(t,n,i){this.Bl=t,this.vs=this.toIsEnabled(n,i),this.zn=this.toCreateAsUrlOptions(n,i)}return t.prototype.toIsEnabled=function(t,n){var i;return null!==(i=null==n?void 0:n.enable)&&void 0!==i?i:t.isThumbnailEnabled()},t.prototype.toSize=function(t,n){return void 0!==n?n:t.getThumbnailSize()},t.prototype.toCleanup=function(t,n){var i,r;return null==n||!0===n?{snap:!0,background:!0}:!1===n?{snap:!1,background:!1}:{snap:null===(i=n.snap)||void 0===i||i,background:null===(r=n.background)||void 0===r||r}},t.prototype.toCreateAsUrlOptions=function(t,n){return{size:this.toSize(t,null==n?void 0:n.size),cleanup:this.toCleanup(t,null==n?void 0:n.cleanup)}},Object.defineProperty(t.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.zn.size},set:function(t){this.zn.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cleanup",{get:function(){return this.zn.cleanup},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){if(this.vs)return this.Bl.createAsUrl(this.zn)},t}(),Qm=function(t){function n(n){var i=t.call(this,n)||this;i.Kt=!1,i.Kt=!1,Lb.getCommandController().on("dirty",(function(){!0!==i.Kt&&(i.Kt=!0,i.emit("change",i))}));var r=i.theme;return i.$l=new qv(i,r,null==n?void 0:n.snapper),i.tv=new qm(i.Bl,r,null==n?void 0:n.thumbnail),i}return _(n,t),Object.defineProperty(n.prototype,"thumbnail",{get:function(){return this.tv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"snapper",{get:function(){return this.$l},enumerable:!1,configurable:!0}),n.prototype.toMode=function(t){return(null==t?void 0:t.mapping)?jr.EDITOR_DATA_MAPPED:jr.EDITOR},n.prototype.newCanvas=function(t){return new xm(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){var n=this.toCanvasBaseOptions(t),i=this.$l,r=n.snap;return null==r?n.snap={controller:i}:null==r.controller&&(r.controller=i),n},n.prototype.serialize=function(){var t=this.canvas,n=this.kl;if(null!=t&&null!=n){this.emit("serializing",t,this);try{var i=t.serialize(n.id,this.tv);return this.emit("serialized",t,null,this),i}catch(n){return this.emit("serialized",t,"exception",this),null}}return null},n.prototype.save=function(){var t=this,n=this.serialize();if(null!=n){var i=this.yl;if(i){var r=Ye.toSimple(n);return this.emit("saving",r,this),i.save(r).then((function(i){t.Kt=!1,n.id=i,t.kl=n,t.emit("change",t),t.emit("saved",null,t)}),(function(n){t.emit("saved",n,t)}))}return this.emit("saved","no-controller",this),Promise.reject()}return this.emit("saved",null,this),Promise.resolve()},n.prototype.saveAs=function(t){var n=this,i=this.serialize();if(null!=i){var r=this.yl;if(r){i.id=void 0,i.name=t;var e=Ye.toSimple(i);return this.emit("saving",e,this),r.save(e).then((function(r){n.Kt=!1,i.id=r,n.kl=i;var e=n.canvas;null!=e&&(e.name=t),n.emit("change",n),n.emit("saved",null,n)}),(function(t){n.emit("saved",t,n)}))}return this.emit("saved","no-controller",this),Promise.reject("no-controller")}return this.emit("saved",null,this),Promise.resolve()},n.prototype.delete=function(){var t=this,n=this.kl;if(n&&null!=n.id){var i=this.yl;return i?(this.emit("deleting",this),i.delete(n.id).then((function(){var n=t.set(null);return t.emit("deleted",null,t),n}),(function(n){return t.emit("deleted",n,t),Promise.reject(n)}))):(this.emit("deleted","no-controller",this),Promise.reject("no-controller"))}return this.set(null),this.emit("deleted",null,this),Promise.resolve(null)},n.prototype.create=function(t,n,i){return this.set({version:1,id:void 0,name:t,width:n,height:i,resources:[],data:[],layers:[["Default layer"]],items:[],snap:void 0})},n.prototype.onSet=function(n,i){t.prototype.onSet.call(this,n,i);var r=n.snap,e=this.$l;null!=r?e.deserialize(r):e.reset(),this.xl&&(e.target.visible=!1,e.grid.visible=!1),this.Kt=!1,this.emit("change",this)},n.prototype.onUnset=function(){t.prototype.onUnset.call(this),this.Kt=!1,this.emit("change",this)},n.prototype.open=function(t){var n=this,i=this.yl;return i?(this.emit("opening",this),i.get(t).then((function(t){var i=n.set(Ye.toSerialized(t));return n.emit("opened",null,n),i}),(function(t){return n.emit("opened",t,n),Promise.reject(t)}))):(this.emit("opened","no-controller",this),Promise.reject("no-controller"))},n.prototype.close=function(){return this.set(null)},n.prototype.isChanged=function(){return this.Kt||this.isNew()},n.prototype.isNew=function(){var t=this.kl;return null!=t&&null==t.id},n.prototype.getName=function(){var t=this.kl;return null!=t?t.name:null},n.prototype.getType=function(){return"DDiagramEditor"},n}(Sm),$m=function(t){function n(n){var i=t.call(this)||this;return i.Zl=n,i.Da=function(){st.update(n)},i}return _(n,t),n.prototype.update=function(){var t=this.Zl.canvas;t&&t.update()},n.prototype.onRender=function(t){var n=this.Zl.canvas;n&&n.onRender(t)},n.prototype.get=function(t){var n=this.Zl.canvas;return n?n.shape.get(t):null},n.prototype.getAll=function(t){var n=this.Zl.canvas;return n?n.shape.getAll(t):[]},n.prototype.each=function(t,n){void 0===n&&(n=!1);var i=this.Zl.canvas;if(null!=i){var r=i.layer.children;if(n){for(e=r.length-1;0<=e;--e)for(h=(s=r[e].children).length-1;0<=h;--h)if(!1===t(a=s[h]))return a}else for(var e=0,u=r.length;e<u;++e)for(var s,h=0,o=(s=r[e].children).length;h<o;++h){var a;if(!1===t(a=s[h]))return a}}return null},n}(t.utils.EventEmitter),tw=function(t){function n(n){var i=t.call(this,n)||this;i.on(ir.move,(function(t){i.onShapeMove(t)})),i.on(ir.up,(function(t){i.onShapeUp(t)})),i.on(ir.upoutside,(function(t){i.onShapeCancel(t)})),i.on(ir.cancel,(function(t){i.onShapeCancel(t)})),i.on(ir.tap,(function(t){i.onShapeClick(t)})),i.on(ir.righttap,(function(t){i.onShapeRightClick(t)})),i.on(ir.rightdown,(function(t){i.onShapeRightDown(t)})),i.on(ir.rightup,(function(t){i.onShapeRightUp(t)})),i.on(ir.rightupoutside,(function(t){i.onShapeRightCancel(t)}));var r=new Zm(i,n&&(n.data||n.tag));return i.data=r,i.tag=r,i.shape=new $m(i),i}return _(n,t),n.prototype.initLayer=function(n,i,r){return t.prototype.initLayer.call(this,n,i,r||this.data.mapper)},n.prototype.toMode=function(t){return jr.VIEWER},n.prototype.newCanvas=function(t){return new Wm(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){return this.toCanvasBaseOptions(t)},n.prototype.onDown=function(n){var i=this.canvas;i?t.prototype.onDown.call(this,n,i.onShapeDown(n)):t.prototype.onDown.call(this,n)},n.prototype.onShapeMove=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeMove(t)}},n.prototype.onShapeUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeUp(t)}},n.prototype.onShapeCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeCancel(t)}},n.prototype.onShapeClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeClick(t)}},n.prototype.onShapeRightClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightClick(t)}},n.prototype.onShapeRightDown=function(t){var n=this.canvas;n&&n.onShapeRightDown(t)},n.prototype.onShapeRightUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightUp(t)}},n.prototype.onShapeRightCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightCancel(t)}},n.prototype.onDblClick=function(n,i){var r=this.canvas;return r?t.prototype.onDblClick.call(this,n,i,r.onShapeDblClick(n,i)):t.prototype.onDblClick.call(this,n,i)},n.prototype.render=function(n){this.shape.onRender(n),t.prototype.render.call(this,n)},n.prototype.getType=function(){return"DDiagram"},n}(Sm),nw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmMessage"},n}(Tl),iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.message),r},n.prototype.toMessage=function(t,n){var i=null==n?void 0:n.message;return null!=i?Ot(i)||wt(i)?this.newMessage(this.toMessageOptions(i)):i instanceof hr?i:this.newMessage(this.toMessageOptionsMerged(i,t.getMessage())):this.newMessage(this.toMessageOptions(t.getMessage()))},n.prototype.toMessageOptionsMerged=function(t,n){var i=t.text;return null==i&&(i={},t.text=i),void 0===i.value&&(i.value=n),t},n.prototype.toMessageOptions=function(t){return{text:{value:t}}},n.prototype.newMessage=function(t){return new nw(t)},Object.defineProperty(n.prototype,"message",{get:function(){var t=this.nv;return null==t&&(t=this.toMessage(this.theme,this.zn),this.nv=t),t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){},n.prototype.getType=function(){return"DDialogConfirm"},n}(ys),rw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDelete"},n}(iw),ew=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDiscard"},n}(iw),uw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogMessage"},n}(iw),sw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogProcessingMessage"},n}(nw),hw=function(t){function n(n){var i,r=this;(r=t.call(this,n)||this).iv=!0,r.si=0;var e=null==n?void 0:n.delay;r.rv=null!==(i=null==e?void 0:e.done)&&void 0!==i?i:r.theme.getDoneDelay();var u=null==e?void 0:e.close;return r.ev=void 0!==u?u:r.theme.getCloseDelay(),r.uv=r.message.text,r}return _(n,t),n.prototype.newMessage=function(t){return new sw(t)},n.prototype.onOpen=function(){this.iv=!1,this.si=Date.now();var n=this.$;null!=n&&clearTimeout(n);var i=this.sv;null!=i&&clearTimeout(i);var r=this.message;r.text=this.uv,r.state.removeAll(ct.SUCCEEDED,ct.FAILED);var e=this.Ih;null!=e&&e.hide(),t.prototype.onOpen.call(this)},n.prototype.onDone=function(t){var n=this;null!=t?this.sv=window.setTimeout((function(){n.close()}),t):this.close()},n.prototype.onResolved=function(t){null!=t&&(this.message.text=t),this.message.state.set(ct.SUCCEEDED,ct.FAILED);var n=this.ev;if(null!=n)this.onDone(n);else{var i=this.Ih;null!=i?i.show():this.close()}},n.prototype.onRejected=function(t){null!=t&&(this.message.text=t),this.message.state.set(ct.FAILED,ct.SUCCEEDED);var n=this.Ih;null!=n?n.show():this.onDone(this.ev)},n.prototype.resolve=function(t){var n=this;if(!this.iv){this.iv=!0;var i=Date.now()-this.si,r=this.rv-i;0<r?this.$=window.setTimeout((function(){n.$=void 0,n.onResolved(t)}),r):this.onResolved(t)}},n.prototype.reject=function(t){var n=this;if(!this.iv){this.iv=!0;var i=Date.now()-this.si,r=this.rv-i;0<r?this.$=window.setTimeout((function(){n.$=void 0,n.onRejected(t)}),r):this.onRejected(t)}},n.prototype.onCloseOn=function(){this.iv&&t.prototype.onCloseOn.call(this)},n.prototype.getType=function(){return"DDialogProcessing"},n}(iw),ow=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(){var n=Lb.getDocumentController().getName();null!=n&&(this.input.value=n),t.prototype.onOpen.call(this)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=Lb.getCommandController();Ot(n)?i.push(new Dm(n)):n.then((function(t){i.push(new Dm(t))}))},n.prototype.getType=function(){return"DDialogSaveAs"},n}(th),aw=function(){function t(t){this.hv=t,this.ov=[]}return t.prototype.indexOf=function(t){return this.ov.indexOf(t)},t.prototype.close=function(t){for(var n=this.ov,i=Math.max(0,t),r=n.length-1;i<=r;--r)n[r].close()},t.prototype.add=function(t){this.ov.push(t)},t.prototype.trim=function(t){this.close(this.indexOf(t)+1)},t.prototype.remove=function(t){var n=this.indexOf(t);0<=n&&(this.close(n+1),this.ov.splice(n,1))},t}(),cw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u=this;t.prototype.init.call(this,n),this.ws=function(){u.onPrerender()},this.Lt=Ai(null!==(i=null==n?void 0:n.align)&&void 0!==i?i:xu.BOTTOM,xu),this.av=null!==(r=null==n?void 0:n.fit)&&void 0!==r&&r,this.ps=null!==(e=null==n?void 0:n.sticky)&&void 0!==e&&e,this.cv=!1,this.hv=null,this.ea=null,this.visible=!1,Hu.apply(this,(function(){u.close()})),this.on("select",(function(){u.close()}));var s=null==n?void 0:n.items;s&&Ll.newItems(this,s,this.ps),this.Ds=new zu(n)},n.prototype.findItem=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof Il&&e.value===t)return e}return null},n.prototype.getType=function(){return"DMenu"},n.prototype.getContext=function(){return this.ea},n.prototype.getCloseable=function(){return this},n.prototype.open=function(n,i,r){if(this.isHidden()){var e=this.Ds.pick(this);this.hv=n;for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof hr&&o.state.removeAll(ct.FOCUSED,ct.HOVERED)}var a=e.renderer,c=this.ws;if(this.ps?a.on("prerender",c):a.once("prerender",c),this.av){var f=n.getBounds();null!=f&&(this.width=f.width)}this.cv=null!=r,r=r||new aw(n),null!=i&&r.trim(i),r.add(this),this.ea=r,e.stage.addChild(this),this.Es=e.getFocusController().get(),this.focus(),t.prototype.show.call(this),this.emit("open",this)}return this},n.prototype.onPrerender=function(){var t=this.hv;if(t){var n=t.getBounds();if(n){this.av&&(this.width=n.width);var i=this.Ds.picked;if(i){var r=this.theme;Bu.attach(this,n,r.getOffsetX(),r.getOffsetY(),i.width,i.height,this.Lt)}}}},n.prototype.close=function(){if(this.isShown()){var n=this.ea;n&&n.remove(this);var i=this.Ds.picked;i&&i.renderer.off("prerender",this.ws),this.hv=null;var r=this.Es;if(null!=r)if(this.Es=null,i){var e=st.getLayer(r);null!=e&&i!==e&&e.view.focus(),i.getFocusController().focus(r)}else this.blur(!0);else this.blur(!0);t.prototype.hide.call(this);var u=this.parent;u&&u.removeChild(this),this.emit("close",this)}return this},n.prototype.onKeyDown=function(n){return nr.moveFocusVertically(n,this,this.Ds),this.state.isActionable&&(nr.isArrowLeftKey(n)||nr.isCancelKey(n))&&this.close(),t.prototype.onKeyDown.call(this,n)},n.prototype.containsGlobalPoint=function(t){return!this.cv},n}(Ju);Ll.setMenuCreator((function(t){return new cw(t)}));var fw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this)},n.prototype.onMenuClose=function(t){if(t){var n=this.fv;n&&t.off("select",n);var i=this.lv;i&&t.off("close",i)}},n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof cw?i:new cw(this.toMenuOptions(t,i))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!0),n):{fit:!0}},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this.Po;return null==t&&(t=this.toMenu(this.theme,this.zn),this.Po=t),t},set:function(t){var n=this.Po;n!=t&&(this.Po=t,this.onMenuReplaced(t,n))},enumerable:!1,configurable:!0}),n.prototype.onMenuReplaced=function(t,n){null!=n&&this.onMenuClose(n)},n.prototype.getType=function(){return"DDropdownBase"},n.prototype.onKeyDown=function(n){return nr.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){var t=this,n=this.menu;if(n.isHidden()){var i=this.fv;null==i&&(i=function(n,i,r){t.onMenuSelect(n,i,r)},this.fv=i);var r=this.lv;null==r&&(r=function(){t.onMenuClose(t.Po)}),n.on("select",i),n.on("close",r),n.open(this),this.emit("open",n,this)}},n.prototype.close=function(){this.menu.close()},n}(js),lw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDropdown"},n}(fw),vw=function(t){function n(n){var i=t.call(this,n)||this;return i.on(ir.down,(function(t){i.state.isActionable&&i.onSelect(t)})),i}return _(n,t),n.prototype.onSelect=function(t){this.emit("select",this)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},n.prototype.getType=function(){return"DExpandableHeader"},n}(Tl),bw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i=this;n.prototype.init.call(this,t);var r=this.theme,e=this.toHeader(r,t);this.Th=e,e.on("select",(function(){i.toggle()})),this.addChild(e);var u=this.toBody(r,t);this.Ie=u,this.addChild(u),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.toHeader=function(n,i){return i&&i.header?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new vw(n)},i.prototype.toBody=function(t,n){return n.body},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.Ie;t instanceof hr?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.Ie;t instanceof hr?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.getType=function(){return"DExpandable"},i}(Ju),dw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new Ks(t)},n}(Wb),gw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new pb(this,this.newOperation(),this.theme,this.zn)},n.prototype.getType=function(){return"DInputTextArea"},n}(Vs),mw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DListItemAmbient"},n}(wd),ww=function(){function t(t){void 0===t&&(t=256),this.vv=t}return t.prototype.getTileSize=function(){return this.vv},t.prototype.lonLatToMeters=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x*r/180,i.y=Math.log(Math.tan((90+n.y)*Math.PI/360))*r/Math.PI,i},t.prototype.metersToLonLat=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x/r*180,i.y=360*Math.atan(Math.exp(n.y*Math.PI/r))/Math.PI-90,i},t.prototype.pixelsToMeters=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=n.x*u-s,e.y=s-n.y*u,e},t.prototype.metersToPixels=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=(n.x+s)/u,e.y=(s-n.y)/u,e},t.prototype.pixelsToTile=function(t,n,i){return i.x=Math.ceil(t.x/n)-1,i.y=Math.ceil(t.y/n)-1,i},t.prototype.metersToTile=function(n,i,r){var e=t.CIRCUMFERENCE_HALF,u=1<<i;return r.x=Math.ceil(.5*(n.x/e+1)*u)-1,r.y=Math.ceil(.5*(1-n.y/e)*u)-1,r},t.prototype.lonLatToTile=function(t,n,i){return this.metersToTile(this.lonLatToMeters(t,i),n,i)},t.prototype.lonLatToPixels=function(t,n,i,r){return this.metersToPixels(this.lonLatToMeters(t,r),n,i,r)},t.prototype.pixelsToLonLat=function(t,n,i,r){return this.metersToLonLat(this.pixelsToMeters(t,n,i,r),r)},t.prototype.tileToPixels=function(t,n,i){return i.x=t.x*n,i.y=t.y*n,i},t.prototype.tileToMeters=function(n,i,r){var e=this.toResolutionMeter(i),u=t.CIRCUMFERENCE_HALF;return r.x=n.x*e+u,r.y=u-n.y*e,r},t.prototype.toResolutionMeter=function(n){return 2*t.CIRCUMFERENCE_HALF/(1<<n)},t.prototype.toResolution=function(n,i){return 2*t.CIRCUMFERENCE_HALF/(i<<n)},t.prototype.toTileCount=function(t){return 1<<t},t.prototype.toTileCode=function(t,n,i){return(n<<t)+i},t.CIRCUMFERENCE_HALF=6378137*Math.PI,t}(),pw=function(){function t(){}return Object.defineProperty(t,"DEFAULT",{get:function(){return null==this.Wr&&(this.Wr=new ww),this.Wr},enumerable:!1,configurable:!0}),t}(),Ow=function(){function n(n,i,r,e,u,s){this.tx=i,this.ty=r;var h=new t.Sprite(t.Texture.EMPTY);h.parent=n,h.position.set(e,u),h.scale.set(s,s),this.bv=h}return n.prototype.load=function(n,i){var r=t.Texture.from(n,{resolution:1});this.bv.texture=r,r.valid?i():r.on("update",i)},n.prototype.transform=function(t,n,i){var r=this.bv;r.position.set(t,n),r.scale.set(i,i)},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.bv.texture.valid},enumerable:!1,configurable:!0}),n.prototype.render=function(t){var n=this.bv;n.updateTransform(),n.render(t)},n.prototype.destroy=function(){var n=this.bv,i=n.texture,r=i.baseTexture.resource,e=null;r instanceof t.resources.BaseImageResource&&r.source instanceof HTMLImageElement&&(e=r.source),i.destroy(!0),n.destroy(),e&&(e.src="")},n}(),Dw=function(){function n(t,n,i,r,e,u){var s=this;this.p=t,this.uu=n,this.dv=u,this.gv=!1,this.mv=!0,this.wv=function(){s.onLoaded()},this.pv=i,this._lon0=NaN,this._lat0=NaN,this._lon1=NaN,this._lat1=NaN,this.Ov=new Map,this.Dv=function(t){s.renderTile(t)},this.Ev=NaN,this.Mv=NaN,this.Sv=NaN,this.jv=NaN,this.Tv=function(t,n,i){s.deleteTile(t,n,i)},this.Nv=function(t){s.destroyTile(t)},this.Iv=function(t){t.loaded||(s.Cv=!1)},this.Av=e.toTileCount(i),this.Rv=1/this.Av,this.kv=r.scale*this.Rv,this.vv=e.getTileSize()*r.scale,this.Jt=r,this.rl=e,this.Cv=!0}return n.prototype.newTile=function(t,n,i,r,e){return new Ow(this.p,t,n,i,r,e)},n.prototype.renderTile=function(t){t.render(this.eu)},Object.defineProperty(n.prototype,"tz",{get:function(){return this.pv},enumerable:!1,configurable:!0}),n.prototype.render=function(t){this.eu=t,this.Ov.forEach(this.Dv)},n.prototype.move=function(t,i,r,e){var u=this._lon0,s=this._lat0,h=this._lon1,o=this._lat1;if(u!==t||s!==i||h!==r||o!==e){this._lon0=t,this._lat0=i,this._lon1=r,this._lat1=e;var a=this.pv,c=this.rl,f=n.WORK;f.set(t,i),c.lonLatToTile(f,a,f);var l=f.x,v=f.y;f.set(r,e),c.lonLatToTile(f,a,f);var b=f.x,d=f.y,g=this.Av,m=Math.max(0,l),w=Math.min(g-1,b),p=Math.max(0,v),O=Math.min(g-1,d),D=m-this.Ev,E=w-this.Mv,M=p-this.Sv,S=O-this.jv,j=D!=D||D<0||1<D,T=E!=E||0<E||E<-1,N=M!=M||M<0||1<M,I=S!=S||0<S||S<-1;if(j||T||N||I){j?this.Ev=m:m=this.Ev,T?this.Mv=w:w=this.Mv,N?this.Sv=p:p=this.Sv,I?this.jv=O:O=this.jv,this.Ov.forEach(this.Tv);var C=m+w>>1,A=p+O>>1,R=Math.max(C-m,w-C),k=Math.max(A-p,O-A),L=Math.max(R,k);this.toOffset(f);var y=f.x,x=f.y;this.gv=!1,this.mv=!1,this.loadTile(a,C,A,y,x,f);for(var B=1;B<=L;++B){var _=C-B;m<=_&&this.loadTilesY(a,_,A,B,p,O,y,x,f);var P=C+B;P<=w&&this.loadTilesY(a,P,A,B,p,O,y,x,f);var F=A-B;p<=F&&this.loadTilesX(a,C,B-1,m,w,F,y,x,f);var U=A+B;U<=O&&this.loadTilesX(a,C,B-1,m,w,U,y,x,f)}this.mv=!0,this.gv&&this.onLoaded()}}},n.prototype.loadTilesX=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,u,s,h,o);for(var a=1;a<=i;++a){var c=n-a;r<=c&&this.loadTile(t,c,u,s,h,o);var f=n+a;f<=e&&this.loadTile(t,f,u,s,h,o)}},n.prototype.loadTilesY=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,i,s,h,o);for(var a=1;a<=r;++a){var c=i-a;e<=c&&this.loadTile(t,n,c,s,h,o);var f=i+a;f<=u&&this.loadTile(t,n,f,s,h,o)}},n.prototype.loadTile=function(t,n,i,r,e,u){var s=this.rl.toTileCode(t,n,i),h=this.Ov,o=h.get(s);null==o&&(this.toTilePosition(n,i,r,e,u),o=this.newTile(n,i,u.x,u.y,this.kv),h.set(s,o),o.load(this.uu(t,n,i),this.wv),this.Cv=!1)},n.prototype.toTilePosition=function(t,n,i,r,e){var u=this.vv,s=this.Rv;return e.set(t,n),this.rl.tileToPixels(e,u,e),e.set(e.x*s+i,e.y*s+r),e},n.prototype.toOffset=function(t){var n=this.p,i=this.Jt,r=this.vv;return t.set(-i.x*r+.5*n.width,-i.y*r+.5*n.height),t},n.prototype.deleteTile=function(t,n,i){var r=t.tx,e=t.ty;(r<this.Ev||this.Mv<r||e<this.Sv||this.jv<e)&&(i.delete(n),t.destroy())},n.prototype.destroy=function(){var t=this.Ov;t.forEach(this.Nv),t.clear()},n.prototype.destroyTile=function(t){t.destroy()},n.prototype.updateLoadingState=function(){this.Cv=!0,this.Ov.forEach(this.Iv)},n.prototype.onLoaded=function(){this.mv?this.dv():this.gv=!0},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.Cv||this.updateLoadingState(),this.Cv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mapping",{get:function(){return this.Jt},set:function(t){var i=this,r=this.rl,e=t.scale*this.Rv,u=r.getTileSize()*t.scale;this.kv=e,this.vv=u,this.Jt=t;var s=n.WORK;this.toOffset(s);var h=s.x,o=s.y;this.Ov.forEach((function(t){i.toTilePosition(t.tx,t.ty,h,o,s),t.transform(s.x,s.y,e)}))},enumerable:!1,configurable:!0}),n.WORK=new t.Point,n}(),Ew=function(n){function i(t){var i=n.call(this)||this,r=t.canvas;i.vr=r,i.uu=t.builder;var e=t.mapping;i.Jt=e;var u=t.coordinate;i.rl=u,i.Lv=i.toMapping(r,e,u),i._z=NaN,i.pv=NaN,i.yv=t.plane.min,i.xv=t.plane.max,i.Bv=[],i.wv=function(){i.onLoaded()},i._v=function(){i.Pv=void 0,i.fit()},i.Fv=t.plane.throttle;var s=function(){i.fitThrottled()};return i.Uv=s,r.on("scale",s),r.on("move",s),r.snippet.add(i,!0),i}return _(i,n),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.rl},enumerable:!1,configurable:!0}),i.prototype.fitThrottled=function(){null==this.Pv&&(this.Pv=window.setTimeout(this._v,this.Fv))},i.prototype.toMapping=function(t,n,r){var e=i.WORK_LONLAT,u=r.getTileSize();e.set(n.from.lon,n.from.lat),r.lonLatToPixels(e,0,u,e);var s=e.x,h=e.y;e.set(n.to.lon,n.to.lat),r.lonLatToPixels(e,0,u,e);var o=e.x,a=e.y,c=Math.abs(o-s),f=Math.abs(a-h),l=1e-7,v=1;return l<c?v=l<f?Math.max(t.width/c,t.height/f):t.width/c:l<f&&(v=t.height/f),{scale:v,x:.5*(o+s)/u,y:.5*(a+h)/u}},Object.defineProperty(i.prototype,"mapping",{get:function(){return this.Jt},set:function(t){var n=this.Lv,i=this.toMapping(this.vr,t,this.rl),r=1e-7;if(r<Math.abs(n.scale-i.scale)||r<Math.abs(n.x-i.x)||r<Math.abs(n.y-i.y)){this.Lv=i;for(var e=this.Bv,u=0,s=e.length;u<s;++u){var h=e[u];h&&(h.mapping=i)}st.update(this.vr),this.Uv()}},enumerable:!1,configurable:!0}),i.prototype.newPlane=function(t){return new Dw(this.vr,this.uu,t,this.Lv,this.rl,this.wv)},i.prototype.render=function(t){for(var n=this.pv,i=this.Bv,r=0;r<n;++r)null!=(e=i[r])&&e.render(t);for(r=i.length-1;n<r;--r){var e;null!=(e=i[r])&&e.render(t)}var u=i[n];null!=u&&u.render(t)},i.prototype.toTileZ=function(t){return Math.min(this.xv,Math.max(this.yv,Math.floor(t)))},i.prototype.updateTransform=function(){},i.prototype.toZ=function(t){return Math.log(this.Lv.scale*t)/Math.log(2)},i.prototype.move=function(t,n,i,r,e){var u=this.Bv,s=this.toZ(t);if(this._z!==s){this._z=s;var h=this.toTileZ(s);if(this.pv!==h){this.pv=h;var o=u[h];null==o&&(o=this.newPlane(h),u[h]=o)}}var a=u[this.pv];return null!=a&&a.move(n,i,r,e),this},i.prototype.fit=function(){var t=this.vr;if(null!=t){var n=t.parent;if(null!=n){var r=t.scale,e=r.x,u=r.y,s=t.x,h=t.y,o=this.rl,a=this.Lv,c=o.getTileSize()*a.scale,f=a.x*c-(s/e+.5*t.width),l=f+n.width/e,v=a.y*c-(h/u+.5*t.height),b=v+n.height/u,d=i.WORK_LONLAT;d.set(f,v),o.pixelsToLonLat(d,0,c,d);var g=d.x,m=d.y;d.set(l,b),o.pixelsToLonLat(d,0,c,d);var w=d.x,p=d.y;this.move(e,g,m,w,p)}}return this},i.prototype.destroyPlanesBefore=function(t,n){for(var i=0;i<t;++i){var r=n[i];r&&(r.destroy(),n[i]=void 0)}},i.prototype.destroyPlanesAfter=function(t,n){for(var i=t+1,r=n.length;i<r;++i){var e=n[i];e&&(e.destroy(),n[i]=void 0)}},i.prototype.cleanup=function(){var t=this.pv,n=this.Bv,i=n[t];if(i&&i.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(t,n);for(var r=t+1,e=n.length;r<e;++r)if((u=n[r])&&u.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(r,n);for(r=t-1;0<=r;--r){var u;if((u=n[r])&&u.loaded)return void this.destroyPlanesBefore(r,n)}},i.prototype.onLoaded=function(){this.cleanup(),st.update(this.vr)},i.prototype.destroy=function(){for(var t=this.Bv,n=0,i=t.length;n<i;++n){var r=t[n];r&&(r.destroy(),t[n]=void 0)}var e=this.vr,u=this.Uv;return e.off("scale",u),e.off("move",u),e.snippet.remove(this,!0),this},i.WORK_LONLAT=new t.Point,i}(t.utils.EventEmitter),Mw=function(t,n,i){return"https://j.tile.openstreetmap.jp/".concat(t,"/").concat(n,"/").concat(i,".png")},Sw=function(){function t(){}return t.toPlaneOptions=function(t){var n,i,r,e=t.plane;return{min:null!==(n=null==e?void 0:e.min)&&void 0!==n?n:this.MIN,max:null!==(i=null==e?void 0:e.max)&&void 0!==i?i:this.MAX,throttle:null!==(r=null==e?void 0:e.throttle)&&void 0!==r?r:this.THROTTLE}},t.from=function(t){return new Ew({canvas:t.canvas,builder:t.builder||Mw,mapping:t.canvas.tile.mapping,coordinate:t.coordinate||pw.DEFAULT,plane:this.toPlaneOptions(t)})},t.MIN=0,t.MAX=18,t.THROTTLE=333,t}(),jw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof cw?i:new cw(this.toMenuOptions(t,i))},n.prototype.newMenu=function(t,n){return new cw(this.toMenuOptions(t,n))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!1),n):{fit:!1}},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){this.menu.open(this)},n.prototype.close=function(){this.menu.close()},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this,n=this.Po;return null==n&&((n=this.toMenu(this.theme,this.zn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Po=n),n},enumerable:!1,configurable:!0}),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this);var r=this.parent;r&&r.emit("select",t,n,r)},n.prototype.onKeyDown=function(n){return nr.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onActivate(t),0))},n.prototype.getType=function(){return"DMenuBarItem"},n}(Ts),Tw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t);var i=null==t?void 0:t.items;if(i)for(var r=0,e=i.length;r<e;++r){var u=this.toItem(i[r]);u&&this.addChild(u)}},i.prototype.toItem=function(n){return null==n?null:n instanceof t.DisplayObject?n:"space"in n?new Xu(n):new jw(n)},i.prototype.onKeyDown=function(t){return nr.moveFocusHorizontally(t,this),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuBar"},i}(Is),Nw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DMenuSidedContent"},n}(Is),Iw={NONE:0,SINGLE:1,SINGLE_ONCE:2},Cw=function(){return!0},Aw=function(n){function i(t,i){var r,e,u,s=this;(s=n.call(this)||this).Nh=t,s.$c=null,s.En=!0,s.xt=Ai(null!==(e=null!==(r=null==i?void 0:i.mode)&&void 0!==r?r:null==i?void 0:i.type)&&void 0!==e?e:Iw.SINGLE_ONCE,Iw),s.pf=null!==(u=null==i?void 0:i.filter)&&void 0!==u?u:s.getFilterDefault();var h=null==i?void 0:i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return _(i,n),i.prototype.first=function(){return this.$c},i.prototype.toDirty=function(){this.En=!0},i.prototype.update=function(){this.En&&(this.En=!1,this.eh(this.Nh))},i.prototype.hasMenu=function(t){return t&&t.menu instanceof cw},i.prototype.eh=function(n){for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u instanceof Nl&&u.state.isActive&&this.Gv(u,!1),u instanceof t.Container&&this.eh(u),this.hasMenu(u)&&this.eh(u.menu)}},i.prototype.add=function(t){this.update(),this.Gv(t,!0)},i.prototype.set=function(t){this.update(),this.Gv(t,!0)},i.prototype.get=function(t){return this.update(),this.$c},i.prototype.getIndex=function(t){return null},i.prototype.size=function(){return this.$c?1:0},i.prototype.isEmpty=function(){return null==this.$c},i.prototype.remove=function(t){this.update(),this.$c===t&&this.Gv(null,!0)},i.prototype.clear=function(){this.update(),this.Gv(null,!0)},i.prototype.getFilterDefault=function(){return Cw},i.prototype.Gv=function(t,n){var i=this.$c,r=this.xt;r!==Iw.NONE&&this.pf(t)&&i!==t&&(this.setState(i,r,!1),this.$c=t,this.setState(t,r,!0),n&&this.emit("change",this))},i.prototype.setState=function(t,n,i){t&&(n===Iw.SINGLE?t.state.isActive=i:i?t.state.addAll(ct.ACTIVE,ct.READ_ONLY):t.state.removeAll(ct.ACTIVE,ct.READ_ONLY))},i}(t.utils.EventEmitter),Rw=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=new aw(r);r.ea=e,e.add(r);var u=null==n?void 0:n.items;if(null!=u){var s=null!==(i=null==n?void 0:n.sticky)&&void 0!==i&&i;r.newItems(u,s)}var h=null==n?void 0:n.selection;return r.tf=h instanceof Aw?h:r.newSelection(h),r}return _(n,t),n.prototype.newSelection=function(t){return new Aw(this.content,t)},n.prototype.onHierarchyDirty=function(){var n=this.tf;null!=n&&n.toDirty(),t.prototype.onHierarchyDirty.call(this)},n.prototype.newItems=function(t,n){gv.newItems(this.content,t,n)},n.prototype.newContent=function(t){return new Nw(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),n.prototype.getContext=function(){return this.ea},n.prototype.getCloseable=function(){return this},n.prototype.open=function(){},n.prototype.close=function(){},n.prototype.onKeyDown=function(n){return nr.moveFocusVertically(n,this),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DMenuSided"},n}(Hd),kw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteError"},n}(Kd),Lw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteNoItemsFound"},n}(Kd),yw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSearching"},n}(Kd),xw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(hr),Bw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonLast"},n}(As),_w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonNext"},n}(As),Pw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonPage"},n}(As),Fw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonPrevious"},n}(As),Uw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonTop"},n}(As),Gw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationDots"},n}(Ss),Hw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationPage"},n}(Ss),zw=function(t){function n(n){var i,r,e,u,s=this;s=t.call(this,n)||this,null!=n?(s.T=null!==(r=null!==(i=n.size)&&void 0!==i?i:n.total)&&void 0!==r?r:10,s.Ut=null!==(u=null!==(e=n.value)&&void 0!==e?e:n.selected)&&void 0!==u?u:0):(s.T=10,s.Ut=0);var h=s.buttonTop,o=s.buttonPrevious;null!=h&&s.addChild(h),null!=o&&s.addChild(o),null==h&&null==o||s.addChild(s.newSpace());var a=s.buttonPages0,c=a.length;s.addChild(a[c-1]),s.addChild(s.dots0);for(var f=c-2;0<=f;--f)s.addChild(a[f]);s.addChild(s.page);for(var l=s.buttonPages1,v=l.length,b=(f=0,v-1);f<b;++f)s.addChild(l[f]);s.addChild(s.dots1),s.addChild(l[v-1]);var d=s.buttonNext,g=s.buttonLast;return null==d&&null==g||s.addChild(s.newSpace()),null!=d&&s.addChild(d),null!=g&&s.addChild(g),s.update(),s}return _(n,t),n.prototype.newSpace=function(){var t,n,i;return new Xu({width:null!==(i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.space)&&void 0!==i?i:this.theme.getButtonSpace()})},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){0<=t&&t<this.T&&this.Ut!==t&&(this.Ut=t,this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.T},set:function(t){0<=t&&this.T!==t&&(this.T=t,this.Ut=0===t?-1:Math.max(0,Math.min(this.T-1,this.Ut)),this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"total",{get:function(){return this.size},set:function(t){this.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots0",{get:function(){var t=this._dots0;return null==t&&(t=this.newDots(),this._dots0=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots1",{get:function(){var t=this._dots1;return null==t&&(t=this.newDots(),this._dots1=t),t},enumerable:!1,configurable:!0}),n.prototype.newDots=function(){return new Gw},Object.defineProperty(n.prototype,"buttonLast",{get:function(){var t=this.Hv;return void 0===t&&(t=this.newButtonLast(),this.Hv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonLast=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.last;if(null!==r&&!1!==r&&void 0!==r){var e=new Bw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonLastActive()})),e}return null},n.prototype.onButtonLastActive=function(){this.moveTo(this.T-1)},n.prototype.moveTo=function(t){if(0<=t&&t<this.T&&this.Ut!==t){var n=this.Ut;this.Ut=t,this.emit("change",t,n,this),this.update()}},Object.defineProperty(n.prototype,"buttonNext",{get:function(){var t=this.zv;return void 0===t&&(t=this.newButtonNext(),this.zv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonNext=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.next;if(null!==r&&!1!==r){var e=new _w(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonNextActive()})),e}return null},n.prototype.onButtonNextActive=function(){this.moveTo(this.Ut+1)},Object.defineProperty(n.prototype,"buttonPrevious",{get:function(){var t=this.Vv;return void 0===t&&(t=this.newButtonPrevious(),this.Vv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPrevious=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.previous;if(null!==r&&!1!==r){var e=new Fw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonPreviousActive()})),e}return null},n.prototype.onButtonPreviousActive=function(){this.moveTo(this.Ut-1)},Object.defineProperty(n.prototype,"buttonTop",{get:function(){var t=this.Wv;return void 0===t&&(t=this.newButtonTop(),this.Wv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonTop=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.top;if(null!==r&&!1!==r&&void 0!==r){var e=new Uw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonTopActive()})),e}return null},n.prototype.onButtonTopActive=function(){this.moveTo(0)},n.prototype.newButtonPage=function(){var t,n,i=this,r=new Pw(null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.page);return r.on("active",(function(){i.onButtonPageActive(r)})),r},Object.defineProperty(n.prototype,"buttonPages0",{get:function(){var t=this._buttonPages0;return null==t&&(t=this.newButtonPages0(),this._buttonPages0=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages0=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"buttonPages1",{get:function(){var t=this._buttonPages1;return null==t&&(t=this.newButtonPages1(),this._buttonPages1=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages1=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"page",{get:function(){var t=this.Xv;return null==t&&(t=this.newPage(),this.Xv=t),t},enumerable:!1,configurable:!0}),n.prototype.newPage=function(){var t;return new Hw(null===(t=this.zn)||void 0===t?void 0:t.page)},n.prototype.onButtonPageActive=function(t){var n=t.text;pt(n)&&(this.moveTo(n-1),t.state.isFocused&&(t.state.isHovered=!1,this.page.focus()))},n.prototype.update=function(){var t=this.T,n=this.Ut;if(t<=0){null!=(o=this.buttonTop)&&(o.state.isEnabled=!1),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=!1),this.hideDots(this.dots0);for(var i=0,r=(l=this.buttonPages0).length;i<r;++i)this.hidePage(l[i]);for(this.hidePage(this.page),i=0,r=(v=this.buttonPages1).length;i<r;++i)this.hidePage(v[i]);this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=!1),(f=this.buttonLast)&&(f.state.isEnabled=!1)}else{var e=n-2,u=n+2;if(e<0)u-=e,e=0;else if(t<=u){var s=u-t+1;u-=s,e-=s}var h=!1;0<e&&(h=!0,e=Math.min(e+1,n));var o,a,c,f,l,v,b=!1;for(u<t-1&&(b=!0,u=Math.max(u-1,n)),null!=(o=this.buttonTop)&&(o.state.isEnabled=0<n),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=0<n),h?this.showDots(this.dots0,1,e-1):this.hideDots(this.dots0),i=0,r=(l=this.buttonPages0).length;i<r;++i){var d=n-i-1,g=l[i];e<=d&&d<=u&&0<=d?this.showPage(g,d):h&&i===r-1?this.showPage(g,0):this.hidePage(g)}for(this.showPage(this.page,n),i=0,r=(v=this.buttonPages1).length;i<r;++i)d=n+i+1,g=v[i],e<=d&&d<=u&&d<t?this.showPage(g,d):b&&i===r-1?this.showPage(g,t-1):this.hidePage(g);b?this.showDots(this.dots1,u+1,t-2):this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=n<t-1),null!=(f=this.buttonLast)&&(f.state.isEnabled=n<t-1)}},n.prototype.showPage=function(t,n){t.text=n+1,t.show()},n.prototype.hidePage=function(t){t.hide()},n.prototype.showDots=function(t,n,i){t.show()},n.prototype.hideDots=function(t){t.hide()},n.prototype.getType=function(){return"DPagination"},n}(Is),Vw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(hr),Ww=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(hr),Xw=function(t){function n(n){var i=t.call(this,n)||this;i.k=[];var r=null==n?void 0:n.values;return r&&(i.values=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){if(t.prototype.onMenuSelect.call(this,n,i,r),i instanceof Al){var e=this.k,u=[],s=[];i.state.isActive?this.updateMenuItems(r,e,n,void 0,u,s):this.updateMenuItems(r,e,void 0,n,u,s),this.k=u,this.text=s,this.onValueChange(u,e,s)}},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.k,e=[],u=[];this.updateMenuItems(n,r,void 0,void 0,e,u),this.k=e,this.text=u},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.open=function(){this.updateMenuItems(this.menu,this.k),t.prototype.open.call(this)},Object.defineProperty(n.prototype,"values",{get:function(){return this.k},set:function(t){var n=this.k;if(!this.isSameValues(t,n)){var i=[],r=[];this.updateMenuItems(this.menu,t,void 0,void 0,i,r),this.k=i,this.text=r}},enumerable:!1,configurable:!0}),n.prototype.isSameValues=function(t,n){if(t.length===n.length)for(var i=0,r=t.length;i<r;++i)if(n.indexOf(t[i])<0)return!1;return!1},n.prototype.updateMenuItems=function(t,n,i,r,e,u){for(var s=t.children,h=0,o=s.length;h<o;++h){var a=s[h];if(a instanceof Vl)this.updateMenuItems(a.menu,n,i,r,e,u);else if(a instanceof Al){var c=a.value;void 0!==r&&r===c?a.state.isActive=!1:void 0!==i&&a.value===i||0<=n.indexOf(a.value)?(e&&e.push(a.value),u&&u.push(a),a.state.isActive=!0):a.state.isActive=!1}}},n.prototype.getType=function(){return"DSelectMultiple"},n}(fw),Kw=function(t){function n(n){var i=t.call(this,n)||this;i.Ut=null;var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=this.Ut;e!==n&&(this.Ut=n,this.text=i,this.onValueChange(n,e,i))},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.Ut;if(null!=r){var e=this.findMenuItem(n,r);null!=e?(this.Ut=r,this.text=e):(this.Ut=null,this.text=null)}else this.Ut=null,this.text=null},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.findMenuItem=function(t,n){for(var i=t.children,r=0,e=i.length;r<e;++r){var u=i[r];if(u instanceof Vl){var s=this.findMenuItem(u.menu,n);if(null!=s)return s}else if(u instanceof Il&&u.value===n)return u}return null},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){if(this.Ut!==t){var n=this.findMenuItem(this.menu,t);null!=n?(this.Ut=t,this.text=n):(this.Ut=null,this.text=null)}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSelect"},n}(fw),Yw=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,i,r)||this;return s.Kv=e,s.Yv=u,s.La=.5*i,s.ya=.5*r,s.interactive=!1,s.interactiveChildren=!1,n.on("update",(function(){s.onTextureUpdate()})),s}return _(n,t),n.prototype.onTextureUpdate=function(){this.emit("update",this)},n.prototype.onReflow=function(t,n,i){var r=this.La,e=this.ya;this.x=-r+this.Kv,this.y=-e+this.Yv,this.width=r+n+r,this.height=e+i+e},n.prototype.render=function(n){var i=this.parent;if(i){var r=i.alpha;this.alpha=r*r*r}t.prototype.render.call(this,n)},n}(t.NineSlicePlane),Jw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n),this.Ut=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderLabel"},n}(Ms),Zw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderThumb"},n}(Ts),qw=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).Ut=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0,e.Jv=e.toRounder(n),e.Zv=null!==(r=null==n?void 0:n.delta)&&void 0!==r?r:1,e}return _(n,t),n.prototype.toRounder=function(t){var n,i=null==t?void 0:t.rounder;if(i)return i;var r=null!==(n=null==t?void 0:t.precision)&&void 0!==n?n:this.theme.getPrecision(),e=Math.pow(10,r);return function(t){return Math.round(t*e)/e}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rounder",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"delta",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderValue"},n}(Ms),Qw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.qv=0,this.Qv=this.newTrack(n),this.addChild(this.Qv),this.$v=this.newTrackSelected(n),this.$v.state.isActive=!0,this.addChild(this.$v),this.ff=this.newThumb(n),this.addChild(this.ff),this.cs=this.newLabelMin(n),this.addChild(this.cs),this.fs=this.newLabelMax(n),this.addChild(this.fs),this.Ut=this.newValue(n),this.addChild(this.Ut),this.Qv.on(ir.down,(function(t){i.Ut.visible=i.state.inEnabled,i.onTrackDown(t.data.global)})),this.$v.on(ir.down,(function(t){i.Ut.visible=i.state.inEnabled,i.onTrackSelectedDown(t.data.global)})),this.tb=function(t){i.onTrackUpBound(t),i.Ut.visible=!1},this.nb=function(t){i.onTrackSelectedUpBound(t),i.Ut.visible=!1},this.ff.on(ir.down,(function(t){i.Ut.visible=!0,i.onThumbDown(t)})),this.ib=function(t){i.onThumbMove(t)},this.rb=function(t){i.onThumbUp(t),i.Ut.visible=!1},this.onValuesChange()},n.prototype.newThumb=function(t){return new Zw(null==t?void 0:t.thumb)},n.prototype.newValue=function(t){return new qw(this.toValueOptions(null==t?void 0:t.value))},n.prototype.toValueOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value=t.value),null==t.visible&&(t.visible=!1),t},n.prototype.newLabelMin=function(t){return new Jw(this.toLabelMinOptions(null==t?void 0:t.min))},n.prototype.toLabelMinOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.newLabelMax=function(t){return new Jw(this.toLabelMaxOptions(null==t?void 0:t.max))},n.prototype.toLabelMaxOptions=function(t){null==(t=t||{}).value&&(t.value=1);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.getValueMargin=function(){return 14},n.prototype.onTrackDown=function(t){if(!this.state.inDisabled){var n=st.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.eb=i;var r=this.tb;i.on(ir.up,r),i.on(ir.upoutside,r),i.on(ir.cancel,r)}this.onPick(t)}},n.prototype.onTrackSelectedDown=function(t){if(!this.state.inDisabled){var n=st.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.eb=i;var r=this.nb;i.on(ir.up,r),i.on(ir.upoutside,r),i.on(ir.cancel,r)}this.onPick(t)}},n.prototype.onTrackUpBound=function(t){var n=this.eb;if(n){this.eb=void 0;var i=this.tb;n.off(ir.up,i),n.off(ir.upoutside,i),n.off(ir.cancel,i)}},n.prototype.onTrackSelectedUpBound=function(t){var n=this.eb;if(n){this.eb=void 0;var i=this.nb;n.off(ir.up,i),n.off(ir.upoutside,i),n.off(ir.cancel,i)}},n.prototype.onThumbMove=function(t){this.state.inDisabled||this.onPick(t.data.global)},n.prototype.onThumbDown=function(t){var n=st.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.eb=i;var r=this.ib;i.on(ir.move,r);var e=this.rb;i.on(ir.up,e),i.on(ir.upoutside,e),i.on(ir.cancel,e)}},n.prototype.onThumbUp=function(t){var n=this.eb;if(n){this.eb=void 0;var i=this.ib;n.off(ir.move,i);var r=this.rb;n.off(ir.up,r),n.off(ir.upoutside,r),n.off(ir.cancel,r)}},n.prototype.updateValue=function(){var t=this.cs.value,n=this.fs.value,i=this.Ut,r=i.rounder(t+this.qv*(n-t)),e=i.value;r!==e&&(i.value=r,i.text=i.value,this.emit("change",r,e,this))},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.onValuesChange()},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut.value},set:function(t){t=Math.max(this.cs.value,Math.min(this.fs.value,t)),this.Ut.value!==t&&(this.Ut.value=t,this.onValuesChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.cs.value},set:function(t){var n=this.cs;if(t=Math.min(this.fs.value,t),n.value!==t){var i=this.Ut;n.text=n.value=t,i.value=Math.max(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.fs.value},set:function(t){var n=this.fs;if(t=Math.max(this.cs.value,t),n.value!==t){var i=this.Ut;n.text=n.value=t,i.value=Math.min(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSlider"},n}(hr),$w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrack"},n}(Ts),tp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackHorizontal"},n}($w),np=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new tp(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new tp(null==t?void 0:t.track)},i.prototype.toValueOptions=function(t){var i=this;return null==(t=n.prototype.toValueOptions.call(this,t)).y&&(t.y=function(t,n){return.5*t-n-i.getValueMargin()}),t},i.prototype.toLabelMinOptions=function(t){return null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return.5*-n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.toLabelMaxOptions=function(t){return null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return t-.5*n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=Math.max(0,Math.min(this.Qv.width,i.x));this.qv=r/this.Qv.width,this.moveThumbPosition(r)},i.prototype.onValuesChange=function(){var t=this.cs.value,n=this.fs.value,i=this.Ut.value;this.qv=(i-t)/(n-t);var r=this.qv*this.Qv.width;this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.ff;n.x=t-.5*n.width,this.$v.width=t;var i=this.Ut;i.x=t-.5*i.width,this.updateValue()},i.prototype.onKeyDown=function(t){return nr.isArrowRightKey(t)?this.value+=this.Ut.delta:nr.isArrowLeftKey(t)&&(this.value-=this.Ut.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderHorizontal"},i}(Qw),ip=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackVertical"},n}($w),rp=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new ip(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new ip(null==t?void 0:t.track)},i.prototype.toLabelMinOptions=function(t){null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return t-.5*n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=ts.RIGHT),t},i.prototype.toLabelMaxOptions=function(t){null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return.5*-n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=ts.RIGHT),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=this.height,e=Math.max(0,Math.min(r,i.y));this.qv=(r-e)/r,this.moveThumbPosition(e)},i.prototype.onValuesChange=function(){var t=this.cs.value,n=this.fs.value,i=this.Ut.value;this.qv=(i-t)/(n-t);var r=this.height*(1-this.qv);this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.ff;n.y=t-.5*n.height;var i=this.$v;i.y=t,i.height=this.height-t;var r=this.Ut;r.y=t-r.height-this.getValueMargin(),this.updateValue()},i.prototype.onKeyDown=function(t){return nr.isArrowUpKey(t)?this.value+=this.Ut.delta:nr.isArrowDownKey(t)&&(this.value-=this.Ut.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderVertical"},i}(Qw),ep=function(){function t(){}return t.set=function(t,n,i,r,e){var u,s=this.toRenderable(n,i,r);t.renderable=s;var h=t.state;h.lock(),h.isDisabled=!s,!1!==e&&(h.isReadOnly=this.toReadOnly(n,i,r));var o=null===(u=r.state)||void 0===u?void 0:u.modifier;o&&o(n,i,t.state),h.unlock()},t.toReadOnly=function(t,n,i){var r=i.editing.enable;return!0!==r&&(!1===r||!r(t,n))},t.toRenderable=function(t,n,i){var r=i.renderable;return!0===r||!1!==r&&r(t,n)},t}(),up=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).ub=-1,s.sb=n,s.hb=i,s.ut=r,s.ob=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.hb.selecting,u=e.dialog;if(u){var s=null!==(i=this.oh)&&void 0!==i?i:null;e.setter(u,s),u.open(this).then((function(){var t=e.getter(u);r.ob?t!==s&&(r.text=t,r.onValueChange(t,s)):r.onValueChange(t,null)}))}},n.prototype.onValueChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb;this.hb.setter(i,e,t),this.emit("change",t,n,this),this.ut(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.oh;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectDialog"},n}(Ts),sp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionDialog"},n}(up),hp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){var e=this.ab;if(void 0!==e){var u=this.ub,s=this.sb;this.hb.setter(e,s,n),t.prototype.onMenuSelect.call(this,n,i,r),this.ut(n,null,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=t,ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellActionMenu"},n}(lw),op=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).ub=-1,s.sb=n,s.hb=i,s.ut=r,s.ob=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.hb.selecting.promise;r&&r().then((function(t){var n;if(i.ob){var r=null!==(n=i.oh)&&void 0!==n?n:null;t!==r&&(i.text=t,i.onValueChange(t,r))}else i.onValueChange(t,null)}))},n.prototype.onValueChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb;this.hb.setter(i,e,t),this.emit("change",t,n,this),this.ut(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.oh;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectPromise"},n}(Ts),ap=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionPromise"},n}(op),cp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=t,ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellText"},n}(Ss),fp=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,e)||this).ph=Ai(null!==(u=null==e?void 0:e.when)&&void 0!==u?u:qu.CLICKED,qu),s.on(ir.tap,(function(t){s.onClick(t)})),s}return _(n,t),n.prototype.onClick=function(t){this.ph===qu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.ph===qu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this);var n=this.ab;if(void 0!==n){var i=this.ub,r=this.sb;this.emit("change",null,null,this),this.ut(null,null,n,i,r,this)}},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTableBodyCellButton"},n}(cp),lp={INDEX:0,TEXT:1,INTEGER:2,REAL:3,CHECK:4,CHECK_SINGLE:5,COLOR:6,BUTTON:7,SELECT:8,DATE:9,DATETIME:10,TIME:11,ACTION:12,LINK:13,TREE:14},vp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.onValueChange(!0,!1)},n.prototype.onInactivate=function(n){t.prototype.onInactivate.call(this,n),this.onValueChange(!1,!0)},n.prototype.onValueChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb,u=this.hb;u.setter(i,e,t),this.emit("change",t,n,this);var s=this.ut;s(t,n,i,r,e,this),t&&u.type===lp.CHECK_SINGLE&&this.onChangeSingle(r,e,u,s)}},n.prototype.onChangeSingle=function(t,n,i,r){var e=this,u=this.parent;if(u){var s=u.parent;if(s){var h=!1,o=i.getter,a=i.setter;s.data.each((function(i,u){return t===u||!o(i,n)||(a(i,n,!1),h=!0,r(!1,!0,i,u,n,e),!1)})),h&&s.update(!0)}}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.state.isActive=!!t,ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellCheck"},n}(Fb),bp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r;var s=this.value;if(pt(t))s.color=t,s.alpha=1;else if(Ot(t)){var h=Number(t);s.color=h==h?h:16777215,s.alpha=1}else if(null!=t){var o=t.color,a=t.alpha;s.color=pt(o)?o:16777215,s.alpha=pt(a)?a:1}else s.color=16777215,s.alpha=1;ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellColor"},n}(ed),dp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.ab=n,this.ub=r,t instanceof Date)u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(pt(t)){var s=this.oh;void 0===s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellDate"},n}(sd),gp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.ab=n,this.ub=r,t instanceof Date)u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(pt(t)){var s=this.oh;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellDatetime"},n}(cd),mp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=r,ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellIndex"},n}(Ss),wp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=Number(t),ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellInputInteger"},n}(Ks),pp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=Number(t),ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellInputReal"},n}(Zs),Op=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=String(t),ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellInputText"},n}($s),Dp=function(t){function n(n){var i=t.call(this,n)||this;return i.Qn=new _b(i.Qn),i}return _(n,t),Object.defineProperty(n.prototype,"padding",{get:function(){return this.Qn},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellInputTreeInput"},n}($s),Ep=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellInputTreeMarker"},n}(js),Mp={START:"START",END:"END",FROZEN:"FROZEN",FROZEN_END:"FROZEN_END",SORTABLE:"SORTABLE",SORTED_ASCENDING:"SORTED_ASCENDING",SORTED_DESCENDING:"SORTED_DESCENDING",HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED",CHECKABLE:"CHECKABLE",SELECTABLE:"SELECTABLE"},Sp=function(t){function n(n,i,r,e){var u=t.call(this,function(t){if(null!=t)return{weight:t.weight,width:t.width}}(e))||this;u.ub=-1,u.sb=n,u.hb=i,u.ut=r;var s=u.newInput(e);u.Ah=s,u.addChild(s);var h=u.newMarker(e);return u.A=h,u.addChild(h),u}return _(n,t),n.prototype.newInput=function(t){return new Dp(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){var n=this;return{weight:1,text:null==t?void 0:t.text,editing:null==t?void 0:t.editing,when:null==t?void 0:t.when,cursor:null==t?void 0:t.cursor,on:{change:function(t,i){n.onInputChange(t,i)}}}},n.prototype.onInputChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb;this.hb.setter(i,e,t),this.emit("change",t,n,this),this.ut(t,n,i,r,e,this)}},n.prototype.newMarker=function(t){var n=this;return new Ep({visible:!1,on:{active:function(){n.onMarkerActive()}}})},n.prototype.onMarkerActive=function(){this.A.state.is(Mp.HAS_CHILDREN)&&this.toggle()},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.ab;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.Ah.padding.getLeft()},n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r;var s=this.Ah;s.visible=!0,s.text=String(t);var h=this.A;if(pt(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=h.state;f.lock(),f.set(Mp.HAS_CHILDREN,a),f.set(ct.DISABLED,!a),f.set(Mp.OPENED,o),f.unlock();var l=this.theme.getLevelPadding(c);h.width=l,a?h.show():h.hide(),s.padding.adjLeft(l)}else h.state.removeAll(Mp.OPENED,Mp.HAS_CHILDREN),h.hide(),s.padding.adjLeft(0);ep.set(this.Ah,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1,this.Ah.visible=!1,this.A.hide()},n.prototype.getType=function(){return"DTableBodyCellInputTree"},n}(hr),jp=function(t,n){if(n)return{url:Tp(t,n.url),target:n.target,checker:Np(t,n.checker),menu:n.menu}},Tp=function(t,n){return Ot(n)||null==n?n:function(){var i=t.row;return void 0!==i?n(i,t.rowIndex,t.columnIndex,t):null}},Np=function(t,n){if(null!=n)return function(){var i=t.row;return void 0!==i&&n(i,t.rowIndex,t.columnIndex,t)}},Ip=function(t){function n(n,i,r,e){var u;return t.call(this,n,i,r,Gl.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this}return _(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t,n=this.Go;return null==n&&(n=new Ul(jp(this,null===(t=this.zn)||void 0===t?void 0:t.link)),this.Go=n),n},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellLink"},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n}(fp),Cp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.ab;if(void 0!==e){var u=this.ub,s=this.sb;this.hb.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.ut(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.value=t,ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMenu"},n}(Kw),Ap=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.ab;if(void 0!==e){var u=this.ub,s=this.sb;this.hb.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.ut(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.values=t,ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMultiple"},n}(Xw),Rp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.ab=n,this.ub=r,t instanceof Date)u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(pt(t)){var s=this.oh;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}ep.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellTime"},n}(rg),kp=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,Gl.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this).Qn=new _b(s.Qn),s}return _(n,t),n.prototype.onClick=function(n){var i;!0!==(null===(i=this.link)||void 0===i?void 0:i.onClick(this,n))&&t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return void 0===t&&(t=this.newLink(),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t,n=null===(t=this.zn)||void 0===t?void 0:t.link;return n?new Ul(jp(this,n)):null},n.prototype.onActivate=function(n){var i;t.prototype.onActivate.call(this,n),this.state.is(Mp.HAS_CHILDREN)?this.toggle():null===(i=this.link)||void 0===i||i.open(n)},n.prototype.toggle=function(){var t=this.ab;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.padding.getLeft()&&(this.toggle(),!0)},n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=t,ep.set(this,n,e,this.hb,!1);var s=this.link,h=this.Qn;if(pt(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=this.state;f.lock(),f.set(Mp.HAS_CHILDREN,a),f.set(Mp.OPENED,o),f.unlock(),h.adjLeft(this.theme.getLevelPadding(c)),s&&(s.menu.enable=!a)}else this.state.removeAll(Mp.OPENED,Mp.HAS_CHILDREN),h.adjLeft(0),s&&(s.menu.enable=!1)},n.prototype.getType=function(){return"DTableBodyCellTree"},n}(fp),Lp={NONE:0,SINGLE:1,MULTIPLE:2},yp=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).ai=!0,e.cb=null!==(i=n.frozen)&&void 0!==i?i:0,e.fb=null!==(r=n.columns)&&void 0!==r?r:[],e}return _(n,t),n.prototype.initCells=function(t,n,i){for(var r=this.toIndexEnd(n),e=n.length-1;0<=e;--e){var u=this.newCell(e,n[e],n,t),s=u.state;s.lock(!1),0===e&&s.add(Mp.START),e===r&&s.add(Mp.END),e<i&&s.add(Mp.FROZEN),e===i-1&&s.add(Mp.FROZEN_END),s.unlock(),this.addChild(u)}},n.prototype.toIndexEnd=function(t){for(var n=t.length,i=0;i<n;++i)if(void 0!==t[i].weight)return n-1;return n},n.prototype.onRefit=function(){t.prototype.onRefit.call(this),this.resetFrozenCellPosition()},n.prototype.updateFrozenCellPosition=function(t){for(var n=this.fb,i=this.children,r=i.length,e=this.cb,u=0;u<e;++u){var s=n[u];i[r-1-u].position.x=-t+s.offset}},n.prototype.resetFrozenCellPosition=function(){for(var t=this.fb,n=this.children,i=n.length,r=this.cb,e=this.getContentPositionX(),u=0;u<r;++u){var s=t[u],h=n[i-1-u];s.offset=h.position.x,h.position.x=-e+s.offset}},n.prototype.getClippingRect=function(n,i){t.prototype.getClippingRect.call(this,n,i);var r=this.cb;if(0<r){var e=n;if(e&&e.parent===this){var u=this.children,s=u.indexOf(e);if(0<=s&&r<=u.length-1-s){var h=u[s+1],o=h.position.x+h.width;i.x+=o,i.width-=o}}}},n.prototype.getType=function(){return"DTableRow"},n}(Is),xp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.hu=-1,u.lb=function(t,i,r,e,s){u.emit("change",t,i,r,e,s,u),n(t,i,r,e,s,u)},u.vb=r,u.state.isAlternated=!i,u.initCells(e,u.fb,u.cb),u}return _(n,t),n.prototype.newCell=function(t,n,i,r){var e=this.lb,u=this.vb,s=u.get(t);if(null==s&&(s=this.toCellOptions(t,n,r),u.set(t,s)),!1!==n.editing.enable)return this.newCellEditable(t,n,e,s);var h=this.newCellUnediable(t,n,e,s);return n.type!==lp.TREE&&(h.state.isReadOnly=!0),h},n.prototype.newCellEditable=function(t,n,i,r){switch(n.type){case lp.INDEX:return new mp(t,n,i,r);case lp.TEXT:return new Op(t,n,i,r);case lp.TREE:return new Sp(t,n,i,r);case lp.INTEGER:return new wp(t,n,i,r);case lp.REAL:return new pp(t,n,i,r);case lp.CHECK:case lp.CHECK_SINGLE:return new vp(t,n,i,r);case lp.COLOR:return new bp(t,n,i,r);case lp.BUTTON:return new fp(t,n,i,r);case lp.LINK:return new Ip(t,n,i,r);case lp.SELECT:return this.newCellSelect(t,n,i,r);case lp.ACTION:return this.newCellAction(t,n,i,r);case lp.DATE:return new dp(t,n,i,r);case lp.DATETIME:return new gp(t,n,i,r);case lp.TIME:return new Rp(t,n,i,r);default:return new cp(t,n,i,r)}},n.prototype.newCellUnediable=function(t,n,i,r){switch(n.type){case lp.INDEX:return new mp(t,n,i,r);case lp.TEXT:return new cp(t,n,i,r);case lp.TREE:return new kp(t,n,i,r);case lp.INTEGER:case lp.REAL:return new cp(t,n,i,r);case lp.CHECK:case lp.CHECK_SINGLE:return new vp(t,n,i,r);case lp.COLOR:return new bp(t,n,i,r);case lp.BUTTON:return new fp(t,n,i,r);case lp.LINK:return new Ip(t,n,i,r);case lp.SELECT:return this.newCellSelect(t,n,i,r);case lp.ACTION:return this.newCellAction(t,n,i,r);case lp.DATE:return new dp(t,n,i,r);case lp.DATETIME:return new gp(t,n,i,r);case lp.TIME:return new Rp(t,n,i,r);default:return new cp(t,n,i,r)}},n.prototype.newCellSelect=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new Cp(t,n,i,r):null!=e.multiple?new Ap(t,n,i,r):null!=e.dialog?new up(t,n,i,r):null!=e.promise?new op(t,n,i,r):new cp(t,n,i,r)},n.prototype.newCellAction=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new hp(t,n,i,r):null!=e.dialog?new sp(t,n,i,r):null!=e.promise?new ap(t,n,i,r):new cp(t,n,i,r)},n.prototype.toCellOptions=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v,b,d,g,m=fb(n.body,i.cell);m.weight=n.weight,m.width=n.width,null!==(r=m.state)&&void 0!==r||(m.state=n.state.initial);var w=n.formatter;null!=w&&(null!==(u=(O=null!==(e=m.text)&&void 0!==e?e:m.text={}).formatter)&&void 0!==u||(O.formatter=w));var p=n.align;if(null!=p){var O,D=null!==(h=(O=null!==(s=m.text)&&void 0!==s?s:m.text={}).align)&&void 0!==h?h:O.align={};null!==(o=D.horizontal)&&void 0!==o||(D.horizontal=p)}var E=n.editing;if(!1!==E.enable){var M=null!==(a=(g=m).editing)&&void 0!==a?a:g.editing={};null!==(c=M.formatter)&&void 0!==c||(M.formatter=E.formatter),null!==(f=M.unformatter)&&void 0!==f||(M.unformatter=E.unformatter),null!==(l=M.validator)&&void 0!==l||(M.validator=E.validator)}var S=n.link;void 0!==S&&(m.link=S);var j=n.selecting,T=null!==(v=j.menu)&&void 0!==v?v:j.multiple;return void 0!==T&&(m.menu=T),(null!==(d=null===(b=null==i?void 0:i.selection)||void 0===b?void 0:b.type)&&void 0!==d?d:Lp.NONE)!==Lp.NONE&&(m.when="DOUBLE_CLICKED",m.cursor=function(t){if(t.in(Mp.SELECTABLE))return"pointer"}),m},n.prototype.getType=function(){return"DTableBodyRow"},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),n.prototype.isCell=function(t){return null!=t&&"set"in t},n.prototype.set=function(t,n,i,r){if(r||this.Ut!==t||this.hu!==i){this.Ut=t,this.hu=i;for(var e=this.children,u=e.length,s=this.fb,h=s.length,o=0;o<u;++o){var a=e[o],c=h-1-o,f=s[c];this.isCell(a)&&a.set(f.getter(t,c),t,n,i,c,r)}this.onSet(t,i)}},n.prototype.onSet=function(t,n){this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Ut){this.Ut=void 0,this.hu=-1;for(var t=this.children,n=t.length,i=0;i<n;++i){var r=t[i];this.isCell(r)&&r.unset()}this.onUnset()}},n.prototype.onUnset=function(){this.emit("unset",this)},n.prototype.getContentPositionX=function(){var t=this.parent;if(t){var n=t.parent;if(n)return n.position.x}return 0},n}(yp),Bp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.Al=-1,i.bb=!1,i.gb=-1,i.p=n,i.pf=null,i.mb=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.bb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.bb&&(this.bb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.bb},n.prototype.newFiltered=function(){var t=this.pf;if(null!=t){var n,i=[],r=this.p,e=r.sorter,u=r.rows;if(wt(t))if(n=e.indices)for(var s=0,h=n.length;s<h;++s)t(u[o=n[s]],o)&&i.push(s);else for(s=0,h=u.length;s<h;++s)t(u[s],s)&&i.push(s);else if(n=e.indices)for(s=0,h=n.length;s<h;++s){var o=n[s];t.test(u[o],o)&&i.push(s)}else for(s=0,h=u.length;s<h;++s)t.test(u[s],s)&&i.push(s);return i}return null},n.prototype.get=function(){return this.pf},n.prototype.set=function(t){this.pf!==t&&(this.pf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R===this.Al&&this.p.sorter.id===this.gb||(this.Al=this.R,this.gb=this.p.sorter.id,this.bb?(this.mb=this.newFiltered(),this.emit("change",this)):null!=this.mb&&(this.mb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.mb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),_p=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"rows",{get:function(){var t=[];return this.each((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),t.prototype.map=function(t){var n=this.p,i=n.sorter.map(t);return null!=i?n.filter.map(i):null},t.prototype.unmap=function(t){var n=this.p;return n.sorter.unmap(n.filter.unmap(t))},t.prototype.size=function(){var t=this.p,n=t.filter.indices;return null!=n?n.length:t.size()},t.prototype.get=function(t){return this.p.get(this.unmap(t))},t.prototype.each=function(t,n,i){var r=this.p,e=r.rows,u=r.supplimentals,s=r.filter.indices,h=r.sorter.indices;if(n=null!=n?Math.max(0,n):0,s){var o=s.length;if(i=null!=i?Math.min(o,i):o,h)for(var a=n;a<i&&!1!==t(e[c=h[s[a]]],u?u[c]:null,a,c);++a);else for(a=n;a<i&&!1!==t(e[c=s[a]],u?u[c]:null,a,c);++a);}else if(o=e.length,i=null!=i?Math.min(o,i):o,h)for(a=n;a<i;++a){var c;if(!1===t(e[c=h[a]],u?u[c]:null,a,c))break}else for(a=n;a<i&&!1!==t(e[a],u?u[a]:null,a,a);++a);},t}(),Pp=function(t,n){return t[0]-n[0]},Fp=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).p=n,e.xt=Ai(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:Lp.NONE,Lp),e.In=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.xt},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.In;n.has(t)?n.delete(t):n.add(t),this.onChange()},n.prototype.add=function(t){var n=this.In,i=n.size;n.add(t),i!==n.size&&this.onChange()},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.In;if(0<t.size){var n=NaN;return t.forEach((function(t){n!=n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.In;if(0<t.size){var n=0;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.In,u=e.size;if(t<i)for(var s=i+(r?1:0),h=t+(n?0:1);h<s;++h)e.add(h);else for(s=t+(n?1:0),h=i+(r?0:1);h<s;++h)e.add(h);u!==e.size&&this.onChange()},n.prototype.addAll=function(t){for(var n=this.In,i=n.size,r=0,e=t.length;r<e;++r)n.add(t[r]);i!==n.size&&this.onChange()},n.prototype.contains=function(t){return this.In.has(t)},n.prototype.remove=function(t){this.In.delete(t)&&this.onChange()},n.prototype.clear=function(){var t=this.In;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.In;n.has(t)&&1===n.size||(n.clear(),n.add(t),this.onChange())},n.prototype.clearAndAddAll=function(t){var n=this.In;if(0<n.size||0<t.length){n.clear();for(var i=0,r=t.length;i<r;++i)n.add(t[i]);this.onChange()}},n.prototype.shift=function(t,n){var i=[],r=this.In;if(r.forEach((function(n){t<=n&&i.push(n)})),0<i.length){for(var e=0,u=i.length;e<u;++e)r.delete(i[e]);for(e=0,u=i.length;e<u;++e)r.add(i[e]+n);this.onChange()}},n.prototype.size=function(){return this.In.size},n.prototype.isEmpty=function(){return 0===this.In.size},n.prototype.each=function(t){var n=!1;this.In.forEach((function(i){n||!1===t(i)&&(n=!0)}))},Object.defineProperty(n.prototype,"indices",{get:function(){var t=[];return this.In.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[],n=this.p;return this.In.forEach((function(i){t.push(n.get(i))})),t},enumerable:!1,configurable:!0}),n.prototype.toArray=function(){var t=[],n=this.p;return this.In.forEach((function(i){t.push([i,n.get(i)])})),t},n.prototype.toSortedArray=function(){return this.toArray().sort(Pp)},n.prototype.toObject=function(){var t={},n=this.p;return this.In.forEach((function(i){t[i]=n.get(i)})),t},n.prototype.toMap=function(){var t=new Map,n=this.p;return this.In.forEach((function(i){t.set(i,n.get(i))})),t},n}(t.utils.EventEmitter),Up={ASCENDING:0,DESCENDING:1},Gp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.Al=-1,i.bb=!1,i.p=n,i.wb=null,i.pb=null,i.zt=Up.ASCENDING,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return this.zt},set:function(t){this.zt=t},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.bb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.bb&&(this.bb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.bb},n.prototype.newSorted=function(){var t=this.wb;if(null!=t){for(var n=[],i=this.p.rows,r=0,e=i.length;r<e;++r)n.push(r);return n.sort(this.toComparator(i,t)),n}return null},n.prototype.toComparator=function(t,n){var i=this.zt;return wt(n)?i===Up.ASCENDING?function(i,r){return n(t[i],t[r],i,r)}:function(i,r){return n(t[r],t[i],r,i)}:i===Up.ASCENDING?function(i,r){return n.compare(t[i],t[r],i,r)}:function(i,r){return n.compare(t[r],t[i],r,i)}},n.prototype.get=function(){return this.wb},n.prototype.set=function(t){this.wb!==t&&(this.wb=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.Al&&(this.Al=this.R,this.bb?(this.pb=this.newSorted(),this.emit("change",this)):null!=this.pb&&(this.pb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.pb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Hp=function(n){function i(t){var i=n.call(this)||this;if(i.p=null,i.Ob=i.toRows(null==t?void 0:t.rows),i.nf=new _p(i),i.tf=i.toSelection(null==t?void 0:t.selection),i.pf=new Bp(i),i.Db=new Gp(i),t){var r=t.filter;r&&i.pf.set(r);var e=t.comparator;e&&i.Db.set(e);var u=t.on;if(u)for(var s in u){var h=u[s];h&&i.on(s,h)}}return i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:wt(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new Fp(this,t)},i.prototype.bind=function(t){this.p=t},i.prototype.toRows=function(t){var n=[];if(null!=t)for(var i=0,r=t.length;i<r;++i)n.push(t[i]);return n},Object.defineProperty(i.prototype,"rows",{get:function(){return this.Ob},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this.p;t&&t.update()},i.prototype.lock=function(){var t=this.p;t&&t.lock()},i.prototype.unlock=function(){var t=this.p;t&&(t.unlock(!1),t.update())},i.prototype.size=function(){return this.Ob.length},i.prototype.clear=function(){var t=this.Ob;0<t.length&&(t.length=0,this.lock(),this.tf.clear(),this.Db.toDirty(),this.pf.toDirty(),this.unlock())},i.prototype.clearAndAdd=function(t){var n=this.Ob;n.length=0,n.push(t),this.lock(),this.tf.clear(),this.Db.toDirty(),this.pf.toDirty(),this.unlock()},i.prototype.clearAndAddAll=function(t){var n=this.Ob;n.length=0;for(var i=0,r=t.length;i<r;++i)n.push(t[i]);this.lock(),this.tf.clear(),this.Db.toDirty(),this.pf.toDirty(),this.unlock()},i.prototype.add=function(t,n){var i=this.Ob,r=this.tf,e=this.Db,u=this.pf;null==n?(i.push(t),this.lock(),e.toDirty(),u.toDirty(),this.unlock()):0<=n&&n<i.length&&(i.splice(n,0,t),this.lock(),r.shift(n,1),e.toDirty(),u.toDirty(),this.unlock())},i.prototype.addAll=function(t,n){var i=this.Ob,r=i.length,e=this.tf,u=this.Db,s=this.pf;if(null==n){for(var h=0,o=a=t.length;h<o;++h)i.push(t[h]);this.lock(),u.toDirty(),s.toDirty(),this.unlock()}else if(0<=n&&n<r){var a=t.length;for(h=0;h<a;++h)i.splice(n+h,0,t[h]);this.lock(),e.shift(n,a),u.toDirty(),s.toDirty(),this.unlock()}},i.prototype.get=function(t){var n=this.Ob;return 0<=t&&t<n.length?n[t]:null},i.prototype.set=function(t,n){var i=this.Ob;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.lock(),this.Db.toDirty(),this.pf.toDirty(),this.unlock(),r}return null},i.prototype.remove=function(t){var n=this.Ob;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.lock(),this.tf.remove(t),this.Db.toDirty(),this.pf.toDirty(),this.unlock(),i}return null},i.prototype.each=function(t,n,i){var r=this.Ob;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.pf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.Db},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),zp=function(n){function i(t){var i,r=this;(r=n.call(this,t)||this).transform.position.y=null!==(i=t.offset)&&void 0!==i?i:0;var e=r.toData(t.data);r.Xt=e,e.bind(r);var u=r.theme,s=function(t,n,i){var r=n.columns||[],e=n.row;return null!=e?(null==e.height&&(e.height=t.getRowHeight()),void 0===e.columns&&(e.columns=r),null==e.frozen&&(e.frozen=n.frozen),void 0===e.selection?e.selection={type:i}:void 0===e.selection.type&&(e.selection.type=i)):e={columns:r,height:t.getRowHeight(),frozen:n.frozen,selection:{type:i}},e}(u,t,e.selection.type);return r.Eb=s,r.Mb=null!=s.height?s.height:u.getRowHeight(),r.fb=s.columns||[],r.Sb=0,r.jb=0,r.Tb=0,r.Nb=!1,r.Ib=!1,r.Cb=[],r.Ab=function(t,n,i,r,u){e.emit("change",t,n,i,r,u,e)},r.vb=new Map,r.Xt.emit("init",r.Xt),r}return _(i,n),i.prototype.toData=function(t){return this.isData(t)?t:new Hp(t)},i.prototype.isData=function(t){return null!=t&&"mapped"in t},i.prototype.onResize=function(t,i,r,e){n.prototype.onResize.call(this,t,i,r,e),this.update()},Object.defineProperty(i.prototype,"selection",{get:function(){return this.Xt.selection},enumerable:!1,configurable:!0}),i.prototype.lock=function(){this.Tb+=1,1===this.Tb&&(this.Nb=!1,this.Ib=!1)},i.prototype.unlock=function(t){this.Tb-=1,0===this.Tb&&(t&&this.Nb&&this.update(this.Ib),this.Nb=!1,this.Ib=!1)},i.prototype.update=function(t){if(0<this.Tb)return this.Nb=!0,void(t&&(this.Ib=!0));var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=this.children,e=i.height,u=this.Mb,s=this.Xt,h=s.mapped.size(),o=this.Sb,a=this.jb,c=a-o,f=this.transform.position.y,l=f+h*u,v=Math.max(e,l),b=Math.max(e-v,n.position.y),d=-b/u,g=(e-(b+f))/u,m=Math.floor(d);m-=m%2==0?2:1;var w=Math.floor(g),p=(w+=(w-m)%2==1?3:2)-m;if(p<c&&c-2<=p&&(w=m+(p=c)),c<p){for(var O=c;O<p;++O){var D=o+O,E=this.newRow(D%2==0);this.addChild(E)}a=o+(c=p)}else if(p<c){for(O=c-1;p<=O;--O)this.removeChild(r[O]);a=o+(c=p)}this.Sb=m,this.jb=w;var M=m-o,S=Math.abs(M),j=r.length;if(0<S&&S<j){var T=this.Cb;if(0<M){for(O=0;O<S;++O)T.push(this.resetRow(r[O]));for(O=S;O<j;++O)r[O-S]=r[O];for(O=0;O<S;++O)r[j-S+O]=T[O]}else{for(O=0;O<S;++O)T.push(this.resetRow(r[j-S+O]));for(O=j-S-1;0<=O;--O)r[O+S]=r[O];for(O=0;O<S;++O)r[O]=T[O]}T.length=0}var N=s.selection,I=N.type!==Lp.NONE;for(s.mapped.each((function(n,i,e,s){var h=r[e-m];h.position.y=e*u;var o=h.state;o.lock(),o.set(Mp.SELECTABLE,I),o.set(ct.ACTIVE,N.contains(s)),o.remove(ct.DISABLED),o.unlock(),h.set(n,i,s,t)}),m,m+j),O=0;m+O<0&&O<j;++O)(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ct.DISABLED),A.removeAll(Mp.SELECTABLE,ct.ACTIVE),A.unlock(),C.unset();for(O=j-1;h<=m+O&&0<=O;--O){var C,A;(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ct.DISABLED),A.removeAll(Mp.SELECTABLE,ct.ACTIVE),A.unlock(),C.unset()}this.lock(),n.position.y=b,n.height=v,this.height=l,this.unlock(!1),this.emit("update",d,g,this)}}},i.prototype.resetRow=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];e instanceof hr&&(e.state.isPressed=!1)}return t},i.prototype.newRow=function(t){return new xp(this.Ab,t,this.vb,this.Eb)},i.prototype.onParentMove=function(t,i,r,e){n.prototype.onParentMove.call(this,t,i,r,e),this.updateFrozenCellPosition(t)},i.prototype.updateFrozenCellPosition=function(t){var n=this.Eb.frozen;if(null!=n&&0<n)for(var i=this.children,r=0,e=i.length;r<e;++r)i[r].updateFrozenCellPosition(t)},i.prototype.getClippingRect=function(t,i){n.prototype.getClippingRect.call(this,t,i);var r=this.parent;if(r){var e=-r.transform.position.y;i.y+=e,i.height-=e}},i.prototype.scrollTo=function(t){var n=this.parent;if(null==n)return!1;var i=n.parent;if(null==i)return!1;var r=-1;return pt(t)?0<=t&&t<this.data.mapped.size()&&(r=t):this.data.mapped.each((function(n,i,e){return n!==t||(r=e,!1)})),!(r<0||(n.position.y=Math.max(Math.min(0,i.height-n.height),-r*this.Mb),st.update(this),0))},i.prototype.toRowIndexMapped=function(t){return 0<=this.parent.position.y+t.y?Math.floor(t.y/this.Mb):-1},i.prototype.toRow=function(t){var n=t-this.Sb,i=this.children;return 0<=n&&n<i.length?i[n]:null},i.prototype.toCell=function(t,n){for(var i=t.children,r=i.length,e=this.fb.length,u=0,s=Math.min(r,e);u<s;++u){var h=i[r-u-1],o=n.x-h.position.x;if(0<=o&&o<=h.width)return h}return null},i.prototype.onRowClick=function(t){if(this.state.isActionable){var n=i.WORK_ON_CLICK;n.copyFrom(t.data.global),this.toLocal(n,void 0,n,!1);var r=this.toRowIndexMapped(n);if(0<=r&&r<this.Xt.mapped.size()){var e=this.toRow(r);if(e){var u=this.toCell(e,n);if(u&&u.onRowSelect&&u.onRowSelect(t,n))return}this.onRowSelect(t,r)}}},i.prototype.onRowSelect=function(t,n){var i=this.Xt,r=i.selection,e=r.type===Lp.SINGLE,u=!e,s=i.mapped.unmap(n),h=t.data.originalEvent,o=h.ctrlKey,a=h.shiftKey;if(e||r.isEmpty()||!u||!o&&!a)r.clearAndAdd(s);else if(o)r.toggle(s);else if(a){var c=r.last;if(null!=c){var f=i.sorter,l=i.filter,v=f.map(s),b=f.map(c);if(null!=v&&null!=b){var d=b+1,g=v+1;if(v<b&&(d=v,g=b),d<g){var m=[],w=l.indices,p=f.indices;if(w)if(p)for(var O=0,D=w.length;O<D;++O)d<=(E=w[O])&&E<g&&m.push(p[E]);else for(O=0,D=w.length;O<D;++O){var E;d<=(E=w[O])&&E<g&&m.push(E)}else if(p)for(O=d;O<g;++O)m.push(p[O]);else for(O=d;O<g;++O)m.push(O);r.addAll(m)}}}}},i.prototype.onDblClick=function(t,i){return n.prototype.onDblClick.call(this,t,i)},i.prototype.getType=function(){return"DTableBody"},Object.defineProperty(i.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),i.WORK_ON_CLICK=new t.Point,i}(hr),Vp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableCategoryCell"},n}(Tl),Wp=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=null!==(i=n.offset)&&void 0!==i?i:0;return r.vn=e,r.transform.position.y=e,r.initCells(n,r.fb,r.cb),r}return _(n,t),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.vn,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new Vp(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=i.cell;if(r){r.weight=n.weight,r.width=n.width;var e=r.text||{};return r.text=e,e.value=e.value||n.label,r}return{weight:n.weight,width:n.width,text:{value:n.label}}},n.prototype.getType=function(){return"DTableCategory"},n}(yp),Xp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.Al=-1,i.bb=!1,i.p=n,i.pf=null,i.mb=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.bb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.bb&&(this.bb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.bb},n.prototype.isFiltered=function(t,n,i){return wt(i)?i(t,n):i.test(t,n)},n.prototype.hasFiltered=function(t,n,i){for(var r=this.p.accessor,e=r.toChildren,u=r.hasChildren,s=0,h=n.length;s<h;++s){var o=n[s];if(this.isFiltered(o,-1,i))return!0;var a=e(o);if(u(o,a)&&this.hasFiltered(t,a,i))return!0}return!1},n.prototype.addAllToFiltered=function(t,n,i,r){for(var e=this.p.accessor,u=e.toChildren,s=e.hasChildren,h=0,o=n.length;h<o;++h){var a=n[h];i.push(r[0]),r[0]+=1;var c=u(a);s(a,c)&&t.isOpened(a)&&this.addAllToFiltered(t,c,i,r)}},n.prototype.newFilteredSub=function(t,n,i,r,e){for(var u=!1,s=this.p.accessor,h=s.toChildren,o=s.hasChildren,a=0,c=n.length;a<c;++a){var f=n[a],l=e[0];e[0]+=1;var v=this.isFiltered(f,l,i),b=h(f);if(o(f,b))if(t.isOpened(f))if(v)r.push(l),u=!0,this.addAllToFiltered(t,b,r,e);else{var d=r.length;this.newFilteredSub(t,b,i,r,e)&&(r.splice(d,0,l),u=!0)}else(v||this.hasFiltered(t,b,i))&&(r.push(l),u=!0);else v&&(r.push(l),u=!0)}return u},n.prototype.newFiltered=function(){var t=this.pf;if(null!=t){var n=[],i=this.p,r=i.nodes;return r&&this.newFilteredSub(i,r,t,n,[0]),n}return null},n.prototype.get=function(){return this.pf},n.prototype.set=function(t){this.pf!==t&&(this.pf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.Al&&(this.Al=this.R,this.bb?(this.mb=this.newFiltered(),this.emit("change",this)):null!=this.mb&&(this.mb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.mb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Kp=function(t){return t.parent},Yp=function(t){return t.children},Jp=function(t,n){return null!=n&&0<n.length},Zp=function(t){null!=t?(this.toParent=t.toParent||Kp,this.toChildren=t.toChildren||Yp,this.hasChildren=t.hasChildren||Jp):(this.toParent=Kp,this.toChildren=Yp,this.hasChildren=Jp)},qp=function(t,n){return t[0]-n[0]},Qp=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).p=n,e.xt=Ai(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:Lp.NONE,Lp),e.Ob=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),n.prototype.onNodeChange=function(t){if(null!=t){var n=this.p.accessor,i=n.toChildren,r=n.hasChildren,e=this.Ob,u=this.newRows(t,i,r,e,new Set);e.size!==u.size&&(this.Ob=u,this.onChange())}else{var s=this.Ob;0<s.size&&(s.clear(),this.onChange())}},n.prototype.newRows=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];r.has(h)&&e.add(h);var o=n(h);i(h,o)&&this.newRows(o,n,i,r,e)}return e},Object.defineProperty(n.prototype,"indices",{get:function(){var t=this.Ob,n=[];return this.p.each((function(i,r){t.has(i)&&n.push(r)})),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[];return this.Ob.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.xt},enumerable:!1,configurable:!0}),n.prototype.getFirst=function(){var t=this.Ob;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},n.prototype.getLast=function(){var t=this.Ob;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},n.prototype.toIndex=function(t){var n=null;return this.p.each((function(i,r){return t!==i||(n=r,!1)})),n},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.getFirst();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.getLast();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)?i.delete(n):i.add(n),this.onChange()}},n.prototype.add=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)||(i.add(n),this.onChange())}},n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.Ob,u=e.size,s=this.p;t<i?s.each((function(t){e.add(t)}),t+(n?0:1),i+(r?1:0)):s.each((function(t){e.add(t)}),i+(r?0:1),t+(n?1:0)),u!==e.size&&this.onChange()},n.prototype.addAll=function(t){if(0<t.length){for(var n=this.Ob,i=this.p,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.contains=function(t){var n=this.p.get(t);return!!n&&this.Ob.has(n)},n.prototype.remove=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)&&(i.delete(n),this.onChange())}},n.prototype.clear=function(){var t=this.Ob;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)?1<i.size&&(i.clear(),i.add(n),this.onChange()):(i.clear(),i.add(n),this.onChange())}},n.prototype.clearAndAddAll=function(t){var n=this.Ob;if(0<n.size||0<t.length){n.clear();for(var i=this.p,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.shift=function(t,n){},n.prototype.size=function(){return this.Ob.size},n.prototype.isEmpty=function(){return this.Ob.size<=0},n.prototype.each=function(t){var n=this.Ob;this.p.each((function(i,r){return!n.has(i)||!1!==t(r)}))},n.prototype.toArray=function(){var t=this.Ob,n=[];return this.p.each((function(i,r){t.has(i)&&n.push([r,i])})),n},n.prototype.toSortedArray=function(){return this.toArray().sort(qp)},n.prototype.toObject=function(){var t=this.Ob,n={};return this.p.each((function(i,r){t.has(i)&&(n[r]=i)})),n},n.prototype.toMap=function(){var t=this.Ob,n=new Map;return this.p.each((function(i,r){t.has(i)&&n.set(r,i)})),n},n}(t.utils.EventEmitter),$p=function(t){function n(){return t.call(this)||this}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return Up.ASCENDING},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.apply=function(){},n.prototype.unapply=function(){},n.prototype.isApplied=function(){return!1},n.prototype.get=function(){return null},n.prototype.set=function(t){},n.prototype.toDirty=function(){},n.prototype.update=function(){},Object.defineProperty(n.prototype,"indices",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.map=function(t){return t},n.prototype.unmap=function(t){return t},n}(t.utils.EventEmitter),tO=function(n){function i(t){var i=n.call(this)||this;if(i.p=null,i.qc=i.toAccessor(t),i.nf=new _p(i),i.Ob=[],i.Rb=!1,i.kb=[],i.Lb=new WeakMap,i.ai=!!(null==t?void 0:t.reverse),i.tf=i.toSelection(null==t?void 0:t.selection),i.pf=new Xp(i),i.Db=new $p,t){var r=t.filter;r&&i.pf.set(r);var e=t.on;if(e)for(var u in e){var s=e[u];s&&i.on(u,s)}}return i.nodes=null==t?void 0:t.nodes,i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:wt(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new Qp(this,t)},i.prototype.toAccessor=function(t){return new Zp(t)},i.prototype.bind=function(t){this.p=t},Object.defineProperty(i.prototype,"nodes",{get:function(){return this.yb},set:function(t){this.yb=t,this.Rb=!0,this.tf.onNodeChange(t),this.pf.toDirty(),this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rows",{get:function(){return this.Rb&&(this.Rb=!1,this.updateRows(this.yb)),this.Ob},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supplimentals",{get:function(){return this.kb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"accessor",{get:function(){return this.qc},enumerable:!1,configurable:!0}),i.prototype.updateRows=function(t){var n=this.Ob,i=this.kb,r=this.Lb;if(null!=t){var e=this.qc,u=this.newRows(t,0,0,n,i,r,this.ai,e.toChildren,e.hasChildren);u!==n.length&&(n.length=u,i.length=u)}else n.length=0,i.length=0},i.prototype.toSupplimental=function(t,n,i){return t<<2|(n?2:0)|(i?1:0)},i.prototype.newRows=function(t,n,i,r,e,u,s,h,o){for(var a=t.length,c=s?-1:1,f=s?a-1:0;0<=f&&f<a;f+=c){var l=t[f],v=h(l),b=u.has(l),d=this.toSupplimental(i,o(l,v),b);n<r.length?(r[n]=l,e[n]=d):(r.push(l),e.push(d)),n+=1,b&&v&&(n=this.newRows(v,n,i+1,r,e,u,s,h,o))}return n},i.prototype.update=function(t){var n=this.p;n&&n.update(t)},i.prototype.size=function(){return this.rows.length},i.prototype.get=function(t){var n=this.rows;return 0<=t&&t<n.length?n[t]:null},i.prototype.expand=function(t){var n=this.Lb;return!n.has(t)&&(n.set(t,1),this.Rb=!0,this.pf.toDirty(),this.update(!0),!0)},i.prototype.collapse=function(t){var n=this.Lb;return!!n.has(t)&&(n.delete(t),this.Rb=!0,this.pf.toDirty(),this.update(!0),!0)},i.prototype.isCollapsed=function(t){return!this.Lb.has(t)},i.prototype.isExpanded=function(t){return this.Lb.has(t)},i.prototype.toggle=function(t){return this.isExpanded(t)?this.collapse(t):this.expand(t)},i.prototype.open=function(t){return this.expand(t)},i.prototype.close=function(t){return this.collapse(t)},i.prototype.isOpened=function(t){return this.isExpanded(t)},i.prototype.each=function(t,n,i){var r=this.rows;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.pf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.Db},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),nO=function(){function t(t,n){var i,r,e;this.p=t,this.vs=null!==(i=null==n?void 0:n.enable)&&void 0!==i&&i,this.xb=null===(r=null==n?void 0:n.filterable)||void 0===r||r,this.Bb=null===(e=null==n?void 0:n.emittable)||void 0===e||e}return Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this.vs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFilterable",{get:function(){return this.xb},set:function(t){this.xb=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmittable",{get:function(){return this.Bb},set:function(t){this.Bb=t},enumerable:!1,configurable:!0}),t.prototype.newIteratee=function(t,n){var i=this.p,r=i.column,e=i.columnIndex;if(null!=r&&null!=e){var u=r.getter,s=r.setter;if(this.Bb){var h=t.data;return function(t,i){return u(t,e)!==n&&(s(t,e,n),h.emit("change",n,!n,t,i,e,h),!0)}}return function(t){return u(t,e)!==n&&(s(t,e,n),!0)}}return null},t.prototype.execute=function(t){var n,i=null===(n=this.p.header)||void 0===n?void 0:n.table;if(i){var r=this.newIteratee(i,t);if(r){var e=!1;this.xb?i.data.mapped.each((function(t,n,i,u){r(t,u)&&(e=!0)})):i.data.each((function(t,n){r(t,n)&&(e=!0)})),e&&i.body.update(!0)}}},t}(),iO=t.interaction.InteractionEvent,rO=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){null!=t?(this.Th=t.header,this.hb=t.column,this.sb=t.columnIndex,this.Pb=new nO(this,t.check)):this.Pb=new nO(this),n.prototype.init.call(this,t),this.initOnClick(t)},Object.defineProperty(i.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"header",{get:function(){return this.Th},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"check",{get:function(){return this.Pb},enumerable:!1,configurable:!0}),i.prototype.initOnClick=function(t){var n=this,i=this.hb;if(i){var r=i.sorting.enable,e=this.Pb.isEnabled;if(e||r){this.on(ir.tap,(function(t){n.onClick(t)}));var u=this.state;u.lock(),u.set(Mp.SORTABLE,r),u.set(Mp.CHECKABLE,e),u.unlock()}}},Object.defineProperty(i.prototype,"sorter",{get:function(){var t=this,n=this.Db;if(null==n){var i=this.Th;if(!i)return null;var r=i.table;if(!r)return null;n=r.data.sorter,this.Db=n,this.Fb=this.Fb||function(){t.onSorterChange()},n.on("change",this.Fb)}return n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comparator",{get:function(){var t=this.hb;return t&&t.sorting.comparator||null},enumerable:!1,configurable:!0}),i.prototype.onSorterChange=function(){var t=this.comparator;if(t){var n=this.Db;if(n){var i=Mp.SORTED_ASCENDING,r=Mp.SORTED_DESCENDING;n.isApplied()&&n.get()===t?n.order===Up.ASCENDING?this.state.set(i,r):this.state.set(r,i):this.state.removeAll(i,r)}}},i.prototype.toClickPosition=function(n){var i=this.Ub||new t.Point;return this.Ub=i,n.data.getLocalPosition(this,i).x},i.prototype.isCheckClicked=function(t){if(t instanceof iO&&this.Pb.isEnabled){if(!this.isSortable)return!0;var n=this.mh[1];if(n&&null!=n.image){var i=this.toClickPosition(t),r=n.bound,e=n.margin.horizontal;return r.left-e<=i&&i<=r.right+e}}return!1},i.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},i.prototype.activate=function(t){this.onActivate(t)},i.prototype.onActivate=function(t){this.isCheckClicked(t)?(this.onToggleStart(),this.onToggleEnd()):(this.doSort(t),this.emit("active",this))},i.prototype.doSort=function(t){if(this.isSortable){var n=this.comparator;if(n){var i=this.sorter;i&&(i.get()===n?i.order===Up.ASCENDING?(i.order=Up.DESCENDING,i.apply()):(i.set(null),i.apply()):(i.set(n),i.order=Up.ASCENDING,i.apply()))}}},Object.defineProperty(i.prototype,"isSortable",{get:function(){var t=this.hb;return!!t&&t.sorting.enable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isToggle",{get:function(){return this.Pb.isEnabled},enumerable:!1,configurable:!0}),i.prototype.toggle=function(){this.state.isActionable&&this.isToggle&&(this.onToggleStart(),this.onToggleEnd())},i.prototype.onToggleStart=function(){this.state.isActive=!this.state.isActive},i.prototype.onToggleEnd=function(){this.state.isActive?(this.Pb.execute(!0),this.emit("active",this)):(this.Pb.execute(!1),this.emit("inactive",this))},i.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.isToggle?this.onToggleStart():this.state.isPressed=!0)},i.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.isToggle?this.onToggleEnd():(this.state.isPressed&&this.activate(t),this.state.isPressed=!1))},i.prototype.onKeyDown=function(t){return nr.isActivateKey(t)&&this.onActivateKeyDown(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyUp=function(t){return nr.isActivateKey(t)&&this.onActivateKeyUp(t),n.prototype.onKeyUp.call(this,t)},i.prototype.getType=function(){return"DTableHeaderCell"},i.prototype.destroy=function(){var t=this.Db,i=this.Fb;t&&i&&t.off("change",i),this.Db=void 0,this.Fb=void 0,n.prototype.destroy.call(this)},i}(Tl),eO=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Gb=null!==(i=n.table)&&void 0!==i?i:null;var u=null!==(r=n.offset)&&void 0!==r?r:0;return e.vn=u,e.transform.position.y=u,e.initCells(n,e.fb,e.cb),e}return _(n,t),Object.defineProperty(n.prototype,"table",{get:function(){return this.Gb},enumerable:!1,configurable:!0}),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.vn,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new rO(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=n.header||i.cell;return null!=r?(void 0===r.weight&&(r.weight=n.weight),void 0===r.width&&(r.width=n.width),void 0===r.text?r.text={value:n.label}:void 0===r.text.value&&(r.text.value=n.label),void 0===r.header&&(r.header=this),void 0===r.column&&(r.column=n),void 0===r.columnIndex&&(r.columnIndex=t),r):{weight:n.weight,width:n.width,text:{value:n.label},header:this,column:n,columnIndex:t}},n.prototype.getType=function(){return"DTableHeader"},n}(yp),uO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getOffsetVerticalStart=function(t){return.5*t+this.p.body.position.y},n}(Gd),sO=function(t,n){return t[n]},hO=function(t,n,i){t[n]=i},oO=function(){return""},aO=function(){},cO=function(t){if(null!=t){var n=t.length;if(n<=1){var i=t[0];return function(t){return Object.prototype.hasOwnProperty.call(t,i)}}return function(i){for(var r=0;r<n;++r){var e=t[r];if(!(e in i))return!1;i=i[e]}return!0}}return function(t,n){return n<t.length}},fO=function(t,n){return Ot(t)?cO(n):null!=t&&t},lO=function(t,n){var i,r=t.editing,e=t.editable;return r?{enable:fO(null!==(i=r.enable)&&void 0!==i?i:e,n),formatter:r.formatter,unformatter:r.unformatter,validator:r.validator}:{enable:fO(e,n)}},vO=function(t,n){return function(i,r){var e=t(i,n),u=t(r,n);return e<u?-1:u<e?1:0}},bO=function(t,n,i){var r=i.sorting,e=i.sortable;return r?r.enable||e?{enable:!0,comparator:r.comparator||vO(t,n)}:{enable:!1}:e?{enable:!0,comparator:vO(t,n)}:{enable:!1}},dO=function(t){return null==t?void 0:t instanceof cw?t:new cw(t)},gO=function(t){return null==t?void 0:"open"in t?t:new $d(t)},mO=function(t){return t.value},wO=function(){},pO=function(t){return t?{getter:t.getter||mO,setter:t.setter||wO,menu:dO(t.menu),multiple:dO(t.multiple),dialog:gO(t.dialog),promise:t.promise}:{getter:mO,setter:wO}},OO=function(t){var n=t.state;return null!=n?Ot(n)||mt(n)?{initial:n,modifier:void 0}:{initial:void 0,modifier:n}:{initial:void 0,modifier:void 0}},DO=function(t,n){var i=t.renderable;return Ot(i)?cO(n):null==i||i},EO=function(t,n){var i,r=n.weight,e=n.width;null!=r?null!=e&&(e=void 0):null==e&&(r=1);var u=Ai(null!==(i=n.type)&&void 0!==i?i:lp.TEXT,lp),s=function(t,n){var i=t.align;if(null!=i)return Ot(i)?ts[i]:i;switch(n){case lp.TEXT:return ts.LEFT;case lp.REAL:case lp.INTEGER:return ts.RIGHT;case lp.BUTTON:case lp.INDEX:case lp.SELECT:case lp.ACTION:case lp.LINK:case lp.CHECK:case lp.CHECK_SINGLE:case lp.COLOR:return ts.CENTER;default:return ts.LEFT}}(n,u),h=n.label||"",o=function(t){return null!=t.path?t.path.split("."):null}(n),a=function(t,n,i){var r=t.getter;if(r)return r;switch(n){case lp.ACTION:case lp.LINK:return oO;default:return null==i?sO:function(t,n){if(t.length<=1){var i=t[0];return void 0===n?function(t){return t[i]}:function(t){return Object.prototype.hasOwnProperty.call(t,i)?t[i]:n}}return void 0===n?function(n){for(var i=0,r=t.length-1;i<r;++i)n=n[t[i]];return n[t[t.length-1]]}:function(i){for(var r=0,e=t.length-1;r<e;++r)i=i[t[r]];var u=t[t.length-1];return Object.prototype.hasOwnProperty.call(i,u)?i[u]:n}}(i,t.default)}}(n,u,o);return{weight:r,width:e,type:u,label:h,getter:a,setter:function(t,n,i){var r=t.setter;if(r)return r;switch(n){case lp.BUTTON:case lp.ACTION:case lp.LINK:return aO;default:return null==i?hO:function(t){if(t.length<=1){var n=t[0];return function(t,i,r){t[n]=r}}return function(n,i,r){for(var e=0,u=t.length-1;e<u;++e)n=n[t[e]]||{};n[t[t.length-1]]=r}}(i)}}(n,u,o),formatter:n.formatter,renderable:DO(n,o),align:s,state:OO(n),editing:lO(n,o),sorting:bO(a,t,n),header:n.header,body:n.body,selecting:pO(n.selecting),category:n.category,frozen:n.frozen,offset:0,link:n.link}},MO=function(t){function n(n){var i=t.call(this,n)||this,r=i.content;r.setWidth(i.toContentWidth(n));var e=i.body;r.addChild(e),e.data.selection.type!==Lp.NONE&&i.on(ir.tap,(function(t){e.onRowClick(t)}));var u=i.header;u&&r.addChild(u);for(var s=i.categories,h=s.length-1;0<=h;--h)r.addChild(s[h]);return e.update(),i}return _(n,t),Object.defineProperty(n.prototype,"columns",{get:function(){var t=this.fb;if(null==t){var n=this.zn;t=n?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(EO(i,t[i]));return n}(n.columns):[],this.fb=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"frozen",{get:function(){var t=this.cb;return null==t&&(t=function(t){for(var n=t.length-1;0<=n;--n)if(!0===t[n].frozen)return n+1;return 0}(this.columns),this.cb=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"categories",{get:function(){var t=this.Hb;return null==t&&(t=this.newCategories(this.zn,this.columns,this.frozen),this.Hb=t),t},enumerable:!1,configurable:!0}),n.prototype.initContent=function(n){t.prototype.initContent.call(this,n),n.state.isFocusReverse=!0},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.body.update()},n.prototype.onResize=function(n,i,r,e){var u=this.scrollbar;u.lock();var s=this.body;s.lock(),t.prototype.onResize.call(this,n,i,r,e),s.update(),s.unlock(!0),u.unlock(!0)},n.prototype.getCategoryCount=function(t){for(var n=0,i=0,r=t.length;i<r;++i){var e=t[i].category;if(null!=e){var u=Ot(e)?1:e.length;n=Math.max(n,u)}}return n},n.prototype.toCategoryLabel=function(t,n){if(n)if(Ot(n)){if(0===t)return n}else if(t<n.length)return n[t]},n.prototype.isSameCategory=function(t,n,i){if(null!=n){if(null!=i){if(Ot(n))return Ot(i)?0<t||n===i:0<t?i.length<=t:1===i.length&&n===i[0];if(Ot(i))return 0<t?n.length<=t:1===n.length&&n[0]===i;if(n.length<=t&&i.length<=t)return!0;if(i.length===n.length){for(var r=t,e=n.length;r<e;++r)if(n[r]!==i[r])return!1;return!0}return!1}return Ot(n)?0<t:n.length<=t}return null==i||(Ot(i)?0<t:i.length<=t)},n.prototype.toCategoryColumns=function(t,n,i){for(var r=[],e=null,u=null,s=0,h=n.length;s<h;++s){var o=n[s];s!==i&&u&&e&&this.isSameCategory(t,e.category,o.category)?null!=u.weight&&null!=o.weight?u.weight+=o.weight:null!=u.width&&null!=o.width?u.width+=o.width:(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u)):(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u))}return r},n.prototype.toCategoryOptions=function(t,n,i,r,e){return n?(void 0===n.columns&&(n.columns=this.toCategoryColumns(t,i,r)),null==n.frozen&&(n.frozen=r),null==n.offset&&(n.offset=e),n):{columns:this.toCategoryColumns(t,i,r),frozen:r,offset:e}},n.prototype.newCategories=function(t,n,i){for(var r=[],e=0,u=this.getCategoryCount(n)-1;0<=u;--u){var s=new Wp(this.toCategoryOptions(u,null==t?void 0:t.category,n,i,e));r.push(s),e+=s.height}return r},n.prototype.onDblClick=function(n,i){var r=this.body.onDblClick(n,i);return t.prototype.onDblClick.call(this,n,i)||r},n.prototype.newScrollBar=function(t){var n=this;return new uO(this,t,(function(t){n.onScrollBarUpdate(t)}))},n.prototype.toContentWidth=function(t){var n=0,i=null==t?void 0:t.columns;if(i)for(var r=0,e=i.length;r<e;++r){var u=i[r].width;null!=u&&(n+=u)}return 0<n?function(t){return Math.max(t,n)}:"100%"},n.prototype.getHeaderOffset=function(){var t=this.zb;return null==t&&(t=this.newHeaderOffset(),this.zb=t),t},n.prototype.newHeaderOffset=function(){for(var t=0,n=this.categories,i=0,r=n.length;i<r;++i)t+=n[i].height;return t},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.Th;return void 0===t&&(t=this.newHeader(this.zn,this.columns,this.frozen,this.getHeaderOffset()),this.Th=t),t},enumerable:!1,configurable:!0}),n.prototype.hasHeader=function(t){if(t)for(var n=t.columns,i=0,r=n.length;i<r;++i)if(null!=n[i].label)return!0;return!1},n.prototype.newHeader=function(t,n,i,r){return this.hasHeader(t)?new eO(this.toHeaderOptions(null==t?void 0:t.header,n,i,r)):null},n.prototype.toHeaderOptions=function(t,n,i,r){return t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.table&&(t.table=this),t):{columns:n,frozen:i,offset:r,table:this}},n.prototype.getBodyOffset=function(){var t=this.Vb;return null==t&&(t=this.newBodyOffset(),this.Vb=t),t},n.prototype.newBodyOffset=function(){var t,n;return this.getHeaderOffset()+(null!==(n=null===(t=this.header)||void 0===t?void 0:t.height)&&void 0!==n?n:0)},Object.defineProperty(n.prototype,"body",{get:function(){var t=this.Ie;return null==t&&(t=this.newBody(this.zn,this.columns,this.frozen,this.getBodyOffset()),this.Ie=t),t},enumerable:!1,configurable:!0}),n.prototype.newBody=function(t,n,i,r){return new zp(this.toBodyOptions(null==t?void 0:t.body,n,i,r,null==t?void 0:t.data))},n.prototype.toBodyOptions=function(t,n,i,r,e){return null!=t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.data&&void 0!==e&&(mt(e)?t.data={rows:e}:t.data=e),void 0===t.height&&void 0===t.weight&&(t.weight=1),t):mt(e)?{columns:n,frozen:i,offset:r,data:{rows:e},weight:1}:{columns:n,frozen:i,offset:r,data:e,weight:1}},Object.defineProperty(n.prototype,"data",{get:function(){return this.body.data},enumerable:!1,configurable:!0}),n.prototype.getFocusedChildClippingRect=function(n,i,r,e,u,s,h,o){t.prototype.getFocusedChildClippingRect.call(this,n,i,r,e,u,s,h,o);var a=this.toCell(n);if(a){var c=i+this.toFrozenCellX(a)-o.x;if(0<c&&(o.x+=c,o.width-=c),a.parent.parent===this.body){var f=this.getBodyOffset();o.y+=f,o.height-=f}}return o},n.prototype.toFrozenCellX=function(t){var n=this.frozen;if(0<n){var i=t.parent.children,r=i.indexOf(t);if(0<=r){var e=i.length;if(n<=e-1-r){var u=i[e-n];return u.position.x+u.width}}}return 0},n.prototype.onKeyDown=function(n){nr.moveFocusHorizontally(n,this);var i=nr.isArrowUpKey(n),r=nr.isArrowDownKey(n);return(i||r)&&this.onKeyDownArrowUpOrDown(n,r),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowUpOrDown=function(t,n){var i=st.getLayer(this);if(null==i)return!1;var r=i.getFocusController(),e=r.get();if(null==e)return!1;var u=this.toCell(e);if(null==u)return!1;var s=u.parent;if(null==s)return!1;var h=r.find(s,!1,!1,n,this);if(null==h)return!1;var o=this.toCell(h);if(null==o)return!1;var a=o.parent;if(null==a)return!1;var c=s.children.indexOf(u);if(c<0)return!1;var f=a.children[c];if(null==f||f===u||!("state"in f))return!1;var l=r.find(f,!0,!0,n,this);return null!=l&&(r.focus(l),!0)},n.prototype.toCell=function(t){for(var n=t;null!=n;){var i=n.parent;if(i instanceof yp)return n instanceof hr?n:null;n=i}return null},n.prototype.getType=function(){return"DTable"},n}(Hd),SO=function(t){var n=t.text;if(Ot(n))return n;var i=t.label;if(Ot(i))return i;var r=t.name;return Ot(r)?r:void 0},jO=function(t){var n=t.title;if(Ot(n))return n},TO=function(t){return t.image},NO=function(t){return t.children},IO=function(t){return t.children=[]},CO=function(t){var n,i,r,e,u;this.toLabel=null!==(n=null==t?void 0:t.toLabel)&&void 0!==n?n:SO,this.toTitle=null!==(i=null==t?void 0:t.toTitle)&&void 0!==i?i:jO,this.toImage=null!==(r=null==t?void 0:t.toImage)&&void 0!==r?r:TO,this.toChildren=null!==(e=null==t?void 0:t.toChildren)&&void 0!==e?e:NO,this.newChildren=null!==(u=null==t?void 0:t.newChildren)&&void 0!==u?u:IO},AO={NONE:0,SINGLE:1,MULTIPLE:2},RO=function(){function t(t,n){this.p=t,this.yb=[],this.Wb=[],this.ai=n,this.En=!1}return Object.defineProperty(t.prototype,"nodes",{get:function(){return this.update(),this.yb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"levels",{get:function(){return this.update(),this.Wb},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.En=!0},t.prototype.size=function(){return this.update(),this.yb.length},t.prototype.each=function(t,n,i){this.update();for(var r=this.yb,e=null!=n?Math.max(0,n):0,u=null!=i?Math.min(r.length,i):r.length,s=e;s<u&&!1!==t(r[s],s);++s);},t.prototype.update=function(){if(this.En){this.En=!1;var t=this.p,n=t.nodes,i=t.accessor.toChildren,r=this.yb,e=this.Wb,u=this.newNodes(t,n,0,0,r,e,this.ai,i);r.length!==u&&(r.length=u,e.length=u)}},t.prototype.newNodes=function(t,n,i,r,e,u,s,h){for(var o=n.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=n[c];i<e.length?(e[i]=f,u[i]=r):(e.push(f),u.push(r)),i+=1;var l=h(f);l&&t.isExpanded(f)&&(i=this.newNodes(t,l,i,r+1,e,u,s,h))}return i},t}(),kO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n,r.yb=new Set;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return AO.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){var t=this.yb;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.yb;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.yb;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.yb;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.yb;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.yb;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.yb;return 0<t.size&&(t.clear(),this.onChange(),!0)},n.prototype.clearAndAdd=function(t){var n=this.yb;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.yb,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.yb=i,this.onChange()),n},n.prototype.contains=function(t){return this.yb.has(t)},n.prototype.size=function(){return this.yb.size},n.prototype.isEmpty=function(){return this.yb.size<=0},n.prototype.each=function(t){var n=!1;this.yb.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.yb.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.yb;if(0<n.size){var i=this.newNodes(t,n,new Set);n.size!==i.size&&(this.yb=i,this.onChange())}},n.prototype.newNodes=function(t,n,i){for(var r=this.p.accessor.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];n.has(s)&&i.add(s);var h=r(s);h&&this.newNodes(h,n,i)}return i},n}(t.utils.EventEmitter),LO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n,r.xn=null;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return AO.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.xn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.xn},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.xn:null},n.prototype.add=function(t){return this.xn!==t&&(this.xn=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.xn===t&&(this.xn=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.xn===t?this.xn=null:this.xn=t,this.onChange(),!0},n.prototype.clear=function(){return null!=this.xn&&(this.xn=null,this.onChange(),!0)},n.prototype.clearAndAdd=function(t){return this.xn!==t&&(this.xn=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){if(0<t.length){var n=t[t.length-1];return this.clearAndAdd(n)}return this.clear()},n.prototype.contains=function(t){return this.xn===t},n.prototype.size=function(){return null!=this.xn?1:0},n.prototype.isEmpty=function(){return null==this.xn},n.prototype.each=function(t){var n=this.xn;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.xn;return null!=t?[t]:[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.xn;if(null!=n){var i=this.newNode(t,n);n!==i&&(this.xn=i,this.onChange())}},n.prototype.newNode=function(t,n){for(var i=this.p.accessor.toChildren,r=0,e=t.length;r<e;++r){var u=t[r];if(n===u)return u;var s=i(u);if(s){var h=this.newNode(s,n);if(null!=h)return h}}return null},n}(t.utils.EventEmitter),yO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return AO.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){return!1},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onNodeChange=function(t){},n}(t.utils.EventEmitter),xO=function(){function t(t,n){this.p=t,this.Xb=new WeakMap,this.tf=this.toSelection(n),this.qc=new CO(n);var i=new RO(this,!!(null==n?void 0:n.reverse));this.nf=i;var r=null==n?void 0:n.nodes;null!=r?(this.yb=r,i.toDirty()):this.yb=[]}return t.prototype.toSelection=function(t){var n=null==t?void 0:t.selection;switch(null==n?void 0:n.type){case AO.NONE:case"NONE":return new yO(this,n);case AO.MULTIPLE:case"MULTIPLE":return new kO(this,n);default:return new LO(this,n)}},Object.defineProperty(t.prototype,"nodes",{get:function(){return this.yb},set:function(t){this.yb=t,this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.qc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),t.prototype.update=function(t){t&&(this.nf.toDirty(),this.tf.onNodeChange(this.yb)),this.p.update(t)},t.prototype.toggle=function(t){var n=this.Xb;return n.has(t)?n.delete(t):n.set(t,1),this.nf.toDirty(),this.update(),!0},t.prototype.expand=function(t){var n=this.Xb;return!n.has(t)&&(n.set(t,1),this.nf.toDirty(),this.update(),!0)},t.prototype.collapse=function(t){var n=this.Xb;return!!n.has(t)&&(n.delete(t),this.nf.toDirty(),this.update(),!0)},t.prototype.expandAll=function(){var t=!1,n=this.Xb;return this.each((function(i){n.has(i)||(n.set(i,1),t=!0)})),!!t&&(this.nf.toDirty(),this.update(),!0)},t.prototype.collapseAll=function(){var t=!1,n=this.Xb;return this.each((function(i){n.has(i)&&(n.delete(i),t=!0)})),!!t&&(this.nf.toDirty(),this.update(),!0)},t.prototype.isCollapsed=function(t){return!this.isExpanded(t)},t.prototype.isExpanded=function(t){return this.Xb.has(t)},t.prototype.clear=function(){var t=this.yb;return 0<t.length&&(t.length=0,this.nf.toDirty(),this.tf.clear(),this.update(),!0)},t.prototype.remove=function(t){var n=!1;return this.each((function(i,r,e){return i!==t||(e.splice(r,1),n=!0,!1)})),!!n&&(this.nf.toDirty(),this.tf.remove(t),this.update(),!0)},t.prototype.add=function(t,n){var i=!1;if(n){var r=this.qc,e=r.toChildren(n);if(e)e.push(t),i=!0;else{var u=r.newChildren(n);u&&(u.push(t),i=!0)}}else{var s=this.yb;s?s.push(t):this.yb=[t],i=!0}return i&&(this.nf.toDirty(),this.update()),!0},t.prototype.addBefore=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e,0,t),i=!0,!1)})),i&&(this.nf.toDirty(),this.update()),i},t.prototype.addAfter=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e+1,0,t),i=!0,!1)})),i&&(this.nf.toDirty(),this.update()),i},t.prototype.each=function(t){var n=this.yb;n&&this.Zc(n,null,t)},t.prototype.Zc=function(t,n,i){for(var r=this.qc.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];if(!1===i(s,e,t,n))return;var h=r(s);h&&this.Zc(h,s,i)}},t}(),BO={HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED"},_O=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Qn=new _b(r.Qn),r.Xt=n,r}return _(n,t),Object.defineProperty(n.prototype,"node",{get:function(){return this.xn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.xn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.xn;void 0!==t&&this.Xt.toggle(t)},n.prototype.set=function(t,n,i){var r,e=this.Xt,u=i||this.xn!==t;if(u){this.xn=t,this.hu=n;var s=e.accessor;this.text=s.toLabel(t),this.title=null!==(r=s.toTitle(t))&&void 0!==r?r:"",this.image=s.toImage(t)}var h=e.mapped.levels[n];this.Qn.adjLeft(this.theme.getLevelPadding(h));var o=e.accessor.toChildren(t),a=!!(o&&0<o.length),c=this.state;c.lock(),c.set(ct.ACTIVE,e.selection.contains(t)),c.remove(ct.DISABLED),c.set(BO.HAS_CHILDREN,a),c.set(BO.OPENED,e.isExpanded(t)),c.unlock(),u&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.xn){this.xn=void 0,this.hu=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ct.DISABLED),t.remove(ct.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onSelect=function(t,n){var i=this.Xt,r=i.selection;if(r.type!==AO.MULTIPLE)r.clearAndAdd(n);else{var e=t&&"data"in t?t.data.originalEvent:t;if(null==e?void 0:e.ctrlKey)r.toggle(n);else if(null==e?void 0:e.shiftKey){var u=i.mapped,s=r.last;if(n===s)r.clearAndAdd(n);else{var h=!1,o=!1,a=[];u.each((function(t){if(h){if(o){if(a.unshift(t),t===n)return!1}else if(a.push(t),t===s)return!1}else t===n?(h=!0,o=!1,a.push(t)):t===s&&(h=!0,o=!0,a.push(t))})),r.clearAndAddAll(a)}}else r.clearAndAdd(n)}},n.prototype.onKeyDown=function(n){var i;return nr.isActivateKey(n)&&this.onKeyDownActivate(n),nr.isArrowRightKey(n)&&void 0!==(i=this.xn)&&this.state.is(BO.HAS_CHILDREN)&&this.Xt.expand(i),nr.isArrowLeftKey(n)&&void 0!==(i=this.xn)&&this.state.is(BO.HAS_CHILDREN)&&this.Xt.collapse(i),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){if(this.state.isActionable&&this.state.isFocused){var n=this.xn;return void 0!==n&&this.onSelect(t,n),!0}return!1},n.prototype.getType=function(){return"DTreeItemText"},n}(Ss),PO=function(t){function n(n,i){var r,e=this;return(e=t.call(this,n,i)||this).ph=Ai(null!==(r=null==i?void 0:i.when)&&void 0!==r?r:qu.CLICKED,qu),e.on(ir.tap,(function(t){e.onClick(t)})),e}return _(n,t),n.prototype.onClick=function(t){this.ph===qu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.ph===qu.DOUBLE_CLICKED&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.activate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTreeItemButton"},n}(_O),FO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(i){t.prototype.onActivate.call(this,i);var r=this.xn;void 0!==r&&(this.state.is(BO.HAS_CHILDREN)?i&&"data"in i&&(this.toLocal(i.data.global,void 0,n.WORK_CONTAINS_POINT).x<=this.padding.getLeft()?this.toggle():this.onSelect(i,r)):this.onSelect(i,r))},n.prototype.getType=function(){return"DTreeItemNonEditable"},n}(PO),UO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new FO(t)},n}(Od),GO=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.gf;return null==t&&(t=this.newUpdater(this.data,this.content,this.zn),this.gf=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new UO(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Xt;return null==t&&(t=this.toData(this.zn),this.Xt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.nodes||t.value)||[];return mt(n)?new xO(this,{nodes:n}):"add"in n?n:new xO(this,n)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nodes",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),n.prototype.toggle=function(t){return this.data.toggle(t)},n.prototype.expand=function(t){return this.data.expand(t)},n.prototype.collapse=function(t){return this.data.collapse(t)},n.prototype.expandAll=function(){return this.data.expandAll()},n.prototype.collapseAll=function(){return this.data.collapseAll()},n.prototype.isCollapsed=function(t){return this.data.isCollapsed(t)},n.prototype.isExpanded=function(t){return this.data.isExpanded(t)},n.prototype.clear=function(){return this.data.clear()},n.prototype.remove=function(t){return this.data.remove(t)},n.prototype.add=function(t,n){return this.data.add(t,n)},n.prototype.addBefore=function(t,n){return this.data.addBefore(t,n)},n.prototype.addAfter=function(t,n){return this.data.addAfter(t,n)},n.prototype.each=function(t){return this.data.each(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!1),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DTree"},n}(Hd),HO={__proto__:null,loadAll:Cv,loadMenuItemAll:Iv,loadMenuItemExpandable:av,loadMenuItem:Ql,loadMenuSidedItemExpandable:Nv,loadMenuSidedItem:mv,deserializeActionValue:bo,EShapeActionBases:fn,EShapeActionEnvironment:ln,EShapeActionExpressions:vn,EShapeActionOpenDialogExtensions:Rh,EShapeActionOpenExtensions:yh,EShapeActionOpenOpeners:Je,EShapeActionRuntimeBase:bn,EShapeActionRuntimeBlinkBrighten:mn,EShapeActionRuntimeBlinkColorFill:wn,EShapeActionRuntimeBlinkColorStroke:pn,EShapeActionRuntimeBlinkDarken:On,EShapeActionRuntimeBlinkOpacity:Dn,EShapeActionRuntimeBlinkVisibility:En,EShapeActionRuntimeBlink:gn,EShapeActionRuntimeChangeColorBrightness:_n,EShapeActionRuntimeChangeColorCode:Fn,EShapeActionRuntimeChangeColor:kn,EShapeActionRuntimeChangeCursor:Gn,EShapeActionRuntimeChangeTextNumber:Si,EShapeActionRuntimeChangeTextText:ji,EShapeActionRuntimeConditional:dn,EShapeActionRuntimeEmitEvent:qe,EShapeActionRuntimeGestureLayer:Fe,EShapeActionRuntimeGestureShape:Ge,EShapeActionRuntimeMiscEmitEvent:$e,EShapeActionRuntimeMiscExecute:Au,EShapeActionRuntimeMiscHtmlElement:lu,EShapeActionRuntimeMiscInputInput:pu,EShapeActionRuntimeMiscInputInteger:Du,EShapeActionRuntimeMiscInputNumber:Ou,EShapeActionRuntimeMiscInputReal:Eu,EShapeActionRuntimeMiscInputText:Su,EShapeActionRuntimeMiscInput:wu,EShapeActionRuntimeMiscWriteBoth:Tu,EShapeActionRuntimeMiscWriteLocal:Nu,EShapeActionRuntimeMiscWriteRemote:Iu,EShapeActionRuntimeMiscWrite:ju,EShapeActionRuntimeOpenDialogBoolean:Hs,EShapeActionRuntimeOpenDialogDate:Ih,EShapeActionRuntimeOpenDialogDatetime:Eh,EShapeActionRuntimeOpenDialogExtension:kh,EShapeActionRuntimeOpenDialogInteger:Js,EShapeActionRuntimeOpenDialogReal:Qs,EShapeActionRuntimeOpenDialogText:nh,EShapeActionRuntimeOpenDialogTime:jh,EShapeActionRuntimeOpenDialog:Gs,EShapeActionRuntimeOpen:ku,EShapeActionRuntimeShowHideLayer:Fh,EShapeActionRuntimeShowHideShape:Gh,EShapeActionRuntimeShowHide:_h,EShapeActionRuntimeTransformMoveAbsoluteX:Vh,EShapeActionRuntimeTransformMoveAbsoluteY:Wh,EShapeActionRuntimeTransformMoveForwardOrBackward:Xh,EShapeActionRuntimeTransformMoveLeftOrRight:Kh,EShapeActionRuntimeTransformMoveRelativeX:Yh,EShapeActionRuntimeTransformMoveRelativeY:Jh,EShapeActionRuntimeTransformMove:zh,EShapeActionRuntimeTransformResizeHeightAbsolute:io,EShapeActionRuntimeTransformResizeHeightRelative:ro,EShapeActionRuntimeTransformResizeSizeAbsolute:eo,EShapeActionRuntimeTransformResizeSizeRelative:uo,EShapeActionRuntimeTransformResizeWidthAbsolute:so,EShapeActionRuntimeTransformResizeWidthRelative:ho,EShapeActionRuntimeTransformResize:no,EShapeActionRuntimeTransformRotateAbsolute:co,EShapeActionRuntimeTransformRotateRelative:fo,EShapeActionRuntimeTransformRotate:ao,EShapeActionRuntimes:Av,EShapeActionValueBase:Sn,EShapeActionValueBlinkType:Mn,EShapeActionValueBlink:In,EShapeActionValueChangeColorBrightness:Pn,EShapeActionValueChangeColorCode:Un,EShapeActionValueChangeColorTarget:Rn,EShapeActionValueChangeColorTypeLegacy:yn,EShapeActionValueChangeColorType:Ln,EShapeActionValueChangeColorTypes:xn,EShapeActionValueChangeColor:Bn,EShapeActionValueChangeCursor:Hn,EShapeActionValueChangeTextType:Ti,EShapeActionValueChangeText:Ni,EShapeActionValueDeserializers:go,EShapeActionValueEmitEvent:Qe,EShapeActionValueGestureOperationType:_e,EShapeActionValueGestureType:He,EShapeActionValueGesture:Ve,EShapeActionValueMiscEmitEvent:Rv,EShapeActionValueMiscExecute:Ru,EShapeActionValueMiscHtmlElement:kv,EShapeActionValueMiscInput:Lv,EShapeActionValueMiscType:ze,EShapeActionValueMiscWrite:yv,EShapeActionValueMisc:Cu,EShapeActionValueOnInputAction:gu,EShapeActionValueOnInputActions:mu,EShapeActionValueOpenDialogExtension:Lh,EShapeActionValueOpenDialogType:Ch,EShapeActionValueOpenDialog:Ah,EShapeActionValueOpenExtension:xh,EShapeActionValueOpenType:Lu,EShapeActionValueOpen:yu,EShapeActionValueOpetyped:Zh,EShapeActionValueShowHideLayer:Uh,EShapeActionValueShowHideShape:Hh,EShapeActionValueShowHideType:Bh,EShapeActionValueShowHide:Ph,EShapeActionValueSubtyped:jn,EShapeActionValueTransformMoveType:qh,EShapeActionValueTransformMove:$h,EShapeActionValueTransformResizeType:to,EShapeActionValueTransformResize:oo,EShapeActionValueTransformRotateType:lo,EShapeActionValueTransformRotate:vo,EShapeActionValueTransformType:Qh,EShapeActionValueType:Tn,EShapeActionValues:Nn,EShapeAction:ht,EShapeActions:Ze,loadShapeAll:jl,loadShapeBar:Mo,loadShapeButton:Vo,loadShapeCircle:ia,loadShapeClipperEx:function(){au=!0},isShapeClipperExLoaded:cu,loadShapeConnectorElbow:rc,loadShapeConnectorLine:ec,loadShapeEmbedded:fc,loadShapeGroupShadowed:Dc,loadShapeGroup:mc,loadShapeImage:Tc,loadShapeLabel:Hc,loadShapeLineOfCircles:gf,loadShapeLineOfRectangleRoundeds:Df,loadShapeLineOfRectangles:Tf,loadShapeLineOfTriangleRoundeds:Hf,loadShapeLineOfTriangles:Yf,loadShapeLine:Wc,loadShapeNull:Qf,loadShapeRectangleRounded:rl,loadShapeRectangle:tl,loadShapeSemicircle:gl,loadShapeTriangleRounded:Sl,loadShapeTriangle:Ol,BAR_VERTEX_COUNT:4,BAR_INDEX_COUNT:2,buildBarClipping:c,buildBarIndex:f,buildBarVertexStepAndColorFill:l,buildBarUv:v,CIRCLE_VERTEX_COUNT:9,CIRCLE_INDEX_COUNT:8,CIRCLE_WORLD_SIZE:Wo,buildCircleClipping:Ko,buildCircleIndex:Yo,buildCircleVertex:Jo,buildCircleStep:Zo,buildCircleUv:qo,buildColor:V,IMAGE_SDF_VERTEX_COUNT:9,IMAGE_SDF_INDEX_COUNT:8,IMAGE_SDF_WORLD_SIZE:Nc,buildImageSdfClipping:Cc,buildImageSdfIndex:Ac,buildImageSdfStep:Rc,buildImageSdfVertex:kc,buildImageSdfUv:Lc,toLineOfAnyPointCount:Zc,buildLineOfAnyColor:qc,toPointsCount:ea,toLinePointCount:ua,toLineVertexCount:sa,toLineIndexCount:ha,buildLineClipping:oa,buildLineIndex:aa,buildLineUv:ca,buildLineVertexStepAndColorFill:fa,buildNullClipping:Xc,buildNullIndex:function(t,n,i,r){for(var e=3*i,u=3*(i+r);e<u;e+=3)t[e+0]=n,t[e+1]=n,t[e+2]=n},buildNullVertex:Kc,buildNullStep:Yc,buildNullUv:Jc,RECTANGLE_ROUNDED_VERTEX_COUNT:jo,RECTANGLE_ROUNDED_INDEX_COUNT:24,RECTANGLE_ROUNDED_WORLD_SIZE:To,buildRectangleRoundedIndex:Io,buildRectangleRoundedVertex:Co,buildRectangleRoundedClipping:Ao,buildRectangleRoundedStep:Ro,buildRectangleRoundedUv:ko,RECTANGLE_VERTEX_COUNT:La,RECTANGLE_INDEX_COUNT:ya,RECTANGLE_WORLD_SIZE:xa,buildRectangleClipping:_a,buildRectangleIndex:Pa,buildRectangleVertex:Fa,buildRectangleStep:Ua,buildRectangleUv:Ha,SEMICIRCLE_VERTEX_COUNT:6,SEMICIRCLE_INDEX_COUNT:4,SEMICIRCLE_WORLD_SIZE:el,buildSemicircleClipping:sl,buildSemicircleIndex:hl,buildSemicircleVertex:ol,buildSemicircleStep:al,buildSemicircleUv:cl,TEXT_VERTEX_COUNT:4,TEXT_INDEX_COUNT:2,TEXT_FMIN:D,toTextBufferCount:M,buildTextClipping:S,buildTextIndex:j,buildTextStep:T,buildTextVertex:I,TRIANGLE_ROUNDED_VERTEX_COUNT:Nf,TRIANGLE_ROUNDED_INDEX_COUNT:15,TRIANGLE_ROUNDED_WORLD_SIZE:If,buildTriangleRoundedIndex:Af,buildTriangleRoundedVertex:Rf,buildTriangleRoundedClipping:kf,buildTriangleRoundedStep:Lf,buildTriangleRoundedUv:yf,TRIANGLE_VERTEX_COUNT:7,TRIANGLE_INDEX_COUNT:3,TRIANGLE_WORLD_SIZE:wa,buildTriangleClipping:Oa,buildTriangleIndex:Da,buildTriangleVertex:Ea,buildTriangleStep:Ma,buildTriangleUv:Sa,BuilderBar:un,BuilderBase:W,BuilderCircle:Qo,BuilderImageSdf:yc,BuilderLabel:Pc,BuilderLineOfAny:Qc,BuilderLineOfCircles:ff,BuilderLineOfRectangleRoundeds:mf,BuilderLineOfRectangles:Ef,BuilderLineOfTriangleRoundeds:xf,BuilderLineOfTriangles:zf,BuilderLine:ma,BuilderMarkerCircleHead:Aa,BuilderMarkerCircleTail:Ra,BuilderMarkerCircle:Ca,BuilderMarkerRectangleHead:Wa,BuilderMarkerRectangleTail:Va,BuilderMarkerRectangle:za,BuilderMarkerTriangleHead:Na,BuilderMarkerTriangleTail:Ia,BuilderMarkerTriangle:Ta,BuilderNull:ka,BuilderRectanglePivoted:uc,BuilderRectangleRounded:Lo,BuilderRectangle:Ec,BuilderSemicircle:fl,BuilderText:sn,BuilderTriangleRounded:Dl,BuilderTriangle:ml,toTransformLocalId:X,toTexture:K,toTextureTransformId:Y,toTextureUvs:J,copyClipping:$c,copyIndex:tf,copyStep:nf,copyUvs:rf,copyVertex:ef,createBarUploaded:hn,createButtonUploaded:xo,createCircleUploaded:$o,createRectanglePivotedUploaded:sc,createGroupUploaded:hc,createImageSdfUploaded:xc,createImageSdf:xv,createImage:function(t){return Oo(t).then((function(t){return new Sc(t)}))},createLabelUploaded:Fc,createLineOfAnyUploaded:lf,createLineOfCirclesUploaded:vf,createLineOfRectangleRoundedsUploaded:wf,createLineOfRectanglesUploaded:Mf,createLineOfTriangleRoundedsUploaded:Bf,createLineOfTrianglesUploaded:Vf,createLineUploaded:Za,createLine:function(t,n,i,r){for(var e=ue(t,[0,0,0,0]),u=.5*(e[2]+e[0]),s=.5*(e[3]+e[1]),h=e[2]-e[0],o=e[3]-e[1],a=[],c=0,f=t.length;c<f;c+=2)a.push(t[c]-u,t[c+1]-s);var l=new zc;return l.stroke.set(!0,void 0,void 0,i),l.transform.position.set(u,s),l.size.set(h,o),l.points.set(a,n,r),l},createNullUploaded:Jf,createRectangleRoundedUploaded:yo,createRectangleUploaded:Mc,createSemicircleUploaded:ll,createTriangleRoundedUploaded:El,createTriangleUploaded:wl,deserializeAll:Fr,deserializeBar:Eo,deserializeBase:Do,deserializeButton:Uo,deserializeCircle:na,deserializeConnectorElbow:$a,deserializeConnectorLine:nc,onDeserializedConnectorLine:ic,deserializeEmbedded:cc,deserializeEmbeddedLayer:Xe,deserializeGradient:wo,deserializeGroupShadowed:Oc,deserializeGroup:gc,deserializeImageSdf:_c,deserializeImage:jc,deserializeLabel:Gc,deserializeLineOfCircles:df,deserializeLineOfRectangleRoundeds:Of,deserializeLineOfRectangles:jf,deserializeLineOfTriangleRoundeds:Gf,deserializeLineOfTriangles:Kf,deserializeLine:Vc,deserializeNull:qf,deserializeRectanglePivoted:nl,deserializeRectangleRounded:il,deserializeRectangle:$f,deserializeSemicircle:dl,deserializeTriangleRounded:Ml,deserializeTriangle:pl,deserialize:Pr,EShapeBarPoints:rt,EShapeBarPosition:it,EShapeBar:en,EShapeBaseHitTestData:Tt,EShapeBase:Rt,EShapeButtonRuntimeActionToggle:Ho,EShapeButtonRuntimeAction:Go,EShapeButtonRuntime:zo,EShapeButton:Fo,EShapeCircle:ta,EShapeConnectorElbowPointsFiller:qa,EShapeConnectorElbow:Qa,EShapeConnectorLine:le,EShapeEmbeddedDatum:Gr,EShapeEmbeddedLayerContainer:Ke,EShapeEmbeddedLayer:xe,EShapeEmbedded:Br,EShapeEmbeddeds:Bv,EShapeFillImpl:$,EShapeGroupFillEditor:lc,EShapeGroupFillViewer:Lr,EShapeGroupPoints:vc,EShapeGroupShadowed:pc,EShapeGroupSizeEditor:Rr,EShapeGroupSizeLayout:Ar,EShapeGroupSizeShadowed:wc,EShapeGroupSizeViewer:kr,EShapeGroupStrokeEditor:bc,EShapeGroupStrokeViewer:yr,EShapeGroupViewer:xr,EShapeGroup:dc,EShapeImageSdf:Bc,EShapeImage:Sc,EShapeLabel:Uc,EShapeLineBaseHitPart:et,EShapeLineBase:rn,EShapeLineOfAnyPointsFillImpl:hf,EShapeLineOfAnyPointsImpl:cf,EShapeLineOfAnyPointsPointImpl:of,EShapeLineOfAnyPointsStrokeImpl:af,EShapeLineOfCircles:bf,EShapeLineOfRectangleRoundeds:pf,EShapeLineOfRectangles:Sf,EShapeLineOfTriangleRoundeds:Uf,EShapeLineOfTriangles:Xf,EShapeLinePoints:ce,EShapeLine:zc,EShapeNull:Zf,EShapePrimitive:Jt,EShapeRectanglePivoted:hu,EShapeRectangleRounded:Po,EShapeRectangle:su,EShapeSemicircle:bl,EShapeStrokeImpl:kt,EShapeTextAlignImpl:Wt,EShapeTextImpl:Yt,EShapeTextOffsetImpl:Xt,EShapeTextOutlineImpl:Kt,EShapeTriangleRounded:Ff,EShapeTriangle:Wf,hitTestBBox:Nt,hitTestCircle:Zt,hitTestSemicircle:vl,hitTestRectangleRounded:_o,hitTestRectangle:Qt,hitTestTriangleRounded:Pf,hitTestTriangleFilled:$t,hitTestTriangle:tn,isStatic:uf,toComputed:sf,toDash:h,toGradientImageUrl:function(t){for(var n=t.direction,i=t.points,r="",e=0,u=i.length;e<u;++e){var s=i[e],h=an.toCode(s.color),o=s.alpha,a=100*s.position;r+='<stop offset="'.concat(a,'%" stop-color="#').concat(h,'" stop-opacity="').concat(o,'" />')}var c=n*Math.PI/180,f=.5*Math.cos(c),l=-.5*Math.sin(c);return _v('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><defs>'+'<linearGradient id="o2glkm3aeu2oio" x1="'.concat(.5-f,'" x2="').concat(.5+f,'" y1="').concat(.5-l,'" y2="').concat(.5+l,'">')+r+'</linearGradient></defs><rect x="0" y="0" width="32" height="32" stroke="none" fill="url(#o2glkm3aeu2oio)" /></svg>')},toGradientSerialized:It,toImageElement:Oo,toLength:O,toResized:function(t,n,i,r,e){var u=Tr.contains(t,Ct.POSITION),s=Tr.contains(t,Ct.WIDTH),h=Tr.contains(t,Ct.HEIGHT);t.disallowUploadedUpdate();var o=t.transform.position;if(r){var a=Math.abs(i.x-n.x),c=Math.abs(i.y-n.y);if(e){var f=Math.max(a,c),l=Ir(f+f),v=Pv(n.x),b=Pv(n.y),d=t.size;s&&h?d.set(l,l):s?d.x=l:h&&(d.y=l),u&&o.set(v,b)}else{var g=Ir(a+a),m=Ir(c+c);v=Pv(n.x),b=Pv(n.y),d=t.size,s&&h?d.set(g,m):s?d.x=g:h&&(d.y=m),u&&o.set(v,b)}}else if(e){a=i.x-n.x,c=i.y-n.y,f=Math.max(Math.abs(a),Math.abs(c));var w=n.x+(a<0?-f:+f),p=n.y+(c<0?-f:+f),O=.5*f;l=Ir(f),v=Pv(Math.min(n.x,w)+O),b=Pv(Math.min(n.y,p)+O),d=t.size,s&&h?d.set(l,l):s?d.x=l:h&&(d.y=l),u&&o.set(v,b)}else{var D=Math.min(n.x,i.x),E=Math.min(n.y,i.y),M=.5*(a=Math.max(n.x,i.x)-D),S=.5*(c=Math.max(n.y,i.y)-E);g=Ir(a),m=Ir(c),v=Pv(D+M),b=Pv(E+S),d=t.size,s&&h?d.set(g,m):s?d.x=g:h&&(d.y=m),u&&o.set(v,b)}t.allowUploadedUpdate()},toScaleInvariant:o,toSizeNormalized:Ir,toSizeRounded:Pv,toThresholdDefault:nn,EShapeAcceptorImpl:Hr,EShapeAcceptorType:zr,EShapeAcceptors:Vr,EShapeBufferUnitBuilder:Ie,EShapeBufferUnit:Ne,EShapeBuffer:Ce,EShapeCapabilities:Tr,EShapeCapability:Ct,EShapeConnectorBodies:tc,EShapeConnectorBodyImpl:fe,EShapeConnectorContainerImpl:ot,EShapeConnectorEdgeAcceptorImpl:Wr,EShapeConnectorEdgeContainerImpl:Kr,EShapeConnectorEdgeImpl:Xr,EShapeConnectors:ve,EShapeContainer:ye,EShapeCopyPart:at,EShapeCorner:ut,EShapeDataImpl:Vt,EShapeDataMapperImpl:Mr,EShapeDataMappingImpl:Gt,EShapeDataScopedImpl:Ht,EShapeDataSystemImpl:zt,EShapeDataValueExtensions:Fv,EShapeDataValueImpl:Ut,EShapeDataValueOrder:xt,EShapeDataValueRangeImpl:yt,EShapeDataValueRangeType:Lt,EShapeDataValueScope:_t,EShapeDataValueState:Pt,EShapeDataValueType:Bt,EShapeDefaults:q,EShapeDeleter:Gv,EShapeDeserializers:n,EShapeOnDeserializeds:i,EShapeEditor:Nr,EShapeLayerState:We,toPointsBoundary:ue,eShapePointsFormatterCurve:ee,EShapePointsMarkerBase:se,EShapePointsMarkerContainerImplNoop:nt,EShapePointsMarkerContainerImpl:ae,EShapePointsMarkerHead:he,EShapePointsMarkerNoop:tt,EShapePointsMarkerTail:oe,EShapePointsMarkerType:Q,EShapePointsStyle:z,EShapePointsStyles:Hv,EShapeRendererIteratorDatum:Re,EShapeRendererIterator:ke,EShapeRenderer:Le,EShapeResourceManagerDeserializationMode:jr,EShapeResourceManagerDeserialization:Sr,EShapeResourceManagerSerialization:zv,EShapeRuntimeImpl:uu,EShapeRuntimeReset:cn,EShapeRuntimes:So,EShapeSearch:Uv,EShapeStateSetImplObservable:St,EShapeState:Mt,EShapeStrokeSide:qt,EShapeStrokeStyle:s,EShapeTextAlignHorizontal:m,EShapeTextAlignVertical:w,EShapeTextDirection:p,EShapeTextWeight:d,EShapeTextStyle:g,EShapeTransformImpl:jt,EShapeTransforms:Cr,EShapeType:r,EShapeUploadedImpl:u,EShapeUploadeds:e,EShapeUuidMappingImpl:_r,ESnapperGrid:Vv,ESnapperResultScale:function(){this.distance=NaN,this.scale=new t.Point},ESnapperResult:Wv,ESnapperTargetValueType:Xv,ESnapperTargetValue:Kv,ESnapperTarget:Yv,ESnapperModifierAnchor:Zv,ESnapper:qv,DThemes:Z,FormatNodeA:zn,FormatNodea:Vn,FormatNodeD:Wn,FormatNoded:Xn,FormatNodee:Yn,FormatNodef:Jn,FormatNodefsi:Zn,FormatNodeg:qn,FormatNodeH:Qn,FormatNodeh:$n,FormatNodeM:ti,FormatNodem:ni,FormatNodemi:ii,FormatNodeP:ri,FormatNodep:ei,FormatNodePadding:ui,FormatNodeParenthesis:si,FormatNodePlus:hi,FormatNodePrecision:Kn,FormatNoderd:mi,FormatNodeRP:oi,FormatNoderp:ai,FormatNodesdt:ci,FormatNodeSpace:fi,FormatNodessi:li,FormatNodeString:vi,FormatNodeY:bi,FormatNodey:di,FormatNodez:gi,FormatNodes:wi,DynamicAtlasItemEmpty:de,DynamicAtlasItemFontAtlas:we,DynamicAtlasItemImage:Te,DynamicAtlasItemText:Qv,DynamicAtlasItemWhite:ge,DynamicAtlasItem:be,DynamicAtlas:me,DynamicFontAtlasCharacterOrigin:Oe,DynamicFontAtlasCharacterType:Ee,DynamicFontAtlasCharacter:De,DynamicFontAtlasFont:$v,DynamicFontAtlas:tb,DynamicFontAtlases:ub,DynamicSDFFontAtlas:Se,DynamicSDFFontAtlases:je,DynamicSDFFontGenerator:Me,isArray:mt,isFunction:wt,isNaN:Sh,isNumber:pt,isObject:sb,isString:Ot,Lazy:hb,NumberFormatterImpl:Ei,NumberFormatters:Mi,toCeilingIndex:ob,toCloned:ab,toEnum:Ai,toIndexOf:Yr,toLabel:cb,toMerged:fb,toPadded:on,toString:function(t){return null!=t?String(t):""},toSvgTexture:function(n,i){return t.Texture.from(_v(n),{resolution:i})},toSvgUrl:_v,UtilAlpha:Cn,UtilSvgAtlasBuilder:lb,UtilAttachAlign:xu,UtilAttach:Bu,UtilCharacterIterator:b,UtilClickOutside:Hu,UtilClipboard:Pl,UtilGestureData:lr,UtilGestureEasingHistory:dr,UtilGestureEasing:gr,UtilGestureMode:fr,UtilGestureModifier:ar,UtilGestureModifiers:cr,UtilGesture:mr,UtilExtract:db,UtilExtractor:vb,UtilFileDownloader:bb,UtilFileAs:gb,UtilFileOpener:mb,UtilFont:Ds,UtilHsv:wb,UtilHtmlElementClipperExImpl:nu,UtilHtmlElementClipperExRectsImpl:iu,UtilHtmlElementWhen:ru,UtilHtmlElement:eu,UtilInputInput:bu,UtilInputNumber:du,UtilInputTextArea:pb,UtilInputText:Mu,UtilInput:vu,UtilKeyboardEvent:nr,UtilName:Ob,UtilOverlay:zu,UtilPointerEvent:ir,UtilRgb:an,UtilRgba:Db,UtilStateBlinker:Eb,UtilTransition:Mb,UtilWheelEvent:Sb,DAlignHorizontal:ts,DAlignVertical:ns,DAlignWith:is,DAnimationBase:br,DAnimationEmpty:jb,DAnimationFadeIn:Tb,DAnimationTimings:vr,DApplicationLayerOptions:Ib,DApplicationLayer:yb,DApplicationPadding:Nb,DApplication:Bb,DApplications:st,DBaseAutoSet:er,DBaseAuto:rr,DBaseBackgroundMeshGeometry:Fi,DBaseBackgroundMesh:Ui,DBaseBackgroundSnippet:Gi,DBaseBackground:Ii,DBaseBorderMeshGeometry:Hi,DBaseBorderMesh:zi,DBaseBorderSnippet:Vi,DBaseBorder:Ri,DBaseCorner:Li,DBaseInteractive:yi,DBaseMeshGeometry:Pi,DBaseOutlineSnippet:Wi,DBaseOutline:xi,DBaseOverflowMaskSimple:vs,DBaseOverflowMask:or,DBasePaddingAdjustable:_b,DBasePadding:Bi,DBasePoint:_i,DBaseReflowableContainer:sr,DBaseReflowableImpl:Xi,DBaseSnippetContainer:ur,DBaseStateSetBlinkerDatumImpl:lt,DBaseStateSetBlinkerImpl:bt,DBaseStateSetImplObservable:Et,DBaseStateSetImpl:Dt,DBaseStateSetSubDatumImp:ft,DBaseStateSetSubImpl:vt,DBaseStateSetTickerDatumImpl:dt,DBaseStateSetTickerImpl:gt,DBaseState:ct,DBase:hr,DBoard:Pb,DBorderMask:Ci,DButtonAmbient:As,DButtonBaseWhen:qu,DButtonBase:js,DButtonCheckRight:Ub,DButtonCheck:Fb,DButtonColorGradient:id,DButtonColor:ed,DButtonDanger:ud,DButtonDate:sd,DButtonDatetime:cd,DButtonFileAs:gb,DButtonFile:fd,DButtonGroup:Bs,DButtonLink:ld,DButtonPrimary:Ns,DButtonRadioRight:bd,DButtonRadio:vd,DButtonRedo:dd,DButtonSecondary:gd,DButtonSelect:ig,DButtonTime:rg,DButtonUndo:eg,DButton:Ts,DCanvasContainer:Dr,DCanvas:ug,DChartAxisBaseBar:hg,DChartAxisBaseGuideContainer:og,DChartAxisBaseOptionParser:cg,DChartAxisBaseTickContainer:dg,DChartAxisBaseTickMajorGridline:fg,DChartAxisBaseTickMajor:lg,DChartAxisBaseTickMinor:vg,DChartAxisBase:gg,DChartAxisContainerImpl:mg,DChartAxisGuideSimpleShapeImpl:wg,DChartAxisGuideSimple:pg,DChartAxisPosition:sg,DChartAxisTickPosition:ag,DChartAxisXDatetime:Dg,DChartAxisX:Og,DChartAxisY:Eg,DChartColorSet1:function(t){return Mg[t%Mg.length]},DChartColorSet2:jg,DChartCoordinateBase:Cg,DChartCoordinateContainerImpl:Rg,DChartCoordinateContainerSubImpl:Ag,DChartCoordinateDirection:Tg,DChartCoordinateLinearTick:kg,DChartCoordinateLinear:Lg,DChartCoordinateLogTick:yg,DChartCoordinateLog:xg,DChartCoordinateTransformImpl:Ng,DChartCoordinateTransformMarkImpl:Ig,DChartLegendItem:Bg,DChartLegend:_g,DChartOverview:Pg,DChartPlotAreaContainer:Fg,DChartPlotAreaImpl:qg,DChartRegionImplObservable:Qg,DChartRegionImpl:bg,DChartSelectionContainerImpl:$g,DChartSelectionGridlineX:nm,DChartSelectionGridlineY:im,DChartSelectionMarker:rm,DChartSelectionShapeBase:tm,DChartSelectionSimple:sm,DChartSelectionSubImpl:um,DChartSelectionPoint:em,DChartSeriesBar:cm,DChartSeriesBaseCoordinateContainer:hm,DChartSeriesBase:om,DChartSeriesContainerImpl:Zg,DChartSeriesFillComputedImpl:Gg,DChartSeriesFillImpl:zg,DChartSeriesLineOfAny:am,DChartSeriesLineOfCircles:fm,DChartSeriesLineOfRectangleRoundeds:lm,DChartSeriesLineOfRectangles:vm,DChartSeriesLineOfTriangleRoundeds:dm,DChartSeriesLineOfTriangles:bm,DChartSeriesLine:gm,DChartSeriesExpressionParametersImpl:mm,DChartSeriesLinear:wm,DChartSeriesPaddingComputedImpl:Vg,DChartSeriesPaddingImpl:Wg,DChartSeriesPointComputedImpl:Xg,DChartSeriesPointImpl:Kg,DChartSeriesScalars:Hg,DChartSeriesStrokeComputedImpl:Yg,DChartSeriesStrokeImpl:Jg,DChartSeriesHitResult:Ug,DChart:pm,DColorGradientObservable:zb,DColorGradientPointObservable:Gb,DCommandBase:Cb,DCommandClear:Ab,DCommandCreate:Om,DCommandSaveAs:Dm,DCommandSave:Em,DContent:kd,DControllerCommandImpl:Rb,DControllerFocusImpl:xb,DControllerKeyboardImpl:kb,DControllers:Lb,DCornerMask:ki,DDiagramBaseControllerOpenType:Er,DDiagramBase:Sm,DDiagramCanvasBase:Am,DDiagramCanvasBaseShapeImpl:Rm,DDiagramCanvasDataImpl:km,DDiagramCanvasEditorBackground:jm,DDiagramCanvasEditorShapeImpl:Lm,DDiagramCanvasEditorSnap:ym,DDiagramCanvasEditor:xm,DDiagramCanvasTileMappingImpl:Nm,DDiagramCanvasTileMappingPointImpl:Tm,DDiagramCanvasShapeImpl:Bm,DDiagramCanvasTickerImpl:Pm,DDiagramCanvasTile:Im,DDiagramCanvas:Wm,DDiagramDataImpl:Zm,DDiagramDataPrivateImpl:Xm,DDiagramDataRemoteImpl:Ym,DDiagramEditorThumbnail:qm,DDiagramEditor:Qm,DDiagramLayerContainer:Cm,DDiagramLayer:ou,DDiagramLayers:Be,DDiagramSerializedVersion:1,DDiagramShape:$m,DDiagramSnapshot:Mm,DDiagramTicker:_m,DDiagram:tw,DDiagrams:Ye,DDialogAlign:xu,DDialogCloseOn:_u,DDialogColorGradient:nd,DDialogColor:rd,DDialogConfirmDelete:rw,DDialogConfirmDiscard:ew,DDialogConfirmMessage:nw,DDialogConfirm:iw,DDialogDate:Nh,DDialogDatetime:Dh,DDialogFittedContent:ih,DDialogFitted:rh,DDialogGestureImpl:Fu,DDialogGestureMode:Pu,DDialogInputBoolean:Us,DDialogInputInteger:Ys,DDialogInputReal:qs,DDialogInputText:th,DDialogInput:xs,DDialogLayeredContent:Zu,DDialogLayeredFooter:Cs,DDialogLayeredHeaderButtonClose:Rs,DDialogLayeredHeaderSeparator:ks,DDialogLayeredHeader:Ls,DDialogLayered:ys,DDialogMessage:uw,DDialogMode:Uu,DDialogProcessingMessage:sw,DDialogProcessing:hw,DDialogSaveAs:ow,DDialogSelectListItemUpdater:Ed,DDialogSelectListItem:pd,DDialogSelectList:Vd,DDialogSelectSearhDismissableImpl:Qd,DDialogSelectSearhImpl:Wd,DDialogSelect:$d,DDialogState:Gu,DDialogTime:Mh,DDialog:Vu,DDropdownBase:fw,DDropdown:lw,DDynamicTextGeometry:ps,DDynamicTextMeasureResultCharacter:bs,DDynamicTextMeasureResult:ds,DDynamicTextMeasure:ws,DDynamicTextStyleWordWrap:gs,DDynamicTextStyle:Os,DDynamicText:Es,DExpandableHeader:vw,DExpandable:bw,DHtmlElementState:tu,DHtmlElement:zs,DImageBaseThemeWrapperSecondary:Qu,DImageBaseThemeWrapperTertiary:$u,DImageBase:Ss,DImagePieceLayouterPartBottom:us,DImagePieceLayouterPartCenter:ss,DImagePieceLayouterPartContainer:fs,DImagePieceLayouterPartLeft:hs,DImagePieceLayouterPartMiddle:os,DImagePieceLayouterPartRight:as,DImagePieceLayouterPartTop:cs,DImagePieceLayouterPart:es,DImagePieceLayouter:ls,DImagePiece:rs,DImage:Tl,DInputAndLabel:Wb,DInputBooleanButtonOff:_s,DInputBooleanButtonOn:Ps,DInputBoolean:Fs,DInputInput:Ws,DInputIntegerAndLabel:dw,DInputInteger:Ks,DInputLabel:Vb,DInputNumber:Xs,DInputRealAndLabel:Xb,DInputReal:Zs,DInputSearch:Xd,DInputTextAndLabel:Kb,DInputTextArea:gw,DInputText:$s,DInput:Vs,DItemUpdater:Od,DLayoutClearType:Ki,DLayoutDirection:Wu,DLayoutHorizontal:Is,DLayoutSpace:Xu,DLayoutVertical:Ju,DLayout:Yu,DLinkMenuItemId:kl,DLinkMenu:yl,DLinkTarget:xl,DLink:Ul,DLinks:Gl,DListDataImpl:Rd,DListDataMappedImpl:Md,DListDataSelectionMultiple:Sd,DListDataSelectionNone:jd,DListDataSelectionSingle:Td,DListDataSelectionType:md,DListItemAccessorImpl:Ad,DListItemAmbient:mw,DListItemUpdater:Dd,DListItem:wd,DList:zd,DMapCoordinateEPSG3857:ww,DMapCoordinates:pw,DMapTilePlane:Dw,DMapTilePyramidImpl:Ew,DMapTileUrlBuilderKokudo:function(t,n,i){return 5<=t?"https://cyberjapandata.gsi.go.jp/xyz/pale/".concat(t,"/").concat(n,"/").concat(i,".png"):2<=t?"https://cyberjapandata.gsi.go.jp/xyz/std/".concat(t,"/").concat(n,"/").concat(i,".png"):"https://cyberjapandata.gsi.go.jp/xyz/earthhillshade/".concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsm:function(t,n,i){return"https://".concat("abc"[(n+i)%3],".tile.openstreetmap.org/").concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsmfj:Mw,DMapTilePyramids:Sw,DMapTile:Ow,DMenuAlign:xu,DMenuBarItem:jw,DMenuBar:Tw,DMenuContext:aw,DMenuItemBase:Nl,DMenuItemCheckIsCompatible:Rl,DMenuItemCheck:Al,DMenuItemExpandableBody:$l,DMenuItemExpandableHeader:tv,DMenuItemExpandableIsCompatible:rv,DMenuItemExpandableItemCheck:ev,DMenuItemExpandableItemLink:uv,DMenuItemExpandableItemMenu:Ev,DMenuItemExpandableItemSeparator:sv,DMenuItemExpandableItemSpace:hv,DMenuItemExpandableItemText:ov,DMenuItemExpandable:iv,DMenuItemExpandables:nv,DMenuItemLinkIsCompatible:zl,DMenuItemLink:Hl,DMenuItemMenuIsCompatible:Wl,DMenuItemMenuToSubMenuOptions:Xl,DMenuItemMenu:Vl,DMenuItemSeparatorReflowable:Kl,DMenuItemSeparatorIsCompatible:Yl,DMenuItemSeparator:Jl,DMenuItemSpaceIsCompatible:ql,DMenuItemSpace:Zl,DMenuItemText:Cl,DMenuItem:Il,DMenuSidedContent:Nw,DMenuSidedItemCheck:cv,DMenuSidedItemExpandableItemCheck:Ov,DMenuSidedItemExpandableItemLink:Dv,DMenuSidedItemExpandableItemMenu:Mv,DMenuSidedItemExpandableItemSeparator:Sv,DMenuSidedItemExpandableItemSpace:jv,DMenuSidedItemExpandableItemText:Tv,DMenuSidedItemExpandable:pv,DMenuSidedItemExpandables:wv,DMenuSidedItemLink:fv,DMenuSidedItemMenu:lv,DMenuSidedItemSeparator:vv,DMenuSidedItemSpace:bv,DMenuSidedItemText:dv,DMenuSidedSelectionType:Iw,DMenuSidedSelection:Aw,DMenuSided:Rw,DMenuSideds:gv,DMenu:cw,DMenus:Ll,DNoteError:kw,DNoteNoItemsFound:Lw,DNoteSearching:yw,DNoteSmallError:Jd,DNoteSmallNoItemsFound:Zd,DNoteSmallSearching:qd,DNoteSmall:Yd,DNote:Kd,DNotification:xw,DPaginationButtonLast:Bw,DPaginationButtonNext:_w,DPaginationButtonPage:Pw,DPaginationButtonPrevious:Fw,DPaginationButtonTop:Uw,DPaginationDots:Gw,DPaginationPage:Hw,DPagination:zw,DPaneScrollBar:Gd,DPane:Hd,DPickerColorAndAlpha:Yb,DPickerColorGradientRecent:Qb,DPickerColorGradientView:$b,DPickerColorGradient:td,DPickerColorRecent:Jb,DPickerColor:Zb,DPickerDate:Th,DPickerDates:hd,DPickerDatetimeButtonBack:eh,DPickerDatetimeButtonDate:uh,DPickerDatetimeButtonNext:sh,DPickerDatetimeLabelDate:ah,DPickerDatetimeLabel:oh,DPickerDatetimeMask:fh,DPickerDatetimeMasks:lh,DPickerDatetimeRange:Vw,DPickerDatetimeSpace:ch,DPickerDatetime:Oh,DPickerDatetimes:ad,DPickerTimeBoundHours:bh,DPickerTimeBoundMinutes:dh,DPickerTimeBoundSeconds:gh,DPickerTimeBound:vh,DPickerTimeBounds:mh,DPickerTimeRange:Ww,DPickerTime:ph,DPickerTimes:od,DScalarExpressionNodeType:Yi,DScalarExpression:Ji,DScalarFunctions:tr,DScrollBarHorizontal:_d,DScrollBarThumbHorizontal:Bd,DScrollBarThumbReflowableHorizontal:xd,DScrollBarThumbReflowableVertical:Pd,DScrollBarThumbVertical:Fd,DScrollBarThumb:yd,DScrollBarVertical:Ud,DScrollBar:Ld,DSelectMultiple:Xw,DSelect:Kw,DShadowImpl:Yw,DSliderHorizontal:np,DSliderLabel:Jw,DSliderThumb:Zw,DSliderTrackHorizontal:tp,DSliderTrackVertical:ip,DSliderTrack:$w,DSliderValue:qw,DSliderVertical:rp,DSlider:Qw,DTableBodyCellActionDialog:sp,DTableBodyCellActionMenu:hp,DTableBodyCellActionPromise:ap,DTableBodyCellButton:fp,DTableBodyCellCheck:vp,DTableBodyCellColor:bp,DTableBodyCellDate:dp,DTableBodyCellDatetime:gp,DTableBodyCellIndex:mp,DTableBodyCellInputInteger:wp,DTableBodyCellInputReal:pp,DTableBodyCellInputText:Op,DTableBodyCellInputTreeInput:Dp,DTableBodyCellInputTreeMarker:Ep,DTableBodyCellInputTree:Sp,toLinkOptions:jp,toUrl:Tp,toChecker:Np,DTableBodyCellLink:Ip,DTableBodyCellSelectDialog:up,DTableBodyCellSelectMenu:Cp,DTableBodyCellSelectMultiple:Ap,DTableBodyCellSelectPromise:op,DTableBodyCellText:cp,DTableBodyCellTime:Rp,DTableBodyCellTree:kp,DTableBodyCells:ep,DTableBodyRow:xp,DTableBody:zp,DTableCategoryCell:Vp,DTableCategory:Wp,DTableColumnType:lp,DTableDataListFilter:Bp,DTableDataListMapped:_p,DTableDataListSelection:Fp,DTableDataListSorter:Gp,DTableDataList:Hp,DTableDataSelectionType:Lp,DTableDataOrder:Up,DTableDataTreeFilter:Xp,DTableDataTreeItemAccessor:Zp,DTableDataTreeSelectionImpl:Qp,DTableDataTreeSorter:$p,DTableDataTree:tO,DTableHeaderCellCheck:nO,DTableHeaderCell:rO,DTableHeader:eO,DTableRow:yp,DTableScrollBar:uO,DTableState:Mp,DTable:MO,DTextBase:Ms,DText:hh,DTreeDataImpl:xO,DTreeDataMappedImpl:RO,DTreeDataSelectionMultiple:kO,DTreeDataSelectionNone:yO,DTreeDataSelectionSingle:LO,DTreeDataSelectionType:AO,DTreeItemButton:PO,DTreeItemNonEditable:FO,DTreeItemState:BO,DTreeItemText:_O,DTreeItemUpdater:UO,DTreeNodeAccessorImpl:CO,DTree:GO,DViewGestureImpl:wr,DViewImpl:Or,DViewTransformImpl:pr};Cv();var zO=window;zO.wcardinal=zO.wcardinal||{},zO.wcardinal.ui=HO}(PIXI);
10
10
  //# sourceMappingURL=wcardinal-ui.min.js.map