atome 0.5.7.0.3 → 0.3191

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of atome might be problematic. Click here for more details.

Files changed (472) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -4
  3. data/README.md +5 -77
  4. data/Rakefile +7 -502
  5. data/app_builder_helpers/Rakefile +235 -0
  6. data/documentation/framework/enhance_atome.md +1 -1
  7. data/documentation/installation/atome_server.md +1 -66
  8. data/documentation/tutorials/tutorials.md +0 -7
  9. data/exe/atome +157 -819
  10. data/lib/atome/atome_native_extensions.rb +3 -0
  11. data/lib/atome/extensions/geolocation.rb +1 -1
  12. data/lib/atome/extensions/ping.rb +11 -10
  13. data/lib/atome/extensions/sha.rb +6 -8
  14. data/lib/atome/kernel/atome_genesis.rb +93 -0
  15. data/lib/atome/kernel/generators/shapes.rb +7 -0
  16. data/lib/atome/kernel/properties/geometry.rb +120 -0
  17. data/lib/atome/kernel/universe.rb +24 -295
  18. data/lib/atome/renderers/headless/headless.rb +0 -0
  19. data/lib/atome/renderers/headless/properties/generator.rb +0 -0
  20. data/lib/atome/renderers/opal/atome_opal_extensions.rb +4 -0
  21. data/lib/{platform_specific → atome/renderers}/opal/extensions/geolocation.rb +1 -1
  22. data/lib/atome/renderers/opal/extensions/ping.rb +13 -0
  23. data/lib/atome/renderers/opal/extensions/sha.rb +11 -0
  24. data/lib/atome/renderers/opal/opal_browser.rb +8 -0
  25. data/lib/{platform_specific → atome/renderers}/opal/opal_parser.rb +0 -1
  26. data/lib/atome/renderers/opal/properties/generator.rb +6 -0
  27. data/lib/atome/renderers/server/server.rb +0 -0
  28. data/lib/atome/version.rb +1 -2
  29. data/lib/atome.rb +16 -35
  30. data/sig/atome.rbs +0 -75
  31. data/vendor/assets/Guardfile +4 -0
  32. data/vendor/assets/Rakefile +2 -12
  33. data/vendor/assets/application/index.rb +2 -7
  34. data/vendor/assets/build/css/style.css +53 -0
  35. data/vendor/assets/build/index.html +24 -0
  36. data/vendor/assets/build/js/application.js +0 -0
  37. data/vendor/assets/build/js/third_parties/interact.min.js +4 -0
  38. data/vendor/assets/build/js/third_parties/popmotion.min.js +1 -0
  39. data/vendor/assets/examples/misc.rb +219 -0
  40. data/vendor/assets/examples/ping.rb +3 -0
  41. data/vendor/assets/examples/storage.rb +9 -0
  42. data/vendor/assets/examples/view_example.rb +21 -0
  43. data/vendor/assets/server/atome_server.rb +96 -33
  44. data/vendor/assets/server/config.ru +3 -8
  45. metadata +69 -512
  46. data/CHANGELOG.md +0 -21
  47. data/atome.gemspec +0 -100
  48. data/documentation/basic.md +0 -241
  49. data/documentation/deep learning/architecture.txt +0 -3763
  50. data/documentation/deep learning/atome.png +0 -0
  51. data/documentation/deep learning/basic_infos.txt +0 -289
  52. data/documentation/deep learning/example_of_users_code.rb +0 -1810
  53. data/documentation/deep learning/misc.txt +0 -24
  54. data/documentation/deep learning/ruby_js_example.rb +0 -272
  55. data/documentation/deep learning/wasm_script_help.text +0 -14
  56. data/documentation/installation/buiding_atome.md +0 -307
  57. data/lib/atome/atome.rb +0 -131
  58. data/lib/atome/extensions/atome.rb +0 -705
  59. data/lib/atome/extensions/mathematics.rb +0 -20
  60. data/lib/atome/genesis/atomes.rb +0 -109
  61. data/lib/atome/genesis/genesis.rb +0 -272
  62. data/lib/atome/genesis/particles/atome.rb +0 -4
  63. data/lib/atome/genesis/particles/communication.rb +0 -43
  64. data/lib/atome/genesis/particles/effect.rb +0 -14
  65. data/lib/atome/genesis/particles/event.rb +0 -344
  66. data/lib/atome/genesis/particles/geometry.rb +0 -31
  67. data/lib/atome/genesis/particles/hierarchy.rb +0 -105
  68. data/lib/atome/genesis/particles/identity.rb +0 -82
  69. data/lib/atome/genesis/particles/material.rb +0 -119
  70. data/lib/atome/genesis/particles/property.rb +0 -147
  71. data/lib/atome/genesis/particles/security.rb +0 -77
  72. data/lib/atome/genesis/particles/spatial.rb +0 -98
  73. data/lib/atome/genesis/particles/time.rb +0 -4
  74. data/lib/atome/genesis/particles/utility.rb +0 -261
  75. data/lib/atome/genesis/presets.rb +0 -10
  76. data/lib/atome/genesis/sparkle.rb +0 -217
  77. data/lib/atome/kernel/black_matter.rb +0 -22
  78. data/lib/atome/presets/atome.rb +0 -79
  79. data/lib/atome/utilities/color_helper/color/cmyk.rb +0 -263
  80. data/lib/atome/utilities/color_helper/color/css.rb +0 -7
  81. data/lib/atome/utilities/color_helper/color/grayscale.rb +0 -197
  82. data/lib/atome/utilities/color_helper/color/hsl.rb +0 -240
  83. data/lib/atome/utilities/color_helper/color/palette/adobecolor.rb +0 -260
  84. data/lib/atome/utilities/color_helper/color/palette/gimp.rb +0 -104
  85. data/lib/atome/utilities/color_helper/color/palette/monocontrast.rb +0 -164
  86. data/lib/atome/utilities/color_helper/color/palette.rb +0 -4
  87. data/lib/atome/utilities/color_helper/color/rgb/colors.rb +0 -167
  88. data/lib/atome/utilities/color_helper/color/rgb/contrast.rb +0 -57
  89. data/lib/atome/utilities/color_helper/color/rgb/metallic.rb +0 -28
  90. data/lib/atome/utilities/color_helper/color/rgb.rb +0 -715
  91. data/lib/atome/utilities/color_helper/color/yiq.rb +0 -62
  92. data/lib/atome/utilities/color_helper/color.rb +0 -415
  93. data/lib/atome/utilities/essentials.rb +0 -70
  94. data/lib/atome/utilities/sanitizer.rb +0 -13
  95. data/lib/atome/utilities/security.rb +0 -71
  96. data/lib/atome/utilities/utilities.rb +0 -656
  97. data/lib/atome_relative.rb +0 -39
  98. data/lib/molecules/_deprecated_examples/site.rb +0 -34
  99. data/lib/molecules/init.rb +0 -31
  100. data/lib/molecules/intuition/_deprecated_inputs.rb +0 -111
  101. data/lib/molecules/intuition/_deprecated_toolbox.rb +0 -282
  102. data/lib/molecules/intuition/utillities.rb +0 -408
  103. data/lib/platform_specific/opal/atome_opal_extensions.rb +0 -11
  104. data/lib/platform_specific/opal/extensions/color.rb +0 -30
  105. data/lib/platform_specific/opal/extensions/js.rb +0 -20
  106. data/lib/platform_specific/opal/extensions/object.rb +0 -6
  107. data/lib/platform_specific/opal/extensions/ping.rb +0 -31
  108. data/lib/platform_specific/opal/extensions/sha.rb +0 -25
  109. data/lib/platform_specific/opal/opal.rb +0 -5
  110. data/lib/platform_specific/wasm/atome_wasm_extensions.rb +0 -11
  111. data/lib/renderers/headless/headless.rb +0 -18
  112. data/lib/renderers/headless/index.rb +0 -6
  113. data/lib/renderers/headless/index_relative.rb +0 -6
  114. data/lib/renderers/headless/utility.rb +0 -6
  115. data/lib/renderers/html/atome.rb +0 -2
  116. data/lib/renderers/html/atome_html.rb +0 -22
  117. data/lib/renderers/html/communication.rb +0 -3
  118. data/lib/renderers/html/effect.rb +0 -51
  119. data/lib/renderers/html/event.rb +0 -59
  120. data/lib/renderers/html/geometry.rb +0 -49
  121. data/lib/renderers/html/hierarchy.rb +0 -248
  122. data/lib/renderers/html/html.rb +0 -1688
  123. data/lib/renderers/html/identity.rb +0 -104
  124. data/lib/renderers/html/index.rb +0 -19
  125. data/lib/renderers/html/index_relative.rb +0 -20
  126. data/lib/renderers/html/material.rb +0 -88
  127. data/lib/renderers/html/property.rb +0 -52
  128. data/lib/renderers/html/security.rb +0 -1
  129. data/lib/renderers/html/spatial.rb +0 -75
  130. data/lib/renderers/html/time.rb +0 -1
  131. data/lib/renderers/html/utility.rb +0 -170
  132. data/lib/renderers/renderer.rb +0 -16
  133. data/lib/renderers/server/index.rb +0 -4
  134. data/lib/renderers/server/index_relative.rb +0 -4
  135. data/lib/renderers/server/utility.rb +0 -4
  136. data/sig/atome_js.rbs +0 -1
  137. data/sig/batch.rbs +0 -7
  138. data/sig/browser_helper.rbs +0 -14
  139. data/sig/essentials.rbs +0 -11
  140. data/sig/genesis.rbs +0 -3
  141. data/sig/global_variables.rbs +0 -1
  142. data/sig/matrix.rbs +0 -5
  143. data/sig/object.rbs +0 -7
  144. data/sig/universe.rbs +0 -3
  145. data/src/utilities/host_mode.rb +0 -5
  146. data/vendor/assets/application/examples/affect.rb +0 -8
  147. data/vendor/assets/application/examples/aid.rb +0 -10
  148. data/vendor/assets/application/examples/allow_copy.rb +0 -13
  149. data/vendor/assets/application/examples/allow_system_right_click.rb +0 -16
  150. data/vendor/assets/application/examples/alternate.rb +0 -36
  151. data/vendor/assets/application/examples/animation.rb +0 -91
  152. data/vendor/assets/application/examples/apply.rb +0 -8
  153. data/vendor/assets/application/examples/atome.rb +0 -5
  154. data/vendor/assets/application/examples/atome_particle_validation.rb +0 -7
  155. data/vendor/assets/application/examples/atome_sparkle_use.rb +0 -6
  156. data/vendor/assets/application/examples/atomizer.rb +0 -86
  157. data/vendor/assets/application/examples/attach.rb +0 -34
  158. data/vendor/assets/application/examples/attached.rb +0 -45
  159. data/vendor/assets/application/examples/b64_to_image.rb +0 -9
  160. data/vendor/assets/application/examples/basic_understanding.rb +0 -54
  161. data/vendor/assets/application/examples/behavior.rb +0 -32
  162. data/vendor/assets/application/examples/blur.rb +0 -26
  163. data/vendor/assets/application/examples/border.rb +0 -75
  164. data/vendor/assets/application/examples/browse.rb +0 -17
  165. data/vendor/assets/application/examples/categories.rb +0 -5
  166. data/vendor/assets/application/examples/category.rb +0 -16
  167. data/vendor/assets/application/examples/center.rb +0 -7
  168. data/vendor/assets/application/examples/clear.rb +0 -96
  169. data/vendor/assets/application/examples/clones&monitoring.rb +0 -105
  170. data/vendor/assets/application/examples/code.rb +0 -13
  171. data/vendor/assets/application/examples/color.rb +0 -54
  172. data/vendor/assets/application/examples/compute.rb +0 -16
  173. data/vendor/assets/application/examples/console.rb +0 -4
  174. data/vendor/assets/application/examples/convert.rb +0 -163
  175. data/vendor/assets/application/examples/copy.rb +0 -25
  176. data/vendor/assets/application/examples/copybck.rb +0 -68
  177. data/vendor/assets/application/examples/css.rb +0 -6
  178. data/vendor/assets/application/examples/database_handling.rb +0 -39
  179. data/vendor/assets/application/examples/debug.rb +0 -78
  180. data/vendor/assets/application/examples/delete.rb +0 -105
  181. data/vendor/assets/application/examples/dig.rb +0 -13
  182. data/vendor/assets/application/examples/display.rb +0 -279
  183. data/vendor/assets/application/examples/display_bck.rb +0 -164
  184. data/vendor/assets/application/examples/drag.rb +0 -54
  185. data/vendor/assets/application/examples/drop.rb +0 -35
  186. data/vendor/assets/application/examples/duplicate.rb +0 -70
  187. data/vendor/assets/application/examples/edit.rb +0 -24
  188. data/vendor/assets/application/examples/encode.rb +0 -6
  189. data/vendor/assets/application/examples/encrypt.rb +0 -6
  190. data/vendor/assets/application/examples/example.rb +0 -27
  191. data/vendor/assets/application/examples/executor.rb +0 -36
  192. data/vendor/assets/application/examples/file.rb +0 -16
  193. data/vendor/assets/application/examples/fill.rb +0 -23
  194. data/vendor/assets/application/examples/find.rb +0 -158
  195. data/vendor/assets/application/examples/fit.rb +0 -26
  196. data/vendor/assets/application/examples/fonts.rb +0 -15
  197. data/vendor/assets/application/examples/generator_and_build.rb +0 -15
  198. data/vendor/assets/application/examples/getter.rb +0 -16
  199. data/vendor/assets/application/examples/grab.rb +0 -14
  200. data/vendor/assets/application/examples/gradient.rb +0 -40
  201. data/vendor/assets/application/examples/group.rb +0 -44
  202. data/vendor/assets/application/examples/help.rb +0 -17
  203. data/vendor/assets/application/examples/hierarchy.rb +0 -21
  204. data/vendor/assets/application/examples/history.rb +0 -32
  205. data/vendor/assets/application/examples/holder.rb +0 -62
  206. data/vendor/assets/application/examples/hypertext.rb +0 -113
  207. data/vendor/assets/application/examples/image.rb +0 -5
  208. data/vendor/assets/application/examples/import.rb +0 -33
  209. data/vendor/assets/application/examples/increment.rb +0 -23
  210. data/vendor/assets/application/examples/infos.rb +0 -10
  211. data/vendor/assets/application/examples/input.rb +0 -34
  212. data/vendor/assets/application/examples/int8.rb +0 -17
  213. data/vendor/assets/application/examples/js&ruby.rb +0 -18
  214. data/vendor/assets/application/examples/keyboard.rb +0 -59
  215. data/vendor/assets/application/examples/layout.rb +0 -38
  216. data/vendor/assets/application/examples/list.rb +0 -72
  217. data/vendor/assets/application/examples/localstorage.rb +0 -19
  218. data/vendor/assets/application/examples/login.rb +0 -84
  219. data/vendor/assets/application/examples/markup.rb +0 -4
  220. data/vendor/assets/application/examples/match.rb +0 -115
  221. data/vendor/assets/application/examples/matrix.rb +0 -118
  222. data/vendor/assets/application/examples/monitor.rb +0 -14
  223. data/vendor/assets/application/examples/on_resize.rb +0 -7
  224. data/vendor/assets/application/examples/on_the_fly_ruby_code_loading.rb +0 -9
  225. data/vendor/assets/application/examples/online.rb +0 -3
  226. data/vendor/assets/application/examples/opacity.rb +0 -9
  227. data/vendor/assets/application/examples/over.rb +0 -29
  228. data/vendor/assets/application/examples/paint.rb +0 -29
  229. data/vendor/assets/application/examples/particles.rb +0 -4
  230. data/vendor/assets/application/examples/percent_to_px.rb +0 -4
  231. data/vendor/assets/application/examples/play.rb +0 -50
  232. data/vendor/assets/application/examples/preset.rb +0 -33
  233. data/vendor/assets/application/examples/random.rb +0 -42
  234. data/vendor/assets/application/examples/raw_html.rb +0 -48
  235. data/vendor/assets/application/examples/read.rb +0 -13
  236. data/vendor/assets/application/examples/recorder.rb +0 -74
  237. data/vendor/assets/application/examples/refresh.rb +0 -62
  238. data/vendor/assets/application/examples/remove.rb +0 -60
  239. data/vendor/assets/application/examples/repeat.rb +0 -26
  240. data/vendor/assets/application/examples/resize.rb +0 -17
  241. data/vendor/assets/application/examples/scroll.rb +0 -11
  242. data/vendor/assets/application/examples/security.rb +0 -76
  243. data/vendor/assets/application/examples/select_text.rb +0 -18
  244. data/vendor/assets/application/examples/selected.rb +0 -35
  245. data/vendor/assets/application/examples/server.rb +0 -24
  246. data/vendor/assets/application/examples/shadow.rb +0 -60
  247. data/vendor/assets/application/examples/shapes.rb +0 -6
  248. data/vendor/assets/application/examples/shortcut.rb +0 -25
  249. data/vendor/assets/application/examples/site.rb +0 -41
  250. data/vendor/assets/application/examples/size.rb +0 -17
  251. data/vendor/assets/application/examples/sliders.rb +0 -17
  252. data/vendor/assets/application/examples/smooth.rb +0 -9
  253. data/vendor/assets/application/examples/style.rb +0 -4
  254. data/vendor/assets/application/examples/sub_atome_manipulation.rb +0 -20
  255. data/vendor/assets/application/examples/svg_img_to_vector.rb +0 -6
  256. data/vendor/assets/application/examples/svg_vectorizer.rb +0 -21
  257. data/vendor/assets/application/examples/sync.rb +0 -38
  258. data/vendor/assets/application/examples/table.rb +0 -76
  259. data/vendor/assets/application/examples/tagged.rb +0 -24
  260. data/vendor/assets/application/examples/terminal.rb +0 -4
  261. data/vendor/assets/application/examples/test.rb +0 -584
  262. data/vendor/assets/application/examples/text.rb +0 -5
  263. data/vendor/assets/application/examples/tick.rb +0 -29
  264. data/vendor/assets/application/examples/tools.rb +0 -666
  265. data/vendor/assets/application/examples/touch.rb +0 -41
  266. data/vendor/assets/application/examples/type_mutation.rb +0 -18
  267. data/vendor/assets/application/examples/unit.rb +0 -14
  268. data/vendor/assets/application/examples/universe.rb +0 -8
  269. data/vendor/assets/application/examples/vector.rb +0 -37
  270. data/vendor/assets/application/examples/video.rb +0 -14
  271. data/vendor/assets/application/examples/wait.rb +0 -6
  272. data/vendor/assets/application/examples/www.rb +0 -10
  273. data/vendor/assets/server/atome_server_wasm.rb +0 -54
  274. data/vendor/assets/server/capture.rb +0 -10
  275. data/vendor/assets/server/database.rb +0 -63
  276. data/vendor/assets/server/eDen.rb +0 -302
  277. data/vendor/assets/server/extensions.rb +0 -13
  278. data/vendor/assets/src/css/style.css +0 -167
  279. data/vendor/assets/src/index.html +0 -45
  280. data/vendor/assets/src/index_opal.html +0 -40
  281. data/vendor/assets/src/index_server.html +0 -38
  282. data/vendor/assets/src/index_server_wasm.html +0 -45
  283. data/vendor/assets/src/index_wasm.html +0 -50
  284. data/vendor/assets/src/js/atome/atome.js +0 -506
  285. data/vendor/assets/src/js/atome/atome_helpers/add_font.js +0 -46
  286. data/vendor/assets/src/js/atome/atome_helpers/atome_animate.js +0 -65
  287. data/vendor/assets/src/js/atome/atome_helpers/atome_drag.js +0 -124
  288. data/vendor/assets/src/js/atome/atome_helpers/atome_drop.js +0 -12
  289. data/vendor/assets/src/js/atome/atome_helpers/atome_events.js +0 -171
  290. data/vendor/assets/src/js/atome/atome_helpers/atome_over.js +0 -43
  291. data/vendor/assets/src/js/atome/atome_helpers/atome_sort.js +0 -20
  292. data/vendor/assets/src/js/atome/atome_helpers/atome_time.js +0 -10
  293. data/vendor/assets/src/js/atome/atome_helpers/atome_video.js +0 -12
  294. data/vendor/assets/src/js/atome/atome_helpers/communication.js +0 -35
  295. data/vendor/assets/src/js/atome/atome_helpers/file.js +0 -12
  296. data/vendor/assets/src/js/atome/specific/opal.js +0 -111
  297. data/vendor/assets/src/js/atome/specific/wasm.js +0 -123
  298. data/vendor/assets/src/js/molecules/web.js +0 -4
  299. data/vendor/assets/src/js/third_parties/browser.script.iife.min.js +0 -13
  300. data/vendor/assets/src/js/third_parties/fabric.min.js +0 -1
  301. data/vendor/assets/src/js/third_parties/html-to-image.min.js +0 -2
  302. data/vendor/assets/src/js/third_parties/interact.min.js +0 -3
  303. data/vendor/assets/src/js/third_parties/jsencrypt.min.js +0 -2
  304. data/vendor/assets/src/js/third_parties/papaparse.min.js +0 -7
  305. data/vendor/assets/src/js/third_parties/popmotion.min.js +0 -1
  306. data/vendor/assets/src/js/third_parties/sortable.min.js +0 -2
  307. data/vendor/assets/src/js/third_parties/three.min.js +0 -6
  308. data/vendor/assets/src/js/third_parties/w3color.js +0 -646
  309. data/vendor/assets/src/js/third_parties/wad.min.js +0 -9
  310. data/vendor/assets/src/js/third_parties/zim.min.js +0 -1
  311. data/vendor/assets/src/medias/audios/audio_missing.wav +0 -0
  312. data/vendor/assets/src/medias/audios/clap.wav +0 -0
  313. data/vendor/assets/src/medias/audios/cowbell.wav +0 -0
  314. data/vendor/assets/src/medias/audios/hihat.wav +0 -0
  315. data/vendor/assets/src/medias/audios/kick.wav +0 -0
  316. data/vendor/assets/src/medias/audios/riff.m4a +0 -0
  317. data/vendor/assets/src/medias/audios/snare.wav +0 -0
  318. data/vendor/assets/src/medias/audios/tom.wav +0 -0
  319. data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +0 -202
  320. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Black.ttf +0 -0
  321. data/vendor/assets/src/medias/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  322. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Bold.ttf +0 -0
  323. data/vendor/assets/src/medias/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  324. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Italic.ttf +0 -0
  325. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Light.ttf +0 -0
  326. data/vendor/assets/src/medias/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  327. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Medium.ttf +0 -0
  328. data/vendor/assets/src/medias/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  329. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Regular.ttf +0 -0
  330. data/vendor/assets/src/medias/fonts/Roboto/Roboto-Thin.ttf +0 -0
  331. data/vendor/assets/src/medias/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  332. data/vendor/assets/src/medias/fonts/Roboto_Slab/LICENSE.txt +0 -202
  333. data/vendor/assets/src/medias/fonts/Roboto_Slab/README.txt +0 -71
  334. data/vendor/assets/src/medias/fonts/Roboto_Slab/RobotoSlab-VariableFont_wght.ttf +0 -0
  335. data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Black.ttf +0 -0
  336. data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Bold.ttf +0 -0
  337. data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-ExtraBold.ttf +0 -0
  338. data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-ExtraLight.ttf +0 -0
  339. data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Light.ttf +0 -0
  340. data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Medium.ttf +0 -0
  341. data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Regular.ttf +0 -0
  342. data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-SemiBold.ttf +0 -0
  343. data/vendor/assets/src/medias/fonts/Roboto_Slab/static/RobotoSlab-Thin.ttf +0 -0
  344. data/vendor/assets/src/medias/images/atome.svg +0 -12
  345. data/vendor/assets/src/medias/images/ballanim.png +0 -0
  346. data/vendor/assets/src/medias/images/blank.png +0 -0
  347. data/vendor/assets/src/medias/images/green_planet.png +0 -0
  348. data/vendor/assets/src/medias/images/icons/Lowpass.svg +0 -8
  349. data/vendor/assets/src/medias/images/icons/activate.svg +0 -3
  350. data/vendor/assets/src/medias/images/icons/audio.svg +0 -7
  351. data/vendor/assets/src/medias/images/icons/band_pass.svg +0 -8
  352. data/vendor/assets/src/medias/images/icons/clear.svg +0 -5
  353. data/vendor/assets/src/medias/images/icons/color.svg +0 -5
  354. data/vendor/assets/src/medias/images/icons/copy.svg +0 -8
  355. data/vendor/assets/src/medias/images/icons/create.svg +0 -3
  356. data/vendor/assets/src/medias/images/icons/delete.svg +0 -8
  357. data/vendor/assets/src/medias/images/icons/edit-.svg +0 -4
  358. data/vendor/assets/src/medias/images/icons/edit.svg +0 -4
  359. data/vendor/assets/src/medias/images/icons/edition.svg +0 -4
  360. data/vendor/assets/src/medias/images/icons/email.svg +0 -13
  361. data/vendor/assets/src/medias/images/icons/equalizer-.svg +0 -5
  362. data/vendor/assets/src/medias/images/icons/equalizer.svg +0 -5
  363. data/vendor/assets/src/medias/images/icons/filter.svg +0 -4
  364. data/vendor/assets/src/medias/images/icons/folder.svg +0 -4
  365. data/vendor/assets/src/medias/images/icons/group.svg +0 -6
  366. data/vendor/assets/src/medias/images/icons/hamburger.svg +0 -8
  367. data/vendor/assets/src/medias/images/icons/high_pass.svg +0 -5
  368. data/vendor/assets/src/medias/images/icons/link.svg +0 -4
  369. data/vendor/assets/src/medias/images/icons/load.svg +0 -4
  370. data/vendor/assets/src/medias/images/icons/low_pass.svg +0 -5
  371. data/vendor/assets/src/medias/images/icons/mail_gray.svg +0 -6
  372. data/vendor/assets/src/medias/images/icons/mail_green.svg +0 -6
  373. data/vendor/assets/src/medias/images/icons/mail_orange.svg +0 -6
  374. data/vendor/assets/src/medias/images/icons/microphone.svg +0 -7
  375. data/vendor/assets/src/medias/images/icons/midi_in.svg +0 -4
  376. data/vendor/assets/src/medias/images/icons/midi_out.svg +0 -4
  377. data/vendor/assets/src/medias/images/icons/modules.svg +0 -11
  378. data/vendor/assets/src/medias/images/icons/paste.svg +0 -4
  379. data/vendor/assets/src/medias/images/icons/pause.svg +0 -5
  380. data/vendor/assets/src/medias/images/icons/play.svg +0 -7
  381. data/vendor/assets/src/medias/images/icons/record.svg +0 -4
  382. data/vendor/assets/src/medias/images/icons/save.svg +0 -5
  383. data/vendor/assets/src/medias/images/icons/select--.svg +0 -4
  384. data/vendor/assets/src/medias/images/icons/select-.svg +0 -5
  385. data/vendor/assets/src/medias/images/icons/select-all.svg +0 -4
  386. data/vendor/assets/src/medias/images/icons/select.svg +0 -4
  387. data/vendor/assets/src/medias/images/icons/settings.svg +0 -5
  388. data/vendor/assets/src/medias/images/icons/settings0.svg +0 -2
  389. data/vendor/assets/src/medias/images/icons/settings1.svg +0 -17
  390. data/vendor/assets/src/medias/images/icons/settings2.svg +0 -25
  391. data/vendor/assets/src/medias/images/icons/settings_old.svg +0 -6
  392. data/vendor/assets/src/medias/images/icons/shape.svg +0 -7
  393. data/vendor/assets/src/medias/images/icons/speaker.svg +0 -6
  394. data/vendor/assets/src/medias/images/icons/stop.svg +0 -4
  395. data/vendor/assets/src/medias/images/icons/tool.svg +0 -7
  396. data/vendor/assets/src/medias/images/icons/tools.svg +0 -9
  397. data/vendor/assets/src/medias/images/icons/undo.svg +0 -4
  398. data/vendor/assets/src/medias/images/icons/undo2.svg +0 -4
  399. data/vendor/assets/src/medias/images/icons/validate.svg +0 -9
  400. data/vendor/assets/src/medias/images/icons/vie.svg +0 -3
  401. data/vendor/assets/src/medias/images/icons/wave-saw.svg +0 -3
  402. data/vendor/assets/src/medias/images/icons/wave-sine.svg +0 -3
  403. data/vendor/assets/src/medias/images/icons/wave-square-.svg +0 -4
  404. data/vendor/assets/src/medias/images/icons/wave-square.svg +0 -3
  405. data/vendor/assets/src/medias/images/icons/wave-triangle.svg +0 -3
  406. data/vendor/assets/src/medias/images/icons/waveform-.svg +0 -4
  407. data/vendor/assets/src/medias/images/icons/waveform.svg +0 -7
  408. data/vendor/assets/src/medias/images/logos/Facebook.svg +0 -8
  409. data/vendor/assets/src/medias/images/logos/GitHub Black.svg +0 -7
  410. data/vendor/assets/src/medias/images/logos/GitHub.svg +0 -7
  411. data/vendor/assets/src/medias/images/logos/LinkedIn-full.svg +0 -109
  412. data/vendor/assets/src/medias/images/logos/LinkedIn.svg +0 -11
  413. data/vendor/assets/src/medias/images/logos/Orange/Facebook.svg +0 -8
  414. data/vendor/assets/src/medias/images/logos/Orange/TikTok.svg +0 -11
  415. data/vendor/assets/src/medias/images/logos/Orange/Twitter.svg +0 -8
  416. data/vendor/assets/src/medias/images/logos/Orange/instagram.svg +0 -8
  417. data/vendor/assets/src/medias/images/logos/Orange/vimeo.svg +0 -8
  418. data/vendor/assets/src/medias/images/logos/Orange/youtube.svg +0 -7
  419. data/vendor/assets/src/medias/images/logos/TikTok.svg +0 -11
  420. data/vendor/assets/src/medias/images/logos/Twitter.svg +0 -35
  421. data/vendor/assets/src/medias/images/logos/X.svg +0 -5
  422. data/vendor/assets/src/medias/images/logos/YouTube.svg +0 -1
  423. data/vendor/assets/src/medias/images/logos/apple.svg +0 -4
  424. data/vendor/assets/src/medias/images/logos/atome.svg +0 -12
  425. data/vendor/assets/src/medias/images/logos/freebsd.png +0 -0
  426. data/vendor/assets/src/medias/images/logos/freebsd.svg +0 -8
  427. data/vendor/assets/src/medias/images/logos/gray/Facebook.svg +0 -8
  428. data/vendor/assets/src/medias/images/logos/gray/TikTok.svg +0 -11
  429. data/vendor/assets/src/medias/images/logos/gray/Twitter.svg +0 -8
  430. data/vendor/assets/src/medias/images/logos/gray/instagram.svg +0 -8
  431. data/vendor/assets/src/medias/images/logos/gray/vimeo.svg +0 -8
  432. data/vendor/assets/src/medias/images/logos/gray/youtube.svg +0 -7
  433. data/vendor/assets/src/medias/images/logos/gray/youtube2.svg +0 -13
  434. data/vendor/assets/src/medias/images/logos/instagram.svg +0 -6
  435. data/vendor/assets/src/medias/images/logos/tiktok_back.svg +0 -1
  436. data/vendor/assets/src/medias/images/logos/vimeo.svg +0 -17
  437. data/vendor/assets/src/medias/images/noise.svg +0 -17
  438. data/vendor/assets/src/medias/images/red_planet.png +0 -0
  439. data/vendor/assets/src/medias/images/tile.png +0 -0
  440. data/vendor/assets/src/medias/texts/lorem.txt +0 -1
  441. data/vendor/assets/src/medias/utils/infos/color.rb +0 -29
  442. data/vendor/assets/src/medias/utils/infos/width.rb +0 -25
  443. data/vendor/assets/src/medias/videos/video_missing.mp4 +0 -0
  444. data/vendor/assets/src-tauri/.gitignore +0 -4
  445. data/vendor/assets/src-tauri/Cargo.toml +0 -27
  446. data/vendor/assets/src-tauri/build.rs +0 -3
  447. data/vendor/assets/src-tauri/icons/128x128.png +0 -0
  448. data/vendor/assets/src-tauri/icons/128x128@2x.png +0 -0
  449. data/vendor/assets/src-tauri/icons/32x32.png +0 -0
  450. data/vendor/assets/src-tauri/icons/Square107x107Logo.png +0 -0
  451. data/vendor/assets/src-tauri/icons/Square142x142Logo.png +0 -0
  452. data/vendor/assets/src-tauri/icons/Square150x150Logo.png +0 -0
  453. data/vendor/assets/src-tauri/icons/Square284x284Logo.png +0 -0
  454. data/vendor/assets/src-tauri/icons/Square30x30Logo.png +0 -0
  455. data/vendor/assets/src-tauri/icons/Square310x310Logo.png +0 -0
  456. data/vendor/assets/src-tauri/icons/Square44x44Logo.png +0 -0
  457. data/vendor/assets/src-tauri/icons/Square71x71Logo.png +0 -0
  458. data/vendor/assets/src-tauri/icons/Square89x89Logo.png +0 -0
  459. data/vendor/assets/src-tauri/icons/StoreLogo.png +0 -0
  460. data/vendor/assets/src-tauri/icons/icon.icns +0 -0
  461. data/vendor/assets/src-tauri/icons/icon.ico +0 -0
  462. data/vendor/assets/src-tauri/icons/icon.png +0 -0
  463. data/vendor/assets/src-tauri/src/main.rs +0 -71
  464. data/vendor/assets/src-tauri/tauri.conf.json +0 -70
  465. data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_arm +0 -0
  466. data/vendor/assets/src-wasm/wasm/wasi-vfs-osx_x86 +0 -0
  467. data/vendor/assets/src-wasm/wasm/wasi-vfs-unix +0 -0
  468. data/vendor/assets/src-wasm/wasm/wasi-vfs.exe +0 -0
  469. /data/vendor/assets/{src → build}/favicon.ico +0 -0
  470. /data/vendor/assets/{src/js/third_parties → build/js}/ping.min.js +0 -0
  471. /data/vendor/assets/{src → build}/js/third_parties/interact.min.js.map +0 -0
  472. /data/vendor/assets/{src → build}/js/third_parties/sha256.min.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";var z_i,WW=window||{},createjs=WW.createjs,zns=WW.zns,zon=null==WW.zon||WW.zon,zog=zon?console.log.bind(console):function(){},zogStyle=" border:thin solid black; color: black",zogg=zon?console.log.bind(console,"%c Z ","background: #acd241;"+zogStyle):function(){},zogp=zon?console.log.bind(console,"%c Z ","background: #e472c4;"+zogStyle):function(){},zogb=zon?console.log.bind(console,"%c Z ","background: #50c4b7;"+zogStyle):function(){},zogr=zon?console.log.bind(console,"%c Z ","background: #fb4758;"+zogStyle):function(){},zogy=zon?console.log.bind(console,"%c Z ","background: #ebcb35;"+zogStyle):function(){},zogo=zon?console.log.bind(console,"%c Z ","background: #f58e25;"+zogStyle):function(){},zogl=zon?console.log.bind(console,"%c Z ","background: #eeeeee;"+zogStyle):function(){},zogd=zon?console.log.bind(console,"%c Z ","background: #444444; border:thin solid black; color: white"):function(){};function zid(e){return z_d("1"),document.getElementById(e)}function zss(e){if(z_d("2"),document.getElementById(e))return document.getElementById(e).style;zon&&zogy("zss(): id not found")}function zgo(e,t,o,n,r,i){if(z_d("3"),!(zot(t)&&""!=t||"_self"==t)){var a="";return o&&(a+="width="+o+","),n&&(a+="height="+n+","),r&&(a+="fullscreen=yes,"),i&&(a+="modal=yes,alwaysRaised=yes"),WW.open(e,t,a)}WW.location.href=e}function zum(e){if(z_d("4"),!zot(e))return Number(String(e).replace(/[^\d.-]/g,""))}function zot(e){return null==e}function zop(e){z_d("5"),zot(e)||(e.stopImmediatePropagation&&e.stopImmediatePropagation(),WW.event&&(WW.event.cancelBubble=!0))}function zil(){z_d("6");var e=function(e){e||(e=event),e.keyCode&&e.keyCode>=32&&e.keyCode<=40&&e.preventDefault()},t=function(e){e||(e=event),e.preventDefault()},o=t;return WW.addEventListener("keydown",e,{passive:!1}),WW.addEventListener("wheel",t,{passive:!1}),WW.addEventListener("DOMMouseScroll",o,{passive:!1}),[e,t,o]}function zet(e){return z_d("6.1"),new function(){var t=this;this.on=function(o,n){if(!(zot(e)||zot(o)||zot(n)))for(var r=t.tags,i=0;i<r.length;i++)r[i].addEventListener(o,n)},this.off=function(o,n){if(!(zot(e)||zot(o)||zot(n)))for(var r=t.tags,i=0;i<r.length;i++)r[i].removeEventListener(o,n)},Object.defineProperty(t,"tags",{get:function(){return zot(e)?[]:"string"==typeof e||e instanceof String?document.querySelectorAll(e):"string"==typeof e.innerHTML?[e]:[]},set:function(){}}),this.css=function(e,o){for(var n=t.tags,r=0;r<n.length;r++)if(1==arguments.length&&arguments[0].constructor==={}.constructor)for(var i in e)n[r].style[i]=e[i];else{if(1==arguments.length)return t.tags[0].style[e];n[r].style[e]=o}},this.prop=function(e,o){if(!zot(e)){for(var n=t.tags,r=[],i=0;i<n.length;i++)if(zot(o))if(e.constructor==={}.constructor)for(var a in e)n[i][a]=e[a];else r.push(n[i][e]);else n[i][e]=o;return zot(o)?r:void 0}}}}function isDUO(e){return 1==e.length&&null!=e[0]&&e[0].constructor==={}.constructor}function zob(e,t,o,n){var r=zim&&(zim.ZIMONON||ZIMONON);if(isDUO(t)){z_d("7");var i,a=t[0];for(var l in a)(i=l.match(/^(.+)gColor$/))&&(a[i[1]+"ackgroundColor"]=a[l],delete a[l]);var s,c,u,d=zot(o)?e.toString().split(/\n/,1)[0].match(/\((.*)\)/)[1].replace(/\s+/g,"").split(","):o.replace(/\s+/g,"").split(","),h=[];for(s=0;s<d.length;s++)c=d[s].split("=")[0],d[s]=c,h.push(a[c]);for(s in a)d.indexOf(s)<0&&zon&&zogy(e,"bad argument "+s);return!(u=Object.prototype.isPrototypeOf.call(e.prototype,n)?new(e.bind.apply(e,[null].concat(h))):e.apply(null,h))||(r&&!u.arguments&&(u.arguments=[a]),u)}r&&n&&t&&zot(n.arguments)&&(n.arguments=Array.prototype.slice.call(t))}function zik(e){if(z_d("7.5"),z_d("17.6"),!zot(e))return zim.Pick.choose(e)}var ignore,zta=console.table&&zon?console.table.bind(console):function(){},zor=function(){for(var e=0;e<arguments.length;e++)if(!zot(arguments[e]))return arguments[e]},zim=function(e){function t(t,n,r,i,a){e.timeCheck||(z_d("9.99"),e.timeCheck=!0);var l=zot(WW.TIME)?zot(e.TIME)?"seconds":e.TIME:WW.TIME;return l&&l.toLowerCase&&(l=l.toLowerCase()),"milliseconds"!=l&&"ms"!=l&&(l="seconds"),n&&n.toLowerCase&&(n=n.toLowerCase()),"ms"!=n&&"milliseconds"!=n&&"seconds"!=n&&"s"!=n||(l=n),zot(t)?l.charAt(0):("ms"==l&&(l="milliseconds"),"s"==l&&(l="seconds"),l=l.charAt(0),a||o(t,l,r,i),l)}function o(t,o,n,r){zot(n)&&(n=10),zot(r)&&(r=9),(e.TIMECHECK||WW.TIMECHECK)&&("m"!=o&&t>n||"m"==o&&t<r)&&zon&&zogy("TIME - warning: time is in "+("m"==o?"milliseconds":"seconds")+" ("+t+")")}if(e.chop=function(t,o,n,r,i,a){if(z_d("7.8"),!zot(t)){zot(o)&&(o=3),zot(n)&&(n=3),zot(r)&&(r=!0),zot(i)&&(i=0),zot(a)&&(a=1),t.uncache&&(t=t.cache({scale:a}).cacheCanvas);var l=t.width/o,s=t.height/n,c=i,u=[];return e.loop(n,(function(n){e.loop(o,(function(o){var r=new e.Bitmap(t,l+2*c,s+2*c,o*l-c,n*s-c);0!=i?(r.setBounds(c,c,l,s),r.regX=c,r.regY=c):r.setBounds(c,c,l,s),u.push(r)}))})),r?new e.Tile(u,o,n,0,0,!0):u}},e.shuffle=function(e){if(z_d("8"),!zot(e)){var t,o,n=e.length;if(0==n)return e;for(;--n;)t=Math.floor(Math.random()*(n+1)),o=e[n],e[n]=e[t],e[t]=o;return e}},e.pluck=function(e,t){if(z_d("9.26"),zot(e)||!Array.isArray(e)||0==e.length)return null;var o=Math.floor(Math.random()*e.length),n=e[o];return t&&e.splice(o,1),n},e.rand=function(e,t,o,n){return z_d("9"),zot(e)&&zot(t)?Math.random():((zot(e)||isNaN(e))&&(e=0),(zot(t)||isNaN(t))&&(t=0),e%1==0&&t%1==0||(o=!1),zot(o)&&(o=!0),n&&Math.random()>.5&&(e*=-1,t*=-1),o&&(e>t?e++:t>e&&t++),0==e&&0==t?0:(r=0==t?Math.random()*e:Math.min(e,t)+Math.random()*(Math.max(e,t)-Math.min(e,t)),o?Math.floor(r):r));var r},e.seedRandom=function(e){return z_d("9.01"),function(e,t,o,n,r,i,a,l,s){function c(e){var t,o=e.length,r=this,i=0,a=r.i=r.j=0,l=r.S=[];for(o||(e=[o++]);n>i;)l[i]=i++;for(i=0;n>i;i++)l[i]=l[a=y&a+e[i%o]+(t=l[i])],l[a]=t;(r.g=function(e){for(var t,o=0,i=r.i,a=r.j,l=r.S;e--;)t=l[i=y&i+1],o=o*n+l[y&(l[i]=l[a=y&a+t])+(l[a]=t)];return r.i=i,r.j=a,o})(n)}function u(e,t){var o,n=[],r=typeof e;if(t&&"object"==r)for(o in e)try{n.push(u(e[o],t-1))}catch(e){}return n.length?n:"string"==r?e:e+"\0"}function d(e,t){for(var o,n=e+"",r=0;r<n.length;)t[y&r]=y&(o^=19*t[y&r])+n.charCodeAt(r++);return g(t)}function h(o){try{return p?g(p.randomBytes(n)):(e.crypto.getRandomValues(o=new Uint8Array(n)),g(o))}catch(n){return[+new Date,e,(o=e.navigator)&&o.plugins,e.screen,g(t)]}}function g(e){return String.fromCharCode.apply(0,e)}var p,f=o.pow(n,6),m=o.pow(2,52),z=2*m,y=255,v=o["seed"+s]=function(e,r,i){var a=[],l=d(u((r=1==r?{entropy:!0}:r||{}).entropy?[e,g(t)]:null==e?h():e,3),a),p=new c(a);return d(g(p.S),t),(r.pass||i||function(e,t,n){return n?(o[s]=e,t):e})((function(){for(var e=p.g(6),t=f,o=0;m>e;)e=(e+o)*n,t*=n,o=p.g(1);for(;e>=z;)e/=2,t/=2,o>>>=1;return(e+o)/t}),l,"global"in r?r.global:this==o)};if(d(o[s](),t),a&&a.exports){a.exports=v;try{p=require("crypto")}catch(e){}}else l&&l.amd&&l((function(){return v}))}(this,[],Math,256,0,0,"object"==typeof module&&module,"function"==typeof define&&define,"random"),Math.seedrandom(e),e},e.odds=function(e){return z_d("9.1"),(zot(e)||isNaN(e))&&(e=50),Math.random()<=e/100},e.rarity=function(t,o,n,r){if(z_d("9.2"),zot(t)||t.constructor!={}.constructor)return[];zot(o)&&(o=!0),zot(n)&&(n=!0),zot(r)&&(r=!1);var i=[];return e.loop(t,(function(t,o){var n,a=e.colors.indexOf(t);-1!=a&&(t=e.colorsHex[a]),Array.isArray(o)?((t=+t==+t?new Number(t):new String(t))._payload=o[1],t.dynamicPayload=r,Object.defineProperty(t,"payload",{get:function(){return this.dynamicPayload||null==this._lastPayload?(this._lastPayload=e.Pick.choose(this._payload),this._lastPayload):this._lastPayload},set:function(e){this._lastPayload=null,this._payload=e}}),n=o[0],e.loop(n,(function(){i.push(t)}))):(n=o,e.loop(n,(function(){+t==+t&&(t=+t),i.push(t)})))})),o&&e.shuffle(i),i},e.repeats=function(t,o){if(z_d("9.25"),zot(t)||!Array.isArray(t))return 0;var n={},r=0,i=0;return e.loop(t,(function(e){null!=n[e]?(n[e]++,i++):n[e]=0,n[e]>r&&(r=n[e])})),o?i:r},e.series=function(){var t,o;if(z_d("13.61"),0==arguments.length)return function(){};1==arguments.length&&Array.isArray(arguments[0])?t=arguments[0]:1==arguments.length&&arguments[0].constructor=={}.constructor?(zot((o=arguments[0]).min)&&(o.min=0),zot(o.max)&&(o.max=1),zot(o.step)&&(o.step=1),t=[],e.loop(Math.floor(Math.abs(o.max-o.min)+o.step),(function(e){t.push(e+o.min)}),null,o.step),o=null):t=Array.prototype.slice.call(arguments);var n,r=0,i=1,a=1,l=0,s=0,c=!1,u=!1,d=!1,h=!1,g=!1,p=function(o,p){if(l&&s%l!=0)return s++,n;s++;var f,m=t.length;if((h||g)&&r%m==0&&e.shuffle(t),f=t[(10*m+r)%m],0==r&&f,g&&r%m==0&&m>1)for(;f==n;)e.shuffle(t),f=t[(10*m+r)%m];return c?i>0&&r+i*a>=m?(i=-1,r=m-1-(r+a-(m-1))):i<0&&r+i*a<0?(i=1,r=a-r):r+=i*a:u?i>0&&r+i*a>=m?(i=-1,r=m-1-(r+a-(m-1))+a):i<0&&r+i*a<0?(i=1,r=a-r-a):r+=i*a:d?i>0&&r+i*a>=m?r=m-1:i<0&&r+i*a<0?r=0:r+=i*a:r+=i*a,n=f,e.isPick(f)?f.noPick&&p?f:e.Pick.choose(f):f},f=p.original=e.copy(t);return p.array=t,p.type="series",Object.defineProperty(p,"index",{get:function(){var e=t.length;return(10*e+r)%e},set:function(e){r=e}}),Object.defineProperty(p,"length",{get:function(){return t.length},set:function(){}}),p.jump=function(e){return r=e,p},p.reverse=function(e){return zot(e)&&(e=!0),i=e?-1:1,r=t.length-1,p},p.bounce=function(e){zot(e)&&(e=!0);var o=t.length;return r=(10*o+r)%o,c=e,p},p.flip=function(e){zot(e)&&(e=!0);var o=t.length;return r=(10*o+r)%o,u=e,p},p.step=function(e){return zot(e)&&(e=1),a=Math.floor(e),p},p.every=function(e){return zot(e)&&(e=1),l=Math.abs(e),s=0,p},p.constrain=function(e){return zot(e)&&(e=!0),d=e,p},p.random=function(e){return zot(e)&&(e=!0),e||(t=f),h=1==e,p},p.mix=function(e){return zot(e)&&(e=!0),e||(t=f),g=1==e,p},p.shuffle=function(o){return zot(o)&&(o=!0),o?e.shuffle(t):t=f,p},p},e.makeSeries=function(e){if(z_d("13.6"),zot(e))return function(){};var t=0,o=function(){return e[t++%e.length]};return o.array=e,o},e.loop=function(t,o,n,r,i,a){var l,s="obj, call, reverse, step, start, end";if(l=zob(e.loop,arguments,s))return l;if(z_d("9.5"),!zot(t)&&!zot(o)){zot(n)&&(n=!1),(zot(r)||r<=0)&&(r=1),t.constructor===Number&&(t=Number(t)),t.constructor===String&&(t=String(t));var c="number"==typeof t?"number":t.constructor===Array?"array":t.constructor==={}.constructor?"object":"string"==typeof t?"string":t instanceof NodeList?"nodelist":t instanceof HTMLCollection?"htmlcollection":"invalid";if("invalid"!=c){var u,d,h,g;if("number"==c||"string"==c||"array"==c||"nodelist"==c||"htmlcollection"==c){if(0==(d=f((u="number"==c?t:t.length)-1)))return!0;if(n){for(h=i;h>=a;h-=r)if(void 0!==(g="number"==c?o(h,d,i,a,t):o("array"==c||"string"==c?t[h]:t.item(h),h,d,i,a,t)))return g}else for(h=i;h<=a;h+=r)if(void 0!==(g="number"==c?o(h,d,i,a,t):o("array"==c||"string"==c?t[h]:t.item(h),h,d,i,a,t)))return g;return!0}if("object"==c){u=0;var p=[];for(h in t)u++,p.push(h);if(0==(d=f(u-1)))return;if(n){for(h=i;h>=a;h-=r)if(void 0!==(g=o(p[h],t[p[h]],h,d,i,a,t)))return g}else for(h=i;h<=a;h+=r)if(void 0!==(g=o(p[h],t[p[h]],h,d,i,a,t)))return g;return!0}}}function f(e){return zot(i)&&(i=n?e:0),zot(a)&&(a=n?0:e),n&&a>i||!n&&i>a||(i<0&&a)<0||i>e&&a>e?0:(i=Math.max(0,Math.min(i,e)),a=Math.max(0,Math.min(a,e)),Math.floor((n?i-a:a-i)/r)+1)}},e.timeout=function(o,n,r,i){var a,l="time, call, pauseOnBlur, timeUnit";if(a=zob(e.timeout,arguments,l,this))return a;if(z_d("9.7"),!zot(n)&&"function"==typeof n){var s=t(o,i);zot(o)&&(o="s"==s?1:1e3),o=e.Pick.choose(o);var c={startTime:Date.now(),time:0,paused:!1,done:!1,timeUnit:i};r&&(zot(e.blurCheck)&&e.setBlurDetect(),e.pauseOnBlur.push(c));var u=c.startTime;return c.pause=function(e,t,o){zot(e)&&(e=!0),e?cancelAnimationFrame(c.rid):(t?u=0:o?(u=Date.now(),c.time=0):u=Date.now(),d()),c.paused=e},c.clear=function(){for(var e in c&&cancelAnimationFrame(c.rid),c)delete c[e];c.pause=function(){},c.clear=function(){}},d(),c}function d(){var e=Date.now();if(c.time+=(e-u)/("s"==s?1e3:1),u=e,c.time>=o)return c.done=!0,n(c),void c.clear();c.rid=requestAnimationFrame(d)}},e.interval=function(o,n,r,i,a,l){var s,c="time, call, total, immediate, pauseOnBlur, timeUnit";if(s=zob(e.interval,arguments,c,this))return s;if(z_d("9.8"),!zot(n)&&"function"==typeof n){var u=t(o,l);if(zot(o)&&(o="s"==u?1:1e3),zot(i)&&(i=!1),zot(r)||!(isNaN(r)||r<=0)){zot(r)&&(r=-1);var d,h={count:0,total:r,paused:!1,time:o,active:!0,timeUnit:l};return a&&(zot(e.blurCheck)&&e.setBlurDetect(),e.pauseOnBlur.push(h)),i&&setTimeout((function(){n(h),p()}),10),h.pause=function(e,t,o){zot(e)&&(e=!0),e?(clearTimeout(d),clearTimeout(h.id),cancelAnimationFrame(h.rid),h.pauseTimeLeft=h.interval-(Date.now()-h.startTime)/("s"==u?1e3:1)):(h.paused||h.pause(!0),d=setTimeout((function(){h.count++,n(h),g(),p()}),t?0:(o?h.interval:h.pauseTimeLeft)*("s"==u?1e3:1)),h.pauseTimeLeft=null),h.paused=e},h.clear=function(){h.active=!1,clearTimeout(d),cancelAnimationFrame(h.rid),clearTimeout(h.id);var e=h.count;for(var t in h)delete h[t];h.active=!1,h.count=e,h.pause=function(){},h.clear=function(){}},g(),h}}function g(){h.startTime=Date.now(),h.interval=e.Pick.choose(h.time),h.id=setTimeout((function(){h.paused||h.active&&(h.count++,n(h),g(),p())}),h.interval*("s"==u?1e3:1))}function p(){-1!=r&&h.count>=(i?h.total-1:h.total)&&h.clear()}},e.async=function(o,n,r,i,a){if(z_d("29"),!zot(o)){var l,s,c,u,d=document.createElement("script"),h=t(i);zot(i)&&(i="s"==h?2:2e3),n?(l=r||n.toString().split(/\n/,1)[0].match(/^function\s?([^\s(]*)/)[1],e.asyncList||(e.asyncList={}),e.asyncList[l]||(e.asyncList[l]=[]),e.asyncList[l].push(n),e.async[l]=(s=d,c=!1,u=setTimeout((function(){c=a,"function"==typeof n&&n("asyncError",a?"cancelled":"timeout")}),i*("s"==h?1e3:1)),function(t){clearTimeout(u),e.asyncList[l]&&(n=e.asyncList[l].shift()),"function"!=typeof n||c||n(t),s&&s.parentNode.removeChild(s),s=null})):(e.async.z_s&&e.async.z_s.parentNode&&e.async.z_s.parentNode.removeChild(e.async.z_s),e.async.z_s=d),o.match(/\?/)||(o+="?"),d.setAttribute("src",o+"&r="+Math.random()),document.getElementsByTagName("head")[0].appendChild(d)}},e.couple=function(t){if(z_d("29.2"),!e.isJSON(t))return t;var o=JSON.parse(t),n={};for(var r in o){var i=o[r];for(var a in i)n[r+"_"+a]=i[a]}return JSON.stringify(n)},e.decouple=function(t){if(z_d("29.3"),!e.isJSON(t))return t;var o=JSON.parse(t),n={};for(var r in o){var i=r.split("_",2);if(2!=i.length)return t;n[i[0]]||(n[i[0]]={}),n[i[0]][i[1]]=o[r]}return JSON.stringify(n)},e.convertColor=function(t,o,n){if(e.convertColorCheck||(z_d("27.5"),e.convertColorCheck=!0),zot(o)&&(o="hex"),!zot(t)&&t.toLowerCase){t=(t=zik(t)).toLowerCase();var r,i,a,l,s,c=["black","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],u=["000000","f0f8ff","faebd7","00ffff","7fffd4","f0ffff","f5f5dc","ffe4c4","ffebcd","0000ff","8a2be2","a52a2a","deb887","5f9ea0","7fff00","d2691e","ff7f50","6495ed","fff8dc","dc143c","00ffff","00008b","008b8b","b8860b","a9a9a9","a9a9a9","006400","bdb76b","8b008b","556b2f","ff8c00","9932cc","8b0000","e9967a","8fbc8f","483d8b","2f4f4f","2f4f4f","00ced1","9400d3","ff1493","00bfff","696969","696969","1e90ff","b22222","fffaf0","228b22","ff00ff","dcdcdc","f8f8ff","ffd700","daa520","808080","808080","008000","adff2f","f0fff0","ff69b4","cd5c5c","4b0082","fffff0","f0e68c","e6e6fa","fff0f5","7cfc00","fffacd","add8e6","f08080","e0ffff","fafad2","d3d3d3","d3d3d3","90ee90","ffb6c1","ffa07a","20b2aa","87cefa","778899","778899","b0c4de","ffffe0","00ff00","32cd32","faf0e6","ff00ff","800000","66cdaa","0000cd","ba55d3","9370db","3cb371","7b68ee","00fa9a","48d1cc","c71585","191970","f5fffa","ffe4e1","ffe4b5","ffdead","000080","fdf5e6","808000","6b8e23","ffa500","ff4500","da70d6","eee8aa","98fb98","afeeee","db7093","ffefd5","ffdab9","cd853f","ffc0cb","dda0dd","b0e0e6","800080","663399","ff0000","bc8f8f","4169e1","8b4513","fa8072","f4a460","2e8b57","fff5ee","a0522d","c0c0c0","87ceeb","6a5acd","708090","708090","fffafa","00ff7f","4682b4","d2b48c","008080","d8bfd8","ff6347","40e0d0","ee82ee","f5deb3","ffffff","f5f5f5","ffff00","9acd32"];if("zim"==(o=o.toLowerCase()))return e.colorsHex.indexOf(t)<0?t:e.colors[e.colorsHex.indexOf(t)];if(r=t.match(/rgba\((.*)\)/)){var d=(i=r[1].split(",")).pop();if(zot(n)&&(n=d),"array"==o)return i.push(d),i;if(t="rgb("+i.join(",")+")","rgb"==o)return t;if("hsl"==o)return p(i[0],i[1],i[2])}if(zot(n)&&(n=1),r=t.match(/rgb\((.*)\)/))return"rgba"==o?"rgba("+r[1]+","+n+")":"hex"==o?(a=1!=n?","+n:"","#"+(l=f(r[1]+a))[0]+l[1]+l[2]+l[3]):"hexnumber"==o?(a=1!=n?","+n:0,l=f(r[1]+a),parseInt(l[0]+""+l[1]+l[2],16)):"string"==o?(t=f(r[1]).join("").toLowerCase(),-1==(s=u.indexOf(t))?"#"+t:c[s]):"array"==o?(a=1!=n?","+n:0,f(r[1]+a)):"hsl"==o?p((i=r[1].split(","))[0],i[1],i[2]):t;if("hsl"==o)return e.convertColor(e.convertColor(t,"rgb"),"hsl");if("array"==o||"rgb"==o||"rgba"==o)return"#"==t.charAt(0)?m(t):m(e.convertColor(t));if("hex"==o){if("#"==t.charAt(0)){if(1!=n){if(a=g(Math.round(255*n)),4==t.length||5==t.length){var h=t.split("");return h[1]=h[1]+""+h[1],h[2]=h[2]+""+h[2],h[3]=h[3]+""+h[3],h[4]=a,h.join("")}return 9==t.length?t.substring(0,c.length-2)+a:t+a}return t}}else if("hexnumber"==o){if("#"==t.charAt(0))return parseInt(t.replace(/^#/,""),16)}else"#"==t.charAt(0)&&3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));return"string"==o?-1==(s=u.indexOf(t))?"#"+t:c[s]:"hexnumber"==o?parseInt(u[-1!=c.indexOf(t.toLowerCase())?c.indexOf(t):0],16):(a=1!=n?g(Math.round(255*n)):"","#"+u[-1!=c.indexOf(t.toLowerCase())?c.indexOf(t):0]+a)}function g(e){var t=Number(e).toString(16);return t.length<2&&(t="0"+t),t}function p(e,t,o){e/=255,t/=255,o/=255;const n=Math.max(e,t,o),r=n-Math.min(e,t,o),i=r?n===e?(t-o)/r:n===t?2+(o-e)/r:4+(e-t)/r:0;return[60*i<0?60*i+360:60*i,100*(r?n<=.5?r/(2*n-r):r/(2-(2*n-r)):0),100*(2*n-r)/2]}function f(e){var t=e.split(","),o=g(t[0]),n=g(t[1]),r=g(t[2]),i=zot(i)?"":g(Math.round(255*Number(t[3])));return[o,n,r,i]}function m(e){var t;return/^#([A-Fa-f0-9]{3}){1,2}$/.test(e)?(3==(t=e.substring(1).split("")).length&&(t=[t[0],t[0],t[1],t[1],t[2],t[2]]),t="0x"+t.join(""),"rgb"==o?"rgb("+[t>>16&255,t>>8&255,255&t]+")":"array"==o?[t>>16&255,t>>8&255,255&t,n]:"rgba("+[t>>16&255,t>>8&255,255&t].join(",")+","+n+")"):/^#([A-Fa-f0-9]{4}){1,2}$/.test(e)?(8==(t=e.substring(1).split("")).length&&(n=t.slice(-2).join(""),t=t.slice(0,6)),4==t.length&&(n=t[3]+""+t[3],t=[t[0],t[0],t[1],t[1],t[2],t[2]]),n=parseInt(n,16)/255,t="0x"+t.join(""),"rgb"==o?"rgb("+[t>>16&255,t>>8&255,255&t]+")":"rgba("+[t>>16&255,t>>8&255,255&t].join(",")+","+n+")"):"rgb"==o?"rgb(0,0,0)":"rgba(0,0,0,1)"}},e.colorRange=function(t,o,n){e.colorRangeCheck||(z_d("27.6"),e.colorRangeCheck=!0),zot(n)&&(n=.5),n=Math.max(0,Math.min(1,n)),zot(t)&&(t="white"),zot(o)&&(o="black");var r,i=e.convertColor(t,"rgb"),a=e.convertColor(o,"rgb");t=i.substring(4,i.length-1).split(","),o=a.substring(4,a.length-1).split(",");for(var l,s="#",c=0;c<t.length;c++)r=o[c]-t[c],(l=Math.floor(parseInt(t[c],10)+r*n).toString(16)).length<2&&(l="0"+l),s+=l;return s},e.lighten=function(t,o){return e.lightenCheck||(z_d("27.65"),e.lightenCheck=!0),zot(o)&&(o=.5),o>=0?e.colorRange(String(t),"#FFFFFF",o):e.colorRange(String(t),"#000000",-o)},e.darken=function(t,o){return zot(o)&&(o=.5),e.darkenCheck||(z_d("27.66"),e.darkenCheck=!0),o>=0?e.colorRange(String(t),"#000000",o):e.colorRange(String(t),"#ffffff",-o)},e.toColor=function(t,o,n){return e.toColorCheck||(z_d("27.67"),e.toColorCheck=!0),zot(n)&&(n=.5),e.colorRange(String(t),o,n)},e.toAlpha=function(t,o){return e.toAlphaCheck||(z_d("27.68"),e.toAlphaCheck=!0),zot(o)&&(o=.5),e.convertColor(String(t),"rgba",o)},e.zimEase=function(t,o,n,r,i){z_d("27.69");var a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w=!1;if(zot(i)&&(i=!0),t){if(Array.isArray(t[1])){w=!0,b=t[1],t=t[0];var C=b[0],x=b[1],k=b[2],T=b[3],A=5*(C-0),P=10*(x-0)-4*A,B=10*(k-0)+30*(C-x),E=5*(T+0)-20*(k+C)+30*x,I=1-E-B-P-A}0,a=t[0],l=t[1],s=t[2],c=t[3],1,p=1-(g=5*(c+0)-20*(s+a)+30*l)-(h=10*(s-0)+30*(a-l))-(d=10*(l-0)-4*(u=5*(a-0)))-u}else o?(p=o[0],g=o[1],h=o[2],d=o[3],a=(u=o[4])/5,l=(d+4*u)/10,s=(h+6*u+3*d)/10,c=(g+4*u+3*d+2*h)/5):(p=0,g=0,h=0,d=0,u=1);return n?(v={reverse:y=function(){return e.zimEase(null,[p,g,h,d,u],!0)},points:[a,l,s,c],polynomials:[p,g,h,d,u]}).noPick=function(e){if(i){if(e<.025)return 0;if(e>.975)return 1}return e<.5?(f=100*(e*=2),m=(f/=100)*f,(p*(z=m*f)*m+g*m*m+h*z+d*m+u*f)/2):(f=100*(e=1-2*(e-.5)),m=(f/=100)*f,1-(p*(z=m*f)*m+g*m*m+h*z+d*m+u*f)/2)}:w?(v={reverse:y=function(){return zon&&zogy("zimEase - multi array points cannot be reversed"),e.zimEase(null,[p,g,h,d,u])},points:[[a,l,s,c],[C,x,k,T]],polynomials:[[p,g,h,d,u],[I,E,B,P,A]]}).noPick=function(e){if(i){if(e<.025)return 0;if(e>.975)return 1}return e<.5?(f=100*(e*=2),m=(f/=100)*f,(p*(z=m*f)*m+g*m*m+h*z+d*m+u*f)/2):(f=100*(e=2*(e-.5)),m=(f/=100)*f,.5+(I*(z=m*f)*m+E*m*m+B*z+P*m+A*f)/2)}:(v={reverse:y=function(){return e.zimEase(null,[p,g,h,d,u],null,!0)},points:[a,l,s,c],polynomials:[p,g,h,d,u]}).noPick=r?function(e){if(i){if(e<.025)return 0;if(e>.975)return 1}return f=100-100*e,m=(f/=100)*f,1-(p*(z=m*f)*m+g*m*m+h*z+d*m+u*f)}:function(e){if(i){if(e<.025)return 0;if(e>.975)return 1}return f=100*e,m=(f/=100)*f,p*(z=m*f)*m+g*m*m+h*z+d*m+u*f},v.noPick.reverse=y,v},e.spline=function(e,t,o,n,r){var i;z_d("27.695"),zot(e)&&(e=[]),zot(t)&&(t=1),zot(o)&&(o=!1),zot(r)&&(r=o),e=function(e,t){if(!Array.isArray(e[0]))for(i=0;i<e.length;i++)e[i]=[e[i].x,e[i].y];if(t){var o=e[e.length-1],n=e[e.length-2],r=e[0],a=e[1];e.unshift(o),e.unshift(n),e.push(r),e.push(a)}var l=[];for(i=0;i<e.length;i++)l.push(e[i][0],e[i][1]);return l}(e,o);var a=e.length,l=a-4,s=o?e[2]:e[0],c=o?e[3]:e[1],u="M"+[s,c];n&&n.mt(s,c);var d=o?a-4:a-2;for(i=o?2:0;i<d;i+=2){var h=i?e[i-2]:e[0],g=i?e[i-1]:e[1],p=e[i+0],f=e[i+1],m=e[i+2],z=e[i+3],y=p+(m-h)/6*t,v=f+(z-g)/6*t,b=m-((i!==l?e[i+4]:m)-p)/6*t,w=z-((i!==l?e[i+5]:z)-f)/6*t;u+="C"+[y,v,b,w,m,z],n&&n.bt(y,v,b,w,m,z)}if(r){var C=u.split("C");C.pop(),u=C.join("C")}return u},e.pointAlongCurve=function(t,o,n,r){if(z_d("27.7"),t&&t[0]&&t[1]&&t[2]&&t[3]){zot(r)&&(r=!1);var i,a,l,s,c,u,d=new e.Bezier(t[0],t[1],t[2],t[3]);if(r?(i=d.mx(o),a=d.my(o)):(i=d.x(o),a=d.y(o)),n){var h=o-.05,g=o+.05;return h<0&&(h=0),g>1&&(g=1),r?(l=d.mx(h),s=d.my(h),c=d.mx(g),u=d.my(g)):(l=d.x(h),s=d.y(h),c=d.x(g),u=d.y(g)),{x:i,y:a,angle:e.angle(l,s,c,u)}}return{x:i,y:a}}},e.distanceAlongCurve=function(t){return z_d("27.8"),(e.dist(t[0],t[3])+(e.dist(t[0],t[1])+e.dist(t[1],t[2])+e.dist(t[2],t[3])))/2},e.closestPointAlongCurve=function(t,o,n,r,i){z_d("27.9");var a,l=1e7,s=0,c=0;return zot(n)&&(n=10),e.loop(o,(function(o,r){var i=new e.Bezier(o[0],o[1],o[2],o[3]);e.loop(n,(function(o,n){var u={x:i.x(o/n),y:i.y(o/n)},d=e.dist(t,u);d<l&&(l=d,a=u,s=r,c=o)}))})),i?(s*n+c)/(o.length*n)*100:r?a:s},e.transformPoints=function(t,o,n,r,i){if(z_d("27.95"),!zot(t)&&Array.isArray(t)){zot(r)&&(r=0),zot(i)&&(i=0),t=e.copy(t);var a,l=r,s=i;"rotation"==o&&(0!=r&&(t=e.transformPoints(t,"x",-l)),0!=i&&(t=e.transformPoints(t,"y",-s)));for(var c=0;c<t.length;c++)if(a=t[c],Array.isArray(a))if("x"==o)a[0]+=n;else if("y"==o)a[1]+=n;else if("scaleX"==o)a[0]=(a[0]-r)*n+r,a[4]=a[4]*n,a[6]=a[6]*n;else if("scaleY"==o)a[1]=(a[1]-i)*n+i,a[5]=a[5]*n,a[7]=a[7]*n;else if("scale"==o)a[0]=(a[0]-r)*n+r,a[4]=a[4]*n,a[6]=a[6]*n,a[1]=(a[1]-i)*n+i,a[5]=a[5]*n,a[7]=a[7]*n;else if("rotation"==o){var u=n*Math.PI/180,d=a[0],h=a[1];a[0]=d*Math.cos(u)-h*Math.sin(u),a[1]=h*Math.cos(u)+d*Math.sin(u),d=a[4],h=a[5],a[4]=d*Math.cos(u)-h*Math.sin(u),a[5]=h*Math.cos(u)+d*Math.sin(u),d=a[6],h=a[7],a[6]=d*Math.cos(u)-h*Math.sin(u),a[7]=h*Math.cos(u)+d*Math.sin(u)}return"rotation"==o&&(0!=r&&(t=e.transformPoints(t,"x",l)),0!=i&&(t=e.transformPoints(t,"y",s))),t}},e.trimPointEnds=function(e){z_d("27.97"),e[0][4]=0,e[0][5]=0,e[0][8]="free",e[e.length-1][6]=0,e[e.length-1][7]=0,e[e.length-1][8]="free"},e.reversePoints=function(t){return z_d("27.975"),t.reverse(),e.loop(t,(function(e){var t=e[6];e[6]=e[4],e[4]=t;var o=e[7];e[7]=e[5],e[5]=o})),t},e.appendPoints=function(e,t,o){return z_d("27.98"),zot(e)&&zot(t)?[]:zot(e)?t:zot(t)?e:(e[e.length-1][6]=t[0][6],e[e.length-1][7]=t[0][7],o&&(e[e.length-1][8]=o),t.shift(),e=e.concat(t))},e.prependPoints=function(e,t,o){return z_d("27.985"),zot(e)&&zot(t)?[]:zot(e)?t:zot(t)?e:(t[t.length-1][6]=e[0][6],t[t.length-1][7]=e[0][7],o&&(e[e.length-1][8]=o),e.shift(),e=t.concat(e))},e.splitPoints=function(t,o,n){if(z_d("27.99"),!(zot(t)||(zot(o)&&(o=Math.floor(t.length/2)),o<0||o>t.length-1))){zot(n)&&(n=!0);var r=e.copy(t.slice(0,o+1)),i=e.copy(t.slice(o));return n&&(e.trimPointEnds(r),e.trimPointEnds(i)),[r,i]}},e.makeID=function(e,t,o){var n;z_d("13.5"),zot(e)&&(e="mixed"),zot(t)&&(t=5),zot(o)&&(o="uppercase");var r=[2,3,4,5,6,7,8,9],i="abcdefghjkmnpqrstuvwxyz".split("");n=e.constructor===Array?e:"numbers"==e?r:"letters"==e?i:r.concat(i);for(var a,l,s="",c=0;c<t;c++)a=n[Math.floor(Math.random()*n.length)],l=Math.random(),"uppercase"==o||"mixed"==o&&l>.5?a.toUpperCase&&(a=a.toUpperCase()):a.toLowerCase&&(a=a.toLowerCase()),s+=String(a);return s},e.makeSyllable=function(t,o){z_d("13.55");var n="bcdfghjklmnprstvwxz",r="aeiouaeiouaeiouy";zot(t)&&(t=3),zot(o)&&(o=e.rand()<.3);var i="",a=o?r:n;return e.loop(t,(function(){var t,o;i+=(t=a,o=e.rand(t.length-1),t.substring(o,o+1)),a=a==r?n:r})),i},e.makePrimitive=function(t){return z_d("13.56"),function t(o){return Array.isArray(o)?(e.loop(o,(function(e){e=t(e)})),o):o.constructor==={}.constructor?(e.loop(o,(function(e,n){o[e]=t(n)})),o):o instanceof String?String(o):o instanceof Number?Number(o):o instanceof Boolean?Boolean(o):o}(t)},e.makeMath=function(){z_d("13.565");for(var e=Object.getOwnPropertyNames(Math),t=0;t<e.length;t++)W[e[t]]=Math[e[t]]},e.swapProperties=function(e,t,o){if(z_d("17.1"),zot(t)||zot(o)||zot(t[e])||zot(o[e]))return!1;var n=o[e];return o[e]=t[e],t[e]=n,!0},e.mobile=function(t){return z_d("28"),zot(WW.MOBILE)||"default"==WW.MOBILE?zot(e.MOBILE)||"default"==e.MOBILE?(zot(t)&&(t=!0),/ip(hone|od|ad)/i.test(navigator.userAgent)?"ios":/android|nexus/i.test(navigator.userAgent)?"android":/blackberry/i.test(navigator.userAgent)?"blackberry":/nokia|phone|mobile/i.test(navigator.userAgent)?"windows":/opera mini|webos/i.test(navigator.userAgent)?"other":!(!t||void 0===WW.orientation)&&(!/safari/i.test(navigator.userAgent)||"ios")):e.MOBILE:WW.MOBILE},e.vee=function(e){return z_d("28.5"),!zot(e)&&("Pick"==e.type||Array.isArray(e)||e.constructor=={}.constructor&&(!zot(e.max)||!zot(e.noPick))||"function"==typeof e)},e.extend=function(t,o,n,r,i){var a,l="subclass, superclass, override, prefix, prototype";if(a=zob(e.extend,arguments,l))return a;if(!zot(t)&&!zot(o)){zot(r)&&(r="super"),zot(n)&&(n=[]),Array.isArray(n)||(n=[n]),zot(i)&&(i=!0);var s={};for(var c in t.prototype)Object.defineProperty(s,c,Object.getOwnPropertyDescriptor(t.prototype,c));for(c in p.prototype=o.prototype,t.prototype=new p,s)Object.defineProperty(t.prototype,c,Object.getOwnPropertyDescriptor(s,c));var u=t.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(u)||u.__proto__;if(d){var h;u[(r+="_")+"constructor"]=d.constructor;for(var g=0;g<n.length;g++)"function"==typeof d[h=n[g]]&&(u[r+h]=d[h]);if(i)for(h in d)Object.prototype.hasOwnProperty.call(u,h)&&"function"==typeof d[h]&&(u[r+h]=d[h])}return t}function p(){this.constructor=t}zon&&t!=e.StageGL&&zogy("zim.extend() - please supply a class and its superclass")},e.copy=function(t,o,n){if(e.copyCheck||(z_d("10"),e.copyCheck=!0),zot(o)&&(o=!1),zot(n)&&(n=!0),null==t||!(t instanceof Array||t.constructor=={}.constructor))return o&&null!=t&&t.clone&&t.type&&("Container"!=t.type&&"Stage"!=t.type&&"StageGL"!=t.type||n)?t.clone():t;if(t instanceof Array){for(var r=[],i=0;i<t.length;i++)r[i]=e.copy(t[i],o,n);return r}if(t.constructor=={}.constructor){var a={};for(var l in t){var s=e.copy(t[l],o,n);Object.prototype.hasOwnProperty.call(t,l)&&(a[l]=s)}return a}},e.merge=function(){e.mergeCheck||(z_d("12"),e.mergeCheck=!0);var t,o,n={};for(t=0;t<arguments.length;t++)for(o in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],o)&&(n[o]=arguments[t][o]);return n},e.arraysEqual=function(t,o,n){if(z_d("11"),zot(t)||zot(o))return!1;if(zot(n)&&(n=!0),t.length!=o.length)return!1;for(var r=0;r<t.length;r++)if(t[r]instanceof Array&&o[r]instanceof Array){if(!e.arraysEqual(t[r],o[r],n))return!1}else{if(n&&t[r]!=o[r])return!1;if(!n)return e.arraysEqual(t.sort(),o.sort(),!0)}return!0},e.arrayMinMax=function(e){if(z_d("11.2"),!Array.isArray(e))return{min:null,max:null};for(var t=e[0],o=e[0],n=e.length;n--;)t=e[n]<t?e[n]:t,o=e[n]>o?e[n]:o;return{min:t=isNaN(t)?null:t,max:o=isNaN(o)?null:o}},e.isEmpty=function(t){if(e.zimEmptyCheck||(z_d("11.5"),e.zimEmptyCheck=!0),!zot(t)){var o=0;for(var n in t){o++;break}return 0==o}},e.isJSON=function(e){if(z_d("11.6"),"string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){return!1}},e.isPick=function(t){if(e.zimPickCheck||(z_d("11.7"),e.zimPickCheck=!0),!zot(t))return Array.isArray(t)||t.constructor=={}.constructor&&(null!=t.min&&null!=t.max||t.noPick)||t.constructor===Function&&(null!=t.array||null!=t())},e.zut=function(e){if(zot(e)||"object"==typeof e)return!0},e.decimals=function(t,o,n,r,i,a,l){if(e.zimDecimalCheck||(z_d("13"),e.zimDecimalCheck=!0),zot(t))return 0;zot(o)&&(o=1),zot(n)&&(n=0),zot(r)&&(r=1),zot(i)&&(i=!0),zot(a)&&(a=!1);var s=Math.round(t*Math.pow(10,o))/Math.pow(10,o);if(a){var c=s-Math.floor(s);s=e.decimals(Math.floor(s)+60*c/100,2)}var u,d,h,g=e.sign(s);if(n>0)for(u=String(s).indexOf("."),d=String(s).length,u<0&&(u=d++,s+="."),h=0;h<n-(d-u-1);h++)s+="0";if(r>1){-1==g&&(s=s.substr(1,s.length-1)),u=String(s).indexOf("."),d=String(s).length;var p=u<0?d:u;for(h=0;h<r-p;h++)s="0"+s;-1==g&&(s="-"+s)}return 0==r&&(s=s.toString().replace(/^0\./,".")),n+r>0&&!i&&0==Number(s)&&(s=0),a&&(s=String(s).replace(".",":")),e.zut(l)?s:null},e.countDecimals=function(t){return e.zimCountDecimalsCheck||(z_d("13.05"),e.zimCountDecimalsCheck=!0),t%1?t.toString().split(".")[1].length:0},e.sign=function(t){return e.zimSignCheck||(z_d("13.1"),e.zimSignCheck=!0),t?t<0?-1:1:0},e.constrain=function(e,t,o,n){if(z_d("13.2"),!zot(e)){if(zot(t)&&(t=0),zot(o)&&(o=Number.MAX_VALUE),o<t)o=t,t=t;return zot(n)&&(n=!1),n&&e<0?Math.max(-o,Math.min(e,-t)):Math.max(t,Math.min(e,o))}},e.dist=function(t,o,n,r){if(e.zimDistCheck||(z_d("13.3"),e.zimDistCheck=!0),!zot(t)&&!zot(o))return zot(t.x)||zot(o.x)?(zot(n)&&(n=0),zot(r)&&(r=0)):(r=o.y,n=o.x,o=t.y,t=t.x),Math.sqrt(Math.pow(n-t,2)+Math.pow(r-o,2))},e.rectIntersect=function(t,o,n){return e.zimRectIntersectCheck||(z_d("13.32"),e.zimRectIntersectCheck=!0),zot(n)&&(n=0),!(t.x>=o.x+o.width+n||t.x+t.width+n<=o.x||t.y>=o.y+o.height+n||t.y+t.height+n<=o.y)},e.boundsAroundPoints=function(t){e.zimBoundsAroundPointsCheck||(z_d("13.34"),e.zimBoundsAroundPointsCheck=!0);for(var o=1e4,n=1e4,r=-1e4,i=-1e4,a=0;a<t.length;a++){var l=t[a];l.x<o&&(o=l.x),l.x>r&&(r=l.x),l.y<n&&(n=l.y),l.y>i&&(i=l.y)}return{x:o,y:n,width:r-o,height:i-n}},e.angle=function(t,o,n,r){if(e.angleCheck||(z_d("13.4"),e.angleCheck=!0),!zot(t)&&!zot(o))return zot(n)&&(n=t,t=0),zot(r)&&(r=o,o=0),(180*Math.atan2(r-o,n-t)/Math.PI+360)%360},e.TAU=2*Math.PI,e.DEG=180/Math.PI,e.RAD=Math.PI/180,e.PHI=.5*Math.pow(5,.5)+.5,e.smoothStep=function(t,o,n){z_d("13.7");var r=e.constrain((t-o)/(n-o),0,1);return r*r*r*(r*(6*r-15)+10)},e.unicodeToUTF=function(e){if(z_d("13.75"),e){" "!=e&&(e=e.replace(/^\s+/g,""));var t,o="",n="";return o=t=e.charCodeAt(0),(n=e.charCodeAt(1))>=56320&&n<=57343&&(t=1024*(o-55296)+(n-56320)+65536),o=o.toString(16),n=n.toString(16),t=t.toString(16),"\\u"+o+"\\u"+n}},e.capitalizeFirst=function(e){return z_d("13.78"),e.charAt(0).toUpperCase()+e.slice(1)},e.Ajax=function(t,o,n,r){z_d("13.8");var i=new XMLHttpRequest;this.master=t,this.couple=o,this.lock=n,this.unique=r;var a=this;this.get=function(o,r){var l=zot(a.master)?"":"&master="+encodeURI(t),s=zot(a.lock)?"":"&lock="+encodeURI(n),c=a.unique?"&unique=true":"";i.open("GET",o+l+s+c,!0),i.onload=function(){200==i.status?r(e.isJSON(i.responseText)?JSON.parse(i.responseText):i.responseText):r(null,"Error: "+i.status)},i.send()},this.post=function(t,o,n,r,l){var s,c="url, data, command, extra, callback";if(s=zob(a.post,arguments,c))return s;if(!zot(t)){i.open("POST",t,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.onload=function(){var t=i.responseText;e.isJSON(t)&&(a.couple&&(t=e.decouple(t)),t=JSON.parse(t)),l(t)},e.isJSON(o)||(o=JSON.stringify(o)),a.couple&&(o=e.couple(o));var u=zot(a.master)?"":"&master="+encodeURIComponent(a.master),d=zot(a.lock)?"":"&lock="+encodeURIComponent(a.lock),h=zot(n)?"":"&command="+encodeURIComponent(n),g=zot(r)?"":"&extra="+encodeURIComponent(r);i.send("data="+encodeURIComponent(o)+u+d+h+g)}},this.put=function(t,o,n){i.open("PUT",t,!0),i.setRequestHeader("Content-type","application/json"),i.onload=function(){n(e.isJSON(i.responseText)?JSON.parse(i.responseText):a.http.responseText)},i.send(JSON.stringify(o))}},e.Noise=function(e){z_d("13.9"),zot(e)&&(e=1e6*Math.random());var t=e;this.seed=e;var o=this,n={};function r(e){var t=new Uint32Array(1);return t[0]=1664525*e[0]+1013904223,t}function i(e,t,o){this.dx=-t-e*n.SQUISH_2D,this.dy=-o-e*n.SQUISH_2D,this.xsb=t,this.ysb=o}function a(e,t,o,r){this.dx=-t-e*n.SQUISH_3D,this.dy=-o-e*n.SQUISH_3D,this.dz=-r-e*n.SQUISH_3D,this.xsb=t,this.ysb=o,this.zsb=r}function l(e,t,o,r,i){this.dx=-t-e*n.SQUISH_4D,this.dy=-o-e*n.SQUISH_4D,this.dz=-r-e*n.SQUISH_4D,this.dw=-i-e*n.SQUISH_4D,this.xsb=t,this.ysb=o,this.zsb=r,this.wsb=i}n.NORM_2D=1/47,n.NORM_3D=1/103,n.NORM_4D=1/30,n.SQUISH_2D=(Math.sqrt(3)-1)/2,n.SQUISH_3D=(Math.sqrt(4)-1)/3,n.SQUISH_4D=(Math.sqrt(5)-1)/4,n.STRETCH_2D=(1/Math.sqrt(3)-1)/2,n.STRETCH_3D=(1/Math.sqrt(4)-1)/3,n.STRETCH_4D=(1/Math.sqrt(5)-1)/4,n.base2D=[[1,1,0,1,0,1,0,0,0],[1,1,0,1,0,1,2,1,1]],n.base3D=[[0,0,0,0,1,1,0,0,1,0,1,0,1,0,0,1],[2,1,1,0,2,1,0,1,2,0,1,1,3,1,1,1],[1,1,0,0,1,0,1,0,1,0,0,1,2,1,1,0,2,1,0,1,2,0,1,1]],n.base4D=[[0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,0,1],[3,1,1,1,0,3,1,1,0,1,3,1,0,1,1,3,0,1,1,1,4,1,1,1,1],[1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,0,1,2,1,1,0,0,2,1,0,1,0,2,1,0,0,1,2,0,1,1,0,2,0,1,0,1,2,0,0,1,1],[3,1,1,1,0,3,1,1,0,1,3,1,0,1,1,3,0,1,1,1,2,1,1,0,0,2,1,0,1,0,2,1,0,0,1,2,0,1,1,0,2,0,1,0,1,2,0,0,1,1]],n.gradients2D=[5,2,2,5,-5,2,-2,5,5,-2,2,-5,-5,-2,-2,-5],n.gradients3D=[-11,4,4,-4,11,4,-4,4,11,11,4,4,4,11,4,4,4,11,-11,-4,4,-4,-11,4,-4,-4,11,11,-4,4,4,-11,4,4,-4,11,-11,4,-4,-4,11,-4,-4,4,-11,11,4,-4,4,11,-4,4,4,-11,-11,-4,-4,-4,-11,-4,-4,-4,-11,11,-4,-4,4,-11,-4,4,-4,-11],n.gradients4D=[3,1,1,1,1,3,1,1,1,1,3,1,1,1,1,3,-3,1,1,1,-1,3,1,1,-1,1,3,1,-1,1,1,3,3,-1,1,1,1,-3,1,1,1,-1,3,1,1,-1,1,3,-3,-1,1,1,-1,-3,1,1,-1,-1,3,1,-1,-1,1,3,3,1,-1,1,1,3,-1,1,1,1,-3,1,1,1,-1,3,-3,1,-1,1,-1,3,-1,1,-1,1,-3,1,-1,1,-1,3,3,-1,-1,1,1,-3,-1,1,1,-1,-3,1,1,-1,-1,3,-3,-1,-1,1,-1,-3,-1,1,-1,-1,-3,1,-1,-1,-1,3,3,1,1,-1,1,3,1,-1,1,1,3,-1,1,1,1,-3,-3,1,1,-1,-1,3,1,-1,-1,1,3,-1,-1,1,1,-3,3,-1,1,-1,1,-3,1,-1,1,-1,3,-1,1,-1,1,-3,-3,-1,1,-1,-1,-3,1,-1,-1,-1,3,-1,-1,-1,1,-3,3,1,-1,-1,1,3,-1,-1,1,1,-3,-1,1,1,-1,-3,-3,1,-1,-1,-1,3,-1,-1,-1,1,-3,-1,-1,1,-1,-3,3,-1,-1,-1,1,-3,-1,-1,1,-1,-3,-1,1,-1,-1,-3,-3,-1,-1,-1,-1,-3,-1,-1,-1,-1,-3,-1,-1,-1,-1,-3],n.lookupPairs2D=[0,1,1,0,4,1,17,0,20,2,21,2,22,5,23,5,26,4,39,3,42,4,43,3],n.lookupPairs3D=[0,2,1,1,2,2,5,1,6,0,7,0,32,2,34,2,129,1,133,1,160,5,161,5,518,0,519,0,546,4,550,4,645,3,647,3,672,5,673,5,674,4,677,3,678,4,679,3,680,13,681,13,682,12,685,14,686,12,687,14,712,20,714,18,809,21,813,23,840,20,841,21,1198,19,1199,22,1226,18,1230,19,1325,23,1327,22,1352,15,1353,17,1354,15,1357,17,1358,16,1359,16,1360,11,1361,10,1362,11,1365,10,1366,9,1367,9,1392,11,1394,11,1489,10,1493,10,1520,8,1521,8,1878,9,1879,9,1906,7,1910,7,2005,6,2007,6,2032,8,2033,8,2034,7,2037,6,2038,7,2039,6],n.lookupPairs4D=[0,3,1,2,2,3,5,2,6,1,7,1,8,3,9,2,10,3,13,2,16,3,18,3,22,1,23,1,24,3,26,3,33,2,37,2,38,1,39,1,41,2,45,2,54,1,55,1,56,0,57,0,58,0,59,0,60,0,61,0,62,0,63,0,256,3,258,3,264,3,266,3,272,3,274,3,280,3,282,3,2049,2,2053,2,2057,2,2061,2,2081,2,2085,2,2089,2,2093,2,2304,9,2305,9,2312,9,2313,9,16390,1,16391,1,16406,1,16407,1,16422,1,16423,1,16438,1,16439,1,16642,8,16646,8,16658,8,16662,8,18437,6,18439,6,18469,6,18471,6,18688,9,18689,9,18690,8,18693,6,18694,8,18695,6,18696,9,18697,9,18706,8,18710,8,18725,6,18727,6,131128,0,131129,0,131130,0,131131,0,131132,0,131133,0,131134,0,131135,0,131352,7,131354,7,131384,7,131386,7,133161,5,133165,5,133177,5,133181,5,133376,9,133377,9,133384,9,133385,9,133400,7,133402,7,133417,5,133421,5,133432,7,133433,5,133434,7,133437,5,147510,4,147511,4,147518,4,147519,4,147714,8,147718,8,147730,8,147734,8,147736,7,147738,7,147766,4,147767,4,147768,7,147770,7,147774,4,147775,4,149509,6,149511,6,149541,6,149543,6,149545,5,149549,5,149558,4,149559,4,149561,5,149565,5,149566,4,149567,4,149760,9,149761,9,149762,8,149765,6,149766,8,149767,6,149768,9,149769,9,149778,8,149782,8,149784,7,149786,7,149797,6,149799,6,149801,5,149805,5,149814,4,149815,4,149816,7,149817,5,149818,7,149821,5,149822,4,149823,4,149824,37,149825,37,149826,36,149829,34,149830,36,149831,34,149832,37,149833,37,149842,36,149846,36,149848,35,149850,35,149861,34,149863,34,149865,33,149869,33,149878,32,149879,32,149880,35,149881,33,149882,35,149885,33,149886,32,149887,32,150080,49,150082,48,150088,49,150098,48,150104,47,150106,47,151873,46,151877,45,151881,46,151909,45,151913,44,151917,44,152128,49,152129,46,152136,49,152137,46,166214,43,166215,42,166230,43,166247,42,166262,41,166263,41,166466,48,166470,43,166482,48,166486,43,168261,45,168263,42,168293,45,168295,42,168512,31,168513,28,168514,31,168517,28,168518,25,168519,25,280952,40,280953,39,280954,40,280957,39,280958,38,280959,38,281176,47,281178,47,281208,40,281210,40,282985,44,282989,44,283001,39,283005,39,283208,30,283209,27,283224,30,283241,27,283256,22,283257,22,297334,41,297335,41,297342,38,297343,38,297554,29,297558,24,297562,29,297590,24,297594,21,297598,21,299365,26,299367,23,299373,26,299383,23,299389,20,299391,20,299584,31,299585,28,299586,31,299589,28,299590,25,299591,25,299592,30,299593,27,299602,29,299606,24,299608,30,299610,29,299621,26,299623,23,299625,27,299629,26,299638,24,299639,23,299640,22,299641,22,299642,21,299645,20,299646,21,299647,20,299648,61,299649,60,299650,61,299653,60,299654,59,299655,59,299656,58,299657,57,299666,55,299670,54,299672,58,299674,55,299685,52,299687,51,299689,57,299693,52,299702,54,299703,51,299704,56,299705,56,299706,53,299709,50,299710,53,299711,50,299904,61,299906,61,299912,58,299922,55,299928,58,299930,55,301697,60,301701,60,301705,57,301733,52,301737,57,301741,52,301952,79,301953,79,301960,76,301961,76,316038,59,316039,59,316054,54,316071,51,316086,54,316087,51,316290,78,316294,78,316306,73,316310,73,318085,77,318087,77,318117,70,318119,70,318336,79,318337,79,318338,78,318341,77,318342,78,318343,77,430776,56,430777,56,430778,53,430781,50,430782,53,430783,50,431e3,75,431002,72,431032,75,431034,72,432809,74,432813,69,432825,74,432829,69,433032,76,433033,76,433048,75,433065,74,433080,75,433081,74,447158,71,447159,68,447166,71,447167,68,447378,73,447382,73,447386,72,447414,71,447418,72,447422,71,449189,70,449191,70,449197,69,449207,68,449213,69,449215,68,449408,67,449409,67,449410,66,449413,64,449414,66,449415,64,449416,67,449417,67,449426,66,449430,66,449432,65,449434,65,449445,64,449447,64,449449,63,449453,63,449462,62,449463,62,449464,65,449465,63,449466,65,449469,63,449470,62,449471,62,449472,19,449473,19,449474,18,449477,16,449478,18,449479,16,449480,19,449481,19,449490,18,449494,18,449496,17,449498,17,449509,16,449511,16,449513,15,449517,15,449526,14,449527,14,449528,17,449529,15,449530,17,449533,15,449534,14,449535,14,449728,19,449729,19,449730,18,449734,18,449736,19,449737,19,449746,18,449750,18,449752,17,449754,17,449784,17,449786,17,451520,19,451521,19,451525,16,451527,16,451528,19,451529,19,451557,16,451559,16,451561,15,451565,15,451577,15,451581,15,451776,19,451777,19,451784,19,451785,19,465858,18,465861,16,465862,18,465863,16,465874,18,465878,18,465893,16,465895,16,465910,14,465911,14,465918,14,465919,14,466114,18,466118,18,466130,18,466134,18,467909,16,467911,16,467941,16,467943,16,468160,13,468161,13,468162,13,468163,13,468164,13,468165,13,468166,13,468167,13,580568,17,580570,17,580585,15,580589,15,580598,14,580599,14,580600,17,580601,15,580602,17,580605,15,580606,14,580607,14,580824,17,580826,17,580856,17,580858,17,582633,15,582637,15,582649,15,582653,15,582856,12,582857,12,582872,12,582873,12,582888,12,582889,12,582904,12,582905,12,596982,14,596983,14,596990,14,596991,14,597202,11,597206,11,597210,11,597214,11,597234,11,597238,11,597242,11,597246,11,599013,10,599015,10,599021,10,599023,10,599029,10,599031,10,599037,10,599039,10,599232,13,599233,13,599234,13,599235,13,599236,13,599237,13,599238,13,599239,13,599240,12,599241,12,599250,11,599254,11,599256,12,599257,12,599258,11,599262,11,599269,10,599271,10,599272,12,599273,12,599277,10,599279,10,599282,11,599285,10,599286,11,599287,10,599288,12,599289,12,599290,11,599293,10,599294,11,599295,10],n.p2D=[0,0,1,-1,0,0,-1,1,0,2,1,1,1,2,2,0,1,2,0,2,1,0,0,0],n.p3D=[0,0,1,-1,0,0,1,0,-1,0,0,-1,1,0,0,0,1,-1,0,0,-1,0,1,0,0,-1,1,0,2,1,1,0,1,1,1,-1,0,2,1,0,1,1,1,-1,1,0,2,0,1,1,1,-1,1,1,1,3,2,1,0,3,1,2,0,1,3,2,0,1,3,1,0,2,1,3,0,2,1,3,0,1,2,1,1,1,0,0,2,2,0,0,1,1,0,1,0,2,0,2,0,1,1,0,0,1,2,0,0,2,2,0,0,0,0,1,1,-1,1,2,0,0,0,0,1,-1,1,1,2,0,0,0,0,1,1,1,-1,2,3,1,1,1,2,0,0,2,2,3,1,1,1,2,2,0,0,2,3,1,1,1,2,0,2,0,2,1,1,-1,1,2,0,0,2,2,1,1,-1,1,2,2,0,0,2,1,-1,1,1,2,0,0,2,2,1,-1,1,1,2,0,2,0,2,1,1,1,-1,2,2,0,0,2,1,1,1,-1,2,0,2,0],n.p4D=[0,0,1,-1,0,0,0,1,0,-1,0,0,1,0,0,-1,0,0,-1,1,0,0,0,0,1,-1,0,0,0,1,0,-1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,-1,0,0,-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,2,1,1,0,0,1,1,1,-1,0,1,1,1,0,-1,0,2,1,0,1,0,1,1,-1,1,0,1,1,0,1,-1,0,2,0,1,1,0,1,-1,1,1,0,1,0,1,1,-1,0,2,1,0,0,1,1,1,-1,0,1,1,1,0,-1,1,0,2,0,1,0,1,1,-1,1,0,1,1,0,1,-1,1,0,2,0,0,1,1,1,-1,0,1,1,1,0,-1,1,1,1,4,2,1,1,0,4,1,2,1,0,4,1,1,2,0,1,4,2,1,0,1,4,1,2,0,1,4,1,1,0,2,1,4,2,0,1,1,4,1,0,2,1,4,1,0,1,2,1,4,0,2,1,1,4,0,1,2,1,4,0,1,1,2,1,2,1,1,0,0,3,2,1,0,0,3,1,2,0,0,1,2,1,0,1,0,3,2,0,1,0,3,1,0,2,0,1,2,0,1,1,0,3,0,2,1,0,3,0,1,2,0,1,2,1,0,0,1,3,2,0,0,1,3,1,0,0,2,1,2,0,1,0,1,3,0,2,0,1,3,0,1,0,2,1,2,0,0,1,1,3,0,0,2,1,3,0,0,1,2,2,3,1,1,1,0,2,1,1,1,-1,2,2,0,0,0,2,3,1,1,0,1,2,1,1,-1,1,2,2,0,0,0,2,3,1,0,1,1,2,1,-1,1,1,2,2,0,0,0,2,3,1,1,1,0,2,1,1,1,-1,2,0,2,0,0,2,3,1,1,0,1,2,1,1,-1,1,2,0,2,0,0,2,3,0,1,1,1,2,-1,1,1,1,2,0,2,0,0,2,3,1,1,1,0,2,1,1,1,-1,2,0,0,2,0,2,3,1,0,1,1,2,1,-1,1,1,2,0,0,2,0,2,3,0,1,1,1,2,-1,1,1,1,2,0,0,2,0,2,3,1,1,0,1,2,1,1,-1,1,2,0,0,0,2,2,3,1,0,1,1,2,1,-1,1,1,2,0,0,0,2,2,3,0,1,1,1,2,-1,1,1,1,2,0,0,0,2,2,1,1,1,-1,0,1,1,1,0,-1,0,0,0,0,0,2,1,1,-1,1,0,1,1,0,1,-1,0,0,0,0,0,2,1,-1,1,1,0,1,0,1,1,-1,0,0,0,0,0,2,1,1,-1,0,1,1,1,0,-1,1,0,0,0,0,0,2,1,-1,1,0,1,1,0,1,-1,1,0,0,0,0,0,2,1,-1,0,1,1,1,0,-1,1,1,0,0,0,0,0,2,1,1,1,-1,0,1,1,1,0,-1,2,2,0,0,0,2,1,1,-1,1,0,1,1,0,1,-1,2,2,0,0,0,2,1,1,-1,0,1,1,1,0,-1,1,2,2,0,0,0,2,1,1,1,-1,0,1,1,1,0,-1,2,0,2,0,0,2,1,-1,1,1,0,1,0,1,1,-1,2,0,2,0,0,2,1,-1,1,0,1,1,0,1,-1,1,2,0,2,0,0,2,1,1,-1,1,0,1,1,0,1,-1,2,0,0,2,0,2,1,-1,1,1,0,1,0,1,1,-1,2,0,0,2,0,2,1,-1,0,1,1,1,0,-1,1,1,2,0,0,2,0,2,1,1,-1,0,1,1,1,0,-1,1,2,0,0,0,2,2,1,-1,1,0,1,1,0,1,-1,1,2,0,0,0,2,2,1,-1,0,1,1,1,0,-1,1,1,2,0,0,0,2,3,1,1,0,0,0,2,2,0,0,0,2,1,1,1,-1,3,1,0,1,0,0,2,0,2,0,0,2,1,1,1,-1,3,1,0,0,1,0,2,0,0,2,0,2,1,1,1,-1,3,1,1,0,0,0,2,2,0,0,0,2,1,1,-1,1,3,1,0,1,0,0,2,0,2,0,0,2,1,1,-1,1,3,1,0,0,0,1,2,0,0,0,2,2,1,1,-1,1,3,1,1,0,0,0,2,2,0,0,0,2,1,-1,1,1,3,1,0,0,1,0,2,0,0,2,0,2,1,-1,1,1,3,1,0,0,0,1,2,0,0,0,2,2,1,-1,1,1,3,1,0,1,0,0,2,0,2,0,0,2,-1,1,1,1,3,1,0,0,1,0,2,0,0,2,0,2,-1,1,1,1,3,1,0,0,0,1,2,0,0,0,2,2,-1,1,1,1,3,3,2,1,0,0,3,1,2,0,0,4,1,1,1,1,3,3,2,0,1,0,3,1,0,2,0,4,1,1,1,1,3,3,0,2,1,0,3,0,1,2,0,4,1,1,1,1,3,3,2,0,0,1,3,1,0,0,2,4,1,1,1,1,3,3,0,2,0,1,3,0,1,0,2,4,1,1,1,1,3,3,0,0,2,1,3,0,0,1,2,4,1,1,1,1,3,3,2,1,0,0,3,1,2,0,0,2,1,1,1,-1,3,3,2,0,1,0,3,1,0,2,0,2,1,1,1,-1,3,3,0,2,1,0,3,0,1,2,0,2,1,1,1,-1,3,3,2,1,0,0,3,1,2,0,0,2,1,1,-1,1,3,3,2,0,0,1,3,1,0,0,2,2,1,1,-1,1,3,3,0,2,0,1,3,0,1,0,2,2,1,1,-1,1,3,3,2,0,1,0,3,1,0,2,0,2,1,-1,1,1,3,3,2,0,0,1,3,1,0,0,2,2,1,-1,1,1,3,3,0,0,2,1,3,0,0,1,2,2,1,-1,1,1,3,3,0,2,1,0,3,0,1,2,0,2,-1,1,1,1,3,3,0,2,0,1,3,0,1,0,2,2,-1,1,1,1,3,3,0,0,2,1,3,0,0,1,2,2,-1,1,1,1];var s,c,u,d,h,g,p=[];for(s=0;s<n.p2D.length;s+=4){for(d=n.base2D[n.p2D[s]],h=null,g=null,c=0;c<d.length;c+=3)g=new i(d[c],d[c+1],d[c+2]),null===h?p[s/4]=g:h.next=g,h=g;g.next=new i(n.p2D[s+1],n.p2D[s+2],n.p2D[s+3])}for(this.lookup2D=[],s=0;s<n.lookupPairs2D.length;s+=2)this.lookup2D[n.lookupPairs2D[s]]=p[n.lookupPairs2D[s+1]];var f=[];for(s=0;s<n.p3D.length;s+=9){for(d=n.base3D[n.p3D[s]],h=null,g=null,c=0;c<d.length;c+=4)g=new a(d[c],d[c+1],d[c+2],d[c+3]),null===h?f[s/9]=g:h.next=g,h=g;g.next=new a(n.p3D[s+1],n.p3D[s+2],n.p3D[s+3],n.p3D[s+4]),g.next.next=new a(n.p3D[s+5],n.p3D[s+6],n.p3D[s+7],n.p3D[s+8])}for(this.lookup3D=[],s=0;s<n.lookupPairs3D.length;s+=2)this.lookup3D[n.lookupPairs3D[s]]=f[n.lookupPairs3D[s+1]];var m=[];for(s=0;s<n.p4D.length;s+=16){for(d=n.base4D[n.p4D[s]],h=null,g=null,c=0;c<d.length;c+=5)g=new l(d[c],d[c+1],d[c+2],d[c+3],d[c+4]),null===h?m[s/16]=g:h.next=g,h=g;g.next=new l(n.p4D[s+1],n.p4D[s+2],n.p4D[s+3],n.p4D[s+4],n.p4D[s+5]),g.next.next=new l(n.p4D[s+6],n.p4D[s+7],n.p4D[s+8],n.p4D[s+9],n.p4D[s+10]),g.next.next.next=new l(n.p4D[s+11],n.p4D[s+12],n.p4D[s+13],n.p4D[s+14],n.p4D[s+15])}for(this.lookup4D=[],s=0;s<n.lookupPairs4D.length;s+=2)this.lookup4D[n.lookupPairs4D[s]]=m[n.lookupPairs4D[s+1]];this.perm=new Uint8Array(256),this.perm2D=new Uint8Array(256),this.perm3D=new Uint8Array(256),this.perm4D=new Uint8Array(256);var z=new Uint8Array(256);for(s=0;s<256;s++)z[s]=s;for((e=new Uint32Array(1))[0]=t,e=r(r(r(e))),s=255;s>=0;s--)e=r(e),(u=new Uint32Array(1))[0]=(e[0]+31)%(s+1),u[0]<0&&(u[0]+=s+1),this.perm[s]=z[u[0]],this.perm2D[s]=14&this.perm[s],this.perm3D[s]=this.perm[s]%24*3,this.perm4D[s]=252&this.perm[s],z[u[0]]=z[s];this.simplex1D=function(e){return o.simplex2D(e,1)},this.simplex2D=function(e,t){var r=(e+t)*n.STRETCH_2D,i=[e+r,t+r],a=i[0],l=i[1],s=[Math.floor(a),Math.floor(l)],c=s[0],u=s[1],d=(c+u)*n.SQUISH_2D,h=[e-(c+d),t-(u+d)],g=h[0],p=h[1],f=[a-c,l-u],m=f[0],z=f[1],y=m+z,v=new Uint32Array(4);v[0]=m-z+1,v[1]=y,v[2]=y+z,v[3]=y+m;for(var b=v[0]|v[1]<<1|v[2]<<2|v[3]<<4,w=o.lookup2D[b],C=0;void 0!==w;){var x=[g+w.dx,p+w.dy],k=x[0],T=x[1],A=2-k*k-T*T;if(A>0){var P=[c+w.xsb,u+w.ysb],B=P[0],E=P[1],I=o.perm2D[o.perm[255&B]+E&255];C+=(A*=A)*A*(n.gradients2D[I]*k+n.gradients2D[I+1]*T)}w=w.next}return C*n.NORM_2D},this.simplex3D=function(e,t,r){var i=(e+t+r)*n.STRETCH_3D,a=[e+i,t+i,r+i],l=a[0],s=a[1],c=a[2],u=[Math.floor(l),Math.floor(s),Math.floor(c)],d=u[0],h=u[1],g=u[2],p=(d+h+g)*n.SQUISH_3D,f=[e-(d+p),t-(h+p),r-(g+p)],m=f[0],z=f[1],y=f[2],v=[l-d,s-h,c-g],b=v[0],w=v[1],C=v[2],x=b+w+C,k=new Uint32Array(7);k[0]=w-C+1,k[1]=b-w+1,k[2]=b-C+1,k[3]=x,k[4]=x+C,k[5]=x+w,k[6]=x+b;for(var T=k[0]|k[1]<<1|k[2]<<2|k[3]<<3|k[4]<<5|k[5]<<7|k[6]<<9,A=o.lookup3D[T],P=0;void 0!==A;){var B=[m+A.dx,z+A.dy,y+A.dz],E=B[0],I=B[1],S=B[2],W=2-E*E-I*I-S*S;if(W>0){var M=[d+A.xsb,h+A.ysb,g+A.zsb],O=M[0],j=M[1],L=M[2],D=o.perm3D[o.perm[o.perm[255&O]+j&255]+L&255];P+=(W*=W)*W*(n.gradients3D[D]*E+n.gradients3D[D+1]*I+n.gradients3D[D+2]*S)}A=A.next}return P*n.NORM_3D},this.simplex4D=function(e,t,r,i){var a=(e+t+r+i)*n.STRETCH_4D,l=[e+a,t+a,r+a,i+a],s=l[0],c=l[1],u=l[2],d=l[3],h=[Math.floor(s),Math.floor(c),Math.floor(u),Math.floor(d)],g=h[0],p=h[1],f=h[2],m=h[3],z=(g+p+f+m)*n.SQUISH_4D,y=e-(g+z),v=t-(p+z),b=r-(f+z),w=i-(m+z),C=[s-g,c-p,u-f,d-m],x=C[0],k=C[1],T=C[2],A=C[3],P=x+k+T+A,B=new Uint32Array(11);B[0]=T-A+1,B[1]=k-T+1,B[2]=k-A+1,B[3]=x-k+1,B[4]=x-T+1,B[5]=x-A+1,B[6]=P<<6,B[7]=P+A,B[8]=P+T,B[9]=P+k,B[10]=P+x;for(var E=B[0]|B[1]<<1|B[2]<<2|B[3]<<3|B[4]<<4|B[5]<<5|B[6]<<6|B[7]<<8|B[8]<<11|B[9]<<14|B[10]<<17,I=o.lookup4D[E],S=0;void 0!==I;){var W=[y+I.dx,v+I.dy,b+I.dz,w+I.dw],M=W[0],O=W[1],j=W[2],L=W[3],D=2-M*M-O*O-j*j-L*L;if(D>0){var _=[g+I.xsb,p+I.ysb,f+I.zsb,m+I.wsb],Y=_[0],X=_[1],R=_[2],H=_[3],F=o.perm4D[o.perm[o.perm[o.perm[255&Y]+X&255]+R&255]+H&255];S+=(D*=D)*D*(n.gradients4D[F]*M+n.gradients4D[F+1]*O+n.gradients4D[F+2]*j+n.gradients4D[F+3]*L)}I=I.next}return S*n.NORM_4D}},e.Point=function(e,t,o,n,r,i,a,l,s,c){z_d("13.45"),zot(e)&&(e=0),zot(t)&&(t=0),zot(o)&&(o=0),zot(n)&&(n=0),zot(r)&&(r=0),zot(i)&&(i=0),zot(a)&&(a=0),zot(l)&&(l=0),zot(s)&&(s=0),zot(c)&&(c=0),this.x=e,this.y=t,this.z=o,this.q=n,this.r=r,this.s=i,this.t=a,this.u=l,this.v=s,this.w=c},e.Bezier=function(e,t,o,n){z_d("13.47"),this.a=e,this.b=t,this.c=o,this.d=n,this.len=100,this.arcLengths=new Array(this.len+1),this.arcLengths[0]=0;for(var r=this.x(0),i=this.y(0),a=0,l=1;l<=this.len;l+=1){var s=this.x(.01*l),c=this.y(.01*l),u=r-s,d=i-c;a+=Math.sqrt(u*u+d*d),this.arcLengths[l]=a,r=s,i=c}this.length=a},e.Bezier.prototype={map:function(e){for(var t=e*this.arcLengths[this.len],o=0,n=this.len,r=0;o<n;)r=o+((n-o)/2|0),this.arcLengths[r]<t?o=r+1:n=r;this.arcLengths[r]>t&&r--;var i=this.arcLengths[r];return i===t?r/this.len:(r+(t-i)/(this.arcLengths[r+1]-i))/this.len},mx:function(e){return this.x(this.map(e))},my:function(e){return this.y(this.map(e))},x:function(e){return(1-e)*(1-e)*(1-e)*this.a.x+(1-e)*(1-e)*3*e*this.b.x+3*(1-e)*(e*e)*this.c.x+e*e*e*this.d.x},y:function(e){return(1-e)*(1-e)*(1-e)*this.a.y+(1-e)*(1-e)*3*e*this.b.y+3*(1-e)*(e*e)*this.c.y+e*e*e*this.d.y}},e.Boundary=function(e,t,o,n){z_d("13.46"),e.x&&(n=e.height,o=e.width,t=e.y,e=e.x),zot(e)||zot(t)||zot(o)||zot(n)||(this.x=e,this.y=t,this.width=o,this.height=n,this.contract=function(e,t,o,n){return zot(e)||(zot(t)&&(t=e),zot(o)?o=2*e:o+=e,zot(n)?n=2*t:n+=t,this.x+=e,this.y+=t,this.width-=o,this.height-=n),this})},e.GradientColor=function(e,t,o,n,r,i){if(z_d("13.465"),this.type="GradientColor",this.colors=zot(e)?["black","white"]:e,Array.isArray(this.colors)||(this.colors=[this.colors,this.colors]),1==this.colors.length&&this.colors.push(this.colors[0]),this.ratios=zot(t)?0:t,!Array.isArray(this.ratios)){this.angle=this.ratios,this.ratios=[];for(var a=0;a<this.colors.length;a++)this.ratios.push(a/(this.colors.length-1))}!zot(o)&&(zot(n)||zot(r)||zot(i))?(this.angle=o,o=null):zot(this.angle)&&zot(o)&&zot(n)&&zot(r)&&zot(i)?this.angle=0:(this.x0=zot(o)?0:o,this.y0=zot(n)?0:n,this.x1=zot(r)?0:r,this.y1=zot(i)?100:i)},e.RadialColor=function(e,t,o,n,r,i,a,l){if(z_d("13.466"),this.type="RadialColor",this.colors=zot(e)?["black","white"]:e,Array.isArray(this.colors)||(this.colors=[this.colors,this.colors]),1==this.colors.length&&this.colors.push(this.colors[0]),this.ratios=t,!Array.isArray(this.ratios)){this.ratios=[];for(var s=0;s<this.colors.length;s++)this.ratios.push(s/(this.colors.length-1))}this.x0=o,this.y0=n,this.r0=r,this.x1=i,this.y1=a,this.r1=l},e.BitmapColor=function(e,t,o){z_d("13.467"),this.type="BitmapColor","string"==typeof e&&WW.asset&&(e=WW.asset(e)),"Bitmap"!=e.type&&e.bitmap&&(e=e.bitmap),this.image="Bitmap"==e.type?e.image:e,zog(this.image),this.repetition=t,this.matrix=o},e.Damp=function(t,o){z_d("14");var n,r="startValue, damp";if(n=zob(e.Damp,arguments,r,this))return n;this.lastValue=zot(t)?0:t,this.damp=zot(o)?.1:o},e.Damp.prototype.convert=function(e){return this.lastValue=this.lastValue+(e-this.lastValue)*this.damp},e.Damp.prototype.immediate=function(e){return this.lastValue=e,this},e.Proportion=function(t,o,n,r,i,a,l){var s,c,u,d="baseMin, baseMax, targetMin, targetMax, factor, targetRound, clamp";if(s=zob(e.Proportion,arguments,d,this))return s;z_d("15"),zot(n)&&(n=0),zot(r)&&(r=1),zot(i)&&(i=1),zot(a)&&(a=!1),zot(l)&&(l=!0),this.convert=function(e){if(zot(e)&&(e=t),!isNaN(e)&&o-t!=0)return l&&(e=Math.max(e,t),e=Math.min(e,o)),c=(e-t)/(o-t),u=i>0?n+(r-n)*c:r-(r-n)*c,a&&(u=Math.round(u)),u}},e.ProportionDamp=function(t,o,n,r,i,a,l,s){var c,u="baseMin, baseMax, targetMin, targetMax, damp, factor, targetRound, clamp";if(c=zob(e.ProportionDamp,arguments,u,this))return c;z_d("16"),zot(n)&&(n=0),zot(r)&&(r=1),zot(i)&&(i=.1),zot(a)&&(a=1),zot(l)&&(l=!1),zot(s)&&(s=!0),this.damp=i;var d,h,g,p,f=this,m=0;d=t,m=n;var z=setInterval(y,20);function y(){isNaN(d)||o-t==0||(s&&(d=Math.max(d,t),d=Math.min(d,o)),h=(d-t)/(o-t),g=r-n,m+=((p=a>0?n+g*h:r-g*h)-m)*f.damp)}this.immediate=function(e){return f.convert(e),y(),m=p,l&&(m=Math.round(m)),f},this.convert=function(e){return d=e,l?Math.round(m):m},this.dispose=function(){return clearInterval(z),!0}},e.Dictionary=function(e){z_d("17"),this.length=0,this.unique=e;var t=this.objects=[],o=this.values=[];this.add=function(e,n){zot(e)||(zot(n)&&(n=!0),this.unique&&this.remove(e),t.push(e),o.push(n),this.length++)},this.at=function(e){if(!zot(e)){var n=t.indexOf(e);return n>-1?o[n]:null}},this.remove=function(e){if(zot(e))return!1;var n=t.indexOf(e);return n>-1&&(t.splice(n,1),o.splice(n,1),this.length--,!0)},this.clear=function(){return t=this.objects=[],o=this.values=[],this.length=null,this},this.dispose=function(){return t=null,o=null,this.length=null,!0}},e.Hierarchy=function(t,o){z_d("17.5");var n,r=this;zot(t)||(zot(o)&&(o=!1),r.processSimple=function(r){var i=0,a={};return function t(n,a,l,s){var c;zot(n)||(r=n),r.constructor=={}.constructor?(r.list&&(c=r,r=r.list),s&&c&&e.loop(c,(function(e,t){"list"!=e&&(s[e]=t)})),e.loop(r,(function(e,n){var r={},s=a["id"+i]={obj:e,level:l,open:o,opened:!1,list:r};i++,t(n,r,l+1,s)}))):Array.isArray(r)&&e.loop(r,(function(e){a["id"+i]={obj:e},i++}))}(t,a,0),n=i,a},r.processComplex=function(t){var r=0;return function t(n,i){e.loop(n,(function(e,n){n.level=i,zot(n.open)&&(n.open=o),zot(n.opened)&&(n.opened=!1),n.list&&t(n.list,i+1),r++}))}(t,0),n=r,t},zot(t.id0)?r.data=r.processSimple(t):r.data=r.processComplex(t),r.getLinearList=function(e){return zot(e)&&(e=r.data),i(e)[0]},r.getLinearIDs=function(e){return zot(e)&&(e=r.data),i(e)[1]},r.getData=function(t){var o;return function n(r){e.loop(r,(function(e,r){if(e==t)return o=r;n(r.list)}))}(r.data),o},r.getNextSibling=function(t){var o,n;return function r(i){e.loop(i,(function(e,i){if(!n&&o)return n=e;e==t?o=i:r(i.list)}))}(r.data),n},r.getPrevSibling=function(t){var o,n=[];return function r(i,a){e.loop(i,(function(e,i){if(e==t)return o=n[a]||n[a-1];n[a]=e,r(i.list,a+1)}))}(r.data,0),o},Object.defineProperty(r,"length",{get:function(){return n},set:function(){zon&&zogy("Hierarchy() - length is read only")}}));function i(t){var o=[],n=[];return function t(r,i){e.loop(r,(function(e,r){o.push(r.obj),n.push(e),r.open&&t(r.list,i+1)}))}(t,0),[o,n]}},e.Pick=function(t){e.pickCheck||(z_d("17.6"),e.pickCheck=!0),this.choices=t,this.num=function(t){for(var o=[],n=0;n<t;n++)o.push(e.Pick.choose(this));return this.choices=e.Pick.series(o),this};var o=this;this.loop=function(t,n){for(var r,i=0;i<t;i++)if(void 0!==(r=n(e.Pick.choose(o),i,t)))return r}},e.Pick.prototype.type="Pick",e.Pick.series=function(){return e.pickCheck||(z_d("17.6"),e.pickCheck=!0),e.series.apply(null,arguments)},e.Pick.rand=function(t,o,n,r){return e.pickCheck||(z_d("17.6"),e.pickCheck=!0),e.rand(t,o,n,r)},e.Pick.choose=function(t,o,n){if(e.pickCheck||(z_d("17.6"),e.pickCheck=!0),null==o&&(o=!0),null==t)return t;if("Pick"==t.type||o){var r,i=t.choices||t;return Array.isArray(i)?(r=i[Math.floor(Math.random()*i.length)],e.Pick.choose(r)):i.constructor==={}.constructor?zot(i.noPick)?zot(i.max)?i:(zot(i.integer)&&(i.integer=!1),r=e.Pick.rand(i.min,i.max,i.integer,i.negative)):i.noPick:i instanceof Function?(null==i.count?i.count=0:i.count++,e.Pick.choose(i(n,!0))):t}return t},e.Pick.getMinMax=function(t){return zot(t.min)||zot(t.max)?Array.isArray(t)?e.arrayMinMax(t):"series"==t.type?e.arrayMinMax(t.array):{min:null,max:null}:t},e.scrollX=function(t,o){return z_d("18"),e.abstractScroll("X","Left",t,o)},e.scrollY=function(t,o){return z_d("19"),e.abstractScroll("Y","Top",t,o)},e.abstractScroll=function(o,n,r,i){z_d("20");var a=t(i),l="X"==o?"Y":"X";if(zot(r))return document.documentElement&&document.documentElement["scroll"+n]||document.body["scroll"+n];if(zot(i))WW.scrollTo(e["scroll"+l](),r);else{var s=i*("s"==a?1e3:1);s<50&&(s=50);var c=s/50,u=e["scroll"+o](),d=(r-u)/c,h=0,g=setInterval((function(){h++,u+=d,WW.scrollTo(e["scroll"+l](),u),h>=c&&(WW.scrollTo(e["scroll"+l](),r),clearInterval(g))}),50)}return r},e.windowWidth=function(){z_d("21");var t=isNaN(WW.innerWidth)?WW.clientWidth:WW.innerWidth,o=isNaN(WW.innerHeight)?WW.clientHeight:WW.innerHeight;if(e.mobile()&&!zot(WW.orientation)&&!WW.parent&&(t>o&&90!=Math.abs(WW.orientation)||o>t&&90==Math.abs(WW.orientation))){var n=t;t=o,o=n}return WW.zdf&&WW.zdf.swapRotation?o:t},e.windowHeight=function(){z_d("22");var t=isNaN(WW.innerWidth)?WW.clientWidth:WW.innerWidth,o=isNaN(WW.innerHeight)?WW.clientHeight:WW.innerHeight;if(e.mobile()&&!zot(WW.orientation)&&!WW.parent&&(t>o&&90!=Math.abs(WW.orientation)||o>t&&90==Math.abs(WW.orientation))){var n=t;t=o,o=n}return WW.zdf&&WW.zdf.swapRotation?t:o},e.browserZoom=function(){if(e.zimBZ)return zot(e.zimBZA)?e.decimals((WW.devicePixelRatio||1)/e.zimBZ1,2):e.zimBZA;if(z_d("22.2"),e.zimBZ=!0,void 0===t){if(!WW.zdf)return e.zimBZA=1,1;var t=WW.zdf}if(!t.retina)return e.zimBZA=1,1;e.zimBZ1=WW.devicePixelRatio||1},e.getQueryString=function(e){if(z_d("22.5"),zot(e)&&(e=location.search.replace("?","")),""==e)return{};for(var t=e.split("&"),o={},n=0;n<t.length;n++){var r=t[n].split("=");void 0===o[r[0]]?o[r[0]]=decodeURIComponent((r[1]+"").replace(/\+/g,"%20")):"string"==typeof o[r[0]]?o[r[0]]=[o[r[0]],decodeURIComponent((r[1]+"").replace(/\+/g,"%20"))]:o[r[0]].push(decodeURIComponent((r[1]+"").replace(/\+/g,"%20")))}return o},e.swapHTML=function(t,o){return z_d("17.2"),e.swapProperties("innerHTML",zid(t),zid(o))},e.urlEncode=function(e){return z_d("23"),e=(e+"").toString(),encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")},e.urlDecode=function(e){return z_d("24"),decodeURIComponent((e+"").replace(/\+/g,"%20"))},e.setCookie=function(e,t,o){if(z_d("25"),!zot(e)&&!zot(t)){var n;if(o){var r=new Date;r.setTime(r.getTime()+24*o*60*60*1e3),n="; expires="+r.toGMTString()}else n="";return document.cookie=e+"="+escape(t)+n+"; path=/",!0}},e.getCookie=function(e){z_d("26");for(var t,o=document.cookie.split(/;\s*/),n=new Array,r=0;r<o.length;r++)n[(t=o[r].split("="))[0]]=t[1];if(void 0!==n[e])return unescape(n[e])},e.deleteCookie=function(t){return z_d("27"),!zot(e.getCookie(t))&&(e.setCookie(t,"",-1),!0)},null==createjs)return zon&&zogr("ZIM >= 4.3.0 requires createjs namespace to be loaded (import createjs before zim)"),e;function n(t,o){if(t&&e.gD(t),!o&&t&&t.dispose&&t.dispose!==e.Container.prototype.dispose&&t.dispose(null,null,!0),t&&t.addChild&&(t.dispatchEvent("removed"),t.removeAllEventListeners(),t.numChildren))for(var r=t.numChildren-1;r>=0;r--)n(t.getChildAt(r));t&&t.parent&&t.parent.removeChild(t)}function r(e,t){t?(e.mouseChildren=!0,e.mouseEnabled=!0,e._enabled=!0):(e.mouseChildren=!1,e.mouseEnabled=!1,e._enabled=!1)}if(e.localToGlobal=function(t,o,n,r){if(e.coordinatesCheck||(z_d("50.43"),e.coordinatesCheck=!0),null!=t&&null!=o){var i=r.call(n,t,o),a=n.stage;if(!WW.zdf){if(!a)return i;WW.zdf={stage:a,canvas:a.canvas}}return i.x/=e.scaX,i.y/=e.scaY,i}},e.globalToLocal=function(t,o,n,r){if(e.coordinatesCheck||(z_d("50.43"),e.coordinatesCheck=!0),null!=t&&null!=o){var i=n.stage;if(!WW.zdf){if(!i)return r.call(n,t,o);WW.zdf={stage:i,canvas:i.canvas}}return t*=e.scaX,o*=e.scaY,r.call(n,t,o)}},e.localToLocal=function(t,o,n,r){if(e.coordinatesCheck||(z_d("50.43"),e.coordinatesCheck=!0),null!=t&&null!=o&&null!=n){var i=r.localToGlobal(t,o),a=r.stage;if(!WW.zdf){if(!a)return n.globalToLocal(i.x,i.y);WW.zdf={stage:a,canvas:a.canvas}}return a||(a=WW.zdf.stage),n==a?i:i?n.globalToLocal(i.x,i.y):void 0}},e.displayBase=function(t){e.zimDBCheck||(z_d("50.432"),e.zimDBCheck=!0);var o,n,r,i=t;(Object.defineProperty(t,"width",{enumerable:!0,get:function(){var e=this.getBounds();return zot(e)?null:Math.abs(e.width*this.scaleX)},set:function(e){if(!1!==t.scaleDimensions){var o=this.getBounds();if(zot(o)||0==o.width)return void(zon&&zogy("DisplayObject() - width needs bounds set with setBounds()"));var n=e/o.width;this.scaleX=this.scaleY=n}else{var r=0!=t.width?t.height/t.width:0;t.setWidth(e),t.setHeight(e*r),t.drawShape()}}}),Object.defineProperty(t,"height",{enumerable:!0,get:function(){var e=this.getBounds();return zot(e)?null:Math.abs(e.height*this.scaleY)},set:function(e){if(!1!==t.scaleDimensions){var o=this.getBounds();if(zot(o)||0==o.height)return void(zon&&zogy("DisplayObject() - height needs bounds set with setBounds()"));var n=e/o.height;this.scaleX=this.scaleY=n}else{var r=0!=t.height?t.width/t.height:0;t.setHeight(e),t.setWidth(e*r),t.drawShape()}}}),Object.defineProperty(t,"widthOnly",{enumerable:!0,get:function(){var e=this.getBounds();return zot(e)?null:Math.abs(e.width*this.scaleX)},set:function(e){if(!1!==t.scaleDimensions){var o=this.getBounds();if((zot(o)||0==o.width)&&zon)return void zogy("DisplayObject() - widthOnly needs bounds set with setBounds()");var n=e/o.width;this.scaleX=n}else t.setWidth(e),t.drawShape()}}),Object.defineProperty(t,"heightOnly",{enumerable:!0,get:function(){var e=this.getBounds();return zot(e)?null:Math.abs(e.height*this.scaleY)},set:function(e){if(!1!==t.scaleDimensions){var o=this.getBounds();if((zot(o)||0==o.height)&&zon)return void zogy("DisplayObject() - heightOnly needs bounds set with setBounds()");var n=e/o.height;this.scaleY=n}else t.setHeight(e),t.drawShape()}}),Object.defineProperty(t,"level",{enumerable:!0,get:function(){return this.parent?this.parent.getChildIndex(this):null},set:function(e){this.parent&&this.parent.setChildIndex(this,Math.max(0,Math.min(e,this.parent.numChildren-1)))}}),Object.defineProperty(t,"depth",{enumerable:!0,get:function(){return this._depth},set:function(e){if(this._depth=e,!zot(this.vrChannel)){var t=this.vrParallaxDistance?e*this.vrParallax*this.vrParallaxDistance:0;"left"==this.vrChannel?this.x=this.vrStartX+e+t:"right"==this.vrChannel&&(this.x=this.vrStartX-e+t)}}}),Object.defineProperty(t,"blendMode",{enumerable:!0,get:function(){return this.compositeOperation},set:function(e){this.compositeOperation=e}}),i.name)||Object.defineProperty(i,"name",{get:function(){return o},set:function(t){o=t,e.zimObjectIDs[t]=i}});i._draggable,Object.defineProperty(i,"draggable",{get:function(){return this._draggable},set:function(e){e!=this._draggable&&(this._draggable=e,this._draggable?this.drag():this.noDrag())}}),i.on("mousedown",(function(e){e.target.stage&&(n=e.target.stage.frame).allowDefault&&(r=!0,n.allowDefault=!1)})),i.on("pressup",(function(){n&&r&&(n.allowDefault=!0)}));for(var a=["hue","saturation","brightness","contrast"],l=0;l<a.length;l++)!function(){for(var t=a[l],o=0;o<2;o++)!function(){var n=0==o?"":"Batch";Object.defineProperty(i,t+n,{get:function(){return i.effects&&i.effects.multi?i.effects.multi[t]:0},set:function(o){i.effects&&i.effects.multi?i.effects.multi[t]=o:i.effect(new e.MultiEffect("hue"==t?o:0,"saturation"==t?o:0,"brightness"==t?o:0,"contrast"==t?o:0)),""==n&&i.updateEffects()}})}()}()},e.gD=function(t){e.zimGDCheck||(z_d("50.435"),e.zimGDCheck=!0),t&&(e.KEYFOCUS==t&&(e.KEYFOCUS=null),WW.KEYFOCUS==t&&(WW.KEYFOCUS=null),t.draggable&&t.noDrag(),t.zimTweens&&t.stopAnimate(),t.zimWire&&t.noWire(),t.zimWired&&t.noWired(),t.zimClickHoldDownEvent&&t.noHold(),t.transformControls&&t.transformControls.dispose(),t.zimClickDownEvent&&(t.zimClickDownEvent=null),t.zimClickUpEvent&&(t.zimClickUpEvent=null),t.physics&&t.removePhysics(),t.name&&e.zimObjectIDs[t.name]==t&&delete e.zimObjectIDs[t.name])},e.Stage=function(t,o,n){if(z_d("50.44"),!zot(t)){var r="CANVAS"==t.tagName?t:zid(t);zot(r)||(this.cjsStage_constructor(t),this.setBounds(0,0,r.width,r.height),this.type="Stage",WW.zdf||(WW.zimDefaultFrame=WW.zdf={stage:this}),n?createjs.Touch.enable(this,!0):o&&createjs.Touch.enable(this,!1),this.cache=function(e,t,o,n,r,i){if(zot(o))if(zot(e)){var a=this.getBounds();if(!zot(a)){var l=this.borderWidth>0?this.borderWidth/2:0;e=a.x-l,t=a.y-l,o=a.width+2*l,n=a.height+2*l}}else o=e,n=t,e=0,t=0;return this.cjsStage_cache(e,t,o,n,r,i),this},this.on("mousedown",(function(e){var t=e.clone();t.type="pressdown",e.target.dispatchEvent(t)}),void 0,!1,void 0,!0),this.loop=function(t,o,n,r,i){return e.loop(this,t,o,n,r,i)},this.hitTestGrid=function(t,o,n,r,i,a,l,s,c,u,d,h){return e.hitTestGrid(this,t,o,n,r,i,a,l,s,c,u,d,h)},this.disposeAllChildren=function(){for(var e=this.numChildren-1;e>=0;e--){var t=this.getChildAt(e);t.dispose&&t.dispose()}return this},this.frame=WW.zdf,!createjs||createjs.stageTransformable||!WW.zdf.retina&&"undefined"==typeof exportRoot||(Object.defineProperty(this,"scale",{get:function(){return this.cjsStage_scale},set:function(t){this.cjsStage_scaleX=t,this.cjsStage_scaleY=t,e.scaX=createjs.stageTransformable?1:t,e.scaY=createjs.stageTransformable?1:t}}),Object.defineProperty(this,"scaleX",{get:function(){return this.cjsStage_scaleX},set:function(t){this.cjsStage_scaleX=t,e.scaX=createjs.stageTransformable?1:t}}),Object.defineProperty(this,"scaleY",{get:function(){return this.cjsStage_scaleY},set:function(t){this.cjsStage_scaleY=t,e.scaY=createjs.stageTransformable?1:t}}),this.localToGlobal=function(t,o){return e.localToGlobal(t,o,this,this.cjsStage_localToGlobal)},this.globalToLocal=function(t,o){return e.globalToLocal(t,o,this,this.cjsStage_globalToLocal)},this.localToLocal=function(t,o,n){return e.localToLocal(t,o,n,this)}))}},e.extend(e.Stage,createjs.Stage,["cache","localToLocal","localToGlobal","globalToLocal"],"cjsStage",!1),e.StageGL=function(t,o,n,r){if(z_d("50.45"),!zot(t)){var i="CANVAS"==t.tagName?t:zid(t);zot(i)||(this.cjsStageGL_constructor(t,o),this.setBounds(0,0,i.width,i.height),this.type="StageGL",WW.zdf||(WW.zdf={stage:this}),r?createjs.Touch.enable(this,!0):n&&createjs.Touch.enable(this,!1),this.cache=function(e,t,o,n,r,i){if(zot(o))if(zot(e)){var a=this.getBounds();if(!zot(a)){var l=this.borderWidth>0?this.borderWidth/2:0;e=a.x-l,t=a.y-l,o=a.width+2*l,n=a.height+2*l}}else o=e,n=t,e=0,t=0;return this.cjsStageGL_cache(e,t,o,n,r,i),this},this.on("mousedown",(function(e){var t=e.clone();t.type="pressdown",e.target.dispatchEvent(t)}),void 0,!1,void 0,!0),this.loop=function(t,o,n,r,i){return e.loop(this,t,o,n,r,i)},this.hitTestGrid=function(t,o,n,r,i,a,l,s,c,u,d,h){return e.hitTestGrid(this,t,o,n,r,i,a,l,s,c,u,d,h)},this.disposeAllChildren=function(){for(var e=this.numChildren-1;e>=0;e--){var t=this.getChildAt(e);t.dispose&&t.dispose()}return this},this.frame=WW.zdf,!createjs||createjs.stageTransformable||!WW.zdf.retina&&"undefined"==typeof exportRoot||(Object.defineProperty(this,"scale",{get:function(){return this.cjsStage_scale},set:function(t){this.cjsStage_scaleX=t,this.cjsStage_scaleY=t,e.scaX=createjs.stageTransformable?1:t,e.scaY=createjs.stageTransformable?1:t}}),Object.defineProperty(this,"scaleX",{get:function(){return this.cjsStage_scaleX},set:function(t){this.cjsStage_scaleX=t,e.scaX=createjs.stageTransformable?1:t}}),Object.defineProperty(this,"scaleY",{get:function(){return this.cjsStage_scaleY},set:function(t){this.cjsStage_scaleY=t,e.scaY=createjs.stageTransformable?1:t}}),this.localToGlobal=function(t,o){return e.localToGlobal(t,o,this,this.cjsStageGL_localToGlobal)},this.globalToLocal=function(t,o){return e.globalToLocal(t,o,this,this.cjsStageGL_globalToLocal)},this.localToLocal=function(t,o,n){return e.localToLocal(t,o,n,this)}))}},e.extend(e.StageGL,createjs.StageGL,["cache","localToLocal","localToGlobal","globalToLocal"],"cjsStageGL",!1),e.Container=function(t,o,n,r,i,a,l){var s,c="a, b, c, d, style, group, inherit";if(s=zob(e.Container,arguments,c,this))return s;e.containerCheck||(z_d("50.5"),z_d("50.435"),e.containerCheck=!0),this.cjsContainer_constructor(),this.type="Container",this.group=a;var u=this,d=!1===i?{}:e.getStyle(this.type,this.group,l);zot(t)&&(t=null!=d.a?d.a:null),zot(o)&&(o=null!=d.b?d.b:null),zot(n)&&(n=null!=d.c?d.c:null),zot(r)&&(r=null!=d.d?d.d:null);var h=g(t,o,n,r);function g(e,t,o,n){var r=[];return zot(e)?r=[e,t,o,n]:zot(t)?e.x?r=[e.x,e.y,e.width,e.height]:(r[0]=0,r[1]=0,r[2]=e,r[3]=e):zot(o)?(r[0]=0,r[1]=0,r[2]=e,r[3]=t):(r[0]=e,r[1]=t,r[2]=o,r[3]=n),zot(r[3])&&(r[3]=r[2]),r}zot(t)||this.setBounds(h[0],h[1],h[2],h[3]),this.cache=function(e,t,o,n,r,i,a){if("AC"==u.type&&WW.zdf)return WW.zdf.ac("cache",arguments,u),u;var l,s="a,b,c,d,scale,options,margin";if(l=zob(u.cache,arguments,s))return l;var c=u.getBounds();if(zot(o))if(zot(e)){if(!zot(c)){var d=u.borderWidth>0?u.borderWidth/2:0;e=c.x-d,t=c.y-d,o=c.width+2*d,n=c.height+2*d}}else o=e,n=t,e=0,t=0;return"Triangle"==u.type&&(e-=u.borderWidth?u.borderWidth:0,o+=u.borderWidth?2*u.borderWidth:0,t-=u.borderWidth?u.borderWidth:0,n+=u.borderWidth?2*u.borderWidth:0),zot(a)&&(a=0),u.cjsContainer_cache(e-a,t-a,o+2*a,n+2*a,r,i),c&&u.setBounds(c.x,c.y,c.width,c.height),u},this.uncache=function(){return u.cjsContainer_uncache(),u},this.childrenToBitmap=function(){var t=this.cacheCanvas,o=new e.Bitmap(this.cache().cacheCanvas);return t||this.uncache(),this.removeAllChildren(),o.addTo(this),this};var p=WW.zdf||1;createjs&&!createjs.stageTransformable&&p.retina&&(this.localToGlobal=function(t,o){return e.localToGlobal(t,o,this,this.cjsContainer_localToGlobal)},this.globalToLocal=function(t,o){return e.globalToLocal(t,o,this,this.cjsContainer_globalToLocal)},this.localToLocal=function(t,o,n){return e.localToLocal(t,o,n,this)}),this.setBounds=function(e,t,o,n){var r=g(e,t,o,n);return u.cjsContainer_setBounds(r[0],r[1],r[2],r[3]),u},this.disposeAllChildren=function(){for(var e=this.numChildren-1;e>=0;e--){var t=this.getChildAt(e);t.dispose&&t.dispose()}return this},e.displayBase(u),!1!==i&&e.styleTransforms(this,d),this.clone=function(t){if("AC"==this.type&&WW.zdf)return zon&&zogy("ZIM asset() - cannot clone lazy-loaded asset - use Frame() assets parameter or loadAssets() method"),WW.zdf.ac("clone",arguments,this),this;var o=this.getBounds();return zot(o)&&(o={x:null,y:null,width:null,height:null}),this.cloneChildren(this.cloneProps(new e.Container(o.x,o.y,o.width,o.height,i,this.group,l)),t)},this.hasProp=function(e){return!zot(this[e])||Object.prototype.hasOwnProperty.call(this,e)}},e.Container.prototype.dispose=function(e){return n(this,e),!0},e.Container.prototype.specialColor=function(e,t,o){if("GradientColor"==t.type){if(!zot(t.angle)){if(!o.width)return void(e.style=t.colors[0]);var n=o.getBounds();if(t.angle+=36e6,t.angle%=360,"Circle"==o.type){var r=n.width/2*Math.cos(t.angle*RAD),i=n.width/2*Math.sin(t.angle*RAD);t.x0=-r,t.y0=-i,t.x1=r,t.y1=i}else{var a=t.angle%90,l=n.width*Math.sin(a*RAD),s=l*Math.sin(a*RAD),c=-l*Math.cos(a*RAD),u=n.height*Math.sin(a*RAD),d=n.width+u*Math.cos(a*RAD),h=u*Math.sin(a*RAD),g=n.height*Math.sin(a*RAD),p=-g*Math.cos(a*RAD),f=n.height-g*Math.sin(a*RAD);t.angle>=0&&t.angle<90?(t.x0=n.x+s,t.y0=n.y+c,t.x1=n.x+d,t.y1=n.y+h):t.angle>=90&&t.angle<180?(t.x0=n.x+s,t.y0=n.y+c,t.x1=n.x+p,t.y1=n.y+f):t.angle>=180&&t.angle<270?(t.x0=n.x+d,t.y0=n.y+h,t.x1=n.x+s,t.y1=n.y+c):(t.x0=n.x+p,t.y0=n.y+f,t.x1=n.x+s,t.y1=n.y+c)}}e.linearGradient(t.colors,t.ratios,t.x0,t.y0,t.x1,t.y1)}else if("RadialColor"==t.type){if(zot(t.x0)){if(!o.width)return void(e.style=t.colors[0]);n=o.getBounds();t.r0=0,"Circle"==o.type?(t.x0=0,t.y0=0,t.r1=n.width/2):(t.x0=n.x+n.width/2,t.y0=n.y+n.height/2,t.r1=Math.sqrt(Math.pow(n.width/2,2)+Math.pow(n.height/2,2))),t.x1=t.x0,t.y1=t.y0}e.radialGradient(t.colors,t.ratios,t.x0,t.y0,t.r0,t.x1,t.y1,t.r1)}else"BitmapColor"==t.type&&e.bitmap(t.image,t.repetition,t.matrix)},e.extend(e.Container,createjs.Container,["cache","uncache","setBounds","clone","localToLocal","localToGlobal","globalToLocal"],"cjsContainer",!1),zimify(e.Container.prototype),e.Shape=function(t,o,n,r,i,a,l,s,c){var u,d="a, b, c, d, graphics, optimize, style, group, inherit";if(u=zob(e.Shape,arguments,d,this))return u;z_d("50.6"),this.cjsShape_constructor(i),this.type="Shape",this.group=s;var h=!1===l?{}:e.getStyle(this.type,this.group,c),g=this;zot(t)&&(t=null!=h.a?h.a:null),zot(o)&&(o=null!=h.b?h.b:null),zot(n)&&(n=null!=h.c?h.c:null),zot(r)&&(r=null!=h.d?h.d:null),zot(i)&&(i=null!=h.graphics?h.graphics:null),zot(a)&&(a=null!=h.optimize&&h.optimize);var p=f(t,o,n,r);function f(e,t,o,n){var r=[];return zot(o)?(r[0]=0,r[2]=e,r[1]=0,r[3]=t):(r[0]=e,r[2]=o,r[1]=t,r[3]=n),zot(r[3])&&(r[3]=r[2]),r}if(zot(t)||this.setBounds(p[0],p[1],p[2],p[3]),!a)for(var m=["mt","lt","a","at","bt","ct","qt","cp","c","f","lf","rf","bf","ef","ss","sd","s","ls","rs","bs","es","dr","rr","rc","dc","de","dp","pg","p"],z=0;z<m.length;z++)!function(){var e=z;g[m[e]]=function(){return"ct"==m[e]?g.graphics.curveTo.apply(g.graphics,arguments):g.graphics[m[e]].apply(g.graphics,arguments),g}}();Object.defineProperty(g,"command",{get:function(){return g.graphics.command},set:function(){}}),this.cache=function(e,t,o,n,r,i,a){var l,s="a,b,c,d,scale,options,margin";if(l=zob(g.cache,arguments,s))return l;var c=g.getBounds();if(zot(o))if(zot(e)){if(!zot(c)){var u=g.borderWidth>0?g.borderWidth/2:0;e=c.x-u,t=c.y-u,o=c.width+2*u,n=c.height+2*u}}else o=e,n=t,e=0,t=0;return zot(a)&&(a=0),g.cjsShape_cache(e-a,t-a,o+2*a,n+2*a,r,i),g},this.setBounds=function(e,t,o,n){var r=f(e,t,o,n);return this.cjsShape_setBounds(r[0],r[1],r[2],r[3]),this},!1!==l&&e.styleTransforms(this,h),this.clone=function(t){zot(t)&&(t=!0);var o=this.getBounds();zot(o)&&(o={x:null,y:null,width:null,height:null});var n=g.cloneProps(new e.Shape(o.x,o.y,o.width,o.height,i,l,s,c));return n.graphics=t?g.graphics.clone():g.graphics,n};var y=WW.zdf||1;createjs&&!createjs.stageTransformable&&y.retina&&(this.localToGlobal=function(t,o){return e.localToGlobal(t,o,this,this.cjsShape_localToGlobal)},this.globalToLocal=function(t,o){return e.globalToLocal(t,o,this,this.cjsShape_globalToLocal)},this.localToLocal=function(t,o,n){return e.localToLocal(t,o,n,this)}),this.hasProp=function(e){return!zot(this[e])||Object.prototype.hasOwnProperty.call(this,e)},e.displayBase(g),this.dispose=function(){e.gD(this),this.graphics.c(),this.dispatchEvent("removed"),this.removeAllEventListeners(),this.parent&&this.parent.removeChild(this)}},e.extend(e.Shape,createjs.Shape,["cache","clone","setBounds","localToLocal","localToGlobal","globalToLocal"],"cjsShape",!1),zimify(e.Shape.prototype),e.Bitmap=function(t,o,n,r,i,a,l,s,c){var u,d="image, width, height, left, top, scale, style, group, inherit";if(u=zob(e.Bitmap,arguments,d,this))return u;z_d("50.7"),this.group=s;var h=!1===l?{}:e.getStyle("Bitmap",this.group,c);zot(a)&&(a=null!=h.scale?h.scale:1),zot(o)&&(o=null!=h.width?h.width:t?t.width:100),zot(n)&&(n=null!=h.height?h.height:t?t.height:100),zot(r)&&(r=null!=h.left?h.left:0),zot(i)&&(i=null!=h.top?h.top:0);var g=!1,p=t;if(!zot(t)&&t.uncache){g=!0;var f=t.cacheCanvas,m=t;t=t.cache(r,i,o,n,a).cacheCanvas}this.cjsBitmap_constructor(t),m&&!f&&m.uncache();var z=this;this.type="Bitmap",zot(o)||zot(n)||this.setBounds(0,0,o,n),this.drawImageData=function(e,r,i,a,l,s){if(zot(e)&&(e=0),zot(r)&&(r=0),zot(i)&&(i=0),zot(a)&&(a=0),zot(l)&&(l=o),zot(s)&&(s=n),!z.proxyCanvas){var c=z.proxyCanvas=document.createElement("canvas");c.setAttribute("width",o),c.setAttribute("height",n),z.proxyContext=c.getContext("2d"),t=p=z.image=c}z.proxyContext&&z.proxyContext.putImageData(z.imageData,e,r,i,a,l,s)},WW.zdf&&(WW.zdf.canvas.getContext("2d")?this.imageData=WW.zdf.canvas.getContext("2d").createImageData(o,n):this.imageData=document.createElement("canvas").getContext("2d").createImageData(o,n),zot(t)&&z.drawImageData(),t&&t.match&&t.match(/data:image/i)&&setTimeout((function(){z.stage&&z.stage.update(),setTimeout((function(){z.stage&&z.stage.update()}),50)}),50)),t&&t.nodeName&&"video"!=t.nodeName.toLowerCase()&&(z.sourceRect=g?{x:0,y:0,width:o*a,height:n*a}:{x:r,y:i,width:o,height:n}),this.cache=function(e,t,o,n,r,i,a){var l;if(zot(o))if(zot(e)){if(!zot(l=this.getBounds())){var s=this.borderWidth>0?this.borderWidth/2:0;e=l.x-s,t=l.y-s,o=l.width+2*s,n=l.height+2*s}}else o=e,n=t,e=0,t=0;return l=this.getBounds(),this.cjsBitmap_cache(e,t,o,n,r,i,a),this.setBounds(l.x,l.y,l.width,l.height),this},this.clone=function(){var t=this.cloneProps(new e.Bitmap(p,o,n,r,i,a,l,this.group,c));return t.cloned=!0,t.src=z.src,t.file=z.file,t.image=z.image,t.svg=z.svg,t.item=z.item,t};var y,v=WW.zdf||1;createjs&&!createjs.stageTransformable&&v.retina&&(this.localToGlobal=function(t,o){return e.localToGlobal(t,o,this,this.cjsBitmap_localToGlobal)},this.globalToLocal=function(t,o){return e.globalToLocal(t,o,this,this.cjsBitmap_globalToLocal)},this.localToLocal=function(t,o,n){return e.localToLocal(t,o,n,this)}),this.hasProp=function(e){return!zot(this[e])||Object.prototype.hasOwnProperty.call(this,e)},this.getColorAt=function(e,t,o){y||(z.cache(),y=z.cacheCanvas.getContext("2d"),z.uncache());var n=y.getImageData(e,t,1,1).data;return n[3]/=255,o?n:"rgba("+n[0]+","+n[1]+","+n[2]+","+n[3]+")"},this.keyOut=function(t,a,l){var s,c;zot(t)&&(t="#389b26"),zot(a)&&(a=.1),Array.isArray(t)||(t=[t]),Array.isArray(a)||(a=[a]),zot(l)||Array.isArray(l)||(l=[l]);var u=[],d=[],h=[];for(s=0;s<t.length;s++)u[s]=e.convertColor(t[s],"array"),null!=a[s]?d[s]=255*a[s]:d[s]=255*a[0],l&&(null!=l[s]?(h[s]=e.convertColor(l[s],"array"),h[s][3]*=255):(h[s]=e.convertColor(l[0],"array"),h[s][3]*=255));z.cacheCanvas&&z.updateCache(),y||(z.cache(),y=z.cacheCanvas.getContext("2d"));var g=y.getImageData(r,i,o,n),p=g.data,f=p.length/4;if(l)for(s=0;s<f;s++){var m=p[4*s+0],v=p[4*s+1],b=p[4*s+2];for(c=0;c<t.length;c++)m>u[c][0]-d[c]&&m<u[c][0]+d[c]&&v>u[c][1]-d[c]&&v<u[c][1]+d[c]&&b>u[c][2]-d[c]&&b<u[c][2]+d[c]&&(p[4*s+0]=h[c][0],p[4*s+1]=h[c][1],p[4*s+2]=h[c][2],p[4*s+3]=h[c][3])}else for(s=0;s<f;s++){m=p[4*s+0],v=p[4*s+1],b=p[4*s+2];for(c=0;c<t.length;c++)m>u[c][0]-d[c]&&m<u[c][0]+d[c]&&v>u[c][1]-d[c]&&v<u[c][1]+d[c]&&b>u[c][2]-d[c]&&b<u[c][2]+d[c]&&(p[4*s+3]=0)}return y.putImageData(g,i,r),this},e.displayBase(z),!1!==l&&e.styleTransforms(this,h),this.doDispose=function(){e.gD(this),this.dispatchEvent("removed"),this.removeAllEventListeners(),this.cloned||this.id&&((v=this.stage&&this.stage.frame?this.stage.frame:WW.zdf)&&v.assets&&v.assets[this.id]&&delete v.assets[this.id],e.assets[this.id]&&delete e.assets[this.id]),this.parent&&this.parent.removeChild(this)}},e.Bitmap.fromData=function(t,o){var n=100,r=100,i=new Image;i.onload=function(){n=i.naturalWidth,r=i.naturalHeight,zot(n)&&(n=i.width),zot(r)&&(r=i.height);var a=new e.Bitmap(t,n,r);setTimeout((function(){o(a)}),50)},i.src=t},e.extend(e.Bitmap,createjs.Bitmap,["cache","clone","dispose","localToLocal","localToGlobal","globalToLocal"],"cjsBitmap",!1),e.Bitmap.prototype.dispose=function(){return this.doDispose()},zimify(e.Bitmap.prototype),e.Sprite=function(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w){var C,x="image, cols, rows, count, offsetX, offsetY, spacingX, spacingY, width, height, animations, json, id, globalControl, spriteSheet, label, frame, style, group, inherit";if(C=zob(e.Sprite,arguments,x,this))return C;z_d("50.8"),this.type="Sprite",this.group=b;var k,T=!1===v?{}:e.getStyle(this.type,this.group,w),A=this;if(zot(y)&&(y=null!=T.frame?T.frame:WW.zdf),zot(g)&&!zot(o)){zot(n)&&(n=null!=T.cols?T.cols:1),zot(r)&&(r=null!=T.rows?T.rows:1),zot(i)&&(i=null!=T.count?T.count:n*r),zot(a)&&(a=null!=T.offsetX?T.offsetX:0),zot(l)&&(l=null!=T.offsetY?T.offsetY:0),zot(s)&&(s=null!=T.spacingX?T.spacingX:0),zot(c)&&(c=null!=T.spacingY?T.spacingY:0),zot(u)&&(u=null!=T.width?T.width:o.width),zot(d)&&(d=null!=T.height?T.height:o.height),o.bitmap&&(o=o.bitmap);var P=(u-a+s)/n-s,B=(d-l+c)/r-c,E=[],I=0;e:for(var S=0;S<r;S++)for(var W=0;W<n;W++){if(++I>i)break e;E.push([a+W*(P+s),l+S*(B+c),P,B])}_(o,E,h)}else if(m)h=(k=m).animations;else{if(!g)return;var M,O;y=A.stage?A.stage.frame:WW.zdf;if("string"==typeof g&&(g=y.asset(g)),g.frames&&!Array.isArray(g.frames)){for(O in M=[],g.frames)j=g.frames[O].frame,M.push([j.x,j.y,j.w,j.h]);g.frames=M}if(g.frames&&!Array.isArray(g.frames[0])){for(M=[],O=0;O<g.frames.length;O++){var j=g.frames[O].frame;M.push([j.x,j.y,j.w,j.h])}g.frames=M}if(!g.images&&g.meta&&g.meta.image&&(g.images=[g.meta.image]),E=g.frames,h=g.animations,zot(o)){var L=g.images?g.images[0]:null;if(L&&L.split){var D=[];e.loop(g.images,(function(e){var t=e.split("/").pop();y.asset(t)&&"EmptyAsset"!=y.asset(t).type?D.push(y.asset(t)):y.asset(e)&&"EmptyAsset"!=y.asset(e).type||"EmptyAsset"!=y.asset(e).type?D.push(y.asset(e)):zon&&zogy("Sprite() - please preload Sprite in Frame or with loadAssets")})),_(D,E,h)}else k=new createjs.SpriteSheet(g)}else _(o,E,h)}function _(t,o,n){Array.isArray(t)||(t=[t]),e.loop(t,(function(e,o){t[o]=e.image}));var r={images:t,frames:o,animations:n||[]};k=new createjs.SpriteSheet(r)}this.animations=h,this.cjsSprite_constructor(k,z),zot(z)||this.stop(),zot(p)&&(p=e.makeID()),this.id=p,zot(f)&&(f=!0),A.globalControl=f;var Y,X=0;this.parseFrames=function(t,o,n,r){var i=[],a=Number.MAX_VALUE,l=0;if(zot(t))zot(o)&&(o=0),zot(n)&&(n=A.totalFrames-1),c(o,n);else{if(zot(A.animations)||zot(A.animations[t]))return[];s(A.animations[t])}function s(e){Array.isArray(e)?function(e){c(e[0],e[1],e[3]),e[2]&&!zot(A.animations[e[2]])&&s(A.animations[e[2]])}(e):e.constructor=={}.constructor?function(e){if(zot(e.frames))return;zot(e.speed)&&(e.speed=1);for(var t=0;t<e.frames.length;t++)e.speed<a&&(a=e.speed),e.speed>l&&(l=e.speed),i.push({f:e.frames[t],s:e.speed});e.next&&!zot(A.animations[e.next])&&s(A.animations[e.next])}(e):isNaN(e)||i.push({f:Math.floor(e),s:1})}function c(e,t,o){var n;if(zot(o)&&(o=1),t>e)for(n=e;n<=t;n++)r(n);else for(n=t;n<=e;n++)r(e-(n-t));function r(e){o<a&&(a=o),o>l&&(l=o),i.push({f:e,s:o})}}if(r)return i;a=e.constrain(e.decimals(a),.1),l=e.constrain(e.decimals(l),.1);for(var u,d=[],h=a!=l,g=0;g<i.length;g++)if(u=i[g],h)for(var p=0;p<e.constrain(Math.round(a<1?u.s/a:u.s),.1);p++)d.push(u.f);else d.push(u.f);return d},this.run=function(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,P,B,E,I,S){var W,M="time, label, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startFrame, endFrame, tweek, id, globalControl, pauseOnBlur";if(W=zob(A.run,arguments,M))return W;var O,j,L=t();if(zot(B)&&(B=1),zot(E)||(A.id=E),zot(I)||(A.globalControl=I),Array.isArray(n)){var D,_,R;O=[],j=0;for(var H=0;H<n.length;H++){(D=n[H]).lookup=A.parseFrames(D.label,D.startFrame,D.endFrame),0==H&&(R=D.lookup[0]),delete D.startFrame,delete D.endFrame,D.obj=e.merge(D.obj,{normalizedFrame:D.lookup.length-1}),D.set=e.merge(D.set,{normalizedFrames:{noPick:D.lookup},normalizedFrame:0}),zot(D.wait)&&(D.wait=j*B),_=D.label,delete D.label,O.push(D),j=0;var F=zot(D.time)?o:D.time;P-T>0&&(j=F/(P-T)/2)}if(0==O.length)return this;1==O.length?(o=O[0].time,n=_,N()):A.gotoAndStop(R)}else N();function N(){Y=A.parseFrames(n,T,P),X=0,A.gotoAndStop(Y[X]),T=P=null,O={normalizedFrame:Y.length-1}}zot(o)&&(o="s"==L?1:1e3),A.running&&A.stopAnimate(A.id),A.running=!0,Array.isArray(O)||(j=0,P-T>0&&(j=o/Math.abs(P-T)/2),Y&&Y.length>0&&(j=o/Y.length/2),zot(d)&&(d=j*B),zot(y)&&(y=j*B));var V=function(){A.running=!1,A.stop(),r&&"function"==typeof r&&r(i||A)};return e.animate({target:A,obj:O,time:o,ease:"linear",call:V,params:i,wait:a,waitedCall:l,waitedParams:s,loop:c,loopCount:u,loopWait:d,loopCall:h,loopParams:g,loopWaitCall:p,loopWaitParams:f,rewind:z,rewindWait:y,rewindCall:v,rewindParams:b,rewindWaitCall:w,rewindWaitParams:C,rewindTime:x,rewindEase:k,override:!1,pauseOnBlur:S,id:A.id}),A.runPaused=!1,A},this.runPaused=!0,this.pauseRun=function(t){return zot(t)&&(t=!0),A.runPaused=t,A.globalControl?e.pauseAnimate(t,A.id):A.pauseAnimate(t,A.id),A},this.stopRun=function(){return A.runPaused=!0,A.running=!1,A.globalControl?e.stopAnimate(A.id):A.stopAnimate(A.id),A},Object.defineProperty(this,"frame",{get:function(){return this.currentFrame},set:function(e){e=Math.round(e),this.paused?this.gotoAndStop(e):this.gotoAndPlay(e)}}),Object.defineProperty(this,"normalizedFrame",{get:function(){return X},set:function(e){X=Math.round(e),this.gotoAndStop(Y[X])}}),Object.defineProperty(this,"normalizedFrames",{get:function(){return Y},set:function(e){Y=e}}),Object.defineProperty(this,"totalFrames",{get:function(){return k.getNumFrames()},set:function(){zogy("zim.Sprite - totalFrames is read only")}}),!1!==v&&e.styleTransforms(this,T),this.clone=function(){return this.cloneProps(new e.Sprite(o,n,r,i,a,l,s,c,u,d,h,g,null,f,m,z,y,v,this.group,w))},createjs&&!createjs.stageTransformable&&y.retina&&(this.localToGlobal=function(t,o){return e.localToGlobal(t,o,this,this.cjsSprite_localToGlobal)},this.globalToLocal=function(t,o){return e.globalToLocal(t,o,this,this.cjsSprite_globalToLocal)},this.localToLocal=function(t,o,n){return e.localToLocal(t,o,n,this)}),this.hasProp=function(e){return!zot(this[e])||Object.prototype.hasOwnProperty.call(this,e)},e.displayBase(A),this.dispose=function(){e.gD(this),this.dispatchEvent("removed"),this.removeAllEventListeners(),this.parent&&this.parent.removeChild(this)}},e.extend(e.Sprite,createjs.Sprite,["clone","localToLocal","localToGlobal","globalToLocal"],"cjsSprite",!1),zimify(e.Sprite.prototype),e.MovieClip=function(t,o,n,r,i,a,l){var s,c="mode, startPosition, loop, labels, style, group, inherit";if(s=zob(e.MovieClip,arguments,c,this))return s;z_d("50.9"),this.type="MovieClip",this.group=a;var u=!1===i?{}:e.getStyle(this.type,this.group,l);zot(t)&&(t=null!=u.mode?u.mode:null),zot(o)&&(o=null!=u.startPosition?u.startPosition:null),zot(n)&&(n=null!=u.loop?u.loop:null),zot(r)&&(r=null!=u.labels?u.labels:null),this.cjsMovieClip_constructor(t,o,n,r),!1!==i&&e.styleTransforms(this,u),this.clone=function(){return this.cloneProps(new e.MovieClip(t,o,n,r,i,this.group,l))},this.hasProp=function(e){return!zot(this[e])||Object.prototype.hasOwnProperty.call(this,e)};var d=WW.zdf||1;createjs&&!createjs.stageTransformable&&d.retina&&(this.localToGlobal=function(t,o){return e.localToGlobal(t,o,this,this.cjsMovieClip_localToGlobal)},this.globalToLocal=function(t,o){return e.globalToLocal(t,o,this,this.cjsMovieClip_globalToLocal)},this.localToLocal=function(t,o,n){return e.localToLocal(t,o,n,this)}),e.displayBase(this),this.dispose=function(){e.gD(this),this.dispatchEvent("removed"),this.removeAllEventListeners(),this.parent&&this.parent.removeChild(this)}},e.extend(e.MovieClip,createjs.MovieClip,["clone","localToLocal","localToGlobal","globalToLocal"],"cjsMovieClip",!1),zimify(e.MovieClip.prototype),e.SVGContainer=function(t,o,n,r,i,a,l,s){var c,u="svg, splitTypes, geometric, showControls, interactive, style, group, inherit";if(c=zob(e.SVGContainer,arguments,u,this))return c;z_d("50.95"),this.group=l;var d=!1===a?{}:e.getStyle("SVGContainer",this.group,s);t&&"Bitmap"==t.type&&(t=t.svg);var h,g,p,f=this,m=new e.Point(0,0);function z(){function e(e,o){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],n=!0,r=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(n=(a=l.next()).done)&&(o.push(a.value),!t||o.length!==t);n=!0);}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}return o}(e,o)||function(e,o){if(!e)return;if("string"==typeof e)return t(e,o);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(e,o)}(e,o)||function(){throw new TypeError("Invalid")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var o=2*Math.PI,n=function(e,t,o,n,r,i,a){var l=e.x,s=e.y;return{x:n*(l*=t)-r*(s*=o)+i,y:r*l+n*s+a}},r=function(e,t){var o=1.5707963267948966===t?.551915024494:-1.5707963267948966===t?-.551915024494:4/3*Math.tan(t/4),n=Math.cos(e),r=Math.sin(e),i=Math.cos(e+t),a=Math.sin(e+t);return[{x:n-r*o,y:r+n*o},{x:i+a*o,y:a-i*o},{x:i,y:a}]},i=function(e,t,o,n){var r=e*o+t*n;return r>1&&(r=1),r<-1&&(r=-1),(e*n-t*o<0?-1:1)*Math.acos(r)};return function(t){var a=t.px,l=t.py,s=t.cx,c=t.cy,u=t.rx,d=t.ry,h=t.xAxisRotation,g=void 0===h?0:h,p=t.largeArcFlag,f=void 0===p?0:p,m=t.sweepFlag,z=void 0===m?0:m,y=[];if(0===u||0===d)return[];var v=Math.sin(g*o/360),b=Math.cos(g*o/360),w=b*(a-s)/2+v*(l-c)/2,C=-v*(a-s)/2+b*(l-c)/2;if(0===w&&0===C)return[];u=Math.abs(u),d=Math.abs(d);var x=Math.pow(w,2)/Math.pow(u,2)+Math.pow(C,2)/Math.pow(d,2);x>1&&(u*=Math.sqrt(x),d*=Math.sqrt(x));var k=function(e,t,n,r,a,l,s,c,u,d,h,g){var p=Math.pow(a,2),f=Math.pow(l,2),m=Math.pow(h,2),z=Math.pow(g,2),y=p*f-p*z-f*m;y<0&&(y=0),y/=p*z+f*m;var v=(y=Math.sqrt(y)*(s===c?-1:1))*a/l*g,b=y*-l/a*h,w=d*v-u*b+(e+n)/2,C=u*v+d*b+(t+r)/2,x=(h-v)/a,k=(g-b)/l,T=(-h-v)/a,A=(-g-b)/l,P=i(1,0,x,k),B=i(x,k,T,A);return 0===c&&B>0&&(B-=o),1===c&&B<0&&(B+=o),[w,C,P,B]}(a,l,s,c,u,d,f,z,v,b,w,C),T=e(k,4),A=T[0],P=T[1],B=T[2],E=T[3],I=Math.abs(E)/(o/4);Math.abs(1-I)<1e-7&&(I=1);var S=Math.max(Math.ceil(I),1);E/=S;for(var W=0;W<S;W++)y.push(r(B,E)),B+=E;return y.map((function(e){var t=n(e[0],u,d,b,v,A,P),o=t.x,r=t.y,i=n(e[1],u,d,b,v,A,P),a=i.x,l=i.y,s=n(e[2],u,d,b,v,A,P);return{x1:o,y1:r,x2:a,y2:l,x:s.x,y:s.y}}))}}function y(t){e.loop(t,(function(e){var t=e.tagName.toLowerCase();if("path"==t&&Y(e),"circle"==t&&b("circle",e),"rect"==t&&b("rect",e),"ellipse"==t&&b("ellipse",e),"line"==t&&b("line",e),"polygon"==t&&b("polygon",e),"polyline"==t&&b("polyline",e),"g"==t){var o,n,r,i,a,l=e.getAttribute("style");if(l){var s=v(l);o=s[0],n=s[1],r=s[2],i=s[3],a=s[4]}A=e.getAttribute("transform"),B=e.getAttribute("fill")?e.getAttribute("fill"):zot(o)?P:o,I=e.getAttribute("stroke")?e.getAttribute("stroke"):zot(n)?E:n,W=e.getAttribute("stroke-width")?e.getAttribute("stroke-width"):zot(r)?S:r,O=e.getAttribute("fill-opacity")?e.getAttribute("fill-opacity"):zot(i)?M:i,L=e.getAttribute("stroke-opacity")?e.getAttribute("stroke-opacity"):zot(a)?j:a}y(e.children),"g"==e.tagName.toLowerCase()&&(B=P,I=E,W=S,O=M,L=j,A=null)}))}function v(t){var o,n,r,i,a,l=t.split(";");return e.loop(l,(function(e){var t=(e=e.replace(/,/g,"")).split(":"),l=t[0].trim().toLowerCase(),s=t[1].trim().toLowerCase().replace("px","");"fill"==l&&(o=s),"stroke"==l&&(n=s),"stroke-width"==l&&(r=s),"opacity"==l&&(i=s,a=s),"fill-opacity"==l&&(i=s),"stroke-opacity"==l&&(a=s)})),[o,n,r,i,a]}function b(t,o){var a,l=_(o),s=l[0],c=l[1],u=l[2],d=l[5],h=l[6];if("circle"==t){var g=Number(o.getAttribute("r").trim()),p=.5523*g;a=n?new e.Circle(Number(o.getAttribute("r")),s,c,u):new e.Blob(s,c,u,4,g,p,"mirror",null,r,null,null,null,null,null,null,null,null,null,null,null,i)}else if("rect"==t)if(n)a=new e.Rectangle(Number(o.getAttribute("width")),Number(o.getAttribute("height")),s,c,u,Number(o.getAttribute("rx")));else{var m=Number(o.getAttribute("width")),z=Number(o.getAttribute("height")),y=Number(o.getAttribute("rx")),v=Number(o.getAttribute("ry"));if(y&&v){var b=.5523*y,x=.5523*v;a=new e.Blob(s,c,u,[[y,0,0,0,-b,0,0,0,"free"],[m-y,0,0,0,0,0,b,0,"free"],[m,v,0,0,0,-x,0,0,"free"],[m,z-v,0,0,0,0,0,x,"free"],[m-y,z,0,0,b,0,0,0,"free"],[y,z,0,0,0,0,-b,0,"free"],[0,z-v,0,0,0,x,0,0,"free"],[0,v,0,0,0,0,0,-x,"free"]],null,null,null,null,r,null,null,null,null,null,null,null,null,null,null,null,i)}else a=new e.Blob(s,c,u,[[0,0],[m,0],[m,z],[0,z]],null,null,null,null,r,null,null,null,null,null,null,null,null,null,null,null,i)}else if("line"==t)a=new e.Squiggle(c,u,[[Number(o.getAttribute("x1")),Number(o.getAttribute("y1"))],[Number(o.getAttribute("x2")),Number(o.getAttribute("y2"))]],null,null,null,null,r,null,null,null,null,null,null,null,null,null,null,null,i);else if("polygon"==t||"polyline"==t){var k=o.getAttribute("points");k=(k=k.replace(/-/g," -")).replace(/\s+/g," ");var T,P=[];if(-1!=k.indexOf(","))e.loop(k.split(" "),(function(e){var t=e.split(",");P.push([Number(t[0].trim()),Number(t[1].trim())])}));else e.loop(k.split(" "),(function(e,t){(t+1)%2==0&&P.push([T,e.trim()]),T=e.trim()}));a="polygon"==t?new Blob(s,c,u,P):new e.Squiggle(c,u,P,null,null,null,null,r,null,null,null,null,null,null,null,null,null,null,null,i)}else"ellipse"==t&&(a=new e.Blob(s,c,u,C(0,0,Number(o.getAttribute("rx")),Number(o.getAttribute("ry"))),null,null,null,null,r,null,null,null,null,null,null,null,null,null,null,null,i));a.loc(d,h,f);var B=o.getAttribute("transform");(B||A)&&w(a,B||A),!i||"Rectangle"!=a.type&&"Circle"!=a.type||a.transform({showReg:!1,visible:r})}function w(t,o){var n=o.split(")");e.loop(n,(function(e){if(""!=e){var o=e.trim().split("("),n=o[0].trim().toLowerCase(),r=o[1].trim().toLowerCase().replace("px","").replace("deg","");if("translate"==n){var i=r.split(",");t.mov(Number(i[0].trim()),i[1]?Number(i[1].trim()):0)}if("scale"==n){var a=r.split(",");"Blob"==t.type||"Squiggle"==t.type?1==a.length?t.transformPoints("scale",Number(a[0].trim())):2==a.length&&(t.transformPoints("scaleX",Number(a[0].trim())),t.transformPoints("scaleY",Number(a[1].trim()))):1==a.length?t.sca(Number(a[0].trim())):2==a.length&&t.sca(Number(a[0].trim()),Number(a[1].trim()))}if("rotate"==n){var l=r.split(",");1==l.length?l.push(0,0):2==l.length&&l.push(0),t.rot(Number(l[0].trim()),Number(l[1].trim()),Number(l[2].trim()))}"skewX"==n&&(t.skewX=r),"skewY"==n&&(t.skewY=r)}}))}function C(e,t,o,n){var r=.5522848,i=o*r,a=n*r,l=e+o,s=t+n;return[[e-o,t,0,0,e,s+a-n,e,t-a,"mirror"],[e,t-n,0,0,e-i,t,l+i-o,t,"mirror"],[l,t,0,0,e,t-a,e+i-i,s+a-n,"mirror"],[e,s,0,0,l-o+i,t,e-i,t,"mirror"]]}if(zot(o)&&(o=!1),zot(n)&&(n=!0),!zot(t)){if(t.replace&&(t=t.replace(/style\s?=[^"]*"[^"]*"/gi,"")),zot(t.draggable))t.getAttribute||(g=new DOMParser,t=g.parseFromString(t,"image/svg+xml").documentElement),p=this.svg=t;else{g=new DOMParser;var x=(t=t.innerHTML?g.parseFromString(t.innerHTML,"text/xml"):t).getElementsByTagName("svg");p=this.svg=x?t.getElementsByTagName("svg")[0]:null}var k,T;if(zot(p)||(k=p.getAttribute("width"),T=p.getAttribute("height")),k&&(k=Number(k.trim())),T&&(T=Number(T.trim())),this.zimContainer_constructor(k,T),this.type="SVGContainer",zot(p))return;var A,P=e.black,B=e.black,E=e.black,I=e.black,S=2,W=2,M=1,O=1,j=1,L=1,D=t.getElementsByTagName("svg");0==D.length&&(D=[t]),y(D)}function _(t){var o,n,r,i,a,l=t.getAttribute("style");if(l){var s=v(l);o=s[0],n=s[1],r=s[2],i=s[3],a=s[4]}o=t.getAttribute("fill")?t.getAttribute("fill"):zot(o)?B:o,n=t.getAttribute("stroke")?t.getAttribute("stroke"):zot(n)?I:n,r=t.getAttribute("stroke-width")?t.getAttribute("stroke-width"):zot(r)?W:r,i=t.getAttribute("fill-opacity")?t.getAttribute("fill-opacity"):zot(i)?O:i,a=t.getAttribute("stroke-opacity")?t.getAttribute("stroke-opacity"):zot(a)?L:a;var c=t.getAttribute("x")?t.getAttribute("x"):0;c=t.getAttribute("cx")?t.getAttribute("cx"):c;var u=t.getAttribute("y")?t.getAttribute("y"):0;return u=t.getAttribute("cy")?t.getAttribute("cy"):u,zot(i)||zot(o)||(o=e.convertColor(o,"rgba",Number(i))),zot(a)||zot(n)||(n=e.convertColor(n,"rgba",Number(a))),[o,n,Number(r),Number(i),Number(a),Number(c),Number(u)]}function Y(t,n){zot(n)&&(n=!0);var a,l,s,c=["M","m","L","l","H","h","V","v","C","c","S","s","Q","q","T","t","A","a","z","Z"],u=["m","l","h","v","c","s","q","t","a","z"],d=new e.Point(0,0);if(a=(a=(a=(a=(a=(a=zot(t.getAttribute)?t:t.getAttribute("d")).replace(/,/g," ")).replace(/([a-zA-Z])/g," $1 ")).replace(/-/g," -")).replace(/\s+/g," ")).replace(/\.(\d*)\./g,".$1 ."),n)var g=_(t),p=g[0],y=g[1],v=g[2];var b,C,x=[],k=[0,0],T=new e.Point(0,0),P=new e.Point(0,0,0,0),B=new e.Point(0,0,0,0,0,0),E=new e.Point(0,0,0,0,0,0,0),I=a.split(" "),S=I.slice(1,I.length),W=[],M=!1,O=!1,j="squiggle",L=null;function D(){b=W[W.length-1],x.length>=2&&("z"!=b&&"Z"!=b||(j="blob")),(l="squiggle"==j?new e.Squiggle(y,v,x,null,null,null,null,r,null,null,null,null,null,null,null,null,null,null,null,i):new e.Blob(p,y,v,x,null,null,null,null,r,null,null,null,null,null,null,null,null,null,null,null,i)).loc(0,0,f),b=W[W.length-1],W[W.length-2],u.indexOf(b)>=0?(k[0]=x[x.length-1][0],k[1]=x[x.length-1][1],m.x=x[x.length-1][0],m.y=x[x.length-1][1],(x=[]).push([k[0],k[1]])):(k=[0,0],x=[[0,0]]),W=[],"z"!=b&&"Z"!=b&&W.push(b),d.x=0,d.y=0;var o=t.getAttribute("transform");(o||A)&&w(l,o||A)}return e.loop(S,(function(t,n){var r;if(0==n&&(m.x=0,m.y=0,k=[0,0],b="",""),-1==c.indexOf(t)){if("lxo"==C&&(C="lx",W.push("l"),M=!0),"lyo"==C&&(C="ly",M=!0),"Lxo"==C&&(C="Lx",W.push("L"),M=!0),"Lyo"==C&&(C="Ly",M=!0),s=Number(t),s=Math.round(100*s)/100,"X"==C?(m.x=s,C="Y"):"Y"==C?(m.y=s,C="Lxo",x.push([m.x,m.y])):"x"==C?(m.x=m.x+s,C="y"):"y"==C&&(m.y=m.y+s,C="lxo",x.push([m.x,m.y])),"H"==C||"h"==C?(d.x=x[x.length-1][0],d.y=x[x.length-1][1],d.x=d.x+("h"==C?s:s-m.x),x.push([d.x,d.y]),C="Lx"):"V"!=C&&"v"!=C||(d.x=x[x.length-1][0],d.y=x[x.length-1][1],d.y=d.y+("v"==C?s:s-m.y),x.push([d.x,d.y]),C="lx"),"Lx"==C?(T.x=s,C="Ly"):"Ly"==C?(T.y=s,d.x=T.x,d.y=T.y,x.push([d.x,d.y]),C="Lx"):"lx"==C?(W.length>0&&(0!=d.x&&0!=d.y?(m.x=d.x,m.y=d.y):(m.x=d.x+m.x,m.y=d.y+m.y)),T.x=m.x+s,C=M?"lyo":"ly"):"ly"==C&&(T.y=m.y+s,d.x=T.x,d.y=T.y,x.push([d.x,d.y]),C="lx"),"qx"==C||"Qx"==C?(x.length>0?(m.x=x[x.length-1][0],m.y=x[x.length-1][1]):(m.x=0,m.y=0),P.x="qx"==C?m.x+s:s,C="qx"==C?"qy":"Qy"):"qy"==C||"Qy"==C?(P.y="qy"==C?m.y+s:s,C="qy"==C?"qz":"Qz",O&&(O=!1,(r=x[x.length-1])[6]=-r[4],r[7]=-r[5],r[8]="mirror",d.x=P.x,d.y=P.y,x[x.length]=[d.x,d.y,0,0,-r[6],r[7],0,0,"free"],C="qy"==C?"qx":"Qx")):"qz"==C||"Qz"==C?(P.z="qz"==C?m.x+s:s,C="qz"==C?"qq":"Qq"):"qq"!=C&&"Qq"!=C||(P.w="qq"==C?m.y+s:s,r=x[x.length-1],d.x=r[0],d.y=r[1],1==x.length?(r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=2/3*(P.x-d.x),r[7]=2/3*(P.y-d.y),r[8]="free"):x[x.length]=[d.x,d.y,0,0,0,0,2/3*(P.x-d.x),2/3*(P.y-d.y),"free"],d.x=P.z,d.y=P.w,x[x.length]=[d.x,d.y,0,0,2/3*(P.x-d.x),2/3*(P.y-d.y),0,0,"free"],C="qq"==C?"qx":"Qx"),"cx"==C||"Cx"==C)x.length>0?(m.x=x[x.length-1][0],m.y=x[x.length-1][1]):(m.x=0,m.y=0),B.x="cx"==C?m.x+s:s,C="cx"==C?"cy":"Cy";else if("cy"==C||"Cy"==C)B.y="cy"==C?m.y+s:s,C="cy"==C?"cz":"Cz";else if("cz"==C||"Cz"==C)B.z="cz"==C?m.x+s:s,C="cz"==C?"cq":"Cq";else if("cq"==C||"Cq"==C)B.q="cq"==C?m.y+s:s,C="cq"==C?"cr":"Cr",O&&("s"==b?"s":"S",(r=x[x.length-1])[2]=0,r[3]=0,zot(r[4])&&(r[4]=0),zot(r[5])&&(r[5]=0),r[6]=-r[4],r[7]=-r[5],r[8]="mirror",d.x=B.z,d.y=B.q,x[x.length]=[d.x,d.y,0,0,B.x-d.x,B.y-d.y,0,0,"free"],C="cr"==C?"cx":"Cx");else if("cr"==C||"Cr"==C)B.r="cr"==C?m.x+s:s,C="cr"==C?"cs":"Cs";else if("cs"==C||"Cs"==C)B.s="cs"==C?m.y+s:s,r=x[x.length-1],1==x.length&&(r[2]=0,r[3]=0,r[4]=0,r[5]=0),r[6]=B.x-r[0],r[7]=B.y-r[1],r[8]="free",d.x=B.r,d.y=B.s,x[x.length]=[d.x,d.y,0,0,B.z-d.x,B.q-d.y,0,0,"free"],C="cs"==C?"cx":"Cx";else if("ax"==C||"Ax"==C)x.length>0?(m.x=x[x.length-1][0],m.y=x[x.length-1][1]):(m.x=0,m.y=0),E.x=s,C="ax"==C?"ay":"Ay";else if("ay"==C||"Ay"==C)E.y=s,C="ay"==C?"az":"Az";else if("az"==C||"Az"==C)E.z=s,C="az"==C?"aq":"Aq";else if("aq"==C||"Aq"==C)E.q=s,C="aq"==C?"ar":"Ar";else if("ar"==C||"Ar"==C)E.r=s,C="ar"==C?"as":"As";else if("as"==C||"As"==C)E.s="as"==C?m.x+s:s,C="as"==C?"at":"At";else if("at"==C||"At"==C){E.t="at"==C?m.y+s:s,h||(h=z());var i=h({px:m.x,py:m.y,cx:E.s,cy:E.t,rx:E.x,ry:E.y,xAxisRotation:E.z,largeArcFlag:E.q,sweepFlag:E.r});e.loop(i,(function(e,t){r=x[x.length-1],1==x.length&&(r[2]=0,r[3]=0,r[4]=0,r[5]=0),0==t&&1==x.length?(r[6]=e.x1-d.x-m.x,r[7]=e.y1-d.y-m.y):(r[6]=e.x1-d.x,r[7]=e.y1-d.y),r[8]="free",d.x=e.x,d.y=e.y,x[x.length]=[d.x,d.y,0,0,e.x2-d.x,e.y2-d.y,0,0,"free"]})),C="at"==C?"ax":"Ax"}}else W.push(t),"s"!=t&&(O=!1),W.length>1&&("M"!=t&&"m"!=t||(D(),"M"==t?(m.x=0,m.y=0):(m.x=x[x.length-1][0],m.y=x[x.length-1][1]),x=[],(W=[]).push(t))),"M"==t?C="X":"m"==t?C="x":"L"==t?(C="Lx",o&&L&&"l"!=L&&D(),L="l"):"l"==t?(C="lx",o&&L&&"l"!=L&&D(),L="l"):"H"==t?(C="H",o&&L&&"l"!=L&&D(),L="l"):"h"==t?(C="h",o&&L&&"l"!=L&&D(),L="l"):"V"==t?(C="V",o&&L&&"l"!=L&&D(),L="l"):"v"==t?(C="v",o&&L&&"l"!=L&&D(),L="l"):"C"==t?(C="Cx",o&&L&&"c"!=L&&D(),L="c"):"c"==t?(C="cx",o&&L&&"c"!=L&&D(),L="c"):"S"==t?(O=!0,C="Cx",o&&L&&"c"!=L&&D(),L="c"):"s"==t?(O=!0,C="cx",o&&L&&"c"!=L&&D(),L="c"):"Q"==t?(C="Qx",o&&L&&"q"!=L&&D(),L="q"):"q"==t?(C="qx",o&&L&&"q"!=L&&D(),L="q"):"T"==t?(O=!0,C="Qx",o&&L&&"q"!=L&&D(),L="q"):"t"==t?(O=!0,C="qx",o&&L&&"q"!=L&&D(),L="q"):"A"==t?(C="Ax",o&&L&&"a"!=L&&D(),L="a"):"a"==t?(C="ax",o&&L&&"a"!=L&&D(),L="a"):"z"!=t&&"Z"!=t||(j="blob")})),n&&D(),x}f.processPath=function(e){return Y(e,!1)},!1!==a&&e.styleTransforms(this,d),this.clone=function(){return f.cloneProps(new e.SVGContainer(t,o,n,r,i,a,this.group,s))}},e.extend(e.SVGContainer,e.Container,"clone","zimContainer",!1),e.CustomShape=function(t,o,n,r){e.zimCustomShapeCheck||(z_d("50.97"),e.zimCustomShapeCheck=!0),this.zimContainer_constructor(t,o,n,r,!1);var i=this;this.mouseChildren=!1,i._dashedOffset=5,Object.defineProperty(i,"color",{get:function(){return i._color},set:function(e){zot(e)&&(e="black"),i._color=e,e&&e.type?i.specialColor(i.colorCommand,e,i):i.colorCommand.style=e}}),this.setColorRange=function(e,t){return zot(t)?(i.startColor=i.color,i.endColor=e):zot(e)?(i.startColor=i.color,i.endColor=t):(i.startColor=e,i.endColor=t),i},i._colorRange=0,Object.defineProperty(i,"colorRange",{get:function(){return i._colorRange},set:function(t){i._colorRange=t,zot(i.startColor)||zot(i.endColor)||(i.color=e.colorRange(i.startColor,i.endColor,t))}}),Object.defineProperty(i,"borderColor",{get:function(){return i._borderColor},set:function(e){i._borderColor=e,e&&!i.borderWidth&&(i.borderWidth=1),i.borderColorCommand?e&&e.type?i.specialColor(i.borderColorCommand,e,i):i.borderColorCommand.style=e:i.drawShape()}}),Object.defineProperty(i,"borderWidth",{get:function(){return i._borderWidth},set:function(e){e>0||(e=0),i._borderWidth=e,i.borderWidthCommand&&0!=i._borderWidth?(i.borderWidthCommand.width=i._borderWidth,i._dashed&&(i.borderDashedCommand.segments=i._dashed,i.borderDashedCommand.offset=i._dashedOffset)):(i.borderWidthCommand=null,i.drawShape())}}),Object.defineProperty(i,"thickness",{get:function(){return i._thickness},set:function(e){e>0||(e=0),i._thickness=e,i.thicknessCommand&&0!=i._thickness?(i.thicknessCommand.width=i._thickness,i._dashed&&(i.dashedCommand.segments=i._dashed,i.dashedCommand.offset=i._dashedOffset)):i.drawShape()}}),Object.defineProperty(i,"dashed",{get:function(){return i._dashed},set:function(e){var t;if(i._dashed=e,e&&!Array.isArray(i._dashed)&&(i.dashed=[10,10]),"Squiggle"==i.type||"Line"==i.type){if(!i.thicknessCommand||0==i._thickness)return;t=i.dashedCommand}else{if(!i.borderWidthCommand||0==i._borderWidth)return;t=i.borderDashedCommand}t?i._dashed?(t.segments=i._dashed,t.offset=i._dashedOffset):(t.segments=null,t.offset=null):i.drawShape()}}),Object.defineProperty(i,"dashedOffset",{get:function(){return i._dashedOffset},set:function(e){var t;if(isNaN(e)&&(e=5),i._dashedOffset=e,"Squiggle"==i.type||"Line"==i.type){if(!i.thicknessCommand||0==i._thickness)return;t=i.dashedCommand}else{if(!i.borderWidthCommand||0==i._borderWidth)return;t=i.borderDashedCommand}t?i._dashed?(t.segments=i._dashed,t.offset=i._dashedOffset):(t.segments=null,t.offset=null):i.drawShape()}}),Object.defineProperty(i,"corner",{get:function(){return i._corner},set:function(e){i._corner=e,i.drawShape()}}),this.linearGradient=function(e,t,o,n,r,i){return this.linearGradientParams=Array.prototype.slice.call(arguments),this.colorCommand.linearGradient(e,t,o,n,r,i),this},this.radialGradient=function(e,t,o,n,r,i,a,l){return this.radialGradientParams=Array.prototype.slice.call(arguments),this.colorCommand.radialGradient(e,t,o,n,r,i,a,l),this},this.cloneAll=function(t,o,n,r){var i=this.getBounds();zot(i)&&(i={x:null,y:null,width:null,height:null});var a=this.cloneChildren(this.cloneProps(new e.Container(i.x,i.y,i.width,i.height,o,n,r)),t);return a.mouseChildren=!1,a.type=this.type,a}},e.extend(e.CustomShape,e.Container,null,"zimContainer",!1),e.Circle=function(t,o,n,r,i,a,l,s,c,u,d){var h,g="radius, color, borderColor, borderWidth, dashed, percent, percentClose, strokeObj, style, group, inherit";if(h=zob(e.Circle,arguments,g,this))return h;z_d("51"),this.zimCustomShape_constructor(null,null,null,null,!1),this.type="Circle",this.group=u;var p=!1===c?{}:e.getStyle(this.type,this.group,d);zot(t)&&(t=null!=p.radius?p.radius:50),zot(i)&&(i=null!=p.dashed&&p.dashed),zot(n)&&(n=null!=p.borderColor?p.borderColor:null),zot(r)&&(r=null!=p.borderWidth?p.borderWidth:null),n<0||r<0?n=r=null:null!=n&&null==r&&(r=1),zot(o)&&(o=null!=p.color?p.color:r>0?"rgba(0,0,0,0)":"black"),zot(a)&&(a=null!=p.percent?p.percent:100),zot(l)&&(l=null==p.percentClose||p.percentClose),zot(s)&&(s=null!=p.strokeObj?p.strokeObj:{});var f=m(t,o,n,r,a);function m(){return arguments}t=e.Pick.choose(t),o=e.Pick.choose(o),n=e.Pick.choose(n),r=e.Pick.choose(r),a=e.Pick.choose(a);var z=this;z._radius=t,z._color=o,z._borderColor=n,z._borderWidth=r,z._dashed=i,z._dashed&&!Array.isArray(z._dashed)&&(z._dashed=[10,10]);var y=this.shape=new createjs.Shape;this.addChild(y);var v=y.graphics;z.drawShape=function(){v.c(),z.colorCommand=v.f(z._color).command,z._color&&z._color.type&&z.specialColor(z.colorCommand,z._color,z),(zot(z._borderWidth)||z._borderWidth>0)&&(zot(z._borderColor)&&zot(z._borderWidth)||(zot(z._borderColor)&&(z._borderColor="black"),z.borderColorCommand=v.s(z._borderColor).command,z._borderColor&&z._borderColor.type&&z.specialColor(z.borderColorCommand,z._borderColor,z),z.borderWidthCommand=v.ss(z._borderWidth,s.caps,s.joints,s.miterLimit,s.ignoreScale).command,z._dashed&&(z.borderDashedCommand=v.sd(Array.isArray(z._dashed)?z._dashed:[10,10],z._dashedOffset).command)));var e=2*z._radius;if("number"==typeof a&&a>=0&&a<100){var t=360*a/100/2;v.arc(0,0,z._radius,(-t-90)*Math.PI/180,(t-90)*Math.PI/180,!1),l&&v.cp(),e=z._radius-Math.cos(t*Math.PI/180)*z._radius}else v.dc(0,0,z._radius);z.setBounds(-z._radius,-z._radius,2*z._radius,e)},z.drawShape(),o.type&&(z.color=o),Object.defineProperty(z,"radius",{get:function(){return z._radius},set:function(e){z._radius=e,z.drawShape()}}),Object.defineProperty(z,"percentage",{get:function(){return a},set:function(e){a=e,z.drawShape()}}),Object.defineProperty(z,"percentClose",{get:function(){return l},set:function(e){l=e,z.drawShape()}}),!1!==c&&e.styleTransforms(this,p),this.clone=function(t){var o=z.cloneProps(new e.Circle(t||!e.isPick(f[0])?z.radius:f[0],t||!e.isPick(f[1])?z.color:f[1],t||!e.isPick(f[2])?z.borderColor:f[2],t||!e.isPick(f[3])?z.borderWidth:f[3],z.dashed,t||!e.isPick(f[4])?a:f[4],l,s,c,this.group,d));return z.linearGradientParams&&o.linearGradient.apply(o,z.linearGradientParams),z.radialGradientParams&&o.radialGradient.apply(o,z.radialGradientParams),o}},e.extend(e.Circle,e.CustomShape,"clone","zimCustomShape",!1),e.Rectangle=function(t,o,n,r,i,a,l,s,c,u,d,h){var g,p="width, height, color, borderColor, borderWidth, corner, dashed, strokeObj, scaleDimensions, style, group, inherit";if(g=zob(e.Rectangle,arguments,p,this))return g;z_d("52"),this.zimCustomShape_constructor(null,null,null,null,!1),this.type="Rectangle",this.group=d;var f=!1===u?{}:e.getStyle(this.type,this.group,h);zot(t)&&(t=null!=f.width?f.width:null),zot(o)&&(o=null!=f.height?f.height:zot(t)?100:t),zot(t)&&(t=o),zot(a)&&(a=null!=f.corner?f.corner:0),zot(l)&&(l=null!=f.dashed&&f.dashed),zot(r)&&(r=null!=f.borderColor?f.borderColor:null),zot(i)&&(i=null!=f.borderWidth?f.borderWidth:null),r<0||i<0?r=i=null:null!=r&&null==i&&(i=1),zot(n)&&(n=null!=f.color?f.color:i>0?"rgba(0,0,0,0)":"black"),zot(s)&&(s=null!=f.strokeObj?f.strokeObj:{}),zot(c)&&(c=null==f.scaleDimensions||f.scaleDimensions);var m=z(t,o,n,r,i);function z(){return arguments}t=e.Pick.choose(t),o=e.Pick.choose(o),n=e.Pick.choose(n),r=e.Pick.choose(r),i=e.Pick.choose(i);var y=this;y._color=n,y._borderColor=r,y._borderWidth=i,y._dashed=l,y._dashed&&!Array.isArray(y._dashed)&&(y._dashed=[10,10]),y._corner=a,y.scaleDimensions=c,y.setWidth=function(e){t=e},y.setHeight=function(e){o=e};var v=this.shape=new createjs.Shape;this.addChild(v);var b=v.graphics;y.drawShape=function(){if(b.c(),y.colorCommand=b.f(y._color).command,n&&n.type&&y.specialColor(y.colorCommand,n,y),(zot(y._borderWidth)||y._borderWidth>0)&&(zot(y._borderColor)&&zot(y._borderWidth)||(zot(y._borderColor)&&(y._borderColor="black"),y.borderColorCommand=b.s(y._borderColor).command,y._borderColor&&y._borderColor.type&&y.specialColor(y.borderColorCommand,y._borderColor,y),y.borderWidthCommand=b.ss(y._borderWidth,s.caps,s.joints,s.miterLimit,s.ignoreScale).command,y._dashed&&(y.borderDashedCommand=b.sd(Array.isArray(y._dashed)?y._dashed:[10,10],y._dashedOffset).command))),Array.isArray(y._corner)){var e=y._corner;Array.isArray(e)&&2==e.length&&(e=[e,e,e,e]);for(var r=[],i=!1,a=0;a<e.length;a++)Array.isArray(e[a])?(i=!0,r.push(e[a])):r.push([e[a],e[a]]);e=r,i?b.mt(0,e[0][1]).curveTo(0,0,e[0][0],0).lt(t-e[1][0],0).curveTo(t,0,t,e[1][1]).lt(t,o-e[2][1]).curveTo(t,o,t-e[2][0],o).lt(e[3][0],o).curveTo(0,o,0,o-e[3][1]).cp():b.rc(0,0,t,o,y._corner[0],y._corner[1],y._corner[2],y._corner[3])}else y._corner>0?b.rr(0,0,t,o,y._corner):b.r(0,0,t,o);y.setBounds(0,0,t,o),n.type&&(y.color=n)},y.drawShape(),!1!==u&&e.styleTransforms(this,f),this.clone=function(n){return y.cloneProps(new e.Rectangle(n||!e.isPick(m[0])?t:m[0],n||!e.isPick(m[1])?o:m[1],n||!e.isPick(m[2])?y.color:m[2],n||!e.isPick(m[3])?y.borderColor:m[3],n||!e.isPick(m[4])?y.borderWidth:m[4],a,y._dashed,s,y.scaleDimensions,u,this.group,h))}},e.extend(e.Rectangle,e.CustomShape,"clone","zimCustomShape",!1),e.Triangle=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p){var f,m="a, b, c, color, borderColor, borderWidth, corner, center, adjust, dashed, strokeObj, style, group, inherit";if(f=zob(e.Triangle,arguments,m,this))return f;z_d("53"),this.zimCustomShape_constructor(null,null,null,null,!1),this.type="Triangle",this.group=g;var z=!1===h?{}:e.getStyle(this.type,this.group,p);zot(t)&&(t=null!=z.a?z.a:100),zot(o)&&(o=null!=z.b?z.b:t),zot(n)&&(n=null!=z.c?z.c:o),-1==n&&(n=Math.sqrt(Math.pow(t,2)+Math.pow(o,2))),zot(l)&&(l=null!=z.corner?z.corner:0),zot(s)&&(s=null==z.center||z.center),zot(c)&&(c=null!=z.adjust?z.adjust:0),zot(i)&&(i=null!=z.borderColor?z.borderColor:null),zot(a)&&(a=null!=z.borderWidth?z.borderWidth:null),i<0||a<0?i=a=null:null!=i&&null==a&&(a=1),zot(r)&&(r=null!=z.color?z.color:a>0?"rgba(0,0,0,0)":"black"),zot(c)&&(c=null!=z.adjust?z.adjust:0),zot(d)&&(d=null!=z.strokeObj?z.strokeObj:{});var y=v(t,o,n,r,i,a);function v(){return arguments}t=e.Pick.choose(t),o=e.Pick.choose(o),n=e.Pick.choose(n),this.a=t,this.b=o,this.c=n,r=e.Pick.choose(r),i=e.Pick.choose(i),a=e.Pick.choose(a);var b=this;b._color=r,b._borderColor=i,b._borderWidth=a,b._dashed=u,b._dashed&&!Array.isArray(b._dashed)&&(b._dashed=[10,10]),b._corner=l;var w=[t,o,n];w.sort((function(e,t){return t-e}));var C=w[0],x=w[1],k=w[2],T=[w.indexOf(t),w.indexOf(o),w.indexOf(n)];if(C>x+k)zogy("zim display - Triangle(): invalid triangle lengths");else{var A=this.shape=new createjs.Shape;this.adjusted=c,this.addChild(A);var P=A.graphics;b.drawShape=function(){var e=[];Array.isArray(b._corner)?e=b._corner:e.push(b._corner,b._corner,b._corner);for(var n=0;n<3;n++)(e[n]<0||"number"!=typeof e[n])&&(e[n]=0);P.c(),b.colorCommand=P.f(b._color).command,b._color&&b._color.type&&b.specialColor(b.colorCommand,b._color,b),(zot(b._borderWidth)||b._borderWidth>0)&&(zot(b._borderColor)&&zot(b._borderWidth)||(zot(b._borderColor)&&(b._borderColor="black"),b.borderColorCommand=P.s(b._borderColor).command,b._borderColor&&b._borderColor.type&&b.specialColor(b.borderColorCommand,b._borderColor,b),b.borderWidthCommand=P.ss(b._borderWidth,d.caps,d.joints,d.miterLimit,d.ignoreScale).command,b._dashed&&(b.borderDashedCommand=P.sd(Array.isArray(b._dashed)?b._dashed:[10,10],b._dashedOffset).command))),b.one={x:0,y:0},b.two={x:t,y:0};var r=180*Math.acos((Math.pow(x,2)+Math.pow(k,2)-Math.pow(C,2))/(2*x*k))/Math.PI,i=180*Math.asin(x*Math.sin(r*Math.PI/180)/C)/Math.PI,a=[r,i,180-r-i];b.angles=[a[T[1]],a[T[2]],a[T[0]]];var l=b.angles[1],u=Math.cos(l*Math.PI/180)*o,h=Math.sin(l*Math.PI/180)*o,g=Math.max(t,t-u),p=h;b.setBounds(0,c,g,p),A.y=p,b.three={x:t-u,y:0-h};var f=t*e[0]/(e[0]+e[1]||1);P.mt(f,0).at(t,0,t-u,0-h,e[1]).at(t-u,0-h,0,0,e[2]).at(0,0,t,0,e[0]).lt(f,0),P.cp(),s&&(b.regX=g/2,b.regY=p/2),c&&(b.shape.y+=c)},b.drawShape(),r.type&&(b.color=r),!1!==h&&e.styleTransforms(this,z),this.clone=function(r){var i=b.cloneProps(new e.Triangle(r||!e.isPick(y[0])?t:y[0],r||!e.isPick(y[1])?o:y[1],r||!e.isPick(y[2])?n:y[2],r||!e.isPick(y[3])?b.color:y[3],r||!e.isPick(y[4])?b.borderColor:y[4],r||!e.isPick(y[5])?b.borderWidth:y[5],l,s,c,u,d,h,this.group,p));return b.linearGradientParams&&i.linearGradient.apply(i,b.linearGradientParams),b.radialGradientParams&&i.radialGradient.apply(i,b.radialGradientParams),i}}},e.extend(e.Triangle,e.CustomShape,"clone","zimCustomShape"),e.Poly=function(t,o,n,r,i,a,l,s,c,u,d){var h,g="radius, sides, pointSize, color, borderColor, borderWidth, dashed, strokeObj, style, group, inherit";if(h=zob(e.Poly,arguments,g,this))return h;z_d("53.1"),this.zimCustomShape_constructor(null,null,null,null,!1),this.type="Poly",this.group=u;var p=!1===c?{}:e.getStyle(this.type,this.group,d);zot(t)&&(t=null!=p.radius?p.radius:50),zot(o)&&(o=null!=p.sides?p.sides:5),zot(n)&&(n=null!=p.pointSize?p.pointSize:0),zot(l)&&(l=null!=p.dashed&&p.dashed),zot(i)&&(i=null!=p.borderColor?p.borderColor:null),zot(a)&&(a=null!=p.borderWidth?p.borderWidth:null),i<0||a<0?i=a=null:null!=i&&null==a&&(a=1),zot(r)&&(r=null!=p.color?p.color:a>0?"rgba(0,0,0,0)":"black"),zot(s)&&(s=null!=p.strokeObj?p.strokeObj:{});var f=m(t,o,n,r,i,a);function m(){return arguments}t=e.Pick.choose(t),o=e.Pick.choose(o),n=e.Pick.choose(n),r=e.Pick.choose(r),i=e.Pick.choose(i),a=e.Pick.choose(a);var z=this;z._radius=t,z._color=r,z._sides=o,z._pointSize=n,z._borderColor=i,z._borderWidth=a,z._dashed=l,z._dashed&&!Array.isArray(z._dashed)&&(z._dashed=[10,10]);var y=this.shape=new createjs.Shape;this.addChild(y),y.rotation=-90;var v=y.graphics;z.drawShape=function(){v.c(),z.colorCommand=v.f(z._color).command,z._color&&z._color.type&&z.specialColor(z.colorCommand,z._color,z),(zot(z._borderWidth)||z._borderWidth>0)&&(zot(z._borderColor)&&zot(z._borderWidth)||(zot(z._borderColor)&&(z._borderColor="black"),z.borderColorCommand=v.s(z._borderColor).command,z._borderColor&&z._borderColor.type&&z.specialColor(z.borderColorCommand,z._borderColor,z),z.borderWidthCommand=v.ss(z._borderWidth,s.caps,s.joints,s.miterLimit,s.ignoreScale).command,z._dashed&&(z.borderDashedCommand=v.sd(Array.isArray(z._dashed)?z._dashed:[10,10],z._dashedOffset).command))),v.dp(0,0,z._radius,z._sides,z._pointSize),z.setBounds(-z._radius,-z._radius,2*z._radius,2*z._radius)},z.drawShape(),r.type&&(z.color=r),Object.defineProperty(z,"radius",{get:function(){return z._radius},set:function(e){z._radius=e,z.drawShape()}}),Object.defineProperty(z,"sides",{get:function(){return z._sides},set:function(e){z._sides=e,z.drawShape()}}),Object.defineProperty(z,"pointSize",{get:function(){return z._pointSize},set:function(e){z._pointSize=e,z.drawShape()}}),!1!==c&&e.styleTransforms(this,p),this.clone=function(t){var o=z.cloneProps(new e.Poly(t||!e.isPick(f[0])?z.radius:f[0],t||!e.isPick(f[1])?z.sides:f[1],t||!e.isPick(f[2])?z.pointSize:f[2],t||!e.isPick(f[3])?z.color:f[3],t||!e.isPick(f[4])?z.borderColor:f[4],t||!e.isPick(f[5])?z.borderWidth:f[5],z.dashed,s,c,this.group,d));return z.linearGradientParams&&o.linearGradient.apply(o,z.linearGradientParams),z.radialGradientParams&&o.radialGradient.apply(o,z.radialGradientParams),o}},e.extend(e.Poly,e.CustomShape,"clone","zimCustomShape",!1),e.Line=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f){var m,z="length, thickness, color, startHead, endHead, dashed, strokeObj, lineType, lineOrientation, curveH, curveV, points, style, group, inherit";if(m=zob(e.Line,arguments,z,this))return m;z_d("53.15"),this.zimCustomShape_constructor(null,null,null,null,!1),this.type="Line",this.group=p;var y=!1===g?{}:e.getStyle(this.type,this.group,f);zot(t)&&(t=null!=y.length?y.length:100),zot(a)&&(a=null!=y.dashed&&y.dashed),zot(o)&&(o=null!=y.thickness?y.thickness:3),zot(n)&&(n=null!=y.color?y.color:"black"),zot(r)&&(r=null!=y.startHead?y.startHead:null),zot(i)&&(i=null!=y.endHead?y.endHead:null),zot(l)&&(l=null!=y.strokeObj?y.strokeObj:{}),zot(s)&&(s=null!=y.lineType?y.lineType:"straight"),"corner"!==s&&"curve"!=s&&(s="straight"),zot(c)&&(c=null!=y.lineOrientation?y.lineOrientation:"auto"),"vertical"!==c&&"horizontal"!=c&&(c="auto"),zot(u)&&(u=null!=y.curveH?y.curveH:20),zot(d)&&(d=null!=y.curveV?y.curveV:20),zot(l)&&(l=null!=y.strokeObj?y.strokeObj:{});var v=b(t,n,o,r,i);function b(){return arguments}t=e.Pick.choose(t),n=e.Pick.choose(n),o=e.Pick.choose(o),r=e.Pick.choose(r),i=e.Pick.choose(i),r&&r.clone&&(r=r.clone()),i&&i.clone&&(i=i.clone());var w=this;function C(t,r){"triangle"==r||"arrow"==r?(w["_"+t+"Head"]=new e.Triangle(4*o,4*o,4*o,n)).rotation=90:"circle"==r&&(w["_"+t+"Head"]=new e.Circle(2.2*o,n));zot(w["_"+t+"Head"].startAngle)&&(w["_"+t+"Head"].startAngle=w["_"+t+"Head"].rotation)}w._length=t,w._color=n,w._thickness=o,w._dashed=a,w._dashed&&!Array.isArray(w._dashed)&&(w._dashed=[10,10]),w._startX=0,w._startY=0,w._endX=t,w._endY=0,w._startHead=r,w._endHead=i,w._points=h,w._lineOrientation=c,w.angle=0,w.lineType=s,w._startHead&&C("start",w._startHead),w._endHead&&C("end",w._endHead),r=w._startHead,i=w._endHead,r&&"Triangle"==r.type&&(r.startRegY=r.regY),i&&"Triangle"==i.type&&(i.startRegY=i.regY);var x=this.shape=new createjs.Shape;this.addChild(x);var k=x.graphics;w.drawShape=function(t,o){var a,s;if(k.c(),w.colorCommand=k.s(w._color).command,n&&n.type&&w.specialColor(w.colorCommand,n,w),w.thicknessCommand=k.ss(w._thickness,l.caps,l.joints,l.miterLimit,l.ignoreScale).command,w._dashed&&(w.dashedCommand=k.sd(Array.isArray(w._dashed)?w._dashed:[10,10],w._dashedOffset).command),w._points){var c=w._points[0];w._startX=c[0],w._startY=c[1];var h=w._points[w._points.length-1],g=[h[h.length-2],h[h.length-1]];w._endX=g[0],w._endY=g[1],k.mt(c[0],c[1]);for(var p=1;p<w._points.length;p++){var f=w._points[p];1==p&&(a=[w._startX,w._startY,f[0],f[1]]),2==f.length?k.lt(f[0],f[1]):4==f.length?k.qt(f[0],f[1],f[2],f[3]):6==f.length&&k.bt(f[0],f[1],f[2],f[3],f[4],f[5])}if(f.length>=4)s=[f[f.length-4],f[f.length-3],w._endX,w._endY];else{var m=w._points[w._points.length-2];s=[m[m.lenth-2],m[m.lenth-1],w._endX,w._endY]}}else{var z,y=w._startX,v=w._startY,b=w._endX,C=w._endY;if("straight"==w.lineType?(r&&"Triangle"==r.type&&(r.regY=0,0!=(z=e.dist(y,v,b,C))&&(y+=w._startHead.height/2*(b-y)/z),0!=z&&(v+=w._startHead.height/2*(C-v)/z)),i&&"Triangle"==i.type&&(i.regY=0,0!=(z=e.dist(y,v,b,C))&&(b-=w._endHead.height/2*(b-y)/z),0!=z&&(C-=w._endHead.height/2*(C-v)/z))):(t?"horizontal"==w._lineOrientation||"horizontal"==w.autoOrientation?r&&"Triangle"==r.type&&(r.regY=0,y=b>y?Math.min(b,y+w._startHead.height/2):Math.max(b,y-w._startHead.height/2)):r&&"Triangle"==r.type&&(r.regY=0,v=C>v?Math.min(C,v+w._startHead.height/2):Math.max(C,v-w._startHead.height/2)):r&&"Triangle"==r.type&&(r.regY=r.startRegY),o?"horizontal"==w._lineOrientation||"horizontal"==w.autoOrientation?i&&"Triangle"==i.type&&(i.regY=0,b>y?b-=w._endHead.height/2:b+=w._endHead.height/2):i&&"Triangle"==i.type&&(i.regY=0,C>v?C-=w._endHead.height/2:C+=w._endHead.height/2):i&&"Triangle"==i.type&&(i.regY=i.startRegY)),"straight"==w.lineType)k.mt(y,v).lt(b,C),a=s=[y,v,b,C];else if("corner"==w.lineType){var x=y+.4*(b-y),T=v+.4*(C-v);"auto"==w._lineOrientation&&(w.autoOrientation=Math.abs(y-b)>Math.abs(v-C)?"horizontal":"vertical"),"horizontal"==w._lineOrientation||"horizontal"==w.autoOrientation?(a=s=[y,v,x,v],k.mt(y,v).lt(x,v).lt(x,C).lt(b,C)):(a=s=[y,v,y,T],k.mt(y,v).lt(y,T).lt(b,T).lt(b,C))}else{var A,P,B,E,I=y>b?-1:1,S=v>C?-1:1,W=y,M=v,O=Math.abs(y-b),j=Math.abs(v-C),L=Math.min(u,.5*O),D=Math.min(d,.5*j);"auto"==w._lineOrientation&&(w.autoOrientation=Math.abs(y-b)>Math.abs(v-C)?"horizontal":"vertical"),"horizontal"==w._lineOrientation||"horizontal"==w.autoOrientation?(A=j-2*D,P=(O-2*L)/2,k.mt(W,M),P>0&&(W+=P*I,k.lt(W,M)),E=M,M+=D*S,W+=L*I,k.qt(W,E,W,M),a=s=[y,v,W,v],A>0&&(M+=A*S,k.lt(W,M)),M+=D*S,B=W,W+=L*I,k.qt(B,M,W,M),P>0&&(W+=P*I,k.lt(W,M))):(A=O-2*L,P=(j-2*D)/2,k.mt(W,M),P>0&&(M+=P*S,k.lt(W,M)),B=W,W+=L*I,M+=D*S,k.qt(B,M,W,M),a=s=[y,v,y,M],A>0&&(W+=A*I,k.lt(W,M)),W+=L*I,E=M,M+=D*S,k.qt(W,E,W,M),P>0&&(M+=P*S,k.lt(W,M)))}}if(w.setBounds(Math.min(w._startX,w._endX),Math.min(w._startY,w._endY),Math.abs(w._startX-w._endX),Math.abs(w._startY-w._endY)),w._length=Math.sqrt(Math.pow(w._startX-w._endX,2)+Math.pow(w._startY-w._endY,2)),w.angle=180*Math.atan2(w._endY-w._startY,w._endX-w._startX)/Math.PI,w._startHead&&w._startHead.loc){w._startHead.loc(w._startX,w._startY,w);var _=180*Math.atan2(a[3]-a[1],a[2]-a[0])/Math.PI;w._startHead.rotation=_-180+w._startHead.startAngle}if(w._endHead&&w._endHead.loc){w._endHead.loc(w._endX,w._endY,w);var Y=180*Math.atan2(s[3]-s[1],s[2]-s[0])/Math.PI;w._endHead.rotation=Y+w._endHead.startAngle}},w.drawShape(),n.type&&(w.color=n),this.setPoints=function(e,t,o,n,r,i){return Array.isArray(e)&&zot(t)?(w.points=e,w):(e&&!zot(e.x)?(w._startX=zot(e.x)?w._startX:e.x,w._startY=zot(e.y)?w._startY:e.y,t&&(w._endX=zot(t.x)?w._endX:t.x,w._endY=zot(t.y)?w._endY:t.y)):(w._startX=zot(e)?w._startX:e,w._startY=zot(t)?w._startY:t,w._endX=zot(o)?w._endX:o,w._endY=zot(n)?w._endY:n),w.drawShape(r,i),w)},this.from=function(e,t){return e&&!zot(e.x)?(w._startX=zot(e.x)?w._startX:e.x,w._startY=zot(e.y)?w._startY:e.y):(w._startX=zot(e)?w._startX:e,w._startY=zot(t)?w._startY:t),w.drawShape(),w},this.to=function(e,t){return e&&!zot(e.x)?(w._endX=zot(e.x)?w._endX:e.x,w._endY=zot(e.y)?w._endY:e.y):(w._endX=zot(e)?w._endX:e,w._endY=zot(t)?w._endY:t),w.drawShape(),w},Object.defineProperty(w,"length",{get:function(){return w._length},set:function(e){var t=0!=w.length?e/w.length:0;if(!isNaN(t)){var o=w.scaleX,n=w.scaleY;w.scaleX*=t,w.scaleY*=t;var r=w.localToGlobal(w._startX,w._startY),i=w.localToGlobal(w._endX,w._endY);w.scaleX=o,w.scaleY=n;var a=w.globalToLocal(r.x,r.y),l=w.globalToLocal(i.x,i.y);w.setPoints(a,l)}}}),Object.defineProperty(w,"startPoint",{get:function(){return new e.Point(w._startX,w._startY)},set:function(e){w._startX=zot(e.x)?w._startX:e.x,w._startY=zot(e.y)?w._startY:e.y,w.drawShape()}}),Object.defineProperty(w,"endPoint",{get:function(){return new e.Point(w._endX,w._endY)},set:function(e){w._endX=zot(e.x)?w._endX:e.x,w._endY=zot(e.y)?w._endY:e.y,w.drawShape()}}),Object.defineProperty(w,"startHead",{get:function(){return w._startHead},set:function(e){w._startHead=e,w.drawShape()}}),Object.defineProperty(w,"endHead",{get:function(){return w._endHead},set:function(e){w._endHead=e,w.drawShape()}}),Object.defineProperty(w,"startX",{get:function(){return w._startX},set:function(e){w._startX=e||0,w.drawShape()}}),Object.defineProperty(w,"startY",{get:function(){return w._startY},set:function(e){w._startY=e||0,w.drawShape()}}),Object.defineProperty(w,"endX",{get:function(){return w._endX},set:function(e){w._endX=e||0,w.drawShape()}}),Object.defineProperty(w,"endY",{get:function(){return w._endY},set:function(e){w._endY=e||0,w.drawShape()}}),Object.defineProperty(w,"points",{get:function(){return w._points},set:function(e){e&&(w._points=e,w.drawShape())}}),Object.defineProperty(w,"lineOrientation",{get:function(){return w._lineOrientation},set:function(e){e&&(w._lineOrientation=e,w.drawShape())}}),!1!==g&&e.styleTransforms(this,y),this.clone=function(t){var o=t||!e.isPick(v[3])?w._startHead:v[3];o&&o.clone&&((o=o.clone()).rotation=w._startHead.startAngle);var n=t||!e.isPick(v[4])?w._endHead:v[4];n&&n.clone&&((n=n.clone()).rotation=w._endHead.startAngle);var r=w.cloneProps(new e.Line(t||!e.isPick(v[0])?w.length:v[0],t||!e.isPick(v[2])?w.thickness:v[2],t||!e.isPick(v[1])?w.color:v[1],o,n,w.dashed,l,s,w._lineOrientation,u,d,e.copy(h),g,this.group,f));return w.points?r.setPoints(w.points):r.setPoints(w._startX,w._startY,w._endX,w._endY),w.linearGradientParams&&r.linearGradient.apply(r,w.linearGradientParams),w.radialGradientParams&&r.radialGradient.apply(r,w.radialGradientParams),r}},e.extend(e.Line,e.CustomShape,"clone","zimCustomShape",!1),e.Squiggle=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k){var T,A="color, thickness, points, length, controlLength, controlType, lockControlType, showControls, lockControls, handleSize, allowToggle, move, dashed, onTop, stickColor, stickThickness, selectColor, selectPoints, editPoints, interactive, strokeObj, style, group, inherit";if(T=zob(e.Squiggle,arguments,A,this))return T;z_d("53.2"),this.group=x;var P=!1===C?{}:e.getStyle("Squiggle",this.group,k);if(zot(o)&&(o=null!=P.thickness?P.thickness:6),zot(r)&&(r=null!=P.length?P.length:300),zot(n)&&(n=null!=P.points?P.points:5),"string"==typeof n){var B=new e.SVGContainer;n=B.processPath(n)}var E="number"!=typeof n,I="number"==typeof n?n:n.length;if(0!=I){zot(i)&&(i=null!=P.controlLength?P.controlLength:r/I),this.zimCustomShape_constructor(r,i,null,null,!1),this.type="Squiggle",this.mouseChildren=!0,zot(g)&&(g=null!=P.dashed&&P.dashed),zot(t)&&(t=null!=P.color?P.color:e.blue),t.style&&(this.colorCommand=t,t="black"),zot(a)&&(a=null!=P.controlType?P.controlType:null);var S=a;zot(a)&&(a="mirror"),zot(l)&&(l=null!=P.lockControlType&&P.lockControlType),zot(b)&&(b=null==P.interactive||P.interactive),zot(s)&&(s=null!=P.showControls?P.showControls:b);var W=s;zot(c)&&(c=null!=P.lockControls?P.lockControls:!b),zot(u)&&(u=null!=P.handleSize?P.handleSize:e.mobile()?20:10),zot(d)&&(d=null!=P.allowToggle?P.allowToggle:b),zot(h)&&(h=null!=P.move?P.move:b),zot(f)&&(f=null!=P.stickColor?P.stickColor:"#111"),zot(m)&&(m=null!=P.stickThickness?P.stickThickness:1),zot(z)&&(z=null!=P.selectColor?P.selectColor:"#fff"),zot(y)&&(y=null!=P.selectPoints?P.selectPoints:b),this.stickColor=f,this.stickThickness=m,zot(p)&&(p=null==P.onTop||P.onTop),zot(v)&&(v=null!=P.editPoints?P.editPoints:b),zot(w)&&(w=null!=P.strokeObj?P.strokeObj:{});var M=U(t);t=e.Pick.choose(t);var O,j,L,D,_,Y,X,R,H=this;this.types=["mirror","straight","free","none"],this.interactive=b,this.num=I,this.onTop=p,this.move=h,this.editPoints=v,this.allowToggle=d,this.lockControlType=l,this.selectPoints=y,this.lockControls=c,H._color=t,H._thickness=o,H._dashed=g,H._dashed&&!Array.isArray(H._dashed)&&(H._dashed=[10,10]);var F,N,V=H.move,G=2;S&&"number"!=typeof n&&e.loop(n,(function(e){e[8]=S,"none"==S&&(e[4]=e[5]=e[6]=e[7]=0)})),Q(),H.selectionManager.on("keydown",(function(e){if(H.selectPoints&&H.keyFocus&&e.keyCode>=37&&e.keyCode<=40){var t=Z();if(t.length>0){for(var o=0;o<t.length;o++){var n=t[o];37==e.keyCode?n.x-=H.selectionManager.shiftKey?10:1:39==e.keyCode?n.x+=H.selectionManager.shiftKey?10:1:38==e.keyCode?n.y-=H.selectionManager.shiftKey?10:1:40==e.keyCode&&(n.y+=H.selectionManager.shiftKey?10:1),F(n)}H.drawShape(),H.dispatchEvent("update"),H.stage&&H.stage.update()}}})),H.selectionManager.on("keyup",(function(e){if(H.selectPoints&&H.keyFocus&&e.keyCode>=37&&e.keyCode<=40){var t=Z();if(t.length>0)for(var o=0;o<t.length;o++)K(t[o])}})),H.selectionManager.on("undo",(function(){if(H.selectPoints&&H.keyFocus&&H.lastPoints){var t=e.copy(H.lastPoints);H.lastPoints=e.copy(H.points),H.points=t,H.stage&&H.stage.update()}})),F=function(e){var t;if(!H.lockControls)if(e.rect1){var o=(t=e).x-t.startX,n=t.y-t.startY;t.rect1.x=t.rect1.startX+o,t.rect1.y=t.rect1.startY+n,t.rect2.x=t.rect2.startX+o,t.rect2.y=t.rect2.startY+n}else{var r=e,i=r.other,l=(t=r.ball).index,s=a;if(zot(j[l][4])||(s=j[l][4]),"straight"==s||"mirror"==s){var c=r.x-t.x,u=r.y-t.y;if("mirror"==s)i.x=t.x-c,i.y=t.y-u;else{var d=Math.atan2(u,c),h=-i.stickLength*Math.cos(d+Math.PI),g=-i.stickLength*Math.sin(d+Math.PI);i.x=t.x-h,i.y=t.y-g}}}},Object.defineProperty(H,"move",{get:function(){return h},set:function(e){h!=e&&(h=e,e?J():$())}}),Object.defineProperty(H,"interactive",{get:function(){return b},set:function(e){W=b=e,H.allowToggle=b,H.editPoints=b,H.lockControls=!b,H.selectPoints=b,H.move=b;var t=H.points;H.points=t}}),Object.defineProperty(H,"allowToggle",{get:function(){return d},set:function(e){d!=e&&((d=e)?H.move&&J():!W&&H.move&&$())}});var q=c;Object.defineProperty(H,"lockControls",{get:function(){return q},set:function(e){q=e,e?(H.controls.mouseChildren=!1,H.controls.mouseEnabled=!1):(H.controls.mouseChildren=!0,H.controls.mouseEnabled=!0)}}),H.lockControls=q,Object.defineProperty(H,"controlsVisible",{get:function(){return W},set:function(e){W=e,e?H.showControls():H.hideControls()}}),null!=WW.KEYFOCUS&&(e.KEYFOCUS=WW.KEYFOCUS),Object.defineProperty(this,"keyFocus",{get:function(){return e.KEYFOCUS==H},set:function(){e.KEYFOCUS=H}}),e.KEYFOCUS||ee(),Object.defineProperty(H,"points",{get:function(){for(var t,o,n=[],r=0;r<j.length;r++)o=j[r],t=[e.decimals(o[0].x),e.decimals(o[0].y),e.decimals(o[1].x),e.decimals(o[1].y),e.decimals(o[2].x),e.decimals(o[2].y),e.decimals(o[3].x),e.decimals(o[3].y)],o[4]&&"mirror"!==o[4]&&t.push(o[4]),n.push(t);return n},set:function(t){var o=H.x,r=H.y,i=H.visible,a=[],l=!1;e.loop(H.pointControls,(function(e){e.scaleX+e.scaleY+e.regX+e.regY+e.rotation!=2&&(l=!0),a.push([e.scaleX,e.scaleY,e.regX,e.regY,e.rotation])})),H.dispose(!0),n=t,Q(),H.lockControls=q,H.x=o,H.y=r,H.visible=i,l&&(e.loop(H.pointControls,(function(e,t){e.scaleX=a[t][0],e.scaleY=a[t][1],e.regX=a[t][2],e.regY=a[t][3],e.rotation=a[t][4]})),H.update())}}),Object.defineProperty(H,"pointsAdjusted",{get:function(){var t,o,n,r=[],i=H.pointObjects;return e.loop(i.length,(function(a){if(n=i[a],o=j[a],0==n[0].rotation&&0==n[0].scaleX&&0==n[0].scaleY)t=[e.decimals(o[0].x),e.decimals(o[0].y),e.decimals(o[1].x),e.decimals(o[1].y),e.decimals(o[2].x),e.decimals(o[2].y),e.decimals(o[3].x),e.decimals(o[3].y)];else{var l=n[0].localToLocal(n[2].x,n[2].y,n[0].parent),s=n[0].localToLocal(n[3].x,n[3].y,n[0].parent);t=[e.decimals(o[0].x),e.decimals(o[0].y),e.decimals(o[1].x),e.decimals(o[1].y),e.decimals(l.x-o[0].x),e.decimals(l.y-o[0].y),e.decimals(s.x-o[0].x),e.decimals(s.y-o[0].y)]}o[4]&&"mirror"!==o[4]&&t.push(o[4]),r.push(t)})),r},set:function(){zon&&zogy("Squiggle() - pointsAdjusted is read only")}}),Object.defineProperty(H,"pointObjects",{get:function(){return j},set:function(){zon&&zogy("Squiggle() - pointObjects is read only - but its contents can be manipulated - use squiggle.update() after changes")}}),Object.defineProperty(H,"pointControls",{get:function(){return D},set:function(){zon&&zogy("Squiggle() - pointControls is read only - but its contents can be manipulated - use blob.update() after changes")}}),Object.defineProperty(H,"pointCircles",{get:function(){return L},set:function(){zon&&zogy("Squiggle() - pointCircles is read only - but its contents can be manipulated - use blob.update() after changes")}}),Object.defineProperty(H,"segmentPoints",{get:function(){var t=[],o=H.pointsAdjusted;return e.loop(o.length-1,(function(e){var n=H.getSegmentPoint(o[e],o[e+1]);t.push(n)})),t},set:function(){zon&&zogy("Squiggle() - segmentPoints is read only")}}),Object.defineProperty(H,"segmentRatios",{get:function(){var t=[],o=0;e.loop(H.segmentPoints,(function(n){var r=e.distanceAlongCurve(n);t.push(r),o+=r}));var n=[],r=0;return e.loop(t,(function(e){r+=e/o,n.push(r)})),n},set:function(){zon&&zogy("Squiggle() - segmentRatios is read only")}}),H.approximateBounds=function(t,o,n){zot(t)&&(t=80),zot(n)&&(n=0),t/=H.num;var r=H.interpolate(t,null,!0,null,!0),i=e.boundsAroundPoints(r);if(H.setBounds(i.x-n,i.y-n,i.width+2*n,i.height+2*n),o){if(!H.parent)return zon&&zogy("approximateBounds() - add to stage to first to see points"),H;H.hitPathPoints?H.hitPathPoints.removeAllChildren():H.hitPathPoints=(new e.Container).addTo(),H.hitPathPoints.top();for(var a=0;a<r.length;a++){var l=r[a];l=H.localToGlobal(l.x,l.y),new e.Circle(3).loc(l.x,l.y,H.hitPathPoints)}}return H},H.getPointAngle=function(t){var o,n,r=H.pointObjects[t][0],i=H.pointObjects[t][2],a=H.pointObjects[t][3];return r==H.stage?(o=new e.Point(i.x,i.y),n=new e.Point(a.x,a.y)):(o=r.localToGlobal(i.x,i.y),n=r.localToGlobal(a.x,a.y)),e.angle(o.x,o.y,n.x,n.y)},H.getSegmentPoint=function(e,t){if(!zot(e)&&!zot(t)){0==e[2]&&0==e[3]||(e[4]-=e[2],e[5]-=e[3],e[6]-=e[2],e[7]-=e[3],e[0]+=e[2],e[1]+=e[3],e[2]=0,e[3]=0),0==t[2]&&0==t[3]||(t[4]-=t[2],t[5]-=t[3],t[6]-=t[2],t[7]-=t[3],t[0]+=t[2],t[1]+=t[3],t[2]=0,t[3]=0);var o={x:e[0],y:e[1]},n={x:e[0]+e[6],y:e[1]+e[7]},r={x:t[0]+t[4],y:t[1]+t[5]},i={x:t[0],y:t[1]};return 0==N.x&&0==N.y||(o.x+=N.x,n.x+=N.x,r.x+=N.x,i.x+=N.x,o.y+=N.y,n.y+=N.y,r.y+=N.y,i.y+=N.y),[o,n,r,i]}},H.getAdjacentSegmentData=function(e){zot(e)&&(e=0);var t=H.pointsAdjusted;return 2==H.num?[[H.getSegmentPoint(t[0],t[1])],[0]]:0==e?[[H.getSegmentPoint(t[0],t[1]),H.getSegmentPoint(t[1],t[2])],[0,1]]:e>=H.num-2?[[H.getSegmentPoint(t[H.num-3],t[H.num-2]),H.getSegmentPoint(t[H.num-2],t[H.num-1])],[H.num-3,H.num-2]]:[[H.getSegmentPoint(t[e-1],t[e]),H.getSegmentPoint(t[e],t[e+1]),H.getSegmentPoint(t[e+1],t[e+2])],[e-1,e,e+1]]},H.getCurvePoint=function(t,o,n,r,i){(zot(t)||isNaN(t))&&(t=0),zot(o)&&(o=H.segmentRatios),zot(n)&&(n=H.segmentPoints),zot(r)&&(r=!1),zot(i)&&(i=!1);var a=o,l=n,s=e.loop(a,(function(e,o){if(e>=t)return o})),c=s>0?a[s-1]:0,u=s>0?a[s]-a[s-1]:a[s];if(u){var d=(t-c)/u,h=e.pointAlongCurve(l[s],d,r,!0),g=H.localToGlobal(h.x,h.y);return g.angle=h.angle,g.z=s,zot(g)?void 0:g}},this.addPoint=function(e,t){zot(e)&&(e=100);var o=H.points,n=H.segmentRatios;return oe(o,H.pointControls,n,e,t=t||S),H.points=o,H.num=o.length,H},this.addPoints=function(t,o,n,r,i,a,l){zot(a)&&(a=e.copy(H.points));var s=e.copy(H.segmentRatios),c=0;if(i&&(H.interpolatedPoints=[]),r)var u=s.length*t;return e.loop(s,(function(s,d){i&&oe(a,H.pointControls,H.segmentRatios,100*c,o,!zot(n)&&d!=n,i,l);var h=r?Math.round(u*(s-c)):t,g=1/(h+1);e.loop(h,(function(e){var r=c+(s-c)*g*(e+1);oe(a,H.pointControls,H.segmentRatios,100*r,o,!zot(n)&&d!=n,i,l),!i&&t>0&&(H.points=a)})),c=s})),i&&"Squiggle"==H.type&&oe(a,H.pointControls,H.segmentRatios,100,o,!1,i,l),H.stage&&H.stage.update(),H.num=a.length,H},this.interpolate=function(e,t,o,n,r){return zot(e)&&(e=1),H.addPoints(e,"none",t,o,!0,n,r),H.interpolatedPoints},E&&H.approximateBounds(),this.dispose=function(t,o,n){if(H.shape){if(e.gD(H),O&&H.toggleStageEvent&&O.off("stagemousedown",H.toggleStageEvent),H.controls.noDrag(),H.controls.removeAllEventListeners(),H.selectPoints&&H.selectionManager&&H.selectionManager.dispose(),H.selectedBalls=null,H.selectedRect1s=null,H.selectedRect2s=null,H.selectionManager=null,H.off("mousedown",H.toggleEvent),H.off("click",H.clickEvent),t){H.shape.dispose(),H.shape=null;for(var r=0;r<H.points.length;r++)H.pointObjects[r][0].removeAllEventListeners(),H.pointObjects[r][1].removeAllEventListeners(),H.pointObjects[r][2].removeAllEventListeners(),H.pointObjects[r][3].removeAllEventListeners();H.controls.removeFrom(H),H.sticks.dispose(),j=null,L=null}else H.removeAllEventListeners(),j=null,L=null,n||this.zimCustomShape_dispose(!0);return!0}}}function U(){return arguments}function Q(){N&&N.removeAllEventListeners(),H.num=I="number"==typeof n?n:n.length,I=Math.max(2,I),i=r/I,_=H.shape=new e.Shape({style:!1}).addTo(H);var d=H.sticks=new e.Shape({style:!1}).addTo(H);u<=0&&d.removeFrom();var f=_.graphics;f.c();var m=d.graphics;m.c();var v=u/10*8,x=u;H.selectPoints?(H.selectedBalls=new e.SelectionSet,H.selectedRect1s=new e.SelectionSet,H.selectedRect2s=new e.SelectionSet,H.selectionManager=new e.SelectionManager([H.selectedBalls,H.selectedRect1s,H.selectedRect2s],"ctrl",!1)):H.selectionManager=new e.SelectionManager(null,"ctrl");var T,A,B,E,S,V,q,U,Q,ee=e.mobile();for(N=H.controls=new e.Container({style:!1}).addTo(H),H.interactive&&N.drag({onTop:!ee}),j=[],D=[],L=[],T=0;T<I;T++){if((E=new e.Container({style:!1}).addTo(N)).num=T,"number"==typeof n){var te=e.Pick.choose(i);B=new e.Container(te,o,null,null,!1).addTo(H).loc({x:T*r/(I-1)-te/2,y:T%2*te}),q=new e.Circle(v,H.selectPoints&&H.selectedBalls.isSelected(T)?z:e.light,e.dark,2,null,null,null,null,!1).centerReg(B).loc({x:te/2,y:0}),S=new e.Rectangle(x,x,H.selectPoints&&H.selectedRect1s.isSelected(T)?z:se(a),0==u?null:e.dark,0==u?null:2,null,null,null,null,!1).centerReg(B).loc({x:0,y:0}),V=new e.Rectangle(x,x,H.selectPoints&&H.selectedRect2s.isSelected(T)?z:se(a),0==u?null:e.dark,0==u?null:2,null,null,null,null,!1).centerReg(B).loc({x:te,y:0});var oe=B.localToLocal(q.x,q.y,N);q.x=oe.x,q.y=oe.y,q.addTo(E,null,!1);var ne=B.localToLocal(S.x,S.y,N);S.x="none"==a?0:ne.x-q.x,S.y="none"==a?0:ne.y-q.y,S.addTo(E,null,!1);var re=B.localToLocal(V.x,V.y,N);V.x="none"==a?0:re.x-q.x,V.y="none"==a?0:re.y-q.y,V.addTo(E,null,!1),E.x=q.x,E.y=q.y,q.x=0,q.y=0,"none"==a&&q.addTo(E,null,!1)}else U=(Q=n[T])[8]?Q[8]:a,E.loc({x:Q[0],y:Q[1]}),q=new e.Circle(v,e.light,e.dark,2,null,null,null,null,!1).centerReg({add:!1}).addTo(E).loc({x:Q[2],y:Q[3]}),S=new e.Rectangle(x,x,se(U),0==u?null:e.dark,0==u?null:2,null,null,null,null,!1).centerReg({add:!1}).addTo(E,0).loc({x:Q[4],y:Q[5]}),V=new e.Rectangle(x,x,se(U),0==u?null:e.dark,0==u?null:2,null,null,null,null,!1).centerReg({add:!1}).addTo(E,0).loc({x:Q[6],y:Q[7]});q.mySet=E,q.rect1=S,q.rect2=V,q.index=T,ee?q.on("mousedown",ae):q.on("dblclick",le),S.ball=q,S.other=V,V.ball=q,V.other=S,0==u&&(q.expand(10),S.expand(10),V.expand(10)),ee&&(q.expand(),S.expand(),V.expand()),A=[E,q,S,V,Q?Q[8]:a],j.push(A),L.push(q),D.push(E)}var ie=!1;function ae(e){ie?(e.preventDefault(),le(e)):(ie=!0,setTimeout((function(){ie=!1}),300))}function le(e){if(!H.lockControlType){var o=e.target,n=j[o.index][4]?j[o.index][4]:a;Math.abs(o.rect1.x)<=2&&Math.abs(o.rect1.y)<=2&&Math.abs(o.rect2.x)<=2&&Math.abs(o.rect2.y)<=2&&(n="none"),"none"==n&&o.parent.addChildAt(o,0),"none"==(n=H.types[(H.types.indexOf(n)+(H.shiftKey?-1:1)+H.types.length)%H.types.length])&&(o.rect1.x=o.rect1.y=o.rect2.x=o.rect2.y=0,o.parent.addChild(o),e.stopImmediatePropagation()),j[o.index][4]=n,o.rect1.color=se(n),o.rect2.color=se(n),H.drawShape(),t.type&&(H.color=t);var r=new createjs.Event("change");r.controlType="bezierSwitch",H.dispatchEvent(r),o.stage.update()}}function se(t){var o={straight:e.pink,free:e.yellow,none:e.blue};return o[t]?o[t]:e.purple}var ce,ue=e.mobile();function de(t){if("Circle"==t.target.type){var o=H.lastSelectedIndex=H.controls.getChildIndex(t.target.parent);if(H.controls.numChildren<=2)return;var n=H.points;H.selectPoints&&(H.lastPoints=e.copy(n)),n.splice(o,1),H.points=n,H.stage.update(),H.lastSelected=H.lastSelectedIndex=null}}H.drawShape=function(){f.c();var e,n,r,i,a,l,s,c,u,d,h,g,p,z,y,v=ue?10:6;if(o<v)for(f.s("rgba(0,0,0,.01)").ss(v),u=(i=j[0][0]).localToLocal(j[0][1].x,j[0][1].y,_),f.mt(u.x,u.y),e=0;e<j.length;e++)n=e,r=(e+1)%j.length,i=j[n][0],a=j[n][1],l=j[n][2],s=j[n][3],c=j[r][0],d=j[r][1],h=j[r][2],p=i.localToLocal(s.x,s.y,_),z=c.localToLocal(h.x,h.y,_),y=c.localToLocal(d.x,d.y,_),e!=j.length-1&&f.bt(p.x,p.y,z.x,z.y,y.x,y.y);for(H.colorCommand||(H.colorCommand=f.s(H._color).command,t&&t.type&&H.specialColor(H.colorCommand,t,H)),H.thicknessCommand||(H.thicknessCommand=f.ss(H._thickness,w.caps,w.joints,w.miterLimit,w.ignoreScale).command),H._dashed&&(H.dashedCommand||(H.dashedCommand=f.sd(Array.isArray(H._dashed)?H._dashed:[10,10],H._dashedOffset).command)),u=(i=j[0][0]).localToLocal(j[0][1].x,j[0][1].y,_),f.mt(u.x,u.y),m.c().s(H.stickColor).ss(H.stickThickness),e=0;e<j.length;e++)n=e,r=(e+1)%j.length,i=j[n][0],a=j[n][1],l=j[n][2],s=j[n][3],c=j[r][0],d=j[r][1],h=j[r][2],p=i.localToLocal(s.x,s.y,_),z=c.localToLocal(h.x,h.y,_),y=c.localToLocal(d.x,d.y,_),e!=j.length-1&&f.bt(p.x,p.y,z.x,z.y,y.x,y.y),u=i.localToLocal(a.x,a.y,_),g=i.localToLocal(l.x,l.y,_),0==e&&(l.visible=0),0!=e&&m.mt(u.x,u.y).lt(g.x,g.y),e!=j.length-1&&m.mt(u.x,u.y).lt(p.x,p.y),e==j.length-1&&(s.visible=0);H._dashed&&f.append(H.dashedCommand),f.append(H.thicknessCommand),f.append(H.colorCommand)},H.drawShape(),t.type&&(H.color=t),N.on("mousedown",(function(e){if(O=e.target.stage,!H.lockControls){if(H.selectPoints&&(H.keyFocus=!0),ce={x:e.target.x,y:e.target.y},e.target.rect1)(q=e.target).startX=q.x,q.startY=q.y,q.rect1.startX=q.rect1.x,q.rect1.startY=q.rect1.y,q.rect2.startX=q.rect2.x,q.rect2.startY=q.rect2.y;else{var t=e.target;t.startX=t.x,t.startY=t.y;var o=(q=t.ball).index,n=a;if(zot(j[o][4])||(n=j[o][4]),"straight"==n){var r=t.other,i=r.x-q.x,l=r.y-q.y;r.stickLength=Math.sqrt(Math.pow(i,2)+Math.pow(l,2))}}if(H.selectPoints){var s=H.selectionManager.currentSet;if(s&&s.selections&&s.selections.length>0)for(T=0;T<s.selections.length;T++){var c=H.pointObjects[s.selections[T]];c[1].startX=c[1].x,c[1].startY=c[1].y,c[2].startX=c[2].x,c[2].startY=c[2].y,c[3].startX=c[3].x,c[3].startY=c[3].y}}}})),H.selectPoints&&N.tap((function(t){if(t.target.rect1){var o=t.target;H.selectedBalls.toggle(o.parent.num)}else{var n=t.target;n.color="white",(o=n.ball).rect1==n?H.selectedRect1s.toggle(o.parent.num):H.selectedRect2s.toggle(o.parent.num)}for(T=0;T<H.pointObjects.length;T++){var r=H.pointObjects[T];r[1].color=H.selectedBalls.isSelected(T)?e.white:e.light,r[2].color=H.selectedRect1s.isSelected(T)?e.white:se(r[4]),r[3].color=H.selectedRect2s.isSelected(T)?e.white:se(r[4])}O.update()})),N.on("pressmove",(function(e){if(!H.lockControls)if(H.selectPoints){var t=Z();if(-1==t.indexOf(e.target))F(e.target),H.drawShape();else if(t.length>0){for(var o=e.target.x-e.target.startX,n=e.target.y-e.target.startY,r=0;r<t.length;r++){var i=t[r];i.x=i.startX+o,i.y=i.startY+n,F(i)}H.drawShape()}}else F(e.target),H.drawShape()})),N.on("pressup",(function(e){if(!H.lockControls){var t=e.target.x!=ce.x||e.target.y!=ce.y,o=new createjs.Event("change");e.target.rect1?(o.controlType="bezierPoint",function(e){if(H.selectPoints){var t=Z();if(t&&-1==t.indexOf(e))K(e);else if(t&&t.length>0)for(var o=0;o<t.length;o++)K(t[o]);else K(e)}else K(e)}(e.target)):o.controlType="bezierHandle",t&&H.dispatchEvent(o)}})),H.changeControl=function(e,t,o,n,r,i,a,l,s){var c,u="index, type, rect1X, rect1Y, rect2X, rect2Y, circleX, circleY, update";if(c=zob(H.changeControl,arguments,u))return c;if(zot(e))for(T=0;T<j.length;T++)H.changeControl(T,t,o,n,r,i,a,l);else{var d=j[e];d[4]=t,"none"==t?(zot(a)||(d[2].x=a),zot(l)||(d[2].y=l),d[2].x=d[1].x,d[2].y=d[1].y,d[3].x=d[1].x,d[3].y=d[1].y,d[1].parent.addChild(d[1])):(zot(o)||(d[2].x=o),zot(n)||(d[2].y=n),zot(r)||(d[3].x=r),zot(i)||(d[3].y=i),zot(a)||(d[1].x=a),zot(l)||(d[1].y=l),d[1].parent.addChildAt(d[1],0)),s&&(H.update(),O&&O.update())}},H.transformPoints=function(t,o,n,r,i){return zot(i)&&(i=!0),H.points=e.transformPoints(H.points,t,o,n,r),i&&H.approximateBounds(),H},H.traverse=function(t,o,n,r){var i=e.copy(H.segmentRatios);i.unshift(0),zot(n)&&(n=o+1);var a,l,s=o<n;return s?(a=100*i[o],l=100*i[n]):(a=50+(100-100*i[o])/2,l=50+(100-100*i[n])/2),t.percentComplete=t.zimStartPercent=a,t.animate({ease:"linear",props:{path:H},rewind:!s,time:r,events:!0}),t.on("animation",(function(e){if(t.percentComplete>l||0==t.percentComplete){t.stopAnimate(),e.remove();var o=new createjs.Event("traversed");o.obj=t,H.dispatchEvent(o)}})),H},H.reversePoints=function(){return n=e.copy(H.points),H.points=e.reversePoints(e.copy(H.points)),H.update(),H},H.appendPoints=function(t,o){var n=e.copy(H.points);return H.points=e.appendPoints(n,t,o),H.update(),H},H.prependPoints=function(t,o){var r=e.copy(H.points);return H.points=e.rependPoints(r,n,o),H.update(),H},H.splitPoints=function(t){var o=e.copy(H.points);if(!(t<1||t>o.length-1)){var n=e.splitPoints(o,t),r=n[0],i=n[1],a=H.clone();return H.points=r,H.update(),a.points=i,H.parent&&a.addTo(H.parent),a}},H.makeBlob=function(t,o){zot(t)&&(t="mirror"),zot(o)&&(o=5);var n=e.copy(H.points);return e.loop(n,(function(e,o,n){e[8]||(e[8]="mirror"),0==o&&("free"==t&&(e[4]=e[5]=0),e[8]=t),o==n-1&&("free"==t&&(e[6]=e[7]=0),e[8]=t)})),Math.abs(n[0][0]-n[n.length-1][0])<o&&Math.abs(n[0][1]-n[n.length-1][1])<o&&(n[0][4]=n[n.length-1][4],n[0][5]=n[n.length-1][5],n.pop()),new e.Blob({points:n,borderColor:H.color,borderWidth:H.thickness,showControls:H.controlsVisible,interactive:H.interactive,onTop:H.onTop,dashed:H.dashed,stickColor:H.stickColor,stickThickness:H.stickThickness})},H.update=function(e){return e?H.points=H.pointsAdjusted:H.drawShape(),H.zimAnimateChanged=!0,H},H.interactive&&(h&&_.drag({onTop:!1}),Y=_.on("mousedown",(function(e){O=e.target.stage,ce={x:_.x,y:_.y},H.selectPoints&&(H.keyFocus=!0),function(){if(H.onTop){var e=H.parent.numChildren-1;"Keyboard"==H.parent.getChildAt(e).type&&e--,H.parent.setChildIndex(H,e)}}()})),X=_.on("pressmove",(function(){N.x=_.x,N.y=_.y,d.x=_.x,d.y=_.y})),R=_.on("pressup",(function(){var e=_.x!=ce.x||_.y!=ce.y,t=_.localToLocal(H.regX,H.regY,H.parent);if(H.x=t.x,H.y=t.y,N.x=N.y=d.x=d.y=_.x=_.y=0,e){var o=new createjs.Event("change");o.controlType="move",H.dispatchEvent(o)}O&&O.update()})),H.move||$(!0)),H.toggleEvent=H.on("mousedown",(function(){H.allowToggle&&(W||(H.showControls(),H.dispatchEvent("controlsshow")))})),H.added((function(){O=H.stage,H.toggleStageEvent&&O.off("stagemousedown",H.toggleStageEvent),H.toggleStageEvent=O.on("stagemousedown",(function(t){H.allowToggle&&H.stage&&W&&!H.hitTestPoint(t.stageX/e.scaX,t.stageY/e.scaY,!1)&&(H.hideControls(),H.dispatchEvent("controlshide"))}))})),H.clickEvent=H.on("click",(function(){H.ctrlKey&&setTimeout((function(){H.clone(!0).addTo(H.stage).mov(0,100),H.allowToggle&&(H.hideControls(),H.dispatchEvent("controlshide"));var e=new createjs.Event("change");e.controlType="move",H.dispatchEvent(e),H.stage.update()}),50)})),H.hideControls=function(){return H.toggled=!1,N.visible=!1,d.visible=!1,W=!1,H.stage&&H.stage.update(),!H.allowToggle&&H.move&&$(),H},s||H.hideControls(),H.showControls=function(){return H.toggled=!0,N.visible=!0,d.visible=!0,W=!0,N.x=_.x,N.y=_.y,d.x=_.x,d.y=_.y,H.addChildAt(_,0),H.move&&!H.allowToggle&&J(),H.stage&&H.stage.update(),H},H.toggle=function(e){return!0===e?H.showControls():!1===e||W?H.hideControls():H.showControls(),H},H.recordData=function(e){zot(e)&&(e=!1);var t={type:"Blob",index:H.parent?H.parent.getChildIndex(H):-1,x:H.x,y:H.y,points:H.recordPoints(),color:H.color,thickness:H.thickness,move:H.move,toggle:H.allowToggle,controlsVisible:W};return e?JSON.stringify(t):t},H.setData=function(e,t){if(!zot(e)){if(t)try{e=JSON.parse(e)}catch(e){return}var o=e.index;zot(o)&&(o=-1),delete e.index;var n=e.points;for(var r in zot(n)||H.setPoints(n),delete e.points,H.num=n.length,e)H[r]=e[r];return H.parent&&H.parent.setChildIndex(H,o),H.update(),H}},H.recordPoints=function(t){zot(t)&&(t=!1);var o=H.points;if(t){if(!H.pane){var n=H.pane=new e.Pane({container:H.stage,width:Math.min(500,H.stage.width-20),height:Math.min(500,H.stage.height-20),draggable:!0});(H.textArea=new e.TextArea(Math.min(400,H.stage.width-70),Math.min(400,H.stage.height-70))).centerReg(n)}H.textArea.text=JSON.stringify(o),H.pane.show()}return o},H.setPoints=function(e){for(var t,o,n=0;n<e.length;n++)t=j[n],o=e[n],zot(t)||(t[0].x=o[0],t[0].y=o[1],t[1].x=o[2],t[1].y=o[3],t[2].x=o[4],t[2].y=o[5],t[3].x=o[6],t[3].y=o[7],t[4]=o[8]);return H.update(),H},!1!==C&&e.styleTransforms(H,P),H.clone=function(t,o){var n=[],s=!1;e.loop(H.pointControls,(function(e){e.scaleX+e.scaleY+e.regX+e.regY+e.rotation!=2&&(s=!0),n.push([e.scaleX,e.scaleY,e.regX,e.regY,e.rotation])}));var d=H.cloneProps(new e.Squiggle(o?H.colorCommand:t||!e.isPick(M[0])?H.color:M[0],H.thickness,H.recordPoints(),r,i,a,l,N.visible,c,u,H.allowToggle,H.move,g,p,H.stickColor,H.stickThickness,z,y,H.editPoints,b,w,C,H.group,k));return s&&(e.loop(d.pointControls,(function(e,t){e.scaleX=n[t][0],e.scaleY=n[t][1],e.regX=n[t][2],e.regY=n[t][3],e.rotation=n[t][4]})),d.update()),H.linearGradientParams&&d.linearGradient.apply(d,H.linearGradientParams),H.radialGradientParams&&d.radialGradient.apply(d,H.radialGradientParams),d},H.shape.on("mousedown",(function(t){O=t.target.stage,H.editPoints&&(H.controlsVisible?(H.pressX=t.stageX/e.scaX,H.pressY=t.stageY/e.scaX):(H.pressX=null,H.pressY=null))})),H.addPointFactor=10,H.addMinDistance=15,H.shape.on("pressup",(function(t){if(H.editPoints&&H.pressX&&Math.abs(H.pressX-t.stageX/e.scaX)<G&&Math.abs(H.pressY-t.stageY/e.scaY)<G){H.selectPoints&&(H.lastPoints=e.copy(H.points));var o=H.points,n=H.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY),r=e.closestPointAlongCurve(n,H.segmentPoints);if("anywhere"==H.editPoints)o.splice(r+1,0,[n.x,n.y,0,0,0,0,0,0]),H.points=o,H.changeControl({index:r+1,type:"mirror",update:!0});else{var i,a=H.pointsAdjusted,l=H.getSegmentPoint(a[r],a[(r+1)%a.length]),s=e.distanceAlongCurve(l),c=Math.round(s/H.addPointFactor),u=H.interpolate(c,r,!1,o),d=1e4;if(e.loop(u,(function(t,o){var r=e.dist(t,n);r<d&&(d=r,i=o)})),d<H.addMinDistance){var h=H.segmentRatios,g=h[r],p=r>0?h[r-1]:0;H.addPoint(100*(p+i/(c+1)*(g-p)))}}H.lastSelectedIndex=r+1,H.lastSelected=H.controls.getChildAt(H.lastSelectedIndex),H.stage.update()}})),H.controls.on("click",(function(e){H.lastSelected=e.target.parent,H.lastSelectedIndex=H.controls.getChildIndex(e.target.parent),H.editPoints&&H.selectionManager.shiftKey&&de(e)})),H.controls.hold(de),W||H.hideControls(),H.dispatchEvent("update")}function Z(){var e=[],t=H.selectionManager.currentSet;if(t&&t.selections&&t.selections.length>0)for(var o=0;o<t.selections.length;o++){var n=H.pointObjects[t.selections[o]];if(t==H.selectedBalls)e.push(n[1]);else if(t==H.selectedRect1s)e.push(n[2]);else{if(t!=H.selectedRect2s)continue;e.push(n[3])}}return e}function K(e){if("Circle"==e.type){var t=e,o=t.mySet,n=t.rect1,r=t.rect2;n.x-=t.x,n.y-=t.y,r.x-=t.x,r.y-=t.y,o.x+=t.x,o.y+=t.y,t.x=0,t.y=0}}function J(){"always"!=H.move&&(V||(V=!0,_.drag({onTop:!1}),Y=_.on("mousedown",Y),X=_.on("pressmove",X),R=_.on("pressup",R)))}function $(e){"always"!=H.move&&(e||V)&&(V=!1,_.noDrag(),_.off("mousedown",Y),_.off("pressmove",X),_.off("pressup",R))}function ee(){if(H.selectPoints){H.keyFocus=!0;var e=document.activeElement;e&&e.blur()}}function te(e,t,o){return{x:e.x+(t.x-e.x)*o,y:e.y+(t.y-e.y)*o}}function oe(t,o,n,r,i,a,l,s){var c=t.length-1,u=0,d=0;100==r&&"Squiggle"==H.type&&(r=99.99),r=(r+1e5)%100,e.loop(n,(function(e,t){if(r/100<e)return c=t,d=e,!0;u=e}));var h=H.segmentPoints[c],g=d>0?(r/100-u)/(d-u):0,p=e.pointAlongCurve(h,g,null,s),f=[p.x,p.y,0,0];if(!a)if(l)H.interpolatedPoints.push({x:p.x,y:p.y,r:r/100});else{if("none"!=i){var m=te(h[0],h[1],g),z=te(h[1],h[2],g),y=te(h[2],h[3],g),v=te(m,z,g),b=te(z,y,g);f[4]=v.x-p.x,f[5]=v.y-p.y,f[6]=b.x-p.x,f[7]=b.y-p.y;var w=H.localToLocal(m.x,m.y,o[c]);t[c][6]=w.x,t[c][7]=w.y;var C=H.localToLocal(y.x,y.y,o[(c+1)%t.length]);t[(c+1)%t.length][4]=C.x,t[(c+1)%t.length][5]=C.y}i&&(f[8]=i),t.splice(c+1,0,f)}}},e.extend(e.Squiggle,e.CustomShape,["clone","dispose"],"zimCustomShape",!1),e.Blob=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T){var A,P="color, borderColor, borderWidth, points, radius, controlLength, controlType, lockControlType, showControls, lockControls, handleSize, allowToggle, move, dashed, onTop, stickColor, stickThickness, selectColor, selectPoints, editPoints, interactive, strokeObj, style, group, inherit";if(A=zob(e.Blob,arguments,P,this))return A;z_d("53.5"),this.group=k;var B=!1===x?{}:e.getStyle("Blob",this.group,T);zot(i)&&(i=null!=B.radius?B.radius:100),this.zimCustomShape_constructor(-i,-i,2*i,2*i,!1),this.type="Blob",this.mouseChildren=!0,zot(p)&&(p=null!=B.dashed&&B.dashed),zot(o)&&(o=null!=B.borderColor?B.borderColor:null),zot(n)&&(n=null!=B.borderWidth?B.borderWidth:null),o<0||n<0?o=n=null:null!=o&&null==n&&(n=1),zot(t)&&(t=null!=B.color?B.color:n>0?"rgba(0,0,0,0)":e.green),t.style&&(this.colorCommand=t,t="black"),o&&o.style&&(this.borderColorCommand=o,o="black"),zot(r)&&(r=null!=B.points?B.points:4);var E="number"!=typeof r,I="number"==typeof r?r:r.length,S=a;zot(a)&&(a=null!=B.controlLength?B.controlLength:4*i/I),zot(l)&&(l=null!=B.controlType?B.controlType:null);var W=l;zot(l)&&(l="straight"),zot(s)&&(s=null!=B.lockControlType&&B.lockControlType),zot(w)&&(w=null==B.interactive||B.interactive),zot(c)&&(c=null!=B.showControls?B.showControls:w);var M=c;zot(u)&&(u=null!=B.lockControls?B.lockControls:!w),zot(d)&&(d=null!=B.handleSize?B.handleSize:e.mobile()?20:10),zot(h)&&(h=null!=B.allowToggle?B.allowToggle:w),zot(g)&&(g=null!=B.move?B.move:w),zot(m)&&(m=null!=B.stickColor?B.stickColor:"#111"),zot(z)&&(z=null!=B.stickThickness?B.stickThickness:1),zot(y)&&(y=null!=B.selectColor?B.selectColor:"#fff"),zot(v)&&(v=null!=B.selectPoints?B.selectPoints:w),this.stickColor=m,this.stickThickness=z,zot(f)&&(f=null==B.onTop||B.onTop),zot(b)&&(b=null!=B.editPoints?B.editPoints:w),zot(C)&&(C=null!=B.strokeObj?B.strokeObj:{});var O=j(t,o);function j(){return arguments}t=e.Pick.choose(t),o=e.Pick.choose(o);var L,D,_,Y,X,R,H,F,N=this;this.interactive=w,this.num=I,this.editPoints=b,this.selectPoints=v,this.lockControls=u,this.onTop=f,this.move=g,this.allowToggle=h,this.lockControlType=s,this.types=["mirror","straight","free","none"],N._color=t,N._borderColor=o,N._borderWidth=n,N._dashed=p,N._dashed&&!Array.isArray(N._dashed)&&(N._dashed=[10,10]);var V,G,q=N.move,U=2;function Q(t){var o;if("circle"!=t&&"rectangle"!=t&&"triangle"!=t||("circle"==t&&(t=new e.Circle(i)),"rectangle"==t&&(t=new e.Rectangle(2*i,2*i).centerReg({add:!1})),"triangle"==t&&(t=new e.Triangle(2*i,2*i,2*i))),"Circle"==t.type||"Rectangle"==t.type||"Triangle"==t.type){var n=t.getBounds();return"Circle"==t.type?(o=4,S=a=2*i*.5523):"Rectangle"==t.type?(t.centerReg({add:!1}),o=[[n.x-n.width/2,n.y-n.height/2],[n.x+n.width/2,n.y-n.height/2],[n.x+n.width/2,n.y+n.height/2],[n.x-n.width/2,n.y+n.height/2]],N.setBounds(n.x-n.width/2,n.y-n.height/2,n.width,n.height),N.regX=t.regX-n.width/2,N.regY=t.regY-n.height/2):"Triangle"==t.type&&(o=[[t.three.x-t.width/2,t.three.y+t.height/2+t.adjusted],[t.two.x-t.width/2,t.two.y+t.height/2+t.adjusted],[t.one.x-t.width/2,t.one.y+t.height/2+t.adjusted]],N.setBounds(n.x-n.width/2,n.y-n.height/2,n.width,n.height)),o}return t}if("string"==typeof(r=Q(r))){var Z=new e.SVGContainer;(r=Z.processPath(r))[0][0]==r[r.length-1][0]&&r[0][1]==r[r.length-1][1]&&(r[0][4]=r[r.length-1][4],r[0][5]=r[r.length-1][5],r.pop())}function K(){if(G&&G.removeAllEventListeners(),N.selectPoints?(N.selectedBalls=new e.SelectionSet,N.selectedRect1s=new e.SelectionSet,N.selectedRect2s=new e.SelectionSet,N.selectionManager=new e.SelectionManager([N.selectedBalls,N.selectedRect1s,N.selectedRect2s],"ctrl",!1)):N.selectionManager=new e.SelectionManager(null,"ctrl"),!((I="number"==typeof r?r:r.length)<=0)){zot(S)&&(a=4*i/I),Y=N.shape=new e.Shape({style:!1}).addTo(N);var o=N.sticks=new e.Shape({style:!1}).addTo(N);d<=0&&o.removeFrom();var n=Y.graphics;n.c();var c=o.graphics;c.c();var h,m,z,b,k,A,P,E,W,j=d/10*8,q=d,Q=e.mobile();for(G=N.controls=new e.Container({style:!1}).addTo(N),N.interactive&&G.drag({onTop:!Q}),L=[],_=[],D=[],h=0;h<I;h++){if((b=new e.Container({style:!1}).addTo(G)).num=h,"number"==typeof r){var Z=e.Pick.choose(a);(z=new e.Container(Z,i,null,null,!1).reg(Z/2,i).addTo(N)).rotation=h/I*360,P=new e.Circle(j,N.selectPoints&&N.selectedBalls.isSelected(h)?y:e.light,e.dark,2,null,null,null,null,!1).centerReg(z).loc({x:Z/2,y:0}),k=new e.Rectangle(q,q,N.selectPoints&&N.selectedRect1s.isSelected(h)?y:se(l),0==d?null:e.dark,0==d?null:2,null,null,null,null,!1).centerReg(z).loc({x:0,y:0}),A=new e.Rectangle(q,q,N.selectPoints&&N.selectedRect2s.isSelected(h)?y:se(l),0==d?null:e.dark,0==d?null:2,null,null,null,null,!1).centerReg(z).loc({x:Z,y:0});var K=z.localToLocal(P.x,P.y,G);P.x=K.x,P.y=K.y,P.addTo(b,null,!1);var oe=z.localToLocal(k.x,k.y,G);k.x="none"==l?0:oe.x-P.x,k.y="none"==l?0:oe.y-P.y,k.addTo(b,null,!1);var ne=z.localToLocal(A.x,A.y,G);A.x="none"==l?0:ne.x-P.x,A.y="none"==l?0:ne.y-P.y,A.addTo(b,null,!1),b.x=P.x,b.y=P.y,P.x=0,P.y=0,"none"==l&&P.addTo(b,null,!1)}else E=(W=r[h])[8]?W[8]:l,b.loc({x:W[0],y:W[1]}),P=new e.Circle(j,e.light,e.dark,2,null,null,null,null,!1).centerReg({add:!1}).addTo(b).loc({x:W[2],y:W[3]}),k=new e.Rectangle(q,q,se(E),0==d?null:e.dark,0==d?null:2,null,null,null,null,!1).centerReg({add:!1}).addTo(b,0).loc({x:W[4],y:W[5]}),A=new e.Rectangle(q,q,se(E),0==d?null:e.dark,0==d?null:2,null,null,null,null,!1).centerReg({add:!1}).addTo(b,0).loc({x:W[6],y:W[7]});P.mySet=b,P.rect1=k,P.rect2=A,P.index=h,0==d&&(P.expand(10),k.expand(10),A.expand(10)),Q?P.on("mousedown",ae):P.on("dblclick",le),k.ball=P,k.other=A,A.ball=P,A.other=k,Q&&(P.expand(),k.expand(),A.expand()),m=[b,P,k,A,W?W[8]:l],L.push(m),D.push(P),_.push(b)}var re,ie=!1;N.drawShape=function(){var e,o,r,i,a,l,s,u,d,h,g,p,f;n.c(),N.colorCommand||(N.colorCommand=n.f(N._color).command,t&&t.type&&N.specialColor(N.colorCommand,t,N)),(zot(N._borderWidth)||N._borderWidth>0)&&(zot(N._borderColor)&&zot(N._borderWidth)||(zot(N._borderColor)&&(N._borderColor="black"),N.borderColorCommand||(N.borderColorCommand=n.s(N._borderColor).command,N._borderColor&&N._borderColor.type&&N.specialColor(N.borderColorCommand,N._borderColor,N)),N.borderWidthCommand||(N.borderWidthCommand=n.ss(N._borderWidth,C.caps,C.joints,C.miterLimit,C.ignoreScale).command),N._dashed&&(N.borderDashedCommand||(N.borderDashedCommand=n.sd(Array.isArray(N._dashed)?N._dashed:[10,10],N._dashedOffset).command)))),s=(r=L[0][0]).localToLocal(L[0][1].x,L[0][1].y,Y),n.mt(s.x,s.y),c.c().s(N.stickColor).ss(N.stickThickness);for(var m=0;m<L.length;m++)e=m,o=(m+1)%L.length,r=L[e][0],P=L[e][1],i=L[e][2],a=L[e][3],l=L[o][0],u=L[o][1],d=L[o][2],g=r.localToLocal(a.x,a.y,Y),p=l.localToLocal(d.x,d.y,Y),f=l.localToLocal(u.x,u.y,Y),n.bt(g.x,g.y,p.x,p.y,f.x,f.y),s=r.localToLocal(P.x,P.y,Y),h=r.localToLocal(i.x,i.y,Y),c.mt(s.x,s.y).lt(h.x,h.y),c.mt(s.x,s.y).lt(g.x,g.y);n.cp(),n.append(N.colorCommand),N._dashed&&n.append(N.borderDashedCommand),N.borderWidthCommand&&n.append(N.borderWidthCommand),N.borderColorCommand&&n.append(N.borderColorCommand)},N.drawShape(),t.type&&(N.color=t),G.on("mousedown",(function(e){if(!N.lockControls){var t;if(N.selectPoints&&(N.keyFocus=!0),re={x:e.target.x,y:e.target.y},e.target.rect1)(t=e.target).startX=t.x,t.startY=t.y,t.rect1.startX=t.rect1.x,t.rect1.startY=t.rect1.y,t.rect2.startX=t.rect2.x,t.rect2.startY=t.rect2.y;else{var o=e.target;o.startX=o.x,o.startY=o.y;var n=(t=o.ball).index,r=l;if(zot(L[n][4])||(r=L[n][4]),"straight"==r){var i=o.other,a=i.x-t.x,s=i.y-t.y;i.stickLength=Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}if(N.selectPoints){var c=N.selectionManager.currentSet;if(c&&c.selections&&c.selections.length>0)for(var u=0;u<c.selections.length;u++){var d=N.pointObjects[c.selections[u]];d[1].startX=d[1].x,d[1].startY=d[1].y,d[2].startX=d[2].x,d[2].startY=d[2].y,d[3].startX=d[3].x,d[3].startY=d[3].y}}}})),N.selectPoints&&G.tap((function(t){var o;if(t.target.rect1)o=t.target,N.selectedBalls.toggle(o.parent.num);else{var n=t.target;n.color="white",(o=n.ball).rect1==n?N.selectedRect1s.toggle(o.parent.num):N.selectedRect2s.toggle(o.parent.num)}for(var r=0;r<N.pointObjects.length;r++){var i=N.pointObjects[r];i[1].color=N.selectedBalls.isSelected(r)?e.white:e.light,i[2].color=N.selectedRect1s.isSelected(r)?e.white:se(i[4]),i[3].color=N.selectedRect2s.isSelected(r)?e.white:se(i[4])}t.target.stage.update()})),G.on("pressmove",(function(e){if(!N.lockControls)if(N.selectPoints){var t=J();if(-1==t.indexOf(e.target))V(e.target),N.drawShape();else if(t.length>0){for(var o=e.target.x-e.target.startX,n=e.target.y-e.target.startY,r=0;r<t.length;r++){var i=t[r];i.x=i.startX+o,i.y=i.startY+n,V(i)}N.drawShape()}}else V(e.target),N.drawShape()})),G.on("pressup",(function(e){if(!N.lockControls){var t=e.target.x!=re.x||e.target.y!=re.y,o=new createjs.Event("change");e.target.rect1?(o.controlType="bezierPoint",function(e){if(N.selectPoints){var t=J();if(t&&-1==t.indexOf(e))$(e);else if(t&&t.length>0)for(var o=0;o<t.length;o++)$(t[o]);else $(e)}else $(e)}(e.target)):o.controlType="bezierHandle",t&&N.dispatchEvent(o)}})),N.changeControl=function(e,t,o,n,r,i,a,l,s){var c,u="index, type, rect1X, rect1Y, rect2X, rect2Y, circleX, circleY, update";if(c=zob(N.changeControl,arguments,u))return c;if(zot(e)){for(var d=0;d<L.length;d++)N.changeControl(d,t,o,n,r,i,a,l);return N}var h=L[e];return h[4]=t,"none"==t?(zot(a)||(h[1].x=a),zot(l)||(h[1].y=l),h[2].x=h[1].x,h[2].y=h[1].y,h[3].x=h[1].x,h[3].y=h[1].y,h[1].parent.addChild(h[1])):(zot(a)||(h[1].x=a),zot(l)||(h[1].y=l),zot(o)||(h[2].x=o),zot(n)||(h[2].y=n),zot(r)||(h[3].x=r),zot(i)||(h[3].y=i),h[1].parent.addChildAt(h[1],0)),h[2].color=se(t),h[3].color=se(t),s&&(N.update(),N.stage&&N.stage.update()),N},N.transformPoints=function(t,o,n,r,i){return zot(i)&&(i=!0),N.points=e.transformPoints(N.points,t,o,n,r),i&&N.approximateBounds(),N},N.traverse=function(t,o,n,r){var i=e.copy(N.segmentRatios);i.unshift(0),zot(n)&&(n=o+1);var a,l,s=o<n;return s?(a=100*i[o],l=100*i[n]):(a=50+(100-100*i[o])/2,l=50+(100-100*i[n])/2),t.percentComplete=a,t.animate({ease:"linear",props:{path:N},rewind:!s,time:r,events:!0}),t.on("animation",(function(e){if(t.percentComplete>l||0==t.percentComplete){t.stopAnimate(),e.remove();var o=new createjs.Event("traversed");o.obj=t,N.dispatchEvent(o)}})),N},N.reversePoints=function(t){return zot(t)&&(t=!0),(r=e.copy(N.points)).reverse(),t&&r.unshift(r.pop()),e.loop(r,(function(e){var t=e[6];e[6]=e[4],e[4]=t;var o=e[7];e[7]=e[5],e[5]=o})),N.points=r,N.update(),N},N.splitPoints=function(t){var o=e.copy(N.points);if(!(t<1||t>o.length-1)){var n=e.copy(o.slice(0,t+1)),r=e.copy(o.slice(t));e.trimPointEnds(n),e.trimPointEnds(r);var i=N.clone();return N.points=n,N.update(),i.points=r,N.parent&&i.addTo(N.parent),i}},N.makeSquiggle=function(t){var o=e.copy(N.points);zot(t)&&(t=0),t=(t+1e3*o.length)%o.length;var n=e.copy(o.slice(t)),r=e.copy(o.slice(0,t+1));return o=n.concat(r),e.trimPointEnds(o),new e.Squiggle({points:o,color:N.borderColor,thickness:N.borderWidth,showControls:N.controlsVisible,interactive:N.interactive,onTop:N.onTop,dashed:N.dashed,stickColor:N.stickColor,stickThickness:N.stickThickness})},N.update=function(e){return e?N.points=N.pointsAdjusted:N.drawShape(),N.zimAnimateChanged=!0,N},N.move&&N.interactive&&Y.drag({onTop:!1}),X=Y.on("mousedown",(function(e){F=e.target.stage,re={x:Y.x,y:Y.y},N.selectPoints&&(N.keyFocus=!0),function(){if(N.onTop){var e=N.parent.numChildren-1;"Keyboard"==N.parent.getChildAt(e).type&&e--,N.parent.setChildIndex(N,e)}}()})),R=Y.on("pressmove",(function(){G.x=Y.x,G.y=Y.y,o.x=Y.x,o.y=Y.y})),H=Y.on("pressup",(function(){var e=Y.x!=re.x||Y.y!=re.y,t=Y.localToLocal(N.regX,N.regY,N.parent);if(N.x=t.x,N.y=t.y,G.x=G.y=o.x=o.y=Y.x=Y.y=0,e){var n=new createjs.Event("change");n.controlType="move",N.dispatchEvent(n)}F.update()})),g||te(!0),N.toggleEvent=N.on("mousedown",(function(){N.allowToggle&&(M||(N.showControls(),N.dispatchEvent("controlsshow")))})),N.added((function(){F=N.stage,N.toggleStageEvent&&N.stage.off("stagemousedown",N.toggleStageEvent),N.toggleStageEvent=N.stage.on("stagemousedown",(function(t){N.allowToggle&&N.stage&&M&&!N.hitTestPoint(t.stageX/e.scaX,t.stageY/e.scaY,!1)&&(N.hideControls(),N.dispatchEvent("controlshide"))}))})),N.clickEvent=N.on("click",(function(){N.ctrlKey&&setTimeout((function(){N.clone(!0).addTo(N.stage).mov(100),N.allowToggle&&(N.hideControls(),N.dispatchEvent("controlshide"));var e=new createjs.Event("change");e.controlType="move",N.dispatchEvent(e),N.stage.update()}),50)})),N.hideControls=function(){return N.toggled=!1,G.visible=!1,o.visible=!1,M=!1,N.stage&&N.stage.update(),!N.allowToggle&&N.move&&te(),N},M||N.hideControls(),N.showControls=function(){return N.toggled=!0,G.visible=!0,o.visible=!0,M=!0,G.x=Y.x,G.y=Y.y,o.x=Y.x,o.y=Y.y,N.addChildAt(Y,0),N.move&&!N.allowToggle&&ee(),N.stage&&N.stage.update(),N},N.toggle=function(e){return!0===e?N.showControls():!1===e||M?N.hideControls():N.showControls(),N},N.recordData=function(e){zot(e)&&(e=!1);var t={type:"Blob",index:N.parent?N.parent.getChildIndex(N):-1,x:N.x,y:N.y,points:N.recordPoints(),color:N.color,borderColor:N.borderColor,borderWidth:N.borderWidth,move:N.move,toggle:N.allowToggle,controlsVisible:M};return e?JSON.stringify(t):t},N.setData=function(e,t){if(!zot(e)){if(t)try{e=JSON.parse(e)}catch(e){return}var o=e.index;zot(o)&&(o=-1),delete e.index;var n=e.points;for(var r in zot(n)||N.setPoints(n),delete e.points,this.num=n.length,e)N[r]=e[r];return N.parent&&N.parent.setChildIndex(N,o),N}},N.recordPoints=function(t){zot(t)&&(t=!1);var o=N.points;if(t){if(!n){var n=N.pane=new e.Pane({displayClose:!1,container:N.stage,width:Math.min(500,N.stage.width-20),height:Math.min(500,N.stage.height-20),draggable:!0}),r=N.textArea=new e.TextArea(Math.min(400,N.stage.width-70),Math.min(400,N.stage.height-70));r.centerReg(n)}n.show(),r.text=JSON.stringify(o)}return o},N.setPoints=function(e){for(var t,o,n=0;n<e.length;n++)t=L[n],o=e[n],zot(t)||(t[0].x=o[0],t[0].y=o[1],t[1].x=o[2],t[1].y=o[3],t[2].x=o[4],t[2].y=o[5],t[3].x=o[6],t[3].y=o[7],t[4]=o[8],t[2].color=se(t[4]),t[3].color=se(t[4]));return N.update(),N},!1!==x&&e.styleTransforms(N,B),N.clone=function(t,o){var n=[],r=!1;e.loop(N.pointControls,(function(e){e.scaleX+e.scaleY+e.regX+e.regY+e.rotation!=2&&(r=!0),n.push([e.scaleX,e.scaleY,e.regX,e.regY,e.rotation])}));var c=N.cloneProps(new e.Blob(o?N.colorCommand:t||!e.isPick(O[0])?N.color:O[0],o?N.borderColorCommand:t||!e.isPick(O[1])?N.borderColor:O[1],N.borderWidth,N.recordPoints(),i,a,l,s,G.visible,u,d,N.allowToggle,N.move,p,f,N.stickColor,N.stickThickness,y,v,N.editPoints,w,C,x,N.group,T));return r&&(e.loop(c.pointControls,(function(e,t){e.scaleX=n[t][0],e.scaleY=n[t][1],e.regX=n[t][2],e.regY=n[t][3],e.rotation=n[t][4]})),c.update()),N.linearGradientParams&&c.linearGradient.apply(c,N.linearGradientParams),N.radialGradientParams&&c.radialGradient.apply(c,N.radialGradientParams),c},N.shapeMousedownEvent=N.shape.on("mousedown",(function(t){F=t.target.stage,N.editPoints&&(N.controlsVisible?(N.pressX=t.stageX/e.scaX,N.pressY=t.stageY/e.scaY):(N.pressX=null,N.pressY=null))})),N.addPointFactor=10,N.addMinDistance=15,N.shapePressupEvent=N.shape.on("pressup",(function(t){if(N.editPoints&&N.pressX&&Math.abs(N.pressX-t.stageX/e.scaX)<U&&Math.abs(N.pressY-t.stageY/e.scaY)<U){N.selectPoints&&(N.lastPoints=e.copy(N.points));var o=N.points,n=N.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY),r=e.closestPointAlongCurve(n,N.segmentPoints);if("anywhere"==N.editPoints)o.splice(r+1,0,[n.x,n.y,0,0,0,0,0,0]),N.points=o,N.changeControl({index:r+1,type:"mirror",update:!0});else{var i,a=N.pointsAdjusted,l=N.getSegmentPoint(a[r],a[(r+1)%a.length]),s=e.distanceAlongCurve(l),c=Math.round(s/N.addPointFactor),u=N.interpolate(c,r,!1,o),d=1e4;if(e.loop(u,(function(t,o){if(0!=o){var r=e.dist(t,n);r<d&&(d=r,i=o)}})),d<N.addMinDistance){var h=N.segmentRatios,g=h[r],p=r>0?h[r-1]:0;N.addPoint(100*(p+i/(c+1)*(g-p)))}}N.lastSelectedIndex=r+1,N.lastSelected=N.controls.getChildAt(N.lastSelectedIndex),N.stage.update()}})),N.controlsClickEvent=N.controls.on("click",(function(e){N.lastSelected=e.target.parent,N.lastSelectedIndex=N.controls.getChildIndex(e.target.parent),N.editPoints&&N.selectionManager.shiftKey&&ce(e)})),N.controls.hold(ce),M||N.hideControls(),N.dispatchEvent("update")}function ae(e){ie?(e.preventDefault(),le(e)):(ie=!0,setTimeout((function(){ie=!1}),300))}function le(e){if(!N.lockControlType){var t=e.target,o=L[t.index][4]?L[t.index][4]:l;Math.abs(t.rect1.x)<=2&&Math.abs(t.rect1.y)<=2&&Math.abs(t.rect2.x)<=2&&Math.abs(t.rect2.y)<=2&&(o="none"),"none"==o&&t.parent.addChildAt(t,0),"none"==(o=N.types[(N.types.indexOf(o)+(N.shiftKey?-1:1)+N.types.length)%N.types.length])&&(t.rect1.x=t.rect1.y=t.rect2.x=t.rect2.y=0,t.parent.addChild(t),e.stopImmediatePropagation()),L[t.index][4]=o,t.rect1.color=se(o),t.rect2.color=se(o),N.drawShape();var n=new createjs.Event("change");n.controlType="bezierSwitch",N.dispatchEvent(n),t.stage.update()}}function se(t){var o={mirror:e.purple,free:e.yellow,none:e.blue};return o[t]?o[t]:e.pink}function ce(t){if("Circle"==t.target.type){var o=N.lastSelectedIndex=N.controls.getChildIndex(t.target.parent);if(N.controls.numChildren<=2)return;var n=N.points;N.selectPoints&&(N.lastPoints=e.copy(n)),n.splice(o,1),N.points=n,N.stage.update(),N.lastSelected=N.lastSelectedIndex=null}}}function J(){var e=[],t=N.selectionManager.currentSet;if(t&&t.selections&&t.selections.length>0)for(var o=0;o<t.selections.length;o++){var n=N.pointObjects[t.selections[o]];if(t==N.selectedBalls)e.push(n[1]);else if(t==N.selectedRect1s)e.push(n[2]);else{if(t!=N.selectedRect2s)continue;e.push(n[3])}}return e}function $(e){if(N.selectPoints&&"Circle"==e.type){var t=e,o=t.mySet,n=t.rect1,r=t.rect2;n.x-=t.x,n.y-=t.y,r.x-=t.x,r.y-=t.y,o.x+=t.x,o.y+=t.y,t.x=0,t.y=0}}function ee(){"always"!=N.move&&(q||(q=!0,Y.drag({onTop:!1}),X=Y.on("mousedown",X),R=Y.on("pressmove",R),H=Y.on("pressup",H)))}function te(e){"always"!=N.move&&(e||q)&&(q=!1,Y.noDrag(),Y.off("mousedown",X),Y.off("pressmove",R),Y.off("pressup",H))}W&&"number"!=typeof r&&e.loop(r,(function(e){e[8]=W,"none"==W&&(e[4]=e[5]=e[6]=e[7]=0)})),K(),N.selectionManager.on("keydown",(function(e){if(N.selectPoints&&N.keyFocus&&e.keyCode>=37&&e.keyCode<=40){var t=J();if(t.length>0){for(var o=0;o<t.length;o++){var n=t[o];37==e.keyCode?n.x-=N.selectionManager.shiftKey?10:1:39==e.keyCode?n.x+=N.selectionManager.shiftKey?10:1:38==e.keyCode?n.y-=N.selectionManager.shiftKey?10:1:40==e.keyCode&&(n.y+=N.selectionManager.shiftKey?10:1),V(n)}N.drawShape(),N.dispatchEvent("update"),N.stage&&N.stage.update()}}})),N.selectionManager.on("keyup",(function(e){if(N.selectPoints&&N.keyFocus&&e.keyCode>=37&&e.keyCode<=40){var t=J();if(t.length>0)for(var o=0;o<t.length;o++)$(t[o])}})),N.selectionManager.on("undo",(function(){if(N.selectPoints&&N.keyFocus&&N.lastPoints){var t=e.copy(N.lastPoints);N.lastPoints=e.copy(N.points),N.points=t,N.stage&&N.stage.update()}})),V=function(e){var t;if(!N.lockControls)if(e.rect1){var o=(t=e).x-t.startX,n=t.y-t.startY;t.rect1.x=t.rect1.startX+o,t.rect1.y=t.rect1.startY+n,t.rect2.x=t.rect2.startX+o,t.rect2.y=t.rect2.startY+n}else{var r=e,i=r.other,a=(t=r.ball).index,s=l;if(zot(L[a][4])||(s=L[a][4]),"straight"==s||"mirror"==s){var c=r.x-t.x,u=r.y-t.y;if("mirror"==s)i.x=t.x-c,i.y=t.y-u;else{var d=Math.atan2(u,c),h=-i.stickLength*Math.cos(d+Math.PI),g=-i.stickLength*Math.sin(d+Math.PI);i.x=t.x-h,i.y=t.y-g}}}},Object.defineProperty(N,"move",{get:function(){return g},set:function(e){g!=e&&(g=e,e?ee():te())}}),Object.defineProperty(N,"interactive",{get:function(){return w},set:function(e){M=w=e,N.allowToggle=w,N.editPoints=w,N.lockControls=!w,N.selectPoints=w,N.move=w;var t=N.points;N.points=t}}),Object.defineProperty(N,"allowToggle",{get:function(){return h},set:function(e){h!=e&&((h=e)?N.move&&ee():!M&&N.move&&te())}}),Object.defineProperty(N,"controlsVisible",{get:function(){return M},set:function(e){M=e,e?N.showControls():N.hideControls()}});var oe=u;function ne(){N.keyFocus=!0;var e=document.activeElement;e&&e.blur()}function re(e,t,o){return{x:e.x+(t.x-e.x)*o,y:e.y+(t.y-e.y)*o}}function ie(t,o,n,r,i,a,l,s){var c=t.length-1,u=0,d=0;100==r&&"Squiggle"==N.type&&(r=99.99),r=(r+1e5)%100,e.loop(n,(function(e,t){if(r/100<e)return c=t,d=e,!0;u=e}));var h=N.segmentPoints[c],g=d>0?(r/100-u)/(d-u):0,p=e.pointAlongCurve(h,g,null,s),f=[p.x,p.y,0,0];if(!a)if(l)N.interpolatedPoints.push({x:p.x,y:p.y,r:r/100});else{if("none"!=i){var m=re(h[0],h[1],g),z=re(h[1],h[2],g),y=re(h[2],h[3],g),v=re(m,z,g),b=re(z,y,g);f[4]=v.x-p.x,f[5]=v.y-p.y,f[6]=b.x-p.x,f[7]=b.y-p.y;var w=N.localToLocal(m.x,m.y,o[c]);t[c][6]=w.x,t[c][7]=w.y;var C=N.localToLocal(y.x,y.y,o[(c+1)%t.length]);t[(c+1)%t.length][4]=C.x,t[(c+1)%t.length][5]=C.y}i&&(f[8]=i),t.splice(c+1,0,f)}}Object.defineProperty(N,"lockControls",{get:function(){return oe},set:function(e){oe=e,e?(N.controls.mouseChildren=!1,N.controls.mouseEnabled=!1):(N.controls.mouseChildren=!0,N.controls.mouseEnabled=!0)}}),N.lockControls=oe,null!=WW.KEYFOCUS&&(e.KEYFOCUS=WW.KEYFOCUS),Object.defineProperty(this,"keyFocus",{get:function(){return e.KEYFOCUS==N},set:function(){e.KEYFOCUS=N}}),N.selectPoints&&!e.KEYFOCUS&&ne(),Object.defineProperty(N,"points",{get:function(){for(var t,o,n=[],r=0;r<L.length;r++)o=L[r],t=[e.decimals(o[0].x),e.decimals(o[0].y),e.decimals(o[1].x),e.decimals(o[1].y),e.decimals(o[2].x),e.decimals(o[2].y),e.decimals(o[3].x),e.decimals(o[3].y)],o[4]&&"straight"!==o[4]&&t.push(o[4]),n.push(t);return n},set:function(t){var o=N.x,n=N.y,i=N.visible,a=[],l=!1;e.loop(N.pointControls,(function(e){e.scaleX+e.scaleY+e.regX+e.regY+e.rotation!=2&&(l=!0),a.push([e.scaleX,e.scaleY,e.regX,e.regY,e.rotation])})),N.dispose(!0),r=Q(t),N.shape&&(N.shape.graphics.clear(),N.sticks.graphics.clear(),N.controls.noDrag(),N.removeAllChildren(),delete N.shape,delete N.sticks,delete N.controls),N.visible=!1,K(),N.lockControls=oe,N.x=o,N.y=n,N.visible=i,l&&(e.loop(N.pointControls,(function(e,t){e.scaleX=a[t][0],e.scaleY=a[t][1],e.regX=a[t][2],e.regY=a[t][3],e.rotation=a[t][4]})),N.update())}}),Object.defineProperty(N,"pointsAdjusted",{get:function(){var t,o,n,r=[],i=N.pointObjects;return e.loop(i.length,(function(a){if(n=i[a],o=L[a],0==n[0].rotation&&0==n[0].scaleX&&0==n[0].scaleY)t=[e.decimals(o[0].x),e.decimals(o[0].y),e.decimals(o[1].x),e.decimals(o[1].y),e.decimals(o[2].x),e.decimals(o[2].y),e.decimals(o[3].x),e.decimals(o[3].y)];else{var l=n[0].localToLocal(n[2].x,n[2].y,n[0].parent),s=n[0].localToLocal(n[3].x,n[3].y,n[0].parent);t=[e.decimals(o[0].x),e.decimals(o[0].y),e.decimals(o[1].x),e.decimals(o[1].y),e.decimals(l.x-o[0].x),e.decimals(l.y-o[0].y),e.decimals(s.x-o[0].x),e.decimals(s.y-o[0].y)]}o[4]&&"mirror"!==o[4]&&t.push(o[4]),r.push(t)})),r},set:function(){zon&&zogy("Blob() - pointsAdjusted is read only")}}),Object.defineProperty(N,"pointObjects",{get:function(){return L},set:function(){zon&&zogy("Blob() - pointObjects is read only - but its contents can be manipulated - use blob.update() after changes")}}),Object.defineProperty(N,"pointControls",{get:function(){return _},set:function(){zon&&zogy("Blob() - pointControls is read only - but its contents can be manipulated - use blob.update() after changes")}}),Object.defineProperty(N,"pointCircles",{get:function(){return D},set:function(){zon&&zogy("Blob() - pointCircles is read only - but its contents can be manipulated - use blob.update() after changes")}}),Object.defineProperty(N,"segmentPoints",{get:function(){var t=N.pointsAdjusted,o=[];return e.loop(t.length,(function(e,n){var r=N.getSegmentPoint(t[e],t[e<n-1?e+1:0]);o.push(r)})),o},set:function(){zon&&zogy("Blob() - segmentPoints is read only")}}),Object.defineProperty(N,"segmentRatios",{get:function(){var t=[],o=0;e.loop(N.segmentPoints,(function(n){var r=e.distanceAlongCurve(n);t.push(r),o+=r}));var n=[],r=0;return e.loop(t,(function(e){r+=e/o,n.push(r)})),n},set:function(){zon&&zogy("Blob() - segmentRatios is read only")}}),N.approximateBounds=function(t,o){zot(t)&&(t=80),t/=N.num;var n=N.interpolate(t,null,!0,null,!0),r=e.boundsAroundPoints(n);if(N.setBounds(r.x,r.y,r.width,r.height),o){if(!N.parent)return zon&&zogy("approximateBounds() - add to stage to first to see points"),N;N.hitPathPoints?N.hitPathPoints.removeAllChildren():N.hitPathPoints=(new e.Container).addTo(),N.hitPathPoints.top();for(var i=0;i<n.length;i++){var a=n[i];a=N.localToGlobal(a.x,a.y),new e.Circle(3).loc(a.x,a.y,N.hitPathPoints)}}return N},N.getPointAngle=function(t){var o,n,r=N.pointObjects[t][0],i=N.pointObjects[t][2],a=N.pointObjects[t][3];return r==N.stage?(o=new e.Point(i.x,i.y),n=new e.Point(a.x,a.y)):(o=r.localToGlobal(i.x,i.y),n=r.localToGlobal(a.x,a.y)),e.angle(o.x,o.y,n.x,n.y)},N.getSegmentPoint=function(e,t){if(!zot(e)&&!zot(t)){0==e[2]&&0==e[3]||(e[4]-=e[2],e[5]-=e[3],e[6]-=e[2],e[7]-=e[3],e[0]+=e[2],e[1]+=e[3],e[2]=0,e[3]=0),0==t[2]&&0==t[3]||(t[4]-=t[2],t[5]-=t[3],t[6]-=t[2],t[7]-=t[3],t[0]+=t[2],t[1]+=t[3],t[2]=0,t[3]=0);var o={x:e[0],y:e[1]},n={x:e[0]+e[6],y:e[1]+e[7]},r={x:t[0]+t[4],y:t[1]+t[5]},i={x:t[0],y:t[1]};return 0==G.x&&0==G.y||(o.x+=G.x,n.x+=G.x,r.x+=G.x,i.x+=G.x,o.y+=G.y,n.y+=G.y,r.y+=G.y,i.y+=G.y),[o,n,r,i]}},N.getAdjacentSegmentData=function(e){zot(e)&&(e=0);var t=N.pointsAdjusted;if(2==N.num)return[[N.getSegmentPoint(t[0],t[1]),N.getSegmentPoint(t[1],t[0])],[0,1]];if(0==e)return[[N.getSegmentPoint(t[N.num-1],t[0]),N.getSegmentPoint(t[0],t[1]),N.getSegmentPoint(t[1],t[2])],[N.num-1,0,1]];if(e>=N.num-1)return[[N.getSegmentPoint(t[N.num-2],t[N.num-1]),N.getSegmentPoint(t[N.num-1],t[0]),N.getSegmentPoint(t[0],t[1])],[N.num-2,N.num-1,0]];var o=e+2>=N.num?0:e+2;return[[N.getSegmentPoint(t[e-1],t[e]),N.getSegmentPoint(t[e],t[e+1]),N.getSegmentPoint(t[e+1],t[o])],[e-1,e,e+1]]},N.getCurvePoint=function(t,o,n,r){zot(o)&&(o=N.segmentRatios),zot(n)&&(n=N.segmentPoints),zot(r)&&(r=!1);var i=o,a=n,l=e.loop(i,(function(e,o){if(e>=t)return o})),s=l>0?i[l-1]:0,c=l>0?i[l]-i[l-1]:i[l],u=(t-s)/c,d=e.pointAlongCurve(a[l],u,r,!0);if(!zot(d)){var h=N.localToGlobal(d.x,d.y);return h.angle=d.angle,h.z=l,zot(h)?void 0:h}},this.addPoint=function(e,t){zot(e)&&(e=100);var o=N.points,n=N.segmentRatios;return ie(o,N.pointControls,n,e,t=t||W),N.points=o,N.num=o.length,N},this.addPoints=function(t,o,n,r,i,a,l){zot(a)&&(a=e.copy(N.points));var s=e.copy(N.segmentRatios),c=0;if(i&&(N.interpolatedPoints=[]),r)var u=s.length*t;return e.loop(s,(function(s,d){i&&ie(a,N.pointControls,N.segmentRatios,100*c,o,!zot(n)&&d!=n,i,l);var h=r?Math.round(u*(s-c)):t,g=1/(h+1);e.loop(h,(function(e){var r=c+(s-c)*g*(e+1);ie(a,N.pointControls,N.segmentRatios,100*r,o,!zot(n)&&d!=n,i,l),!i&&t>0&&(N.points=a)})),c=s})),i&&"Squiggle"==N.type&&ie(a,N.pointControls,N.segmentRatios,100,o,null,i,l),N.stage&&N.stage.update(),N.num=a.length,N},this.interpolate=function(e,t,o,n,r){return zot(e)&&(e=1),N.addPoints(e,"none",t,o,!0,n,r),N.interpolatedPoints},E&&N.approximateBounds(),this.dispose=function(t,o,n){if(N.shape){if(e.gD(N),F&&N.toggleStageEvent&&F.off("stagemousedown",N.toggleStageEvent),N.controls.noDrag(),N.controls.removeAllEventListeners(),N.selectPoints&&N.selectionManager&&N.selectionManager.dispose(),N.selectedBalls=null,N.selectedRect1s=null,N.selectedRect2s=null,N.selectionManager=null,N.off("mousedown",N.toggleEvent),N.off("click",N.clickEvent),t){N.shape.dispose(),N.shape=null;for(var r=0;r<N.points.length;r++)N.pointObjects[r][0].removeAllEventListeners(),N.pointObjects[r][1].removeAllEventListeners(),N.pointObjects[r][2].removeAllEventListeners(),N.pointObjects[r][3].removeAllEventListeners();N.controls.removeFrom(N),N.sticks.dispose(),L=null,D=null}else N.removeAllEventListeners(),L=null,D=null,n||this.zimCustomShape_dispose(!0);return!0}}},e.extend(e.Blob,e.CustomShape,["clone","dispose"],"zimCustomShape",!1),e.Flare=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M){var O,j="color, borderColor, borderWidth, crossAngle, thickness, thicknessA, thicknessB, pin, startX, startY, lengths, angles, anglesA, anglesB, anglesEnd, cross, crossColors, close, dashed, strokeObj, spineColor, spineBorderWidth, spineBorderColor, spineDashed, spineStrokeObj, closeColor, closeBorderWidth, closeBorderColor, closeDashed, closeStrokeObj, style, group, inherit";if(O=zob(e.Flare,arguments,j,this))return O;z_d("53.6"),this.zimContainer_constructor(),this.type="Flare",this.group=W;var L=!1===S?{}:e.getStyle(this.type,this.group,M),D=this;zot(o)&&(o=null!=L.borderColor?L.borderColor:null),zot(n)&&(n=null!=L.borderWidth?L.borderWidth:null),o<0||n<0?o=n=null:null!=o&&null==n&&(n=1),zot(t)&&(t=null!=L.color?L.color:n>0?"rgba(0,0,0,0)":"black"),(zot(n)||n>0)&&(zot(o)&&zot(n)||zot(o)&&(o="black")),zot(r)&&(r=null!=L.crossAngle?L.crossAngle:0);var _,Y,X=r;function R(i,s,d,h,g,p,f,m){D.removeAllChildren();var z=D.shape=(new e.Shape).addTo(D);if(D.colorCommand=z.c().f(t).command,t&&t.type&&D.specialColor(D.colorCommand,t,D),(zot(n)||n>0)&&(zot(o)&&zot(n)||(zot(o)&&(o="black"),D.borderColorCommand=z.s(o).command,o&&o.type&&D.specialColor(D.borderColorCommand,o,D),D.borderWidthCommand=z.ss(n,b.caps,b.joints,b.miterLimit,b.ignoreScale).command,v&&(D.borderDashedCommand=z.sd([10,10],5).command))),z.mt(0,0),C>0){var y=D.spineShape=(new e.Shape).addTo(D);D.spineColorCommand=y.c().f(w).command,w&&w.type&&D.specialColor(D.spineColorCommand,w,D),(zot(C)||C>0)&&(zot(x)&&zot(C)||(zot(x)&&(x="black"),D.spineBorderColorCommand=y.s(x).command,x&&x.type&&D.specialColor(D.spineBorderColorCommand,x,D),D.spineBorderWidthCommand=y.ss(C,T.caps,T.joints,T.miterLimit,T.ignoreScale).command,k&&(D.spineBorderDashedCommand=y.sd([10,10],5).command)))}if(!zot(A)){var S=D.closeShape=(new e.Shape).addTo(D);D.closeColorCommand=S.c().f(A).command,A&&A.type&&D.specialColor(D.closeColorCommand,A,D),(zot(P)||P>0)&&(zot(B)&&zot(P)||(zot(B)&&(B="black"),D.closeBorderColorCommand=S.s(B).command,B&&B.type&&D.specialColor(D.closeBorderColorCommand,B,D),D.closeBorderWidthCommand=S.ss(P,I.caps,I.joints,I.miterLimit,I.ignoreScale).command,E&&(D.closeBorderDashedCommand=S.sd([10,10],5).command))),z.mt(0,0)}var W,M,O=c,j=u,L=r,_=L-180,Y=a,X=l,R=Math.max(i.length,s.length,d.length,h.length,g.length),H=_,F=[],N=[],V=[];D.points=[];var G=D.pinPoints=[];function q(t,o,n,r,i){var a=i-90,l=180-r-(90-a),s=Math.tan(a*e.RAD)*n,c=(t-o-s)/Math.sin(l*e.RAD)*Math.sin(r*e.RAD)+Math.sqrt(Math.pow(n,2)+Math.pow(s,2));return{x:c*Math.sin(a*e.RAD),y:c*Math.cos(a*e.RAD),t:c}}e.loop(R,(function(o){var n=function(o){var n=s[o],r=i[o],a=d[o],l=h[o],c=g[o];if(f)var u=f[o];zot(n)&&(n=H,D.angles[o]=n);zot(r)&&(r=200,D.lengths[o]=r);zot(a)&&(a=0,D.anglesA[o]=a);zot(l)&&(l=0,D.anglesB[o]=l);zot(c)&&(c=0,D.anglesEnd[o]=c);f&&zot(u)&&(u=t,D.crossColors[o]=u);var p=180-(c+=90),m=Math.cos((H-n)*e.RAD),z=Math.sin((H-n)*e.RAD),y=new e.Point(0,0),v=new e.Point(r,0);if(zot(W))var b=new e.Point(Math.cos(L*e.RAD)*Y,Math.sin(L*e.RAD)*Y);else b=new e.Point(W.x*m-W.y*z,W.x*z+W.y*m);var w,C=q(r,b.x,b.y,a,p),x=new e.Point(r-C.x,-C.y);w=zot(M)?new e.Point(Math.cos(_*e.RAD)*Y,Math.sin(_*e.RAD)*X):new e.Point(M.x*m-M.y*z,M.x*z+M.y*m);var k=q(r,w.x,w.y,l,c),T=new e.Point(r-k.x,k.y);return W=new e.Point(x.x-r,x.y),M=new e.Point(T.x-r,T.y),H=n,{a:n,A:b,B:x,C:T,D:w,E:v,F:y,tA:C.t,tB:k.t}}(o),r=Math.cos(n.a*e.RAD),a=Math.sin(n.a*e.RAD),l=new e.Point(O+n.A.x*r-n.A.y*a,j+n.A.x*a+n.A.y*r),c=new e.Point(O+n.B.x*r-n.B.y*a,j+n.B.x*a+n.B.y*r),u=new e.Point(O+n.C.x*r-n.C.y*a,j+n.C.x*a+n.C.y*r),p=new e.Point(O+n.D.x*r-n.D.y*a,j+n.D.x*a+n.D.y*r);F.push(l,c),N.unshift(u,p),V.push([l,c,u,p]);var m=new e.Point(O+n.F.x*r-n.F.y*a,j+n.F.x*a+n.F.y*r),z=new e.Point(O+n.E.x*r-n.E.y*a,j+n.E.x*a+n.E.y*r);0==o&&D.pinPoints.push(m),D.pinPoints.push(z),O=z.x,j=z.y,Y=n.tA,X=n.tB})),D.points=F.concat(N),p?(e.loop(V,(function(e,t){z.mt(e[0].x,e[0].y),zot(f)||zot(f[t])||z.f(f[t]).mt(e[0].x,e[0].y),z.lt(e[1].x,e[1].y).lt(e[2].x,e[2].y).lt(e[3].x,e[3].y).cp()})),m&&z.mt(V[V.length-1][1].x,V[V.length-1][1].y).lt(V[V.length-1][2].x,V[V.length-1][2].y).lt(V[0][3].x,V[0][3].y).lt(V[0][0].x,V[0][0].y).cp()):(e.loop(F,(function(e,t){0==t?z.mt(e.x,e.y):z.lt(e.x,e.y)})),m&&(z.lt(F[0].x,F[0].y),z.cp()),e.loop(N,(function(e,t){0==t&&m?z.mt(e.x,e.y):z.lt(e.x,e.y)})),m&&z.lt(N[0].x,N[0].y),z.cp()),y&&(e.loop(G,(function(e,t){0==t?y.mt(e.x,e.y):y.lt(e.x,e.y)})),m&&y.lt(G[0].x,G[0].y).cp()),zot(A)||(e.loop(N,(function(e,t){0==t?S.mt(e.x,e.y):S.lt(e.x,e.y)})),m&&S.lt(N[0].x,N[0].y).cp())}r-=90,zot(i)&&(i=null!=L.thickness?L.thickness:null),zot(a)&&(a=null!=L.thicknessA?L.thicknessA:null),zot(l)&&(l=null!=L.thicknessB?L.thicknessB:null),zot(i)?zot(l)&&!zot(a)?l=a:zot(a)&&!zot(l)?a=l:l=a=10:zot(l)&&!zot(a)?l=i-a:zot(a)&&!zot(l)?a=i-l:l=a=i/2,D.thickness=a+l,zot(m)&&(m=null==L.cross||L.cross),zot(z)&&(z=null!=L.crossColors?L.crossColors:null),zot(z)||Array.isArray(z)||(z=[z]),zot(y)&&(y=null!=L.close&&L.close),zot(c)&&(c=null!=L.startX?L.startX:0),zot(u)&&(u=null!=L.startY?L.startY:0),zot(d)&&(d=null!=L.lengths?L.lengths:[200]),Array.isArray(d)||(d=[d]),zot(h)&&(h=null!=L.angles?L.angles:[0]),Array.isArray(h)||(h=[h]),zot(g)&&(g=null!=L.anglesA?L.anglesA:[10]),Array.isArray(g)||(g=[g]),zot(p)&&(p=null!=L.anglesB?L.anglesB:e.copy(g)),Array.isArray(p)||(p=[p]),zot(f)&&(f=null!=L.anglesEnd?L.anglesEnd:[0]),Array.isArray(f)||(f=[f]),zot(b)&&(b=null!=L.strokeObj?L.strokeObj:{miterLimit:2}),zot(x)&&(x=null!=L.spineBorderColor?L.spineBorderColor:null),zot(C)&&(C=null!=L.spineBorderWidth?L.spineBorderWidth:null),x<0||C<0?x=C=null:null!=x&&null==C&&(C=1),zot(w)&&(w=null!=L.spineColor?L.spineColor:C>0?"rgba(0,0,0,0)":"black"),zot(k)&&(k=null!=L.spineDashed?L.spineDashed:null),zot(T)&&(T=null!=L.spineStrokeObj?L.spineStrokeObj:{miterLimit:2}),(zot(C)||C>0)&&(zot(x)&&zot(C)||zot(x)&&(x=o||"black")),zot(B)&&(B=null!=L.closeBorderColor?L.closeBorderColor:null),zot(P)&&(P=null!=L.closeBorderWidth?L.closeBorderWidth:null),B<0||P<0?B=P=null:null!=B&&null==P&&(P=1),zot(A)&&(A=null!=L.closeColor?L.closeColor:P>0?"rgba(0,0,0,0)":null),zot(E)&&(E=null!=L.closeDashed?L.closeDashed:null),zot(I)&&(I=null!=L.closeStrokeObj?L.closeStrokeObj:{miterLimit:2}),(zot(P)||P>0)&&(zot(B)&&zot(P)||zot(B)&&(B=o||"black")),this.thicknessA=a,this.thicknessB=l,this.cross=m,this.close=y,this.lengths=d,this.angles=h,this.anglesA=g,this.anglesB=p,this.anglesEnd=f,this.crossColors=z,R(d,h,g,p,f,m,z,y),t.type&&(D.color=t),this.add=function(e,t,o,n,r,i,a,l){var s,c="lengths, angles, anglesA, anglesB, anglesEnd, cross, crossColors, close";return(s=zob(D.add,arguments,c))?s:(zot(i)||(D.cross=i),zot(l)||(D.close=l),zot(e)||(Array.isArray(e)||(e=[e]),zot(D.lengths)?D.lengths=e:D.lengths=D.lengths.concat(e)),zot(t)||(Array.isArray(t)||(t=[t]),zot(D.angles)?D.angles=t:D.angles=D.angles.concat(t)),zot(o)||(Array.isArray(o)||(o=[o]),zot(D.anglesA)?D.anglesA=o:D.anglesA=D.anglesA.concat(o)),zot(n)||(Array.isArray(n)||(n=[n]),zot(D.anglesB)?D.anglesB=n:D.anglesB=D.anglesB.concat(n)),zot(r)||(Array.isArray(r)||(r=[r]),zot(D.anglesEnd)?D.anglesEnd=r:D.anglesEnd=D.anglesEnd.concat(r)),zot(a)||(zot(D.crossColors)?zon&&zogy("Flare() - must set crossColor for original object parameters"):(Array.isArray(a)||(a=[a]),zot(D.crossColors)?D.crossColors=a:D.crossColors=D.crossColors.concat(a))),D.remake(),D)},this.remake=function(){return a=this.thicknessA,l=this.thicknessB,R(D.lengths,D.angles,D.anglesA,D.anglesB,D.anglesEnd,D.cross,D.crossColors,D.close),D},Object.defineProperty(D,"color",{get:function(){return t},set:function(e){zot(e)&&(e="black"),t=e,e&&e.type?D.specialColor(D.colorCommand,e,D):D.colorCommand.style=e}}),this.setColorRange=function(e,t){return zot(t)?(_=D.color,Y=e):zot(e)?(_=D.color,Y=t):(_=e,Y=t),D};var H=0;Object.defineProperty(D,"colorRange",{get:function(){return H},set:function(t){H=t,zot(_)||zot(Y)||(D.color=e.colorRange(_,Y,t))}}),Object.defineProperty(D,"borderColor",{get:function(){return o},set:function(e){o=e,D.borderColorCommand?e&&e.type?D.specialColor(D.borderColorCommand,e,D):D.borderColorCommand.style=e:R()}}),Object.defineProperty(D,"borderWidth",{get:function(){return n},set:function(e){e>0||(e=0),n=e,D.borderWidthCommand&&0!=n?(D.borderWidthCommand.width=n,v&&(D.borderDashedCommand.segments=[20,10],D.borderDashedCommand.offset=5)):R()}}),Object.defineProperty(D,"spineColor",{get:function(){return w},set:function(e){zot(e)&&(e="black"),w=e,D.spineColorCommand?e&&e.type?D.specialColor(D.spineColorCommand,e,D):D.spineColorCommand.style=e:R()}}),Object.defineProperty(D,"spineBorderColor",{get:function(){return x},set:function(e){x=e,D.spineBorderColorCommand?e&&e.type?D.specialColor(D.spineBorderColorCommand,e,D):D.spineBorderColorCommand.style=e:R()}}),Object.defineProperty(D,"spineBorderWidth",{get:function(){return C},set:function(e){e>0||(e=0),C=e,D.spineBorderWidthCommand&&0!=C?(D.spineBorderWidthCommand.width=C,k&&(D.spineBorderDashedCommand.segments=[20,10],D.spineBorderDashedCommand.offset=5)):R()}}),Object.defineProperty(D,"closeColor",{get:function(){return A},set:function(e){zot(e)&&(e="black"),A=e,D.closeColorCommand?e&&e.type?D.specialColor(D.closeColorCommand,e,D):D.closeColorCommand.style=e:R()}}),Object.defineProperty(D,"closeBorderColor",{get:function(){return B},set:function(e){B=e,D.closeBorderColorCommand?e&&e.type?D.specialColor(D.closeBorderColorCommand,e,D):D.closeBorderColorCommand.style=e:R()}}),Object.defineProperty(D,"closeBorderWidth",{get:function(){return P},set:function(e){e>0||(e=0),P=e,D.closeBorderWidthCommand&&0!=P?(D.closeBorderWidthCommand.width=P,E&&(D.closeBorderDashedCommand.segments=[20,10],D.closeBorderDashedCommand.offset=5)):R()}}),Object.defineProperty(D,"pin",{get:function(){return s},set:function(e){e>0||(e=0),e>D.pinPoints.length-1&&(s=0),s=e;var t=D.pinPoints[s];t&&(D.regX=t.x,D.regY=t.y)}});var F=e.boundsAroundPoints(D.points);this.setBounds(F.x,F.y,F.width,F.height),zot(s)||(D.pin=s),this.mouseChildren=!1,!1!==S&&e.styleTransforms(this,L),this.clone=function(){return D.cloneProps(new e.Flare(t,o,n,X,e.copy(i),e.copy(a),e.copy(l),s,c,u,e.copy(d),e.copy(h),e.copy(g),e.copy(p),e.copy(f),m,e.copy(z),y,v,b,w,C,x,k,T,A,P,B,E,I,S,this.group,M))}},e.extend(e.Flare,e.Container,["clone"],"zimContainer",!1),e.MultiFlare=function(t,o,n,r,i,a,l){var s,c="flares, pins, angles, endToEnd, style, group, inherit";if(s=zob(e.MultiFlare,arguments,c,this))return s;z_d("53.7"),this.zimContainer_constructor(),this.type="MultiFlare",this.group=a;var u=!1===i?{}:e.getStyle(this.type,this.group,l),d=this;zot(t)&&(t=null!=u.flares?u.flares:[]),Array.isArray(t)||(t=[t]),zot(o)&&(o=null!=u.pins?u.pins:null),zot(n)&&(n=null!=u.angles?u.angles:null),zot(r)&&(r=null!=u.endToEnd&&u.endToEnd),d.flares=t,d.pins=o,d.angles=n,d.endToEnd=r,d.mouseChildren=!1,d.add=function(t,o){return zot(t)||(zot(o)&&(o=!0),Array.isArray(t)||(t=[t]),e.loop(t,(function(e){o?d.flares.push(e.clone()):d.flares.push(e)})),d.remake(),d.stage&&d.stage.update()),d},d.remove=function(t){return zot(t)||(Array.isArray(t)||(t=[t]),e.loop(t,(function(e){var t=d.flares.indexOf(e);t>=0&&d.flares.splice(t,1)})),d.remake(),d.stage&&d.stage.update()),d},d.remake=function(){d.removeAllChildren(),e.loop(d.flares,(function(e,i){if(o&&!zot(o[i])&&(e.pin=o[i]),n&&!zot(n[i])&&(e.rotation=n[i]),e.addTo(d),d.flares.push(e),r&&i>0){var a=t[i-1],l=a.pinPoints[a.pinPoints.length-1],s=a.localToLocal(l.x,l.y,d),c=e.pinPoints[0],u=e.localToLocal(c.x,c.y,d);e.mov(s.x-u.x,s.y-u.y)}}))},d.remake(),!1!==i&&e.styleTransforms(this,u),this.clone=function(){return d.cloneProps(new e.MultiFlare(e.copy(t,!0),e.copy(o),e.copy(n),r,i,this.group,l))}},e.extend(e.MultiFlare,e.Container,["clone"],"zimContainer",!1),e.FlareBox=function(t,o,n,r,i,a,l,s,c,u,d){var h,g="width, height, color, borderColor, borderWidth, flares, corners, pins, style, group, inherit";if(h=zob(e.FlareBox,arguments,g,this))return h;z_d("53.8"),this.group=u;var p=!1===c?{}:e.getStyle("FlareBox",this.group,d);zot(t)&&(t=null!=p.width?p.width:220),zot(o)&&(o=null!=p.height?p.height:80),this.zimContainer_constructor(t,o),this.type="FlareBox";var f=this;if(this.mouseChildren=!1,zot(r)&&(r=null!=p.borderColor?p.borderColor:null),zot(i)&&(i=null!=p.borderWidth?p.borderWidth:null),r<0||i<0?r=i=null:null!=r&&null==i&&(i=1),zot(n)&&(n=null!=p.color?p.color:i>0?"rgba(0,0,0,0)":"black"),(zot(i)||i>0)&&(zot(r)&&zot(i)||zot(r)&&(r="black")),zot(a)&&(a=null!=p.flares?p.flares:null),zot(l)&&(l=null!=p.corners?p.corners:null),zot(s)&&(s=null!=p.pins?p.pins:null),f.backing=new e.Rectangle(t,o,n,r,i).addTo(this),!zot(a)){if("MultiFlare"!=a.type){if(!Array.isArray(a)){if("Flare"!=a.type)return;a=[a]}a=new e.MultiFlare(a,s)}a.addTo(f),f.multiFlare=a,f.flares=f.multiFlare.flares,a.loop((function(e,n){s&&!zot(s[n])?e.pin=s[n]:zot(e.pin)&&(e.pin=0),l&&!zot(l[n])?e.corner=l[n]:zot(e.corner)&&(e.corner=0),1==e.corner?e.loc(t,0):2==e.corner?e.loc(t,o):3==e.corner?e.loc(0,o):e.loc(0,0),e.rot(90*(e.corner-e.pin))})),!1!==c&&e.styleTransforms(this,p),this.clone=function(){return f.cloneProps(new e.FlareBox(t,o,n,r,i,e.copy(a,!0),e.copy(l),e.copy(s),c,this.group,d))}}},e.extend(e.FlareBox,e.Container,["clone"],"zimContainer",!1),e.Label=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L){var D,_="text, size, font, color, rollColor, shadowColor, shadowBlur, align, valign, bold, italic, variant, lineWidth, lineHeight, backing, outlineColor, outlineWidth, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backgroundDashed, padding, paddingHorizontal, paddingVertical, shiftHorizontal, shiftVertical, rollPersist, labelWidth, labelHeight, maxSize, splitWords, style, group, inherit";if(D=zob(e.Label,arguments,_,this))return D;z_d("54"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Label",this.group=j;var Y=!1===O?{}:e.getStyle(this.type,this.group,L);zot(t)&&(t=null!=Y.text?Y.text:"LABEL"),zot(o)&&(o=null!=Y.size?Y.size:36),zot(n)&&(n=null!=Y.font?Y.font:"arial"),zot(i)&&(i=null!=Y.color?Y.color:"black"),zot(d)&&(d=null!=Y.bold&&Y.bold),zot(h)&&(h=null!=Y.italic&&Y.italic);var X=R(t,o,n,i,d,h);function R(){return arguments}t=e.Pick.choose(t);var H=!1;""===t&&(t=" ",H=!0),o=e.Pick.choose(o),n=e.Pick.choose(n),i=e.Pick.choose(i),d=e.Pick.choose(d),h=e.Pick.choose(h),zot(a)&&(a=null!=Y.rollColor?Y.rollColor:null),(zot(l)||"ignore"==l)&&(l=null!=Y.shadowColor&&"ignore"!=l?Y.shadowColor:-1),(zot(s)||"ignore"==s)&&(s=null!=Y.shadowBlur&&"ignore"!=s?Y.shadowBlur:14),zot(c)&&(c=null!=Y.align?Y.align:"left"),zot(u)&&(u=null!=Y.valign?Y.valign:"top"),zot(z)&&zot(Y.outlineColor)||!zot(y)||(y=null!=Y.outlineWidth?Y.outlineWidth:Math.round(.2*o)),zot(y)&&zot(Y.outlineWidth)||!zot(z)||(z=null!=Y.outlineColor?Y.outlineColor:"#000000"),zot(y)&&(y=null!=Y.outlineWidth?Y.outlineWidth:0),(zot(v)||"ignore"==v)&&(v=null!=Y.backgroundColor&&"ignore"!=v?Y.backgroundColor:null),zot(b)&&(b=null!=Y.backgroundBorderColor&&"ignore"!=b?Y.backgroundBorderColor:null),zot(w)&&(w=null!=Y.backgroundBorderWidth&&"ignore"!=w?Y.backgroundBorderWidth:null),(zot(k)||"ignore"==k)&&(k=null!=Y.padding&&"ignore"!=k?Y.padding:10),zot(T)&&(T=null!=Y.paddingHorizontal?Y.paddingHorizontal:k),zot(A)&&(A=null!=Y.paddingVertical?Y.paddingVertical:k),zot(P)&&(P=null!=Y.shiftHorizontal?Y.shiftHorizontal:0),zot(B)&&(B=null!=Y.shiftVertical?Y.shiftVertical:0),zot(g)&&(g=null!=Y.variant&&Y.variant),zot(p)&&(p=null!=Y.lineWidth?Y.lineWidth:null),zot(f)&&(f=null!=Y.lineHeight?Y.lineHeight:null),(zot(m)||"ignore"==m)&&(m=null!=Y.backing&&"ignore"!=m?Y.backing.clone():null),zot(E)&&(E=null!=Y.rollPersist&&Y.rollPersist),null!=Y.labelWidth&&(p=Y.labelWidth),zot(I)||(p=I),"middle"==c&&(c="center"),zot(S)&&(S=null!=Y.labelHeight?Y.labelHeight:null),zot(W)&&(W=null!=Y.maxSize?Y.maxSize:null),o=W?Math.min(o,W):o,zot(M)&&(M=null!=Y.splitWords&&Y.splitWords);var F=WW.zdf&&WW.zdf.retina,N=this;this.mouseChildren=!1,this.paddingVertical=A,this.paddingHorizontal=T,WW.DIR&&"rtl"==WW.DIR||!WW.DIR&&"rtl"==e.DIR?"start"==c?c="right":"end"==c&&(c="left"):"start"==c?c="left":"end"==c&&(c="right");var V=[];V[0]=h?"italic":"normal",V[1]=g?"small-caps":"normal",V[2]=d?"bold":"normal",V[3]=o+"px",V[4]=n;var G,q=V.join(" ");t=String(t);var U,Q,Z=!1,K=p,J=S;if(zot(m)&&zot(v)){var $=new createjs.Shape;N.hitArea=$}else K&&(K-=2*T),J&&(J-=2*A);function ee(e){var t=new createjs.Text(e,q,i);return t.lineWidth=K,t.lineHeight=f,t}function te(e,t,o){var n=Math.ceil(K/t*o.length),r=o.substr(0,n),i=ee(r),a=i.getMeasuredWidth();if(a>K)for(;a>K;)n--,a=(i=ee(r=o.substr(0,n))).getMeasuredWidth();else if(a<K){for(;a<K;)n++,a=(i=ee(r=o.substr(0,n))).getMeasuredWidth();n--,r=o.substr(0,n)}return{endIndex:n,start:r,end:o.substr(n,o.length)}}if(G=ee(t),M&&K>1.2*o)for(var oe=G.getMetrics(),ne=0;oe.width>K&&ne<1e3;)ne++,e.loop(oe.lines,(function(e,t){var o=ee(e=e.replace(/^[\s\t]+/,"")),n=o.getMeasuredWidth();if(n>K){var r=te(0,n,e);return oe.lines[t]=r.start,oe.lines.length>t+1?(r.end.trim(),oe.lines[t+1]=r.end+" "+oe.lines[t+1]):oe.lines.push(r.end),G=ee(oe.lines.join(" ")),oe=G.getMetrics(),!1}}));if(this.label=G,G.textAlign=c,G.textBaseline="alphabetic",y>0){var re=this.outlineLabel=G.clone();re.color=z,re.outline=y}function ie(){N.removeChild(N.background),N.background=new e.Rectangle(N.getBounds().width+2*T,N.getBounds().height+2*A,v,b,w,C,x,null,null,!1),e.center(N.background,N,0),N.setBounds(N.background.x,N.background.y,N.background.width,N.background.height)}function ae(){var t,n=G.getBounds(),r=n.y,i=n.height;if(K&&!J){var a=n.x,l=K;"right"==c?a=n.x-K+n.width:"center"==c&&(a=-K/2),G.setBounds(a,r,l,i),n=G.getBounds()}"baseline"==u?t=n.y:"top"==u?(G.y=o-o/6,t=0):"center"==u||"middle"==u?(t=-n.height/2,G.y=.3*o):t=-n.height,N.setBounds(n.x,t,Y.width?Y.width-2*k:n.width,Y.height?Y.height-2*k:n.height),N.hitArea&&N.hitArea.graphics.c().f("black").r(N.getBounds().x,N.getBounds().y,N.getBounds().width,N.getBounds().height),"center"!=u&&"middle"!=u||(e.pos(G,null,0),e.mov(G,0,1)),S||(m?Z&&ce():zot(v)||ie()),"baseline"==u||F||(G.y+=o/32),ue()}if(-1!=l&&s>0&&(G.shadow=new createjs.Shadow(l,3,3,s)),this.addChild(G),ae(),!zot(m)){if("Pattern"==m.type){if(N.backing=new e.Container(N.width+2*T,N.height+2*A,null,null,!1).centerReg(null,null,!1),-1!=l&&s>0){var le=new e.Rectangle(N.width+2*T-2,N.height+A-2,"#666",null,null,C,null,null,null,!1).center(N.backing);le.shadow=new createjs.Shadow(l,3,3,s)}var se=new e.Rectangle(N.width+2*T,N.height+2*A,v,null,null,C,null,null,null,!1).addTo(N.backing);m.centerReg(se),m.setMask(se),N.backing.pattern=m}else N.backing=m;N.backing.center(N,0),m=N.backing,ce(),Z=!0}function ce(){var e=m.boundsToGlobal(),t=N.boundsToGlobal(e,!0);N.setBounds(t.x,t.y,t.width,t.height)}function ue(){e.pos(G,"left"==c||"right"==c?m||N.background?T:0:null,"top"==u||"baseline"==u||"bottom"==u?m||N.background?A:0:null,"right"==c,"bottom"==u),G.x+=P,G.y+=B}function de(){re&&(re.x=G.x,re.y=G.y,N.addChildAt(re,N.background||N.backing?1:0))}ue(),de(),Object.defineProperty(N,"text",{get:function(){return" "==G.text&&H?"":G.text},set:function(e){H=!1,""===e&&(e=" ",H=!0),G.text=String(e),G.setBounds(null),N.setBounds(null),ae(),re&&(re.text=String(e)),zot(p)||zot(S)||(fe(),re&&de())}}),Object.defineProperty(N,"size",{get:function(){return o},set:function(e){o=W?Math.min(e,W):e,V[3]=o+"px",this.label.font=V.join(" "),re&&(re.font=V.join(" ")),G.setBounds(null),N.setBounds(null),ae(),de()}}),Object.defineProperty(N,"bold",{get:function(){return Boolean(this.label.font.match("bold"))},set:function(e){d=e,V[2]=e?"bold":"normal",this.label.font=V.join(" "),re&&(re.font=V.join(" "))}}),Object.defineProperty(N,"italic",{get:function(){return Boolean(this.label.font.match("italic"))},set:function(e){h=e,V[0]=e?"italic":"normal",this.label.font=V.join(" "),re&&(re.font=V.join(" "))}}),Object.defineProperty(N,"variant",{get:function(){return Boolean(this.label.font.match("small-caps"))},set:function(e){g=e,V[1]=e?"small-caps":"normal",this.label.font=V.join(" "),re&&(re.font=V.join(" "))}}),Object.defineProperty(N,"font",{get:function(){return V[4]},set:function(e){zot(e)||(n=e,V[4]=e,this.label.font=V.join(" "),re&&(re.font=V.join(" ")))}}),Object.defineProperty(N,"align",{get:function(){return c},set:function(e){zot(e)||(c=e,this.label.textAlign=c,re&&(re.textAlign=c),ae(),de())}}),Object.defineProperty(N,"valign",{get:function(){return u},set:function(e){zot(e)||(u=e,ae(),de())}}),Object.defineProperty(N,"color",{get:function(){return i},set:function(t){a==i&&(a=t),i=t,G.color=i,e.OPTIMIZE||!zns&&WW.OPTIMIZE||!N.stage||N.stage.update()}}),Object.defineProperty(N,"colorOnly",{get:function(){return i},set:function(t){i=t,G.color=i,e.OPTIMIZE||!zns&&WW.OPTIMIZE||!N.stage||N.stage.update()}}),this.setColorRange=function(e,t){return zot(t)?(U=N.color,Q=e):zot(e)?(U=N.color,Q=t):(U=e,Q=t),N};var he=0;function ge(){N.mouseoverEvent=N.on("mouseover",(function(){N.showRollColor&&N.showRollColor()})),N.mouseoutEvent=N.on("mouseout",(function(){N.rollPersist||N.showRollColor(!1)})),N.pressupEvent=N.on("pressup",(function(){N.rollPersist&&N.showRollColor(!1)}))}function pe(){N.off("mouseover",N.mouseoverEvent),N.off("mouseout",N.mouseoutEvent),N.off("pressup",N.pressupEvent)}function fe(){N.size=W||200;for(var e=0;f<J/2&&(N.height>J||N.width>K)&&(e++,N.size=N.size/2,!(e>50)););for(e=0;N.height<=J&&N.width<=K&&(e++,N.size=Math.ceil(N.size+1),!(e>50)););N.size=N.size-1,de(),G.setBounds(null);var t=G.getBounds(),o=t.y,n=t.height;J&&("bottom"==u?o=o-J+n:"center"!=u&&"middle"!=u||(o=(o+o-J+n)/2),n=J),G.setBounds(t.x,o,t.width,n),N.setBounds(null),t=N.getBounds(),N.setBounds(t.x,t.y,t.width,t.height),m?Z&&ce():zot(v)||ie()}Object.defineProperty(N,"colorRange",{get:function(){return he},set:function(t){he=t,zot(U)||zot(Q)||(N.color=e.colorRange(U,Q,t))}}),Object.defineProperty(N,"backgroundColor",{get:function(){return v},set:function(t){v=t,N.background?N.background.color=t:N.backing?N.backing.color=t:ie(),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!N.stage||N.stage.update()}}),Object.defineProperty(N,"outlineColor",{get:function(){return z},set:function(t){z=t,re&&(re.color=z),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!N.stage||N.stage.update()}}),Object.defineProperty(N,"rollColor",{get:function(){return a},set:function(e){!N.mouseoverEvent&&e&&ge(),null==e&&N.mouseoverEvent&&pe(),a=e}}),this._enabled=!0,Object.defineProperty(N,"enabled",{get:function(){return N._enabled},set:function(t){r(N,t),G.color=i,N.mouseChildren=!1,e.OPTIMIZE||!zns&&WW.OPTIMIZE||!N.stage||N.stage.update()}}),this.showRollColor=function(e){return zot(e)&&(e=!0),G.color=e?a:i,N.stage&&N.stage.update(),N},a&&ge(),Object.defineProperty(N,"labelWidth",{get:function(){return p},set:function(t){t>0&&(K=p=t,zot(m)&&zot(v)||K&&(K-=2*T),N.label.lineWidth=K,re&&(re.lineWidth=K),G.setBounds(null),N.setBounds(null),ae(),S&&fe(),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!N.stage||N.stage.update())}}),Object.defineProperty(N,"labelHeight",{get:function(){return S},set:function(t){t>0&&(J=S=t,zot(m)&&zot(v)||J&&(J-=2*A),p&&fe(),N.setBounds(null),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!N.stage||N.stage.update())}}),zot(p)||zot(S)||fe(),e.styleTransforms(this,Y),this.clone=function(t){return N.cloneProps(new e.Label(t||!e.isPick(X[0])?N.text:X[0],t||!e.isPick(X[1])?o:X[1],t||!e.isPick(X[2])?n:X[2],t||!e.isPick(X[3])?i:X[3],a,l,s,c,u,t||!e.isPick(X[4])?d:X[4],t||!e.isPick(X[5])?h:X[5],g,p,f,zot(m)?null:m.clone(t),z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,this.group,L))}},e.extend(e.Label,e.Container,"clone","zimContainer"),e.LabelOnPath=function(t,o,n,r,i,a,l,s,c,u,d,h){var g,p="label, path, percentAngle, percents, showPath, allowToggle, interactive, onTop, rtl, style, group, inherit";if(g=zob(e.LabelOnPath,arguments,p,this))return g;z_d("54.5"),this.zimContainer_constructor(null,null,null,null,!1),this.type="LabelOnPath",this.group=d;var f=!1===u?{}:e.getStyle(this.type,this.group,h);zot(t)&&(t=null!=f.label?f.label:new e.Label("Label on Path")),zot(o)&&(o=null!=f.path?f.path:new e.Squiggle({points:[[0,0,0,0,-86,57,86,-57],[300,150,0,0,-133,21,133,-21]]})),zot(n)&&(n=null!=f.percentAngle?f.percentAngle:100),zot(r)&&(r=null!=f.percents?f.percents:null),zot(i)&&(i=null==f.showPath||f.showPath),zot(a)&&(a=null==f.allowToggle||f.allowToggle),zot(l)&&(l=null==f.interactive||f.interactive),zot(s)&&(s=null!=f.onTop&&f.onTop),zot(c)&&(c=null!=f.rtl?f.rtl:"rtl"==WW.DIR||"rtl"==e.DIR),c&&o.reversePoints();var m=t.color;o.addTo(this);var z=this;this.path=o,this.allowToggle=a,o.interactive=l,"string"==typeof t&&(t=new e.Label(t));var y=o.alpha;i||o.alp(0),o.onTop=s;var v=this.letters=(new e.Container).addTo(this);if(!r){r=[];for(var b=0;b<t.text.length;b++)r.push(e.decimals(1/(t.text.length-("Blob"==o.type?0:1))*100*b))}function w(){var e;for(e=v.numChildren-1;e>=0;e--)v.getChildAt(e).dispose();for(z.numLetters=t.text.length,e=0;e<z.numLetters;e++){var o=t.clone();o.text=t.text[e],o.centerReg(v).reg(null,o.height),""!=o.text&&" "!=o.text&&o.expand(0),z.allowToggle&&(o.cursor="pointer"),o.on("mousedown",(function(){z.allowToggle&&z.toggle()}))}z.resize()}this.percents=r,this.resize=function(){for(var e=o.segmentRatios,t=o.segmentPoints,i=0;i<this.numLetters;i++){var a=o.getCurvePoint(r[i]/100,e,t,!0);if(a){var l=this.globalToLocal(a.x,a.y);l&&(v.getChildAt(i).loc(l).rot((a.angle>180?a.angle-360:a.angle)*n/100),c&&(v.getChildAt(i).rotation+=180))}}return this},w(),this.showPath=function(e){return this.toggle(!0),o.toggle(e),this},this.hidePath=function(){return this.toggle(!1),this},Object.defineProperty(z,"text",{get:function(){return t.text},set:function(n){t.text=n,r=[];for(var i=0;i<t.text.length;i++)r.push(e.decimals(1/(t.text.length-("Blob"==o.type?0:1))*100*i));w()}}),Object.defineProperty(this,"color",{get:function(){return m},set:function(e){m=e;for(var t=0;t<z.letters.numChildren;t++)z.letters.getChildAt(t).color=m;z.stage&&z.stage.update()}}),Object.defineProperty(z,"interactive",{get:function(){return l},set:function(t){l=t,o.interactive=t,this.ticker&&e.Ticker.remove(this.ticker),l&&(this.ticker=e.Ticker.add((function(){z.resize()})))}}),this.interactive&&(this.ticker=e.Ticker.add((function(){z.resize()})));var C=z.toggled=i;this.toggle=function(e){if(this.allowToggle)return(C=zot(e)?!C:!!e)?(o.alp(y),this.interactive&&(o.showControls(),v.mouseEnabled=!1,v.mouseChildren=!1,v.cursor="default",this.controlHideEvent&&o.off("controlshide",this.controlHideEvent),this.controlHideEvent=o.on("controlshide",(function(){v.mouseEnabled=!0,v.mouseChildren=!0,v.cursor="pointer",y=o.alpha,o.alp(0),C=!1,z.toggled=C,z.stage&&z.stage.update()}),null,!0))):(y=o.alpha,o.alp(0),v.mouseEnabled=!0,v.mouseChildren=!0,v.cursor="pointer"),z.toggled=C,z.stage&&z.stage.update(),z},z.toggle(!0),e.styleTransforms(this,f),this.clone=function(){return z.cloneProps(new e.LabelOnPath(z.label.clone(),z.path.clone(),n,e.copy(r),i,a,l,s,c,u,this.group,h))},this.dispose=function(t,o,n){return this.ticker&&e.Ticker.remove(this.ticker),n||this.zimContainer_dispose(!0),!0}},e.extend(e.LabelOnPath,e.Container,["clone","dispose"],"zimContainer",!1),e.LabelOnArc=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y){var v,b="label, size, font, color, radius, flip, spacing, letterSpacing, angles, showCircle, arcColor, arcBorderColor, arcBorderWidth, radiusSpread, rtl, style, group, inherit";if(v=zob(e.LabelOnArc,arguments,b,this))return v;z_d("54.55"),this.group=z;var w=!1===m?{}:e.getStyle("LabelOnArc",this.group,y);zot(o)&&(o=null!=w.size?w.size:30),zot(t)&&(t=null!=w.label?w.label:new e.Label("Label on Arc",o)),zot(n)&&(n=null!=w.font?w.font:"verdana"),zot(r)&&(r=null!=w.color?w.color:"white"),zot(i)&&(i=null!=w.radius?w.radius:100),zot(a)&&(a=null!=w.flip&&w.flip),zot(l)&&(l=null!=w.spacing?w.spacing:0),zot(s)&&(s=null!=w.letterSpacing?w.letterSpacing:5),zot(c)&&(c=null!=w.angles?w.angles:null);var C=!zot(c),x=e.copy(c);zot(u)&&(u=null!=w.showCircle&&w.showCircle),zot(d)&&(d=null!=w.arcColor?w.arcColor:null),zot(h)&&(h=null!=w.arcBorderColor?w.arcBorderColor:null),zot(g)&&(g=null!=w.arcBorderWidth?w.arcBorderWidth:null),zot(p)&&(p=null!=w.radiusSpread&&w.radiusSpread),zot(f)&&(f=null!=w.rtl?w.rtl:"rtl"==WW.DIR||"rtl"==e.DIR);var k=this.outerRadius=i+l+t.height;this.innerRadius=i+l,this.zimContainer_constructor(-k,-k,2*k,2*k,!1),this.type="LabelOnArc";var T,A,P,B,E,I,S=this;function W(){if(S.disposeAllChildren(),a){var o=t.text.split("").reverse().join("");t.text=o}var n;for(T=S.letters=new e.Container(S.width,S.height).centerReg(S),S.numLetters=t.text.length,S.letterHeight=t.height,A=S.labels=[],n=0;n<S.numLetters;n++){var r=t.clone();A.push(r),r.text=t.text[n],r.letterHolder=new e.Container(r.width,r.height),r.centerReg(r.letterHolder).rot(a?180:0)}if(f&&A.reverse(),B=S.circle=new e.Circle(i),u&&B.addTo(S),P=S.arc=(new e.Shape).addTo(S),M(),c){for(E=0,n=0;n<c.length;n++)E+=c[n];E+=c[c.length-1]/2}O()}function M(){E=0,I=[0];for(var e=0;e<S.numLetters;e++){var t=A[e],o=180*Math.atan((t.width+s)/2/(i+l))/Math.PI*2;I.push(o),E+=o,t.letterHolder.centerReg(T).reg(null,i+l+t.height+(a?.13*t.height:0))}S.circle.radius=i,(d||h||g)&&(g>0&&zot(h)?h="#000000":zot(g)&&!zot(h)&&(g=2),P.graphics.c().f(null).s(h).ss(g).arc(0,0,i,(S.startAngle-90)*Math.PI/180,(S.startAngle-90+E)*Math.PI/180))}function O(){var e;if(!C)for(c=[],e=0;e<I.length-1;e++)c[e]=Math.round((I[e]+I[e+1])/2*100)/100;S.angles=c,S.startAngle=-E/2;var t=S.startAngle;for(e=0;e<T.numChildren;e++){t=T.getChildAt(e).rotation=t+c[e]}}"Label"!=t.type&&(t=new e.Label(t,o,n,r)),t.text,W(),Object.defineProperty(this,"radius",{get:function(){return i},set:function(e){i=e,M(),C||p||O()}}),Object.defineProperty(this,"color",{get:function(){return r},set:function(e){r=e;for(var t=0;t<S.labels.length;t++)S.labels[t].color=r;S.stage&&S.stage.update()}}),Object.defineProperty(S,"text",{get:function(){return t.text},set:function(o){t.text=o,c=x?e.copy(x):null,W()}}),e.styleTransforms(this,w),this.clone=function(){return S.cloneProps(new e.LabelOnArc(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,this.group,y))}},e.extend(e.LabelOnArc,e.Container,"clone","zimContainer",!1),e.LabelLetters=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f){var m,z="label, align, valign, letterSpacing, letterSpacings, lineSpacing, lineSpacings, lineHeight, lineAlign, lineValign, cache, rtl, style, group, inherit";if(m=zob(e.LabelLetters,arguments,z,this))return m;z_d("54.57"),this.group=p;var y=!1===g?{}:e.getStyle("LabelLetters",this.group,f);zot(t)&&(t=null!=y.label?y.label:new e.Label("Label Letters")),zot(o)&&(o=null!=y.align?y.align:"center"),zot(n)&&(n=null!=y.valign?y.valign:"center"),zot(r)&&(r=null!=y.letterSpacing?y.letterSpacing:5),zot(i)&&(i=null!=y.letterSpacings?y.letterSpacings:null),zot(s)&&(s=null!=y.lineHeight?y.lineHeight:null),zot(a)&&(a=null!=y.lineSpacing?y.lineSpacing:5),zot(l)&&(l=null!=y.lineSpacings?y.lineSpacings:null),zot(h)&&(h=null!=y.rtl&&y.rtl),zot(c)&&(c=null!=y.lineAlign?y.lineAlign:h?"right":"left"),zot(u)&&(u=null!=y.lineValign?y.lineValign:"bottom"),zot(d)&&(d=null!=y.cache&&y.cache),this.zimContainer_constructor(null,null,null,null,!1),this.type="LabelLetters";var v,b,w=this,C=w.letterData=[];function x(t){var o=[];if(h){K=-1,t=t.replace(/[\u0591-\u07FF]+/gi,(function(e){return e.split("").reverse().join("")}));var n=(t=(t=(t=(t=t.replace(/([^\u0591-\u07FF ])([\u0591-\u07FF])/gi,"$1-!!-$2")).replace(/([\u0591-\u07FF])([^\u0591-\u07FF ])/gi,"$1-!!-$2")).replace(/([^\u0591-\u07FF]) ([\u0591-\u07FF])/gi,"$1-!!- -!!-$2")).replace(/([\u0591-\u07FF]) ([^\u0591-\u07FF])/gi,"$1-!!- -!!-$2")).split(/-!!-/g);e.loop(n,(function(e,t){e.match(/[\u0591-\u07FF]/i)&&(n[t]=e.split(" ").reverse().join(" "))})),t=n.join("")}t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\n|\r/g,"<br>")).replace(/<strong>|<strong \/>|<strong\/>/gi,"<b>")).replace(/<\/strong>/gi,"</b>")).replace(/<em>|<em \/>|<em\/>/gi,"<i>")).replace(/<\/em>/gi,"</i>")).replace(/\\n|\\r/g,"<br>")).replace(/<br>|<br \/>|<br\/>(<\/br>)?/gi,"<br>")).replace(/<b/gi,"<b")).replace(/<i/gi,"<i")).replace(/<u/gi,"<u")).replace(/<br/gi,"<br")).replace(/<a/gi,"<a")).replace(/<font/gi,"<font");var r,i=[/<(a|i|u|f|br|\/a|\/i|\/u|\/f|\/b)[^>]*>/g,/<(a|i|u|f|br|\/a|\/i|\/u|\/f|b)[^>]*>/g,/<(b|i|u|f|br|\/b|\/i|\/u|\/f|\/a)[^>]*>/g,/<(b|i|u|f|br|\/b|\/i|\/u|\/f|a)[^>]*>/g,/<(b|a|u|f|br|\/b|\/a|\/u|\/f|\/i)[^>]*>/g,/<(b|a|u|f|br|\/b|\/a|\/u|\/f|i)[^>]*>/g,/<(b|a|i|f|br|\/b|\/a|\/i|\/f|\/u)[^>]*>/g,/<(b|a|i|f|br|\/b|\/a|\/i|\/f|u)[^>]*>/g,/<(b|a|i|u|br|\/b|\/a|\/i|\/u|\/f)[^>]*>/g,/<(b|a|i|u|br|\/b|\/a|\/i|\/u|f)[^>]*>/g];e.loop(["b","a","i","u","font"],(function(e,o){r=t.replace(i[2*o],""),l("font"==e?r.split("<font "):"a"==e?r.split("<a "):r.split("<"+e+">"),e,0),l((r=t.replace(i[2*o+1],"")).split("</"+e+">"),e,1)}));var a=(r=(r=t.replace(/<br>/gi,"@^#")).replace(/<(b|a|i|u|f|\/b|\/a|\/i|\/u|\/f)[^>]*>/g,"")).split("@^#");function l(t,n,r){if(t.length>1)if("font"!=n&&"a"!=n||0!=r){t.pop();var i=0;e.loop(t,(function(e){i+=e.length;var t=o[i];t||(o[i]=[]),(t=o[i])[r]?t[r].push(n):t[r]=[n]}))}else{var a=t[0].length;e.loop(t,(function(e,t){if(0!=t){var i=o[a];i||(o[a]=[]),i=o[a];var l=e.split(">");i[r]?i[r].push(n+" "+l[0]):i[r]=[n+" "+l[0]],a+=l[1].length}}))}}return v=a.join("\n"),r=a.join(""),l(a,"br",0),{text:r,data:o,original:v}}"Label"!=t.type?(C=(b=x(t)).data,t=new e.Label(b.text)):(C=(b=x(t.text)).data,t.text=b.text),w.text=b.original,w._color=t.color,WW.DIR&&"rtl"==WW.DIR||!WW.DIR&&"rtl"==e.DIR?"start"==c?c="right":"end"==c&&(c="left"):"start"==c?c="left":"end"==c&&(c="right"),w.numLetters=t.text.length;var k,T=!zot(i);if(i&&!Array.isArray(i)&&(i=null),i)for(k=0;k<w.numLetters;k++)zot(i[k])&&(i[k]=r);else for(i=[],k=0;k<w.numLetters;k++)i.push(r);if(w.letterSpacings=i,l&&!Array.isArray(l)&&(l=null),l)for(k=0;k<w.numLetters-1;k++)zot(l[k])&&(l[k]=a);else for(l=[],k=0;k<w.numLetters-1;k++)l.push(a);w.lineSpacings=l,w.labels=[],w.lines=[[]];var A=[],P=[],B=[0],E=0,I=0,S=0,W=0,M=0,O=C,j=!1,L=!1,D=!1,_=!1,Y=!1,X=!1,R=!1,H=!1,F=!1,N=!1,V=!1,G=!1;for(w.rolls=[[]],k=0;k<w.numLetters;k++){var q;_=!1,O[k]&&(O[k][1]&&(O[k][1].indexOf("b")>=0&&(j=!1),O[k][1].indexOf("i")>=0&&(L=!1),O[k][1].indexOf("u")>=0&&(D=!1),e.loop(O[k][1],(function(e){return e.match(/^font/i)?(Y=!1,V=!1,G&&w.rolls.push([]),G=!1,X=!1,H=!1,void(R=!1)):e.match(/^a/i)?(F=!1,void(N=!1)):void 0}))),O[k][0]&&(O[k][0].indexOf("b")>=0&&(j=!0),O[k][0].indexOf("i")>=0&&(L=!0),O[k][0].indexOf("u")>=0&&(D=!0),_=0,e.loop(O[k][0],(function(e){"br"==e&&_++})),e.loop(O[k][0],(function(t){var o,n;return t.match(/^font/i)?((o=t.match(/ color\s?=\s?(\S*)/i))&&(Y=o[1],(n=e.colors.indexOf(Y))>=0&&(Y=e.colorsHex[n]),Y=Y.replace(/'/g,"")),(o=t.match(/size\s?=\s?(\S*)/i))&&(X=o[1]),(o=t.match(/backgroundColor\s?=\s?(\S*)/i))&&(V=o[1],(n=e.colors.indexOf(V))>=0&&(V=e.colorsHex[n]),V=V.replace(/'/g,"")),(o=t.match(/rollBackgroundColor\s?=\s?(\S*)/i))&&(G=o[1],(n=e.colors.indexOf(G))>=0&&(G=e.colorsHex[n]),G=G.replace(/'/g,"")),(o=t.match(/group\s?=\s?(\S*)/i))&&(R=o[1]),void((o=t.match(/family\s?=\s?(.*)/i))&&(H=(H=o[1]).split(/\ssize\s?=|\scolor\s?=|\sgroup\s?=/i)[0]))):t.match(/^a/i)?((o=t.match(/href\s?=\s?(\S*)/i))&&(F=o[1]),void((o=t.match(/target\s?=\s?(\S*)/i))&&(N=o[1]))):void 0})))),R?q=new e.Label({text:t.text[k],group:R}):(q=t.clone()).text=t.text[k],w.labels.push(q),j&&(q.bold=!0),L&&(q.italic=!0),Y&&(q.color=Y),V&&(q.backgroundColor=V);var U=T||zot(q.backgroundColor)?i[k]:-.5;G&&(q.rollIndex=w.rolls.length-1,q.zrbc=G,q.zobc=q.backgroundColor,w.rolls[q.rollIndex].push(q),q.expand(0),q.on("mouseover",Q),q.on("mouseout",Z)),F&&(q.expand(U,0),q.zurl=F,q.ztar=N,q.cur(),q.on("click",(function(e){var t=e.currentTarget;Z(e),t.ztar||(t.ztar="_self"),zgo(t.zurl,t.ztar)}))),X&&(q.size=X),H&&(q.font=H),_&&(E+=(zot(s)?S:s)+l[W],B.push(E),P.push(zot(s)?S:s),A.push(I),M=Math.max(M,I)),_&&(_>1&&e.loop(_-1,(function(){w.lines.push([]),E+=(zot(s)?S:s)+l[W],B.push(E),P.push(zot(s)?S:s),A.push(0),W++})),S=0,I=0,w.lines.push([]),W++),I+=q.width+U,S=Math.max(S,q.height),k==w.numLetters-1&&(A.push(I),P.push(S),M=Math.max(M,I)),w.lines[W].push(q),D&&(q.underline=new e.Line(q.width+U+1,1,q.color).center(q,this).mov(0,q.height/2))}function Q(t){var o=t.currentTarget,n=w.rolls[o.rollIndex];e.loop(n,(function(e){e.backgroundColor=o.zrbc})),o.stage&&o.stage.update()}function Z(t){var o=t.currentTarget,n=w.rolls[o.rollIndex];e.loop(n,(function(e){e.backgroundColor=o.zobc})),o.stage&&o.stage.update()}for(var K=0,J=0;J<w.lines.length;J++){var $,ee,te=w.lines[J];for(I=A[J],S=P[J],E=B[J],$="left"==c?0:"right"==c?M-I:(M-I)/2,ee=E,k=0;k<te.length;k++){K++,d&&q.cache(),(q=te[k]).regX="left"==o?0:"right"==o?q.width:q.width/2,q.regY="top"==n?0:"bottom"==n?q.height:q.height/2;var oe=ee+("top"==n?0:"bottom"==n?q.height:q.height/2);"center"==u||"middle"==u?oe+=(P[J]-q.height)/2:"bottom"==u&&(oe+=P[J]-q.height),U=T||zot(q.backgroundColor)?i[K-1]:-.5,"left"==o?(q.loc($,oe,this),$=q.x+q.width+U):"right"==o?(q.loc($+q.width,oe,this),$=q.x+U):(q.loc($+q.width/2,oe,this),$=q.x+q.width/2+U)}}this.getBounds()||this.setBounds(0,0,0,0),this.regX=this.getBounds().x,this.regY=this.getBounds().y,Object.defineProperty(this,"color",{get:function(){return this._color},set:function(e){this._color=e;for(var t=0;t<w.numChildren;t++)w.getChildAt(t).color=this._color;w.stage&&w.stage.update()}}),this.dispose=function(){e.gD(this),e.loop(w.labels,(function(e){e.removeFrom(),e.dispose()})),w.removeFrom()},e.styleTransforms(this,y),this.clone=function(){return w.cloneProps(new e.LabelLetters(t,o,n,r,i,a,l,s,c,u,d,h,g,this.group,f))}},e.extend(e.LabelLetters,e.Container,"clone","zimContainer",!1),e.Emoji=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z){var y,v="code, size, monochrome, italic, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backing, padding, paddingHorizontal, paddingVertical, shiftHorizontal, shiftVertical, style, group, inherit";if(y=zob(e.Emoji,arguments,v,this))return y;z_d("54.58"),this.group=m;var b=!1===f?{}:e.getStyle("Emoji",this.group,z);zot(t)&&(t=null!=b.code?b.code:"🙂"),zot(o)&&(o=null!=b.size?b.size:30),zot(n)&&(n=null!=b.monochrome&&b.monochrome),zot(r)&&(r=null!=b.italic&&b.italic),(zot(i)||"ignore"==i)&&(i=null!=b.backgroundColor&&"ignore"!=i?b.backgroundColor:null),zot(a)&&(a=null!=b.backgroundBorderColor&&"ignore"!=a?b.backgroundBorderColor:null),zot(l)&&(l=null!=b.backgroundBorderWidth&&"ignore"!=l?b.backgroundBorderWidth:null),(zot(u)||"ignore"==u)&&(u=null!=b.padding&&"ignore"!=u?b.padding:10),zot(d)&&(d=null!=b.paddingHorizontal?b.paddingHorizontal:u),zot(h)&&(h=null!=b.paddingVertical?b.paddingVertical:u),zot(g)&&(g=null!=b.shiftHorizontal?b.shiftHorizontal:0),zot(p)&&(p=null!=b.shiftVertical?b.shiftVertical:0);var w=C(t,o);function C(){return arguments}t=e.Pick.choose(t),o=e.Pick.choose(o),"U+"==t.substring(0,2)&&(t=e.unicodeToUTF(t)),this.zimLabel_constructor(t,o,null,null,null,null,null,null,null,null,r,null,null,null,c,null,null,i,null,null,s,null,u,d,h,g,p),this.type="Emoji",this.code=t,this.size=o;var x=this,k=this.getBounds(),T=5,A=3;this.bounds=this.setBounds(k.x+A,k.y-T+1,k.width-2*A,k.height+T),n&&(this.saturation=-100);var P=n;Object.defineProperty(x,"monochrome",{get:function(){return P},set:function(e){e!=P&&(P=e,e&&(this.saturation=e?-100:0))}}),this.cache=function(e,t,o,n){return zot(e)?(t=this.getBounds(),this.zimLabel_cache(t.x-20,t.y-20,t.width+40,t.height+40)):this.zimLabel_cache(e,t,o,n),this},e.styleTransforms(this,b),this.clone=function(o){return x.cloneProps(new e.Emoji(o||!e.isPick(w[0])?t:w[0],o||!e.isPick(w[1])?x.size:w[1],n,r,i,a,l,s,c,u,d,h,g,p,f,x.group,z))}},e.extend(e.Emoji,e.Label,["clone","cache"],"zimLabel",!1),e.Button=function(o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q,U,Q,Z,K,J,$,ee,te,oe,ne,re,ie,ae,le,se,ce,ue,de,he,ge,pe,fe,me){var ze,ye="width, height, label, backgroundColor, rollBackgroundColor, downBackgroundColor, color, rollColor, downColor, borderColor, borderWidth, rollBorderColor, downBorderColor, backing, rollBacking, downBacking, icon, rollIcon, downIcon, corner, dashed, shadowColor, shadowBlur, gradient, gloss, align, valign, indent, indentHorizontal, indentVertical, hitPadding, autoPadding, autoPaddingH, autoPaddingV, rollPersist, toggle, toggleBackgroundColor, rollToggleBackgroundColor, downToggleBackgroundColor, toggleColor, rollToggleColor, downToggleColor, toggleBacking, rollToggleBacking, downToggleBacking, toggleIcon, rollToggleIcon, downToggleIcon, toggleEvent, wait, waitTime, waitBackgroundColor, rollWaitBackgroundColor, downWaitBackgroundColor, waitColor, rollWaitColor, downWaitColor, waitBacking, rollWaitBacking, downWaitBacking, waitIcon, rollWaitIcon, downWaitIcon, waitModal, waitEnabled, style, group, inherit";if(ze=zob(e.Button,arguments,ye,this))return ze;z_d("55"),this.group=fe;var ve=!1===pe?{}:e.getStyle("Button",fe,me);zot(o)&&(o=null!=ve.width?ve.width:200),zot(n)&&(n=null!=ve.height?ve.height:60),zot(WW.M)&&(WW.M=e.mobile());var be=c,we=u;zot(c)&&(c=null!=ve.color?ve.color:"white"),zot(u)&&(u=null!=ve.rollColor?ve.rollColor:"white"),zot(O)&&(O=null!=ve.autoPadding?ve.autoPadding:20),zot(j)&&(j=null!=ve.autoPaddingH?ve.autoPaddingH:O),zot(L)&&(L=null!=ve.autoPaddingV?ve.autoPaddingV:O),zot(B)&&(B=null!=ve.align?ve.align:"center"),zot(E)&&(E=null!=ve.valign?ve.valign:"center"),zot(i)&&(i=zot(v)?null!=ve.label?ve.label:"PRESS":""),"string"==typeof i||"number"==typeof i?i=new e.Label({text:i,size:null!=ve.size?ve.size:36,font:null!=ve.font?ve.font:"arial",color:null!=ve.color&&null==be?ve.color:c,rollColor:ve.rollColor&&null==we!=null?ve.rollColor:u,align:B,valign:E,rollPersist:null!=ve.rollPersist&&ve.rollPersist,backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",shiftVertical:null!=ve.shiftVertical?ve.shiftVertical:0,shiftHorizontal:null!=ve.shiftHorizontal?ve.shiftHorizontal:0,style:!1,group:this.group}):(zot(be)||(i.color=be),c=i.color,!zot(i.rollColor)&&zot(we)||(i.rollColor=u),u=i.rollColor),zot(d)&&(d=null!=ve.downColor?ve.downColor:u),"auto"==o&&(o=i.width+2*j),"auto"==n&&(n=i.height+2*L),this.zimContainer_constructor(o,n,null,null,!1),this.type="Button",zot(a)&&(a=null!=ve.backgroundColor?ve.backgroundColor:e.purple),zot(l)&&(l=null!=ve.rollBackgroundColor?ve.rollBackgroundColor:e.pink),zot(s)&&(s=null!=ve.downBackgroundColor?ve.downBackgroundColor:l);var Ce=xe(a,l,s,c,u,d);function xe(){return arguments}a=zik(a),l=zik(l),s=zik(s),c=zik(c),u=zik(u),d=zik(d);var ke=h,Te=g;zot(h)&&(h=null!=ve.borderColor?ve.borderColor:null),zot(g)&&(g=null!=ve.borderWidth?ve.borderWidth:null),h<0||g<0?h=g=null:null!=h&&null==g&&(g=1),zot(p)&&(p=null!=ve.rollBorderColor?ve.rollBorderColor:h),zot(f)&&(f=null!=ve.downBorderColor?ve.downBorderColor:p),zot(C)&&(C=null!=ve.corner?ve.corner:10),zot(k)&&(k=null!=ve.shadowColor?ve.shadowColor:"rgba(0,0,0,.3)"),zot(T)&&(T=null!=ve.shadowBlur?ve.shadowBlur:14),zot(M)&&(M=null!=ve.hitPadding?ve.hitPadding:0),zot(I)&&(I=null!=ve.indent?ve.indent:10),zot(S)&&(S=null!=ve.indentHorizontal?ve.indentHorizontal:I),zot(W)&&(W=null!=ve.indentVertical?ve.indentVertical:I),zot(A)&&(A=null!=ve.gradient?ve.gradient:0),zot(P)&&(P=null!=ve.gloss?ve.gloss:0);var Ae=(!zot(_)||!zot(V)||!zot(G)||!zot(q)||!zot(U)||!zot(Q)||!zot(Z))&&zot(J)&&zot(ae)&&zot(le);Ae&&zot(K)&&(K=WW.M?"mousedown":"click"),zot(D)&&(D=null!=ve.rollPersist&&ve.rollPersist),this.rollPersist=D,zot(x)&&(x=null!=ve.dashed&&ve.dashed),zot(_)||"Label"!=_.type||zon&&zogy("Button() - do not pass Label to toggle parameter - just pass a String"),zot(Y)&&(Y=null!=ve.toggleBackgroundColor?ve.toggleBackgroundColor:a),zot(X)&&(X=null!=ve.rollToggleBackgroundColor?ve.rollToggleBackgroundColor:l),zot(R)&&(R=null!=ve.downToggleBackgroundColor?ve.downToggleBackgroundColor:X),zot(H)&&(H=null!=ve.toggleColor?ve.toggleColor:i.color),zot(F)&&(F=null!=ve.rollToggleColor?ve.rollToggleColor:i.rollColor),zot(N)&&(N=null!=ve.downToggleColor?ve.downToggleColor:i.rollToggleColor),zot(ee)&&(ee=null!=ve.waitBackgroundColor?ve.waitBackgroundColor:a),zot(te)&&(te=null!=ve.rollWaitBackgroundColor?ve.rollWaitBackgroundColor:l),zot(oe)&&(oe=null!=ve.downWaitBackgroundColor?ve.downWaitBackgroundColor:l),zot(ne)&&(ne=null!=ve.waitColor?ve.waitColor:i.color),zot(re)&&(re=null!=ve.rollWaitColor?ve.rollWaitColor:i.rollColor),zot(ie)&&(ie=null!=ve.downWaitColor?ve.downWaitColor:re);var Pe=this;this.mouseChildren=!1,this.cursor="pointer",Pe.focus=!1,Pe.rolled=!1;var Be=t($);zot(m)&&(m=null!=ve.backing?ve.backing.clone():null),zot(m)?Pe.backing=new e.Rectangle(o,n,a,null,null,C,x,null,null,!1).centerReg(null,null,!1):Pe.backing=m,Pe.rollBacking=zot(z)?null!=ve.rollBacking?ve.rollBacking.clone():null:z,Pe.downBacking=zot(y)?null!=ve.downBacking?ve.downBacking.clone():null:y,Pe.waitBacking=zot(ae)?null!=ve.waitBacking?ve.waitBacking.clone():null:ae,Pe.rollWaitBacking=zot(le)?null!=ve.rollWaitBacking?ve.rollWaitBacking.clone():null:le,Pe.downWaitBacking=zot(se)?null!=ve.downWaitBacking?ve.downWaitBacking.clone():null:se,Pe.toggleBacking=zot(V)?null!=ve.toggleBacking?ve.toggleBacking.clone():null:V,Pe.rollToggleBacking=zot(G)?null!=ve.rollToggleBacking?ve.rollToggleBacking.clone():null:G,Pe.downToggleBacking=zot(q)?null!=ve.downToggleBacking?ve.downToggleBacking.clone():null:q;var Ee,Ie,Se,We=["backing","rollBacking","downBacking","toggleBacking","rollToggleBacking","downToggleBacking","waitBacking","rollWaitBacking","downWaitBacking"];for(Se=0;Se<We.length;Se++)Ee=We[Se],(Ie=Pe[Ee])&&("Pattern"==Ie.type?Ie=Me(Ee,Ie):-1!=k&&T>0&&(Ie.shadow=new createjs.Shadow(k,3,3,T)),Ie.x=o/2,Ie.y=n/2);function Me(t,r){(Pe[t]=new e.Container(o,n,null,null,!1).centerReg(null,null,!1),-1!=k&&T>0)&&(new e.Rectangle(o-2,n-2,"#666",null,null,C,null,null,null,!1).center(Pe[t]).shadow=new createjs.Shadow(k,3,3,T));var i=Pe[t].mask=new e.Rectangle(o,n,t.indexOf("roll")>=0?l:a,null,null,C,null,null,null,!1).addTo(Pe[t]);return r.centerReg(i),r.setMask(i.shape),Pe[t].pattern=r,Pe[t]}Pe.addChild(Pe.backing),g&&(Pe.border=new e.Rectangle(o,n,"rgba(0,0,0,0)",h,g,C,x,null,null,!1),Pe.addChild(Pe.border)),Pe.icon=zot(v)?null!=ve.icon?ve.icon.clone():null:v,Pe.rollIcon=zot(b)?null!=ve.rollIcon?ve.rollIcon.clone():null:b,Pe.downIcon=zot(w)?null!=ve.downIcon?ve.downIcon.clone():null:w,Pe.waitIcon=zot(ce)?null!=ve.waitIcon?ve.waitIcon.clone():null:ce,Pe.rollWaitIcon=zot(ue)?null!=ve.rollWaitIcon?ve.rollWaitIcon.clone():null:ue,Pe.downWaitIcon=zot(de)?null!=ve.downWaitIcon?ve.downWaitIcon.clone():null:de,Pe.toggleIcon=zot(U)?null!=ve.toggleIcon?ve.toggleIcon.clone():null:U,Pe.rollToggleIcon=zot(Q)?null!=ve.rollToggleIcon?ve.rollToggleIcon.clone():null:Q,Pe.downToggleIcon=zot(Z)?null!=ve.downToggleIcon?ve.downToggleIcon.clone():null:Z;var Oe,je,Le=["icon","rollIcon","downIcon","toggleIcon","rollToggleIcon","downToggleIcon","waitIcon","rollWaitIcon","downWaitIcon"];for(Se=0;Se<Le.length;Se++){var De=Le[Se],_e=Pe[De];_e&&(_e.x=o/2,_e.y=n/2)}if(Pe.icon&&Pe.addChild(Pe.icon),Array.isArray(C)||(C=[C,C,C,C]),A>0){var Ye=new createjs.Shape;Ye.graphics.lf(["rgba(255,255,255,"+A+")","rgba(0,0,0,"+A+")"],[0,1],0,0,0,n-g),Ye.graphics.rc(g/2,g/2,o-g,n-g,C[0],C[1],C[2],C[3]),this.addChild(Ye)}if(P>0){var Xe=new createjs.Shape;Xe.graphics.f("rgba(255,255,255,"+P+")"),Xe.graphics.rc(g/2,g/2,o-g,(n-g)/2,C[0],C[1],0,0),Xe.graphics.f("rgba(0,0,0,"+P+")"),Xe.graphics.rc(g/2,n/2,o-g,(n-g)/2,0,0,C[2],C[3]),this.addChild(Xe)}function Re(){(je=new createjs.Shape).graphics.f("#000").r(-M,-M,o+2*M,n+2*M),Pe.hitArea=Oe=je}M>0&&Re(),this.addChild(i),i.center(this),i.y+=1,this.label=i,e.pos(i,"left"==B||"right"==B?S:null,"top"==E||"bottom"==E?W:null,"right"==B,"bottom"==E);var He=i.color;if(this.toggled=!1,Ae){var Fe=i.text,Ne=i.color,Ve=i.rollColor;this.on(K,(function(){Pe.toggled=!Pe.toggled,Ge()}))}function Ge(){Pe.toggled?(zot(_)||(Pe.label.text=!0===_?Fe:_),zot(H)||(Pe.label.colorOnly=He=H),zot(F)||(Pe.label.rollColor=F),Pe.rolled?(Pe.rollToggleBacking?rt("rollToggleBacking"):Pe.toggleBacking&&rt("toggleBacking"),Pe.rollToggleIcon?rt("rollToggleIcon"):Pe.toggleIcon&&rt("toggleIcon"),zot(m)&&zot(Pe.rollToggleBacking)&&(Pe.backing.color=X)):(Pe.toggleBacking&&rt("toggleBacking"),Pe.toggleIcon&&rt("toggleIcon"),zot(m)&&(Pe.backing.color=Y))):(Pe.label.colorOnly=He=Ne,Pe.label.rollColor=Ve,Pe.rolled&&Pe.label.showRollColor(!0),Pe.label.text=Fe,qe()),Pe.stage&&Pe.stage.update()}function qe(){Pe.pressed?(zot(m)&&Pe.backing&&!Pe.downBacking&&(Pe.backing.color=s),Pe.downBacking?rt("downBacking"):Pe.rollBacking?rt("rollBacking"):Pe.backing&&rt("backing"),Pe.downIcon?rt("downIcon"):Pe.rollIcon?rt("rollIcon"):Pe.icon?rt("icon"):rt("icon",null)):Pe.rolled?(zot(m)&&Pe.backing&&!Pe.rollBacking&&(Pe.backing.color=l),Pe.rollBacking?rt("rollBacking"):Pe.backing&&rt("backing"),Pe.rollIcon?rt("rollIcon"):Pe.icon?rt("icon"):rt("icon",null)):(zot(m)&&Pe.backing&&(Pe.backing.color=a),Pe.backing&&rt("backing"),Pe.icon,rt("icon"))}this.toggle=function(e){return Ae?(zot(e)?Pe.toggled=!Pe.toggled:Pe.toggled=e,Ge(),Pe):(zon&&zogy("Button() - can't toggle with wait parameters provided"),Pe)};var Ue=!1;Pe.waiting=!1;var Qe,Ze,Ke,Je,$e=!1,et=Pe.label.color,tt=Pe.label.rollColor,ot=this.on("mousedown",(function(){Ue=!0,nt()}));function nt(){zot(J)&&zot(ae)&&zot(le)||Pe.waiting||($e=!0,zot(ge)&&(ge=!0),he&&(Je=Pe.stage.on("stagemousedown",(function(t){Pe.hitTestPoint(t.stageX/e.scaX,t.stageY/e.scaY)||Pe.clearWait()}),null,!0)),setTimeout((function(){Pe.waiting=!0}),50),Ze=i.text,zot(ne)||(Pe.label.colorOnly=He=ne),zot(re)||(Pe.label.rollColor=re),Ke=Pe.enabled,!ge&&Pe.enabled&&(Pe.enabled=!1),zot(J)||(Pe.label.text=J),Pe.rolled?(zot(m)&&!Pe.rollWaitBacking&&(Pe.backing.color=te),Pe.rollWaitBacking?rt("rollWaitBacking"):Pe.waitBacking&&rt("waitBacking"),Pe.rollWaitIcon?rt("rollWaitIcon"):Pe.waitIcon&&rt("waitIcon")):(zot(m)&&!Pe.waitBacking&&(Pe.backing.color=ee),Pe.waitBacking&&rt("waitBacking"),Pe.waitIcon&&rt("waitIcon")),zot($)&&($="s"==Be?5:5e3),Qe&&Qe.clear(),Qe=e.timeout($,(function(){Pe.enabled||(Pe.enabled=Ke),Pe.clearWait(),Pe.dispatchEvent("waited")})),Pe.stage&&Pe.stage.update())}function rt(e,t){var o;if(e.indexOf("con")>=0){for(o=0;o<Le.length;o++){var n=Le[o],r=Pe[n];Pe.removeChild(r)}Pe[e]&&Pe.addChildAt(Pe[e],1)}else{if(!Pe[e]&&!t)return;for(o=0;o<We.length;o++){var i=We[o],a=Pe[i];Pe.removeChild(a)}Pe[e]&&Pe.addChildAt(Pe[e],0)}}this.wait=nt,this.clearWait=function(){return Qe?(Je&&Pe.stage.off("stagemousedown",Je),Qe.clear(),Pe.label.text=Ze,qe(),Pe.label.colorOnly=He=et,Pe.label.rollColor=tt,setTimeout((function(){Pe.waiting=!1}),55),$e=!1,Pe.stage&&Pe.stage.update(),Pe):Pe},this.removeWait=function(){return Pe.clearWait(),J=null,Pe.waitBacking=null,Pe.rollWaitBacking=null,Pe.off("mousedown",ot),Pe};var it=!1;function at(){Pe.rolled=!0,it=!0,$e?(Pe.pressed&&Pe.downWaitBacking?rt("downWaitBacking"):Pe.pressed&&Pe.downBacking?rt("downBacking"):Pe.rollWaitBacking?rt("rollWaitBacking"):Pe.waitBacking?rt("waitBacking"):Pe.rollBacking?rt("rollBacking"):rt("backing"),Pe.pressed&&Pe.downWaitIcon?rt("downWaitIcon"):Pe.rollWaitIcon?rt("rollWaitIcon"):Pe.waitIcon?rt("waitIcon"):Pe.rollIcon?rt("rollIcon"):rt("icon",!0)):Ae&&Pe.toggled?(Pe.pressed&&Pe.downToggleBacking?rt("downToggleBacking"):Pe.pressed&&Pe.downBacking?rt("downBacking"):Pe.rollToggleBacking?rt("rollToggleBacking"):Pe.toggleBacking?rt("toggleBacking"):Pe.rollBacking?rt("rollBacking"):rt("backing"),Pe.pressed&&Pe.downToggleIcon?rt("downToggleIcon"):Pe.rollToggleIcon?rt("rollToggleIcon"):Pe.toggleIcon?rt("toggleIcon"):Pe.rollIcon?rt("rollIcon"):rt("icon",!0)):(Pe.pressed&&Pe.downBacking?rt("downBacking"):Pe.rollBacking?rt("rollBacking"):rt("backing"),Pe.pressed&&Pe.downIcon?rt("downIcon"):Pe.rollIcon?rt("rollIcon"):rt("icon",!0)),Pe.pressed?zot(m)&&Pe.backing?Pe.backing.color=s:m&&!zot(m.mask)&&Pe.backing&&(Pe.backing.mask.color=s):zot(m)&&Pe.backing?Pe.backing.color=l:m&&!zot(m.mask)&&Pe.backing&&(Pe.backing.mask.color=l),Pe.border&&(Pe.border.borderColor=Pe.pressed?f:p),Pe.pressed?Pe.label.colorOnly=d:Pe.label.showRollColor?Pe.label.showRollColor():Pe.label.colorOnly=He,Pe.stage&&Pe.stage.update()}this.on("mouseover",(function(e){Pe.stage&&Pe.stage.frame.leftMouseDown&&!lt||at()}));var lt=!1;function st(){it=!1,Pe.rollPersist&&Ue||ct()}function ct(){Pe.rolled=!1,$e||Pe.waiting?(zot(m)&&Pe.backing&&zot(Pe.waitBacking)&&(Pe.backing.color=zot(ee)?a:ee),Pe.waitBacking?rt("waitBacking"):Pe.backing&&rt("backing"),Pe.waitIcon?rt("waitIcon"):Pe.icon?rt("icon"):rt("icon",null)):Pe.toggled&&Ae?(zot(m)&&Pe.backing&&zot(Pe.toggleBacking)&&(Pe.backing.color=Y),Pe.toggleBacking?rt("toggleBacking"):Pe.backing&&rt("backing"),Pe.toggleIcon?rt("toggleIcon"):Pe.icon?rt("icon"):rt("icon",null)):(zot(m)&&Pe.backing?Pe.backing.color=a:m&&!zot(m.mask)&&Pe.backing&&(Pe.backing.mask.color=a),Pe.backing&&rt("backing"),Pe.icon?rt("icon"):rt("icon",null)),Pe.border&&(Pe.border.borderColor=h),Pe.label.colorOnly=He,Pe.label.showRollColor&&Pe.label.showRollColor(!1),Pe.stage&&Pe.stage.update()}function ut(e,t){return zot(e)||(Pe.contains(Pe[e])&&(Pe.removeChild(Pe[e]),t&&Pe.addChildAt(t,e.indexOf("con")>=0?Pe.numChildren-1:0),Pe.stage&&Pe.stage.update()),t?(zot(m)&&"backing"==e&&(m=t),"Pattern"==t.type&&(t=Me(e,t)),Pe[e]=t,Pe[e].x=o/2,Pe[e].y=n/2):Pe[e]=null,qe()),Pe}this.on("mousedown",(function(){Pe.pressed=lt=!0,at(),Pe.rolled})),this.on("pressup",(function(){Pe.pressed=lt=Ue=!1,it?at():Pe.rollPersist&&ct(),WW.M&&st()})),this.on("pressmove",(function(){var e=Pe.stage?Pe.stage.frame:WW.zdf,t=Pe.hitTestPoint(e.mouseX,e.mouseY);lt&&!t?(st(),lt=!1):!lt&&t&&(at(),lt=!0)})),this.on("mouseout",st),Pe.removeRoll=ct,Pe.rollBacking&&Pe.rollBacking.removeFrom(),Object.defineProperty(Pe,"text",{get:function(){return" "==i.text?"":i.text},set:function(t){i.text=t,Fe&&(Fe=t),i.center(this),i.y+=1,e.pos(i,"left"==B||"right"==B?S:null,"top"==E||"bottom"==E?W:null,"right"==B,"bottom"==E)}}),Object.defineProperty(Pe,"color",{get:function(){return c},set:function(t){c=t,Ne&&(Ne=c),Pe.label&&!zot(Pe.label.color)&&(Pe.label.color=He=c),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!Pe.stage||Pe.stage.update()}}),Object.defineProperty(Pe,"rollColor",{get:function(){return u},set:function(e){u=e,Ve&&(Ve=u),Pe.label&&(Pe.label.rollColor=u)}}),Object.defineProperty(Pe,"downColor",{get:function(){return d},set:function(e){d=e,originalDownColor&&(originalDownColor=d),Pe.label&&(Pe.label.downColor=d)}}),Object.defineProperty(Pe,"backgroundColor",{get:function(){return a},set:function(t){a=t,Pe.backing.color?Pe.backing.color=a:Pe.backing.mask&&(Pe.backing.mask.color=a),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!Pe.stage||Pe.stage.update()}}),Object.defineProperty(Pe,"rollBackgroundColor",{get:function(){return l},set:function(e){l=e,Pe.rollBacking&&Pe.rollBacking.color?Pe.rollBacking.color=l:Pe.rollBacking&&Pe.rollBacking.mask&&(Pe.rollBacking.mask.color=l)}}),Object.defineProperty(Pe,"downBackgroundColor",{get:function(){return s},set:function(e){s=e,Pe.downBacking&&Pe.downBacking.color?Pe.downBacking.color=s:Pe.downBacking&&Pe.downBacking.mask&&(Pe.downBacking.mask.color=s)}}),Object.defineProperty(Pe,"borderColor",{get:function(){return h},set:function(e){h=e,Pe.rolled||(Pe.backing&&Pe.backing.borderColor&&(Pe.backing.borderColor=e),Pe.border&&(Pe.border.borderColor=e))}}),Object.defineProperty(Pe,"rollBorderColor",{get:function(){return p},set:function(e){p=e,Pe.rolled&&(Pe.backing&&Pe.backing.borderColor&&(Pe.backing.borderColor=e),Pe.border&&(Pe.border.borderColor=e))}}),Object.defineProperty(Pe,"hitPadding",{get:function(){return M},set:function(e){0==(M=e)?Oe&&(this.hitArea=null):Re()}}),this._enabled=!0,this.startMouseChildren=this.mouseChildren,Object.defineProperty(Pe,"enabled",{get:function(){return Pe._enabled},set:function(t){Pe._enabled&&(Pe.startMouseChildren=Pe.mouseChildren),t?(r(Pe,t),Pe.mouseChildren=Pe.startMouseChildren):(ct(),r(Pe,t));var o=i.color;i.color=He=o,e.OPTIMIZE||!zns&&WW.OPTIMIZE||!Pe.stage||Pe.stage.update()}}),this.setBacking=function(e,t){ut(e,t)},this.setIcon=function(e,t){ut(e,t)},!1!==pe&&e.styleTransforms(this,ve),this.clone=function(t){var r=new e.Button(o,n,i.clone(),t||!e.isPick(Ce[0])?a:Ce[0],t||!e.isPick(Ce[1])?l:Ce[1],t||!e.isPick(Ce[2])?s:Ce[2],t||!e.isPick(Ce[3])?c:Ce[3],t||!e.isPick(Ce[4])?u:Ce[4],t||!e.isPick(Ce[5])?d:Ce[5],ke,Te,p,f,zot(m)?null:Pe.backing.clone(),zot(z)?null:Pe.rollBacking.clone(),zot(y)?null:Pe.downBacking.clone(),zot(v)?null:v.clone(),zot(b)?null:b.clone(),zot(w)?null:w.clone(),C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,zot(V)?null:V.clone(),zot(G)?null:G.clone(),zot(q)?null:q.clone(),zot(U)?null:U.clone(),zot(Q)?null:Q.clone(),zot(Z)?null:Z.clone(),K,J,$,ee,te,oe,ne,re,ie,zot(ae)?null:ae.clone(),zot(le)?null:le.clone(),zot(se)?null:se.clone(),zot(ce)?null:ce.clone(),zot(ue)?null:ue.clone(),zot(de)?null:de.clone(),he,ge,pe,this.group,me);return Pe.cloneProps(r)},this.doDispose=function(e,t,o){return Pe.icon&&Pe.icon.dispose(),Pe.rollIcon&&Pe.rollIcon.dispose(),Pe.downIcon&&Pe.downIcon.dispose(),Pe.waitIcon&&Pe.waitIcon.dispose(),Pe.rollWaitIcon&&Pe.rollWaitIcon.dispose(),Pe.downWaitIcon&&Pe.downWaitIcon.dispose(),Pe.toggleIcon&&Pe.toggleIcon.dispose(),Pe.rollToggleIcon&&Pe.rollToggleIcon.dispose(),Pe.downToggleIcon&&Pe.downToggleIcon.dispose(),Pe.icon=Pe.rollIcon=Pe.downIcon=Pe.waitIcon=Pe.rollWaitIcon=Pe.downWaitIcon=Pe.toggleIcon=Pe.rollToggleIcon=Pe.downToggleIcon=null,o||this.zimContainer_dispose(!0),!0}},e.extend(e.Button,e.Container,["clone","dispose"],"zimContainer",!1),e.Button.prototype.dispose=function(e){return this.doDispose(null,null,e)},e.CheckBox=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z){var y,v="size, label, startChecked, color, backgroundColor, borderColor, borderWidth, corner, margin, indicatorType, indicatorColor, tap, rtl, style, group, inherit";if(y=zob(e.CheckBox,arguments,v,this))return y;z_d("56"),this.zimContainer_constructor(null,null,null,null,!1),this.type="CheckBox",this.group=m;var b=!1===f?{}:e.getStyle(this.type,this.group,z);zot(t)&&(t=null!=b.size?b.size:60),zot(o)&&(o=null!=b.label?b.label:null),zot(n)&&(n=null!=b.startChecked&&b.startChecked);var w=n;zot(i)&&(i=null!=b.color?b.color:"#111"),zot(a)&&(a=null!=b.backgroundColor?b.backgroundColor:"rgba(255,255,255,.8)"),zot(l)&&(l=null!=b.borderColor?b.borderColor:"#111"),zot(s)&&(s=null!=b.borderWidth?b.borderWidth:t/10),l<0||s<0?l=s=null:null!=l&&null==s&&(s=t/10),zot(c)&&(c=null!=b.corner?b.corner:0),"string"!=typeof o&&"number"!=typeof o||(o=new e.Label({text:o,size:5*t/6,color:i,valign:"center",align:p?"right":"left",backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",style:f,group:this.group})),zot(u)&&(u=null!=b.margin?b.margin:t/5),"box"!=d&&"square"!=d&&"x"!=d&&(d=null!=b.indicatorType?b.indicatorType:"check"),zot(h)&&(h=null!=b.indicatorColor?b.indicatorColor:s>0?l:"black"),this.setBounds(-u,-u,t+2*u,t+2*u),zot(g)&&(g=null!=b.tap&&b.tap),zot(p)&&(p=null!=b.rtl?b.rtl:"rtl"==WW.DIR);var C=this;this.cursor="pointer";var x=this.box=new e.Rectangle(t,t,a,null,null,c),k=this.box2=new e.Rectangle(5*t/7,5*t/7,"rgba(0,0,0,0)",l,s,c);k.x=t/7,k.y=t/7,this.addChild(x,k);var T=t;o&&(o.center(C),this.label=o,p?(o.x=-u,this.setBounds(-o.width-2*u,-u,t+3*u+o.getBounds().width,Math.max(t+2*u,o.getBounds().height)),T=t+o.width+u,this.regX=t):(o.x=C.getBounds().width,this.setBounds(-u,-u,t+4*u+o.getBounds().width,Math.max(t+2*u,o.getBounds().height)),T=o.x+o.width));var A=new e.Shape({style:!1}),P=A.graphics;P.f("rgba(0,0,0,.01)").r(this.getBounds().x,this.getBounds().y,T+2*u,this.getBounds().height),this.hitArea=A;var B=new e.Shape({style:!1}),E=B.graphics;"check"==d?E.f(h).p("AnQAdICBiaIEEDZIF8nfICfB4In/KPg"):"box"==d||"square"==d?E.f(h).dr(-35,-35,70,70):E.f(h).p("AmJEVIEUkTIkXkWIB4h5IEWEYIETkTIB4B3IkTESIEQERIh4B4IkRkRIkSEVg");var I=95;B.setBounds(-I/2,-I/2,I,I);var S=t/(I+66);function W(){w=!w,C.setChecked(w),C.dispatchEvent("change")}B.scaleX=B.scaleY=S,B.alpha=.9,B.x=t/2,B.y=t/2,w&&this.addChild(B),g?this.tap(W):this.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",W),Object.defineProperty(C,"checked",{get:function(){return w},set:function(e){C.setChecked(e)}}),this.toggle=function(e){zot(e)&&(e=!w),C.setChecked(e)},Object.defineProperty(C,"toggled",{get:function(){return w},set:function(e){C.setChecked(e)}}),Object.defineProperty(C,"text",{get:function(){return o?o.text:null},set:function(t){o&&(o.text=t,e.OPTIMIZE||!zns&&WW.OPTIMIZE||!C.stage||C.stage.update())}}),Object.defineProperty(B,"indicatorColor",{get:function(){return h},set:function(o){w&&C.removeChild(B),B=new createjs.Shape,E=B.graphics,h=o,E.f(h).p("AnQAdICBiaIEEDZIF8nfICfB4In/KPg"),B.scaleX=B.scaleY=S,B.alpha=.9,B.x=t/2,B.y=t/2,w&&C.addChild(B),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!C.stage||C.stage.update()}}),Object.defineProperty(C,"indicator",{get:function(){return B},set:function(){zogy("ZIM CheckBox - check is read only")}}),this._enabled=!0,Object.defineProperty(C,"enabled",{get:function(){return C._enabled},set:function(e){r(C,e)}}),this.setChecked=function(t){return zot(t)&&(t=!0),(w=t)?C.addChild(B):C.removeChild(B),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!C.stage||C.stage.update(),C},!1!==f&&e.styleTransforms(this,b),this.clone=function(){return C.cloneProps(new e.CheckBox(t,o?o.clone():"",n,i,a,l,s,c,u,d,h,g,p,f,this.group,z))}},e.extend(e.CheckBox,e.Container,"clone","zimContainer",!1),e.RadioButtons=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z){var y,v="size, buttons, vertical, color, backgroundColor, borderColor, borderWidth, spacing, margin, always, indicatorColor, selectedIndex, rtl, style, group, inherit";if(y=zob(e.RadioButtons,arguments,v,this))return y;z_d("57"),this.zimContainer_constructor(null,null,null,null,!1),this.type="RadioButtons",this.group=m;var b=!1===f?{}:e.getStyle(this.type,this.group,z);zot(t)&&(t=null!=b.size?b.size:60),t=Math.max(5,t),zot(o)&&(o=null!=b.buttons?b.buttons:["A","B","C"]),zot(n)&&(n=null==b.vertical||b.vertical),zot(i)&&(i=null!=b.color?b.color:"#111"),zot(a)&&(a=null!=b.backgroundColor?b.backgroundColor:"rgba(255,255,255,.8)"),zot(l)&&(l=null!=b.borderColor?b.borderColor:"#111"),zot(s)&&(s=null!=b.borderWidth?b.borderWidth:t/9),l<0||s<0?l=s=null:null!=l&&null==s&&(s=t/10),zot(c)&&(c=n?null!=b.spacing?b.spacing:.2*t:null!=b.spacing?b.spacing:t),zot(u)&&(u=null!=b.margin?b.margin:t/5),zot(d)&&(d=null!=b.always&&b.always),zot(h)&&(h=null!=b.indicatorColor?b.indicatorColor:s>0?l:"black"),zot(p)&&(p=null!=b.rtl?b.rtl:"rtl"==WW.DIR);var w=this;this.cursor="pointer",this.labels=[],this.indicators=[];var C,x=0;if("string"==typeof o){var k=o;o=[];for(var T=0;T<k.length;T++)o.push({label:k[T]})}var A=new e.Container({style:!1});function P(e){var t=A.getChildIndex(e.target);d&&w.selectedIndex==t||(w.setSelected(t),w.dispatchEvent("change"))}this.addChild(A),E();for(var B=0;B<A.numChildren;B++)A.getChildAt(B).on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",P);function E(){var r,a,l,s=!1;for(a=o.length-1;a>=0;a--)(r=o[a]).selected&&!0===r.selected&&(s?r.selected="false":(s=!0,w.id=r.id));A.removeAllChildren(),w.buttons=[];var u=0;for(a=0;a<o.length;a++){if("string"==typeof(r=o[a])||"number"==typeof r)r={selected:!1,label:new e.Label({text:r,size:5*t/6,color:null!=b.color?b.color:i,valign:"center",backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",style:f,group:w.group})};(r.label&&"string"==typeof r.label||"number"==typeof r.label)&&(r.label=new e.Label({text:r.label,size:null!=b.size?b.size:5*t/6,color:null!=b.color?b.color:i,valign:"center",style:f})),w.labels.push(r.label),r.index=a,o[a]=r,(l=I(r.selected,r.label)).type="RadioButton",l.obj=r,r.selected&&(C=l.obj),A.addChild(l),n?(l.y=u,u+=l.getBounds().height+c):(l.x=u,u+=l.getBounds().width+c)}}function I(o,n){var r=new e.Container({style:!1});w.buttons.push(r),r.mouseChildren=!1,r.setBounds(-u,-u,t+2*u,t+2*u);var i=new e.Shape({style:!1}),c=i.graphics;c.f(a).dc(t/2,t/2,t/1.85),c.s(l).ss(s).dc(t/2,t/2,t/2-t/2/5),r.addChild(i);var d=r.check=new e.Circle(t/5.2,h,null,null,null,null,null,null,!1);w.indicators.push(d),d.mouseEnabled=!1,d.alpha=.95,d.regX=d.regY=-t/2;var g=t;n&&(0==x&&(x=n.width),r.addChild(n),n.y=t/2,r.text=n.text,p?(n.x=-n.width-u,r.setBounds(-n.width-u,-u,t+2*u+n.getBounds().width,Math.max(t+2*u,n.getBounds().height)),g=n.width+u+t):(n.x=r.getBounds().width,r.setBounds(-u,-u,t+2*u+n.getBounds().width,Math.max(t+2*u,n.getBounds().height)),g=n.x+n.width)),o&&(r.addChild(d),w.label=n,w.label&&(w.text=n.text));var f=new e.Shape({style:!1});return(c=f.graphics).f("rgba(0,0,0,.01)").r(r.getBounds().x,r.getBounds().y,g+2*u,r.getBounds().height),r.hitArea=f,r}this.getBounds()||this.setBounds(0,0,t,t),p?(this.setBounds(2*-u-x,-u,this.getBounds().width+2*u,this.getBounds().height),this.regX=n?t+u:this.getBounds().width-x-3*u):this.setBounds(-u,-u,this.getBounds().width+2*u,this.getBounds().height),this.setSelected=function(t){if(zot(t)&&(t=-1),-1==t||A.getChildAt(t)){for(var o,n=0;n<A.numChildren;n++)(o=A.getChildAt(n)).removeChild(o.check);if(t>=0){o=A.getChildAt(t);var r=-2;C&&(r=C.index),C=o.obj}return-1==t||r==C.index?(C=null,w.id=null,w.label=null,w.text=""):(o.addChild(o.check),w.id=C.id,w.label=C.label,w.label&&(w.text=w.label.text)),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!w.stage||w.stage.update(),w}},Object.defineProperty(w,"selected",{get:function(){return C},set:function(){zogy("ZIM RadioButton - selected is read only")}}),Object.defineProperty(w,"selectedIndex",{get:function(){return C?C.index:-1},set:function(e){var t=e;d&&w.selectedIndex==t||w.setSelected(t)}}),this._enabled=!0,Object.defineProperty(w,"enabled",{get:function(){return w._enabled},set:function(e){r(w,e)}}),zot(g)&&(g=null!=b.selectedIndex?b.selectedIndex:0),w.selectedIndex=g,e.styleTransforms(this,b),this.clone=function(){for(var r=e.copy(o),m=0;m<r.length;m++)r[m].label=r[m].label.clone();return w.cloneProps(new e.RadioButtons(t,r,n,i,a,l,s,c,u,d,h,g,p,f,this.group,z))}},e.extend(e.RadioButtons,e.Container,"clone","zimContainer",!1),e.Toggle=function(o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k){var T,A="width, height, label, startToggled, backgroundColor, margin, indicatorType, indicatorColor, tap, toggleBackgroundColor, color, borderColor, borderWidth, corner, indicatorCorner, shadowColor, shadowBlur, time, labelLeft, style, group, inherit";if(T=zob(e.Toggle,arguments,A,this))return T;z_d("57.5"),this.group=x;var P=!1===C?{}:e.getStyle("Toggle",this.group,k);zot(o)&&(o=null!=P.width?P.width:80),zot(n)&&(n=null!=P.height?P.height:50),this.zimContainer_constructor(o,n,null,null,!1),this.type="Toggle",zot(l)&&(l=null!=P.backgroundColor?P.backgroundColor:"#C60"),zot(s)&&(s=null!=P.margin?P.margin:10),zot(c)&&(c=null!=P.indicatorType?P.indicatorType:"circle"),zot(u)&&(u=null!=P.indicatorColor?P.indicatorColor:"#fff"),zot(h)&&(h=null!=P.toggleBackgroundColor?P.toggleBackgroundColor:"#F93"),zot(g)&&(g=null!=P.color?P.color:"#111"),zot(p)&&(p=null!=P.borderColor?P.borderColor:null),zot(f)&&(f=null!=P.borderWidth?P.borderWidth:null),p<0||f<0?p=f=null:null!=p&&null==f&&(f=1),zot(m)&&(m=null!=P.corner?P.corner:"circle"!=c?0:25),zot(z)&&(z=null!=P.indicatorCorner?P.indicatorCorner:0),zot(y)&&(y=null!=P.shadowColor?P.shadowColor:"rgba(0,0,0,.3)"),zot(v)&&(v=null!=P.shadowBlur?P.shadowBlur:14),zot(a)&&(a=null!=P.startToggled&&P.startToggled);var B=t(b);zot(b)&&(b=null!=P.time?P.time:"s"==B?.1:100),zot(i)&&(i=null!=P.label?P.label:null),zot(w)&&(w=null!=P.labelLeft?P.labelLeft:null);var E=this;E.cursor="pointer","string"!=typeof i&&"number"!=typeof i||(i=this.label=new e.Label({text:i,size:P.size||5*n/6,color:g,valign:"center",backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",group:this.group})),"string"!=typeof w&&"number"!=typeof w||(w=this.labelLeft=new e.Label({text:w,size:P.size||5*n/6,color:g,valign:"center",backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",group:this.group})),this.background=new e.Rectangle(o,n,l,p,f,m).addTo(this),this.indicator="rectangle"==c||"square"==c?new e.Rectangle(.65*n,.65*n,u,null,null,z).center(this.background).pos(.2*n,null,a):new e.Circle(.35*n,u).center(this.background).pos(.175*n,null,a);var I=a;E.background.color=I?h:l,-1!=y&&v>0&&(this.background.shadow=new createjs.Shadow(y,3,3,v)),i&&(this.addChild(i),i.x=o+2+s+f,i.y=n/2,this.label=i,this.setBounds(-s,-s,o+3*s+f+i.getBounds().width,Math.max(n+2*s,i.getBounds().height))),w&&(this.addChild(w),w.x=0,E.background.x+=w.width+3+s+f,E.label.x+=w.width+3+s+f,w.y=n/2,this.labelLeft=w,this.setBounds(-s,-s,E.getBounds().width+w.width+3+s+f,E.getBounds().height)),this.expand(e.mobile()?20:10),this.tap((function(t){if(w){var n=E.localToGlobal(w.width+3+s+f+o/2,0);if(t.stageX/e.scaX<n.x-o/2&&!I||t.stageX/e.scaX>=n.x+o/2&&I)return}I=!I,W(),E.dispatchEvent("change")}),e.mobile()?20:10);var S=new e.Swipe(this,20,"s"==B?.2:200);function W(e){var t=E.indicator.x,o=b;if(!0===e&&(o=0),"rectangle"==c||"square"==c?(E.indicator.pos(.2*n,null,I),b>0&&E.indicator.animate({props:{x:t},from:!0,time:o})):(E.indicator.pos(.175*n,null,I),b>0&&E.indicator.animate({props:{x:t},from:!0,time:o})),E.background.color=I?h:l,E.text=I?E.label?E.label.text:"on":E.labelLeft?E.labelLeft.text:"off",E.zimAccessibility){var r="Toggle set to "+(I?E.label?E.label.text+".":"on.":E.labelLeft?E.labelLeft.text+".":"off.");setTimeout((function(){E.zimAccessibility.talk(r)}),50)}}S.on("swipe",(function(e){0!=e.swipeX&&(1==e.swipeX&&I||(-1!=e.swipeX||I)&&(I=!I,W(),E.dispatchEvent("change")))})),Object.defineProperty(E,"textLeft",{get:function(){return w?w.text:null},set:function(t){w&&(w.text=t,e.OPTIMIZE||!zns&&WW.OPTIMIZE||!E.stage||E.stage.update())}}),E.toggle=function(e,t){var o=I;return zot(e)&&(e=!0),o!=(I=e)&&W(t),E},E.text=I?E.label?E.label.text:"on":E.labelLeft?E.labelLeft.text:"off",Object.defineProperty(E,"toggled",{get:function(){return I},set:function(e){E.toggle(e)}}),this._enabled=!0,Object.defineProperty(E,"enabled",{get:function(){return E._enabled},set:function(e){r(E,e)}}),!1!==C&&e.styleTransforms(this,P),this.clone=function(){return E.cloneProps(new e.Toggle(o,n,i?i.clone():"",a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w?w.clone():"",C,this.group,k))}},e.extend(e.Toggle,e.Container,"clone","zimContainer",!1),e.Tip=function(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G){var q,U="text, align, valign, margin, marginH, marginV, outside, target, delay, time, mouseClose, size, font, color, rollColor, shadowColor, shadowBlur, textAlign, textValign, lineWidth, lineHeight, backing, outlineColor, outlineWidth, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backgroundDashed, padding, paddingHorizontal, paddingVertical, shiftHorizontal, shiftVertical, rollPersist, labelWidth, labelHeight, maxSize, bold, italic, variant, splitWords, style, group, inherit";if(q=zob(e.Tip,arguments,U,this))return q;z_d("57.6"),this.group=V;var Q=!1===N?{}:e.getStyle("Tip",this.group,G);zot(o)&&(o=null!=Q.text?Q.text:"Here's a tip!"),zot(i)&&(i=null!=Q.margin?Q.margin:40),zot(a)&&(a=null!=Q.marginH?Q.marginH:i),zot(l)&&(l=null!=Q.marginV?Q.marginV:i),zot(n)&&(n=null!=Q.align?Q.align:"right"),zot(r)&&(r=null!=Q.valign?Q.valign:"bottom"),zot(s)&&(s=null!=Q.outside&&Q.outside),zot(A)&&(A=null!=Q.backgroundColor?Q.backgroundColor:e.blue),zot(f)&&(f=null!=Q.color?Q.color:e.white),zot(E)&&(E=null!=Q.corner?Q.corner:25),zot(E)&&(E=null!=Q.corner?Q.corner:25),zot(E)&&(E=null!=Q.corner?Q.corner:25),zot(W)&&(W=null!=Q.paddingHorizontal?Q.paddingHorizontal:14+(Array.isArray(E)?E[0]:E)),(zot(z)||"ignore"==z)&&(z=null!=Q.shadowColor&&"ignore"!=z?Q.shadowColor:"rgba(0,0,0,.3)"),(zot(y)||"ignore"==y)&&(y=null!=Q.shadowBlur&&"ignore"!=y?Q.shadowBlur:1),zot(u)&&(u=null!=Q.delay?Q.delay:0);var Z=t(d);zot(d)&&(d=null!=Q.time?Q.time:"s"==Z?2:2e3),zot(h)&&(h=null==Q.mouseClose||Q.mouseClose),this.zimLabel_constructor(o,g,p,f,m,null,null,v,b,X,R,H,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,F,N,V,e.copy(Q)),this.type="Tip",s&&(a=-a,l=-l);var K=this;K.align=n,K.valign=r,this.background.sha(z,3,5,y),this.show=function(o,n){t(n);if(zot(o)&&(o=u),zot(n)&&(n=d),zot(c)){if(!WW.zdf)return K;c=WW.zdf.stage}else{if(!c.getBounds)return zogy("zim Tip(): Please pass in a reference to a container with bounds set as parameter to Tip"),K;if(zot(c.stage))return zogy("zim display - Waiter(): The container must have a stage property"),K}function r(){var t;t=c.boundsToGlobal?c.boundsToGlobal():c.getBounds();var o=new e.Container(t.x,t.y,t.width,t.height);o.zimTemp=!0,o.loc(0,0,c.stage),"center"!=K.align&&"middle"!=K.align&&"center"!=K.valign&&"middle"!=K.valign||K.center(o),K.pos("center"==K.align||"middle"==K.align?null:a,"center"==K.valign||"middle"==K.valign?null:l,"right"==K.align,"bottom"==K.valign,o),s&&("right"==K.align?K.x+=K.width:"left"==K.align&&(K.x-=K.width),"bottom"==K.valign?K.y+=K.height:"top"==K.valign&&(K.y-=K.height)),K.addTo(o.stage),o.zimTemp&&o.removeFrom&&(o.removeFrom(),o=null),o=K.stage,K.timeoutID&&K.timeoutID.clear(),K.timeoutID=e.timeout(n,(function(){K.hide(),o.stage.update()})),h&&(K.upID&&o.stage.off("stagemouseup",K.upID),K.upID=o.stage.on("stagemouseup",(function(){K.hide(),o.stage&&o.stage.update()}))),o.stage&&o.stage.update()}return o>0?K.showID=e.timeout(o,r):r(),K},this.hide=function(){return this.removeFrom(),this.timeoutID&&this.timeoutID.clear(),this.upID&&c.stage&&c.stage.off("stagemouseup",this.upID),K},this.clear=function(){K.showID&&K.showID.clear(),K.hide()},this.dispose=function(e,t,o){K.upID&&K.stage&&K.stage.off("stagemouseup",K.upID),o||this.zimLabel_dispose(!0)},!1!==N&&e.styleTransforms(this,Q),this.clone=function(){return K.cloneProps(new e.Tip(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,F,N,this.group,G))}},e.extend(e.Tip,e.Label,["dispose","clone"],"zimLabel",!1),e.Pane=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B){var E,I="width, height, content, backgroundColor, color, draggable, resets, modal, corner, backdropColor, shadowColor, shadowBlur, center, displayClose, backdropClose, backing, fadeTime, container, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, close, closeColor, style, group, inherit";if(E=zob(e.Pane,arguments,I,this))return E;z_d("58"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Pane";var S="zim display - Pane(): Please pass in a reference to a container with bounds set as first parameter";if(zot(v)){if(!WW.zdf)return void zogy(S);v=WW.zdf.stage}else{if(!v.getBounds)return void zogy(S);if(zot(v.getStage))return void zogy("zim display - Pane(): The container must have a stage property")}this.group=P;var W=!1===A?{}:e.getStyle(this.type,this.group,B);zot(t)&&(t=null!=W.width?W.width:200),zot(o)&&(o=null!=W.height?W.height:200),zot(n)&&(n=null!=W.content?W.content:null),"string"!=typeof n&&"number"!=typeof n||(n=new e.Label({text:n,size:null!=W.size?W.size:40,align:null!=W.align?W.align:"center",valign:null!=W.valign?W.valign:"center",color:null!=W.color?W.color:a,backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",group:this.group}).noMouse()),n&&(n=this.content=e.makeContent(n,t,e.dark)),zot(i)&&(i=null!=W.backgroundColor?W.backgroundColor:"white"),zot(l)&&(l=null!=W.draggable&&W.draggable),zot(s)&&(s=null==W.resets||W.resets),zot(c)&&(c=null==W.modal||W.modal),zot(u)&&(u=null!=W.corner?W.corner:20),zot(b)&&(b=null!=W.titleBar?W.titleBar:null),zot(w)&&(w=null!=W.titleBarColor?W.titleBarColor:null),zot(C)&&(C=null!=W.titleBarBackgroundColor?W.titleBarBackgroundColor:null),zot(x)&&(x=null!=W.titleBarHeight?W.titleBarHeight:null),zot(d)&&(d=null!=W.backdropColor?W.backdropColor:"rgba(0,0,0,.2)"),zot(h)&&(h=null!=W.shadowColor?W.shadowColor:"rgba(0,0,0,.3)"),zot(g)&&(g=null!=W.shadowBlur?W.shadowBlur:20),zot(p)&&(p=null==W.center||W.center),zot(f)&&(f=null==W.displayClose||W.displayClose),l&&(f=!1),zot(m)&&(m=null==W.backdropClose||W.backdropClose),zot(y)&&(y=null!=W.fadeTime?W.fadeTime:0),zot(k)&&(k=null!=W.close&&W.close),zot(T)&&(T=null!=W.closeColor?W.closeColor:"#555");var M=this.backdrop=new e.Shape({style:!1}),O=M.graphics;O.f(d),O.drawRect(-5e3,-5e3,1e4,1e4),this.setBounds(-t/2,-o/2,t,o);var j=this,L=["header","message","text","display","buttons","config"];n&&L.forEach((function(e){n[e]&&(j[e]=n[e])})),j.label=j.message,j.container=v,M.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",m?H:function(e){e.stopImmediatePropagation()});var D,_,Y,X,R=new e.Dictionary(!0);function H(e){j.dispatchEvent("closing"),setTimeout((function(){G(),j.dispatchEvent("close")}),10),e.stopImmediatePropagation()}if(M.on("mousedown",(function(e){e.stopImmediatePropagation()})),this.addChild(M),c||M.noMouse(),zot(z))D=this.backing=new e.Rectangle({width:t,height:o,color:i,corner:u,style:!1});else{if("Pattern"==z.type){var F=z;D=new e.Rectangle(t,o,i,null,null,u,null,null,null,!1),F.centerReg(D),F.setMask(D.shape)}else D=z;j.display=j.backing=D}(f&&(D.cursor="pointer",D.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",H)),-1!=h&&g>0&&(D.shadow=new createjs.Shadow(h,8,8,g)),D.on("click",(function(e){e.stopImmediatePropagation()})),this.resetX,this.resetY,l)&&(D.cursor="pointer",D.on("mousedown",(function(t){isNaN(j.resetX)&&(j.resetX=j.x),isNaN(j.resetY)&&(j.resetY=j.y),_=t.stageX/e.scaX-j.x,Y=t.stageY/e.scaY-j.y,D.cursor="pointer"})),D.on("pressmove",(function(t){var o,n=U(t.stageX/e.scaX-_,t.stageY/e.scaY-Y);j.x=n.x,j.y=n.y;for(var r=0;r<j.numChildren;r++)"TextArea"!=(o=j.getChildAt(r)).type&&"Loader"!=o.type&&"Tag"!=o.type||o.resize();j.stage.update()})),this.on("pressup",(function(){D.cursor="pointer",j.stage&&j.stage.update()})));if(D.centerReg(this),n&&n.center(this),!zot(b)){"string"==typeof b&&(b=new e.Label(b,null,null,w));var N=j.titleBarLabel=b;zot(x)&&(x=1.5*N.height),zot(w)&&(w="black"),zot(C)&&(C="rgba(0,0,0,.2)"),j.titleBar=b=new e.Container(t,x,null,null,!1).centerReg(j).mov(0,-o/2+x/2),b.mouseEnabled=!1,b.mouseChildren=!1,j.titleBar.backing=new e.Rectangle(t,x,C,null,null,[.95*u,.95*u,0,0],null,null,null,!1).addTo(b),N.center(b).pos({x:Math.max(u/2,10),reg:!0})}function V(){var t,o;for(j.toggled=!1,o=0;o<j.numChildren;o++)if("TextArea"==(t=j.getChildAt(o)).type||"Loader"==t.type||"Tag"==t.type){var n={obj:t,depth:j.getChildIndex(t)};R.add(t,n)}for(o=j.numChildren-1;o>=0;o--)"TextArea"!=(t=j.getChildAt(o)).type&&"Loader"!=t.type&&"Tag"!=t.type||j.removeChild(t);if(e.OPTIMIZE||!zns&&WW.OPTIMIZE||j.container.stage.update(),s&&(isNaN(j.resetX)||(j.x=j.resetX),isNaN(j.resetY)||(j.y=j.resetY)),j.zimAccessibility){var r=j.zimAccessibility;r.resize(j),X?X.focus():j.zimTabTag.nextSibling.focus(),setTimeout((function(){r.talk("Pane has been closed.")}),50)}}function G(){function t(){j.container.removeChild(j),j.closeCall&&j.closeCall(j.closeParams),e.OPTIMIZE||!zns&&WW.OPTIMIZE||j.container.stage.update(),s&&(isNaN(j.resetX)||(j.x=j.resetX),isNaN(j.resetY)||(j.y=j.resetY))}y>0?j.animate({obj:{alpha:0},time:y,call:function(){t(),j.dispatchEvent("fadedout")}}):t()}function q(){for(var e=0;e<R.length;e++)j.addChildAt(R.values[e].obj,R.values[e].depth);if(j.zimAccessibility){var t=j.zimAccessibility;setTimeout((function(){t.activatedObject&&(X=t.activatedObject.zimTabTag)}),50),t.resize(j),t.tabIndex=j.zimTabIndex}j.toggled=!0}function U(e,n){return{x:e=Math.max(t/2,Math.min(j.container.getBounds().width-t/2,e)),y:n=Math.max(o/2,Math.min(j.container.getBounds().height-o/2,n))}}k&&((k=j.close=new e.Shape(-40,-40,80,80,null,!1)).graphics.f(T).p("AmJEVIEUkTIkXkWIB4h5IEWEYIETkTIB4B3IkTESIEQERIh4B4IkRkRIkSEVg"),b?k.addTo(j).scaleTo(b,null,50).mov(t/2-Math.max(u/2,10)-k.width/2,-o/2+x/2).expand(40):k.addTo(j).sca(.3).mov(t/2-k.width-3,-o/2+k.height).expand(40),k.cursor="pointer",k.expand(),k.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",H)),Object.defineProperty(j,"text",{get:function(){if(j.message)return" "==j.message.text?"":j.message.text},set:function(e){j.message&&(j.message.text=e)}}),this._enabled=!0,Object.defineProperty(j,"enabled",{get:function(){return j._enabled},set:function(e){r(j,e)}}),this.hide=function(e,t){return zot(e)||(j.closeParams=e),G(),t&&(j.dispatchEvent("close"),j.dispatchEvent("change")),j},this.on("removed",V),this.show=function(e,t){return zot(e)||(j.closeCall=e),zot(t)||(j.closeParams=t),p&&isNaN(j.resetX)&&(j.x=j.container.getBounds().width/2,j.y=j.container.getBounds().height/2),j.container.addChild(j),y>0?(j.alpha=0,j.animate({props:{alpha:1},time:y,call:function(){j.dispatchEvent("fadedin")}})):setTimeout((function(){j.container.stage&&j.container.stage.update()}),10),j},this.on("added",q),this.toggle=function(e){return!0===e?j.show():!1===e||j.container.contains(j)?j.hide():j.show(),j},!1!==A&&e.styleTransforms(this,W),this.clone=function(){var n=label.x,r=label.y,v=j.cloneProps(new e.Pane(t,o,label.clone(),i,a,l,s,c,u,d,h,g,p,f,m,zot(z)?z.clone():null,y,j.container,b,w,C,x,k,T,A,this.group,B));return v.label.x=n,v.label.y=r,v}},e.extend(e.Pane,e.Container,"clone","zimContainer",!1),e.Panel=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B){var E,I="width, height, content, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, backgroundColor, borderColor, borderWidth, corner, close, closeColor, next, nextColor, extraButton, collapse, collapseColor, collapsed, align, shadowColor, shadowBlur, draggable, boundary, style, group, inherit";if(E=zob(e.Panel,arguments,I,this))return E;z_d("57.7"),this.group=P;var S=!1===A?{}:e.getStyle("Panel",this.group,B);zot(t)&&(t=null!=S.width?S.width:250),zot(o)&&(o=null!=S.height?S.height:300),this.zimContainer_constructor(t,o,null,null,!1),this.type="Panel",zot(n)&&(n=null!=S.content?S.content:null);var W=this.content=n;zot(i)&&(i=null!=S.titleBar?S.titleBar:"PANEL"),zot(a)&&(a=null!=S.titleBarColor?S.titleBarColor:"#fff"),zot(l)&&(l=null!=S.titleBarBackgroundColor?S.titleBarBackgroundColor:"#555"),zot(s)&&(s=null!=S.titleBarHeight?S.titleBarHeight:30),zot(c)&&(c=null!=S.backgroundColor?S.backgroundColor:"#eee"),zot(u)&&(u=null!=S.borderColor?S.borderColor:"#888"),zot(d)&&(d=null!=S.borderWidth?S.borderWidth:null),u<0||d<0?u=d=null:null!=u&&null==d&&(d=1),zot(h)&&(h=null!=S.corner?S.corner:5),zot(w)&&(w=null!=S.align?S.align:"left"),zot(C)&&(C=null!=S.shadowColor?S.shadowColor:"rgba(0,0,0,.3)"),zot(x)&&(x=null!=S.shadowBlur?S.shadowBlur:14),zot(k)&&(k=null!=S.draggable&&S.draggable),zot(T)&&(T=null!=S.boundary?S.boundary:null),zot(g)&&(g=null!=S.close&&S.close),zot(p)&&(p=null!=S.closeColor?S.closeColor:zot(a)?"#555":a),zot(f)&&(f=null!=S.next?S.next:e.vee(i)),zot(m)&&(m=null!=S.nextColor?S.nextColor:zot(a)?"#555":a),Array.isArray(h)||(h=[h,h,h,h]),zot(y)&&(y=null!=S.collapse&&S.collapse),zot(v)&&(v=null!=S.collapseColor?S.collapseColor:zot(a)?"#555":a),zot(b)&&(b=null!=S.collapsed&&S.collapsed);var M=this,O=["header","message","text","display","buttons","config"];n&&O.forEach((function(e){n[e]&&(M[e]=n[e])})),M.label=M.message;var j=this.background=new e.Rectangle(t,o,c,u,d,h).addTo(this);-1!=C&&x>0&&(this.background.shadow=new createjs.Shadow(C,3,3,x));var L=i,D=e.Pick.choose(L),_=e.Pick.choose(a),Y=e.Pick.choose(l);n=M.contentContainer=new e.Container(t,o-s).addTo(M).mov(0,s);"string"==typeof D&&(D=new e.Label({text:D,color:_,size:null!=S.size?S.size:20,bold:null!=S.bold&&S.bold,backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",group:this.group}));var X=M.titleBarLabel=D;zot(Y)&&(Y="rgba(0,0,0,.2)"),M.titleBar=i=new e.Container(t,s,null,null,!1).loc(0,0,M);var R=M.titleBar.backing=new e.Rectangle(t+d,s,Y,null,null,[.95*h[0],.95*h[1],0,0],!0,null,null,!1).center(i);if(i&&F(),M.label=D,M.text=D.text,g){var H=M.closeIcon=new e.Shape(-40,-40,80,80,null,!1);H.graphics.f(p).p("AmJEVIEUkTIkXkWIB4h5IEWEYIETkTIB4B3IkTESIEQERIh4B4IkRkRIkSEVg"),i?(H.centerReg(i).scaleTo(i,null,50),H.pos(Math.max(h[1]/2,15),null,!0)):H.addTo(M).sca(.3).mov(t/2-H.width-3,-o/2+g.height),H.expand(40),H.cursor="pointer",H.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){var e=M.stage;M.removeFrom(),M.dispatchEvent("close"),e.update()}))}if(M.add=function(e,t,o){o&&M.contentContainer.removeAllChildren(),t?e.center(M.contentContainer):e.addTo(M.contentContainer)},M.content){W=e.makeContent(M.content,t);(O=["header","message","text","display","buttons","config"]).forEach((function(e){W[e]&&(M[e]=W[e])})),M.label=M.message,M.add(W,!0)}function F(){"right"==w?X.center(i).pos(Math.max(h[0]/2,10),null,!0):"center"==w||"middle"==w?X.center(i):X.center(i).loc(Math.max(h[0]/2,10)),X.mov(0,2)}if(this.nextPanel=function(t,o){var n=zot(t)||zot(L.array)?e.Pick.choose(L):L.array[t],r=zot(t)||zot(a.array)?e.Pick.choose(a):a.array[t],i=zot(t)||zot(l.array)?e.Pick.choose(l):l.array[t],s=zot(t)||zot(c.array)?e.Pick.choose(c):c.array[t],d=zot(t)||zot(u.array)?e.Pick.choose(u):u.array[t];"string"==typeof n&&(n=new e.Label({text:n,color:r,size:null!=S.size?S.size:20,backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",group:this.group})),M.label=n,M.text=n.text,X.removeFrom(),X=M.titleBarLabel=n,F(),R.color=i,M.background.color=s,M.background.borderColor=d,o&&M.dispatchEvent("change"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!M.stage||M.stage.update()},k&&(i.cursor="pointer",i.on("mousedown",(function(){M.drag({rect:T,currentTarget:!0})})),i.on("pressup",(function(){M.noDrag(!1)}))),f>0){var N=M.nextIcon=new e.Shape(-20,-20,40,40,null,!1);N.graphics.f(a).p("AiJieIETCeIkTCfg"),N.centerReg(i).scaleTo(i,null,70).alp(.8).hov(1).expand(),N.pos(Math.max(h[1]/2,15),null,!0),H&&N.mov(-H.width-8),N.cursor="pointer",N.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){M.nextPanel(),M.dispatchEvent("change")}))}if(zot(z)||((z=M.extraButton=new e.Button({label:"R",width:50,height:50,corner:5,group:"PanelExtra"}).scaleTo(i,null,70).centerReg(i).expand()).pos(Math.max(h[1]/2,15),null,!0),H&&z.mov(-H.width-8),N&&z.mov(-N.width-8)),y){G=b,M.collapse=function(e){if(zot(e)&&(e=!0),e==G)return M;e?(V.rot(180),j.visible=!1,n.visible=!1,G=!0,M.dispatchEvent("collapse")):(V.rot(0),j.visible=!0,n.visible=!0,G=!1,M.dispatchEvent("expand")),M.stage&&M.stage.update()},M.collapseEvent=M.titleBar.on("dblclick",(function(){M.collapsed=!M.collapsed})),zot(v)&&(v="#555");var V=M.collapseIcon=new e.Triangle(90,90,90,e.faint,v,16);V.centerReg(M).scaleTo(i,null,41).pos({x:t-Math.max(h[1]/2,15)-V.width/2-4,y:s/2,reg:!0}).expand(40),z&&V.mov(-z.width-8),H&&V.mov(-H.width-8),N&&V.mov(-N.width-8),V.cursor="pointer",V.expand();var G=!1;V.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){G?M.collapse(!1):M.collapse(!0)}))}M.overlay=new e.Rectangle(t,o,null,null,null,h).alp(.3),Object.defineProperty(M,"panelHeight",{get:function(){return M.background.height},set:function(o){j.removeFrom(),j=this.background=new e.Rectangle(t,o,c,u,d,h).addTo(this).bot(),-1!=C&&x>0&&(this.background.shadow=new createjs.Shadow(C,3,3,x)),M.setBounds(t,o),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!M.stage||M.stage.update()}}),Object.defineProperty(M,"collapsed",{get:function(){return G},set:function(e){M.collapse&&M.collapse(e)}}),this._enabled=!0,Object.defineProperty(M,"enabled",{get:function(){return M._enabled},set:function(t){r(M,t),t?M.overlay.removeFrom():M.overlay.addTo(M),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!M.stage||M.stage.update()}}),b&&(b=!1,M.collapsed=!0),!1!==A&&e.styleTransforms(this,S),this.clone=function(){return M.cloneProps(new e.Toggle(t,o,i?i.clone():"",a,l,s,c,u,d,h,g,p,f,m,z,y,v,M.collapsed,w,C,x,k,T,A,this.group,B))},this.doDispose=function(e,t,o){return y&&this.titleBar.off("dblclick",this.collapseEvent),o||this.zimContainer_dispose(!0),!0}},e.extend(e.Panel,e.Container,["clone","dispose"],"zimContainer",!1),e.Panel.prototype.dispose=function(e){return this.doDispose(null,null,e)},e.Window=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q){var U,Q="width, height, content, backgroundColor, borderColor, borderWidth, padding, corner, swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, slide, slideDamp, slideSnap, interactive, shadowColor, shadowBlur, paddingHorizontal, paddingVertical, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, cancelCurrentDrag, fullSize, fullSizeColor, resizeHandle, collapse, collapseColor, collapsed, optimize, style, group, inherit";if(U=zob(e.Window,arguments,Q,this))return U;z_d("58.1"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Window",this.group=G;var Z=!1===V?{}:e.getStyle(this.type,this.group,q);zot(t)&&(t=null!=Z.width?Z.width:300),zot(o)&&(o=null!=Z.height?Z.height:200),zot(i)&&(i=null!=Z.backgroundColor?Z.backgroundColor:"#333");var K=a,J=l;zot(a)&&(a=null!=Z.borderColor?Z.borderColor:"#999"),zot(l)&&(l=null!=Z.borderWidth?Z.borderWidth:1),zot(s)&&(s=null!=Z.padding?Z.padding:0),zot(c)&&(c=null!=Z.corner?Z.corner:0),zot(u)&&(u=null==Z.swipe||Z.swipe),zot(d)&&(d=null==Z.scrollBarActive||Z.scrollBarActive),zot(h)&&(h=null!=Z.scrollBarDrag&&Z.scrollBarDrag),zot(g)&&(g=null!=Z.scrollBarColor?Z.scrollBarColor:a),zot(p)&&(p=null!=Z.scrollBarAlpha?Z.scrollBarAlpha:.3),zot(f)&&(f=null==Z.scrollBarFade||Z.scrollBarFade),zot(m)&&(m=null==Z.scrollBarH||Z.scrollBarH),zot(z)&&(z=null==Z.scrollBarV||Z.scrollBarV),h&&(f=null!=Z.scrollBarFade&&Z.scrollBarFade),zot(y)&&(y=null==Z.slide||Z.slide),zot(v)&&(v=null!=Z.slideDamp?Z.slideDamp:.6),zot(b)&&(b=null!=Z.slideSnap?Z.slideSnap:"vertical"),zot(w)&&(w=null==Z.interactive||Z.interactive),zot(C)&&(C=null!=Z.shadowColor?Z.shadowColor:"rgba(0,0,0,.3)"),zot(x)&&(x=null!=Z.shadowBlur?Z.shadowBlur:20),zot(T)&&(T=null!=Z.paddingVertical?Z.paddingVertical:s),zot(k)&&(k=null!=Z.paddingHorizontal?Z.paddingHorizontal:s),zot(A)&&(A=null==Z.scrollWheel||Z.scrollWheel),zot(B)&&(B=null!=Z.titleBar?Z.titleBar:null),zot(E)&&(E=null!=Z.titleBarColor?Z.titleBarColor:null),zot(I)&&(I=null!=Z.titleBarBackgroundColor?Z.titleBarBackgroundColor:null),zot(S)&&(S=null!=Z.titleBarHeight?Z.titleBarHeight:null),zot(W)&&(W=null!=Z.draggable?Z.draggable:null),zot(M)&&(M=null!=Z.boundary?Z.boundary:null),zot(O)&&(O=null!=Z.onTop?Z.onTop:null),zot(j)&&(j=null!=Z.close?Z.close:null),zot(L)&&(L=null!=Z.closeColor?Z.closeColor:null),zot(D)&&(D=null!=Z.cancelCurrentDrag&&Z.cancelCurrentDrag),zot(_)&&(_=null!=Z.fullSize?Z.fullSize:null),zot(Y)&&(Y=null!=Z.fullSizeColor?Z.fullSizeColor:null),zot(X)&&(X=null!=Z.resizeHandle?Z.resizeHandle:null),zot(R)&&(R=null!=Z.collapse&&Z.collapse),zot(H)&&(H=null!=Z.collapseColor?Z.collapseColor:null),zot(F)&&(F=null!=Z.collapsed&&Z.collapsed),zot(N)&&(N=null==Z.optimize||Z.optimize),!1===B&&(B=null),zot(B)||(zot(S)&&(S=30),o-=S);var $=this;$.optimize=N,this.scrollX=this.scrollY=this.scrollXMax=this.scrollYMax=0;var ee=this.backing=new e.Shape({style:!1});this.addChild(ee);var te=new createjs.Shape;te.type="WindowBacking";var oe,ne=te.graphics;if(this.addChild(te),n)var re=n;if(n=this.contentContainer=new e.Container({style:!1}),this.addChild(n),n.mask=te,!w)var ie=new createjs.Shape;if(l>0){var ae=new createjs.Shape;this.addChild(ae)}var le=B?0:c;function se(){$.setBounds(0,0,t,o),ee.graphics.c().f(i).rc(0,0,t,o,le,le,c,c),-1!=C&&x>0&&(ee.shadow=new createjs.Shadow(C,4,4,x)),l>0&&(c?ae.graphics.c().s(a).ss(l,"square","miter").rc(0,0,t,o,le,le,c,c):ae.graphics.c().s(a).ss(l,"square","miter").dr(0,0,t,o)),zot(Ie)||(Ie.widthOnly=$.width+l,$.setBounds(0,-S,$.width,o+S)),Se&&(B?Se.pos({x:t-Math.max(c/2,10)-Se.width/2,y:S/2,reg:!0}):j.pos(Math.max(c/2,10)/2,Se.height/2,!0,!1,$)),We&&(We.pos({x:t-Math.max(c/2,10)-We.width/2,y:S/2,reg:!0}),Se&&We.mov(-Se.width-10)),Oe&&(Oe.pos({x:t-Math.max(c/2,10)-Oe.width/2,y:S/2,reg:!0}),Se&&Oe.mov(-Se.width-10),We&&Oe.mov(-We.width-10))}se();var ce,ue,de,he,ge,pe,fe,me,ze,ye,ve,be,we,Ce,xe,ke=this.scrollBar={};if(ke.color=g,ke.size=6,ke.minSize=2*ke.size,ke.spacing=3.5+l/2,ke.margin=0,ke.corner=ke.size/2,ke.showTime=.5,ke.fadeTime=3,d){var Te=ke.horizontal=new e.Shape({style:!1}),Ae=Te.graphics;Te.alpha=p,this.addChild(Te),h&&Te.drag({localBounds:!0});var Pe=ke.vertical=new e.Shape({style:!1}),Be=Pe.graphics;Pe.alpha=p,this.addChild(Pe),h&&Pe.drag({localBounds:!0})}if(this.update=function(){d&&(Ae.clear(),Be.clear()),ge=d?ke.size+2*ke.spacing:0,pe=n.getBounds()?n.getBounds().width:0,fe=n.getBounds()?n.getBounds().height:0,de=m&&pe>t-k&&(d||!0===u||"auto"==u||"horizontal"==u),he=z&&fe>o-T&&(d||!0===u||"auto"==u||"vertical"==u),$.scrollXMax=pe+2*k-t+(he?ge+ke.margin:0),$.scrollYMax=fe+2*T-o+(de?ge+ke.margin:0),ne.clear();var r=l/2,i=l/2,a=t-(he&&d?ke.size+2*ke.spacing:0)-(he?0:l),s=o-(de&&d?ke.size+2*ke.spacing:0)-(de?0:l);ne.f("rgba(0,0,0,0)").rc(r,i,a,s,le,le,he&&d?0:c,de&&d?0:c),te.setBounds($.getBounds().x,$.getBounds().y,$.getBounds().width,$.getBounds().height),e.expand(te,0),w||(ie.graphics.c().f("red").dr(r,i,a,s),n.hitArea=ie);var g,p,f=Math.max(c,Math.min(ke.corner,ke.spacing)),y=f+l/2,v=f+(he?ge:0)+l/2,b=f+l/2,C=f+(de?ge:0)+l/2;de&&d&&(g=Math.max(ke.minSize,(t-y-v)*(t-y-v)/(pe+k+ke.margin)),Ae.f(ke.color).rr(0,0,g,ke.size,ke.corner),Te.x=y,Te.y=o-ke.size-ke.spacing,ce=new e.Proportion(-$.scrollXMax,0,y,t-g-v,-1),h&&(Te.setBounds(0,0,g,ke.size),p=new createjs.Rectangle(y,Te.y,t-g-y-v,0),Te.dragBoundary(p),Te.proportion=new e.Proportion(p.x,p.x+p.width,0,-$.scrollXMax),Te.off("pressmove",me),me=Te.on("pressmove",(function(){$.dispatchEvent("scrolling"),ie&&(ie.x=-n.x,ie.y=-n.y),n.x=Te.proportion.convert(Te.x),Ne()})))),he&&d&&(g=Math.max(ke.minSize,(o-b-C)*(o-b-C)/(fe+T+ke.margin)),Be.f(ke.color).rr(0,0,ke.size,g,ke.corner),Pe.x=t-ke.size-ke.spacing,Pe.y=b,ue=new e.Proportion(-$.scrollYMax,0,b,o-g-C,-1),h&&(Pe.setBounds(0,0,ke.size,g),p=new createjs.Rectangle(Pe.x,b,0,o-g-b-C),Pe.dragBoundary(p),Pe.proportion=new e.Proportion(p.y,p.y+p.height,0,-$.scrollYMax),Pe.off("pressmove",ze),ze=Pe.on("pressmove",(function(){$.dispatchEvent("scrolling"),ie&&(ie.x=-n.x,ie.y=-n.y),lt=n.y=Pe.proportion.convert(Pe.y),Ne()})))),Ve(),clearTimeout($.d2Timeout),$.d2Timeout=setTimeout((function(){Te&&Te.proportion&&(n.x=Te.proportion.convert(Te.x)),Pe&&Pe.proportion&&(n.y=Pe.proportion.convert(Pe.y))}),50),clearTimeout($.dTimeout),$.dTimeout=setTimeout((function(){Xe()}),300),Xe(),Ne()},this.resize=function(e,r){zot(e)&&(e=t),zot(r)&&(r=o);var i=20;B&&(i=Ee.x+Ee.width+10),e<i&&(e=i),r<20&&(r=20),t=e,o=r,se();for(var a=0;a<n.numChildren;a++){var l=n.getChildAt(a);"Wrapper"==l.type&&De(l)}return $.update(),lt=n.y,P&&st.immediate(lt),$.dispatchEvent("resize"),$},!zot(B)){zot(W)&&(W=!0),"string"==typeof B&&(B=new e.Label({text:B,color:E,size:null!=Z.size?Z.size:20,backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",group:this.group}));var Ee=$.titleBarLabel=B;zot(I)&&(I="rgba(0,0,0,.2)"),$.titleBar=B=new e.Container(t,S,null,null,!1).centerReg($).mov(0,-o/2-S/2);var Ie=$.titleBar.backing=new e.Rectangle(t+l,S,I,null,null,[.95*c,.95*c,0,0],!0,null,null,!1).center(B);Ee.center(B).pos({x:Math.max(c/2,Math.max(10,s)),reg:!0}),$.regX=0,$.regY=-S,$.setBounds(0,-S,t,o+S),W?(B.cursor="pointer",B.on("mousedown",(function(){$.drag({rect:M,currentTarget:!0,onTop:O})})),B.on("pressup",(function(){$.noDrag(!1)}))):B.on("mousedown",(function(){}))}if(j){zot(L)&&(L="#555");var Se=$.closeIcon=new e.Shape(-40,-40,80,80,null,!1);Se.graphics.f(L).p("AmJEVIEUkTIkXkWIB4h5IEWEYIETkTIB4B3IkTESIEQERIh4B4IkRkRIkSEVg"),B?Se.centerReg($).scaleTo(B,null,50).pos({x:t-Math.max(c/2,10)-Se.width/2,y:S/2,reg:!0}).expand(40):Se.sca(.3).pos(Math.max(c/2,10)/2,Se.height/2,!0,!1,$).expand(40),Se.cursor="pointer",Se.expand(),Se.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){var e=$.stage;$.removeFrom(),$.dispatchEvent("close"),e&&e.update()}))}if(!zot(B)){if(_){$.fullSize=function(e){if(zot(e)&&(e=!0),e==ve||!$.parent)return $;e?(be=$.width,we=$.height,Ce=$.x,xe=$.y,$.resize($.parent.width,$.parent.height),$.x=0,$.y=0,ve=!0,Me.alpha=1,We.getChildAt(0).alpha=.01,$.dispatchEvent("fullsize")):($.resize(be,we-B.height),$.x=Ce,$.y=xe,ve=!1,Me.alpha=0,We.getChildAt(0).alpha=1,$.dispatchEvent("originalsize")),$.stage&&$.stage.update()},zot(Y)&&(Y="#555");var We=$.fullSizeIcon=new e.Rectangle(80,80,e.faint,Y,16),Me=(new e.Shape).s(Y).ss(16).mt(-19.6,-20.6).lt(-19.6,-40).lt(40,-40).lt(40,20.7).lt(19.6,20.7).lt(19.6,40).lt(-40,40).lt(-40,-20.6).lt(-19.6,-20.6).lt(19.6,-20.6).lt(19.6,20.7).addTo(We).mov(40,40).alp(0);We.centerReg($).scaleTo(B,null,42).pos({x:t-Math.max(c/2,10)-We.width/2,y:S/2,reg:!0}).expand(40),Se&&We.mov(-Se.width-10),We.cursor="pointer",We.expand(),ve=!1,be=t,we=o,Ce=$.x,xe=$.y,We.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){ve?$.fullSize(!1):$.fullSize(!0)}))}if(R){ye=F,$.collapse=function(e){if(zot(e)&&(e=!0),e==ye)return $;e?(Oe.rot(180),$.backing.visible=!1,$.contentContainer.visible=!1,te.visible=!1,Te&&(Te.visible=!1),Te&&(Pe.visible=!1),ae&&(ae.visible=!1),ye=!0,Ie.sha(C,5,5,x),$.dispatchEvent("collapse")):(Oe.rot(0),$.backing.visible=!0,$.contentContainer.visible=!0,te.visible=!0,Te&&(Te.visible=!0),Te&&(Pe.visible=!0),ae&&(ae.visible=!0),ye=!1,Ie.sha(null),$.dispatchEvent("expand")),$.stage&&$.stage.update()},zot(H)&&(H="#555");var Oe=$.collapseIcon=new e.Triangle(90,90,90,e.faint,H,16);Oe.centerReg($).scaleTo(B,null,42).pos({x:t-Math.max(c/2,10)-Oe.width/2,y:S/2,reg:!0}).expand(40),Se&&Oe.mov(-Se.width-10),We&&Oe.mov(-We.width-10),Oe.cursor="pointer",Oe.expand(),ye=!1,be=t,we=o,Ce=$.x,xe=$.y,Oe.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){ye?$.collapse(!1):$.collapse(!0)}))}}if(X){var je=$.resizeHandle=new e.Rectangle(25,25,e.grey,e.white).alp(.01).centerReg().rot(45).hov(.5).loc(0,0,$).mov($.width,$.height-($.titleBar?$.titleBar.height:0)).drag();je.on("pressmove",(function(){$.resize(je.x,je.y)})),je.on("pressup",Le),$.titleBar&&$.titleBar.on("pressup",Le)}function Le(e){e.currentTarget.loc(0,0,$).top().alp(.01).mov($.width,$.height-($.titleBar?$.titleBar.height:0))}function De(e){"right"==e.align?(e.x=k,e.resize($.width-(he?ke.size+2*ke.spacing:k)-2*k)):("center"==e.align||e.align,e.resize($.width-(he?ke.size+2*ke.spacing:0)-2*k)),e.alpha=e.wrapperLastAlpha}if(this.add=function(e,t,o,r){var i,a="obj, index, center, replace";if(i=zob($.add,arguments,a,$))return i;var l=e;if(l.getBounds())return ut(l),zot(t)&&(t=n.numChildren),r&&(t=0,$.removeAll()),o?(l.center($).addTo(n,t).mov(0,S?S/2:0),n.height>$.height-(S||0)&&l.loc(null,0),n.width>$.width&&l.loc(0)):l.addTo(n,t),"Wrapper"==l.type&&(Pe.alpha=0,m=!1,l.wrapperLastAlpha=l.alpha,l.alpha=0,this.added((function(){De(l),$.resize(),Te.alpha=1,Pe.alpha=1}))),0==l.x&&(l.x=k),0==l.y&&(l.y=T),$.update(),$;zogy("Window.add() - please add content with bounds set")},re){var _e=e.makeContent(re,t),Ye=["header","message","text","display","buttons","config"];Ye.forEach((function(e){_e[e]&&($[e]=_e[e])})),$.label=$.message,$.add(_e,0,!0)}function Xe(t){zot(oe)&&(oe=$.stage||WW.zdf.stage),zot(t)&&(t=!0),t?e.dragBoundary(n,new createjs.Rectangle(0,0,de?-$.scrollXMax:0,he?-$.scrollYMax:0)):e.dragBoundary(n,new createjs.Rectangle(-1e3,-1e3,oe.width+2e3,oe.height+2e3))}this.remove=function(e){return n.removeChild(e),$.update(),$},this.removeAll=function(){return n.removeAllChildren(),$.update(),$};var Re,He=!1;function Fe(){lt=n.y,P&&st.immediate(lt),d&&Ve()}function Ne(){$.optimize&&(oe=$.stage,n.loop((function(e){e.hitTestBounds&&e.stage&&(e.hitTestBounds(oe)?(e.visible=!0,e.loop&&e.loop((function(e){e.hitTestBounds&&(e.hitTestBounds(oe)?e.visible=!0:e.visible=!1)}))):e.visible=!1)})))}function Ve(){Ne(),$.dispatchEvent("scrolling"),ie&&(ie.x=-n.x,ie.y=-n.y),de&&d&&(Te.x=ce.convert(n.x)),he&&d&&(Pe.y=ue.convert(n.y))}function Ge(t){zot(t)&&(t=100),ut($),u&&setTimeout((function(){n&&(e.drag({obj:n,currentTarget:!0,localBounds:!0,slide:y,slideDamp:v,slideSnap:!((!m||!0!==u&&"auto"!=u&&"horizontal"!=u)&&(!z||!0!==u&&"auto"!=u&&"vertical"!=u))&&b}),n.removeAllEventListeners("slidestart"),n.on("slidestart",(function(){$.dispatchEvent("slidestart")})),n.removeAllEventListeners("slidestop"),!d&&N&&($.zDE&&n.off($.zDE),$.zDE=n.on("mousedown",(()=>{$.zTI&&e.Ticker.remove(Ne)})),$.zME&&n.off($.zME),$.zME=n.on("pressmove",Ne),$.zSTA&&n.off($.zSTA),$.zSTA=n.on("slidestart",(function(){$.zTI=e.Ticker.add(Ne)})),$.zSTO&&n.off($.zSTO),$.zSTO=n.on("slidestop",(function(t){$.zTI&&e.Ticker.remove($.zTI)}))),n.on("slidestop",(function(e){y&&qe(),$.dispatchEvent("slidestop")})),n.getBounds()&&n.getBounds().width>0&&Xe())}),t)}function qe(){e.Ticker.remove(Fe),He=!1,de&&f&&d&&e.animate(Te,{alpha:0},ke.fadeTime),he&&f&&d&&e.animate(Pe,{alpha:0},ke.fadeTime)}u&&n.on("mousedown",(function(){He||e.Ticker.add(Fe,n.stage),He=!0,de&&d&&f&&e.animate(Te,{alpha:p},ke.showTime),he&&d&&f&&e.animate(Pe,{alpha:p},ke.showTime)})),this.on("added",(function(){Ge(50)}),null,!0),this.cancelCurrentDrag=function(){$.contentContainer&&$.contentContainer.noDrag(!1),setTimeout((function(){n&&(e.drag({obj:n,currentTarget:!0,localBounds:!0,slide:y,slideDamp:v,slideSnap:!((!m||!0!==u&&"auto"!=u&&"horizontal"!=u)&&(!z||!0!==u&&"auto"!=u&&"vertical"!=u))&&b}),n.getBounds()&&n.getBounds().width>0&&Xe())}),300)},this.added((function(t){Re=(oe=t).on("stagemousemove",(function(t){$.windowMouseX=t.stageX/e.scaX,$.windowMouseY=t.stageY/e.scaY}))})),y?n.on("slidestop",qe):n.on("mousedown",(function(){n.stage.on("stagemouseup",qe,null,!0)})),D&&($.blurEvent=function(){$.cancelCurrentDrag(),qe()},document.WW.addEventListener("blur",$.blurEvent));var Ue,Qe,Ze,Ke=!1,Je=0,$e=0,et=0,tt=0,ot=300,nt=2;function rt(){Ue=Date.now(),e.Ticker.add(at,n.stage)}function it(){Ke||($.dispatchEvent("hoverout"),Ke=!0),e.Ticker.remove(at)}function at(){if(!n.stage)return Ke||($.dispatchEvent("hoverout"),Ke=!0),void e.Ticker.remove(at);Math.abs(Je-$.windowMouseX)>nt||Math.abs($e-$.windowMouseY)>nt?(Ke||($.dispatchEvent("hoverout"),Ke=!0),Ue=Date.now(),Je=$.windowMouseX,$e=$.windowMouseY):Date.now()-Ue>ot&&((Math.abs(et-$.windowMouseX)>nt||Math.abs(tt-$.windowMouseY)>nt)&&($.contentMouse=n.globalToLocal($.windowMouseX,$.windowMouseY),$.dispatchEvent("hoverover"),et=$.windowMouseX,tt=$.windowMouseY,Ke=!1),Ue=Date.now())}w&&(n.on("mousedown",(function(t){oe=t.target.stage,Qe=t.stageX/e.scaX,Ze=Date.now()})),n.on("click",(function(t){Date.now()-Ze<600&&Math.abs(t.stageX/e.scaX-Qe)<5&&($.contentMouse=n.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY),$.dispatchEvent("select"))})),n.on("mouseover",rt),n.on("mouseout",it));var lt=$.scrollY;$.scrollWindow=function(t){if(he&&$.stage&&$.hitTestPoint($.windowMouseX,$.windowMouseY)&&$.contains($.stage.getObjectUnderPoint($.windowMouseX*e.scaX,$.windowMouseY*e.scaY))){zot(t)&&(t=event);var o=t.detail?-19*t.detail:t.wheelDelta;zot(o)&&(o=-19*t.deltaY),lt+=o,lt=Math.max(-$.scrollYMax,Math.min(0,lt)),P||($.scrollY=lt,n.stage.update())}N&&Ne()},A&&(WW.addEventListener("mousewheel",$.scrollWindow),WW.addEventListener("wheel",$.scrollWindow),WW.addEventListener("DOMMouseScroll",$.scrollWindow));var st,ct=!1;function ut(t){P&&!ct&&t.stage&&(ct=!0,st=new e.Damp($.scrollY,P),$.dampTicker=e.Ticker.add((function(){He||null!=$.scrollY&&null!=lt&&$.scrollY!=lt&&Math.round($.scrollY)==Math.round(lt)||zot(lt)||($.scrollY=st.convert(lt))}),t.stage))}this._enabled=!0,Object.defineProperty($,"enabled",{get:function(){return $._enabled},set:function(t){t?Ge():(clearTimeout($.dTimeout),e.noDrag(n)),r($,t)}}),this._scrollEnabled=!0,Object.defineProperty($,"scrollEnabled",{get:function(){return $._scrollEnabled},set:function(t){t?(Ge(),h&&(me&&(Te.mouseEnabled=!0),ze&&(Pe.mouseEnabled=!0)),WW.addEventListener("mousewheel",$.scrollWindow),WW.addEventListener("wheel",$.scrollWindow),WW.addEventListener("DOMMouseScroll",$.scrollWindow)):(clearTimeout($.dTimeout),e.noDrag(n),h&&(me&&(Te.mouseEnabled=!1),ze&&(Pe.mouseEnabled=!1)),WW.removeEventListener("mousewheel",$.scrollWindow),WW.removeEventListener("wheel",$.scrollWindow),WW.removeEventListener("DOMMouseScroll",$.scrollWindow)),$._scrollEnabled=t}}),Object.defineProperty($,"scrollX",{get:function(){return n.x},set:function(e){n.x=e,clearTimeout($.d2Timeout),n.zimDragImmediate&&n.zimDragImmediate(n.x,n.y),Ve()}}),Object.defineProperty($,"scrollY",{get:function(){return n.y},set:function(e){n.y=lt=e,P&&st.immediate(lt),clearTimeout($.d2Timeout),n.zimDragImmediate&&n.zimDragImmediate(n.x,n.y),Ve()}}),Object.defineProperty($,"backgroundColor",{get:function(){return i},set:function(e){i=e,se()}}),Object.defineProperty($,"fullSized",{get:function(){return ve},set:function(e){$.fullSize&&$.fullSize(e)}}),Object.defineProperty($,"collapsed",{get:function(){return ye},set:function(e){$.collapse&&$.collapse(e)}}),F&&(ye=!1,$.collapsed=!0),$.titleBar&&($.collapseEvent=$.titleBar.on("dblclick",(function(){$.collapsed=!$.collapsed}))),!1!==V&&e.styleTransforms(this,Z),this.clone=function(n){zot(n)&&(n=!0);var r=$.cloneProps(new e.Window(t,o,null,i,K,J,s,c,u,d,h,ke.color,p,f,m,z,y,v,b,w,C,x,k,T,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q));return n&&($.contentContainer.cloneChildren(r.contentContainer),r.update()),r},this.doDispose=function(t,o,r){return A&&(WW.removeEventListener("mousewheel",$.scrollWindow),WW.removeEventListener("wheel",$.scrollWindow),WW.removeEventListener("DOMMouseScroll",$.scrollWindow)),n&&($.zDE&&n.off($.zDE),$.zME&&n.off($.zME),$.zSTA&&n.off($.zSTA),$.zSTO&&n.off($.zSTO),$.zTI&&e.Ticker.remove($.zTI)),$.titleBar&&$.titleBar.removeAllEventListeners(),Re&&oe&&oe.off("stagemousemove",Re),$.resizeHandle&&$.resizeHandle.removeAllEventListeners(),$.blurEvent&&WW.removeEventListener("blur",$.blurEvent),e.Ticker.remove(at),zot(Fe)||e.Ticker.remove(Fe),r||this.zimContainer_dispose(!0),n=$.contentContainer=null,!0}},e.extend(e.Window,e.Container,["clone","dispose"],"zimContainer",!1),e.Window.prototype.dispose=function(e){return this.doDispose(null,null,e)},e.Page=function(t,o,n,r,i,a,l,s,c,u,d){var h,g="width, height, color, color2, vertical, pattern, scalePattern, cache, style, group, inherit";if(h=zob(e.Page,arguments,g,this))return h;z_d("58.3"),this.group=u;var p=!1===c?{}:e.getStyle("Page",this.group,d);zot(t)&&(t=null!=p.width?p.width:WW.zdf.width),zot(o)&&(o=null!=p.height?p.height:WW.zdf.height),this.zimContainer_constructor(0,0,t,o,!1),this.type="Page";var f=this;zot(i)&&(i=null==p.vertical||p.vertical),zot(n)&&(n=null!=p.color?p.color:e.light),zot(r)&&(r=null!=p.color2?p.color2:null),zot(a)&&(a=null!=p.pattern?p.pattern:null),zot(l)&&(l=null!=p.scalePattern?p.scalePattern:"fill"),zot(s)&&(s=null!=p.cache&&p.cache),zot(r)||(n=new e.GradientColor([n,r],[0,1],0,0,i?0:t,i?o:0),r=null);var m=this.backing=new e.Rectangle({width:t,height:o,color:n,style:!1}).addTo(this);!zot(s)||zot(r)&&zot(a)||(s=!0),s&&m.cache(),zot(a)||(this.pattern=a.addTo(this),l&&a.scaleTo(this,100,100,l).center(this),s&&a.cache()),Object.defineProperty(f,"color",{get:function(){return n},set:function(e){zot(e)&&(e="black"),n=e,f.backing.color=e}}),!1!==c&&e.styleTransforms(this,p),this.clone=function(h){zot(h)&&(h=!1),n.type&&(r=null);var g=f.cloneProps(new e.Page(t,o,n,r,i,a,l,s,c,u,d));return h&&f.cloneChildren(g),g}},e.extend(e.Page,e.Container,["clone"],"zimContainer",!1),e.Layer=function(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I){var S,W="width, height, titleBar, titleBarContainer, backgroundColor, rollBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, color, rollColor, selectedColor, selectedRollColor, borderWidth, borderColor, dashed, transformObject, titleBarWidth, titleBarHeight, titleBarX, titleBarY, titleBarDraggable, close, closeColor, closeBackgroundColor, closeIndicatorColor, anchor, style, group, inherit";if(S=zob(e.Layer,arguments,W,this))return S;z_d("58.5"),this.group=E;var M=!1===B?{}:e.getStyle("Layer",this.group,I);zot(o)&&(o=null!=M.width?M.width:500),zot(n)&&(n=null!=M.height?M.height:500),this.zimContainer_constructor(0,0,o,n,!1),this.type="Layer";var O=this;O.distX=40,O.distY=0,zot(r)&&(r=null!=M.titleBar?M.titleBar:"LAYER");var j=r,L=r,D=!0;zot(a)&&(a=null!=M.backgroundColor?M.backgroundColor:"#eee"),zot(l)&&(l=null!=M.rollBackgroundColor?M.rollBackgroundColor:"#fff"),zot(s)&&(s=null!=M.selectedBackgroundColor?M.selectedBackgroundColor:"#666"),zot(u)&&(u=null!=M.color?M.color:"#666"),zot(d)&&(d=null!=M.rollColor?M.rollColor:"#666"),zot(h)&&(h=null!=M.selectedColor?M.selectedColor:"#ddd"),zot(p)&&(p=null!=M.borderWidth?M.borderWidth:1),zot(f)&&(f=null!=M.borderColor?M.borderColor:a),(f<0||p<0)&&(f=p=null),zot(m)&&(m=null==M.dashed||M.dashed),zot(z)&&(z=null!=M.titleBar?M.titleBar:null),zot(y)&&(y=null!=M.titleBarWidth?M.titleBarWidth:100);var _,Y=y;if(zot(v)&&(v=null!=M.titleBarHeight?M.titleBarHeight:40),zot(b)&&(b=null!=M.titleBarX?M.titleBarX:null),zot(w)&&(w=null!=M.titleBarY?M.titleBarY:null),zot(C)&&(C=null==M.titleBarDraggable||M.titleBarDraggable),zot(x)&&(x=null==M.close||M.close),zot(k)&&(k=null!=M.closeColor?M.closeColor:s),zot(T)&&(T=null!=M.closeBackgroundColor?M.closeBackgroundColor:s),zot(A)&&(A=null!=M.closeIndicatorColor?M.closeIndicatorColor:h),zot(P)&&(P=null==M.anchor||M.anchor),C||(P=!1),O.anchor=P,x&&(y+=30),z=e.merge({borderColor:s},z,{events:!0,visible:!1,ghostColor:f,ghostWidth:p,ghostDashed:m,ghostHidden:!0}),zot(i)&&(i=null!=M.titleBarContainer?M.titleBarContainer:null),zot(i)){if(!WW.zdf)return void zogy("zim Layer(): Please pass in a reference to a container with bounds set.");i=WW.zdf.stage}O.active=!1,O.turnOff=function(){O.active=!1,x&&(O.checkBox.visible=!1),O.transformControls.remove(),O.mouseChildren=!0,O.button.backgroundColor=a,O.button.rollBackgroundColor=l,O.button.color=u,O.button.rollColor=u,O.transformControls.allowToggleOff(),O.resizeChildren&&O.resizeChildren()},O.turnOn=function(){O.active=!0,x&&(O.checkBox.visible=!0,O.checkBox.checked=!0),O.button.backgroundColor=s,O.button.rollBackgroundColor=s,O.button.color=h,O.button.rollColor=h,O.mouseChildren=!1,O.transformControls.add(),O.transformControls.allowToggleOn()},O.titleBarPos=function(e,t){if(O.titleBar)return O.titleBar.pos?(O.titleBar.pos(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8],arguments[9]),_.update()):(O.distX=e,O.distY=t),D=!1,O};var X=O.visible;O.visible=!1;var R=t();this.added((function(t){_=t,O.transform(z),p>=0&&O.transformControls.hideGhost(),setTimeout((function(){O.visible=X,p>=0&&setTimeout((function(){O.transformControls.showGhost(),O.stage&&O.stage.update()}),200),_=t;var o=O.titleBar=new e.Container(y,v).reg(0,v).loc(O,null,i).mov(O.distX,O.distY);function n(e){if(D&&C){var t=i.localToLocal(o.x-O.distX,o.y-O.distY,O.parent),n=O.localToLocal(O.regX,O.regY,O.parent),a=O.localToLocal(0,0,O.parent);O.x=t.x+(n.x-a.x),O.y=t.y+(n.y-a.y),O.transformControls.resize(e),r(O),O.stage&&O.stage.update()}}function r(e){e.loop((function(e){"Layer"==e.type&&(O.titleBarDraggable&&e.move(),e.transformControls.ghost&&e.transformControls.resize(),r(e))}))}function s(){return 0==o.x||(o.y==o.height||(o.x==i.width-o.width||(o.y==i.height||void 0)))}if(C&&o.drag({all:!0,boundary:new e.Boundary(0,v,i.width-y,i.height-v),localBounds:!0}),40==O.distX&&0==O.distY||o.pos(O.distX,O.distY),x&&(O.checkBox=new e.CheckBox({borderColor:k,backgroundColor:T,indicatorColor:A,size:20,startChecked:!0}).center(o).pos(0,null,!0).change((function(){O.turnOff(),O.dispatchEvent("transformhide")})),O.checkBox.visible=!1),o.mouseChildren=!0,o.layer=O,O.resetTitleBar=function(){O.distX=40,O.distY=0,D=!0,O.move(!0),O.stage&&O.stage.update()},"string"!=typeof L&&"number"!=typeof L||(L=new e.Label({text:L,color:u,rollColor:d,size:null!=M.size?M.size:18,group:this.group})),O.label=L,O.label.center(o),O.button=new e.Button({shadowBlur:-1,width:Y,height:v-1,label:O.label,color:u,rollColor:d,backgroundColor:a,rollBackgroundColor:l,corner:null!=M.corner?M.corner:0,inherit:e.copy(M)}).addTo(o),O.button.on("mousedown",(function(){i.loop((function(e){e&&e!=o&&e.layer&&e.layer.turnOff&&e.layer.active&&e.layer.turnOff()})),O.active||(O.turnOn(),O.dispatchEvent("transformshow")),o.top()})),O.button.on("pressmove",(function(){n()})),O.button.on("pressup",(function(){n(!0);var e=O.localToLocal(0,0,i);O.distX=o.x-e.x,O.distY=o.y-e.y,o.top(),!s()&&C&&(e=O.localToGlobal(0,0),O.button.hitTestPoint(e.x,e.y)&&O.resetTitleBar())})),O.button.on("dblclick",(function(){C&&O.resetTitleBar()})),O.turnOff(),O.on("transformed",(function(e){"move"!=e.transformType&&"size"!=e.transformType&&"stretch"!=e.transformType&&"rotate"!=e.transformType||(C&&O.move(),r(O))})),O.move=function(e){!e&&!D&&O.anchor&&s()||(o.loc(O.localToLocal(0,0,i)).mov(O.distX,O.distY),o.x<0&&(D=!1,o.x=0),o.y<o.height&&(D=!1,o.y=o.height),o.x>i.width-o.width&&(D=!1,o.x=i.width-o.width),o.y>i.height&&(D=!1,o.y=i.height),O.anchor||(D=!0))},O.on("transformhide",(function(){O.turnOff(),i.loop((function(e){e&&e!=o&&e.layer&&e.layer.turnOff&&e.layer.active&&e.layer.turnOff()}))})),O.resizeChildren=function(e){O.transformControls.resize(e),O.loop((function(e){e.transformControls&&(e.transformControls.visible&&e.transformControls.hide(),"Layer"==e.type?e.resizeChildren():e.transformControls.resize())}))},O.resize=function(e){return O.move(),O.resizeChildren(e),O},O.toggled=!1,O.toggle=function(e){return zot(e)?O.toggled=!O.toggled:O.toggled=e,O.toggled?(i.loop((function(e){e&&e!=o&&e.layer&&e.layer.turnOff&&e.layer.active&&e.layer.turnOff()})),O.turnOn(),O.dispatchEvent("transformshow")):(o.top(),O.turnOff(),i.loop((function(e){e&&e!=o&&e.layer&&e.layer.turnOff&&e.layer.active&&e.layer.turnOff()})),O.dispatchEvent("transformhide")),O.stage&&O.stage.update(),O},Object.defineProperty(O,"titleBarDraggable",{get:function(){return C},set:function(t){(C=t)?o.drag({all:!0,boundary:e.Boundary(0,40,i.width-y,i.height-v),localBounds:!0}):o.noDrag(!1)}}),O.stageUpEvent=_.on("stagemouseup",(function(){O.transformControls.visible&&o.top()})),!zot(b)||!zot(w)){D=!1;var c=zot(b)?o.x:b,h=zot(w)?o.y-v:w;O.titleBarStartX=b,O.titleBarStartY=w,O.titleBarPos(c,h);var g=O.parent.localToLocal(O.x,O.y,i);O.distX=o.x-g.x,O.distY=o.y-g.y}}),50)}),"s"==R?.05:50),!1!==B&&e.styleTransforms(this,M),this.clone=function(){return O.cloneProps(new e.Layer(o,n,j,i,a,l,s,c,u,d,h,g,p,f,m,z,Y,v,b,w,C,x,k,T,A,P,B,this.group,I))},this.dispose=function(e,t,o){return O.stageUpEvent&&_.off("stagemouseup",O.stageUpEvent),i&&i.loop((function(e){e.layer=null})),O.transformControls.dispose(),O.transformControls=null,o||this.zimContainer_dispose(!0),O.titleBar.layer=null,O.titleBar.dispose(),O.checkBox=O.button=null,r=O.titleBar=z=null,!0}},e.extend(e.Layer,e.Container,["clone","dispose"],"zimContainer",!1),e.Waiter=function(o,n,r,i,a,l,s,c,u,d,h){var g,p="container, speed, foregroundColor, backgroundColor, corner, shadowColor, shadowBlur, fadeTime, style, group, inherit";if(g=zob(e.Waiter,arguments,p,this))return g;z_d("59"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Waiter",this.group=d;var f=!1===u?{}:e.getStyle(this.type,this.group,h),m=t(n);zot(n)&&(n=null!=f.speed?f.speed:"s"==m?.6:600),zot(r)&&(r=null!=f.foregroundColor?f.foregroundColor:"white"),zot(i)&&(i=null!=f.backgroundColor?f.backgroundColor:"orange"),zot(a)&&(a=null!=f.corner?f.corner:16),zot(l)&&(l=null!=f.shadowColor?f.shadowColor:"rgba(0,0,0,.3)"),zot(s)&&(s=null!=f.shadowBlur?f.shadowBlur:14),zot(c)&&(c=null!=f.fadeTime?f.fadeTime:0);var z=40,y=3,v=.6*z/2,b=(z-2*v)/2,w=y*(2*v+b)+b;this.setBounds(-w/2,-z/2,w,z);var C,x=this,k=this.display=new e.Shape({style:!1});this.addChild(k),k.setBounds(0,0,w,z),k.regX=w/2,k.regY=z/2;var T=k.graphics;T.f(i);var A=a;Array.isArray(A)||(A=[a,a,a,a]),T.rc(0,0,w,z,A[0],A[1],A[2],A[3]),-1!=l&&s>0&&(k.shadow=new createjs.Shadow(l,3,3,s)),k.on("click",(function(e){e.stopImmediatePropagation()}));var P,B,E=new e.Container({style:!1});this.addChild(E);for(var I=0;I<y;I++)(P=new createjs.Shape).graphics.f(r).dc(0,0,v),P.x=(I-(y-1)/2)*(2*v+b),E.addChild(P),P.cache(-v,-v,2*v,2*v),P.alpha=0;this.hide=function(){function e(){if(x.parent&&x.parent.removeChild(x),(C=x.stage)&&C.update(),x.zimAccessibility){var e=x.zimAccessibility;e.resize(x),B?B.focus():x.zimTabTag.nextSibling.focus(),setTimeout((function(){e.talk("Waiter has finished.")}),50)}}return c>0?x.animate({obj:{alpha:0},time:c,call:e}):e(),x.toggled=!1,x};var S=[];this.show=function(){var e,t="zim display - Waiter(): Please pass in a reference to a container with bounds set as first parameter to Waiter";if(zot(o)){if(!WW.zdf)return void zogy(t);o=WW.zdf.stage}else{if(!o.getBounds)return void zogy(t);if(zot(o.stage))return void zogy("zim display - Waiter(): The container must have a stage property")}for(var r=0,i=n*("s"==m?1e3:1),a=0;a<E.numChildren;a++)E&&S.push(setTimeout((function(){e=E.getChildAt(r),createjs.Tween.get(e,{loop:!0}).to({alpha:1},i/y/2).wait(i/y).to({alpha:0},i/y).wait(i-i/y-i/y/2),r++}),a*i/y));if(x.ticker=createjs.Ticker.on("tick",(function(){o.stage.update()})),x.x=o.getBounds().width/2,x.y=o.getBounds().height/2,o.addChild(x),c>0&&(x.alpha=0,x.animate({alpha:1},c)),x.zimAccessibility){var l=x.zimAccessibility;setTimeout((function(){l.activatedObject&&(B=l.activatedObject.zimTabTag)}),50),l.resize(x),l.talk(x.zimTabTag.getAttribute("aria-label"))}return x.toggled=!0,x},x.toggle=function(e){return!0===e?x.show():!1===e||x.parent?x.hide():x.show(),x},!1!==u&&e.styleTransforms(this,f),this.clone=function(){return x.cloneProps(new e.Waiter(o,n,r,i,a,l,s,c,u,this.group,h))},this.dispose=function(e,t,o){x.ticker&&createjs.Ticker.off("tick",x.ticker),createjs.Tween.removeTweens(x),x.removeFrom();for(var n=0;n<E.numChildren;n++){var r=E.getChildAt(n);clearInterval(S[n]),createjs.Tween.removeTweens(r)}return o||this.zimContainer_dispose(!0),!0}},e.extend(e.Waiter,e.Container,["clone","dispose"],"zimContainer",!1),e.ProgressBar=function(n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x){var k,T="barType, foregroundColor, backgroundColor, borderColor, borderWidth, padding, label, color, labelPosition, percentage, corner, shadowColor, shadowBlur, backing, delay, fastClose, container, autoHide, style, group, inherit";if(k=zob(e.ProgressBar,arguments,T,this))return k;z_d("59.5"),this.zimContainer_constructor(null,null,null,null,!1),this.type="ProgressBar",this.group=C;var A=!1===w?{}:e.getStyle(this.type,this.group,x);zot(r)&&(r=null!=A.foregroundColor?A.foregroundColor:"#acd241"),zot(i)&&(i=null!=A.backgroundColor?A.backgroundColor:"#444"),zot(a)&&(a=null!=A.borderColor?A.borderColor:i),zot(l)&&(l=null!=A.borderWidth?A.borderWidth:null),zot(d)&&(d=null!=A.labelPosition?A.labelPosition:"bottom"),zot(n)&&(n=null!=A.barType?A.barType:"circle"),zot(s)&&(s=null!=A.padding?A.padding:"circle"==n?2:-.5),zot(g)&&(g=null!=A.corner?A.corner:15),zot(p)&&(p=null!=A.shadowColor?A.shadowColor:"rgba(0,0,0,.3)"),zot(f)&&(f=null!=A.shadowBlur?A.shadowBlur:14),zot(m)&&(m=null!=A.backing?A.backing.clone():null),zot(y)&&(y=null==A.fastClose||A.fastClose),a<0||l<0?a=l=null:null!=a&&null==l&&(l="circle"==n?10:2);var P=t(z);zot(z)&&(z=null!=A.delay?A.delay:"s"==P?.1:100),zot(b)&&(b=null==A.autoHide||A.autoHide),zot(c)&&(c=null!=A.label?A.label:null),zot(u)&&(u=null!=A.color?A.color:r),"string"!=typeof c&&"number"!=typeof c||(c=new e.Label({text:c,color:u,backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",group:this.group})),!zot(h)&&zot(c)&&(c=new e.Label("")),this.label=c;var B,E,I,S=30,W=this,M=0;if(W.visible=!1,setTimeout((function(){W.visible=!0,W.stage&&W.stage.update()}),z),"circle"==n)B=20,m=this.backing=new e.Circle(B,"rgba(0,0,0,0)",i,l,null,null,null,null,!1).addTo(W),E=this.bar=new e.Shape({style:!1}).addTo(W).loc(m.x,m.y).rot(-90);else{if(B=200,-1!=p&&f>0){var O=new e.Rectangle(B-2,S-2,i,null,null,g,null,null,null,!1).addTo(this);O.shadow=new createjs.Shadow(p,3,3,f)}m=_(m);var j=g;Array.isArray(j)||(j=[g,g,g,g]);var L=1.2*(s+l/2);E=this.bar=new e.Rectangle(B-1.8*(s+l/2),S-1.8*(s+l/2),r,null,null,[j[0]-L,j[1]-L,j[2]-L,j[3]-L],null,null,null,!1).center(this);var D=this.mask=new e.Rectangle(B-1.8*(s+l/2),S-1.8*(s+l/2),null,null,null,null,null,null,null,!1).center(this).alp(0).sca(0,1);E.setMask(D)}function _(t){var o;if(W.backing?(o=W.getChildIndex(W.backing),W.removeChild(W.backing)):o=W.numChildren,W.border&&W.removeChild(W.border),zot(t)||"Pattern"!=t.type)t=W.backing=zot(t)?new e.Rectangle(B,S,i,a,l,g,null,null,null,!1).addTo(W,o):m.addTo(W,o);else{var n=t;(t=W.backing=new e.Rectangle(B,S,i,null,null,g,null,null,null,!1).addTo(W,o)).pattern=n,n.center(t),n.setMask(t.shape),l&&(W.border=new e.Rectangle(B,S,"rgba(0,0,0,0)",a,l,g,null,null,null,!1).addTo(W,o+1))}return t}function Y(e){"circle"==n?E.graphics.c().mt(0,0).s(r).ss(l-2*s+.5).a(0,0,B,0,360*e/100*Math.PI/180):(D.sca(e/100,1),E.setMask(D)),zot(h)||(c.text=c.startText+" "+Math.min(Math.round(e),100)+"%"),b&&y&&Math.round(e)>=100&&(W.timeOut=setTimeout((function(){W.hide()}),200)),!W.dispatched&&Math.round(e)>=100&&(W.dispatchEvent("complete"),W.dispatched=!0,setTimeout((function(){W&&(W.dispatched=!1)}),100)),W.stage&&W.stage.update()}W.setBacking=function(e){_(e),W.stage&&W.stage.update()},m.on("click",(function(e){e.stopImmediatePropagation()})),zot(c)||(c.scaleX=c.scaleY=.8,c.startText=c.text,zot(h)||(c.text=c.startText+" 0%"),c.center(W),"above"==d?c.y-=60:c.y+=60,c.alpha=.8),this.hide=function(){var e=W.stage;if(W.parent&&W.parent.removeChild(W),"Pattern"==W.backing.type&&W.backing.pauseInterval&&W.backing.pauseInterval(),e&&e.update(),W.zimAccessibility){var t=W.zimAccessibility;t.resize(W),I?I.focus():W.zimTabTag.nextSibling.focus(),setTimeout((function(){t.talk("Progress Bar has finished.")}),50)}return W.toggled=!1,W},this.show=function(){var e="zim display - ProgressBar(): Please pass in a reference to a container with bounds set as first parameter of the ProgressBar";if(zot(v)){if(!WW.zdf)return void zogy(e);v=WW.zdf.stage}else{if(!v.getBounds)return void zogy(e);if(zot(v.stage))return void zogy("zim display - Waiter(): The container must have a stage property")}if(W.timeOut&&clearTimeout(W.timeOut),Y(0),W.zimActiveLoader&&W.zimActiveLoader.on("progress",(function(e){Y(M=100*e.progress)})),W.center(v),"Pattern"==W.backing.type&&W.backing.pauseInterval&&W.backing.pauseInterval(!1),W.zimAccessibility){var t=W.zimAccessibility;setTimeout((function(){t.activatedObject&&(I=t.activatedObject.zimTabTag)}),50),t.resize(W),t.talk(W.zimTabTag.getAttribute("aria-label"))}return W.toggled=!0,W},W.toggle=function(e){return!0===e?W.show():!1===e||W.parent?W.hide():W.show(),W},W.run=function(e,t){zot(t)||(b=t),zot(e)&&(e="s"==P?3:3e3),o(e,P);var n=e*("s"==P?1e3:1);W.runInterval&&clearInterval(W.runInterval),W.percent=0;var r=Date.now();return W.runInterval=setInterval((function(){W.percent=(Date.now()-r)/n*100,W.percent>=100&&(W.percent=100,clearInterval(W.runInterval))}),30),W},W.dispatched=!1,Object.defineProperty(W,"percent",{get:function(){return M},set:function(e){M=e,Y(e)}});var X=W.getBounds();W.setBounds(X.x-5,X.y-5,X.width+10,X.height+10),!1!==w&&e.styleTransforms(this,A),this.clone=function(){return W.cloneProps(new e.ProgressBar(n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,this.group,x))},this.dispose=function(e,t,o){return"Pattern"==W.backing.type&&W.backing.clearInterval&&W.backing.clearInterval(),W.runInterval&&clearInterval(W.runInterval),o||this.zimContainer_dispose(!0),!0}},e.extend(e.ProgressBar,e.Container,["clone","dispose"],"zimContainer",!1),e.Indicator=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C){var x,k="width, height, num, foregroundColor, backgroundColor, borderColor, borderWidth, backdropColor, corner, indicatorType, fill, scale, lightScale, interactive, shadowColor, shadowBlur, selectedIndex, backgroundAlpha, style, group, inherit";if(x=zob(e.Indicator,arguments,k,this))return x;z_d("60"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Indicator",this.group=w;var T=!1===b?{}:e.getStyle(this.type,this.group,C);zot(t)&&(t=null!=T.width?T.width:300),zot(o)&&(o=null!=T.height?T.height:50),zot(n)&&(n=null!=T.num?T.num:6),zot(d)&&(d=null!=T.indicatorType?T.indicatorType:"dot"),zot(i)&&(i=null!=T.foregroundColor?T.foregroundColor:"star"==d?e.yellow:"heart"==d?e.red:"#f58e25"),zot(a)&&(a=null!=T.backgroundColor?T.backgroundColor:"#666"),a<0&&(a=null!=T.backgroundColor?T.backgroundColor:"rgba(0,0,0,.01)"),zot(l)&&(l=null!=T.borderColor?T.borderColor:null),zot(s)&&(s=null!=T.borderWidth?T.borderWidth:null),l<0||s<0?l=s=null:null!=l&&null==s&&(s=1),zot(c)&&(c=null!=T.backdropColor?T.backdropColor:-1),zot(u)&&(u=null!=T.corner?T.corner:0),zot(h)&&(h=null!=T.fill&&T.fill),zot(g)&&(g=null!=T.scale?T.scale:1),zot(p)&&(p=null!=T.lightScale?T.lightScale:1),zot(f)&&(f=null!=T.interactive&&T.interactive),zot(m)&&(m=null!=T.shadowColor?T.shadowColor:"rgba(0,0,0,.3)"),zot(z)&&(z=null!=T.shadowBlur?T.shadowBlur:5),zot(v)&&(v=null!=T.backgroundAlpha?T.backgroundAlpha:.2);var A,P=(zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",B=this;if(this.lights=[],-1!=c){var E=B.backdrop=new e.Rectangle(t,o,c,l,s,u,null,null,null,!1);this.addChild(E)}var I,S=this.lightsContainer=new e.Container({style:!1});this.addChild(S);var W=.5*o,M=t/(n+1),O=new createjs.Shape,j=!1;"square"==d||"box"==d||"Emoji"==d.type?O.graphics.f("black").dr(-M/2/p+W/2,-o/2+W/2,M/p,o):O.graphics.f("black").dr(-M/2/p,-o/2,M/p,o);for(var L=0;L<n;L++)"square"==d||"box"==d?((I=new e.Rectangle(W,W,a,l,s,null,null,null,null,!1)).regX=I.width/2,I.regY=I.height/2):"star"==d?I=new e.Poly(.6*W,5,.5,a,l,s,null,null,!1):"heart"==d?I=new e.Blob({points:[[0,-40.7,0,0,-57.3,-76.6,41.8,-80.3,"mirror"],[100,0,0,0,23.7,-45.4,-23.7,45.4,"mirror"],[0,100,0,0,0,0,0,0,"mirror"],[-100,0,0,0,21.9,48.2,-21.9,-48.2,"mirror"]],color:a,interactive:!1}).transformPoints("scale",.15):"Emoji"==d.type?(j=!0,(I=d.clone().reg("center","center")).myCache=!1):I=new e.Circle(W/2,a,l,s,null,null,null,null,!1),this.lights.push(I),I.znum=L,I.scaleX=I.scaleY=p,I.hitArea=O,I.x=M+M*L,I.y=o/2,S.addChild(I);function D(t){var o;t>=n&&(t=-1);for(var r=0;r<n;r++){o=h&&r<t?i:a,r==t&&(o=i);var l=S.getChildAt(r);j&&(l.alpha=o==i?1:v),l.color=o}B.zimAccessibility&&B.zimAccessibility.changeTitle(B),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!B.stage||B.stage.update()}S.setBounds(0,0,t,o),S.regX=S.x=t/2,S.regY=S.y=o/2,this.addChild(S),-1!=m&&z>0&&(S.shadow=new createjs.Shadow(m,2,2,z)),f&&(S.cursor="pointer",B.lightsEvent=S.on(P,(function(e){if(A==e.target.znum){if(A>0)return;if(0==A)return D(A=-1),void B.dispatchEvent("change")}D(A=e.target.znum),B.dispatchEvent("change")}))),S.scaleX=S.scaleY=g,Object.defineProperty(this,"selectedIndex",{get:function(){return A},set:function(t){A=Math.floor(t),D(A=e.constrain(A,-1,n-1))}}),Object.defineProperty(this,"num",{get:function(){return n},set:function(){zon&&zogy("Indicator() - num is read only")}}),this._enabled=!0,Object.defineProperty(B,"enabled",{get:function(){return B._enabled},set:function(e){r(B,e)}}),zot(y)&&(y=null!=T.selectedIndex?T.selectedIndex:0),B.selectedIndex=y,!1!==b&&e.styleTransforms(this,T),this.dispose=function(e,t,o){o||(B.lightsEvent&&S.off(P,B.lightsEvent),this.zimContainer_dispose())},this.clone=function(){return B.cloneProps(new e.Indicator(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,this.group,C))}},e.extend(e.Indicator,e.Container,["clone","dispose"],"zimContainer",!1),e.TextInput=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X){var R,H="width, height, placeholder, text, size, font, color, backgroundColor, borderColor, borderWidth, maxLength, password, selectionColor, selectionAlpha, cursorColor, cursorSpeed, shadowColor, shadowBlur, align, corner, padding, paddingHorizontal, paddingVertical, shiftHorizontal, shiftVertical, multiline, wrap, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, number, inputType, rtl, style, group, inherit";if(R=zob(e.TextInput,arguments,H,this))return R;z_d("54.2"),this.group=Y;var F=!1===_?{}:e.getStyle("TextInput",this.group,X);zot(i)&&(i=null!=F.size?F.size:36),(zot(w)||"ignore"==w)&&(w=null!=F.padding&&"ignore"!=w?F.padding:5),zot(C)&&(C=null!=F.paddingHorizontal?F.paddingHorizontal:w),zot(x)&&(x=null!=F.paddingVertical?F.paddingVertical:w),zot(t)&&(t=null!=F.width?F.width:300),zot(o)&&(o=null!=F.height?F.height:i+2*x),zot(n)&&(n=null!=F.placeholder?F.placeholder:null),zot(r)&&(r=null!=F.text?F.text:""),zot(a)&&(a=null!=F.font?F.font:"arial"),zot(l)&&(l=null!=F.color?F.color:e.dark),zot(s)&&(s=null!=F.backgroundColor?F.backgroundColor:e.lighter),zot(c)&&(c=null!=F.borderColor?F.borderColor:null),zot(u)&&(u=null!=F.borderWidth?F.borderWidth:null);var N=V(t,o,n,r,l,s,c);function V(){return arguments}t=e.Pick.choose(t),o=e.Pick.choose(o),n=e.Pick.choose(n),r=e.Pick.choose(r),l=e.Pick.choose(l),s=e.Pick.choose(s),c=e.Pick.choose(c),zot(g)&&(g=null!=F.selectionColor?F.selectionColor:l),zot(p)&&(p=null!=F.selectionAlpha?F.selectionAlpha:.2),zot(f)&&(f=null!=F.cursorColor?F.cursorColor:l),zot(m)&&(m=null!=F.cursorSpeed?F.cursorSpeed:.5),zot(z)&&(z=null!=F.shadowColor?F.shadowColor:"rgba(0,0,0,.3)"),zot(y)&&(y=null!=F.shadowBlur?F.shadowBlur:20),zot(v)&&(v=null!=F.align?F.align:"left"),zot(b)&&(b=null!=F.corner?F.corner:0),zot(k)&&(k=null!=F.shiftHorizontal?F.shiftHorizontal:0),zot(h)&&(h=null!=F.password&&F.password),zot(T)&&(T=null!=F.shiftVertical?F.shiftVertical:h?.25*i:0),zot(d)&&(d=null!=F.maxLength?F.maxLength:"center"==v?1.8*Math.floor(t/i):null),zot(A)&&(A=null!=F.multiline&&F.multiline),zot(P)&&(P=null!=F.wrap&&F.wrap),zot(B)&&(B=null!=F.scrollBarActive&&F.scrollBarActive),zot(E)&&(E=null!=F.scrollBarDrag&&F.scrollBarDrag),zot(I)&&(I=null!=F.scrollBarColor?F.scrollBarColor:c),zot(S)&&(S=null!=F.scrollBarAlpha?F.scrollBarAlpha:.3),zot(W)&&(W=null==F.scrollBarFade||F.scrollBarFade),zot(M)&&(M=null==F.scrollBarH||F.scrollBarH),zot(O)&&(O=null==F.scrollBarV||F.scrollBarV),j&&zot(L)&&(L="number"),zot(L)&&(L=null!=F.inputType?F.inputType:"text"),!0===L&&(L="number"),E&&(W=null!=F.scrollBarFade&&F.scrollBarFade),zot(D)&&(D=null!=F.rtl?F.rtl:"rtl"==WW.DIR||"rtl"==e.DIR?"rtl":null),this.zimWindow_constructor(t,o,null,s,c,u,w,b,!1,B,E,I,S,W,M,O,!1,null,!1,!0,z,y,C,x,!0,null,null,null,null,null,!1,null,null,null,null,null,null,null,null,null,null,null,null,_,Y,e.copy(F)),this.type="TextInput";var G=this;this.placeholderLabel=new e.Label({text:n||"",size:i,color:l,font:a,shiftHorizontal:k,shiftVertical:T,valign:"top"}).alp(.5),""==r&&this.add(this.placeholderLabel);var q=new e.Rectangle({width:t-2*w,height:o-2*w,color:e.clear,style:!1}).center(this);this.cursor="text";var U=this.label=new e.TextInput.LabelInput(r,i,d,h,g,p,f,m,a,l,null,null,null,v,"top",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,k,T,null,null,null,null,L,D,_,Y,X);this.add(U),U.setMask(q),this.htmlTag=this.label.hiddenInput,this.selection=this.label.selection,this.blinker=this.label.blinker,"right"==v?(U.x=t-C,this.placeholderLabel.x=t-this.placeholderLabel.width-C):"center"==v&&(U.x=t/2,this.placeholderLabel.x=(t-this.placeholderLabel.width)/2);var Q=new e.Rectangle({width:w,height:o,color:e.clear,style:!1}).addTo(this).expand(0);Q.on("mousedown",(function(e){U.onMousedown(e),e.stopImmediatePropagation()})),Q.on("pressmove",(function(e){U.onPressmove(e),e.stopImmediatePropagation()})),Q.on("dblclick",(function(e){U.onDblclick(e),e.stopImmediatePropagation()}));var Z=new e.Rectangle({width:w,height:o,color:e.clear,style:!1}).pos(0,0,e.RIGHT,e.TOP,this).expand(0);Z.on("mousedown",(function(e){U.onMousedown(e),e.stopImmediatePropagation()})),Z.on("pressmove",(function(e){U.onPressmove(e),e.stopImmediatePropagation()})),Z.on("dblclick",(function(e){U.onDblclick(e),e.stopImmediatePropagation()}));var K="";this.on("mousedown",(function(e){U.onMousedown(e),K=U.text})),this.on("pressmove",(function(e){U.onPressmove(e),e.stopImmediatePropagation()})),this.on("dblclick",(function(e){U.onDblclick(e),e.stopImmediatePropagation()})),this.added((function(e){e.on("stagemousedown",(function(e){G.hitTestPoint(e.stageX,e.stageY)||(U.focus=!1,U.text!=K&&G.dispatchEvent("change"),K=U.text)}))})),this.label.on("focus",(function(){G.dispatchEvent("focus")})),this.label.on("blur",(function(){G.dispatchEvent("blur")})),this.label.on("input",(function(){""!=U.text&&G.placeholderLabel.parent&&(G.placeholderLabel.removeFrom(),G.stage&&G.stage.update()),""!=U.text||G.placeholderLabel.parent||(G.add(G.placeholderLabel),G.stage&&G.stage.update()),G.dispatchEvent("input")})),this.label.on("keydown",(function(){G.dispatchEvent("keydown")})),this.label.on("blinker",(function(){var o=U.x+U.blinker.x,n=e.constrain(o,C,t-C-U.blinker.width);o!=n&&(U.x-=o-n),G.stage&&G.stage.update()})),Object.defineProperty(G,"text",{get:function(){return U.hiddenInput.value},set:function(t){U.setText(t),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!G.stage||G.stage.update()}}),Object.defineProperty(G,"focus",{get:function(){return U.focus},set:function(e){U.focus=e}}),Object.defineProperty(G,"color",{get:function(){return U.color},set:function(t){U.color=latestColor=t,e.OPTIMIZE||!zns&&WW.OPTIMIZE||!G.stage||G.stage.update()}}),Object.defineProperty(G,"size",{get:function(){return U.size},set:function(t){U.size=t,U.hiddenInput.style.fontSize=t+"px",e.OPTIMIZE||!zns&&WW.OPTIMIZE||!G.stage||G.stage.update()}}),Object.defineProperty(G,"align",{get:function(){return U.align},set:function(o){v=U.align=o,U.x="right"==v?t-U.width:"center"==v?t/2:0,e.OPTIMIZE||!zns&&WW.OPTIMIZE||!G.stage||G.stage.update()}}),Object.defineProperty(G,"font",{get:function(){return U.font},set:function(t){U.font=t,e.OPTIMIZE||!zns&&WW.OPTIMIZE||!G.stage||G.stage.update()}}),Object.defineProperty(G,"selectionAlpha",{get:function(){return U.selectionAlpha},set:function(t){U.selectionAlpha=t,0!=U.selection.alpha&&(U.selection.alpha=t),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!G.stage||G.stage.update()}}),e.styleTransforms(this,F),this.clone=function(j){return G.cloneProps(j||!e.isPick(N[0])?t:N[0],j||!e.isPick(N[1])?o:N[1],j||!e.isPick(N[2])?n:N[2],j||!e.isPick(N[3])?r:N[3],i,a,j||!e.isPick(N[4])?l:N[4],j||!e.isPick(N[5])?s:N[5],j||!e.isPick(N[6])?c:N[6],u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,L,_,this.group,X)}},e.extend(e.TextInput,e.Window,"clone","zimWindow",!1),e.TextInput.LabelInput=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H){this.zimLabel_constructor(t,o,c,u,null,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,null,j,L,null,D,X,R,H),this.type="LabelInput",zot(u)&&(u=e.dark),zot(i)&&(i=u),zot(a)&&(a=.2),this.selectionAlpha=a,zot(l)&&(l=u),zot(s)&&(s=.5),this.hiddenInput=document.createElement("INPUT"),this.hiddenInput.value=t,"text"==_&&r&&(_="password"),this.hiddenInput.type=_,"number"==_&&(this.hiddenInput.pattern="[^(0-9).-+*/%$]*",this.hiddenInput.inputmode="numeric"),n>0&&(this.hiddenInput.maxLength=n),this.hiddenInput.autocapitalize="off",this.hiddenInput.autocorrect="off",this.hiddenInput.autocomplete="off",this.hiddenInput.spellcheck=!1,this.hiddenInput.style.position="absolute",this.hiddenInput.style.overflow="hidden",this.hiddenInput.style.touchAction="none",this.hiddenInput.style.left="-99999px",this.hiddenInput.style.top="-99999px",this.hiddenInput.style.zIndex=-999,this.hiddenInput.style.opacity=0,this.hiddenInput.style.width="1px",this.hiddenInput.style.height="1px",this.hiddenInput.style.fontSize="1px",this.onFocus=function(){this.stage&&(F=this.stage.frame),F.zil&&WW.removeEventListener("keydown",F.zil[0]),this.blinker.alp(1).replayTween(),this.selection.alp(.2),this.positionBlinkerAndSelection(),this.dispatchEvent("focus")},this.onBlur=function(){this.stage&&(F=this.stage.frame),F.zil&&WW.addEventListener("keydown",F.zil[0]),this.positionBlinkerAndSelection(),this.blinker.pauseAnimate(!0).alp(0),this.selection.alp(0),this.hiddenInput.type=_,this.dispatchEvent("blur")},this.onInput=function(){var e=this.hiddenInput.value;"number"==_&&(e=e.replace(/[^(0-9).\-+*/%$]*/g,""),this.hiddenInput.value=e),this.text="password"==this.hiddenInput.type?e.replace(/./g,"*"):e,this.measureText(),this.positionBlinkerAndSelection(),this.dispatchEvent("input")},this.onSelect=function(){this.positionBlinkerAndSelection(),this.focus&&this.blinker.replayTween()};var F,N=this;this.onKeydown=function(){this.blinker.replayTween(),setTimeout((function(){N.positionBlinkerAndSelection.call(N),N.dispatchEvent("keydown")}),10)},this.onMousedown=function(e){var t=this.text.length,o=this.eventPositionGlobalToLocal(e);this.focus||(this.hiddenInput.focus(),"number"!=_&&"email"!=_||(this.hiddenInput.type="text"));var n=this.mapPointToIndex(o);Y?this.hiddenInput.setSelectionRange(t-n,t-n):this.hiddenInput.setSelectionRange(n,n),this.positionBlinkerAndSelection()},this.onPressmove=function(e){var t=this.text.length;this.focus||this.hiddenInput.focus();var o,n=this.eventPositionGlobalToLocal(e);o=Y?t-this.mapPointToIndex(n):this.mapPointToIndex(n),this.hiddenInput.selectionStart===this.hiddenInput.selectionEnd?this.hiddenInput.selectionStart<=o?this.hiddenInput.setSelectionRange(this.hiddenInput.selectionStart,o,Y?"backward":"forward"):this.hiddenInput.setSelectionRange(o,this.hiddenInput.selectionEnd,Y?"forward":"backward"):this.hiddenInput.selectionDirection===(Y?"backward":"forward")?this.hiddenInput.setSelectionRange(this.hiddenInput.selectionStart,o,Y?"backward":"forward"):this.hiddenInput.setSelectionRange(o,this.hiddenInput.selectionEnd,Y?"forward":"backward"),this.positionBlinkerAndSelection()},this.onDblclick=function(){this.hiddenInput.select(),this.positionBlinkerAndSelection()},this.positionBlinkerAndSelection=function(){var e=this.text.length;if(this.focus){var t,o,n=this.backing||this.background?this.paddingHorizontal:0,r=this.backing||this.background?this.paddingVertical:0;if(this.hiddenInput.selectionStart!==this.hiddenInput.selectionEnd)Y?(t=this.textWidthArray[e-this.hiddenInput.selectionStart],o=this.textWidthArray[e-this.hiddenInput.selectionEnd],this.selection.widthOnly=o-t,this.selection.pos(o+n-1+W,r+M)):(t=this.textWidthArray[this.hiddenInput.selectionStart],o=this.textWidthArray[this.hiddenInput.selectionEnd],this.selection.widthOnly=o-t,this.selection.pos(t+n-1+W,r+M)),this.selection.heightOnly=this.textHeight,this.selection.alp(this.selectionAlpha);else this.selection.alp(0);this.blinker.heightOnly=this.textHeight;var i="backward"===this.hiddenInput.selectionDirection?this.hiddenInput.selectionStart:this.hiddenInput.selectionEnd;i||(i=0),Y&&(i=e-i),this.blinker.pos(this.textWidthArray[i]+n-1+("right"==p&&""==this.text?this.width:"center"==p&&""==this.text?this.width/2:0)+W,r+M),this.dispatchEvent("blinker")}this.stage&&this.stage.update()},this.eventPositionGlobalToLocal=function(t){var o=this.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY);return o.x-="right"==p?this.label.x-this.width:"center"==p?(this.label.x-this.width)/2:this.label.x,o.y-=this.label.y,o},this.mapPointToIndex=function(e){for(var t=this.textWidthArray.length-1,o=0;o<this.textWidthArray.length-1;o++){var n=(this.textWidthArray[o]+this.textWidthArray[o+1])/2;if(e.x<=n){t=o;break}}return t},this.measureText=function(){var e=this.label.clone(),t=this.text;Y&&(t=t.split("").reverse().join(""));for(var o=0;o<t.length&&o<this.previousMeasuredText.length&&t[o]===this.previousMeasuredText[o];)o++;for(this.textWidthArray=this.textWidthArray.slice(0,o+1),o++;o<=t.length;o++)e.text=t.slice(0,o),this.textWidthArray.push(e.getMeasuredWidth());this.previousMeasuredText=t,this.textHeight=e.getMeasuredLineHeight()},this.setText=function(e){this.hiddenInput.value=e,this.onInput()},Object.defineProperty(this,"focus",{get:function(){return document.activeElement===N.hiddenInput},set:function(e){!0===e?N.hiddenInput.focus():N.hiddenInput.blur()}}),this.added((function(e){F=e.frame,N.hiddenInput.addEventListener("focus",N.onFocus.bind(N)),N.hiddenInput.addEventListener("blur",N.onBlur.bind(N))})),this.hiddenInput.addEventListener("input",this.onInput.bind(this)),this.hiddenInput.addEventListener("select",this.onSelect.bind(this)),this.hiddenInput.addEventListener("keydown",this.onKeydown.bind(this)),document.body.appendChild(this.hiddenInput),this.on("mousedown",this.onMousedown.bind(this)),this.on("pressmove",this.onPressmove.bind(this)),this.on("dblclick",this.onDblclick.bind(this)),this.cursor="text",this.blinker=new e.Rectangle({width:2,height:1,color:l,style:!1}).animate({obj:{alpha:0},wait:s,time:.1,rewind:!0,rewindWait:s,loop:!0,loopWait:s}).pauseAnimate(!0).alp(0).addTo(this),this.selection=new e.Rectangle({width:1,height:1,color:i,style:!1}).alp(0).addTo(this),this.textWidthArray=[0],this.previousMeasuredText="",this.textHeight=null,this.measureText()},e.extend(e.TextInput.LabelInput,e.Label,null,"zimLabel",!1),e.List=function(n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q,U,Q,Z,K,J,$,ee,te,oe,ne,re,ie,ae,le,se,ce,ue,de,he,ge,pe,fe,me,ze,ye,ve,be){var we,Ce="width, height, list, viewNum, vertical, currentSelected, align, valign, labelAlign, labelValign, labelIndent, labelIndentHorizontal, labelIndentVertical, indent, spacing, backgroundColor, rollBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, selectedColor, selectedRollColor, borderColor, borderWidth, padding, corner, swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, scrollBarOverlay, slide, slideDamp, slideSnap, shadowColor, shadowBlur, paddingHorizontal, paddingVertical, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, collapse, collapseColor, collapsed, excludeCustomTap, organizer, checkBox, pulldown, clone, cancelCurrentDrag, selectedIndex, noScale, pulldownToggle, optimize, keyEnabled, style, group, inherit";if(we=zob(e.List,arguments,Ce,this))return we;z_d("60.5"),this.group=ve;var xe=!1===ye?{}:e.getStyle("List",this.group,be);zot(n)&&(n=null!=xe.width?xe.width:300);var ke=r;zot(r)&&(r=null!=xe.height?xe.height:zot(se)?200:200+se.height),zot(i)&&(i=i=null!=xe.list?xe.list:["Option 1","Option 2","Option 3","Option 4","Option 5","Option 6","Option 7","Option 8","Option 9","Option 10"]),0==i.length&&(i=["%-&"]),this.originalList=i,zot(a)&&(a=null!=xe.viewNum?xe.viewNum:5),zot(l)&&(l=null==xe.vertical||xe.vertical),zot(s)&&(s=null==xe.currentSelected||xe.currentSelected);var Te=!zot(c)||!zot(d);zot(ce)&&(ce=null!=xe.checkBox&&xe.checkBox),zot(c)&&(c=null!=xe.align?xe.align:ce?"left":"center"),zot(u)&&(u=null!=xe.valign?xe.valign:"center"),zot(d)&&(d=null!=xe.labelAlign?xe.labelAlign:c),zot(h)&&(h=null!=xe.labelValign?xe.labelValign:u),zot(m)&&(m=null!=xe.indent?xe.indent:ce?0:10),zot(g)&&(g=null!=xe.labelIndent?xe.labelIndent:m),zot(p)&&(p=null!=xe.labelIndentHorizontal?xe.labelIndentHorizontal:g),zot(f)&&(f=null!=xe.labelIndentVertical?xe.labelIndentVertical:g),zot(z)&&(z=null!=xe.spacing?xe.spacing:2),zot(C)&&(C=null!=xe.backdropColor?xe.backdropColor:"#333"),zot(y)&&(y=null!=xe.backgroundColor?xe.backgroundColor:"#777"),zot(v)&&(v=null!=xe.rollBackgroundColor?xe.rollBackgroundColor:"#555"),zot(b)&&(b=null!=xe.selectedBackgroundColor?xe.selectedBackgroundColor:"#444"),zot(w)&&(w=null!=xe.selectedRollBackgroundColor?xe.selectedRollBackgroundColor:"#555"),zot(x)&&(x=null!=xe.color?xe.color:"white"),zot(k)&&(k=null!=xe.rollColor?xe.rollColor:x),zot(T)&&(T=null!=xe.selectedColor?xe.selectedColor:x),zot(A)&&(A=null!=xe.selectedRollColor?xe.selectedRollColor:k),zot(C)&&(C=null!=xe.backdropColor?xe.backdropColor:C);var Ae=P,Pe=B;zot(P)&&(P=null!=xe.borderColor?xe.borderColor:"#999"),zot(B)&&(B=null!=xe.borderWidth?xe.borderWidth:1),zot(E)&&(E=null!=xe.padding?xe.padding:z),zot(I)&&(I=null!=xe.corner?xe.corner:0),zot(S)&&(S=null==xe.swipe||xe.swipe),zot(W)&&(W=null==xe.scrollBarActive||xe.scrollBarActive),zot(M)&&(M=null==xe.scrollBarDrag||xe.scrollBarDrag),zot(O)&&(O=null!=xe.scrollBarColor?xe.scrollBarColor:P),zot(j)&&(j=null!=xe.scrollBarAlpha?xe.scrollBarAlpha:.3),zot(L)&&(L=null==xe.scrollBarFade||xe.scrollBarFade),zot(D)&&(D=null!=xe.scrollBarH?xe.scrollBarH:!l),zot(_)&&(_=null!=xe.scrollBarV?xe.scrollBarV:l),M&&(L=null!=xe.scrollBarFade&&xe.scrollBarFade),zot(Y)&&(Y=null==xe.scrollBarOverlay||xe.scrollBarOverlay),zot(X)&&(X=null==xe.slide||xe.slide),zot(R)&&(R=null!=xe.slideDamp?xe.slideDamp:.6),zot(H)&&(H=null!=xe.slideSnap?xe.slideSnap:l?"vertical":"horizontal"),zot(F)&&(F=null!=xe.shadowColor?xe.shadowColor:"rgba(0,0,0,.3)"),zot(N)&&(N=null!=xe.shadowBlur?xe.shadowBlur:20),zot(G)&&(G=null!=xe.paddingVertical?xe.paddingVertical:E),zot(V)&&(V=null!=xe.paddingHorizontal?xe.paddingHorizontal:E),zot(q)&&(q=null==xe.scrollWheel||xe.scrollWheel),zot(Q)&&(Q=null!=xe.titleBar?xe.titleBar:null),zot(Z)&&(Z=null!=xe.titleBarColor?xe.titleBarColor:null),zot(K)&&(K=null!=xe.titleBarBackgroundColor?xe.titleBarBackgroundColor:null),zot(J)&&(J=null!=xe.titleBarHeight?xe.titleBarHeight:35),zot($)&&($=null!=xe.draggable?xe.draggable:null),zot(ee)&&(ee=null!=xe.boundary?xe.boundary:null),zot(te)&&(te=null!=xe.onTop?xe.onTop:null),zot(oe)&&(oe=null!=xe.close?xe.close:null),zot(ne)&&(ne=null!=xe.closeColor?xe.closeColor:null),zot(re)&&(re=null!=xe.collapse?xe.collapse:null),zot(ie)&&(ie=null!=xe.collapseColor?xe.collapseColor:null),zot(le)&&(le=null!=xe.excludeCustomTap&&xe.excludeCustomTap),zot(ce)&&(ce=null!=xe.checkBox&&xe.checkBox),zot(ue)&&(ue=null!=xe.pulldown&&xe.pulldown),zot(fe)&&(fe=null!=xe.pulldownToggle&&xe.pulldownToggle),zot(pe)&&(pe=null!=xe.noScale&&xe.noScale),zot(de)&&(de=null!=xe.clone&&xe.clone),zot(me)&&(me=null==xe.optimize||xe.optimize),zot(ze)&&(ze=null!=xe.keyEnabled?xe.keyEnabled:null),!1===Q&&(Q=null),this.vertical=l;var Be=this,Ee=r;WW.DIR&&"rtl"==WW.DIR||!WW.DIR&&"rtl"==e.DIR?"start"==c?c="right":"end"==c&&(c="left"):"start"==c?c="left":"end"==c&&(c="right"),ce&&e.loop(i,(function(t,o){i[o]=e.List.checkItem(t,null,n,"left",10,10,z,x,k,T,A,y,v,b,w)}));var Ie,Se=t();if(i.constructor=={}.constructor){var We=zot(i.shade)?zot(xe.shade)?.2:xe.shade:i.shade,Me=zot(i.dim)?zot(xe.dim)?.1:xe.dim:i.dim,Oe=zot(i.shift)?zot(xe.shift)?15:xe.shift:i.shift,je=zot(i.bloom)?!zot(xe.bloom)&&xe.bloom:i.bloom,Le=zot(i.whither)?!zot(xe.whither)&&xe.whither:i.whither,De=zot(i.open)?!zot(xe.open)&&xe.open:i.open,_e=zot(i.expander)?zot(xe.expander)?"plus":xe.expander:i.expander;"arrows"==(_e=_e.toLowerCase())&&(_e="arrow"),"none"!=_e&&"arrow"!=_e&&(_e="plus"),!0===je&&(je="s"==Se?.01:10),!0===Le&&(Le="s"==Se?.01:10),o(je),o(Le),!0===Oe&&(Oe=15),!0===We&&(We=.2),!0===Me&&(Me=.1);var Ye=zot(i.subStyles)?zot(xe.subStyles)?{}:xe.subStyles:i.subStyles;zot(i.menu)||(i=i.menu),Ie=Be.tree=new e.Hierarchy(i),i=Ie.getLinearList(),Te||(c=d="left")}ue&&(a=zot(Ie)?i.length:Ie.length,zot(ke)&&(r=a*n/620*100+(a+1)*z+(zot(Q)?0:J)),B=0,b=y,C=e.clear,S=!1);var Xe,Re=0,He=0;e.loop(i,(function(e){"ListItem"==e.type&&(e.width=n-2*z),pe&&(e.width&&(Re+=e.width),e.height&&(He+=e.height))})),Re&&(Re+=z*(i.length-1)),He&&(He+=z*(i.length-1)),this.align=c,this.valign=u,this.indent=m,zot(se)||(r-=se.height,se.list=Be,Be.organizer=se,se.setButtons(),J+=se.height),this.zimWindow_constructor(n,r,null,C,P,B,E,I,S,W,M,O,j,L,D,_,X,R,H,!0,F,N,V,G,q,U,Q,Z,K,J,$,ee,te,oe,ne,he,!1,null,!1,re,ie,ae,me,ye,ve,e.copy(xe)),this.type="List",zot(Q)||(this.titleBarLabel.pos(null,J-30,null,!0),zot(J)&&(J=30),r-=J),zot(se)||se.addTo(Be).loc(0,-se.height),Re&&pe?(Be.itemWidth=l?n-2*V-(W?Y?0:6:0):Re/i.length,Be.itemHeight=l?He/i.length:r-2*G-(W?Y?0:6:0)):(Be.itemWidth=l?n-2*V-(W?Y?0:6:0):(n-2*V)/a,Be.itemHeight=l?(r-2*G)/a:r-2*G-(W?Y?0:6:0));var Fe,Ne,Ve,Ge=e.copy(xe);function qe(t){Xe=Be.tabs=new e.Tabs({width:l?Be.itemWidth:Be.itemWidth*i.length,height:l?Be.itemHeight*i.length:Be.itemHeight,tabs:t,spacing:z,vertical:l,backgroundColor:y,rollBackgroundColor:v,selectedBackgroundColor:b,selectedRollBackgroundColor:w,color:x,rollColor:k,selectedColor:T,selectedRollColor:A,backdropColor:C,currentEnabled:!0,currentSelected:s,align:c,valign:u,labelAlign:d,labelValign:h,labelIndent:g,labelIndentHorizontal:p,labelIndentVertical:f,indent:m,useTap:!0,excludeCustomTap:le,keyWrap:!1,keyEnabled:ze,style:ye,group:ve,inherit:Ge}).mov(l?0:V,l?G:0),Be.add(Xe),e.loop(Xe.labels,(function(t){t&&(t.backgroundColor=e.clear)}))}function Ue(t,o,n){t.listZID=o,t.label&&(We&&new e.Rectangle(Oe*(n.level+1),t.height).alp(We).pos(0,0,"right"==Be.align,!1,t),Me&&new e.Rectangle(t.width,t.height).alp((n.level+1)*Me).addTo(t).bot().ord(1),Oe&&"center"!=Be.align&&(t.label.x+=("right"==Be.align?-1:1)*Oe*(n.level+1)));var r=Ie.getData(o);r.obj=t,r.list&&!e.isEmpty(r.list)&&(t.expander=new e.Label({size:"arrow"==_e?22:36,text:r.open?"arrow"==_e?"▲":"-":"arrow"==_e?"▼":"+",align:"center",color:e.convertColor(x,"rgba",.6)}).center(t).alp("none"==_e?0:.7).pos(15,null,"right"!=Be.align).mov(0,r.open?-3:0))}function Qe(){if(Be.selected.expander){var t,o=Ie.getData(Be.selected.listZID);if(o.open){Be.selected.expander&&(Be.selected.expander.text="arrow"==_e?"▼":"+",Be.selected.expander.mov(0,3)),o.open=!1;var n,r=Ie.getNextSibling(Be.selected.listZID);n=zot(r)?Be.items.length-1:e.loop(Be.items,(function(e,t){if(e.listZID==r)return t-1})),Le?(t=0,Be.enabled=!1,e.interval(Le,(function(e){Be.removeAt(1,Be.selectedIndex+n-Be.selectedIndex-t),t++,e.total==e.count+1&&(Be.enabled=!0,Be.dispatchEvent("collapsed"))}),n-Be.selectedIndex,!0)):(Be.removeAt(n-Be.selectedIndex,Be.selectedIndex+1),Be.dispatchEvent("collapsed"))}else{o.open=!0,Be.selected.expander&&(Be.selected.expander.text="arrow"==_e?"▲":"-",Be.selected.expander.mov(0,-3));var i,a=Ie.getLinearList(o.list),l=Ie.getLinearIDs(o.list);if(o.opened)Array.isArray(a)&&(je?(t=0,Be.enabled=!1,e.interval(je,(function(e){Be.addAt(a[t],Be.selectedIndex+1+t),(i=new createjs.Event("bloom")).item=a[t],Be.dispatchEvent(i),e.total==e.count+1&&(Be.enabled=!0,(i=new createjs.Event("expanded")).items=a,Be.dispatchEvent(i)),t++}),a.length,!0)):(Be.addAt(a,Be.selectedIndex+1),(i=new createjs.Event("expanded")).items=a,Be.dispatchEvent(i)));else{o.opened=!0;var s=Ye[o.level];zot(s)&&(s={}),Array.isArray(a)&&(je?(t=0,Be.enabled=!1,e.interval(je,(function(n){Be.addAt(a[t],Be.selectedIndex+1+t,{backgroundColor:s.backgroundColor,color:s.color,rollBackgroundColor:s.rollBackgroundColor,rollColor:s.rollColor,selectedBackgroundColor:s.selectedBackgroundColor,selectedColor:s.selectedColor,selectedRollBackgroundColor:s.selectedRollBackgroundColor,selectedRollColor:s.selectedRollColor});var r=l[t],c=Be.items[Be.selectedIndex+1+t];s.borderColor&&(c.borderColor=s.borderColor),Ue(c,r,o),c.label&&(c.label.backgroundColor=e.clear),(i=new createjs.Event("bloom")).item=c,Be.dispatchEvent(i),n.total==n.count+1&&(Be.enabled=!0,(i=new createjs.Event("expanded")).items=a,Be.dispatchEvent(i)),t++,Be.stage&&Be.stage.update()}),a.length,!0)):(Be.addAt(a,Be.selectedIndex+1,{backgroundColor:s.backgroundColor,color:s.color,rollBackgroundColor:s.rollBackgroundColor,rollColor:s.rollColor,selectedBackgroundColor:s.selectedBackgroundColor,selectedColor:s.selectedColor,selectedRollBackgroundColor:s.selectedRollBackgroundColor,selectedRollColor:s.selectedRollColor}),e.loop(l,(function(t,n){var r=Be.items[Be.selectedIndex+1+n];Ue(r,t,o),r.label&&(r.label.backgroundColor=e.clear)})),(i=new createjs.Event("expanded")).items=a,Be.dispatchEvent(i)))}}}}if(delete Ge.borderWidth,delete Ge.borderColor,qe(e.copy(i,de)),Be.expandList=function(e){return Be.selectedIndex=e,Be.selected&&Qe(),Be.selected},Ie){fe&&Be.added((function(e){Fe=e,Be.stageToggleEvent=Fe.on("stagemousedown",(function(){var e=Fe.getObjectUnderPoint(Fe.frame.mouseX,Fe.frame.mouseY);e&&Be.contains(e)||Be.enabled&&Be.selected&&Ie.getData(Be.selected.listZID).open&&Qe()}))}));var Ze=Ie.getLinearIDs();e.loop(Ze,(function(e,t){Be.tabs.buttons[t].listZID=e})),e.loop(Be.tabs.buttons,(function(t){var o=Ie.getData(t.listZID);e.isEmpty(o.list)||(t.expander=new e.Label({size:"arrow"==_e?22:36,text:"arrow"==_e?"▼":"+",align:"center",color:e.convertColor(x,"rgba",.6)}).center(t).alp("none"==_e?0:.7).pos(15,null,"right"!=Be.align))}));var Ke=De;Be.toggle=function(e){if(zot(e))e=!Ke;else if(e==Ke)return;Be.selectedIndex=0,Ke=e,Qe()},Object.defineProperty(Be,"toggled",{get:function(){return Ke},set:function(e){Ke!=e&&Be.toggle()}}),Be.tap(Qe)}function Je(e){if(l){var t=-(Be.itemHeight+z)*e+r/2-Be.itemHeight/2;return(Be.itemHeight+z)*Be.length<r&&(t=0),t>0&&(t=0),(Be.itemHeight+z)*Be.length>r&&t<-Be.tabs.height+r-2*G&&(t=-Be.tabs.height+r-2*G),t}var o=-(Be.itemWidth+z)*e+n/2-Be.itemWidth/2;return(Be.itemWidth+z)*Be.length<n&&(o=0),o>0&&(o=0),(Be.itemWidth+z)*Be.length>n&&o<-Be.tabs.width+n-2*V&&(o=-Be.tabs.width+n-2*V),o}Xe.tap((function(e){e.target.selectedIndex!=Be.selectedIndex&&(Be.selectedIndex=Xe.selectedIndex,Be.dispatchEvent("change"),fe&&(Be.selectedIndex=0),e.preventDefault())})),Xe.on("keychange",(function(e){var t;e.target.selectedIndex!=Be.selectedIndex&&(Be.selectedIndex=Xe.selectedIndex,setTimeout((function(){l?((t=Be.selected.y+Be.scrollY)<0||t>Be.height-Be.selected.height)&&Be.animateTo(Be.selectedIndex,"ms"==Se?100:.1):((t=Be.selected.x+Be.scrollX)<0||t>Be.width-Be.selected.width)&&Be.animateTo(Be.selectedIndex,"ms"==Se?100:.1)}),100),Be.dispatchEvent("change"))})),this.getItemIndex=function(e){return Be.items.indexOf(e)},this.animateTo=function(e,o){zot(e)&&(e=0),zot(o)&&(o=.05);var n=t(o);Be.selectedIndex=e;var r,i=Je(e);return l?(r=Math.abs(Be.scrollY-i)/Be.itemHeight,Be.animate({scrollY:i},r*o/("s"==n?1:1e3))):(r=Math.abs(Be.scrollX-i)/Be.itemWidth,Be.animate({scrollX:i},r*o/("s"==n?1:1e3))),Be},this.addAt=function(t,o,r,i){if(zot(t))return Be;if(Be.tabs.loop((function(e){e.visible=!0})),"ListItem"==t.type?t.width=n-2*z:Array.isArray(t)&&e.loop(t,(function(e){"ListItem"==e.type&&(e.width=n-2*z)})),i)if(Array.isArray(t)){var a=[];e.loop(t,(function(o){o.clone?a.push(t.clone()):a.push(e.copy(t,i))})),Be.tabs.addAt(a,o,r)}else t.clone?Be.tabs.addAt(t.clone(),o,r):Be.tabs.addAt(e.copy(t,i),o,r);else Be.tabs.addAt(t,o,r);return Be.update(),Be},this.removeAt=function(e,t){Be.tabs.removeAt(e,t),Be.tabs.loop((function(e){e.visible=!0})),Ne=Be.tabs.selectedIndex;var o=Xe.getBounds();return Xe.setBounds(0,0,o.width,o.height),o.height<r&&(Be.scrollY=0),Be.update(),Be},"%-&"==i[0]&&1==i.length&&Be.removeAt(1,0),this.clear=function(){return Be.tabs.removeAt(Be.length,0),Be.contentContainer.x=0,Be.contentContainer.y=0,Be.update(),Be},this.setCheck=function(e,t){zot(e)&&(e=0),zot(t)&&(t=!0),Be.items[e].checkBox.checked=t,Be.items[e].content.zimOut()},this.getCheck=function(e){return zot(e)&&(e=0),Be.items[e].checkBox.checked},this.setChecks=function(t){return e.loop(Be.items,(function(e){e.checkBox.checked=t,e.content.zimOut()})),Be},Object.defineProperty(Be,"items",{get:function(){return Be.tabs.buttons},set:function(){zon&&zogy("List() - items is read only - use addAt() and removeAt() to change")}}),Object.defineProperty(Be,"list",{get:function(){return Be.tabs.buttons},set:function(){zon&&zogy("List() - list is read only - use addAt() and removeAt() to change")}}),Object.defineProperty(Be,"length",{get:function(){return Be.tabs.buttons.length},set:function(){zon&&zogy("List() - length is read only")}}),Object.defineProperty(Be,"selectedIndex",{get:function(){return Ne},set:function(t){Xe.selectedIndex=t,Be.label=Xe.label,Be.selected=Xe.selected,Ne=t,e.OPTIMIZE||!zns&&WW.OPTIMIZE||!Be.stage||Be.stage.update()}}),s&&(Be.selectedIndex=0),Object.defineProperty(Be,"selectedIndexPlusPosition",{get:function(){return Ne},set:function(t){Be.selectedIndex=t,Ne=t,l?Be.scrollY=Je(t)-2:Be.scrollX=Je(t),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!Be.stage||Be.stage.update()}}),Object.defineProperty(Be,"text",{get:function(){return Be.label?Be.label.text:null},set:function(e){Be.label&&(Be.label.text=e)}}),Object.defineProperty(Be,"bloom",{get:function(){return je},set:function(e){je=e}}),Object.defineProperty(Be,"currentValue",{get:function(){return Be.label?Be.label.text:null},set:function(t){var o=e.loop(Be.list,(function(e,o){var n;e.label&&(n=e.label.text),"Label"==e.type&&(n=e.text);var r=new RegExp(t,"i");if(n&&n.match(r))return o}));!0!==o&&(Be.selectedIndexPlusPosition=o)}}),Object.defineProperty(Be,"itemDown",{get:function(){return Be.tabs.buttonDown},set:function(){}}),Object.defineProperty(Be,"itemsText",{get:function(){for(var e=[],t=0;t<Be.tabs.buttons.length;t++){var o=Be.tabs.buttons[t].label;o&&!zot(o.text)?e.push(o.text):e.push(null)}return e},set:function(){zon&&zogy("List() - itemsText is read only")}}),s&&(Be.selectedIndex=0),Object.defineProperty(Be,"checkBoxes",{get:function(){for(var e=[],t=0;t<Be.tabs.buttons.length;t++){var o=Be.tabs.buttons[t].checkBox;e.push(o)}return e},set:function(){zon&&zogy("List() - checkBoxes is read only")}}),Object.defineProperty(Be,"accordionIndex",{get:function(){var e=Be.selected.listZID;return e?Number(e.split("id")[1]):null},set:function(){zon&&zogy("List() - accordionIndex is read only")}}),this.last=function(){return this.selectedIndexPlusPosition=this.length-1,this},this.first=function(){return this.selectedIndexPlusPosition=0,this},this.openAtLevel=function(t){if(!zot(t)){var o=[];e.loop(t,(function(e){o.push(e)}));var n=Be.bloom;Be.bloom=!1,e.interval(.01,(function(e){var t=Be.items[e.count];t?-1!=o.indexOf(Be.tree.getData(t.listZID).level)&&Be.expandList(e.count):(e.clear(),Be.bloom=n)}),null,!0,!1,"s")}},this.openAtNum=function(e){if(!zot(e)){if(!Ve){var t;function l(e,o){for(t in e)Ve[t]=o,l(e[t].list,t)}Ve={},l(Be.tree.data);var o={};for(var n in Ve){o[n]||(o[n]=[]);for(var r=Ve[n];r;)o[n].unshift(r),r=Ve[r];o[n].push(n)}}var i=o["id"+e],a=Be.bloom;Be.bloom=!1,interval(.01,(function(e){var t=Be.items[e.count];t?-1!=i.indexOf(t.listZID)&&Be.expandList(e.count):(e.clear(),Be.bloom=a)}),null,!0,!1,"s")}},De&&Qe&&Be.openAtLevel(1e4),zot(ge)&&(ge=null!=xe.selectedIndex?xe.selectedIndex:0),Be.selectedIndex=ge,!1!==ye&&e.styleTransforms(this,xe),this.clone=function(){return Be.cloneProps(new e.List(n,Ee,e.copy(Be.originalList,!0),a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,Ae,Pe,E,e.copy(I),S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q,U,Q,Z,K,J,$,ee,te,oe,ne,re,ie,ae,le,se,ce,ue,de,he,ge,pe,fe,me,ze,ye,this.group,be))},this.dispose=function(e,t,o){return o||(Be.stageToggleEvent&&Fe.off("stagemousedown",Be.stageToggleEvent),Be.organizer&&Be.organizer.dispose(),this.zimWindow_dispose()),!0}},e.extend(e.List,e.Window,["clone","dispose"],"zimWindow",!1),e.List.makeBase=function(t,o,n,r){zot(r)&&(r=e.dark),t.backing=new e.Rectangle(t.width,t.height,r).center(t),"Label"==o.type?t.label=o:t.label=new e.Label(o,null,null,e.white),t.text=t.label.text,t.label.center(t).loc(n)},e.List.slider=function(t,o,n,r,i,a,l,s,c,u,d,h,g){var p,f="label, min, max, val, call, step, obj, property, paddingLeft, paddingRight, factor, offset, backgroundColor";if(p=zob(e.List.slider,arguments,f))return p;var m=new e.Container(620,100);return m.type="ListItem",m.listItem="Slider",zot(c)&&(c=20),zot(u)&&(u=30),zot(d)&&(d=1),zot(h)&&(h=0),e.List.makeBase(m,t,c,g),m.slider=new e.Slider({inside:!0,barWidth:40,barLength:150,barColor:e.blue,min:o,max:n,step:a}).sca(1.5).center(m).mov(20).change((function(){m.stepper.currentValue=h+Math.round(m.slider.currentValue*d),l&&s&&(l[s]=m.slider.currentValue),i&&"function"==typeof i&&i(m.slider.currentValue,m.parent),m.slider.stage&&m.slider.stage.update()})),zot(r)||(m.slider.currentValue=r),m.stepper=new e.Stepper({corner:0,arrows:!1,stepperType:"number",min:h+o*d,max:h+n*d,step:a}).sca(.5).center(m).pos(u,null,!0).change((function(){m.slider.currentValue=m.stepper.currentValue/(d||1)-h,l&&s&&(l[s]=m.slider.currentValue),i&&"function"==typeof i&&i(m.slider.currentValue,m.parent),m.stepper.stage&&m.stepper.stage.update()})),zot(r)||(m.stepper.currentValue=h+r*d),m},e.List.checkBox=function(t,o,n,r,i,a,l,s){var c,u="label, checked, call, obj, property, paddingLeft, paddingRight, backgroundColor";if(c=zob(e.List.checkBox,arguments,u))return c;var d=new e.Container(620,100);return d.type="ListItem",d.listItem="CheckBox",zot(a)&&(a=20),zot(l)&&(l=30),e.List.makeBase(d,t,a,s),d.checkBox=new e.CheckBox({startChecked:o,label:""}).sca(1.2).center(d).pos(256+l,null,!0).change((function(){r&&i&&(r[i]=d.checkBox.checked),n&&"function"==typeof n&&n(d.checkBox.checked,d.parent),d.checkBox.stage&&d.checkBox.stage.update()})),d},e.List.colorPicker=function(t,o,n,r,i,a,l,s,c){var u,d="label, color, picker, call, obj, property, paddingLeft, paddingRight, backgroundColor";if(u=zob(e.List.colorPicker,arguments,d))return u;var h=new e.Container(620,100);return h.type="ListItem",h.listItem="ColorPicker",zot(l)&&(l=20),zot(s)&&(s=30),e.List.makeBase(h,t,l,c),zot(o)&&(o=e.pink),h.colorPicker=n||new e.ColorPicker({alphaPicker:!1,selectedColor:o}),h.swatch=new e.Rectangle(132,66,o,e.lighter,5).center(h).pos(270,null,!0).cur(),h.swatch.on("mousedown",(function(){h.colorPicker.selectedColor=h.swatch.color,h.colorPicker.show()})),h.colorLabel=new e.Label(h.swatch.color.toUpperCase(),40,null,e.light).center(h).pos(s,null,!0),h.colorPicker.on("close",(function(){var e=h.colorPicker.stage;h.colorPicker.hide(),e&&e.update()})),h.colorPicker.on("change",(function(){var e=h.colorPicker.stage;h.swatch.color=h.colorPicker.selectedColor,h.colorLabel.text=h.swatch.color.toUpperCase(),h.colorPicker.hide(),i&&a&&(i[a]=h.colorPicker.selectedColor),r&&"function"==typeof r&&r(h.colorPicker.selectedColor,h.parent),e&&e.update()})),h},e.List.checkItem=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z){var y,v="label, size, width, align, paddingHorizontal, paddingVertical, spacing, color, rollColor, selectedColor, selectedRollColor, backgroundColor, rollBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, group, inherit";if(y=zob(e.List.checkItem,arguments,v))return y;var b=e.getStyle("CheckBox",m,z);zot(o)&&(o=null!=b.size?b.size:20);var w=e.getStyle("List",m,z);zot(n)&&(n=300),zot(i)&&(i=10),zot(a)&&(a=10),zot(r)&&(r=null!=w.align?w.align:"center"),zot(l)&&(l=null!=w.spacing?w.spacing:2),zot(h)&&(h=null!=w.backgroundColor?w.backgroundColor:"#777"),zot(g)&&(g=null!=w.rollBackgroundColor?w.rollBackgroundColor:"#555"),zot(p)&&(p=null!=w.selectedBackgroundColor?w.selectedBackgroundColor:"#444"),zot(f)&&(f=null!=w.selectedRollBackgroundColor?w.selectedRollBackgroundColor:"#555"),zot(s)&&(s=null!=w.color?w.color:"white"),zot(c)&&(c=null!=w.rollColor?w.rollColor:s),zot(u)&&(u=null!=w.selectedColor?w.selectedColor:s),zot(d)&&(d=null!=w.selectedRollColor?w.selectedRollColor:c);var C=new e.Container;return C.type="CheckItem",C.checkBox=new e.CheckBox({size:o,label:t,color:s,tap:!0}),C.backing=new e.Rectangle(n-2*l,C.checkBox.height+2*a,h).addTo(C),C.checkBox.center(C),"center"!=r&&"middle"!=r&&C.checkBox.pos(i,null,"right"==r),C.backing.tap((function(){C.checkBox.toggle(),C.zimOut()})),C.checkBox.change((function(){C.zimOut()})),C.zimOver=function(){C.backing.color=C.checkBox.checked?f:g,C.checkBox.label.color=C.checkBox.checked?d:c,C.stage&&C.stage.update()},C.zimOut=function(){C.backing.color=C.checkBox.checked?p:h,C.checkBox.label.color=C.checkBox.checked?u:s,C.stage&&C.stage.update()},C.backing.on("mouseover",C.zimOver),C.checkBox.on("mouseover",C.zimOver),C.backing.on("mouseout",C.zimOut),C.checkBox.on("mouseout",C.zimOut),C},e.Stepper=function(n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X){var R,H="list, width, backgroundColor, borderColor, borderWidth, label, color, vertical, arrows, corner, shadowColor, shadowBlur, continuous, display, press, hold, holdDelay, holdSpeed, draggable, dragSensitivity, dragRange, stepperType, min, max, step, step2, arrows2, arrows2Scale, keyEnabled, keyArrows, rightForward, downForward, selectedIndex, currentValue, style, group, inherit";if(R=zob(e.Stepper,arguments,H,this))return R;z_d("61"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Stepper",this.group=Y;var F=!1===_?{}:e.getStyle(this.type,this.group,X);zot(n)&&(n=null!=F.list?F.list:[]),zot(i)&&(i=null!=F.width?F.width:200),zot(a)&&(a=null!=F.backgroundColor?F.backgroundColor:"white"),zot(l)&&(l=null!=F.borderColor?F.borderColor:null),zot(s)&&(s=null!=F.borderWidth?F.borderWidth:null),l<0||s<0?l=s=null:null!=l&&null==s&&(s=1),zot(u)&&(u=null!=F.color?F.color:"#555"),zot(c)&&(c=null!=F.label?F.label:""),"string"!=typeof c&&"number"!=typeof c||(c=new e.Label({text:c,size:null!=F.size?2*F.size:64,color:u,align:null!=F.align?F.align:"center",valign:null!=F.valign?F.valign:"center",backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",padding:"ignore",backgroundColor:"ignore",group:this.group})),zot(d)&&(d=null!=F.vertical&&F.vertical),zot(h)&&(h=null==F.arrows||F.arrows),zot(g)&&(g=null!=F.corner?F.corner:16),zot(p)&&(p=null!=F.shadowColor?F.shadowColor:"rgba(0,0,0,.3)"),zot(f)&&(f=null!=F.shadowBlur?F.shadowBlur:14),zot(m)&&(m=null!=F.continuous&&F.continuous),zot(z)&&(z=null==F.display||F.display),zot(y)&&(y=null==F.press||F.press),zot(v)&&(v=null==F.hold||F.hold);var N=t(b);zot(b)&&(b=null!=F.holdDelay?F.holdDelay:"s"==N?.4:400),zot(w)&&(w=null!=F.holdSpeed?F.holdSpeed:"s"==N?.2:200),o(w,N),zot(C)&&(C=null==F.draggable||F.draggable),(zot(x)||x<=0)&&(x=null!=F.dragSensitivity?F.dragSensitivity:.1),zot(k)&&(k=null!=F.dragRange?F.dragRange:200),zot(T)&&(T=null!=F.stepperType?F.stepperType:n.length>0?"list":"number"),zot(A)&&(A=null!=F.min?F.min:0),zot(P)&&(P=null!=F.max?F.max:10),zot(B)&&(B=null!=F.step?F.step:1),zot(E)&&(E=null!=F.step2?F.step2:B),zot(I)&&E!=B&&"number"==T&&(I=null==F.arrows2||F.arrows2),zot(S)&&(S=null!=F.arrows2Scale?F.arrows2Scale:.5),zot(W)&&(W=null==F.keyEnabled||F.keyEnabled),zot(M)&&(M=null==F.keyArrows||F.keyArrows),zot(O)&&(O=null==F.rightForward||F.rightForward),zot(j)&&(j=null!=F.downForward?F.downForward:"number"!=T);var V,G=this,q=100,U=q/4;a=zik(a);var Q,Z,K,J=B,$=1;if("number"==T){if(A=Number(A),P=Number(P),isNaN(A)&&(A=0),isNaN(P)&&(P=100),P<A){$=-1;var ee=P;P=A,A=ee,Q=P}else Q=A;this.min=A,this.max=P,0>A&&0<P&&(Q=0),B=Math.abs(B),Z=Math.max(ne(B),ne(E))}else if("letter"==T){n="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),"string"!=typeof A&&(A="A"),"string"!=typeof P&&(P="Z"),A=A.substr(0,1).toUpperCase(),P=P.substr(0,1).toUpperCase();var te=n.indexOf(A);te<0&&(A="A",te=0);var oe=n.indexOf(P);oe<0&&(P="Z",oe=n.length),oe<te&&(n.reverse(),te=n.length-1-te,oe=n.length-1-oe),n=n.splice(te,oe-te+1)}else T="list";function ne(e){var t=String(e).split(".")[1];return t=t?t.length:0}var re,ie,ae,le,se,ce,ue,de,he,ge,pe,fe,me,ze,ye=0,ve=0;if(C&&this.on("mousedown",(function(t){G.zimAccessibility&&G.zimAccessibility.aria||(this.stage.mouseMoveOutside=!0,ye=t.rawX/e.scaX,ve=t.rawY/e.scaY,K=this.stage.on("stagemousemove",(function(t){ye=t.rawX/e.scaX,ve=t.rawY/e.scaY})))}),null,!0),this.label=c,c.mouseChildren=!1,c.mouseEnabled=!1,h&&(ae=this.containerPrev=new e.Container({style:!1}),this.addChild(ae),le=this.arrowPrev=new e.Triangle(q,.8*q,.8*q,a,null,null,null,null,null,null,null,!1),-1!=p&&f>0&&(ae.shadow=new createjs.Shadow(p,3,3,f)),ae.addChild(le),ae.expand(),ae.cursor="pointer",ae.on("mousedown",(function(t){if(!G.zimAccessibility||!G.zimAccessibility.aria){J=B;var o=d?j?1:-1:O?-1:1;ke(o),Ce(o,null,null,t.stageX/e.scaX,t.stageY/e.scaY)}})),v&&ae.on("pressup",xe),d?(ae.rotation=180,ae.x=i/2,ae.y=z?ae.height+U+q+ae.height/2+U:2*ae.height):(ae.rotation=-90,ae.x=ae.height/2,ae.y=ae.width/2)),z){var be,we=this.textBox=new e.Rectangle(i,q,a,l,s,g,null,null,null,!1);we.cursor="pointer",this.addChild(we),-1!=p&&f>0&&(we.shadow=new createjs.Shadow(p,3,3,f)),h&&(d?h&&(we.y=le.height+U):h&&(we.x=le.height+U)),this.addChild(c),n.length>0&&(V=0,c.text=n[V]),c.center(G),we.on("mousedown",(function(t){G.zimAccessibility&&G.zimAccessibility.aria||(be=G.currentValue,y&&ke(1),Ce(1,!0,null,t.stageX/e.scaX,t.stageY/e.scaY))})),we.on("pressup",(function(){!G.zimAccessibility||G.zimAccessibility.aria}))}else n.length>0&&(V=0);function Ce(t,o,n,r,i){if(v){0==(pe=r)&&(pe=1),0==(fe=i)&&(fe=1),C||(x=1);var a=w*("s"==N?1e3:1),l=b*("s"==N?1e3:1),s=a;me=new e.Proportion(0,k,a,a*x),re=setTimeout((function(){!function e(){ie=setTimeout((function(){var r=t;if(C){var i=Math.abs(ye-pe),a=Math.abs(ve-fe);d?(o||n||(i=0),n&&(a=0)):(o||n||(a=0),n&&(i=0)),(i>=10||a>=10)&&(i>a?(J=d?E:B,r=ye-pe>0?1:-1,s=me.convert(Math.abs(pe-ye))):(J=d?B:E,r=ve-fe>0?1:-1,"number"!=T&&j||(r*=-1),s=me.convert(Math.abs(fe-ve))))}ke(r),e()}),s)}()}),l)}}function xe(){G.zimAccessibility&&G.zimAccessibility.aria||(clearTimeout(re),clearTimeout(ie))}function ke(t){var o;if("number"==T){var r=Q=Number(Q);Q+=Number(J*t*$),Q=e.decimals(Q,Z),m?Q>G.max?Q=G.min:Q<G.min&&(Q=G.max):(Q>G.max?(Q=1==B?G.max:r,z&&(we.cursor="default")):z&&(we.cursor="pointer"),Q<G.min&&(Q=1==B?G.min:r))}else{if(o=V+t,m)o>n.length-1&&(o=0),o<0&&(o=n.length-1);else{if(o>n.length-1)return void(z&&(we.cursor="default"));if(z&&(we.cursor="pointer"),o<0)return}V=o}Pe("number"==T?Q:n[V],"number"==T?Q:V),G.currentValue!=be&&G.dispatchEvent("change"),be=G.currentValue}function Te(){G.keyFocus=!0;var e=document.activeElement;e&&e.blur()}function Ae(){ae.alpha=1,le.color=a,ae.cursor="pointer",se.alpha=1,ce.color=a,se.cursor="pointer",m||("number"==T?(V==G.min&&($>0?Be():Ee()),V==G.max&&($>0?Ee():Be())):(0==V&&(d?Ee():Be()),V==n.length-1&&(d?Be():Ee())))}function Pe(t,o){V=o,z&&("number"==T&&0!=t&&Z>0&&(t=e.decimals(t,Z,!0)),c.text=t,c.center(G)),h&&Ae(),!se||e.OPTIMIZE||!zns&&WW.OPTIMIZE||!se.stage?!c||e.OPTIMIZE||!zns&&WW.OPTIMIZE||!c.stage||c.stage.update():se.stage.update(),G.zimAccessibility&&G.zimAccessibility.changeTitle(G,null,!0)}function Be(){h&&(ae.alpha=.8,le.color="#aaa",ae.cursor="default")}function Ee(){h&&(se.alpha=.8,ce.color="#aaa",se.cursor="default")}h&&(se=this.containerNext=new e.Container({style:!1}),this.addChild(se),ce=this.arrowNext=new e.Triangle(q,.8*q,.8*q,a,null,null,null,null,null,null,null,!1),-1!=p&&f>0&&(se.shadow=new createjs.Shadow(p,3,3,f)),se.addChild(ce),se.expand(),se.cursor="pointer",se.on("mousedown",(function(t){if(!G.zimAccessibility||!G.zimAccessibility.aria){J=B;var o=d?j?-1:1:O?1:-1;ke(o),Ce(o,null,null,t.stageX/e.scaX,t.stageY/e.scaY)}})),v&&se.on("pressup",xe),d?(se.rotation=0,se.x=i/2,se.y=se.getBounds().height/2):(se.rotation=90,se.x=z?we.x+we.getBounds().width+se.getBounds().height/2+U:ae.x+ae.getBounds().width,se.y=se.getBounds().width/2)),v&&z&&we.on("pressup",xe),I&&(ue=this.prev2=new e.Container({style:!1}),de=this.arrowPrev2=new e.Triangle(q,.8*q,.8*q,"rgba(0,0,0,.2)",a,2,null,null,null,null,null,!1),ue.addChild(de),ue.expand(),ue.cursor="pointer",ue.sca(S),ue.alpha=.5,ue.on("mousedown",(function(t){if(!G.zimAccessibility||!G.zimAccessibility.aria){J=E;var o=d?O?-1:1:j?1:-1;ke(o),Ce(o,null,!0,t.stageX/e.scaX,t.stageY/e.scaY)}})),v&&ue.on("pressup",xe),he=this.next2=new e.Container({style:!1}),ge=this.arrowNext2=new e.Triangle(q,.8*q,.8*q,"rgba(0,0,0,.2)",a,2,null,null,null,null,null,!1),he.addChild(ge),he.expand(),he.cursor="pointer",he.sca(S),he.alpha=.5,he.on("mousedown",(function(t){if(!G.zimAccessibility||!G.zimAccessibility.aria){J=E;var o=d?O?1:-1:j?-1:1;ke(o),Ce(o,null,!0,t.stageX/e.scaX,t.stageY/e.scaY)}})),v&&he.on("pressup",xe),d?(ue.y=this.height/2,ue.x=-ue.width/2-U*Math.max(.2,Math.min(1,S)),ue.rotation=270,he.y=this.height/2,he.x=this.width+he.width/2+U*Math.max(.2,Math.min(1,S)),he.rotation=90):(he.x=this.width/2,he.y=-he.height/2-U*Math.max(.2,Math.min(1,S)),he.rotation=0,ue.x=this.width/2,ue.y=this.height+ue.height/2+U*Math.max(.2,Math.min(1,S)),ue.rotation=180),this.addChild(ue,he)),Object.defineProperty(this,"stepperArray",{get:function(){if("number"==T){n=[];for(var t=G.min;t<=G.max;t+=Math.min(B,E))n.push(Number(e.decimals(t,Z,null,!1)))}return n},set:function(e){n=e;var t=G.selectedIndex;G.selectedIndex=t}}),Object.defineProperty(this,"min",{get:function(){return A},set:function(e){if("number"==T){G.currentValue<e&&(G.currentValue=e),A=e;var t=G.selectedIndex;G.selectedIndex=t}else A=e}}),Object.defineProperty(this,"max",{get:function(){return P},set:function(e){if("number"==T){G.currentValue>e&&(G.currentValue=e),P=e;var t=G.selectedIndex;G.selectedIndex=t}else P=e}}),Pe("number"==T?Q:n[V],"number"==T?Q:V),Object.defineProperty(this,"selectedIndex",{get:function(){return"number"==T?G.stepperArray.indexOf(G.currentValue):V},set:function(e){zot(e)||("number"==T?(V=Math.min(G.stepperArray.length-1,Math.max(0,e)),Pe(Q=G.stepperArray[V],Q)):(e=Math.min(n.length-1,Math.max(0,e)),Pe(n[V=e],V)))}}),Object.defineProperty(this,"currentValue",{get:function(){return"number"==T?Number(Q):n[V]},set:function(e){if(!zot(e))if("number"==T){if(e=Number(e),G.max>G.min){if(e>G.max||e<G.min)return}else if(e<G.max||e>G.min)return;var t=G.stepperArray.indexOf(e);if(t<0)return;V=t,Pe(Q=Number(G.stepperArray[V]),Q)}else{if(!(n.indexOf(e)>-1))return;if((e=n.indexOf(e))==G.selectedIndex)return;Pe(n[V=e],V)}}}),Object.defineProperty(this,"currentValueEvent",{get:function(){return G.currentValue},set:function(e){String(e)!=String(G.currentValue)&&(G.currentValue=e,G.dispatchEvent("change"))}}),Object.defineProperty(this,"continuous",{get:function(){return m},set:function(e){m=e,"number"==T?Pe(Q,Q):Pe(n[G.selectedIndex],G.selectedIndex)}}),this._enabled=!0,Object.defineProperty(G,"enabled",{get:function(){return G._enabled},set:function(t){r(G,t),t?("number"==T?Pe(Q,Q):Pe(n[G.selectedIndex],G.selectedIndex),WW.addEventListener("keydown",G.keyDownEvent)):(Be(),Ee(),WW.removeEventListener("keydown",G.keyDownEvent),z&&(c.mouseChildren=!1),z&&(c.mouseEnabled=!1)),!se||e.OPTIMIZE||!zns&&WW.OPTIMIZE||!se.stage?!c||e.OPTIMIZE||!zns&&WW.OPTIMIZE||!c.stage||c.stage.update():se.stage.update()}}),null!=WW.KEYFOCUS&&(e.KEYFOCUS=WW.KEYFOCUS),Object.defineProperty(this,"keyFocus",{get:function(){return e.KEYFOCUS==G},set:function(){e.KEYFOCUS=G}}),e.KEYFOCUS||Te(),this.on("mousedown",(function(){Te()}));var Ie=!0,Se="";this.on("mousedown",(function(){Ie=!0,Se="",G.zimAccessibility&&G.zimAccessibility.aria||(G.focus=!0,ze=!1)})),this.keyDownEvent=function(e){if(G.stage&&(G.zimAccessibility&&G.focus||!G.zimAccessibility&&G.keyFocus)){e||(e=event);var t=e.keyCode;if(M&&t>=37&&t<=40){var o=j?40:38,n=O?39:37,r=j?38:40,i=O?37:39;t==o||t==n?(J=d&&t==o||!d&&t==n?B:E,ke(1)):t!=r&&t!=i||(J=d&&t==r||!d&&t==i?B:E,ke(-1))}if(W)if("number"==T){var a=null,l=null;if(8==t){var s=String(Se).split("");s.pop(),a=s.pop(),Se=s.join("")}if(!e.shiftKey&&t>=48&&t<=57?a=t-48:t>=96&&t<=105?a=t-96:190==t?(Se=String(Se)+".",l=!0):173==t||189==t?(G.currentValue=-1*G.currentValue,G.currentValue!=be&&G.dispatchEvent("change"),be=G.currentValue,ze=!ze):46==t&&(Ie=!0,Se=""),zot(a)&&zot(l))return Ie=!0,void(Se="");if(zot(a))return;if(Ie?(Ie=!1,Se=a):Se=a=Number(Se+""+a),a<A||a>P)return;G.currentValue=a,G.currentValue!=be&&G.dispatchEvent("change"),be=G.currentValue}else Ie=!0,Se="",G.currentValue=String.fromCharCode(e.keyCode),G.currentValue!=be&&G.dispatchEvent("change"),be=G.currentValue}},WW.addEventListener("keydown",this.keyDownEvent),this.next=function(){ke(1)},this.prev=function(){ke(-1)},zot(L)&&(L=null!=F.selectedIndex?F.selectedIndex:0),G.selectedIndex=L,zot(D)&&(D=null!=F.currentValue?F.currentValue:null),zot(D)||(G.currentValue=D),!1!==_&&e.styleTransforms(this,F),this.clone=function(){return G.cloneProps(new e.Stepper(n,i,a,l,s,c.clone(),u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,this.group,X))},this.dispose=function(e,t,o){return WW.removeEventListener("keydown",G.keyDownEvent),G.removeAllEventListeners(),G.stage&&G.stage.off(K),o||this.zimContainer_dispose(!0),ae=this.containerPrev=le=this.arrowPrev=null,se=this.containerNext=ce=this.arrowNext=null,we=this.textBox=c=this.label=null,!0}},e.zut=function(t){if(zot(t)||!t.key)return!0;e.async("https://zimjs.com/gamdata.php?id="+t.key+"&player="+t.player+"&score="+t.score+"&reverse="+t.info.reverse+"&total="+t.info.total+"&allowZero="+t.info.allowZero,t.info.type)},e.extend(e.Stepper,e.Container,["clone","dispose"],"zimContainer",!1),e.Slider=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D){var _,Y="min, max, step, button, barLength, barWidth, barColor, vertical, useTicks, tickColor, tickStep, semiTicks, tickScale, semiTickScale, accentSize, accentOffset, accentColor, accentBackgroundColor, accentDifference, sound, inside, keyArrows, keyArrowsStep, keyArrowsH, keyArrowsV, damp, currentValue, expand, expandVertical, expandBar, expandBarVertical, useLabels, labelMargin, style, group, inherit";if(_=zob(e.Slider,arguments,Y,this))return _;z_d("62"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Slider",this.group=L;var X=!1===j?{}:e.getStyle(this.type,this.group,D);if(zot(t)&&(t=null!=X.min?X.min:0),zot(o)&&(o=null!=X.max?X.max:10),o-t!=0){var R;zot(w)&&(w=null!=X.sound&&X.sound),zot(n)&&(n=null!=X.step?X.step:0),zot(i)&&(i=null!=X.button?X.button:w?"aztec":null),zot(a)&&(a=null!=X.barLength?X.barLength:300),zot(l)&&(l=null!=X.barWidth?X.barWidth:3),zot(s)&&(s=null!=X.barColor?X.barColor:w?e.lighter:"#666"),zot(c)&&(c=null!=X.vertical?X.vertical:!!w),zot(u)&&(u=null!=X.useTicks?X.useTicks:!!w),zot(h)&&(h=null!=X.tickStep?X.tickStep:n||(u||w?(o-t)/40:0)),zot(g)&&(g=null!=X.semiTicks?X.semiTicks:h?3:0),zot(d)&&(d=null!=X.tickColor?X.tickColor:w?e.tin:s),zot(p)&&(p=null!=X.tickScale?X.tickScale:w?1.25:1),zot(f)&&(f=null!=X.semiTickScale?X.semiTickScale:1),zot(m)&&(m=null!=X.accentSize?X.accentSize:w?10:0),zot(z)&&(z=null!=X.accentOffset?X.accentOffset:w?-(m+l)/2:0),zot(y)&&(y=null!=X.accentColor?X.accentColor:e.pink),zot(v)&&(v=null!=X.accentBackgroundColor?X.accentBackgroundColor:w?e.blue:e.clear),zot(b)&&(b=null!=X.accentDifference?X.accentDifference:-.5),zot(C)&&(C=null!=X.inside&&X.inside),zot(x)&&(x=null==X.keyArrows||X.keyArrows),zot(T)&&(T=null==X.keyArrowsH||X.keyArrowsH),zot(A)&&(A=null==X.keyArrowsV||X.keyArrowsV),zot(k)&&(k=null!=X.keyArrowsStep?X.keyArrowsStep:(o-t)/100),zot(P)&&(P=null!=X.damp&&X.damp),zot(B)&&(B=null!=X.currentValue&&X.currentValue),zot(E)&&(E=null!=X.expand?X.expand:e.mobile()?10:null),zot(I)&&(I=null!=X.expandVertical?X.expandVertical:E),zot(S)&&(S=null!=X.expandBar?X.expandBar:null),zot(W)&&(W=null!=X.expandBarVertical?X.expandBarVertical:E),zot(M)&&(M=null!=X.useLabels&&X.useLabels),zot(O)&&(O=null!=X.labelMargin?X.labelMargin:20);var H=this,F=Be(t,o,n,B);t=e.Pick.choose(t),o=e.Pick.choose(o);var N,V=n=e.Pick.choose(n);B=e.Pick.choose(B),m&&(H.accentBacking=new e.Rectangle(a-.25,m+b,v).addTo(this).rot(c?90:0).mov(c?-z-l/2+b/2:.25,c?0:z+l/2-b/2),N=H.accent=new e.Rectangle(a,m,y).sca(0,1).rot(c?-90:0).mov(c?-z-m-l/2:0,c?a:z+l/2).addTo(this));var G,q,U=!(!zot(X.backing)&&"Pattern"!=X.backing.type);if(zot(i)||"string"==typeof i){var Q,Z=30,K=40;if(c&&(Z=50,K=40),"pill"==i||"aztec"==i||"circle"==i||"grip"==i){if("pill"==i)Q={width:c?40:18,height:c?18:40,borderColor:e.tin,borderWidth:3,corner:8};else if("aztec"==i){Z=null!=X.width?X.width:.9*Math.max(Z,K),K=null!=X.height?X.height:.6*Math.min(Z,K);var J=Ie(null!=X.backgroundColor?X.backgroundColor:e.lighter,Z,K).rot(c?0:-90),$=Ie(null!=X.rollBackgroundColor?X.rollBackgroundColor:e.white,Z,K).rot(c?0:-90);Q={width:Z,height:K,backing:J,rollBacking:$},X.borderWidth=0,X.borderColor=0}else"circle"==i&&(Z=null!=X.width?X.width:30,K=null!=X.height?X.height:30,Q={width:Z,height:Z,corner:null!=X.corner?X.corner:Z/2});H.buttonType=i}var ee=null!=X.borderColor?X.borderColor:Q?Q.borderColor:U?"#666":null;if(i=new e.Button({width:null!=X.width?X.width:Q?Q.width:Z,height:null!=X.height?X.height:Q?Q.height:K,label:"",backgroundColor:null!=X.backgroundColor?X.backgroundColor:"#fff",rollBackgroundColor:null!=X.rollBackgroundColor?X.rollBackgroundColor:"#ddd",borderColor:ee,rollBorderColor:null!=X.rollBorderColor?X.rollBorderColor:ee,borderWidth:null!=X.borderWidth?X.borderWidth:Q?Q.borderWidth:U?1:null,corner:null!=X.corner?X.corner:Q?Q.corner:0,backing:null!=X.backing?X.backing.clone():Q?Q.backing:null,rollBacking:null!=X.rollBacking?X.rollBacking.clone():Q?Q.rollBacking:null,shadowColor:null!=X.shadowColor?X.shadowColor:null,shadowBlur:null!=X.shadowBlur?X.shadowBlur:null,hitPadding:30,style:!1}),"circle"==H.buttonType)i.scaleY=K/Z,c||i.rot(-90);else if("grip"==H.buttonType){var te=[1,1,1],oe=.4;e.loop(te,(function(t,o,n){c?new e.Line(.62*i.width,t,i.borderColor?i.borderColor:e.grey).pos(0,i.height*oe/2+(o+1)*(i.height*(1-oe))/(n+1),e.CENTER,e.TOP,i):new e.Line(.62*i.height,t,i.borderColor?i.borderColor:e.grey).rot(90).pos(i.width*oe/2+(o+1)*(i.width*(1-oe))/(n+1),0,e.LEFT,e.CENTER,i)}))}}i.rollPersist=!0,zot(E)&&zot(I)||i.expand(E,I),c?(G=i.width,C?(q=a,this.setBounds(0,0,G,q)):(q=a+i.height,this.setBounds(-i.width/2,-i.height/2,G,q))):(q=Math.max(i.height,l),C?(G=a,this.setBounds(0,0,G,q)):(G=a+i.width,this.setBounds(-i.width/2,-i.height/2,G,q)));var ne,re,ie,ae,le,se,ce,ue,de,he,ge,pe,fe,me,ze,ye,ve=t,be=0;if(this.button=i,this.cursor="pointer",u){ae=this.ticks=new e.Shape({style:!1}),this.addChild(ae),(le=ae.graphics).ss(1).s(d);var we,Ce=Math.round((o-t)/(h||n)),xe=(o-t)/Ce;h?(xe!=h&&zon&&zogy("Slider() - non-divisible step ("+h+") adjusted to "+xe),h=xe):(xe!=n&&zon&&zogy("Slider() - non-divisible step ("+n+") adjusted to "+xe),n=xe),we=C?(a-(c?i.height:i.width))/Math.abs(Ce):a/Math.abs(Ce)}if(c){if(se=C?i.height/2:0,ne=this.bar=new e.Rectangle(l,a,s,null,null,null,null,null,null,!1),S?ne.expand(S,W):ne.expand(20,0),ne.centerReg(this),i.centerReg(this),ie=ne.getBounds(),re=new createjs.Rectangle(ne.x,ie.y+se,0,ie.height-2*se),u){for(M&&(ce=H.labels=(new e.Container).addTo(H)),ue=0;ue<=Math.abs(Ce);ue++)he=(de=ue%(g+1)==0)?25*p:15*f,ge=se+we*ue,le.mt(0,ge).lt(he,ge),M&&(g&&de||!g)&&(pe=Math.max(e.countDecimals(V),e.countDecimals(t),e.countDecimals(o)),new e.Label({text:e.decimals(o-(o-t)/Math.abs(Ce)*ue,pe+1),size:X.size?X.size:10,align:"left",valign:"center"}).centerReg({add:!1}).reg(0).loc(he+O+2,ge-1,ce));ae.x=ne.x+15}}else if(se=C?i.width/2:0,ne=this.bar=new e.Rectangle(a,l,s,null,null,null,null,null,null,!1),S?ne.expand(S,W):ne.expand(0,20),ne.centerReg(this),i.centerReg(this),ie=ne.getBounds(),re=new createjs.Rectangle(ie.x+se,ne.y,ie.width-2*se,0),u){for(M&&(ce=H.labels=(new e.Container).addTo(H)),ue=0;ue<=Math.abs(Ce);ue++)he=se+we*ue,ge=-((de=ue%(g+1)==0)?25*p:15*f),le.mt(he,0).lt(he,ge),M&&(g&&de||!g)&&(pe=Math.max(e.countDecimals(V),e.countDecimals(t),e.countDecimals(o)),new e.Label({text:e.decimals(t+(o-t)/Math.abs(Ce)*ue,pe+1),size:X.size?X.size:10,align:"center",valign:"center"}).centerReg({add:!1}).loc(he,ge-O,ce));ae.y=ne.y-10}i.x=re.x,i.y=re.y,i.on("mousedown",(function(t){R=t.target.stage,H.focus=!0;var o=H.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY);fe=o.x-i.x,me=o.y-i.y,R&&(R.mouseMoveOutside=!0)})),i.on("pressmove",(function(e){We(e)})),ne.on("mousedown",(function(e){R=e.target.stage,fe=0,me=0,H.zimAccessibility&&H.zimAccessibility.aria||We(e)})),P&&(ze=t,ye=new e.Damp(ze,P),H.ticker=e.Ticker.add((function(){ze=ye.convert(ve)}))),Object.defineProperty(this,"currentValue",{get:function(){return P?ze:ve},set:function(n){zot(n)||(t<o?(n<t&&(n=t),n>o&&(n=o)):(n>t&&(n=t),n<o&&(n=o)),ve=n=Se(n),ye&&ye.immediate(ve),c?(i.y=(n-o)/(t-o)*re.height+se,be=i.y):(i.x=(n-t)/(o-t)*re.width+se,be=i.x),N&&Ee(),Oe(),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!H.stage||H.stage.update())}}),Object.defineProperty(this,"currentValueEvent",{get:function(){return P?ze:ve},set:function(e){e!=H.currentValue&&(H.currentValue=e,H.dispatchEvent("change"))}}),Object.defineProperty(this,"min",{get:function(){return t},set:function(){zon&&zogy("Slider() - min is read only")}}),Object.defineProperty(this,"max",{get:function(){return o},set:function(){zon&&zogy("Slider() - max is read only")}}),Object.defineProperty(this,"step",{get:function(){return n},set:function(){zon&&zogy("Slider() - step is read only")}}),Object.defineProperty(this,"keyArrowsH",{get:function(){return T},set:function(e){T=e}}),Object.defineProperty(this,"keyArrowsV",{get:function(){return A},set:function(e){A=e}}),null!=WW.KEYFOCUS&&(e.KEYFOCUS=WW.KEYFOCUS),Object.defineProperty(this,"keyFocus",{get:function(){return e.KEYFOCUS==H},set:function(){e.KEYFOCUS=H}}),x&&!e.KEYFOCUS&&Le(),this.on("mousedown",(function(){x&&Le()}));var ke=!1,Te=!1,Ae=!1,Pe=!1;this.keyDownEvent=function(e){H.stage&&(H.zimAccessibility&&H.focus||!H.zimAccessibility&&H.keyFocus)&&(37==e.keyCode&&T?ke=!0:40==e.keyCode&&A?Te=!0:39==e.keyCode&&T?Ae=!0:38==e.keyCode&&A&&(Pe=!0),null==H.keyInterval&&(ke||Te||Ae||Pe)&&(De(),H.keyTimeout=setTimeout((function(){null==H.keyInterval&&(ke||Te||Ae||Pe)&&(H.keyInterval=setInterval(De,40))}),140)))},WW.addEventListener("keydown",this.keyDownEvent),H.keyUpEvent=function(e){37==e.keyCode?ke=!1:40==e.keyCode?Te=!1:39==e.keyCode?Ae=!1:38==e.keyCode&&(Pe=!1),null==H.keyInterval||ke||Te||Ae||Pe||(clearInterval(H.keyInterval),H.keyInterval=null)},WW.addEventListener("keyup",this.keyUpEvent),this._enabled=!0,Object.defineProperty(H,"enabled",{get:function(){return H._enabled},set:function(e){r(H,e),e?(WW.addEventListener("keydown",H.keyDownEvent),WW.addEventListener("keyup",H.keyUpEvent)):(WW.removeEventListener("keydown",H.keyDownEvent),WW.removeEventListener("keyup",H.keyUpEvent))}}),zot(B)||(H.currentValue=B),e.setSwipe(this,!1),!1!==j&&e.styleTransforms(this,X),this.clone=function(t){return H.cloneProps(new e.Slider(t||!e.isPick(F[0])?H.min:F[0],t||!e.isPick(F[1])?H.max:F[1],t||!e.isPick(F[2])?H.step:F[2],i.clone(),a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,t||!e.isPick(F[3])?H.currentValue:F[3],E,I,S,W,M,O,j,this.group,D))},this.dispose=function(e,t,o){return WW.removeEventListener("keydown",H.keyDownEvent),WW.removeEventListener("keyup",H.keyUpEvent),o||this.zimContainer_dispose(!0),!0}}else zogy("ZIM Slider range must not be 0");function Be(){return arguments}function Ee(){N.sca((H.currentValue-H.min)/Math.abs(H.max-H.min),1)}function Ie(t,o,n){var r=new e.Shape(o,n);return r.f(t).s(null!=X.borderColor?X.borderColor:e.tin).ss(null!=X.borderWidth?X.borderWidth:3).mt(2,0).lt(o+2,.2*n).lt(o+2,.8*n).lt(2,n).cp().centerReg({add:!1}),r}function Se(e){return 0==n?e:Math.round(e/n)*n}function We(n){var r=H.globalToLocal(n.stageX/e.scaX,n.stageY/e.scaY),a=je(r.x-fe,r.y-me,re);c?(i.x=a.x,ve=Se((a.y-re.y)/re.height*(t-o)),i.y=re.y+ve*re.height/(t-o),ve+=o,i.y!=be&&H.dispatchEvent("change"),be=i.y):(ve=Se((a.x-re.x)/re.width*(o-t)),i.x=re.x+ve*re.width/(o-t),ve+=t,i.y=a.y,i.x!=be&&H.dispatchEvent("change"),be=i.x),N&&Ee(),Oe(),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!H.stage||H.stage.update()}function Me(e){return e>0?1:-1}function Oe(){H.zimAccessibility&&H.zimAccessibility.changeTitle(H,null,!0)}function je(e,t,o){return{x:e=Math.max(o.x,Math.min(o.x+o.width,e)),y:t=Math.max(o.y,Math.min(o.y+o.height,t))}}function Le(){H.keyFocus=!0;var e=document.activeElement;e&&e.blur()}function De(){(ke||Te)&&(H.currentValueEvent-=n>0?n*Me(o-t):k*Me(o-t)),(Ae||Pe)&&(H.currentValueEvent+=n>0?n*Me(o-t):k*Me(o-t))}},e.extend(e.Slider,e.Container,["clone","dispose"],"zimContainer",!1),e.Selector=function(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b){var w,C="tile, borderColor, borderWidth, backgroundColor, corner, dashed, paddingHorizontal, paddingVertical, speed, diagonal, dim, multi, keyArrows, behind, resizeScale, selectedIndex, style, group, inherit";if(w=zob(e.Selector,arguments,C,this))return w;z_d("62.5"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Selector",this.group=v;var x=!1===y?{}:e.getStyle(this.type,this.group,b),k=t();zot(o)&&(o=null!=x.tile?x.tile:new e.Tile(new e.Circle(20,e.red),4,4,10,10)),zot(n)&&(n=null!=x.borderColor?x.borderColor:"white"),zot(r)&&(r=null!=x.borderWidth?x.borderWidth:2),zot(i)&&(i=null!=x.backgroundColor?x.backgroundColor:"rgba(0,0,0,.1)"),zot(a)&&(a=null!=x.corner?x.corner:10),zot(l)&&(l=null!=x.dashed&&x.dashed),zot(s)&&(s=null!=x.padding?x.padding:o.spacingH/2),zot(c)&&(c=null!=x.paddingVertical?x.paddingVertical:o.spacingV/2),zot(u)&&(u=null!=x.speed?x.speed:2),zot(d)&&(d=null!=x.diagonal&&x.diagonal),zot(h)&&(h=null!=x.dim&&x.dim),zot(g)&&(g=null!=x.multi&&x.multi),g&&(u=0),zot(p)&&(p=null==x.keyArrows||x.keyArrows),zot(f)&&(f=null!=x.behind&&x.behind),zot(m)&&(m=null!=x.resizeScale&&x.resizeScale),zot(z)&&(z=null!=x.selectedIndex?x.selectedIndex:null);var T=[],A=[];e.loop(o.items.length,(function(){T.push(zik(n)),A.push(zik(i))}));var P,B,E,I,S=this;if(!zot(z)||!g){var W=z,M=zot(z)||z<0?0:z,O=o.getChildAt(M);S.currentItem=o.getChildAt(M),zot(z=W)&&(z=null!=x.selectedIndex?x.selectedIndex:0)}if((P=O||o.getChildAt(0))&&(B=P.width+2*s,E=P.height+2*c),S.tile=o.addTo(S).cur(),g){var j=this.selectors=[];e.loop(10,(function(){(I=new e.Rectangle(B,E,e.faint,e.faint,r,a,l,{ignoreScale:!m}).centerReg(S,f?0:1)).visible=!1,j.push(I),I.mouseEnabled=!1})),this.selector=I}else(I=this.selector=new e.Rectangle(B,E,e.faint,e.faint,r,a,l,{ignoreScale:!m}).centerReg(S)).loc(o.width/2,P.y+c,S,f?0:1),I.visible=!1;z<0||zot(O)||(I.loc(P.x+s,P.y+c,S,f?0:1),I.color=A[z],I.borderColor=T[z],I.visible=!0),o.mov(s,c),this.setBounds(o.width+2*s,o.height+2*c);var L={};function D(t,n,r){zot(r)&&(r=I),O=t,z=t.tileNum,r.color=A[z],r.borderColor=T[z],g&&(S.upItem=S.upIndex=null,S.downItem=O,S.downIndex=z),S.animating=!0;var i=o.localToLocal(t.x,t.y,S),a=Math.abs(i.x-I.x),l=Math.abs(i.y-I.y),p=S.noAnimate||n?0:u;if(S.noAnimate=!1,0==p)r.loc(i.x,i.y).siz(t.width+2*s,t.height+2*c),S.animating=!1,S.dispatchEvent("change");else if(d||(a+l)*p<=0?r.animate({x:i.x,y:i.y},(l+a)*p):(r.stopAnimate(),a>=l?r.animate([{props:{x:i.x},time:Math.max("s"==k?.1:100,a*p/("s"==k?1e3:1))},{props:{y:i.y},time:Math.max("s"==k?.1:100,l*p/("s"==k?1e3:1))}]):r.animate([{props:{y:i.y},time:Math.max("s"==k?.1:100,l*p/("s"==k?1e3:1))},{props:{x:i.x},time:Math.max("s"==k?.1:100,a*p/("s"==k?1e3:1))}])),r.animate({props:{widthOnly:t.width+2*s,heightOnly:t.height+2*c},time:Math.max("s"==k?.2:200,(l+a)*p/("s"==k?1e3:1)),call:function(){S.animating=!1,S.dispatchEvent("change")}}),h){if(!0===h)var f=.7;else f=e.constrain(h,0,1);o.animate({props:{alpha:f},rewind:!0,time:(l+a)*u*.7/("s"==k?1e3:1)})}o.stage&&o.stage.update()}function _(){S.keyFocus=!0;var e=document.activeElement;e&&e.blur()}this.tileDown=o.on("mousedown",(function(e){var t=I;if(!g||!zot(t=j.shift())){t.visible=!0;for(var n=e.target,r=0;n.parent!=o&&r<10;)n=n.parent,r++;if(n.parent==o&&D(n,null,t),g){var i="id"+Math.abs(e.pointerID+1);L[i]={index:z,item:O,selector:t}}}})),g&&(this.tileMove=o.on("pressmove",(function(t){var n="id"+Math.abs(t.pointerID+1),r=L[n];if(!zot(r)){var i=o.itemUnderPoint(t.stageX/e.scaX,t.stageY/e.scaY);if(r.item!=i){if(S.upItem=r.item,S.upIndex=r.index,S.downItem=r.item=i,S.downIndex=r.index=i?i.tileNum:null,S.dispatchEvent("change"),zot(i))r.selector.visible=!1;else{var a=o.localToLocal(i.x,i.y,S);r.selector.loc(a.x,a.y).siz(i.width+2*s,i.height+2*c),r.selector.color=A[r.index],r.selector.borderColor=T[r.index],r.selector.visible=!0}S.stage.update()}}})),this.tileUp=o.on("pressup",(function(t){var o="id"+Math.abs(t.pointerID+1),n=L[o];zot(n)||(S.downIndex=S.downItem=null,S.upIndex=n.index,S.upItem=n.item,j.push(n.selector),n.selector.visible=!1,S.dispatchEvent("change"),!S.stage||e.OPTIMIZE||!zns&&WW.OPTIMIZE||S.stage.update(),delete L[o])}))),S.noAnimate=!1,p&&S.added((function(){S.keyEvent=S.stage.frame.on("keydown",(function(t){if(S.stage&&S.enabled&&!S.animating&&(S.zimAccessibility&&S.focus||!S.zimAccessibility&&S.keyFocus)){var n=e.loop(o.items2D,(function(t,o){var n=e.loop(t,(function(e,t){if(e==O)return[t,o]}));if(Array.isArray(n))return n}));!0===n&&(n=[0,0]);var r,i=o.items2D[n[1]].length,a=o.items2D.length;"39"==t.keyCode?(r=(n[0]+1)%i,D(o.items2D[n[1]][r],r<n[0])):"37"==t.keyCode?(r=(n[0]-1+i)%i,D(o.items2D[n[1]][r],r>n[0])):"38"==t.keyCode?(r=(n[1]-1+a)%a,D(o.items2D[r][n[0]],r>n[1])):"40"==t.keyCode&&(r=(n[1]+1)%a,D(o.items2D[r][n[0]],r<n[1]))}}))})),Object.defineProperty(this,"selectedIndex",{get:function(){return z},set:function(e){zot(e)&&(S.currentItem=null),S.currentItem=o.items[e]}}),Object.defineProperty(this,"text",{get:function(){return O.text},set:function(){zon&&zogy("Selector() - text is read only")}}),Object.defineProperty(this,"currentItem",{get:function(){return O},set:function(e){if(zot(e))return O=null,z=null,I.visible=!1,S.selectedCol=null,void(S.selectedRow=null);I.visible=!0,S.lastItem=O,S.lastIndex=z,S.lastCol=S.selectedCol,S.lastRow=S.selectedRow,S.selectedCol=e.tileCol,S.selectedRow=e.tileRow,z=e.tileNum,D(O=e)}}),this._enabled=!0,Object.defineProperty(S,"enabled",{get:function(){return S._enabled},set:function(e){e?S.mouse():S.noMouse(),S._enabled=e}}),null!=WW.KEYFOCUS&&(e.KEYFOCUS=WW.KEYFOCUS),Object.defineProperty(this,"keyFocus",{get:function(){return e.KEYFOCUS==S},set:function(){e.KEYFOCUS=S}}),e.KEYFOCUS||_(),this.on("mousedown",(function(){_()})),!1!==y&&e.styleTransforms(this,x),this.clone=function(t){if(t)for(var y=[],v=0;v<S.tile.items.length;v++)y.push(S.tile.items[v].clone(!0));return S.cloneProps(new e.Selector(t?e.series(y):o.clone?o.clone():o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,this.style,this.group))},this.dispose=function(e,t,n){S.keyEvent&&S.stage&&S.stage.frame.off("keydown",S.keyEvent),o.off(S.tileDown),o.dispose(),g&&(o.off(S.tileMove),o.off(S.tileUp)),n||this.zimContainer_dispose(!0)}},e.extend(e.Selector,e.Container,["clone","dispose"],"zimContainer",!1),e.Dial=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H){var F,N="min, max, step, width, backgroundColor, indicatorColor, indicatorScale, indicatorType, useTicks, innerTicks, tickColor, tickStep, semiTicks, tickScale, semiTickScale, innerCircle, innerScale, innerColor, inner2Color, accentSize, accentOffset, accentColor, accentBackgroundColor, accentDifference, sound, linear, gap, limit, keyArrows, keyArrowsStep, keyArrowsH, keyArrowsV, continuous, continuousMin, continuousMax, damp, currentValue, useLabels, labelMargin, style, group, inherit";if(F=zob(e.Dial,arguments,N,this))return F;z_d("63"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Dial",this.group=R;var V=!1===X?{}:e.getStyle(this.type,this.group,H);if(zot(t)&&(t=null!=V.min?V.min:0),zot(o)&&(o=null!=V.max?V.max:10),o-t!=0){zot(T)&&(T=null!=V.sound&&V.sound),zot(n)&&(n=null!=V.step?V.step:T?0:1),zot(r)&&(r=null!=V.width?V.width:100),zot(i)&&(i=null!=V.backgroundColor?V.backgroundColor:"#666"),zot(a)&&(a=null!=V.indicatorColor?V.indicatorColor:T?"white":"#222"),zot(l)&&(l=null!=V.indicatorScale?V.indicatorScale:1),zot(s)&&(s=null!=V.indicatorType?V.indicatorType:T?"aztec":"arrow"),zot(c)&&(c=null!=V.useTicks?V.useTicks:0!=n),zot(u)&&(u=null!=V.innerTicks&&V.innerTicks),zot(h)&&(h=null!=V.tickStep?V.tickStep:n||(c?.25:0)),zot(g)&&(g=null!=V.semiTicks?V.semiTicks:T?3:0),zot(d)&&(d=null!=V.tickColor?V.tickColor:T?e.tin:i),zot(p)&&(p=null!=V.tickScale?V.tickScale:T?1.25:1),zot(f)&&(f=null!=V.semiTickScale?V.semiTickScale:1.25),zot(m)&&(m=null==V.innerCircle||V.innerCircle),zot(y)&&(y=null!=V.innerColor?V.innerColor:T?e.pink:"rgba(0,0,0,.2)"),zot(v)&&(v=null!=V.inner2Color?V.inner2Color:T?e.light:"rgba(0,0,0,.1)"),zot(z)&&(z=null!=V.innerScale?V.innerScale:T?.4:.5),zot(b)&&(b=null!=V.accentSize?V.accentSize:T?r/2*.15:0),zot(w)&&(w=null!=V.accentOffset?V.accentOffset:r/2*.45),zot(k)&&(k=null!=V.accentDifference?V.accentDifference:-.25),zot(C)&&(C=null!=V.accentColor?V.accentColor:e.pink),zot(x)&&(x=null!=V.accentBackgroundColor?V.accentBackgroundColor:T?e.blue:e.clear),zot(P)&&(P=null!=V.gap?V.gap:T?.25:0),zot(A)&&(A=null!=V.linear?V.linear:T),P&&(A=!0,M=!1),zot(B)&&(B=null==V.limit||V.limit),zot(E)&&(E=null==V.keyArrows||V.keyArrows),zot(I)&&(I=null!=V.keyArrowsStep?V.keyArrowsStep:(o-t)/100),zot(S)&&(S=null==V.keyArrowsH||V.keyArrowsH),zot(W)&&(W=null==V.keyArrowsV||V.keyArrowsV),zot(M)&&(M=null!=V.continuous&&V.continuous),M&&(B=null!=V.limit&&V.limit),zot(L)&&(L=null!=V.damp&&V.damp),zot(D)&&(D=null!=V.currentValue&&V.currentValue),zot(_)&&(_=null!=V.useLabels&&V.useLabels),zot(Y)&&(Y=null!=V.labelMargin?V.labelMargin:10),0==B&&(L=null);var G=this;this.cursor="pointer";var q=Le(t,o,n,D);t=e.Pick.choose(t),o=e.Pick.choose(o);var U=n=e.Pick.choose(n);D=e.Pick.choose(D);var Q,Z=r/2,K=r,J=t,$=0;if(b){var ee=r/2+w+b/2,te=360*P/2;G.accentBacking=new e.Shape(-Z,-Z,2*Z,2*Z).addTo(this).s(x).ss(b+k).a(0,0,ee,(te-90)*e.RAD,(360-te-90)*e.RAD),Q=G.accent=new e.Shape(-Z,-Z,2*Z,2*Z).addTo(this)}var oe=this.backing=new e.Circle(Z,i,null,null,null,null,null,null,!1);if(b?oe.center(this):this.addChild(oe),m){var ne=this.inner=new e.Circle(Z*z,y,null,null,null,null,null,null,!1);this.addChild(ne);var re=this.inner2=new e.Circle(Z*(z-.1),v,null,null,null,null,null,null,!1);this.addChild(re)}T&&(G.rotation=180);var ie,ae,le,se,ce,ue,de=Math.abs(o-t)/(h||n)+(P?1:0),he=n?Math.abs(o-t)/n:0;if(c){var ge=this.ticks=new e.Container({style:!1});if(this.addChild(ge),_)var pe=G.labels=new e.Container(2*r,2*K).centerReg(G);for(var fe=0;fe<de;fe++){var me=fe%(g+1)==0,ze=new e.Rectangle(1,Z*(me?.2*p:.1*f),d,null,null,null,null,null,null,!1);if(ze.regY=Z+(u?z-.05:ze.height+.1*Z),ze.regX=.5,ze.rotation=(360-360*P)/(de-(P?1:0))*fe+360*P/2,ge.addChild(ze),_&&(g&&me||!g)){var ye=Math.max(e.countDecimals(U),e.countDecimals(t),e.countDecimals(o));new e.Label({text:e.decimals(t+(o-t)/Math.abs(he)*fe,ye+1),size:V.size?V.size:10,align:"center",valign:"center"}).centerReg({add:!1}).loc(0,-Y-1,ze).addTo(pe)}}G.expand(ze.height)}if(this.setBounds(-Z,-Z,r,r),"dot"==s||"circle"==s)ie=this.indicator=new e.Container({style:!1}),ae=this.indicatorShape=new e.Circle(.19*Z,a,null,null,null,null,null,null,!1),ie.addChild(ae),e.sca(ie,l),ie.regY=Z-ie.getBounds().width*l/2-.07*Z;else if("line"==s||"rectangle"==s)ie=this.indicator=new e.Container({style:!1}),ae=this.indicatorShape=new e.Rectangle(.1*Z,.3*Z,a,null,null,null,null,null,null,null,null,!1),ie.addChild(ae),e.sca(ie,l),ie.regY=Z-ie.getBounds().width*l/2-.07*Z,ie.regX=.05*Z;else if("aztec"==s){ie=this.indicator=new e.Container({style:!1});var ve=.05*Z,be=.1*Z,we=.42*Z;ae=this.indicatorShape=new e.Shape(-be,0,2*be,we).f(a).mt(-ve,0).lt(ve,0).lt(be,we).lt(-be,we).cp(),ie.addChild(ae),e.sca(ie,l),ie.regY=Z-ie.getBounds().width*l/2-.04*Z}else ie=this.indicator=new e.Container({style:!1}),ae=this.indicatorShape=new e.Triangle(.4*Z,.4*Z,.4*Z,a,null,null,null,null,null,null,null,!1),ie.addChild(ae),e.sca(ie,l),ie.regY=Z-ie.getBounds().height*l*(u?.85:.75),u&&(ae.rotation=180);ie.regY/=l,this.addChild(ie);var Ce,xe,ke=0;if(M)var Te=0,Ae=0,Pe=0,Be=!1,Ee=!1,Ie=!0;if(A)this.on("mousedown",(function(t){if(!G.zimAccessibility||!G.zimAccessibility.aria){var o=le=ie.rotation,n=G.parent.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY);ce=G.on("pressmove",(function(t){var r=G.parent.globalToLocal(t.rawX/e.scaX,t.rawY/e.scaY);ie.rotation=o=le+100*(n.y-r.y)/(this.width||1),B&&(o>360-360*P/2||o<0+360*P/2)&&(o=e.constrain(o,360*P/2,360-360*P/2),n=G.parent.globalToLocal(t.rawX/e.scaX,t.rawY/e.scaY),le=o),Re(o)})),ue=this.on("pressup",(function(){G.off("pressmove",ce),G.off("pressup",ue)}))}}));else{var Se=!0;this.on("mousedown",(function(t){if(!G.zimAccessibility||!G.zimAccessibility.aria){le=ie.rotation;var n=G.parent.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY),r=n.x-G.x,i=G.y-n.y;se=180*Math.atan2(r,i)/Math.PI;var a=(new Date).getTime();ce=G.on("pressmove",(function(t){if(Be){var n=G.parent.globalToLocal(t.rawX/e.scaX,t.rawY/e.scaY),r=n.x-G.x,i=G.y-n.y;se=180*Math.atan2(r,i)/Math.PI,le=ie.rotation}r=(n=G.parent.globalToLocal(t.rawX/e.scaX,t.rawY/e.scaY)).x-G.x,i=G.y-n.y;var a=180*Math.atan2(r,i)/Math.PI,l=le+a-se;l=(l+36e5)%360,B&&Se&&(l-ke>180&&G.currentValue!=o?l=0:l-ke<-180&&(l=359)),Se=!0,Re(l),ke=l})),ue=this.on("pressup",(function(t){(G.currentValue!=G.min&&G.currentValue!=G.max&&(Se=!1),(new Date).getTime()-a<200)&&(n=G.parent.globalToLocal(t.rawX/e.scaX,t.rawY/e.scaY),r=n.x-G.x,i=G.y-n.y,Re(180*Math.atan2(r,i)/Math.PI-G.rotation));le=ie.rotation,G.off("pressmove",ce),G.off("pressup",ue)}))}}))}L&&(Ce=t,xe=new e.Damp(Ce,L),G.ticker=e.Ticker.add((function(){Ce=xe.convert(J)}))),Object.defineProperty(this,"currentValue",{get:function(){return L?Ce:J},set:function(n){zot(n)||(M?(Be=!1,zot(O)||zot(j)?zot(O)?zot(j)||n>j&&(n=j,Be=!0):n<O&&(n=O,Be=!0):O<j?(n<O&&(n=O,Be=!0),n>j&&(n=j,Be=!0)):(n>O&&(n=O,Be=!0),n<j&&(n=j,Be=!0)),Ie&&(Ee=!0,Pe=360*Math.floor(n/(o-t)))):t<o?(n<t&&(n=B?t:o),n>o&&(n=B?o:t)):(n>t&&(n=B?t:o),n<o&&(n=B?o:t)),J=n,n=_e(n),L&&L.immediate(J),ie.rotation=360*P/2+(n-t)*(360-360*P)/(o-t),ie.rotation=(ie.rotation+36e5)%360,$=n-t,ke=ie.rotation,Q&&De(),Xe(),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!G.stage||G.stage.update())}}),Object.defineProperty(this,"currentValueEvent",{get:function(){return L?Ce:J},set:function(e){e!=G.currentValue&&(G.currentValue=e,G.dispatchEvent("change"))}}),Object.defineProperty(this,"min",{get:function(){return t},set:function(e){M?t=e:zon&&zogy("Dial() - min is read only")}}),Object.defineProperty(this,"max",{get:function(){return o},set:function(e){M?o=e:zon&&zogy("Dial() - max is read only")}}),Object.defineProperty(this,"continuous",{get:function(){return M},set:function(){zon&&zogy("Dial() - continuous is read only")}}),Object.defineProperty(this,"continuousMin",{get:function(){return O},set:function(e){O=e,G.currentValue<O&&(G.currentValue=O)}}),Object.defineProperty(this,"continuousMax",{get:function(){return j},set:function(e){j=e,G.currentValue>j&&(G.currentValue=j)}}),Object.defineProperty(this,"step",{get:function(){return n},set:function(){zon&&zogy("Dial() - step is read only")}}),Object.defineProperty(this,"keyArrowsH",{get:function(){return S},set:function(e){S=e}}),Object.defineProperty(this,"keyArrowsV",{get:function(){return W},set:function(e){W=e}}),null!=WW.KEYFOCUS&&(e.KEYFOCUS=WW.KEYFOCUS),Object.defineProperty(this,"keyFocus",{get:function(){return e.KEYFOCUS==G},set:function(){e.KEYFOCUS=G}}),E&&!e.KEYFOCUS&&He(),this.on("mousedown",(function(){E&&He()}));var We=!1,Me=!1,Oe=!1,je=!1;this.keyDownEvent=function(e){G.stage&&(G.zimAccessibility&&G.focus||!G.zimAccessibility&&G.keyFocus)&&(37==e.keyCode&&S?We=!0:40==e.keyCode&&W?Me=!0:39==e.keyCode&&S?Oe=!0:38==e.keyCode&&W&&(je=!0),null==G.keyInterval&&(We||Me||Oe||je)&&(Fe(),G.keyTimeout=setTimeout((function(){null==G.keyInterval&&(We||Me||Oe||je)&&(G.keyInterval=setInterval(Fe,40))}),140)))},WW.addEventListener("keydown",this.keyDownEvent),G.keyUpEvent=function(e){37==e.keyCode?We=!1:40==e.keyCode?Me=!1:39==e.keyCode?Oe=!1:38==e.keyCode&&(je=!1),null==G.keyInterval||We||Me||Oe||je||(clearInterval(G.keyInterval),G.keyInterval=null)},WW.addEventListener("keyup",this.keyUpEvent),this._enabled=!0,Object.defineProperty(G,"enabled",{get:function(){return G._enabled},set:function(e){e?(WW.addEventListener("keydown",G.keyDownEvent),WW.addEventListener("keyup",G.keyUpEvent)):(WW.removeEventListener("keydown",G.keyDownEvent),WW.removeEventListener("keyup",G.keyUpEvent)),G._enabled=e}}),zot(D)&&(D=null!=V.currentValue?V.currentValue:t),G.currentValue=D,!1!==X&&e.styleTransforms(this,V),this.clone=function(t){return G.cloneProps(new e.Dial(t||!e.isPick(q[0])?G.min:q[0],t||!e.isPick(q[1])?G.max:q[1],t||!e.isPick(q[2])?G.step:q[2],r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,t||!e.isPick(q[3])?G.currentValue:q[3],_,Y,X,this.group,H))},this.dispose=function(e,t,o){return WW.removeEventListener("keydown",G.keyDownEvent),WW.removeEventListener("keyup",G.keyUpEvent),o||this.zimContainer_dispose(!0),!0}}else zogy("ZIM Dial range must not be 0");function Le(){return arguments}function De(){Q.c().s(C).ss(b),A?Q.a(0,0,ee,(te-90)*e.RAD,(ie.rotation-2*te)*e.RAD):Q.a(0,0,ee,(te-90)*e.RAD,(ie.rotation-90)*e.RAD)}function _e(e){return 0==n?e:Math.round(e/n)*n}function Ye(e){return e>0?1:-1}function Xe(){G.zimAccessibility&&G.zimAccessibility.changeTitle(G,null,!0)}function Re(r){if(M){Ee&&(Te=r,Ee=!1),r>Te+180?Pe-=360:r<Te-180&&(Pe+=360),Ae=Pe+r,Ie=!1;var i=G.currentValue;return G.currentValue=_e(Ae*(o-t)/360),i!=G.currentValue&&G.dispatchEvent("change"),Te=r,Ie=!0,Q&&De(),!0}var a;r<0&&(r+=360),r%=360,0!=n?(a=_e(((r=Math.min(r,360))-360*P/2)/(360-360*P)*(o-t)),ie.rotation=360*P/2+a*(360-360*P)/(o-t)):(ie.rotation=r,a=(r-360*P/2)/(360-360*P)*(o-t)),a!=$&&($=a,J=a+t,Q&&De(),G.dispatchEvent("change"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!G.stage||G.stage.update()),Xe()}function He(){G.keyFocus=!0;var e=document.activeElement;e&&e.blur()}function Fe(){(We||Me)&&(G.currentValueEvent-=n>0?n*Ye(o-t):I*Ye(o-t)),(Oe||je)&&(G.currentValueEvent+=n>0?n*Ye(o-t):I*Ye(o-t))}},e.extend(e.Dial,e.Container,["clone","dispose"],"zimContainer",!1),e.Tabs=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q,U){var Q,Z="width, height, tabs, backgroundColor, rollBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, color, rollColor, selectedColor, selectedRollColor, vertical, spacing, currentEnabled, currentSelected, corner, base, keyEnabled, gradient, gloss, backing, rollBacking, wait, waitTime, waitBackgroundColor, rollWaitBackgroundColor, waitColor, rollWaitColor, waitModal, waitEnabled, backdropColor, align, valign, labelAlign, labelValign, labelIndent, labelIndentHorizontal, labelIndentVertical, indent, useTap, excludeCustomTap, selectedIndex, styleLabels, keyWrap, style, group, inherit";if(Q=zob(e.Tabs,arguments,Z,this))return Q;z_d("65");var K=!1===G?{}:e.getStyle("Tabs",q,U);zot(g)&&(g=null!=K.vertical&&K.vertical),zot(t)&&(t=null!=K.width?K.width:null);var J=!zot(t);if(zot(t)&&(t=g?60:240),zot(o)&&(o=null!=K.height?K.height:g?240:60),this.zimContainer_constructor(null,null,null,null,!0),this.type="Tabs",this.group=q,(zot(n)||n.length<=0)&&(n=null!=K.tabs?K.tabs:[1,2,3,4]),zot(i)&&(i=null!=K.backgroundColor?K.backgroundColor:"#777"),zot(a)&&(a=null!=K.rollBackgroundColor?K.rollBackgroundColor:"#555"),zot(l)&&(l=null!=K.selectedBackgroundColor?K.selectedBackgroundColor:"#333"),zot(s)&&(s=null!=K.selectedRollBackgroundColor?K.selectedRollBackgroundColor:a),zot(c)&&(c=null!=K.color?K.color:"white"),zot(u)&&(u=null!=K.rollColor?K.rollColor:c),zot(d)&&(d=null!=K.selectedColor?K.selectedColor:c),zot(h)&&(h=null!=K.selectedRollColor?K.selectedRollColor:u),zot(C)&&(C=null!=K.backing?K.backing.clone():null),zot(x)&&(x=null!=K.rollBacking?K.rollBacking.clone():null),zot(M)&&(M=null!=K.align?K.align:"center"),zot(O)&&(O=null!=K.valign?K.valign:"center"),zot(j)&&(j=null!=K.labelAlign?K.labelAlign:M),zot(L)&&(L=null!=K.labelValign?K.labelValign:O),zot(X)&&(X=null!=K.indent?K.indent:10),zot(D)&&(D=null!=K.labelIndent?K.labelIndent:X),zot(_)&&(_=null!=K.labelIndentHorizontal?K.labelIndentHorizontal:D),zot(Y)&&(Y=null!=K.labelIndentVertical?K.labelIndentVertical:D),zot(f)&&(f=null!=K.currentEnabled&&K.currentEnabled),zot(m)&&(m=null==K.currentSelected||K.currentSelected),m||(f=!0),zot(p)&&(p=null!=K.spacing?K.spacing:1),zot(z)&&(z=null!=K.corner?K.corner:0),zot(b)&&(b=null!=K.gradient?K.gradient:null),zot(w)&&(w=null!=K.gloss?K.gloss:null),zot(y)&&(y=null!=K.base?K.base:0!=z||Array.isArray(z)?g?"left":"bottom":"none"),zot(v)&&(v=null==K.keyEnabled||K.keyEnabled),zot(R)&&(R=null!=K.useTap&&K.useTap),zot(H)&&(H=null!=K.excludeCustomTap&&K.excludeCustomTap),zot(W)&&(W=null!=K.backdropColor?K.backdropColor:null),zot(N)&&(N=null!=K.styleLabels?K.styleLabels:null),zot(V)&&(V=null==K.keyWrap||K.keyWrap),"none"==y||0==z||Array.isArray(z))Array.isArray(z)||(z=[z,z,z,z]);else switch(y){case"bottom":z=[z,z,0,0];break;case"left":z=[0,z,z,0];break;case"top":z=[0,0,z,z];break;case"right":z=[z,0,0,z]}var $=this;this.keyEnabled=v;var ee,te,oe=0,ne=[],re=[],ie=n.length,ae=(t-p*(ie-1))/ie,le=(o-p*(ie-1)-2)/ie;if(!zot(W)){var se=this.backdrop=new e.Rectangle(t,o,W,null,null,null,null,null,null,!1);this.addChild(se)}var ce,ue=!1;function de(e){for(var t=0;t<e.length;t++){var o=e[t];o.constructor!=={}.constructor?"string"==typeof o||"number"==typeof o||"Label"==o.type?(e[t]={type:"TabObject",label:String(null!=o)||"Label"==o.type?o:"1"},ce&&"TabObject"!=ce&&(ue=!0),ce="TabObject"):(ce&&"TabObject"==ce&&(ue=!0),ce="Other"):(ce&&"TabObject"!=ce&&(ue=!0),ce="TabObject",o.type="TabObject")}}de(n);for(var he,ge=0,pe=0,fe=0;fe<n.length;fe++)te=n[fe],g?J&&(te.width=te.width?te.width:t):(zot(te.width)&&pe++,ge+=zot(te.width)?ae:te.width);if(!g)if(ge>t-p*(ie-1))for(fe=0;fe<n.length;fe++)(te=n[fe]).width=(t-p*(ie-1))/ge*(zot(te.width)?ae:te.width);else if(Math.round(ge)<Math.round(t-p*(ie-1))&&pe>0)for(he=(ie*ae-(ge-pe*ae))/pe,fe=0;fe<n.length;fe++)(te=n[fe]).width=zot(te.width)?he:te.width;function me(t,n){for(fe=0;fe<t.length;fe++)""!=(te=t[fe])&&"TabObject"==te.type&&(zot(te.label)&&(te.label=" "),"string"!=typeof te.label&&"number"!=typeof te.label||(te.label=new e.Label({text:te.label,size:null!=K.size?K.size:g?le/2:o/2,font:null!=K.font?K.font:null,style:N,valign:L,inherit:n})))}me(n,N?K:null);var ze=0;for(fe=0;fe<n.length;fe++)!(te=n[fe]).width&&g&&te.label.width>ze&&(ze=te.label.width);var ye=0;function ve(n,r){var p=[],f=[];for(fe=0;fe<n.length;fe++){if("TabObject"==(te=n[fe]).type){var m={color:zot(te.color)?e.Pick.choose(c):te.color,rollColor:zot(te.rollColor)?e.Pick.choose(u):te.rollColor,selectedColor:zot(te.selectedColor)?e.Pick.choose(d):te.selectedColor,selectedRollColor:zot(te.selectedRollColor)?e.Pick.choose(h):te.selectedRollColor,backgroundColor:zot(te.backgroundColor)?e.Pick.choose(i):te.backgroundColor,rollBackgroundColor:zot(te.rollBackgroundColor)?e.Pick.choose(a):te.rollBackgroundColor,selectedBackgroundColor:zot(te.selectedBackgroundColor)?e.Pick.choose(l):te.selectedBackgroundColor,selectedRollBackgroundColor:zot(te.selectedRollBackgroundColor)?e.Pick.choose(s):te.selectedRollBackgroundColor,wait:zot(te.wait)?e.Pick.choose(k):te.wait};if(r)for(var y in r)zot(r[y])||(m[y]=r[y]);(ee=new e.Button({width:g?zot(te.width)?J?t:ze+le/2+z[0]/2:te.width:zot(te.width)?ae:te.width,height:g?le:o,label:te.label,borderColor:null!=K.borderColor?K.borderColor:null,borderWidth:null!=K.borderWidth?K.borderWidth:null,backgroundColor:m.backgroundColor,rollBackgroundColor:m.rollBackgroundColor,corner:z,shadowColor:-1,gradient:b,gloss:w,backing:C?C.clone():null,rollBacking:x?x.clone():null,wait:m.wait,waitTime:zot(te.waitTime)?T:te.waitTime,waitBackgroundColor:zot(te.waitBackgroundColor)?A:te.waitBackgroundColor,rollWaitBackgroundColor:zot(te.rollWaitBackgroundColor)?P:te.rollWaitBackgroundColor,waitColor:zot(te.waitColor)?B:te.waitColor,rollWaitColor:zot(te.rollWaitBackgroundColor)?E:te.rollWaitColor,waitModal:zot(te.waitModal)?I:te.waitModal,waitEnabled:zot(te.waitEnabled)?S:te.waitEnabled,align:j,valign:L,indentHorizontal:_,indentVertical:Y,inherit:e.copy(K)})).tabInfo=m,ee.color=ee.tabInfo.color,ee.rollColor=ee.tabInfo.rollColor,ee.type="TabsButton",ee.content=te,ee.listIndentReady=!0}else{if(te.listIndentReady)ee=te;else{(ee=new e.Container).type=te.type,ee.content=te;for(var v=["text","backing","label","slider","stepper","checkBox","colorPicker","swatch","colorLabel"],W=0;W<v.length;W++)te[v[W]]&&(ee[v[W]]=te[v[W]])}te.checkBox&&(ee.checkBox=te.checkBox),zot(ee.tabInfo)&&(ee.tabInfo={}),H&&(ee.excludeTap=!0),ee.tabInfo.color=zot(te.color)?c:te.color,ee.tabInfo.backgroundColor=zot(te.backgroundColor)?i:te.backgroundColor,te.listIndentReady||(new e.Rectangle(Math.max(te.width,g?J?t:ze+le/2+z[0]/2:te.width),Math.max(te.height,g?le:o),e.clear).addTo(ee).expand(0).cur(),te.center(ee).cur(),"center"!=M&&"middle"!=M&&te.pos(0,null,"right"==M),"center"!=O&&"middle"!=O&&te.pos(null,0,null,"bottom"==O),ee.listIndentReady=!0)}ee.width>ye&&(ye=ee.width),R?ee.tap((function(t){Ce(t.currentTarget.znum),$.dispatchEvent("change"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()})):ee.zimTabEvent=ee.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(t){Ce(t.currentTarget.znum),$.dispatchEvent("change"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()})),ee.on("mousedown",(function(e){$.buttonDown=e.currentTarget})),ee.on("pressup",(function(){$.buttonDown=null})),f.push(te.label),p.push(ee),ee.index=fe}return[p,f]}var be=ve(n);function we(){var e,n=0,r=0;for(fe=0;fe<re.length;fe++)(e=re[fe]).znum=fe,e.selectedIndex=fe,e.selectedIndex==oe&&m&&(e.backgroundColor=l,e.rollBackgroundColor=s,e.color=d),ne[fe]&&(ne[fe].znum=fe),$.addChild(e),g&&!J||(e.x=(t-e.width)/2,e.y=(o-e.height)/2),g?(e.y=r,r=e.y+e.height+p,"left"==M?e.x=("TabsButton"==e.type||"ListItem"==e.type?0:X)+(e.regX-(e.getBounds()?e.getBounds().x:0))*e.scaleX:"right"==M&&(e.x=(J?t:ye)-e.width-("TabsButton"==e.type||"ListItem"==e.type?0:X))):(e.x=n,n=e.x+e.width+p,"top"==O?e.y=("TabsButton"!=e.type||ue?X:0)+(e.regY-(e.getBounds()?e.getBounds().y:0))*e.scaleY:"bottom"==O&&(e.y=o-e.height-("TabsButton"!=e.type||ue?X:0))),0!=fe||f||(e.enabled=!1),e.enabled=!0;zot(W)||$.removeChild(se),$._bounds=null;var i=$.getBounds(),a=0,c=0;if(i||0==createjs.EaselJS.version[0]?i&&(a=g&&0!=i.width&&J?t:i.width,c=g&&0!=i.height?i.height:o,$.setBounds(a,c)):$.setBounds(),zot(W)||(se.widthOnly=a,se.heightOnly=c,$.addChildAt(se,0)),g&&!J)for(fe=0;fe<=re.length;fe++)"center"!=M&&"middle"!=M||(e.x=(a-e.width)/2)}function Ce(e){if(e!=oe){var t=re[oe];t&&m&&(t.tabInfo&&zot(t.tabInfo.wait)&&(t.tabInfo.backgroundColor&&(t.backgroundColor=t.tabInfo.backgroundColor),t.tabInfo.rollBackgroundColor&&(t.rollBackgroundColor=t.tabInfo.rollBackgroundColor),t.tabInfo.color&&t.label&&(t.color=t.tabInfo.color),t.tabInfo.rollColor&&t.label&&(t.rollColor=t.tabInfo.rollColor)),f||(t.enabled=!0)),(t=re[oe=e])&&(t.tabInfo&&zot(t.tabInfo.wait)&&m&&(t.tabInfo.selectedBackgroundColor&&(t.backgroundColor=t.tabInfo.selectedBackgroundColor),t.tabInfo.selectedRollBackgroundColor&&(t.rollBackgroundColor=t.tabInfo.selectedRollBackgroundColor),t.tabInfo.selectedColor&&t.label&&(t.color=t.tabInfo.selectedColor),t.tabInfo.selectedRollColor&&t.label&&(t.rollColor=t.tabInfo.selectedRollColor)),f||(t.enabled=!1))}}function xe(){$.keyFocus=!0;var e=document.activeElement;e&&e.blur()}re=be[0],ne=be[1],we(),this.addAt=function(t,o,n){zot(o)&&(o=re.length),o=e.constrain(o,0,re.length),Array.isArray(t)||(t=[t]),de(t),me(t,n);var r=ve(t,n),i=r[0],a=r[1];o<=oe&&(oe+=i.length);var l=[o,0].concat(i);return Array.prototype.splice.apply(re,l),l=[o,0].concat(a),Array.prototype.splice.apply(ne,l),we(),$},this.removeAt=function(t,o){if(0==re.length)return $;for(zot(t)&&(t=1),zot(o)&&(o=re.length-t),o=e.constrain(o,0,re.length-t),oe>=o&&oe<=o+t&&(oe=-1),oe>o+t&&(oe-=t),fe=o;fe<o+t;fe++)re[fe].tabInfo&&(re[fe].tabInfo.backgroundColor&&(re[fe].backgroundColor=re[fe].tabInfo.backgroundColor),re[fe].tabInfo.color&&re[fe].label&&(re[fe].color=re[fe].tabInfo.color)),R?re[fe].noTap():re[fe].off((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",re[fe].zimTabEvent),re[fe].removeFrom();return re.splice(o,t),ne.splice(o,t),we(),$},$.keyEvent=function(t){if($.keyEnabled&&$.keyFocus&&!$.zimAccessibility&&9==t.keyCode){var o=oe;t.shiftKey?Ce(--o<0?V?n.length-1:0:o):Ce(++o>n.length-1?V?0:n.length-1:o),$.dispatchEvent("change"),$.dispatchEvent("keychange"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update(),t.preventDefault()}},WW.addEventListener("keydown",$.keyEvent),Object.defineProperty(this,"selected",{get:function(){return re[oe]},set:function(){zon&&zogy("Tabs() - selected is read only - try selectedIndex")}}),Object.defineProperty(this,"selectedIndex",{get:function(){return oe},set:function(t){Ce(t),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()}}),this.last=function(){return this.selectedIndex=this.buttons.length-1,this},this.first=function(){return this.selectedIndex=0,this},Object.defineProperty(this,"tabs",{get:function(){return oe},set:function(t){Ce(Math.min(Math.max(t,0),n.length-1)),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()}}),Object.defineProperty(this,"color",{get:function(){return $.buttons[0].tabItems?$.buttons[0].tabItems.color:c},set:function(t){if(c=t,$.buttons[0].tabInfo){for(var o=0;o<$.buttons.length;o++)$.buttons[o].tabInfo&&($.buttons[o].tabInfo.color=t),o==oe&&m||($.buttons[o].color=c);e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()}}}),Object.defineProperty(this,"rollColor",{get:function(){return $.buttons[0].tabItems?$.buttons[0].tabItems.rollColor:u},set:function(t){if(u=t,$.buttons[0].tabInfo){for(var o=0;o<$.buttons.length;o++)$.buttons[o].tabInfo&&($.buttons[o].tabInfo.rollColor=t),$.buttons[o].rollColor=u,o!=oe&&$.buttons[o].rolled&&($.buttons[o].color=u);e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()}}}),Object.defineProperty(this,"selectedColor",{get:function(){return $.buttons[0].tabItems?$.buttons[0].tabItems.selectedColor:d},set:function(t){if(d=t,$.buttons[0].tabInfo){for(var o=0;o<$.buttons.length;o++)$.buttons[o].tabInfo&&($.buttons[o].tabInfo.selectedColor=t),o==oe&&m&&($.buttons[o].color=d);e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()}}}),Object.defineProperty(this,"selectedRollColor",{get:function(){return $.buttons[0].tabItems?$.buttons[0].tabItems.selectedRollColor:h},set:function(t){if(h=t,$.buttons[0].tabInfo){for(var o=0;o<$.buttons.length;o++)$.buttons[o].tabInfo&&($.buttons[o].tabInfo.selectedRollColor=t),o==oe&&m&&$.buttons[o].rolled&&($.buttons[o].color=h);e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()}}}),Object.defineProperty(this,"backgroundColor",{get:function(){return $.buttons[0].tabItems?$.buttons[0].tabItems.backgroundColor:i},set:function(t){if(i=t,$.buttons[0].tabInfo){for(var o=0;o<$.buttons.length;o++)$.buttons[o].tabInfo&&($.buttons[o].tabInfo.backgroundColor=t),o==oe&&m||($.buttons[o].backgroundColor=i);e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()}}}),Object.defineProperty(this,"rollBackgroundColor",{get:function(){return $.buttons[0].tabItems?$.buttons[0].tabItems.rollBackgroundColor:a},set:function(t){if(a=t,$.buttons[0].tabInfo){for(var o=0;o<$.buttons.length;o++)$.buttons[o].tabInfo&&($.buttons[o].tabInfo.rollBackgroundColor=t),$.buttons[o].rollBackgroundColor=a,o!=oe&&$.buttons[o].rolled&&($.buttons[o].backgroundColor=a);e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()}}}),Object.defineProperty(this,"selectedBackgroundColor",{get:function(){return $.buttons[0].tabItems?$.buttons[0].tabItems.selectedBackgroundColor:l},set:function(t){if(l=t,$.buttons[0].tabInfo){for(var o=0;o<$.buttons.length;o++)$.buttons[o].tabInfo&&($.buttons[o].tabInfo.selectedBackgroundColor=t),o==oe&&m&&($.buttons[o].backgroundColor=l);e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()}}}),Object.defineProperty(this,"selectedRollBackgroundColor",{get:function(){return $.buttons[0].tabItems?$.buttons[0].tabItems.selectedRollBackgroundColor:s},set:function(t){if(s=t,$.buttons[0].tabInfo){for(var o=0;o<$.buttons.length;o++)$.buttons[o].tabInfo&&($.buttons[o].tabInfo.selectedRollBackgroundColor=t),o==oe&&m&&$.buttons[o].rolled&&($.buttons[o].backgroundColor=s);e.OPTIMIZE||!zns&&WW.OPTIMIZE||!$.stage||$.stage.update()}}}),Object.defineProperty(this,"label",{get:function(){return ne[oe]},set:function(){zon&&zogy("Tabs() - selected is read only - try selectedIndex")}}),Object.defineProperty(this,"text",{get:function(){return null!=ne[oe]?ne[oe].text:void 0},set:function(){zon&&zogy("Tabs() - selected is read only - try selectedIndex")}}),Object.defineProperty(this,"buttons",{get:function(){return re},set:function(){zon&&zogy("Tabs() - buttons is read only")}}),Object.defineProperty(this,"labels",{get:function(){return ne},set:function(){zon&&zogy("Tabs() - labels is read only")}}),this._enabled=!0,Object.defineProperty($,"enabled",{get:function(){return $._enabled},set:function(e){r($,e)}}),null!=WW.KEYFOCUS&&(e.KEYFOCUS=WW.KEYFOCUS),Object.defineProperty(this,"keyFocus",{get:function(){return e.KEYFOCUS==$},set:function(){e.KEYFOCUS=$}}),v&&e.KEYFOCUS&&xe(),this.on("mousedown",(function(){v&&xe()}));var ke=$.getBounds();zot(ke)||0==ke.width?$.setBounds(0,0,t,o):$.width=t,zot(F)&&(F=null!=K.selectedIndex?K.selectedIndex:0),$.selectedIndex=F,!1!==G&&e.styleTransforms(this,K),this.clone=function(){for(var r=e.copy(n,!0),q=0;q<r.length;q++)r[q].label=r[q].label.clone();return $.cloneProps(new e.Tabs(t,o,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,this.group,U))},this.doDispose=function(t,o,r){$.keyEvent&&WW.removeEventListener("keydown",$.keyEvent),e.loop($.buttons,(function(e){e.dispose()})),$.keyEvent=null,r||this.zimContainer_dispose(!0),m=te=n=ne=ee=re=be=null}},e.extend(e.Tabs,e.Container,["clone","dispose"],"zimContainer",!1),e.Tabs.prototype.dispose=function(e){return this.doDispose(null,null,e)},e.Pad=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M){var O,j="width, cols, rows, keys, backgroundColor, rollBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, color, rollColor, selectedColor, selectedRollColor, spacing, currentEnabled, corner, labelColor, gradient, gloss, backing, rollBacking, wait, waitTime, waitBackgroundColor, rollWaitBackgroundColor, waitColor, rollWaitColor, waitModal, waitEnabled, selectedIndex, style, group, inherit";if(O=zob(e.Pad,arguments,j,this))return O;z_d("66"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Pad",this.group=W;var L,D=!1===S?{}:e.getStyle(this.type,this.group,M);if(zot(t)&&(t=null!=D.width?D.width:150),zot(o)&&(o=null!=D.cols?D.cols:3),zot(n)&&(n=null!=D.rows?D.rows:o),zot(i))if(null!=D.keys)i=D.keys;else for(i=[],L=1;L<=n*o;L++)i.push(L);zot(f)&&(f=null==D.currentEnabled||D.currentEnabled),zot(p)&&(p=null!=D.spacing?D.spacing:1);var _,Y=this;this.cols=o,this.rows=n;var X,R=t/o-p,H=[],F=0;for(this.labels=[],this.buttons=[],L=0;L<n;L++){for(var N=[],V=0;V<o;V++)N.push(null!=i[F]?i[F]:""),F++;var G=null!=D.corner?D.corner:m;G&&!Array.isArray(G)&&(G=[G,G,G,G]),X=H[L]=new e.Tabs({width:t,height:R,tabs:N,backgroundColor:null!=D.backgroundColor?D.backgroundColor:a,rollBackgroundColor:null!=D.rollBackgroundColor?D.rollBackgroundColor:l,selectedBackgroundColor:null!=D.selectedBackgroundColor?D.selectedBackgroundColor:s,color:null!=D.color?D.color:u,rollColor:null!=D.rollColor?D.rollColor:d,selectedColor:null!=D.selectedColor?D.selectedColor:h,spacing:null!=D.spacing?D.spacing:p,currentEnabled:null!=D.currentEnabled?D.currentEnabled:f,corner:G,backing:null!=D.backing?D.backing.clone():b,rollBacking:null!=D.rollBacking?D.rollBacking.clone():w,base:null,keyEnabled:!1,gradient:null!=D.gradient?D.gradient:y,gloss:null!=D.gloss?D.gloss:v,wait:null!=D.wait?D.wait:C,waitTime:null!=D.waitTime?D.waitTime:x,waitBackgroundColor:null!=D.waitBackgroundColor?D.waitBackgroundColor:k,rollWaitBackgroundColor:null!=D.rollWaitBackgroundColor?D.rollWaitBackgroundColor:T,waitColor:null!=D.waitColor?D.waitColor:A,rollWaitColor:null!=D.rollWaitColor?D.rollWaitColor:P,waitModal:null!=D.waitModal?D.waitModal:B,waitEnabled:null!=D.waitEnabled?D.waitEnabled:E,group:W,style:!1}),this.labels=this.labels.concat(X.labels),this.buttons=this.buttons.concat(X.buttons),this.addChild(X),X.selectedIndex=-1,X.y=(R+p)*L,X.znum=L,X.on("change",q)}function q(t){var n=t.target;Y.selected=n.selected,Y.text=n.text,Y.label=n.label;for(var r=n.selectedIndex,i=0;i<H.length;i++)H[i].selectedIndex=-1;n.selectedIndex=r,_=n.znum*o+r,Y.dispatchEvent("change"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!Y.stage||Y.stage.update()}this.tabs=H,Object.defineProperty(this,"selectedIndex",{get:function(){return _},set:function(e){_=e;for(var t=0;t<H.length;t++)H[t].selectedIndex=-1;var n=Math.floor(_/o);n>=0&&n<Y.tabs.length&&(Y.tabs[n].selectedIndex=_%o)}}),this._enabled=!0,Object.defineProperty(Y,"enabled",{get:function(){return Y._enabled},set:function(e){r(Y,e)}}),zot(I)&&(I=null!=D.selectedIndex?D.selectedIndex:0),Y.selectedIndex=I,!1!==S&&e.styleTransforms(this,D),this.clone=function(){return Y.cloneProps(new e.Pad(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,this.group,M))},this.dispose=function(t,o,n){e.loop(H,(function(e){e.dispose()})),this.labels=this.buttons=this.tabs=null,X=H=Y.rowTabs=null,n||this.zimContainer_dispose(!0)}},e.extend(e.Pad,e.Container,["clone","dispose"],"zimContainer",!1),e.DPad=function(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,z,y){var v,b="axis, width, backgroundColor, borderWidth, borderColor, indicatorColor, indicatorPressColor, indicatorScale, indicatorRadius, innerCircle, innerScale, activeRadius, clamp, logo, style, group, inherit";if(v=zob(e.DPad,arguments,b,this))return v;z_d("66.2"),this.zimContainer_constructor(null,null,null,null,!1),this.type="DPad",this.group=z;var w=!1===m?{}:e.getStyle(this.type,this.group,y);zot(t)&&(t=null!=w.axis?w.axis:"all"),zot(o)&&(o=null!=w.width?w.width:100),zot(n)&&(n=null!=w.backgroundColor?w.backgroundColor:"#666666"),zot(a)&&(a=null!=w.borderColor?w.borderColor:null),zot(i)&&(i=null!=w.borderWidth?w.borderWidth:null),a<0||i<0?a=i=null:null!=a&&null==i&&(i=1),zot(l)&&(l=null!=w.indicatorColor?w.indicatorColor:"#dddddd"),zot(s)&&(s=null!=w.indicatorPressColor?w.indicatorPressColor:"#eeeeee"),zot(c)&&(c=null!=w.indicatorScale?w.indicatorScale:1),zot(u)&&(u=null!=w.indicatorRadius?w.indicatorRadius:null),zot(d)&&(d=null==w.innerCircle||w.innerCircle),zot(h)&&(h=null!=w.innerScale?w.innerScale:.5),zot(g)&&(g=null!=w.activeRadius?w.activeRadius:o),zot(p)&&(p=null==w.clamp||w.clamp),zot(f)&&(f=null!=w.logo&&w.logo);var C=this;this.axis=t,this.outer=new e.Circle(o/2,n,a,i).addTo(this);var x=this.inner=new e.Circle(o*h/2,"rgba(0,0,0,.2)").center(this);f&&(this.logo=new e.Label({text:"D",bold:!0}).center(x).mov(1,2).alp(.3));var k=(new e.Container).addTo(this),T=.2*(o-i)*c,A=8;"vertical"==t?A=2:"horizontal"==t?(A=2,k.rotation=90):"both"==t&&(A=4),e.loop(A,(function(t,n){new e.Triangle(T,T,T,l).addTo(k).reg(null,zot(u)?.475*(o-i):u).rot(360*t/n)}));var P,B,E=0,I=0,S=!0;function W(){var t=B;E=t.stageX/e.scaX,I=t.stageY/e.scaY,P=C.globalToLocal(E,I),(t=new createjs.Event("change")).dirX=2*((P.x+g)/(2*g)-.5),t.dirY=2*((P.y+g)/(2*g)-.5),p&&(t.dirX=e.constrain(t.dirX,-1,1),t.dirY=e.constrain(t.dirY,-1,1)),C.dirX=t.dirX,C.dirY=t.dirY,C.dispatchEvent(t)}this.on("mousedown",(function(t){B=t,k.loop((function(e){e.color=s})),S?C.ticker=e.Ticker.add((function(){W()})):e.Ticker.add(C.ticker)})),this.on("pressmove",(function(e){B=e})),this.on("pressup",(function(){e.Ticker.remove(C.ticker),C.dirX=C.dirY=0,k.loop((function(e){e.color=l})),C.stage&&C.stage.update()})),this._enabled=!0,Object.defineProperty(C,"enabled",{get:function(){return C._enabled},set:function(e){r(C,e)}}),e.styleTransforms(this,w),this.clone=function(){return C.cloneProps(new e.DPad(t,o,n,i,a,l,s,c,u,d,h,g,p,f,m,this.group,y))},this.dispose=function(t,o,n){return this.ticker&&e.Ticker.remove(this.ticker),n||this.zimContainer_dispose(!0),!0}},e.extend(e.DPad,e.Container,["clone","dispose"],"zimContainer",!1),e.Radial=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_){var Y,X="labels, size, font, height, coreRadius, coreColor, startAngle, totalAngle, angles, flip, shiftRadial, icons, rollIcons, rotateIcons, iconsShiftRadial, backgroundColor, rollBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, selectedColor, selectedRollColor, borderColor, borderWidth, gradient, gap, gapAsAngle, spacing, spacingInner, spacingOuter, currentEnabled, currentSelected, selectedIndex, style, group, inherit";if(Y=zob(e.Radial,arguments,X,this))return Y;z_d("66.4"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Radial",this.group=D;var R=!1===L?{}:e.getStyle(this.type,this.group,_);zot(t)&&(t=null!=R.labels?R.labels:["A","B","C","D","E"]),zot(o)&&(o=null!=R.size?R.size:30),zot(n)&&(n=null!=R.font?R.font:"verdana"),zot(l)&&(l=null!=R.startAngle?R.startAngle:null),zot(s)&&(s=null!=R.totalAngle?R.totalAngle:360),zot(c)&&(c=null!=R.angles?R.angles:null),zot(u)&&(u=null==R.flip||R.flip),zot(d)&&(d=null!=R.shiftRadial?R.shiftRadial:0),zot(h)&&(h=null!=R.icons?R.icons:null),zot(g)&&(g=null!=R.rollIcons?R.rollIcons:null),zot(p)&&(p=null!=R.rotateIcons&&R.rotateIcons),zot(f)&&(f=null!=R.iconsShiftRadial?R.iconsShiftRadial:0),zot(r)&&(r=null!=R.height?R.height:60),zot(i)&&(i=null!=R.coreRadius?R.coreRadius:100),zot(a)&&(a=null!=R.coreColor?R.coreColor:"#333"),zot(b)&&(b=null!=R.backdropColor?R.backdropColor:e.clear),zot(m)&&(m=null!=R.backgroundColor?R.backgroundColor:"#666"),zot(z)&&(z=null!=R.rollBackgroundColor?R.rollBackgroundColor:"#777"),zot(y)&&(y=null!=R.selectedBackgroundColor?R.selectedBackgroundColor:"#444"),zot(v)&&(v=null!=R.selectedRollBackgroundColor?R.selectedRollBackgroundColor:y),zot(w)&&(w=null!=R.color?R.color:"white"),zot(C)&&(C=null!=R.rollColor?R.rollColor:w),zot(x)&&(x=null!=R.selectedColor?R.selectedColor:w),zot(k)&&(k=null!=R.selectedRollColor?R.selectedRollColor:C),zot(T)&&(T=null!=R.borderColor?R.borderColor:"#333"),zot(A)&&(A=null!=R.borderWidth?R.borderWidth:2),zot(E)&&(E=null!=R.gapAsAngle&&R.gapAsAngle),zot(B)&&(B=null!=R.gap?R.gap:E?3:6),zot(P)&&(P=null!=R.gradient?R.gradient:null),!0===P&&(P=.1),zot(I)&&(I=null!=R.spacing?R.spacing:6),zot(S)&&(S=null!=R.spacingInner?R.spacingInner:I),zot(W)&&(W=null!=R.spacingOuter?R.spacingOuter:I),zot(M)&&(M=null!=R.currentEnabled&&R.currentEnabled),zot(O)&&(O=null==R.currentSelected||R.currentSelected);var H=this,F=this.innerRadius=i+S,N=this.outerRadius=F+r;this.setBounds(-N,-N,2*N,2*N);var V=this.backdrop=new e.Circle(N+W,b).center(this);if(i>0&&(this.core=new e.Circle(i,a).center(this)),c&&c.length<t.length-1)return zon&&zogy("Radial() - not enough angles provided"),this;if(t&&t.length>0||h&&h.length>0){var G;if(t&&t.length>0&&(G=t.length),h&&h.length>0&&(G=G>0?Math.min(h.length,G):h.length),g&&g.length<G)for(var q=0;q<G-g.length;q++)g.push(new e.Circle(1,e.clear));var U=V.width,Q=this.buttons=new e.Container(-U/2,-U/2,U,U).centerReg(this),Z=B;E||(B=B/N*180/Math.PI,Z=Z/F*180/Math.PI);for(var K=(s-B*G+(360==s?0:B))/G,J=l||0,$=0;$<G;$++){c&&(K=c[$]);var ee=new e.Shape(-U/2,-U/2,U,U).centerReg(Q);ee.num=$,ee.zimSelected=!1,ee.angle=K;var te=ee.graphics;ee.backgroundColor=e.Pick.choose(m),ee.rollBackgroundColor=e.Pick.choose(z),ee.selectedBackgroundColor=e.Pick.choose(y),ee.selectedRollBackgroundColor=e.Pick.choose(v),ee.color=e.Pick.choose(w),ee.rollColor=e.Pick.choose(C),ee.selectedColor=e.Pick.choose(x),ee.selectedRollColor=e.Pick.choose(k),ee.colorCommand=te.f(ee.backgroundColor).command,(zot(A)||A>0)&&(zot(T)&&zot(A)||(zot(T)&&(T="black"),ee.borderColorCommand=te.s(T).command,ee.borderWidthCommand=te.ss(A).command));var oe=(J-90-K/2)*Math.PI/180,ne=(J-90+K/2)*Math.PI/180,re=(J-90+(K+B-Z)/2)*Math.PI/180,ie=(J-90-(K+B-Z)/2)*Math.PI/180;if(te.arc(0,0,N,oe,ne,!1),te.arc(0,0,F,re,ie,!0).cp(),P&&(te.s().ss().rf(["rgba(0,0,0,"+P+")","rgba(255,255,255,"+P+")"],[0,1],0,0,F,0,0,N),te.arc(0,0,N,oe,ne,!1),te.arc(0,0,F,re,ie,!0).cp()),ee.cursor="pointer",ee.zimOverEvent=ee.on("mouseover",(function(e){var t=e.target;t.colorCommand.style=t==H.selected&&O?t.selectedRollBackgroundColor:t.rollBackgroundColor,t.label&&(t.label.color=t==H.selected&&O?t.selectedRollColor:t.rollColor),g&&(t.holder.removeAllChildren(),g[t.num].loc(1,0,t.holder)),H.stage&&H.stage.update()})),ee.zimOutEvent=ee.on("mouseout",(function(e){var t=e.target;t.colorCommand.style=t==H.selected&&O?t.selectedBackgroundColor:t.backgroundColor,t.label&&(t.label.color=t==H.selected&&O?t.selectedColor:t.color),g&&(t.holder.removeAllChildren(),h&&h[t.num].loc(1,0,t.holder)),H.stage&&H.stage.update()})),ee.zimDownEvent=ee.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(t){var o=t.target,n=o!==H.selected;H.lastSelected=H.selected,de=o.num,O?n?(H.selected&&(H.selected.colorCommand.style=H.selected.backgroundColor,H.selected.label&&(H.selected.label.color=H.selected.color)),H.selected=o,H.label=o.label,H.label&&(H.text=H.label.text),H.icon=o.icon,o.colorCommand.style=o.selectedRollBackgroundColor,o.label&&(o.label.color=o.selectedRollColor)):M||(de=-1,H.selected=null,H.label=null,H.text=null,H.icon=null,o.colorCommand.style=o.rollBackgroundColor,o.label&&(o.label.color=o.rollColor)):(H.selected=o,H.label=o.label,H.label&&(H.text=H.label.text),H.icon=o.icon),H.dispatchEvent("change"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!H.stage||H.stage.update()})),h&&h.length>0){var ae=F+r/2+f,le=ee.holder=new e.Container(3,ae).addTo(this).reg(1,ae).rot(J);le.mouseChildren=!1,le.mouseEnabled=!1,ee.icon=h[$],h[$].loc(1,0,le),p||(h[$].rotation=-J)}if(t&&t.length>0){var se;if("LabelOnArc"!=t[$].type){var ce="Label"==t[$].type?t[$]:new e.Label({text:t[$],size:o,font:n,color:w,style:L,inherit:_});se=new e.LabelOnArc({label:ce,color:w,size:o,spacing:-5,flip:u&&J>90&&J<270,radius:F+(r-ce.height)/2+2+d,style:L,inherit:_})}else se=t[$];t[$]=se,ee.label=se,se.center(this).rot(J),se.mouseChildren=!1,se.mouseEnabled=!1}if($!=t.length-1){var ue=c?c[$+1]:K;J+=(K+ue)/2+B}}zot(l)||(H.rotation+=H.buttons.getChildAt(0).angle/2)}var de=null;Object.defineProperty(this,"selectedIndex",{get:function(){return de},set:function(t){var o;H.buttons&&(o=H.buttons.getChildAt(t)),o!==H.selected&&(H.selected&&(H.selected.colorCommand.style=H.selected.backgroundColor,H.selected.label&&(H.selected.label.color=H.selected.color)),H.selected=o,o&&(O&&(o.colorCommand.style=o.selectedRollBackgroundColor),o.label&&(O&&(o.label.color=o.selectedColor),H.text=o.label.text))),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!H.stage||H.stage.update()}}),zot(j)&&(j=null!=R.selectedIndex?R.selectedIndex:0),H.selectedIndex=j,e.styleTransforms(this,R),this.clone=function(){return H.cloneProps(new e.Radial(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,this.group,_))}},e.extend(e.Radial,e.Container,"clone","zimContainer",!1),e.RadialMenu=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_){var Y,X="menu, size, font, height, coreRadius, coreColor, title, titleIcon, startAngle, totalAngle, flip, shiftRadial, rotateIcons, iconsShiftRadial, backgroundColor, rollBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, selectedColor, selectedRollColor, borderColor, borderWidth, gradient, gap, gapAsAngle, spacing, spacingInner, spacingOuter, currentEnabled, currentSelected, open, under, style, group, inherit",R=X.split(", "),H=!1;if(t&&t.constructor==={}.constructor)for(var F in t)if(R.indexOf(F)>=0){H=!0;break}if(t&&H&&(Y=zob(e.RadialMenu,arguments,X,this)))return Y;z_d("66.6"),this.zimContainer_constructor(null,null,null,null,!1),this.type="RadialMenu",this.group=D;var N=!1===L?{}:e.getStyle(this.type,this.group,_);zot(t)&&(t=null!=N.menu?N.menu:{A:{A1:["AA1","AA2","AA3","AA4"],A2:[],A3:[]},B:["B1","B2","B3","B4","B5","B6"],C:[]}),zot(o)&&(o=null!=N.size?N.size:30),zot(n)&&(n=null!=N.font?N.font:"verdana"),zot(c)&&(c=null!=N.startAngle?N.startAngle:null),zot(u)&&(u=null!=N.totalAngle?N.totalAngle:360),zot(d)&&(d=null==N.flip||N.flip),zot(g)&&(g=null!=N.rotateIcons&&N.rotateIcons),zot(h)&&(h=null!=N.shiftRadial?N.shiftRadial:0),zot(p)&&(p=null!=N.iconsShiftRadial?N.iconsShiftRadial:0),zot(r)&&(r=null!=N.height?N.height:60),zot(i)&&(i=null!=N.coreRadius?N.coreRadius:100),zot(a)&&(a=null!=N.coreColor?N.coreColor:"#333"),zot(l)&&(l=null!=N.title?N.title:"MENU"),zot(s)&&(s=null!=N.titleIcon?N.titleIcon:null),zot(v)&&(v=null!=N.backdropColor?N.backdropColor:e.clear),zot(f)&&(f=null!=N.backgroundColor?N.backgroundColor:"#666"),zot(m)&&(m=null!=N.rollBackgroundColor?N.rollBackgroundColor:"#777"),zot(z)&&(z=null!=N.selectedBackgroundColor?N.selectedBackgroundColor:"#444"),zot(y)&&(y=null!=N.selectedRollBackgroundColor?N.selectedRollBackgroundColor:z),zot(b)&&(b=null!=N.color?N.color:"white"),zot(w)&&(w=null!=N.rollColor?N.rollColor:b),zot(C)&&(C=null!=N.selectedColor?N.selectedColor:b),zot(x)&&(x=null!=N.selectedRollColor?N.selectedRollColor:w),zot(k)&&(k=null!=N.borderColor?N.borderColor:"#333"),zot(T)&&(T=null!=N.borderWidth?N.borderWidth:2),zot(B)&&(B=null!=N.gapAsAngle&&N.gapAsAngle),zot(P)&&(P=null!=N.gap?N.gap:B?3:6),zot(E)&&(E=null!=N.spacing?N.spacing:6),zot(A)&&(A=null!=N.gradient?N.gradient:null),!0===A&&(A=.1),zot(I)&&(I=null!=N.spacingInner?N.spacingInner:E),zot(S)&&(S=null!=N.spacingOuter?N.spacingOuter:E),zot(W)&&(W=null!=N.currentEnabled&&N.currentEnabled),zot(M)&&(M=null==N.currentSelected||N.currentSelected),zot(O)&&(O=null!=N.open&&N.open),zot(j)&&(j=null==N.under||N.under);var V=this,G=(zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",q=null,U=this.core=new e.Circle({radius:i,color:a,style:L,inherit:_}).addTo(this);s&&(this.titleIcon=s.center(U)),l&&(this.title=new e.Label({text:l,size:o,font:n,color:b,style:L,inherit:_}).center(U)),U.cursor="pointer",U.on(G,(function(){V.leafNode=!1,0==J.length?$():(e.loop(J,(function(e){e.selectedIndex=-1,e.removeFrom(),J=[]})),V.outerLevel=0,V.selected=V.outerMenu=V.selectedMenu=V.text=null),(W||V.selected!=q)&&V.dispatchEvent("change"),q=V.selected,V.stage&&V.stage.update()})),this.closeRings=function(t){zot(t)&&(t=V.outerLevel);var o=V.outerLevel-t;e.loop(J,(function(e,t){t>o-1&&(e.removeFrom(),e.selectedIndex=-1,J.pop())}),!0),V.outerLevel=o,V.outerMenu=J[J.length-1],V.outerMenu&&(V.outerMenu.selectedIndex=-1),V.selected=V.selectedMenu=V.text=null,J[J.length-2]?(V.selectedMenu=J[J.length-2],V.selectedIndex=V.selectedMenu.selectedIndex):V.selectedIndex=-1,V.selected!=q&&V.dispatchEvent("change"),q=V.selected,V.stage&&V.stage.update()};var Q,Z,K={};V.outerLevel=0,t.constructor=={}.constructor&&(t={core:t},Q=V.tree=new e.Hierarchy(t),Z=Q.getLinearIDs()),V.lastRadial=null;var J=this.radials=[];function $(t){var o,n,r;if(t?o=t.ringLevel:(o=0,n=i),e.loop(J,(function(e,t){t>o-1&&(e.removeFrom(),e.selectedIndex=-1,J.pop())}),!0),t&&(r=t.selected),r){var a=r.id;n=t.outerRadius,ee(a,o+1,n)}else t||ee("id0",o+1,n);V.selected=r,V.selected?(V.selectedMenu=J[V.selected.menu.ringLevel-1],V.selectedIndex=V.selected.num,V.selected.label?V.text=V.selected.label.text:V.text=null):W&&t?(V.selectedIndex=t.selectedIndex,V.label=t.label,V.text=t.text,V.icon=t.icon,V.selectedMenu=t):(V.text=null,V.selectedIndex=-1,V.selectedMenu=null),V.stage&&V.stage.update()}function ee(t,i,a){var l;if(i&&(V.outerLevel=i),!K[t]){var s=Q.getData(t),E=s.list;if(E&&!e.isEmpty(E)){var O={labels:Q.getLinearList(E),coreRadius:a,size:o,font:n,startAngle:c,totalAngle:u,flip:d,rotateIcons:g,shiftRadial:h,iconsShiftRadial:p,height:r,coreColor:e.clear,backdropColor:v,backgroundColor:f,rollBackgroundColor:m,selectedBackgroundColor:z,selectedRollBackgroundColor:y,color:b,rollColor:w,selectedColor:C,selectedRollColor:x,borderColor:k,borderWidth:T,gapAsAngle:B,gap:P,gradient:A,spacingInner:I,spacingOuter:S,currentSelected:M,currentEnabled:W,style:L,inherit:_};s.styles&&(O=e.merge(O,s.styles)),l=K[t]=new e.Radial(O),Z=Q.getLinearIDs(E),l.buttons.loop((function(e,t){e.menu=l,e.id=Z[t]})),l.ringLevel=V.outerLevel,l.selectedIndex=-1,l.on("change",(function(e){V.leafNode=!1,$(e.target),(W||V.selected!=q)&&V.dispatchEvent("change"),q=V.selected}))}}K[t]?(J.push(K[t]),K[t].center(V),j&&K[t].bot()):(V.leafNode=!0,V.outerLevel-=1),V.outerMenu=l}O&&$(),e.styleTransforms(this,N),this.clone=function(){return V.cloneProps(new e.RadialMenu(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,this.group,_))}},e.extend(e.RadialMenu,e.Container,"clone","zimContainer",!1),e.ColorPicker=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E){var I,S="width, colors, cols, spacing, greyPicker, alphaPicker, startBackgroundColor, draggable, shadowColor, shadowBlur, buttonBar, circles, indicator, backgroundColor, keyArrows, container, selectedIndex, selectedColor, dropperTarget, spectrumCollapse, spectrumMode, spectrumClose, spectrumOk, spectrumTitle, tolerancePicker, collapsed, style, group, inherit";if(I=zob(e.ColorPicker,arguments,S,this))return I;z_d("67"),this.zimContainer_constructor(null,null,null,null,!1),this.type="ColorPicker",this.group=B;var W,M=!1===P?{}:e.getStyle(this.type,this.group,E);zot(t)&&(t=null!=M.width?M.width:500),zot(o)&&(o=null!=M.colors?M.colors:"spectrum"),"legacy"==o&&(W=!0),zot(n)&&(n=null!=M.cols?M.cols:10),zot(r)&&(r=null!=M.spacing?M.spacing:2);var O=!W&&o.length>0&&o.length<=n;"spectrum"==o&&(n=10,r=2,O=!1),zot(a)&&(a=null!=M.alphaPicker?M.alphaPicker:!O),zot(T)&&(T=null!=M.tolerancePicker&&M.tolerancePicker),T&&(a=!1),zot(i)&&(i=null!=M.greyPicker?M.greyPicker:!O),zot(c)&&(c=null!=M.shadowColor?M.shadowColor:"rgba(0,0,0,.3)"),zot(u)&&(u=null!=M.shadowBlur?M.shadowBlur:14),zot(d)&&(d=null!=M.buttonBar?M.buttonBar:!O),zot(s)&&(s=d||"spectrum"==o?null==M.draggable||M.draggable:null!=M.draggable&&M.draggable),zot(h)&&(h=null!=M.circles&&M.circles),zot(g)&&(g=null!=M.indicator&&M.indicator,d||(g=null==M.indicator||M.indicator)),zot(p)&&(p=null!=M.backgroundColor?M.backgroundColor:"black"),zot(l)&&(l=null!=M.startBackgroundColor?M.startBackgroundColor:null),zot(f)&&(f=null==M.keyArrows||M.keyArrows),zot(v)&&(v=null!=M.dropperTarget&&M.dropperTarget),zot(b)&&(b=null==M.spectrumCollapse||M.spectrumCollapse),zot(w)&&(w=null==M.spectrumMode||M.spectrumMode),zot(C)&&(C=null==M.spectrumClose||M.spectrumClose),zot(x)&&(x=null==M.spectrumOk||M.spectrumOk),zot(k)&&(k=null!=M.spectrumTitle?M.spectrumTitle:null),zot(A)&&(A=null!=M.collapsed&&M.collapsed);var j=this;if(zot(m)){if(!WW.zdf)return;m=WW.zdf.stage}else{if(!m.getBounds)return;if(zot(m.getStage))return}j.container=m;var L,D,_="#e472c4",Y="#50c4b7",X=1,R=1,H=new createjs.Shape;this.addChild(H),H.x+=r,H.y+=r,W=!1;var F,N,V,G=[],q="spectrum"==o;if(zot(o)||"legacy"==o||"spectrum"==o){W=!0;var U=6,Q=U*U*U;U=Math.ceil(Math.pow(Q,.5)),D=(t-r)/18-r,V=Math.floor(Math.pow(U*U,1/3)),L=[];for(var Z=0;Z<6;Z++)for(var K=0;K<6;K++)for(var J=0;J<6;J++)L.push("#"+re(3*Z)+re(3*K)+re(3*J));for(o=[],Z=0;Z<L.length;Z++)F=Math.floor(Z/6),o[18*((N=Z%6)+6*(V=F>=18?1:0))+(F-6*V*3)]=L[Z];n=18,G=[Y,_]}else D=(t-r)/n-r;var $,ee=Math.ceil(o.length/n),te=1,oe=String(o[o.length-1]);if(!zot(l)){var ne=l.match(/rgba\((.*)\)/);ne&&(te=(F=ne[1].split(",")).pop(),l="rgb("+F.join(",")+")"),oe=String(l)}function re(e){return(e=Math.floor(e).toString(16))+""+e}W&&($=Y),V=0;var ie,ae,le=H.graphics,se=null!=M.borderColor?M.borderColor:null,ce=null!=M.borderWidth?M.borderWidth:null;!zot(se)&&zot(ce)&&(ce=1),ce&&zot(se)&&(se="#333"),ce&&le.s(se).ss(ce);var ue=o.length;for(q&&(ue=56),Z=0;Z<ue;Z++)F=Z%n,N=Math.floor(Z/n),ie=F*(D+r),ae=N*(D+r),h?le.f(o[Z]).dc(ie+D/2,ae+D/2,D/2):le.f(o[Z]).r(ie,ae,D,D);var de=ae+D+r;j.colors=o;var he=de;if(i){for(Z=0;Z<16;Z++)G.push("#"+re(Z)+re(Z)+re(Z));for(Z=0;Z<G.length;Z++)F=Math.floor(Z/n),ie=(N=Z%n)*(D+r),ae=F*(D+r)+de,h?le.f(G[Z]).dc(ie+D/2,ae+D/2,D/2):le.f(G[Z]).r(ie,ae,D,D);de=ae+D+r;var ge=n,pe=Math.ceil(G.length/n)}function fe(e){zot(e)||e<0?g.visible=!1:(g.visible=!0,"#000"==oe||"#000000"==oe||"black"==oe?(g.color="#222",g.alpha=1):(g.color="black",g.alpha=.5),g.x=H.x+e%n*(D+r)+D/2,g.y=H.x+Math.floor(e/n)*(D+r)+D/2)}j.greys=G,g&&!q&&((g=this.indicator=h?new e.Circle(D/2*.5,null,null,null,null,null,null,null,!1):new e.Rectangle(.5*D,.5*D,null,null,null,null,null,null,null,!1)).alpha=.5,g.centerReg(),this.addChild(g),g.mouseEnabled=!1,fe(o.indexOf(oe)));var me=10,ze=de;if(a||T){var ye=new e.Container({style:!1});ye.setBounds(0,0,600,70),this.addChild(ye),ye.x=0,ye.y=de;var ve=this.alphaBacking=new e.Rectangle(600-2*me,50,"#222",null,null,0,null,null,null,!1);ye.addChild(ve),e.centerReg(ve,ye);var be=this.alphaBut=new e.Button({width:20,height:30,backgroundColor:"darkorange",rollBackgroundColor:"orange",label:"",corner:0,hitPadding:20,style:!1}),we=this.alphaSlider=new e.Slider({min:0,max:1,step:T?0:.05,button:be,barLength:T?275:330,barWidth:2,barColor:"#999",vertical:!1,useTicks:!1,inside:!1,style:!1});we.currentValue=zot(te)?1:te,T&&(we.currentValue=.1),ye.addChild(we),we.x=40,we.y=ye.height/2;var Ce=this.alphaText=new e.Label({text:T?"Tolerance: 0.1":"Alpha: "+e.decimals(te),size:30,color:"orange",backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",backgroundColor:"ignore",rollColor:"orange",group:this.group});ye.addChild(Ce),Ce.x=we.x+we.bar.width+40,Ce.y=ye.height/2-Ce.height/2,ye.scaleX=ye.scaleY=t/600,we.on("change",(function(){Ce.text=T?"Tolerance: "+Ct(we.currentValue):"Alpha: "+Ct(we.currentValue),a&&Ee&&(Ee.alpha=R=we.currentValue),j.dispatchEvent("change"),j.stage&&j.stage.update()})),de+=ye.height-me,T&&(j.toleranceBacking=j.alphaBacking,j.toleranceBut=j.alphaBut,j.toleranceSlider=j.alphaSlider,j.alphaBacking=j.alphaBut=j.alphaSlider=null)}if(d){var xe=new e.Container({style:!1});xe.setBounds(0,0,600,100),this.addChild(xe),xe.x=0,xe.y=de+me;var ke=this.swatchText=new e.TextInput({align:"left",selectionAlpha:.5,text:oe.toUpperCase(),width:140,size:30,color:"orange",shadowColor:"ignore",shadowBlur:"ignore",backgroundColor:"ignore",group:this.group});if(ke.on("input",(function(){4!=ke.text.length&&7!=ke.text.length||(Ee.color=ke.text)})),xe.addChild(ke),e.centerReg(ke),ke.x=90,ke.y=48,s){var Te=this.grip=new e.Shape({style:!1});Te.cursor="pointer",xe.addChild(Te),Te.graphics.f("rgba(256,256,256,.25)").r(0,0,5,20).r(10,0,5,20).r(20,0,5,20).r(30,0,5,20),Te.x=70,Te.y=65,ke.y=40,Te.mouseEnabled=!1}var Ae=this.closeBut=new e.Button({width:90,height:90,label:"X",backgroundColor:"#222",rollBackgroundColor:"#444",corner:0,style:!1});xe.addChild(Ae),Ae.x=600-Ae.width-me,Ae.y=0,Ae.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){j.hide(),j.dispatchEvent("close")}));var Pe=this.okBut=new e.Button({width:150,height:90,label:"OK",backgroundColor:"#222",rollBackgroundColor:"#444",corner:0,style:!1});xe.addChild(Pe),Pe.x=Ae.x-Pe.width-me,Pe.y=0,Pe.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",lt);var Be=this.swatchBacking=new e.Shape({style:!1});xe.addChild(Be),(le=Be.graphics).f("black").r(.5,.5,50,89).f("#666").r(50,.5,50,89).f("white").r(100,.5,49.5,89),Be.x=Pe.x-150-me,Be.y=0;var Ee=this.swatch=new e.Rectangle(150,90,oe,null,null,null,null,null,null,!1);xe.addChild(Ee),Ee.x=Be.x,Ee.y=0,Ee.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){j.dispatchEvent("swatch")})),Ee.cursor="pointer",Ee.alpha=R=te,xe.scaleX=xe.scaleY=t/600,de+=xe.height}else H.cursor="pointer";a||d||(de-=me-r);var Ie=de+me;this.setBounds(0,0,t,Ie);var Se=this.background=new e.Rectangle(t,Ie,p,null,null,null,null,null,null,!1);this.addChildAt(Se,0),-1!=c&&u>0&&(Se.shadow=new createjs.Shadow(c,8,8,u));var We,Me=WW.zdf,Oe=!1;if(this.dropperTarget=v,q){o="spectrum";var je=30,Le=20,De=ze-je+1,_e=De-Le+1,Ye=j.bar=new e.Rectangle(j.width,je+1,e.black).addTo(j);k&&(j.title=new e.Label(k,18,null,e.light).pos(12,1,LEFT,CENTER,j.bar).noMouse()),s&&Ye.cur();var Xe=new e.Container(j.width,De).loc(0,je,j),Re=new e.Rectangle(j.width,_e,new e.GradientColor(["rgb(255 0 0)","rgb(255 255 0)","rgb(0 255 0)","rgb(0 255 255)","rgb(0 0 255)","rgb(255 0 255)","rgb(255 0 0)"],[0,1/6,2/6,.5,4/6,5/6,1],0,0,500,0)).addTo(Xe).mov(0,Le-1);new e.Rectangle(j.width,_e/2,new e.GradientColor(["rgba(255,255,255,1)","rgba(255,255,255,0)"],[0,1],0,0,0,_e/2)).loc(Re,null,Xe),new e.Rectangle(j.width,_e/2+.5,new e.GradientColor(["rgba(0,0,0,1)","rgba(0,0,00,0)"],[1,0],0,0,0,_e/2+.5)).loc(Re,null,Xe).mov(0,_e/2),new e.Rectangle(j.width,20,new e.GradientColor(["black","white"],[.1,.9],0,0,j.width,0)).addTo(Xe);var He,Fe=j.gradient=new e.Bitmap(Xe).loc(Xe,null,j).cur("none"),Ne=j.pixels=new e.Pixel(Xe,.5).loc(Xe,null,j).vis(!1).cur("none");Xe.dispose(),!d&&C&&((He=j.closeIcon=new e.Shape(-40,-40,80,80,null,!1)).graphics.f(e.light).p("AmJEVIEUkTIkXkWIB4h5IEWEYIETkTIB4B3IkTESIEQERIh4B4IkRkRIkSEVg"),He.sca(.25).expand(10,10,10,1).pos(7,0,e.RIGHT,e.CENTER,Ye).cur().addTo(j),He.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){j.hide(),j.dispatchEvent("close")})));var Ve=j.collapseIcon=new e.Triangle(20,20,20,e.faint,e.light,2).expand(10,10,10,1).pos(40+(He?30:0),0,e.RIGHT,e.CENTER,Ye).cur().addTo(j);Ve.on("mousedown",(function(){j.collapse(0==Ve.rotation)}));var Ge=new e.Rectangle(20,20,e.white).reg("center");new e.Tile(new e.Rectangle(10,10,e.series(e.silver,e.white,e.white,e.silver)),2,2,0,0).addTo(Ge),Ge.mouseChildren=!1;var qe=j.modeIcon=new e.Button({width:20,height:20,shadowColor:-1,label:"",backing:Ge,toggleEvent:"mousedown",toggleBacking:new e.Rectangle(20,20,new e.GradientColor([e.white,e.grey],[0,1],0,0,20,20)).reg("center")}).pos(8+(He?30:0),5,e.RIGHT,e.TOP,j).expand(10,10,10,1);qe.on("mousedown",(function(){Ne.vis(qe.toggled),j.spectrumToggled=!qe.toggled,Me.stage.update()})),w||(qe.removeFrom(),Ve.mov(28)),b||Ve.removeFrom(),x||j.okBut&&j.okBut.removeFrom(),!C&&Ae&&Ae.removeFrom();var Ue=new e.Rectangle(j.width,j.height-De-je,e.faint).pos(0,0,e.LEFT,e.BOTTOM,j).noMouse(),Qe=this.dropper=new e.Circle(10,e.clear,e.white,8);new e.Circle(5,e.clear,e.black,2).center(Qe),new e.Circle(7,e.clear,e.white,2).center(Qe),Qe.noMouse()}this.updateDropperTarget=function(){Qe.vis(!1),rt(),Qe.vis(!0).top()},this.spectrumToggled=q,this.toggleSpectrum=function(e){e!=j.spectrumToggled&&(zot(e)&&(e=!j.spectrumToggled),j.spectrumToggled=e,qe.toggle(!e),Ne.vis(!e),j.updateDropperTarget())};var Ze,Ke,Je=!1;function $e(){var e,t;if(Me.stage.mouseInBounds?Qe.alp(1):Qe.alp(0),Qe.loc(Me.mouseX,Me.mouseY),Je=j.spectrumToggled?Fe.hitTestReg(Qe):Ne.hitTestReg(Qe),e=!!j.dropperTarget&&(Qe.x>=We.x&&Qe.x<=We.x+We.width&&Qe.y>=We.y&&Qe.y<=We.y+We.height),t=j.dropperTarget?(Je||e)&&!Ue.hitTestReg(Qe)&&!Ye.hitTestReg(Qe):Je,!Oe&&t)et(e);else if(Oe&&!t)return tt(),void Me.stage.update();if(t){var o;if(Je)o=j.spectrumToggled?Fe:Ne;else{if(!j.dropperTarget)return;o=We}var n=o.globalToLocal(Me.mouseX,Me.mouseY),r=o.getColorAt(n.x,n.y,!0),i="rgba("+r[0]+","+r[1]+","+r[2]+","+r[3]+")";r[3]<.05&&(i=Me.color),Qe.borderColor=i,Me.stage.update()}}function et(e){Oe=!0,e&&rt(),Qe.vis(!0).top()}function tt(){Oe=!1,We.dispose(),Qe.vis(!1)}function ot(){nt(),j.dropperDown=Me.stage.on("stagemousedown",$e),j.dropperMove=Me.stage.on("stagemousemove",$e),j.dropperUp=Me.stage.on("stagemouseup",(function(){$e(),Ee&&q&&Je&&Ee.color!=Qe.borderColor&&at()}))}function nt(){j.dropperDown&&Me.stage.off("stagemousedown",j.dropperDown),j.dropperMove&&Me.stage.off("stagemousemove",j.dropperMove),j.dropperUp&&Me.stage.off("stagemouseup",j.dropperUp)}function rt(){We&&We.dispose&&We.dispose();var t,o=new e.Rectangle(Me.width,Me.height,Me.color).addTo(Me.stage,0);t=j.dropperTarget&&j.dropperTarget.getBounds&&j.dropperTarget.type&&!j.dropperTarget.type.includes("Stage")?j.dropperTarget.boundsToGlobal():Me.stage.getBounds(),We=new e.Bitmap(Me.stage,t.width,t.height,t.x,t.y).loc(t).cur("none"),o.dispose(),We.on("mousedown",at)}function it(){We&&We.dispose&&We.dispose(),Qe.vis(!1)}function at(){Qe.vis(!1),j.currentValue=e.convertColor(Qe.borderColor,"hex"),j.dispatchEvent("change"),v?(rt(),Qe.vis(!0).top(),setTimeout((function(){j.updateDropperTarget(),Me.stage.update()}),50)):(Qe.vis(!0).top(),Me.stage.update())}function lt(){if(W&&i){var t=[Y=_,_=$];for(Z=0;Z<2;Z++){var o=H.graphics;F=Math.floor(Z/n),ie=(N=Z%n)*(D+r),ae=F*(D+r)+he,G[Z]=t[Z],o.f(Se.color).r(ie-1,ae-1,D+2,D+2).f(t[Z]).r(ie,ae,D,D)}}$=oe,X=R,j.dispatchEvent("change"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!j.stage||j.stage.update()}(this.collapsed=!1,this.collapse=function(e){zot(e)&&(e=!0),e!=j.collapsed&&(j.collapsed=e,e?(qe.enabled=!1,Ve.rot(180),j.background.vis(!1),Fe.vis(!1),Ue.vis(!1),H.visible=!1,Ne&&Ne.vis(!1),ye&&ye.vis(!1),d&&xe.vis(!1),Oe=!1,nt(),it(),j.dispatchEvent("collapsed")):(qe.enabled=!0,Ve.rot(0),j.background.vis(!0),Fe.vis(!0),Ue.vis(!0),H.visible=!0,j.spectrumToggled||Ne.vis(!0),ye&&ye.vis(!0),d&&xe.vis(!0),Oe=!0,ot(),rt(),Ye.hitTestReg(Qe)&&it(),j.dispatchEvent("expanded")),Me.stage.update())},A&&b&&(j.vis(!1),setTimeout((function(){j.collapse(!0),j.vis(!0),j.stage&&j.stage.update()}),50)),s)&&(Se.on("mousedown",st),Se.on("pressmove",ct),Se.on("pressup",ut),q&&(Ye.on("mousedown",st),Ye.on("pressmove",ct),Ye.on("pressup",ut)));function st(t){Ze=t.stageX/e.scaX-j.x,Ke=t.stageY/e.scaY-j.y}function ct(t){j.x=t.stageX/e.scaX-Ze,j.y=t.stageY/e.scaY-Ke,j.stage&&j.stage.update()}function ut(){j.stage&&j.stage.update()}var dt,ht,gt=n*(D+r),pt=ee*(D+r);if(i)var ft=ge*(D+r),mt=pe*(D+r);function zt(){j.keyFocus=!0;var e=document.activeElement;e&&e.blur()}function yt(){j.zimAccessibility&&j.zimAccessibility.changeTitle(j,null,!0)}function vt(e){e<0&&(e=j.colors.length-1),e>j.colors.length-1&&(e=0),j.selectedIndex=e,j.dispatchEvent("change"),j.stage&&j.stage.update()}function bt(){if(q&&(Oe=!1,nt(),it()),j.toggled=!1,j.zimAccessibility){var e=j.zimAccessibility;e.resize(j),ht?ht.focus():j.zimTabTag.nextSibling.focus(),setTimeout((function(){e.talk("ColorPicker has been closed.")}),50)}dt&&dt.update()}H.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(t){var a=e.hitTestGrid(H,gt,pt,n,ee,t.stageX,t.stageY,0,0,r,r);zot(a)||(oe=o[a],d&&(Ee.color=oe,ke.text=String(o[a]).toUpperCase()),lt()),i&&(a=null,zot(a=e.hitTestGrid(H,ft,mt,ge,pe,t.stageX,t.stageY,0,pt,r,r))||(oe=G[a],d&&(Ee.color=oe,ke.text=G[a].toUpperCase()),lt())),g&&fe(o.indexOf(oe)),d?j.stage&&j.stage.update():g&&j.stage&&j.stage.update(),yt()})),Object.defineProperty(this,"selectedColor",{get:function(){return oe},set:function(e){e=e.toLowerCase(),$=oe=e,d&&(Ee.color=oe,ke.text=oe,j.stage&&j.stage.update()),g&&!q&&fe(o.indexOf(oe)),yt()}}),Object.defineProperty(this,"currentValue",{get:function(){return oe},set:function(e){j.selectedColor=e}}),Object.defineProperty(this,"currentValueEvent",{get:function(){return oe},set:function(e){e!=j.selectedColor&&(j.selectedColor=e,j.dispatchEvent("change"))}}),Object.defineProperty(this,"selectedIndex",{get:function(){return q?null:o.indexOf(oe)},set:function(e){q||($=oe=o[e],d&&(Ee.color=oe,ke.text=oe,j.stage&&j.stage.update()),g&&fe(o.indexOf(oe)),yt())}}),Object.defineProperty(this,"selectedAlpha",{get:function(){return a?Ct(we.currentValue):1},set:function(e){a&&(X=we.currentValue=e,Ee&&(Ee.alpha=X),Ce&&(Ce.text="Alpha: "+Ct(we.currentValue)),j.stage&&j.stage.update())}}),Object.defineProperty(this,"selectedTolerance",{get:function(){return T?Ct(we.currentValue):1},set:function(e){T&&(we.currentValue=e,j.stage&&j.stage.update())}}),Object.defineProperty(this,"colors",{get:function(){return q?"spectrum":i?o.concat(G):o},set:function(){zon&&zogy("ColorPicker() colors is read only - make a new ColorPicker to change")}}),null!=WW.KEYFOCUS&&(e.KEYFOCUS=WW.KEYFOCUS),Object.defineProperty(this,"keyFocus",{get:function(){return e.KEYFOCUS==j},set:function(){zns?e.KEYFOCUS=j:WW.KEYFOCUS=j}}),f&&e.KEYFOCUS&&zt(),this.on("mousedown",(function(){f&&zt()})),this.keyDownEvent=function(e){if(j.stage&&!q&&(j.zimAccessibility&&j.focus||!j.zimAccessibility&&j.keyFocus)){var t=j.selectedIndex;37==e.keyCode||40==e.keyCode?vt(--t):38!=e.keyCode&&39!=e.keyCode||vt(++t)}},WW.addEventListener("keydown",this.keyDownEvent),this.hide=function(){return dt=j.stage,j.removeFrom(),dt&&dt.update(),j},this.on("removed",bt);function wt(){if(j.stage&&(dt=j.stage),j.zimAccessibility){var e=j.zimAccessibility;setTimeout((function(){e.activatedObject&&(ht=e.activatedObject.zimTabTag)}),50),e.resize(j),e.tabIndex=j.zimTabIndex}j.toggled=!0,setTimeout((function(){q&&(Oe=!0,rt(),ot(),et(),$e()),j.stage&&j.stage.update()}),20)}function Ct(e){return Math.round(e*Math.pow(10,2))/Math.pow(10,2)}this.show=function(){return j.center(j.container),j},this.on("added",wt),this.toggle=function(e){return!0===e?j.show():!1===e||j.container.contains(j)?j.hide():j.show(),j},zot(z)&&(z=null!=M.selectedIndex?M.selectedIndex:0),j.selectedIndex=z,zot(y)&&(y=null!=M.selectedColor?M.selectedColor:null),null!=y&&(j.selectedColor=y),q&&(j.selectedColor="#888888"),!1!==P&&e.styleTransforms(this,M),this.clone=function(){return j.cloneProps(new e.ColorPicker(t,W?null:o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,this.group,E))},this.dispose=function(e,t,o){return WW.removeEventListener("keydown",j.keyDownEvent),q&&(nt(),j.gradient.cur("default"),j.pixels.cur("default"),v&&v.cur("default"),We.cur("default"),Oe=!1,it()),we&&we.dispose(),Qe&&Qe.dispose(),j.dropperDown&&Me.stage.off("stagemousedown",j.dropperDown),j.dropperMove&&Me.stage.off("stagemousemove",j.dropperMove),j.dropperUp&&Me.stage.off("stagemouseup",j.dropperUp),o||this.zimContainer_dispose(!0),!0}},e.extend(e.ColorPicker,e.Container,["clone","dispose"],"zimContainer",!1),e.EmojiPicker=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v){var b,w="width, height, emojis, monochrome, backgroundColor, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, cache, size, collapse, collapseColor, collapsed, colSize, rowSize, style, group, inherit";if(b=zob(e.EmojiPicker,arguments,w,this))return b;z_d("67.05"),this.group=y;var C=!1===z?{}:e.getStyle("EmojiPicker",this.group,v);zot(t)&&(t=null!=C.width?C.width:400),zot(o)&&(o=null!=C.height?C.height:600),zot(r)&&(r=null!=C.monochrome&&C.monochrome),zot(i)&&(i=null!=C.backgroundColor?C.backgroundColor:e.lighter),zot(a)&&(a=null!=C.titleBar?C.titleBar:"Emojis"),zot(l)&&(l=null!=C.titleBarColor?C.titleBarColor:null),zot(s)&&(s=null!=C.titleBarBackgroundColor?C.titleBarBackgroundColor:e.silver.toAlpha(.8)),zot(c)&&(c=null!=C.titleBarHeight?C.titleBarHeight:40),zot(u)&&(u=null!=C.cache?C.cache:!!e.mobile()),zot(d)&&(d=null!=C.size?C.size:30),zot(f)&&(f=null!=C.colSize?C.colSize:d+15),zot(m)&&(m=null!=C.rowSize?C.rowSize:d+14),zot(h)&&(h=null!=C.collapse&&C.collapse),zot(g)&&(g=null!=C.collapseColor?C.collapseColor:zot(l)?"#555":l),zot(p)&&(p=null!=C.collapsed&&C.collapsed),this.zimWindow_constructor(t,o,null,i,null,null!=C.borderWidth?C.borderWidth:2,null!=C.padding?C.padding:10,null!=C.corner?C.corner:10,null,null==C.scrollBarActive||C.scrollBarActive,null==C.scrollBarDrag||C.scrollBarDrag,null,null,null,!1,null,null,null,null,!0,null,null,null,null,null,null,a,l,s,c,null==C.draggable||C.draggable,null,null,null==C.close||C.close,null,null,null!=C.fullSize&&C.fullSize,null,null!=C.resizeHandle&&C.resizeHandle,h,g,p,null,z,y,e.copy(C)),this.type="EmojiPicker";var x=this;this.emojiData=zot(n)?["💥","🌵","🎂","🍰","🐩","🔥","🌫","🌊","🍏","🍎","🍋","🍌","🍇","🍑","🍅","🍆","🧀","🍕","🍬","🍭","🍩","🍺","🍻","🍸","🍾","☕️","💩","👻","🤖","💤","👀","💃","💃🏻","💃🏼","💃🏽","💃🏾","💃🏿","👔","👗","👙","👘","👠","👒","🎩","🐱","🐻","🐶","🐼","🐯","🦁","🐮","🐷","🐙","🐵","🐒","🐔","🐦","🐴","🦄","🐝","🐢","🐠","🐐","🕊","🐕","🐈","🐉","🐲","🎄","🍀","🌻","🌹","💐","🍄","☀️","🌧","⚽️","🏀","🏈","⚾️","🎾","🏒","⛷","🏄","🏊","🚴","🎭","🎨","🎷","🎺","🎸","🎻","🎰","🎳","🚗","🚕","🚌","🚎","🚑","🚒","🚜","🚂","✈️","⛵️","🛰","🌁","🌋","🏞","🌅","🎆","🌈","🏠","🏥","🏫","⌚️","📱","🖥","💾","📼","🎥","☎️","📺","📻","📡","🕯","💰","💎","🚬","⚰","🔮","💈","🚽","🔑","🛏","🎉","🎊","❤️","🤡","😀","😬","😁","😂","😃","😄","😅","😆","😇","😉","😊","🙂","🙃","☺️","😋","😌","😍","😘","😗","😙","😚","😜","😝","😛","🤑","🤓","😎","🤗","😏","😶","😐","😑","😒","🙄","🤔","😳","😟","😠","😔","😕","🙁","☹️","😣","😫","😩","😱","😨","😰","😯","😦","😢","😪","😓","😭","😵","😲","🤐","😷","🤒","🤕","😴","💀","☠️","👽","😺","😸","😹","😻","😼","😽","🙀","😿","😾","👄","💋","👅","🗣","👤","👥","👖","👣","👡","👢","👞","👟","🎓","👑","👜","👛","💼","👓","🕶","💍","🌂","❄️","🌪","⚡️","🥑","🦋","🙈","🙉","🙊","🐧","🕷","🦂","🦀","🐍","🐛","🐌","🐞","🐜","🐟","🐡","🐬","🐳","🐋","🐊","🐆","🌲","🌳","🌴","🌱","🌿","🍃","🍂","🍁","🌺","🌼","🌸","🌰","🎃","🐚","🕸","🌎","🌍","🌏","🌕","🌖","🌗","🌘","🌑","🌒","🌓","🌔","🌚","🌝","🌛","🌜","🌞","🌙","⭐️","🌟","💫","✨","☄️","🍔","🍳","🍟","🌭","🍝","🌮","🌯","🍣","🍨","🍦","🍷","🍹","🏆","🎪","🎹","🚀","⛲️","🎢","⛰","🏔","🗻","💯","🎵","🎶","💬","💭","🗯","🃏","🏳️‍🌈","🥓","🥃","🎤","🚨","🏍","🏕","⛺️","🏜","🏖","🏝","🌇","🌆","🏙","🌃","🏘","🏡","🏢","🔨","⚙","🔫","💣","🔪","💊","🕳","💉","🛁","⛱","🎁","🎈","🎀","📅","🗳","📚","✏️","⚪️","⚫️","⬛️","⬜️","🖼","🏚","🏭","🔲","🔳","🎱","🔺","🔻","💦","⛳️","🏟","💡","🔭","🔬","🕰","🐪","🐫","🐘","🐸","🐰","🐭","🚪","🛍","👁","🍓","🍒","🌶","🌽","🍠","🍯","🍞","🍫","🍿","🍪","🍊","🏹","👯","👯‍♂️","🗑"]:n;var k=[];e.loop(this.emojiData,(function(t){var o=new e.Emoji(t,d,r);k.push(o)})),this.wrapper=new e.Wrapper({items:k,width:t,alignInner:e.CENTER,valignInner:e.CENTER,wrapperType:"column",colSize:f,rowSize:m}).cur(),this.backdrop=new e.Rectangle(this.wrapper.width,this.wrapper.height,e.faint),e.timeout(.2,(function(){x.scrollBar&&x.scrollBar.vertical&&x.scrollBar.vertical.getBounds()&&x.scrollBar.vertical.expand(),x.backdrop.heightOnly=x.wrapper.height,u&&x.wrapper.cache()})),this.add(this.backdrop),this.add(this.wrapper),this.wrapper.tap((function(e){x.currentEmoji=e.target,x.dispatchEvent("change")})),!1!==z&&e.styleTransforms(this,C),this.clone=function(){return x.cloneProps(new e.EmojiPicker(t,o,z,this.group,v))},this.dispose=function(){return!0}},e.extend(e.EmojiPicker,e.Window,["clone","dispose"],"zimWindow",!1),e.TextEditor=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j){var L,D="width, color, backgroundColor, fieldColor, fieldHeight, textSize, sizeList, optionList, colorList, fontList, live, button, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, wrap, limit, scroll, placeholder, password, borderColor, borderWidth, margin, corner, shadowColor, shadowBlur, draggable, boundary, frame, fontListHeight, fontListViewNum, style, group, inherit";if(L=zob(e.TextEditor,arguments,D,this))return L;z_d("67.1"),this.group=O;var _=!1===M?{}:e.getStyle("TextEditor",this.group,j);if(zot(t)&&(t=null!=_.width?_.width:400),zot(n)&&(n=null!=_.backgroundColor?_.backgroundColor:e.lighter),zot(g)&&(g=null!=_.titleBar?_.titleBar:"Text Editor"),zot(B)&&(B=null==_.draggable||_.draggable),zot(m)&&(m=null!=_.titleBarHeight?_.titleBarHeight:30),zot(r)&&(r=null!=_.fieldColor?_.fieldColor:n.darken(.05)),zot(d)&&(d=null==_.live||_.live),zot(z)&&(z=null==_.wrap||_.wrap),zot(v)&&(v=null==_.scroll||_.scroll),zot(k)&&(k=null!=_.margin?_.margin:10),zot(y)&&(y=null!=_.limit?_.limit:null),zot(g)&&(g=null!=_.titleBar?_.titleBar:null),zot(l)&&(l=null!=_.sizeList?_.sizeList:null),zot(c)&&(c=null!=_.colorList?_.colorList:null),zot(s)&&(s=null!=_.optionList?_.optionList:null),zot(u)&&(u=null!=_.fontList?_.fontList:null),zot(r)&&(r=null!=_.fieldColor?_.fieldColor:null),zot(i)&&(i=null!=_.fieldHeight?_.fieldHeight:null),zot(a)&&(a=null!=_.textSize?_.textSize:null),zot(S)&&(S=null!=_.fontListHeight?_.fontListHeight:100),zot(W)&&(W=null!=_.fontListViewNum?_.fontListViewNum:3),void 0===I){if(!WW.zdf)return void(zon&&zogy("zim.TextEditor - please provide a reference to zim Frame"));I=WW.zdf}this.zimPanel_constructor(t,300,null,g,p,f,m,n,C,x,T,!0,null,null,null,A,P,B,E,null,M,O,j);var Y=this;function X(){d||(H.text=R.text),Y.hide(),Y.dispatchEvent("set")}zot(h)&&(h=new e.Button({width:50,height:50,label:"",icon:(new e.Shape).sca(.4).f("white").p("AikFsQg5jmhphxIA1gXQBeBGA3CwQC8mRCpjOIBfAoQkPFGiSFpg"),color:e.white,corner:10,backgroundColor:e.green.darken(.2),borderColor:e.white,borderWidth:2,rollBackgroundColor:e.green,shadowBlur:3}).pos(k,m+2*k,e.RIGHT,e.TOP,Y)),Y.button=h,h.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",X),zot(i)&&(i=null!=_.fieldHeight?_.fieldHeight:h.height+2*k);var R=Y.textArea=new e.TextArea({color:o,backgroundColor:r,width:t-h.width-3*k,height:zot(i)?h.height+2*k:i,expand:10,password:w,placeholder:b,frame:I}).loc(k,m+k+(i&&i<h.height+2*k?(h.height-i)/2+k:0),null,null,!1);z||(R.tag.style.whiteSpace="nowrap"),y&&R.tag.setAttribute("maxLength",y),v&&(R.tag.style.overflowY="auto");var H=new e.Label;Y.on("pressmove",(function(){R.resize()})),Y.on("close",(function(){Y.inputEvent&&R.off("input",Y.inputEvent),R.removeFrom()})),Y.panelHeight=m+k+Math.max(i,h.height+2*k)+k;var F,N=e.mobile(),V=N?35:30;if(l||s||c){new e.Rectangle(t,V+k,"rgba(0,0,0,.05)").loc(0,Y.panelHeight,Y);var G,q,U,Q=[];if(c){var Z=Array.isArray(c),K=Y.colorPicker=new e.ColorPicker({colors:Z?c:null,cols:Z?Math.min(c.length,12):null,alphaPicker:!1,greyPicker:!Z,container:I.stage});K.on("close",ee),K.on("change",(function(){H.color=o.color=K.selectedColor,Y.dispatchEvent("update"),ee()})),Y.closeColorPicker=function(){ee()},(o=Y.swatch=new e.Rectangle(V,V,H.color,e.dark,1).cur()).on("mousedown",(function(){Y.dispatchEvent("color"),R.tag.style.display="none",K.selectedColor=o.color,K.show(),Y.stage&&Y.stage.update()})),Q.push(o)}if(s)!0===s&&(s=["bold","italic","align"]),zot(WW.STYLE)&&(WW.STYLE={}),zot(WW.STYLE.group)&&(WW.STYLE.group={}),WW.STYLE.group.zimEditor={width:V,height:V,corner:0,borderColor:e.tin,shadowBlur:-1,backgroundColor:e.light,rollBackgroundColor:e.light,toggleBackgroundColor:e.green,toggleColor:e.grey},e.loop(s,(function(t){if("bold"==t.toLowerCase())(G=Y.bold=new e.Button({label:new e.Label({text:"B",color:e.grey,size:16,bold:!0}),toggle:"B",group:"zimEditor"})).on("click",(function(){H.bold=G.toggled,Y.dispatchEvent("update"),Y.stage&&Y.stage.update()})),Q.push(G),H.bold&&G.toggle();else if("italic"==t.toLowerCase())(q=Y.italic=new e.Button({label:new e.Label({text:"I",color:e.grey,size:16,bold:!0,italic:!0}),toggle:"I",group:"zimEditor"})).on("click",(function(){H.italic=q.toggled,Y.dispatchEvent("update"),Y.stage&&Y.stage.update()})),Q.push(q),H.italic&&q.toggle();else if("align"==t.toLowerCase()){var o=new e.Tile(new e.Rectangle(V-10,V-10,e.grey).centerReg(),3,1,10,10),n=N?["⇚","⇔","⇛"]:["⇐","⇔","⇒"];e.loop(3,(function(t){var r=o.getChildAt(t);new e.Label(n[t],2*V/3,null,e.white).center(r).expand(10)}));var r=0;"right"==H.align?r=2:"center"!=H.align&&"middle"!=H.align||(r=1),(U=Y.align=new e.Selector({tile:o,corner:0,borderWidth:1,borderColor:e.grey,backgroundColor:e.clear,selectedIndex:r})).on("change",(function(){0==U.selectedIndex?H.align="left":1==U.selectedIndex&&(H.align="center"),2==U.selectedIndex&&(H.align="right"),Y.dispatchEvent("update"),Y.stage&&Y.stage.update()})),Q.push(U)}})),delete WW.STYLE.group.zimEditor;if(l){var J=Y.sizePicker=new e.Stepper({list:!0===l?null:l,stepperType:!0===l?null:"list",min:!0===l?5:null,max:!0===l?500:null,width:150,shadowBlur:-1,borderColor:e.dark,borderWidth:2,corner:0,backgroundColor:e.green,downForward:!1}).siz(null,V);J.arrowPrev.expand(0),J.textBox.color=e.lighter,J.on("change",(function(){H.size=J.currentValue,Y.dispatchEvent("update"),Y.stage&&Y.stage.update()})),J.currentValue=H.size,Q.push(J)}var $=new e.Tile(Q,Q.length,1,10,10,!0).loc(k,Y.panelHeight+k/2,Y);Y.panelHeight=Y.panelHeight+k+$.height+k}function ee(){R.tag.style.display="block",K.hide(),Y.stage&&Y.stage.update()}if(u){Array.isArray(u)?F=u:(F=["Arial","Courier New","Georgia","Helvetica","Palatino","Tahoma","Verdana"],N||(F=F.concat(["Comic Sans MS","Impact"])),F.sort());var te=Y.fonts=new e.List({width:t-2*k,height:S,viewNum:W,backgroundColor:e.moon,color:e.grey,rollColor:e.dark,rollBackgroundColor:e.green.lighten(.5),selectedBackgroundColor:e.mist,selectedRollBackgroundColor:e.green.lighten(.6),selectedColor:e.dark,backdropColor:e.light,scrollBarColor:e.dark,shadowBlur:-1,list:F}).center(Y).loc(null,Y.panelHeight);te.on("change",(function(){H.font=te.currentValue,Y.dispatchEvent("update"),Y.stage&&Y.stage.update()})),Y.panelHeight=Y.panelHeight+k+te.height+k}function oe(){H&&(R.text=H.text),o&&(o.color=H.color),G&&G.toggle(1==H.bold),q&&q.toggle(1==H.italic),U&&(U.noAnimate=!0,"center"==H.align?U.selectedIndex=1:"right"==H.align?U.selectedIndex=2:U.selectedIndex=0),J&&(J.currentValue=H.size),te&&(te.currentValue=H.font),Y.inputEvent&&R.off("input",Y.inputEvent),Y.inputEvent=R.on("input",(function(){d&&(H.text=R.text),Y.dispatchEvent("input"),Y.dispatchEvent("update"),Y.stage&&Y.stage.update()}))}Y.show=function(e,o,n,r){if(Y.parent)return e==Y.label||(Y.label=e),Y;var i;if(H=e,R.addTo(Y),H&&H.stage)i=H.stage;else if(r)i=r.stage;else{if(!WW.zdf)return Y;i=WW.zdf.stage}return zot(o)&&zot(n)?H&&H.y>i.height/2?Y.loc(i.width/2-t/2,H.y-Y.panelHeight-.05*i.height,i):H&&H.y<=i.height/2?Y.loc(i.width/2-t/2,H.y+H.height+.05*i.height,i):Y.center(i):Y.loc(o,n),Y.y<20&&(Y.y=20),Y.y+Y.height>Y.stage.height&&(Y.y=Y.stage.height-Y.height-20),oe(),Y.stage.update(),Y},Y.hide=function(){if(c&&K.hide(),R&&R.removeFrom(),!zot(Y.stage)){var e=Y.stage;return Y.removeFrom(),e.update(),Y}},Object.defineProperty(Y,"label",{get:function(){return H},set:function(e){H=e,oe()}}),!1!==M&&e.styleTransforms(this,_),this.clone=function(){return Y.cloneProps(new e.TextEditor(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,this.group,j))},this.dispose=function(e,t,n){return Y.inputEvent&&R.off("input",Y.inputEvent),K&&K.dispose(),o&&o.dispose(),te&&te.dispose(),h&&h.dispose(),R&&R.dispose(),U&&U.dispose(),G&&G.dispose(),q&&q.dispose(),J&&J.dispose(),n||this.zimPanel_dispose(),Y.stage&&Y.stage.update(),Y.textArea=Y.color=Y.colorPicker=Y.font=Y.button=Y.selector=Y.bold=Y.italic=Y.size=null,!0}},e.extend(e.TextEditor,e.Panel,["clone","dispose"],"zimPanel",!1),e.Keyboard=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P){var B,E="labels, backgroundColor, color, shiftBackgroundColor, shiftHoldBackgroundColor, placeBackgroundColor, placeColor, cursorColor, shadeAlpha, borderColor, borderWidth, margin, corner, draggable, placeClose, shadowColor, shadowBlur, container, data, place, special, rtl, hardKeyboard, layout, style, group, inherit";if(B=zob(e.Keyboard,arguments,E,this))return B;z_d("67.2"),this.zimContainer_constructor(1e3,400,null,null,!1),this.type="Keyboard",this.group=A;var I=!1===T?{}:e.getStyle(this.type,this.group,P);zot(t)&&(t=null!=I.labels?I.labels:[]),Array.isArray(t)||(t=[t]),zot(o)&&(o=null!=I.backgroundColor?I.backgroundColor:"#333"),zot(n)&&(n=null!=I.color?I.color:"white"),zot(r)&&(r=null!=I.shiftBackgroundColor?I.shiftBackgroundColor:"orange"),zot(i)&&(i=null!=I.shiftHoldBackgroundColor?I.shiftHoldBackgroundColor:"red"),zot(a)&&(a=null!=I.placeBackgroundColor?I.placeBackgroundColor:"#50c4b7"),zot(l)&&(l=null!=I.placeColor?I.placeColor:n),zot(s)&&(s=null!=I.cursorColor?I.cursorColor:"#50c4b7"),zot(c)&&(c=null!=I.shadeAlpha?I.shadeAlpha:.2),zot(u)&&(u=null!=I.borderColor?I.borderColor:"rgba(0,0,0,.1)"),zot(d)&&(d=null!=I.borderWidth?I.borderWidth:null),u<0||d<0?u=d=null:null!=u&&null==d&&(d=1),zot(h)&&(h=null!=I.margin?I.margin:5),zot(g)&&(g=null!=I.corner?I.corner:30),zot(p)&&(p=null!=I.draggable&&I.draggable),zot(f)&&(f=null==I.placeClose||I.placeClose),zot(m)&&(m=null!=I.shadowColor?I.shadowColor:"rgba(0,0,0,.2)"),zot(z)&&(z=null!=I.shadowBlur?I.shadowBlur:14),zot(v)&&(v=null!=I.data?I.data:[[["q","w","e","r","t","y","u","i","o","p"],["a","s","d","f","g","h","j","k","l"],["shift","z","x","c","v","b","n","m","backspace"],["?123"]],[["1","2","3","4","5","6","7","8","9","0"],["!","@","#","$","/","^","&","*","(",")"],["1/2","-","'",'"',":",";",",","?","backspace"],["ABC"]],[["+","x","%","=","<",">","{","}","[","]"],["€","£","¥","$","₩","~","`","¤","♡","☆"],["2/2","_","\\","|","《","》","¡","¿","backspace"],["ABC"]]]),v[3]||(v[3]={e:["ė","ē","ę","ê","é","ë","è"],u:["ū","û","ú","ü","ù"],i:["ī","į","ì","í","ï","î"],o:["ō","œ","ø","õ","ô","ó","ö","ò"],a:["ā","ã","å","â","á","ä","à","æ"],n:["ñ","ń"]});var S=this;zot(b)&&(b=null==I.place||I.place),zot(C)&&(C=null!=I.rtl&&I.rtl),zot(x)&&(x=null==I.hardKeyboard||I.hardKeyboard),zot(k)&&(k=null!=I.layout?I.layout:"qwerty"),"qwerty"!=(k=k.toLowerCase())&&("arabic"==k?v=[[["ض","ص","ث","ق","ف","غ","ع","ه","خ","ح","ج"],["ش","س","ي","ب","ل","ا","ت","ن","م","ك","ط"],["ذ","ء","ؤ","ر","ى","ة","و","ز","ظ","د","back"],["?123","ـ"]],[["1","2","3","4","5","6","7","8","9","0","*"],["!","@","#","$","/","^","&","*","(",")","*"],["1/2","-","'",'"',":",";",",","?","*","backspace"],["ABC","*"]],[["+","x","%","=","<",">","{","}","[","]","*"],["€","£","¥","$","₩","~","`","¤","♡","☆","*"],["2/2","_","\\","|","《","》","¡","¿","*","backspace"],["ABC","*"]],{"ا":["أ","إ","آ","ء"],"ى":["ئ"],"ء":["ئ","ؤ"],"و":["ؤ"],"ـ":["ٍ","ً","ٌ","ْ","ُ","ِ","َ","ّ"],"*":["ٍ","ً","ٌ","ْ","ُ","ِ","َ","ّ"],n:["ñ","ń"]}]:"hebrew"==k?v=[[["ק","ר","א","ט","ו","ן","ם","פ","backspace"],["ש","ד","ג","כ","ע","י","ח","ל","ך","ף"],["ז","ס","ב","נ","ה","מ","צ","ת","ץ"],["?123",","]],[["1","2","3","4","5","6","7","8","9","0"],["!","@","#","$","/","^","&","*","(",")"],["1/2","-","'",'"',":",";",",","?","backspace"],["ABC",","]],[["+","x","%","=","<",">","{","}","[","]"],["€","£","¥","$","₩","~","`","¤","♡","☆"],["2/2","_","\\","|","《","》","¡","¿","backspace"],["ABC",","]],{e:["ė","ē","ę","ê","é","ë","è"],u:["ū","û","ú","ü","ù"],i:["ī","į","ì","í","ï","î"],o:["ō","œ","ø","õ","ô","ó","ö","ò"],a:["ā","ã","å","â","á","ä","à","æ"],n:["ñ","ń"]}]:"azerty"==k?v=[[["a","z","e","r","t","y","u","i","o","p"],["q","s","d","f","g","h","j","k","l","m"],["shift","w","x","c","v","b","n","´","backspace"],["?123",","]],[["1","2","3","4","5","6","7","8","9","0"],["!","@","#","$","/","^","&","*","(",")"],["1/2","-","'",'"',":",";",",","?","backspace"],["ABC",","]],[["+","x","%","=","<",">","{","}","[","]"],["€","£","¥","$","₩","~","`","¤","♡","☆"],["2/2","_","\\","|","《","》","¡","¿","backspace"],["ABC",","]],{e:["ė","ē","ę","ê","é","ë","è"],u:["ū","û","ú","ü","ù"],i:["ī","į","ì","í","ï","î"],o:["ō","œ","ø","õ","ô","ó","ö","ò"],a:["ā","ã","å","â","á","ä","à","æ"],n:["ñ","ń"]}]:"turkish"==k&&(v=[[["q","w","e","r","t","y","u","ı","o","p","ğ","ü"],["a","s","d","f","g","h","j","k","l","ş","i"],["shift","z","x","c","v","b","n","m","ö","ç","backspace"],["?123","*"]],[["1","2","3","4","5","6","7","8","9","0","*"],["!","@","#","$","/","^","&","*","(",")","*"],["1/2","-","'",'"',":",";",",","?","*","backspace"],["ABC","*"]],[["+","x","%","=","<",">","{","}","[","]","*"],["€","£","¥","$","₩","~","`","¤","♡","☆","*"],["2/2","_","\\","|","《","》","¡","¿","*","backspace"],["ABC","*"]],{e:["ė","ē","ę","ê","é","ë","è"],u:["ū","û","ú","ü","ù"],i:["ī","į","ì","í","ï","î"],o:["ō","œ","ø","õ","ô","ó","ö","ò"],a:["ā","ã","å","â","á","ä","à","æ"],n:["ñ","ń"]},{"ı":"I",i:"İ"},{I:"ı","İ":"i"}])),S.data=v;var W="zim display - Keyboard(): Please pass in a reference to a container with bounds set";if(zot(y)){if(!WW.zdf)return void zogy(W);y=WW.zdf.stage}else{if(!y.getBounds)return void zogy(W);if(zot(y.stage))return void zogy("zim display - Keyboard(): The container must have a stage property")}-1!=m&&z>0&&(S.shadow=new createjs.Shadow(m,3,3,z));var M,O=WW.zdf?WW.zdf.stage:null;S.labels=t;var j=10;e.loop(v[0],(function(e){e.length>j&&(j=e.length)}));var L=j,D=["@","",".","/","away"];zot(w)||D.splice(1,0,w);var _=e.copy(v[0]);_[3]=_[3].concat(D);var Y=e.copy(v[1]);Y[3]=Y[3].concat(D);var X=e.copy(v[2]);X[3]=X[3].concat(D);var R,H,F,N,V,G,q,U,Q,Z,K,J,$=[],ee=(1e3-5*(L-1))/L,te={def:"default",shift:"shift",number1:"number1",number2:"number2"},oe=te.def,ne=!1,re=0,ie=[];function ae(t){O=S.stage,H&&S.removeChild(H),G&&ie.indexOf(t.target)<0&&ze(),zot(t.target.na)||(p&&t.target===Z?(S.tickerMouseEvent=O.on("stagemousemove",(function(e){S.mouseYAmount=e.stageY})),e.Ticker.add(ge),S.on("pressup",pe),K=t.stageY-S.localToGlobal(0,0).y):zot(w)||t.target.na!==w?"shift"===t.target.na?le():"?123"===t.target.toggle?(S.removeChild(R),se(te.number1)):"ABC"===t.target.toggle?(S.removeChild(R),oe=te.def,se(),ne&&le(!0)):"1/2"===t.target.toggle?(S.removeChild(R),se(te.number2)):"2/2"===t.target.toggle?(S.removeChild(R),se(te.number1)):"away"===t.target.na?(he(),S.dispatchEvent("close")):v[3]&&v[3][t.target.na]?ce(t.target.na):"return"===t.target.na?ye("\n"):"backspace"===t.target.na||"back"===t.target.na?we():""===t.target.na?ye(" "):ye(t.target.na):S.dispatchEvent("special"),O.update())}function le(e){var t,n,a=!1;if(oe===te.def){for(N.color=e?i:r,t=0;t<$.length-6-(zot(w)?0:1);t++)(n=$[t]).label.text.length>0&&(1===n.na.length?(v[4]&&v[4][n.label.text]?n.label.text=v[4][n.label.text]:n.label.text=n.label.text.toUpperCase(),n.label.centerReg(n).mov(0,6)):n.label.centerReg(n));e||(a=!0,setTimeout((function(){a&&(ne=!0,N.color=i,R.updateCache(),S.stage&&S.stage.update())}),500),J=S.on("pressup",(function(){S.off("pressup",J),a=!1}))),oe=te.shift}else{for(N.color=o,ne=!1,t=0;t<$.length-6;t++)(n=$[t]).label.text.length>0&&(1===n.na.length?(v[5]&&v[5][n.label.text]?n.label.text=v[5][n.label.text]:n.label.text=n.label.text.toLowerCase(),n.label.centerReg(n).mov(0,3)):n.label.centerReg(n));oe=te.def}R.updateCache(),S.stage&&S.stage.update()}function se(t){var r,i,a,l,s,h,p,f=0,m=0,z=!1,y=!1;zot(t)&&(t=te.def),t===te.def?r=_:t===te.number1?r=Y:t===te.number2&&(r=X),R=new e.Container(1e3,430,null,null,!1).addTo(S);for(var b=0;b<r.length;b++){(b<=1||t==te.def&&2==b&&"shift"!=r[2][0])&&(f=(ee/2+2.5)*(L-r[b].length));for(var C=0;C<r[b].length;C++){if(z=!1,h=null,y=!1,"backspace"==r[b][C]?(s=!0,h=U,y=!0):"back"==r[b][C]?(s=!1,h=U,y=!0):"shift"==r[b][C]?(s=!0,h=q):(3==b||t!=te.def&&2==b)&&0==C?(s=!0,y=!0):""==r[b][C]?(s=!1,z=!0):"away"==r[b][C]?(h=Q,s=!0,y=!0):s=!1,s?l=1.5*ee+2.5:z?(l=(ee+5)*((zot(w)?4:3)+L-10+1-v[0][3].length)-5,-1!=v[0][3].indexOf("backspace")&&(l-=ee/2)):l=ee,a=new e.Rectangle(l,ee,o,u,d,g,null,null,null,!1).cur().addTo(R),y&&a.addChild(new e.Rectangle(l,ee,"black",null,null,g,null,null,null,!1).alp(c)),a.label=i=h?new e.Label({text:"",backgroundColor:"ignore",font:null!=I.font?I.font:null,style:!1}):new e.Label({lineWidth:10,lineHeight:25,font:null!=I.font?I.font:null,text:r[b][C],color:n,align:"center",style:!1}),h){var x=h.clone();x.scaleTo(a,70,70),x.centerReg(a)}p?(p=!1,f+=67.33):(i.centerReg(a).mov(0,isNaN(i.text)?3:7),a.x=f,a.y=m,a.na=r[b][C],2==b&&0==C&&t==te.number1&&(a.toggle="1/2"),2==b&&0==C&&t==te.number2&&(a.toggle="2/2"),3==b&&0==C&&t==te.def&&(a.toggle="?123"),3==b&&0==C&&t!=te.def&&(a.toggle="ABC"),a.toggle&&i.mov(0,3),$.push(a),"shift"==a.na&&(N=a),f=a.x+a.width+5)}m+=ee+5,f=0}R.cache(d?-d:0,d?-d:0,d?R.width+2*d:R.width,d?R.height+2*d:R.height)}function ce(t){var r,i=v[3][t],a=!1,l=!1;r=e.timeout(500,(function(){var t,s,c,h,p=0;if(r.clear(),!a){l=!0,(H=new e.Container(1e3,ee,null,null,!1).addTo(S,0)).y=-ee-5;for(var f=0;f<i.length;f++)h=oe===te.shift?i[f].toUpperCase():i[f],t=new e.Label({lineWidth:10,lineHeight:25,text:h,font:null!=I.font?I.font:null,color:n,align:"center",style:!1}),s=new e.Rectangle(ee,ee,o,u,d,g,null,null,null,!1).addTo(H),c=new e.Rectangle(ee,ee,"white",null,null,g,null,null,null,!1).alp(.2),s.addChild(c),t.center(s),s.na=i[f],s.x=p,p+=ee+5;S.stage&&S.stage.update()}}),null,"ms");var s=S.on("pressup",(function(){a=!0,S.off("pressup",s),l||ye(t)}))}function ue(){(q=new e.Shape({style:!1})).graphics.f(n).p("AhIFoIAAjYIixAAID5n3ID6H3IixAAIAADYgAjHBxICeAAIAADYIBTAAIAAjYICeAAIjImSg"),q.setBounds(-25.5,-36,51,72),U=new e.Container({style:!1});var t=new e.Shape({style:!1});t.graphics.f(n).p("ACgC+IigigIifCgQgGAGgJAAQgJAAgGgGQgGgGgBgJQABgJAGgGICgigIigifQgGgGgBgJQABgJAGgGQAGgGAJAAQAIAAAHAGICfCgICgigQAGgGAJAAQAJAAAGAGQAGAGABAJQgBAJgGAGIigCfICgCgQAGAGABAJQgBAJgGAGQgGAGgJAAQgJAAgGgGg"),t.setTransform(82.6,32),t.addTo(U);var o=new e.Shape({style:!1});o.graphics.f(n).s().p("AkhFAQgcAAgUgUIkHj6QgVgUAAgeQAAgdAVgVIEHj6QAUgTAcAAINKAAQAdAAAUAUQAUAUAAAdIAAH1QAAAdgUATQgUAVgdAAgAk0kOIkGD8QgIAHAAALQAAALAIAIIEGD7QAIAHALAAINKAAQALAAAIgIQAHgHAAgLIAAn1QAAgLgHgIQgIgIgLAAItKAAQgLAAgIAHg"),o.setTransform(62.2,32),o.addTo(U),U.setBounds(0,0,125,64),(Q=new e.Container({style:!1})).setBounds(0,0,147,86);for(var r,i=[{p:"Ai+heIF9AAIi/C9g",transform:[73.4,76]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[128.4,43.2]},{p:"AnNAzIAAhlIObAAIAABlg",transform:[73,43.2]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[18.8,43.2]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[128.2,29.5]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[114.5,29.5]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[100.8,29.5]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[87.1,29.5]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[73.4,29.5]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[59.7,29.5]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[46,29.5]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[32.3,29.5]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[18.6,29.5]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[128,15.8]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[114.3,15.8]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[100.6,15.8]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[86.9,15.8]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[73.2,15.8]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[59.5,15.8]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[45.8,15.8]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[32.1,15.8]},{p:"AgyAzIAAhlIBlAAIAABlg",transform:[18.4,15.8]},{p:"AphEnQgzAAgkgkQglglAAgzIAAlVQAAgzAlglQAkgkAzAAITDAAQAzAAAkAkQAlAlAAAzIAAFVQAAAzglAlQgkAkgzAAgAqjjtQgcAcAAAnIAAFVQAAAnAcAbQAbAcAnAAITDAAQAnAAAcgcQAbgbAAgnIAAlVQAAgngbgcQgcgcgnAAIzDAAQgnAAgbAcg",transform:[73.4,29.5]}],a=0;a<i.length;a++)(r=new e.Shape({style:!1})).graphics.f(n).s().p(i[a].p),r.setTransform(i[a].transform[0],i[a].transform[1]),r.addTo(Q)}function de(){Z=new e.Rectangle(1.5*ee+2.5+2.5,ee,o,u,d,g,null,null,null,!1).addTo(S,0).cur();for(var t=0;t<4;t++)new e.Rectangle(.4*Z.width,4,n,null,null,null,null,null,null,!1).centerReg(Z).alp(.2).y-=15*t-22;Z.x=8.5*ee+40,Z.y=-ee-5,Z.na="drag"}function he(){S.hide()}function ge(){S.mouseYAmount&&(S.y=S.parent.globalToLocal(0,S.mouseYAmount-K).y)}function pe(){O.off("pressmousemove",S.tickerMouseEvent),e.Ticker.remove(ge)}function fe(){if(V&&F){for(var e=V.label.x+V.label.getBounds().x,t=0;t<re;t++)e+=V.widthArray[t]?V.widthArray[t]:0;F.heightOnly=V.getBounds().height*(V.backing&&zot(V.padding)?.9:1)-(V.paddingVertical&&V.background?2*V.paddingVertical:0),F.center(V),F.x=e}}function me(){if(G)return S;if(!V)return S;var t,o,n,r=f?["<",">","x"]:["<",">"];ie=[],n=V.localToLocal(0,0,S),G=new e.Container({style:!1}).addTo(S).pos({x:n.x,y:n.y+V.height+15,reg:!0}).cur();for(var i=0;i<r.length;i++)t=new e.Rectangle(ee,ee,a,u,d,g,null,null,null,!1),"x"==r[i]&&new e.Rectangle(ee,ee,"black",null,null,g,null,null,null,!1).alp(c).addTo(t),(o=new e.Label({lineWidth:10,text:r[i],backing:t,font:null!=I.font?I.font:null,color:l,align:"center",valign:"center",style:!1})).pos(0,0,e.LEFT,e.TOP,G).cache(),o.x=o.x+i*(ee+5),ie.push(o);n=V.localToLocal(0,0,S),G.x=n.x,G.y=n.y+V.height+15,G.on("click",(function(e){0==ie.indexOf(e.target)?re>0&&re--:1==ie.indexOf(e.target)?re<V.text.length&&re++:ze();fe()})),S.stage&&S.stage.update()}function ze(){if(!G)return S;G.removeAllEventListeners(),S.removeChild(G),G=null}function ye(e){if(V){var t,o;if("del"===e)V&&(V.text=[V.text.slice(0,re-1),V.text.slice(re)].join("")),re--,be();else{oe===te.shift&&(e=e.toUpperCase());var n=V.text;(t=V.clone().removeFrom()).text=e,o=t.label.getMeasuredWidth(),V.widthArray?V.widthArray.splice(re,0,o):V.widthArray=[V.breedte],re<V.text.length?V.text=[V.text.slice(0,re),e,V.text.slice(re)].join(""):V.text+=e,V&&V.label.getBounds().width<M?(re++,fe()):V.text=n}oe!==te.shift||ne||(S.removeChild(R),se(),oe=te.def),fe();var r=new createjs.Event("keydown");r.letter=e,S.dispatchEvent(r),S.stage&&S.stage.update()}}function ve(t){if(S.stage){var o,n=0,r=!1;(V=t.target).widthArrayCheck||be(),M=V.label.lineWidth?V.label.lineWidth:1e4,(o=V.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY)).x-=V.label.x,o.y-=V.label.y;for(var i=0;i<V.widthArray.length;i++)if(n+=V.widthArray[i],o.x<n-V.widthArray[i]/2+V.label.getBounds().x){re=i,r=!0;break}r||(re=V.text.length),fe(),b&&!G&&V.text.length>0&&me(),G&&V&&(V.text.length>0?(o=V.localToLocal(0,0,S),G.x=o.x,G.y=o.y+V.height+15):ze())}}function be(){if(V){var t=new e.Label("");V.widthArray=[];for(var o=0;o<V.text.length;o++)(t=V.clone().removeFrom()).text=V.text[o],V.widthArray.push(t.label.getMeasuredWidth());t.text=V.text,V.widthArrayCheck=!0,fe()}}function we(t){var o,n=!0;function r(){V&&V.text.length>0?(S.selectedIndex>0&&ye("del"),t?i():S.on("pressup",i)):ye("del")}function i(){n=!1,o&&o.clear(),S.off("pressup",i)}r(),o=e.timeout(300,(function t(){(!V||V.text.length<1||0==S.currentIndex)&&(n=!1),n&&(r(),o&&(o=e.timeout(200,t,null,"ms"))),V&&V.text.length<1&&i()}),null,"ms"),S.stage&&S.stage.update()}function Ce(){for(var e=0;e<t.length;e++)t[e].clickEvent=t[e].on("click",ve)}function xe(){if(t.length>1)for(var e=0;e<t.length;e++)t[e].off("click",t[e].clickEvent)}function ke(){if(!F&&(V=t[0],M=V&&V.label.lineWidth?V.label.lineWidth:1e4,V)){(F=new e.Rectangle(3,V.height-(V.paddingVertical&&V.background?2*V.paddingVertical:0),s,null,null,null,null,null,null,!1).center(V)).x=0,F.visible=!1,F.animate({obj:{alpha:0},rewind:!0,loop:!0,loopWait:750,time:250,id:"knipperTekst",timeUnit:"ms"});for(var o=0;o<t.length;o++)t[o].widthArray=[0];be()}}function Te(){e.stopAnimate("knipperTekst"),V&&V.removeChild(F),F=null,V=null}ue(),se(oe),p&&de(),this.on("mousedown",ae),S.addChar=function(e){!zot(e)&&e.match(/^.$/)&&ye(e)},S.removeChar=function(){we(!0)},S.setBounds(1e3,400-26*(L-10)),Ce(),ke(),Object.defineProperty(this,"selectedLabel",{get:function(){return V},set:function(e){ve({target:e}),S.hidePlace()}}),Object.defineProperty(this,"selectedIndex",{get:function(){return re},set:function(e){re=e,fe()}}),this.show=function(e){(S.addTo(y),zot(e))||ve({target:t[e]});return F&&(F.visible=!0),S.toggled=!0,S},this.hide=function(){return S.removeFrom(y),F&&(F.visible=!1),O.update(),S.toggled=!1,S},this.toggle=function(e){return!0===e?S.show():!1===e||S.parent?S.hide():S.show(),S},this.showPlace=function(){return me(),S},this.hidePlace=function(){return ze(),S},this.addLabels=function(e){Array.isArray(e)||(e=[e]);for(var o=e.length-1;o>=0;o--){t.indexOf(e[o])>=0||"Label"!=e[o].type?e.splice(o,1):e[o].widthArray=[0]}return xe(),t=t.concat(e),Ce(),ke(),F&&(F.visible=!0),S},this.removeLabels=function(e){Array.isArray(e)||(e=[e]),xe();for(var o=0;o<e.length;o++){var n=t.indexOf(e[o]);n>=0&&t.splice(n,1)}return Ce(),0==t.length?V&&Te():V&&-1==t.indexOf(V)&&(Te(),ke()),S};var Ae=new e.Rectangle(this.width,this.height,e.clear,null,null,null,null,null,null,!1).addTo(this).expand().bot();Ae.on("mousedown",(function(){})),Ae.on("click",(function(){})),this.resize=function(){if(S.scaleTo(O,100-2*h/O.width*100,50-2*h/O.height*100),S.y=O.height-S.height-h,S.x=O.width/2-S.width/2,V&&G){var e=V.localToLocal(0,0,S);G.x=e.x,G.y=e.y+V.height+15}return S.stage&&S.stage.update(),S},this.resize(),S.selectedLabel&&(S.selectedIndex=S.selectedLabel.text.length),x&&(this.keydownEvent=function(e){if(S.stage){var t=S;zot(t)||(35==e.keyCode&&(t.selectedIndex=t.selectedLabel.text.length),36==e.keyCode&&(t.selectedIndex=0),37==e.keyCode&&(t.selectedIndex=t.selectedIndex-1),39==e.keyCode&&(t.selectedIndex=t.selectedIndex+1),46==e.keyCode&&t.selectedIndex<t.selectedLabel.text.length&&(t.selectedIndex=t.selectedIndex+1,t.removeChar()),8==e.keyCode&&(e.preventDefault(),t.removeChar()),t.addChar(e.key),S.stage&&S.stage.update())}},WW.addEventListener("keydown",this.keydownEvent)),!1!==T&&e.styleTransforms(this,I),this.clone=function(){var l=new e.Keyboard(t,o,n,r,i,a,s,c,h,g,p,f,m,z,y,v,b,w,C,x,k,T,this.group,P);return S.cloneProps(l)},this.dispose=function(e,t,o){Ae.removeAllEventListeners(),Ae=null,S.keydownEvent&&WW.removeEventListener("keydown",S.keydownEvent);for(var n=0;n<S.labels.length;n++)S.labels[n].removeAllEventListeners();return F&&F.dispose(),S.labels=V=null,O&&O.off("pressmousemove",S.tickerMouseEvent),o||S.zimContainer_dispose(!0),!0}},e.extend(e.Keyboard,e.Container,["clone","dispose"],"zimContainer",!1),e.Organizer=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P){var B,E="width, list, useAdd, useRemove, usePosition, autoAdd, autoRemove, autoPosition, addForward, removeForward, backgroundColor, rollBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, color, rollColor, selectedColor, selectedRollColor, spacing, corner, keyEnabled, gradient, gloss, backdropColor, style, group, inherit";if(B=zob(e.Organizer,arguments,E,this))return B;z_d("67.3"),this.group=A;var I=!1===T?{}:e.getStyle("Organizer",this.group,P);if(zot(t)&&(t=null!=I.width?I.width:o&&o.vertical?o.width:300),zot(n)&&(n=null==I.useAdd||I.useAdd),zot(r)&&(r=null==I.useRemove||I.useRemove),zot(i)&&(i=null==I.usePosition||I.usePosition),zot(a)&&(a=null!=I.autoAdd?I.autoAdd:n),zot(l)&&(l=null!=I.autoRemove?I.autoRemove:r),zot(s)&&(s=null!=I.autoPosition?I.autoPosition:i),zot(c)&&(c=null==I.addForward||I.addForward),zot(u)&&(u=null==I.removeForward||I.removeForward),zot(d)&&(d=null!=I.backgroundColor?I.backgroundColor:"#777"),zot(h)&&(h=null!=I.rollBackgroundColor?I.rollBackgroundColor:"#555"),zot(g)&&(g=null!=I.selectedBackgroundColor?I.selectedBackgroundColor:"#333"),zot(f)&&(f=null!=I.color?I.color:"white"),zot(m)&&(m=null!=I.rollColor?I.rollColor:f),zot(z)&&(z=null!=I.selectedColor?I.selectedColor:f),zot(y)&&(y=null!=I.selectedRollColor?I.selectedRollColor:f),zot(v)&&(v=null!=I.spacing?I.spacing:1),zot(b)&&(b=null!=I.corner?I.corner:0),zot(C)&&(C=null!=I.gradient?I.gradient:.2),zot(x)&&(x=null!=I.gloss?I.gloss:null),zot(k)&&(k=null!=I.backdropColor?I.backdropColor:null),Array.isArray(b)||(b=[b,b,b,b]),n||i||r){var S=(n?1:0)+(i?4:0)+(r?1:0),W=(t+v)/S,M={width:W,height:W,label:"",shadowColor:-1,gradient:C,corner:b,backgroundColor:d,rollBackgroundColor:h},O=[],j=new e.Shape;if(j.graphics.f(f).p("AAAA4Ih6B8Ig5g4IB8h8Ih7h6IA4g5IB6B8IB7h8IA5A5Ih8B6IB8B7Ig5A5g"),n&&O.push(new e.Button({icon:j.sca(.55).rot(-45).reg(1),inherit:M})),i){var L=new e.Shape;L.graphics.f(f).p("AiJieIETCeIkTCfg"),O.push(new e.Button({icon:L.sca(.6).rot(o&&!o.vertical?180:-90).reg(-2),inherit:M})),O.push(new e.Button({icon:L.clone().sca(.6).rot(o&&!o.vertical?0:90).reg(-2),inherit:M}));var D=new e.Shape;D.graphics.f(f).p("AiFCLIAAkVIBXAAIAAEVgAgiAAICoiHIAAEQg"),O.push(new e.Button({icon:D.sca(.62).rot(o&&!o.vertical?0:90).reg(0),inherit:M})),O.push(new e.Button({icon:D.clone().sca(.62).rot(o&&!o.vertical?180:-90).reg(0),inherit:M}))}r&&O.push(new e.Button({icon:j.clone().rot(0).sca(.55),inherit:M})),0==O.length&&(O=[""]),this.zimTabs_constructor(t,W,O,d,h,g,p,f,m,z,y,!1,v,!0,!1,b,null,!0,C,x,null,null,null,null,null,null,null,null,null,null,k);var _=this;_.list=o,_.type="Organizer",_.setButtons=function(){if(i){var e=n?1:0;O[e+0]&&(O[e+0].icon.rotation=_.list&&!_.list.vertical?180:-90),O[e+1]&&(O[e+1].icon.rotation=_.list&&!_.list.vertical?0:90),O[e+2]&&(O[e+2].icon.rotation=_.list&&!_.list.vertical?0:90),O[e+3]&&(O[e+3].icon.rotation=_.list&&!_.list.vertical?180:-90)}};var Y=!1,X=o;_.change((function(e){(!Y&&_.list||_.list&&_.list!=X)&&(_.list!=X&&X&&X.noChange(),_.list.change((function(){_.orgItem=_.list.selected,_.orgIndex=_.list.selectedIndex})),Y=!0,X=_.list);var t=e.target.selectedIndex;n||t++,i||n&&!(t>0)||(t=5);var o,r=zot(_.list.selectedIndex)||_.list.selectedIndex<0;switch(r&&(_.currentValue=null),_.lastIndex=_.list.selectedIndex,t){case 0:a&&(o=Math.max(0,_.list.selectedIndex),_.add(o)),_.orgType="add";break;case 1:if(r)break;s&&(o=_.list.selectedIndex,_.up(o)),_.orgType="up";break;case 2:if(r)break;s&&(o=_.list.selectedIndex,_.down(o)),_.orgType="down";break;case 3:if(r)break;s&&(o=_.list.selectedIndex,_.toTop(o)),_.orgType="top";break;case 4:if(r)break;s&&(o=_.list.selectedIndex,_.toBottom(o)),_.orgType="bottom";break;case 5:if(r)break;l&&(o=_.list.selectedIndex,_.remove(o)),_.orgType="remove"}})),this.add=function(e,t,o){return zot(e)&&(e=_.lastIndex),zot(t)&&(t=""),e=c?Math.min(_.list.length,Math.max(0,_.list.selectedIndex)+1):Math.max(0,_.list.selectedIndex),_.list.addAt(t,e,o),_.list.selectedIndexPlusPosition=e,_.orgItem=_.list.selected,_.orgIndex=_.list.selectedIndex,_},this.up=function(e){zot(e)&&(e=_.lastIndex);var t=_.list.items[e];return zot(t)||(_.list.removeAt(1,e),_.list.addAt(t,e-1),_.list.selectedIndexPlusPosition=Math.max(0,e-1),_.orgItem=_.list.selected,_.orgIndex=_.list.selectedIndex),_},this.down=function(e){zot(e)&&(e=_.lastIndex);var t=_.list.items[e];return zot(t)||(_.list.removeAt(1,e),_.list.addAt(t,e+1),_.list.selectedIndexPlusPosition=Math.min(_.list.length-1,e+1),_.orgItem=_.list.selected,_.orgIndex=_.list.selectedIndex),_},this.toTop=function(e){zot(e)&&(e=_.lastIndex);var t=_.list.items[e];return zot(t)||(_.list.removeAt(1,e),_.list.addAt(t,0),_.list.first(),_.orgItem=_.list.selected,_.orgIndex=_.list.selectedIndex),_},this.toBottom=function(e){zot(e)&&(e=_.lastIndex);var t=_.list.items[e];if(!zot(t))return _.list.removeAt(1,e),_.list.addAt(t,_.list.length),_.list.last(),_.orgItem=_.list.selected,_.orgIndex=_.list.selectedIndex,_},this.remove=function(e){if(zot(e)){if(!(_.list.selectedIndex>=0))return _;e=_.list.selectedIndex}var t=e==_.list.selectedIndex;return _.removedItem=_.list.items[e],_.list.removeAt(1,e),t?u||(e=Math.max(0,e-1)):e=_.list.selectedIndex,_.list.selectedIndexPlusPosition=Math.min(_.list.length-1,e),_.orgItem=_.list.selected,_.orgIndex=_.list.selectedIndex,_},!1!==T&&e.styleTransforms(this,I),this.clone=function(){return _.cloneProps(new e.Organizer(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,_.group,P))},this.dispose=function(e,t,o){return O=null,o||_.zimTabs_dispose(!0),!0}}},e.extend(e.Organizer,e.Tabs,["clone","dispose"],"zimTabs",!1),e.Connectors=function(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M){var O,j="width, height, points, node, line, linear, linearWrap, linearOrder, num, snapH, snapV, dropType, deleteNode, dblclick, fullMove, min, max, boundary, expand, nodeRollColor, nodeRollBorderColor, nodeSelectedColor, nodeSelectedBorderColor, baseColor, baseBorderColor, baseRollover, rootLock, grandChildren, dblclickTime, style, group, inherit";if(O=zob(e.Connectors,arguments,j,this))return O;z_d("67.39"),this.group=W;var L=!1===S?{}:e.getStyle("Connectors",this.group,M);zot(o)&&(o=null!=L.width?L.width:null),zot(n)&&(n=null!=L.height?L.height:null),this.zimContainer_constructor(null,null,null,null,!1),this.type="Connectors",zot(r)&&(r=null!=L.points?L.points:[[0,0],[100,0],[100,100],[0,100]]),zot(i)&&(i=null!=L.node?L.node:new e.Circle(10,e.grey,e.grey)),i.removeFrom(),i.color!=e.clear||i.hitArea||i.expand(0),zot(a)&&(a=null!=L.line?L.line:new e.Line({length:10,thickness:3,color:e.tin,strokeObj:{caps:"round"}})),zot(u)&&(u=null!=L.num?L.num:10),zot(l)&&(l=null!=L.linear&&L.linear),zot(s)&&(s=null==L.linearWrap||L.linearWrap),zot(w)&&(w=null!=L.nodeRollColor?L.nodeRollColor:i.color.match("rgb")?i.color:i.color.lighten(.2)),zot(C)&&(C=null!=L.nodeRollBorderColor?L.nodeRollBorderColor:i.borderColor),zot(x)&&(x=null!=L.nodeSelectedColor?L.nodeSelectedColor:e.white),zot(k)&&(k=null!=L.nodeSelectedBorderColor?L.nodeSelectedBorderColor:i.borderColor),zot(T)&&(T=null!=L.baseColor?L.baseColor:i.color),zot(A)&&(A=null!=L.baseBorderColor?L.baseBorderColor:i.borderColor),zot(P)&&(P=null!=L.baseRollover&&L.baseRollover),zot(z)&&(z=null!=L.min?L.min:i.radius?2*i.radius:Math.min(i.width,i.height)),zot(y)&&(y=null!=L.max?L.max:null),zot(b)&&(b=null!=L.expand?L.expand:e.mobile()?10:0),zot(g)&&(g=null!=L.dropType?L.dropType:"any"),zot(p)&&(p=null==L.deleteNode||L.deleteNode),zot(f)&&(f=null==L.dblclick||L.dblclick),zot(m)&&(m=null==L.fullMove||L.fullMove),zot(I)&&(I=null!=L.dblclickTime?L.dblclickTime:.5);var D=t(I);if(I*="s"==D?1e3:1,zot(d)&&(d=null!=L.snapH?L.snapH:null),zot(h)&&(h=null!=L.snapV?L.snapV:null),zot(B)&&(B=null!=L.rootLock&&L.rootLock),zot(E)&&(E=null==L.grandChildren||L.grandChildren),l&&r.length<=1)zon&&zogy("Connector() - linear needs more than one point");else{var _=this;_.node=i,_.line=a;var Y=i.color,X=i.borderColor,R=_.lines=new e.Container(o,n).addTo(_),H=_.nodes=new e.Container(o,n).addTo(_);if("Blob"==r.type||"Squiggle"==r.type){var F=[];e.loop(r.points,(function(e){F.push([e[0],e[1]])})),r=F}_.points=r,this.addNode=function(e,t){if(!l)return U(e,t)},Q(),_.keyEvent=function(t){p&&46==t.keyCode&&(e.loop(G,(function(e){e&&e.parent&&he(e)})),_.stage&&_.stage.update())},WW.addEventListener("keydown",_.keyEvent);var N,V,G=[],q=0;this.selectNode=function(e,t){se(e,t)},this.removeNode=function(e){he(e)},this.removeConnectors=function(){e.loop(H,(function(e){he(e)}),!0),Q(),_.stage.update()},this.removeBase=function(t){e.loop(t.connectors,(function(e){he(e)})),ge(t)},this.addBase=function(e,t){U(e,t)},Object.defineProperty(this,"selectedList",{get:function(){return G},set:function(){zon&&zogy("Selectors() - selectedList is read only")}}),this.dispose=function(t,o,n){return _.nodes.loop((function(e){e.removeFrom(),e.removeAllEventListeners(),e=null}),!0),_.lines.loop((function(e){e.removeFrom(),e=null}),!0),WW.removeEventListener("keydown",_.keyEvent),_.keyEvent=null,_.bases&&e.loop(_.bases,(function(e){ge(e)})),n||(_.zimContainer_dispose(!0),_.stage&&_.stage.update()),!0},!1!==S&&e.styleTransforms(this,L),this.clone=function(){return _.cloneProps(new e.Collectors(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,_.group,M))}}function U(t,o,n,r){if(t.addChild){g="on",B=!0,E=!1,(n=t).connectorMoveEvent||(_.bases||(_.bases=[]),_.bases.push(n),n.connectorMoveEvent=n.on("pressmove",(function(){n.positionConnectors(n,!0,!0)})),n.connectorUpEvent=n.on("pressup",(function(){n.positionConnectors(n,!0,!0)})),P&&(n.connectorOverEvent=n.on("mouseover",(function(){ne(n)})),n.connectorOutEvent=n.on("mouseout",(function(){re(n)}))),n.positionConnectors=function(t,o,n){e.loop(t.connectors,(function(e){var r=t.parent.localToLocal(t.x-t.baseStart.x+e.nodeStart.x,t.y-t.baseStart.y+e.nodeStart.y,e.parent);e.x=r.x,e.y=r.y,de(e,o,n)})),t.stage&&t.stage.update()},n.setConnectorColors=function(t,o,r,i){return zot(t)||(n.connectorColor=t),zot(o)||(n.connectorBorderColor=o),zot(r)||(n.connectorRollColor=r),zot(i)||(n.connectorRollBorderColor=i),e.loop(n.connectors,(function(e){zot(t)||(e.color=t),zot(o)||(e.borderColor=o)})),n},n.setConnectorColors(T,A,w,C));var l=n.getBounds();a.endHead,Array.isArray(o)||(o=[o,o]);var s=[];return 2==o.length&&(o=[o[0],o[1],o[0],o[1]]),a.lineOrientation!=e.HORIZONTAL&&"auto"!=a.lineOrientation||e.loop([o[0],o[1]],(function(t,o){if(-1==t||-2==t){var r=n.localToLocal(0==o?l.x:l.x+l.width,l.y,_);s.push([r.x,r.y,e.HORIZONTAL])}if(-1==t||-3==t){var i=n.localToLocal(0==o?l.x:l.x+l.width,l.y+l.height,_);s.push([i.x,i.y,e.HORIZONTAL])}t>0&&e.loop(t,(function(t,r){var i=n.localToLocal(0==o?l.x:l.x+l.width,l.y+l.height*(t+1)/(r+1),_);s.push([i.x,i.y,e.HORIZONTAL])}))})),a.lineOrientation!=e.VERTICAL&&"auto"!=a.lineOrientation||e.loop([o[2],o[3]],(function(t,o){if(-1==t||-2==t){var r=n.localToLocal(l.x,0==o?l.y:l.y+l.height,_);s.push([r.x,r.y,e.VERTICAL])}if(-1==t||-3==t){var i=n.localToLocal(l.x+l.width,0==o?l.y:l.y+l.height,_);s.push([i.x,i.y,e.VERTICAL])}t>0&&e.loop(t,(function(t,r){var i=n.localToLocal(l.x+l.width*(t+1)/(r+1),0==o?l.y:l.y+l.height,_);s.push([i.x,i.y,e.VERTICAL])}))})),n.connectors=[],n.baseStart=new e.Point(n.x,n.y),e.loop(s,(function(e){var t=U(e[0],e[1],n,e[2]);ie(n,t)})),setTimeout((function(){n.positionConnectors(n,!0,!0)}),50),_}var c=i.clone().loc(t,o,H).drag({boundary:v}).expand(b);return c.orientation=r,c.on("mouseover",K),c.on("mouseout",J),c.on("mousedown",$),c.on("pressmove",ee),c.on("pressup",te),p&&c.hold(Z),c.creations=[],c}function Q(){e.loop(r,(function(e){U(e[0],e[1])})),l&&H.loop((function(e,t,o){0==t?(e.before=s?H.getChildAt(o-1):null,e.after=H.getChildAt(t+1)):t==o-1?(e.after=s?H.getChildAt(0):null,e.before=H.getChildAt(t-1)):(e.before=H.getChildAt(t-1),e.after=H.getChildAt(t+1)),c&&t>0&&e.noMouse()}))}function Z(e){var t=e.target.stage,o=e.target;_.bases||B&&!o.creator.creator||(o.adding?he(o.creator):he(o),t&&t.update())}function K(e){var t=e.target;t.selected||(t.color=t.base?t.base.connectorRollColor:w,t.borderColor=t.base?t.base.connectorRollBorderColor:C,_.stage&&_.stage.update())}function J(e){var t=e.target;t.selected||(t.color=t.base?t.base.connectorColor:Y,t.borderColor=t.base?t.base.connectorBorderColor:X,_.stage&&_.stage.update())}function $(t){var o=t.target;if(l||B&&!o.creator||!f||(0==q&&(V=setTimeout((function(){if(q=0,G){var e=_.stage?_.stage.frame:WW.zdf,t=H.loop((function(t){if(t.hitTestPoint(e.mouseX,e.mouseY)&&t.selected)return!1}));t&&ue()}}),I)),q++),o.startX=o.x,o.startY=o.y,!l&&G.length>0&&e.loop(G,(function(e){e.startX=e.x,e.startY=e.y})),!(o.creations.length>=u||o.selected||o.creator&&!E)){o.adding=!0;var n=U(o.x,o.y).bot();if(n.creations=o.creations,n.creatorLine=o.creatorLine,n.creator=o.creator,n.orientation=o.orientation,n.startX=o.startX,n.startY=o.startY,o.base&&(n.base=o.base,n.baseStart=o.baseStart,n.nodeStart=o.nodeStart,n.connectors=o.connectors,o.base=o.baseStart=o.nodeStart=o.connectors=null,n.base.connectors&&n.base.connectors.splice(n.base.connectors.indexOf(o),1,n),n.color=n.base.connectorColor,n.borderColor=n.base.connectorBorderColor),n.before=o.before,n.after=o.after,n.before&&(n.before.after=n),n.after&&(n.after.before=n),n.creator){var r=n.creator.creations.indexOf(o);-1!=r&&n.creator.creations.splice(r,1,n)}e.loop(n.creations,(function(e){e.creator=n})),o.creator=n,o.creatorLine=a.clone().setPoints(o.x,o.y,o.x,o.y).addTo(R).alp(0),o.creatorLine.lineOrientation=o.orientation,o.creatorLine.node=o,o.creatorLine.creatorNode=n,o.creations=[],n.creations.push(o)}}function ee(t){var o=t.target;o.creatorLine&&o.creatorLine.alp(1),!l&&G.length>0&&-1==G.indexOf(o)&&ue(),de(o,!1,!0),_.bases&&e.loop(_.bases,(function(e){o.creator&&o.creator.base==e||(!e.connectorsOn&&o.hitTestBounds(e)&&ne(e),e.connectorsOn&&!o.hitTestBounds(e)&&re(e))})),_.stage.update()}function te(t){var o=t.target;_.bases&&e.loop(_.bases,(function(e){e!=o.base&&e.connectorsOn&&re(e)}));var n=!1;if(!l&&q>1){clearTimeout(V);var r=o.adding?o.creator:o;if(o.adding&&he(r.creations[r.creations.length-1]),!r.selected)se(r,!(_.stage?_.stage.frame:WW.zdf).ctrlKey);q=0,n=!0}if(l||_.base||(d&&(o.x=Math.round(o.x/d)*d),h&&(o.y=Math.round(o.y/h)*h)),z&&e.dist(o.x,o.y,o.startX,o.startY)<z||y&&e.dist(o.x,o.y,o.startX,o.startY)>y)return o.adding?he(o):(o.loc(o.startX,o.startY),n||de(o)),_.stage.update(),void _.dispatchEvent("noconnection");var i=!1,a=!1;if(l){var s=o.creator;if(_.connectionStart=s,_.connectionEnd=o,s.before&&o.hitTestCircle(s.before)&&!c)o.loc(s.before).removeFrom(),s.before.after=null,s.before.before||s.before.noMouse(),s.before=null,s.after||s.noMouse(),a=!0,i=ce();else if(s.after&&o.hitTestCircle(s.after))o.loc(s.after).removeFrom(),s.after.before=null,s.after.after||s.after.noMouse(),c&&s.after.mouse(),s.after=null,s.before||s.noMouse(),c&&s.noMouse(),a=!0,i=ce();else{if(s&&!(o.creations.length>0))return he(o),_.stage.update(),void _.dispatchEvent("noconnection");o.loc(o.startX,o.startY).bot()}}else{if("off"==g){if(!H.loop((function(e){if(o!=e)return o.hitTestCircles(e)?(o.adding?he(o):(o.loc(o.startX,o.startY),de(o)),B&&le(o),!m&&o.creator&&u>0&&o.creator.creations.length>=u&&o.creator.noMouse(),_.dispatchEvent("connection"),_.stage.update(),!1):void 0})))return void oe(o)}else if("on"==g||"single"==g){var p,f=0;if(H.loop((function(e){if(o!=e&&o.hitTestCircles(e)){if(p=e,_.bases&&(o.orientation!=e.orientation||o.creator&&o.creator.base&&o.creator.base==e.base))return;if("on"==g)return!1;f++,f+=e.creations.length}}))&&("single"!=g||1!=f))return void oe(o);if(o.loc(p),o.creator&&o.orientation==e.VERTICAL&&Math.round(o.y)==Math.round(o.creator.startY)||o.creator&&o.orientation==e.HORIZONTAL&&Math.round(o.x)==Math.round(o.creator.startX))return;p.base&&p.base.connectors&&ie(p.base,o),i=!0}}!m&&o.creator&&u>0&&o.creator.creations.length>=u&&o.creator.noMouse(),o.adding=!1,de(o,!0,!0),e.loop(G,(function(e){e.startX=e.x,e.startY=e.y})),o.startX=o.x,o.startY=o.y,B&&le(o),a?_.dispatchEvent("connection"):_.dispatchEvent("noconnection"),i&&_.dispatchEvent("complete"),_.stage.update()}function oe(e){e.adding||!E?he(e):(e.loc(e.startX,e.startY),de(e)),B&&le(e),e.base&&e.base.connectors&&ae(e.base,e),_.stage.update(),_.dispatchEvent("noconnection")}function ne(t){e.loop(t.connectors,(function(e){e.color=t.connectorRollColor,e.borderColor=t.connectorRollBorderColor})),t.connectorsOn=!0,t.stage.update()}function re(t){e.loop(t.connectors,(function(e){e.color=t.connectorColor,e.borderColor=t.connectorBorderColor})),t.connectorsOn=!1,t.stage.update()}function ie(e,t){e.connectors.push(t),t.nodeStart=t.parent.localToLocal(t.x,t.y,e.parent),t.nodeStart.x-=e.x-e.baseStart.x,t.nodeStart.y-=e.y-e.baseStart.y,t.base=e}function ae(e,t){e.connectors.splice(e.connectors.indexOf(t),1),t.nodeStart=null,t.base=null}function le(e){e.creator&&(e.creator.creator?le(e.creator):e.creator&&e.creator.creations.length>=u?e.creator.noMouse():e.creator.mouse())}function se(t,o){o&&e.loop(t.creations,(function(e){se(e,o)})),t.selected=!0,t.color=t.base?t.base.connectorColor:x,t.borderColor=t.base?t.base.connectorBorderColor:k,G.push(t),t.top(),N||(N=_.stage.on("stagemousedown",(function(){var e=_.stage?_.stage.frame:WW.zdf,t=H.loop((function(t){if(t.hitTestPoint(e.mouseX,e.mouseY))return!1}));t&&ue()})))}function ce(){var e=H.loop((function(e){if(e.before||e.after)return!1}));if(e)return H.loop((function(e){e.noMouse()})),!0}function ue(){e.loop(G,(function(e){e.selected=!1,e.color=e.base?e.base.connectorColor:Y,e.borderColor=e.base?e.base.connectorBorderColor:X})),G=[],_.stage.off("stagemousedown",N),N=null,_.stage.update()}function de(t,o,n){var r=G.length>0?G:[t];e.loop(r,(function(r){r!=t&&r.loc(r.startX+t.x-t.startX,r.startY+t.y-t.startY),r.creator&&r.creatorLine.setPoints(r.x,r.y,r.creator.x,r.creator.y,o,n),e.loop(r.creations,(function(e){e.creatorLine.setPoints(e.x,e.y,e.creator.x,e.creator.y,o,n)}))}))}function he(t){if(e.loop(t.creations,(function(e){he(e)}),!0),t.creatorLine){t.creatorLine.removeFrom();var o=t.creator.creations.indexOf(t);-1!=o&&t.creator.creations.splice(o,1),t.creator.mouseEnabled||B&&!t.creator.creator||t.creator.mouse()}return t.removeFrom(),t.removeAllEventListeners(),t=null,_}function ge(e){e.off("pressmove",e.connectorMoveEvent),e.off("pressup",e.connectorUpEvent),e.connectorOverEvent&&e.off("mouseover",e.connectorOverEvent),e.connectorOutEvent&&e.off("mouseout",e.connectorOutEvent),e.connectors=null,e.baseStart=null,e.positionConnectors=e.setConnectorColors=null,e.connectorColor=e.connectorBorderColor=e.connectorRollColor=e.connectorRollBorderColor=null,_.bases.splice(_.bases.indexOf(e),1),_.stage&&_.stage.update()}},e.extend(e.Connectors,e.Container,["clone","dispose"],"zimContainer",!1),e.Marquee=function(n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v){var b,w="width, height, items, time, transition, speed, direction, marginLeft, marginRight, marqueeType, borderColor, borderWidth, refresh, mix, style, group, inherit";if(b=zob(e.Marquee,arguments,w,this))return b;z_d("67.4"),this.group=y;var C=!1===z?{}:e.getStyle("Marquee",this.group,v),x=this;zot(n)&&(n=null!=C.width?C.width:300),zot(r)&&(r=null!=C.height?C.height:100);var k=t(a);zot(a)&&(a=null!=C.time?C.time:"s"==k?5:5e3),zot(l)&&(l=null!=C.transition?C.transition:"slide"),zot(g)&&(g=null!=C.borderColor?C.borderColor:"#333"),zot(p)&&(p=null!=C.borderWidth?C.borderWidth:1),g<0||p<0?g=p=null:null!=g&&null==p&&(p=1),zot(u)&&(u=null!=C.marginLeft?C.marginLeft:25),zot(d)&&(d=null!=C.marginRight?C.marginRight:25),zot(s)&&(s=null!=C.speed?C.speed:"s"==k?.5:500),o(s,k),zot(c)&&(c=null!=C.direction?C.direction:"right"),zot(f)&&(f=null!=C.refresh?C.refresh:"s"==k?1800:18e5),zot(m)&&(m=null==C.mix||C.mix),this.zimContainer_constructor(n+u+d,r,null,null,!1),this.type="Marquee",this.speed=s;var T=new e.Rectangle(n-1,r-1,e.clear).addTo(x).mov(u+.5,.5),A=this.content=new e.Container(n,r).loc(u,0,x).setMask(T),P=this.pages=new e.Pages(null,l,s,null,A).addTo(A),B=!1;function E(){B=!0,x.selectedIndex=0,x.selected=P.pages[x.selectedIndex].page,x.lastSelected=null,x.selected.marqueeOn&&x.selected.marqueeOn(),x.interval=e.interval(a,(function(){x.go()}))}if(this.add=function(e,t,o,n,r){zot(r)&&(r=!0),e.scaleTo(A,100,100),t&&e.cur().on("click",(function(){zgo(t,o)})),P.addPage(e),r&&P.center(),e.marqueeViews=0,e.marquee=x,B||E(),n||D(),H&&H.top()},this.remove=function(e){if(x.selected==e){if(1==x.pages.pages.length)return;var t=x.selectedIndex+1;t==x.pages.pages.length&&(t=0),x.pages.go(t,null,null,0),setTimeout((function(){x.pages.removePage(e),e.dispose&&e.dispose(),D()}),20)}else x.pages.removePage(e),e.dispose&&e.dispose(),D()},zot(i)||Array.isArray(i)||(i=[i]),i&&i.length>0&&(m&&e.shuffle(i),e.loop(i,(function(e){x.add(e,null,null,!0)}))),f>0)var I=e.timeout(f*("s"==k?1e3:1),(function(){location.reload()}),null,"ms");x.go=function(t){if(x.selected.marqueeViews+=1,x.selected.marqueeOff&&x.selected.marqueeOff(),t)x.selected=t,e.loop(P.pages,(function(e,o){e.page!=t||(x.selectedIndex=o)})),x.interval.interval=x.selected.marqueeTime?x.selected.marqueeTime:a,x.interval.pause(L.toggled,null,!0);else{var o=x.selectedIndex+1;x.selectedIndex=o%P.pages.length,x.selected=P.pages[x.selectedIndex].page,x.interval.time=x.selected.marqueeTime?x.selected.marqueeTime:a}x.dispatchEvent("page"),x.selected.marqueeOn&&x.selected.marqueeOn(),P.go(x.selected,c,l,s)},P.on("pagetransitioned",(function(){x.dispatchEvent("pagetransitioned"),x.indicator&&(x.indicator.selectedIndex=x.selectedIndex)}));var S=!1,W=x.left=new e.Container(u-4,r-4),M=(new e.Shape).sca(.6);M.graphics.f(e.light).mt(0,0).p("AAhCLIAAkVIBXAAIAAEVgAh3CLIAAkVIBXAAIAAEVg");var O=(new e.Shape).sca(.6).reg(-2,0);O.graphics.f(e.light).mt(0,0).p("AiJieIETCeIkTCfg");var j,L=x.button=new e.Button({label:"",icon:M,toggleIcon:O,width:45,height:45,corner:0,shadowBlur:0}).scaleTo(W,100).pos(0,0,!1,!0,W);function D(){if(!zot(u)&&0!=u){var t=4*u/25;W.pos(u-W.width-t,t/2,!1,!0,x),x.indicator&&(x.indicator.dispose(),x.indicator.removeFrom()),j||(j=new e.Proportion(8,16,W.width+t,W.width/2+t,-1)),x.indicator=new e.Indicator({width:(P.pages.length<=2?P.pages.length:P.pages.length-1)*(W.width-3),height:j.convert(P.pages.length),num:P.pages.length,shadowBlur:-1,interactive:!0,scale:1.2,indicatorType:h}),x.indicator.fit(0,0,r-L.height,L.width),x.indicator.rot("down"==c?-90:90).center(W).pos(null,W.width-t/2,null,!0),x.indicator.selectedIndex=x.selectedIndex,x.indicator.on("change",(function(){x.go(P.pages[x.indicator.selectedIndex].page)}))}}if(L.on("click",(function(){x.interval&&x.interval.pause(L.toggled),S=L.toggled,x.stage.update()})),D(),!zot(d)&&d>0&&WW.zdf&&WW.zdf){var _=4*d/25,Y=x.right=new e.Container(45,270),X=x.icon=WW.zdf.makeIcon(e.grey,e.lighter,e.silver).sca(.5).pos(0,0,!0,!0,Y).mov(0,0).cur();X.on("mouseover",(function(){R.animate({props:{scaleX:1},time:500,ease:"backOut",override:!0,timeUnit:"ms"}),X.stage.update()})),X.on("mouseout",(function(){R.animate({props:{scaleX:0},time:300,ease:"backIn",override:!0,timeUnit:"ms"}),X.stage.update()})),X.on("mousedown",(function(){zgo("https://zimjs.com/marquee","_blank")}));var R=x.label=new e.Label({text:"MARQUEE",color:e.dark,backgroundColor:e.lighter,shiftVertical:1,paddingVertical:5}).rot(-90).pos(0,13,!0,!1,Y).reg(-10).sca(0,1).mov(0);Y.fit(0,0,d-_,r-_),Y.pos(d-Y.width-_,_/2,!0,!0,x)}if(x.stage&&x.stage.update(),this.pause=function(e,t){zot(e)&&(e=!0),e!=S&&(S=e,x.interval.pause(e,t),x.button.toggle(e))},Object.defineProperty(this,"paused",{get:function(){return S},set:function(){zon&&zogy("Marquee() - paused is read only - use pause()")}}),Object.defineProperty(this,"time",{get:function(){return a},set:function(e){a=e,x.interval.time=a}}),this.load=function(t,o){var n=[];m&&e.shuffle(t),e.loop(t,(function(e){Array.isArray(e)?n.push(e[0]):n.push(e)}));var r=x.stage?x.stage.frame:WW.zdf;return x.marqueeLoader=r.loadAssets(n,o),x.loadEvent=x.marqueeLoader.on("assetload",(function(e){var o,n,r=t[e.asset.id];Array.isArray(r)?(o=r[0],n=r[1]):(o=r,n="_self"),x.add(e.asset,o,n),D()})),x},!zot(g)){var H=new e.Rectangle(n-1,r-1,e.clear,g,p).loc(T,null,x);H.mouseEnabled=!1}!1!==z&&e.styleTransforms(this,C),this.clone=function(){return x.cloneProps(new e.Marquee(n,r,i,a,l,s,c,h,g,p,f,m,z,this.group,v))},this.dispose=function(e,t,o){return I&&I.clear(),x.interval&&x.interval.clear(),x.loadEvent&&x.marqueeLoader.off("assetload",x.loadEvent),P.dispose(),P=null,o||this.zimContainer_dispose(!0),!0}},e.extend(e.Marquee,e.Container,["clone","dispose"],"zimContainer"),e.Loader=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j){var L,D="width, height, label, type, backgroundColor, rollBackgroundColor, color, rollColor, borderColor, rollBorderColor, borderWidth, corner, shadowColor, shadowBlur, hitPadding, gradient, gloss, dashed, backing, rollBacking, rollPersist, icon, rollIcon, toggle, toggleBacking, rollToggleBacking, toggleIcon, rollToggleIcon, toggleEvent, frame, multiple, accept, style, group, inherit";if(L=zob(e.Loader,arguments,D,this))return L;z_d("67.5"),this.group=O;var _=!1===M?{}:e.getStyle("Loader",this.group,j);if(zot(t)&&(t=null!=_.width?_.width:250),zot(o)&&(o=null!=_.height?_.height:70),zot(r)&&(r=null!=_.type?_.type:"image"),r=r.toLowerCase(),zot(i)&&(i=null!=_.backgroundColor?_.backgroundColor:"rgba(0,0,0,.05)"),zot(a)&&(a=null!=_.rollBackgroundColor?_.rollBackgroundColor:"rgba(0,0,0,.1)"),zot(l)&&(l=null!=_.color?_.color:"rgba(0,0,0,.5)"),zot(s)&&(s=null!=_.rollColor?_.rollColor:l),zot(c)&&(c=null!=_.borderColor?_.borderColor:"rgba(0,0,0,.3)"),zot(d)&&(d=null!=_.borderWidth?_.borderWidth:1),zot(y)&&(y=null==_.dashed||_.dashed),zot(h)&&(h=null!=_.corner?_.corner:0),zot(S)&&(S=null==_.multiple||_.multiple),zot(n)&&(n=null!=_.label?_.label:new e.Label({text:"UPLOAD PIC",color:l,rollColor:s,valign:"center",align:"center",backing:"ignore",shadowColor:"ignore",shadowBlur:"ignore",backgroundColor:"ignore",group:this.group})),void 0===I){if(!WW.zdf)return void(zon&&zogy("zim.Loader - please provide a reference to zim Frame"));I=WW.zdf}this.zimButton_constructor(t,o,n,i,a,null,l,s,null,c,d,u,null,v,b,null,C,x,null,h,y,g,p,m,z,null,null,null,null,null,f,null,null,null,w,k,null,null,null,null,null,null,T,A,null,P,B,null,E,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,!1),this.type="Loader";var Y=this,X=I.stage;n=Y.label;var R=Y.tag=document.createElement("input");I.tag?I.tag.appendChild(R):document.body.appendChild(R),R.setAttribute("type","file"),R.setAttribute("aria-hidden",!0),S&&R.setAttribute("multiple","multiple"),W&&R.setAttribute("accept",W),R.hidden=!0,R.zimDisplay=R.style.display||"inline-block",R.style.cssText="border:thin solid grey; z-index:2; width:"+t+"px; height:"+o+"px; overflow:hidden; outline:none;position:absolute; left:0px; top:0px; display:none; cursor:pointer; opacity: 0; filter: alpha(opacity=0);",this.addEventListener("mousedown",(function(){R.click()})),R.addEventListener("change",V);var H=new createjs.DOMElement(R);X.addChild(H),H.alpha=0;var F=I.retina&&WW.devicePixelRatio||1;function N(){Y.resize(),Y.time2=setTimeout((function(){R.style.display="block",R.hidden=!1,R.style.display="block"}),50),Y.on("added",N,null,!0)}function V(t){var o,n,i;if(o=t.dataTransfer&&t.dataTransfer.files&&t.dataTransfer.files.length>0?t.dataTransfer.files:t.target.files,"text"==r||"json"==r){var a,l=[];if("json"==r.toLowerCase())var s,c=[]}else if("other"==r)var u,d=[];else var h,g=[];for(var p=0;p<o.length;p++)n=o[p],i=void 0,(i=new FileReader).onload=function(t){if("text"==r||"json"==r){var n=t.target.result;if(l.push(n),"json"==r){var i=JSON.parse(n);c.push(i)}1==l.length&&(a=n,"json"==r&&(s=i)),l.length==o.length&&((p=new createjs.Event("loaded")).texts=l,p.text=a,p.lastText=n,p.total=l.length,"json"==r&&(p.jsons=c,p.json=s,p.lastJSON=i),Y.dispatchEvent(p),R.value="")}else if("other"==r){var p,f=t.target.result;d.push(f),1==d.length&&(u=f),d.length==o.length&&((p=new createjs.Event("loaded")).others=d,p.other=u,p.lastOther=f,p.total=d.length,Y.dispatchEvent(p),R.value="")}else{var m=new Image;m.onload=function(){var t=new e.Bitmap(m);if(g.push(t),1==g.length&&(h=t),g.length==o.length){var n=new createjs.Event("loaded");n.bitmaps=g,n.bitmap=h,n.lastBitmap=t,n.total=g.length,Y.dispatchEvent(n),R.value=""}},m.src=t.target.result}},"text"==r||"json"==r?i.readAsText(n):i.readAsDataURL(n)}this.resize=function(t,o){if(!Y.stage)return R.setAttribute("aria-hidden",!0),R.hidden=!0,void(R.style.display="none");R.setAttribute("aria-hidden",!1),R.hidden=!1,R.style.display=R.zimDisplay,zot(t)&&(t=!0),Y.time1&&clearTimeout(Y.time1),o||(Y.time1=setTimeout((function(){Y.resize(null,!0)}),40));var n=Y.getConcatenatedMatrix().decompose(),r=Y.localToGlobal(0,0);if(I.retina){var i=e.browserZoom();I.tag?(H.x=r.x/F/i,H.y=r.y/F/i):(H.x=I.x/X.scaleX+r.x/F/i,H.y=I.y/X.scaleY+r.y/F/i),e.sca(H,n.scaleX/F/X.scaleX/i,n.scaleY/F/X.scaleY/i)}else H.x=I.x+r.x*I.scale,H.y=I.y+r.y*I.scale,e.sca(H,I.scale*n.scaleX,I.scale*n.scaleY);return X.update(),Y},this.resize(),Y.on("added",(function(){R.style.display="block",R.hidden=!1,R.style.display="block",Y.resize()})),Y.added(N),Y.on("removed",(function(){Y.time1&&clearTimeout(Y.time1),Y.time2&&clearTimeout(Y.time2),R&&(R.style.display="none",R.hidden=!0,R.style.display="none")}));var G=new XMLHttpRequest;if(G.upload){var q=function(e){R.removeEventListener("change",V),V(e),setInterval((function(){R.addEventListener("change",V)}),100)};R.addEventListener("drop",q)}this.save=function(t,o,n,r,i,a,l,s,c,u,d){var h,g="content, filename, x, y, width, height, cached, cachedBounds, type, data, quality";if(h=zob(Y.save,arguments,g))return h;if(zot(t)&&(t=I.stage),zot(c)&&(c="png"),zot(o))o="saved_"+String(e.makeID("numbers",5))+"."+c;else{var p=o.split(".");if(1==p.length)o+="."+c;else{var f=["png","jpg","jpeg"],m=f.indexOf(p[p.length-1].toLowerCase());-1==m?o+="."+c:c=f[m]}}if(zot(n)&&(n=0),zot(r)&&(r=0),zot(i)&&(i=t.getBounds&&t.getBounds()?t.getBounds().width:I.width),zot(a)&&(a=t.getBounds&&t.getBounds()?t.getBounds().height:I.height),t.cache(n,r,i,a),u){var z=t.cacheCanvas.toDataURL("image/"+c,d);return l?s&&t.cache(s.x,s.y,s.width,s.height):t.uncache(),z}var y=/Edge\/(\d)+/.test(navigator.userAgent);if(y){var v=WW.open();v.document.write("<html><head><title>saved</title></head><body style='margin:0px;padding:0px;overflow:hidden'><img src="+t.cacheCanvas.toDataURL("image/"+c)+"></body></html>"),v.document.close()}else{"jpg"==c&&(c="jpeg");var b=document.createElement("a");b.setAttribute("download",o),b.setAttribute("href",t.cacheCanvas.toDataURL("image/"+c,d)),document.body.appendChild(b),b.click(),document.body.removeChild(b)}return l?s&&t.cache(s.x,s.y,s.width,s.height):t.uncache(),Y},!1!==M&&e.styleTransforms(this,_),this.clone=function(){var r=new e.Loader(t,o,zot(n)?null:n.clone(),i,a,l,s,c,d,h,g,p,f,m,z,zot(v)?null:v.clone(),zot(b)?null:b.clone(),w,zot(C)?null:C.clone(),zot(x)?null:x.clone(),k,zot(T)?null:T.clone(),zot(A)?null:A.clone(),zot(P)?null:P.clone(),zot(B)?null:B.clone(),E,I,M,this.group);return Y.cloneProps(r)},Object.defineProperty(this,"frame",{get:function(){return I},set:function(e){e!=I&&(I.off("update",Y.updateEvent),I.off("resize",Y.resizeEvent),I=e,Y.resizeEvent=I.on("resize",Y.resize),Y.updateEvent=I.on("update",Y.resize),Y.resize())}}),this.resizeEvent=I.on("resize",Y.resize),this.updateEvent=I.on("update",Y.resize),this.dispose=function(e,t,o){var n;return Y.stage&&(n=Y.stage),I.off("update",Y.updateEvent),I.off("resize",Y.resizeEvent),V&&R.removeEventListener("change",V),q&&R.removeEventListener("drop",q),R&&R.parentNode&&R.parentNode.removeChild(R),R=null,o||(this.zimButton_dispose(),n&&n.update()),!0}},e.extend(e.Loader,e.Button,["clone","dispose"],"zimButton",!1),e.TextArea=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T){var A,P="width, height, size, padding, color, backgroundColor, borderColor, borderWidth, corner, shadowColor, shadowBlur, dashed, id, placeholder, readOnly, spellCheck, password, inputType, wrap, maxLength, frame, expand, style, group, inherit";if(A=zob(e.TextArea,arguments,P,this))return A;z_d("67.6"),this.group=k;var B=!1===x?{}:e.getStyle("TextArea",this.group,T);if(zot(t)&&(t=null!=B.width?B.width:250),zot(o)&&(o=null!=B.height?B.height:70),zot(n)&&(n=null!=B.size?B.size:20),zot(r)&&(r=null!=B.padding?B.padding:5),zot(i)&&(i=null!=B.color?B.color:"#666"),zot(a)&&(a=null!=B.backgroundColor?B.backgroundColor:"rgba(256,256,256,.1)"),zot(l)&&(l=null!=B.borderColor?B.borderColor:"rgba(0,0,0,.1)"),zot(s)&&(s=null!=B.borderWidth?B.borderWidth:null),l<0||s<0?l=s=null:null!=l&&null==s&&(s=1),zot(c)&&(c=null!=B.corner?B.corner:0),!zot(d)&&zot(u)&&(u=null!=B.shadowColor?B.shadowColor:"rgba(0,0,0,.3)"),!zot(u)&&zot(d)&&(d=null!=B.shadowBlur?B.shadowBlur:10),zot(z)&&(z=null!=B.password&&B.password),zot(y)&&(y=null!=B.inputType&&B.inputType),zot(v)&&(v=null==B.wrap||B.wrap),zot(b)&&(b=null!=B.maxLength?B.maxLength:null),zot(m)&&(m=null==B.spellCheck||B.spellCheck),zot(f)&&(f=null!=B.readOnly&&B.readOnly),zot(p)&&(p=null!=B.placeholder?B.placeholder:null),this.maxLength=b,zot(C)&&(C=null!=B.expand?B.expand:20),!0===C&&(C=20),void 0===w){if(!WW.zdf)return void(zon&&zogy("zim.TextArea - please provide a reference to zim Frame"));w=WW.zdf}this.zimContainer_constructor(t,o,null,null,!1),this.type="TextArea";var E=this,I=w.stage,S=this.background=new e.Rectangle(t,o,a,l,s,c,h,null,null,!1).expand(C);-1!=u&&d>0&&(S.shadow=new createjs.Shadow(u,3,3,d)),E.addChild(S);var W=E.tag=y||z?document.createElement("input"):document.createElement("textarea");w.tag?w.tag.appendChild(W):document.body.appendChild(W),zot(g)||(W.setAttribute("id",g),W.setAttribute("name",g)),z?W.setAttribute("type","password"):y&&W.setAttribute("type",y),W.readOnly=f,W.spellcheck=m,p&&W.setAttribute("placeholder",p),W.zimDisplay=W.style.display||"inline-block",W.style.cssText="background-color:rgba(0,0,0,.01); color:"+i+"; resize:none; z-index:3; width:"+(t-2*r)+"px; height:"+(o-2*r)+"px; overflow:hidden; outline:none;font-size:"+n+"px; font-family:"+(null!=B.font?B.font:"arial")+"; border:none; position:absolute; left:0px; top:0px; display:none;",E.taInput=function(){!zot(E.maxLength)&&E.text.length>E.maxLength&&(E.text=E.text.substring(0,E.maxLength)),E.dispatchEvent("input")},E.taFocus=function(){E.stage&&(w=E.stage.frame),w.zil&&WW.removeEventListener("keydown",w.zil[0]),E.dispatchEvent("focus")},E.taBlur=function(){E.stage&&(w=E.stage.frame),w.zil&&WW.addEventListener("keydown",w.zil[0]),E.dispatchEvent("blur")},W.addEventListener("change",E.taChange),W.addEventListener("input",E.taInput),W.addEventListener("focus",E.taFocus),W.addEventListener("blur",E.taBlur);var M=new createjs.DOMElement(W);M.alpha=0,this.on("mousedown",(function(){setTimeout((function(){W.focus()}),100)})),this.setFocus=function(e){return zot(e)&&(e=!0),e?W.focus():W.blur(),E};var O=w.retina&&WW.devicePixelRatio||1;function j(){I.addChild(M),E.time2=setTimeout((function(){W.style.display=W.zimDisplay}),50),E.resize(),E.on("added",j,null,!0),E.FOEvent=I.on("stagemousedown",(function(){E.focus=!1}))}this.resize=function(t,o){zot(t)&&(t=!0),E.time1&&clearTimeout(E.time1),o||(E.time1=setTimeout((function(){E.resize(null,!0)}),40));var n=E.getConcatenatedMatrix().decompose(),i=E.localToGlobal(r,r);if(w.retina){var a=e.browserZoom();w.tag?(M.x=i.x/O/a,M.y=i.y/O/a):(M.x=w.x/I.scaleX+i.x/O/a,M.y=w.y/I.scaleY+i.y/O/a),e.sca(M,n.scaleX/O/I.scaleX/a,n.scaleY/O/I.scaleY/a)}else w.tag?(M.x=i.x*w.scale,M.y=i.y*w.scale):(M.x=w.x+i.x*w.scale,M.y=w.y+i.y*w.scale),e.sca(M,w.scale*n.scaleX,w.scale*n.scaleY);return M.alpha=E.alpha,E.parent&&(M.alpha*=E.parent.alpha),t&&E.stage&&I.update(),E},this.resize(),E.added(j),E.on("removed",(function(){E.time1&&clearTimeout(E.time1),E.time2&&clearTimeout(E.time2),I.removeChild(M),E.FOEvent&&I.off("stagemousedown",E.FOEvent),W&&(W.style.display="none")})),Object.defineProperty(this,"currentValue",{get:function(){return W.value},set:function(e){W.value=e}}),Object.defineProperty(this,"text",{get:function(){return W.value},set:function(e){W.value=e}}),Object.defineProperty(this,"focus",{get:function(){return document.activeElement==W},set:function(e){E.setFocus(e)}}),Object.defineProperty(this,"readOnly",{get:function(){return W.readOnly},set:function(e){W.readOnly=e}}),null!=WW.KEYFOCUS&&(e.KEYFOCUS=WW.KEYFOCUS),Object.defineProperty(this,"keyFocus",{get:function(){return e.KEYFOCUS==E},set:function(){e.KEYFOCUS=E}}),e.KEYFOCUS||(E.keyFocus=!0),E.taMousedown=function(){E.keyFocus=!0},W.addEventListener("mousedown",E.taMousedown),v||(W.style.whiteSpace="pre"),!1!==x&&e.styleTransforms(this,B),this.clone=function(){var k=new e.TextArea(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,this.group,T);return E.cloneProps(k)},Object.defineProperty(this,"frame",{get:function(){return w},set:function(e){e!=w&&(w.off("update",E.updateEvent),w.off("resize",E.resizeEvent),w=e,E.resizeEvent=w.on("resize",E.resize),E.updateEvent=w.on("update",E.resize),O=w.retina&&WW.devicePixelRatio||1,I=w.stage,E.resize())}}),this.resizeEvent=w.on("resize",E.resize),this.updateEvent=w.on("update",E.resize),this.dispose=function(e,t,o){var n;return E.stage&&(n=E.stage),w.off("update",E.updateEvent),w.off("resize",E.resizeEvent),n&&E.FOEvent&&n.off("stagemousedown",E.FOEvent),W&&W.parentNode&&W.parentNode.removeChild(W),W.removeEventListener("change",E.taChange),W.removeEventListener("input",E.taInput),W.removeEventListener("focus",E.taFocus),W.removeEventListener("blur",E.taBlur),W.removeEventListener("mousedown",E.taMousedown),W=null,o||(this.zimContainer_dispose(!0),n&&n.update()),E.background=null,!0}},e.extend(e.TextArea,e.Container,["clone","dispose"],"zimContainer",!1),e.Tag=function(t,o,n,r,i,a,l,s,c,u,d,h){var g,p="width, height, id, frame, backgroundColor, padding, paddingHorizontal, paddingVertical, expand, style, group, inherit";if(g=zob(e.Tag,arguments,p,this))return g;z_d("67.7"),this.group=d;var f=!1===u?{}:e.getStyle("Tag",this.group,h);if(zot(t)&&(t=null!=f.width?f.width:250),zot(o)&&(o=null!=f.height?f.height:70),zot(n)&&(n=null!=f.id?f.id:"zimTag_"+e.rand(1e4)),void 0===r){if(!WW.zdf)return void(zon&&zogy("zim.Tag - please provide a reference to zim Frame"));r=WW.zdf}zot(i)&&(i=null!=f.backgroundColor?f.backgroundColor:"rgba(0,0,0,0)"),zot(a)&&(a=null!=f.padding?f.padding:10),zot(l)&&(l=null!=f.paddingHorizontal?f.paddingHorizontal:a),zot(s)&&(s=null!=f.paddingVertical?f.paddingVertical:a),zot(c)&&(c=null!=f.expand?f.expand:20),!0===c&&(c=20),this.zimContainer_constructor(t,o,null,null,!1),this.type="Tag",this.tagID=n,this.id=n;var m=this,z=r.stage;m.background=new e.Rectangle(t+l,o+s,i).center(this).expand(c||0);var y=m.tag=document.createElement("div");r.tag?r.tag.appendChild(y):document.body.appendChild(y),y.setAttribute("id",n),y.setAttribute("name",n),y.zimDisplay=y.style.display||"inline-block",y.style.cssText="resize:none; z-index:3; width:"+t+"px; height:"+o+"px; overflow:hidden; outline:none;position:absolute; left:0px; top:0px; display:none;";var v=new createjs.DOMElement(y);v.alpha=0;var b=r.retina&&WW.devicePixelRatio||1;function w(){z.addChild(v),m.time2=setTimeout((function(){y.style.display=y.zimDisplay}),50),m.resize(),m.on("added",w,null,!0)}this.resize=function(t,o){zot(t)&&(t=!0),m.time1&&clearTimeout(m.time1),o||(m.time1=setTimeout((function(){m.resize(null,!0)}),40));var n=m.getConcatenatedMatrix().decompose(),i=m.localToGlobal(0,0);if(r.retina){var a=e.browserZoom();r.tag?(v.x=i.x/b/a,v.y=i.y/b/a):(v.x=r.x/z.scaleX+i.x/b/a,v.y=r.y/z.scaleY+i.y/b/a),e.sca(v,n.scaleX/b/z.scaleX/a,n.scaleY/b/z.scaleY/a)}else v.x=r.x+i.x*r.scale,v.y=r.y+i.y*r.scale,e.sca(v,r.scale*n.scaleX,r.scale*n.scaleY);return v.alpha=m.alpha,m.parent&&(v.alpha*=m.parent.alpha),t&&m.stage&&z.update(),m},this.resize(),m.added(w),m.on("removed",(function(){m.time1&&clearTimeout(m.time1),m.time2&&clearTimeout(m.time2),z.removeChild(v),y&&(y.style.display="none")})),this.add=function(e){return y.innerHTML+=e,m},Object.defineProperty(this,"innerHTML",{get:function(){return y.innerHTML},set:function(e){y.innerHTML=e}}),Object.defineProperty(this,"style",{get:function(){return y.style},set:function(e){y.style=e}}),!1!==u&&e.styleTransforms(this,f),this.clone=function(){var d=new e.Tag(t,o,n,r,i,a,l,s,c,u,this.group,h);return m.cloneProps(d)},Object.defineProperty(this,"frame",{get:function(){return r},set:function(e){e!=r&&(r.off("update",m.updateEvent),r.off("resize",m.resizeEvent),r=e,m.resizeEvent=r.on("resize",m.resize),m.updateEvent=r.on("update",m.resize),m.resize())}}),this.resizeEvent=r.on("resize",m.resize),this.updateEvent=r.on("update",m.resize),this.dispose=function(e,t,o){var n;return m.stage&&(n=m.stage),r.off("update",m.updateEvent),r.off("resize",m.resizeEvent),y&&y.parentNode&&y.parentNode.removeChild(y),y=null,o||(this.zimContainer_dispose(!0),n&&n.update()),!0}},e.extend(e.Tag,e.Container,["clone","dispose"],"zimContainer",!1),e.addTo=function(t,o,n,r){var i,a="obj, container, index, localToLocal";if(i=zob(e.addTo,arguments,a))return i;if(z_d("47.5"),!zot(t)){if(zot(o)){if(!WW.zdf)return void zogy("zim methods - addTo(): please provide container");o=WW.zdf.stage}if(zot(r)&&(r=!0),t.parent||(r=!1),r)var l=t.parent.localToLocal(t.x,t.y,o);return zot(n)||isNaN(n)?o.addChild(t):o.addChildAt(t,n),r&&(t.x=l.x,t.y=l.y),t}zogy("zim methods - addTo(): please provide object")},e.removeFrom=function(e,t){if(z_d("47.6"),!zot(e))return e.removePhysics&&e.removePhysics(),zot(t)?e.parent&&e.parent.removeChild(e):t.removeChild(e),e;zogy("zim methods - removeFrom(): please provide object")},e.added=function(e,n,r,i){if(z_d("47.7"),!zot(e)&&!zot(n)&&"function"==typeof n){var a=t(r);if(zot(r)&&(r="s"==a?.1:100),!e.stage){var l,s=r*("s"==a?1e3:1);i&&(o(i),l=i*("s"==a?1e3:1));var c=Date.now(),u=0,d=setInterval((function(){u>5?clearInterval(d):(u++,e.stage&&(n(e.stage,e),clearInterval(d),clearInterval(h)))}),10),h=setInterval((function(){l>0&&c-Date.now()>l&&clearInterval(h),e.stage&&(n(e.stage,e),clearInterval(h))}),s);return h}n(e.stage,e)}},e.centerReg=function(t,o,n,r){var i,a="obj, container, index, add";if(i=zob(e.centerReg,arguments,a))return i;if("AC"==t.type&&WW.zdf)return WW.zdf.ac("centerReg",arguments),t.addTo(o,n);if(z_d("48"),zot(t)||!t.getBounds||!t.getBounds())return zogy("zim methods - centerReg(): please provide object with bounds set"),t;zot(r)&&(r=!0),zot(o)&&t.parent&&r&&(o=t.parent,zot(n)&&(n=t.parent.getChildIndex(t)),t.parent.removeChild(t)),zot(o)||o!=t.parent||(zot(n)&&(n=t.parent.getChildIndex(t)),t.parent.removeChild(t));var l=t.getBounds();return t.regX=l.x+l.width/2,t.regY=l.y+l.height/2,r?e.center(t,o,n):t},e.center=function(t,o,n,r){var i,a="obj, container, index, add";if(i=zob(e.center,arguments,a))return i;if("AC"==t.type&&WW.zdf)return WW.zdf.ac("center",arguments),t.addTo(o,n);if(e.centerCheck||(z_d("48.1"),e.centerCheck=!0),zot(t)||!t.getBounds)return zogy("zim.center(): please provide object with bounds"),t;if(zot(o)&&(t.parent?o=t.parent:WW.zdf&&(o=WW.zdf.stage)),zot(o)||!o.getBounds)return zogy("zim.center(): please provide container with bounds"),t;var l=t.getBounds(),s=o.getBounds();zot(r)&&(r=!0);var c=!1;if(zot(s)&&(o.setBounds(0,0),s=o.getBounds(),c=!0),r&&o.addChild&&(zot(n)||"number"==typeof n&&isNaN(n)?o.contains(t)||o.addChild(t):o.addChildAt(t,n)),zot(l))return t.x=s.x+s.width/2,t.y=s.y+s.height/2,t;var u=!1,d=!1;0==o.scaleX&&(u=!0,o.scaleX=1e-5),0==o.scaleY&&(d=!0,o.scaleY=1e-5);var h=t.localToLocal(t.regX,t.regY,o),g=e.boundsToGlobal(t),p=e.boundsToGlobal(o,g,!0);if(u&&(o.scaleX=0),d&&(o.scaleY=0),t.x=s.x+s.width/2-p.width/2+(h.x-p.x),t.y=s.y+s.height/2-p.height/2+(h.y-p.y),!r&&o.getStage&&o.stage&&t.parent){var f=o.localToLocal(t.x,t.y,t.parent);t.x=f.x,t.y=f.y}return c&&o.setBounds(null),t},e.place=function(t,o){if(z_d("49"),!zot(t)){zot(o)&&(o="obj"),e.lastPlace=t,e.drag({obj:t,currentTarget:!0,dragCursor:"crosshair"}),t.on("mousedown",(function(){e.lastPlace=t}));var n=WW.zdf;return n&&n.on("keydown",(function(o){if(t==e.lastPlace){var n=o.keyCode;if(n>=37&&n<=40){var i=o.shiftKey?10:1;t.mov(37==n?-1*i:39==n?1*i:0,38==n?-1*i:40==n?1*i:0),r(),t.stage&&t.stage.update()}}})),zogy("place "+o+" - to get new position"),t.on("click",r),t}function r(){zogy(o+".x = "+Math.round(t.x)+"; "+o+".y = "+Math.round(t.y)+";"),zogy(o+".loc("+Math.round(t.x)+", "+Math.round(t.y)+");")}},e.placeReg=function(t,o){if(z_d("49.5"),!zot(t)){var n=t.stage;if(zot(n))return zogy("zim.placeReg() - add object to stage before calling placeReg()"),t;zot(o)&&(o="obj");var r=t.parent.localToGlobal(t.x,t.y),i=new e.Shape(-25,-25,50,50,null,!1).addTo(n).pos({x:r.x,y:r.y,reg:!0});return i.graphics.s("white").mt(-25,0).lt(25,0).mt(0,-25).lt(0,20),i.compositeOperation="difference",i.expand(0),e.drag({obj:i}),zogy("place cursor to get new registration point location"),n.on("stagemouseup",(function(){var e=t.globalToLocal(i.x,i.y);zogy(o+".regX = "+Math.round(e.x)+"; "+o+".regY = "+Math.round(e.y)+";"),zogy(o+".reg("+Math.round(e.x)+", "+Math.round(e.y)+");")})),t}},e.pos=function(t,o,n,r,i,a,l,s,c,u,d){var h,g="obj, x, y, horizontal, vertical, container, index, add, reg, regX, regY";if(h=zob(e.pos,arguments,g))return h;if("AC"==t.type&&WW.zdf)return WW.zdf.ac("pos",arguments),t.addTo(a,l);z_d("41.5"),WW.DIR&&"rtl"==WW.DIR||!WW.DIR&&"rtl"==e.DIR?"start"==r?r="right":"end"==r&&(r="left"):"start"==r?r="left":"end"==r&&(r="right");var p=!1;"right"==r&&(p=!0);var f=!1;"bottom"==i&&(f=!0);var m=e.POSREG;if(null!=WW.POSREG&&(m=WW.POSREG),zot(c)&&(c=m),!zot(t)){zot(c)&&zot(u)&&(u=!1),zot(c)&&zot(d)&&(d=!1),!zot(c)&&zot(u)&&(u=c),!zot(c)&&zot(d)&&(d=c),zot(s)&&(s=!0),zot(a)||a.addChild||(a=null),t.getBounds||t.getBounds()||(u=d=!1),t.zimPos={x:o,y:n,h:r,v:i,i:l},zot(a)&&(t.parent?a=t.parent:WW.zdf&&(a=WW.zdf.stage)),!t.parent&&zot(o)&&(o=0),!t.parent&&zot(n)&&(n=0);var z=!1;t.getBounds()||(t.setBounds(0,0),z=!0);var y=!1;if(a&&!a.getBounds()&&(a.setBounds(0,0),y=!0),!zot(a)&&a.addChild&&s){var v=a.getBounds().clone();P();var b=a.getBounds();v.width==b.width&&v.height==b.height&&v.x==b.x&&v.y==b.y||(t.removeFrom(),a.setBounds(v.x,v.y,v.width,v.height),y=!0,P())}if(!u&&!d&&!("center"!=r&&"middle"!=r||"center"!=i&&"middle"!=i))return t.center(a),t.mov(o,n),z&&t.setBounds(null),y&&a.setBounds(null),t;if("center"==r||"middle"==r){if(u)t.x=a.width/2;else{var w=t.y;t.center(),t.y=w}t.mov(o),o=null,r=null}else!0===r&&(p=!0);if("center"==i||"middle"==i){if(d)t.y=a.height/2;else{var C=t.x;t.center(),t.x=C}t.mov(0,n),n=null,i=null}else!0===i&&(f=!0);if(t.parent&&t.parent.getBounds){if(a=t.parent,zot(o)&&1==p&&(o=0),zot(n)&&1==f&&(n=0),zot(o)||(t.x=o),zot(n)||(t.y=n),zot(o)&&zot(n)&&!p&&!f)return z&&t.setBounds(null),y&&a.setBounds(null),t;var x=0,k=0;if(t.getBounds()){var T=B();if(!zot(o))x=(p?new e.Point(T.x+T.width,T.y+T.height):new e.Point(T.x,T.y)).x-o;zot(n)||(k=(f?new e.Point(T.x+T.width,T.y+T.height):new e.Point(T.x,T.y)).y-n);var A=a.getBounds();zot(o)||(p?t.x=u?A.width+A.x-o:A.width+A.x-o-x:(t.x=u?o:o-x,t.x+=A.x)),zot(n)||(f?t.y=d?A.height+A.y-n:A.height+A.y-n-k:(t.y=d?n:n-k,t.y+=A.y))}}return z&&t.setBounds(null),y&&a.setBounds(null),t}function P(){zot(l)||"number"==typeof l&&isNaN(l)?a.contains(t)||a.addChild(t):a.addChildAt(t,l)}function B(){var e=t.getBounds(),o=e.x,n=e.y,r=e.width,i=e.height,a=t._props.matrix;a=t.getMatrix(a),(o||n)&&a.appendTransform(0,0,1,1,0,0,0,-o,-n);var l=r*a.a,s=r*a.b,c=i*a.c,u=i*a.d,d=a.tx,h=a.ty,g=d,p=d,f=h,m=h;return(o=l+d)<g?g=o:o>p&&(p=o),(o=l+c+d)<g?g=o:o>p&&(p=o),(o=c+d)<g?g=o:o>p&&(p=o),(n=s+h)<f?f=n:n>m&&(m=n),(n=s+u+h)<f?f=n:n>m&&(m=n),(n=u+h)<f?f=n:n>m&&(m=n),{x:g,y:f,width:p-g,height:m-f}}},e.loc=function(t,o,n,r,i,a,l,s){var c,u="obj, target, y, container, index, add, localToLocal, x";if(c=zob(e.loc,arguments,u))return c;if("AC"==t.type&&WW.zdf)return WW.zdf.ac("loc",arguments),t.addTo(r,i);if(z_d("41.55"),!zot(t)){if("number"==typeof o&&(s=o,o=null),zot(o)||(zot(o.x)||(s=o.x),zot(o.y)||(n=o.y)),zot(s)&&zot(o)&&(s=t.x),zot(n)&&zot(o)&&(n=t.y),zot(a)&&(a=!0),zot(r)&&(t.parent?r=t.parent:WW.zdf&&(r=WW.zdf.stage)),a&&r&&(t.parent&&r==t.parent?zot(i)||r.addChildAt(t,i):zot(i)||isNaN(i)?r.addChild(t):r.addChildAt(t,i)),zot(l)&&(l=!0),o&&o.parent&&t.parent&&l){var d=o.parent.localToLocal(s,n,t.parent);s=d.x,n=d.y}return t.x=s,t.y=n,t}},e.mov=function(t,o,n){var r,i="obj, x, y";return(r=zob(e.mov,arguments,i))?r:"AC"==t.type&&WW.zdf?(WW.zdf.ac("mov",arguments),t):(z_d("41.6"),zot(t)?void 0:(zot(o)||(t.x+=o),zot(n)||(t.y+=n),t))},e.sca=function(e,t,o){return"AC"==e.type&&WW.zdf?(WW.zdf.ac("sca",arguments),e):(z_d("41.97"),zot(e)||zot(e.scaleX)||(zot(t)&&(t=e.scaleX),zot(o)&&(o=t),e.scaleX=t,e.scaleY=o),e)},e.alp=function(e,t){if(z_d("41.7"),!zot(e))return zot(t)||(e.alpha=e.hovOriginal=t,e.tag&&e.tag.style&&("Loader"!=e.type&&(e.tag.style.opacity=t),e.tag.style.display=e.tag.zimDisplay=0==t?"none":"inline-block")),e},e.vis=function(e,t){if(z_d("41.71"),!zot(e))return e.visible=t,e.tag&&e.tag.style&&(e.tag.style.display=e.tag.zimDisplay=t?"inline-block":"none"),e},e.ble=function(e,t){if(z_d("41.72"),!zot(e))return zot(t)&&(t="difference"),e.compositeOperation=t,"Blob"!=e.type&&"Squiggle"!=e.type||e.update(),e},e.dye=function(e,t){if(z_d("41.73"),!zot(e))return e.hasOwnProperty("backgroundColor")?e.backgroundColor=t:e.hasOwnProperty("color")&&(e.color=t),e},e.hov=function(e,t,o){if(z_d("41.75"),!zot(e))return zot(t)&&(t=1),zot(o)&&(o="number"==typeof t?"alpha":"color"),e.hovMouseover&&(e.off("mouseover",e.hovMouseover),e.off("mouseout",e.hovMouseout)),-1==t?(e.cur("default"),zot(e.hovOld)||(e[e.hovType]=e.hovOld),e.hovOld=null,e.stage&&e.stage.update(),e):(e.cur(),e.hovOld=e[o],e.hovNew=t,e.hovType=o,e.hovMouseover=e.on("mouseover",(function(){e[o]=e.hovNew,e.stage&&e.stage.update()})),e.hovMouseout=e.on("mouseout",(function(){e[o]=e.hovOld,e.stage&&e.stage.update()})),e)},e.rot=function(t,o,n,r){if(z_d("41.8"),!zot(t)){if("AC"==t.type&&WW.zdf)return WW.zdf.ac("rot",arguments),t;if(!zot(o))if(!t.parent||zot(n)&&zot(r))t.rotation=o;else{zot(n)&&(n=t.x),zot(r)&&(r=t.y);var i=t.parent.localToLocal(n,r,t),a=new e.Point(t.x,t.y);t.reg(i.x,i.y),t.rotation=o,t.x=n,t.y=r;var l=t.parent.localToLocal(a.x,a.y,t);t.reg(l.x,l.y),t.x=a.x,t.y=a.y}return t}},e.siz=function(e,t,o,n){if(z_d("41.85"),!zot(e))return"AC"==e.type&&WW.zdf?(WW.zdf.ac("siz",arguments),e):(zot(n)&&(n=!1),zot(t)||zot(o)?zot(t)?zot(o)||(n?e.heightOnly=o:e.height=o):n?e.widthOnly=t:e.width=t:(e.widthOnly=t,e.heightOnly=o),e)},e.ske=function(e,t,o){if(z_d("41.9"),!zot(e))return"AC"==e.type&&WW.zdf?(WW.zdf.ac("ske",arguments),e):(zot(t)||(e.skewX=t),zot(o)||(e.skewY=o),e)},e.reg=function(t,o,n,r){if(z_d("41.95"),!zot(t)){if("AC"==t.type&&WW.zdf)return WW.zdf.ac("reg",arguments),t;var i,a=t.regX,l=t.regY,s=o,c=WW.DIR||e.DIR||"ltr";if("default"==o&&(o=null),"string"==typeof o&&((i=t.getBounds())?("start"==o&&(o="ltr"==c?"left":"right"),"end"==o&&(o="ltr"==c?"right":"left"),"left"==o?o=i.x:"right"==o?o=i.x+i.width:"center"!=o&&"middle"!=o||(o=i.x+i.width/2)):o=null),"string"==typeof n?(i||(i=t.getBounds()),i?"top"==n?n=i.y:"bottom"==n?n=i.y+i.height:"center"!=n&&"middle"!=n||(n=i.y+i.height/2):n=null):!zot(n)||"center"!=s&&"middle"!=s||(i||(i=t.getBounds()),n=i?i.y+i.height/2:null),"default"==n&&(n=null),zot(o)||(t.regX=o),zot(n)||(t.regY=n),r&&t.parent){var u=t.localToLocal(a,l,t.parent);t.x-=u.x-t.x,t.y-=u.y-t.y}return t}},e.top=function(e){return z_d("41.62"),zot(e)||!e.parent||e.parent.setChildIndex(e,e.parent.numChildren-1),e},e.bot=function(e){return z_d("41.63"),zot(e)||!e.parent||e.parent.setChildIndex(e,0),e},e.ord=function(e,t){if(z_d("41.64"),!zot(e)&&e.parent)return zot(t)&&(t=0),e.parent.setChildIndex(e,e.parent.getChildIndex(e)+t),e},e.cur=function(e,t){return z_d("41.1"),zot(e)?(zogy("zim methods - cur(): please provide object"),e):(zot(t)&&(t="pointer"),e.cursor=t,e)},e.sha=function(e,t,o,n,r){return z_d("41.2"),zot(e)?(zogy("zim methods - sha(): please provide object"),e):(zot(t)&&(t="rgba(0,0,0,.3)"),t.blur?(e.shadow=t,e):(zot(o)&&(o=e.width?.08*e.width:5),zot(n)&&(n=e.height?.08*e.height:5),zot(r)&&(r=e.width?.16*e.width:10),e.shadow=new createjs.Shadow(t,o,n,r),e))},e.dep=function(e,t){if(z_d("41.65"),!zot(e))return zot(t)&&(t=0),e.depth=t,e},e.nam=function(t,o){if(z_d("41.67"),!zot(t)&&!zot(o))return t.name=o,e.zimObjectIDs[o]=t,t},e.movement=function(t,o,n){z_d("47.75");var r=t.stage||WW.zdf.stage;function i(){r=t.stage,t.zimMovementStage=r,t.zimMovementEvent&&r.off("stagemousemove",t.zimMovementEvent),t.zimMovementEvent=r.on("stagemousemove",(function(e){o(e)})),t.on("mouseout",(function(){t.zimMovementEvent&&r.off("stagemousemove",t.zimMovementEvent)}),null,!0)}return e.mobile()?(t.zimMovementEvent&&r.off("pressmove",t.zimMovementEvent),t.zimMovementEvent=t.on("pressmove",(function(e){o(e)}))):(t.zimMouseoverEvent&&t.off("mouseover",t.zimMouseoverEvent),t.zimMouseoverEvent=t.on("mouseover",i),n&&i()),t},e.noMovement=function(e){if(z_d("47.9"),!zot(e))return e.zimMouseoverEvent&&e.off("mouseover",e.zimMouseoverEvent),e.zimMovementEvent&&e.zimMovementStage&&e.zimMovementStage.off("stagemousemove",e.zimMovementEvent),e},e.tap=function(o,n,r,i,a,l,s,c,u,d){var h,g="obj, call, distance, time, once, dbl, dblTime, call2, call3, call4";if(h=zob(e.tap,arguments,g))return h;if(z_d("47.8"),!zot(o)&&!zot(n)&&"function"==typeof n){zot(r)&&(r=l?10:5);var p=t(i);zot(i)&&(i="s"==p?8:8e3),zot(a)&&(a=!1),zot(l)&&(l=!1),zot(s)&&(s=d?"s"==p?.5:500:"s"==p?1:1e3),o.cursor="pointer";var f,m=!1,z=!1;return l?o.zimDblClickDownEvent=o.on("mousedown",(function(t){if(f=!1,m)m=!1;else{if(m=!0,"List"==t.currentTarget.type){if("WindowBacking"==t.target.type)return;if(t.currentTarget.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY).y<=0)return}var a,l,h=t.stageX/e.scaX,g=t.stageY/e.scaY,y=Date.now();z=!0,o.zimDoubleTimeout&&clearTimeout(o.zimDoubleTimeout),o.zimDoubleTimeout=setTimeout((function(){if(z=!1,m=!1,o.zimDblClickUpEvent&&o.off("pressup",o.zimDblClickUpEvent),f&&d)if(Math.abs(h+g-a/e.scaX-l/e.scaY)<r){if(o.excludeTap)return;d(t)}else c&&c(t)}),"s"==p?1e3*s:s),o.zimDblClickUpEvent=o.on("pressup",(function(t){if(a=t.stageX,l=t.stageY,f=!0,m)u&&u(t);else if(z){if(Math.abs(h+g-t.stageX/e.scaX-t.stageY/e.scaY)<r&&Date.now()-y<("s"==p?1e3*i:i)){if(o.excludeTap)return;clearTimeout(o.zimDoubleTimeout),n(t)}else c&&c(t);t.remove()}}))}}),null,a):o.zimClickDownEvent=o.on("mousedown",(function(t){if("List"==t.currentTarget.type){if("WindowBacking"==t.target.type)return;if(t.currentTarget.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY).y<=0)return}var a=t.stageX/e.scaX,l=t.stageY/e.scaY,s=Date.now();o.zimClickUpEvent=o.on("pressup",(function(t){if(Math.abs(a+l-t.stageX/e.scaX-t.stageY/e.scaY)<r&&Date.now()-s<("s"==p?1e3*i:i)){if(o.excludeTap)return;n(t)}else c&&c(t);t.remove()}))}),null,a),o}},e.noTap=function(e){if(z_d("47.9"),!zot(e))return e.cursor&&(e.cursor="default"),e.zimClickDownEvent&&e.off("mousedown",e.zimClickDownEvent),e.zimClickUpEvent&&e.off("pressup",e.zimClickUpEvent),e.zimDoubleTimeout&&clearInterval(e.zimDoubleTimeout),e},e.hold=function(o,n,r,i,a){if(z_d("47.87"),!zot(o)&&!zot(n)&&"function"==typeof n){zot(r)&&(r=5);var l,s=t(i);return zot(i)&&(i="s"==s?1.5:1500),zot(a)&&(a=!1),o.cursor="pointer",o.zimClickHoldDownEvent=o.on("mousedown",(function(t){if(zot((l=t.target.stage).frame)&&(l.frame=WW.zdf),!zot(l.frame)&&l.frame.mousemoveEvent||(zot(l.frame)&&(l.frame={}),l.frame.mouseX=t.stageX/e.scaX,l.frame.mouseY=t.stageY/e.scaY,l.frame.mouseholdEvent&&l.off("stagemousemove",l.frame.mouseholdEvent),l.frame.mouseholdEvent=l.on("stagemousemove",(function(t){l.frame.mouseX=t.stageX/e.scaX,l.frame.mouseY=t.stageY/e.scaY}))),"List"==t.currentTarget.type){if("WindowBacking"==t.target.type)return;if(t.currentTarget.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY).y<=0)return}var a=t.stageX/e.scaX,c=t.stageY/e.scaY;clearInterval(o.zimHoldInterval);var u=0;o.zimHoldInterval=setInterval((function(){if(u<10)Math.abs(a+c-l.frame.mouseX-l.frame.mouseY)>r&&clearInterval(o.zimHoldInterval);else{if(Math.abs(a+c-l.frame.mouseX-l.frame.mouseY)<r){if(o.excludeHold)return;n(t)}clearInterval(o.zimHoldInterval)}u++}),i/10*("s"==s?1e3:1)),o.zimClickHoldUpEvent=o.on("pressup",(function(){clearInterval(o.zimHoldInterval),l&&l.frame.mouseholdEvent&&l.off("stagemousemove",l.frame.mouseholdEvent)}),null,!0)}),null,a),o}},e.noHold=function(e){if(z_d("47.88"),!zot(e))return e.cursor&&(e.cursor="default"),e.off("mousedown",e.zimClickHoldDownEvent),e.off("pressup",e.zimClickHoldUpEvent),e.stage&&e.stage.frame.mouseEvent&&e.stage.off("stagemousemove",e.stage.frame.mouseEvent),clearInterval(e.zimHoldTimeout),e},e.change=function(e,t,o){if(z_d("47.85"),!zot(e)&&!zot(t)&&"function"==typeof t)return zot(o)&&(o=!1),e.zimChangeEvent=e.on("change",(function(e){t(e)}),null,o),e},e.noChange=function(e){if(z_d("47.95"),!zot(e))return e.off("mousedown",e.zimChangeEvent),e},e.drag=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b){var w,C="obj, boundary, overCursor, dragCursor, all, swipe, localBounds, onTop, surround, slide, slideDamp, slideSnap, reg, removeTweens, startBounds, rect, currentTarget, offStage, immediateBoundary, singleTouch";if(w=zob(e.drag,arguments,C))return w;if(z_d("31"),!zot(t)&&t.on){var x=e.DRAGALL;if(null!=WW.DRAGALL&&(x=WW.DRAGALL),zot(i)&&zot(z)&&(i=x),zot(i)&&zot(z)?z=!1:zot(i)?zot(z)&&(z=!1):z=i,"Tag"!=t.type&&"TextArea"!=t.type&&"Loader"!=t.type||(z=!0),o&&o.getBounds&&("Container"==t.type||"Tile"==t.type)&&1==t.mouseChildren&&!i){var k=Array.prototype.slice.call(arguments);return k[4]=!0,setTimeout((function(){t.loop((function(t){k[0]=t,e.drag.apply(null,k)}))}),v?0:50),t}t.zimDown&&t.noDrag(),t.cursor=zot(n)?"pointer":n,zot(a)&&(a=!1),zot(l)&&(l=!1),zot(s)&&(s=!0),zot(c)&&(c=!1),zot(u)&&(u=!1),zot(d)&&(d=.3),zot(h)&&(h=!0);var T=["horizontal","vertical","auto"];if(!0!==h&&T.indexOf(h)<0&&(h=!1),zot(g)&&(g=!1),zot(p)&&(p=!0),zot(f)&&(f=!0),zot(o)&&!zot(m)&&(o=m),zot(b)&&(b=!1),t.dragPaused=!1,u)var A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X;else t.zimDragTicker=function(){};t._draggable=!0,e.setSwipe(t,a),t.zimBoundary=o,t.zimLocalBounds=l,t.downCheck=!1;var R,H,F,N,V,G,q,U=!1;t.zimAdded=t.on("added",Z,null,!0),t.zimRemoved=t.on("removed",K,null,!0),t.parent&&Z(),t.pointers={};var Q=!1;return t.zimDown=t.on("mousedown",(function(o){if(t.stage&&!t.dragPaused&&(!b||!Q)){Q=!0,q=t.stage,t.zmu||(t.zmu=q.frame.on("mouseupplus",(function(e){t.downCheck&&(u||(t.downCheck=!1),$(e,!0))}))),t.dragMouseX=Math.round(o.stageX/e.scaX)+q.x,t.dragMouseY=Math.round(o.stageY/e.scaY)+q.y;var n="id"+Math.abs(o.pointerID+1);if(t.pointers[n]=!0,G=z?o.currentTarget:o.target,!t.zimBoundary||G.getBounds()){if(t.downCheck=!0,t.stage.mouseMoveOutside=!0,e.Ticker.has(t.zimDragTicker)||e.Ticker.add(t.zimDragTicker,t.stage),p&&t.zimTweens)for(var i in t.zimTweens){var a=t.zimTweens[i];!a.zimObj||null==a.zimObj.x&&null==a.zimObj.y||t.stopAnimate(i)}if(G.parent){if(s){var d=G.parent.numChildren-1;"Keyboard"==G.parent.getChildAt(d).type&&d--,G.parent.setChildIndex(G,d),G.ZIMoutlineShape&&G.outline()}V=G.parent==t.stage?new e.Point(o.stageX/e.scaX,o.stageY/e.scaY):G.parent.globalToLocal(o.stageX/e.scaX,o.stageY/e.scaY),g&&(G.x=V.x,G.y=V.y),R=V.x-G.x,H=V.y-G.y,t.zimBoundary&&(l?(F=e.boundsToGlobal(G.parent,t.zimBoundary),c&&(N=t.zimBoundary)):(F=t.zimBoundary,c&&(N=e.boundsToGlobal(G.parent,t.zimBoundary,!0)))),t.cursor=zot(r)?"pointer":r,u&&(t.slideStartX=t.x,t.slideStartY=t.y,X=t.zimDragMoving,E=0,I=[V.x],S=[V.y],_=-1e4,Y=-1e4,t.zimDragMoving=!0),"Pen"==t.type&&(t.zimDragCheck=!0,U=!1)}}else zogy("zim.drag() - drag object needs bounds set")}}),!0),t.zimMove=t.on("pressmove",(function(o){if((!b||t.pointers["id"+Math.abs(o.pointerID+1)])&&t.downCheck&&!t.dragPaused){var n=(y?o.rawX:o.stageX)/e.scaX+q.x,r=(y?o.rawY:o.stageY)/e.scaY+q.y;t.dragMouseX=Math.round(n),t.dragMouseY=Math.round(r),J(G,n,r),G.ZIMoutlineShape&&G.outline(),"Pen"==t.type&&!U&&t.drawing?U=!0:"Tag"!=t.type&&"TextArea"!=t.type&&"Loader"!=t.type||t.resize()}}),!0),t.zimPosition=J,t.zimUp=t.on("pressup",(function(e){$(e)}),!0),t}function Z(){if(t.off("added",t.zimAdded),(o=t.zimBoundary)&&o.getBounds&&"Blob"!=o.type){if(t.zimLocalBounds=!1,o="Stage"!=o.type&&"StageGL"!=o.type?o.boundsToGlobal():new e.Boundary(0,0,o.width,o.height),!c){var n=t.boundsToGlobal();V=t.localToGlobal(t.regX,t.regY);var r=new e.Point(V.x-n.x,V.y-n.y),i=t.borderWidth?t.borderWidth:0;o.x+=r.x+i/2,o.y+=r.y+i/2,o.width-=n.width+i,o.height-=n.height+i}t.zimBoundary=o}R=0,H=0,t.zimBoundary&&"Blob"!=t.zimBoundary.type&&(l?(F=e.boundsToGlobal(t.parent,t.zimBoundary),c&&(N=t.zimBoundary)):(F=t.zimBoundary,c&&(N=e.boundsToGlobal(t.parent,t.zimBoundary,!0)))),F&&f&&(V=t.parent.localToGlobal(t.x,t.y),J(t,V.x,V.y)),u&&setTimeout((function(){A=new e.Damp(t.x,d),P=new e.Damp(t.y,d),t.zimDragImmediate=function(e,t){O=e,j=t,W=L=M=D=0,zot(e)||A.immediate(e),zot(t)||P.immediate(t)},B=3,E=0,I=[],S=[],W=t.x,M=t.y,O=t.x,j=t.y,L=t.x,D=t.y,_=-1e4,Y=-1e4,t.zimDragMoving=!0,oe()}),50),zot(t.zimMaskDynamic)||t.zimMaskApply()}function K(){t.zimDragTicker&&e.Ticker.remove(t.zimDragTicker)}function J(o,n,r){if(zot(o)&&(o=G||t),o.parent){if(zot(n)||zot(r)){var i=o.parent.localToGlobal(o.x,o.y);R=H=0,t.zimBoundary&&(l?(F=e.boundsToGlobal(o.parent,t.zimBoundary),c&&(N=o.zimBoundary)):(F=t.zimBoundary,c&&(N=e.boundsToGlobal(o.parent,t.zimBoundary,!0)))),n=i.x,r=i.y,u&&(O=o.x,j=o.y,G=o,A&&A.immediate(O),P&&P.immediate(j))}var a,s;a=q&&q.type?o.parent.globalToLocal(n,r):o.parent.globalToLocal(n*e.scaX,r*e.scaY),u&&h?"vertical"==h?(s=ee(o,a.x-R,a.y-H),o.x=s.x,o.y=a.y-H):"horizontal"==h?(s=ee(o,a.x-R,a.y-H),o.x=a.x-R,o.y=s.y):(o.x=a.x-R,o.y=a.y-H):(s=ee(o,a.x-R,a.y-H),o.x=s.x,o.y=s.y),!u||X||o.slideStartX==o.x&&o.slideStartY==o.y||(X=!0)}}function $(o,r){if(!b||t.pointers["id"+Math.abs(o.pointerID+1)]){Q=!1;var i="id"+Math.abs(o.pointerID+1);if(delete t.pointers[i],t.downCheck&&!t.dragPaused){if(t.cursor=zot(n)?"pointer":n,u){if(G.dispatchEvent("slidestart"),G.parent){var a=y?o.rawX:o.stageX,l=y?o.rawY:o.stageY;V=G.parent.globalToLocal(a/e.scaX,l/e.scaY)}else V=new e.Point(0,0);t.downCheck=!1,W=V.x,M=V.y,O=G.x,j=G.y,r&&(L=W=0,D=M=0),A.immediate(G.x),P.immediate(G.y)}else{t.downCheck=!1;var s=0;for(var c in t.pointers)s++;0==s&&e.Ticker.remove(t.zimDragTicker),"Pen"==t.type&&(t.zimDragCheck=!1,U&&t.drawing&&t.stopCheck())}t.stage&&t.stage.update()}}}function ee(e,o,n){if(!e.parent)return{x:o,y:n};if(F)if(c){var r=e.getBounds().width,i=e.getBounds().height,a=e.getBounds().x,l=e.getBounds().y;r<N.width?o=N.x+(N.width-r)/2+(e.regX-a):(o-(e.regX-a)>N.x&&(o=N.x+(e.regX-a)),o-(e.regX-a)+r<N.x+N.width&&(o=N.x+N.width+(e.regX-a)-r)),e.height<N.height?n=N.y+(N.height-i)/2+(e.regY-l):(n-(e.regY-l)>N.y&&(n=N.y+(e.regY-l)),n-(e.regY-l)+i<N.y+N.height&&(n=N.y+N.height+(e.regY-l)-i))}else{if("Blob"==F.type)return F.shape.hitTestPoint(o,n)?{x:o,y:n}:{x:t.x,y:t.y};V=e.parent.localToGlobal(o,n),o=Math.max(F.x,Math.min(F.x+F.width,V.x)),n=Math.max(F.y,Math.min(F.y+F.height,V.y)),o=(V=e.parent.globalToLocal(o,n)).x,n=V.y}return{x:o,y:n}}function te(o,n,r,i,a){Math.abs(o.x-_)<.1&&Math.abs(o.y-Y)<.1?(t.zimDragMoving=!1,o.x=i,o.y=a,o.slideStartX=null,o.slideStartY=null,X&&(o.dispatchEvent("slidestop"),e.Ticker.remove(t.zimDragTicker)),"Pen"==t.type&&(t.zimDragCheck=!1,U&&t.drawing&&t.stopCheck())):(_=n,Y=r)}function oe(){t.zimDragTicker=function(){if(!zot(t.slideStartX))if(G||(G=t),t.downCheck){var o;o=G.parent?G.parent.globalToLocal(t.dragMouseX,t.dragMouseY):new e.Point(0,0),E++,I.push(o.x),S.push(o.y),E>=B?(L=I.shift(),D=S.shift()):(L=I[0],D=S[0])}else{if(!t.zimDragMoving)return;var n,r=O+W-L,i=j+M-D;F&&(r=(n=ee(G,r,i)).x,i=n.y),h?(G.x=A.convert(r),G.y=P.convert(i),te(G,G.x,G.y,r,i)):(n=ee(G,A.convert(r),P.convert(i)),G.x=n.x,G.y=n.y,te(G,G.x,G.y,G.x,G.y))}}}},e.noDrag=function(t,o){if(z_d("32"),!zot(t)&&t.on){if(zot(o)&&(o=!0),o&&t.numChildren&&t.numChildren>1)for(var n=0;n<t.numChildren;n++){r(t.getChildAt(n))}return r(t),t}function r(t){t.cursor=null,t._draggable=!1,e.setSwipe(t,!0),t.off("added",t.zimAdded),t.off("removed",t.zimRemoved),t.off("mousedown",t.zimDown),t.off("pressmove",t.zimMove),t.off("pressup",t.zimUp),t.zmu&&(t.stage?t.stage.frame.off("mouseupplus",t.zmu):WW.zdf.off("mouseupplus",t.zmu)),e.Ticker&&(t.zimDragSlide&&e.Ticker.remove(t.zimDragSlide),t.zimDragTicker&&e.Ticker.remove(t.zimDragTicker)),t.zimDragMoving=t.zimAdded=t.zimRemoved=t.zimDown=t.zimMove=t.zimUp=t.zimBoundary=t.zimDragSlide=null,t.slideStartX=t.slideStartY=t.zimDragImmediate=null,t.dragMouseX=t.zimPosition=t.dragMouseY=t.zimDown=t.zimUp=null,t.zimDragTicker=t.zimDragSlide=null}},e.dragBoundary=function(e,t){if(z_d("33"),!zot(e)&&e.on&&!zot(t))return e.zimBoundary=t,e.zimDragMoving=!0,e.zimPosition&&e.zimPosition(),e},e.dragRect=e.dragBoundary,e.mouse=function(e){return z_d("33.1"),e.zimLastMouse&&(e.mouseChildren=e.zimLastMouse),e.mouseEnabled=!0,e},e.noMouse=function(e){return z_d("33.15"),e.zimLastMouse=e.mouseChildren,e.mouseChildren=!1,e.mouseEnabled=!1,e},e.wire=function(t,o,n,r,i,a,l,s){var c,u="source, target, prop, twoWay, setSource, filter, call, input";if(c=zob(e.wire,arguments,u))return c;if(z_d("33.2"),zot(e.Ticker)&&zon)return zogy("wire() - requires ZIM Frame"),t;if(zot(o)&&zon)return zogy("wire() - requires a target"),t;var d=e.DEFAULTWIRE;return null!=WW.DEFAULTWIRE&&(d=WW.DEFAULTWIRE),zot(s)&&(s=d&&"currentValue"!=d&&"selectedIndex"!=d||d&&Object.prototype.hasOwnProperty.call(t,d)?d:Object.prototype.hasOwnProperty.call(t,"currentValue")?"currentValue":Object.prototype.hasOwnProperty.call(t,"selectedIndex")?"selectedIndex":n),zot(n)&&(n=s),t.addChild&&(t.zimWire=!0),o.addChild&&(o.zimWired=!0),e.Ticker.addWire(t,[o,n,r,i,a,l,s]),t},e.noWire=function(t,o,n,r){var i,a="source, target, prop, input";return(i=zob(e.noWire,arguments,a))?i:(z_d("33.25"),zot(e.Ticker)&&zon?(zogy("noWire() - requires ZIM Frame"),t):(e.Ticker.removeWire(t,o,n,r),t))},e.wired=function(t,o,n,r,i,a,l,s){var c,u="target, source, prop, twoWay, setSource, filter, call, input";return(c=zob(e.wired,arguments,u))?c:(z_d("33.3"),zot(e.Ticker)&&zon?(zogy("wired() - requires ZIM Frame"),t):(e.wire(o,t,n,r,i,a,l,s),t))},e.noWired=function(t,o,n,r){var i,a="target, source, prop, input";return(i=zob(e.noWire,arguments,a))?i:(z_d("33.35"),zot(e.Ticker)&&zon?(zogy("noWired() - requires ZIM Frame"),t):(e.Ticker.removeWire(o,t,n,r),t))},void 0===i);if(e.bind=function(t,o,n,r,a,l){var s,c="obj, id, props, extra, filter, bindObj";if(s=zob(e.bind,arguments,c))return s;if(z_d("33.17"),!i)return zon&&zogy("bind() - needs a Bind() object created first"),t;if(zot(o))return zon&&zogy("bind() - needs a unique id"),t;var u=l||i;return u.add(o,t,n,r,a),t},e.noBind=function(t,o,n,r,a){var l,s="obj, props, removeConnectionData, call, bindObj";if(l=zob(e.noBind,arguments,s))return l;if(z_d("33.18"),!i)return t;var c=a||i;return c.remove(t,o,n,r),t},e.transform=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E){var I,S="obj, move, stretchX, stretchY, scale, rotate, allowToggle, visible, onTop, showStretch, showRotate, showScale, showReg, showBorder, borderColor, borderWidth, dashed, customCursors, handleSize, regSize, snapDistance, snapRotation, cache, events, ghostColor, ghostWidth, ghostDashed, ghostHidden, frame";if(I=zob(e.transform,arguments,S))return I;if("AC"==t.type&&WW.zdf)return WW.zdf.ac("transform",arguments),t;if(z_d("33.5"),zot(t)||!t.getBounds)return zogy("zim methods - transform(): please provide object with bounds set"),t;if(!t.getBounds())return zogy("zim methods - transform(): please setBounds() on object"),t;if(!t.parent)return zogy("zim methods - transform(): object should be on stage first"),t;zot(o)&&(o=!0),zot(n)&&(n=!0),zot(r)&&(r=!0),0==t.width&&(n=!1),0==t.height&&(r=!1),zot(i)&&(i=!0),zot(a)&&(a=!0);var W=e.mobile();zot(l)&&(l=!0),zot(s)&&(s=!0),zot(c)&&(c=!0),zot(u)&&(u=!!W),zot(d)&&(d=!!W),zot(h)&&(h=!0),zot(g)&&(g=!0),zot(p)&&(p=!0),zot(f)&&(f="brown"),zot(m)&&(m=1),zot(T)&&(T=null),zot(A)&&(A=null),T<0||A<0?T=A=null:null!=T&&null==A&&(A=1),zot(P)&&(P=!0),zot(B)&&(B=!1),zot(E)&&(E=WW.zdf),zot(y)&&(y=!W),zot(v)&&(v=W?20:10),zot(b)&&(b=16),zot(w)&&(w=10),zot(C)&&(C=5),zot(x)&&(x=!0),zot(k)&&(k=!1),"Tag"!=t.type&&"TextArea"!=t.type&&"Loader"!=t.type||(k=!0),t.mouseChildren=!1;var M=t.getConcatenatedMatrix().decompose(),O=t.stage?t.stage:E.stage;zot(E.eventRemove)&&(O.enableMouseOver(),E.ctrlKey=!1,E.shiftKey=!1,WW.addEventListener("keydown",(function(e){E.altKey=e.altKey,E.ctrlKey=e.ctrlKey})),WW.addEventListener("keyup",(function(e){E.altKey=e.altKey,E.ctrlKey=e.ctrlKey})));var j=t.getBounds(),L=new e.Shape({style:!1}),D=new e.Shape({style:!1}),_=new e.Shape({style:!1});D.mouseEnabled=!1,_.controlType="reg";var Y,X,R,H,F,N,V,G,q,U=t.parent,Q=L.graphics,Z=D.graphics,K=_.graphics,J=new e.Container({style:!1});J.type="TransformControls";var $,ee,te,oe,ne,re=new e.Container({style:!1}),ie=new e.Container({style:!1}),ae=new e.Container({style:!1}),le=new e.Container({style:!1});function se(t,o){t==o&&new e.Triangle(16,12,12,"white",null,null,0).addTo(t).mov(0,-13.5),new e.Triangle(16,12,12,"white",null,null,0).addTo(t).mov(13.5).rot(90),t==o&&new e.Triangle(16,12,12,"white",null,null,0).addTo(t).mov(0,13.5).rot(180),new e.Triangle(16,12,12,"white",null,null,0).addTo(t).mov(-13.5).rot(-90),t==o&&new e.Triangle(10,7,7,"black",null,null,0).addTo(t).mov(0,-13),new e.Triangle(10,7,7,"black",null,null,0).addTo(t).mov(13).rot(90),t==o&&new e.Triangle(10,7,7,"black",null,null,0).addTo(t).mov(0,13).rot(180),new e.Triangle(10,7,7,"black",null,null,0).addTo(t).mov(-13).rot(-90),x&&t.cache(-20,-20,40,40)}if(zot(t.zimMaskDynamic)||t.zimMaskApply(),y){var ce=new e.Container({style:!1}),ue=new e.Container({style:!1});se(ce,ce),se(ue,ce);var de={"nw-resize":45,"ne-resize":-45,"n-resize":90,"e-resize":0}}function he(){var e=t;for($=0,ee=1,te=1,oe=0,ne=0;e.parent;)$+=e.rotation,ee*=e.scaleX,te*=e.scaleY,oe+=e.skewX,ne+=e.skewY,e=e.parent}he();var ge,pe,fe=$,me=["nw-resize","ne-resize","nw-resize","ne-resize"],ze=[2,3,0,1];for(pe=0;pe<4;pe++)h?((ge=new e.Rectangle(v,v,"#e472c4","#333",2,null,null,null,null,!1)).centerReg(re),x&&ge.cache(-1,-1,v+2,v+2)):((ge=new e.Rectangle(v,v,"rgba(0,0,0,0)","rgba(0,0,0,0)",2,null,null,null,null,!1)).centerReg(re),ge.expand(0)),ge.rotation=$,V=y?"none":me[pe],ge.drag({overCursor:V,dragCursor:V,onTop:!1}),ge.controlType="corner",ge.cu=me[pe];for(pe=0;pe<ze.length;pe++)re.getChildAt(pe).op=re.getChildAt(ze[pe]);var ye=["n-resize","e-resize","n-resize","e-resize"];for(ze=[1,1,0,0],pe=0;pe<4;pe++){var ve=pe%2==0?t.width/2:v,be=pe%2==0?v:t.height/2;u?((ge=new e.Rectangle(v,v,"#AAA","#333",2,null,null,null,null,!1)).centerReg(pe%2==0?ae:ie),x&&ge.cache(-1,-1,v+2,v+2)):((ge=new e.Rectangle(ve,be,"rgba(0,0,0,0)",null,null,null,null,null,null,!1)).centerReg(pe%2==0?ae:ie),ge.expand(0)),ge.rotation=$,V=y?"none":ye[pe],ge.drag({overCursor:V,dragCursor:V,onTop:!1}),ge.controlType="side",ge.cu=ye[pe]}for(pe=0;pe<ze.length;pe++){var we=pe%2==0?ae:ie;we.getChildAt(Math.floor(pe/2)).op=we.getChildAt(ze[pe])}var Ce=["ne-resize","nw-resize","ne-resize","nw-resize"];for(pe=0;pe<4;pe++)d?((ge=new e.Circle(v,"#e472c4",null,null,null,null,null,null,!1)).addTo(le),x&&ge.cache(-v,-v,2*v,2*v)):((ge=new e.Circle(v,"rgba(0,0,0,0)",null,null,null,null,null,null,!1)).addTo(le),ge.expand(0)),V=y?"none":Ce[pe],ge.drag({overCursor:V,dragCursor:V,onTop:!1}),ge.controlType="rotate",ge.cu=Ce[pe];var xe=1.8;function ke(){var t=v*xe*e.sign(ee),o=v*xe*e.sign(te);le.getChildAt(0).reg(t,o),le.getChildAt(1).reg(-t,o),le.getChildAt(2).reg(-t,-o),le.getChildAt(3).reg(t,-o),O.update()}function Te(){Q.c(),Z.c(),K.c(),Y=t.localToGlobal(j.x,j.y),X=t.localToGlobal(j.x+j.width,j.y),R=t.localToGlobal(j.x+j.width,j.y+j.height),H=t.localToGlobal(j.x,j.y+j.height);var o=t.localToGlobal(j.x+j.width/2,j.y),n=t.localToGlobal(j.x+j.width,j.y+j.height/2),r=t.localToGlobal(j.x+j.width/2,j.y+j.height),i=t.localToGlobal(j.x,j.y+j.height/2);F=t.localToGlobal(t.regX,t.regY),N=t.localToGlobal(j.x+j.width/2,j.y+j.height/2),q=[Y,X,R,H],G=[o,n,r,i],p&&(Q.s(f),z&&Q.sd([10,5],0),Q.ss(m).mt(Y.x,Y.y).lt(X.x,X.y).lt(R.x,R.y).lt(H.x,H.y).lt(Y.x,Y.y).cp()),zot(T)||(Z.s(T),P&&Z.sd([10,5],0),Z.ss(A).mt(Y.x,Y.y).lt(X.x,X.y).lt(R.x,R.y).lt(H.x,H.y).lt(Y.x,Y.y).cp()),L.setBounds(Y.x,Y.y,X.x-Y.x,H.y-Y.y),g&&(K.s("#eee").ss(m).f("rgba(0,0,0,.1)").dc(0,0,b),K.s("#222").ss(m).dc(0,0,.3*b)),he();for(var a=Math.min(50,Math.abs(oe))*e.sign(oe),l=Math.min(50,Math.abs(ne))*e.sign(ne),s=$*e.sign(ee*te)*e.sign(t.scaleX*t.scaleY),c=0;c<q.length;c++){var d=q[c];re.getChildAt(c).loc(d.x,d.y).ske(a,l).rot(s),le.getChildAt(c).loc(d.x,d.y).rot(s);var h=G[c],y=c%2==0?ae:ie;y.getChildAt(Math.floor(c/2)).loc(h.x,h.y).ske(a,l).rot(s),u||y.getChildAt(Math.floor(c/2)).sca(c%2==0?ee/2:1,c%2==0?1:te/2)}_.x=F.x,_.y=F.y}le.alpha=.5,ke(),Te();var Ae=new e.Shape(1e3,1e3,null,null,null,!1);function Pe(){Ae.x=0,Ae.y=0,Ae.graphics.c().f("rgba(0,0,0,.01)").mt(Y.x,Y.y).lt(X.x,X.y).lt(R.x,R.y).lt(H.x,H.y).lt(Y.x,Y.y).cp(),Ae.reg(F.x,F.y),Ae.x=F.x,Ae.y=F.y}Pe(),J.on("dblclick",(function(e){E.ctrlKey&&t.transformControls.visible&&(t.scaleX=1,t.scaleY=1,t.rotation=0,Te(),Pe(),O.update()),rt(e,!0)}));var Be=J.on("mousedown",Ie),Ee=t.on("mousedown",Ie);function Ie(e){var o=O.getObjectUnderPoint(e.stageX,e.stageY,1);W||o&&(t.contains&&t.contains(o)||!t.contains&&t==o)?t.transformControls.visible||(y?(ut=!1,Ae.mouseEnabled=!1):E.canvas.style.cursor="move",t.transformControls.show(),t.dispatchEvent("transformshow")):!t.transformControls.visible||o&&J.contains(o)||(t.transformControls.hide(),t.dispatchEvent("transformhide"))}var Se,We,Me,Oe,je,Le,De,_e,Ye,Xe,Re,He,Fe,Ne=O.on("stagemousedown",(function(e){var o=O.getObjectUnderPoint(e.stageX,e.stageY,1),n=o&&o.parent&&o.parent.layer&&o.parent.layer==t;!t.transformControls.visible||o&&(J.contains(o)||n)||(t.dispatchEvent("transformhide"),t.transformControls.hide())}));l||(J.off("mousedown",Be),t.off("mousedown",Ee),O.off("stagemousedown",Ne));var Ve,Ge,qe,Ue,Qe,Ze=!1,Ke=!1,Je=t.cursor,$e=new e.Circle(30,"rgba(0,0,0,0)",null,null,null,null,null,null,!1).expand(20);if(y){$e.mouseEnabled=!1,$e.mouseChildren=!1,$e.addChild(ue),re.on("mouseover",at),re.on("mouseout",lt),ie.on("mouseover",at),ie.on("mouseout",lt),ae.on("mouseover",at),ae.on("mouseout",lt),le.on("mouseover",at),le.on("mouseout",lt);var et=new e.Circle(30,"rgba(0,0,0,0)",null,null,null,null,null,null,!1).expand(20);et.cursor="none"}function tt(o){if(Ke=!0,c&&st(),Ve&&O.off("stagemousemove",Ve),Se=o.target.x,We=o.target.y,Xe=t.x,Re=t.y,Me=t.scaleX,Oe=t.scaleY,"rotate"==o.target.controlType){Ze=!0,je=t.rotation;var n=o.stageX/e.scaX,r=o.stageY/e.scaY,i=U.localToGlobal(Xe,Re);He=i.x,Fe=i.y,Le=180*Math.atan2(r-Fe,n-He)/Math.PI}E.ctrlKey||"rotate"==o.target.controlType?(De=Math.abs(Se-t.x),_e=Math.abs(We-t.y)):(De=Math.abs(Se-o.target.op.x),_e=Math.abs(We-o.target.op.y)),"rotate"!=o.target.controlType&&(Ye=o.target.op.parent.localToLocal(o.target.op.x,o.target.op.y,t.parent)),$e.stage?O.setChildIndex($e,O.getChildIndex(J)):$e.addTo(O,O.getChildIndex(J)+1),$e.x=o.stageX/e.scaX,$e.y=o.stageY/e.scaY,$e.cursor=y?"none":o.target.cu,y&&(t.getConcatenatedMatrix().decompose(M),M.rotation||(M.rotation=0),ue.rotation=M.rotation*e.sign(ee*te)*e.sign(t.scaleX*t.scaleY)+de[o.target.cu]+fe,"side"!=o.target.controlType&&ee*te<0&&(ue.rotation+=90),et.addTo(O,1).pos({x:o.stageX/e.scaX,y:o.stageY/e.scaY,reg:!0})),Ae.visible=!1,t.cursor="none"}function ot(o){var n=1;if(E.ctrlKey&&"corner"==o.target.controlType?n=De>_e?(o.target.x-Xe)/(Se-Xe):(o.target.y-Re)/(We-Re):De>_e?Se-o.target.op.x&&(n=(o.target.x-o.target.op.x)/(Se-o.target.op.x)):We-o.target.op.y&&(n=(o.target.y-o.target.op.y)/(We-o.target.op.y)),"corner"==o.target.controlType?(t.scaleX=n*Me,t.scaleY=n*Oe):(t.scaleX="e-resize"==o.target.cu?n*Me:Me,t.scaleY="n-resize"==o.target.cu?n*Oe:Oe),Te(),$e.x=o.stageX/e.scaX,$e.y=o.stageY/e.scaY,y&&(et.x=o.stageX/e.scaX,et.y=o.stageY/e.scaY),!E.ctrlKey||"side"==o.target.controlType){var r=o.target.op.parent.localToLocal(o.target.op.x,o.target.op.y,t.parent);t.x-=(r.x-Ye.x)*e.sign(ee)*e.sign(t.scaleX),t.y-=(r.y-Ye.y)*e.sign(te)*e.sign(t.scaleY)}(Te(),t.transformControls.events)&&it(o,o.target.controlType)}function nt(o){var n=180*Math.atan2(o.stageY/e.scaY-Fe,o.stageX/e.scaX-He)/Math.PI;(E.shiftKey?t.rot(45*Math.round((je+(n-Le)*e.sign(ee)*e.sign(t.scaleX))/45)):t.rot(je+(n-Le)*e.sign(ee)*e.sign(t.scaleX)),Te(),$e.x=o.stageX/e.scaX,$e.y=o.stageY/e.scaY,y&&(t.getConcatenatedMatrix().decompose(M),M.rotation||(M.rotation=0),ue.rotation=M.rotation*e.sign(ee*te)*e.sign(t.scaleX*t.scaleY)+de[o.target.cu]+fe,"side"!=o.target.controlType&&ee*te<0&&(ue.rotation+=90),et.x=o.stageX/e.scaX,et.y=o.stageY/e.scaY),Te(),t.transformControls.events)&&it(o,o.target.controlType,null,!1)}function rt(e,t){ke();var o=e?e.target.controlType:"move";t&&(o="reset"),y&&et.removeFrom(O),it(e,o,!0),O.update()}function it(o,n,r,i){null==i&&(i=!0);var a=!1;qe=null,"move"==n?(t.x==gt.x&&t.y==gt.y||((qe=new createjs.Event("transformed")).transformType="move"),i&&(a=Ae.hitTestPoint(o.stageX/e.scaX,o.stageY/e.scaY))):"corner"==n?(t.scaleX==gt.scaleX&&t.scaleY==gt.scaleY||((qe=new createjs.Event("transformed")).transformType="size"),i&&(a=re.hitTestPoint(o.stageX/e.scaX,o.stageY/e.scaY))):"side"==n?(t.scaleX==gt.scaleX&&t.scaleY==gt.scaleY||((qe=new createjs.Event("transformed")).transformType="stretch"),i&&(a=ie.hitTestPoint(o.stageX/e.scaX,o.stageY/e.scaY)||ae.hitTestPoint(o.stageX/e.scaX,o.stageY/e.scaY))):"rotate"==n?(t.rotation!=gt.rotation&&((qe=new createjs.Event("transformed")).transformType="rotate"),i&&(a=le.hitTestPoint(o.stageX/e.scaX,o.stageY/e.scaY))):"reg"==n?t.regX==gt.regX&&t.regY==gt.regY||((qe=new createjs.Event("transformed")).transformType="reg"):(qe=new createjs.Event("transformed")).transformType="reset"==n?"reset":"unknown",i&&!a&&($e.removeFrom(O),E.canvas.style.cursor="default",t.cursor=Je),qe&&(qe.pressup=r,"Tag"!=t.type&&"TextArea"!=t.type&&"Loader"!=t.type||t.resize(),t.dispatchEvent(qe))}function at(o){Ke||($e.stage?O.setChildIndex($e,O.getChildIndex(J)):$e.addTo(O,O.getChildIndex(J)+1),et.addTo(O,1),$e.x=o.stageX/e.scaX,$e.y=o.stageY/e.scaY,et.x=o.stageX/e.scaX,et.y=o.stageY/e.scaY,t.getConcatenatedMatrix().decompose(M),M.rotation||(M.rotation=0),ue.rotation=M.rotation*e.sign(ee*te)*e.sign(t.scaleX*t.scaleY)+de[o.target.cu]+fe,"side"!=o.target.controlType&&ee*te<0&&(ue.rotation+=90),O.update(),Ve&&O.off("stagemousemove",Ve),Ve=O.on("stagemousemove",(function(t){$e.x=t.stageX/e.scaX,$e.y=t.stageY/e.scaY,O.update()})))}function lt(){O.off("stagemousemove",Ve),Ke||(t.cursor=Je,$e.removeFrom(O),et.removeFrom(O),O.update())}function st(){if(c){var e=U.numChildren-1;"Keyboard"==U.getChildAt(e).type&&e--,U.setChildIndex(t,e),ct()}}function ct(){if(U==O)J.removeFrom(),O.addChildAt(J,O.getChildIndex(t)+1);else{for(var e=U;e.parent&&e.parent!=O;)e=e.parent;t.stage&&(J.parent==O&&O.removeChild(J),O.addChildAt(J,O.getChildIndex(e)+1))}}re.on("mousedown",tt),re.on("pressmove",ot),re.on("pressup",rt),ie.on("mousedown",tt),ie.on("pressmove",ot),ie.on("pressup",rt),ae.on("mousedown",tt),ae.on("pressmove",ot),ae.on("pressup",rt),le.on("mousedown",tt),le.on("pressmove",nt),le.on("pressup",rt),_.drag(),_.on("mousedown",st),_.on("pressup",(function(o){if(!E.ctrlKey){for(var n=0;n<q.length;n++)if(e.dist(_.x,_.y,q[n].x,q[n].y)<w){_.x=q[n].x,_.y=q[n].y;break}e.dist(_.x,_.y,N.x,N.y)<w&&(_.x=N.x,_.y=N.y)}var r=t.rotation;Ue=t.globalToLocal(_.x,_.y),Qe=U==O?new e.Point(_.x,_.y):U.globalToLocal(_.x,_.y),t.reg(Ue.x,Ue.y),t.rotation=0,t.x=t.x+Qe.x-t.x,t.y=t.y+Qe.y-t.y,t.rotation=r,Te(),Pe(),rt(o),O.update()}));var ut=!0;function dt(){O.off("stagemousemove",Ge),Ke||(ce.removeFrom(J),O.update())}function ht(t){!Ke&&y&&ut&&(ce.addTo(J).pos({x:t.stageX/e.scaX,y:t.stageY/e.scaY,reg:!0}),O.update(),Ge&&O.off("stagemousemove",Ge),Ge=O.on("stagemousemove",(function(t){ce.x=t.stageX/e.scaX,ce.y=t.stageY/e.scaY,O.update()})))}V=y?"none":"move",Ae.drag({overCursor:V,dragCursor:V,onTop:!1}),Ae.controlType="move",y&&(Ae.on("mouseover",ht),Ae.on("mouseout",dt)),Ae.on("mousedown",st),Ae.on("pressmove",(function(o){var n;if(t.transformControls.visible&&(n=U==O?new e.Point(Ae.x,Ae.y):U.globalToLocal(Ae.x,Ae.y),t.x=n.x,t.y=n.y,Te(),t.transformControls.events)){it(o,"move")}})),Ae.on("pressup",(function(e){t.transformControls.visible&&rt(e)}));var gt,pt=O.on("stagemouseup",(function(){Ke=!1,Ae.mouseEnabled=!0,ut||(qe=new createjs.Event("transformed"),t.x!=gt.x||t.y!=gt.y?qe.transformType="move":qe.transformType="select",qe.pressup=!0,t.dispatchEvent(qe)),ut=!0,Ae.visible=!0,Ze&&!E.ctrlKey&&C>1&&(t.rotation=Math.round(t.rotation/C)*C,Te()),Pe(),Ae.mouseEnabled=!0,Ze=!1,O.update()}));function ft(){gt={x:t.x,y:t.y,rotation:t.rotation,regX:t.regX,regY:t.regY,scaleX:t.scaleX,scaleY:t.scaleY}}ft();var mt,zt=t.on("mousedown",ft);J.on("mousedown",ft),J.addChild(L),o&&J.addChild(Ae),i&&J.addChild(re),n&&J.addChild(ie),r&&J.addChild(ae),a&&J.addChild(le),J.addChild(_),o&&(t.drag({overCursor:"pointer",dragCursor:"pointer",onTop:!1,removeTweens:!1}),mt=t.on("pressmove",(function(e){if(Te(),Pe(),ke(),t.transformControls.events){it(e,"move")}})));var yt=l;return t.transformControls={visible:s,events:k,ghost:!zot(T),ghostEnabled:!zot(T),show:function(){return c&&st(),ct(),t.toggled=!0,t.transformControls.visible=!0,D.parent&&D.removeFrom(),O.update(),t},hide:function(){if(t.transformControls.ghost)var e=O.getChildIndex(J);return O.removeChild(J),t.transformControls.ghost&&t.transformControls.ghostEnabled&&O.addChildAt(D,e),t.toggled=!1,t.transformControls.visible=!1,y&&(Ve&&O.off("stagemousemove",Ve),Ge&&O.off("stagemousemove",Ge),Ke=!1,$e.removeFrom(O),et.removeFrom(O)),o||(t.cursor=Je),O.update(),t},remove:function(e){e||t.transformControls.hide(),l=!1,o&&(t.noDrag(),t.off("pressmove",mt))},add:function(e){e||t.transformControls.show(),l=yt,o&&(t.drag({overCursor:"pointer",dragCursor:"pointer",onTop:!1,removeTweens:!1}),mt=t.on("pressmove",mt))},allowToggleOn:function(){l=yt=!0,Be=J.on("mousedown",Be),Ee=t.on("mousedown",Ee),Ne=O.on("stagemousedown",Ne)},allowToggleOff:function(){l=yt=!1,J.off("mousedown",Be),t.off("mousedown",Ee),O.off("stagemousedown",Ne)},disable:function(){J.mouseChildren=!1,J.mouseEnabled=!1,o&&(t.noDrag(),t.off("pressmove",mt))},enable:function(){J.mouseChildren=!0,J.mouseEnabled=!0,o&&(t.drag({overCursor:"pointer",dragCursor:"pointer",onTop:!1,removeTweens:!1}),mt=t.on("pressmove",mt))},recordData:function(e){var o={type:t.type,index:U.getChildIndex(t),x:t.x,y:t.y,scaleX:t.scaleX,scaleY:t.scaleY,rotation:t.rotation,skewX:t.skewX,skewY:t.skewY,regX:t.regX,regY:t.regY,controls:t.transformControls.visible};return e?JSON.stringify(o):o},setData:function(e,o){if(!zot(e)){o&&(e=JSON.parse(e)),delete e.controls;var n=e.index;for(var r in zot(n)&&(n=0),delete e.index,e)t[r]=e[r];return setTimeout((function(){Te(),Pe(),ke(),U.setChildIndex(t,n),t.transformControls.visible&&"Layer"!=t.type?t.transformControls.show():t.transformControls.hide(),!t.transformControls.ghost||t.transformControls.ghostEnabled||t.transformControls.visible||O.addChild(D)}),90),t}},hideGhost:function(){t.transformControls.ghost=!1,D.removeFrom()},showGhost:function(){if(t.transformControls.ghost=!0,t.transformControls.ghostEnabled&&!t.transformControls.visible){for(var e=U;e.parent&&e.parent!=O;)e=e.parent;D.stage?O.setChildIndex(D,O.getChildIndex(e)+1):O.addChildAt(D,O.getChildIndex(e)+1)}},addGhost:function(){A>0?(t.transformControls.ghostEnabled=!0,t.transformControls.showGhost()):zon&&zogy("transform() - ghostWidth must be > 0 when making transform")},removeGhost:function(){t.transformControls.ghostEnabled=!1,t.transformControls.hideGhost()},resize:function(e){if(U=t.parent,Te(),Pe(),ke(),s&&t.transformControls.show(),e){var o=new createjs.Event("transformed");o.pressup=!0,o.transformType="resize",t.dispatchEvent(o)}return t},dispose:function(){t.transformControls.hide(),l=!1,o&&(t.noDrag(),t.off("pressmove",mt)),t.transformControls.hideGhost(),Ae.removeAllEventListeners(),le.removeAllEventListeners(),_.removeAllEventListeners(),ie.removeAllEventListeners(),ae.removeAllEventListeners(),re.removeAllEventListeners(),J.removeAllEventListeners(),Ee&&t.off("mousedown",Ee),Be&&t.off("mousedown",Be),Ne&&O.off("stagemousedown",Ne),Ve&&O.off("stagemousemove",Ve),Ge&&O.off("stagemousemove",Ge),pt&&O.off("stagemouseup",pt),zt&&t.off("mousedown",zt),mt&&t.off("pressmove",mt),J=$e=et=null,t.transformControls=null},controls:J,scaleControls:re,stretchXControls:ie,stretchYControls:ae,rotateControls:le},t.toggle=function(e){return!0===e?t.transformControls.show():!1===e||t.transformControls.visible?t.transformControls.hide():t.transformControls.show(),t},t.transformControls.ghost&&(t.transformControls.toggleGhost=function(e){return!0===e?t.transformControls.showGhost():!1===e||t.transformControls.visible?t.transformControls.hideGhost():t.transformControls.showGhost(),t}),s?t.transformControls.show():!B&&t.transformControls.ghost&&t.transformControls.showGhost(),t},e.gesture=function(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z){var y,v="obj, move, scale, rotate, boundary, minScale, maxScale, snapRotate, localBounds, slide, slideEffect, regControl, onTop, surround, circularBounds, rect";if(y=zob(e.gesture,arguments,v))return y;if(z_d("34.5"),!zot(o)&&o.on){var b,w,C,x;zot(n)&&(n=!0),zot(r)&&(r=!0),zot(i)&&(i=!0),zot(u)&&(u=!1),zot(c)&&(c=1),zot(d)&&(d=!1),zot(h)&&(h=5),zot(g)&&(g=!1),zot(p)&&(p=!0),zot(f)&&(f=!1),f&&i&&(f=z=null,zon&&zogy("gesture() - does not support surround when rotate is true")),zot(m)&&(m=!1),zot(a)&&!zot(z)&&(a=z);var k=t();if(zot(o.zimMaskDynamic)||o.zimMaskApply(),!o.zimTouch){var T,A,P,B,E,I,S,W,M=new e.Damp(o.scaleX,.05),O=new e.Damp(o.scaleY,.05),j=o.scaleX/o.scaleY;if(o.zimTouch={move:n,scale:r,rotate:i,pointers:{},checkBounds:function(e,t){if(o.zimTouch.boundary){var n=o.zimTouch.boundary,r=o.parent.localToLocal(e,t,o.parent);f?(e=Math.min(n.x,Math.max(n.x+n.width,r.x)),t=Math.min(n.y,Math.max(n.y+n.height,r.y))):(e=Math.max(n.x,Math.min(n.x+n.width,r.x)),t=Math.max(n.y,Math.min(n.y+n.height,r.y))),e=(r=o.parent.globalToLocal(e,t)).x,t=r.y}return{x:e,y:t}}},a){o.zimTouch.boundary=a,u&&(o.zimTouch.boundary=e.boundsToGlobal(o.parent,a)),o.zimTouch.boundaryStartX=o.zimTouch.boundary.x,o.zimTouch.boundaryStartY=o.zimTouch.boundary.y,o.zimTouch.boundaryStartW=o.zimTouch.boundary.width,o.zimTouch.boundaryStartH=o.zimTouch.boundary.height;var L=o.zimTouch.checkBounds(o.x,o.y);o.x=L.x,o.y=L.y}d&&(C=10,x=5,w=0,b=[],o.zimTouch.slideInterval=e.interval(C/("s"==k?1e3:1),(function(){b[w++%x]=[o.x,o.y]})),o.zimTouch.slideInterval.pause(),o.animate({x:o.x,y:o.y},10/("s"==k?1e3:1),"quadOut")),o.zimTouch.mousedown=o.on("mousedown",(function(t){if(zot(W)?W=1:W++,p){var n=o.parent.numChildren-1;"Keyboard"==o.parent.getChildAt(n).type&&n--,o.parent.setChildIndex(o,n),o.ZIMoutlineShape&&o.outline()}g||(S=null,A=o.scaleX,P=o.scaleY,B=o.rotation,E=o.regX,I=o.regY,o.reg(0,0),T=o.getMatrix(),o.regX=E,o.regY=I);var r="id"+Math.abs(t.pointerID+1),i=o.parent.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY);o.zimTouch.pointers[r]={startX:i.x,startY:i.y,x:i.x,y:i.y},(o.zimTouch.move||o.zimTouch.rotate)&&(o.zimTouch.total=0,e.loop(o.zimTouch.pointers,(function(){o.zimTouch.total++}))),d&&1==o.zimTouch.total&&o.zimTouch.slideInterval.pause(!1),D()})),o.zimTouch.pressmove=o.on("pressmove",(function(t){var n="id"+Math.abs(t.pointerID+1),r=o.parent.globalToLocal(t.stageX/e.scaX,t.stageY/e.scaY);o.zimTouch.pointers[n]&&(o.zimTouch.pointers[n].x=r.x,o.zimTouch.pointers[n].y=r.y);var i,a,c=0,u=0,d=0,h=0;if(e.loop(o.zimTouch.pointers,(function(e,t){c+=t.x-t.startX,u+=t.y-t.startY,d+=t.x,h+=t.y})),0!=o.zimTouch.total){i=c/o.zimTouch.total,a=u/o.zimTouch.total,c=o.zimTouch.startX+i,u=o.zimTouch.startY+a,d/=o.zimTouch.total,h/=o.zimTouch.total;var p={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY,rotation:o.rotation};if(o.zimTouch.move){var f=o.zimTouch.checkBounds(c,u);p.x=f.x,p.y=f.y}if(2==o.zimTouch.pair.length){var m=o.zimTouch.pair[0],z=o.zimTouch.pair[1];if(o.zimTouch.scale){var y=Math.sqrt(Math.pow(z.startX-m.startX,2)+Math.pow(z.startY-m.startY,2)),v=Math.sqrt(Math.pow(z.x-m.x,2)+Math.pow(z.y-m.y,2)),b=o.zimTouch.startSX+(v/y-1),w=o.zimTouch.startSY+(v/y-1);p.scaleX=b,p.scaleY=w,p.scaleX=M.convert(b),p.scaleY=O.convert(w);var C=!zot(l)&&Math.min(b,w)<l,x=!zot(s)&&Math.max(b,w)>s;(C||x)&&(C?j>1?(p.scaleY=l,p.scaleX=l*j):(p.scaleX=l,p.scaleY=l/j):x&&(j>1?(p.scaleX=s,p.scaleY=s/j):(p.scaleY=s,p.scaleX=s*j)),M.immediate(p.scaleX),O.immediate(p.scaleY))}if(o.zimTouch.rotate){var k=Math.atan2(m.startY-z.startY,m.startX-z.startX)*(180/Math.PI),W=Math.atan2(m.y-z.y,m.x-z.x)*(180/Math.PI)-k;p.rotation=o.zimTouch.startR+W}if(g)o.scaleX=p.scaleX,o.scaleY=p.scaleY,o.rotation=p.rotation,o.zimTouch.move&&(o.x=p.x,o.y=p.y);else{o.reg(0,0);var L=o.parent.localToGlobal(d,h);d=L.x,h=L.y;var D=zot(S)?o.globalToLocal(d,h):o.globalToLocal(S.x,S.y);T.clone().translate(D.x,D.y).rotate(p.rotation-B).scale(p.scaleX/A,p.scaleY/P).translate(-D.x,-D.y).decompose(o),o.zimTouch.move&&(o.x+=i,o.y+=a),S=o.localToGlobal(D.x,D.y),o.reg(E,I)}o.zimTouch.scale&&o.dispatchEvent("scale"),o.zimTouch.rotate&&o.dispatchEvent("rotate"),o.zimTouch.move&&o.dispatchEvent("move")}else o.x=p.x,o.y=p.y,o.zimTouch.move&&o.dispatchEvent("move");"Tag"!=o.type&&"TextArea"!=o.type&&"Loader"!=o.type||o.resize(),o.ZIMoutlineShape&&o.outline(),o.getStage&&o.stage&&o.stage.update()}})),o.on("mousedown",(function(){var e=1;o.stage.on("stagemousedown",(function(){e++})),o.stage.on("stagemouseup",(function(){0==--e&&setTimeout((function(){o.zimTouch&&(o.zimTouch.total=0),o.zimTouch&&(o.zimTouch.pointers={}),W=null}),50)}))}),null,!0),o.zimTouch.pressup=o.on("pressup",(function(e){var t="id"+Math.abs(e.pointerID+1);if(delete o.zimTouch.pointers[t],(o.zimTouch.move||o.zimTouch.rotate)&&o.zimTouch.total--,i&&!zot(c)&&0==o.zimTouch.total&&(c>0?o.rotation=Math.round(o.rotation/c)*c:0==c&&(o.rotation=Math.round(o.rotation))),d&&0==o.zimTouch.total&&1==W){o.zimTouch.slideInterval.pause();var n=b[(w+1)%b.length],r=b[w%b.length],a=o.x+(n[0]-r[0])*h,l=o.y+(n[1]-r[1])*h,s=o.zimTouch.checkBounds(a,l),u=x*C*h*Math.min((o.x-s.x)/(o.x-a)||1,(o.y-s.y)/(o.y-l)||1);o.animate({x:s.x,y:s.y},u/("s"==k?1e3:1),"quadOut",(function(){o.dispatchEvent("slidestop")}))}0==o.zimTouch.total&&(W=null),o.getStage&&o.stage&&o.stage.update(),D()})),a&&(_(),o.on("move",_))}return o}function D(){o.zimTouch.pair=[],e.loop(o.zimTouch.pointers,(function(e,t,n){t.startX=t.x,t.startY=t.y,n<=1&&o.zimTouch.pair.push(t)})),o.zimTouch.startX=o.x,o.zimTouch.startY=o.y,o.zimTouch.startSX=o.scaleX,o.zimTouch.startSY=o.scaleY,o.zimTouch.startR=o.rotation}function _(){var e,t=o.localToGlobal(o.regX,o.regY);if(m){var n=o.parent.localToGlobal(o.x-o.width/2,o.y-o.height/2),r=o.parent.localToGlobal(o.x+o.width/2,o.y+o.height/2);e={x:n.x,y:n.y,width:r.x-n.x,height:r.y-n.y}}else e=o.boundsToGlobal();var i={x:o.zimTouch.boundaryStartX+t.x-e.x,y:o.zimTouch.boundaryStartY+t.y-e.y,width:o.zimTouch.boundaryStartW-e.width,height:o.zimTouch.boundaryStartH-e.height};o.gestureBoundary(i,!1)}},e.noGesture=function(t,o,n,r){var i,a="obj, move, scale, rotate";return(i=zob(e.noGesture,arguments,a))?i:(z_d("34.6"),!zot(t)&&t.on&&t.zimTouch?(zot(o)&&(o=!0),zot(n)&&(n=!0),zot(r)&&(r=!0),t.zimTouch.move=!o,t.zimTouch.scale=!n,t.zimTouch.rotate=!r,t.zimTouch.move||t.zimTouch.scale||t.zimTouch.rotate||(t.off("mousedown",t.zimTouch.mousedown),t.off("pressmove",t.zimTouch.pressmove),t.off("pressup",t.zimTouch.pressup),delete t.zimTouch),t):void 0)},e.gestureBoundary=function(t,o,n){if(z_d("34.7"),!zot(t)&&t.on&&!zot(o)&&t.zimTouch){t.zimTouch.localBounds&&t.parent?t.zimTouch.boundary=e.boundsToGlobal(t.parent,o):t.zimTouch.boundary=o,zot(n)&&(n=!0),n&&(t.zimTouch.boundaryStartX=o.x,t.zimTouch.boundaryStartY=o.y,t.zimTouch.boundaryStartW=o.width,t.zimTouch.boundaryStartH=o.height);var r=t.zimTouch.checkBounds(t.x,t.y);return t.x=r.x,t.y=r.y,t}},e.effect=function(e,t,o,n,r,i){if(z_d("33.16"),zot(t))return e;zot(e.effects)&&(e.effects={}),Array.isArray(t)||(t=[t]);for(var a=0,l=0;l<t.length;l++){var s=t[l];s.type||(s instanceof createjs.BlurFilter?s.type="BlurEffect":s instanceof createjs.ColorFilter?s.type="ColorEffect":s instanceof createjs.AlphaMaskFilter?s.type="AlphaEffect":s instanceof createjs.ColorMatrixFilter?s.type="MultiEffect":zot(s.type)&&(s.type="custom"+a++));var c=s.type.replace(/effect/i,"");e.effects[c.toLowerCase()]=s}for(var u in e.filters=[],e.effects)e.filters.push(e.effects[u]);return e.cache(o,n,r,i),e},e.updateEffects=function(e,t){return z_d("33.163"),e.updateCache&&(t?e.cache():e.updateCache()),e},e.noEffect=function(e,t,o){if(z_d("33.165"),zot(o)&&(o=!1),zot(t)){var n;e.effects.multi&&(n=e.effects.multi),e.effects={},n&&(e.effects.multi=n)}else{e.effects||(e.effects={}),Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var i=t[r].replace(/effect/i,"");delete e.effects[i.toLowerCase()]}}for(var a in e.filters=[],e.effects)e.filters.push(e.effects[a]);return o||e.filters.length>0?e.updateCache&&e.updateCache():e.uncache&&e.uncache(),e},e.addPhysics=function(t,o,n,r,i,a,l,s,c,d,h,g,p){var f,m="obj, dynamic, contract, shape, friction, linear, angular, density, bounciness, maskBits, categoryBits, physics, restitution";if(f=zob(e.addPhysics,arguments,m))return f;if(z_d("34.8"),zot(g)){if("undefined"==typeof zimPhysics)return zon&&zogy("ZIM Physics module must be imported"),t;zot(WW.zimDefaultPhysics)&&(WW.zimDefaultPhysics=new e.Physics),g=WW.zimDefaultPhysics}t.physics=g;var z="rectangle";return"Circle"==t.type||"Dial"==t.type?z="circle":"Triangle"==t.type&&(z="triangle"),zot(r)&&(r=z),zot(c)&&(c=p),u(t,o,n,r,i,a,l,s,c,d,h),t},e.removePhysics=function(e){return z_d("34.85"),zot(e.physics)||(e==e.physics.followObj&&e.physics.follow(null),e.follow=e.noFollow=e.control=e.noControl=e.sleep=e.wake=null,e.impulse=e.force=e.spin=e.torque=null,e.physics.remove(e.body),e.physics=null),e},e.hitTestPoint=function(t,o,n,r){if(e.zimhtp||(z_d("35"),e.zimhtp=!0),!t.stage||zot(o)||zot(n))return!1;if(!zot(t)&&t.globalToLocal){if(zot(r)&&(r=!0),r){var i=t.getBounds();if(i){var a=t.globalToLocal(o,n);if(a.x>i.x+i.width||a.x<i.x)return!1;if(a.y>i.y+i.height||a.y<i.y)return!1}}var l={x:o,y:n};return l=t.image||t.spriteSheet||"Shape"==t.type?t.globalToLocal(l.x,l.y):t.globalToLocal(l.x*e.scaX,l.y*e.scaY),t.hitTest(l.x,l.y)}},e.hitTestReg=function(t,o,n){if(e.zimhtr||(z_d("36"),e.zimhtr=!0),!t.stage||!o.stage)return!1;if(!zot(t)&&!zot(o)&&t.localToLocal&&o.localToLocal){zot(n)&&(n=!0);var r=o.localToGlobal(o.regX,o.regY),i=t.getBounds();if(n&&i){var a=t.globalToLocal(r.x,r.y);if(a.x>i.x+i.width||a.x<i.x)return!1;if(a.y>i.y+i.height||a.y<i.y)return!1}return r=t.image||t.spriteSheet||"Shape"==t.type?t.globalToLocal(r.x,r.y):t.globalToLocal(r.x*e.scaX,r.y*e.scaY),t.hitTest(r.x,r.y)}},e.hitTestRect=function(t,o,n,r,i){if(e.zimhtr||(z_d("37"),e.zimhtr=!0),!t.stage||!o.stage)return!1;if(!zot(t)&&!zot(o)&&t.hitTest&&o.getBounds){zot(n)&&(n=0),zot(r)&&(r=!0);var a=o.getBounds();if(a){if(r)if(t.getBounds()&&!e.hitTestBounds(t,o))return!1;var l,s,c=a.x+a.width/2,u=a.y+a.height/2,d=o.localToGlobal(c,u);if(i){if(!g(d))return!1;for(var h=0;h<=n;h++){if(l=a.width*(h+1)/(n+1),s=a.height*(h+1)/(n+1),!g(d=o.localToGlobal(a.x+l,a.y)))return!1;if(!g(d=o.localToGlobal(a.x+a.width,a.y+s)))return!1;if(!g(d=o.localToGlobal(a.x+a.width-l,a.y+a.height)))return!1;if(!g(d=o.localToGlobal(a.x,a.y+a.height-s)))return!1}return!0}if(g(d))return!0;for(h=0;h<=n;h++){if(l=a.width*(h+1)/(n+1),s=a.height*(h+1)/(n+1),g(d=o.localToGlobal(a.x+l,a.y)))return!0;if(g(d=o.localToGlobal(a.x+a.width,a.y+s)))return!0;if(g(d=o.localToGlobal(a.x+a.width-l,a.y+a.height)))return!0;if(g(d=o.localToGlobal(a.x,a.y+a.height-s)))return!0}}else zon&&zogy("hitTestRect():\n please setBounds() on param b object")}function g(o){if(o=t.image||t.spriteSheet||"Shape"==t.type?t.globalToLocal(o.x,o.y):t.globalToLocal(o.x*e.scaX,o.y*e.scaY),t.hitTest(o.x,o.y))return!0}},e.hitTestCircle=function(t,o,n,r,i){if(e.zimhtc||(z_d("38"),e.zimhtr=!0),z_d("38"),t.stage&&o.stage&&!zot(t)&&!zot(o)&&t.hitTest&&o.getBounds){zot(n)&&(n=8),zot(r)&&(r=!0);var a=o.getBounds();if(a){var l=t.getBounds();if(r&&l&&!e.hitTestBounds(t,o))return!1;var s,c,u,d=a.x+a.width/2,h=a.y+a.height/2,g=o.localToGlobal(d,h),p=(a.width+a.height)/2/2;if(i){if(!m(g))return!1;for(var f=0;f<n;f++)if(s=f/n*2*Math.PI,c=d+p*Math.cos(s),u=h+p*Math.sin(s),!m(g=o.localToGlobal(c,u)))return!1;return!0}if(m(g))return!0;for(f=0;f<n;f++)if(s=f/n*2*Math.PI,c=d+p*Math.cos(s),u=h+p*Math.sin(s),m(g=o.localToGlobal(c,u)))return!0;return!1}zon&&zogy("hitTestCircle():\n please setBounds() on param b object")}function m(o){if(o=t.image||t.spriteSheet||"Shape"==t.type?t.globalToLocal(o.x,o.y):t.globalToLocal(o.x*e.scaX,o.y*e.scaY),t.hitTest(o.x,o.y))return!0}},e.hitTestCircleRect=function(t,o,n){if(e.zimhtcr||(z_d("38.2"),e.zimhtcr=!0),t.stage&&o.stage){var r=t.stage;if(!zot(t)&&!zot(o)&&t.getBounds&&o.getBounds){var i=t.getBounds(),a=o.getBounds();if(i&&a){zot(n)&&(n=0);var l=(t.radius?t.radius:(i.width+i.height)/2)+n;l*=t.getConcatenatedMatrix().decompose().scaleX/r.scaleX;var s=o.boundsToGlobal(),c=t.localToGlobal(0,0),u=c.x,d=c.y,h=s.x,g=s.y,p=s.x+s.width,f=s.y+s.height,m=(u<h?h:u>p?p:u)-u,z=(d<g?g:d>f?f:d)-d;return m*m+z*z<=l*l}zon&&zogy("hitTestCircleRect():\n please setBounds() on both objects")}}},e.hitTestCircles=function(t,o,n){if(e.zimhtcs||(z_d("38.5"),e.zimhtcs=!0),t.stage&&o.stage){var r=t.stage;if(!zot(t)&&!zot(o)&&t.hitTest&&t.getBounds&&o.getBounds){var i=t.getBounds(),a=o.getBounds();if(i&&a){zot(n)&&(n=0);var l=t.localToGlobal(i.x+i.width/2,i.y+i.height/2),s=o.localToGlobal(a.x+a.width/2,a.y+a.height/2),c=t.getConcatenatedMatrix(),u=o.getConcatenatedMatrix(),d=Math.sqrt(c.a/r.scaleX*c.a/r.scaleX+c.c/r.scaleX*c.c/r.scaleX),h=Math.sqrt(c.b/r.scaleY*c.b/r.scaleY+c.d/r.scaleY*c.d/r.scaleY),g=Math.sqrt(u.a/r.scaleX*u.a/r.scaleX+u.c/r.scaleX*u.c/r.scaleX),p=Math.sqrt(u.b/r.scaleY*u.b/r.scaleY+u.d/r.scaleY*u.d/r.scaleY),f=Math.sqrt(Math.abs(Math.pow(l.x-s.x,2)+Math.pow(l.y-s.y,2)));return i.width*Math.max(d,h)/2+a.width*Math.max(g,p)/2>=f-n}zon&&zogy("hitTestCircles():\n please setBounds() on both objects")}}},e.hitTestBounds=function(t,o,n,r){if(e.zimhtb||(z_d("39"),e.zimhtb=!0),t.stage&&o.stage&&!zot(t)&&!zot(o)&&t.getBounds&&o.getBounds){var i=!1;r&&r.graphics&&(i=!0);var a=t.getBounds(),l=o.getBounds();if(a&&l){zot(n)&&(n=0);var s=e.boundsToGlobal(t),c=e.boundsToGlobal(o);if(i){var u=r.graphics;u.c(),u.ss(1).s("blue"),u.r(s.x,s.y,s.width,s.height),u.s("green"),u.r(c.x,c.y,c.width,c.height),r.stage.update()}return e.rectIntersect(s,c,n)}zon&&zogy("hitTestBounds():\n please setBounds() on both objects")}},e.hitTestPath=function(t,o,n,r){if(e.zimhtpa||(z_d("37.5"),e.zimhtpa=!0),t.stage&&o.stage&&!zot(t)&&!zot(o)&&t.hitTest&&("Squiggle"==o.type||"Blob"==o.type)){var i=t.getBounds();zot(n)&&(n=2),zot(r)&&(r=!1);var a,l,s=o.interpolate(n,null,!0,null,!0);if(r)for(o.hitPathPoints?o.hitPathPoints.removeAllChildren():o.hitPathPoints=(new e.Container).addTo(),o.hitPathPoints.top(),a=0;a<s.length;a++)l=s[a],l=o.localToGlobal(l.x,l.y),new e.Circle(3).loc(l.x,l.y,o.hitPathPoints);if(i){var c=e.boundsAroundPoints(s);if(!e.rectIntersect(t.boundsToGlobal(i),o.boundsToGlobal(c)))return}for(a=0;a<s.length;a++)if(l=s[a],u(l=o.localToGlobal(l.x,l.y)))return!0;return!1}function u(o){if(o=t.image||t.spriteSheet||"Shape"==t.type?t.globalToLocal(o.x,o.y):t.globalToLocal(o.x*e.scaX,o.y*e.scaY),t.hitTest(o.x,o.y))return!0}},e.hitTestGrid=function(t,o,n,r,i,a,l,s,c,u,d,h,g){if(e.zimhtg||(z_d("41"),e.zimhtg=!0),!t.stage)return!1;if(!zot(t)&&!h){var p=t.globalToLocal(a,l);a=p.x,l=p.y}zot(s)&&(s=0),zot(c)&&(c=0),zot(u)&&(u=0),zot(d)&&(d=0);var f=(o+=u)/r,m=(n+=d)/i,z=Math.min(r-1,Math.max(0,Math.floor((a-s+u/2)/f))),y=Math.min(i-1,Math.max(0,Math.floor((l-c+d/2)/m)));if("open"!=g){if(a-s>f*(z+1)-u||a-s<f*z)return;if(l-c>m*(y+1)-d||l-c<m*y)return}var v=y*r+z;return zot(g)||"index"==g?v:"col"==g?z:"row"==g?y:"array"==g||"open"==g?[v,z,y]:void 0},e.animate=function(n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q,U,Q,Z,K,J,$,ee,te){var oe,ne="target, props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, sequence, sequenceCall, sequenceParams, sequenceReverse, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck";if(n&&(n.props||n.obj)&&(oe=zob(e.animate,arguments,ne)))return oe;if("AC"==n.type&&WW.zdf)return WW.zdf.ac("animate",arguments),n;if(e.animateCheck||(z_d("45"),e.animateCheck=!0),n){var re=e.ANIMATE;if(null!=WW.ANIMATE&&(re=WW.ANIMATE),!re)return n;zot(te)&&(te=!0);var ie,ae,le,se=t(null,ee,null,null,!zot(te)&&!te);g>0&&(h=!0);var ce=arguments,ue=Array.prototype.slice.call(arguments);if(zot(r)&&!zot(q)&&(r=q),zot(q=r))return zon&&zogy("animate() - need props"),n;if("BeadsContainer"==n.type&&zot(B)&&(B=0),"Tone"==n.type&&(K=!1),!1===K?e.pauseAnimateOnBlur=!1:(K||zot(K)&&!1!==e.pauseAnimateOnBlur)&&(zot(e.blurCheck)&&e.setBlurDetect(),e.pauseAnimateOnBlur=!0),!zot(B)&&n.addChild);else{i=e.Pick.choose(i),a=e.Pick.choose(a),c=e.Pick.choose(c),g=e.Pick.choose(g),p=e.Pick.choose(p),b=e.Pick.choose(b),w=e.Pick.choose(w),A=zot(A)?i:e.Pick.choose(A),S=e.Pick.choose(S),D=e.Pick.choose(D),_=e.Pick.choose(_);var de=["loopCount","loopWait","rewind","rewindWait"];for(ae in M)de.indexOf(ae)>=0&&(M[ae]=e.Pick.choose(M[ae]))}var he={override:!zot(n)&&!zot(n.zimX)&&!zot(q.x)||!zot(n)&&!zot(n.zimY)&&!zot(q.y)};if(zot(h)||(he.loop=h),zot(g)||(he.count=g),zot(p)||(he.loopWait=p),zot(f)||(he.loopCall=f),zot(y)||(he.loopWaitParams=y),zot(z)||(he.loopWaitCall=z),zot(m)||(he.loopParams=m),zot(v)||(he.loopPick=v),zot(b)||(he.rewind=b),zot(w)||(he.rewindWait=w),zot(C)||(he.rewindCall=C),zot(x)||(he.rewindParams=x),zot(k)||(he.rewindWaitCall=k),zot(T)||(he.rewindWaitParams=T),zot(r)||(he=e.merge(he,M)),M=he,e.loop(q,(function(e,t){if("string"==typeof e){var o=e.split(".");if(o.length>1&&"."!=e.substr(0,1)&&(q["."+e]=t,delete q[e],e="."+e),o.length>1&&"string"==typeof t){var n=t.substr(0,1);"+"!=n&&"-"!=n&&(q[e]="+"+t)}}})),n.zimTweenOriginals={},!zot(B)&&n.addChild){var ge=[];for(ie=0;ie<n.numChildren;ie++)ge.push(n.getChildAt(ie));R=n,n=ge}var pe=["extra","zoom","speed","layer","fade"],fe={zoom:"Pen"==n.type?"size":"scale",speed:"percentSpeed",layer:"layer",fade:"alpha"};if(n instanceof Array){for(S&&n.reverse(),ie=0;ie<n.length;ie++){var me,ze=n[ie];if(D)for(ae in ze.zimObj={},q){if(me=pe.indexOf(ae)>=0?q[ae]:e.Pick.choose(q[ae]),ze.zimObj[ae]=ze[ae],"string"==typeof me&&"transform"!=ae)me=(ze.zimLastObj&&!zot(ze.zimLastObj[ae])?ze.zimLastObj[ae]:ze[ae])+Number(me.replace(/\s/g,""));ze.zimLastObj&&(ze.zimLastObj[ae]=b?ze.zimTweenOriginals[ae]:q[ae]),ze[ae]=me}else for(ae in ze.zimObj={},q)pe.indexOf(ae),ze.zimObj[ae]=q[ae];var ye=ie*B;0==ie&&0!=B&&(ye="s"==se?.02:20),e.animate(ze,ze.zimObj,i,a,ie==n.length-1?l:null,ie==n.length-1?s:null,c,u,d,null,null,null,null,null,null,null,v,null,null,null,null,null,null,A,P,null,E,I,null,W,e.copy(M),O,j,L,null,_,Y,X,R,H,F,N,V,G,q,U,ye,Z,K,J,$,ee,te)}return R}var ve,be,we,Ce,xe,ke=i,Te=A;if(zot(ke)&&(ke="s"==se?1:1e3),zot(A)&&(A=Te=ke),zot(a)&&(a="quadInOut"),zot(c)&&(c=0),zot(w)&&(w=0),zot(M)&&(M={override:!zot(n.zimX)&&!zot(q.x)||!zot(n.zimY)&&!zot(q.y)}),zot(s)&&(s=n),zot(W)&&(W=!0),zot(O)&&(O=!1),zot(j)&&(j=!1),zot(D)&&(D=!1),zot(_)&&(_={}),_.scale&&(_.scaleX=_.scaleY=_.scale,delete _.scale),zot(L)||(M.override=L),zot(F)&&(F=!1),zot(V)&&(V=!!F),zot(H)&&(H=!1),zot(N)&&(N=!0),zot(G)&&(G=!0),zot(Z)&&(Z=1),n.futureRate=Z,q instanceof Array)return le=1,0==q.length?this:(ho(),fo(),co(),n);if(q&&(q.x&&(n.zimX=!0),q.y&&(n.zimY=!0)),!zot(q.shape)&&q.shape.type==n.type&&("Blob"==n.type||"Squiggle"==n.type)){var Ae=n.pointObjects,Pe=q.shape.pointObjects;if(Ae.length!=Pe.length)zon&&zogy("animate() - shapes must be of same number of points"),delete q.shape;else{delete q.shape;var Be=zot(q.blobShift)?0:q.blobShift;delete q.blobShift;var Ee=!0;for(ie=0;ie<Ae.length;ie++){var Ie=Ae[ie],Se=Pe[(2e4*Ae.length+ie+Be)%Ae.length];for(Jt=0;Jt<4;Jt++)if(1!=Jt){var We=Ie[Jt],Me=e.copy(ue);Me[0]=We,Me[1]={x:Se[Jt].x,y:Se[Jt].y,rotation:Se[Jt].rotation},Ee&&(Me[37]=!0,We.animateEvent&&We.off("animation",We.animateEvent),We.animateEvent=We.on("animation",(function(){n.update()}))),Ee=!1,e.animate.apply(e.animate,Me)}}if(e.isEmpty(q))return n}}if(!zot(n)){n.tweenStates||(n.tweenStates={all:!0});var Oe=!1;if(q.note){if(Array.isArray(q.note))e.loop(q.note,(function(t,o){"string"==typeof t&&(q.note[o]=e.Synth.note(t))}));else if(q.note.min)q.note.min=e.Synth.note(q.note.min),q.note.max=e.Synth.note(q.note.max);else if(q.note.array)e.loop(q.note.array,(function(t,o){"string"==typeof t&&(q.note.array[o]=e.Synth.note(t))}));else if("function"==typeof q.note){if(zon)return zogy("animate() - use frequency in ZIM VEE functions not note"),n}else q.note=e.Synth.note(q.note);q.frequency=q.note,delete q.note}"Sprite"!=n.type&&Object.prototype.hasOwnProperty.call(n,"paused")||(Object.defineProperty(n,"paused",{get:function(){return n.animatePaused},set:function(e){n.animatePaused=e}}),n.paused=!0,n.animating=!1),n.endTween=function(t,o){if(n.stopAnimate(o),"all"!=t&&"main"!=t&&"none"!=t&&(t="all"),n.seriesTweens){if(e.loop(n.seriesTweens,(function(o,r){e.loop(o,(function(e){"string"==typeof o[e]&&"transform"!=e&&(o[e]=n[e]+Number(o[e].replace(/\s/g,""))),so(n,e,o[e])})),"all"==t&&n.seriesCalls[r]&&n.seriesCalls[r](n.seriesParams[r])})),"none"!=t){var r=n.seriesCalls[n.seriesCalls.length-1];r&&r(n.seriesParams[n.seriesParams.length-1])}n.seriesTweens=null,n.seriesCalls=null,n.seriesParams=null}else e.loop(n.zimLastObj,(function(e){"string"==typeof n.zimLastObj[e]&&"transform"!=e&&(n.zimLastObj[e]=n[e]+Number(n.zimLastObj[e].replace(/\s/g,""))),so(n,e,n.zimLastObj[e])})),"none"!=t&&l&&l(s);return n.stage&&n.stage.update(),n};var je,Le,De=!1;if(e.loop(q,(function(e,t){n.zimTweenOriginals[e]="path"==e?q[e]:lo(n,e),e.match("hue")?(q.hueBatch=t,delete q.hue,De=!0):e.match("saturation")?(q.saturationBatch=t,delete q.saturation,De=!0):e.match("brightness")?(q.brightnessBatch=t,delete q.brightness,De=!0):e.match("contrast")?(q.contrastBatch=t,delete q.contrast,De=!0):e.match(/^.effects/)&&(De=!0)})),n.resetTween=function(t){zot(t)&&(t=!0),n.pauseAnimate(),n.percent=null,n.startPercent=null;var o=n.zimSeriesOriginals?n.zimSeriesOriginals:n.zimTweenOriginals;return e.loop(o,(function(e){var t;"path"==e?(n.percentComplete=0,n.zimPath=o[e],t=(n.zimStartPercent,n.zimPath.getCurvePoint(n.zimStartPercent/100)),n.loc(t.x,t.y)):so(n,e,o[e])})),n.zimLastObj=null,n.stage&&n.stage.update(),n.stopAnimate(),n.zimPath&&(ue[1].path=n.zimPath),zot(n.zimStartRotation)||(n.rotation=n.zimStartRotation),n.zimStartRotation=null,zot(n.zimStartScaleX)||(n.scaleX=n.zimStartScaleX),n.zimStartScaleX=null,zot(n.zimStartScaleY)||(n.scaleY=n.zimStartScaleY),n.zimStartScaleY=null,e.animate.apply(null,n.zimSeriesArgs?n.zimSeriesArgs:ue),n.pauseAnimate(t),n},n.replayTween=function(){return n.resetTween(!1),n},q.path||H)n.requestedPercentComplete?je=n.requestedPercentComplete:n.percentComplete&&!go(n,"percentComplete")&&(je=n.percentComplete),n.requestedPercentComplete=null,zot(je)&&(je=0),n.pathRatio=0,n.zimStartRotation=n.rotation,n.percent=null,n.parent&&"BeadsContainer"==n.parent.type||(n.startPercent=null);if(O&&(W=!1),zot(n.zimTweens)&&(n.zimTweens={}),O||(n.stage?Le=n.stage:WW.zdf?Le=WW.zdf.stage:O=!0),n.setColorRange&&!zot(q.color)){var _e=q.color;delete q.color,q.colorRange=1,n.setColorRange(n.color,_e),n.colorRange=0}var Ye={};for(ie in q)pe.indexOf(ie)>=0||(Ye[ie]=e.copy(q[ie]),q[ie]=e.Pick.choose(q[ie]));for(var Xe in zot(q.scale)||(q.scaleX=q.scaleY=e.Pick.choose(q.scale),delete q.scale),q){if(!n.zimBusy)break;n.zimBusy[Xe]&&delete q[Xe]}if(!e.isEmpty(q)){for(ie in"Sprite"!=n.type&&(n.paused=!1,n.animating=!0),(j||M.loop||M.rewind)&&po(),fo(),pe.shift(),_)_[ie]=e.Pick.choose(_[ie]);for(ie in M)"waitedCall"!=ie&&"waitedParams"!=ie&&"loopCall"!=ie&&"rewindCall"!=ie&&"loopWaitCall"!=ie&&"rewindWaitCall"!=ie&&(M[ie]=e.Pick.choose(M[ie]));var Re,He,Fe,Ne;if(mo(),n.getBounds&&zot(n.percentCompleteCheck)&&(n.percentCompleteCheck=!0,Object.defineProperty(n,"percentComplete",{get:function(){return this.zimTween&&this.zimTween.duration?this.zimTween.position/this.zimTween.duration*100:0},set:function(e){this.zimTween?(vt=!0,bo(e,!0)):this.requestedPercentComplete=e}}),Object.defineProperty(n,"percentCompleteNoAngle",{get:function(){return this.zimTween&&this.zimTween.duration?this.zimTween.position/this.zimTween.duration*100:0},set:function(e){this.zimTween?bo(e,!1):this.requestedPercentComplete=e}})),Object.defineProperty(n,"rate",{get:function(){return n.futureRate},set:function(t){n.futureRate=t,e.loop(n.zimTweens,(function(e,o){o.timeScale=t}))},configurable:!0}),!zot(q.path)&&q.path.segmentPoints){zot(q.orient)&&(q.orient=!0),q.orient&&zot(q.flip)&&(q.flip=!0),"Pen"==n.type&&(n.infinite=!0),n.zimOnPath=!0,zot(n.pathRatio)&&(n.pathRatio=0),q.orient&&(q.orient=q.path,q.startOrient=q.rotation),Re=q.path,F?(delete q.path,delete q.percent,(zon&&n.startPercent&&n.startPercent>0||n.percent&&100!=n.percent)&&zogy("ZIM.animate() - startPercent and percent currently not supported with drag on path"),(He=Re.getCurvePoint(n.pathRatio,tt,Ne))&&(Fe=n.parent.globalToLocal(He.x,He.y),n.x=Fe.x,n.y=Fe.y)):(zot(n.startPercent)&&(n.startPercent=e.Pick.choose(zot(q.startPercent)?0:q.startPercent)),zot(n.percent)&&(n.percent=e.Pick.choose(zot(q.percent)?100:q.percent)),delete q.path,delete q.percent);var Ve=!Re.lockControls;delete q.path,q.pathRatio=1}var Ge,qe,Ue,Qe,Ze,Ke=!0,Je=!1,$e=!0,et=!0;if(zot(q.redirect)||(et=q.redirect,delete q.redirect),Re){var tt;Ve||(Ne=e.copy(Re.segmentPoints),tt=e.copy(Re.segmentRatios)),n.currentPercent=n.startPercent+n.percent*n.pathRatio;var ot=(1e6+n.currentPercent)%100/100;if(He=Re.getCurvePoint(ot,tt,Ne),n.parent&&He&&(Fe=n.parent.globalToLocal(He.x,He.y),n.x=Fe.x,n.y=Fe.y),F){a="linear",n.cursor="pointer";var nt=n.percentComplete,rt=!1,it=!0,at=!0,lt=nt,st=10;Ne=e.copy(Re.segmentPoints);var ct=0;e.loop(Ne,(function(t){ct+=e.distanceAlongCurve(t)}));var ut=Math.round(ct/Ne.length/st),dt=Re.interpolate(ut,null,!0,null,!0),ht=(nt||0)/100*ct,gt=ht;Re.zimAnimateChanged=!1,n.zimAnimatePathChange=Re.on("change",(function(){Re.zimAnimateChanged=!0})),n.zimAnimatePathDown=Re.on("mousedown",(function(){rt=!0,1==n.paused&&(Je=!0)})),n.zimAnimatePathUp=Re.on("pressup",(function(){Je=!1})),n.zimAnimateDragDown=n.on("mousedown",(function(t){Le=t.target.stage,n.amu||(n.amu=Le.frame.on("mouseupplus",(function(){Je=!1}))),Le.mouseMoveOutside=!0,Ke=!1,$e=!0,setTimeout((function(){Ke=!0}),50),Je=!0,Re.zimAnimateChanged&&(Ne=e.copy(Re.segmentPoints),ct=0,e.loop(Ne,(function(t){ct+=e.distanceAlongCurve(t)})),ut=Math.round(ct/Ne.length/st),dt=Re.interpolate(ut,null,!0,null,!0)),Re.zimAnimateChanged=!1,nt=n.percentComplete,ft.immediate(nt);var o=nt;b&&(o=ve.position>ve.duration/2?2*(100-nt):2*nt),gt=ht=(o||0)/100*ct}));var pt=!1;n.zimAnimateDragPress=n.on("pressmove",(function(e){pt=!0,Co(e)})),n.animateReturn=function(){b?(it=!1,at=!1,n.percentComplete<50&&(n.percentComplete=100-n.percentComplete),n.pauseAnimate(!1)):zon&&zogy("animate() - animateReturn() needs rewind set to true")},n.zimAnimateDragUp=n.on("pressup",(function(){0==n.paused&&(Je=!1),Ke=!1,setTimeout((function(){Ke=!0}),50),yt[0]<yt[4]?at=!0:yt[0]>yt[4]&&(at=!1),!n.paused&&b&&et&&at!=it&&(n.percentComplete=100-n.percentComplete,it=at)}));var ft=new e.Damp(nt,.15),mt=0,zt=0,yt=[0,0,0,0,0],vt=!1;n.zimDragAnimateTicker=e.Ticker.add((function(){var e;F&&(++zt%20&&(yt.push(gt),yt.shift()),ht=gt,rt&&(nt=n.percentComplete),Je||$e&&1==n.paused?(rt||vt||"Blob"==Re.type&&Math.abs(mt-nt)>(b?45:90)?(rt=!1,e=nt,ft.immediate(e),vt=!1):e=ft.convert(nt),Math.abs(mt-e)>.1?(n.percentCompleteNoAngle=e,mt=e):(n.percentCompleteNoAngle=e,$e=!1,pt=!1)):$e=!1)}),Le)}}if(q.orient){if(!0===q.orient){var bt=n.parent.localToGlobal(zot(q.x)?n.x:q.x,zot(q.y)?n.y:q.y);q.orient={x:bt.x,y:bt.y}}Ge=q.orient,delete q.orient;var wt,Ct=n.rotation;if(n.rotation=Re.getPointAngle(0)+Ct,Ge!=Re)wt=Ge.parent?Ge.parent.localToLocal(Ge.x,Ge.y,n.parent):n.parent.globalToLocal(Ge.x,Ge.y),n.rotation=e.angle(n.x,n.y,wt.x,wt.y)+Ct}q.flip&&(qe=q.flip,delete q.flip,Ue=n.scaleX),q.flipVertical&&(Qe=q.flipVertical,delete q.flipVertical,Ze=n.scaleY);var xt=n.x,kt=n.y,Tt=0;M.loop&&(zot(M.count)||(Tt=M.count,delete M.count,le=1));var At,Pt=0;M.loopWait&&(Pt=M.loopWait,p=M.loopWait,delete M.loopWait),M.loopCall&&(At=M.loopCall,delete M.loopCall);var Bt,Et=n;M.loopParams&&(Et=M.loopParams,delete M.loopParams),WW.TIMECHECK&&te&&(ke&&o(ke,se),Te&&o(Te,se),c&&o(c,se),Rt&&o(Rt,se),Pt&&o(Pt,se),p&&o(p,se),M.rewindWait&&o(M.rewindWait,se),U&&o(U,se),Q&&o(Q,se)),"s"==se&&(ke&&(ke*=1e3),Te&&(Te*=1e3),c&&(c*=1e3),Rt&&(Rt*=1e3),Pt&&(Pt*=1e3),p&&(p*=1e3),M.rewindWait&&(M.rewindWait*=1e3),U&&(U*=1e3),Q&&(Q*=1e3)),M.loopWaitCall&&(Bt=M.loopWaitCall,delete M.loopWaitCall);var It=n;M.loopWaitParams&&(It=M.loopWaitParams,delete M.loopWaitParams);var St,Wt,Mt,Ot,jt=["ballisticIn","ballisticOut","ballisticInOut","snapIn","snapOut","snapInOut","slowmoIn","slowmoOut","slowmoInOut"];if(-1!=jt.indexOf(a)&&(a=To(a)),M.rewind&&(a&&(a instanceof Function?St=zik(a.reverse()):-1==(St=a).indexOf("InOut")&&(-1!=St.indexOf("Out")?St=St.replace("Out","In"):-1!=St.indexOf("In")&&(St=St.replace("In","Out")))),P&&(St=P,-1!=jt.indexOf(St)&&(St=To(St)))),a instanceof Function)Wt=a;else{var Lt="get"+a.charAt(0).toUpperCase()+a.slice(1),Dt=zik(J),_t=zik($);zot(Dt)&&zot(_t)||!createjs.Ease[Lt]?Wt=createjs.Ease[a]:(!zot(_t)&&zot(Dt)&&(Dt=1),!zot(Dt)&&zot(_t)&&(_t=.3*1.5),Wt=createjs.Ease[Lt](Dt,_t))}if(St&&(St instanceof Function?Mt=St:(Lt="get"+St.charAt(0).toUpperCase()+St.slice(1),Dt=zik(J),_t=zik($),zot(Dt)&&zot(_t)||!createjs.Ease[Lt]?Mt=createjs.Ease[St]:(!zot(_t)&&zot(Dt)&&(Dt=1),!zot(Dt)&&zot(_t)&&(_t=.3*1.5),Mt=createjs.Ease[Lt](Dt,_t)))),M.rewind){var Yt,Xt,Rt=0;if(delete M.rewind,b=!0,w=M.rewindWait,M.rewindWait&&(Rt=M.rewindWait,delete M.rewindWait),M.rewindCall){Yt=M.rewindCall;var Ht=M.rewindParams;zot(Ht)&&(Ht=n),delete M.rewindCall,delete M.rewindParams}if(M.rewindWaitCall){Xt=M.rewindWaitCall;var Ft=M.rewindWaitParams;zot(Ft)&&(Ft=n),delete M.rewindWaitCall,delete M.rewindWaitParams}U>0||Q>0||c>0?U>0||Q>0?(n.waiting=!0,(ve=n.zimTweens[Y]=n.zimTween=createjs.Tween.get(n,{override:M.override}).wait(U>0?U:0,!0).wait(Q>0?Q:0,!0).call((function(e){e.waiting=!1,Q=U=0,Bo(ve)}))).timeScale=n.futureRate):Bo():(zo(),Eo())}else U>0||Q>0||c>0?U>0||Q>0?(n.waiting=!0,(ve=n.zimTweens[Y]=n.zimTween=createjs.Tween.get(n,{override:M.override}).wait(U>0?U:0,!0).wait(Q>0?Q:0,!0).call((function(){Q=U=0,n.waiting=!1,Io(ve)}))).timeScale=n.futureRate):Io():(zo(),So());ve.startPaused=V,ve.rewinding=!1,zot(Z)||(ve.timeScale=e.Pick.choose(Z)),!O&&W&&(je&&(n.pathRatio=n.percentComplete&&100!=Math.round(n.percentComplete)?n.percentComplete/100:0,n.percentCompleteNoAngle=100!=Math.round(je)?je:0),Ot=X&&!zot(R)&&R.dispatchEvent?e.Ticker.add((function(){De&&n.updateEffects(),(Re||Ge||qe||Qe)&&Vt(),R.dispatchEvent("animation")}),Le):X&&n.dispatchEvent?e.Ticker.add((function(){De&&n.updateEffects(),(Re||Ge||qe||Qe)&&Vt(),n.dispatchEvent("animation")}),Le):e.Ticker.add((function(){De&&n.updateEffects(),(Re||Ge||qe||Qe)&&Vt()}),Le));var Nt=[1,1,1],Vt=function(){if(n.parent&&!ve.passive&&!ve.startPaused){if(F&&b&&(lt<50&&n.percentComplete>50||lt>50&&n.percentComplete<50)&&(it=n.percentComplete<50),lt=n.percentComplete,Re){if(Ve&&(Ne=Re.segmentPoints,tt=Re.segmentRatios),F)var t=Re.getCurvePoint(n.pathRatio,tt,Ne);else{n.currentPercent=n.startPercent+n.percent*n.pathRatio;var o=(1e6+n.currentPercent)%100/100;1==n.pathRatio&&(o+=n.percent>0?1:0),t=Re.getCurvePoint(o,tt,Ne)}if(t){var r=n.parent.globalToLocal(t.x,t.y);n.x=r.x,n.y=r.y}}var i,a=90==Ct||270==Ct||-90==Ct;if(qe&&Ke&&(xt>n.x&&e.sign(a?n.scaleY:n.scaleX)==e.sign(Ue)&&(a?n.scaleY*=-1:n.scaleX*=-1),xt<n.x&&e.sign(a?n.scaleY:n.scaleX)!=e.sign(Ue)&&(a?n.scaleY*=-1:n.scaleX*=-1)),Qe&&Ke&&(kt>n.y&&e.sign(a?n.scaleX:n.scaleY)==e.sign(Ze)&&(a?n.scaleX*=-1:n.scaleY*=-1),kt<n.y&&e.sign(a?n.scaleX:n.scaleY)!=e.sign(Ze)&&(a?n.scaleX*=-1:n.scaleY*=-1)),Ge){var l;if(Re==Ge)i=e.angle(xt,kt,n.x,n.y)+Ct;else l=Ge.parent?Ge.parent.localToLocal(Ge.x,Ge.y,n.parent):n.parent.globalToLocal(Ge.x,Ge.y),i=e.angle(n.x,n.y,l.x,l.y)+Ct;if(0!=i&&(!n.paused||pt)){qe&&xt-n.x>0&&(i+=180);var s=i;n.rotation=s==Ct?n.rotation:s,b&&n.percentComplete>50&&!qe&&(n.rotation+=180)}}if(F){var c=n.x-xt+n.y-kt;Math.abs(c)>2&&(Nt.push(e.sign(c)),Nt.shift(),ve.forward=Mo(Nt))}xt=n.x,kt=n.y}};(Re||Ge||qe||Qe)&&(n.handlePath=Vt),zot(n.zimMaskDynamic)||n.zimMaskApply();var Gt,qt,Ut,Qt=!1;for(Do(),n.stopAnimate&&n.stopAnimate.real||(n.stopAnimate=function(t,o,r,i,a){var l;if(n.dynamicAnimation=null,!a||!F){if(zot(t)&&(n.tweenStates={}),o)return n.endTween(null,t),n;if(zot(i)&&(i=!0),null==n.pan&&(n.paused=!0,n.animating=!1),"Pen"==n.type&&n.zimOnPath&&(n.stop(),n.zimOnPath=!1),zot(r)&&(r=!0),i&&F&&(Re&&Re.off("change",n.zimAnimatePathChange),n.off("mousedown",n.zimAnimateDragDown),n.off("pressmove",n.zimAnimateDragPress),n.off("pressup",n.zimAnimateDragUp),n.amu&&Le.frame.off("mouseupplus",n.amu),e.Ticker.remove(n.zimDragAnimateTicker)),zot(t)){if(!r)return n;for(l in n.zimBusy=null,createjs.Tween.removeTweens(n),n.zimTweens)Yo(l);n.zimTweens=null,n.zimIdSets=null,n.zimTween=null,e.idSets&&e.idSets[be||l]&&(delete e.idSets[be||l],e.isEmpty(e.idSets)&&delete e.idSets),e.animatedObjects.remove(n)}else{Array.isArray(t)||(t=[t]);var s=Ro(t);for(l in n.zimTweens)n.zimTweens[l].requestID&&cancelAnimationFrame(n.zimTweens[l].requestID),r&&s.indexOf(l)>=0&&_o(l),!r&&s.indexOf(l)<0&&_o(l)}return n}n.pauseAnimate()},n.stopAnimate.real=!0,n.pauseAnimate=function(e,t,o,r){var i;if("pauseOnBlur"==t?t=null:zot(t)&&(n.tweenStates={all:!1===e}),"Pen"==n.type&&(!1===e?n.zimOnPath&&(n.infinite=!0):n.stop()),Ut&&!r){if(zot(t))for(i in n.zimTweens)Xo(i,e);else n.pause(e,t);return n}if(zot(e)&&(e=!0),Je=!1,n.paused=e,n.animating=!e,zot(o)&&(o=!0),zot(t)&&!o)return n;if(zot(t))for(i in n.zimTweens)Xo(i,e);else{Array.isArray(t)||(t=[t]);var a=Ro(t);for(i in n.zimTweens)o&&a.indexOf(i)>=0&&(Xo(i,e),n.tweenStates[i]=!e),!o&&a.indexOf(i)<0&&(Xo(i,e),n.tweenStates[i]=!e)}return"Sprite"==n.type&&(n.running||n.stop()),n}),V&&n.pauseAnimate(!0,Y,null,!0),q.extra&&(Gt=q.extra,delete q.extra,Array.isArray(Gt)||(Gt=[Gt])),ie=0;ie<pe.length;ie++){var Zt=pe[ie];q[Zt]&&(zot(Gt)&&(Gt=[]),Ho(Zt,q[Zt]),delete q[Zt])}if(Gt)for(n.zimStartScaleX=n.scaleX,n.zimStartScaleY=n.scaleY,ve.extraTickers=[],ie=0;ie<Gt.length;ie++){var Kt=Gt[ie];for(var Jt in zot(Kt.inputObj)&&(Kt.inputObj=n),zot(Kt.inputProp)&&(Kt.inputProp="y"),zot(Kt.inputMin)&&(Kt.inputMin=0),zot(Kt.inputMax)&&(Kt.inputMax="x"==Kt.inputProp?Le.width:Le.height),zot(Kt.outputObj)&&(Kt.outputObj=n),zot(Kt.outputProp)&&(Kt.outputProp="scale"),zot(Kt.outputMin)&&(Kt.outputMin=0),zot(Kt.outputMax)&&(Kt.outputMax=Kt.outputMin+1),zot(Kt.constrain)&&(Kt.constrain=!0),Kt)q[Jt]=e.Pick.choose(q[Jt]);"percentSpeed"==Kt.outputProp&&(H=!0),qt=new e.Proportion(Kt.inputMin,Kt.inputMax,Kt.outputMin,Kt.outputMax,Kt.factor,Kt.outputRound);var $t=function(){var t=Kt,o=qt;return function(){var n,r=t.outputObj,i=t.inputObj[t.inputProp];"x"!=t.inputProp&&"y"!=t.inputProp||t.inputObj.parent&&(i=t.inputObj.parent.localToGlobal(i,i)[t.inputProp]);if(n=t.constrain?e.constrain(o.convert(i),t.outputMin,t.outputMax):o.convert(i),Number.isNaN(n)&&(n=null!=t.outputMin?t.outputMin:0),"scale"==t.outputProp)r.scaleX=e.sign(r.scaleX)*n,r.scaleY=e.sign(r.scaleY)*n;else if("scaleX"==t.outputProp)r.scaleX=e.sign(r.scaleX)*n;else if("scaleY"==t.outputProp)r.scaleY=e.sign(r.scaleY)*n;else if("layer"==t.outputProp){if(!r.parent)return;var a=e.constrain(Math.round(n),0,r.parent.numChildren-1);a!=r.parent.getChildIndex(r)&&r.parent.setChildIndex(r,a)}else"percentSpeed"==t.outputProp?r[t.outputProp]=100*n:r[t.outputProp]=n}}();$t(),ve.extraTickers.push(e.Ticker.add($t,Le))}if(H&&(n.dynamicAnimation=!0),H||n.zimAnimateDragDown){if(H){Ut=!0,n.pauseAnimate(!0,Y,null,!0),n.paused=!1,n.animating=!0,ve.currentTime=0;var eo=ve;zot(n.percentSpeed)&&(n.percentSpeed=ve.startPaused?0:100);var to=1e3/60;ve.currentTime=0;var oo=!Q&&!U&&!c&&!Tt&&M.loop;N&&M.loop&&!Tt&&(N=!1);var no=i+(b?A||i:0)+(w||0)+(p||0);no*="s"==se?1e3:1;var ro,io=1;M.loop&&Tt&&(io=Tt),N&&(ro=no*io),Fo()}var ao;n.pause=function(t,o){if(zot(t)&&(t=!0),zot(o)&&(o=0),t){if(n.zimAnimateDragDown&&(F=!1,n.cursor="default",Re&&Re.off("change",n.zimAnimatePathChange),n.off("mousedown",n.zimAnimateDragDown),n.off("pressmove",n.zimAnimateDragPress),n.off("pressup",n.zimAnimateDragUp),!H))return;ao=n.percentSpeed,o>0?e.animate({target:n,props:{percentSpeed:0},override:!1,ticker:!1,time:o,call:function(){n.percentSpeed=0,n.paused=!0,n.animating=!1,H=!1,n.dispatchEvent("pause")}}):(ve.startPaused=!1,n.percentSpeed=0,n.paused=!0,n.animating=!1,H=!1,setTimeout((function(){n.dispatchEvent("pause")}),10))}else{if(n.zimAnimateDragDown&&(F=!0,n.cursor="pointer",Re&&(n.zimAnimatePathChange=Re.on("change",n.zimAnimatePathChange)),n.zimAnimateDragDown=n.on("mousedown",n.zimAnimateDragDown),n.zimAnimateDragPress=n.on("pressmove",n.zimAnimateDragPress),n.zimAnimateDragUp=n.on("pressup",n.zimAnimateDragUp),!H&&0!=V))return;Je=!1,ve.currentTime=ve.position,o>0?e.animate({target:n,props:{percentSpeed:ao},override:!1,ticker:!1,time:o,call:function(){n.percentSpeed=ao,n.paused=!1,n.animating=!0,H=!0}}):(n.percentSpeed=ao,n.paused=!1,n.animating=!0,H=!0)}return n}}return n}}}function lo(e,t){if("."==t.substr(0,1)){for(var o=t.split("."),n=e,r=1;r<o.length;r++)n=n[o[r]];return n}return"transform"==t&&e.style?e.style.transform:e[t]}function so(e,t,o){if("."==t.substr(0,1)){for(var n=t.split("."),r=e,i=1;i<n.length-1;i++)r=r[n[i]];r[n[n.length-1]]=o}else e[t]=o}function co(){var t;n.zimLastObj&&e.loop(n.zimLastObj,(function(e){zot(n.zimTweenOriginals[e])||(n[e]=n.zimTweenOriginals[e],n.zimLastObj[e]=n.zimTweenOriginals[e])}));for(var o,r,i=c,a=0,l=0;l<q.length;l++)if(!zot((t=q[l]).target)){zot(t.time)&&(t.time=ke),i+=t.wait?t.wait:0,o=t.time,r=zot(t.rewindTime)?o:t.rewindTime,t.rewind&&(o=o+r+(t.rewindWait?t.rewindWait:0)),t.loop&&(o*=t.loopCount,o+=(t.loopCount-1)*(t.loopWait?t.loopWait:0)),zot(t.params)&&(t.params=t.target),xe=t.target,i<0&&(a+=i,i=0);var s={target:t.target,obj:e.copy(t.obj),seriesWait:a,wait:i,waitedCall:t.waitedCall,waitedParams:t.waitedParams,time:t.time,ease:t.ease,from:t.from,rewind:t.rewind,call:t.call,params:t.params,loop:t.loop,loopCount:t.loopCount,loopWait:t.loopWait,loopCall:t.loopCall,loopParams:t.loopParams,loopWaitCall:t.loopWaitCall,loopWaitParams:t.loopWaitParams,loopPick:t.loopPick,rewindWait:t.rewindWait,rewindCall:t.rewindCall,rewindParams:t.rewindParams,rewindWaitCall:t.rewindWaitCall,rewindWaitParams:t.rewindWaitParams,rewindTime:t.rewindTime,rewindEase:t.rewindEase,set:e.copy(t.masterSet),events:X,rate:n.futureRate,pauseOnBlur:t.pauseOnBlur,easeAmount:t.easeAmount,easeFrequency:t.easeFrequency,override:!1,id:Y};l==q.length-1&&uo(s),e.animate(s),a+=i+o,i=0}}function uo(e){var t=e.call,o=e.params;M.loop&&(!M.count||le<M.count)?e.call=function(){function e(){for(var e=0;e<Ce.objects.length;e++)Ce.objects[e].set&&Ce.objects[e].set(Ce.values[e]);M.loopWaitCall&&"function"==typeof M.loopWaitCall&&M.loopWaitCall(M.loopWaitParams),co()}t&&"function"==typeof t&&t(o),M.loopCall&&"function"==typeof M.loopCall&&M.loopCall(M.loopParams),M.loopWait?(zot(n.zimTweens)&&(n.zimTweens={}),(ve=n.zimTweens[Y]=n.zimTween=createjs.Tween.get(n,{override:M.override}).wait(M.loopWait,!0).call(e)).timeScale=n.futureRate):e()}:e.call=function(){t&&"function"==typeof t&&t(o),zot(s)&&(s=xe),l&&"function"==typeof l&&l(s),_o(Y),n.zimLastObj=null},le++}function ho(){var t,o;n&&!n.seriesTweens&&(n.seriesTweens=[],n.seriesCalls=[],n.seriesParams=[]);for(var r=0;r<q.length;r++)(t=q[r]).target?(t.target.seriesTweens||(t.target.seriesTweens=[]),t.target.seriesCalls||(t.target.seriesCalls=[]),t.target.seriesParams||(t.target.seriesParams=[]),t.target.seriesTweens.push(t.props),t.target.seriesCalls.push(t.call),t.target.seriesParams.push(t.params)):(n.seriesTweens.push(t.props),n.seriesCalls.push(t.call),n.seriesParams.push(t.params));for(n.seriesCalls.push(l),n.seriesParams.push(s),t=q[0],(o=n||t.target).zimSeriesOriginals={},r=q.length-1;r>=0;r--)zot((t=q[r]).props)&&!zot(t.obj)&&(t.props=t.obj),t.obj=t.props,e.loop(t.obj,(function(e){o.zimSeriesOriginals[e]="path"==e?q[e]:lo(o,e)}));var i=new e.Dictionary;for(Ce=new e.Dictionary,r=0;r<q.length;r++)if(t=q[r],n||(n=t.target),zot(t.target)&&(t.target=n),zot(t.ease)&&(t.ease=a),!zot(t.target)){if(0==r&&(t.target.zimSeriesArgs=ce),zot(t.props)&&!zot(t.obj)&&(t.props=t.obj),t.obj=t.props,t.loop&&(zot(t.loopCount)||t.loopCount<=0)&&(t.loopCount=0,q.splice(r+1,q.length)),zot(t.obj.scale)||(t.obj.scaleX=t.obj.scaleY=t.obj.scale,delete t.obj.scale),t.from){var c=i.at(t.target);if(c){if(t.set){var u=e.copy(t.obj),d=e.merge(c,t.set);t.obj=wo(t.target,t.obj,d),t.set=e.merge(t.set,u)}else t.set=e.copy(t.obj),t.obj=wo(t.target,t.obj,c);t.from=!1}else i.add(t.target,wo(t.target,t.obj,t.set))}var h={};for(var g in t.obj)h[g]=t.set&&t.set[g]?t.set[g]:t.target[g];zot(Ce.at(t.target))&&Ce.add(t.target,{});var p=e.merge(Ce.at(t.target),h);Ce.remove(t.target),Ce.add(t.target,p),t.masterSet=e.copy(t.set)}zot(n.zimTweens)&&(n.zimTweens={})}function go(e,t){return!!Object.getOwnPropertyDescriptor(e,t).get}function po(){n.zimMouseEnabledCheck||(n.zimMouseEnabledCheck=!0,n.zimLastMouseEnabled=n.mouseEnabled),n.mouseEnabled=!1,setTimeout((function(){for(var e in n.zimBusy||(n.zimBusy={}),q)n.zimBusy[e]=!0;n.zimMouseEnabledCheck=null,n.mouseEnabled=n.zimLastMouseEnabled}),70)}function fo(){zot(Y)?Y=e.makeID(10):(Y=String(Y),we=Y),zot(n.zimIdSets)&&(n.zimIdSets={}),zot(n.zimIdSets[Y])?zot(n.zimTweens[Y])||(be=Y,Y=e.makeID(10),n.zimIdSets[be]=[be],n.zimTweens[be].zimIdSet=be,n.zimIdSets[be].push(Y)):(be=Y,Y=e.makeID(10),n.zimIdSets[be].push(Y))}function mo(){yo(),vo(),n.seriesTweens&&(n.seriesTweens[0]=q),D&&!Oe&&(q=wo(n,q,_,!0))}function zo(){yo(),D&&!Oe&&(q=wo(n,q,_,!0))}function yo(){var e;for(ie in n.zimLastObj||(n.zimLastObj={}),q){if("string"==typeof q[ie]&&"transform"!=ie){if("+"==q[ie].substr(0,1))continue;e=n.zimLastObj&&!zot(n.zimLastObj[ie])?n.zimLastObj[ie]:n[ie],q[ie]=e+Number(q[ie].replace(/\s/g,""))}n.zimLastObj[ie]=b?n.zimTweenOriginals[ie]:q[ie]}}function vo(){var e;for(ie in _){if("string"==typeof _[ie]&&"transform"!=ie){if("+"==_[ie].substr(0,1))continue;e=n.zimLastObj&&!zot(n.zimLastObj[ie])?n.zimLastObj[ie]:n[ie],_[ie]=e+Number(_[ie].replace(/\s/g,""))}n.zimLastObj[ie]=b?n.zimTweenOriginals[ie]:q[ie]}}function bo(e,t){n.zimTween.startPaused=!1,H?zot(n.zimTween.currentTime)||(n.zimTween.currentTime=n.zimTween.currentTime-n.zimTween.position+e*n.zimTween.duration/100):n.zimTween.setPosition(Math.round(e*n.zimTween.duration/100)),t&&Re&&!1!==q.orient&&Re.getCurvePoint&&(n.rotation=Re.getCurvePoint(e/100,null,null,!0).angle+(Ct||0)),vt&&void 0!==nt&&(nt=e),n.handlePath&&n.handlePath()}function wo(e,t,o,n){Oe=!0,Re&&(!zot(e.percentComplete)||o&&!zot(o.percentComplete))&&(o||(o={}),zot(o.pathRatio)&&(o.pathRatio=zot(o.percentComplete)?e.percentComplete/100:o.percentComplete/100));var r={};for(ie in t)o&&!zot(o[ie])?r[ie]=o[ie]:r[ie]=e[ie],n&&(e[ie]=t[ie]);return r}function Co(t){var o=Re.globalToLocal(t.rawX/e.scaX,t.rawY/e.scaY),n=ht;"Blob"==Re.type&&(yt[0]<yt[4]?at=!0:yt[0]>yt[4]&&(at=!1),n<10&&!at?(gt=ht=n=ct-5,ft.immediate(gt/ct*100),yt=[ct-1,ct-2,ct,ct-3,ct-4]):n>ct-10&&at&&(gt=ht=n=5,ft.immediate(gt/ct*100),yt=[0,0,0,0,0]));var r=o.x,i=o.y,a=n;dt.sort((function(e,t){var o=e.x,n=e.y,l=e.r*ct,s=t.x,c=t.y,u=t.r*ct;return Math.sqrt(Math.pow(r-o,2)+Math.pow(i-n,2)+Math.pow(a-l,2))-Math.sqrt(Math.pow(r-s,2)+Math.pow(i-c,2)+Math.pow(a-u,2))})),gt=dt[0].r*ct,nt=gt/ct*100,nt=e.constrain(nt,0,99.95),b&&(nt/=2,ve.position>ve.duration/2&&(nt=100-nt))}function xo(){if(Pt>0&&(n.waiting=!1),M.loop){if(E&&"function"==typeof E){var t=zot(I)?n:I;E(t)}if(At&&"function"==typeof At&&At(Et),v){var o,r=e.Pick.choose(n.futureRate);if(zot(n.futureRate)||(ve.timeScale=r),zot(Ye.scale)||(o=e.Pick.choose(Ye.scale)),!D&&ve.step&&ve.step.prev&&ve.step.prev.props)for(var i in ve.step.prev.props)if(!(pe.indexOf(i)>=0)){var a=e.Pick.choose(Ye[i]);if("string"==typeof a&&"transform"!=i)if("+"!=a.substr(0,1))a=(n.zimLastObj&&!zot(n.zimLastObj[i])?n.zimLastObj[i]:n[i])+Number(a.replace(/\s/g,""));n.zimLastObj[i]=b?n.zimTweenOriginals[i]:a,zot(Ye[i])||(ve.step.prev.props[i]=a),"scaleX"!=i||zot(o)||(ve.step.prev.props.scaleX=o),"scaleY"!=i||zot(o)||(ve.step.prev.props.scaleY=o)}}}}function ko(){Bt&&"function"==typeof Bt&&Bt(It)}function To(t){var o=[.4,.75,.9,.95],n=[.99,-.69,.53,.014],r=[1.18,.69,1,.96];return"ballisticIn"==t?t=zik(e.zimEase(o)):"ballisticOut"==t?t=zik(e.zimEase(o).reverse()):"ballisticInOut"==t?t=zik(e.zimEase(o,null,!0)):"snapIn"==t?t=zik(e.zimEase(n)):"snapOut"==t?t=zik(e.zimEase(n).reverse()):"snapInOut"==t?t=zik(e.zimEase(n,null,!0)):"slowmoIn"==t?t=zik(e.zimEase(r)):"slowmoOut"==t?t=zik(e.zimEase(r).reverse()):"slowmoInOut"==t&&(t=zik(e.zimEase(r,null,!0))),t}function Ao(){Rt>0&&(n.waiting=!1),Yt&&"function"==typeof Yt&&Yt(Ht)}function Po(){Rt>0&&(n.waiting=!0),Xt&&"function"==typeof Xt&&Xt(Ft)}function Bo(e){zo(),c>0&&(n.waiting=!0),(ve=n.zimTweens[Y]=n.zimTween=createjs.Tween.get(n,{override:M.override}).wait(c,!0).call((function(){n.waiting=!1,u&&"function"==typeof u&&u(zot(d)?n:d),c=0,Eo(ve)}))).timeScale=n.futureRate,e&&Wo(e,ve)}function Eo(e){var t=jo();n.set&&!D&&n.set(_),(ve=n.zimTweens[Y]=n.zimTween=createjs.Tween.get(n,M).to(q,ke,Wt).call(Po).wait(Rt,!0).call(Ao).to(t,Te,Mt).call(Oo).wait(Pt,!0).call(xo)).timeScale=n.futureRate,e&&Wo(e,ve),Do()}function Io(e){zo(),c>0&&(n.waiting=!0),(ve=n.zimTweens[Y]=n.zimTween=createjs.Tween.get(n,{override:M.override}).wait(c,!0).call((function(){c=0,n.waiting=!1,u&&"function"==typeof u&&u(zot(d)?n:d),So(ve)}))).timeScale=n.futureRate,e&&Wo(e,ve)}function So(e){n.set&&!D&&n.set(_),(ve=n.zimTweens[Y]=n.zimTween=createjs.Tween.get(n,M).to(q,ke,Wt).call(Oo).wait(Pt,!0).call(xo)).timeScale=n.futureRate,e&&Wo(e,ve),Do()}function Wo(e,t){t.zimIdSet=e.zimIdSet,t.zimObj=e.zimObj,t.zimTicker=e.zimTicker,t.zimExtraTickers=e.zimExtraTickers,t.requestID=e.requestID}function Mo(e){if(Array.isArray(e)){for(var t=0,o=0,n=e.length;o<n;o++)t+=e[o];return t}}function Oo(){if(n.seriesTweens&&n.seriesTweens.shift(),n.seriesCalls&&n.seriesCalls.shift(),n.seriesParams&&n.seriesParams.shift(),n.paused&&"Sprite"!=n.type)l&&"function"==typeof l&&l(s);else{if(M.loop){if(!(Tt>0))return Pt>0&&(n.waiting=!0),void ko();if(le<Tt)return Pt>0&&(n.waiting=!0),ko(),void le++;b?n.set&&n.set(jo()):n.set&&n.set(q)}if(G?_o(Y):n.pauseAnimate(!0,Y),!M.loop&&E&&"function"==typeof E){var e=zot(I)?n:I;E(e)}l&&"function"==typeof l&&l(s)}}function jo(){var e={};for(var t in q)if(O&&n.style)zot(_[t])||D?e[t]="transform"==t?n.style[t]:zum(n.style[t]):e[t]=_[t];else if(zot(_[t])||D)if("."==t.substr(0,1)){for(var o=t.split("."),r=n,i=1;i<o.length;i++)r=r[o[i]];e[t]=r}else e[t]=n[t];else e[t]=_[t];return e}function Lo(t){if(n.zimBusy){for(var o in t)delete n.zimBusy[o];e.isEmpty(n.zimBusy)&&(n.zimBusy=null)}}function Do(){ve.zimObj=q,ve.zimTicker=Ot,ve.zimPaused=Qt,be&&(ve.zimIdSet=be),we&&(zot(e.idSets)&&(e.idSets={}),zot(e.idSets[we])?e.idSets[we]=[n]:e.idSets[we].indexOf(n)<0&&e.idSets[we].push(n)),e.animatedObjects||(e.animatedObjects=new e.Dictionary(!0)),e.animatedObjects.add(n,!0)}function _o(t){if(n.tweenStates&&n.tweenStates[t]&&delete n.tweenStates[t],!zot(n.zimTweens)&&!zot(n.zimTweens[t])){n.zimX=null,n.zimY=null,Lo(n.zimTweens[t].zimObj),n.zimTweens[t].paused=!0,Yo(t);var o=n.zimTweens[t].zimIdSet;if(!zot(o)&&n.zimIdSets){var r=n.zimIdSets[o];r&&r.splice(r.indexOf(t),1),r&&0==r.length&&(delete n.zimIdSets[o],e.isEmpty(n.zimIdSets)&&delete n.zimIdSets)}if("Pen"==n.type&&n.zimOnPath&&(n.stop(),n.zimOnPath=!1),delete n.zimTweens[t],n.zimLastObj=null,e.isEmpty(n.zimTweens)&&n.stopAnimate(null,null,null,!1,!0),n.zimTweens&&n.zimTweens[t]||n.zimIdSets&&n.zimIdSets[o||t]);else if(e.idSets&&e.idSets[o||t]){e.idSets[o||t];var i=e.idSets[o||t].indexOf(n);i>=0&&e.idSets[o||t].splice(i,1),e.idSets[o||t].length<=0&&(delete e.idSets[o||t],e.isEmpty(e.idSets)&&delete e.idSets)}}}function Yo(t){!function(){var o=n.zimTweens[t].zimTicker;if(n.zimTweens[t].extraTickers)for(var r=0;r<n.zimTweens[t].extraTickers.length;r++)e.Ticker.remove(n.zimTweens[t].extraTickers[r]);n.zimTweens[t].requestID&&cancelAnimationFrame(n.zimTweens[t].requestID),o&&setTimeout((function(){o&&e.Ticker.remove(o),o=null}),200)}()}function Xo(t,o){var r=n.zimTweens[t];r.paused=o,o!=r.zimPaused&&(r.zimPaused=o,o?r.zimTicker&&(r.zimAnimateTimeout=setTimeout((function(){e.Ticker.remove(r.zimTicker)}),200)):(r.startPaused=!1,clearTimeout(r.zimAnimateTimeout),r.zimTicker&&(r.zimTicker=e.Ticker.add(r.zimTicker,Le))))}function Ro(e){for(var t=[],o=0;o<e.length;o++)n.zimIdSets&&!zot(n.zimIdSets[e[o]])?t=t.concat(n.zimIdSets[e[o]]):t.push(e[o]);return t}function Ho(e,t){!0===t?Gt.push({outputProp:fe[e]}):Array.isArray(t)?Gt.push({outputProp:fe[e],outputMin:t[0],outputMax:t[1],inputMin:t[2],inputMax:t[3]}):Gt.push({outputProp:fe[e],outputMax:t})}function Fo(){if(ve.requestID=requestAnimationFrame(Fo),H&&(!ve.startPaused||0!=n.percentSpeed)){ve.startPaused=!1,ve!=eo&&(eo=ve,ve.currentTime=0,n.pauseAnimate(!0,Y,null,!0),n.paused=!1,n.animating=!0,oo=!Q&&!U&&!c&&!Tt&&M.loop),oo&&(ve.currentTime+=1e4*no,ve.setPosition(ve.currentTime,!0),oo=!1);var t=ve.currentTime+to*n.percentSpeed/100;ro&&0==c&&(t=e.constrain(t,0,ro)),ve.currentTime=t,ve.setPosition(ve.currentTime),(Re||Ge||qe||Qe)&&Vt(),Le.update()}}},e.stopAnimate=function(t,o){var n;if(z_d("45.12"),zot(t)){if(e.animatedObjects)for(n=e.animatedObjects.length-1;n>=0;n--)e.animatedObjects.objects[n].stopAnimate(null,o)}else if(Array.isArray(t)||(t=[t]),e.idSets)for(var r=0;r<t.length;r++){var i=t[r];if(e.idSets[i])for(n=e.idSets[i].length-1;n>=0;n--)e.idSets[i][n].stopAnimate(i,o)}},e.stopZimAnimate=function(t){z_d("45.1"),e.stopAnimate(t)},e.pauseAnimate=function(t,o){var n;if(z_d("45.22"),zot(t)&&(t=!0),zot(o)||"pauseOnBlur"==o){if(e.animatedObjects)for(n=e.animatedObjects.length-1;n>=0;n--)e.animatedObjects.objects[n].pauseAnimate(t,o)}else if(Array.isArray(o)||(o=[o]),e.idSets)for(var r=0;r<o.length;r++){var i=o[r];if(e.idSets[i])for(n=e.idSets[i].length-1;n>=0;n--)e.idSets[i][n].pauseAnimate(t,i)}},e.pauseZimAnimate=function(t,o){z_d("45.2"),e.pauseAnimate(t,o)},e.wiggle=function(n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y){var v,b="target, property, baseAmount, minAmount, maxAmount, minTime, maxTime, totalTime, type, ease, integer, id, startType, ticker, wait, pauseOnBlur";if(v=zob(e.wiggle,arguments,b))return v;if(z_d("45.25"),zot(n)||zot(i)||zot(a))return n;zot(l)&&(l=a);var w=t(s,null,40);zot(s)&&(s="s"==w?1:1e3),zot(c)&&(c=s),o(c,w,40),zot(h)&&(h="quadInOut"),zot(g)&&(g=!1),zot(p)&&(p=e.makeID()),zot(d)&&(d="both"),zot(f)&&(f="both"),zot(m)&&(m=!0),zot(z)&&(z=0),o(u,w,40),zot(u)||(n.wiggleTimeout=setTimeout((function(){n.stopAnimate(p),n.dispatchEvent("wigglestop")}),u*("s"==w?1e3:1)));var C,x=0;function k(){var t,o=e.rand(e.Pick.choose(s),e.Pick.choose(c),!1),u={},m={};m[r]=e.Pick.choose(i),t="negative"==d||0==x&&"negative"==f?-e.rand(e.Pick.choose(a),e.Pick.choose(l),g):"positive"==d||0==x&&"positive"==f?e.rand(e.Pick.choose(a),e.Pick.choose(l),g):0==x?e.rand(e.Pick.choose(a),e.Pick.choose(l),g,!0):e.rand(e.Pick.choose(a),e.Pick.choose(l),g)*e.sign(C)*-1,u[r]=e.Pick.choose(i)+t,0==x&&(o/=2),C=t,x++;var v=n.futureRate;"negative"==d||"positive"==d?e.animate({target:n,obj:u,set:m,ease:h,time:2*o,wait:zik(z),rewind:!0,override:!1,call:k,id:p,ticker:!!n.stage,timeCheck:!1,pauseOnBlur:y}):e.animate({target:n,obj:u,ease:h,time:o,wait:zik(z),override:!1,call:k,id:p,ticker:!!n.stage,timeCheck:!1,pauseOnBlur:y}),v&&(n.futureRate=v)}return n.addTo&&!n.stage?n.added(k):k(),n},e.loop=function(t,o,n,r,i,a){var l,s="obj, call, reverse, step, start, end";if(l=zob(e.loop,arguments,s))return l;if(e.zimLoopCheck||z_d("45.3"),e.zimLoopCheck=!0,!zot(t)&&!zot(o)){zot(n)&&(n=!1),(zot(r)||r<=0)&&(r=1),t.constructor===Number&&(t=Number(t)),t.constructor===String&&(t=String(t));var c="number"==typeof t?"number":t.constructor===Array?"array":t.constructor==={}.constructor?"object":t instanceof NodeList?"nodelist":"string"==typeof t?"string":t instanceof HTMLCollection?"htmlcollection":"invalid";if("container"!=c||t.addChild){var u,d,h,g;if("number"==c||"string"==c||"array"==c||"nodelist"==c||"htmlcollection"==c){if(0==(h=f((u="number"==c?t:t.length)-1)))return;if(n){for(d=i;d>=a;d-=r)if(void 0!==(g="number"==c?o(d,h,i,a,t):o("array"==c||"string"==c?t[d]:t.item(d),d,h,i,a,t)))return g}else for(d=i;d<=a;d+=r)if(void 0!==(g="number"==c?o(d,h,i,a,t):o("array"==c||"string"==c?t[d]:t.item(d),d,h,i,a,t)))return g;return!0}if("object"==c){u=0;var p=[];for(d in t)u++,p.push(d);if(0==(h=f(u-1)))return;if(n){for(d=i;d>=a;d-=r)if(void 0!==(g=o(p[d],t[p[d]],d,h,i,a,t)))return g}else for(d=i;d<=a;d+=r)if(void 0!==(g=o(p[d],t[p[d]],d,h,i,a,t)))return g;return!0}if(0!=(h=f(t.numChildren-1))){if(n){for(d=i;d>=a;d-=r)if(void 0!==(g=o(t.getChildAt(d),d,h,i,a,t)))return g}else for(d=i;d<=a;d+=r)if(void 0!==(g=o(t.getChildAt(d),d,h,i,a,t)))return g;return!0}}}function f(e){return zot(i)&&(i=n?e:0),zot(a)&&(a=n?0:e),n&&a>i||!n&&i>a||(i<0&&a)<0||i>e&&a>e?0:(i=Math.max(0,Math.min(i,e)),a=Math.max(0,Math.min(a,e)),Math.floor((n?i-a:a-i)/r)+1)}},e.scaleTo=function(t,o,n,r,i,a,l){var s,c="obj, boundObj, percentX, percentY, type, boundsOnly, simple";if(s=zob(e.scaleTo,arguments,c))return s;if("AC"==t.type&&WW.zdf)return WW.zdf.ac("scaleTo",arguments),t;if(z_d("43"),zot(o)&&(o=WW.zdf&&WW.zdf.stage?WW.zdf.stage:null),zot(t)||!t.getBounds||!t.getBounds())return zog("zim methods - scaleTo(): please provide an object (with setBounds) to scale"),t;if(zot(o)||!o.getBounds||!o.getBounds())return zog("zim methods - scaleTo(): please provide a boundObject (with setBounds) to scale to"),t;zot(n)&&(n=-1),zot(r)&&(r=-1),-1==n&&-1==r&&(n=r=100,zot(i)&&(i="fill")),zot(i)&&(i="fit"),"smallest"==i?i="fit":"biggest"==i||"outside"==i||"largest"==i?i="fill":"both"!=i&&"stretch"!=i||(i="full"),zot(a)&&(a=!1),zot(l)&&(l=!1);var u,d,h,g=o.getBounds().width*n/100*(a?1:o.scaleX),p=o.getBounds().height*r/100*(a?1:o.scaleY);if("Stage"!=o.type&&"StageGL"!=o.type||(g=o.width*n/100,p=o.height*r/100),l)u=t.getBounds().height,d=t.getBounds().width;else{var f=e.boundsToGlobal(t);u=f.height/t.scaleX,d=f.width/t.scaleY,(isNaN(u)||isNaN(d)||u>5e3)&&(u=t.getBounds().height,d=t.getBounds().width)}return-1!=n&&-1!=r||"full"==i?"full"==i?(t.scaleX=-1!=n?g/d:t.scaleX,t.scaleY=-1!=r?p/u:t.scaleY,t):(h="fill"==i?Math.max(g/d,p/u):Math.min(g/d,p/u),e.sca(t,h),t):(-1==n?e.sca(t,p/u):e.sca(t,g/d),t)},e.fit=function(t,o,n,r,i,a){var l,s="obj, left, top, width, height, type";if(l=zob(e.fit,arguments,s))return l;if("AC"==t.type&&WW.zdf)return WW.zdf.ac("fit",arguments),t;if(z_d("46"),!zot(t)&&t.getBounds){if(t.getBounds()){if(zot(o)){if(!t.stage)return void zogy("zim methods - fit(): please add boundary dimensions or add obj to stage first");if(!t.stage.getBounds())return void zogy("zim methods - fit(): please add boundary dimensions or add obj with bounds to stage first");var c=t.stage.getBounds().width,u=t.stage.getBounds().height;o=0,n=0,r=c,i=u}!0===a?a="fit":!1===a&&(a="fill"),zot(a)&&(a="fit"),t.scaleX=t.scaleY=1;var d,h,g,p,f,m=r,z=i,y=t.getBounds().width,v=t.getBounds().height;return"full"==a?(t.scaleX=g=m/y,t.scaleY=p=z/v,d=m,h=z):("fit"==a?f=m/z>=y/v?z/v:m/y:"fill"==a&&(f=m/z>=y/v?m/y:z/v),g=p=f),t.scaleX=g,t.scaleY=p,d=y*g,h=v*p,t.x=(t.regX-t.getBounds().x)*g+o+(m-d)/2,t.y=(t.regY-t.getBounds().y)*p+n+(z-h)/2,{x:t.x,y:t.y,width:d,height:h,scale:f,scaleX:g,scaleY:p,bX:o,bY:n,bWidth:r,bHeight:i}}zogy("zim methods - fit(): please setBounds() on object")}},e.boundsCheck=!1,e.boundsToGlobal=function(t,o,n,r,i){if(e.boundsCheck||(z_d("40"),e.boundsCheck=!0),!zot(t)&&t.getBounds){if(zot(n)&&(n=!1),i&&!t.getBounds&&!t.getBounds())return t;var a=t.getBounds();if(a||!zot(o)){var l,s,c,u;o&&(a=o),i&&i.type&&("Stage"==i.type||"StageGL"==i.type)?(l=t.localToLocal(a.x,a.y,i),s=t.localToLocal(a.x+a.width,a.y,i),c=t.localToLocal(a.x+a.width,a.y+a.height,i),u=t.localToLocal(a.x,a.y+a.height,i)):n?(l=t.globalToLocal(a.x,a.y),s=t.globalToLocal(a.x+a.width,a.y),c=t.globalToLocal(a.x+a.width,a.y+a.height),u=t.globalToLocal(a.x,a.y+a.height)):(l=t.localToGlobal(a.x,a.y),s=t.localToGlobal(a.x+a.width,a.y),c=t.localToGlobal(a.x+a.width,a.y+a.height),u=t.localToGlobal(a.x,a.y+a.height));var d=Math.min(l.x,s.x,c.x,u.x),h=Math.min(l.y,s.y,c.y,u.y),g=Math.max(l.x,s.x,c.x,u.x),p=Math.max(l.y,s.y,c.y,u.y);return new createjs.Rectangle(d,h,g-d,p-h)}zogy("zim methods - boundsToGlobal():\n please setBounds() on object (or a rectangle)")}},e.resetBounds=function(t,o,n,r,i,a){var l,s,c,u,d,h="obj, a, b, c, d, margin";return(l=zob(e.resetBounds,arguments,h))?l:(z_d("40.5"),zot(r)?(s=0,c=o,u=0,d=n):(s=o,c=r,u=n,d=i),zot(d)&&(d=c),zot(o)?t.setBounds(null):t.setBounds(s,u,c,d),a&&(n=t.getBounds())&&t.setBounds(n.x-a,n.y-a,n.width+2*a,n.height+2*a),t)},e.copyMatrix=function(e,t){return z_d("45.5"),e.x=t.x,e.y=t.y,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.regX=t.regX,e.regY=t.regY,e.rotation=t.rotation,e.skewX=t.skewX,e.skewY=t.skewY,e},e.duplicate=function(e,t){z_d("45.6");var o=e.clone(t);for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&null==o[n]){if("parent"==n)continue;if("zimTouch"==n)continue;o[n]=e[n]}return o},e.expand=function(t,o,n,r,i){var a,l,s,c="obj, padding, paddingVertical, paddingRight, paddingBottom";if(a=zob(e.expand,arguments,c))return a;if(z_d("50"),zot(t)||!t.getBounds||!t.getBounds())return zogy("zim methods - expand(): please provide object with bounds set"),t;zot(o)&&(o=20),zot(n)&&(n=o),zot(r)&&zot(i)?(l=r=o,s=i=n):(zot(r)&&(r=o),zot(i)&&(i=n),l=o,s=n);var u=t.getBounds(),d=new createjs.Shape;return d.graphics.f("0").r(u.x-l,u.y-s,u.width+l+r,u.height+s+i),t.hitArea=d,t},e.setSwipe=function(e,t){if(z_d("34"),!zot(e)&&e.on)return e.zimNoSwipe=!t||null,e instanceof createjs.Container&&function t(o){for(var n,r=o.numChildren,i=0;i<r;i++)(n=o.getChildAt(i)).zimNoSwipe=e.zimNoSwipe,n instanceof createjs.Container&&t(n)}(e),e},e.setMask=function(t,o,n){if(z_d("50.1"),zot(t)&&zogy("zim methods - setMask(): please provide obj"),zot(o))return a(),t;var r,i=t.stage||(WW.zdf?WW.zdf.stage:null);function a(){t.zimMask&&t.zimMask.parent&&t.zimMask.parent.removeChild(t.zimMask),t.zimMask=null,t.zimMaskTicker&&e.Ticker.remove(t.zimMaskTicker),t.mask=null}function l(){if(n&&(!i||!o.stage))return t;if(r&&r.dispose&&r.dispose(),r=null,t.zimMask=o.zimMask=r=o.shape.clone(),e.copyMatrix(r,o),o.addChildAt(r,0),r.alpha=0,t.parent){var a=o.getConcatenatedMatrix().decompose(),l=t.parent.getConcatenatedMatrix().decompose();r.scaleX=a.scaleX/l.scaleX,r.scaleY=a.scaleY/l.scaleY,r.rotation=(a.rotation?a.rotation:0)-(l.rotation?l.rotation:0);var s=o.localToLocal(o.shape.x+o.regX,o.shape.y+o.regY,t.parent);r.x=s.x,r.y=s.y,t.mask=r}else t.mask=r}return t.zimMaskOriginal&&t.zimMaskOriginal!=o&&a(),zot(n)&&(n=!("Blob"!=o.type&&zot(o.zimDown)&&zot(o.transformControls)&&zot(o.zimTouch)&&zot(o.zimTweens)),o.zimMaskDynamic=n),t.zimMaskOriginal=o,o.zimMaskApply=function(){t.zimMaskTicker&&e.Ticker.remove(t.zimMaskTicker),t.zimMaskTicker=e.Ticker.add(l)},o&&o.shape?(l(),n&&o.zimMaskApply()):(r=o,t.mask=r),t},e.outline=function(t,o,n,r){var i,a="obj, color, size, boundsOnly";if(i=zob(e.outline,arguments,a))return i;if("AC"==t.type&&WW.zdf)return WW.zdf.ac("outline",arguments),t;if(z_d("47"),t.type&&"zimOultineShape"==t.type)return zon&&zogy("zim.outline() - warning, you are trying to outline an outline - do not outline in a loop"),t;if(zot(t)||!t.getBounds)return zogy("zim methods - outline(): please provide object with bounds set"),t;if(!t.getBounds())return zogy("zim methods - outline(): please setBounds() on object"),t;if(!t.parent)return zogy("zim methods - outline(): object should be on stage first"),t;if(zot(o)&&(o="brown"),zot(n)&&(n=2),n<=0)return t.ZIMoutlineShape&&t.ZIMoutlineShape.parent.removeChild(t.ZIMoutlineShape),t.ZIMoutlineShapeC&&t.ZIMoutlineShapeC.parent.removeChild(t.ZIMoutlineShapeC),void(t.ZIMoutlineShape=t.ZIMoutlineShapeC=null);var l=t.getBounds(),s=t.ZIMoutlineShape=t.ZIMoutlineShape?t.ZIMoutlineShape:new e.Shape;s.type="zimOutlineShape";var c=t.ZIMoutlineShapeC=t.ZIMoutlineShapeC?t.ZIMoutlineShapeC:new e.Shape;c.type="zimOutlineShape";var u=t.parent;t.outlineToggled=!0,t.outlineToggle=function(e){return!0===e?(t.ZIMoutlineShape.visible=!0,t.ZIMoutlineShapeC.visible=!0):!1===e?(t.ZIMoutlineShape.visible=!1,t.ZIMoutlineShapeC.visible=!1):(t.ZIMoutlineShape.visible=!t.ZIMoutlineShape.visible,t.ZIMoutlineShapeC.visible=!t.ZIMoutlineShapeC.visible),t.outlineToggled=t.ZIMoutlineShape.visible,t};var d=t.localToLocal(l.x,l.y,u),h=t.localToLocal(l.x+l.width,l.y,u),g=t.localToLocal(l.x+l.width,l.y+l.height,u),p=t.localToLocal(l.x,l.y+l.height,u),f=t.localToLocal(0,0,u),m=s.graphics.c(),z=c.graphics.c();if(m.s(o).ss(n).mt(d.x,d.y).lt(h.x,h.y).lt(g.x,g.y).lt(p.x,p.y).lt(d.x,d.y).cp(),!r){var y=10,v=y+1;z.s("white").ss(n+2),z.mt(-v,0).lt(v,0),z.mt(0,-v).lt(0,v),z.s(o).ss(n),z.mt(-y,0).lt(y,0),z.mt(0,-y).lt(0,y),z.cp(),c.x=f.x,c.y=f.y,c.rotation=t.rotation,m.s("white").ss(n+2).dc(t.x,t.y,y+6),m.s(o).ss(n).dc(t.x,t.y,y+6)}t.parent.removeChild(s),t.parent.removeChild(c);var b=t.parent.getChildIndex(t);return t.parent.addChildAt(c,b+1),t.parent.addChildAt(s,b+1),s.mouseEnabled=!1,c.mouseEnabled=!1,t},e.blendmodes=function(t,o,n){z_d("47.05"),zot(o)&&(o=1);var r=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"];!1===n&&r.push("source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","copy","xor");var i=0,a=e.interval(o,(function(){var e=r[i%r.length];i++,t.ble(e),zogb(e),t.stage&&t.stage.update()}));return t.on("mousedown",(function(){a.pause(!a.paused)})),t},e.STYLE=null,e.ignore="ignore",e.getStyle=function(t,o,n){e.STYLECHECK||(z_d("50.34"),e.STYLECHECK=!0);var r,i,a=["pos","addTo","center","centerReg","mov","drag","transform","gesture","outline","bounds","animate","wiggle","cache"],l=WW.STYLE||e.STYLE,s=l;for(var c in l&&l.type&&"string"==typeof l.type&&(l.ttype=l.type,delete l.type),l)r=l[c],c.match(/^[(A-Z)]/)&&(l.type||(l.type={}),l.type[c]?l.type[c]=e.merge(l.type[c],r):l.type[c]=r,delete l[c]);if(s=zot(s)?{}:e.copy(s),zot(n))n={};else for(i=0;i<a.length;i++)delete n[a[i]];var u=n,d=s.type;if(d&&delete s.type,!zot(o)&&!zot(s.group)){var h=o.split(","),g={};for(i=0;i<h.length;i++){var p=h[i].trim();zot(s.group[p])||(g=e.merge(g,s.group[p]))}delete s.group}for(var f in zot(t)||zot(d)||zot(d[t])||(s=e.merge(s,d[t])),zot(o)||zot(g)||(s=e.merge(s,g)),s)if(u[f])delete s[f];else if("ignore"!=(r=-1!=a.indexOf(f)||s.delayPick?s[f]:e.Pick.choose(s[f]))){var m;for(var z in r&&r.constructor==={}.constructor&&(r=e.copy(r,!0,!1)),s)(m=z.match(/^(.+)gColor$/))&&(s[m[1]+"ackgroundColor"]=s[z],delete s[z]);s[f]=r}else delete s[f];return(s=e.merge(s,u)).ttype&&!s.type&&(s.type=s.ttype,delete s.ttype),!1===s.style?{}:s},e.styleTransforms=function(t,o){var n,r=["visible","x","y","scale","scaleX","scaleY","rotation","alpha","skewX","skewY","regX","regY","blendMode"];if(o){for(o.add&&t.addTo(),o.addTo&&t.addTo(!0===o.addTo?null:o.addTo),o.center&&t.center(!0===o.center?null:o.center),o.centerReg&&t.centerReg(!0===o.centerReg?null:o.centerReg),n=0;n<r.length;n++)null!=o[r[n]]&&(t[r[n]]=e.Pick.choose(o[r[n]]));if(o.bounds&&o.bounds.constructor==={}.constructor&&t.setBounds(o.bounds.x?o.bounds.x:0,o.bounds.y?o.bounds.y:0,o.bounds.width?o.bounds.width:100,o.bounds.height?o.bounds.height:100),null!=o.x&&(o.loc?null==o.loc.x&&(o.loc.x=o.x):o.loc={x:o.x}),null!=o.y&&(o.loc?null==o.loc.y&&(o.loc.y=o.y):o.loc={y:o.y}),o.loc&&(o.loc.constructor==={}.constructor?t.loc(e.Pick.choose(o.loc.x),e.Pick.choose(o.loc.y)):t.loc(e.Pick.choose(o.loc))),o.pos)if(o.pos.constructor==={}.constructor)t.pos(e.Pick.choose(o.pos.x),e.Pick.choose(o.pos.y),e.Pick.choose(o.pos.right),e.Pick.choose(o.pos.bottom),e.Pick.choose(o.pos.container),e.Pick.choose(o.pos.index),o.pos.add,e.Pick.choose(o.pos.reg),e.Pick.choose(o.pos.regX),e.Pick.choose(o.pos.regY));else{var i=e.Pick.choose(o.pos);"left"!=i&&"top"!=i||t.pos(),"right"==i&&t.pos({right:!0}),"bottom"==i&&t.pos({bottom:!0}),"rightbottom"!=i&&"bottomright"!=i||t.pos({right:!0,bottom:!0}),"center"==i&&t.center()}if((o.mov||o.move)&&(o.move&&(o.mov=o.move),o.mov.constructor==={}.constructor?t.mov(e.Pick.choose(o.mov.x),e.Pick.choose(o.mov.y)):t.mov(e.Pick.choose(o.mov))),o.outline&&setTimeout((function(){t.outline(o.outline.constructor==={}.constructor?o.outline:null),t.stage&&t.stage.update()}),20),o.drag&&t.drag(o.drag.constructor==={}.constructor?o.drag:{currentTarget:!0}),o.gesture&&t.gesture(o.gesture.constructor==={}.constructor?o.gesture:null),o.transform&&setTimeout((function(){t.transform(o.transform.constructor==={}.constructor?o.transform:null)}),20),o.animate)for(Array.isArray(o.animate)||(o.animate=[o.animate]),n=0;n<o.animate.length;n++)!function(){var e=o.animate[n];e.constructor==={}.constructor&&setTimeout((function(){t.animate(e)}),20)}();if(o.wiggle)for(Array.isArray(o.wiggle)||(o.wiggle=[o.wiggle]),n=0;n<o.wiggle.length;n++)!function(){var e=o.wiggle[n];e.constructor==={}.constructor&&setTimeout((function(){t.wiggle(e)}),20)}();o.expand&&t.expand(!0===o.expand?null:o.expand),o.cache&&(o.cache.constructor==={}.constructor?o.cache.x?t.cache(e.Pick.choose(o.cache.x),e.Pick.choose(o.cache.y),e.Pick.choose(o.cache.x),e.Pick.choose(o.cache.y)):t.cache(e.Pick.choose(o.cache.width),e.Pick.choose(o.cache.height)):t.cache());var a=WW.STYLE||e.STYLE;!a||!0!==a.once&&a.once!=t.type||(WW.STYLE?WW.STYLE={}:e.STYLE={})}},e.Style={remembered:{},clear:function(){return WW.STYLE&&(WW.STYLE={}),e.STYLE&&(e.STYLE={}),e.Style},clearTypes:function(){return delete(WW.STYLE||e.STYLE).types,e.Style},clearGroups:function(){return delete(WW.STYLE||e.STYLE).groups,e.Style},remember:function(t){zot(t)&&(t="default");var o=WW.STYLE||e.STYLE;return o||(o=zns?e.STYLE={}:WW.STYLE={}),e.Style.remembered[t]=e.copy(o,!0),e.Style},clearRemembered:function(t){return zot(t)?e.Style.remembered={}:delete e.Style.remembered[t],e.Style},recall:function(t){return zot(t)&&(t="default"),WW.STYLE?WW.STYLE=e.Style.remembered[t]:e.STYLE=e.Style.remembered[t],e.Style},add:function(t){var o=WW.STYLE||e.STYLE;return o||(o=zns?e.STYLE={}:WW.STYLE={}),WW.STYLE?WW.STYLE=e.merge(o,t):e.STYLE=e.merge(o,t),e.Style},addType:function(t,o){var n=WW.STYLE||e.STYLE;return n||(n=zns?e.STYLE={}:WW.STYLE={}),n.type||(n.type={}),n.type[t]=o,e.Style},addGroup:function(t,o){var n=WW.STYLE||e.STYLE;return n||(n=zns?e.STYLE={}:WW.STYLE={}),n.group||(n.group={}),n.group[t]=o,e.Style},remove:function(t){var o=WW.STYLE||e.STYLE;return o||(o=zns?e.STYLE={}:WW.STYLE={}),delete o[t],e.Style},removeType:function(t){var o=WW.STYLE||e.STYLE;return o||(o=zns?e.STYLE={}:WW.STYLE={}),o.type?(delete o.type[t],e.Style):e.Style},removeGroup:function(t){var o=WW.STYLE||e.STYLE;return o||(o=zns?e.STYLE={}:WW.STYLE={}),o.group?(delete o.group[t],e.Style):e.Style}},e.PATH=null,e.TIME="seconds",e.TIMECHECK=!1,e.DIR="ltr",e.SEEDRAND=null,e.SEEDRANDCOUNT=0,e.ANIMATE=!0,e.OPTIMIZE=!1,e.ACTIONEVENT="mousedown",e.DEFAULTWIRE="currentValue",e.KEYFOCUS=null,e.POSREG=!1,e.DRAGALL=!1,e.MOBILE="default",e.Ticker={stages:null,myUpdate:null,alwaysList:new e.Dictionary,list:new e.Dictionary,wire:new e.Dictionary,setFPS:function(t,o){zot(t)&&zot(o)?(t=60,o=60):zot(t)?t=60:zot(o)&&(o=t),e.Ticker.framerate=createjs.Ticker.framerate=e.mobile()?t:o},setTimingMode:function(e){createjs.Ticker.timingMode=createjs.Ticker.RAF,"synched"==e&&(createjs.Ticker.timingMode=createjs.Ticker.RAF_SYNCHED),"timeout"==e&&(createjs.Ticker.timingMode=createjs.Ticker.TIMEOUT)},add:function(t,o){z_d("30");var n=e.Ticker;return n.has(t,o)?t:(!zot(o)&&o.update||(o=WW.zdf.stage),zot(t)||"function"!=typeof t?void zogy("zim.Ticker.add() - only add functions"):(n.list.at(o)?n.list.at(o).push(t):n.list.add(o,[t]),n.ticker||(n.ticker=createjs.Ticker.on("tick",n.call)),n.framerate||n.setFPS(),t))},addWire:function(t,o){if(z_d("30"),zot(o[0]))return t;var n=e.Ticker;n.wire.add(t,o);var r=o[0][o[1]];return o[4]&&(r=o[4](r,"from")),o[3]&&(t[o[6]]=o[7]=r),n.ticker||(n.ticker=createjs.Ticker.on("tick",n.call)),n.framerate||n.setFPS(),t},rawID:{},raw:function(t){z_d("30");var o=e.makeID(7,"letters");return function n(r){t(r),e.Ticker.rawID[o]=requestAnimationFrame(n)}(),o},removeRaw:function(t){cancelAnimationFrame(e.Ticker.rawID[t]),delete e.Ticker.rawID[t]},call:function(t){var o,n,r,i=e.Ticker,a=[];for(r=0;r<i.list.length;r++){o=i.list.objects[r],n=i.list.values[r];for(var l=0;l<n.length;l++)n[l](t);var s=!1;i.alwaysList.at(o)?s=!0:n.length>0&&(!zot(i.update)||e.OPTIMIZE||!zns&&WW.OPTIMIZE?i.update&&(s=!0):s=!0),s&&a.indexOf(o)<0&&a.push(o)}for(r=i.wire.length-1;r>=0;r--){var c=i.wire.objects[r],u=i.wire.values[r];if(u){var d=c[u[6]];d!=u[7]&&(u[4]&&(d=u[4](d,"to",u[7])),u[0][u[1]]=u[7]=d,u[5]&&u[5](d),(o=u[0].stage)&&a.indexOf(o)<0&&a.push(o)),u[2]&&u[0]&&(d=u[0][u[1]],u[7]!=d&&(u[4]&&(d=u[4](d,"from",u[7])),c[u[6]]=u[7]=d,u[5]&&u[5](d),(o=c.stage)&&a.indexOf(o)<0&&a.push(o)))}}if(0==i.list.length)for(r=0;r<i.alwaysList.length;r++)o=i.alwaysList.objects[r],a.indexOf(o)<0&&a.push(o);var h=a.length;for(r=0;r<h;r++)a[r].update()},always:function(t){z_d("30");var o=e.Ticker;o.framerate||o.setFPS(),!zot(t)&&t.update||(t=WW.zdf.stage),o.alwaysList.add(t,!0),o.ticker||(o.ticker=createjs.Ticker.on("tick",o.call))},alwaysOff:function(t){var o=e.Ticker;!zot(t)&&t.update||(t=WW.zdf.stage),o.alwaysList.remove(t)},remove:function(t){var o=e.Ticker;if(zot(t)||"function"!=typeof t)zogy("zim.Ticker - only remove functions");else{for(var n=0;n<o.list.length;n++){var r=o.list.values[n].indexOf(t);r>-1&&o.list.values[n].splice(r,1)}o.alwaysList.length>0||o.list.length>0||o.wire.length>0||(createjs.Ticker.off("tick",o.ticker),o.ticker=null)}},removeAll:function(t){for(var o,n=e.Ticker,r=0;r<n.list.length;r++)o=n.list.objects[r],(zot(t)||t===o)&&(n.list.values[r]=[]);n.alwaysList.length>0||n.list.length>0||n.wire.length>0||(createjs.Ticker.off("tick",n.ticker),n.ticker=null)},removeWire:function(t,o,n,r){var i=e.Ticker;if(zot(t)&&zot(o)&&zot(n)&&zot(r))i.wire.clear();else for(var a=i.wire.length-1;a>=0;a--){var l=i.wire.objects[a],s=i.wire.values[a];s&&(t&&l!=t||o&&s[0]!=o||n&&s[1]!=n||r&&s[6]!=r||(i.wire.objects.splice(a,1),i.wire.values.splice(a,1)))}i.alwaysList.length>0||i.list.length>0||i.wire.length>0||(createjs.Ticker.off("tick",i.ticker),i.ticker=null)},has:function(t,o){return!zot(o)&&o.update||(o=WW.zdf.stage),e.Ticker.list&&e.Ticker.list.at(o)&&e.Ticker.list.at(o).indexOf(t)>=0},dispose:function(t){for(var o,n=e.Ticker,r=0,i=n.list.length-1;i>=0;i--)o=n.list.objects[i],zot(t)||t===o?(n.list.remove(t),n.alwaysList.remove(t)):r+=n.list.values[i].length;if(!(n.alwaysList.length>0))return 0==r&&(createjs.Ticker.off("tick",n.ticker),n.ticker=null),!0}},e.Ticker.setFPS(),Object.defineProperty(e.Ticker,"update",{get:function(){return e.Ticker.myUpdate},set:function(t){var o=e.Ticker;"boolean"!=typeof t&&(t=null),o.myUpdate=t,!1===o.myUpdate&&(cancelAnimationFrame(o.ticker),o.alwaysList=new e.Dictionary)}}),e.Pages=function(o,n,r,i,a,l,s,c,u){var d,h="pages, transition, speed, transitionTable, holder, arrowDisableColor, style, group, inherit";if(d=zob(e.Pages,arguments,h,this))return d;z_d("71"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Pages",this.group=c;var g=!1===s?{}:e.getStyle(this.type,this.group,u),p=t(r);if(zot(o)&&(o=null!=g.pages?g.pages:[]),this.pages=o,zot(n)&&(n=null!=g.transition?g.transition:"none"),zot(r)&&(r=null!=g.speed?g.speed:"s"==p?.2:200),zot(i)&&(i=null!=g.transitionTable?g.transitionTable:[]),this.transitionTable=i,zot(l)&&(l=null!=g.arrowDisableColor?g.arrowDisableColor:e.grey),this.arrowDisableColor=l,zot(a)&&(a=null!=g.holder?g.holder:null),zot(a)&&WW.zdf&&(a=WW.zdf.stage),a.getBounds&&a.getBounds()){this.speed=r,this.active=!0;var f=this;f.transitioning=!1;var m,z,y=a.getBounds().width,v=a.getBounds().height;"none"==n&&i==[]||W();var b,w,C,x=["left","right","up","down"],k=!0;for(C=0;C<o.length;C++)(b=o[C]).constructor!={}.constructor&&(b=o[C]={page:o[C]}),b.swipe&&(k=!1);for(C=0;C<o.length;C++){if((b=o[C]).constructor!=={}.constructor&&(b=o[C]={page:o[C]}),k){var T=o[C-1],A=o[C+1];b.swipe=[T?T.page:null,A?A.page:null]}M(b.page,b.swipe)}var P,B=this.page=o[0]?o[0].page:null;zot(this.page)||(this.index=0),this.addChild(B),O(B),this.swipe=new e.Swipe(a);var E=!1,I=this.swipe.on("swipe",(function(e){if(f.active){var t=e.currentTarget.direction;if("none"!=t){var o="";"left"==t?o="right":"right"==t?o="left":"up"==t?o="down":"down"==t&&(o="up"),t=o;var n=x.indexOf(t);w=B.zimSwipeArray[n],P=[w,t,null,null,!0],f.page=B,f.nextPage=w,f.direction=t,f.dispatchEvent("swipe"),setTimeout((function(){E||f.go(w,t,null,null,!0)}),50)}}}));this.addPage=function(e,t){M(e,t),f.pages.push({page:e}),B?e.parent&&e.parent.removeChild(e):(B=f.page=e,f.addChild(B))},this.removePage=function(t){j(t),f.currentPage==t&&(f.removeChild(t),a.stage&&a.stage.update()),e.loop(f.pages,(function(e,o){e.page!=t&&e!=t||f.pages.splice(o,1)}),!0),t.zimSwipeArray=null},this.setSwipeArray=function(e,t){zot(t)&&(t=[]);var o={page:e,swipe:t};o.page.zimSwipeArray=o.swipe?o.swipe:[]},this.pause=function(){E=!0},this.unpause=function(){E&&f.go(P[0],P[1],P[2],P[3],P[4])};var S=!0;this.go=function(t,r,i,l,s){if("number"==typeof t){var c=f.pages[t];if(zot(c))return;t=c.page}setTimeout((function(){E=!1}),200);for(var u=[{x:y},{x:-y},{y:v},{y:-v}],d=[{x:y/2,alpha:0},{x:-y/2,alpha:0},{y:v/2,alpha:0},{y:-v/2,alpha:0}],h=n,g=f.speed,p=0;p<f.transitionTable.length;p++)if(f.transitionTable[p][0]==B&&f.transitionTable[p][1]==t){h=f.transitionTable[p][2],zot(f.transitionTable[p][3])||(g=f.transitionTable[p][3]);break}function b(e){e[0].uncache(),e[1].uncache(),f.transitioning=!1,f.dispatchEvent("pagetransitioned"),f.removeChild(f.lastPage),"fan"==i&&("right"==r||"down"==r?(f.lastPage.rotation=0,f.lastPage.regY=0,f.lastPage.mov(0,-f.lastPage.height)):(f.page.rotation=0,f.page.regY=0,f.page.mov(0,-f.lastPage.height))),f.removeChild(m),f.removeChild(z),O(B),S=!0}function w(t){f.removeChild(f.lastPage),e.animate(t.shift(),{alpha:0},f.speed/2,null,b,t)}if(zot(i)&&(i=h),zot(l)&&(l=g),f.speed=l,f.direction=r,""==t||null==t)f.page=B,f.dispatchEvent("nothing");else if("string"==typeof t)f.page=B,f.dispatchEvent(t);else{if(t==B)return;zot(r)&&(r="right");var C,k=x.indexOf(r);if(!S)return;S=!1,t.x=0,t.y=0,t.alpha=t.zimOriginalAlpha;if(["pixelDark","pixelLight","pixelZIM","bubbleDark","bubbleLight","bubbleZIM","lineDark","lineLight","lineZIM"].indexOf(i)>=0){var T=i;C=!0,i="slide"}if(["explodeDark","explodeLight","explodeZIM"].indexOf(i)>=0){var A=i;C=!0,i="fade"}if("Emitter"==i.type&&(C=i,i=i.horizontal||i.vertical?"slide":"fade"),f.transitioning=!0,"slide"==i?(t.x=-(0|u[k].x),t.y=-(0|u[k].y),t.cache(0,0,(y+1)/t.scaleX,(v+1)/t.scaleY),B.cache(0,0,(y+1)/B.scaleX,(v+1)/B.scaleY),f.addChild(t),f.addChild(B),e.animate(B,u[k],f.speed,null,b,[B,t]),e.animate(t,[{x:0},{x:0},{y:0},{y:0}][k],f.speed)):"reveal"==i?(t.cache(0,0,(y+1)/t.scaleX,(v+1)/t.scaleY),B.cache(0,0,(y+1)/B.scaleX,(v+1)/B.scaleY),f.addChild(t),f.addChild(B),e.animate(B,d[k],f.speed,null,b,[B,t])):"fade"==i?(t.cache(0,0,(y+1)/t.scaleX,(v+1)/t.scaleY),B.cache(0,0,(y+1)/B.scaleX,(v+1)/B.scaleY),t.alpha=1,f.addChild(t),f.addChild(B),e.animate(B,{alpha:0},f.speed,null,b,[B,t])):"black"==i?(t.cache(0,0,(y+1)/t.scaleX,(v+1)/t.scaleY),B.cache(0,0,(y+1)/B.scaleX,(v+1)/B.scaleY),t.alpha=1,f.addChild(t),f.addChild(B),m.alpha=0,f.addChild(m),e.animate(m,{alpha:1},f.speed/2,null,w,[m,B,t])):"clear"==i?(t.cache(0,0,(y+1)/t.scaleX,(v+1)/t.scaleY),B.cache(0,0,(y+1)/B.scaleX,(v+1)/B.scaleY),t.alpha=0,f.addChild(t),f.addChild(B),e.animate(B,{alpha:0},f.speed/2),e.animate(t,{alpha:1},f.speed/2,null,b,[B,t],f.speed/2)):"white"==i?(t.cache(0,0,(y+1)/t.scaleX,(v+1)/t.scaleY),B.cache(0,0,(y+1)/B.scaleX,(v+1)/B.scaleY),t.alpha=1,f.addChild(t),f.addChild(B),z.alpha=0,f.addChild(z),e.animate(z,{alpha:1},f.speed/2,null,w,[z,B,t])):"fan"==i?(t.cache(0,0,(y+1)/t.scaleX,(v+1)/t.scaleY),B.cache(0,0,(y+1)/B.scaleX,(v+1)/B.scaleY),t.alpha=1,"right"==r||"down"==r?(f.addChild(t),f.addChild(B),B.regY=B.height,B.mov(0,B.height),e.animate(B,{rotation:-90},f.speed,null,b,[B,t])):(f.addChild(B),f.addChild(t),t.regY=B.height,t.mov(0,B.height),t.rotation=-90,e.animate(t,{rotation:0},f.speed,null,b,[B,t]))):(f.transitioning=!1,f.addChild(t),f.removeChild(B),S=!0),C){var P,I,W=k<2;if(T||"slide"==i){T?("lineDark"==T||"lineLight"==T?P=new e.Rectangle(W?30:y+5,W?v+5:30,"lineDark"==T?e.dark:e.white).alp(.2):"lineZIM"==T?P=new e.Rectangle(W?50:y+5,W?v+5:50,[e.green,e.yellow,e.orange,e.pink,e.blue]).alp(.5):"pixelDark"==T||"pixelLight"==T?P=new e.Rectangle(40,40,e.clear,"pixelDark"==T?e.dark:e.white,2).alp(.7):"pixelZIM"==T?P=new e.Rectangle(40,40,[e.green,e.yellow,e.orange,e.pink,e.blue]).alp(.7):"bubbleDark"==T||"bubbleLight"==T?P=new e.Circle(30,e.clear,"bubbleDark"==T?e.dark:e.white,2).alp(.7):"bubbleZIM"==T&&(P=new e.Circle(30,[e.green,e.yellow,e.orange,e.pink,e.blue]).alp(.7)),P.centerReg({add:!1}),I="lineDark"==T||"lineLight"==T||"lineZIM"==T?new e.Emitter({obj:P,life:.5,decayTime:.5,shrink:!1,force:0,gravity:0,width:0,startPaused:!0}):new e.Emitter({obj:P,num:6,life:.5,decayTime:.5,width:W?0:y,height:W?v:0,vertical:W,horizontal:!W,startPaused:!0})):I=C;var M=[{x:0,y:v/2},{x:y,y:v/2},{x:y/2,y:0},{x:y/2,y:v}],L=[{x:y,y:v/2},{x:0,y:v/2},{x:y/2,y:v},{x:y/2,y:0}];I.centerReg(a).spurt(null,f.speed),I.x=M[k].x,I.y=M[k].y,e.animate(I,L[k],f.speed,null,(function(){T&&I.dispose()}))}else(A||"fade"==i)&&(A?("explodeDark"==A||"explodeLight"==A?P=new e.Circle(150,"explodeDark"==A?e.dark:e.white).alp(.5):"explodeZIM"==A&&(P=new e.Circle(130,[e.green,e.yellow,e.orange,e.pink,e.blue]).alp(.7)),I=new e.Emitter({obj:P,num:5,gravity:0,force:{min:20,max:40},life:.5,shrink:!1,decayTime:.5,startPaused:!0})):I=C,I.centerReg(a).spurt(null,.35*f.speed),I.on("fizzed",(function(){A&&I.dispose()})));a&&"Stage"!=a.type&&"StageGL"!=a.type&&I.particles&&a.shape&&I.particles.setMask(a.shape)}for(a&&a.shape&&I&&I.particles&&I.particles.setMask(a.shape),j(B),f.lastPage=B,f.page=t,f.index=-1,p=0;p<f.pages.length;p++){f.pages[p].page==f.page&&(f.index=p)}"none"==i&&O(t),zot(s)&&(s=!1),f.fromSwipe=s,f.dispatchEvent("page"),B=t,f.setArrows(o.index),a.stage&&a.stage.update()}},a&&a.shape&&(a.mouseChildren=!0,a.mouseEnabled=!0,f.setMask(a.shape)),this.resize=function(){y=a.getBounds().width,v=a.getBounds().height,"none"==n&&i==[]||W()},this.puff=function(e){for(var t=0;t<o.length;t++)f.addChild(o[t].page);f.addChild(B),e>0&&setTimeout((function(){f.settle()}),e*("s"==p?1e3:1))},this.settle=function(){f.removeAllChildren(),f.addChild(B),f.dispatchEvent("puffed")},this.disable=function(){f.active=!1},this.enable=function(){f.active=!0},this.arrows={},this.setArrows=function(){if(!e.isEmpty(f.arrows)){var t=f.pages[f.index];if(t&&t.swipe){var o=t.swipe,n=[e.LEFT,e.RIGHT,e.DOWN,e.UP];e.loop(n,(function(t,n){o[n]?e.loop(f.arrows[t],(function(e){if(!0===e.setDisabled)return e.activate(!1,f.arrowDisableColor),void(e.setDisabled=null);e.enabled||e.activate(!0,e.arrowBackgroundColor)})):e.loop(f.arrows[t],(function(e){if(!1===e.setDisabled)return e.activate(!0,e.arrowBackgroundColor),void(e.setDisabled=null);e.enabled&&e.activate(!1,f.arrowDisableColor)}))})),f.stage&&f.stage.update()}}},!1!==s&&e.styleTransforms(this,g),this.dispose=function(e,t,o){return f.swipe.off("swipe",I),f.swipe.dispose(),o||this.zimContainer_dispose(!0),!0}}else zogy("zim controls - Pages():\nholder object must have bounds set");function W(){(m=new createjs.Shape).graphics.f("black").r(0,0,y,v+1),(z=new createjs.Shape).graphics.f("white").r(0,0,y,v+1)}function M(t,o){t.zimHTMLList=new e.Dictionary,j(t),t.zimSwipeArray=o||[],t.zimOriginalAlpha=t.alpha,t.parent&&t.parent.removeChild(b.page)}function O(e){if(!zot(e))for(C=0;C<e.zimHTMLList.length;C++)e.addChildAt(e.zimHTMLList.values[C].obj,e.zimHTMLList.values[C].depth)}function j(e){var t,o;for(e.zimHTMLList.clear(),o=0;o<e.numChildren;o++)if("TextArea"==(t=e.getChildAt(o)).type||"Loader"==t.type||"Tag"==t.type){var n={obj:t,depth:e.getChildIndex(t)};e.zimHTMLList.add(t,n)}for(o=e.numChildren-1;o>=0;o--)"TextArea"!=(t=e.getChildAt(o)).type&&"Loader"!=t.type&&"Tag"!=t.type||e.removeChild(t)}},e.extend(e.Pages,e.Container,["clone","dispose"],"zimContainer",!1),e.Arrow=function(t,o,n,r,i,a,l,s,c,u,d){var h,g="backgroundColor, rollBackgroundColor, pages, direction, type, newPage, trans, speed, style, group, inherit";if(h=zob(e.Arrow,arguments,g,this))return h;z_d("71.2"),this.group=u;var p,f,m,z,y,v=!1===c?{}:e.getStyle("Arrow",this.group,d);zot(r)&&(r=null!=v.direction?v.direction:"right"),zot(t)&&(t=null!=v.backgroundColor?v.backgroundColor:e.blue),this.arrowBackgroundColor=t,zot(o)&&(o=null!=v.rollBackgroundColor?v.rollBackgroundColor:e.blue.lighten(.2)),this.arrowRollBackgroundColor=o,zot(i)&&(i=null!=v.type?v.type:"triangle"),zot(a)&&(a=null!=v.newPage?v.newPage:null),zot(l)&&(l=null!=v.trans?v.trans:null),zot(s)&&(s=null!=v.speed?v.speed:null),"triangle"==i?(p=new e.Triangle(45,45,45,t,null,null,null,null,-7).rot(90),f=new e.Triangle(45,45,45,o,null,null,null,null,-7).rot(90)):"thick"==i?(p=new e.Shape,m=p.graphics.f(t).command,y="AhFBdIiWAAIAAi4ICWAAIAAh7IEhDWIkhDXg",p.p(y).reg(-4),f=new e.Shape,z=f.graphics.f(t).command,f.p(y).reg(-4)):"thin"==i?(p=new e.Shape,m=p.graphics.f(t).command,y="AhBCIIBZhbIjWAAIAAhVIDaAAIhdhfIA9g+IDDDFIAAAAIAAAAIjDDGg",p.p(y).reg(-4),f=new e.Shape,z=f.graphics.f(t).command,f.p(y).reg(-4)):"angle"==i&&(p=new e.Shape,m=p.graphics.f(t).command,y="AiNC5IC4i5Ii4i5IAxgxIDqDqIjqDrg",p.p(y).reg(-3),f=new e.Shape,z=f.graphics.f(t).command,f.p(y).reg(-3)),this.zimButton_constructor(50,50,"",e.clear,e.clear,null,null,null,null,null,null,null,null,null,null,null,p,f),this.type="Arrow";var b=this;if(this.activate=function(t,o){return zot(t)&&(t=!0),zot(o)&&(o=e.grey),!1===o||(t?(b.enabled=!0,!1!==o&&("triangle"==i?(b.icon.color=b.arrowBackgroundColor,b.rollIcon.color=b.arrowRollBackgroundColor):(m.style=b.arrowBackgroundColor,z.style=b.arrowRollBackgroundColor))):(b.enabled=!1,!1!==o&&("triangle"==i?(b.icon.color=o,b.rollIcon.color=o):(m.style=o,z.style=o)))),b},!zot(n)&&"Pages"==n.type){var w=(zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click";zot(n.arrows)&&(n.arrows={}),zot(n.arrows[r])&&(n.arrows[r]=[]),n.arrows[r].push(this);var C=x();C||this.activate(!1,n.arrowDisableColor),this.expand(),this.on(w,(function(){if(!n.transitioning){var e=x();e&&n.go(e,r,l,s)}})),!1!==c&&e.styleTransforms(this,v),this.clone=function(){return b.cloneProps(new e.Arrow(t,o,n,r,i,a,l,s,c,this.group,d))}}function x(){var e=n.pages[n.index];if(e&&e.swipe){var t=e.swipe;return"left"==r?t[0]:"right"==r?t[1]:"up"==r?t[2]:"down"==r?t[3]:void 0}}},e.extend(e.Arrow,e.Button,"clone","zimButton",!1),e.HotSpots=function(t,o,n){var r,i="spots, local, mouseDowns";if(r=zob(e.HotSpots,arguments,i,this))return r;z_d("72"),this.zimContainer_constructor(null,null,null,null,!1),this.type="HotSpots",zot(o)&&(o=!0),zot(n)&&(n=!1);var a,l,s=(zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",c=this,u=c.hotSpots=[];zot(t)&&(t=[]);for(var d=0;d<t.length;d++)h(t[d]);function h(t){var r=null;if(!Array.isArray(t.rect)){if(!(r=t.rect))return void zogy("zim controls - HotSpots(): HotSpot "+t.page+" "+t.rect+" button does not exist");t.rect=[r.x,r.y,r.width||1,r.height||1]}(l=new e.HotSpot(t.page,t.rect[0],t.rect[1],t.rect[2],t.rect[3],t.call,t.callOver,t.callOut,o,t.talk)).zimHSpage=t.page,l.button=r,u.push(l),l.on(s,g),r&&zot(t.callOver)&&zot(t.callOut)&&(l.spot.mouseEnabled=!1,l.spot.mouseChildren=!1,r.zimHScall=t.call,r.zimHSEvent=r.on(s,g,!0),n||(r.zimHSMDEvent=r.on("mousedown",(function(e){e.stopImmediatePropagation()}))),r.cursor="pointer")}function g(e){e.stopImmediatePropagation&&e.stopImmediatePropagation(),WW.event&&(WW.event.cancelBubble=!0),"function"==typeof e.currentTarget.zimHScall&&e.currentTarget.zimHScall(e)}this.add=this.addHotSpot=function(e,o,n,r,i,l){a={page:e,rect:o,call:n,callOver:r,callOut:i,talk:l},t.push(a),h(a)},this.show=function(){for(var e=0;e<u.length;e++)(l=u[e]).button||(l.spot.alpha=.2)},this.hide=function(){for(var e=0;e<u.length;e++)(l=u[e]).spot.alpha=0},this.remove=this.removeHotSpots=function(o,r){for(var i=t.length-1;i>=0;i--)a=t[i],l=u[i],r&&!Array.isArray(r)&&(r=[r.x,r.y,r.getBounds().width,r.getBounds().height]),(zot(o)&&zot(r)||zot(r)&&o==a.page||zot(o)&&e.arraysEqual(r,a.rect)||o==a.page&&e.arraysEqual(r,a.rect))&&(t.splice(i,1),l.button&&(l.button.off(s,l.button.zimHSEvent),l.button.zimHSEvent=null,n||(l.button.off("mousedown",l.button.zimHSMDEvent),l.button.zimHSMDEvent=null)),l.off(s,g),l.dispose(),u.splice(i,1))},this.dispose=function(){for(var e=0;e<u.length;e++)(l=u[e]).button&&(l.button.off(s,l.button.zimHSEvent),l.button.zimHSCall=null,l.button.zimHSEvent=null,n||(l.button.off("mousedown",l.button.zimHSMDEvent),l.button.zimHSMDEvent=null)),l.off(s,g),l.dispose();return!0}},e.extend(e.HotSpots,e.Container,"dispose","zimContainer",!1),e.HotSpot=function(t,o,n,r,i,a,l,s,c,u){var d,h="obj, x, y, width, height, call, callOver, callOut, local, talk";if(d=zob(e.HotSpot,arguments,h,this))return d;if(z_d("73"),this.zimContainer_constructor(null,null,null,null,!1),this.type="HotSpot",!zot(t)&&t.addChild)if(t instanceof createjs.Container!=0)if(zot(o)||zot(n)||zot(r)||zot(i))zogy("zim controls - HotSpot():\nPlease pass in x, y, width, height");else{zot(c)&&(c=!0);var g,p,f,m=(zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",z=r,y=i;if(c)g=new e.Point(o,n),p=r,f=i;else{g=t.globalToLocal(o,n);var v=t.globalToLocal(o+z,n+y);p=v.x-g.x,f=v.y-g.y}var b=new e.Shape(r,i);if(b.talk=zot(u)?"HotSpot":u,b.alpha=0,b.graphics.f("black").dr(0,0,p,f),b.x=g.x,b.y=g.y,b.cursor="pointer",b.expand(0),this.spot=b,"function"==typeof a)var w=b.on(m,(function(e){a(e)}));if("function"==typeof l)var C=b.on("mouseover",(function(e){l(e)}));if("function"==typeof s)var x=b.on("mouseout",(function(e){s(e)}));t.addChild(b),this.show=function(){b.alpha=.5,t.stage&&t.stage.update()},this.hide=function(){b.alpha=0,t.stage&&t.stage.update()},this.dispose=function(){return w&&b.off(m,C),C&&b.off("mouseover",C),x&&b.off("mouseout",x),t.removeChild(b),b=null,!0}}else zogy("zim controls - HotSpot():\nObjects passed in should be Containers");else zogy("zim controls - HotSpot():\nPlease pass in container object for obj")},e.extend(e.HotSpot,e.Container,"dispose","zimContainer",!1),e.Guide=function(t,o,n,r,i,a,l,s){var c,u="obj, vertical, percent, hideKey, pixelKey, style, group, inherit";if(c=zob(e.Guide,arguments,u,this))return c;z_d("76"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Guide",this.group=l;var d=!1===a?{}:e.getStyle(this.type,this.group,s);if(zot(t)&&(t=WW.zdf?WW.zdf.stage:"stage"),zot(o)&&(o=null==d.vertical||d.vertical),"stage"==t||t.addChild&&t.getBounds&&t.getBounds()){zot(n)&&(n=null==d.percent||d.percent),zot(r)&&(r=null!=d.hideKey?d.hideKey:"G"),zot(i)&&(i=null!=d.pixelKey?d.pixelKey:"P");var h,g,p,f,m,z=this,y=80,v=26,b=y/6+y/2,w=2*v;o?((f=E("#00c5af","white","white")).shape.regX=y+y/6,f.shape.regY=v/2,f.label.x=-y/2-y/6):((f=E("#d61fa0","white","white")).shape.regX=y/2,f.shape.regY=v+v/4,f.label.y=3*-v/4),"stage"!=t&&t.addChild(z);var C,x,k,T,A=e.added(z,I),P=!1,B={x:0,y:0};Object.defineProperty(this,"pixels",{get:function(){return!n},set:function(e){n=!e,z.resize()}}),WW.addEventListener("keydown",M),this.toggled=!0,this.toggle=function(e){return!0===e?z.visible=z.toggled=!0:!1===e?z.visible=z.toggled=!1:(z.visible=!z.visible,z.toggled=z.visible),m&&(m.off("stagemousemove",h),z.visible&&(h=m.on("stagemousemove",S,z)),m.update()),z},this.resize=function(){return!!z&&(m&&(W(),S()),!0)},!1!==a&&e.styleTransforms(this,d),this.dispose=function(){return!!z&&(e.noDrag(k),clearInterval(A),z.removeAllChildren(),WW.removeEventListener("keydown",M),z.parent&&z.parent.removeChild(z),z=null,!0)}}else zog("zim controls - Guide(): Please provide container with bounds for the obj (setBounds())");function E(t,o,n){var r=new e.Container({style:!1});return r.shape=new e.Shape,r.shape.graphics.s(o).ss(1).f(t).r(0,0,y,v),r.shape.alpha=.9,r.addChild(r.shape),r.label=new createjs.Text("10","16px arial",n),r.label.textAlign="center",r.label.textBaseline="middle",r.addChild(r.label),r.mouseChildren=!1,r.mouseEnabled=!1,r}function I(){"stage"==t?(m=z.stage,t=m):m=t.stage,t.addChild(z),C=t.getBounds().width,x=t.getBounds().height,o?(f.y=x/2,f.label.text="x:"+(z.percent?"70%":Math.round(70*C/100))):(f.x=C/2,f.label.text="y:"+(z.percent?"70%":Math.round(70*x/100))),k=new e.Shape,z.addChild(k),o?k.x=.7*C:k.y=.7*x,P||(t.addChild(z),W()),m.off("stagemousemove",h),h=m.on("stagemousemove",S),m.update()}function S(r){var i,a;r?(i=t.globalToLocal(r.rawX/e.scaX,r.rawY/e.scaY),B=i):i={x:B.x,y:B.y},n?o?(a=Math.round(Math.abs(i.x-k.x)/C*100),f.label.text="x:"+Math.max(0,Math.min(a,100))+"%",f.y=Math.max(w,Math.min(i.y,p))):(a=Math.round(Math.abs(i.y-k.y)/x*100),f.label.text="y:"+Math.max(0,Math.min(a,100))+"%",f.x=Math.max(b,Math.min(i.x,g))):o?(a=Math.round(Math.abs(i.x-k.x)),f.label.text="x:"+Math.max(0,Math.min(a,Math.round(C))),f.y=Math.max(w,Math.min(i.y,p))):(a=Math.round(Math.abs(i.y-k.y)),f.label.text="y:"+Math.max(0,Math.min(a,Math.round(x))),f.x=Math.max(b,Math.min(i.x,g))),m&&m.update()}function W(){var n;P=!0,C=t.getBounds().width,x=t.getBounds().height,o?(n="ew-resize",T=new createjs.Rectangle(0,0,C,0)):(n="ns-resize",T=new createjs.Rectangle(0,0,0,x)),e.noDrag(k),setTimeout((function(){e.drag(k,T,n,n,null,null,!0)}),500),m.mouseMoveOutside=!0,m.enableMouseOver(10),g=C-2*y/3,p=x-v-v,k.uncache();var r=k.graphics;o?(r.c().s("rgba(0,255,255,.1)").ss(20).mt(0,0).lt(0,x),r.f().s("white").ss(2).mt(0,0).lt(0,x),r.s("#00c5af").sd([20,20]).mt(0,0).lt(0,x).sd(),k.cache(-10,0,20,x)):(r.c().s("rgba(255,0,255,.1)").ss(20).mt(0,0).lt(C,0),r.f().s("white").ss(2).mt(0,0).lt(C,0),r.s("#d61fa0").sd([20,20]).mt(0,0).lt(C,0).sd(),k.cache(0,-10,C,20)),o?f.x=C:f.y=x,z.addChild(f)}function M(e){e||(e=event),m&&(String.fromCharCode(e.keyCode)==r.toUpperCase()&&z.toggle(),String.fromCharCode(e.keyCode)==i.toUpperCase()&&(z.pixels=!z.pixels))}},e.extend(e.Guide,e.Container,"clone","zimContainer",!1),e.Grid=function(t,o,n,r,i,a,l,s,c,u,d){var h,g="obj, color, percent, hideKey, pixelKey, allowToggle, cache, numbers, style, group, inherit";if(h=zob(e.Grid,arguments,g,this))return h;z_d("78"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Grid",this.group=u;var p=!1===c?{}:e.getStyle(this.type,this.group,d);if(zot(t)&&(t=WW.zdf?WW.zdf.stage:"stage"),zot(o)&&(o=null!=p.color?p.color:"black"),"stage"==t||t.addChild&&t.getBounds&&t.getBounds()){zot(n)&&(n=null==p.percent||p.percent),zot(r)&&(r=null!=p.hideKey?p.hideKey:"G"),zot(i)&&(i=null!=p.pixelKey?p.pixelKey:"P"),zot(a)&&(a=null==p.allowToggle||p.allowToggle),zot(l)&&(l=null==p.cache||p.cache),zot(s)&&(s=null==p.numbers||p.numbers);var f,m=this,z=10;this.mouseChildren=!1,this.mouseEnabled=!1;var y=80,v=26,b=m.numbersX=M("#dddddd",o,"#333333");b.shape.regX=y/2,b.shape.regY=-v/4,b.label.y=3*v/4;var w=m.numbersY=M("#dddddd",o,"#333333");w.shape.regX=-y/6,w.shape.regY=v/2,w.label.x=y/2+y/6,s||(b.visible=!1,w.visible=!1);var C,x,k,T=y/6+y/2,A=2*v;b.x=T,w.y=A,b.label.text="x:0",w.label.text="y:0","stage"!=t&&t.addChild(m);var P,B,E,I=e.added(m,O),S=!1,W={x:0,y:0};Object.defineProperty(this,"pixels",{get:function(){return!n},set:function(e){n=!e,m.resize()}}),WW.addEventListener("keydown",D),this.toggled=!0,this.toggle=function(e){return!0===e?m.visible=m.toggled=!0:!1===e?m.visible=m.toggled=!1:(m.visible=!m.visible,m.toggled=m.visible),k.off("stagemousemove",f),m.visible&&(f=k.on("stagemousemove",j,m)),k&&k.update(),m},this.resize=function(){return!!m&&(m.removeChild(E),E=null,k&&(L(),j(),setTimeout((function(){m.removeChild(E),E=null,L()}),200)),!0)},!1!==c&&e.styleTransforms(this,p),this.dispose=function(){return clearInterval(I),m.removeAllChildren(),WW.removeEventListener("keydown",D),m.parent&&m.parent.removeChild(m),m=null,!0}}else zog("zim controls - Grid(): Please provide container with bounds for the obj (setBounds())");function M(t,o,n){var r=new e.Container({style:!1});return r.shape=new createjs.Shape,r.shape.graphics.s(o).ss(1).f(t).r(0,0,y,v),r.shape.alpha=.9,r.addChild(r.shape),r.label=new createjs.Text("10","16px arial",n),r.label.textAlign="center",r.label.textBaseline="middle",r.addChild(r.label),r.mouseChildren=!1,r.mouseEnabled=!1,r}function O(){"stage"==t?(k=m.stage,t=k):k=t.stage,S||(L(),t.addChild(m)),k.off("stagemousemove",f),f=k.on("stagemousemove",j),k.update()}function j(o){var r;o?(r=t.globalToLocal(o.rawX/e.scaX,o.rawY/e.scaY),W=r):r={x:W.x,y:W.y},n?(b.label.text="x:"+Math.max(0,Math.min(Math.round(r.x/P*100),100))+"%",b.x=Math.max(T,Math.min(r.x,C)),w.label.text="y:"+Math.max(0,Math.min(Math.round(r.y/B*100),100))+"%",w.y=Math.max(A,Math.min(r.y,x))):(b.label.text="x:"+Math.max(0,Math.min(Math.round(r.x),Math.round(P))),b.x=Math.max(T,Math.min(r.x,C)),w.label.text="y:"+Math.max(0,Math.min(Math.round(r.y),Math.round(B))),w.y=Math.max(A,Math.min(r.y,x))),k&&k.update()}function L(){S=!0,t&&t.getBounds&&(P=t.getBounds().width,B=t.getBounds().height),k&&(k.mouseMoveOutside=!0,k.enableMouseOver(10)),C=P-2*y/3,x=B-v-v,E=m.grid=new e.Container({style:!1}),m.addChild(E);var r=new createjs.Shape;E.addChild(r);var i=r.graphics;i.s(o).ss(1);var a,s=new createjs.Shape;if(E.addChild(s),n){for(a=1;a<21;a++)i.mt(a*P/20,0).lt(a*P/20,B);for(a=1;a<20;a++)i.mt(0,a*B/20).lt(P,a*B/20);for(r.alpha=.3,(i=s.graphics).s(o).ss(1),a=1;a<10;a++)i.mt(a*P/10,0).lt(a*P/10,B);for(a=1;a<10;a++)i.mt(0,a*B/10).lt(P,a*B/10)}else{for(a=0;a<P/z;a++)i.mt(a*z,0).lt(a*z,B);for(a=0;a<B/z;a++)i.mt(0,a*z).lt(P,a*z);for(r.alpha=.3,(i=s.graphics).s(o).ss(1),a=0;a<P/(10*z);a++)i.mt(a*(10*z),0).lt(a*(10*z),B);for(a=0;a<B/(10*z);a++)i.mt(0,a*(10*z)).lt(P,a*(10*z))}i.s("#FFFFFF").ss(8),i.mt(P/2,B/2-40).lt(P/2,B/2+40),i.mt(P/2-40,B/2).lt(P/2+40,B/2),i.s("#000000").ss(4),i.mt(P/2,B/2-40).lt(P/2,B/2+40),i.mt(P/2-40,B/2).lt(P/2+40,B/2),i.s(o).ss(l?3:2),i.dr(0,0,P,B),s.alpha=.5,l&&E.cache(0,0,P,B),m.addChild(b),m.addChild(w),k&&k.update()}function D(e){e||(e=event),k&&a&&(String.fromCharCode(e.keyCode)==r.toUpperCase()&&m.toggle(),String.fromCharCode(e.keyCode)==i.toUpperCase()&&(m.removeChild(E),E=null,m.pixels=!m.pixels))}},e.extend(e.Grid,e.Container,"clone","zimContainer",!1),e.Wrapper=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k){var T="items, width, spacingH, spacingV, wrapperType, align, valign, alignInner, valignInner, flip, reverse, bottomFull, colSize, rowSize, height, minSpreadNum, minStretchNum, percentVoidH, offsetVoidH, percentVoidV, offsetVoidV, style, group, inherit",A=null;if(A=zob(e.Wrapper,arguments,T,this))return A;z_d("78.5"),this.group=x;var P=!1===C?{}:e.getStyle("Wrapper",this.group,k);zot(o)&&(o=null!=P.width?P.width:300),zot(f)&&(f=null!=P.height?P.height:null),zot(n)&&(n=null!=P.spacingH?P.spacingH:null),zot(r)&&(r=null!=P.spacingV?P.spacingV:null),zot(i)&&(i=null!=P.wrapperType?P.wrapperType:"spacing"),zot(a)&&(a=null!=P.align?P.align:"left"),zot(l)&&(l=null!=P.valign?P.valign:"top"),zot(s)&&(s=null!=P.alignInner?P.alignInner:"left"),zot(c)&&(c=null!=P.valignInner?P.valignInner:"bottom"),zot(u)&&(u=null!=P.flip&&P.flip),zot(d)&&(d=null!=P.reverse&&P.reverse),zot(h)&&(h=null!=P.bottomFull&&P.bottomFull),zot(g)&&(g=null!=P.colSize?P.colSize:100),zot(p)&&(p=null!=P.rowSize?P.rowSize:null),zot(n)&&(n=0),zot(r)&&(r=0),zot(m)&&(m=null!=P.minSpreadNum?P.minSpreadNum:2),zot(z)&&(z=null!=P.minStretchNum?P.minStretchNum:3),zot(y)&&(y=null!=P.percentVoidH?P.percentVoidH:0),zot(v)&&(v=null!=P.offsetVoidH?P.offsetVoidH:0),zot(b)&&(b=null!=P.percentVoidV?P.percentVoidV:0),zot(w)&&(w=null!=P.offsetVoidV?P.offsetVoidV:0);var B,E,I=200,S=0,W=0,M=0,O=o;this.items=[],"spread"==i?B=!0:"stretch"==i&&(E=!0),this.zimContainer_constructor(o,I),this.type="Wrapper","middle"==a&&(a="center"),"middle"==l&&(l="center"),"middle"==s&&(s="center"),"middle"==c&&(c="center");var j=this;function L(t,n,r,i,l,d,g,p){var f=e.Pick.choose(a),m=e.Pick.choose(B),y=e.Pick.choose(E),v=e.Pick.choose(u),b=e.Pick.choose(s),w=e.Pick.choose(c);zot(f)&&(f="left"),zot(w)&&(w="top"),zot(b)&&(b="left"),v&&t.reverse();var C,x,k=((100-d)/100/2+g/100)*o,T=o*d/100,A=0,P=!1;if(l){(h||u)&&t.reverse();var I=O%l,L=O/2+g/100*O,D=0,_=Math.floor(O/l);0!=j.rows&&p&&(P=!0),e.loop(t,(function(e,o){var n;A=0,D="right"==b?l*o+0+l-e.wrapWidth:"center"==b||"middle"==b?l*o+0+(l-e.wrapWidth)/2:l*o+0,C=e.x,e.pos(D),x=e.x-C,e.centerX+=x,e.marginLeft&&(A+=e.marginLeft),e.marginRight&&(A-=e.marginRight),"center"==f||"middle"==f?(n=Math.floor(O/l)-t.length,A+=(I+(n?n*l:0))/2):"right"==f&&(n=Math.floor(O/l)-t.length,A+=I+(n?n*l:0)),e.mov(A),e.centerX+=A})),"center"==f&&P&&(t.length+_)%2!=0&&(A=(L<=O/2?-1:1)*l/2,e.loop(t,(function(e){e.mov(A),e.centerX+=A})))}else if(m||y){var Y,X;m?Y=t.length?(O-i)/(t.length+1):0:y&&(Y=t.length-1>0?(O-i)/(t.length-1):0),t.length<z&&0!=j.rows&&p&&(Y=M,P=!0),M=Y;var R=0;if((h||u)&&t.reverse(),e.loop(t,(function(e,t){A=0,C=e.x,e.pos(Y*(t+(m?1:0))+R),x=e.x-C,e.centerX+=x,P||(e.marginLeft&&(A+=e.marginLeft),e.marginRight&&(A-=e.marginRight),e.mov(A),e.centerX+=A),R+=e.wrapWidth})),P){A=0;var H=m?Y:0;x=0,e.loop(t,(function(o){if("right"==f)C=o.x,o.pos(H,null,e.RIGHT),x=o.x-C,H+=o.wrapWidth+Y;else if("center"==f){var n=(O-(R+(t.length-1)*Y))/2-(m?Y:0);C=o.x,o.pos(H+n,null,e.RIGHT),x=o.x-C,H+=o.wrapWidth+Y}o.marginLeft&&(A+=o.marginLeft),o.marginRight&&(A-=o.marginRight),o.mov(A),o.centerX+=x+A}),!0)}}else"center"==f?e.loop(t,(function(e){A=((h||u?0:o)-n.x)/2,(m||y)&&(e.marginLeft&&(A+=e.marginLeft),e.marginRight&&(A-=e.marginRight)),e.mov(A),e.centerX+=A})):(h||u)&&"left"==f?(X=t[t.length-1].marginLeft,e.loop(t,(function(e){A=-n.x+(X||0),m&&(A+=W),e.mov(A),e.centerX+=A}))):h||u||"right"!=f?m&&m&&e.loop(t,(function(e){A=W*("right"==f?-1:1),e.mov(A),e.centerX+=A})):(X=t[t.length-1].marginRight,e.loop(t,(function(e){A=o-n.x-(X||0),m&&(A-=W),e.mov(A),e.centerX+=A})));d&&(k=(.5+g/100)*O,T=o*d/100,e.loop(t,(function(e){l||y||m?"right"==f?e.centerX>O-k&&e.mov(T):"center"==f?Math.round(e.centerX)==Math.round(O/2+g/100*O)?e.mov(T/2):Math.round(e.centerX)>Math.round(O/2+g/100*O)&&e.mov(T):e.centerX>k&&e.mov(T):h||u||"right"!=f?h||u||"center"!=f?(h||u)&&"right"==f?e.centerX>O-k&&e.mov(T):(h||u)&&"center"==f?e.centerX>O/2+g/100*O&&e.mov(T):e.centerX>k&&e.mov(T):e.centerX>o/2+g/100*O?e.mov(T/2):e.mov(-T/2):e.centerX<o-k&&e.mov(-T)}))),m&&(W=(S+=Y)/(j.rows+1)),"center"==w?e.loop(t,(function(e){e.mov(0,(r-e.wrapHeight)/2*(h?-1:1))})):h||"bottom"!=w?h&&"top"==w&&e.loop(t,(function(e){e.mov(0,-(r-e.wrapHeight)+(e.marginTop?e.marginTop:0))})):e.loop(t,(function(e){e.mov(0,r-e.wrapHeight-(e.marginBottom?e.marginBottom:0))}))}this.add=function(e){return this.addAt(e,this.numChildren-1),j},this.addAt=function(t,o){return zot(t)||((zot(o)||o<0)&&(o=0),Array.isArray(t)||(t=[t]),e.loop(t,(function(e,t){j.addChildAt(e,o+t)})),j.resize()),j},this.remove=function(t){return Array.isArray(t)||(t=[t]),e.loop(t,(function(e){e&&e.removeFrom&&e.removeFrom()}),!0),j.resize(),j},this.convert=function(e,t){var o=[];return e.loop((function(e){o.push(e),t&&e.cache()})),j.add(o),e.removeFrom(),j},this.resize=function(t,a){if(!j.preventResize){zot(t)||(o=t),zot(a)||(f=a),this.items2D=[],this.items=[],S=0,W=0,M=0,zot(y)&&(y=0),zot(v)&&(v=0);var s=e.Pick.choose(y),c=e.Pick.choose(v);O=o*(100-s)/100,this.setBounds(O,I);var m=0,z=0,C=0;j.cols=0,j.rows=0;var x=[],k=[0],T=null,A=0,P=null,B=e.Pick.choose(g);"column"!=i&&(B=null);var E,D,_=e.Pick.choose(p),Y=0;e.loop(this,(function(t,o){h||u?t.pos(m+(t.marginRight?t.marginRight:0),z+(t.marginTop?t.marginTop:0),e.RIGHT,u?e.TOP:e.BOTTOM):t.pos(m+(t.marginLeft?t.marginLeft:0),z+(t.marginTop?t.marginTop:0)),Y++,P=t.boundsToGlobal();var i=j.globalToLocal(P.x,P.y),a=j.globalToLocal(P.x+P.width,P.y+P.height);if(E=h||u?j.globalToLocal(P.x,P.y):j.globalToLocal(P.x+P.width,P.y+P.height),t.wrapHeight=a.y-i.y,t.wrapWidth=a.x-i.x,s){var l=j.globalToLocal(P.x+t.wrapWidth/2,P.y+t.wrapHeight/2);t.centerX=l.x,t.centerY=l.y,l=null}D=B?B*Y:h||u?O-E.x+(t.marginLeft?t.marginLeft:0)+n:E.x+(t.marginRight?t.marginRight:0)+n,Math.round(D)-n>O&&(L(x,T,C,A,B,s,c,!1),A=0,0==j.cols&&(j.cols=o),m=0,z+=C+(_?0:e.Pick.choose(r)),C=0,_=e.Pick.choose(p),s=e.Pick.choose(y),c=e.Pick.choose(v),Y=0,j.items2D.push(e.copy(x)),j.rows++,k.push(z),x=[],h||u?t.pos(m+(t.marginRight?t.marginRight:0),z+(t.marginTop?t.marginTop:0),e.RIGHT,u?e.TOP:e.BOTTOM):t.pos(m+(t.marginLeft?t.marginLeft:0),z+(t.marginTop?t.marginTop:0)),s&&(P=t.boundsToGlobal(),l=j.globalToLocal(P.x+t.wrapWidth/2,P.y+t.wrapHeight/2),t.centerX=l.x,t.centerY=l.y,l=null),Y++,B?D=0:(D=(t.marginLeft?t.marginLeft:0)+t.wrapWidth+(t.marginRight?t.marginRight:0)+e.Pick.choose(n),E.x=h||u?O-((t.marginRight?t.marginRight:0)+t.wrapWidth):(t.marginLeft?t.marginLeft:0)+t.wrapWidth)),x.push(t),A+=t.wrapWidth,m=D,C=_||Math.max(C,t.wrapHeight+(t.marginTop?t.marginTop:0)+(t.marginBottom?t.marginBottom:0)),T=new e.Point(E.x,z+C)}),(!d||!h)&&(d||h)),j.numChildren>0&&(0==j.cols&&(j.cols=j.numChildren),j.items2D.push(e.copy(x)),k.push(z),L(x,T,C,A,B,s,c,!0),j.rows+=1);var X,R=e.Pick.choose(l);zot(R)&&(R="top"),h&&(X=z+C-I,e.loop(this,(function(e){e.mov(0,X)})),j.items2D.reverse(),e.loop(j.items2D,(function(e){e.reverse()})));var H=e.Pick.choose(b),F=e.Pick.choose(w);if(!zot(H)){zot(F)&&(F=0);var N=z+C,V=N*H/100,G=N/2+F/100*N;e.loop(k,(function(t,o){if(t>=G)return e.loop(j.items2D,(function(t){e.loop(t,(function(e){e.mov(0,V)}))}),null,1,o),"break"}))}return zot(f)||("bottom"==l?(X=f-(z+C),e.loop(this,(function(e){e.mov(0,X)}))):"center"!=l&&"middle"!=l||(X=(f-(z+C))/2,e.loop(this,(function(e){e.mov(0,X)})))),j.setBounds(null),(P=j.getBounds())&&j.setBounds(0,P.y,o,P.height),e.loop(j.items2D,(function(t){e.loop(t,(function(e){j.items.push(e)}))})),this.stage&&this.stage.update(),j}},Object.defineProperty(j,"spacingH",{get:function(){return n},set:function(e){n=e,this.resize()}}),Object.defineProperty(j,"spacingV",{get:function(){return r},set:function(e){r=e,this.resize()}}),Object.defineProperty(j,"wrapperType",{get:function(){return i},set:function(e){B="spread"==e,E="stretch"==e,i=e,this.resize()}}),Object.defineProperty(j,"align",{get:function(){return a},set:function(e){"middle"==(a=e)&&(a="center"),this.resize()}}),Object.defineProperty(j,"valign",{get:function(){return l},set:function(e){"middle"==(l=e)&&(l="center"),this.resize()}}),Object.defineProperty(j,"alignInner",{get:function(){return s},set:function(e){"middle"==(s=e)&&(s="center"),this.resize()}}),Object.defineProperty(j,"valignInner",{get:function(){return c},set:function(e){"middle"==(c=e)&&(c="center"),this.resize()}}),Object.defineProperty(j,"colSize",{get:function(){return g},set:function(e){g=e,"column"==i&&this.resize()}}),Object.defineProperty(j,"rowSize",{get:function(){return p},set:function(e){p=e,this.resize()}}),Object.defineProperty(j,"flip",{get:function(){return u},set:function(e){u=e,this.resize()}}),Object.defineProperty(j,"reverse",{get:function(){return d},set:function(e){d=e,this.resize()}}),Object.defineProperty(j,"bottomFull",{get:function(){return h},set:function(e){h=e,this.resize()}}),Object.defineProperty(j,"percentVoidH",{get:function(){return y},set:function(e){y=e,this.resize()}}),Object.defineProperty(j,"offsetVoidH",{get:function(){return v},set:function(e){v=e,this.resize()}}),Object.defineProperty(j,"percentVoidV",{get:function(){return b},set:function(e){b=e,this.resize()}}),Object.defineProperty(j,"offsetVoidV",{get:function(){return w},set:function(e){w=e,this.resize()}}),zot(t)||j.add(t),!1!==C&&e.styleTransforms(this,P),this.clone=function(){return j.cloneProps(new e.Wrapper(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,this.style,this.group))}},e.extend(e.Wrapper,e.Container,"clone","zimContainer",!1),e.Tile=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k){var T,A="obj, cols, rows, spacingH, spacingV, unique, width, height, squeezeH, squeezeV, colSize, rowSize, align, valign, count, mirrorH, mirrorV, snapToPixel, clone, events, exact, style, group, inherit";if(T=zob(e.Tile,arguments,A,this))return T;z_d("66.5"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Tile",this.group=x;var P,B=!1===C?{}:e.getStyle(this.type,this.group,k);zot(t)&&(t=null!=B.obj?B.obj:new e.Circle),zot(o)&&(o=null!=B.cols?B.cols:1121),zot(n)&&(n=null!=B.rows?B.rows:1121),1121==o&&1121==n?o=n=P=3:1121==o?o=1:1121==n&&(n=1),zot(a)&&(a=null!=B.unique&&B.unique),zot(l)&&(l=null!=B.width?B.width:null),zot(s)&&(s=null!=B.height?B.height:null),zot(d)&&(d=null!=B.colSize?B.colSize:null),zot(h)&&(h=null!=B.rowSize?B.rowSize:null),zot(l)||(d=null),zot(s)||(h=null),zot(r)&&(r=null!=B.spacingH?B.spacingH:P?3:null),zot(i)&&(i=null!=B.spacingV?B.spacingV:P?3:null),!zot(r)&&zot(d)||(r=0),!zot(i)&&zot(h)||(i=0),zot(c)&&(c=null!=B.squeezeH&&B.squeezeH),zot(u)&&(u=null!=B.squeezeV&&B.squeezeV),zot(g)&&(g=null!=B.align?B.align:"left"),zot(p)&&(p=null!=B.valign?B.valign:"top"),zot(f)&&(f=null!=B.count?B.count:a&&Array.isArray(t)?t.length:null),0===f&&(f=null,zon&&zogy("ZIM Tile() - count parameter of 0 is ignored - see docs")),zot(m)&&(m=null!=B.mirrorH&&B.mirrorH),zot(z)&&(z=null!=B.mirrorV&&B.mirrorV),zot(y)&&(y=null==B.snapToPixel||B.snapToPixel),y&&(t&&t.stage?t.stage.snapToPixelEnabled=!0:"undefined"!=typeof elem&&WW.zdf&&(WW.zdf.stage.snapToPixelEnabled=!0)),zot(v)&&(v=null!=B.clone?B.clone:!a&&null),null==v&&(v="function"!=typeof t||"series"==t.type),zot(b)&&(b=null==B.events||B.events);var E=this;E.cols=o=Math.round(o),E.rows=n=Math.round(n),E.spacingH=r,E.spacingV=i,E.squeezeH=c,E.squeezeV=u;var I,S="function"==typeof g,W="function"==typeof p;E.align=S?"left":g,E.valign=W?"top":p,E.mirrorH=m,E.mirrorV=z,E.items=[];var M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q,U,Q,Z,K=0,J=!1;e:for(var $=0;$<n;$++)for(var ee=0;ee<o;ee++){if(K++,!zot(f)&&K>f)break e;"string"==typeof(I=a?t[K-1]:e.Pick.choose(t))&&(I=WW.asset(I).centerReg({add:!1}).clone()),zot(I)&&(I=new e.Container(0,0,0,0)),v&&(0==$&&0==ee||(I=I.clone(w))),b&&I.on("change",(function(e){var t=new createjs.Event("change");t.item=e.currentTarget,E.dispatchEvent(t)})),E.items.push(I),"AC"==I.type&&(J=!0),I.tileNum=K-1,I.tileCol=ee,I.tileRow=$}function te(){E.removeAllChildren(),M=[],O=[],j=[],L=[],D=[],_=0,Y=0,X=0,R=0,H=[],F=[],N=[],G=[],V=[],E.items&&E.items.length||(E.items=[]),f=E.items.length;var t,o,n,r,i,a=0,c=0,u=0;for(o=0;o<f;o++)c=Math.floor(o/E.cols),u=o%E.cols,zot(M[c])&&(M[c]=[]),zot(E.items[o])&&(E.items[o]=new e.Container(0,0,0,0)),M[c][u]=E.items[o];E.rows=Math.max(1,M.length),E.cols=Math.max(1,zot(M[0])?0:M[0].length);e:for(c=0;c<E.rows;c++)for(H.push([]),F.push([]),G.push([]),h&&zot(s)&&(n=e.Pick.choose(h)),o=0;o<E.cols;o++){if(a++,!zot(f)&&a>f)break e;(t=M[c][o]).snapToPixel=y,E.addChild(t),H[c].push(t.scaleX),F[c].push(t.scaleY),0==c&&d&&zot(l)&&(r=e.Pick.choose(d)),0==c&&V.push(e.Pick.choose(g)),d&&zot(l)||(r=Math.abs(t.width)),h&&zot(s)||(n=Math.abs(t.height)),G[c][o]=[r,n],zot(L[o])&&(L[o]=0),zot(D[c])&&(D[c]=0),r>L[o]&&(L[o]=r),n>D[c]&&(D[c]=n),zot(O[c])&&(O[c]=0),zot(j[o])&&(j[o]=0),O[c]+=r,j[o]+=n,O[c]>_&&(_=O[c]),j[o]>Y&&(Y=j[o]),zot(N[o])&&(N[o]=0),N[o]++}if(!1===E.squeezeH)for(o=0;o<L.length;o++)i=L[o],X+=i;if(!1===E.squeezeV)for(o=0;o<D.length;o++)i=D[o],R+=i}function oe(t,o){var n,r;t<=0&&(t=null),o<=0&&(o=null),q=zot(t)||"full"!=E.squeezeH?zot(t)?X>0?X+(E.cols-1)*E.spacingH:_+(E.cols-1)*E.spacingH:Math.max(_+(E.cols-1)*E.spacingH,t):t,U=zot(o)||"full"!=E.squeezeV?zot(o)?R>0?R+(E.rows-1)*E.spacingV:Y+(E.rows-1)*E.spacingV:Math.max(Y+(E.rows-1)*E.spacingV,o):o,E.setBounds(0,0,q,U),Q=[],Z=[];var i=[];for($=0;$<M.length;$++)for(n=M[$],r=0,ee=0;ee<n.length;ee++){var a,l;if(I=n[ee],0==$&&(Q[ee]=0,zot(o)||("full"==E.squeezeV?Z[ee]=N[ee]>1?(o-j[ee])/(N[ee]-1):0:E.squeezeV?Z[ee]=N[ee]>1?Math.max(E.spacingV,(o-j[ee])/(N[ee]-1)):0:Z[ee]=N[ee]>1?Math.max(E.spacingV,(U-j[ee])/(N[ee]-1)):0),E.squeezeV?"center"==E.valign||"middle"==E.valign?i[ee]=(U-(j[ee]+(N[ee]-1)*(zot(o)?E.spacingV:Z[ee])))/2:"bottom"==E.valign?i[ee]=U-(j[ee]+(N[ee]-1)*(zot(o)?E.spacingV:Z[ee])):i[ee]=0:i[ee]=0),0==ee){zot(t)||(l="full"==E.squeezeH?n.length>1?(t-O[$])/(n.length-1):0:E.squeezeH?n.length>1?Math.max(E.spacingH,(t-O[$])/(n.length-1)):0:n.length>1?Math.max(E.spacingH,(q-O[$])/(n.length-1)):0),a=E.squeezeH?"center"==E.align||"middle"==E.align?(q-(O[$]+(n.length-1)*(zot(t)?E.spacingH:l)))/2:"right"==E.align?q-(O[$]+(n.length-1)*(zot(t)?E.spacingH:l)):0:0;var s=e.Pick.choose(p)}g=V[ee];var c=G[$][ee][0],u=G[$][ee][1];E.mirrorH&&ee%2==1&&(I.scaleX=-H[$][ee]),I.pos(r,null),!E.squeezeH&&S?!zot(t)||"center"!=g&&"middle"!=g?zot(t)&&"right"==g&&(I.x+=L[ee]-I.width):I.x+=(L[ee]-I.width)/2:E.squeezeH?!zot(t)||"center"!=E.align&&"middle"!=E.align?zot(t)&&"right"==E.align&&(I.x+=c-I.width):I.x+=(c-I.width)/2:!zot(t)||"center"!=E.align&&"middle"!=E.align?zot(t)&&"right"==E.align&&(I.x+=L[ee]-I.width):I.x+=(L[ee]-I.width)/2,E.mirrorV&&$%2==1&&(I.scaleY=-F[$][ee]),I.pos(null,Q[ee]),!E.squeezeV&&W?!zot(o)||"center"!=s&&"middle"!=s?zot(o)&&"bottom"==s&&(I.y+=D[$]-I.height):I.y+=(D[$]-I.height)/2:E.squeezeV?!zot(o)||"center"!=E.valign&&"middle"!=E.valign?zot(o)&&"bottom"==E.valign&&(I.y+=u-I.height):I.y+=(u-I.height)/2:!zot(o)||"center"!=E.valign&&"middle"!=E.valign?zot(o)&&"bottom"==E.valign&&(I.y+=D[$]-I.height):I.y+=(D[$]-I.height)/2,!0!==E.squeezeH&&zot(t)?r+=L[ee]+(zot(t)?E.spacingH:l):r+=c+(zot(t)?E.spacingH:l),I.x+=a,I.y+=i[ee],!0!==E.squeezeV&&zot(o)?Q[ee]+=D[$]+(zot(o)?E.spacingV:Z[ee]):Q[ee]+=u+(zot(o)?E.spacingV:Z[ee])}}function ne(e){for(var t,o=[],n=0;n<e.length;n++)n%E.cols==0&&(t=[],o.push(t)),t.push(e[n]);return o}function re(e){var t,o=[];for(t=0;t<E.cols;t++)o.push([]);for(t=0;t<e.length;t++)o[t%E.cols][Math.floor(t/E.cols)]=e[t];return o}J&&zon&&zogy("ZIM Tile - assets must have dimensions for Tile"),te(),oe(l,s),this.itemUnderPoint=function(t,r,i){if(zot(i)&&(i=!0),!zot(t)&&!zot(r)){var a=E.globalToLocal(t,r);t=a.x,r=a.y;var l=0,c=e.loop(L,(function(e,o){return l+=e+E.spacingH,!((!i||"vertical"==i)&&t>l-E.spacingH&&t<l)&&(t<l-E.spacingH/2?o:void 0)}));if(!1!==c&&(!0===c&&(c=o-1),!(t<0||t>q||r<0||r>U))){var u=0,d=e.loop(D,(function(e,t){var o=zot(s)?E.spacingV:Z[ee];return!((!i||"horizontal"==i)&&r>u-o&&r<u)&&(r<(u+=e+o)-o/2?t:void 0)}));if(!1!==d)return!0===d&&(d=n-1),E.items2D[d][c]}}},this.remake=function(e){return zot(e)||(E.items=e),te(),oe(l,s),E},this.resize=function(e,t){return zot(e)&&(e=l),zot(t)&&(t=s),l=e,s=t,oe(e,t),E},Object.defineProperty(this,"items2D",{get:function(){return ne(E.items)},set:function(){zon&&zogy("Tile() - items2D is read only")}}),Object.defineProperty(this,"items2DCols",{get:function(){return re(E.items)},set:function(){zon&&zogy("Tile() - items2DCols is read only")}}),Object.defineProperty(this,"current",{get:function(){var t=[];return e.loop(E.items,(function(e){var o=e.getBounds(),n=e.x-e.regX+o.x+o.width/2,r=e.y-e.regY+o.y+o.height/2,i=E.hitTestGrid(E.width,E.height,E.cols,E.rows,n,r,null,null,E.spacingH,E.spacingV,!0,"open");null!=i&&(t[i[0]]=e)})),t},set:function(){zon&&zogy("Tile() - current is read only")}}),Object.defineProperty(this,"current2D",{get:function(){return ne(E.current)},set:function(){zon&&zogy("Tile() - current2D is read only")}}),Object.defineProperty(this,"current2DCols",{get:function(){return re(E.current)},set:function(){zon&&zogy("Tile() - current2DCols is read only")}}),!1!==C&&e.styleTransforms(this,B),this.clone=function(o){if(o)for(var n=[],r=0;r<E.items.length;r++)n.push(E.items[r].clone(!0));return E.cloneProps(new e.Tile(o?e.series(n):t.clone?t.clone():t,E.cols,E.rows,E.spacingH,E.spacingV,a,l,s,E.squeezeH,E.squeezeV,d,h,g,p,E.items.length,E.mirrorH,E.mirrorV,y,!o&&v,b,o,this.style,this.group))}},e.extend(e.Tile,e.Container,"clone","zimContainer",!1),e.Beads=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f){var m,z="path, obj, count, angle, startPercent, endPercent, percents, onTop, showControls, visible, interactive, clone, group, style, inherit";if(m=zob(e.Beads,arguments,z,this))return m;z_d("66.7"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Beads",this.group=g;var y=!1===p?{}:e.getStyle(this.type,this.group,f);zot(s)&&(s=null!=y.onTop&&y.onTop),zot(c)&&(c=null!=y.showControls&&y.showControls),zot(u)&&(u=null==y.visible||y.visible),zot(d)&&(d=null==y.interactive||y.interactive),zot(t)&&(t=null!=y.path?y.path:new e.Blob({color:null,borderWidth:3,borderColor:e.blue})),t.visible=u,t.interactive=d,t.toggle(c),t.onTop=s,zot(o)&&(o=null!=y.obj?y.obj:new e.Circle(10)),zot(n)&&(n=null!=y.count?y.count:10),zot(r)&&(r=null!=y.angle?y.angle:null),zot(i)&&(i=null!=y.startPercent?y.startPercent:0),zot(a)&&(a=null!=y.endPercent?y.endPercent:100),zot(l)&&(l=null!=y.percents?y.percents:null);var v,b=a;if(a<i&&(b=100+a),zot(l)){var w;w="Squiggle"==t.type?(b-i)/(n-1):(b-i)/(n-(i!=b%100?1:0)),l=[];var C=i-w;for(v=0;v<n;v++)l.push(C+w),(C+=w)>100&&(C-=100)}zot(h)&&(h=null==y.clone||y.clone);var x,k=this;for(k.count=n,k.percents=l,k.items=[],v=0;v<n;v++)x=e.Pick.choose(o),h&&0!=v&&(x=x.clone()),x.beadNum=v,x.startPercent=l[v],k.items.push(x);k.path=t.addTo(k),k.beads=(new e.Container).addTo(k,s?0:null),k.beads.type="BeadsContainer",this.resize=function(){for(var e=t.segmentRatios,o=t.segmentPoints,n=0;n<k.count;n++){var i=t.getCurvePoint(Math.max(0,Math.min(.9999,l[n]/100)),e,o,!0);if(i){var a=k.beads.globalToLocal(i.x,i.y);a&&k.items[n].loc(a,null,k.beads).rot((zot(r)?i.angle>180?i.angle-360+t.rotation:i.angle+t.rotation:r)+k.items[n].rotation)}}return this},k.resize(),d&&(t.on("pressmove",k.resize),t.on("update",k.resize)),!1!==p&&e.styleTransforms(this,y),this.dispose=function(e){return e||this.zimContainer_dispose(!0),k.items=[],!0},this.clone=function(n){if(n)for(var g=[],p=0;p<k.items.length;p++)g.push(k.items[p].clone(!0));return k.cloneProps(new e.Beads(t.clone(),n?e.series(g):o.clone?o.clone():o,k.count,r,i,a,l,s,c,u,d,h,this.style,this.group))}},e.extend(e.Beads,e.Container,["clone","dispose"],"zimContainer",!1),e.Layout=function(t,o,n,r,i,a,l,s,c,u,d,h){var g,p="holder, regions, lastMargin, lastMarginMin, backgroundColor, vertical, showRegions, scalingObject, hideKey, style, group, inherit";if(g=zob(e.Layout,arguments,p,this))return g;z_d("80"),this.cjsEventDispatcher_constructor(),this.type="Layout",this.group=d;var f=!1===u?{}:e.getStyle(this.type,this.group,h);if(zot(t)&&(t=null!=f.holder?f.holder:null),zot(s)&&(s=null!=f.scalingObject?f.scalingObject:null),!zot(t)&&t.getBounds)if((s=zot(s)?t:s).getBounds&&s.getBounds()){var m,z=s.getBounds();t.setBounds(0,0,z.width,z.height),zot(n)&&(n=null!=f.lastMargin?f.lastMargin:0),zot(r)&&(r=null!=f.lastMarginMin?f.lastMarginMin:0),zot(a)&&(a=null==f.vertical||f.vertical),zot(i)&&(i=null!=f.backgroundColor?f.backgroundColor:""),zot(c)&&(c=null!=f.hideKey?f.hideKey:"B"),zot(l)&&(l=null!=f.showRegions?f.showRegions:null),l&&(m=new e.Shape);var y=this.backing=new e.Shape,v=this;if(this.active=!0,zot(o)&&(o=null!=f.regions?e.copy(f.regions):null),!zot(o)){var b;e.loop(o,(function(e,t){e instanceof createjs.DisplayObject&&(o[t]={object:e})})),this.regions=o;var w=0,C="minWidth",x="width",k="height",T="marginLeft",A="marginMinLeft",P="maxHeight";a&&(C="minHeight",x="height",k="width",T="marginTop",A="marginMinTop",P="maxWidth");for(var B=[],E=0,I=0;I<o.length;I++){if(!(b=o[I]).object||!b.object.getBounds())return void zogy("Layout(): each region object must have an object with setBounds() set");b[C]||(b[C]=0),b[x]||(b[x]=0),b.backgroundColor||(b.backgroundColor=""),b.given=0,b.maxGiven=0,"auto"==b[T]?(B[I]=!0,E++,b[A]?b[T]=b[A]:delete b[T]):b[T]&&b[A]&&b[T]<b[A]&&(b[T]=b[A]),zot(b[T])&&(b[T]=1e-4),b[P]||(b[P]=100),a?(b.align||(b.align="middle"),b.valign||(0==I?b.valign="top":I==o.length-1?b.valign="bottom":b.valign="middle",1==o.length&&(b.valign="middle"))):(b.valign||(b.valign="top"),b.align||(0==I?b.align="left":I==o.length-1?b.align="right":b.align="middle",1==o.length&&(b.align="middle"))),b[x]&&(b[C]=0),w+=b[x]+b[T]}if("auto"==n?(B[o.length]=!0,n=r||0):n&&r&&n<r&&(n=r),(w+=n)>100)zogy("Layout(): cannot fit regions into 100% bounds");else{var S=100-w;W(),this.resize=function(){var r;if(v.active){for(z=s.getBounds(),t.setBounds(0,0,z.width,z.height),y.graphics.clear(),""!=i&&(M(y,i),y.graphics.r(0,0,z.width,z.height)),r=0;r<o.length;r++)(b=o[r]).maxGiven=0,b.marginGiven=0;for(var l,c,u,d,h=!0,g=S;h;){for(h=!1,l=!0,r=0;r<o.length;r++)(b=o[r]).given>0&&0==b.maxGiven&&(c=b.object.getBounds()[x],(u=b.object.getBounds()[k])/c*(b.given*z[x]/100)>(d=b[P]*z[k]/100)&&"Window"!=b.object.type?(b.maxGiven=c/u*d*100/z[x],g-=b.maxGiven):l=!1);if(l)break;var p=0;for(r=0;r<o.length;r++)0==(b=o[r])[x]&&0==b.maxGiven&&(p+=b.object.getBounds()[x]);for(r=0;r<o.length;r++)0==(b=o[r])[x]&&0==b.maxGiven&&(b.given=b.object.getBounds()[x]/p*g)}var f=!0;if((b=o[0]).maxGiven>0?b.maxGiven<b[C]&&(b[x]=b[C],f=!1):b.given>0&&b.given<b[C]&&(b[x]=b[C],f=!1),(b=o[o.length-1]).maxGiven>0?b.maxGiven<b[C]&&(b[x]=b[C],f=!1):b.given>0&&b.given<b[C]&&(b[x]=b[C],f=!1),!f){for(w=0,r=0;r<o.length;r++)b=o[r],w+=b[x]+b[T];return(w+=n)>100?void zogy("zim display - Layout(): cannot fit regions into 100% bounds"):(S=100-w,W(),void v.resize())}var I=!0,O=0,j=0;for(r=0;r<o.length;r++)O+=(b=o[r])[T],b[x]>0?j+=b[x]:b.maxGiven>0?j+=b.maxGiven:b.given>0&&(j+=b.given),0==b[x]&&(I=!1);if(I||l){var L=100-j-(O+=n);if(O-=n+o[0][T],0!=L&&0!=O)for(r=0;r<o.length;r++)0!=r&&((b=o[r]).marginGiven=b[T]/O*(O+L))}if(E>0){var D=0,_=0;for(r=0;r<o.length;r++)(b=o[r]).marginGiven>0?_+=b.marginGiven:_+=b[T],b.marginGiven=0,D+=b[T]>.05?b[T]:0;var Y=(_-D)/E;for(r=0;r<B.length;r++)B[r]&&o[r]&&((b=o[r]).marginGiven=(b[A]?b[A]:0)+Y)}var X,R,H,F=0,N=0;if(m&&m.graphics){var V=m.graphics;V.c()}for(r=0;r<o.length;r++)(b=o[r]).marginGiven>0?F+=b.marginGiven*z[x]/100:F+=b[T]*z[x]/100,c=(c=b[x]>0?b[x]:b.maxGiven>0?b.maxGiven:b.given>0?b.given:0)*z[x]/100,u=b[P]*z[k]/100,N=(z[k]-u)/2,a?("Wrapper"==b.object.type&&b.object.resize(u),"Window"==b.object.type&&b.object.resize(u,c),"Region"==b.object.type&&b.object.setBounds(u,c),X=e.fit(b.object,N,F,u,c)):("Wrapper"==b.object.type&&b.object.resize(c),"Window"==b.object.type&&b.object.resize(c,u),"Region"==b.object.type&&b.object.setBounds(c,u),X=e.fit(b.object,F,N,c,u)),"top"==b.valign?b.object.y=X.bY:"bottom"==b.valign&&(b.object.y=X.bY+X.bHeight-X.height),"left"==b.align?b.object.x=X.bX:"right"==b.align&&(b.object.x=X.bX+X.bWidth-X.width),m&&m.graphics&&(V.s("white").ss(2).r(X.bX,X.bY,X.bWidth,X.bHeight),V.s("#ff8203").sd([20,20]).r(X.bX,X.bY,X.bWidth,X.bHeight).sd()),H=R=0,0!=F&&F+c!=z[x]||(a?H=1:R=1),u==z[k]&&(a?R=1:H=1),""!=b.backgroundColor&&(M(y,b.backgroundColor),y.graphics.r(X.bX,X.bY,X.bWidth+R,X.bHeight+H)),F+=c,b.object.ZIMoutlineShape&&b.object.outline()}},this.resize(),m&&t.addChild(m),t.addChildAt(y,0),WW.addEventListener("keydown",O),this.disable=function(){v.active=!1,WW.removeEventListener("keydown",O),m&&(m.alpha=0)},this.enable=function(){v.active=!0,WW.addEventListener("keydown",O),v.resize(),m&&(m.alpha=1)},this.removeShape=function(){m&&(m.graphics.clear(),m.dispose(),m=null,m=!1),WW.removeEventListener("keydown",O)},this.toggled=!0,this.toggle=function(e){return m.visible=!0===e||!1!==e&&!m.visible,v.toggled=m.visible,v},this.addShape=function(e){v.removeShape(),m=e,WW.addEventListener("keydown",O),t.addChild(m),v.resize()},!1!==u&&e.styleTransforms(this,f),this.dispose=function(){return v.resize=null,v.backing&&v.backing.dispose(),v.backing=null,v.removeShape(),!0}}}}else zog("zim controls - Layout(): holder must have bounds set or provide a scalingObject with bounds");else zog("zim controls - Layout(): please provide an object with bounds set that holds the objects being laid out");function W(){var e,t=0;for(e=0;e<o.length;e++)(b=o[e]).given=0,0==b[x]&&(t+=b.object.getBounds()[x]);for(e=0;e<o.length;e++)0==(b=o[e])[x]&&(b.given=b.object.getBounds()[x]/t*S)}function M(e,t){"GradientColor"==t.type?e.graphics.lf(t.colors,t.ratios,t.x0,t.y0,t.x1,t.y1):"RadialColor"==t.type?e.graphics.rf(t.colors,t.ratios,t.x0,t.y0,t.r0,t.x1,t.y1,t.r1):"BitmapColor"==t.type?e.graphics.bf(t.image,t.repetition,t.matrix):e.graphics.f(b.backgroundColor)}function O(e){e||(e=event),m&&String.fromCharCode(e.keyCode)==c.toUpperCase()&&(v.toggle(),m.stage&&m.stage.update())}},e.extend(e.Layout,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.Accessibility=function(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m){var z,y="appName, tabOrder, tabIndex, cycle, decimals, frame, application, alwaysHighlight, AHTime, AHColor, AHBorderWidth, AHBorderPadding, AHAlpha, AHObject, AHObjectScale";if(z=zob(e.Accessibility,arguments,y,this))return z;z_d("30.5"),this.cjsEventDispatcher_constructor(),this.type="Accessibility",zot(o)&&(o="application"),zot(i)&&(i=!1),zot(a)&&(a=2),zot(l)&&(l=WW.zdf),zot(s)&&(s=!e.mobile()),zot(c)&&(c=!1);var v=t(u);if(zot(u)&&(u="s"==v?.7:700),zot(d)&&(d="brown"),zot(h)&&(h=3),zot(g)&&(g=5),zot(p)&&(p=.8),zot(m)&&(m=.8),zot(f)){var b=new e.Shape({style:!1});b.mouseEnabled=!1}else f.mouseEnabled&&(f.mouseEnabled=!1);if(void 0===l)l=WW.zdf;if(zot(l))zon&&zogy("Accessibility - needs a Frame");else{var w=l.retina&&WW.devicePixelRatio||1,C=this;C.cycle=i,C.decimals=a,C.alwaysHighlight=c,C.AHTime=u,C.AHColor=d,C.AHBorderWidth=h,C.AHBorderPadding=g,C.AHAlpha=p,C.AHObjectScale=m;var x,k,T,A,P,B,E,I,S,W=-1,M=-1,O=[],j=[],L={RadioButtons:"option",Tabs:"tab",Pad:"key"},D=l.canvas.id,_=e.mobile(),Y=!1,X=null,R=[],H=150;Object.defineProperty(this,"tabOrder",{get:function(){return W},set:function(e){var t,n,r;for(k&&k.removeEventListener("focus",K),T&&T.removeEventListener("focus",K),t=0;t<O.length;t++)O[t].parentElement&&(O[t].outerHTML="");for(O=[],t=0;t<j.length;t++)(n=W[t])&&j[t][0].off("mousedown",j[t][1]);j=[],W=[];var i=[];S=l.shim?document.body:l.canvas,q=!1;var a=0;for(t=0;t<e.length;t++){if("HotSpots"==(n=e[t]).type&&(e.splice.apply(e,[t,1].concat(n.hotSpots)),n=n.hotSpots[0]),"HotSpot"==n.type&&(n=n.spot),n.constructor=={}.constructor){if(!(r=n.obj)||!r.getStage)continue;n.title||(n.title=ae(r))}else r=n,n={obj:n,title:ae(n)};if("RadioButtons"==r.type||"Tabs"==r.type||"Pad"==r.type){var s=[];a--;for(var c=0;c<r.buttons.length;c++){a++;var u=r.buttons[c],d={obj:u,title:n.title+" - "+L[r.type]+": "+("a"==u.text||"A"==u.text?"eh":u.text)};s.push(d),u.zimTabParent=r,u.zimTabParent.zimAccessibility=C,u.zimTabIndex=t+a,u.tabIndex=c,u.zimAccessibility=C,le(d),S=se(D+"Tab"+(t+a),d.title,S,d),j.push([u,u.on("mousedown",ie)]),Y||R.push([u,u.on("mousedown",Z)])}i=i.concat(s)}else r.zimTabIndex=t+a,r.zimTabParent=r,le(n),r.zimAccessibility=C,j.push([r,r.on("mousedown",ie)]),Y||R.push([r,r.on("mousedown",Z)]),i.push(n),S=se(D+"Tab"+(t+a),n.title,S,n)}(k=C.startAppTag=se(D+"PrefixTab",o+" start",l.shim?document.body:l.canvas,null,"before")).addEventListener("focus",K),Y||(k.addEventListener("focus",oe),(P=se(D+"noAriaTab","",k,null,"before")).setAttribute("aria-hidden",!0),P.focusTab=k,P.addEventListener("focus",te),(E=se(D+"noAriaTab","",k)).setAttribute("aria-hidden",!0),E.focusTab=k,E.addEventListener("focus",te)),S=se(D+"BufferTab","",S),_&&S.setAttribute("aria-hidden",!0),S=T=C.endAppTag=se(D+"SuffixTab",o+" end",S),T.addEventListener("focus",K),Y||(T.addEventListener("focus",oe),S=B=se(D+"noAriaTab","",T),B.setAttribute("aria-hidden",!0),B.focusTab=T,B.addEventListener("focus",te),(I=se(D+"noAriaTab","",T,null,"before")).setAttribute("aria-hidden",!0),I.focusTab=T,I.addEventListener("focus",te)),W=i}}),Object.defineProperty(this,"tabIndex",{get:function(){return M},set:function(t){if(U)if(t<0||t>=W.length)h();else{t!=M&&d();var o=W[t].obj;if(o.stage){if(M=t,o.focus=!0,N=!0,V=!1,C.changeTitle(o),o.zimTabTag.focus(),setTimeout((function(){o.zimTabTag.focus();var e=new createjs.Event("change");e.title=o.zimTabTag.getAttribute("aria-label"),C.dispatchEvent(e)}),H),C.alwaysHighlight&&(!X||!_)){if(C.AHObject){x=C.AHObject;var n=e.boundsToGlobal(o);C.AHObject.alp(C.AHAlpha).addTo(l.stage,null,!1),C.AHObject.fit(n.x,n.y,n.width,n.height),C.AHObject.sca(C.AHObject.scaleX*C.AHObjectScale),C.AHTime>0&&(F=setTimeout((function(){l.stage.removeChild(C.AHObject),l.stage.update()}),C.AHTime*("s"==v?1e3:1)))}else{x=b;var r=o.getBounds(),i=o.localToGlobal(r.x-5,r.y-5),a=o.localToGlobal(r.x+r.width+5,r.y-5),s=o.localToGlobal(r.x+r.width+5,r.y+r.height+5),c=o.localToGlobal(r.x-5,r.y+r.height+5),u=b.graphics;u.clear(),u.s(C.AHColor).ss(C.AHBorderWidth).mt(i.x-C.AHBorderPadding,i.y-C.AHBorderPadding).lt(a.x+C.AHBorderPadding,a.y-C.AHBorderPadding).lt(s.x+C.AHBorderPadding,s.y+C.AHBorderPadding).lt(c.x-C.AHBorderPadding,c.y+C.AHBorderPadding).lt(i.x-C.AHBorderPadding,i.y-C.AHBorderPadding).cp(),b.alpha=C.AHAlpha,C.AHTime>0&&(F=setTimeout((function(){l.stage.removeChild(b),l.stage.update()}),C.AHTime*("s"==v?1e3:1)))}l.stage.addChild(x),l.stage.update()}}else h()}function d(){if(M&&M>-1)W&&W[M]&&(W[M].obj.focus=!1);else for(var e=0;e<W.length;e++)W[e].obj.focus=!1}function h(){d(),N=!1,C.AHObject&&l.stage.removeChild(C.AHObject),C.alwaysHighlightShape&&l.stage.removeChild(C.alwaysHighlightShape),l.stage.update(),M=-1}}}),Object.defineProperty(this,"aria",{get:function(){return X},set:function(e){(X=e)&&J()}}),"android"==_&&(e.ACTIONEVENT="click",zns||(WW.ACTIONEVENT="click")),zot(n)?setTimeout((function(){if(-1==W){W=[];var t=[];e.loop(l.stage,(function(e){e.type&&t.push(e)})),C.tabOrder=t,zot(r)||(C.tabIndex=r)}}),50):(W=[],C.tabOrder=n,zot(r)||(C.tabIndex=r));var F,N=!1,V=!0,G=l.on("keydown",(function(e){if(9==e.keyCode&&(ce()||(N=!1,-1!=C.tabIndex&&(C.tabIndex=-1)),N?de(e):ue(e)),N&&W.length>0&&C.tabIndex>=0&&13==e.keyCode){var t=W[C.tabIndex],o=t.obj;if(t&&o.stage){var n=new createjs.Event("mousedown"),r=new createjs.Event("click");n.fromEnter=r.fromEnter=!0,"Pane"==o.type?(o.backdrop.dispatchEvent(n),o.backdrop.dispatchEvent(r)):(o.dispatchEvent(n),o.dispatchEvent(r))}}}));this.tab=function(e){if(clearTimeout(F),x&&l.stage.removeChild(x),zot(e)&&(e=1),0!=W.length)for(var t=0;t<W.length;t++){var o=W[t].obj;if(o.focus){o.focus=!1;var n=t+e,r=(n+1e4*W.length)%W.length,i=W[r];o=i.obj;for(var a=0,s=!1;!o.stage||!(!o.zimTabParent&&(zot(o.enabled)||o.enabled)||o.zimTabParent&&(zot(o.zimTabParent.enabled)||o.zimTabParent.enabled));)if(a++,r=((n+=e)+100*W.length)%W.length,o=(i=W[r]).obj,a==W.length){s=!0;break}if(s||!C.cycle&&n!=r&&!V)return void he(e);V=!1,C.tabIndex=r;break}}else he(e)},this.changeTitle=function(e,t,o){if("number"!=typeof e&&(e=e.zimTabIndex),!zot(e))if(o&&zot(t))C.tabIndex=e;else{var n=W[e],r=n.obj;zot(t)&&(t=r.zimTabTag.getAttribute("aria-label").split(" - currently")[0]),n.title=t,le(n),r.zimTabTag.setAttribute("aria-label",n.title),o&&(C.tabIndex=e)}};var q=!1;this.talk=function(e){q||((A=se(D+"TalkTab","",T)).setAttribute("role","alert"),q=!0),A.removeAttribute("role"),A.setAttribute("aria-label",e),A.setAttribute("role","alert");var t=new createjs.Event("change");t.title=e,C.dispatchEvent(t)},this.resize=function(e){if(zot(e))for(var t=0;t<W.length;t++)n(W[t].obj);else{if("number"!=typeof e&&(e=e.zimTabIndex),e<0)return;var o=W[e].obj;!o.stage&&x&&o==C.currentObject&&(l.stage.removeChild(x),l.stage.update()),n(o)}function n(e){if("TextArea"!=e.type&&"Loader"!=e.type){var t=e.boundsToGlobal(),o=e.zimTabTag;l.retina?(o.style.left=l.x+t.x*l.scale/w+"px",o.style.top=l.y+t.y*l.scale/w+"px",o.style.width=t.width*l.scale/w+"px",o.style.height=t.height*l.scale/w+"px"):(o.style.left=l.x+t.x*l.scale/w/w+"px",o.style.top=l.y+t.y*l.scale/w/w+"px",o.style.width=t.width*l.scale/w/w+"px",o.style.height=t.height*l.scale/w/w+"px"),o.setAttribute("aria-hidden",!e.stage),o.hidden=!e.stage}else e.resize()}},Object.defineProperty(this,"currentObject",{get:function(){return W[M]&&W[M].obj?W[M].obj:null},set:function(e){for(var t=0;t<W.length;t++)if(W[t].obj==e){C.tabIndex=t;break}}});var U=!0;Object.defineProperty(this,"enabled",{get:function(){return U},set:function(e){U=e}}),this.dispose=function(){b&&b.graphics.clear(),C.tabOrder=[];for(var e=0;e<O.length;e++)O[e].parentElement&&(O[e].outerHTML="");Q(),C.removeAllEventListeners(),l.off("keydown",G)}}function Q(){k&&(k.removeEventListener("focus",K),k.removeEventListener("focus",oe),k.parentNode&&(k.outerHTML="")),P&&(P.removeEventListener("focus",te),P.parentNode&&(P.outerHTML="")),E&&(E.removeEventListener("focus",te),E.parentNode&&(E.outerHTML="")),S&&S.parentNode&&(S.outerHTML=""),T&&(T.removeEventListener("focus",K),T.removeEventListener("focus",oe),T.parentNode&&(T.outerHTML="")),B&&(B.removeEventListener("focus",te),B.parentNode&&(B.outerHTML="")),I&&(I.removeEventListener("focus",te),I.parentNode&&(I.outerHTML=""))}function Z(t){var o=t.currentTarget.boundsToGlobal(),n=o.x+o.width/2,r=o.y+o.height/2;t.stageX/e.scaX<n-5||t.stageX/e.scaX>n+5||t.stageY/e.scaY<r-5||t.stageY/e.scaY>r+5?$():J()}function K(){A&&(A.innerHTML="")}function J(){var t,o;X=!0,ne(),A&&A.setAttribute("aria-hidden",!1),e.ACTIONEVENT="click",zns||(WW.ACTIONEVENT="click"),l.stage.removeChild(x),_&&(C.alwaysHighlight=!1),l.stage.update();for(var n=0;n<W.length;n++)(o=(t=W[n]).obj.zimTabTag).disabled=!1,t.title=t.title.replace(/\s\(use arrow keys\)/,""),o.setAttribute("aria-label",t.title),o.addEventListener("focus",ee)}function $(){X=!1;for(var e=0;e<W.length;e++)W[e].obj.zimTabTag.disabled=!1;ne(),c&&re()}function ee(e){var t=e.currentTarget,o=t.zimObject;M=o.zimTabIndex,o.focus=!0;var n=new createjs.Event("change");n.title=t.getAttribute("aria-label"),C.dispatchEvent(n)}function te(e){X=!1,e.target.focusTab.focus()}function oe(){zot(X)||X?J():$()}function ne(){Y=!0,k.removeEventListener("focus",oe),T.removeEventListener("focus",oe),P.removeEventListener("focus",te),B.removeEventListener("focus",te),P.parentNode&&(P.parentNode.removeChild(P),B.parentNode.removeChild(B)),E.removeEventListener("focus",te),I.removeEventListener("focus",te),E.parentNode&&(E.parentNode.removeChild(E),I.parentNode.removeChild(I));for(var e=0;e<R.length;e++)R[e][0].off("mousedown",R[e][1])}function re(){for(var e=0;e<O.length;e++){var t=O[e];(!t.zimObject||"Loader"!=t.zimObject.type&&"TextArea"!=t.zimObject.type&&"Tag"!=t.zimObject.type)&&(O[e].style.left="-2000px")}}function ie(e){var t=e.currentTarget;if("RadioButton"==t.type||"TabsButton"==t.type||"PadButton"==t.type)for(var o=0;o<t.zimTabParent.buttons.length;o++){var n=t.zimTabParent.buttons[o];n.zimTabTag.setAttribute("aria-label",n.zimTabTag.getAttribute("aria-label").split(" - currently")[0]+(t.zimTabParent.selectedIndex==n.tabIndex?" - currently selected.":" - currently not selected."))}C.tabIndex=e.currentTarget.zimTabIndex,C.activatedObject=t}function ae(e){return e.talk?e.talk:"TextArea"==e.type||"RadioButtons"==e.type||"Tabs"==e.type||"Pad"==e.type?e.type:"Waiter"==e.type?"Waiter active - please wait":e.text?e.type+" - "+("a"==e.text||"A"==e.text?"eh":e.text):e.type+("Dial"==e.type||"Slider"==e.type||"ColorPicker"==e.type||"Stepper"==e.type?" (use arrow keys)":"")+("TextArea"==e.type?" (press ENTER to edit)":"")}function le(t){var o=t.obj;t.title=t.title.replace(/\.$/,""),"RadioButton"==o.type||"TabsButton"==o.type||"PadButton"==o.type?t.title=t.title+(o.tabIndex==o.zimTabParent.selectedIndex?" - currently selected":" - currently not selected"):"CheckBox"==o.type?t.title=t.title+(o.checked?" - currently checked":" - currently not checked"):"Stepper"==o.type?t.title=t.title+" - currently displaying "+o.currentValue:"Slider"==o.type||"Dial"==o.type?t.title=t.title+" - currently at "+e.decimals(o.currentValue,C.decimals):"ColorPicker"==o.type?t.title=t.title+" - currently at "+o.selectedColor:"TextArea"==o.type?t.title=t.title+(""!=o.tag.value?"":" - placeholder: "+o.tag.placeholder):"Indicator"==o.type?t.title=t.title+" - currently "+(o.selectedIndex>=0?"at "+(o.selectedIndex+1)+" of "+o.num:"not indicating"):"TextInput"==o.type&&(t.title=t.title+(""!=o.htmlTag.value?"":" - placeholder: "+o.htmlTag.placeholder)),t.title+="."}function se(e,t,o,n,r){var i,a,c;if(n&&(i=n.obj),n&&("TextArea"==i.type||"Loader"==i.type))return(a=i.tag).setAttribute("aria-label",t),i&&a.setAttribute("aria-hidden",!i.stage),"before"==r?o.parentNode.insertBefore(a,o):o.parentNode.insertBefore(a,o.nextSibling),"TextArea"==i.type?a.style.zIndex=3:a.style.zIndex=-5,a.zimObject=i,n.obj.zimTabTag=a,O.push(a),a;if(n&&"TextInput"==i.type)return(a=i.htmlTag).setAttribute("aria-label",t),i&&a.setAttribute("aria-hidden",!i.stage),"before"==r?o.parentNode.insertBefore(a,o):o.parentNode.insertBefore(a,o.nextSibling),a.style.zIndex=-5,a.zimObject=i,n.obj.zimTabTag=a,O.push(a),a;if(!n||"Dial"!=i.type&&"Slider"!=i.type&&"Stepper"!=i.type&&"ColorPicker"!=i.type)a=document.createElement("div"),i&&(a.zimObject=i),a.innerHTML="tag",a.setAttribute("role",s?"application":"button"),"android"==_&&a.addEventListener("click",(function(){i.dispatchEvent("click")}));else{var u,d,h=[];if("Dial"==i.type||"Slider"==i.type){var g=i.step<=0?(i.max-i.min)/20:i.step;for(c=i.min;c<i.max;c+=g)h.push(i.min+c)}else"Stepper"==i.type?h=i.stepperArray:"ColorPicker"==i.type&&(h=i.colors);for((a=document.createElement("select")).disabled=!0,a.zimObject=i,a.addEventListener("change",(function(e){(X||"android"!=!_)&&(e.currentTarget.zimObject.zimTabParent.currentValueEvent=e.target.value,l.stage.update())})),a.size=1,c=0;c<h.length;c++)u=h[c],(d=document.createElement("option")).setAttribute("aria-label",u),d.innerHTML=u,a.add(d),u==i.zimTabParent.currentValue&&d.setAttribute("selected","selected");a.setAttribute("role","button")}if(a.setAttribute("id",e),a.setAttribute("tabindex",0),a.setAttribute("aria-label",t),i&&a.setAttribute("aria-hidden",!i.stage),"before"==r?o.parentNode.insertBefore(a,o):o.parentNode.insertBefore(a,o.nextSibling),a.style.position="absolute",n){var p=(i=n.obj).boundsToGlobal();l.retina?(a.style.left=l.x+p.x*l.scale/w+"px",a.style.top=l.y+p.y*l.scale/w+"px",a.style.width=p.width*l.scale/w+"px",a.style.height=p.height*l.scale/w+"px"):(a.style.left=l.x+p.x*l.scale+"px",a.style.top=l.y+p.y*l.scale+"px",a.style.width=p.width*l.scale+"px",a.style.height=p.height*l.scale+"px"),n.obj.zimTabTag=a}else a.style.left="-1000px",a.style.top=l.y+"px";return a.style.overflow="hidden",a.style.zIndex=-5,a.style.fontSize="20px",a.style.color="rgba(0,0,0,.01)",O.push(a),a}function ce(){for(var e=!1,t=0;t<O.length;t++)if(document.activeElement==O[t]){e=!0;break}return!(document.activeElement!=l.canvas&&!e)}function ue(e){l.shiftKey||zid(D+"PrefixTab")!=document.activeElement&&l.canvas!=document.activeElement?!l.shiftKey||zid(D+"SuffixTab")!=document.activeElement&&zid(D+"BufferTab")!=document.activeElement||(W.length>0&&(W[0].obj.focus=!0),V=!0,N=!0,de(e)):(W.length>0&&(W[W.length-1].obj.focus=!0),V=!0,N=!0,de(e))}function de(e){e.ctrlKey?he(e.shiftKey?-1:1):(e.shiftKey?C.tab(-1):C.tab(1),e.preventDefault())}function he(e){N=!1,zid(D+(1==e?"SuffixTab":"PrefixTab")).focus(),l.stage.removeChild(f),l.stage.update(),C.tabIndex=-1}},e.extend(e.Accessibility,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.Manager=function(e){z_d("75");var t,o,n=this;this.type=e,this.items=[],this.add=function(e){return Array.isArray(e)?n.items=n.items.concat(e):n.items.push(e),n},this.remove=function(e){if(n){if(e)for(Array.isArray(e)||(e=[e]),t=e.length-1;t>=0;t--){o=e[t];var r=n.items.indexOf(o);-1!=r&&n.items.splice(r,1)}else n.items=[];return n}},this.resize=function(e){if(n){if(e)for(Array.isArray(e)||(e=[e]),t=e.length-1;t>=0;t--)(o=e[t]).resize||-1==n.items.indexOf(o)?o.resize():n.items.splice(n.items.indexOf(o),1);else for(t=n.items.length-1;t>=0;t--)n.items[t].resize?n.items[t].resize():n.items.splice(t,1);return n}},this.toggle=function(e,t){if(n){if(t)for(Array.isArray(t)||(t=[t]),r=t.length-1;r>=0;r--)(o=t[r]).resize||-1==n.items.indexOf(o)?o.toggle(e):n.items.splice(n.items.indexOf(o),1);else for(var r=n.items.length-1;r>=0;r--)n.items[r].resize?n.items[r].toggle(e):n.items.splice(r,1);return n}},this.dispose=function(e){if(n){if(n.resize=null,e)for(Array.isArray(e)||(e=[e]),t=e.length-1;t>=0;t--)o=e[t],-1!=n.items.indexOf(o)&&n.items.splice(n.items.indexOf(o)),o.dispose&&o.dispose();else{for(t=n.items.length-1;t>=0;t--)n.items[t].resize?n.items[t].dispose():n.items.splice(t,1);n.items=null}return!0}}},e.ResizeManager=function(){z_d("75.5"),e.Manager.call(this,"ResizeManager")},e.ResizeManager.prototype=new e.Manager,e.ResizeManager.prototype.constructor=e.ResizeManager,e.TransformManager=function(t,o){z_d("75.7");var n=this;function r(e){!localStorage||e&&!e.pressup||n.savePersist(e)}this.type="TransformManager",this.persistID=o,this.items=[],this.add=function(e){var t,o=[];o=Array.isArray(e)?e:[e];for(var r=!1,i=0;i<o.length;i++)if((t=o[i]).transformControls&&(t.originalVisible=t.transformControls.visible),t.toggle&&t.toggle(!1),0==n.items.length&&0==i&&(r=!0),"Blob"==t.type||"Squiggle"==t.type)n.persistID||r&&(r=!1,t.controlsVisible=!0,n.currentObject=t),t.on("change",(function(e){var t=new createjs.Event("transformed");t.transformObject=e.target,t.transformType=e.controlType,n.dispatchEvent(t)})),t.on("controlsshow",(function(e){var t=new createjs.Event("transformshow");n.currentObject=t.transformObject=e.target,n.dispatchEvent(t)})),t.on("controlshide",(function(e){var t=new createjs.Event("transformhide");t.transformObject=e.target,n.currentObject=null,n.dispatchEvent(t)})),t.on("update",(function(e){var t=new createjs.Event("transformed");t.transformObject=e.target,t.transformType=e.controlType,n.dispatchEvent(t)}));else{var a=t.transformControls;n.persistID||r&&"Layer"!=t.type&&(r=!1,t.originalVisible&&(a.show(),n.currentObject=t)),t.on("transformed",(function(e){var t=new createjs.Event("transformed");t.transformObject=e.target,t.transformType=e.transformType,n.dispatchEvent(t)})),t.on("transformshow",(function(e){var t=new createjs.Event("transformshow");n.currentObject=t.transformObject=e.target,n.dispatchEvent(t)})),t.on("transformhide",(function(e){var t=new createjs.Event("transformhide");t.transformObject=e.target,n.currentObject=null,n.dispatchEvent(t)}))}n.items=n.items.concat(e),n.persist&&!zot(n.persistID)&&n.persist(n.persistID)},this.remove=function(e){if(zot(e))n.items=[];else{var t;Array.isArray(e)||(e=[e]);for(var r=0;r<e.length;r++){t=e[r],n.currentObject==t&&(n.currentObject=null),t.transformedEvent&&(t.off("transformed",t.transformedEvent),t.transformedEvent=null),"Blob"==t.type||"Squiggle"==t.type?t.controlsVisible=!1:t.transformControls.remove();var i=n.items.indexOf(t);-1!=i&&n.items.splice(i,1)}o&&n.savePersist()}},this.show=function(e){if(!zot(e)){if("Blob"==e.type||"Squiggle"==e.type)e.controlsVisible||(e.controlsVisible=!0);else{var t=e.transformControls;if(!t||t.visible)return;t.show()}n.currentObject=e}},this.hide=function(e){if(!zot(e))if(n.currentObject==e&&(n.currentObject=null),"Blob"==e.type||"Squiggle"==e.type)e.controlsVisible&&(e.controlsVisible=!1);else{var t=e.transformControls;if(!t||t.visible)return;t.hide()}},this.hideAll=function(e){for(var t,o,r=0;r<n.items.length;r++)if((o=n.items[r])&&(o.transformControls||o.update)){if(n.items[r]==e)continue;"Blob"==o.type||"Squiggle"==o.type?o.controlsVisible&&(o.controlsVisible=!1):(t=n.items[r].transformControls).visible&&t.hide()}else n.items.splice(r);n.currentObject=null},this.resize=function(){if(n){for(var e,t=0;t<n.items.length;t++)(e=n.items[t])&&(e.transformControls||e.update)?"Blob"==e.type||"Squiggle"==e.type?e.update():e.transformControls.resize():n.items.splice(t);o&&n.savePersist()}},zot(t)||n.add(t);var i="TransformManager persist(persistID) - sorry, must provide id";this.persist=function(t){var o,a;if(zot(t)&&zon)zogy(i);else{n.persistID=t;var l=0;if(localStorage&&localStorage[t]){var s=n.persistData=JSON.parse(localStorage[t]);if(s.length==n.items.length)for(a=0;a<n.items.length;a++)s[a].controls&&(n.currentObject=n.items[a]),!s[a]||"Blob"!=s[a].type&&"Squiggle"!=s[a].type?s[a]&&(zot(n.items[a].transformControls)?function(){var t=o=n.items[a],r=s[a];e.interval(50,(function(e){t.transformControls&&(t.transformControls.setData(r),t.dispatchEvent("persistset"),++l==s.length&&(setTimeout((function(){t==n.currentObject&&n.currentObject.toggle(!0),n.dispatchEvent("persistcomplete")}),100),e.clear()))}),20,null,null,"ms")}():(n.items[a].transformControls.setData(s[a]),function(){var t=o=n.items[a];e.interval(50,(function(e){t.dispatchEvent("persistset"),++l==s.length&&(setTimeout((function(){t==n.currentObject&&n.currentObject.toggle(!0),n.dispatchEvent("persistcomplete")}),100),e.clear())}),20,null,null,"ms")}())):(n.items[a].points.length!=s[a].points.length&&(n.items[a].points=s[a].points),n.items[a].setData(s[a]),n.items[a]==n.currentObject&&n.currentObject.toggle(!0),++l==s.length&&setTimeout((function(){n.dispatchEvent("persistcomplete")}),100))}for(a=0;a<n.items.length;a++)(o=n.items[a]).transformedEvent||("Blob"==o.type||"Squiggle"==o.type?(o.transformedEvent=o.on("change",(function(e){e.pressup=!0,r(e)})),o.transformedEvent=o.on("update",(function(e){e.pressup=!0,r(e)})),o.transformedEvent=o.on("controlsshow",(function(e){e.pressup=!0,r(e)})),o.transformedEvent=o.on("controlshide",(function(e){e.pressup=!0,r(e)}))):(o.transformedEvent=o.on("transformed",r),o.transformedEvent=o.on("transformshow",r),o.transformedEvent=o.on("transformhide",r)))}},this.savePersist=function(){for(var e=[],t=0;t<n.items.length;t++){var o=n.items[t];"Blob"==o.type||"Squiggle"==o.type?o.recordData&&e.push(o.recordData()):o.transformControls&&o.transformControls.recordData&&e.push(o.transformControls.recordData())}n.persistData=e,localStorage[n.persistID]=JSON.stringify(e)},this.clearPersist=function(e){zot(e)&&zon?zogy(i):(n.persistData=null,localStorage&&localStorage.removeItem(e))},this.stopPersist=function(){for(var e=0;e<n.items.length;e++){var t=n.items[e];t.transformedEvent&&("Blob"==t.type||"Squiggle"==t.type?t.off("change",t.transformedEvent):t.off("transformed",t.transformedEvent),t.transformedEvent=null)}n.persistData=null},zot(o)||n.persist(o),this.dispose=function(e,t){if(zot(e)&&(e=!0),n.removeAllEventListeners(),n.persistID&&e&&n.stopPersist(),t)for(var o=0;o<n.items.length;o++){var r=n.items[o];"Blob"==r.type||"Squiggle"==r.type?r.dispose():r.transformControls.dispose()}}},e.extend(e.TransformManager,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.GuideManager=function(){z_d("77"),e.Manager.call(this,"GuideManager")},e.GuideManager.prototype=new e.Manager,e.GuideManager.prototype.constructor=e.GuideManager,e.GridManager=function(){z_d("79"),e.Manager.call(this,"GridManager")},e.GridManager.prototype=new e.Manager,e.GridManager.prototype.constructor=e.GridManager,e.LayoutManager=function(){z_d("81"),e.Manager.call(this,"LayoutManager")},e.LayoutManager.prototype=new e.Manager,e.LayoutManager.prototype.constructor=e.LayoutManager,e.SelectionSet=function(e){z_d("81.5"),this.type="SelectionSet",zot(e)&&(e=[]),this.selections=e,this.clear=function(){this.selections=[]},this.isSelected=function(e){return this.selections.indexOf(e)>=0},this.add=function(e,t,o,n){if(!zot(e)&&(zot(t)&&(zot(this.selectionManager)||(t=this.selectionManager.multiple)),zot(this.selectionManager)||(this.selectionManager.setCurrent(this),!t&&this.selectionManager.multipleSets&&this.selectionManager.clear()),t||this.clear(),!(this.selections.indexOf(e)>=0))){if(this.selections.push(e),!zot(o)){Array.isArray(o)||(o=[o]);for(var r=0;r<=o.length;r++)o[r].add(e,t)}if(!zot(n))for(Array.isArray(n)||(n=[n]),r=0;r<=n.length;r++)n[r].remove(e,t)}},this.remove=function(e,t,o,n){if(!zot(e)){zot(t)&&(zot(this.selectionManager)||(t=this.selectionManager.multiple)),zot(this.selectionManager)||this.selectionManager.setCurrent(this),t||this.clear();var r=this.selections.indexOf(e);if(zot(this.selectionManager)||(this.selectionManager.setCurrent(this),!t&&this.selectionManager.multipleSets&&this.selectionManager.clear()),t||this.clear(),t?r>=0&&this.selections.splice(r,1):this.clear(),!zot(o)){Array.isArray(o)||(o=[o]);for(var i=0;i<=o.length;i++)o[i].remove(e,t)}if(!zot(n))for(Array.isArray(n)||(n=[n]),i=0;i<=n.length;i++)n[i].add(e,t)}},this.toggle=function(e,t,o,n){this.isSelected(e)?this.remove(e,t,o,n):this.add(e,t,o,n)},this.dispose=function(){return this.clear(),this.selections=null,!0}},e.SelectionManager=function(e,t,o){z_d("81.6"),this.cjsEventDispatcher_constructor(),this.type="SelectionManager",zot(e)&&(e=[]),zot(o)&&(o=!0),Array.isArray(e)||(e=[e]),this.sets=e,this.multipleKey=t,this.multipleSets=o,this.multiple=!1;for(var n=this,r=0;r<e.length;r++)e[r].selectionManager=this;this.clear=function(){this.currentSet=null;for(var t=0;t<e.length;t++)e[t].clear()},this.setCurrent=function(t){this.currentSet=t;for(var o=0;o<e.length;o++)e[o]!=t&&(this.multipleSets||e[o].clear())};var i=new createjs.Event("keydown");this.eventRemove=i.remove,this.keydownEvent=function(e){e.remove=n.eventRemove,n.multipleKey&&(n.multiple=e[n.multipleKey+"Key"]),n.ctrlKey=e.ctrlKey,n.shiftKey=e.shiftKey,n.metaKey=e.metaKey,n.dispatchEvent(e),90==e.keyCode&&(n.ctrlKey||n.metaKey)&&n.dispatchEvent("undo")},WW.addEventListener("keydown",this.keydownEvent),this.keyupEvent=function(e){n.multipleKey&&(n.multiple=e[n.multipleKey+"Key"]),n.ctrlKey=e.ctrlKey,n.shiftKey=e.shiftKey,n.metaKey=e.metaKey,e.remove=n.eventRemove,n.dispatchEvent(e)},WW.addEventListener("keyup",this.keyupEvent),this.dispose=function(){this.clear(),WW.removeEventListener("keydown",this.keydownEvent),WW.removeEventListener("keyup",this.keyupEvent)}},e.extend(e.SelectionManager,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),void 0===i)var i;e.Bind=function(t,o,n,r,a,l,s,c){var u,d="connection, bindType, master, masterFilter, couple, smartDecimals, report, setDefault";if(u=zob(e.Bind,arguments,d,this))return u;z_d("81.8"),this.type="Bind";var h=this;function g(t,o,n){var r,i=[];if(zot(o)&&zot(n)){if("from"==t&&h.bindType!=e.LOCALSTORAGE)return e.loop(h.bindings,(function(e){e.filter&&i.push(e.filter)})),[i,"full"];r=h.ids}else zot(o)||Array.isArray(o)||(o=[o]),zot(n)||Array.isArray(n)||(n=[n]),o&&(r=[],e.loop(o,(function(t){if("string"==typeof t)r.indexOf(t)<0&&r.push(t);else{var o=h.objIDs.at(t);o&&e.loop(o,(function(e){r.indexOf(e)<0&&r.push(e)}))}})));var a={};return r?function(o){e.loop(r,(function(n){var r=h.bindings[n];if(r){r.filter&&i.push(r.filter);var l=r.obj;e.loop(o||r.props,(function(o){var r=h.toIDs[o];if(r&&r.indexOf(n)>=0)if("from"==t)a[n]||(a[n]=[]),a[n].push(o);else{a[n]||(a[n]={});var i=l[o];"number"==typeof i&&h.smartDecimals&&(i=i>1?e.decimals(i,1):e.decimals(i,2)),a[n][o]=e.copy(i)}}))}}))}(n):n&&function(){var o=[];e.loop(n,(function(n){e.loop(h.toIDs[n],(function(r){var l=h.bindings[r];o.indexOf(r)<0&&(l.filter&&i.push(l.filter),o.push(r));var s=l.obj;if("from"==t)a[r]||(a[r]=[]),a[r].push(n);else{a[r]||(a[r]={});var c=s[n];"number"==typeof c&&h.smartDecimals&&(c=c>1?e.decimals(c,1):e.decimals(c,2)),a[r][n]=e.copy(c)}}))}))}(),[i,a]}zot(t)&&localStorage&&zot(i)&&(zot(o)||o==e.LOCALSTORAGE)?(t="zimBind",o=e.LOCALSTORAGE):t&&t.match(/\/|\./)?(zot(o)&&(o=e.GET),t.match(/\?/)?t+="&":t+="?"):t&&zot(o)&&(o=e.LOCALSTORAGE),zot(l)&&(l=!0),o!=e.LOCALSTORAGE||localStorage||(zon&&zogy("Bind() - no localStorage"),h.error="error - no localStorage"),this.connection=t,this.bindType=o,this.master=n,this.masterFilter=r,this.smartDecimals=l,zot(s)&&(s=!1),i&&!c||(i=this),Object.defineProperty(h,"default",{get:function(){return h==i},set:function(e){e||i!=h?e&&(i=h):i=null}}),this.bindType==e.POST&&(h.ajax=new e.Ajax),this.bindings={},this.ids=[],this.data={},this.objIDs=new e.Dictionary(!0),this.toIDs={},this.fromIDs={},this.add=function(t,o,n,r,i){if(zot(n)||zot(o)||zot(t))return h;if(h.bindings[t]){if(h.bindings[t].obj!=o)return zon&&zogy("Bind() - id can be used with only one object"),h}else{h.ids.indexOf(t)<=0&&h.ids.push(t),h.bindings[t]={obj:o,props:[]},zot(i)||"function"!=typeof i||(h.bindings[t].filter=i);var a=h.objIDs.at(o);a?a.indexOf(t)<0&&a.push(t):h.objIDs.add(o,[t])}Array.isArray(n)||n.constructor=={}.constructor||(n=[n]);var l=h.bindings[t].props;function c(e,t,o){zot(e[t])?e[t]=[o]:e[t].indexOf(o)<0&&e[t].push(o)}return Array.isArray(n)?e.loop(n,(function(e){c(h.toIDs,e,t),c(h.fromIDs,e,t),l.indexOf(e)<0&&l.push(e)})):e.loop(n,(function(o,n){n!=e.BOTH&&n!=e.TO||c(h.toIDs,o,t),n!=e.BOTH&&n!=e.FROM||c(h.fromIDs,o,t),l.indexOf(o)<0&&l.push(o)})),s&&z("Bind Report: ADD ["+t+"]",(n?" "+n:"")+(r?" "+r:"")),h.bindType==e.LOCALSTORAGE?(h.from(null,t,n,r),h.data&&!e.isEmpty(h.data)||h.to(t,n)):(f("bind",null,[i],h.data,r),h.applyData()),h},this.updatefilter=function(e,t){var o=h.bindings[e];return o&&(zot(t)?o.filter&&delete o.filter:"function"==typeof t&&(o.filter=t)),h},this.remove=function(t,o,n,r,i,l){var c;if(zot(t)||Array.isArray(t)||(t=[t]),!zot(t)){c=[];var u=[];e.loop(t,(function(e){"string"==typeof e?c.push(e):u.push(e)}))}zot(o)||Array.isArray(o)||(o=[o]),zot(i)&&(i=!0),0==(t=c.concat(u)).length&&(t=null);var d=g("from",t,o),p=f("remove",r,d[0],d=d[1],n);if("stop"!=p){var m=e.copy(d);if(zot(o)||0==o.length?(c.length>0&&e.loop(c,(function(e){w(e,!0)})),u.length>0&&e.loop(u,(function(t){(c=h.objIDs.at(t)).length>0&&e.loop(c,(function(e){w(e,!1)})),h.objIDs.remove(t)}))):(c=[],e.loop(d,(function(t,o){var n=h.bindings[t].props;e.loop(o,(function(e){var o=n.indexOf(e);o>=0&&n.splice(o,1),b(e,t)})),0==n.length&&c.push(t)})),c.length>0&&h.remove(c)),i){var y="type="+h.bindType+"&";h.bindType==e.LOCALSTORAGE?(h.to(),v("success")):h.bindType==e.GET?(p=JSON.stringify(m),a&&(p=e.couple(p)),e.async(h.connection+y+"remove="+p,v,"callbackRemove")):h.bindType==e.POST?h.ajax.post(h.connection+y,m,v,"remove"):(h.bindType,e.SOCKET)}return h}function v(t){l&&"function"==typeof l&&(a&&(t=e.couple(t)),l(t)),s&&z("Bind Report: REMOVE"+(n?" ["+n+"]":""),t)}function b(e,t){var o,n;(o=h.fromIDs[e])&&((n=o.indexOf(t))>=0&&o.splice(n,1),0==o.length&&delete h.fromIDs[e]),(o=h.toIDs[e])&&((n=o.indexOf(t))>=0&&o.splice(n,1),0==o.length&&delete h.toIDs[e])}function w(t,o){var n=h.bindings[t].obj,r=h.bindings[t].props,i=h.objIDs.at(n),a=i.indexOf(t);a>=0&&i.splice(a,1),o&&0==i.length&&u.push(n),(a=h.ids.indexOf(t))>=0&&h.ids.splice(a,1),e.loop(r,(function(e){b(e,t)})),delete h.bindings[t]}},this.stopProcess=!1,this.stop=function(){h.stopped=!0};var p=function(){var e=this;e.stop=function(){e.stopped=!0}};function f(t,o,n,r,i){var a=new p,l=null!=r&&!e.isEmpty(r)&&h.data;return m(a,i)?["stop",r]:(h.masterFilter&&"function"==typeof h.masterFilter&&(r=h.data=h.masterFilter(r,t,i,a)),"stop"==e.loop(n,(function(e){if("function"==typeof e){if(m(a,i))return"stop";r=h.data=e(r,t,i,a)}}))||m(a,i)?["stop",r]:(o&&"function"==typeof o&&(r=h.data=o(r,t,i,a)),m(a,i)?["stop",r]:(l&&!h.data&&zon&&zogy("Bind()"+(t?" ["+t+"]":"")+(i?" ["+i+"]":"")+" - warning, a filter may not have returned data"),["go",r])))}function m(e,t){if(h.stopped||e.stopped)return z("STOP"+(t?" ["+t+"]":""),e.stopped?"process stopped":"bind stopped"),e.stopped?e.stop=null:h.stopped=!1,!0}function z(e,t){h==i?zogl(e,t):zogd(e,t)}return this.to=function(t,o,r,i,l,c,u,d){var p,m="targets, props, extra, filter, smartDecimals, call, lock, unique";if(p=zob(h.to,arguments,m))return p;var y=g("to",t,o),v=y[0],b=f("to",i,v,y=y[1],r);if(y=b[1],"stop"!=b[0]){if(h.bindType==e.LOCALSTORAGE)localStorage[h.connection]=JSON.stringify(y),B(y);else{var w="type="+h.bindType+"&";if(!y||e.isEmpty(y))return h;if(h.bindType==e.GET){var C=y;e.isJSON(C)||(C=JSON.stringify(C)),a&&(C=e.couple(C)),s&&z("Bind Report: TO [bindings]",C),C=e.urlEncode(C);var x=zot(h.master)?"":"&master="+e.urlEncode(n),k=zot(u)?"":"&lock="+e.urlEncode(u),T=zot(d)?"":"&unique="+e.urlEncode(d),A=zot(r)?"":"&extra="+e.urlEncode(r),P=h.connection+w+"command=to&data="+C+x+k+T+A;s&&z("Bind Report: TO [url]",P),e.async(P,B,"callbackTo")}else h.bindType==e.POST&&(h.ajax.master=n,h.ajax.couple=a,h.ajax.lock=u,h.ajax.unique=d,s&&z("Bind Report: TO [bindings]",y),h.ajax.post(h.connection+w,y,"to",r,B))}return h}function B(t){a&&(t=e.decouple(t)),c&&"function"==typeof c&&c(t),s&&z("Bind Report: TO"+(r?" ["+r+"]":" -"),t)}},this.toLock=function(t,o,n,r,i,a){var l,s="targets, props, extra, filter, smartDecimals, call";if(l=zob(h.toLock,arguments,s))return l;if("localstorage"==h.bindType.toLowerCase())return h.to(t,o,n,r,i,a),h;var c=e.makeID();function u(){h.to(t,o,n,r,i,a,c)}h.from(u,t,o,n,r,c)},this.toUnique=function(e,t,o,n,r,i){var a,l="targets, props, extra, filter, smartDecimals, call";if(a=zob(h.toUnique,arguments,l))return a;h.to(e,t,o,n,r,i,null,!0)},this.toggleReport=function(e){return s=zot(e)?!s:e,h},s&&z("Bind Report: CREATE ["+o.toUpperCase()+"]",t+(n?" "+n:"")),this.report=function(){var t="Bind {DATA} Report:",o=e.copy(h.data);h==i?zogl(t,o):zogd(t,o),t="Bind {BINDINGS} Report:",o=e.copy(h.bindings),h==i?zogl(t,o):zogd(t,o)},this.from=function(t,o,r,i,l,c){var u,d="call, targets, props, extra, filter, lock";if(u=zob(h.from,arguments,d))return u;var p=g("from",o,r),m=p[0];p=p[1];var y=f("fromTo",l,m,p,i);if(p=y[1],"stop"!=y[0]){var v="type="+h.bindType+"&";if(h.bindType==e.LOCALSTORAGE)localStorage[h.connection]&&null!=localStorage[h.connection]||(localStorage[h.connection]="{}"),h.data=JSON.parse(localStorage[h.connection]),T(h.data);else if(h.bindType==e.GET){var b=p;e.isJSON(b)||(b=JSON.stringify(b)),a&&(b=e.couple(b)),s&&z("Bind Report: FROM [bindings]",b),b=e.urlEncode(b);var w=zot(h.master)?"":"&master="+e.urlEncode(n),C=zot(c)?"":"&lock="+e.urlEncode(c),x=zot(i)?"":"&extra="+e.urlEncode(i),k=h.connection+v+"data="+b+"&command=from"+w+C+x;s&&z("Bind Report: FROM [url]",k),e.async(k,T,"callbackFrom")}else h.bindType==e.POST&&(h.ajax.master=n,h.ajax.couple=a,h.ajax.lock=c,s&&z("Bind Report: FROM [bindings]",p),h.ajax.post(h.connection+v,p,"from",i,T));return h}function T(o){if(h.data=o,a&&(h.data=e.decouple(h.data)),!zot(c))var n=JSON.stringify(h.data);if("stop"!=f("from",l,m,h.data,i)[0]){var r=!1;(zot(c)||n!=JSON.stringify(h.data))&&(r=!0,h.applyData()),s&&z("Bind Report: FROM"+(i?" ["+i+"]":" -"),r?h.data:"data not applied in toLock()"),t&&"function"==typeof t&&t(h.data)}}},this.applyData=function(){return e.loop(h.data,(function(t,o){if(h.bindings[t]){var n=h.bindings[t].obj;e.loop(o,(function(e,t){n[e]=t}))}})),h},this.clear=function(){return h.bindType==e.LOCALSTORAGE&&(localStorage[h.connection]=null),h},this.removeAllBindings=function(t,o){if(zot(t)&&(t=!0),this.bindings={},this.ids=[],this.data={},this.objIDs=new e.Dictionary(!0),this.toIDs={},this.fromIDs={},t){var r="type="+h.bindType+"&";if(h.bindType==e.LOCALSTORAGE)h.clear(),a("success");else if(h.bindType==e.GET){var i=zot(h.master)?"":"&master="+encodeURI(n);e.async(h.connection+r+"command=removeAll"+i,a,"callbackRemoveAll")}else h.bindType==e.POST&&(h.ajax.master=n,h.ajax.post(h.connection+r,{},"removeAll",null,a,"removeAll"))}function a(e){o&&"function"==typeof o&&o(e),s&&z("Bind Report: REMOVEALL",e)}return h},h},e.Swipe=function(o,n,r,i,a){var l,s="obj, distance, duration, isometric, overrideNoSwipe";if(l=zob(e.Swipe,arguments,s,this))return l;if(z_d("70"),this.cjsEventDispatcher_constructor(),this.type="Swipe",!zot(o)&&o.on){zot(n)&&(n=30);var c,u,d,h,g,p,f=t(r);zot(r)&&(r="s"==f?.08:80),this.distance=n,this.duration=r,this.active=!0;var m,z,y=this,v=o.on("mousedown",(function(t){function n(){var o=new createjs.Event("swipe");if(o.obj=y.obj,o.stageX=t.stageX/e.scaX,o.stageY=t.stageY/e.scaY,o.rawX=t.rawX/e.scaX,o.rawY=t.rawY/e.scaY,o.swipeX=o.swipeY=0,y.direction="none",i){if(Math.abs(h-c)>y.distance||Math.abs(g-u)>y.distance){var n=180*Math.atan2(g-u,h-c)/Math.PI;(n=(n+360)%360)>=270&&n<360?(o.swipeY=-1,y.direction="up"):n>=0&&n<90?(o.swipeX=1,y.direction="right"):n>=90&&n<180?(o.swipeY=1,y.direction="down"):n>=180&&n<270&&(o.swipeX=-1,y.direction="left")}}else Math.abs(h-c)>Math.abs(g-u)?(h-c>y.distance&&(o.swipeX=1,y.direction="right"),c-h>y.distance&&(o.swipeX=-1,y.direction="left")):(g-u>y.distance&&(o.swipeY=1,y.direction="down"),u-g>y.distance&&(o.swipeY=-1,y.direction="up"));y.dispatchEvent(o)}!y.active||!a&&t.target.zimNoSwipe||(y.obj=t.target,h=c=t.stageX/e.scaX,g=u=t.stageY/e.scaY,d=!0,y.dispatchEvent("swipedown"),clearTimeout(p),p=setTimeout((function(){d&&(n(),d=!1)}),y.duration*("s"==f?1e3:1)),m=o.on("pressmove",(function(t){h=t.stageX/e.scaX,g=t.stageY/e.scaY})),z=o.on("pressup",(function(){d&&(n(),d=!1,clearTimeout(p))})))}));this.disable=function(){y.active=!1},this.enable=function(){y.active=!0},this.dispose=function(){v&&o.off("mousedown",v),m&&o.off("pressmove",m),z&&o.off("pressup",z)}}else zogy("zim controls - Swipe():\nPlease pass in object")},e.extend(e.Swipe,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.Swiper=function(o,n,r,i,a,l,s,c,u,d,h,g,p){var f,m="swipeOn, target, property, sensitivity, swiperType, min, max, damp, integer, factor, loop, pauseTime, otherSwiper";if(f=zob(e.Swiper,arguments,m,this))return f;if(z_d("69.5"),this.cjsEventDispatcher_constructor(),this.type="Swiper",!zot(o)&&o.getStage&&o.stage){if(!zot(n)){zot(i)&&(i=1),zot(a)&&(a="horizontal"),zot(c)&&(c=.1),zot(u)&&(u=!1),zot(d)&&(d=1),zot(h)&&(h=!1);var z=t(g);zot(g)&&(g="s"==z?.2:200);var y,v,b,w=this,C=o,x=w.desiredValue=n[r];this.target=n,this.property=r,this.sensitivity=i;var k,T,A,P=!1,B=WW.zdf||o.stage?o.stage.frame:{};C.canvas?(b=C,w.downEvent=C.on("stagemousedown",(function(e){P=!0,_(e),w.moveEvent=C.on("stagemousemove",Y),w.upEvent=C.on("stagemouseup",L),w.upEvent2=B.on("mouseupplus",L)}))):(b=C.stage,R(),w.downEvent=C.on("mousedown",_),w.moveEvent=C.on("pressmove",Y),w.upEvent=C.on("pressup",D),w.upEvent2=B.on("mouseupplus",D));var E,I,S=Math.sqrt(Math.pow(C.width,2)+Math.pow(C.height,2)),W=new e.Damp(w.target[w.property],c),M=x,O=x;w.swiperTicker=e.Ticker.add((function(){x==M?x!=O&&(w.pauseTimeout&&w.pauseTimeout.clear(),O=x,w.pauseTimeout=e.timeout(g,(function(){P&&w.dispatchEvent("swipepause"),w.pauseTimeout=null}))):(O=null,M=x,w.pauseTimeout&&w.pauseTimeout.clear()),w.swiperMoving&&(w.target[w.property]=u?Math.round(W.convert(x)):W.convert(x),!P&&Math.abs(w.target[w.property]-x)<(zot(s)||zot(l)?.5:Math.abs(s-l)/1e3)&&(w.swiperMoving=!1,w.target[w.property]=x,w.immediate(w.target[w.property]),w.dispatchEvent("swipestop")))}),b),this.immediate=function(e){W.immediate(e),w.target[w.property]=u?Math.round(e):e,w.desiredValue=x=e};var j=!0;Object.defineProperty(w,"enabled",{get:function(){return j},set:function(e){j!=e&&(e?F():H(),j=Boolean(e))}}),Object.defineProperty(w,"desiredValue",{get:function(){return x},set:function(e){x=e}}),Object.defineProperty(w,"damp",{get:function(){return c},set:function(e){c=e,W.damp=c}}),this.dispose=function(){H(),W=null,w.swiperTicker=null}}}else zogy("zim.Swiper() - please provide container on stage");function L(){P=!1,C.off("stagemousemove",w.moveEvent),C.off("stagemouseup",w.upEvent),w.dispatchEvent("swipeup")}function D(){P=!1,w.dispatchEvent("swipeup")}function _(t){b=t.target.stage,A=(C.parent?C.parent:C).localToGlobal(C.x,C.y),P=!0,"radial"==a?(E=t.stageX/e.scaX,I=t.stageY/e.scaY,k=Math.atan2(I-A.y,E-A.x)*e.DEG):y="horizontal"==a?t.stageX/e.scaX:t.stageY/e.scaY,v=w.target[w.property],w.dispatchEvent("swipedown")}function Y(t){if(P){if("radial"==a){w.diff=e.dist(E,I,t.stageX/e.scaX,t.stageY/e.scaY),T=Math.atan2(t.stageY/e.scaY-A.y,t.stageX/e.scaX-A.x)*e.DEG;var o=e.sign(k-T);if(Math.abs(T-k)>180)return void(P=!1);w.diff=w.diff*o;var n=Math.max(10,e.dist(A.x,A.y,t.stageX/e.scaX,t.stageY/e.scaY));w.diff*=(S-n)/S}else w.diff=y-("horizontal"==a?t.stageX/e.scaX:t.stageY/e.scaY);if(p&&(Math.abs(w.diff)<Math.abs(p.diff)?(w.override=!0,p.override=!1):(w.override=!1,p.override=!0)),!w.override){if(Math.abs(w.diff)>0&&(w.swiperMoving=!0),x=v-w.diff*w.sensitivity*d,zot(l)||zot(s)||!h)zot(l)||(x=Math.max(x,l)),zot(s)||(x=Math.min(x,s));else{var r=x;x=(x+1e4*(s-l)-l)%(s-l)+l,Math.abs(r-x)>.8*Math.abs(s-l)&&(w.immediate(x),y="horizontal"==a?t.stageX/e.scaX:t.stageY/e.scaY,v=w.target[w.property])}w.desiredValue=x,w.dispatchEvent("swipemove")}}}function X(){C.off("stagemousedown",w.downEvent),C.off("stagemousemove",w.moveEvent),C.off("stagemouseup",w.upEvent),B.off("mouseupplus",w.upEvent2)}function R(){C.off("mousedown",w.downEvent),C.off("pressmove",w.moveEvent),C.off("pressup",w.upEvent),B.off("mouseupplus",w.upEvent2)}function H(){C.canvas?X():R(),e.Ticker.remove(w.swiperTicker)}function F(){C.canvas?w.downEvent=C.on("stagemousedown",w.downEvent):(w.downEvent=C.on("mousedown",w.downEvent),w.moveEvent=C.on("pressmove",w.moveEvent),w.upEvent=C.on("pressup",w.upEvent),w.upEvent2=B.on("mouseupplus",w.upEvent2)),w.immediate(w.target[w.property]),w.swiperTicker=e.Ticker.add(w.swiperTicker,b)}},e.extend(e.Swiper,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.MotionController=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x){var k,T="target, type, speed, axis, boundary, map, diagonal, damp, flip, orient, constant, firstPerson, turnSpeed, moveThreshold, stickThreshold, container, localBounds, mouseMoveOutside, mousedownIncludes, minPercentSpeed, maxPercentSpeed, dampKeyup, rotate";if(k=zob(e.MotionController,arguments,T,this))return k;z_d("69.7"),this.cjsEventDispatcher_constructor(),this.type="MotionController";var A,P=this,B="zim MotionController(): Please pass in a reference to the stage or a container on the stage";if(zot(m)){if(!WW.zdf)return void zogy(B);A=m=WW.zdf.stage}else if(zot(m.stage)){if(!WW.zdf)return void zogy(B);A=WW.zdf.stage}else A=m.stage;var E=A.frame;zot(u)||(x=u),zot(t)&&(t=new e.Container(1,1,null,null,!1));var I="Accelerator"==t.type;if(zot(n)&&(n=7),!zot(o)&&"DPad"==o.type){var S=o;o="manual",zot(r)&&(r=S.axis),"all"==r&&(r="both"),S.on("change",(function(){P.convert(t.x+S.dirX*n,t.y+S.dirY*n)}))}(zot(o)||"mousemove"!=o&&"pressmove"!=o&&"pressdrag"!=o&&"keydown"!=o&&"gamebutton"!=o&&"gamestick"!=o&&"swipe"!=o&&"follow"!=o&&"manual"!=o)&&(o="mousedown"),zot(r)&&(r=I?"horizontal":"both"),"keydown"==o&&zot(a)&&(a=[[65,37],[68,39],[87,38],[83,40]]),"gamebutton"==o&&zot(a)&&(a=h?[14,15,e.GamePad.RT,e.GamePad.LT]:[14,15,12,13]),"gamestick"==o&&zot(a)&&(a=h?[[0,2],[0,2],[1],[1]]:[0,0,1,1]),"gamestick"==o&&zot(a)&&(a=[0,0,1,1]),zot(l)&&(l=!0),"horizontal"!=r&&"vertical"!=r||(l=!1),zot(s)&&(s="keydown"==o||"gamebutton"==o?1:"pressmove"==o?.2:.1),zot(h)&&(h=!1),zot(g)&&(g=.4*n),zot(p)&&(p=4),zot(f)&&(f=.2),zot(y)&&(y=!1),A.mouseMoveOutside=y,zot(v)&&(v=[]),Array.isArray(v)||(v=[v]),"Pen"!=t.type||t.move?v.push(t):v.push(t,t.paper),i&&i.getBounds&&(v?-1==v.indexOf(i)&&v.push(i):v=[i]),t.motionController=this,this.mousedownIncludes=v,zot(C)&&(C=.3),P.dampKeyup=C,this.dirX=0,this.dirY=0,this.speed=n,this.turnSpeed=g,this.axis=r,this.target=t,this.moveThreshold=p,this.stickThreshold=f,this.boundary=i,t.zimMCStartAngle=t.rotation;var W,M,O,j=P.speed,L=P.speed,D=0;(P.rotation=t.zimMCStartAngle,I)?(O=!(M=m.getBounds())||"vertical"==r&&!M.height||"vertical"!=r&&!M.width?1e3:"vertical"==r?M.height:M.width,zot(b)&&(b=0),zot(w)&&(w=100),zot(this.target.percentSpeed)&&(this.target.percentSpeed=(w-b)/2),P.x=O/2,P.y=O/2,W=new e.Proportion(0,O,b,w)):(P.x=this.target.x,P.y=this.target.y);var _,Y,X,R,H,F,N,V,G,q=P.scaleX=t.scaleX,U=P.scaleY=t.scaleY,Q=!1,Z=!1;if("keydown"==o||"gamebutton"==o){for(F=0;F<4;F++)Array.isArray(a[F])||(a[F]=[a[F]]);var K=[0,0,0,0],J=[],$=["X","X","Y","Y"],ee=[-1,1,-1,1],te={dirX:0,dirY:0};if("keydown"==o)var oe=E.on("keydown",de);else var ne=(V=P.gamepad=new e.GamePad).on("buttondown",de);if(zot(d))if("keydown"==o)var re=E.on("keyup",he);else var ie=V.on("buttonup",he);G={rotation:0,speedX:P.speed,speedY:P.speed};var ae=e.Ticker.add((function(){if(h)pe(te);else{var e=P.speed,t=P.speed;if("both"==P.axis&&0!=te.dirX&&0!=te.dirY){var o=ze(te.dirX,te.dirY);e=o.speedX,t=o.speedY}"horizontal"!=P.axis&&"both"!=P.axis||(P.x+=e*te.dirX),"vertical"!=P.axis&&"both"!=P.axis||(P.y+=t*te.dirY),fe()}}),A)}else if("mousedown"==o||"mousemove"==o)_=A.on("stage"+o,(function(t){if(A=t.target.stage,"mousedown"==o){if(Array.isArray(P.mousedownIncludes)||(P.mousedownIncludes=[P.mousedownIncludes]),P.mousedownIncludes.indexOf(m)<0)for(F=0;F<m.numChildren;F++){var n=m.getChildAt(F);if(-1==P.mousedownIncludes.indexOf(n)&&n.mouseEnabled&&n.hitTestPoint&&n.hitTestPoint(t.stageX/e.scaX,t.stageY/e.scaY))return}P.dispatchEvent("mousedown")}var r=m.globalToLocal(y?t.rawX/e.scaX:t.stageX/e.scaX,y?t.rawY/e.scaY:t.stageY/e.scaY);P.x=r.x,P.y=r.y,fe()}));else if("pressmove"==o||"pressdrag"==o||"follow"==o)"Pen"==t.type&&(t.write=!1),_=A.on("stagemousedown",(function(n){var i;if(("Pen"!=t.type&&"pressmove"!=o||!P.boundary||"Blob"!=!P.boundary.type||!((i={x:n.stageX/e.scaX,y:n.stageY/e.scaY}).x<P.boundary.x||i.x>P.boundary.x+P.boundary.width||i.y<P.boundary.y||i.y>P.boundary.y+P.boundary.height))&&(!P.boundary||"Blob"!=P.boundary.type||"pressmove"!=o&&"pressdrag"!=o||(i={x:n.stageX/e.scaX,y:n.stageY/e.scaY},P.boundary.shape.hitTestPoint(i.x,i.y)))&&("pressdrag"!=o||t.hitTestPoint(n.stageX/e.scaX,n.stageY/e.scaY))){Z=!1,Array.isArray(P.mousedownIncludes)||(P.mousedownIncludes=[P.mousedownIncludes]);var a=!1;for(P.mouseDownIncludes&&(H=A.getObjectUnderPoint(n.stageX,n.stageY,1)),F=0;F<P.mousedownIncludes.length;F++)H&&P.mousedownIncludes[F].hitTestPoint&&P.mousedownIncludes[F].hitTestPoint(n.stageX/e.scaX,n.stageY/e.scaY)&&P.mousedownIncludes[F].contains(H)&&(a=!0);if(!a)for(F=0;F<m.numChildren;F++){var l=m.getChildAt(F);if(-1==P.mousedownIncludes.indexOf(l)&&l.mouseEnabled&&l.hitTestPoint&&l.hitTestPoint(n.stageX/e.scaX,n.stageY/e.scaY))return}var s=m.globalToLocal(y?n.rawX/e.scaX:n.stageX/e.scaX,y?n.rawY/e.scaY:n.stageY/e.scaY);"follow"!=o&&"pressdrag"!=o&&P.immediate("both"==r||"horizontal"==r?s.x:null,"both"==r||"vertical"==r?s.y:null),fe(),P.dispatchEvent("mousedown"),Q=!0,P.moveX=y?n.rawX/e.scaX:n.stageX/e.scaX,P.moveY=y?n.rawY/e.scaY:n.stageY/e.scaY,Y=A.on("stagemousemove",(function(t){P.moveX=y?t.rawX/e.scaX:t.stageX/e.scaX,P.moveY=y?t.rawY/e.scaY:t.stageY/e.scaY,"follow"!=o&&ge()})),R&&e.Ticker.remove(R),"follow"==o&&(R=e.Ticker.add(ge)),"Pen"==t.type&&(t.write=!0,t.zimDragCheck=!0)}})),X=A.on("stagemouseup",(function(){"Pen"==t.type&&(t.write=!1,t.zimDragCheck=!1,Z&&t.stopCheck()),R&&e.Ticker.remove(R),A.off("stagemousemove",Y),Q=!1}));else if("gamestick"==o){for(V=this.gamepad=new e.GamePad,F=0;F<4;F++)Array.isArray(a[F])||(a[F]=[a[F]]);G={rotation:t.zimMCStartAngle,speedX:P.speed,speedY:P.speed};var le=V.on("data",(function(e){for(te={dirX:0,dirY:0},F=0;F<a[0].length;F++)if(N=e.axes[a[0][F]],Math.abs(N)>P.stickThreshold){te.dirX=N;break}for(F=0;F<a[2].length;F++)if(N=e.axes[a[2][F]],Math.abs(N)>P.stickThreshold){te.dirY=N;break}h?pe(te):(P.x+=P.speed*te.dirX,P.y+=P.speed*te.dirY,fe())}))}else if("swipe"==o)var se=new e.Swiper(A,P,"x",.8),ce=new e.Swiper(A,P,"y",.8,!1),ue=se.on("swipemove",(function(){fe()}));function de(e){var t,n="keydown"==o?e.keyCode:e.buttonCode;for(F=0;F<4;F++)if(a[F].indexOf(n)>-1){if(l||"both"!=P.axis||(te.dirX=te.dirY=0),te["dir"+$[F]]=ee[F],K[F]=1,0==(t=J.indexOf(F)))return;return t>0&&J.splice(t,1),void J.unshift(F)}}function he(e){var t,n="keydown"==o?e.keyCode:e.buttonCode;for(F=0;F<4;F++)if(a[F].indexOf(n)>-1){if(K[F]=0,(t=J.indexOf(F))>=0&&J.splice(t,1),"both"!=P.axis||l)te["dir"+$[F]]=-K[2*Math.floor(F/2)]+K[2*Math.floor(F/2)+1];else if(J.length>0){te["dir"+$[F]]=0;var r=J[0];te["dir"+$[r]]=ee[r]}else te.dirX=te.dirY=0;return}}function ge(){var e=m.globalToLocal(P.moveX,P.moveY);P.x=e.x,P.y=e.y,fe(),"Pen"==t.type&&!Z&&t.drawing&&(Z=!0)}function pe(e){G.rotation+=e.dirX*P.turnSpeed,P.rotation=G.rotation,G.speedX=Math.sin(G.rotation*Math.PI/180)*P.speed*-e.dirY,G.speedY=-Math.cos(G.rotation*Math.PI/180)*P.speed*-e.dirY,P.x+=G.speedX,P.y+=G.speedY}function fe(){var e=ze(P.x-(I?P.target.percentSpeed:P.target.x),P.y-(I?P.target.percentSpeed:P.target.y));if(j=e.speedX,L=e.speedY,x)if(zot(e.angle)||(P.rotation=e.angle+t.zimMCStartAngle),zot(P.rotation))P.rotation=P.target.rotation;else{P.rotation+=D;var o=me(P.rotation),n=P.target.rotation=me(P.target.rotation);Math.abs(o-n)>180&&(n>o?n-=360:o-=360),P.dampR.immediate(n),P.target.rotation=n,P.rotation=o}}function me(e){return(e%360+360)%360}function ze(e,t){var o,n=P.speed,r=P.speed,i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return i>0&&(n=Math.abs(e)/i*P.speed,r=Math.abs(t)/i*P.speed,o=90-180*Math.atan2(e,t)/Math.PI),{speedX:n,speedY:r,angle:o}}var ye=this.x,ve=this.y,be=this.x,we=this.y,Ce=this.x=I?O/2:this.target.x,xe=this.y=I?O/2:this.target.y;this.dampX=new e.Damp(Ce,s),this.dampY=new e.Damp(xe,s),this.dampR=new e.Damp(this.target.rotation,s);var ke,Te=0,Ae=0,Pe=e.Ticker.add((function(){if("manual"==o&&fe(),P.boundary&&"Blob"!=P.boundary.type&&(P.x=e.constrain(P.x,P.boundary.x,P.boundary.x+P.boundary.width),P.y=e.constrain(P.y,P.boundary.y,P.boundary.y+P.boundary.height)),"horizontal"==P.axis||"both"==P.axis){if(P.dirX=e.sign(P.x-Ce),Math.abs(P.x-Ce)<j?Ce=P.x:Ce+=P.dirX*j,te&&0==te.dirX){var n=P.boundary?P.boundary.width/2:A.width/2,r=P.x-(P.x-n)*(I?P.dampKeyup:0);Ce=r,P.x=Ce}I&&M&&M.width?P.target.percentSpeed=W.convert(P.dampX.convert(Ce)):P.target.x=P.dampX.convert(Ce)}if("vertical"==P.axis||"both"==P.axis){if(P.dirY=e.sign(P.y-xe),Math.abs(P.y-xe)<L?xe=P.y:xe+=e.sign(P.y-xe)*L,te&&0==te.dirY){n=P.boundary?P.boundary.height/2:A.height/2;var i=P.y-(P.y-n)*(I?P.dampKeyup:0);xe=i,P.y=xe}I&&M&&M.height?P.target.percentSpeed=W.convert(P.dampY.convert(xe)):P.target.y=P.dampY.convert(xe)}if(P.boundary&&"Blob"==P.boundary.type&&(P.boundary.shape.hitTestPoint(P.target.x,P.target.y)?(ye=P.target.x,ve=P.target.y):(P.target.x=P.x=ye,P.target.y=P.y=ve,P.immediate(ye,ve))),"pressmove"==o&&Q&&P.dispatchEvent("pressing"),1==s?(P.movingX=0!=Math.round(be-P.x),P.movingY=0!=Math.round(we-P.y),be=P.x,we=P.y):(P.movingX=Math.abs(Ce-(I?P.target.percentSpeed:P.target.x))>P.moveThreshold,P.movingY=Math.abs(xe-(I?P.target.percentSpeed:P.target.y))>P.moveThreshold),!P.moving||P.movingX||P.movingY?P.moving||!P.movingX&&!P.movingY||P.dispatchEvent("startmoving"):P.dispatchEvent("stopmoving"),P.moving=P.movingX||P.movingY,P.moving&&P.dispatchEvent("moving"),P.dirX!=Te||P.dirY!=Ae){var a,l=new createjs.Event("change");P.dirX!=Te?(a=["left",null,"right"],l.dir=a[P.dirX+1],Te=P.dirX,t.zimMCStartAngle||"horizontal"!=c&&"both"!=c||(P.scaleX=t.scaleX=P.dirX?Math.abs(t.scaleX)*P.dirX:t.scaleX,D=0!=q&&-1==Math.round(P.scaleX/q)?180:0)):(a=["up",null,"down"],l.dir=a[P.dirY+1],Ae=P.dirY,t.zimMCStartAngle||"vertical"!=c&&"both"!=c||(P.scaleY=t.scaleY=P.dirY?Math.abs(t.scaleY)*P.dirY:t.scaleY,D=0!=U&&-1==Math.round(P.scaleY/U)?180:0)),P.dispatchEvent(l)}x&&!zot(P.rotation)&&(P.target.rotation=P.dampR.convert(P.rotation))}),A);this.immediate=function(e,t,o){return!zot(e)&&P.dampX&&(P.dampX.immediate(e),P.x=I?P.target.percentSpeed=Ce=e:P.target.x=Ce=e,se&&se.immediate(e)),!zot(t)&&P.dampY&&(P.dampY.immediate(t),P.y=I?P.target.percentSpeed=xe=t:P.target.y=xe=t,ce&&ce.immediate(t)),!zot(o)&&P.dampR&&(P.dampR.immediate(o),P.rotation=P.target.rotation=o),ye=P.x,ve=P.y,P},this.convert=function(e,t){zot(e)||(P.x=e),zot(t)||(P.y=t),fe()},Object.defineProperty(P,"pausingSpeed",{get:function(){return P.speed},set:function(e){P.speed=e}}),this.paused=!1,this.pause=function(n,r,i){return zot(n)&&(n=!0),zot(r)&&(r=0),zot(i)&&(i=!1),n?(ke=P.speed,r>0?(e.animate({target:P,obj:{pausingSpeed:0},ticker:!1,time:r,call:function(){P.speed=0,P.paused=!0,P.enabled=!1,P.immediate(P.target.x,P.target.y),P.dispatchEvent("pause")}}),i&&(Q=!1,Y&&A.off("stagemousemove",Y),R&&e.Ticker.remove(R),"Pen"==t.type&&(t.write=!1,t.zimDragCheck=!1),X&&A.off("stagemouseup",X),Z&&t.stopCheck(),"keydown"==o?re&&E.off("keyup",re):ie&&V.off("buttonup",ie))):(P.speed=0,P.paused=!0,P.enabled=!1,P.immediate(P.target.x,P.target.y),setTimeout((function(){P.dispatchEvent("pause")}),10))):(P.enabled=!0,r>0?e.animate({target:P,obj:{pausingSpeed:ke},ticker:!1,time:r,call:function(){P.speed=ke,P.paused=!1}}):(P.speed=ke,P.paused=!1)),P};var Be=!0;function Ee(){"keydown"==o?(oe=E.on("keydown",oe),re&&(re=E.on("keyup",re)),ae=e.Ticker.add(ae,A)):"gamebutton"==o?(ne=V.on("buttondown",ne),ie&&(ie=V.on("buttonup",ie)),ae=e.Ticker.add(ae,A)):"gamestick"==o?le=V.on("data",le):"swipe"==o?(se.enabled=!0,ce.enabled=!0,ue&&(ue=se.on("swipemove",ue))):"mousedown"==o||"mousemove"==o?_=A.on("stage"+o,_):"pressmove"==o&&(_=A.on("stagemousedown",_),Y&&(Y=A.on("stagemousemove",Y)),X&&(X=A.on("stagemouseup",X))),Pe=e.Ticker.add(Pe,A)}function Ie(){"keydown"==o?(E.off("keydown",oe),E.off("keyup",re),e.Ticker.remove(ae)):"gamebutton"==o?(V.off("buttondown",ne),V.off("buttonup",ie),e.Ticker.remove(ae)):"gamestick"==o?V.off("data",le):"swipe"==o?(se.enabled=!1,ce.enabled=!1,se.off("swipemove",ue)):"mousedown"==o||"mousemove"==o?A.off("stage"+o,_):"pressmove"==o&&(A.off("stagemousedown",_),A.off("stagemousemove",Y),A.off("stagemouseup",X)),e.Ticker.remove(Pe)}Object.defineProperty(P,"enabled",{get:function(){return Be},set:function(e){Be!=e&&(e?(Ee(),P.paused=!1):(Ie(),P.paused=!0),Be=Boolean(e))}}),this.dispose=function(){Ie(),V&&V.dispose(),se&&se.dispose(),ce&&se.dispose()}},e.extend(e.MotionController,createjs.EventDispatcher,"enabled","cjsEventDispatcher"),e.GamePad=function(){if(z_d("69.8"),this.type="GamePad",this.cjsEventDispatcher_constructor(),!navigator.getGamepads)return this.error=!0,void(zon&&zogy("zim.GamePad() - no browswer support"));var e;WW.addEventListener("gamepadconnected",o),this.currentIndex=0;var t=this;function o(o){t.connected=!0,function(e,o){var n=new createjs.Event(e);n.index=o.gamepad.index,n.id=o.gamepad.id,n.buttons=o.gamepad.buttons,n.axes=o.gamepad.axes,t.dispatchEvent(n)}("gamepadconnected",o);var n=navigator.getGamepads()[t.currentIndex];t.lastData=[];for(var r=0;r<n.buttons.length;r++)t.lastData[r]=n.buttons[r].pressed;!function o(){if(e=requestAnimationFrame(o),t.data=navigator.getGamepads()[t.currentIndex],t.data){for(var n,r=t.buttons=[],i=0;i<t.data.buttons.length;i++)r[i]=t.data.buttons[i].pressed,r[i]!=t.lastData[i]&&(t.lastData[i]=r[i],(n=r[i]?new createjs.Event("buttondown"):new createjs.Event("buttonup")).buttonCode=i,n.button=a[i],t.dispatchEvent(n));(n=new createjs.Event("data")).axes=t.axes=t.data.axes,n.buttons=t.buttons,t.dispatchEvent(n)}}()}var n=setInterval((function(){navigator.getGamepads&&navigator.getGamepads()[0]&&(t.connected||o(),clearInterval(n))}),500);var r=function(o){o.gamepad.index==t.currentIndex&&(cancelAnimationFrame(e),t.connected=!1,t.dispatchEvent("gamepaddisconnected"))};WW.addEventListener("gamepaddisconnected",r),this.dispose=function(){WW.removeEventListener("gamepadconnected",o),WW.removeEventListener("gamepaddisconnected",r),cancelAnimationFrame(e),clearInterval(n),t.connected=!1}};var a=["A","B","X","Y","LB","RB","LT","RT","BACK","START","LS","RS","DPAD_UP","DPAD_DOWN","DPAD_LEFT","DPAD_RIGHT"];for(z_i=0;z_i<a.length;z_i++)e.GamePad[a[z_i]]=z_i;var l,s,c=["LSX","LSY","RSX","RSY"];for(z_i=0;z_i<c.length;z_i++)e.GamePad[c[z_i]]=z_i;function u(t,o,n,r,i,a,c,u,d,h,g){function p(){WW.zimContactListener=new WW.b2ContactListener,l=new e.Dictionary(!0),s=new e.Dictionary(!0),WW.zimContactListener.BeginContact=function(e){var t=l.at(e.m_fixtureB.GetBody());t&&t(e.m_fixtureA.GetBody().zimObj,e.m_fixtureA.GetBody());(t=l.at(e.m_fixtureA.GetBody()))&&t(e.m_fixtureB.GetBody().zimObj,e.m_fixtureB.GetBody())},WW.zimContactListener.EndContact=function(e){var t=s.at(e.m_fixtureB.GetBody());t&&t(e.m_fixtureA.GetBody().zimObj,e.m_fixtureA.GetBody());(t=s.at(e.m_fixtureB.GetBody().zimObj,e.m_fixtureB.GetBody()))&&t(e.m_fixtureB.GetBody())},t.physics.world.SetContactListener(WW.zimContactListener)}z_d("69.97"),zot(n)&&(n=0),"rectangle"==r?t.body=t.physics.makeRectangle(t.width-n,t.height-n,o,i,c,u,d,h,g,a):"circle"==r?t.body=t.physics.makeCircle(t.width/2-n,o,i,c,u,d,h,g,a):"triangle"==r&&(zot(t.a)&&(t.a=t.width,t.b=t.c=Math.sqrt(Math.pow(t.a/2,2)+Math.pow(t.height,2))),t.body=t.physics.makeTriangle(t.a-n,t.b-n,t.c-n,o,i,c,u,d,h,g,a)),t.body.x=t.x,t.body.y=t.y,t.body.rotation=t.rotation,t.physics.addMap(t.body,t),t.impulse=function(e,o,n,r){zot(e)&&(e=0),zot(o)&&(o=0);var i=t.body.GetWorldCenter();return zot(n)&&(n=i.x*t.physics.scale),zot(r)&&(r=i.y*t.physics.scale),t.body.ApplyImpulse(new WW.b2Vec2(e,o),new WW.b2Vec2(n/t.physics.scale,r/t.physics.scale)),t},t.force=function(e,o,n,r){zot(e)&&(e=0),zot(o)&&(o=0);var i=t.body.GetWorldCenter();return zot(n)&&(n=i.x*t.physics.scale),zot(r)&&(r=i.y*t.physics.scale),t.body.ApplyForce(new WW.b2Vec2(e,o),new WW.b2Vec2(n/t.physics.scale,r/t.physics.scale)),t},t.setLinearVelocity=function(e,o){return t.body.SetLinearVelocity(new WW.b2Vec2(e,o)),t},t.setAngularVelocity=function(e){return t.body.SetAngularVelocity(e),t},t.spin=function(e){return zot(e)&&(e=10),t.body.ApplyTorque(1e3*e),t},t.torque=function(e){return zot(e)&&(e=10),t.body.ApplyTorque(e),t},t.follow=function(e,o,n,r,i,a,l,s,c,u,d,h){var g,p="damp, dampY, leftOffset, rightOffset, upOffset, downOffset, offsetDamp, offsetDampY, horizontal, vertical, borderLock, borderOriginal";return(g=zob(t.follow,arguments,p))?g:(t.physics.follow(t,e,o,n,r,i,a,l,s,c,u,d,h),t)},t.noFollow=function(){return t.physics.follow(null),t},t.control=function(e,o,n,r,i){var a,l="type, speed, speedY, horizontal, vertical";return(a=zob(t.control,arguments,l))?a:(t.physics.control(t,e,o,n,r,i),t)},t.noControl=function(){return t.physics.noControl(t),t},t.sleep=function(){return t.body.SetAwake(!1),t},t.wake=function(){return t.body.SetAwake(!0),t},t.contact=function(e){return WW.zimContactListener||p(),l.add(t.body,e),t},t.noContact=function(){return l.remove(t.body),t},t.contactEnd=function(e){return WW.zimContactListener||p(),s.add(t.body,e),t},t.noContactEnd=function(){return s.remove(t.body),t},t.hasOwnProperty("dynamic")||Object.defineProperty(t,"dynamic",{get:function(){return 2==t.body.GetType()},set:function(e){t.body.SetType(1==e?2:0)}})}for(e.extend(e.GamePad,createjs.EventDispatcher,null,"cjsEventDispatcher"),e.Portal=function(t,o){var n,r="obj, lands";if(n=zob(e.Portal,arguments,r,this))return n;if(z_d("69.96"),!zot(t)&&t.stage){this.type="Portal";var i=this,a=o&&o.numChildren&&o.numChildren>0;if(a){var l=o.getChildAt(o.numChildren-1),s=o.getChildAt(o.numChildren-2);o.setChildIndex(s,o.numChildren-1),s.setMask(t)}t.on(e.mobile()?"mousedown":"mouseover",(function(){i._enabled&&(a&&c(),i.dispatchEvent("enter"))})),t.on(e.mobile()?"pressup":"mouseout",(function(){i._enabled&&i.dispatchEvent("exit")})),Object.defineProperty(this,"portal",{get:function(){return t},set:function(e){!zot(e)&&e.stage||!zon?s.setMask(t):zogy("zim.Portal() - please provide a Display Object to act as the portal")}}),Object.defineProperty(this,"currentLand",{get:function(){return l},set:function(e){if(o.contains(e))for(;e!=l;)c()}}),Object.defineProperty(this,"nextLand",{get:function(){return s},set:function(){zon&&zogy("zim.Portal() - nextLand is read only - remake Portal to change")}}),this._enabled=!0,Object.defineProperty(i,"enabled",{get:function(){return i._enabled},set:function(e){i._enabled=e}})}function c(){o.setChildIndex(l,0),l=s,s=o.getChildAt(o.numChildren-2),o.setChildIndex(s,o.numChildren-1),l.setMask(null),s.setMask(t),t.stage.update()}},e.extend(e.Portal,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),WW.zimContactListener=null,e.BlurEffect=function(t,o,n,r,i,a){var l,s="blurX, blurY, quality, style, group, inherit";if(l=zob(e.BlurEffect,arguments,s,this))return l;z_d("69.972"),this.group=i;var c=!1===r?{}:e.getStyle("BlurEffect",i,a);zot(t)&&(t=null!=c.blurX?c.blurX:10),zot(o)&&(o=null!=c.blurY?c.blurY:10),zot(n)&&(n=null!=c.quality?c.quality:1);var u=d(t,o,n);function d(){return arguments}t=zik(t),o=zik(o),n=zik(n),this.createjsBlurFilter_constructor(t,o,n),this.type="BlurEffect",this.clone=function(i){return new e.BlurEffect(i||!e.isPick(u[0])?t:u[0],i||!e.isPick(u[1])?o:u[1],i||!e.isPick(u[2])?n:u[2],r,this.group,a)}},e.extend(e.BlurEffect,createjs.BlurFilter,"clone","createjsBlurFilter",!1),e.GlowEffect=function(t,o,n,r,i,a,l,s,c,u,d,h){var g,p="color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject, style, group, inherit";if(g=zob(e.GlowEffect,arguments,p,this))return g;z_d("69.9725"),this.group=d;var f=!1===u?{}:e.getStyle("GlowEffect",d,h);zot(t)&&(t=null!=f.color?f.color:"white"),zot(o)&&(o=null!=f.alpha?f.alpha:1),zot(n)&&(n=null!=f.blurX?f.blurX:30),zot(r)&&(r=null!=f.blurY?f.blurY:30),zot(i)&&(i=null!=f.strength?f.strength:1),zot(a)&&(a=null!=f.quality?f.quality:1),zot(l)&&(l=null!=f.inner&&f.inner),zot(s)&&(s=null!=f.knockout&&f.knockout),zot(c)&&(c=null!=f.hideObject&&f.hideObject);var m=z(t,o,n,r,i,a,l,s,c);function z(){return arguments}n=zik(n),r=zik(r),a=zik(a),t=zik(t),this.alpha=zik(o),this.strength=zik(i),this.inner=zik(l),this.knockout=zik(s),this.hideObject=zik(c),this.createjsBlurFilter_constructor(n,r,a),this.type="GlowEffect",this.usesContext=!0,this.applyFilter=function(e,t,o,n,r,i,a,l){if((this.alpha<=0||this.strength<=0)&&!this.knockout)return!0;void 0===a&&(a=t),void 0===l&&(l=o);var s=(i=i||e).getImageData(a,l,n,r).data,c=document.createElement("canvas");c.width=n,c.height=r;for(var u=c.getContext("2d"),d=u.getImageData(0,0,n,r),h=d.data,g=this.inner,p=this._red,f=this._green,m=this._blue,z=0,y=h.length;z<y;z+=4){var v=z+3,b=s[v];g?255!==b&&(h[z]=p,h[z+1]=f,h[z+2]=m,h[v]=255-b):0!==b&&(h[z]=p,h[z+1]=f,h[z+2]=m,h[v]=b)}u.putImageData(d,0,0);var w=this.strength;if(0<w){this.createjsBlurFilter_applyFilter(u,0,0,n,r),255<w&&(w=255);for(var C=1;C<w;C++)u.drawImage(c,0,0)}var x,k=this.alpha;return k<0?k=0:1<k&&(k=1),x=this.knockout?g?"source-in":"source-out":this.hideObject?g?"source-in":"copy":g?"source-atop":"destination-over",i.save(),i.setTransform(1,0,0,1,0,0),i.globalAlpha=k,i.globalCompositeOperation=x,i.drawImage(c,a,l),i.restore(),!0},Object.defineProperty(this,"color",{get:function(){return this._red<<16|this._green<<8|this._blue},set:function(t){t=e.convertColor(t,"hexNumber"),this._red=t>>16&255,this._green=t>>8&255,this._blue=255&t}}),this.color=t,this.clone=function(c){return new e.GlowFilter(c||!e.isPick(m[0])?t:m[0],c||!e.isPick(m[1])?o:m[1],c||!e.isPick(m[2])?n:m[2],c||!e.isPick(m[3])?r:m[3],c||!e.isPick(m[4])?a:m[4],c||!e.isPick(m[5])?i:m[5],c||!e.isPick(m[6])?l:m[6],c||!e.isPick(m[7])?s:m[7],c||!e.isPick(m[8])?s:m[8],u,this.group,h)}},e.extend(e.GlowEffect,createjs.BlurFilter,["clone","applyFilter"],"createjsBlurFilter",!1),e.ShadowEffect=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p){var f,m="distance, angle, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject, style, group, inherit";if(f=zob(e.ShadowEffect,arguments,m,this))return f;z_d("69.973"),this.group=g;var z=!1===h?{}:e.getStyle("ShadowEffect",g,p);zot(t)&&(t=null!=z.distance?z.distance:10),zot(o)&&(o=null!=z.angle?z.angle:45),zot(n)&&(n=null!=z.color?z.color:e.black),zot(r)&&(r=null!=z.alpha?z.alpha:.4),zot(i)&&(i=null!=z.blurX?z.blurX:15),zot(a)&&(a=null!=z.blurY?z.blurY:15),zot(l)&&(l=null!=z.strength?z.strength:1),zot(s)&&(s=null!=z.quality?z.quality:1),zot(c)&&(c=null!=z.inner&&z.inner),zot(u)&&(u=null!=z.knockout&&z.knockout),zot(d)&&(d=null!=z.hideObject&&z.hideObject);var y=v(t,o,n,r,i,a,l,s,c,u,d);function v(){return arguments}i=zik(i),a=zik(a),s=zik(s),n=zik(n),t=zik(t),o=zik(o);var b=this;function w(t,o){var n=o*e.RAD;b._offsetX=Math.cos(n)*t,b._offsetY=Math.sin(n)*t}this.alpha=zik(r),this.strength=zik(l),this.inner=zik(c),this.knockout=zik(u),this.hideObject=zik(d),this.createjsBlurFilter_constructor(i,a,s),this.type="ShadowEffect",this.usesContext=!0,Object.defineProperty(this,"angle",{get:function(){return o},set:function(e){o=e=(e%360+360)%360,w(t,e)}}),this.angle=o,Object.defineProperty(this,"distance",{get:function(){return t},set:function(e){t=e,w(e,o)}}),this.distance=t,Object.defineProperty(this,"color",{get:function(){return this._red<<16|this._green<<8|this._blue},set:function(t){t=e.convertColor(t,"hexNumber"),this._red=t>>16&255,this._green=t>>8&255,this._blue=255&t}}),this.color=n,this.applyFilter=function(e,t,o,n,r,i,a,l){if((this.alpha<=0||this.strength<=0)&&!this.knockout&&!this.hideObject)return!0;void 0===a&&(a=t),void 0===l&&(l=o);var s=(i=i||e).getImageData(a,l,n,r).data,c=document.createElement("canvas");c.width=n,c.height=r;for(var u=c.getContext("2d"),d=u.getImageData(0,0,n,r),h=d.data,g=this.inner,p=this._red,f=this._green,m=this._blue,z=0,y=h.length;z<y;z+=4){var v=z+3,b=s[v];g?255!==b&&(h[z]=p,h[z+1]=f,h[z+2]=m,h[v]=255-b):0!==b&&(h[z]=p,h[z+1]=f,h[z+2]=m,h[v]=b)}u.putImageData(d,0,0);var w=this.strength;if(0<w){this.createjsBlurFilter_applyFilter(u,0,0,n,r),255<w&&(w=255);for(var C=1;C<w;C++)u.drawImage(c,0,0)}var x,k=this.alpha;return k<0?k=0:1<k&&(k=1),x=this.knockout?g?"source-in":"source-out":this.hideObject?g?"source-in":"copy":g?"source-atop":"destination-over",i.save(),i.setTransform(1,0,0,1,0,0),i.globalAlpha=k,i.globalCompositeOperation=x,i.drawImage(c,a+this._offsetX,l+this._offsetY),i.restore(),!0},this.getBounds=function(e){var t=this.createjsBlurFilter_getBounds(e),o=this._offsetX,n=this._offsetY;return 0!==o&&(o<0?(t.x+=o,t.width+=-o):t.width+=o),0!==n&&(n<0?(t.y+=n,t.height+=-n):t.height+=n),t},this.clone=function(g){return new e.ShadowFilter(g||!e.isPick(y[0])?t:y[0],g||!e.isPick(y[1])?o:y[1],g||!e.isPick(y[2])?n:y[2],g||!e.isPick(y[3])?r:y[3],g||!e.isPick(y[4])?i:y[4],g||!e.isPick(y[5])?a:y[5],g||!e.isPick(y[6])?s:y[6],g||!e.isPick(y[7])?l:y[7],g||!e.isPick(y[8])?c:y[8],g||!e.isPick(y[9])?u:y[9],g||!e.isPick(y[10])?d:y[10],h,this.group,p)}},e.extend(e.ShadowEffect,createjs.BlurFilter,["clone","getBounds","applyFilter"],"createjsBlurFilter",!1),e.ColorEffect=function(t,o,n,r,i,a,l,s,c,u,d){var h,g="redMultiplier, greenMultiplier, blueMultiplier, alphaMultiplier, redOffset, greenOffset, blueOffset, alphaOffset, style, group, inherit";if(h=zob(e.ColorEffect,arguments,g,this))return h;z_d("69.9735"),this.group=u;var p=!1===c?{}:e.getStyle("ColorEffect",u,d);zot(t)&&(t=null!=p.redMultiplier?p.redMultiplier:1),zot(o)&&(o=null!=p.greenMultiplier?p.greenMultiplier:1),zot(n)&&(n=null!=p.blueMultiplier?p.blueMultiplier:1),zot(r)&&(r=null!=p.alphaMultiplier?p.alphaMultiplier:1),zot(i)&&(i=null!=p.redOffset?p.redOffset:0),zot(a)&&(a=null!=p.greenOffset?p.greenOffset:0),zot(l)&&(l=null!=p.blueOffset?p.blueOffset:0),zot(s)&&(s=null!=p.alphaOffset?p.alphaOffset:0);var f=m(t,o,n,r,i,a,l,s);function m(){return arguments}t=zik(t),o=zik(o),n=zik(n),r=zik(r),i=zik(i),a=zik(a),l=zik(l),s=zik(s),this.createjsColorFilter_constructor(t,o,n,r,i,a,l,s),this.type="ColorEffect",this.clone=function(u){return new e.ColorEffect(t,o,n,r,i,a,l,s,u||!e.isPick(f[0])?t:f[0],u||!e.isPick(f[1])?o:f[1],u||!e.isPick(f[2])?n:f[2],u||!e.isPick(f[2])?r:f[3],u||!e.isPick(f[2])?i:f[4],u||!e.isPick(f[2])?a:f[5],u||!e.isPick(f[2])?l:f[6],u||!e.isPick(f[2])?s:f[7],c,this.group,d)}},e.extend(e.ColorEffect,createjs.ColorFilter,"clone","createjsColorFilter",!1),e.MultiEffect=function(t,o,n,r,i,a,l){var s,c="hue, saturation, brightness, contrast, style, group, inherit";if(s=zob(e.MultiEffect,arguments,c,this))return s;z_d("69.974"),this.group=a;var u=!1===i?{}:e.getStyle("MultiEffect",a,l);zot(t)&&(t=null!=u.hue?u.hue:0),zot(o)&&(o=null!=u.saturation?u.saturation:0),zot(n)&&(n=null!=u.brightness?u.brightness:0),zot(r)&&(r=null!=u.contrast?u.contrast:0);var d=h(t,o,n,r);function h(){return arguments}t=zik(t),this.createjsColorMatrixFilter_constructor((new createjs.ColorMatrix).adjustColor(n,r,o,t)),this.type="MultiEffect",this.adjustColor=function(e,i,a,l){zot(t)||(t=zik(e)),zot(o)||(o=zik(i)),zot(n)||(n=zik(a)),zot(r)||(r=zik(l)),this.matrix.reset().adjustColor(e,i,a,l)},Object.defineProperty(this,"brightness",{get:function(){return n},set:function(e){n=zik(e),this.matrix.reset().adjustColor(n,r,o,t)}}),Object.defineProperty(this,"contrast",{get:function(){return r},set:function(e){r=zik(e),this.matrix.reset().adjustColor(n,r,o,t)}}),Object.defineProperty(this,"saturation",{get:function(){return o},set:function(e){o=zik(e),this.matrix.reset().adjustColor(n,r,o,t)}}),Object.defineProperty(this,"hue",{get:function(){return t},set:function(e){t=zik(e),this.matrix=(new createjs.ColorMatrix).adjustColor(n,r,o,t),this.applyFilter()}}),this.clone=function(a){return new e.MultiEffect(a||!e.isPick(d[0])?t:d[0],a||!e.isPick(d[0])?o:d[0],a||!e.isPick(d[0])?n:d[0],a||!e.isPick(d[0])?r:d[0],i,this.group,l)}},e.extend(e.MultiEffect,createjs.ColorMatrixFilter,"clone","createjsColorMatrixFilter",!1),e.AlphaEffect=function(t,o,n,r){var i,a="mask, style, group, inherit";if(i=zob(e.AlphaEffect,arguments,a,this))return i;z_d("69.9745"),this.group=n;var l=!1===o?{}:e.getStyle("AlphaEffect",n,r);zot(t)&&(t=null!=l.mask?l.mask:null);var s=c(t);function c(){return arguments}"Bitmap"==(t=zik(t)).type?t=t.image:t.cache&&(t=t.cache().cacheCanvas),this.createjsAlphaMaskFilter_constructor(t),this.type="AlphaEffect",this.clone=function(n){return new e.AlphaEffect(n||!e.isPick(s[0])?t:s[0],o,this.group,r)}},e.extend(e.AlphaEffect,createjs.AlphaMaskFilter,"clone","createjsAlphaMaskFilter",!1),e.Pixel=function(t,o,n,r,i,a,l,s,c,u,d,h,g){var p,f="obj, amount, amountY, blur, dynamic, blendmode, boundary, expand, amountFactor, blurFactor, style, group, inherit";if(p=zob(e.Pixel,arguments,f,this))return p;z_d("69.9747"),this.group=h;var m=!1===d?{}:e.getStyle("Pixel",h,g);zot(t)&&(t=null!=m.obj?m.obj:null),zot(o)&&(o=null!=m.amount?m.amount:.5),zot(n)&&(n=null!=m.amountY?m.amountY:null);var z=!1;null==n&&(z=!0,n=o),zot(r)&&(r=null!=m.blur?m.blur:0),zot(i)&&(i=null!=m.dynamic&&m.dynamic),zot(a)&&(a=null!=m.blendmode?m.blendmode:null),zot(l)&&(l=null!=m.boundary?m.boundary:new e.Boundary(t.getBounds())),zot(s)&&(s=null!=m.expand?m.expand:0),zot(c)&&(c=null!=m.amountFactor?m.amountFactor:.6),zot(u)&&(u=null!=m.blurFactor?m.blurFactor:.6);var y=v(t,o,n,r,a,c,u);function v(){return arguments}t=zik(t),o=zik(o),n=zik(n),r=zik(r),a=zik(a),c=zik(c),u=zik(u),s&&(Array.isArray(s)?1==s.length?l.contract(-s):2==s.length?l.contract(-s[0],-s[1]):l.contract(-s[0],-s[1],-s[2],-s[3]):l.contract(-s));var b=e.constrain(10*c,0,10),w=e.constrain(10*u,0,10),C=this,x=Math.pow(Math.E,-o*b),k=Math.pow(Math.E,-n*b),T=Math.pow(Math.E,-r*w);zot(t)&&(t=new e.Tile(new e.Circle(20,[e.green,e.blue,e.yellow,e.pink,e.purple]),5,5,5,5));var A=document.createElement("canvas"),P=A.getContext("2d"),B=document.createElement("canvas"),E=B.getContext("2d"),I=T;this.update=function(){t.cacheCanvas&&T==I?t.updateCache(a):(t.cache(l.x,l.y,l.width,l.height,T),I=T);var e=t.width,o=t.height,n=t.width*x,r=t.height*k;A.width=e,A.height=o,B.width=e,B.height=o,E.msImageSmoothingEnabled=!1,E.mozImageSmoothingEnabled=!1,E.webkitImageSmoothingEnabled=!1,E.imageSmoothingEnabled=!1,P.drawImage(t.cacheCanvas,0,0,n,r),E.drawImage(A,0,0,n,r,-s*t.scale,-s*t.scale,B.width+2*s*t.scaleX,B.height+2*s*t.scaleY)},this.update(),this.zimBitmap_constructor(B),i&&(this.dynamicTicker=e.Ticker.add((function(){C.update()}))),Object.defineProperty(this,"amount",{get:function(){return o},set:function(e){o=e,x=Math.pow(Math.E,-o*b),z&&(k=Math.pow(Math.E,-o*b),n=o),C.update()}}),Object.defineProperty(this,"amountX",{get:function(){return o},set:function(e){o=e,z=!1,x=Math.pow(Math.E,-o*b),C.update()}}),Object.defineProperty(this,"amountY",{get:function(){return n},set:function(e){n=e,z=!1,k=Math.pow(Math.E,-n*b),C.update()}}),Object.defineProperty(this,"amountFactor",{get:function(){return c},set:function(t){c=t,b=e.constrain(10*c,0,10),x=Math.pow(Math.E,-o*b),k=Math.pow(Math.E,-n*b),C.update()}}),Object.defineProperty(this,"blur",{get:function(){return r},set:function(e){r=e,T=Math.pow(Math.E,-r*w),C.update()}}),Object.defineProperty(this,"blurFactor",{get:function(){return u},set:function(t){u=t,w=e.constrain(10*u,0,10),T=Math.pow(Math.E,-r*w),C.update()}}),Object.defineProperty(this,"dynamic",{get:function(){return i},set:function(t){i!=t&&((i=t)?C.dynamicTicker?C.dynamicTicker=e.Ticker.add(C.dynamicTicker):C.dynamicTicker=e.Ticker.add(C.update):C.dynamicTicker&&e.Ticker.remove(C.dynamicTicker))}}),this.dispose=function(){C.dynamicTicker&&e.Ticker.remove(C.dynamicTicker),this.zimBitmap_dispose()},!1!==d&&e.styleTransforms(this,m),this.clone=function(h){return C.cloneProps(new e.Pixel(h||!e.isPick(y[0])?t:y[0],h||!e.isPick(y[1])?o:y[1],h||!e.isPick(y[2])?n:y[2],h||!e.isPick(y[3])?r:y[3],i,h||!e.isPick(y[4])?a:y[4],l,s,h||!e.isPick(y[5])?c:y[5],h||!e.isPick(y[6])?u:y[6],d,this.group,g))}},e.extend(e.Pixel,e.Bitmap,["clone","dispose"],"zimBitmap",!1),e.Parallax=function(t,o,n,r,i,a,l){var s,c="layers, damp, auto, stage, startPaused, mouseMoveOutside, clamp";if(s=zob(e.Parallax,arguments,c,this))return s;if(z_d("68"),this.type="Parallax",zot(r))if(t&&t[0]&&t[0].obj&&t[0].obj.stage)r=t[0].obj.stage;else{if(!WW.zdf)return;r=WW.zdf.stage}n=!!zot(n),zot(i)&&(i=!1),zot(a)&&(a=!1);var u=r.getBounds().width,d=r.getBounds().height;r.mouseMoveOutside=a;var h=this;h.stageEvent=r.on("stagemousemove",(function(t){h.mouseX=t.rawX/e.scaX,h.mouseY=t.rawY/e.scaY}));var g=zot(o)?.1:o;this.addLayer=function(t){if(!(zot(t.obj)||zot(t.prop)||zot(t.propChange))){var o={obj:t.obj,prop:t.prop};o[o.prop]=t.propChange,zot(t.input)&&(t.input="mouseX"),o.input=t.input,o.split=zot(t.split)?!("mouseX"!=t.input||!n):t.split;var r=zot(t.inMin)?0:t.inMin,i=zot(t.inMax)?"mouseX"==t.input||"scrollX"==t.input?u:d:t.inMax,a=zot(t.factor)?1:t.factor,s=!zot(t.integer)&&t.integer;return o["p_"+o.prop]=new e.ProportionDamp(r,i,0,o[o.prop],g,a,s,l),"scale"==o.prop?o["s_"+o.prop]=o.obj.scaleX:"frame"==o.prop?o["s_"+o.prop]=o.obj.currentFrame:o["s_"+o.prop]=o.obj[o.prop],zot(t.immediate)||o["p_"+o.prop].immediate(t.immediate),p.push(o),h}},this.removeLayer=function(e){if(!zot(e)){var t=p[e];return t["p_"+t.prop].dispose(),p.splice(e,1),h}},this.immediate=function(e){for(var t,o=0;o<p.length;o++)(t=p[o])["p_"+t.prop].immediate(e[o]);return h},this.dispose=function(){return r.off("stagemousemove",h.stageEvent),p=null,n&&e.Ticker.remove(m),!0},t=zot(t)?[]:t;for(var p=[],f=0;f<t.length;f++)this.addLayer(t[f]);if(n){var m=e.Ticker.add(z,r);i&&e.Ticker.remove(m)}function z(){h.step()}this.step=function(t){for(var o,n,r=0;r<p.length;r++)o=p[r],zot(t)?"mouseX"==o.input?n=h.mouseX:"mouseY"==o.input?n=h.mouseY:"scrollX"==o.input?n=e.scrollX():"scrollY"==o.input&&(n=e.scrollY()):n=t,"scale"==o.prop?o.obj.scaleX=o.obj.scaleY=o["s_"+o.prop]+o["p_"+o.prop].convert(n):"frame"==o.prop?o.obj.gotoAndStop(o["s_"+o.prop]+o["p_"+o.prop].convert(n)):(o.obj[o.prop]=o["s_"+o.prop]+o["p_"+o.prop].convert(n),o.split&&(o.obj[o.prop]-=o[o.prop]/2));return h},h.paused=i,h.pause=function(t){return zot(t)&&(t=!0),h.paused!=t&&(h.paused=t,m&&(t?e.Ticker.remove(m):m=e.Ticker.add(m))),h},Object.defineProperty(h,"damp",{get:function(){return g},set:function(e){var t;g=e;for(var o=0;o<p.length;o++)(t=p[o])["p_"+t.prop].damp=g}})},e.Flipper=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p){var f,m="front, back, interactive, time, vertical, flipped, easeRoot, frontPress, backPress, reverse, continuous, style, group, inherit";if(f=zob(e.Flipper,arguments,m,this))return f;z_d("68.5"),this.group=g;var z=!1===h?{}:e.getStyle("Flipper",this.group,p);if(zot(t)&&(t=null!=z.front?z.front:WW.zdf.makeIcon().sca(2)),zot(o)&&(o=null!=z.back?z.back:new e.Page(t.width,t.height,e.dark)),this.front=t,this.back=o,a){var y=t;t=o,o=y}var v=Math.max(t.width,o.width),b=Math.max(t.height,o.height);this.zimContainer_constructor(v,b),this.type="Flipper",zot(r)&&(r=null!=z.time?z.time:.2),zot(i)&&(i=null!=z.vertical&&z.vertical),zot(n)&&(n=null!=z.interactive&&z.interactive),zot(a)&&(a=null!=z.flipped&&z.flipped),zot(l)&&(l=null!=z.easeRoot?z.easeRoot:"quad"),zot(s)&&(s=null==z.frontPress||z.frontPress),zot(c)&&(c=null==z.backPress||z.backPress),zot(u)&&(u=null!=z.reverse&&z.reverse),zot(d)&&(d=null!=z.continuous&&z.continuous);var w=a;this.flipped=a;var C,x=this;function k(e,t,o,n){if(zot(o)&&(o=1),o*=u?-1:1,d&&(o=u?w?1:-1:w?-1:1),zot(n)&&(n=r),x.flipped=!x.flipped,x.dispatchEvent("flip"),0==n)return x.removeAllChildren(),t.scale=t.oScale,t.skewX=t.skewY=0,t.centerReg(x),void x.dispatchEvent("flipped");var a,s;i?(a={skewX:-90*o,scaleY:e.oScale/2},s={skewX:0,scaleY:t.oScale},t.ske(90*o,0).sca(t.oScale,t.oScale/2)):(a={skewY:-90*o,scaleX:e.oScale/2},s={skewY:0,scaleX:t.oScale},t.ske(0,90*o).sca(t.oScale/2,t.oScale)),e.animate({props:a,time:r,ease:l+"In",call:function(){e.removeFrom(),t.centerReg(x).animate({props:s,time:r,ease:l+"Out",call:function(){x.dispatchEvent("flipped")}})}})}t.centerReg(this),(s&&!a||c&&a)&&((C=n&&t.backing?t.backing:t).on("mousedown",(function(){k(t,o)})),C.cur()),(c&&!a||s&&a)&&((C=n&&o.backing?o.backing:o).on("mousedown",(function(){k(o,t,-1)})),C.cur()),t.oScale=t.scale,o.oScale=o.scale,t.flipper=x,t.other=o,o.flipper=x,o.other=t,n||(t.mouseChildren=o.mouseChildren=!1),this.flip=function(e,n){e!=x.flipped&&(x.flipped?k(w?t:o,w?o:t,-1,n):k(w?o:t,w?t:o,1,n))},!1!==h&&e.styleTransforms(this,z),this.clone=function(){return x.cloneProps(new e.Flipper(t.clone(),o.clone(),n,r,i,a,l,s,c,u,d,h,this.group,p))}},e.extend(e.Flipper,e.Container,"clone","zimContainer"),e.Book=function(o,n,r,i,a,l,s,c){var u,d="width, height, pages, startPage, rollUp, radius, backgroundColor, arrows";if(u=zob(e.Book,arguments,d,this))return u;z_d("68.7"),zot(o)&&(o=WW.zdf?WW.zdf.stage.width:1024),zot(n)&&(n=WW.zdf?WW.zdf.stage.height:768),this.zimContainer_constructor(o,n),this.type="Book",zot(r)&&(r=[]),zot(i)&&(i=0),zot(a)&&(a=!0),zot(s)&&(s=e.darker),zot(c)&&(c=!0);var h,g,p=t(),f=this;0!=r.length&&(f.backing=new e.Rectangle(o-2,n-2,s),e.loop(r,(function(t,o){"string"==typeof t&&(r[o]=e.asset(t)),r[o].zimBookIndex=o})),f.added(m),f.nextPage=function(e){if(zot(f.rollUp))return setTimeout((function(){f.nextPage(e)}),10),f;f.moving||f.rollUp(o/2+.1,n+.1,"right",e,"quadIn")},f.prevPage=function(e){if(zot(f.rollUp))return setTimeout((function(){f.prevPage(e)}),10),f;f.moving||f.rollUp(o/2+.1,n+.1,"left",e,"quadIn")},f.gotoPage=function(t,o){if(zot(f.rollUp))return setTimeout((function(){f.gotoPage(t,o)}),10),f;t=e.constrain(t,0,f.pages.length-1),zot(o)&&(o="s"==p?.3:300);var n=o+("s"==p?.35:350);f.pageInterval=e.interval(n,(function(r){var i=!1;f._currentPage<t?f.nextPage(o):f._currentPage>t?f.prevPage(o):i=!0,f.dispatchEvent("pageturn"),r.count==r.total-1&&(i?f.dispatchEvent("pagedone"):e.timeout(n,(function(){f.dispatchEvent("pagedone")})))}),Math.floor(Math.abs(t-f._currentPage)/2+1),!0)},Object.defineProperty(f,"page",{get:function(){return f._currentPage},set:function(e){f.gotoPage(e,"s"==p?.1:100)}}),Object.defineProperty(f,"pages",{get:function(){return r},set:function(){zon&&zogy("Book() - pages is read only")}}),this.dispose=function(e,t,o){return f.stageEvent&&h.off("stagemousedown",f.stageEvent),f.moveEvent&&h.off("stagemousemove",f.moveEvent),f.upEvent&&h.off("stagemouseup",f.upEvent),f.keydown&&g.off("keydown",f.keydown),f.removeFrom(),o||this.zimContainer_dispose(!0),!0});function m(t){g=(h=t).frame;var u,d,m,z,y,v,b,w=new e.Shape;function C(t){f._currentPage=t,f.removeAllChildren(),f.backing.loc(1,1,f),f.setMask(f.backing),w.addTo(f),w.c().f(e.black).dr(0,0,0,0),f.moving=!1,r[t-1]?u=r[t-1].reg(0,0).rot(0).loc(0,0,f):t>0&&b.reg(0,0).rot(0).loc(0,0,f).setMask(null),d=r[t-2]?r[t-2].reg(o/2,n).loc(0,n,f).rot(-90):new e.Rectangle(o/2,n,s).reg(o/2,n).loc(0,n,f).rot(-90),m=r[t-3]?r[t-3].rot(0).loc(0,0,f).setMask(w):new e.Rectangle(o/2,n,s).loc(0,0,f).setMask(w),r[t]?(z=r[t].rot(0).reg(0,0).pos(0,0,e.RIGHT,e.TOP,f),r[t+1]?y=r[t+1].reg(0,n).loc(o,n,f).rot(90):(y=new e.Rectangle(o/2,n,s).reg(0,n).loc(o,n,f).rot(90),b=y),v=r[t+2]?r[t+2].rot(0).pos(0,0,e.RIGHT,e.TOP,f).setMask(w):new e.Rectangle(o/2,n,s).pos(0,0,e.RIGHT,e.TOP,f).setMask(w),h.update()):h.update()}f._currentPage=i,C(i),Object.defineProperty(f,"directPage",{get:function(){return f._currentPage},set:function(e){C(e=i%2==1?2*Math.ceil(e/2)-1:2*Math.ceil(e/2))}});var x=!1;function k(){f.stageEvent=h.on("stagemousedown",(function(){var t,i;if(!f.moving){var a=f.globalToLocal(g.mouseX,g.mouseY);if(!(a.x<0||a.x>o||a.y<0||a.y>n||l>0&&e.dist(a,new e.Point(0,n))>l&&e.dist(a,new e.Point(o,n))>l)){var s=a.x>o/2?"right":"left";"right"==s&&f._currentPage>=r.length-1||"left"==s&&f._currentPage<=1||(f.moving=!0,"right"==s?(z.addTo(f),y.addTo(f),v.addTo(f),f.pageNext=v.zimBookIndex):(u.addTo(f),d.addTo(f),m.addTo(f),f.rolledUp&&P(0,0,"right"),f.pageNext=d.zimBookIndex),f.direction=s,f.dispatchEvent("rollpress"),f.moveEvent=h.on("stagemousemove",(function(){T&&(T.clear(),T=null);var r=f.globalToLocal(g.mouseX,g.mouseY);t="right"==s?o-r.x:r.x,i=n-r.y+t,f.currentW=t=e.constrain(t,0,o/2),f.currentH=i=e.constrain(i,0,n),P(t,i,s)})),f.upEvent=h.on("stagemouseup",(function(){h.off("stagemousemove",f.moveEvent),x||A(t,i,s)}),null,!0))}}}))}if(f.currentW=0,f.currentH=0,f.moving=!1,k(),f.rollUp=function(t,o,n,i,a){if(!f.moving&&!("right"==n&&f._currentPage>=r.length-1||"left"==n&&f._currentPage<=1)){"right"==n?(z.addTo(f),y.addTo(f),v.addTo(f)):(f.rolledUp&&P(0,0,"right"),u.addTo(f),d.addTo(f),m.addTo(f)),f.moving=!0,zot(i)&&(i="s"==p?.5:5e-4),zot(a)&&(a=null),f.animate({props:{currentW:t,currentH:o},time:i,ease:a,call:function(){e.Ticker.remove(l),f.moving=!1,P(t,o,n)}});var l=e.Ticker.add((function(){P(f.currentW,f.currentH,n)}))}},!1!==a){f.rolledUp=!0,!0===a&&(a="s"==p?1:.001);var T=e.timeout(a,(function(){f.rollUp(60,130,"right",.5),f.dispatchEvent("rollup")}))}function A(t,o,n,r){f.moving=!0,f.rolledUp=!1,zot(r)&&(r="s"==p?.7:7e-4),f.animate({props:{currentW:0,currentH:0},time:r,call:function(){e.Ticker.remove(i),P(0,0,n),f.moving=!1,f.dispatchEvent("rolldown")}});var i=e.Ticker.add((function(){P(f.currentW,f.currentH,n)}))}function P(t,r,i){var a;"right"==i?(w.c().mt(o,n).lt(o-t,n).lt(o,n-r).cp(),a=Math.atan2(t,r),y.loc(o-(t+t*Math.cos(2*a)),n-t*Math.sin(2*a)).rot(2*a*e.DEG),!x&&t>=o/2&&r>=n&&function(){x=!0,f.moving=!0,f.moveEvent&&h.off("stagemousemove",f.moveEvent);f.upEvent&&h.off("stagemouseup",f.upEvent);f.currentW=0,f.currentH=0,f.lastPage=e.constrain(f._currentPage),f.direction="right",f.pageNext=v.zimBookIndex,f.dispatchEvent("pageanimate"),f.animate({ease:"quadOut",props:{currentW:o/2},time:.3,timeUnit:"s",call:function(){e.Ticker.remove(t),y.reg(0,0),v.setMask(null),C(f._currentPage+2),f.moving=!1,x=!1,f.currentW=0,f.currentH=0,f.dispatchEvent("page")}});var t=e.Ticker.add((function(){w.c().mt(o,n).lt(o/2,n).lt(o-f.currentW,0).lt(o,0).cp()}));y.reg(o/2,n).loc(o/2,n,f).animate({props:{rotation:0},time:.3,ease:"quadOut",timeUnit:"s"})}()):(w.c().mt(0,n).lt(t,n).lt(0,n-r).cp(),a=Math.atan2(t,r),d.loc(t+t*Math.cos(2*a),n-t*Math.sin(2*a)).rot(2*-a*e.DEG),!x&&t>=o/2&&r>=n&&function(){x=!0,f.moving=!0,f.moveEvent&&h.off("stagemousemove",f.moveEvent);f.upEvent&&h.off("stagemouseup",f.upEvent);f.currentW=0,f.currentH=0,f.lastPage=e.constrain(f._currentPage),f.direction="left",f.pageNext=d.zimBookIndex,f.dispatchEvent("pageanimate"),f.animate({ease:"quadOut",props:{currentW:o/2},time:.3,timeUnit:"s",call:function(){e.Ticker.remove(t),d.reg(0,0),m.setMask(null),C(f._currentPage-2),f.moving=!1,x=!1,f.currentW=0,f.currentH=0,f.dispatchEvent("page")}});var t=e.Ticker.add((function(){w.c().mt(0,n).lt(o/2,n).lt(f.currentW,0).lt(0,0).cp()}));d.reg(0,n).loc(o/2,n,f).animate({props:{rotation:0},time:.3,timeUnit:"s",ease:"quadOut"})}()),h.update()}f.rollDown=function(e,t,o,n){f.moving||"right"==o&&f._currentPage>=r.length-1||"left"==o&&f._currentPage<=1||A(e,t,o,n)},c&&(!0===c&&(c=.2),f.keydown=g.on("keydown",(function(e){39==e.keyCode?f.nextPage(c):37==e.keyCode&&f.prevPage(c)}))),f.changeFrame=function(e){return f.stageEvent&&h.off("stagemousedown",f.stageEvent),f.moveEvent&&h.off("stagemousemove",f.moveEvent),f.upEvent&&h.off("stagemouseup",f.upEvent),g=e,h=e.stage,k(),f}}},e.extend(e.Book,e.Container,["clone","dispose"],"zimContainer"),e.Scrambler=function(o,n,i,a,l,s,c,u,d,h,g,p,f,m){var z,y="tile, keys, keyProperty, scramble, time, wait, num, shadowColor, shadowBlur, swap, swapLock, style, group, inherit";if(z=zob(e.Scrambler,arguments,y,this))return z;z_d("67.35"),this.zimContainer_constructor(null,null,null,null,!1),this.type="Scrambler",this.group=f;var v=!1===p?{}:e.getStyle(this.type,this.group,m);zot(o)&&(o=null!=v.tile?v.tile:o),zot(n)&&(n=null!=v.keys?v.keys:null),zot(i)&&(i=null!=v.keyProperty?v.keyProperty:null),zot(a)&&(a=null==v.scramble||v.scramble),zot(l)&&(l=null!=v.time?v.time:0),zot(s)&&(s=null!=v.wait?v.wait:0),zot(c)&&(c=null!=v.num?v.num:1),zot(u)&&(u=null!=v.shadowColor?v.shadowColor:"rgba(0,0,0,.3)"),zot(d)&&(d=null!=v.shadowBlur?v.shadowBlur:5),zot(h)&&(h=null!=v.swap&&v.swap),zot(g)&&(g=null!=v.swapLock&&v.swapLock),g&&(h=!0),zot(o)&&(o=new e.Tile(new e.Rectangle(100,100,e.series(e.silver,e.tin,e.grey,e.dark,e.darker)),5,1,5)),o.addTo(this);var b=this;b.complete=!0;var w=t(l);t(s);var C,x,k,T=(o.width+o.spacingH)/o.cols,A=(o.height+o.spacingV)/o.rows,P=WW.zdf,B=e.makeID(null,10),E=!1;function I(t){var n=t.target;n.stopAnimate();var r=n.boundsToGlobal(),i=o.hitTestGrid(o.width,o.height,o.cols,o.rows,r.x+r.width/2,r.y+r.height/2,null,null,o.spacingH,o.spacingV,null,"open");zot(i)||e.loop(o,(function(e){if(e!=n&&!1!==e.paused){var t,r=e.boundsToGlobal(),a=o.hitTestGrid(o.width,o.height,o.cols,o.rows,r.x+r.width/2,r.y+r.height/2,null,null,o.spacingH,o.spacingV,null,"open");if(!zot(a))i[2]==a[2]&&(e.x>=n.x&&e.x<=n.x+T/2||e.x<=n.x&&e.x>=n.x-T/2)&&(t=e.x,e.mouseEnabled=!1,e.top().ord(-1),e.animate({props:{x:C},time:.2,id:B,timeUnit:"seconds",call:function(){e.mouseEnabled=!0,h&&!b.complete&&b.test()&&(b.complete=!0,b.dispatchEvent("complete"))}}),C=t),i[1]==a[1]&&(e.y>=n.y&&e.y<=n.y+A/2||e.y<=n.y&&e.y>=n.y-A/2)&&(t=e.y,e.mouseEnabled=!1,e.top().ord(-1),e.animate({props:{y:x},time:.201,override:!1,id:B,timeUnit:"seconds",call:function(){e.mouseEnabled=!0,h&&!b.complete&&b.test()&&(b.complete=!0,b.dispatchEvent("complete"))}}),x=t)}}),!0)}function S(e){o.loop((function(t){t!=e&&t.noMouse()}))}function W(){o.loop((function(e){e.locked||e.mouse()}))}o.pointers={},o.on("mousedown",(function(e){if(!E){E=!0,S(e.target),b.myDownCheck=!0,k=e.target;var t="id"+Math.abs(e.pointerID+1);if(o.pointers[t]=!0,g){var n=o.current;if(b.testItem(e.target,n.indexOf(e.target)))return e.target.noMouse(),e.target.noDrag(),e.target.locked=!0,void(b.myDownCheck=!1)}if(C=e.target.x,x=e.target.y,-1!=u&&d>0){var r=new createjs.Shadow(u,3,3,d);e.target.backing?e.target.backing.shadow=r:e.target.shadow=r}b.upEvent&&o.off("pressup",b.upEvent),P&&(b.scrmu||(b.scrmu=P.on("mouseupplus",(function(e){b.myDownCheck&&(b.myDownCheck=!1,i(e={target:k,pointerID:e.pointerID},!0),b.upEvent&&o.off("pressup",b.upEvent))})))),b.upEvent=o.on("pressup",(function(e){var t="id"+Math.abs(e.pointerID+1);o.pointers[t]&&(b.myDownCheck=!1,i(e))})),h||(b.moveEvent&&o.off("pressmove",b.moveEvent),b.moveEvent=o.on("pressmove",(function(e){I(e)})))}function i(e,t){var r="id"+Math.abs(e.pointerID+1);if(o.pointers[r]){delete o.pointers[r];var i=!0;if(W(),E=!1,b.upEvent&&o.off("pressup",b.upEvent),g){var l=e.target.boundsToGlobal(),s=o.hitTestGrid(o.width,o.height,o.cols,o.rows,l.x+l.width/2,l.y+l.height/2,null,null,o.spacingH,o.spacingV,null,"open");if(zot(s))i=!1;else{var c=n[s[0]];i=e.target!=c&&!b.testItem(c,s[0])}}h&&i&&I(e),e.target.mouseEnabled=!1,t?(e.target.x=C,e.target.y=x,a()):e.target.animate({props:{x:C,y:x},time:.1,id:B,timeUnit:"seconds",pauseOnBlur:!1,call:a})}}function a(){!b.complete&&b.test()&&(b.complete=!0,b.dispatchEvent("complete")),-1!=u&&d>0&&(e.target.backing?e.target.backing.shadow=null:e.target.shadow=null),e.target.mouseEnabled=!0}})),this.test=function(){var t=o.current;return e.loop(t,(function(e,t){return!zot(e)&&(!!b.testItem(e,t)&&void 0)}))},this.testItem=function(e,t){if(!zot(e)){if(zot(t)&&(t=o.current.indexOf(e)),n){if((zot(i)?e.key:e[i])!=n[t])return!1}else if(o.items[t]!=e)return!1;return!0}},this.starts=[];var M=[];e.loop(o.rows*o.cols,(function(e){M.push(e)}));var O=M.slice();function j(){b.upEvent&&o.off("pressup",b.upEvent),b.moveEvent&&o.off("pressmove",b.moveEvent),o.noDrag(),s+l>0&&b.noMouse()}function L(t,n,r){e.stopAnimate(B),e.loop(o.items,(function(e,i,a){var l=b.starts[t[i]];n?e.animate({props:{x:l.x,y:l.y},time:n,ease:r?"quadInOut":"quadOut",wait:r,timeUnit:"seconds",id:B}):(e.loc(l),b.stage?e.drag({boundary:o,singleTouch:!0}):i==a-1&&b.added((function(){o.drag({boundary:o,singleTouch:!0})})))}))}o.loop((function(e){e.mouseChildren=!1,b.starts.push({x:e.x,y:e.y})})),this.inactive=!1,this.scramble=function(t,r,a){function l(){for(var r=!0,l=0;r&&l<50;)l++,e.shuffle(M),r=e.loop(M,(function(e,t){var r=o.getChildAt(e);if(n){if((zot(i)?r.key:r[i])!=n[t])return!1}else if(o.items[t]!=r)return!1}));L(M,t/a),e.timeout(t,(function(){b.dispatchEvent("scrambled")}))}return zot(r)&&(r=0),zot(t)&&(t=0),(zot(a)||0==t)&&(a=1),j(),e.timeout(r,(function(){t>0?e.interval(t/a,l,a,!0):l()})),setTimeout((function(){b.complete=!1,o.loop((function(e){e.mouse(),e.locked=!1})),b.mouse(),o.drag({boundary:o,singleTouch:!0}),E=!1}),"s"==w?1e3*(r+t):r+t),b},a?b.scramble(l,s,c):b.added((function(){o.drag({boundary:o,singleTouch:!0})})),this.solve=function(e,t,n){zot(n)&&(n=!0),zot(t)&&(t=0),zot(e)&&(e=0),t+e==0&&n&&b.noMouse(),setTimeout((function(){M=O.slice(),j(),L(M,e,0)}),"s"==w?1e3*t:t),n||setTimeout((function(){b.mouse(),o.drag({boundary:o,singleTouch:!0})}),"s"==w?1e3*(t+e):t+e)},this._enabled=!0,Object.defineProperty(b,"enabled",{get:function(){return b._enabled},set:function(t){r(b,t),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!b.stage||b.stage.update()}}),Object.defineProperty(b,"order",{get:function(){var t=[];return e.loop(o.current,(function(e){if(!e)return!1;t.push(e.tileNum)}))&&t.length==M.length?M=t:M},set:function(t){var n=[];e.loop(t,(function(e){n.push(o.items[e])})),o.remake(n),o.stage&&o.stage.update()}}),this.dispose=function(e,t,n){return b.scrmu&&P.off("mouseupplus",b.scrmu),o.removeAllEventListeners(),n||(b.zimContainer_dispose(!0),b.stage&&b.stage.update()),!0},!1!==p&&e.styleTransforms(this,v),this.clone=function(){return b.cloneProps(new e.Scrambler(o.clone(),n,i,a,l,s,c,u,d,h,g,p,b.group,m))}},e.extend(e.Scrambler,e.Container,["clone","dispose"],"zimContainer",!1),e.Scroller=function(t,o,n,r,i,a,l,s,c,u){var d,h="backing, speed, direction, horizontal, gapFix, stage, container, style, group, inherit";if(d=zob(e.Scroller,arguments,h,this))return d;z_d("69"),this.cjsEventDispatcher_constructor(),this.type="Scroller",this.group=c;var g=!1===s?{}:e.getStyle(this.type,this.group,u);if(zot(t)&&(t=null!=g.backing?g.backing:null),!zot(t)){var p=this.backing1=t;if(!zot(p)&&p.getBounds){var f=this.backing2=t.clone(!0);zot(r)&&(r=null==g.horizontal||g.horizontal),zot(i)&&(i=null!=g.gapFix?g.gapFix:0),zot(l)&&(l=null!=g.container?g.container:null),zot(a)&&(a=null!=g.stage?g.stage:null);var m=this;zot(o)&&(o=null!=g.speed?g.speed:1),this.speed=o;var z=this.baseSpeed=this.speed;zot(n)&&(n=null!=g.direction?g.direction:1),this.direction=n;var y=r?p.scaleX:p.scaleY;if("AC"!=p.type)if(p.getBounds())if(a||p.stage)if(p.parent)if(p.parent.addChildAt(f,p.parent.getChildIndex(p)),a=a||p.stage,zot(l)&&(l=a),l.getBounds()){var v,b,w=p.getBounds().width*y-i,C=p.getBounds().height*y-i;r?f.x=w:f.y=C;var x=!1,k=e.Ticker.add(T,a);this.paused=!1,this.pause=function(t,o){return zot(t)&&(t=!0),zot(o)&&(o=0),t?(z=m.speed,o>0?(x=!0,e.animate({target:m,obj:{pausingSpeed:0},ticker:!1,time:o,call:function(){m.speed=0,m.paused=!0,x=!1,m.dispatchEvent("pause")}})):(x=!1,m.speed=0,m.paused=!0,setTimeout((function(){m.dispatchEvent("pause")}),10))):(x=!1,o>0?e.animate({target:m,obj:{pausingSpeed:z},ticker:!1,time:o,call:function(){m.speed=z,m.paused=!1,x=!1}}):(m.speed=z,m.paused=!1)),m},Object.defineProperty(m,"percentSpeed",{get:function(){return 0==m.baseSpeed?NaN:m.speed/m.baseSpeed*100},set:function(e){x||m.paused||(m.speed=m.baseSpeed*e/100)}}),Object.defineProperty(m,"pausingSpeed",{get:function(){return 0==m.baseSpeed?NaN:m.speed/m.baseSpeed*100},set:function(e){m.speed=m.baseSpeed*e/100}}),Object.defineProperty(m,"percentComplete",{get:function(){return r?p.x<0&&p.x>f.x?-p.x/p.width*100:(-f.x/f.width*100+1e9)%100:p.y<0&&p.y>f.y?-p.y/p.height*100:(-f.y/f.height*100+1e9)%100},set:function(e){e=(e+1e9)%100,r?(p.x=-e*p.width/100,f.x=p.x+w):(p.y=-e*p.height/100,f.y=p.y+C)}}),!1!==s&&e.styleTransforms(this,g),this.dispose=function(){return e.Ticker.remove(k),!0}}else zogy("zim display - Scroller(): please setBounds() on container or stage if no container");else zogy("ZIM Scroller(): please add object to container or stage before adding to Scroller");else zogy("ZIM Scroller(): please pass in stage parameter or add backing objects to stage to start");else zogy("ZIM Scroller(): please setBounds() on backing objects");else zogy("ZIM Scroller(): please provide Pic() with dimensions for backing objects")}}function T(){v||(v=l.getBounds().width,b=l.getBounds().height),0!=m.speed&&0!=m.direction&&(r?(p.x-=m.speed*m.direction,p.x<f.x?f.x=p.x+w:f.x=p.x-w,m.direction*m.speed>0?f.x<0&&p.x<f.x?p.x=f.x+w:p.x<0&&f.x<p.x&&(f.x=p.x+w):f.x>v&&f.x>p.x?f.x=p.x-w:p.x>v&&p.x>f.x&&(p.x=f.x-w)):(p.y-=m.speed*m.direction,p.y<f.y?f.y=p.y+C:f.y=p.y-C,m.direction*m.speed>0?f.y<0&&p.y<f.y?p.y=f.y+C:p.y<0&&f.y<p.y&&(f.y=p.y+C):f.y>b&&f.y>p.y?f.y=p.y-C:p.y>b&&p.y>f.y&&(p.y=f.y-C)))}},e.extend(e.Scroller,createjs.EventDispatcher,null,"cjsEventDispatcher"),e.Dynamo=function(t,o,n,r,i,a,l,s,c,u,d,h){var g,p="sprite, speed, label, startFrame, endFrame, update, reversible, flip, flipVertical, style, group, inherit";if(g=zob(e.Dynamo,arguments,p,this))return g;z_d("69.2"),this.cjsEventDispatcher_constructor(),this.type="Dynamo",this.group=d;var f=!1===u?{}:e.getStyle(this.type,this.group,h);if(zot(t)&&(t=null!=f.sprite?f.sprite:null),!zot(t)){var m=this.frames=t.parseFrames(n,r,i,!0);if(0!=m.length){this.totalFrames=m.length;var z=0;zot(o)&&(o=null!=f.speed?f.speed:30),zot(l)&&(l=null==f.reversible||f.reversible);var y=this.baseSpeed=this.speed=o;zot(a)&&(a=null!=f.update&&f.update),zot(s)&&(s=null!=f.flip?f.flip:null),zot(s)&&0==l&&(s=!0);var v,b,w,C,x,k=this,T=Date.now(),A=!1;k.scaleX=t.scaleX,k.scaleY=t.scaleY,P(),this.paused=!1,this.pause=function(t,o,n){if(zot(t)&&(t=!0),t!=k.paused)return zot(o)&&(o=0),t?(y=k.speed,void 0===n?o>0?(A=!0,e.animate({target:k,obj:{pausingSpeed:0},ticker:!1,time:o,call:function(){A=!1,k.speed=0,k.paused=!0,k.dispatchEvent("pause")}})):(A=!1,k.speed=0,k.paused=!0,setTimeout((function(){k.dispatchEvent("pause")}),10)):(A=!0,x=n)):(x=null,o>0?(A=!0,e.animate({target:k,obj:{pausingSpeed:y},ticker:!1,time:o,call:function(){A=!1,k.speed=y,k.paused=!1}})):(A=!1,k.speed=y,k.paused=!1)),k},Object.defineProperty(k,"frame",{get:function(){return z},set:function(e){z=Math.round(e)%m.length;var o=m[z];zot(o)||(t.frame=o.f)}}),Object.defineProperty(k,"percentSpeed",{get:function(){return 0==k.baseSpeed?NaN:A||k.paused?y/k.baseSpeed*100:k.speed/k.baseSpeed*100},set:function(e){A||k.paused?y=k.baseSpeed*e/100:k.speed=k.baseSpeed*e/100}}),Object.defineProperty(k,"pausingSpeed",{get:function(){return 0==k.baseSpeed?NaN:k.speed/k.baseSpeed*100},set:function(e){k.speed=k.baseSpeed*e/100}}),!1!==u&&e.styleTransforms(this,f),this.dispose=function(){cancelAnimationFrame(v)}}}function P(){if(v=requestAnimationFrame(P),b=m[z].s,0!=k.speed&&0!=b&&(C=1e3/Math.abs(k.speed)*b,(w=Date.now())-T>C)){T=w;var e=k.frame+(k.speed>0||!l?1:-1),o=!1;e>=m.length&&(o=!0,e=0),e<0&&(o=!0,e=m.length-1),k.frame=e,s&&(k.speed<0?t.scaleX=-k.scaleX:t.scaleX=k.scaleX),c&&(k.speed<0?t.scaleY=-k.scaleY:t.scaleY=k.scaleY),o&&k.dispatchEvent("loop"),k.dispatchEvent("change"),a&&t.stage&&t.stage.update(),zot(x)||x!=k.frame||(A=!1,k.speed=0,k.paused=!0,k.dispatchEvent("pause"))}}},e.extend(e.Dynamo,createjs.EventDispatcher,null,"cjsEventDispatcher"),e.Accelerator=function(e){z_d("69.3"),this.cjsEventDispatcher_constructor();var t=this;this.type="Accelerator",this.paused=!1,this.items=[],this.paused=!1,this._percentSpeed=100,this.add=function(e){var o;o=Array.isArray(e)?e:[e];for(var n=0;n<o.length;n++)t.items.indexOf(o[n])<0&&t.items.push(o[n]);return t},e&&this.add(e),this.remove=function(e){var o,n;o=Array.isArray(e)?e:[e];for(var r=0;r<o.length;r++)(n=t.items.indexOf(o[r]))>=0&&t.items.splice(n,1);return t},this.pause=function(e,o,n){if(zot(e)&&(e=!0),e!=t.paused){var r=[];if(e){zot(n)||(o=null);for(var i=!1,a=0;a<t.items.length;a++)(zot(o)||!zot(n)||t.items[a].totalFrames)&&(!t.items[a].totalFrames||zot(o)&&zot(n))||(t.items[a].pause(!0,o,n),i=!0,r[a]=1,t.items[a].on("pause",(function(){t.paused||(l(),t.paused=!0,t.dispatchEvent("pause"))}),null,!0));i||(l(),t.paused=!0,setTimeout((function(){t.dispatchEvent("pause")}),10))}else t.paused=!1,l()}function l(){for(var o=0;o<t.items.length;o++)1!=r[o]&&t.items[o].pause(e)}},Object.defineProperty(t,"percentSpeed",{get:function(){return t._percentSpeed},set:function(e){t._percentSpeed=e;for(var o=0;o<t.items.length;o++)t.items[o].percentSpeed=e}}),this.dispose=function(){for(var e=0;e<t.items.length;e++)t.items[e].dispose();return t.items=null,!0}},e.extend(e.Accelerator,createjs.EventDispatcher,null,"cjsEventDispatcher"),e.Emitter=function(n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L){var D,_="obj, width, height, interval, num, life, fade, shrink, decayTime, decayStart, trace, traceFadeTime, traceShiftX, traceShiftY, angle, force, gravity, wind, layers, animation, random, horizontal, vertical, sink, sinkForce, cache, events, startPaused, pool, poolMin, particles, style, group, inherit";if(D=zob(e.Emitter,arguments,_,this))return D;z_d("69.9"),this.type="Emitter",this.group=j;var Y=!1===O?{}:e.getStyle(this.type,this.group,L);zot(n)&&(n=null!=Y.obj?Y.obj:[new e.Circle(20,"#e472c4"),new e.Circle(20,"#acd241"),new e.Circle(20,"#50c4b7")]),zot(r)&&(r=null!=Y.width?Y.width:300),zot(i)&&(i=null!=Y.height?Y.height:300);var X=t(a);zot(a)&&(a=null!=Y.interval?Y.interval:"s"==X?.02:20),"number"==typeof a&&(a=Math.max("s"==X?.01:10,a)),zot(l)&&(l=null!=Y.num?Y.num:1),zot(g)&&(g=null!=Y.trace&&g.size),zot(p)&&(p=null!=Y.traceFadeTime?Y.traceFadeTime:d),zot(f)&&(f=null!=Y.traceShiftX?Y.traceShiftX:0),zot(m)&&(m=null!=Y.traceShiftY?Y.traceShiftY:0),o(s,X),zot(s)&&(s=null!=Y.life?Y.life:"s"==X?1:1e3),zot(c)&&(c=null==Y.fade||Y.fade),zot(u)&&(u=null!=Y.shrink?Y.shrink:!g),o(d,X),zot(d)&&(d=null!=Y.decayTime?Y.decayTime:"s"==X?1:1e3),zot(z)&&(z=null!=Y.angle?Y.angle:{min:0,max:360}),zot(y)&&(y=null!=Y.force?Y.force:5),zot(v)&&(v=null!=Y.gravity?Y.gravity:9.8),zot(b)&&(b=null!=Y.wind?Y.wind:0),zot(w)&&(w=null!=Y.layers?Y.layers:"top"),zot(r)&&(r=null!=Y.width?Y.width:100),zot(i)&&(i=null!=Y.height?Y.height:100),zot(k)&&(k=null!=Y.horizontal&&Y.horizontal),zot(T)&&(T=null!=Y.vertical&&Y.vertical),zot(A)&&(A=null!=Y.sink?Y.sink:null),!zot(A)&&zot(P)&&(P=null!=Y.sinkForce?Y.sinkForce:10),zot(E)&&(E=null!=Y.events&&Y.events),zot(I)&&(I=null!=Y.startPaused&&Y.startPaused),zot(S)&&(S=null==Y.pool||Y.pool),zot(W)&&(W=null!=Y.poolMin?Y.poolMin:0),zot(M)&&(M=null!=Y.particles?Y.particles:new e.Container),zot(C)&&(C=null!=Y.animation?Y.animation:null),M.type="Particles",this.zimContainer_constructor(r,i,null,null,!1),this.type="Emitter";var R=this;this.regX=r/2,this.regY=i/2,R.obj=n,R.particles=M,R.interval=a,R.num=l,R.life=s,R.fade=c,R.shrink=u,R.decayTime=d,R.decayStart=h,R.trace=g,R.traceFadeTime=p,R.traceShiftX=f,R.traceShiftY=m,R.angle=z,R.emitterForce=y,R.gravity=v,R.wind=b,R.layers=w,R.animation=C,R.random=x,R.horizontal=k,R.vertical=T,R.sink=A,R.sinkForce=P,R.events=E,R.startEmitterPaused=R.emitterPaused=I,R.pool=S,R.poolMin=W,R.particlesEmitted=0;var H,F,N=[],V=0,G=0;function q(t){if(R.emitterPaused=null,R.on("added",(function(){R.particles.addTo(R.parent)})),F=t,zot(B)&&(B=!F.isWebGL&&e.mobile()),B&&(F.snapToPixelEnabled=!0),F){var o=R.parent.getChildIndex(R);R.parent.addChildAt(M,o),k||T||R.centerReg(null,null,!1),R.zimInterval=e.interval(R.interval,(function(){var t,o,a=e.isPick(R.life)?e.Pick.getMinMax(R.life).max:R.life;(zot(a)&&(a="s"==X?1:1e3),R.startEmitterPaused)?R.pauseEmitter():(n=Array.isArray(R.obj)?R.obj:[R.obj]).length<=0||(Array.isArray(R.interval)?(R.interval.sort(l),t=R.interval[0]):t=R.interval.constructor=={}.constructor?R.interval.min:R.interval,Array.isArray(R.num)?(R.num.sort(l),o=R.num[R.num.length-1]):o=R.num.constructor=={}.constructor?R.num.max:R.num,e.loop(e.Pick.choose(R.num),(function(){if(R.decayTime>0){var l={};R.shrink&&(l.scale=0),R.fade&&(l.alpha=0)}var s,c,u;if(R.pool&&N.length>0&&G>=Math.max(R.poolMin,(a/t+5)*o))(s=N[V++%N.length]).visible=!0,(u=s.trace?s.getChildAt(0):s).emitShape&&(c=u.template,u.graphics.c().s(c.s?e.Pick.choose(c.s):null).ss(c.ss?e.Pick.choose(c.ss):null).sd(c.sd?e.Pick.choose(c.sd):null,c.offset?e.Pick.choose(c.offset):null)),s.trace&&s.updateCache(),"top"==R.layers?u.emitShape?s.addTo(M,null,!1):s.centerReg(M):u.emitShape?s.addTo(M,"bottom"==R.layers?0:e.rand(M.numChildren),!1):s.centerReg(M,"bottom"==R.layers?0:e.rand(M.numChildren)),s.scaleX=1,s.scaleY=1,u.scaleX=u.originalScaleX,u.scaleY=u.originalScaleY,u.rotation=u.originalRotation,u.color=u.originalColor,u.endSpurt=!1;else{G++,R.trace&&((s=new e.Container(r,i,null,null,!1)).trace=!0);var d=e.Pick.choose(e.shuffle(n)[0]);"shape"==d.type?(c=d,(u=new e.Shape(1,1,null,null,null,!1)).emitShape=!0,u.template=c,u.graphics.s(c.s?e.Pick.choose(c.s):null).ss(c.ss?e.Pick.choose(c.ss):null).sd(c.sd?e.Pick.choose(c.sd):null,c.offset?e.Pick.choose(c.offset):null),R.trace?u.addTo(s,null,!1):"top"==R.layers?u.addTo(M,null,!1):u.addTo(M,"bottom"==R.layers?0:e.rand(M.numChildren),null,!1)):((u=d.clone()).centerReg||zimify(u),R.trace?u.centerReg(s).pos({x:-1e3,y:-1e3,reg:!0}):"top"==R.layers?u.centerReg(M):u.centerReg(M,"bottom"==R.layers?0:e.rand(M.numChildren))),R.trace&&("top"==R.layers?s.addTo(M,null,!1):s.addTo(M,"bottom"==R.layers?0:e.rand(M.numChildren),!1),s.cache(f,m,r,i)),R.trace||(s=u),s.particle=u,u.originalAlpha=u.alpha,u.originalScaleX=u.scaleX,u.originalScaleY=u.scaleY,u.originalRotation=u.rotation,u.originalColor=u.color}R.currentParticle=u,R.particlesEmitted++,s.particleNormal=!0,s.particleDecaying=!1,s.particleFizzing=!1;var h=e.Pick.choose(R.angle),g=e.Pick.choose(R.emitterForce),p=g*Math.cos(h*Math.PI/180),z=g*Math.sin(h*Math.PI/180);u.info={position:{x:R.x,y:R.y},velocity:{x:p,y:z}},R.horizontal&&(u.info.position={x:R.x-R.regX+e.rand(0,r),y:R.y-R.regY+(R.vertical?i/2:0)}),R.vertical&&(u.info.position={x:R.x-R.regX+(R.horizontal?r/2:0),y:R.y-R.regY+e.rand(0,i)}),u.emitShape?u.graphics.mt(u.info.position.x,u.info.position.y):(u.x=u.info.position.x,u.y=u.info.position.y),u.alpha=u.originalAlpha,R.random&&e.loop(R.random,(function(t,o){var n=e.Pick.choose(o);"scale"==t?u.sca(n):("x"==t?u.info.position.x=R.horizontal||R.vertical?n:n+r/2:"y"==t&&(u.info.position.y=R.horizontal||R.vertical?n:n+i/2),"x"!=t&&"y"!=t||!u.emitShape||u.graphics.mt(u.info.position.x,u.info.position.y),u[t]=n,u.emitShape&&(u.x=0,u.y=0))})),B&&!u.emitShape&&u.cache(u.getBounds().x-10,u.getBounds().y-10,u.getBounds().width+20,u.getBounds().height+20);var y,v=!u.emitShape&&R.shrink;if(R.decayTime>0&&(R.fade||v||R.trace&&R.traceFadeTime>0)){var b=zik(R.life);if(R.trace&&R.traceFadeTime>0&&s.animate({obj:{alpha:0},time:R.traceFadeTime,wait:b-R.traceFadeTime,waitedCall:function(e){e.particleNormal=!1,e.particleFizzing=!0},call:U,override:!1,id:"decay"}),R.fade||v){var w={};R.fade&&(w.alpha=0),v&&(w.scaleX=0,w.scaleY=0),u.animate({obj:w,time:R.decayTime,wait:zot(R.decayStart)?b-R.decayTime:R.decayStart,waitedCall:function(e){e.parent!=R&&(e=e.parent),e.particleNormal=!1,e.particleDecaying=!0},call:function(t){var o;R.events&&Q("decayed",t),t.endSpurt&&Q("spurtdecayed",t),R.trace&&R.traceFadeTime>0||(zot(R.decayStart)||R.decayStart+R.decayTime>R.life?t.parent&&U(t.parent.trace?t.parent:t):(o=s,e.timeout(b-(R.decayStart+R.decayTime),(function(){U(o)}))))},override:!1,id:"decay"})}}else R.life>0&&((y=s).timeOut=e.timeout(R.life,(function(){U(y)})));if(R.events&&Q("emitted",s),Z(u),R.animation){var C=e.Pick.choose(R.animation);zot(C.override)&&(C.override=!1),u.animate(e.copy(C))}})));function l(e,t){return e-t}}),null,!0,!0);var a=0;H=R.emitterTicker=e.Ticker.add((function(){e.loop(M,(function(t){if(t.trace){var o=t;t=t.getChildAt(0)}var n=t.info,r=0,i=0;if(!zot(R.sink)){var l,s=R.particles.localToGlobal(n.position.x,n.position.y);l=R.sink.parent&&R.sink.parent.localToGlobal?R.sink.parent.localToGlobal(R.sink.x,R.sink.y):new createjs.Point(e.Pick.choose(R.sink.x),e.Pick.choose(R.sink.y));var c=e.angle(s.x,s.y,l.x,l.y);r=R.sinkForce*Math.cos(c*Math.PI/180),i=R.sinkForce*Math.sin(c*Math.PI/180)}var u=R.wind+r,d=R.gravity+i;n.velocity.x+=u*a,n.velocity.y+=d*a,n.position.x+=n.velocity.x*a*100,n.position.y+=n.velocity.y*a*100,t.emitShape?t.graphics.lt(n.position.x,n.position.y):(t.x=n.position.x,t.y=n.position.y),R.trace&&o&&o.updateCache(t.emitShape?null:"source-over")}))}),F),a=1/e.Ticker.framerate}}function U(e){if(R.events&&Q("fizzed",e),(e.trace?e.getChildAt(0).endSpurt:e.endSpurt)&&(Q("spurtfizzed",e),R.spurting=!1),R.pool&&"end"!=e.pooled)return e.pooled||(e.pooled=!0,N&&N.push(e)),void(e.visible=!1);R.removeChild(e),R.trace&&e.uncache(),e=null}function Q(e,t){if(!zot(t)){var o=new createjs.Event(e);o.particle=t.trace?t.getChildAt(0):t,R.dispatchEvent(o)}}function Z(e){zot(R.spurtCount)&&zot(R.spurtNum)||(R.spurtCount++,R.spurtCount>=R.spurtNum&&K(e))}function K(e){R.pauseEmitter(),R.spurtCount=R.spurtNum=null,zot(e)||(Q("spurted",e),e.endSpurt=!0)}e.added(R,q),R.particles.noMouse(),Object.defineProperty(R,"interval",{get:function(){return a},set:function(e){a=e,R.zimInterval&&(R.zimInterval.time=a)}}),this.removeFrom=function(){R.parent&&R.parent.removeChild(R),R.particles.removeFrom()},this.spurting=!1,this.spurt=function(t,o,n){var r,i="num, time, restart";return(r=zob(R.spurt,arguments,i))?r:(zot(o)||(e.timeout(e.Pick.choose(o),(function(){K(R.currentParticle)}),!0),R.spurting=!0),zot(t)||(R.spurtNum=e.Pick.choose(t),R.spurtCount=0,R.spurting=!0),R.pauseEmitter(!1,n,null,!0),R)},this.clearPool=function(){e.loop(R.particles,(function(e){e.pooled="end",e.visible||R.removeChild(e)}),!0),G=0,V=0,N=[]},R.startEmitterPaused||(this.emitterPaused=!1),this.pauseEmitter=function(t,o,n,r){if(R.startEmitterPaused=null,zot(t)&&(t=!0),zot(o)&&(o=!1),zot(n)&&(n=!1),t){if(R.emitterPaused)return R;n&&(H&&e.Ticker.remove(H),e.loop(R.particles,(function(e){e.pauseAnimate(),e.trace&&e.getChildAt(0).pauseAnimate(),e.timeOut&&e.timeOut.pause()}))),R.zimInterval.pause(),R.emitterPaused=!0}else{if(!R.emitterPaused)return R;o&&(e.loop(R.particles,(function(e){e.stopAnimate(),e.timeOut&&e.timeOut.clear(),e.trace&&e.getChildAt(0).pauseAnimate()})),R.removeAllChildren()),F&&H&&!e.Ticker.has(F,H)&&(e.Ticker.add(H,F),e.loop(R.particles,(function(e){e.pauseAnimate(!1),e.timeOut&&e.timeOut.pause(!1),e.trace&&e.getChildAt(0).pauseAnimate(!1)}))),R.zimInterval&&R.zimInterval.pause(!1,r),R.emitterPaused=!1}return R},this.resize=function(e,t){zot(e)||(r=e),zot(t)||(i=t),R.setBounds(0,0,r,i),k||T||R.centerReg(),R.clearPool()},!1!==O&&e.styleTransforms(this,Y),this.clone=function(t){var o;return o=Array.isArray(R.obj)||R.obj.constructor=={}.constructor?e.copy(R.obj):R.obj.clone?R.obj.clone(t):R.obj,R.cloneProps(new e.Emitter(o,r,i,R.interval,R.num,R.life,R.fade,R.shrink,R.decayTime,R.decayStart,R.trace,R.traceFadeTime,R.traceShiftX,R.traceShiftY,R.angle,R.emitterForce,R.gravity,R.wind,R.layers,R.animation,e.copy(R.random),R.horizontal,R.vertical,R.sink,R.sinkForce,B,R.events,I,R.pool,R.poolMin,O,R.group,L))},this.dispose=function(){return R.zimInterval&&R.zimInterval.clear(),H&&e.Ticker.remove(H),e.loop(N,(function(e){e&&e.dispose()})),M&&M.dispose&&M.dispose(),R.currentParticle&&R.currentParticle.dispose&&R.currentParticle.dispose(),n&&Array.isArray(n)?e.loop(n,(function(e){e.dispose&&e.dispose()})):n&&n.dispose&&n.dispose(),M=R.currentParticle=R.particles=n=R.obj=N=R.poolList=null,!0}},e.extend(e.Emitter,e.Container,"clone","zimContainer",!1),e.Generator=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C){var x,k="color, strokeColor, strokeWidth, draw, stamp, setup, maxCount, boundary, drawCount, drawPause, drawSpacebarPause, startX, startY, cache, recordLinePoints, frame, seed, output, outputType, style, group, inherit";if(x=zob(e.Generator,arguments,k,this))return x;z_d("69.92"),this.group=w;var T=!1===b?{}:e.getStyle("Generator",this.group,C);zot(m)&&(m=null!=T.frame?T.frame:WW.zdf);var A=m.stage;zot(t)&&(t=null!=T.color?T.color:null),zot(o)&&(o=null!=T.strokeColor?T.strokeColor:e.white),zot(n)&&(n=null!=T.strokeWidth?T.strokeWidth:1),zot(l)&&(l=null!=T.maxCount?T.maxCount:1e3),zot(s)&&(s=null!=T.boundary?T.boundary:new e.Boundary(0,0,A.width,A.height)),zot(c)&&(c=null!=T.drawCount?T.drawCount:1),zot(u)&&(u=null==T.drawPause||T.drawPause),zot(d)&&(d=null==T.drawSpacebarPause||T.drawSpacebarPause),zot(h)&&(h=null!=T.startX?T.startX:A.width/2),zot(g)&&(g=null!=T.startY?T.startY:A.height/2),zot(p)&&(p=null!=T.cache&&T.cache);var P=this.drawing=new e.Container(s.x,s.y,s.width,s.height).addTo(A),B=this.shape=new e.Shape(s.width,s.height).addTo(P);this.drawCount=c,zot(u)&&(u=!0),p&&B.cache(s.x,s.y,s.width,s.height),this.zimContainer_constructor(s.x,s.y,s.width,s.height),this.type="Generator";var E=this;if(E.draw=null,y){E.drawCount=10,!zot(i)&&zot(r)&&(r=i),i=null;var I=new e.Loader;E.outputNum=0,E.outputName=!0===y?"gen_":y.match(/_$/)?y:y+"_"}this.color=t,this.strokeColor=o,this.strokeWidth=n;var S=h,W=g;this.fill=function(e){return E.color=e,E.currentColor=zik(E.color),B.f(E.currentColor),this},this.stroke=function(e,t){return zot(e)||(E.strokeColor=e,E.currentStrokeColor=zik(E.strokeColor),B.s(E.currentStrokeColor)),zot(t)||(E.strokeWidth=t,E.currentStrokeWidth=zik(E.strokeWidth),B.ss(E.currentStrokeWidth)),this},this.noStroke=function(){return E.strokeColor=E.currentStrokeColor=null,E.strokeWidth=E.currentStrokeWidth=null,B.s(),B.ss(1),this},B.matrix=B.getMatrix(),this.translate=function(e,t){zot(e)&&(e=0),zot(t)&&(t=0),e=zik(e),t=zik(t);var o=B.matrix.transformPoint(e,t);return S=o.x,W=o.y,B.mt(S,W),B.matrix.translate(e,t),this},this.rotate=function(e){return zot(e)&&(e=0),e=zik(e),B.matrix.rotate(e),this},this.scale=function(e,t){return zot(e)&&(e=1),zot(t)&&(t=e),e=zik(e),t=zik(t),B.matrix.scale(e,t),this},this.skew=function(e,t){return zot(e)&&(e=0),zot(t)&&(t=0),e=zik(e),t=zik(t),B.matrix.skew(e,t),this},f&&(E.linePoints=[]),this.line=function(e,t,o,n){zot(e)&&(e=0),zot(t)&&(t=0),zot(o)&&(o=0),zot(n)&&(n=0),e=zik(e),t=zik(t),o=zik(o),n=zik(n),("zero"==f||"nonzero"==f&&e&&t)&&E.linePoints.push([e,t]),E.translate(e,t);var r=B.matrix.transformPoint(o,n);return S=r.x,W=r.y,B.lt(S,W),f&&E.linePoints.push([S,W]),B.matrix.translate(o,n),this},this.arc=function(e,t,o,n,r,i){zot(e)&&(e=0),zot(t)&&(t=0),zot(o)&&(o=50),e=zik(e),t=zik(t),o=zik(o),o=Math.abs(o),zot(n)&&(n=0),zot(r)&&(r=180),n=zik(n),r=zik(r),zot(i)&&(i=!1),i=zik(i),E.translate(e,t);var a=B.matrix.transformPoint(0,0);B.decomp||(B.decomp={}),B.matrix.decompose(B.decomp);var l=(Math.abs(B.decomp.scaleX)+Math.abs(B.decomp.scaleY))/2,s=B.decomp.rotation||0,c=o*l;return B.mt(a.x+c*Math.cos((n+s)*Math.PI/180),a.y+c*Math.sin((n+s)*Math.PI/180)),B.a(a.x,a.y,c,(n+s)*Math.PI/180,(r+s)*Math.PI/180,i),this},this.curve=function(e,t,o,n,r,i){zot(e)&&(e=0),zot(t)&&(t=0),zot(o)&&(o=50),zot(n)&&(n=50),zot(r)&&(r=100),zot(i)&&(i=0),e=zik(e),t=zik(t),o=zik(o),n=zik(n),r=zik(r),i=zik(i),E.translate(e,t);var a=B.matrix.transformPoint(o,n),l=B.matrix.transformPoint(r,i),s=l.x,c=l.y;return B.qt(a.x,a.y,s,c),B.matrix.translate(r,i),this},this.bezier=function(e,t,o,n,r,i,a,l){zot(e)&&(e=0),zot(t)&&(t=0),zot(o)&&(o=50),zot(n)&&(n=50),zot(r)&&(r=-50),zot(i)&&(i=-50),zot(a)&&(a=100),zot(l)&&(l=0),e=zik(e),t=zik(t),o=zik(o),n=zik(n),r=zik(r),i=zik(i),a=zik(a),l=zik(l),E.translate(e,t);var s=B.matrix.transformPoint(o,n),c=B.matrix.transformPoint(r,i),u=B.matrix.transformPoint(a,l),d=u.x,h=u.y;return B.bt(s.x,s.y,c.x,c.y,d,h),B.matrix.translate(a,l),this},this.rectangle=function(e,t,o,n,r,i,a,l){if(zot(e)&&(e=0),zot(t)&&(t=0),zot(o)&&(o=100),zot(n)&&(n=o),e=zik(e),t=zik(t),o=zik(o),n=zik(n),!(r||i||a||l)){E.translate(e,t);var s=B.matrix.transformPoint(0,0),c=B.matrix.transformPoint(o,0),u=B.matrix.transformPoint(o,n),d=B.matrix.transformPoint(0,n);return B.mt(s.x,s.y).lt(c.x,c.y).lt(u.x,u.y).lt(d.x,d.y).lt(s.x,s.y).lt(c.x,c.y),B.mt(s.x,s.y),this}zot(r)&&(r=0),zot(i)&&(i=r),zot(a)&&(a=r),zot(l)&&(l=r),r=zik(r),i=zik(i),a=zik(a),l=zik(l);var h=(o<n?o:n)/2,g=0,p=0,f=0,m=0;r<0&&(r*=g=-1),r>(h=Math.abs(h))&&(r=h),i<0&&(i*=p=-1),i>h&&(i=h),a<0&&(a*=f=-1),a>h&&(a=h),l<0&&(l*=m=-1),l>h&&(l=h),E.translate(e,t),B.decomp||(B.decomp={}),B.matrix.decompose(B.decomp);var z=(Math.abs(B.decomp.scaleX)+Math.abs(B.decomp.scaleY))/2,y=o<0?-1:1,v=n<0?-1:1,b=B.matrix.transformPoint(o-i*y,0),w=B.matrix.transformPoint(o+i*p*y,-i*p*v),C=B.matrix.transformPoint(o,i*v),x=B.matrix.transformPoint(o,n-a*v),k=B.matrix.transformPoint(o+a*f*y,n+a*f*v),T=B.matrix.transformPoint(o-a*y,n),A=B.matrix.transformPoint(l*y,n),P=B.matrix.transformPoint(-l*m*y,n+l*m*v),I=B.matrix.transformPoint(0,n-l*v),S=B.matrix.transformPoint(0,r*v),W=B.matrix.transformPoint(-r*g*y,-r*g*v),M=B.matrix.transformPoint(r*y,0);return B.mt(b.x,b.y).at(w.x,w.y,C.x,C.y,i*z).lt(x.x,x.y).at(k.x,k.y,T.x,T.y,a*z).lt(A.x,A.y).at(P.x,P.y,I.x,I.y,l*z).lt(S.x,S.y).at(W.x,W.y,M.x,M.y,r*z).cp(),this},this.circle=function(e,t,o,n,r){zot(e)&&(e=0),zot(t)&&(t=0),zot(o)&&(o=50),zot(n)&&(n=100),zot(r)&&(r=!0),e=zik(e),t=zik(t),o=zik(o),n=zik(n),o=Math.abs(o),E.translate(e,t);var i=B.matrix.transformPoint(0,0);B.decomp||(B.decomp={}),B.matrix.decompose(B.decomp);var a=(Math.abs(B.decomp.scaleX)+Math.abs(B.decomp.scaleY))/2,l=B.decomp.rotation||0,s=o*a;if(E.circleHeight=2*s,"number"==typeof n&&n>=0&&n<100){var c=360*n/100/2;B.mt(i.x+s*Math.cos((-c-90+l)*Math.PI/180),i.y+s*Math.sin((-c-90+l)*Math.PI/180)),B.a(i.x,i.y,s,(-c-90+l)*Math.PI/180,(c-90+l)*Math.PI/180,!1),r&&B.cp(),E.circleHeight=s-Math.cos(c*Math.PI/180)*s}else B.mt(i.x+s,i.y),B.a(i.x,i.y,s,0,2*Math.PI);return this},this.elipse=function(e,t,o,n){zot(e)&&(e=0),zot(t)&&(t=0),zot(o)&&(o=100),zot(n)&&(n=50),e=zik(e),t=zik(t),o=zik(o),n=zik(n),E.translate(e,t);var r=B.matrix.transformPoint(-o/2,-n/2);B.decomp||(B.decomp={}),B.matrix.decompose(B.decomp);var i=B.decomp.scaleX,a=B.decomp.scaleY;return B.de(r.x,r.y,o*i,n*a),this},this.poly=function(e,t,o,n,r,i){zot(e)&&(e=0),zot(t)&&(t=0),zot(o)&&(o=100),zot(n)&&(n=5),zot(r)&&(r=0),zot(i)&&(i=0),e=zik(e),t=zik(t),o=zik(o),n=zik(n),r=zik(r),i=zik(i),o=Math.abs(o),E.translate(e,t);var a=B.matrix.transformPoint(0,0);B.decomp||(B.decomp={}),B.matrix.decompose(B.decomp);var l=(Math.abs(B.decomp.scaleX)+Math.abs(B.decomp.scaleY))/2,s=B.decomp.rotation||0,c=o*l;return B.dp(a.x,a.y,c,n,r,s),this},this.closePath=this.close=this.cp=function(){return B.cp(),this},this._noise=new e.Noise(z),this.noise=function(){return 1==arguments.length?(this._noise.simplex1D.apply(null,arguments)+1)/2:2==arguments.length?(this._noise.simplex2D.apply(null,arguments)+1)/2:3==arguments.length?(this._noise.simplex3D.apply(null,arguments)+1)/2:4==arguments.length?(this._noise.simplex4D.apply(null,arguments)+1)/2:void 0},this.stack=[],this.colorStrokeStack=[],this.push=function(){return E.stack.push(B.matrix.clone()),E.colorStrokeStack.push([E.color,E.strokeColor,E.strokeWidth,E.currentColor,E.currentStrokeColor,E.currentStrokeWidth]),this},this.pop=function(){B.matrix=E.stack.pop()||B.matrix;var e=E.colorStrokeStack.pop()||[E.color,E.strokeColor,E.strokeWidth,E.currentColor,E.currentStrokeColor,E.currentStrokeWidth];return E.color=e[0],E.strokeColor=e[1],E.strokeWidth=e[2],E.currentColor=e[3],E.currentStrokeColor=e[4],E.currentStrokeWidth=e[5],B.f(E.currentColor).s(E.currentStrokeColor).ss(E.currentStrokeWidth),B.mt(B.matrix.x,B.matrix.y),this},this.blit=function(){return B.updateCache("source-over"),B.c(),this},this.step=function(){return E.draw&&L(),this},zot(E.color)||this.fill(E.color),!zot(E.strokeColor)&&E.strokeWidth?this.stroke(E.strokeColor,E.strokeWidth):E.noStroke(),this.translate(S,W),"function"==typeof a&&(this.setup=a,e.timeout(.01,(function(){a(0,E.count,E),p&&B.updateCache(),A.update()})));var M=0;function O(){I.save({content:A,filename:E.outputName+e.decimals(E.outputNum,null,null,6),type:v}),E.outputNum++}function j(t){E.stampNum++;var o=e.loop(E.maxCount,(function(e,t){if(E.paused)return E.pausedCount=e,!1;if(E.changeCount)return E.changeCount=!1,!1;M=e+1;var o=i(e+1,t,E,E.stampNum);return E.currentColor=zik(E.color),B.f(E.currentColor),E.currentStrokeColor=zik(E.strokeColor),B.s(E.currentStrokeColor),E.currentStrokeWidth=zik(E.strokeWidth),B.ss(E.currentStrokeWidth),y&&(A.update(),O()),o||void 0}),null,null,t);p&&B.updateCache(),o&&E.dispatchEvent("complete"),A.update()}function L(){E.iterator++,E.iterator%Math.ceil(E.drawCount)==0&&(E.count++,E.draw(E.count,E.maxCount,E),p&&E.blit(),E.currentColor=zik(E.color),B.f(E.currentColor),E.currentStrokeColor=zik(E.strokeColor),B.s(E.currentStrokeColor),E.currentStrokeWidth=zik(E.strokeWidth),B.ss(E.currentStrokeWidth),E.dispatchEvent("drawing"),A.update(),y&&O()),E.maxCount&&E.count>=E.maxCount&&(E.dispatchEvent("complete"),e.Ticker.remove(E.ticker))}this.maxCount=l,this.resetup=function(e){return zot(e)&&(e=!0),M=0,e&&E.shape.c(),zot(E.color)||this.fill(E.color),!zot(E.strokeColor)&&E.strokeWidth?this.stroke(E.strokeColor,E.strokeWidth):E.noStroke(),this.reset(),this.setup&&(a(0,E.count,E),p&&B.updateCache(),A.update()),this},this.stampNum=0,"function"==typeof i&&(this.stamp=i,e.timeout(.015,(function(){j(0)}))),this.restamp=function(e,t){return zot(e)&&(e=!0),zot(t)&&(t=!0),M=0,e&&E.shape.c(),t&&E.resetup(e),j(0),this},this.reset=function(){return this.fill(t),!zot(o)&&n?this.stroke(o,n):this.noStroke(),B.matrix.identity(),this.translate(h,g),this},this.clear=function(){return this.shape.c(),this},y&&(A.update(),O()),E.iterator=0,"function"==typeof r&&(this.draw=r,a?setTimeout((function(){E.ticker=e.Ticker.add(L)}),100):this.ticker=e.Ticker.add(L),E.generatorPaused=!1,u&&(E.pauseEvent=A.on("stagemousedown",(function(){E.count>=E.maxCount||E.pauseTimeout||(e.Ticker.has(E.ticker)?(e.Ticker.remove(E.ticker),E.generatorPaused=!0,E.dispatchEvent("generatorpaused")):(E.ticker=e.Ticker.add(E.ticker),E.generatorPaused=!1,E.dispatchEvent("generatorunpaused")))}))),d&&(E.pauseSpacebarEvent=m.on("keydown",(function(t){E.count>=E.maxCount||E.pauseTimeout||20==t.keyCode&&(e.Ticker.has(E.ticker)?(e.Ticker.remove(E.ticker),E.generatorPaused=!0,E.dispatchEvent("generatorpaused")):(E.ticker=e.Ticker.add(E.ticker),E.generatorPaused=!1,E.dispatchEvent("generatorunpaused")))})))),this.redraw=function(t,o){return zot(t)&&(t=!0),E.reset(),zot(o)&&(o=!0),E.ticker&&e.Ticker.remove(E.ticker),E.iterator=0,E.count=0,t&&E.shape.c(),o?(E.resetup(t),setTimeout((function(){E.ticker&&(E.ticker=e.Ticker.add(E.ticker))}),100)):E.ticker&&(E.ticker=e.Ticker.add(E.ticker)),this},this.paused=!1,this.pause=function(t,o){if(zot(t)&&(t=!0),!(E.count>=E.maxCount)){if(t==this.paused)return this;this.paused=t,this.pauseTimeout&&this.pauseTimeout.clear(),this.paused?E.ticker&&e.Ticker.remove(E.ticker):E.ticker?E.ticker=e.Ticker.add(E.ticker):j(E.pausedCount,E.maxCount),setTimeout((function(){A.update()}),20),o&&(this.pauseTimeout=e.timeout(o,(function(){E.pause(!E.paused),E.pauseTimeout=null}))),E.dispatchEvent(E.paused?"paused":"unpaused")}},this.outOfBounds=function(e,t){zot(e)&&(e=0),zot(t)&&(t=e);var o=E.shape.stage;if(o)return E.currentX>o.width-e||E.currentX<0+e||E.currentY>o.height-t||E.currentY<0+t},this.stop=function(){E.pause(),E.pauseEvent&&A.off("stagemousedown",E.pauseEvent),E.pauseSpaceEvent&&m.off("keydown",E.pauseSpaceEvent)},Object.defineProperty(this,"count",{get:function(){return M},set:function(e){M=e,E.stamp&&(E.changeCount=!0,setTimeout((function(){j(M,E.maxCount)})))}}),Object.defineProperty(this,"currentX",{get:function(){return S},set:function(){zon&&zogy("Generator() - currentX is read only")}}),Object.defineProperty(this,"currentY",{get:function(){return W},set:function(){zon&&zogy("Generator() - currentY is read only")}}),this.clone=function(){return E.cloneProps(new e.Generator(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,b,E.group,C))},E.dispose=function(t,o,n){return E.pause(),E.ticker&&e.Ticker.remove(E.ticker),E.pauseEvent&&A.off("stagemousedown",E.pauseEvent),E.pauseSpacebarEvent&&m.off("keydown",E.pauseSpacebarEvent),E._noise&&(E._noise=null),E.shape&&E.shape.dispose(),E.drawing&&E.drawing.dispose(),E.shape=E.drawing=null,n||E.zimContainer_dispose(),!0},!1!==b&&e.styleTransforms(this,T)},e.extend(e.Generator,e.Container,["clone","dispose"],"zimContainer",!1),e.Pen=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A){var P,B="size, color, penType, damp, spread, borderColor, borderWidth, end, paper, nib, cache, ctrlKey, cropScale, undo, undoKeys, move, onTop, deleteable, doubleClickDelete, immediateStop, lineAlpha, lineBlendMode, frame, style, group, inherit";if(P=zob(e.Pen,arguments,B,this))return P;z_d("69.93"),this.zimContainer_constructor(),this.type="Pen",this.group=T;var E=!1===k?{}:e.getStyle(this.type,this.group,A);zot(n)&&(n=null!=E.penType?E.penType:"line");var I={size:2,color:"#333",spread:{min:5,max:20},borderColor:"#111",borderWidth:0},S={line:{size:2},kitetail:{size:{min:5,max:20},color:e.series(e.pink,e.blue,e.green),borderColor:"rgba(0,0,0,.5)",borderWidth:1},grass:{color:"#acd241",size:3,spread:{min:10,max:30}},hair:{color:["#e472c4","#50c4b7"],size:3,spread:{min:20,max:50}},city:{size:{min:30,max:70},spread:{min:50,max:200},color:["#333","#111","#555"]},barbwire:{},splatter:{size:{min:5,max:20},color:"rgba(0,0,0,.5)"}};zot(S[n])&&(n="line"),zot(t)&&(t=null!=E.size?E.size:zot(S[n].size)?I.size:S[n].size),zot(o)&&(o=null!=E.color?E.color:zot(S[n].color)?I.color:S[n].color),zot(r)&&(r=null!=E.damp?E.damp:.1),!1===r&&(r=1),zot(i)&&(i=null!=E.spread?E.spread:zot(S[n].spread)?I.spread:S[n].spread),zot(a)&&(a=null!=E.borderColor?E.borderColor:zot(S[n].borderColor)?I.borderColor:S[n].borderColor),zot(l)&&(l=null!=E.borderWidth?E.borderWidth:zot(S[n].borderWidth)?I.borderWidth:S[n].borderWidth),zot(s)&&(s=null!=E.end?E.end:"butt"),zot(g)&&(g=null!=E.cropScale?E.cropScale:1),zot(d)&&(d=null==E.cache||E.cache),zot(p)&&(p=null!=E.undo?E.undo:0),zot(f)&&(f=null==E.undoKeys||E.undoKeys),zot(m)&&(m=null==E.move||E.move),zot(y)&&(y=null==E.deleteable||E.deleteable),zot(v)&&(v=null==E.doubleClickDelete||E.doubleClickDelete),zot(z)&&(z=null==E.onTop||E.onTop),zot(b)&&(b=null!=E.immediateStop?E.immediateStop:"both"),zot(w)&&(w=null!=E.lineAlpha?E.lineAlpha:1),zot(C)&&(C=null!=E.lineBlendMode?E.lineBlendMode:"normal"),zot(c)&&(c=null!=E.paper?E.paper:new e.Container),zot(u)&&(u=null!=E.nib?E.nib.clone():null),zot(x)&&(x=null!=E.frame?E.frame:WW.zdf);var W=this;this.dampX=new e.Damp(null,r),this.dampY=new e.Damp(null,r);var M=!0;this.drawing=!1,this.immediateStop=b,this.undoLevels=p,this.undoKeys=f,this.move=m,this.draggable=!0,this.lineAlpha=w,this.lineBlendMode=C;var O,j,L,D,_,Y=W.shape=new e.Shape,X=x.stage.width,R=x.stage.height;W.paperNum=0,W.sizeScale=1,W.spreadScale=1,W.sizeFactor=1,W.spreadFactor=1,W.stop=function(){},this.added((function(r){function h(t){W.drawing&&(W.nib.x=t.stageX/e.scaX,W.nib.y=t.stageY/e.scaY)}_=r,W.paper=c,X=W.stage.width,R=W.stage.height,zot(u)||(W.zimDown?W.nib=u.addTo(W):(W.nib=u.addTo(W.parent,W.parent.getChildIndex(W)),W.nib.x=W.x,W.nib.y=W.y,W.nib.mouseEnabled=!1,W.stageDown=_.on("stagemousedown",(function(e){_=e.target.stage,W.nibEvent=_.on("stagemousemove",h)})),W.stageUp=_.on("stagemouseup",(function(){_.off("stagemousemove",W.nibEvent)})))),W.zimDragCheck=!1,W.stop=function(){W.stopCheck(!0)},W.infinite=!1,W.stopCheck=function(t){if(t)W.drawing=!1,W.infinite=!1;else{if(W.infinite)return;if(W.zimDragCheck)return;if(!W.immediateStop&&W.drawing)return}W.immediate(W.x,W.y),setTimeout((function(){var t;if(!W.drawing){if(d?(Y.cache(-(X*g-X)/2,-(R*g-R)/2,X*g,R*g),t=c.bitmap=new e.Bitmap(Y.cacheCanvas).reg((X*g-X)/2,(R*g-R)/2).addTo(c),Y.graphics.clear(),Y.uncache(),Y.top()):t=Y,W.undoLevels>0){var o={paper:c,line:t};p.push(o),p.length>W.undoLevels&&p.shift(),W.dispatchEvent("recordUndo")}d||(Y=(new e.Shape).clone().addTo(c)),W.lastSegment=t,W.lastSelected=t,t.alpha=W.lineAlpha,t.blendMode=W.lineBlendMode,t.paper=c,W.dispatchEvent("stop"),W.dispatchEvent("change")}}),W.immediateStop||t?0:50)};var f=0;W.dampX.immediate(W.x),W.dampY.immediate(W.y),W.lastX=W.lastMidX=W.drawX=W.x,W.lastY=W.lastMidY=W.drawY=W.y,W.ticker=e.Ticker.add((function(){if(W.parent){var r=W.dampX.convert(M?W.x:W.finishX),u=W.dampY.convert(M?W.y:W.finishY),d=W.parent.localToLocal(r,u,Y),h=e.Pick.choose(t)*W.sizeScale*W.sizeFactor,g=e.Pick.choose(i)*W.spreadScale*W.spreadFactor;if(Math.abs(W.lastX-r)+Math.abs(W.lastY-u)<1){if(W.drawing&&(W.drawing=!1,W.zimDown?(W.x=W.lastX=W.lastMidX=M?W.x:W.finishX,W.y=W.lastY=W.lastMidY=M?W.y:W.finishY,W.dampX.immediate(W.x),W.dampY.immediate(W.y)):(W.x=W.finishX=W.lastX=W.lastMidX=r,W.y=W.finishY=W.lastY=W.lastMidY=u),W.stopCheck()),W.lastX=W.lastMidX=r,W.lastY=W.lastMidY=u,c){var p=c.localToLocal(0,0,W.parent);W.lastMidX-=p.x,W.lastMidY-=p.y}}else{W.drawing||(H=[],c.getChildIndex(Y)!=c.numChildren-1&&Y.top()),W.drawing=!0,W.dispatchEvent("drawing");var m,z,y,v,b=W.parent.localToLocal(W.lastX,W.lastY,Y);if(m=c?c.localToLocal(W.lastMidX,W.lastMidY,Y):W.parent.localToLocal(W.lastMidX,W.lastMidY,Y),"splatter"==n)for(var w=0;w<=3;w++){var C=e.rand(360)*Math.PI/180,x=g,k={x:r+x*Math.cos(C),y:u+x*Math.sin(C)},T=W.parent.localToLocal(k.x,k.y,Y);Y.graphics.mt(T.x,T.y).f(e.Pick.choose(o)).dc(T.x,T.y,h/2)}else"grass"==n||"hair"==n||"city"==n?("grass"!=n&&"hair"!=n||(z=W.lastX+(r-W.lastX)/2,y=W.lastY+(u-W.lastY)/2,v=W.parent.localToLocal(z,y,Y),Y.graphics.s(e.Pick.choose(o)).ss(h,s).mt(v.x,v.y).lt(v.x+e.rand(-g/4,g/4),"hair"==n?v.y+g:v.y-g)),("grass"==n||"hair"==n||"city"==n&&f%3==0)&&Y.graphics.s(e.Pick.choose(o)).ss(h,s).mt(d.x,d.y).lt(d.x+("city"==n?0:e.rand(-g/4,g/4)),"hair"==n?v.y+g:d.y-g),f++):("kitetail"==n&&Y.graphics.s(e.Pick.choose(o)).ss(h,s),"barbwire"==n?(Y.graphics.s(e.Pick.choose(o)).ss(h,s),z=W.lastX+(r-W.lastX)/2+e.rand(-g,g),y=W.lastY+(u-W.lastY)/2+e.rand(-g,g)):(z=W.lastX+(r-W.lastX)/2,y=W.lastY+(u-W.lastY)/2),v=W.parent.localToLocal(z,y,Y),"line"!=n&&Y.graphics.qt(b.x,b.y,v.x,v.y));l>0&&"line"!=n&&(z=W.lastX+(r-W.lastX)/2,y=W.lastY+(u-W.lastY)/2,v=W.parent.localToLocal(z,y,Y),Y.graphics.s(e.Pick.choose(a)).ss(e.Pick.choose(l)).mt(m.x,m.y).qt(b.x,b.y,v.x,v.y),"splatter"==n&&Y.graphics.es()),"splatter"==n?Y.graphics.f(e.Pick.choose(o)):"kitetail"!=n&&Y.graphics.s(e.Pick.choose(o)).ss(h,s),"grass"!=n&&"hair"!=n&&"city"!=n&&"splatter"!=n&&Y.graphics.mt(m.x,m.y).qt(b.x,b.y,v.x,v.y),W.lastX=r,W.lastY=u,v&&(W.lastMidX=v.x,W.lastMidY=v.y),W.drawX=W.lastMidX||0,W.drawY=W.lastMidY||0}}}))})),W.mouseChildren=!1,p=[];var H=[];this.saveState=function(e,t,o){var n="Container"==e.type?"paper":"line",r={paper:W.paper};r[n]=e,r[n+"Transform"]={x:e.x,y:e.y,r:e.rotation,a:e.alpha,rX:e.regX,rY:e.regY,sX:e.scaleX,sY:e.scaleY,skX:e.skewX,skY:e.skewY,v:e.visible},zot(t)||zot(o)||t==o||(r.startLayer=t,r.endLayer=o),p.push(r),W.dispatchEvent("recordUndo"),p.length>W.undoLevels&&p.shift()};var F,N,V={x:0,y:0,r:0,a:1,rX:0,rY:0,sX:1,sY:1,skX:0,skY:0,v:!0};function G(t,o){for(var n,r=p.length-1;r>=0;r--)if(p[r][t]==o&&p[r][t+"Transform"]){n=p[r][t+"Transform"];break}n||(n=e.copy(V)),o.x=n.x,o.y=n.y,o.alpha=n.a,o.rotation=n.r,o.regX=n.rX,o.regY=n.rY,o.scaleX=n.sX,o.scaleY=n.sY,o.skewX=n.skX,o.skewY=n.skY,o.visible=n.v,"line"==t&&d&&(o.regX=(X*g-X)/2,o.regY=(R*g-R)/2)}this.undo=function(){var t=p.pop();if(t){if(H.push(t),t.clear){for(var o=0;o<t.clear.length;o++)t.paper.addChild(t.clear[o]);t.paper.addChild(Y)}else t.line&&t.lineTransform?(zot(t.startLayer)||(Y.top(),t.paper.setChildIndex(t.line,L)),G("line",t.line)):t.line?t.line.removeFrom():t.paperTransform&&G("paper",t.paper);W.lastPaper=W.paper,t.paper!=W.paper&&(W.paper=t.paper,W.dispatchEvent("paperChange")),W.dispatchEvent("change"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!W.stage||W.stage.update()}},this.redo=function(){var t,o,n=H.pop();n&&(p.push(n),n.clear?(n.paper.removeAllChildren(),n.paper.addChild(Y)):n.line&&n.lineTransform?(zot(n.endLayer)||(Y.top(),n.paper.setChildIndex(n.line,D)),o=n.lineTransform,t=n.line):n.line?n.line.addTo(n.paper):n.paperTransform&&(o=n.paperTransform,t=n.paper),t&&(t.x=o.x,t.y=o.y,t.alpha=o.a,t.rotation=o.r,t.regX=o.rX,t.regY=o.rY,t.scaleX=o.sX,t.scaleY=o.sY,t.skewX=o.skX,t.skewY=o.skY,t.visible=o.v),W.lastPaper=W.paper,n.paper!=W.paper&&(W.paper=n.paper,W.dispatchEvent("paperChange")),W.dispatchEvent("change"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!W.stage||W.stage.update())},W.ctrlKey=!1,W.shiftKey=!1,W.ctrlKeyCheck=!1,W.zimkeydownEvent=function(e){W.ctrlKey=e.ctrlKey,W.shiftKey=e.shiftKey,17==e.keyCode&&m&&!W.ctrlKeyCheck&&(W.ctrlKeyCheck=!0,c.noDrag(),c.drag({onTop:z,all:!0})),W.undoLevels<=0||W.undoKeys&&(e.ctrlKey&&(e.shiftKey&&90==e.keyCode||89==e.keyCode)?W.redo():e.ctrlKey&&90==e.keyCode&&W.undo(),x&&x.ctrlKey&&W.write&&(W.lastWrite=W.write,W.write=!1))},WW.addEventListener("keydown",W.zimkeydownEvent),W.zimkeyupEvent=function(e){17==e.keyCode&&m&&W.ctrlKeyCheck&&(W.ctrlKeyCheck=!1,c.noDrag(),c.drag({onTop:z})),e.ctrlKey||(W.ctrlKey=!1),e.shiftKey||(W.shiftKey=!1),x&&!x.ctrlKey&&0==W.write&&(W.write=W.lastWrite)},WW.addEventListener("keyup",W.zimkeyupEvent),Object.defineProperty(this,"paper",{get:function(){return c},set:function(r){"Container"==r.type&&(c=r,Y.addTo(c,0,!1),c.shape=Y,W.dampX.immediate(W.x),W.dampY.immediate(W.y),W.lastX=W.lastMidX=W.finishX=W.x,W.lastY=W.lastMidY=W.finishY=W.y,"barbwire"==n&&Y.graphics.s(e.Pick.choose(o)).ss(e.Pick.choose(t)*W.sizeScale*W.sizeFactor,s),Y.graphics.mt(W.x,W.y),c.parent||c.addTo(W.parent,W.parent.getChildIndex(W)),zot(c.paperNum)&&(c.paperNum=++W.paperNum,y&&c.on("mousedown",(function(e){W.lastSelected=e.target,W.nibEvent&&W.stage.off("stagemousemove",W.nibEvent);var t=e.target.paper;t&&(t!=W.paper&&(W.paper=t,W.dispatchEvent("paperChange")),W.shiftKey&&(W.ctrlKey?W.clear():(e.target.visible=!1,W.undoLevels>0&&W.saveState(e.target),W.dispatchEvent("change"))))})),v&&c.on("dblclick",(function(e){e.target.visible=!1,W.undoLevels>0&&W.saveState(e.target)})),m&&(c.on("mousedown",(function(t){_=t.target.stage,W.draggingCheck=!0,W.shiftKey&&y||(O=t.stageX/e.scaX,j=t.stageY/e.scaY,Y.top(),L=c.getChildIndex(t.target))})),c.drag({onTop:z}),c.on("pressup",(function(t){y&&W.shiftKey||0!=t.target.visible&&(W.undoLevels<=0||(Math.abs(t.stageX/e.scaX-O)<1&&Math.abs(t.stageY/e.scaY-j)<1?z&&(Y.top(),D=c.getChildIndex(t.target),L!=D&&W.saveState(t.target,L,D)):(W.ctrlKey?(W.saveState(c),W.dispatchEvent("paperChange")):(Y.top(),D=c.getChildIndex(t.target),W.saveState(t.target,L,D)),W.dispatchEvent("change"),Y.top())))})))))}}),Object.defineProperty(this,"write",{get:function(){return M},set:function(e){M&&!1===e&&(W.finishX=W.x,W.finishY=W.y),!M&&e&&(Y.graphics.es(),Y.graphics.ef(),W.dampX.immediate(W.x),W.dampY.immediate(W.y),W.lastX=W.lastMidX=W.x,W.lastY=W.lastMidY=W.y),M=e}}),Object.defineProperty(this,"size",{get:function(){return t},set:function(o){Y.graphics.es(),Y.graphics.ef(),t=o,"splatter"!=n&&Y.graphics.ss(e.Pick.choose(t)*W.sizeScale*W.sizeFactor,s)}}),Object.defineProperty(this,"color",{get:function(){return o},set:function(t){o=t,Y.graphics.es(),Y.graphics.ef(),"splatter"!=n&&Y.graphics.s(e.Pick.choose(o))}}),Object.defineProperty(this,"penType",{get:function(){return n},set:function(r){n=r,Y.graphics.ef().es(),"splatter"!=n?Y.graphics.s(e.Pick.choose(o)):Y.graphics.s(e.Pick.choose(o)).ss(e.Pick.choose(t)*W.sizeScale*W.sizeFactor,s)}}),Object.defineProperty(this,"damp",{get:function(){return r},set:function(e){r=e,W.dampX.damp=r,W.dampY.damp=r}}),Object.defineProperty(this,"spread",{get:function(){return i},set:function(e){i=e}}),this.setColorRange=function(e,t){return zot(t)?(F=W.color,N=e):zot(e)?(F=W.color,N=t):(F=e,N=t),W};var q=0;Object.defineProperty(W,"colorRange",{get:function(){return q},set:function(t){q=t,zot(F)||zot(N)||(W.color=e.colorRange(F,N,t))}}),Object.defineProperty(this,"borderColor",{get:function(){return a},set:function(e){a=e}}),Object.defineProperty(this,"borderWidth",{get:function(){return l},set:function(e){l=e}}),W.setPen=function(t){W.dampX.immediate(W.x),W.dampY.immediate(W.y),W.lastX=W.lastMidX=W.finishX=W.x,W.lastY=W.lastMidY=W.finishY=W.y,zot(t)&&(t=n),zot(S[t])&&(t="line"),W.penType=n=t;var o=e.merge(I,S[t]);for(var r in o)W[r]!=o[r]&&(W[r]=o[r]);return W},W.immediate=function(e,t){return zot(e)||(W.x=e,W.dampX.immediate(W.x),W.lastX=W.lastMidX=W.finishX=W.x),zot(t)||(W.y=t,W.dampY.immediate(W.y),W.lastY=W.lastMidY=W.finishY=W.y),W},W.clear=function(){for(var e=[],t=0;t<c.numChildren-1;t++)e.push(c.getChildAt(t));return p.push({paper:c,clear:e}),p.length>W.undoLevels&&p.shift(),W.dispatchEvent("recordUndo"),c.removeAllChildren(),Y.graphics.clear(),c.addChild(Y),W.dispatchEvent("change"),W.stage&&W.stage.update(),W},this.deleteSegment=function(e){e.visible=!1,W.undoLevels>0&&W.saveState(e)},this.clone=function(){return this.cloneChildren(this.cloneProps(new e.Pen(t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A)))},W.dispose=function(t,o,n){return zot(t)&&(t=!0),WW.removeEventListener("keydown",W.zimkeydownEvent),WW.removeEventListener("keyup",W.zimkeyupEvent),_&&W.nibEvent&&_.off("stagemousemove",W.nibEvent),_&&W.stageDown&&_.off("stagemousedown",W.stageDown),_&&W.stageUp&&_.off("stagemouseup",W.stageUp),_&&W.upEvent&&_.off("stagemouseup",W.upEvent),e.Ticker.remove(W.ticker),W.removeAllEventListeners(),u&&u.removeFrom(),t&&(W.shape&&W.shape.dispose(),W.paper&&W.paper.dispose(),d&&(W.bitmap&&W.bitmap.dispose(),W.bitmap=null),W.zimContainer_dispose(n),c=Y=W.shape=null),!0},!1!==k&&e.styleTransforms(this,E)},e.extend(e.Pen,e.Container,["dispose","clone"],"zimContainer",!1),e.SoundWave=function(t,o,n,r,i,a,l,s,c,u,d,h){var g,p="num, input, include, smoothing, min, max, operation, baseline, magnify, reduce, adjust, channel";if(g=zob(e.SoundWave,arguments,p,this))return g;z_d("69.95"),this.type="SoundWave",zot(t)&&(t=120),zot(o)&&(o="mic"),zot(n)&&(n=120/1024),zot(r)&&(r=.85),zot(i)&&(i="mic"==o?-80:(o.oscillator,-100)),zot(a)&&(a="mic"==o?-40:(o.oscillator,-10)),zot(l)&&(l=function(t,o){return t*(.5+1*o/Math.pow(e.SoundWave.bufferLength,.95))}),zot(s)&&(s="mic"==o?0:(o.oscillator,30)),zot(c)&&(c="mic"==o?1:o.oscillator?5:10),zot(u)&&(u=0),zot(d)&&(d=5),e.SoundWave.bufferLength=1024;var f,m=t,z=this;z.baseline=s,z.magnify=c,z.reduce=u,z.input=o,z.adjust=d,f="Tone"==o.type||"SynthSound"==o.type?o.audioContext:new(WW.AudioContext||WW.webkitAudioContext);var y,v,b=z.analyser=f.createAnalyser();function w(t){if(v&&v.disconnect(b),v=t,zot(h)||0!==h&&1!==h)t.connect(b),"mic"!=o&&b.connect(f.destination);else{var r=new ChannelSplitterNode(f,{numberOfOutputs:2});t.connect(r),r.connect(b,h);var i=new ChannelMergerNode(f,{numberOfInputs:2});b.connect(i,0,h),"mic"!=o&&i.connect(f.destination)}if(b.fftSize=2*e.SoundWave.bufferLength,(y=Math.floor(n*e.SoundWave.bufferLength/m))<1)zogy("ZIM SoundWave: include param is too small or num param is too big");else{var a=b.frequencyBinCount,s=new Uint8Array(a),c=300,u=0,d=0,g=Math.round(60*z.adjust*.8),p=new e.Damp(c,.01);z.calculate=function(t){b.getByteFrequencyData(s);var r=s.map(l);if(1==y&&!t)return r;var i,a=[],h=0;for(i=0;i<=n*e.SoundWave.bufferLength;i++)h+=r[i],0!=i&&i%y==0&&(a.push(Math.max(0,(h/y-z.baseline)*z.magnify-z.reduce)),h=0);var f=a.length;if("mic"!=o&&(a[0]*=.75,a[1]*=.85,a[2]*=.9,a[f-2]*=.8,a[f-1]*=.75),a[f-1]*=1.3,a[f-2]*=1.2,a[f-3]*=1.1,t){var m=[];++g>=60*z.adjust&&(c=u/g,u=0,d=0,g=0);var v=p.convert(c);for(i=0;i<f;i++)a[i]>d&&(d=a[i]),m[i]=Math.min(1,0!=v?a[i]/v:0);return u+=d,m}return a},setTimeout((function(){z.dispatchEvent("ready")}),50)}}b.minDecibels=i,b.maxDecibels=a,b.smoothingTimeConstant=r,Object.defineProperty(this,"smoothing",{get:function(){return b.smoothingTimeConstant},set:function(e){b.smoothingTimeConstant=e}}),Object.defineProperty(this,"num",{get:function(){return m},set:function(t){m=t,(y=Math.floor(n*e.SoundWave.bufferLength/m))<1&&zogy("ZIM SoundWave: num is too big")}}),this.setInput=function(e){if(z.input=e,"mic"==e)return navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,void(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){w(z.source=f.createMediaStreamSource(e))})).catch((function(e){zogy("ZIM SoundWave: Error occured: "+e)})):navigator.getUserMedia?navigator.getUserMedia({audio:!0},(function(e){w(z.source=f.createMediaStreamSource(e))}),(function(e){zogy("ZIM SoundWave: Error occured: "+e)})):zogy("ZIM SoundWave: Sorry, mic not supported"));if("Tone"==e.type)w(e.compressor);else if("SynthSound"==e.type)w(e.gain);else{if(e.type&&"sound"==e.type)return void zogy("ZIM SoundWave: pass in the result of a zim.asset('somesound').play() for the input");var t,o;e.playbackResource?(t=e.playbackResource,o=f.createMediaElementSource(t)):(t=e,o=f.createMediaElementSource(t)),w(o)}},this.setInput(o),this.dispose=function(e){return e&&f&&f.close(),b&&b.disconnect(),!0}},e.extend(e.SoundWave,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.Synth=function(o,n){z_d("69.955"),this.type="Synth",zot(o)&&(o=.3),zot(n)&&(n=220),this.volume=o,this.frequency=n;var r,i=this;this.play=function(t,o,n,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q,U,Q,Z){var K=Array.prototype.slice.call(arguments);if(r||!WW.AudioContext&&!WW.webkitAudioContext||((r=new(WW.AudioContext||WW.webkitAudioContext)).z=r.createBufferSource,r.createBufferSource=function(e){return null==e&&(e=r.z()),e.start=e.start||function(e){r.noteOn(e)},e}),r){for(t=null!=t?zik(t):.3,o=null!=o?zik(o):.05,n=null!=n?zik(n):220,a=null!=a?zik(a):0,l=null!=l?zik(l):0,s=null!=s?zik(s):.1,c=null!=c?zik(c):0,u=null!=u?zik(u):1,d=null!=d?zik(d):0,h=null!=h?zik(h):0,g=null!=g?zik(g):0,p=null!=p?zik(p):0,f=null!=f?zik(f):0,m=null!=m?zik(m):0,z=null!=z?zik(z):0,y=null!=y?zik(y):0,v=null!=v?zik(v):0,C=null!=C?zik(C):0,b=null!=b?zik(b):1,w=null!=w?zik(w):0,E=null!=E?zik(E):44100,null==I&&(I=99+a*E),null==S&&(S=l*E),null==W&&(W=s*E),null==M&&(M=w*E),null==O&&(O=v*E),null==j&&(j=2*Math.PI),null==L&&(L=function(e){return e>0?1:-1}),null==D&&(D=I+M+S+W+O),null==_&&(_=d*=500*j/Math.pow(E,2)),null==Y&&(Y=n*=(1+2*o*Math.random()-o)*j/E),null==X&&(X=L(z)*j/4),null==R&&(R=0),null==H&&(H=0),null==F&&(F=0),null==N&&(N=0),null==V&&(V=0),null==G&&(G=0),null==q&&(q=1),null==U&&(U=[]),null==Q&&(Q=r.createBufferSource()),null==Z&&(Z=r.createBuffer(1,D,E)),Q.connect(r.destination);F<Math.floor(D);U[F++]=G)++V>100*y&&(V=0,G=R*n*Math.sin(H*z*j/E-X),G=c?c>1?c>2?c>3?Math.sin(Math.pow(G%j,3)):Math.max(Math.min(Math.tan(G),1),-1):1-(2*G/j%2+2)%2:1-4*Math.abs(Math.round(G/j)-G/j):Math.sin(G),G=(f?1-C+C*Math.sin(j*F/f):1)*L(G)*Math.pow(Math.abs(G),u)*t*i.volume*(F<I?F/I:F<I+M?1-(F-I)/M*(1-b):F<I+M+S?b:F<D-O?(D-F-O)/W*b:0),G=O?G/2+(O>F?0:(F<D-O?1:(F-D)/O)*U[F-O|0]/2):G),R+=1-m+1e9*(Math.sin(F)+1)%2*m,H+=1-m+1e9*(Math.pow(Math.sin(F),2)+1)%2*m,n+=d+=500*h*j/Math.pow(E,3),q&&++q>p*E&&(n+=g*j/E,Y+=g*j/E,q=0),f&&++N>f*E&&(n=Y,d=_,N=1,q=q||1);Z.getChannelData(0).set(U),Q.buffer=Z;var J,$=new createjs.EventDispatcher;return $.type="SynthSound",$.audioContext=r,$.gain=r.createGain(),Q.connect($.gain),$.gain.connect(r.destination),Q.start(),$.duration=U.length/E,$.playing=!0,$.stop=function(){clearTimeout($.completeID),clearInterval($.repeatID),$.gain.gain.setTargetAtTime(0,r.currentTime,.1),$.playing=!1,setTimeout((function(){r.close()}),100)},$.repeat=$.loop=function(t,o){return J=0,!0===t&&(t=null),zot(o)&&(o=0),clearTimeout($.completeID),$.repeatID=e.interval((function(){return $.duration+zik(o)}),(function(){J++,t&&J>=t?($.dispatchEvent("complete"),$.repeatID.clear(),$.playing=!1):($.dispatchEvent("loop"),i.play.apply(i,K))})),$},$.play=function(){return i.play.apply(i,K),$.playing=!0,$},$.completeID=setTimeout((function(){$.dispatchEvent("complete")}),1e3*(U.length/E+.1)),$}},this.Tone=function(o,r,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C){var x,k="volume, note, shape, duration, attack, release, wahAmount, wahRate, wahShape, wahThroat, wahNote, vibratoAmount, vibratoRate, vibratoShape, tremeloAmount, tremeloRate, tremeloShape, startTime, pauseOnBlur";if(x=zob(i.Tone,arguments,k,this))return x;this.type="Tone";var T,A=this;zot(o)&&(o=i.volume),zot(r)&&(r=i.frequency),zot(a)&&(a=e.SINE),zot(s)&&(s=.02),zot(c)&&(c=.05),zot(w)&&(w=0),WW.AudioContext||WW.webkitAudioContext?T=this.audioContext=new(WW.AudioContext||WW.webkitAudioContext):zon&&zogy("Synth tone() needs AudioContext"),o=zik(o),r=zik(r),a=zik(a),l=zik(l),s=zik(s),c=zik(c),u=zik(u),d=zik(d),h=zik(h),g=zik(g),p=zik(p),f=zik(f),m=zik(m),z=zik(z),y=zik(y),v=zik(v),b=zik(b),w=zik(w);var P=t(l);i.duration=l,l&&(l*="s"==P?1:.001),w&&(t(w),w*="s"==P?1:.001),i.attack=s,i.release=c,i.rampDuration=.02,i.hush=.1;var B=this.note=this.oscillator=T.createOscillator();B.frequency.value=e.Synth.note(r),e.Synth.setShape(B,a);var E=this.filter=T.createBiquadFilter();E.type="bandpass",E.frequency.value=B.frequency.value,E.Q.value=0;var I=this.gain=B.gain=T.createGain();I.type="gain",I.gain.setValueAtTime(0,T.currentTime);var S=this.compressor=T.createDynamicsCompressor();function W(e,t){zot(e)&&(e=T.currentTime),zot(t)&&(t=i.attack),B.start(e);var n=WW.zdf&&(new Date).getTime()-WW.zdf.startTime<200?.1:i.attack;I.gain.setValueAtTime(0,T.currentTime+.1),I.gain.linearRampToValueAtTime(o*i.hush,T.currentTime+.1+n)}S.threshold.setValueAtTime(-50,T.currentTime),S.knee.setValueAtTime(40,T.currentTime),S.ratio.setValueAtTime(12,T.currentTime),S.attack.setValueAtTime(0,T.currentTime),S.release.setValueAtTime(.25,T.currentTime),B.connect(E),E.connect(I),I.connect(S),S.connect(T.destination),W(w),this.stop=function(e){zot(e)&&(e=i.release),I&&X(I.gain,0,!0,e),_&&X(_.gain,0,!0,e),L&&X(L.gain,0,!0,e),setTimeout((function(){A.dispatchEvent("complete")}),1e3*(.6+e+i.rampDuration)),setTimeout((function(){T&&!T.iamClosed&&(T.iamClosed=!0,T.close())}),1e3*(e+1)),setTimeout((function(){M&&A.removeWah()}),1e3*(e+1))},l&&this.stop(w+l-.1);var M,O,j,L,D,_,Y=this.notes=[B];function X(e,t,o,n){zot(t)&&(t=0),zot(n)&&(n=i.rampDuration),o?(e.cancelScheduledValues(T.currentTime),e.linearRampToValueAtTime(e.value,T.currentTime+.02),e.linearRampToValueAtTime(t,T.currentTime+.05+n)):(e.cancelScheduledValues(T.currentTime),e.setTargetAtTime(t,T.currentTime,n))}function R(){zot(u)&&(u=1e3),zot(d)&&(d=1),zot(h)&&(h="sine"),zot(g)&&(g=5),p=zot(p)?A.oscillator.frequency.value:e.Synth.note(p),zot(O)&&(O=200),A.filter.Q.value=g,(M=A.wah=i.oscillator(d,u/2,h,p+u/2+O)).ticker=e.Ticker.add((function(){A.filter.frequency.value=A.wah.amplitude}))}function H(){zot(m)&&(m=5),zot(z)&&(z="sine"),zot(f)&&(f=10),j=A.vibrato=T.createOscillator(),(L=A.vibratoGain=T.createGain()).gain.value=0,j.frequency.value=m,e.Synth.setShape(j,z),j.connect(L),L.connect(B.frequency),j.start(0),L.gain.setValueAtTime(0,T.currentTime+.1),L.gain.linearRampToValueAtTime(f,T.currentTime+.1+i.attack)}function F(){zot(v)&&(v=5),zot(b)&&(b="sine"),D=A.tremelo=T.createOscillator(),(_=A.tremeloGain=T.createGain()).gain.value=0,D.frequency.value=v,e.Synth.setShape(D,b),D.connect(_),_.connect(I.gain),D.start(0);var t=WW.zdf&&(new Date).getTime()-WW.zdf.startTime<200?.1:i.attack;_.gain.setValueAtTime(0,T.currentTime+.1),_.gain.linearRampToValueAtTime(o*i.hush,T.currentTime+.1+t)}this.addNote=function(t,o,n,r,i,a){zot(r)&&(r=!0),zot(i)&&(i=!1),zot(t)&&(t=.1),zot(a)&&(a=0);var l={type:"Note"};l._volume=t,l._note=e.Synth.note(o),Y.push(l);var s=l.oscillator=T.createOscillator();s.frequency.value=l._note,s.type=e.Synth.setShape(s,n);var c=l.gain=T.createGain();return X(c.gain,l._volume,!0),c.connect(r?E:I),s.connect(c),L&&i&&L.connect(s.frequency),s.start(T.currentTime+a),Object.defineProperty(l,"volume",{get:function(){return l._volume},set:function(e){zot(e)||(l._volume=zik(e),X(l.gain.gain,l._volume,!0))}}),Object.defineProperty(l,"note",{get:function(){return l._note},set:function(t){zot(t)||(l._note=zik(t),X(l.oscillator.frequency,e.Synth.note(l._note)))}}),l},this.removeNote=function(e){var t=Y.indexOf(e);return t>=0&&Y.splice(t,1),e.oscillator.disconnect(),e=null,this},this.ramp=function(e,t){X(I.gain,e*i.hush,!0,t)},this.animate=function(){return arguments[0].props?arguments[0].target=this:Array.prototype.unshift.call(arguments,this),e.animate.apply(null,arguments),this},this.wiggle=function(){return arguments[0].props?arguments[0].target=this:Array.prototype.unshift.call(arguments,this),e.wiggle.apply(null,arguments),this},e.addWires(this),!u&&!d&&zot(h)&&zot(g)||R(),A.removeWah=function(){e.Ticker.remove(M.ticker),M.dispose(),M=A.wah=null,A.filter.Q.value=0},(f||m||!zot(z))&&H(),A.removeVibrato=function(){X(L.gain,0,!0),setTimeout((function(){L.disconnect(),j.disconnect(),j.stop(),j=null}),1e3*(i.rampDuration+1))},(y||v||!zot(b))&&F(),A.removeTremelo=function(){X(_.gain,0,!0),setTimeout((function(){_.disconnect(),D.disconnect(),D.stop(),D=null}),1e3*(i.rampDuration+1))},Object.defineProperty(this,"volume",{get:function(){return o},set:function(t){var n;zot(t)||(D?(n=I.gain.value?_.gain.value/I.gain.value:o?y/o:0,o=zik(t),o=e.constrain(o,.001),X(_.gain,o*n*i.hush,!0)):o=zik(t),X(I.gain,o*i.hush,!1,i.rampDuration))}}),this.paused=!1;var N=o;this.pause=function(e){zot(e)&&(e=!0),e?(N=A.volume,A.volume=0):A.volume=N},C&&(zot(e.blurCheck)&&e.setBlurDetect(),e.pauseOnBlur.push(this)),Object.defineProperty(this,"frequency",{get:function(){return n},set:function(e){zot(e)||(n=zik(e),X(B.frequency,e))}}),Object.defineProperty(this,"note",{get:function(){return r},set:function(t){zot(t)||(r=zik(t),B.frequency.value=e.Synth.note(r))}}),Object.defineProperty(this,"shape",{get:function(){return a},set:function(t){a=zik(t),e.Synth.setShape(B,a)}}),Object.defineProperty(this,"currentTime",{get:function(){return T.currentTime},set:function(){zon&&zogy("Synth tone() - currentTime is read only")}}),this.wahAmountMin=0,this.wahAmountMax=5e3,Object.defineProperty(this,"wahAmount",{get:function(){return u},set:function(t){zot(t)||(u=zik(t),u=e.constrain(u,i.wahAmountMin,i.wahAmountMax),zot(M)?R():M.gain=u/2)}}),this.wahRateMin=0,this.wahRateMax=30,Object.defineProperty(this,"wahRate",{get:function(){return d},set:function(t){zot(t)||(d=zik(t),d=e.constrain(d,i.wahRateMin,i.wahRateMax),zot(M)?R():M.frequency=d)}}),this.wahThroatMin=0,this.wahThroatMax=100,Object.defineProperty(this,"wahThroat",{get:function(){return g},set:function(t){g=zik(t),g=e.constrain(g,i.wahThroatMin,i.wahThroatMax),zot(M)?R():E.Q.value=g}}),Object.defineProperty(this,"wahNote",{get:function(){return p},set:function(e){zot(e)||(p=zik(e),zot(M)?R():M.offset=p+u/2+O)}}),Object.defineProperty(this,"wahAdjust",{get:function(){return O},set:function(e){zot(e)||(O=zik(e),zot(M)?R():M.offset=p+u/2+O)}}),Object.defineProperty(this,"wahShape",{get:function(){return h},set:function(e){h=zik(e),zot(M)?R():M.shape=h}}),Object.defineProperty(this,"tremeloAmount",{get:function(){return y},set:function(e){zot(e)||(y=zik(e),zot(D)?F():_.gain.setValueAtTime(y,T.currentTime))}}),Object.defineProperty(this,"tremeloRate",{get:function(){return v},set:function(e){zot(e)||(v=zik(e),zot(M)?F():D.frequency.value=v)}}),Object.defineProperty(this,"tremeloShape",{get:function(){return b},set:function(t){b=zik(t),zot(D)?F():e.Synth.setShape(D,b)}}),Object.defineProperty(this,"vibratoAmount",{get:function(){return f},set:function(e){zot(e)||(f=zik(e),zot(j)?H():L.gain.setValueAtTime(f,T.currentTime))}}),Object.defineProperty(this,"vibratoRate",{get:function(){return m},set:function(e){zot(e)||(m=zik(e),zot(j)?H():j.frequency.value=m)}}),Object.defineProperty(this,"vibratoShape",{get:function(){return z},set:function(t){z=zik(t),zot(j)?H():e.Synth.setShape(j,z)}})},e.extend(this.Tone,createjs.EventDispatcher),this.tone=function(e,t,o,n,r,a,l,s,c,u,d,h,g,p,f,m,z,y){return Array.prototype.unshift.call(arguments,null),new(Function.prototype.bind.apply(i.Tone,arguments))},this.Oscillator=function(t,o,n,r){var a,l="frequency, gain, shape, offset";if(a=zob(i.Oscillator,arguments,l,this))return a;this.type="Oscillator",zot(t)&&(t=1),zot(o)&&(o=10),zot(n)&&(n="sine"),zot(r)&&(r=0),this.frequency=zik(t),this.gain=zik(o),this.shape=zik(n),"saw"==this.shape&&(this.shape="sawtooth"),this.offset=zik(r),this.paused=!1;var s=this,c=0,u=e.Ticker.framerate;this.ticker=e.Ticker.add((function(){if(!s.paused){var e=0;"sine"==s.shape?e=Math.sin(s.frequency*(2*Math.PI*(c/u))):"square"==s.shape?e=(e=Math.sin(s.frequency*(2*Math.PI*(c/u))))<=0?0:1:"triangle"==s.shape?e=2/Math.PI*Math.asin(Math.sin(s.frequency*Math.PI*2*c/u)):"sawtooth"==s.shape||"saw"==s.shape?e=-2/Math.PI*Math.atan(1/Math.tan(s.frequency*Math.PI*c/u)):"zap"==s.shape&&(e=2/Math.PI*Math.atan(1/Math.tan(s.frequency*Math.PI*c/u))),s.amplitude=e*s.gain+s.offset,c++}})),this.pause=function(e){s.paused=e},this.dispose=function(){e.Ticker.remove(this.ticker)}},this.oscillator=function(e,t,o,n){return Array.prototype.unshift.call(arguments,null),new(Function.prototype.bind.apply(i.Oscillator,arguments))}},e.Synth.notes=["C",null,"D",null,"E","F",null,"G",null,"A",null,"B"],e.Synth.major=["C","D","E","F","G","A","B","C4"],e.Synth.minor=["C","D","Eb","F","G","Ab","B","C4"],e.Synth.shapes=["sine","triangle","sawtooth","tan","noise","square"],e.Synth.setShape=function(t,o){if(!zot(t)){var n;if(zot(o)&&(o="sine"),"saw"==o&&(o="sawtooth"),"number"==typeof o)(o=e.Synth.shapes[o])||(o="sine");else if(o.real&&o.imag)n=t.context.createPeriodicWave(new Float32Array(o.real),new Float32Array(o.imag));else if(o.constructor==PeriodicWave)n=o;else if("string"==typeof o){if(e.Synth.shapes.indexOf(o)<0&&(o="sine"),"noise"==o){for(var r=4096,i=new Float32Array(r),a=new Float32Array(r),l=1;l<r;l+=2)a[l]=e.shuffle([0,.5,1])[0];n=t.context.createPeriodicWave(i,a)}else"tan"==o&&(o="sawtooth")}else o="sine";n?(t.setPeriodicWave(n),o="custom"):t.type=o}},e.Synth.getNote=function(e,t){return zot(t)&&(t=0),e*Math.pow(2,t/12)},e.Synth.note=function(t){if("string"==typeof t){var o=t.substr(0,1).toUpperCase(),n=e.loop(t,(function(e){if(!isNaN(e))return Number(e)}));n=!0===n||isNaN(n)?3:n;var r=e.Synth.notes.indexOf(o);r<0&&(r=9);var i=t.match(/b/g),a=t.match(/#/g);i=i?i.length:0;var l=12*(n-3)+r+(a=a?a.length:0)-i;return e.Synth.getNote(e.Synth.getNote(220,-9),l)}return"number"!=typeof t&&(t=220),t},e.Synth.wave=function(e,t){if(WW.AudioContext||WW.webkitAudioContext){var o=new(WW.AudioContext||WW.webkitAudioContext);if(e.real)t=e.imag,e=e.real;else if(zot(t)&&zon)return void zogy("Synth.wave() - pass in asset('wave.json') or real and imag properties");return e.constructor!==Float32Array&&(e=new Float32Array(e)),t.constructor!==Float32Array&&(t=new Float32Array(t)),o.createPeriodicWave(e,t)}},e.Synth.drawWave=function(t,o,n,r,i,a,l,s,c){var u,d="shape, color, thickness, backgroundColor, borderColor, borderWidth, corner, padding, paddingVertical";if(u=zob(e.Synth.drawWave,arguments,d))return u;var h=45,g=45;t=zik(t),zot(n)&&(n=2),zot(o)&&(o=e.darker),zot(s)&&(s=8),zot(c)&&(c=s);var p=s,f=c,m=new e.Container(h,g);m.mouseChildren=!1,zot(r)||(m.backing=new e.Rectangle(h,g,r,i,a,l).addTo(m)),m.shape=new e.Shape(h,g).addTo(m).s(o).ss(n);var z=h-2*p;return"square"==t?m.shape.mt(p,g/2).lt(p,f+3).lt(h/2,f+3).lt(h/2,g-f-3).lt(h-p,g-f-3).lt(h-p,g/2):"triangle"==t?m.shape.mt(p,g/2).lt(p+z/4,f+3).lt(p+3*z/4,g-f-3).lt(h-p,g/2):"sawtooth"==t||"saw"==t?m.shape.mt(p,g/2).lt(h/2,f+2).lt(h/2,g-f-2).lt(h-p,g/2):"zap"==t?m.shape.mt(p,g/2).lt(h/2,g-f-2).lt(h/2,f+2).lt(h-p,g/2):m.shape.mt(p,g/2).bt(h/2,-15,h/2,g+15,h-p,g/2),m.type=t,m},e.VR=function(t,o,n,r,i,a,l,s,c,u,d,h){var g,p="content, angle, distance, parallax, parallaxAngle, damp, parallaxDamp, startAngle, negativeParallax, boundaryMarkers, swiper, holder";if(g=zob(e.VR,arguments,p,this))return g;if(z_d("69.98"),this.type="VR",WW.zdf){var f=WW.zdf;!zot(h)&&h.getBounds&&h.getBounds().width||(h=f.stage),zot(o)&&(o=0),zot(n)&&(n=100),zot(a)&&(a=.5),zot(r)&&(r=0),zot(i)&&(i=60),zot(l)&&(l=.1),zot(s)&&(s=0),zot(c)&&(c=!1),zot(u)&&(u=!0),zot(d)&&(d=!0),this.angle=o,this.currentAngle=s,e.mobile()&&(d=!1);var m=this,z=h.width,y=h.height;m.zimContainer_constructor();var v=m.left=new e.Container(z/2,y,null,null,!1),b=new e.Rectangle(z/2,y,"rgba(0,0,0,.01)",null,null,null,null,null,null,!1);v.addChild(b);var w=m.right=v.clone();m.addChild(v,w),w.x=z/2;var C=m.contentLeft=m.content=t,x=m.contentRight=t.clone();if(0!=s)var k=setTimeout(V,100);else V();var T=[],A=[];if(G(C,x),q(T,"left"),q(A,"right"),0!=o&&0!=n){var P=new e.Damp(180+s,a);P.immediate(180+s);var B=!1,E=!1;f.on("deviceorientation",(function(e){U(P.convert((e.rotation.z>180?-180:180)+e.rotation.z+s)-180)})),e.Ticker.always()}if(0!=r&&0!=n){var I=new e.ProportionDamp(180-i/2,180+i/2,-i/2,i/2,l);I.immediate(180),f.on("deviceorientation",(function(e){var t=0;0==o&&0!=r&&0!=n&&(t=I.convert((e.rotation.z>180?-180:180)+e.rotation.z)),K(t)})),e.Ticker.always()}!d||0==n||0==o&&0==r||m.added((function(){var t={swipeAngle:0};m.swiper=new e.Swiper({swipeOn:m,target:t,property:"swipeAngle",sensitivity:.2,damp:.05,factor:-1,min:-330,max:330}),e.Ticker.add((function(){0!=o&&0!=n&&U(t.swipeAngle),0!=r&&0!=n&&K(I.convert(t.swipeAngle+180))}))}));var S=localStorage&&localStorage.zimEyeAdjust?Number(localStorage.zimEyeAdjust):0,W=S,M=!1;C.startRegX=C.regX,x.startRegX=x.regX;var O=this.adjuster=new e.Container(800,300,null,null,!1);b=O.backing=new e.Rectangle(O.width,O.height,e.lighter,null,null,null,null,null,null,!1).center(O).alp(1).sha("rgba(0,0,0,.2)",0,0,30),O.strip=new e.Rectangle(O.width,O.height/3,e.white,null,null,null,null,null,null,!1).center(O).alp(1),O.label=new e.Label({text:"slide to adjust center of left and right",size:28,color:e.dark,align:"center",valign:"center"}).center(O).pos({y:50,reg:!0});var j=O.close=new e.Rectangle(50,50,e.light,null,null,null,null,null,null,!1).addTo(O).mov(O.width-70,26),L=new e.Shape(-40,-40,80,80,null,!1);L.graphics.f(e.dark).p("AmJEVIEUkTIkXkWIB4h5IEWEYIETkTIB4B3IkTESIEQERIh4B4IkRkRIkSEVg"),L.center(j).sca(.3),j.cursor="pointer",j.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){m.hideAdjuster(),Y.currentValue=(Y.max-Y.min)/2+W,m.dispatchEvent("closed")}));var D=new e.Circle(30,e.dark,null,null,null,null,null,null,!1).center(O).pos({x:O.width/4,reg:!0});D.shape.alpha=.2,new e.Circle(12,e.dark,null,null,null,null,null,!1).center(D);var _=new e.Circle(30,e.dark,null,null,null,null,null,!1).center(O).pos({x:O.width/4*3,reg:!0});_.shape.alpha=.2,new e.Circle(12,e.dark,null,null,null,null,null,null,!1).center(_);var Y=O.slider=new e.Slider({min:0,max:30,step:1,useTicks:!0,style:!1}).centerReg(O).pos({y:O.height-40,reg:!0});Y.currentValue=(Y.max-Y.min)/2+S;var X=new e.Proportion(Y.min,Y.max,D.x-O.width/4,D.x+O.width/4,-1),R=new e.Proportion(Y.min,Y.max,_.x-O.width/4,_.x+O.width/4);Y.on("change",(function(){D.x=X.convert(Y.currentValue),_.x=R.convert(Y.currentValue)})),new e.Label("closer",24,null,e.silver).centerReg(O).pos({x:Y.x-220,y:Y.y,reg:!0}),new e.Label("farther",24,null,e.silver).centerReg(O).pos({x:Y.x+220,y:Y.y,reg:!0});var H=m.ok=new e.Button({label:"OK",width:90,height:60,corner:0,backgroundColor:e.blue,rollBackgroundColor:e.green,shadowColor:-1,style:!1}).centerReg(O).sca(.8).pos({x:O.width-58,y:Y.y,reg:!0});H.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){localStorage&&(localStorage.zimEyeAdjust=Y.currentValue-(Y.max-Y.min)/2),J(),m.hideAdjuster(),m.dispatchEvent("saved"),m.dispatchEvent("closed")}));var F=m.zero=new e.Button({label:">|<",width:90,height:60,corner:0,backgroundColor:e.yellow,rollBackgroundColor:e.green,shadowColor:-1,style:!1}).centerReg(O).sca(.8).pos({x:58,y:Y.y,reg:!0});F.on((zns?"mousedown"==e.ACTIONEVENT:"mousedown"==WW.ACTIONEVENT)?"mousedown":"click",(function(){Y.currentValue=(Y.max-Y.min)/2,D.x=X.convert(Y.currentValue),_.x=R.convert(Y.currentValue)}));var N=new e.Proportion(0,30,-h.width/4,h.width/4);J(),this.showAdjuster=function(){if(M)return m;M=!0,D.x=X.convert(Y.currentValue),_.x=R.convert(Y.currentValue),W=Y.currentValue-(Y.max-Y.min)/2,O.scaleTo(h,100,100).center(this),h.stage.update()},this.hideAdjuster=function(){if(!M)return m;M=!1,O.removeFrom(this),h.stage.update()},this.position=function(e,t,o){function n(e){e.vrStartX=t,e.vrParallaxDamp&&e.vrParallaxDamp.immediate(t),e.mov(t,o)}return n(e),n(e.vrMatch),e},this.register=function(e){if(!e.parent||!e.parent.vrMatch)return zon&&zogy("ZIM VR() - please only register objects already inside content container"),e;var t=e.clone().addTo(e.parent.vrMatch),o=[],n=[];return G(e,t,o,n),q(o,"left"),q(n,"right"),e},0!=o&&0!=n&&u&&(m.boundaryRight=new e.Container({style:!1}),new e.Circle(24,e.light,null,null,null,null,null,null,!1).addTo(m.boundaryRight).dep(-2),new e.Triangle(16,16,16,e.yellow,e.grey,null,null,null,-3,null,null,!1).rot(-90).center(m.boundaryRight).dep(-6),m.boundaryRight.center(t).mov(n/2+24),m.boundaryLeft=new e.Container({style:!1}),new e.Circle(24,e.light,null,null,null,null,null,null,!1).addTo(m.boundaryLeft).dep(-2),new e.Triangle(16,16,16,e.yellow,e.grey,null,null,null,-3,null,null,!1).rot(90).center(m.boundaryLeft).dep(-6),m.boundaryLeft.center(t).mov(-n/2-24),m.register(m.boundaryRight),m.register(m.boundaryLeft)),this.remove=function(){return e.loop(arguments,(function(e,o){t.contains(o)&&($(o),o.parent.removeChild(o),o.vrMatch.parent.removeChild(o.vrMatch))})),m},this.resize=function(){z=h.width,y=h.height,v.getChildAt(0).widthOnly=w.getChildAt(0).widthOnly=z/2,v.getChildAt(0).heightOnly=w.getChildAt(0).heightOnly=y,w.x=z/2,v.setBounds(0,0,z/2,y),w.setBounds(0,0,z/2,y),0!=s?(clearTimeout(k),k=setTimeout(V,100)):V(),O.scaleTo(h,100,100).center(this,null,!1)}}else zon&&zogy("VR() - please use ZIM Frame");function V(){C.addTo(v,null,!1).setMask(v.getChildAt(0)).pos({y:(h.height-C.height)/2,reg:!0}),x.addTo(w,null,!1).setMask(w.getChildAt(0)).pos({y:(h.height-C.height)/2,reg:!0})}function G(t,o,n,r){t.vrMatch=o,o.vrMatch=t,t.cacheCanvas&&o.cache(),t.dep&&!zot(t.depth)&&(T.push(t),A.push(o),zot(n)||n.push(t),zot(r)||r.push(o),o.dep(t.depth)),e.loop(t,(function(e,t){G(e,o.getChildAt(t),n,r)}))}function q(t,i){e.loop(t,(function(t){t.vrChannel=i,t.vrStartX=t.x,0!=o&&0!=n&&(t.vrAngle=o,t.vrDistance=n),0!=r&&0!=n&&(t.vrParallax=r/100,t.vrParallaxDistance=0,0!=o&&(t.vrParallaxDamp=new e.Damp(0,l))),t.dep(t.depth)}))}function U(e){m.currentAngle=e;var t,r=-m.currentAngle*n/o;m.contentLeft.x=r,m.contentRight.x=r,Math.round(m.currentAngle)<=-o/2&&!B?((t=new createjs.Event("boundaryout")).boundary="left",B=!0,m.dispatchEvent(t)):Math.round(m.currentAngle)>=o/2&&!E?((t=new createjs.Event("boundaryout")).boundary="right",E=!0,m.dispatchEvent(t)):Math.round(m.currentAngle)>-o/2&&Math.round(m.currentAngle)<o/2&&(t=new createjs.Event("boundaryin"),B?(t.boundary="left",m.dispatchEvent(t),B=!1):E&&(t.boundary="right",m.dispatchEvent(t),E=!1))}function Q(e){var t=e.parent.localToLocal(e.vrStartX,0,h),r=e.vrParallaxDamp.convert("left"==e.vrChannel?m.contentLeft.x+t.x-z/4:m.contentRight.x+t.x-z/2-z/4);e.depth<=0&&!c&&(r=0),e.vrParallaxDistance=Math.max(-n/o*i/2,Math.min(n/o*i/2,r)),e.dep(e.depth)}function Z(e,t){e.vrParallaxDistance=e.depth<=0&&!c?0:t,e.dep(e.depth)}function K(t){0!=o&&0!=n?(e.loop(T,Q),e.loop(A,Q)):(e.loop(T,(function(e){Z(e,t)})),e.loop(A,(function(e){Z(e,t)})))}function J(){var e=N.convert(Y.currentValue);C.regX=C.startRegX+e,x.regX=x.startRegX-e}function $(t){var o=T.indexOf(t);T.indexOf(t)>=0&&(T.splice(o,1),A.splice(o,1)),e.loop(t,(function(e){$(e)}))}},e.extend(e.VR,e.Container,"clone","zimContainer",!1),e.scaX=1,e.scaY=1,e.Frame=function(o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O){var j,L="scaling, width, height, color, outerColor, ready, assets, path, progress, ticker, rollover, touch, scrollTop, align, valign, canvasID, rollPerSecond, delay, canvasCheck, gpu, gpuObj, nextFrame, nextStage, allowDefault, loadFailObj, sensors, retina, mouseMoveOutside, captureMouse, shim, maxConnections, maxNum, singleTouch";if(j=zob(e.Frame,arguments,L,this))return j;z_d("83"),zon&&zogg("ZIM FRAME"),this.cjsEventDispatcher_constructor(),this.type="Frame",this.startTime=(new Date).getTime();var D=this;WW.zdf&&WW.zdf.type||(WW.zimDefaultFrame=WW.zdf=WW.F=this),WW.M=e.mobile(),zot(b)&&(b=!0);var _=!!WW.HTMLCanvasElement;if(_||!b){var Y=e.mobile();zot(o)&&(o="full"),"outside"==o&&(o="fill"),zot(c)||(WW.PATH=c),zot(h)&&(h=!Y),zot(g)&&(g=!0),zot(p)&&(p=!1),zot(f)&&(f="center"),zot(m)&&(m="center");var X="";zot(z)&&(WW.zdf!=this?(X=e.makeID(5),z="myCanvas"+X):z="myCanvas");var R=t(v);zot(y)&&(y=20),zot(v)&&(v=Y?"s"==R?1:1e3:"s"==R?.03:30),zot(w)&&(w=!1),zot(T)&&(T=!1),zot(A)&&(A="circles"),this.loadFailObj=A,zot(P)&&(P=!1),zot(B)&&(B=!0),this.retina=B,zot(E)&&(E=!1),zot(I)&&(I=!0),zot(S)&&(S=!1),zot(W)&&(W=10),zot(O)&&(O=!1),O&&(g=!0);var H=W;D.maxNum=M,w&&(B=!1),this.retina=B;var F=!1;this.leftMouseDown=!1;var N,V,G,q,U,Q=["fit","fill","full"];if(S){this.shim=!0,S.stage.frame=this;var Z,K,J=this.canvas=S.canvas;this.scale=S.stage.scaleX,setTimeout((function(){ze(),K=function(){ze(),Z&&clearTimeout(Z),Z=setTimeout(ze,50)},WW.addEventListener("resize",K)}),20),N=S.stage,V=N.getBounds()?N.getBounds().width:J.width/N.scaleX,G=N.getBounds()?N.getBounds().height:J.height/N.scaleY,N.getBounds()||N.setBounds(0,0,V,G),i=J.style.backgroundColor,Ce(),ze()}else this.scale=1,this.x=0,this.y=0;var $,ee,te,oe=!1,ne=!1,re=!1,ie=!1;S||("interactive"===document.readyState||"complete"===document.readyState?setTimeout((function(){ve()}),200):document.addEventListener("DOMContentLoaded",ve));var ae,le=!1,se="full"==o&&"undefined"!=typeof InstallTrigger;if(this.swapRotation=!1,Y&&!WW.parent){var ce=isNaN(WW.innerWidth)?WW.clientWidth:WW.innerWidth,ue=isNaN(WW.innerHeight)?WW.clientHeight:WW.innerHeight;this.swapRotation=(0==WW.orientation||180==WW.orientation)&&ce>ue||90==Math.abs(WW.orientation)&&ue>ce}WW.addEventListener("resize",ye),D.loadAssetsCount=0,zot(e.assets)&&(e.assets={},e.assetIDs={});var de,he=!1;this.update=function(){ke(),D.dispatchEvent("update")},this.loadAssets=function(o,n,r,i,a,l,s,c,u,d,h,g){if(zot(o))return z();if(zot(o.src)){var p,f="assets, path, progress, xhr, time, loadTimeout, outputAudioSprite, crossOrigin, fileType, queueOnly, maxConnections, maxNum";if(p=zob(D.loadAssets,arguments,f))return p}zot(n)||(WW.PATH=n);var m=t(a||null);if(!zot(r)&&"ProgressBar"==r.type&&zot(i)&&(i=!0),Array.isArray(o)||(o=[o]),0==o.length)return z();function z(){var t=new e.Queue;return t.isLoading=!1,t.loadAssetsCount=0,setTimeout((function(){t.dispatchEvent("complete"),D.dispatchEvent("complete")}),10),t}zot(a)&&(a=0),zot(l)&&(l="s"==m?8:8e3),zot(s)&&(s=!1),zot(c)&&(c="anonymous"),zot(d)&&(d=!1),zot(h)&&(h=H),zot(g)&&(g=D.maxNum);var y,v,b,w,C,x=!1,k=[],T=/\.([^.]+)$/i,A=[],P=[],B=[],E=0,I=!0;for(b=0;b<o.length;b++){if((y=o[b]).assets){var S=[];for(o.splice(b,1),Array.isArray(y.assets)||(y.assets=[y.assets]),w=0;w<y.assets.length;w++)e.assetIDs[y.assets[w]]?S.push({id:y.path+y.assets[w],src:y.path+y.assets[w],path:null,loadTimeout:y.loadTimeout,maxNum:y.maxNum,noCORSonImage:y.noCORSonImage}):S.push({id:y.assets[w],src:y.assets[w],path:y.path,loadTimeout:y.loadTimeout,maxNum:y.maxNum,noCORSonImage:y.noCORSonImage});for(var W=S.length-1;W>=0;W--)o.splice(b,0,S[W]);y=S[0]}var M;if(y.constructor=={}.constructor)if(y.audioSprite){Q(y=(C=e.copy(y)).src);var O,j=[];for(w=0;w<C.audioSprite.length;w++)O=C.audioSprite[w],j.push({id:O[0],startTime:Math.round(1e3*O[1]),duration:Math.round(1e3*(O[2]-O[1]))});delete C.audioSprite,C.data={audioSprite:j},k.push(C)}else if(y.data&&y.data.audioSprite)Q(y=(C=e.copy(y)).src),k.push(C);else if(y.id){if(y.path){var L,_;if(y.path.match(/http/i))y.src=y.path+y.src;else if(y.path.match(/^\//))_=(L=WW.location.href).match(/(.*?)([^/])\/[^/]/),L=_[1]+_[2],y.src=L+y.path+y.src;else{var Y=WW.location.pathname,X=(L=WW.location.href).split(Y)[0]+Y;_=X.match(/(.*)\//),y.src=_[1]+"/"+y.path+y.src}delete y.path}if(y.noCORSonImage){var R,F=new Image;B.push(F),F.src=y.src,F.id=y.id,F.onload=function(t){var o=t.currentTarget,n=e.assets[o.id]=new e.Bitmap(o).expand(0);R=new createjs.Event("assetload"),n&&"string"!=typeof n&&"number"!=typeof n&&(n.file=o.id,n.src=o.src),R.asset=n,K.dispatchEvent(R),d||((R=new createjs.Event("assetload")).asset=n,D.dispatchEvent(R)),K.loadAssetsCount--,0==K.loadAssetsCount&&ae()}}else{e.assetIDs[y.id]=y.src;var V=y.maxNum;zot(V)&&(V=g);var G=y.type,q=zot(y.loadTimeout)?l:y.loadTimeout;Q(y=y.src),M={src:y,loadTimeout:q*("s"==m?1e3:1),data:V,type:G},zot(u)||(M.type=u),k.push(M)}}else y.src.match(/fonts\.googleapis\.com/)?P.push(y):A.push(y);else Q(y),M={src:y,loadTimeout:l*("s"==m?1e3:1),data:g},zot(u)||(M.type=u),k.push(M);if(x&&I){var U=document.createElement("audio");U.setAttribute("src",(zot(n)||y.match(/^http:\/\/|https:\/\//i)?"":n)+y),document.body.appendChild(U),I=!1}}function Q(e){if(E++,e.split){var t=e.split("?");(v=t[0].match(T))&&createjs.Sound.SUPPORTED_EXTENSIONS.indexOf(v[1])>=0&&(x=!0)}}D.loadAssetsCount++,D.isLoading=!0;var Z,K=new e.Queue;if(K.isLoading=!0,K.loadAssetsCount=0,!zot(r)&&r.show&&(r.zimActiveLoader=K,r.show()),A.length>0){var J,$,ee=[];for(b=0;b<A.length;b++)J={src:"url("+(($=A[b]).src.match(/^http/i)?"":n||"")+$.src+")"+($.type?" format('"+$.type+"')":""),family:$.font},$.weight&&(J.weight=$.weight),$.style&&(J.style=$.style),ee.push(J);(Z=new createjs.FontLoader({src:ee},!0)).on("complete",te),Z.on("error",te),Z.load(),K.loadAssetsCount++}if(P.length>0)for(b=0;b<P.length;b++)J={src:($=P[b]).src,type:"fontcss"},K.loadAssetsCount++,(Z=new createjs.FontLoader(J,!0)).on("complete",te),Z.on("error",te),Z.load();function te(){K.loadAssetsCount--,0==K.loadAssetsCount&&ae()}if(B.length>0)for(b=0;b<B.length;b++)K.loadAssetsCount++;function oe(t,o){K.loadAssetsCount--;var n=o.item,r=e.assets[n.id]=t;r.src=n.src,r.file=n.id,r.item=n,r.svg=o.svg;var i=new createjs.Event("assetload");i.item=n,i.asset=r,r.type="SVG",K.dispatchEvent(i),d||((i=new createjs.Event("assetload")).item=n,i.asset=r,D.dispatchEvent(i)),0==K.loadAssetsCount&&ae()}var ne=Date.now(),re=new createjs.Event("complete");if(E>0){K.loadAssetsCount++;var ie=K.preload=D.preload=new createjs.LoadQueue(i,n,c);1!=h&&ie.setMaxConnections(h),x&&ie.installPlugin(createjs.Sound),ie.on("progress",(function(e){K.dispatchEvent(e),d||D.dispatchEvent(e)})),ie.on("error",(function(e){K.dispatchEvent(e),d||D.dispatchEvent(e)})),ie.on("fileload",(function(o){if(o.result&&("IMG"!=o.result.nodeName&&"SVG"!=o.result.nodeName||o.rawResult)){var r,i=o.item,a=o.item.type,l=i.id.match(T);if(a&&"sound"==a){var s=[];if(i.data&&i.data.audioSprite)for(var c=0;c<i.data.audioSprite.length;c++)s.push(i.data.audioSprite[c].id);else s.push(i.id);for(c=0;c<s.length;c++)!function(){var i=s[c],a=o.item.src,l=o.item;r=e.assets[i]={type:"sound",path:n,id:i,file:i,src:a,item:l,dispose:function(){delete e.assets[i],r=null},play:function(o,n,r,a,l,s,c){var u,d="volume, loop, loopCount, pan, offset, delay, interrupt";if(u=zob(e.assets[i].play,arguments,d))return u;var h={volume:o,loop:n,loopCount:r,pan:a,offset:l,delay:s,interrupt:c},g=t(h.offset,null,30);"s"==g&&(h.offset&&(h.offset*=1e3),h.delay&&(h.delay*=1e3)),!0===h.loop&&(h.loop=-1),h.loopCount&&(h.loop=h.loopCount,delete h.loopCount);var p=createjs.Sound.play(i,h);return p.getStage=function(){return N},p.dispose=function(){p.destroy()},p}}}()}else if("image"==a)o.result.width&&(r=e.assets[i.id]=new e.Bitmap(o.result,o.result.width,o.result.height),i.avoidCORS&&r.expand(0));else{if("svg"==a)return K.loadAssetsCount++,void e.svgToBitmap(o.result,oe,null,null,{svg:o.result,item:i,type:a,ext:l});r=e.assets[i.id]=o.result}r&&"string"!=typeof r&&"number"!=typeof r&&(r.file=o.item.id,r.src=o.item.src,r.item=o.item),(u=new createjs.Event("assetload")).item=i,u.asset=r,K.dispatchEvent(u),d||((u=new createjs.Event("assetload")).item=i,u.asset=r,D.dispatchEvent(u))}else{var u=new createjs.Event("error");(u=new createjs.Event("error")).item=o.item,K.dispatchEvent(u),(u=new createjs.Event("error")).item=o.item,D.dispatchEvent(u)}})),D.preloadEvent=ie.on("complete",(function(e){re=e,K.loadAssetsCount--,0==K.loadAssetsCount&&ae()}));try{ie.loadManifest(k)}catch(e){}}function ae(){var e=Date.now();a=Math.max(0,a-(e-ne)),setTimeout((function(){D.loadAssetsCount--,D.loadAssetsCount<=0&&(D.isLoading=!1),K.isLoading=!1,K.dispatchEvent(re),d||D.dispatchEvent(re)}),a*("s"==m?1e3:1))}return K},this.ac=function(e,t,o){o?(o.commands||(o.commands=[]),o.commands.push([e,t,o])):(t[0].commands||(t[0].commands=[]),t[0].commands.push([e,t]))},e.asset=this.asset=function(t,o,n,r,i){if(!zot(t)){t=zik(t);var a,l=e.assetIDs[t];if(l&&(t=l),e.assets[t]&&(!e.assets[t].type||e.assets[t].type&&"AC"!=e.assets[t].type.substr(0,2)))return e.assets[t];if(null!=WW.PATH&&(e.PATH=WW.PATH),i)return(a="circles"==D.loadFailObj?D.makeCircles(14):D.loadFailObj)&&(a.type="EmptyAsset",a.id=t,a.play=function(){if(zon)return zogy("Frame - asset("+t+") not found"),{}}),a;var s=new e.Container(o,n);e.assets[t]=s,s.type=o&&n?"ACWD":"AC";var c=D.loadAssets({assets:t,path:1==t.split("/").length?e.PATH:null,queueOnly:!0,maxNum:r}),u=t.split(".");return createjs.Sound.SUPPORTED_EXTENSIONS.indexOf(u[u.length-1])>=0&&(s.play=function(){return s.playParams=arguments,s.proxy=new createjs.EventDispatcher,Object.defineProperty(s.proxy,"volume",{get:function(){return s.sound?s.sound.volume:null},set:function(e){s.volume=e,s.sound&&(s.sound.volume=e)}}),Object.defineProperty(s.proxy,"pan",{get:function(){return s.sound?s.sound.pan:null},set:function(e){s.pan=e,s.sound&&(s.sound.pan=e)}}),s.proxy}),c.on("complete",(function(){t.id?t=t.id:t.src&&(t=t.src);var o,n=D.asset(t,null,null,null,!0),r=t.split(".");if(createjs.Sound.SUPPORTED_EXTENSIONS.indexOf(r[r.length-1])>=0)s.play=n.play,s.type="Sound",s.src=n.src,s.item=n.item,s.playParams&&(s.sound=s.play.apply(null,s.playParams),null!=s.volume&&(s.sound.volume=s.volume),null!=s.pan&&(s.sound.pan=s.pan),s.sound.on("complete",(function(){s.proxy.dispatchEvent("complete")})));else if("Bitmap"==n.type||"Image"==n.type||"Pic"==n.type){if("Bitmap"==n.type?(n.addTo(s),s.bitmap=n,s.image=n.image,s.id=n.id,s.item=n.item):(s.bitmap=n.getChildAt(0).clone(),s.bitmap.addTo(s),s.image=s.bitmap.image,s.id=s.bitmap.id,s.item=s.bitmap.item),s.mouseChildren=!1,s.type="Image",s.commands)for(o=0;o<s.commands.length;o++)s.commands[o][2]?s[s.commands[o][0]].apply(s,s.commands[o][1]):e[s.commands[o][0]].apply(s,s.commands[o][1]);s.commands=null,s.stage&&s.stage.update()}else if("EmptyAsset"==n.type){if(n.addTo(s),s.mouseChildren=!1,s.type="EmptyAsset",s.commands)for(o=0;o<s.commands.length;o++)s.commands[o][2]?s[s.commands[o][0]].apply(s,s.commands[o][1]):e[s.commands[o][0]].apply(s,s.commands[o][1]);s.commands=null,s.stage&&s.stage.update()}else if("SVG"==n.type){if(n.addTo(s),s.mouseChildren=!1,s.type="SVG",s.bitmap=n,s.svg=n.svg,s.commands)for(o=0;o<s.commands.length;o++)s.commands[o][2]?s[s.commands[o][0]].apply(s,s.commands[o][1]):e[s.commands[o][0]].apply(s,s.commands[o][1]);s.commands=null,s.stage&&s.stage.update()}e.assets[t]=s,s.dispatchEvent("assetLoad"),s.dispatchEvent("complete")})),c.on("error",(function(e){var t=new createjs.Event("error");t.id=e.id,t.item=e.item,s.dispatchEvent(t)})),s}},e.asset.getIDs=function(){var t=[];for(var o in e.assetIDs)t.push(o);return t},e.image=function(t,o,n,r,i){return t.match(/^htt/i)&&(t="https://cors.zimjs.com/"+t),e.asset(t,o,n,r,i)},e.zimObjectIDs={},e.object=this.object=function(t){return e.zimObjectIDs[t]},e.object.getNames=function(){var t=[];for(var o in e.zimObjectIDs)t.push(o);return t},WW.zns||(WW.asset=this.asset,WW.image=e.image,WW.object=this.object),this.setDefault=function(){return WW.zimDefaultFrame=WW.zdf=WW.F=D,WW.S=N,WW.W=N.width,WW.H=N.height,D},Object.defineProperty(D,"isDefault",{get:function(){return WW.zdf==D},set:function(){zogy("Frame(): isDefault is read only - see setDefault()")}}),Object.defineProperty(D,"stage",{get:function(){return N},set:function(){zogy("Frame(): stage is read only - see remakeCanvas(), perhaps")}}),Object.defineProperty(D,"width",{get:function(){return V},set:function(){zogy("Frame(): width is read only - see remakeCanvas(), perhaps")}}),Object.defineProperty(D,"height",{get:function(){return G},set:function(){zogy("Frame(): height is read only - see remakeCanvas(), perhaps")}}),Object.defineProperty(this,"color",{get:function(){return i},set:function(t){i=t,zot(t)?zid(z).style.backgroundColor="default":(zid(z).style.backgroundColor=i,!zot(i)&&w&&N.setClearColor(e.convertColor(i)))}}),Object.defineProperty(this,"outerColor",{get:function(){return de},set:function(e){de=e,zet("body").css({backgroundColor:de})}}),Object.defineProperty(D,"allowDefault",{get:function(){return T},set:function(e){e?(N.preventSelection=!1,document.body.style.overflow="visible",D.zil&&(WW.removeEventListener("keydown",D.zil[0]),WW.removeEventListener("wheel",D.zil[1]),WW.removeEventListener("DOMMouseScroll",D.zil[2]),D.zil=null)):(N.preventSelection=!0,N.enableDOMEvents(!0),"full"!=o&&"fit"!=o&&"fill"!=o||(document.body.style.overflow="hidden"),zot(D.zil)&&(D.zil=zil())),T=e,N.__touch&&(N.__touch.preventDefault=!T)}}),WW.addEventListener("contextmenu",Pe,!1);var ge=new createjs.Event("keydown");if(this.eventRemove=ge.remove,WW.addEventListener("keydown",Be),WW.addEventListener("keyup",Ee),WW.addEventListener("wheel",Ie),P&&WW.DeviceMotionEvent&&WW.addEventListener("devicemotion",Se),P&&WW.DeviceOrientationEvent){var pe=0,fe=0;WW.addEventListener("deviceorientation",We)}this.isFullscreen=!!document.fullscreenElement,this.htmlobc=zet("html").css("backgroundColor"),this.fullscreen=function(e){if(zot(e)&&(e=!0),e){if(document.fullscreenElement)return;var t=D.canvas.parent?D.canvas.parent:document.body;t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}else{if(!document.fullscreenElement)return;document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}this.isFullscreen=e},document.addEventListener("fullscreenchange",(function(){D.isFullscreen=!!document.fullscreenElement,document.fullscreenElement?(zet("html").css("backgroundColor",D.color),D.dispatchEvent("fullscreenenter")):(zet("html").css("backgroundColor",D.htmlobc?D.htmlobc:"transparent"),D.dispatchEvent("fullscreenexit"))})),this.remakeCanvas=function(e,t){if("full"!=o){zot(e)&&(e=V),zot(t)&&(t=G),zid(z)&&zid(z).parentNode.removeChild(zid(z)),V=e,G=t;for(var n=[],r=0;r<D.stage.numChildren;r++)n.push(D.stage.getChildAt(r));for(we(),xe(),r=0;r<n.length;r++)D.stage.addChild(n[r])}},this.follow=function(t,o,n,r,i,a,l,s,c,u,d,h,g,p){var f,m="obj, boundary, damp, dampY, leftOffset, rightOffset, upOffset, downOffset, offsetDamp, offsetDampY, horizontal, vertical, borderLock, lag";if(f=zob(D.follow,arguments,m))return f;if(D.followObj=null,D.followTicker&&e.Ticker.remove(D.followTicker),!zot(t))return t.dirX=t.dirY=0,D.followObj=t,t.followDampX=null,t.followDampY=null,zot(o)&&(o=new e.Boundary(0,0,D.stage.width,D.stage.height)),D.followBoundary=o,zot(n)&&(n=.05),zot(r)&&(r=n),zot(i)&&(i=0),zot(a)&&(a=0),zot(l)&&(l=0),zot(s)&&(s=0),zot(c)&&(c=.02),zot(u)&&(u=c),zot(d)&&(d=!0),zot(h)&&(h=!0),zot(g)&&(g=!1),zot(p)&&(p=!1),t.parent?z():t.on("added",z),t;function z(){var f=t.parent;D.frameBorderLock=g,d&&(D.followDampX=new e.Damp(f.x,n),D.offsetDampX=new e.Damp(o.x+i+(o.width-i-a)/2,c)),h&&(D.followDampY=new e.Damp(f.y,r),D.offsetDampY=new e.Damp(o.y+l+(o.height-l-s)/2,u)),D.followTicker=e.Ticker.add((function(){var e=D.followBoundary;if(d){var o=e.x+i+(e.width-i-a)/2;D.followOffsetX=[p?e.x+e.width-i:o,o,p?e.x+i:o],D.followObj&&(f.x=D.followDampX.convert(D.offsetDampX.convert(D.followOffsetX[t.motionController?t.motionController.dirX+1:1])-t.x))}if(h){var n=e.y+l+(e.height-l-s)/2;D.followOffsetY=[p?e.y+e.height-s:n,n,p?e.y+l:n],D.followObj&&(f.y=D.followDampY.convert(D.offsetDampY.convert(D.followOffsetY[t.motionController?t.motionController.dirY+1:1])-t.y))}D.frameBorderLock&&(f.x>D.followBoundary.x&&(f.x=D.followBoundary.x),f.y>D.followBoundary.y&&(f.y=D.followBoundary.y),f.x<D.followBoundary.x+D.followBoundary.width-f.width&&(f.x=D.followBoundary.x+D.followBoundary.width-f.width),f.y<D.followBoundary.y+D.followBoundary.height-f.height&&(f.y=D.followBoundary.y+D.followBoundary.height-f.height))}))}},e.setBlurDetect(),this.dispose=function(){return D.zil&&D.zil.length&&(WW.removeEventListener("keydown",D.zil[0]),WW.removeEventListener("wheel",D.zil[1]),WW.removeEventListener("DOMMouseScroll",D.zil[2])),K&&WW.removeEventListener("resize",K),WW.removeEventListener("resize",ye),WW.removeEventListener("contextmenu",Pe),WW.removeEventListener("keydown",Be),WW.removeEventListener("keyup",Ee),WW.removeEventListener("wheel",Ie),WW.removeEventListener("devicemotion",Se),WW.removeEventListener("deviceorientation",We),WW.removeEventListener("mousedown",me,!0),WW.removeEventListener("mousemove",me,!0),WW.removeEventListener("mouseup",me),T||(document.body.style.overflow="auto"),function e(t){if(t.dispose)t.dispose();else{if(t.removeAllEventListeners(),t.numChildren)for(var o=t.numChildren-1;o>=0;o--)e(t.getChildAt(o));t.parent&&t.parent.removeChild(t)}t=null}(N),zid(z)&&zid(z).parentNode.removeChild(zid(z)),D==e.tickerFrame&&(e.tickerFrame=null),D===WW.zdf&&(WW.zdf=WW.S=WW.W=WW.H=null),N=null,D=null,!0},this.makeCircles=function(t,o){zot(t)&&(t=100);var n,r,i=[e.orange,e.green,e.pink,e.blue,e.brown,e.dark];if(o)for((n=new e.Container({style:!1})).radius=t,r=0;r<i.length;r++)n.addChild(new e.Circle(n.radius/i.length*(i.length-r),i[r],null,null,null,null,null,null,!1));else{var a=(n=new e.Shape({style:!1})).graphics;for(n.radius=t,r=0;r<i.length;r++)a.f(i[r]).dc(0,0,n.radius/i.length*(i.length-r));n.setBounds(-n.radius,-n.radius,2*n.radius,2*n.radius)}return n},this.madeWith=function(t,o,n,r,i,a,l){zot(t)&&(t=e.dark),zot(o)&&(o="Made with ZIM");var s=new e.Container,c=s.icon=D.makeIcon(n,r,i,a,l).sca(.5).alp(.92).hov(1).addTo(s).tap((function(){c.alp(.92),c.stage.update(),zgo("https://zimjs.com","_blank")}));return s.label=new e.Label(o,16,null,t).sca(.7).pos(0,-19,e.CENTER,e.BOTTOM,s),s},this.makeIcon=function(t,o,n,r,i){var a=new e.Container(-20,-13,102,120).reg(-20,-13);zot(t)&&(t=e.light),zot(o)&&(o=e.dark),!0===n&&(n=[e.silver,e.silver,e.silver,e.silver,e.silver]),new e.Rectangle(a.width,a.height,o,r,i).loc(-20,-13,a);var l=[[n?n[0]:"#E474C3","AieA0IAAgCIAmhlIEXAAIg5Bng",41.7,19.5],[n?n[1]:"#50C5B7","AiSAzIAnhlID+AAIg5Blg",35.3,33.2],[n?n[2]:"#F48E25","AiFA0IAmhnIDlAAIg5Bng",28.9,46.7],[n?n[3]:"#EBCD36","Ah4AzIAmhlIDLAAIg5Blg",22.4,60.5],[n?n[4]:"#ABD140","AhrA0IAAgFIAlhiICxAAIg5Bng",16.1,74.3],[t,"AlGHRIAnhnIH+AAIgbBngAlGlpIAnhnIJmAAIg5Bng",32.7,46.5]];return e.loop(l,(function(t){var o=(new e.Shape).addTo(a);o.graphics.f(t[0]).p(t[1]),o.setTransform(t[2],t[3])})),a.mouseChildren=!1,a},this.makeAbstract=function(t){zot(t)&&(t="black");var o=new e.Rectangle(200,200);e.loop([[115.8,103.55,"#4ACBEB","Am6GkIAAtHIN0AAIAAClIrZAAIAAKig"],[127.55,73.3,"#A1E543","AAjLSIAAp6IEiAAIAAJ6gAlELOIAAp2IEiAAIAAJ2gAlEihIAAowIKEAAIAAIwg"],[32.55,73.05,"#B545E4","Ak6LQIAA2fIJ1AAIAAWfg"]],(function(t){var n=(new e.Shape).f(t[2]).p(t[3]);n.setTransform(t[0]+20,t[1]+27),n.addTo(o)}),!0);var n=new e.Container;return o.sca(.4).addTo(n),n.mouseChildren=!1,n},this.makeCat=function(t){zot(t)&&(t=246);var o=new e.Container(157.5,246);e.loop([[16.95,241.15,0,"black",[1.5,2,1],"AgKAhIAVhB"],[58.65,244.378,0,"#A7A7A7",[3,2,1],"AmYAAIMxAB"],[105.64,107.14,"#EF7988",0,0,"AAEArQgNAAgjghQgiggAFgIQAFgJBEgCQBEgDAGAGQAHAIgfAkQgfAlgPAAIAAAAg"],[104.84,111.34,0,"black",[1,1,1],"AABA2IAPAYQAJAPAJAGQAKAHAMAAQAbAAAXgWQAQgPAVghQAVghAAgcQAAgnglgYQgbgSgxgCIgrACAAJADIgIAzAhphVQgXAVgMAWQgKAQgIAiQgIAkAFAMQALAfAqAOQAmANAcgIQANgEANgQQALgNAGgT"],[105.05,111.4,"#757B74",0,0,"AheBrQgvgRgQgeQgPgdAQgkQAZg8AEgFQAXgfA8gGQBVgKA+ATQBRAZgYBEQgVA/gnAZQgUAOgZAKQgJAJgVgbQgUgegCAAQgDAAgWAgQgWAUgZAAQgMAAgNgEg"],[86.18,93,"black",0,0,"Aj7g0QiYg0i9AyQA0g3BcgRQBagQBfAaQBkAbBEBBQBNBHASBpQhgiYibg0gAFxiDQAzgdA6AMQA9AMA2A4QgHgBAAACQAAAAgBABQAAAAAAAAQgBAAgBAAQAAAAgBgBQh8gshOAzQhIAvhBCYQALjABzhCg"],[78.5,63.23,"#705F6C","black",[1,1,1],"AHAg5IgNmIIBfGpQgOgQgSgMQgjgXgPASgAKeDZQg2g4g9gMQg6gMgzAdQhzBCgLDBQBBiZBIgvQBNgzB9AsQAEACAAgCQAAgCAHABgAqdBuIAAnsIDmHEQgegMgsgBQhXgChFA3gAoEDzQA0g3BdgRQBagQBeAaQBkAbBFBBQBMBIASBpQhfiYibg1QiYg0i+Ayg"],[86.28,98.01,"black","black",[1,1,1],"AJSh/QgEADgHgDQgFgBgBAFQgNBXhNA9QhTBEhagZQgGgCgPAFQgUAHgEAAQCNAeBchOQBGg7AWhigApRhnQAFABAIAAQAGABAAAAQBFBsCVA7QCpBDCrgzQACAAAHAJQAEAFAFAJQjAAzitg/Qing9g/iHg"],[96.95,97.3,"#0C0436",0,0,"AlZBJQgVgVAAgeQAAgcAVgVQAVgVAeAAQAdAAAVAVQAVAVAAAcQAAAegVAVQgVAVgdAAQgeAAgVgVgAD1AcQgVgVAAgdQAAgdAVgVQAVgVAeAAQAdAAAVAVQAVAVAAAdQAAAdgVAVQgVAVgdAAQgeAAgVgVg"],[96.88,97.2,"#EA9424",0,0,"AlpBYQgbgbAAgnQAAglAbgbQAbgbAnAAQAmAAAbAbQAbAbAAAlQAAAngbAbQgbAbgmAAQgnAAgbgbgADnArQgbgbAAgmQAAgmAbgbQAbgbAmAAQAnAAAbAbQAbAbAAAmQAAAmgbAbQgbAbgnAAQgmAAgbgbg"],[96.88,97.2,"#AFCE3A",0,0,"AlzBiQgggfAAgtQAAgrAggfQAfggAtAAQAsAAAgAgQAfAfAAArQAAAtgfAfQggAggsAAQgtAAgfgggADcA1QgfgfAAgsQAAgsAfgfQAgggAsAAQAtAAAfAgQAgAfAAAsQAAAsggAfQgfAggtAAQgsAAggggg"],[78.5,64.1,0,"black",[1,1,1],"AHAhCIgNmIIBfGpQgOgQgSgMQgjgXgPASgAKeDQQg2g4g9gMQg6gMgzAdQhzBCgLDBQCqAvBlhgQBJhFAGhagAoADiQAlgiBTgOQBYgOBaARQDrAsA0DTQjAAziog/Qihg+hAiIgAqdBlIAAnsIDmHEQgegMgsgBQhXgChFA3g"],[86.375,93.9,"#EACE35",0,0,"AltB+Qiig9g/iIQAkghBTgOQBZgPBaARQDrAtA0DRQhWAXhSAAQhkAAhcgjgADxB2QALjABzhBQAzgeA6AMQA9ANA2A4QgGBYhJBGQhEBAhiAAQgxAAg4gQg"],[73.45,154.83,"black","black",[2,1,1],"AkjjDIByAMQB/ANBEAFQB/AICXgSIgKFzQj4hflLiNQgDgBAFiag"],[79.42,123.62,"#A7A7A7","black",[2,1,1],"AEBpxIgBgBQAYiNAeiQQA8kgAfgMQAggNBLEqQAlCVAfCXIAXARQAbAXAZAcQBQBZAZBnQAZBngUB+QgKA/gPArQgeASgrAWQhYAuhFAXQg8AUh0AWIhoASIAAQzItygCQAvhKA1hoQBqjRAjiXQAri/AOjLIAFimQgegHhTgeQhEgZhgg/IhTg7QgekPgQkUQggonBEgWQBFgWCbEtQAkBGA3B9QAbA9AYA3QASAqAQAmIgjhQIABAAIJmgYIBUACIBQAK"]],(function(t){var n=(new e.Shape).f(t[2]).s(t[3]).ss(t[4]?t[4][0]:null,t[4]?t[4][1]:null,t[4]?t[4][2]:null).p(t[5]);n.setTransform(t[0],t[1]),n.addTo(o)}),!0);var n=new e.Container;return o.sca(t/246).addTo(n).mov(0,-.4),Y&&n.cache(),n.mouseChildren=!1,n}}else setTimeout((function(){D.dispatchEvent("failed")}),100);function me(e){D.leftMouseDown=void 0===e.buttons?1===e.which:1===e.buttons,F&&!D.leftMouseDown&&D.dispatchEvent("mouseupplus"),F=D.leftMouseDown}function ze(){D.scale=S.stage.scaleX;var t=J.getBoundingClientRect();D.x=t.x+e.scrollX(),D.y=t.y+e.scrollY(),e.scaX=createjs.stageTransformable?1:S.stage.scaleX,e.scaY=createjs.stageTransformable?1:S.stage.scaleY}function ye(){if(S){var t=N.getBounds();return V=t.width,G=t.height,void D.dispatchEvent("resize")}ae=Date.now()+v*("s"==R?1e3:1),se?le||(le=!0,te=e.Ticker.update,e.tickerFrame||(e.Ticker.update=!1,e.tickerFrame=D),ke(),Ae(),clearInterval(D.frameTime),D.frameTime=setInterval((function(){if(Date.now()>ae)return clearInterval(D.frameTime),le=!1,void(D==e.tickerFrame&&(e.Ticker.update=te));ke(),Ae()}),50)):(ke(),Ae(),clearInterval(D.frameTime),D.frameTime=setInterval((function(){Date.now()>ae?clearInterval(D.frameTime):(ke(),Ae())}),v*("s"==R?1e3:1)<50?v*("s"==R?1e3:1)+5:50))}function ve(){if(!ie){if(ie=!0,-1==Q.indexOf(o)){if(zot(zid($=o)))return void zogy("Frame - scaling: HTML tag with id="+o+" must exist");ee=D.tag=zid($),D.scaling=o=zot(n)||zot(r)?"tag":"inline",0==z.indexOf("myCanvas")&&(z=$+"Canvas"),"canvas"==ee.tagName.toLowerCase()&&(he=!0,z=$)}else D.scaling=o;var t;if(D.canvasID=z,zot(n)&&(n=500),zot(r)&&(r=500),V=n,G=r,zot(a)||(D.outerColor=a),we(),xe(),Y?(p&&setTimeout((function(){WW.scrollTo(0,0)}),50),setTimeout(i,100),v*("s"==R?1e3:1)!=100&&setTimeout(i,v*("s"==R?1e3:1))):(ne=!0,be()),zot(s))re=!0,be();else zot(t=s.constructor!={}.constructor||s.audioSprite||s.id||s.data||s.src?D.loadAssets({assets:s,path:c,progress:u,queueOnly:!0}):D.loadAssets(e.merge(s,{progress:u,queueOnly:!0})))||!t.on?(zon&&zogy("Frame() - load failed"),re=!0,be()):t.on("complete",(function(){re=!0,be()}))}function i(){ke(),ne=!0,be(),Ae(),N&&N.update()}}function be(){if(ne&&re&&!oe)if(N.width>=1&&N.height>=1){if(!zot(u)&&u.show&&u.hide(),WW.S||(WW.S=N),WW.W||(WW.W=N.width),WW.H||(WW.H=N.height),l&&"function"==typeof l&&l(D,N,N.width,N.height),d&&"function"==typeof d){var t=0;D.updateID=e.Ticker.add((function(){d(++t,D,N,N.width,N.height)})),D.pauseTicker=function(t){zot(t)&&(t=!0),t?e.Ticker.remove(D.updateID):e.Ticker.add(D.updateID)}}D.dispatchEvent("ready"),oe=!0,Ae(),N.update()}else setTimeout((function(){ke(),be()}),50)}function we(){var t;he?t=D.canvas=D.tag:(t=D.canvas=document.createElement("canvas")).setAttribute("id",z),t.setAttribute("tabindex",0);var n=e.windowWidth(),r=e.windowHeight(),a=WW.devicePixelRatio||1;"full"==o||"tag"==o?B?(D.scale=a,t.setAttribute("width",n*D.scale),t.setAttribute("height",r*D.scale),"full"==o&&(t.style.width=n+"px",t.style.height=r+"px")):(t.setAttribute("width",n),t.setAttribute("height",r)):(t.setAttribute("width",V),t.setAttribute("height",G));var l=zid(z+"Alternative");l&&t.appendChild(l),he||("tag"==o||"inline"==o?ee.appendChild(t):document.body.appendChild(t)),zot(i)||(t.style.backgroundColor=i),"full"==o||"fit"==o||"fill"==o?(t.style.position="absolute",T||(document.body.style.overflow="hidden")):"static"==getComputedStyle(t.parentElement).position&&(t.parentElement.style.position="relative")}function Ce(){I&&(D.mouseX=0,D.mouseY=0,D.mousedownEvent=N.on("stagemousedown",(function(t){D.mouseX=t.stageX/e.scaX,D.mouseY=t.stageY/e.scaY})),D.mousemoveEvent=N.on("stagemousemove",(function(t){D.mouseX=t.stageX/e.scaX,D.mouseY=t.stageY/e.scaY}))),WW.removeEventListener("mousedown",me,!0),WW.removeEventListener("mousemove",me,!0),WW.removeEventListener("mouseup",me),WW.addEventListener("mousedown",me,!0),WW.addEventListener("mousemove",me,!0),WW.addEventListener("mouseup",me)}function xe(){ke(),-1==Q.indexOf(o)||T||(D.zil=zil()),D.mousedownEvent&&N&&N.off("stagemousedown",D.mousedownEvent),D.mousemoveEvent&&N&&N.off("stagemousemove",D.mousemoveEvent),(N=w?new e.StageGL(z,C):new e.Stage(z)).frame=D,N.mouseMoveOutside=E,!zot(i)&&w&&N.setClearColor(e.convertColor(i)),N.setBounds(0,0,V,G),N.width=V,N.height=G,B&&ke(),h&&N.enableMouseOver(y),g&&(O?createjs.Touch.enable(N,!0,T):createjs.Touch.enable(N,!1,T)),T&&(N.preventSelection=!1),x&&(N.nextStage=x.stage),k&&(N.nextStage=k),Ce()}function ke(){if(D){var t,r,i,a,l=zid(z),s=e.windowWidth(),c=e.windowHeight();if((q=D.orientation=s>c?"horizontal":"vertical")!=U&&(U=q,D.dispatchEvent("orientation")),Y&&p&&setTimeout((function(){WW.scrollTo(0,0)}),100),l){if("fit"==o)D.scale=s/c>=V/G?c/G:s/V;else if("fill"==o)D.scale=s/c>=V/G?s/V:c/G;else{if("full"==o)return l.style.left=l.style.top="0px",l.width=V=s,l.height=G=c,N&&(N.setBounds(0,0,V,G),B?(i=WW.devicePixelRatio||1,l.width=s*i,l.height=c*i,l.style.width=s+"px",l.style.height=c+"px",D.scale=i,N.scaleX=N.scaleY=D.scale):N.scaleX=N.scaleY=1,N.tickOnUpdate=!1,N.update(),N.tickOnUpdate=!0,N.width=V,N.height=G,w&&N.updateViewport(V/N.scaleX,G/N.scaleY),e.scaX=createjs.stageTransformable?1:N.scaleX,e.scaY=createjs.stageTransformable?1:N.scaleY),T||(e.scrollX(0),e.scrollY(0)),void Te();if("tag"==o)return V=""==ee.style.width?ee.getAttribute("width")||ee.offsetWidth:ee.style.width,G=""==ee.style.height?ee.getAttribute("height")||ee.offsetHeight:ee.style.height,B?(l.width=V*D.scale,l.height=G*D.scale,l.style.width=V+"px",l.style.height=G+"px",N&&(N.scaleX=N.scaleY=D.scale)):(N&&(N.scaleX=N.scaleY=1),l.width=V,l.height=G),N&&(N.tickOnUpdate=!1,N.update(),N.tickOnUpdate=!0,N.setBounds(0,0,V,G),N.width=V,N.height=G,w&&N.updateViewport(V/N.scaleX,G/N.scaleY),e.scaX=createjs.stageTransformable?1:N.scaleX,e.scaY=createjs.stageTransformable?1:N.scaleY),ee.style.overflow="hidden",l.style.left=l.style.top="0px",a=l.getBoundingClientRect(),D.x=a.x+e.scrollX(),D.y=a.y+e.scrollY(),void Te();if("inline"==o){if(B){if(document.styleSheets[0])try{for(var u=document.styleSheets[0].rules||document.styleSheets[0].cssRules,d=0;d<u.length;d++){var h=u[d];if(h.selectorText=="#"+z){var g=h.style.getPropertyValue("width");if(g){var y=zum(l.style.width),v=zum(l.style.height);l.style.width=g}}}}catch(e){}var b=WW.getComputedStyle(l),C=zum(b.getPropertyValue("width"));y&&(l.style.height=v*C/y+"px",b=WW.getComputedStyle(l));var x=zum(b.getPropertyValue("height"));i=WW.devicePixelRatio||1,D.scale=C/n*i,l.width=V*D.scale,l.height=G*D.scale,l.style.width=C+"px",l.style.height=x+"px",N&&(N.scaleX=N.scaleY=D.scale)}else N&&(N.scaleX=N.scaleY=1);return N&&(N.tickOnUpdate=!1,N.update(),N.tickOnUpdate=!0,N.setBounds(0,0,V,G),N.width=V,N.height=G,w&&N.updateViewport(V/N.scaleX,G/N.scaleY),e.scaX=createjs.stageTransformable?1:N.scaleX,e.scaY=createjs.stageTransformable?1:N.scaleY),l.style.left=l.style.top="0px",a=l.getBoundingClientRect(),D.x=a.x+e.scrollX(),D.y=a.y+e.scrollY(),void Te()}}r=G*D.scale,t=V*D.scale,B?(i=WW.devicePixelRatio||1,D.scale*=i,l.width=V*D.scale,l.height=G*D.scale,l.style.width=V*D.scale/i+"px",l.style.height=G*D.scale/i+"px",N&&(N.scaleX=N.scaleY=D.scale)):(N&&(N.scaleX=N.scaleY=1),l.style.width=t+"px",l.style.height=r+"px"),N&&(N.tickOnUpdate=!1,N.update(),N.tickOnUpdate=!0),D.x="left"==f?0:"right"==f?s-t:(s-t)/2,D.y="top"==m?0:"bottom"==m?c-r:(c-r)/2,l.style.left=D.x+"px",l.style.top=D.y+"px",T||(e.scrollX(0),e.scrollY(0)),Te(),N&&(e.scaX=createjs.stageTransformable?1:N.scaleX,e.scaY=createjs.stageTransformable?1:N.scaleY)}}}function Te(){if("fill"==o){var t=(zum(D.canvas.style.width)-e.windowWidth())/2;"left"==f?(D.visibleLeft=0,D.visibleRight=e.windowWidth()/(e.windowWidth()+2*t)*V):"right"==f?(D.visibleLeft=2*t/(e.windowWidth()+2*t)*V,D.visibleRight=V):(D.visibleLeft=t/(e.windowWidth()+2*t)*V,D.visibleRight=(e.windowWidth()+t)/(e.windowWidth()+2*t)*V);var n=(zum(D.canvas.style.height)-e.windowHeight())/2;"top"==m?(D.visibleTop=0,D.visibleBottom=e.windowHeight()/(e.windowHeight()+2*n)*G):"bottom"==m?(D.visibleTop=2*n/(e.windowHeight()+2*n)*G,D.visibleBottom=G):(D.visibleTop=n/(e.windowHeight()+2*n)*G,D.visibleBottom=(e.windowHeight()+n)/(e.windowHeight()+2*n)*G)}else D.visibleLeft=D.visibleTop=0,D.visibleRight=V,D.visibleBottom=G}function Ae(){if(oe&&D){D==WW.zdf&&(WW.W=D.width,WW.H=D.height),D.dispatchEvent("resize");var t=(new Date).getTime();setTimeout((function(){(new Date).getTime()-t>80&&(ke(),D==WW.zdf&&(WW.W=D.width,WW.H=D.height),setTimeout((function(){D.dispatchEvent("resize"),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!N||"full"!=o&&"tag"!=o||N.update()}),100))}),100),e.OPTIMIZE||!zns&&WW.OPTIMIZE||!N||"full"!=o&&"tag"!=o||N.update()}}function Pe(e){D.dispatchEvent(e)}function Be(e){e.remove=D.eventRemove,D.altKey=e.altKey,D.ctrlKey=e.ctrlKey,D.metaKey=e.metaKey,D.shiftKey=e.shiftKey,D.dispatchEvent(e)}function Ee(e){D.altKey=e.altKey,D.ctrlKey=e.ctrlKey,D.metaKey=e.metaKey,D.shiftKey=e.shiftKey,e.remove=D.eventRemove,D.dispatchEvent(e)}function Ie(e){D.dispatchEvent(e)}function Se(e){e.remove=D.eventRemove,D.dispatchEvent(e)}function We(e){e.remove=D.eventRemove;var t=360-e.alpha;Math.abs(t-pe)>135&&Math.abs(t-pe)<225&&(fe=0==fe?180:0),pe=t,e.rotation={x:e.beta,y:e.gamma,z:(t+fe)%360},D.dispatchEvent(e)}},e.extend(e.Frame,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.Queue=function(){this.cjsEventDispatcher_constructor(),this.type="Queue",this.isLoading=!0},e.extend(e.Queue,createjs.EventDispatcher,null,"cjsEventDispatcher"),e.Pic=function(t,o,n,r,i,a,l){var s,c="file, width, height, noCors, style, group, inherit";if(s=zob(e.Pic,arguments,c,this))return s;z_d("83.03"),this.group=a;var u=!1===i?{}:e.getStyle("Pic",this.group,l);if(zot(t)&&(t=null!=u.file?u.file:null),zot(r)&&(r=null!=u.noCors&&u.noCors),zot(t))zon&&zogy("ZIM Pic - needs a file");else{this.zimContainer_constructor(o,n);var d=this,h=t;t=d.file=e.Pick.choose(t),this.type=o&&n?"ACWD":"AC";var g=r?e.image(t):e.asset(t);d.mouseChildren=!1,"Bitmap"==g.type||"Image"==g.type?("Bitmap"==g.type?d.bitmap=g.clone().addTo(d):d.bitmap=g.getChildAt(0).clone().addTo(d),d.id=g.id,d.image=d.bitmap.image,d.src=d.bitmap.src,d.item=d.bitmap.item,d.setBounds(null),d.type="Pic",setTimeout((function(){d.dispatchEvent("ready"),d.dispatchEvent("complete")}),20)):g.on("complete",(function(){if(d.bitmap=g.getChildAt(0).clone().addTo(d),d.id=g.id,d.setBounds(null),d.type="Pic",d.commands)for(var t=0;t<d.commands.length;t++)d.commands[t][2]?d[d.commands[t][0]].apply(d,d.commands[t][1]):e[d.commands[t][0]].apply(d,d.commands[t][1]);d.image=d.bitmap.image,d.src=d.bitmap.src,d.item=d.bitmap.item,d.commands=null,d.dispatchEvent("ready"),d.dispatchEvent("complete"),d.stage&&d.stage.update()})),d.keyOut=function(e,t,o){return"AC"==d.type&&WW.zdf?(WW.zdf.ac("keyOut",arguments,d),d):(d.bitmap&&d.bitmap.keyOut(e,t,o),d.stage&&d.stage.update(),d)},e.styleTransforms(this,u),d.clone=function(a){return this.cloneProps(new e.Pic(a?t:h,o,n,r,i,this.group,l))}}},e.extend(e.Pic,e.Container,["clone"],"zimContainer",!1),e.Aud=function(t,o,n,r,i,a,l,s,c,u,d,h){var g,p="file, volume, loop, loopCount, pan, offset, delay, interrupt, maxNum, style, group, inherit";if(g=zob(e.Aud,arguments,p,this))return g;z_d("83.05"),this.cjsEventDispatcher_constructor(),this.type="Aud",this.group=d;var f=!1===u?{}:e.getStyle(this.type,this.group,h);if(zot(t)&&(t=null!=f.file?f.file:null),zot(t))zon&&zogy("ZIM Sound - needs a file");else{zot(o)&&(o=null!=f.volume?f.volume:1),zot(n)&&(n=null!=f.loop&&f.loop),zot(r)&&(r=null!=f.loopCount?f.loopCount:null),zot(i)&&(i=null!=f.pan?f.pan:0),zot(a)&&(a=null!=f.offset?f.offset:0),zot(l)&&(l=null!=f.delay?f.delay:0),zot(s)&&(s=null!=f.interrupt?f.interrupt:"none"),zot(c)&&(c=null!=f.maxNum?f.maxNum:null);var m=this;t=m.file=e.Pick.choose(t);var z=m.sound=e.asset(t,null,null,c);"AC"==z.type?z.on("complete",(function(){m.src=z.src,m.item=z.item,m.dispatchEvent("ready"),m.dispatchEvent("complete")})):setTimeout((function(){m.src=z.src,m.item=z.item,m.dispatchEvent("ready"),m.dispatchEvent("complete")}),20),m.volume=o,m.loop=n,m.loopCount=r,m.pan=i,m.offset=a,m.delay=l,m.interrupt=s,m.maxNum=c,m.play=function(e,t,o,n,r,i,a){var l,s="volume, loop, loopCount, pan, offset, delay, interrupt";return(l=zob(m.play,arguments,s))?l:(zot(e)&&(e=m.volume),zot(t)&&(t=m.loop),zot(o)&&(o=m.loopCount),zot(n)&&(n=m.pan),zot(r)&&(r=m.offset),zot(i)&&(i=m.delay),zot(a)&&(a=m.interrupt),m.sound.play(e,t,o,n,r,i,a))},m.dispose=function(){return m.sound&&m.sound.dispose(),m.sound=null,!0}}},e.extend(e.Aud,createjs.EventDispatcher,null,"cjsEventDispatcher"),e.Vid=function(t,o,n,r,i,a,l,s,c,u,d,h){var g,p="file, width, height, scaling, volume, loop, align, valign, type, style, group, inherit";if(g=zob(e.Vid,arguments,p,this))return g;z_d("83.07"),this.group=d;var f=!1===u?{}:e.getStyle("Vid",this.group,h);if(zot(t)&&(t=null!=f.file?f.file:null),zot(t))zon&&zogy("ZIM Vid - needs a file");else{zot(o)&&(o=null!=f.width?f.width:null),zot(n)&&(n=null!=f.height?f.height:null),zot(r)&&(r="fit"),zot(a)&&(a=null==f.loop||f.loop),zot(i)&&(i=null!=f.volume?f.volume:1),zot(l)&&(l=null!=f.align?f.align:"center"),zot(s)&&(s=null!=f.valign?f.valign:"center"),zot(c)&&(c=null!=f.type?f.type:"video/mp4"),this.zimContainer_constructor(o,n),this.type=o&&n?"ACWD":"AC";var m,z=this,y=t;t=e.Pick.choose(t),z.file=t,null!=WW.PATH&&(e.PATH=WW.PATH);var v="";1==t.split("/").length&&e.PATH&&(v=e.PATH),this.mouseChildren=!1;var b=z.source=document.createElement("video");document.body.appendChild(b),b.style.display="none",b.setAttribute("autoplay","autoplay"),b.setAttribute("playsinline","playsinline"),b.setAttribute("crossorigin","anonymous"),a&&b.setAttribute("loop","loop");var w=z.innerSource=document.createElement("source");1==t.split("?").length&&(t+="?playsinline=1"),w.setAttribute("src",v+t),w.setAttribute("type",c),b.appendChild(w),x();var C=0;z.videoPaused=!0,z.play=function(){if(m){if(b.play(),b.volume=i,z.videoPaused=!1,!z.ticker)if(z.keyObj){var t=z.keyObj.color,o=z.keyObj.tolerance,n=z.keyObj.replacement;z.ticker=e.Ticker.add((function(){m.keyOut(t,o,n)}))}else z.ticker=e.Ticker.add((function(){}));return z}zon&&zogy("ZIM Vid - no file found")},z.keyOut=function(t,o,n){return z.ticker?(e.Ticker.remove(z.ticker),z.ticker=e.Ticker.add((function(){m.keyOut(t,o,n)}))):z.keyObj={color:t,tolerance:o,replacement:n},z},z.pause=function(e){return zot(e)&&(e=!0),z.videoPaused=e,e?b.pause():b.play(),z},Object.defineProperty(this,"duration",{get:function(){return b.duration},set:function(){}}),Object.defineProperty(this,"currentTime",{get:function(){return b.currentTime},set:function(e){b.currentTime=e}}),Object.defineProperty(this,"volume",{get:function(){return b.volume},set:function(e){i=e,b.volume=e}}),e.styleTransforms(this,f),z.clone=function(d){return this.cloneProps(new e.Vid(d?t:y,o,n,r,i,a,l,s,c,u,this.group,h))},z.dispose=function(t,o,n){this.ticker&&e.Ticker.remove(this.ticker);var r=z.stage;return z.bitmap.dispose(),m=z.bitmap=null,b.pause(),b.removeAttribute("src"),b.load(),b.remove(),b=null,n||this.zimContainer_dispose(!0),r&&r.update(),!0}}function x(){C++>5&&z.dispatchEvent("error"),b.addEventListener("stalled",x),b.addEventListener("error",x),b.addEventListener("canplay",k)}function k(){z.type="Vid",b.removeEventListener("stalled",x),b.removeEventListener("error",x),b.removeEventListener("canplay",k),b.pause();var t=b.videoWidth,i=b.videoHeight;if(z.setBounds(0,0,o||t,n||i),(m=z.bitmap=new e.Bitmap(b,t,i).addTo(z)).setBounds(0,0,t,i),m.scaleTo(z,100,100,r).pos(0,0,l,s,z),z.commands)for(var a=0;a<z.commands.length;a++)z.commands[a][2]?z[z.commands[a][0]].apply(z,z.commands[a][1]):e[z.commands[a][0]].apply(z,z.commands[a][1]);z.commands=null,z.dispatchEvent("ready")}},e.extend(e.Vid,e.Container,["clone","dispose"],"zimContainer",!1),e.SVG=function(t,o,n,r,i,a,l,s,c,u,d){var h,g="svg, width, height, bitmap, splitTypes, geometric, showControls, interactive, style, group, inherit";if(h=zob(e.SVG,arguments,g,this))return h;z_d("83.09"),this.group=u;var p=!1===c?{}:e.getStyle("SVG",this.group,d);if(zot(t)&&(t=null!=p.svg?p.svg:null),zot(t))zon&&zogy("ZIM SVG - needs a svg value");else{zot(r)&&(r=null==p.bitmap||p.bitmap),zot(i)&&(i=null!=p.splitTypes&&p.splitTypes),zot(a)&&(a=null==p.geometric||p.geometric),zot(l)&&(l=null==p.showControls||p.showControls),zot(s)&&(s=null==p.interactive||p.interactive),this.zimContainer_constructor(o,n);var f=this;r&&(this.mouseChildren=!1);var m=t;t=e.Pick.choose(t),this.type=o&&n?"ACWD":"AC";var z=e.assets[t];if(z&&(f.src=z.src,f.file=z.file,f.item=z.item,f.svg=z.svg),z&&"Bitmap"==z.type)f.type="SVG",f.bitmap=z.clone(),v();else if(z&&"AC"==z.type)z.on("complete",(function(){f.type="SVG",f.bitmap=z.bitmap.clone(),v(zot(o)&&zot(n))}));else if(z&&"ACWB"==z.type)zot(o)&&zot(n)&&f.setBounds(0,0,z.width,z.height),z.on("complete",(function(){f.type="SVG",f.bitmap=z.bitmap.clone(),v()}));else if(z&&"SVG"==z.type)f.type="SVG",z.bitmap?f.bitmap=z.bitmap.clone():f.bitmap=z.clone(),v();else if(t&&t.match(/<svg/i)&&(f.svg=t),f.svg&&f.svg.match(/<svg/i))f.type="SVG",v();else{var y=e.asset(t);y.on("complete",(function(){f.type="SVG",y.bitmap&&(f.src=y.bitmap.src,f.file=y.bitmap.file,f.item=y.bitmap.item,f.svg=y.bitmap.svg,f.bitmap=y.bitmap.clone()),v(zot(o)&&zot(n))}))}f.keyOut=function(e,t,o){return"AC"==f.type&&WW.zdf?(WW.zdf.ac("keyOut",arguments,f),f):(f.bitmap&&f.bitmap.keyOut(e,t,o),f.stage&&f.stage.update(),f)},e.styleTransforms(this,p),f.clone=function(u){return this.cloneProps(new e.SVG(u?t:m,o,n,r,i,a,l,s,c,this.group,d))}}function v(o){if(r)f.bitmap?(f.svg=f.bitmap.svg,f.bitmap.addTo(f),o&&b(),setTimeout((function(){f.dispatchEvent("ready"),f.dispatchEvent("complete")}),20)):e.svgToBitmap(f.svg,(function(e){f.bitmap=e,f.bitmap.addTo(f),b(),f.dispatchEvent("ready"),f.dispatchEvent("complete"),f.stage&&f.stage.update()}));else if(f.bitmap&&(f.svg=f.bitmap.svg),t.match(/<svg/i)||z&&"SVG"==z.type||o){new e.SVGContainer(f.svg).loop((function(e){e&&e.addTo(f)}),!0),o&&b(),setTimeout((function(){f.dispatchEvent("ready"),f.dispatchEvent("complete")}),20)}else{var n=e.asset(t);n.on("complete",(function(){new e.SVGContainer(n).loop((function(e){e&&e.addTo(f)}),!0),b(),f.dispatchEvent("ready"),f.dispatchEvent("complete"),f.stage&&f.stage.update()}))}}function b(){if(zot(o)&&zot(n)&&f.setBounds(null),f.type="SVG",f.commands)for(var t=0;t<f.commands.length;t++)f.commands[t][2]?f[f.commands[t][0]].apply(f,f.commands[t][1]):e[f.commands[t][0]].apply(f,f.commands[t][1]);f.commands=null}},e.extend(e.SVG,e.Container,["clone"],"zimContainer",!1),e.SensorAsk=function(t,o,n,r,i,a,l){var s,c="callback, sensorType, color, backgroundColor, style, group, inherit";if(s=zob(e.SensorAsk,arguments,c,this))return s;z_d("83.01"),this.group=a;var u=!1===i?{}:e.getStyle("SensorAsk",this.group,l);if(zot(o)&&(o=null!=u.sensorType?u.sensorType:"deviceorientation"),"devicemotion"!=o&&(o="deviceorientation"),this.sensorType=o,!zot(t)){zot(n)&&(n=null!=u.color?u.color:e.dark),zot(r)&&(r=null!=u.backgroundColor?u.backgroundColor:e.lighter),this.zimPane_constructor(200,200,"",r,n,!1,null,!0,100,black.toAlpha(.3),null,null,null,!1,!1),this.type="SensorAsk";var d=this;if(Style.addGroup("sensorAsk",{width:100,color:n,rollColor:r,corner:10,backgroundColor:e.faint,rollBackgroundColor:n,borderColor:n,borderWidth:2}),d.yes=new e.Button({label:"YES",group:"sensorAsk"}).sca(.65).pos(0,30,CENTER,TOP,this).tap((function(){d.hide(!0);var e=DeviceMotionEvent;"deviceorientation"!=o&&(e=DeviceOrientationEvent),e.requestPermission().then((function(e){t("denied"!=e)}))})),d.label=new e.Label("Use sensor?",null,null,n,null,null,null,"center").sca(.9).centerReg(this),d.no=new e.Button({label:"NO",group:"sensorAsk"}).sca(.65).pos(0,30,CENTER,BOTTOM,this).tap((function(){d.hide(!1),t(!1)})),new e.Circle(110,e.clear,n,1).center(this).alp(.8),new e.Circle(120,e.clear,n,1).center(this).alp(.5),new e.Circle(130,e.clear,n,1).center(this).alp(.2),e.styleTransforms(this,u),DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission)d.show();else{var h=!1;function g(e){"deviceorientation"==o?null==e.alpha||0==e.alpha&&0==e.beta&&0==e.gamma?t(!1):t(!0):!e.acceleration||null==e.acceleration.x||0==e.acceleration.x&&0==e.acceleration.y&&0==e.acceleration.z?t(!1):t(!0),h=!0,window.removeEventListener(o,g)}window.addEventListener(o,g),setTimeout((function(){h||t(!1)}),100)}}},e.extend(e.SensorAsk,e.Pane,null,"zimPane",!1),e.colorsHex=["#f58e25","#acd241","#e472c4","#50c4b7","#d1a170","#ebcb35","#993399","#fb4758","#000000","#111111","#333333","#555555","#555555","#777777","#999999","#aaaaaa","#bbbbbb","#cccccc","#dddddd","#eeeeee","#ffffff","rgba(0,0,0,.01)","rgba(0,0,0,0)"],e.colors=["orange","green","pink","blue","brown","yellow","purple","red","black","darker","dark","grey","gray","tin","silver","fog","mist","light","moon","lighter","white","faint","clear"],z_i=0;z_i<e.colors.length;z_i++)e[e.colors[z_i]]=e.colorsHex[z_i];return String.prototype.darken=function(t){return e.darken(this,t)},String.prototype.lighten=function(t){return e.lighten(this,t)},String.prototype.toColor=function(t,o){return e.toColor(this,t,o)},String.prototype.toAlpha=function(t){return e.toAlpha(this,t)},e.FIT="fit",e.FILL="fill",e.FULL="full",e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.MIDDLE="middle",e.START="start",e.END="end",e.TOP="top",e.BOTTOM="bottom",e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e.BOTH="both",e.UP="up",e.DOWN="down",e.AUTO="auto",e.AVE="ave",e.DEFAULT="default",e.GET="get",e.POST="post",e.LOCALSTORAGE="localStorage",e.SOCKET="socket",e.TO="to",e.FROM="from",e.SINE="sine",e.SQUARE="square",e.TRIANGLE="triangle",e.SAW="saw",e.SAWTOOTH="saw",e.ZAP="zap",e.DISTILL=!1,e.distillery=[],e.distill=function(){!WW.zns&&e&&(e.DISTILL||WW.DISTILL)&&e.distillery.push("83.3","83.35"),e.distillery.length>0?(e.distillery=e.distillery.filter((function(e,t,o){return o.indexOf(e)===t})),zogy("zim.distill() - go to https://zimjs.com/distill and enter the following:"),zog(e.distillery.join(" "))):zogy("must set zim.DISTILL = true;")},e.parseAudioSprite=function(e,t){if(z_d("83.25"),!(zot(e)||zot(e.resources)||zot(e.spritemap))){var o,n=e,r=n.resources[0],i=n.spritemap,a=[],l={src:r,data:{}};for(var s in i)o=i[s],a.push({id:s,startTime:Math.round(1e3*o.start),duration:Math.round(1e3*(o.end-o.start))});return l.data.audioSprite=a,t&&zogy(JSON.stringify(l)),l}},e.previewAudioSprite=function(t,o,n){if(z_d("83.26"),!zot(t)){if(zot(o)&&(o=3),void 0===n){if(zot(WW.zdf))return;n=WW.zdf}var r=n.width,i=t,a=[],l=[];if(i.constructor=={}.constructor){i.resources&&(i=e.parseAudioSprite(i)),i.audioSprite?e.loop(i.audioSprite,(function(e){a.push(e[0].substr(0,o)),l.push(e[0])})):i.data&&i.data.audioSprite&&e.loop(i.data.audioSprite,(function(e){a.push(e.id.substr(0,o)),l.push(e.id)}));var s=new e.Tabs({tabs:a,width:r,currentEnabled:!0}).addTo();return s.on("change",(function(){n.asset(l[s.selectedIndex]).play()})),s}}},e.svgToBitmap=function(t,o,n,r,i){if(z_d("83.27"),!zot(t.draggable)){var a=new DOMParser,l=(t=t.innerHTML?a.parseFromString(t.innerHTML,"text/xml"):t).getElementsByTagName("svg")?t.getElementsByTagName("svg")[0]:null;t=l}if(XMLSerializer||!zon){var s="string"==typeof t?t:(new XMLSerializer).serializeToString(t);if(s){var c=s.split(">")[0];if(c.length>1)if(1==c.split(/width/i).length){var u=100,d=100,h=c.split(/viewBox/i);if(h.length>1){var g=h[1].split('"')[1];if(g){var p=g.split(" ");p.length>1&&(u=p[p.length-2],d=p[p.length-1])}}s=s.replace(/svg /i,'svg width="'+u+'" height="'+d+'" ')}s.match(/xmlns/i)||(s=s.replace(/svg /i,"svg xmlns='http://www.w3.org/2000/svg' "))}var f=self.URL||self.webkitURL||self,m=new Image;m.onload=function(){var t=new e.Bitmap(m,n,r);o(t,i),f.revokeObjectURL(z)};var z=f.createObjectURL(new document.Blob([s],{type:"image/svg+xml"}));m.src=z}else zogy("ZIM svgToBitmap() - sorry, not supported in Browser")},e.makeContent=function(t,o,n){var r;if(z_d("83.29"),zot(n)&&(n=e.dark),"string"==typeof t||"number"==typeof t)t=this.message=new e.Label(t,null,null,n);else if(t.constructor=={}.constructor){var i=t;i.buttonScale||(i.buttonScale=.5),zot(i.spacingH)&&(i.spacingH=20*i.buttonScale),zot(i.spacingV)&&(i.spacingV=20);var a=i.spacingH,l=i.spacingV;i.align||(i.align="center"),t=new e.Container;var s=new Container(10,l).addTo(t);if(i.header&&i.header.pos(0,l,"left","top",t),i.message)var c=new e.Label(i.message,null,null,zot(i.color)?n:i.color).loc(0,t.height+(i.header?l:0),t);if(i.display&&i.display.pos(0,-i.display.height-(i.header||i.message?l:0),"left","bottom",t),i.buttons){Array.isArray(i.buttons)||(i.buttons=[i.buttons]);i.length;for(var u=(new e.Container).loc(0,t.height+(i.header||i.message||i.display?l:0),t),d=0;d<i.buttons.length;d++){var h=i.buttons[d],g=h.call||function(){};h.button||(h.button=new e.Button({width:h.width,label:h.label,backgroundColor:h.backgroundColor||h.bgColor,color:h.color,rollBackgroundColor:h.rollBackgroundColor||h.rollBgColor,rollColor:h.rollColor})),h.button.call=g,h.button.sca(i.buttonScale).loc(0==d?0:u.width+a,0,u).tap((function(e){e.target.call(e.target)}))}}for(r=0;r<t.numChildren;r++){var p=t.getChildAt(r);p.lastY=p.y,"center"==i.align?p.center(t).loc(null,p.lastY):"right"==i.align&&p.pos(0,null,"right")}if(o&&(t.width=Math.min(t.width,o-2*a-(!0===i.scrollBar?12:i.scrollBar>0?i.scrollBar:0))),new e.Container(10,l).pos(0,-s.height,"center","bottom",t).bot(),s.top(),t.config=i,t.header=i.header,t.message=c,t.text=i.message,t.display=i.display,i.buttons)for(t.buttons=[],r=0;r<u.numChildren;r++)t.buttons.push(u.getChildAt(r))}return t},e}(zim||{});function z_d(e){zim&&(zim.DISTILL||WW.DISTILL)&&zim.distillery.push(e)}function zimify(e,t){if(z_d("83.3"),e&&e.noDrag)return e;!0!==t&&(t=null);var o={drag:function(e,t,o,n,r,i,a,l,s,c,u,d,h,g,p,f){return isDUO(arguments)?(arguments[0].obj=this,zim.drag(arguments[0])):zim.drag(this,e,t,o,n,r,i,a,l,s,c,u,d,h,g,p,f)},noDrag:function(e){return zim.noDrag(this,e)},mouse:function(){return zim.mouse(this)},noMouse:function(){return zim.noMouse(this)},effect:function(e,t,o,n,r){return zim.effect(this,e,t,o,n,r)},noEffect:function(e,t){return zim.noEffect(this,e,t)},updateEffects:function(e){return zim.updateEffects(this,e)},wire:function(e,t,o,n,r,i,a){return isDUO(arguments)?(arguments[0].source=this,zim.wire(arguments[0])):zim.wire(this,e,t,o,n,r,i,a)},noWire:function(e,t,o){return isDUO(arguments)?(arguments[0].source=this,zim.noWire(arguments[0])):zim.noWire(this,e,t,o)},wired:function(e,t,o,n,r,i,a){return isDUO(arguments)?(arguments[0].target=this,zim.wired(arguments[0])):zim.wired(this,e,t,o,n,r,i,a)},noWired:function(e,t,o){return isDUO(arguments)?(arguments[0].target=this,zim.noWired(arguments[0])):zim.noWired(this,e,t,o)},bind:function(e,t,o,n,r){return isDUO(arguments)?(arguments[0].obj=this,zim.bind(arguments[0])):zim.bind(this,e,t,o,n,r)},noBind:function(e,t,o,n){return isDUO(arguments)?(arguments[0].obj=this,zim.noBind(arguments[0])):zim.noBind(this,e,t,o,n)},dragBoundary:function(e){return zim.dragBoundary(this,e)},dragRect:function(e){return zim.dragBoundary(this,e)},transform:function(e,t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P){return isDUO(arguments)?(arguments[0].obj=this,zim.transform(arguments[0])):zim.transform(this,e,t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P)},setSwipe:function(e){return zim.setSwipe(this,e)},gesture:function(e,t,o,n,r,i,a,l,s,c,u,d,h,g,p){return isDUO(arguments)?(arguments[0].obj=this,zim.gesture(arguments[0])):zim.gesture(this,e,t,o,n,r,i,a,l,s,c,u,d,h,g,p)},noGesture:function(e,t,o){return isDUO(arguments)?(arguments[0].obj=this,zim.noGesture(arguments[0])):zim.noGesture(this,e,t,o)},gestureBoundary:function(e,t){return zim.gestureBoundary(this,e,t)},gestureRect:function(e,t){return zim.gestureBoundary(this,e,t)},addPhysics:function(e,t,o,n,r,i,a,l,s,c,u){return isDUO(arguments)?(arguments[0].obj=this,zim.addPhysics(arguments[0])):zim.addPhysics(this,e,t,o,n,r,i,a,l,s,c,u)},removePhysics:function(){return zim.removePhysics(this)},hitTestPoint:function(e,t,o){return zim.hitTestPoint(this,e,t,o)},hitTestReg:function(e,t){return zim.hitTestReg(this,e,t)},hitTestRect:function(e,t,o,n){return zim.hitTestRect(this,e,t,o,n)},hitTestCircle:function(e,t,o,n){return zim.hitTestCircle(this,e,t,o,n)},hitTestCircleRect:function(e,t){return zim.hitTestCircleRect(this,e,t)},hitTestCircles:function(e,t){return zim.hitTestCircles(this,e,t)},hitTestBounds:function(e,t,o){return zim.hitTestBounds(this,e,t,o)},boundsToGlobal:function(e,t,o,n){return zim.boundsToGlobal(this,e,t,o,n)},resetBounds:function(e,t,o,n,r){return isDUO(arguments)?(arguments[0].obj=this,zim.resetBounds(arguments[0])):zim.resetBounds(this,e,t,o,n,r)},hitTestPath:function(e,t,o){return zim.hitTestPath(this,e,t,o)},hitTestGrid:function(e,t,o,n,r,i,a,l,s,c,u,d){return zim.hitTestGrid(this,e,t,o,n,r,i,a,l,s,c,u,d)},animate:function(e,t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q,U,Q,Z,K){return e&&(e.props||e.obj)&&isDUO(arguments)?(arguments[0].target=this,zim.animate(arguments[0])):zim.animate(this,e,t,o,n,r,i,a,l,s,c,u,d,h,g,p,f,m,z,y,v,b,w,C,x,k,T,A,P,B,E,I,S,W,M,O,j,L,D,_,Y,X,R,H,F,N,V,G,q,U,Q,Z,K)},pauseAnimate:function(){return this},stopAnimate:function(){return this},wiggle:function(e,t,o,n,r,i,a,l,s,c,u,d,h,g,p){return isDUO(arguments)?(arguments[0].target=this,zim.wiggle(arguments[0])):zim.wiggle(this,e,t,o,n,r,i,a,l,s,c,u,d,h,g,p)},loop:function(e,t,o,n,r){return zim.loop(this,e,t,o,n,r)},copyMatrix:function(e){return zim.copyMatrix(this,e)},duplicate:function(e){return zim.duplicate(this,e)},cur:function(e){return zim.cur(this,e)},sha:function(e,t,o,n){return zim.sha(this,e,t,o,n)},pos:function(e,t,o,n,r,i,a,l,s,c){return isDUO(arguments)?(arguments[0].obj=this,zim.pos(arguments[0])):zim.pos(this,e,t,o,n,r,i,a,l,s,c)},loc:function(e,t,o,n,r,i,a){return isDUO(arguments)?(arguments[0].obj=this,zim.loc(arguments[0])):zim.loc(this,e,t,o,n,r,i,a)},mov:function(e,t){return isDUO(arguments)?(arguments[0].obj=this,zim.mov(arguments[0])):zim.mov(this,e,t)},top:function(){return zim.top(this)},bot:function(){return zim.bot(this)},ord:function(e){return zim.ord(this,e)},dep:function(e){return zim.dep(this,e)},nam:function(e){return zim.nam(this,e)},alp:function(e){return zim.alp(this,e)},vis:function(e){return zim.vis(this,e)},ble:function(e){return zim.ble(this,e)},dye:function(e){return zim.dye(this,e)},hov:function(e,t){return zim.hov(this,e,t)},rot:function(e,t,o){return zim.rot(this,e,t,o)},siz:function(e,t,o){return zim.siz(this,e,t,o)},ske:function(e,t){return zim.ske(this,e,t)},reg:function(e,t,o){return zim.reg(this,e,t,o)},sca:function(e,t){return zim.sca(this,e,t)},scaleTo:function(e,t,o,n,r){return isDUO(arguments)?(arguments[0].obj=this,zim.scaleTo(arguments[0])):zim.scaleTo(this,e,t,o,n,r)},fit:function(e,t,o,n,r){return isDUO(arguments)?(arguments[0].obj=this,zim.fit(arguments[0])):zim.fit(this,e,t,o,n,r)},outline:function(e,t,o){return isDUO(arguments)?(arguments[0].obj=this,zim.outline(arguments[0])):zim.outline(this,e,t,o)},blendmodes:function(e){return zim.blendmodes(this,e)},addTo:function(e,t,o){return isDUO(arguments)?(arguments[0].obj=this,zim.addTo(arguments[0])):zim.addTo(this,e,t,o)},removeFrom:function(e){return zim.removeFrom(this,e)},added:function(e,t,o){return zim.added(this,e,t,o)},movement:function(e,t){return zim.movement(this,e,t)},noMovement:function(){return zim.noMovement(this)},tap:function(e,t,o,n,r,i,a,l,s){return isDUO(arguments)?(arguments[0].obj=this,zim.tap(arguments[0])):zim.tap(this,e,t,o,n,r,i,a,l,s)},noTap:function(){return zim.noTap(this)},hold:function(e,t,o,n){return zim.hold(this,e,t,o,n)},noHold:function(){return zim.noHold(this)},change:function(e,t){return zim.change(this,e,t)},noChange:function(){return zim.noChange(this)},centerReg:function(e,t,o){return isDUO(arguments)?(arguments[0].obj=this,zim.centerReg(arguments[0])):zim.centerReg(this,e,t,o)},center:function(e,t,o){return isDUO(arguments)?(arguments[0].obj=this,zim.center(arguments[0])):zim.center(this,e,t,o)},place:function(e){return zim.place(this,e)},placeReg:function(e){return zim.placeReg(this,e)},expand:function(e,t,o,n){return isDUO(arguments)?(arguments[0].obj=this,zim.expand(arguments[0])):zim.expand(this,e,t,o,n)},setMask:function(e,t){return zim.setMask(this,e,t)},cloneProps:function(e){return e.type=this.type,e.group=this.group,e.style=this.style,e.alpha=this.alpha,e.rotation=this.rotation,e.mouseEnabled=this.mouseEnabled,e.mouseChildren=this.mouseChildren,e.tickEnabled=this.tickEnabled,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.skewX=this.skewX,e.skewY=this.skewY,e.name&&(e.name=this.name),e.regX=this.regX*e.width/(this.width||1),e.regY=this.regY*e.height/(this.height||1),e.visible=this.visible,e.shadow=this.shadow,this.type&&"Shape"!=this.type||zim.copyMatrix(e,this),e.compositeOperation=this.compositeOperation,e.snapToPixel=this.snapToPixel,this.filters&&this.filters.length>0&&(e.filters=this.filters.slice(0),e.cache()),e.mask=this.mask,e.hitArea=this.hitArea,this.type&&"Shape"!=this.type&&"Blob"!=this.type&&"Squiggle"!=this.type||!this._bounds||e.setBounds(this._bounds.x,this._bounds.y,this._bounds.width,this._bounds.height),e},cloneChildren:function(e,t){e.children.length&&e.removeAllChildren();for(var o=e.children,n=0,r=this.children.length;n<r;n++){var i=this.children[n].clone(t);i.parent=e,o.push(i)}return e}};if(!zot(t)){for(var n in t=[],o)t.push(n);return t}for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);return zim&&(e.cjsLocalToGlobal=e.localToGlobal,e.cjsGlobalToLocal=e.globalToLocal,e.cjsLocalToLocal=e.localToLocal,e.localToGlobal=function(t,o){return zim.localToGlobal(t,o,e,e.cjsLocalToGlobal)},e.globalToLocal=function(t,o){return zim.globalToLocal(t,o,e,e.cjsGlobalToLocal)},e.localToLocal=function(t,o,n){return zim.localToLocal(t,o,n,e)},e.hueBatch||zim.displayBase(e)),e}function zimplify(e){z_d("83.35"),document.Window=Window,document.Blob=Blob,ignore="ignore",zot(e)&&(e=[]),Array.isArray(e)||(e=[e]);var t=zimify(null,!0),o=["loop","stopAnimate","pauseAnimate","animate","wiggle","wire","wired"];for(var n in zim)(-1==t.indexOf(n)||o.indexOf(n)>=0)&&-1==e.indexOf(n)&&(window[n]=zim[n])}zim.fastFrame=function(e,t){if(z_d("83.355"),createjs=e,zot(WW.zdf))return t.frame=new zim.Frame({shim:{stage:t,canvas:t.canvas}}),WW.zimDefaultFrame=WW.zdf=t.frame,zim.scaX=createjs.stageTransformable?1:t.scaleX,zim.scaY=createjs.stageTransformable?1:t.scaleY,t.frame},zim.addWires=function(e){return z_d("83.365"),e.wire=function(){return Array.prototype.unshift.call(arguments,e),zim.wire.apply(null,arguments),e},e.noWire=function(){return Array.prototype.unshift.call(arguments,e),zim.noWire.apply(null,arguments),e},e.wired=function(){return Array.prototype.unshift.call(arguments,e),zim.wired.apply(null,arguments),e},e.noWired=function(){return Array.prototype.unshift.call(arguments,e),zim.noWired.apply(null,arguments),e},e},zim.setBlurDetect=function(){z_d("83.36"),zim.blurCheck=!0,zim.pauseAnimateOnBlur=!0,zim.pauseOnBlur=[],zim.blurDetect=function(){var e,t,o={hidden:"visibilitychange",webkitHidden:"webkitvisibilitychange",mozHidden:"mozvisibilitychange",msHidden:"msvisibilitychange"};for(e in o)if(e in document){t=o[e];break}return function(o){return o&&document.addEventListener(t,o),!document[e]}}(),zim.blurDetect((function(){var e,t,o;if(zim.blurDetect())setTimeout((function(){if(zim.pauseOnBlur)for(e=0;e<zim.pauseOnBlur.length;e++)(t=zim.pauseOnBlur[e]).pauseOnBlurPaused||t.pause(!1);if(zim.pauseAnimateOnBlur&&zim.animatedObjects)for(e=0;e<zim.animatedObjects.objects.length;e++){t=zim.animatedObjects.objects[e];var n=zim.copy(t.tweenStates);if(t.tweenStates)if(zot(n.all)||n.all){if(t.pauseAnimate(!1),!t.dynamicAnimation)for(o in n)"all"!=o&&!1===n[o]&&t.pauseAnimate(!0,o)}else for(o in t.pauseAnimate(!0),n)"all"!=o&&n[o]&&t.pauseAnimate(!1,o);else t.pauseAnimate(!1);"Sprite"==t.type&&(t.paused=!0)}}),300),WW.zdf&&WW.zdf.dispatchEvent("tabfocus");else{if(zim.pauseOnBlur)for(e=0;e<zim.pauseOnBlur.length;e++)(t=zim.pauseOnBlur[e]).pauseOnBlurPaused=t.paused,t.pause(!0);zim.pauseAnimateOnBlur&&zim.animatedObjects&&zim.pauseAnimate(!0,"pauseOnBlur"),WW.zdf&&WW.zdf.dispatchEvent("tabblur")}}))};var ZIMONON=!1;zim=function(e){return e.ZIMON={stringify:function(t,o){if(z_d("83.39"),!zot(t)){if(ZIMONON)return function n(r,i,a){if(zot(r))return;if(Array.isArray(r))e.loop(r,(function(e,t){n(e,r,t)}));else if(r.constructor=={}.constructor)e.loop(r,(function(e,t){n(t,r,e)}));else if(r.type){var l={zimon:r.type};r.arguments&&(l.args=Array.prototype.slice.call(r.arguments),n(l.args)),"series"==r.type&&(l.args=Array.prototype.slice.call(r.array),n(l.args)),o&&o[r.type]&&o[r.type].props&&(l.props=[],e.loop(o[r.type].props,(function(e){l.props.push(r[e])}))),i?i[a]=l:t=l}else"string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r&&null!==r&&zon&&zogy("ZIMON - potentially bad JSON value"+r)}(t=e.copy(t)),JSON.stringify({obj:t,key:o,zimon:1,info:"https://zimjs.com/zimon/"});zon&&zogy("ZIMON - set ZIMONON=true before using ZIMON.stringify()")}},parse:function(t,o){if(z_d("83.39"),!zot(t)){var n=JSON.parse(t),r=n.obj;return o=n.key,function t(n,i,a){if(zot(n))return;if(Array.isArray(n))e.loop(n,(function(e,o){t(e,n,o)}));else if(zot(n.zimon)&&n.constructor=={}.constructor)e.loop(n,(function(e,o){t(o,n,e)}));else if(n.zimon){var l=n.zimon,s="";o&&(o[l]&&o[l].scope?s=o[l].scope+".":o.scope&&(s=o.scope+"."));var c,u=function(e){try{return Function("return("+e+")")()}catch(t){return zon&&zogy("ZIMON - bad function scope or name: "+e),null}}(s+l),d=n.args;zot(d)&&(d=[]),t(d),c="series"==n.type?e.series(d):u?new(u.bind.apply(u,[null].concat(Array.prototype.slice.call(d)))):null,i?i[a]=c:r=c,o&&o[l]&&o[l].props&&c&&e.loop(o[l].props,(function(e,t){zot(n.props[t])||(c[e]=n.props[t])}))}}(r),r}}},e.Wonder=function(t,o,n,r,i){var a,l="wid, client, app, notes, server";if(a=zob(e.Wonder,arguments,l,this))return a;if(z_d("82"),zot(t))zogy("zim.Wonder() - please provide Wonder ID (see https://zimjs.com/wonder/)");else{zot(i)&&(i="https://wonder.zimjs.org/wonder");var s=this;zot(e.wonderSession)&&(e.wonderSession="W"+e.rand(1e5,999999));var c,u=[],d=setInterval(m,1e3),h=0,g=setInterval((function(){h>28&&(u.push({id:t,c:o,a:n,n:r,k:c,t:"e",v:"frequency max - terminated",s:e.wonderSession}),zogy("zim.Wonder() - frequency max - terminated"),s.dispose()),h=0}),3e4);this.countsOff={},this.timesOff={},this.ordersOff={},this.count=function(i){z(i,"count")&&(c=i,u.push({id:t,c:o,a:n,n:r,k:i,t:"c",v:1,s:e.wonderSession}))};var p={};this.timeStart=function(e){z(e,"time")&&(s.timeEnd(e),c=e,p[e]=(new Date).getTime())};var f={};this.timePause=function(e){z(e,"time")&&(f[e]||(f[e]=(new Date).getTime()))},this.timeUnpause=function(e){if(z(e,"time")&&f[e]){var t=(new Date).getTime()-f[e];p[e]&&(p[e]+=t),delete f[e]}},this.timeEnd=function(i){if(z(i,"time")&&p[i]){var a=f[i]?f[i]:(new Date).getTime(),l=Math.round((a-p[i])/1e3);delete f[i],delete p[i],u.push({id:t,c:o,a:n,n:r,k:i,t:"t",v:l,s:e.wonderSession})}},this.order=function(i,a){z(i,"order")&&(c=i,zot(a)?zogy("zim.Wonder order() - please provide an item"):u.push({id:t,c:o,a:n,n:r,k:i,t:"o",v:a,s:e.wonderSession}))},this.countOff=function(e){s.countsOff[e]=1},this.countOn=function(e){delete s.countOff[e]},this.timeOff=function(e){s.timesOff[e]=1},this.timeOn=function(e){delete s.timesOff[e]},this.orderOff=function(e){s.ordersOff[e]=1},this.orderOn=function(e){delete s.ordersOff[e]},this.dispose=function(){return m(),clearInterval(d),clearInterval(g),!0}}function m(){u.length>0&&(e.async(i+"?wonder="+JSON.stringify(u)),u=[],h++)}function z(e,t){return zot(e)?(zogy("zim.Wonder "+t+" - please provide a keyword"),!1):!s[t+"sOff"][e]}},e.VERSION="zim/00/zim",e.getLatestVersions=function(t){z_d("82.2");e.async("https://zimjs.com/live/getLatestVersions.php",(function(e){t(JSON.parse(e))}),"returnLatestVersions")},e.PWA=function(t,o,n,r,i,a,l){var s,c,u="call, label, backgroundColor, color, backdropColor, pane, noScale";if(s=zob(e.PWA,arguments,u,this))return s;z_d("82.4"),this.cjsEventDispatcher_constructor(),this.type="PWA";var d=this;function h(){this.pane=c=a.show(),c.on("close",(function(){t&&t.constructor===Function&&t(),d.scaleEvent&&e.off("resize",d.scaleEvent),d.dispatchEvent("ready")}));var e=e||WW.zdf;e&&!l&&(c.scaleTo(e.stage,105).center(),"full"!=e.scaling&&"tag"!=e.scaling||(d.scaleEvent=e.on("resize",(function(){c.scaleTo(e.stage,105).center()}))),e.stage.update())}zot(o)&&(o=new e.Label({text:"Please add to home screen as an app",align:e.LEFT,lineHeight:44,color:r})),zot(n)&&(n=e.yellow),zot(a)&&((a=new e.Pane({width:1200,height:230,label:o,backgroundColor:n,backdropColor:i})).label.align=e.LEFT,a.label.center(),a.label.mov(40),(new e.Shape).s(e.dark).ss(3,1,0,3).p("AAAj0IAAFJAA8hoIBuAAIAAFdIlTAAIAAldIBuAA").sca(1.6).center(a).mov(-a.label.width/2-20,-10),(new e.Shape).s(e.dark).ss(3,1,0,3).p("AhGAlIBGhGIBHBG").sca(1.6).center(a).mov(-a.label.width/2-20,-48)),M&&!(WW.matchMedia("(display-mode: standalone)").matches||WW.navigator.standalone||document.referrer.includes("android-app://"))?h():(t&&t.constructor===Function&&t(),setTimeout((function(){d.dispatchEvent("ready")}),20)),this.show=function(){return h(),this}},e.extend(e.PWA,createjs.EventDispatcher,null,"cjsEventDispatcher",!1),e.QR=function(t,o,n,r,i,a){var l,s="url, color, backgroundColor, size, clickable, correctLevel";if(l=zob(e.QR,arguments,s,this))return l;z_d("82.5"),zot(t)&&(t="https://zimjs.com"),zot(r)&&(r=256),zot(o)&&(o=e.black),zot(n)&&(n=e.white),zot(i)&&(i=!0),zot(a)&&(a=2);var c=document.createElement("div");if("undefined"!=typeof QRCode){var u=new QRCode(c,{text:t,width:r,height:r,colorDark:o,colorLight:n,correctLevel:a});this.zimBitmap_constructor(u._oDrawing._oContext.canvas),i&&this.cur().on("click",(function(){zgo(t,"_blank")})),c=null}else zogy("ZIM QR - needs qrcode.js library - see docs")},e.extend(e.QR,e.Bitmap,null,"zimBitmap",!1),e.GIF=function(t,o,n,r){var i,a="url";if(i=zob(e.GIF,arguments,a,this))return i;if(z_d("82.7"),"undefined"!=typeof gifler){zot(o)&&(o=100),zot(n)&&(n=100);var l,s,c,u=this;if(u.paused=!1,this.zimBitmap_constructor(null,o,n),this.cache(),null!=WW.PATH&&(e.PATH=WW.PATH),c=t.match(/http/)||t.match(/^\//)?t:(e.PATH?e.PATH:"")+t,u.gifler=gifler(c).animate(this.cacheCanvas).then((function(e){u.animator=e,r&&(l=setInterval((function(){u.animator.running()&&(s=setTimeout((function(){u.animator.stop(),u.paused=!0}),.1),clearInterval(l))}),.05))})),!u.ticker)if(u.keyObj){var d=u.keyObj.color,h=u.keyObj.tolerance,g=u.keyObj.replacement;u.ticker=e.Ticker.add((function(){u.keyOut(d,h,g)}))}else u.ticker=e.Ticker.add((function(){}));u.keyOut=function(t,o,n){return u.ticker?(e.Ticker.remove(u.ticker),u.ticker=e.Ticker.add((function(){u.keyOut(t,o,n)}))):u.keyObj={color:t,tolerance:o,replacement:n},u},this.pause=function(t){return zot(t)&&(t=!0),u.animator&&(l&&clearInterval(l),s&&clearTimeout(s),t&&u.animator.running()?(u.animator.stop(),e.Ticker.remove(u.ticker)):t||u.animator.running()||(u.animator.start(),e.Ticker.add(u.ticker))),u.paused=t,u},this.stop=function(){u.dispose()},this.reset=function(){return u.animator.reset(),u.paused&&(u.animator.start(),e.Ticker.add(u.ticker)),u},this.clone=function(){return this.cloneProps(new e.GIF(t,o,n,r))},this.dispose=function(){u.animator.stop(),u.parent&&u.removeFrom(),e.Ticker.remove(u.ticker),e.gD(this)}}else zogy("ZIM GIF - needs gifler.js library - see docs")},e.extend(e.GIF,e.Bitmap,["clone","dispose","keyOut"],"zimBitmap",!1),e}(zim||{}),zns||zimplify();