mosaico 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (425) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/Gemfile +7 -0
  4. data/LICENSE +680 -0
  5. data/README.md +179 -0
  6. data/Rakefile +5 -0
  7. data/app/assets/images/mosaico/logo_transparent.png +0 -0
  8. data/app/assets/javascripts/mosaico/application.js.erb +51 -0
  9. data/app/assets/javascripts/mosaico/plugins/debug.js.erb +10 -0
  10. data/app/assets/javascripts/mosaico/plugins/logo.js.erb +10 -0
  11. data/app/assets/javascripts/mosaico/plugins/preview.js +85 -0
  12. data/app/assets/javascripts/mosaico/plugins/save.js.erb +72 -0
  13. data/app/assets/javascripts/mosaico/plugins/template_path.js.erb +22 -0
  14. data/app/assets/javascripts/mosaico/plugins/translations.js +10 -0
  15. data/app/assets/javascripts/mosaico/utilities.js +25 -0
  16. data/app/assets/stylesheets/mosaico/application.css +6 -0
  17. data/app/controllers/mosaico/application_controller.rb +17 -0
  18. data/app/controllers/mosaico/images_controller.rb +142 -0
  19. data/app/controllers/mosaico/projects_controller.rb +31 -0
  20. data/app/controllers/mosaico/templates_controller.rb +8 -0
  21. data/app/helpers/mosaico/application_helper.rb +7 -0
  22. data/app/models/mosaico/image.rb +9 -0
  23. data/app/models/mosaico/placeholder_image.rb +9 -0
  24. data/app/models/mosaico/project.rb +13 -0
  25. data/app/models/mosaico/uploaded_image.rb +26 -0
  26. data/app/views/layouts/mosaico/application.html.erb +13 -0
  27. data/app/views/mosaico/projects/new.html.erb +1 -0
  28. data/app/views/mosaico/projects/show.html.erb +1 -0
  29. data/app/views/mosaico/shared/_metadata.html.erb +12 -0
  30. data/config/routes.rb +12 -0
  31. data/db/migrate/20170817202255_add_images.rb +14 -0
  32. data/db/migrate/20170824233755_add_projects.rb +11 -0
  33. data/lib/mosaico.rb +100 -0
  34. data/lib/mosaico/engine.rb +72 -0
  35. data/lib/mosaico/local_backend.rb +23 -0
  36. data/lib/mosaico/local_image_backend.rb +7 -0
  37. data/lib/mosaico/local_placeholder_backend.rb +7 -0
  38. data/lib/mosaico/placeholder.png +0 -0
  39. data/lib/mosaico/template.rb +89 -0
  40. data/lib/mosaico/versafix_template.rb +43 -0
  41. data/lib/mosaico/version.rb +4 -0
  42. data/lib/tasks/makeThumbs.js.erb +57 -0
  43. data/lib/tasks/thumbs.rake +35 -0
  44. data/mosaico.gemspec +22 -0
  45. data/screenshot.png +0 -0
  46. data/vendor/assets/fonts/LiberationSans-Regular.ttf +0 -0
  47. data/vendor/assets/mosaico-0.16.0/mosaico/.jsbeautifyrc +6 -0
  48. data/vendor/assets/mosaico-0.16.0/mosaico/.jshintrc +8 -0
  49. data/vendor/assets/mosaico-0.16.0/mosaico/.travis.yml +6 -0
  50. data/vendor/assets/mosaico-0.16.0/mosaico/CONTRIBUTING.md +37 -0
  51. data/vendor/assets/mosaico-0.16.0/mosaico/Dockerfile +21 -0
  52. data/vendor/assets/mosaico-0.16.0/mosaico/Gruntfile.js +241 -0
  53. data/vendor/assets/mosaico-0.16.0/mosaico/LICENSE +680 -0
  54. data/vendor/assets/mosaico-0.16.0/mosaico/NOTICE.txt +87 -0
  55. data/vendor/assets/mosaico-0.16.0/mosaico/README.md +73 -0
  56. data/vendor/assets/mosaico-0.16.0/mosaico/backend/README.txt +23 -0
  57. data/vendor/assets/mosaico-0.16.0/mosaico/backend/main.js +162 -0
  58. data/vendor/assets/mosaico-0.16.0/mosaico/bower.json +76 -0
  59. data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico-material.css +7425 -0
  60. data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.css +7133 -0
  61. data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.debug.js +1517 -0
  62. data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.js +12828 -0
  63. data/vendor/assets/mosaico-0.16.0/mosaico/build/templates.js +15 -0
  64. data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.eot +0 -0
  65. data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.svg +685 -0
  66. data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.ttf +0 -0
  67. data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.woff +0 -0
  68. data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.woff2 +0 -0
  69. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/byvoxmail.png +0 -0
  70. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico-badge.gif +0 -0
  71. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico-v.gif +0 -0
  72. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico32.png +0 -0
  73. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaicologo.png +0 -0
  74. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/screenshot-orig.png +0 -0
  75. data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/screenshot.png +0 -0
  76. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/README.md +26 -0
  77. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-de.json +88 -0
  78. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-en.json +88 -0
  79. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-es.json +88 -0
  80. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-fr.json +88 -0
  81. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-it.json +88 -0
  82. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-nl.json +88 -0
  83. data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-sv.json +88 -0
  84. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico-material.min.css +5 -0
  85. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico-material.min.css.map +1 -0
  86. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.css +5 -0
  87. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.css.map +1 -0
  88. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.js +1517 -0
  89. data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.js.map +147 -0
  90. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/canvas-to-blob.min.js +2 -0
  91. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery-ui.min.css +7 -0
  92. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery-ui.min.js +13 -0
  93. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-image.js +324 -0
  94. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-process.js +175 -0
  95. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-validate.js +122 -0
  96. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload.js +1482 -0
  97. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.iframe-transport.js +217 -0
  98. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.min.js +5 -0
  99. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.min.map +1 -0
  100. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.ui.touch-punch.min.js +11 -0
  101. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/knockout-jqueryui.min.js +1 -0
  102. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/knockout.js +123 -0
  103. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/load-image.all.min.js +2 -0
  104. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.eot +0 -0
  105. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.ttf +0 -0
  106. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.woff +0 -0
  107. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/stylesheet.css +9 -0
  108. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/advlist/plugin.js +101 -0
  109. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/advlist/plugin.min.js +1 -0
  110. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/anchor/plugin.js +55 -0
  111. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/anchor/plugin.min.js +1 -0
  112. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autolink/plugin.js +204 -0
  113. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autolink/plugin.min.js +1 -0
  114. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autoresize/plugin.js +162 -0
  115. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autoresize/plugin.min.js +1 -0
  116. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autosave/plugin.js +165 -0
  117. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autosave/plugin.min.js +1 -0
  118. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/bbcode/plugin.js +123 -0
  119. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/bbcode/plugin.min.js +1 -0
  120. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/charmap/plugin.js +462 -0
  121. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/charmap/plugin.min.js +1 -0
  122. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/code/plugin.js +60 -0
  123. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/code/plugin.min.js +1 -0
  124. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/css/prism.css +138 -0
  125. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/plugin.js +1319 -0
  126. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/plugin.min.js +1 -0
  127. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/colorpicker/plugin.js +112 -0
  128. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/colorpicker/plugin.min.js +1 -0
  129. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/contextmenu/plugin.js +100 -0
  130. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/contextmenu/plugin.min.js +1 -0
  131. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/directionality/plugin.js +64 -0
  132. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/directionality/plugin.min.js +1 -0
  133. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-cool.gif +0 -0
  134. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-cry.gif +0 -0
  135. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-embarassed.gif +0 -0
  136. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
  137. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-frown.gif +0 -0
  138. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-innocent.gif +0 -0
  139. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-kiss.gif +0 -0
  140. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-laughing.gif +0 -0
  141. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
  142. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-sealed.gif +0 -0
  143. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-smile.gif +0 -0
  144. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-surprised.gif +0 -0
  145. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
  146. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-undecided.gif +0 -0
  147. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-wink.gif +0 -0
  148. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-yell.gif +0 -0
  149. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/plugin.js +65 -0
  150. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/plugin.min.js +1 -0
  151. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullpage/plugin.js +490 -0
  152. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullpage/plugin.min.js +1 -0
  153. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullscreen/plugin.js +154 -0
  154. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullscreen/plugin.min.js +1 -0
  155. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/hr/plugin.js +30 -0
  156. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/hr/plugin.min.js +1 -0
  157. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/image/plugin.js +630 -0
  158. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/image/plugin.min.js +1 -0
  159. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/imagetools/plugin.js +2944 -0
  160. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/imagetools/plugin.min.js +1 -0
  161. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/importcss/plugin.js +273 -0
  162. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/importcss/plugin.min.js +1 -0
  163. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/insertdatetime/plugin.js +121 -0
  164. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/insertdatetime/plugin.min.js +1 -0
  165. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/layer/plugin.js +225 -0
  166. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/layer/plugin.min.js +1 -0
  167. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/legacyoutput/plugin.js +208 -0
  168. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/legacyoutput/plugin.min.js +1 -0
  169. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/link/plugin.js +403 -0
  170. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/link/plugin.min.js +1 -0
  171. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/lists/plugin.js +965 -0
  172. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/lists/plugin.min.js +1 -0
  173. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/moxieplayer.swf +0 -0
  174. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/plugin.js +879 -0
  175. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/plugin.min.js +1 -0
  176. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/nonbreaking/plugin.js +53 -0
  177. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/nonbreaking/plugin.min.js +1 -0
  178. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/noneditable/plugin.js +101 -0
  179. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/noneditable/plugin.min.js +1 -0
  180. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/pagebreak/plugin.js +88 -0
  181. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/pagebreak/plugin.min.js +1 -0
  182. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/paste/plugin.js +1844 -0
  183. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/paste/plugin.min.js +1 -0
  184. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/preview/plugin.js +101 -0
  185. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/preview/plugin.min.js +1 -0
  186. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/print/plugin.js +32 -0
  187. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/print/plugin.min.js +1 -0
  188. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/save/plugin.js +98 -0
  189. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/save/plugin.min.js +1 -0
  190. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/searchreplace/plugin.js +609 -0
  191. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/searchreplace/plugin.min.js +1 -0
  192. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/spellchecker/plugin.js +1031 -0
  193. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/spellchecker/plugin.min.js +1 -0
  194. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/tabfocus/plugin.js +120 -0
  195. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/tabfocus/plugin.min.js +1 -0
  196. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/table/plugin.js +4400 -0
  197. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/table/plugin.min.js +2 -0
  198. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/template/plugin.js +276 -0
  199. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/template/plugin.min.js +1 -0
  200. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textcolor/plugin.js +297 -0
  201. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textcolor/plugin.min.js +1 -0
  202. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textpattern/plugin.js +268 -0
  203. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textpattern/plugin.min.js +1 -0
  204. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/css/visualblocks.css +135 -0
  205. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/plugin.js +86 -0
  206. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/plugin.min.js +1 -0
  207. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualchars/plugin.js +123 -0
  208. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualchars/plugin.min.js +1 -0
  209. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.js +69 -0
  210. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.min.js +1 -0
  211. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/Variables.less +196 -0
  212. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/content.inline.min.css +1 -0
  213. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/content.min.css +1 -0
  214. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/readme.md +1 -0
  215. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.eot +0 -0
  216. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.json +1277 -0
  217. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.svg +63 -0
  218. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.ttf +0 -0
  219. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.woff +0 -0
  220. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.eot +0 -0
  221. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.json +1972 -0
  222. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.svg +98 -0
  223. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.ttf +0 -0
  224. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.woff +0 -0
  225. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/anchor.gif +0 -0
  226. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/loader.gif +0 -0
  227. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/object.gif +0 -0
  228. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/trans.gif +0 -0
  229. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.ie7.min.css +1 -0
  230. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.json +79 -0
  231. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.min.css +1 -0
  232. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/content.inline.min.css +1 -0
  233. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/content.min.css +1 -0
  234. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.eot +0 -0
  235. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.svg +63 -0
  236. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  237. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.woff +0 -0
  238. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.eot +0 -0
  239. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.svg +129 -0
  240. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.ttf +0 -0
  241. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.woff +0 -0
  242. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/anchor.gif +0 -0
  243. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/loader.gif +0 -0
  244. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/object.gif +0 -0
  245. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/trans.gif +0 -0
  246. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/skin.ie7.min.css +1 -0
  247. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/skin.min.css +1 -0
  248. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/inlite/theme.js +1828 -0
  249. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/inlite/theme.min.js +1 -0
  250. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/modern/theme.js +934 -0
  251. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/modern/theme.min.js +1 -0
  252. data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/tinymce.min.js +14 -0
  253. data/vendor/assets/mosaico-0.16.0/mosaico/editor.html +63 -0
  254. data/vendor/assets/mosaico-0.16.0/mosaico/favicon.ico +0 -0
  255. data/vendor/assets/mosaico-0.16.0/mosaico/index.html +368 -0
  256. data/vendor/assets/mosaico-0.16.0/mosaico/package.json +92 -0
  257. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/byvoxmail.png +0 -0
  258. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico-badge.gif +0 -0
  259. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico-v.gif +0 -0
  260. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico32.png +0 -0
  261. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaicologo.png +0 -0
  262. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/screenshot-orig.png +0 -0
  263. data/vendor/assets/mosaico-0.16.0/mosaico/res/img/screenshot.png +0 -0
  264. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/README.md +26 -0
  265. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-de.json +88 -0
  266. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-en.json +88 -0
  267. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-es.json +88 -0
  268. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-fr.json +88 -0
  269. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-it.json +88 -0
  270. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-nl.json +88 -0
  271. data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-sv.json +88 -0
  272. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/Variables.less +196 -0
  273. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/content.inline.min.css +1 -0
  274. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/content.min.css +1 -0
  275. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/readme.md +1 -0
  276. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.eot +0 -0
  277. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.json +1277 -0
  278. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.svg +63 -0
  279. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.ttf +0 -0
  280. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.woff +0 -0
  281. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.eot +0 -0
  282. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.json +1972 -0
  283. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.svg +98 -0
  284. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.ttf +0 -0
  285. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.woff +0 -0
  286. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/anchor.gif +0 -0
  287. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/loader.gif +0 -0
  288. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/object.gif +0 -0
  289. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/trans.gif +0 -0
  290. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.ie7.min.css +1 -0
  291. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.json +79 -0
  292. data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.min.css +1 -0
  293. data/vendor/assets/mosaico-0.16.0/mosaico/server-config.js +12 -0
  294. data/vendor/assets/mosaico-0.16.0/mosaico/spec/converter-spec.js +115 -0
  295. data/vendor/assets/mosaico-0.16.0/mosaico/spec/data/template-versafix-1.model.json +137 -0
  296. data/vendor/assets/mosaico-0.16.0/mosaico/spec/declarations-spec.js +282 -0
  297. data/vendor/assets/mosaico-0.16.0/mosaico/spec/mensch-spec.js +114 -0
  298. data/vendor/assets/mosaico-0.16.0/mosaico/spec/model-spec.js +88 -0
  299. data/vendor/assets/mosaico-0.16.0/mosaico/spec/stylesheet-spec.js +177 -0
  300. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/app_standalone.less +7 -0
  301. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/app_standalone_material.less +350 -0
  302. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/safarihack.css +17 -0
  303. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements.less +497 -0
  304. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_jquery.less +344 -0
  305. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_mixins.less +406 -0
  306. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_moxie.less +130 -0
  307. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico.less +529 -0
  308. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico_content.less +391 -0
  309. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico_tools.less +1043 -0
  310. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_reset.less +45 -0
  311. data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_variables.less +156 -0
  312. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/app.js +167 -0
  313. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/bind-iframe.js +64 -0
  314. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/blocks.js +118 -0
  315. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/choose-template.js +7 -0
  316. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/colorpicker.js +58 -0
  317. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/csstext.js +16 -0
  318. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/droppable.js +87 -0
  319. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/eventable.js +33 -0
  320. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/extender-pagination.js +60 -0
  321. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/extsortables.js +103 -0
  322. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/fileupload.js +373 -0
  323. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/if-subs.js +110 -0
  324. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/jqueryui-spinner.js +31 -0
  325. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/jqueryui-tabs.js +17 -0
  326. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/script-template.js +30 -0
  327. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/scrollfix.js +48 -0
  328. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/scrollintoview.js +83 -0
  329. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/string-template.js +76 -0
  330. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/tooltips.js +36 -0
  331. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/validated-value.js +40 -0
  332. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/virtuals.js +102 -0
  333. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/wysiwygs.js +304 -0
  334. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/checkmodel.js +114 -0
  335. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/declarations.js +279 -0
  336. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/domutils.js +93 -0
  337. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/editor.js +411 -0
  338. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/main.js +42 -0
  339. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/model.js +536 -0
  340. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/parser.js +485 -0
  341. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/stylesheet.js +205 -0
  342. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/utils.js +156 -0
  343. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/wrapper.js +308 -0
  344. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/color.js +53 -0
  345. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/inliner.js +35 -0
  346. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/localstorage.js +100 -0
  347. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ko-bindings.js +22 -0
  348. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/template-loader.js +446 -0
  349. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/timed-call.js +31 -0
  350. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/undomanager/undomain.js +49 -0
  351. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/undomanager/undoserializer.js +120 -0
  352. data/vendor/assets/mosaico-0.16.0/mosaico/src/js/viewmodel.js +595 -0
  353. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/array.tmpl.html +1 -0
  354. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/block-show.tmpl.html +1 -0
  355. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/block-wysiwyg.tmpl.html +18 -0
  356. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/blocks-show.tmpl.html +1 -0
  357. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/blocks-wysiwyg.tmpl.html +2 -0
  358. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/customstyle.tmpl.html +3 -0
  359. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/empty.tmpl.html +0 -0
  360. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/error.tmpl.html +1 -0
  361. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/gallery-images.tmpl.html +16 -0
  362. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/img-wysiwyg.tmpl.html +43 -0
  363. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/main.tmpl.html +102 -0
  364. data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/toolbox.tmpl.html +111 -0
  365. data/vendor/assets/mosaico-0.16.0/mosaico/tasks/combineKOTemplates.js +24 -0
  366. data/vendor/assets/mosaico-0.16.0/mosaico/tasks/lib/phantom-thumbnailer-editor.js +168 -0
  367. data/vendor/assets/mosaico-0.16.0/mosaico/tasks/makeThumbs.js +79 -0
  368. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/README.md +1 -0
  369. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/_full.png +0 -0
  370. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/footerBlock.png +0 -0
  371. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/headerBlock.png +0 -0
  372. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/heroBlock.png +0 -0
  373. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/socialBlock.png +0 -0
  374. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/threetwoBlock.png +0 -0
  375. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/twoColumnBlock.png +0 -0
  376. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/template-tedc15.html +567 -0
  377. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/HeaderAndText.png +0 -0
  378. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/_full.png +0 -0
  379. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/fixedlist.png +0 -0
  380. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/mosaico-tutorial.md +335 -0
  381. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/mosaico-tutorial.pdf +0 -0
  382. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_384.jpg +0 -0
  383. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_385.jpg +0 -0
  384. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_386.jpg +0 -0
  385. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_387.jpg +0 -0
  386. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_407.jpg +0 -0
  387. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_408.jpg +0 -0
  388. data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/template-tutorial.html +68 -0
  389. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/_full.png +0 -0
  390. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/buttonBlock.png +0 -0
  391. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/doubleArticleBlock.png +0 -0
  392. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/doubleImageBlock.png +0 -0
  393. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/hrBlock.png +0 -0
  394. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/imageBlock.png +0 -0
  395. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/logoBlock.png +0 -0
  396. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/sideArticleBlock.png +0 -0
  397. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/singleArticleBlock.png +0 -0
  398. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/socialBlock.png +0 -0
  399. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/spacerBlock.png +0 -0
  400. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/textBlock.png +0 -0
  401. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/titleBlock.png +0 -0
  402. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/tripleArticleBlock.png +0 -0
  403. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/tripleImageBlock.png +0 -0
  404. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/facebook_bw_ok.png +0 -0
  405. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/facebook_ok.png +0 -0
  406. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/flickr_bw_ok.png +0 -0
  407. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/flickr_ok.png +0 -0
  408. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/google+_bw_ok.png +0 -0
  409. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/google+_ok.png +0 -0
  410. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/instagram_bw_ok.png +0 -0
  411. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/instagram_ok.png +0 -0
  412. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/linkedin_bw_ok.png +0 -0
  413. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/linkedin_ok.png +0 -0
  414. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/twitter_bw_ok.png +0 -0
  415. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/twitter_ok.png +0 -0
  416. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/vimeo_bw_ok.png +0 -0
  417. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/vimeo_ok.png +0 -0
  418. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/web_bw_ok.png +0 -0
  419. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/web_ok.png +0 -0
  420. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/youtube_bw_ok.png +0 -0
  421. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/youtube_ok.png +0 -0
  422. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/sponsor.gif +0 -0
  423. data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/template-versafix-1.html +1531 -0
  424. data/vendor/assets/mosaico-0.16.0/mosaico/uploads/README.md +1 -0
  425. metadata +536 -0
@@ -0,0 +1,1517 @@
1
+ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Mosaico = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
+ (function (global){
3
+ function log(){}function info(){console.log.apply(console,arguments)}function warn(){console.log.apply(console,arguments)}function error(){console.warn.apply(console,arguments)}function time(e){times[e]=Date.now()}function timeEnd(e){var t=times[e];if(!t)throw new Error("No such label: "+e);var o=Date.now()-t;console.log(e+": "+o+"ms")}function trace(){var e=new Error;e.name="Trace",e.message=util.format.apply(null,arguments),console.error(e.stack)}function dir(e){console.log(util.inspect(e)+"\n")}function assert(e){if(!e){var t=slice.call(arguments,1);assert.ok(!1,util.format.apply(null,t))}}var util=require("util"),assert=require("assert"),slice=Array.prototype.slice,console,times={};console="undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};for(var functions=[[log,"log"],[info,"info"],[warn,"warn"],[error,"error"],[time,"time"],[timeEnd,"timeEnd"],[trace,"trace"],[dir,"dir"],[assert,"assert"]],i=0;i<functions.length;i++){var tuple=functions[i],f=tuple[0],name=tuple[1];console[name]||(console[name]=f)}module.exports=console;
4
+
5
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
6
+
7
+ },{"assert":21,"util":26}],2:[function(require,module,exports){
8
+ !function(e){var t=0,o=window.navigator.userAgent,n=o.indexOf("MSIE ")>0,i=n?"-ie":"",a=n?!1:/mozilla/.test(o.toLowerCase())&&!/webkit/.test(o.toLowerCase()),r=[],l=["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646"],s=["f2f2f2","7f7f7f","ddd9c3","c6d9f0","dbe5f1","f2dcdb","ebf1dd","e5e0ec","dbeef3","fdeada","d8d8d8","595959","c4bd97","8db3e2","b8cce4","e5b9b7","d7e3bc","ccc1d9","b7dde8","fbd5b5","bfbfbf","3f3f3f","938953","548dd4","95b3d7","d99694","c3d69b","b2a2c7","92cddc","fac08f","a5a5a5","262626","494429","17365d","366092","953734","76923c","5f497a","31859b","e36c09","7f7f7f","0c0c0c","1d1b10","0f243e","244061","632423","4f6128","3f3151","205867","974806"],d=["c00000","ff0000","ffc000","ffff00","92d050","00b050","00b0f0","0070c0","002060","7030a0"],u=[["003366","336699","3366cc","003399","000099","0000cc","000066"],["006666","006699","0099cc","0066cc","0033cc","0000ff","3333ff","333399"],["669999","009999","33cccc","00ccff","0099ff","0066ff","3366ff","3333cc","666699"],["339966","00cc99","00ffcc","00ffff","33ccff","3399ff","6699ff","6666ff","6600ff","6600cc"],["339933","00cc66","00ff99","66ffcc","66ffff","66ccff","99ccff","9999ff","9966ff","9933ff","9900ff"],["006600","00cc00","00ff00","66ff99","99ffcc","ccffff","ccccff","cc99ff","cc66ff","cc33ff","cc00ff","9900cc"],["003300","009933","33cc33","66ff66","99ff99","ccffcc","ffffff","ffccff","ff99ff","ff66ff","ff00ff","cc00cc","660066"],["333300","009900","66ff33","99ff66","ccff99","ffffcc","ffcccc","ff99cc","ff66cc","ff33cc","cc0099","993399"],["336600","669900","99ff33","ccff66","ffff99","ffcc99","ff9999","ff6699","ff3399","cc3399","990099"],["666633","99cc00","ccff33","ffff66","ffcc66","ff9966","ff6666","ff0066","d60094","993366"],["a58800","cccc00","ffff00","ffcc00","ff9933","ff6600","ff0033","cc0066","660033"],["996633","cc9900","ff9900","cc6600","ff3300","ff0000","cc0000","990033"],["663300","996600","cc3300","993300","990000","800000","993333"]],c="#0000ffff",f=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},p=function(e){return f(Number(e))},b=function(e){var t=f(e);return t+t+t},m=function(e){if(e.length>10){var t=1+e.indexOf("("),o=e.indexOf(")"),n=e.substring(t,o).split(",");return["#",p(n[0]),p(n[1]),p(n[2])].join("")}return e};e.widget("evol.colorpicker",{version:"3.2.1",options:{color:null,showOn:"both",hideButton:!1,displayIndicator:!0,transparentColor:!1,history:!0,defaultPalette:"theme",strings:"Theme Colors,Standard Colors,Web Colors,Theme Colors,Back to Palette,History,No history yet."},_active:!1,_create:function(){var o=this;switch(this._paletteIdx="theme"==this.options.defaultPalette?1:2,this._id="evo-cp"+t++,this._enabled=!0,this.options.showOn=this.options.hideButton?"focus":this.options.showOn,this.element.get(0).tagName){case"INPUT":var r=this.options.color,l=this.element,s=("focus"===this.options.showOn?"":"evo-pointer ")+"evo-colorind"+(a?"-ff":i)+(this.options.hideButton?" evo-hidden-button":""),d="";if(this._isPopup=!0,this._palette=null,null!==r)l.val(r);else{var u=l.val();""!==u&&(r=this.options.color=u)}r===c?s+=" evo-transparent":d=null!==r?"background-color:"+r:"",l.addClass("colorPicker "+this._id).wrap('<div style="width:'+(this.options.hideButton?this.element.width():this.element.width()+32)+"px;"+(n?"margin-bottom:-21px;":"")+(a?"padding:1px 0;":"")+'"></div>').after('<div class="'+s+'" style="'+d+'"></div>').on("keyup onpaste",function(){var t=e(this).val();t!=o.options.color&&o._setValue(t,!0)});var f=this.options.showOn;("both"===f||"focus"===f)&&l.on("focus",function(){o.showPalette()}),("both"===f||"button"===f)&&l.next().on("click",function(e){return e.stopPropagation(),o.showPalette(),!1});break;default:this._isPopup=!1,this._palette=this.element.html(this._paletteHTML()).attr("aria-haspopup","true"),this._bindColors()}if(this.options.history&&(r&&this._add2History(r),this.options.initialHistory)){var p=this.options.initialHistory;for(var b in p)this._add2History(p[b])}},_paletteHTML:function(){var e=this._paletteIdx=Math.abs(this._paletteIdx),t=this.options,o=t.strings.split(","),n='<div class="evo-pop'+i+' ui-widget ui-widget-content ui-corner-all"'+(this._isPopup?' style="position:absolute"':"")+"><span>"+this["_paletteHTML"+e]()+'</span><div class="evo-more"><a href="javascript:void(0)">'+o[1+e]+"</a>";return t.history&&(n+='<a href="javascript:void(0)" class="evo-hist">'+o[5]+"</a>"),n+="</div>",t.displayIndicator&&(n+=this._colorIndHTML(this.options.color)+this._colorIndHTML("")),n+="</div>"},_colorIndHTML:function(e){var t=n?"evo-colorbox-ie ":"",o="";return e?e===c?t+="evo-transparent":o="background-color:"+e:o="display:none",'<div class="evo-color" style="float:left"><div style="'+o+'" class="'+t+'"></div><span>'+(e?e:"")+"</span></div>"},_paletteHTML1:function(){for(var e=this.options,t=e.strings.split(","),o='<td style="background-color:#',a=n?'"><div style="width:2px;"></div></td>':'"><span/></td>',r='<tr><th colspan="10" class="ui-widget-content">',u='<table class="evo-palette'+i+'">'+r+t[0]+"</th></tr><tr>",c=0;10>c;c++)u+=o+l[c]+a;for(u+="</tr>",n||(u+='<tr><th colspan="10"></th></tr>'),u+='<tr class="top">',c=0;10>c;c++)u+=o+s[c]+a;for(var f=1;4>f;f++)for(u+='</tr><tr class="in">',c=0;10>c;c++)u+=o+s[10*f+c]+a;for(u+='</tr><tr class="bottom">',c=40;50>c;c++)u+=o+s[c]+a;for(u+="</tr>"+r,e.transparentColor&&(u+='<div class="evo-transparent evo-tr-box"></div>'),u+=t[1]+"</th></tr><tr>",c=0;10>c;c++)u+=o+d[c]+a;return u+="</tr></table>"},_paletteHTML2:function(){for(var e,t,o='<td style="background-color:#',a=n?'"><div style="width:5px;"></div></td>':'"><span/></td>',r='<table class="evo-palette2'+i+'"><tr>',l="</tr></table>",s='<div class="evo-palcenter">',d=0,c=u.length;c>d;d++){s+=r;var f=u[d];for(e=0,t=f.length;t>e;e++)s+=o+f[e]+a;s+=l}s+='<div class="evo-sep"/>';var p="";for(s+=r,e=255;e>10;e-=10)s+=o+b(e)+a,e-=10,p+=o+b(e)+a;return s+=l+r+p+l+"</div>"},_switchPalette:function(t){if(this._enabled){var o,n,i,a=this.options.strings.split(",");if(e(t).hasClass("evo-hist")){var l=['<table class="evo-palette"><tr><th class="ui-widget-content">',a[5],"</th></tr></tr></table>",'<div class="evo-cHist">'];if(0===r.length)l.push("<p>&nbsp;",a[6],"</p>");else for(var s=r.length-1;s>-1;s--)9===r[s].length?l.push('<div class="evo-transparent"></div>'):l.push('<div style="background-color:',r[s],'"></div>');l.push("</div>"),o=-this._paletteIdx,n=l.join(""),i=a[4]}else this._paletteIdx<0?(o=-this._paletteIdx,this._palette.find(".evo-hist").show()):o=2==this._paletteIdx?1:2,n=this["_paletteHTML"+o](),i=a[o+1],this._paletteIdx=o;this._paletteIdx=o;var d=this._palette.find(".evo-more").prev().html(n).end().children().eq(0).html(i);0>o&&d.next().hide()}},_downOrUpPositioning:function(){for(var e=this.element,t=0;null!==e&&100>t;){if("visible"!=e.css("overflow")){var o=this._palette.offset().top+this._palette.height(),n=e.offset().top+e.height(),i=this._palette.offset().top-this._palette.height()-this.element.outerHeight(),a=e.offset().top,r=o>n&&i>a;r?this._palette.css({bottom:this.element.outerHeight()+"px"}):this._palette.css({bottom:"auto"});break}if("HTML"==e[0].tagName)break;e=e.offsetParent(),t++}},showPalette:function(){if(this._enabled&&(this._active=!0,e(".colorPicker").not("."+this._id).colorpicker("hidePalette"),null===this._palette)){this._palette=this.element.next().after(this._paletteHTML()).next().on("click",function(e){return e.stopPropagation(),!1}),this._bindColors();var t=this;this._isPopup&&(this._downOrUpPositioning(),e(document.body).on("click."+t._id,function(e){e.target!=t.element.get(0)&&t.hidePalette()}).on("keyup."+t._id,function(e){27===e.keyCode&&t.hidePalette()}))}return this},hidePalette:function(){if(this._isPopup&&this._palette){e(document.body).off("click."+this._id);var t=this;this._palette.off("mouseover click","td,.evo-transparent").fadeOut(function(){t._palette.remove(),t._palette=t._cTxt=null}).find(".evo-more a").off("click")}return this},_bindColors:function(){var t=this,o=this.options,n=this._palette.find("div.evo-color"),i=o.history?"td,.evo-cHist>div":"td";o.transparentColor&&(i+=",.evo-transparent"),this._cTxt1=n.eq(0).children().eq(0),this._cTxt2=n.eq(1).children().eq(0),this._palette.on("click",i,function(){if(t._enabled){var o=e(this);t._setValue(o.hasClass("evo-transparent")?c:m(o.attr("style").substring(17))),t._active=!1}}).on("mouseover",i,function(){if(t._enabled){var o=e(this),n=o.hasClass("evo-transparent")?c:m(o.attr("style").substring(17));t.options.displayIndicator&&t._setColorInd(n,2),t._active&&t.element.trigger("mouseover.color",n)}}).find(".evo-more a").on("click",function(){t._switchPalette(this)})},val:function(e){return"undefined"==typeof e?this.options.color:(this._setValue(e),this)},_setValue:function(e,t){e=e.replace(/ /g,""),this.options.color=e,this._isPopup?(t||this.hidePalette(),this._setBoxColor(this.element.val(e).next(),e)):this._setColorInd(e,1),this.options.history&&this._paletteIdx>0&&this._add2History(e),this.element.trigger("change.color",e)},_setColorInd:function(e,t){var o=this["_cTxt"+t];this._setBoxColor(o,e),o.next().html(e)},_setBoxColor:function(e,t){t===c?e.addClass("evo-transparent").removeAttr("style"):e.removeClass("evo-transparent").attr("style","background-color:"+t)},_setOption:function(e,t){"color"==e?this._setValue(t,!0):this.options[e]=t},_add2History:function(e){for(var t=r.length,o=0;t>o;o++)if(e==r[o])return;t>27&&r.shift(),r.push(e)},clear:function(){this.hidePalette().val("")},enable:function(){var e=this.element;return this._isPopup?e.removeAttr("disabled"):e.css({opacity:"1","pointer-events":"auto"}),"focus"!==this.options.showOn&&this.element.next().addClass("evo-pointer"),e.removeAttr("aria-disabled"),this._enabled=!0,this},disable:function(){var e=this.element;return this._isPopup?e.attr("disabled","disabled"):(this.hidePalette(),e.css({opacity:"0.3","pointer-events":"none"})),"focus"!==this.options.showOn&&this.element.next().removeClass("evo-pointer"),e.attr("aria-disabled","true"),this._enabled=!1,this},isDisabled:function(){return!this._enabled},destroy:function(){e(document.body).off("click."+this._id),this._palette&&(this._palette.off("mouseover click","td,.evo-cHist>div,.evo-transparent").find(".evo-more a").off("click"),this._isPopup&&this._palette.remove(),this._palette=this._cTxt=null),this._isPopup&&this.element.next().off("click").remove().end().off("focus").unwrap(),this.element.removeClass("colorPicker "+this.id).empty(),e.Widget.prototype.destroy.call(this)}})}(jQuery);
9
+
10
+ },{}],3:[function(require,module,exports){
11
+ !function(e){"use strict";var t="Compound",o="Identifier",n="MemberExpression",r="Literal",i="ThisExpression",a="CallExpression",l="UnaryExpression",s="BinaryExpression",d="LogicalExpression",u="ConditionalExpression",c="ArrayExpression",f=46,p=44,b=39,m=34,g=40,h=41,v=91,y=93,k=63,w=59,x=58,_=function(e,t){var o=new Error(e+" at character "+t);throw o.index=t,o.description=e,o},S=!0,O={"-":S,"!":S,"~":S,"+":S},C={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},$=function(e){var t,o=0;for(var n in e)(t=n.length)>o&&e.hasOwnProperty(n)&&(o=t);return o},T=$(O),E=$(C),A={"true":!0,"false":!1,"null":null},D="this",M=function(e){return C[e]||0},j=function(e,t,o){var n="||"===e||"&&"===e?d:s;return{type:n,operator:e,left:t,right:o}},P=function(e){return e>=48&&57>=e},B=function(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||e>=128&&!C[String.fromCharCode(e)]},H=function(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||e>=48&&57>=e||e>=128&&!C[String.fromCharCode(e)]},q=function(e){for(var s,d,S=0,$=e.charAt,q=e.charCodeAt,I=function(t){return $.call(e,t)},R=function(t){return q.call(e,t)},U=e.length,N=function(){for(var e=R(S);32===e||9===e||10===e||13===e;)e=R(++S)},L=function(){var e,t,o=V();return N(),R(S)!==k?o:(S++,e=L(),e||_("Expected expression",S),N(),R(S)===x?(S++,t=L(),t||_("Expected expression",S),{type:u,test:o,consequent:e,alternate:t}):(_("Expected :",S),void 0))},F=function(){N();for(var t=e.substr(S,E),o=t.length;o>0;){if(C.hasOwnProperty(t))return S+=o,t;t=t.substr(0,--o)}return!1},V=function(){var e,t,o,n,r,i,a,l;if(i=z(),t=F(),!t)return i;for(r={value:t,prec:M(t)},a=z(),a||_("Expected expression after "+t,S),n=[i,r,a];(t=F())&&(o=M(t),0!==o);){for(r={value:t,prec:o};n.length>2&&o<=n[n.length-2].prec;)a=n.pop(),t=n.pop().value,i=n.pop(),e=j(t,i,a),n.push(e);e=z(),e||_("Expected expression after "+t,S),n.push(r,e)}for(l=n.length-1,e=n[l];l>1;)e=j(n[l-1].value,n[l-2],e),l-=2;return e},z=function(){var t,o,n;if(N(),t=R(S),P(t)||t===f)return G();if(t===b||t===m)return W();if(B(t)||t===g)return Z();if(t===v)return Q();for(o=e.substr(S,T),n=o.length;n>0;){if(O.hasOwnProperty(o))return S+=n,{type:l,operator:o,argument:z(),prefix:!0};o=o.substr(0,--n)}return!1},G=function(){for(var e,t,o="";P(R(S));)o+=I(S++);if(R(S)===f)for(o+=I(S++);P(R(S));)o+=I(S++);if(e=I(S),"e"===e||"E"===e){for(o+=I(S++),e=I(S),("+"===e||"-"===e)&&(o+=I(S++));P(R(S));)o+=I(S++);P(R(S-1))||_("Expected exponent ("+o+I(S)+")",S)}return t=R(S),B(t)?_("Variable names cannot start with a number ("+o+I(S)+")",S):t===f&&_("Unexpected period",S),{type:r,value:parseFloat(o),raw:o}},W=function(){for(var e,t="",o=I(S++),n=!1;U>S;){if(e=I(S++),e===o){n=!0;break}if("\\"===e)switch(e=I(S++)){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+=" ";break;default:t+="\\"+e}else t+=e}return n||_('Unclosed quote after "'+t+'"',S),{type:r,value:t,raw:o+t+o}},J=function(){var t,n=R(S),a=S;for(B(n)?S++:_("Unexpected "+I(S),S);U>S&&(n=R(S),H(n));)S++;return t=e.slice(a,S),A.hasOwnProperty(t)?{type:r,value:A[t],raw:t}:t===D?{type:i}:{type:o,name:t}},Y=function(e){for(var o,n,r=[],i=!1;U>S;){if(N(),o=R(S),o===e){i=!0,S++;break}o===p?S++:(n=L(),n&&n.type!==t||_("Expected comma",S),r.push(n))}return i||_("Expected "+String.fromCharCode(e),S),r},Z=function(){var e,t;for(e=R(S),t=e===g?X():J(),N(),e=R(S);e===f||e===v||e===g;)S++,e===f?(N(),t={type:n,computed:!1,object:t,property:J()}):e===v?(t={type:n,computed:!0,object:t,property:L()},N(),e=R(S),e!==y&&_("Unclosed [",S),S++):e===g&&(t={type:a,arguments:Y(h),callee:t}),N(),e=R(S);return t},X=function(){S++;var e=L();return N(),R(S)===h?(S++,e):(_("Unclosed (",S),void 0)},Q=function(){return S++,{type:c,elements:Y(y)}},K=[];U>S;)s=R(S),s===w||s===p?S++:(d=L())?K.push(d):U>S&&_('Unexpected "'+I(S)+'"',S);return 1===K.length?K[0]:{type:t,body:K}};if(q.version="<%= version %>",q.toString=function(){return"JavaScript Expression Parser (JSEP) v"+q.version},q.addUnaryOp=function(e){return T=Math.max(e.length,T),O[e]=S,this},q.addBinaryOp=function(e,t){return E=Math.max(e.length,E),C[e]=t,this},q.addLiteral=function(e,t){return A[e]=t,this},q.removeUnaryOp=function(e){return delete O[e],e.length===T&&(T=$(O)),this},q.removeAllUnaryOps=function(){return O={},T=0,this},q.removeBinaryOp=function(e){return delete C[e],e.length===E&&(E=$(C)),this},q.removeAllBinaryOps=function(){return C={},E=0,this},q.removeLiteral=function(e){return delete A[e],this},q.removeAllLiterals=function(){return A={},this},"undefined"==typeof exports){var I=e.jsep;e.jsep=q,q.noConflict=function(){return e.jsep===q&&(e.jsep=I),q}}else"undefined"!=typeof module&&module.exports?exports=module.exports=q:exports.parse=q}(this);
12
+
13
+ },{}],4:[function(require,module,exports){
14
+ "use strict";var utils=require("./utils");module.exports=function(e){function t(t,i,r){function l(o){for(var i=o[0],l=o[1],s=new utils.Selector(i),d=s.parsed(),c=n(d),u=0;u<d.length;++u){var p=d[u];if(p.pseudos)for(var m=0;m<p.pseudos.length;++m){var g=p.pseudos[m];if(e.ignoredPseudos.indexOf(g.name)>=0)return}}if(c){var h=d[d.length-1],v=h.pseudos;h.pseudos=a(h.pseudos),i=d.toString(),h.pseudos=v}var y;try{y=t(i)}catch(k){return}y.each(function(){function o(t,o){for(var i=0,a=t.length;a>i;i++)if("property"==t[i].type){var l=t[i].name,s=t[i].value,d=null!==t[i].value.match(/!important$/);d&&!r.preserveImportant&&(s=s.replace(/\s*!important$/,""));var c=[t[i].position.start.line,t[i].position.start.col],u=new utils.Property(l,s,o,d?2:0,c),p=n.styleProps[l];e.excludedProperties.indexOf(l)<0&&(p&&p.compare(u)===u||!p)&&(p&&p.selector!==o?delete n.styleProps[l]:p&&(u.nextProp=p),n.styleProps[l]=u)}}var n=this;if(!(n.name&&e.nonVisualElements.indexOf(n.name.toUpperCase())>=0)){if(c){var i="pseudo"+c,a=n[i];a||(a=n[i]=t("<span />").get(0),a.pseudoElementType=c,a.pseudoElementParent=n,n[i]=a),n=a}if(!n.styleProps){if(n.styleProps={},t(n).attr(b)){var d="* { "+t(n).attr(b)+" } ";o(utils.parseCSS(d)[0][1],new utils.Selector("<style>",!0))}f.push(n)}o(l,s)}})}function s(e){Object.keys(e.styleProps).length;var o=[];Object.keys(e.styleProps).forEach(function(t){for(var n=e.styleProps[t];"undefined"!=typeof n;)o.push(n),n=n.nextProp}),o.sort(function(e,t){return e.compareFunc(t)});var n=o.filter(function(e){return"content"!==e.prop}).map(function(e){return e.prop+": "+e.value.replace(/["]/g,"'")+";"}).join(" ");n&&t(e).attr(b,n)}function d(e){if(e.pseudoElementType&&e.styleProps.content){var n=o(e.styleProps.content.value);n.img?(e.name="img",t(e).attr("src",n.img)):t(e).text(n);var i=e.pseudoElementParent;"before"===e.pseudoElementType?t(i).prepend(e):t(i).append(e)}}function c(o,n){if(o.name){var i=o.name.toUpperCase();if(e[n+"Elements"].indexOf(i)>-1)for(var a in o.styleProps)if(o.styleProps[a].prop===n){if(o.styleProps[a].value.match(/px/)){var r=o.styleProps[a].value.replace("px","");return t(o).attr(n,r),void 0}if(e.tableElements.indexOf(i)>-1&&o.styleProps[a].value.match(/\%/))return t(o).attr(n,o.styleProps[a].value),void 0}}}function u(o){if(o.name){var n=o.name.toUpperCase(),i=Object.keys(e.styleToAttribute);if(e.tableElements.indexOf(n)>-1)for(var a in o.styleProps)i.indexOf(o.styleProps[a].prop)>-1&&t(o).attr(e.styleToAttribute[o.styleProps[a].prop],o.styleProps[a].value)}}r=r||{};var p=utils.parseCSS(i),f=[],b="style";if(r.styleAttributeName&&(b=r.styleAttributeName),p.forEach(l),f.forEach(s),r.inlinePseudoElements&&f.forEach(d),r.applyWidthAttributes&&f.forEach(function(e){c(e,"width")}),r.applyHeightAttributes&&f.forEach(function(e){c(e,"height")}),r.applyAttributesTableElements&&f.forEach(u),r.insertPreservedExtraCss&&r.extraCss){var m=utils.getPreservedText(r.extraCss,{mediaQueries:r.preserveMediaQueries,fontFaces:r.preserveFontFaces});if(m){var g=null;r.insertPreservedExtraCss!==!0?g=t(r.insertPreservedExtraCss):(g=t("head"),g.length||(g=t("body")),g.length||(g=t.root())),g.first().append("<style>"+m+"</style>")}}}function o(e){if("none"===e||"normal"===e)return"";var t=e.match(/^\s*url\s*\(\s*(.*?)\s*\)\s*$/i);if(t){var o=t[1].replace(/^['"]|['"]$/g,"");return{img:o}}return e=e.slice(1,e.length-1),e=e.replace(/\\/g,"")}function n(e){if(0!==e.length){var t=e[e.length-1].pseudos;if(t)for(var o=0;o<t.length;o++)if(i(t[o]))return t[o].name}}function i(e){return"before"===e.name||"after"===e.name}function a(e){return e.filter(function(e){return!i(e)})}function r(e,o){o=utils.getDefaultOptions(o);var n=s(e,o);return n+="\n"+o.extraCss,t(e,n,o),e}function l(e,t){var o,n,i,a=[],r=e("style");return r.each(function(){if(i=this,o=i.childNodes,1===o.length){if(n=o[0].data,t.applyStyleTags&&void 0===e(i).attr("data-embed")&&a.push(n),t.removeStyleTags&&void 0===e(i).attr("data-embed")){var r=utils.getPreservedText(i.childNodes[0].nodeValue,{mediaQueries:t.preserveMediaQueries,fontFaces:t.preserveFontFaces});r?i.childNodes[0].nodeValue=r:e(i).remove()}e(i).removeAttr("data-embed")}}),a}function s(e,t){var o=l(e,t),n=o.join("\n");return n}return e.ignoredPseudos=["hover","active","focus","visited","link"],e.widthElements=["TABLE","TD","IMG"],e.heightElements=["TABLE","TD","IMG"],e.tableElements=["TABLE","TD","TH","TR","TD","CAPTION","COLGROUP","COL","THEAD","TBODY","TFOOT"],e.nonVisualElements=["HEAD","TITLE","BASE","LINK","STYLE","META","SCRIPT","NOSCRIPT"],e.styleToAttribute={"background-color":"bgcolor","background-image":"background","text-align":"align","vertical-align":"valign"},e.excludedProperties=[],e.juiceDocument=r,e.inlineDocument=t,e};
15
+
16
+ },{"./utils":7}],5:[function(require,module,exports){
17
+ "use strict";function Property(e,t,o,n,i){this.prop=e,this.value=t,this.selector=o,this.priority=n||0,this.additionalPriority=i||[]}module.exports=exports=Property;var utils=require("./utils");Property.prototype.compareFunc=function(e){var t=[];t.push.apply(t,this.selector.specificity()),t.push.apply(t,this.additionalPriority),t[0]+=this.priority;var o=[];return o.push.apply(o,e.selector.specificity()),o.push.apply(o,e.additionalPriority),o[0]+=e.priority,utils.compareFunc(t,o)},Property.prototype.compare=function(e){var t=this.compareFunc(e);return 1===t?this:e},Property.prototype.toString=function(){return this.prop+": "+this.value.replace(/['"]+/g,"")+";"};
18
+
19
+ },{"./utils":7}],6:[function(require,module,exports){
20
+ "use strict";function Selector(e,t){this.text=e,this.spec=void 0,this.styleAttribute=t||!1}function parse(e){try{return parser(e)[0]}catch(t){return[]}}var parser=require("./../../slick/parser");module.exports=exports=Selector,Selector.prototype.parsed=function(){return this.tokens||(this.tokens=parse(this.text)),this.tokens},Selector.prototype.specificity=function(){function e(o,n){for(var i=n||parse(o),r=[t?1:0,0,0,0],a=[],l=0;l<i.length;l++){var s=i[l],d=s.pseudos;if(s.id&&r[1]++,s.attributes&&(r[2]+=s.attributes.length),s.classList&&(r[2]+=s.classList.length),s.tag&&"*"!==s.tag&&r[3]++,d){r[3]+=d.length;for(var u=0;u<d.length;u++)"not"===d[u].name&&(a.push(d[u].value),r[3]--)}}for(var c=a.length;c--;)for(var f=e(a[c]),p=4;p--;)r[p]+=f[p];return r}var t=this.styleAttribute;return this.spec||(this.spec=e(this.text,this.parsed())),this.spec};
21
+
22
+ },{"./../../slick/parser":17}],7:[function(require,module,exports){
23
+ "use strict";var mensch=require("./../../mensch/index.js"),own={}.hasOwnProperty,os=require("os"),Selector=require("./selector"),Property=require("./property");exports.Selector=Selector,exports.Property=Property,exports.extract=function(e){for(var t=0,o=[],n="",i=0,r=e.length;r>i;i++){var a=e.charAt(i);t?(("]"===a||")"===a)&&t--,n+=a):","===a?(o.push(n),n=""):(("["===a||"("===a)&&t++,(n.length||","!==a&&"\n"!==a&&" "!==a)&&(n+=a))}return n.length&&o.push(n),o},exports.parseCSS=function(e){for(var t=mensch.parse(e,{position:!0,comments:!0}),o="undefined"!=typeof t.stylesheet&&t.stylesheet.rules?t.stylesheet.rules:[],n=[],i=0,r=o.length;r>i;i++)if("rule"==o[i].type)for(var a=o[i],l=a.selectors,s=0,d=l.length;d>s;s++)n.push([l[s],a.declarations]);return n},exports.getPreservedText=function(e,t){for(var o=mensch.parse(e,{position:!0,comments:!0}),n="undefined"!=typeof o.stylesheet&&o.stylesheet.rules?o.stylesheet.rules:[],i=[],r=null,a=n.length-1;a>=0;a--)(t.fontFaces&&"font-face"===n[a].type||t.mediaQueries&&"media"===n[a].type)&&i.push(mensch.stringify({stylesheet:{rules:[n[a]]}},{comments:!1,indentation:" "})),r=n[a].position.start;return 0===i.length?!1:os.EOL+i.join(os.EOL)+os.EOL},exports.normalizeLineEndings=function(e){return e.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n")},exports.compareFunc=function(e,t){for(var o=Math.min(e.length,t.length),n=0;o>n;n++)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return e.length-t.length},exports.compare=function(e,t){return 1==exports.compareFunc(e,t)?e:t},exports.extend=function(e,t){for(var o in t)own.call(t,o)&&(e[o]=t[o]);return e},exports.getDefaultOptions=function(e){var t=exports.extend({extraCss:"",insertPreservedExtraCss:!0,applyStyleTags:!0,removeStyleTags:!0,preserveMediaQueries:!0,preserveFontFaces:!0,applyWidthAttributes:!0,applyHeightAttributes:!0,applyAttributesTableElements:!0,url:""},e);return t.webResources=t.webResources||{},t};
24
+
25
+ },{"./../../mensch/index.js":12,"./property":5,"./selector":6,"os":22}],8:[function(require,module,exports){
26
+ (function (global){
27
+ !function(e){if("function"==typeof define&&define.amd)define(["knockout","jquery","jquery-ui/sortable","jquery-ui/draggable"],e);else if("function"==typeof require&&"object"==typeof exports&&"object"==typeof module){var t=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),o=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null);(typeof window !== "undefined" ? window['jQuery']['ui']['sortable'] : typeof global !== "undefined" ? global['jQuery']['ui']['sortable'] : null),(typeof window !== "undefined" ? window['jQuery']['ui']['draggable'] : typeof global !== "undefined" ? global['jQuery']['ui']['draggable'] : null),e(t,o)}else e(window.ko,window.jQuery)}(function(e,t){var o="ko_sortItem",a="ko_sourceIndex",i="ko_sortList",n="ko_parentList",l="ko_dragItem",r=e.utils.unwrapObservable,d=e.utils.domData.get,s=e.utils.domData.set,c=t.ui&&t.ui.version,u=c&&c.indexOf("1.6.")&&c.indexOf("1.7.")&&(c.indexOf("1.8.")||"1.8.24"===c),p=function(t,a){e.utils.arrayForEach(t,function(e){1===e.nodeType&&(s(e,o,a),s(e,n,d(e.parentNode,i)))})},m=function(t,o){var a,i={},n=r(t())||{};return n.data?(i[o]=n.data,i.name=n.template):i[o]=t(),e.utils.arrayForEach(["afterAdd","afterRender","as","beforeRemove","includeDestroyed","templateEngine","templateOptions","nodes"],function(t){n.hasOwnProperty(t)?i[t]=n[t]:e.bindingHandlers.sortable.hasOwnProperty(t)&&(i[t]=e.bindingHandlers.sortable[t])}),"foreach"===o&&(i.afterRender?(a=i.afterRender,i.afterRender=function(e,t){p.call(t,e,t),a.call(t,e,t)}):i.afterRender=p),i},b=function(e,t){var o=r(t);if(o)for(var a=0;e>a;a++)o[a]&&r(o[a]._destroy)&&e++;return e},f=function(o,a){var i,n;a?(n=document.getElementById(a),n&&(i=new e.templateSources.domElement(n),i.text(t.trim(i.text())))):t(o).contents().each(function(){this&&1!==this.nodeType&&o.removeChild(this)})};e.bindingHandlers.sortable={init:function(c,p,g,h,v){var k,y,w=t(c),$=r(p())||{},x=m(p,"foreach"),S={};f(c,x.name),t.extend(!0,S,e.bindingHandlers.sortable),$.options&&S.options&&(e.utils.extend(S.options,$.options),delete $.options),e.utils.extend(S,$),S.connectClass&&(e.isObservable(S.allowDrop)||"function"==typeof S.allowDrop)?e.computed({read:function(){var t=r(S.allowDrop),o="function"==typeof t?t.call(this,x.foreach):t;e.utils.toggleDomNodeCssClass(c,S.connectClass,o)},disposeWhenNodeIsRemoved:c},this):e.utils.toggleDomNodeCssClass(c,S.connectClass,S.allowDrop),e.bindingHandlers.template.init(c,function(){return x},g,h,v),k=S.options.start,y=S.options.update,S.options.helper||(S.options.helper=function(e,o){return o.is("tr")&&o.children().each(function(){t(this).width(t(this).width())}),o});var C=setTimeout(function(){var p,m=S.options.receive;w.sortable(e.utils.extend(S.options,{start:function(t,o){var i=o.item[0];s(i,a,e.utils.arrayIndexOf(o.item.parent().children(),i)),o.item.find("input:focus").change(),k&&k.apply(this,arguments)},receive:function(e,t){"function"==typeof m&&m.call(this,e,t),p=d(t.item[0],l),p&&(p.clone&&(p=p.clone()),S.dragged&&(p=S.dragged.call(this,p,e,t)||p))},update:function(l,c){var m,f,g,h,v,k=c.item[0],w=c.item.parent()[0],$=d(k,o)||p;if($||t(k).remove(),p=null,$&&this===w||!u&&t.contains(this,w)){if(m=d(k,n),g=d(k,a),f=d(k.parentNode,i),h=e.utils.arrayIndexOf(c.item.parent().children(),k),x.includeDestroyed||(g=b(g,m),h=b(h,f)),(S.beforeMove||S.afterMove)&&(v={item:$,sourceParent:m,sourceParentNode:m&&c.sender||k.parentNode,sourceIndex:g,targetParent:f,targetIndex:h,cancelDrop:!1},S.beforeMove&&S.beforeMove.call(this,v,l,c)),m?t(m===f?this:c.sender||this).sortable("cancel"):t(k).remove(),v&&v.cancelDrop)return;if(S.hasOwnProperty("strategyMove")&&S.strategyMove!==!1){if(h>=0)if(m)if(m!==f)m.splice(g,1),f.splice(h,0,$),s(k,o,null),c.item.remove();else{var C=r(m);m.valueWillMutate&&m.valueWillMutate(),C.splice(g,1),C.splice(h,0,$),m.valueHasMutated&&m.valueHasMutated()}else f.splice(h,0,$),s(k,o,null),c.item.remove()}else h>=0&&(m&&(m.splice(g,1),e.processAllDeferredBindingUpdates&&e.processAllDeferredBindingUpdates(),e.options&&e.options.deferUpdates&&e.tasks.runEarly()),f.splice(h,0,$)),s(k,o,null);e.processAllDeferredBindingUpdates&&e.processAllDeferredBindingUpdates(),S.afterMove&&S.afterMove.call(this,v,l,c)}y&&y.apply(this,arguments)},connectWith:S.connectClass?"."+S.connectClass:!1})),void 0!==S.isEnabled&&e.computed({read:function(){w.sortable(r(S.isEnabled)?"enable":"disable")},disposeWhenNodeIsRemoved:c})},0);return e.utils.domNodeDisposal.addDisposeCallback(c,function(){(w.data("ui-sortable")||w.data("sortable"))&&w.sortable("destroy"),e.utils.toggleDomNodeCssClass(c,S.connectClass,!1),clearTimeout(C)}),{controlsDescendantBindings:!0}},update:function(t,o,a,n,l){var r=m(o,"foreach");s(t,i,r.foreach),e.bindingHandlers.template.update(t,function(){return r},a,n,l)},connectClass:"ko_container",allowDrop:!0,afterMove:null,beforeMove:null,options:{}},e.bindingHandlers.draggable={init:function(o,a,i,n,d){var c=r(a())||{},u=c.options||{},p=e.utils.extend({},e.bindingHandlers.draggable.options),b=m(a,"data"),f=c.connectClass||e.bindingHandlers.draggable.connectClass,g=void 0!==c.isEnabled?c.isEnabled:e.bindingHandlers.draggable.isEnabled;return c="data"in c?c.data:c,s(o,l,c),e.utils.extend(p,u),p.connectToSortable=f?"."+f:!1,t(o).draggable(p),void 0!==g&&e.computed({read:function(){t(o).draggable(r(g)?"enable":"disable")},disposeWhenNodeIsRemoved:o}),e.utils.domNodeDisposal.addDisposeCallback(o,function(){t(o).draggable("destroy")}),e.bindingHandlers.template.init(o,function(){return b},i,n,d)},update:function(t,o,a,i,n){var l=m(o,"data");return e.bindingHandlers.template.update(t,function(){return l},a,i,n)},connectClass:e.bindingHandlers.sortable.connectClass,options:{helper:"clone"}}});
28
+
29
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
30
+
31
+ },{}],9:[function(require,module,exports){
32
+ (function (global){
33
+ !function(e){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?module.exports=e((typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),require("./../knockoutjs-reactor/src/knockout.reactor.js")):"function"==typeof define&&define.amd?define(["knockout","knockoutjs-reactor","exports"],e):e(ko,ko.watch)}(function(e,t){var o=function(o,n){var i,a=e.observableArray(),r=e.observableArray(),l=0,s=1,d=2,c=l,u=0,p=1,f=2,b=3,g=u,m={levels:100,undoLabel:"undo (#COUNT#)",redoLabel:"redo (#COUNT#)"};n="object"==typeof n?e.utils.extend(m,n):m;var h=function(e){c==s?k(e,r):c==d?k(e,a):c==l&&(k(e,a),r.removeAll())},v=function(e,t){return"undefined"!=typeof e.mergedAction?e.mergedAction(t):null},k=function(e,t){if(t().length>0){var o=v(t()[t().length-1],e);if(null!==o)return t()[t().length-1]=o,void 0}t().length>=n.levels&&t.shift(),i=t,t.push(e)},y=function(t,o,n){return{name:e.computed(function(){return e.utils.unwrapObservable(t).replace(/#COUNT#/,n().length)}),enabled:e.computed(function(){return 0!==n().length}),execute:function(){var e=n.pop();if(e){var t=c;c=o;var a=g;g=b,e(),w(i),g=a,c=t}return!0}}},w=function(e){if("undefined"==typeof e)throw"Unexpected operation: stack cleaner called with undefined stack";e().length>0&&"undefined"!=typeof e()[e().length-1].mergedAction&&delete e()[e().length-1].mergedAction},x=function(e,t){var o=function(e,t){e(),t()}.bind(void 0,e,t);return"undefined"!=typeof e.mergedAction&&(o.mergedAction=e.mergedAction),o},$=function(e,t,o){if("undefined"!=typeof t)e(t);else{if(!o)throw"Unexpected condition: no item and no child.oldValues!";if("deleted"==o.status)e.splice(o.index,0,o.value);else{if("added"!=o.status)throw"Unsupproted item.status: "+o.status;e.splice(o.index,1)}}},_=function(e,t,o,n,i){return e.bind(void 0,o,n,i)},S=_,C=function(e,t,o){var n="undefined"!=typeof t.oldValues?t.oldValues[0]:void 0,i=S($,e,t,n,o);g!=p&&(g==b?"undefined"!=typeof i&&(i.mergedAction=function(e){return"undefined"!=typeof e.mergeMe&&e.mergeMe?x(e,this):null},i.mergeMe=!0):"undefined"!=typeof i&&(t.oldValues&&g==f&&(i.mergedAction=function(e,t,o){return"object"==typeof o.mergeableAction&&e==o.mergeableAction.child?this:null}.bind(i,t,o),i.mergeableAction={child:t,item:o}),o&&"deleted"==o.status&&(i.mergedAction=function(e,t,o){return"object"==typeof o.mergeableMove&&t.value==o.mergeableMove.item.value?x(o,this):(console.log("UR","not mergeable",typeof o.mergeableMove),null)}.bind(i,t,o)),o&&"added"==o.status&&(i.mergeableMove={child:t,item:o})),"undefined"!=typeof i&&h(i))},H={depth:-1,oldValues:1,mutable:!0,tagFields:!0},M={},q="function"==typeof t?t:e.watch,O=q(o,H,C,M);return{push:h,undoCommand:y(n.undoLabel,s,a),redoCommand:y(n.redoLabel,d,r),reset:function(){a.removeAll(),r.removeAll()},setModeOnce:function(){g=f,w(a)},setModeMerge:function(){g=b,w(a)},setModeNormal:function(){g=u,w(a)},setModeIgnore:function(){g=p,w(a)},setUndoActionMaker:function(e){S=e},dispose:function(){O.dispose()}}};return o});
34
+
35
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
36
+
37
+ },{"./../knockoutjs-reactor/src/knockout.reactor.js":11}],10:[function(require,module,exports){
38
+ (function (global){
39
+ !function(e){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?e((typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),exports):"function"==typeof define&&define.amd?define(["knockout","exports"],e):e(ko,ko.wrap={})}(function(e,t){function o(e){var t=typeof e;return"object"===t&&(e?e.constructor==Date?t="date":"[object Array]"==Object.prototype.toString.call(e)&&(t="array"):t="null"),t}function n(t){var o={};for(var n in t){var i=t[n];e.isComputed(i)||(o[n]=r(i))}return o}function i(e){var t=[];if(!e||0==e.length)return t;for(var o=0,n=e.length;n>o;++o)t.push(r(e[o]));return t}function r(t){var a=e.isObservable(t);if(a){var l=t();return r(l)}return"array"==o(t)?i(t):"object"==o(t)?n(t):t}function a(){f=[{obj:null,wrapped:null,lvl:""}]}function l(t,o,n){for(var i=0;i<f.length;++i)if(f[i].obj===t)return f[i].wrapped;var r={};for(var a in t){var l=t[a];f.push({obj:t,wrapped:r,lvl:d()+"/"+a}),r[a]=u(l,o,n),f.pop()}return o&&o[d()]&&(r=o[d()](r)),c()&&e.track(r),n?e.observable(r):r}function s(t,o,n){var i=e.observableArray();if(!t||0==t.length)return i;for(var r=0,a=t.length;a>r;++r)i.push(u(t[r],o,n));return i}function d(){return f[f.length-1].lvl}function u(t,n,i){if("array"==o(t))return s(t,n,i);if("object"==o(t))return l(t,n,i);if(c()||"function"==typeof t)return t;var r=e.observable();return r(t),r}function c(){return null!=e.track}t.fromJS=function(e,t,o){return a(),u(e,t,o)},t.updateFromJS=function(t,o,n,i){return a(),t(e.utils.unwrapObservable(u(o,n,i)))},t.fromJSON=function(o,n,i){var r=e.utils.parseJson(o);return arguments[0]=r,t.fromJS.apply(this,n,i)},t.toJS=function(e){return r(e)},t.toJSON=function(o){var n=t.toJS(o);return e.utils.stringifyJson(n)};var f});
40
+
41
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
42
+
43
+ },{}],11:[function(require,module,exports){
44
+ (function (global){
45
+ !function(e){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?e((typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null)):"function"==typeof define&&define.amd?define(["knockout"],e):e(window.ko)}(function(e){e.subscribable.fn.watch=function(t,o,n,i){var a=typeof t;return"boolean"===a||"undefined"===a?e.watch(this,{enabled:t!==!1}):"function"!==a||e.isSubscribable(t)?e.watch(t,o,n,i||this):e.watch(this,o||{},t,i||this),this},e.watch=function(t,o,n,i){function a(s,d,c,u,f,p){if(s&&0!==o.depth&&(-1===o.depth||c.length<(o.depth||1))){if(o.watchedOnly&&!s.watchable&&s!=t)return;if((o.enabled===!1||o.enabled===!0)&&(s.watchable=o.enabled),s.watchable===!1)return;o.seal===!0&&(s.watchable=!1);var b=typeof s;if("object"===b||"function"===b){if(s._watcher===i)return;if(o.hide&&e.utils.arrayIndexOf(o.hide,s)>-1)return;var m=[].concat(c,d&&d!==t?d:[]);if("function"!==b){if("[object Object]"===Object.prototype.toString.call(s))e.utils.objectForEach(s,function(t,n){if(n=o.getter?o.getter.call(i,m,s,t):n){if(o.wrap){var r=Object.prototype.toString.call(n);"[object Function]"!==r&&"[object Object]"!==r&&(o.beforeWrap&&o.beforeWrap.call(i,m,s,n)===!1||(n=s[t]="[object Array]"===r?e.observableArray(n):e.observable(n)))}o.unloop&&(n._watcher=u?void 0:i);var l=a(n,f?null:s,m,u,null,t);o.tagFields&&void 0===n._fieldName&&(l||"parentsOnly"!==o.tagFields&&"function"==typeof n||"object"==typeof n)&&(n._fieldName=t)}});else if(o.hideArrays!==!0)for(var g=0;g<s.length;g++)a(s[g],f?null:s,m,u);return!0}if("function"==typeof s.notifySubscribers&&n){if(o.enabled===!0&&s.watchable===!1)return;if(u||!o.beforeWatch||o.beforeWatch.call(i,m,s,p)!==!1){var h="function"==typeof s.pop;if(u?r(s):l(s,h,m,f),h)return a(s(),f?null:s,m,u,!0),!0;if(o.hideWrappedValues!==!0)return a(s(),f?null:s,m,u,!0)}}}}}function r(e){var t=e[s];if(!t)throw"Subscriptions field (."+s+") not defined for observable child "+(e._fieldName||"");if(t.change)for(var n=t.change.length-1;n>=0;n--)t.change[n]._watcher===i&&t.change[n].dispose();if(t.beforeChange&&(o.mutable||o.oldValues>0))for(var n=t.beforeChange.length-1;n>=0;n--)t.beforeChange[n]._watcher===i&&t.beforeChange[n].dispose();if(t.arrayChange)for(var n=t.arrayChange.length-1;n>=0;n--)t.arrayChange[n]._watcher===i&&t.arrayChange[n].dispose()}function l(t,r,l,s){r?t.subscribe(function(o){e.utils.arrayForEach(o,function(e){var o=n.call(i,l,t,e);void 0!==o&&i(o),e.moved||setTimeout(function(){a(e.value,s?null:t,l,"deleted"===e.status)},0)})},void 0,"arrayChange")._watcher=i:(t.subscribe(function(){if(t.watchable!==!1){var e=n.call(i,l,t);void 0!==e&&i(e),o.mutable&&"object"==typeof t()&&a(t(),s?null:t,l)}},null,"change")._watcher=i,(o.oldValues>0||o.mutable)&&(t.subscribe(function(e){if(o.oldValues>0){var n=t.oldValues?t.oldValues:t.oldValues=[];for(n.unshift(e);n.length>o.oldValues;)n.pop()}o.mutable&&"object"==typeof e&&a(e,s?null:t,l,!1,!0)},null,"beforeChange")._watcher=i))}"function"==typeof o&&(i=i||n,n=o,o={}),i=i||this;var s;switch("function"==typeof e.subscription||e.version){case!0:s="_subscriptions";break;case"3.0.0":s="F";break;case"3.1.0":s="H";break;case"3.2.0":s="M";break;case"3.3.0":s="G";break;case"3.4.0":s="K";break;case"3.4.1":s="K";break;default:throw"Unsupported Knockout version. Only v3.0.0 to v3.4.1 are supported when minified. Current version is "+e.version}return"function"!=typeof t||e.isSubscribable(t)?(a(t,null,[]),{dispose:function(){a(t,null,[],!0)}}):e.computed(t,n,o)}});
46
+
47
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
48
+
49
+ },{}],12:[function(require,module,exports){
50
+ module.exports={lex:require("./lib/lexer"),parse:require("./lib/parser"),stringify:require("./lib/stringify")};
51
+
52
+ },{"./lib/lexer":14,"./lib/parser":15,"./lib/stringify":16}],13:[function(require,module,exports){
53
+ (function (process){
54
+ function debug(e){return _debug.bind(null,e)}function _debug(e){var t=[].slice.call(arguments,1);t.unshift("["+e+"]"),process.stderr.write(t.join(" ")+"\n")}exports=module.exports=debug;
55
+
56
+ }).call(this,require('_process'))
57
+
58
+ },{"_process":23}],14:[function(require,module,exports){
59
+ function lex(e){function t(){return u(),e[h]}function o(e){return e?w[w.length-1-e]:k}function n(t){var o=h+1;return t===e.slice(o,o+t.length)}function i(t){var o=e.slice(h).indexOf(t);return o>0?o:!1}function r(e){return e===a(1)}function a(t){return e[h+(t||1)]}function l(){var e=w.pop();return k=w[w.length-1],e}function s(e){return k=e,w.push(k),w.length}function d(e){var t=k;return w[w.length-1]=k=e,t}function u(t){if(1==(t||1))"\n"==e[h]?(y++,g=1):g++,h++;else{var o=e.slice(h,h+t).split("\n");o.length>1&&(y+=o.length-1,g=1),g+=o[o.length-1].length,h+=t}}function c(){x.end={line:y,col:g},DEBUG&&debug("addToken:",JSON.stringify(x,null,2)),_.push(x),m="",x={}}function f(e){x={type:e,start:{line:y,col:g}}}var p,b,m="",g=0,h=-1,v=0,y=1,k="before-selector",w=[k],x={},_=[],S=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];for(TIMER&&(p=Date.now());b=t();)switch(DEBUG&&debug(b,o()),b){case" ":switch(o()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":m+=b}break;case"\n":case" ":case"\r":case"\f":switch(o()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":m+=b;break;case"at-value":"\n"===b&&(x.value=m.trim(),c(),l())}break;case":":switch(o()){case"name":x.name=m.trim(),m="",d("before-value");break;case"before-selector":m+=b,f("selector"),s("selector");break;case"before-value":d("value"),m+=b;break;default:m+=b}break;case";":switch(o()){case"name":case"before-value":case"value":m.trim().length>0&&(x.value=m.trim(),c()),d("before-name");break;case"value-paren":m+=b;break;case"at-value":x.value=m.trim(),c(),l();break;case"before-name":break;default:m+=b}break;case"{":switch(o()){case"selector":if("\\"===a(-1)){m+=b;break}x.text=m.trim(),c(),d("before-name"),v+=1;break;case"at-group":switch(x.name=m.trim(),x.type){case"font-face":case"viewport":case"page":s("before-name");break;default:s("before-selector")}c(),v+=1;break;case"name":case"at-rule":x.name=m.trim(),c(),s("before-name"),v+=1;break;case"comment":case"double-string":case"single-string":m+=b;break;case"before-value":d("value"),m+=b}break;case"}":switch(o()){case"before-name":case"name":case"before-value":case"value":m&&(x.value=m.trim()),x.name&&x.value&&c(),f("end"),c(),l(),"at-group"===o()&&(f("at-group-end"),c(),l()),v>0&&(v-=1);break;case"at-group":case"before-selector":case"selector":if("\\"===a(-1)){m+=b;break}v>0&&"at-group"===o(1)&&(f("at-group-end"),c()),v>1&&l(),v>0&&(v-=1);break;case"double-string":case"single-string":case"comment":m+=b}break;case'"':case"'":switch(o()){case"double-string":'"'===b&&"\\"!==a(-1)&&l();break;case"single-string":"'"===b&&"\\"!==a(-1)&&l();break;case"before-at-value":d("at-value"),s('"'===b?"double-string":"single-string");break;case"before-value":d("value"),s('"'===b?"double-string":"single-string");break;case"comment":break;default:"\\"!==a(-1)&&s('"'===b?"double-string":"single-string")}m+=b;break;case"/":switch(o()){case"comment":case"double-string":case"single-string":m+=b;break;case"before-value":case"selector":case"name":case"value":if(r("*")){var O=i("*/");O&&u(O+1)}else"before-value"==o()&&d("value"),m+=b;break;default:r("*")?(f("comment"),s("comment"),u()):m+=b}break;case"*":switch(o()){case"comment":r("/")?(x.text=m,u(),c(),l()):m+=b;break;case"before-selector":m+=b,f("selector"),s("selector");break;case"before-value":d("value"),m+=b;break;default:m+=b}break;case"@":switch(o()){case"comment":case"double-string":case"single-string":m+=b;break;case"before-value":d("value"),m+=b;break;default:for(var C,$,T=!1,A=0,E=S.length;!T&&E>A;++A)$=S[A],C=$.name||$,n(C)&&(T=!0,f(C),s($.state||"at-group"),u(C.length),$.prefix&&(x.prefix=$.prefix),$.type&&(x.type=$.type));T||(m+=b)}break;case"(":switch(o()){case"value":s("value-paren");break;case"before-value":d("value")}m+=b;break;case")":switch(o()){case"value-paren":l();break;case"before-value":d("value")}m+=b;break;default:switch(o()){case"before-selector":f("selector"),s("selector");break;case"before-name":f("property"),d("name");break;case"before-value":d("value");break;case"before-at-value":d("at-value")}m+=b}return TIMER&&debug("ran in",Date.now()-p+"ms"),_}var DEBUG=!1,TIMER=!1,debug=require("./debug")("lex");exports=module.exports=lex;
60
+
61
+ },{"./debug":13}],15:[function(require,module,exports){
62
+ function parse(e,t){var o;t||(t={}),_comments=!!t.comments,_position=!!t.position,_depth=0,_tokens=Array.isArray(e)?e.slice():lex(e);var n,r,i=[];for(TIMER&&(o=Date.now());r=next();)n=parseToken(r),n&&i.push(n);return TIMER&&debug("ran in",Date.now()-o+"ms"),{type:"stylesheet",stylesheet:{rules:i}}}function astNode(e,t){t||(t={});for(var o,n=["type","name","value"],r={},i=0;i<n.length;++i)o=n[i],e[o]&&(r[o]=t[o]||e[o]);for(n=Object.keys(t),i=0;i<n.length;++i)o=n[i],r[o]||(r[o]=t[o]);return _position&&(r.position={start:e.start,end:e.end}),DEBUG&&debug("astNode:",JSON.stringify(r,null,2)),r}function next(){var e=_tokens.shift();return DEBUG&&debug("next:",JSON.stringify(e,null,2)),e}function parseAtGroup(e){_depth+=1;var t={};switch(e.type){case"font-face":case"viewport":t.declarations=parseDeclarations();break;case"page":t.prefix=e.prefix,t.declarations=parseDeclarations();break;default:t.prefix=e.prefix,t.rules=parseRules()}return astNode(e,t)}function parseAtImport(e){return astNode(e)}function parseCharset(e){return astNode(e)}function parseComment(e){return astNode(e,{text:e.text})}function parseNamespace(e){return astNode(e)}function parseProperty(e){return astNode(e)}function parseSelector(e){function t(e){return e.trim()}return astNode(e,{type:"rule",selectors:e.text.split(",").map(t),declarations:parseDeclarations(e)})}function parseToken(e){switch(e.type){case"property":return parseProperty(e);case"selector":return parseSelector(e);case"at-group-end":return _depth-=1,void 0;case"media":case"keyframes":return parseAtGroup(e);case"comment":if(_comments)return parseComment(e);break;case"charset":return parseCharset(e);case"import":return parseAtImport(e);case"namespace":return parseNamespace(e);case"font-face":case"supports":case"viewport":case"document":case"page":return parseAtGroup(e)}DEBUG&&debug("parseToken: unexpected token:",JSON.stringify(e))}function parseTokensWhile(e){for(var t,o,n=[];(o=next())&&e&&e(o);)t=parseToken(o),t&&n.push(t);return o&&"end"!==o.type&&_tokens.unshift(o),n}function parseDeclarations(){return parseTokensWhile(function(e){return"property"===e.type||"comment"===e.type})}function parseRules(){return parseTokensWhile(function(){return _depth})}var DEBUG=!1,TIMER=!1,debug=require("./debug")("parse"),lex=require("./lexer");exports=module.exports=parse;var _comments,_depth,_position,_tokens;
63
+
64
+ },{"./debug":13,"./lexer":14}],16:[function(require,module,exports){
65
+ function stringify(e,t){var o;t||(t={}),_indentation=t.indentation||"",_compress=!!t.compress,_comments=!!t.comments,_compress?_n=_s="":(_n="\n",_s=" "),TIMER&&(o=Date.now());var n=reduce(e.stylesheet.rules,stringifyNode).join("\n").trim();return TIMER&&debug("ran in",Date.now()-o+"ms"),n}function indent(e){return this.level||(this.level=1),e?(this.level+=e,void 0):_compress?"":Array(this.level).join(_indentation||"")}function stringifyAtRule(e){return"@"+e.type+" "+e.value+";"+_n}function stringifyAtGroup(e){var t="",o=e.prefix||"";e.name&&(t=" "+e.name);var n="page"!==e.type;return"@"+o+e.type+t+_s+stringifyBlock(e,n)+_n}function stringifyComment(e){return _comments?"/*"+(e.text||"")+"*/"+_n:""}function stringifyRule(e){var t;return e.selectors?t=e.selectors.join(","+_n):(t="@"+e.type,t+=e.name?" "+e.name:""),indent()+t+_s+stringifyBlock(e)+_n}function reduce(e,t){return e.reduce(function(e,o){var n="comment"===o.type?stringifyComment(o):t(o);return n&&e.push(n),e},[])}function stringifyBlock(e,t){var o=e.declarations,n=stringifyDeclaration;return e.rules&&(o=e.rules,n=stringifyRule),o=stringifyChildren(o,n),o&&(o=_n+o+(t?"":_n)),"{"+o+indent()+"}"}function stringifyChildren(e,t){if(!e)return"";indent(1);var o=reduce(e,t);return indent(-1),o.length?o.join(_n):""}function stringifyDeclaration(e){return"property"===e.type?stringifyProperty(e):(DEBUG&&debug("stringifyDeclaration: unexpected node:",JSON.stringify(e)),void 0)}function stringifyNode(e){switch(e.type){case"rule":return stringifyRule(e);case"media":case"keyframes":return stringifyAtGroup(e);case"comment":return stringifyComment(e);case"import":case"charset":case"namespace":return stringifyAtRule(e);case"font-face":case"supports":case"viewport":case"document":case"page":return stringifyAtGroup(e)}DEBUG&&debug("stringifyNode: unexpected node: "+JSON.stringify(e))}function stringifyProperty(e){var t=e.name?e.name+":"+_s:"";return indent()+t+e.value+";"}var DEBUG=!1,TIMER=!1,debug=require("./debug")("stringify"),_comments,_compress,_indentation,_n,_s;exports=module.exports=stringify;
66
+
67
+ },{"./debug":13}],17:[function(require,module,exports){
68
+ "use strict";var escapeRe=/([-.*+?^${}()|[\]\/\\])/g,unescapeRe=/\\/g,escape=function(e){return(e+"").replace(escapeRe,"\\$1")},unescape=function(e){return(e+"").replace(unescapeRe,"")},slickRe=RegExp("^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(/<combinator>/,"["+escape(">+~`!@$%^&={}\\;</")+"]").replace(/<unicode>/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(/<unicode1>/g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")),Part=function(e){this.combinator=e||" ",this.tag="*"};Part.prototype.toString=function(){if(!this.raw){var e,t,o="";if(o+=this.tag||"*",this.id&&(o+="#"+this.id),this.classes&&(o+="."+this.classList.join(".")),this.attributes)for(e=0;t=this.attributes[e++];)o+="["+t.name+(t.operator?t.operator+'"'+t.value+'"':"")+"]";if(this.pseudos)for(e=0;t=this.pseudos[e++];)o+=":"+t.name,t.value&&(o+="("+t.value+")");this.raw=o}return this.raw};var Expression=function(){this.length=0};Expression.prototype.toString=function(){if(!this.raw){for(var e,t="",o=0;e=this[o++];)1!==o&&(t+=" ")," "!==e.combinator&&(t+=e.combinator+" "),t+=e;this.raw=t}return this.raw};var replacer=function(e,t,o,n,r,i,a,l,s,d,u,c,f,p,m,b){var g,h;if((t||!this.length)&&(g=this[this.length++]=new Expression,t))return"";if(g||(g=this[this.length-1]),(o||n||!g.length)&&(h=g[g.length++]=new Part(o)),h||(h=g[g.length-1]),r)h.tag=unescape(r);else if(i)h.id=unescape(i);else if(a){var v=unescape(a),y=h.classes||(h.classes={});if(!y[v]){y[v]=escape(a);var k=h.classList||(h.classList=[]);k.push(v),k.sort()}}else f?(b=b||m,(h.pseudos||(h.pseudos=[])).push({type:1==c.length?"class":"element",name:unescape(f),escapedName:escape(f),value:b?unescape(b):null,escapedValue:b?escape(b):null})):l&&(u=u?escape(u):null,(h.attributes||(h.attributes=[])).push({operator:s,name:unescape(l),escapedName:escape(l),value:u?unescape(u):null,escapedValue:u?escape(u):null}));return""},Expressions=function(e){this.length=0;for(var t,o=this,n=e;e;){if(t=e.replace(slickRe,function(){return replacer.apply(o,arguments)}),t===e)throw new Error(n+" is an invalid expression");e=t}};Expressions.prototype.toString=function(){if(!this.raw){for(var e,t=[],o=0;e=this[o++];)t.push(e);this.raw=t.join(", ")}return this.raw};var cache={},parse=function(e){return null==e?null:(e=(""+e).replace(/^\s+|\s+$/g,""),cache[e]||(cache[e]=new Expressions(e)))};module.exports=parse;
69
+
70
+ },{}],18:[function(require,module,exports){
71
+ !function(e){function t(e,i){if(e=e?e:"",i=i||{},e instanceof t)return e;if(!(this instanceof t))return new t(e,i);var n=o(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=R(100*this._a)/100,this._format=i.format||n.format,this._gradientType=i.gradientType,this._r<1&&(this._r=R(this._r)),this._g<1&&(this._g=R(this._g)),this._b<1&&(this._b=R(this._b)),this._ok=n.ok,this._tc_id=L++}function o(e){var t={r:0,g:0,b:0},o=1,n=null,r=null,s=null,d=!1,c=!1;return"string"==typeof e&&(e=D(e)),"object"==typeof e&&(A(e.r)&&A(e.g)&&A(e.b)?(t=i(e.r,e.g,e.b),d=!0,c="%"===String(e.r).substr(-1)?"prgb":"rgb"):A(e.h)&&A(e.s)&&A(e.v)?(n=E(e.s),r=E(e.v),t=l(e.h,n,r),d=!0,c="hsv"):A(e.h)&&A(e.s)&&A(e.l)&&(n=E(e.s),s=E(e.l),t=a(e.h,n,s),d=!0,c="hsl"),e.hasOwnProperty("a")&&(o=e.a)),o=S(o),{ok:d,format:e.format||c,r:N(255,z(t.r,0)),g:N(255,z(t.g,0)),b:N(255,z(t.b,0)),a:o}}function i(e,t,o){return{r:255*C(e,255),g:255*C(t,255),b:255*C(o,255)}}function n(e,t,o){e=C(e,255),t=C(t,255),o=C(o,255);var i,n,a=z(e,t,o),r=N(e,t,o),l=(a+r)/2;if(a==r)i=n=0;else{var s=a-r;switch(n=l>.5?s/(2-a-r):s/(a+r),a){case e:i=(t-o)/s+(o>t?6:0);break;case t:i=(o-e)/s+2;break;case o:i=(e-t)/s+4}i/=6}return{h:i,s:n,l:l}}function a(e,t,o){function i(e,t,o){return 0>o&&(o+=1),o>1&&(o-=1),1/6>o?e+6*(t-e)*o:.5>o?t:2/3>o?e+6*(t-e)*(2/3-o):e}var n,a,r;if(e=C(e,360),t=C(t,100),o=C(o,100),0===t)n=a=r=o;else{var l=.5>o?o*(1+t):o+t-o*t,s=2*o-l;n=i(s,l,e+1/3),a=i(s,l,e),r=i(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*r}}function r(e,t,o){e=C(e,255),t=C(t,255),o=C(o,255);var i,n,a=z(e,t,o),r=N(e,t,o),l=a,s=a-r;if(n=0===a?0:s/a,a==r)i=0;else{switch(a){case e:i=(t-o)/s+(o>t?6:0);break;case t:i=(o-e)/s+2;break;case o:i=(e-t)/s+4}i/=6}return{h:i,s:n,v:l}}function l(t,o,i){t=6*C(t,360),o=C(o,100),i=C(i,100);var n=e.floor(t),a=t-n,r=i*(1-o),l=i*(1-a*o),s=i*(1-(1-a)*o),d=n%6,c=[i,l,r,r,s,i][d],u=[s,i,i,l,r,r][d],p=[r,r,s,i,i,l][d];return{r:255*c,g:255*u,b:255*p}}function s(e,t,o,i){var n=[M(R(e).toString(16)),M(R(t).toString(16)),M(R(o).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function d(e,t,o,i,n){var a=[M(R(e).toString(16)),M(R(t).toString(16)),M(R(o).toString(16)),M(I(i))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function c(e,t,o,i){var n=[M(I(i)),M(R(e).toString(16)),M(R(t).toString(16)),M(R(o).toString(16))];return n.join("")}function u(e,o){o=0===o?0:o||10;var i=t(e).toHsl();return i.s-=o/100,i.s=H(i.s),t(i)}function p(e,o){o=0===o?0:o||10;var i=t(e).toHsl();return i.s+=o/100,i.s=H(i.s),t(i)}function f(e){return t(e).desaturate(100)}function b(e,o){o=0===o?0:o||10;var i=t(e).toHsl();return i.l+=o/100,i.l=H(i.l),t(i)}function g(e,o){o=0===o?0:o||10;var i=t(e).toRgb();return i.r=z(0,N(255,i.r-R(255*-(o/100)))),i.g=z(0,N(255,i.g-R(255*-(o/100)))),i.b=z(0,N(255,i.b-R(255*-(o/100)))),t(i)}function m(e,o){o=0===o?0:o||10;var i=t(e).toHsl();return i.l-=o/100,i.l=H(i.l),t(i)}function h(e,o){var i=t(e).toHsl(),n=(i.h+o)%360;return i.h=0>n?360+n:n,t(i)}function v(e){var o=t(e).toHsl();return o.h=(o.h+180)%360,t(o)}function k(e){var o=t(e).toHsl(),i=o.h;return[t(e),t({h:(i+120)%360,s:o.s,l:o.l}),t({h:(i+240)%360,s:o.s,l:o.l})]}function y(e){var o=t(e).toHsl(),i=o.h;return[t(e),t({h:(i+90)%360,s:o.s,l:o.l}),t({h:(i+180)%360,s:o.s,l:o.l}),t({h:(i+270)%360,s:o.s,l:o.l})]}function w(e){var o=t(e).toHsl(),i=o.h;return[t(e),t({h:(i+72)%360,s:o.s,l:o.l}),t({h:(i+216)%360,s:o.s,l:o.l})]}function x(e,o,i){o=o||6,i=i||30;var n=t(e).toHsl(),a=360/i,r=[t(e)];for(n.h=(n.h-(a*o>>1)+720)%360;--o;)n.h=(n.h+a)%360,r.push(t(n));return r}function $(e,o){o=o||6;for(var i=t(e).toHsv(),n=i.h,a=i.s,r=i.v,l=[],s=1/o;o--;)l.push(t({h:n,s:a,v:r})),r=(r+s)%1;return l}function _(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[e[o]]=o);return t}function S(e){return e=parseFloat(e),(isNaN(e)||0>e||e>1)&&(e=1),e}function C(t,o){O(t)&&(t="100%");var i=T(t);return t=N(o,z(0,parseFloat(t))),i&&(t=parseInt(t*o,10)/100),e.abs(t-o)<1e-6?1:t%o/parseFloat(o)}function H(e){return N(1,z(0,e))}function q(e){return parseInt(e,16)}function O(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)}function T(e){return"string"==typeof e&&-1!=e.indexOf("%")}function M(e){return 1==e.length?"0"+e:""+e}function E(e){return 1>=e&&(e=100*e+"%"),e}function I(t){return e.round(255*parseFloat(t)).toString(16)}function B(e){return q(e)/255}function A(e){return!!J.CSS_UNIT.exec(e)}function D(e){e=e.replace(P,"").replace(F,"").toLowerCase();var t=!1;if(V[e])e=V[e],t=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};var o;return(o=J.rgb.exec(e))?{r:o[1],g:o[2],b:o[3]}:(o=J.rgba.exec(e))?{r:o[1],g:o[2],b:o[3],a:o[4]}:(o=J.hsl.exec(e))?{h:o[1],s:o[2],l:o[3]}:(o=J.hsla.exec(e))?{h:o[1],s:o[2],l:o[3],a:o[4]}:(o=J.hsv.exec(e))?{h:o[1],s:o[2],v:o[3]}:(o=J.hsva.exec(e))?{h:o[1],s:o[2],v:o[3],a:o[4]}:(o=J.hex8.exec(e))?{r:q(o[1]),g:q(o[2]),b:q(o[3]),a:B(o[4]),format:t?"name":"hex8"}:(o=J.hex6.exec(e))?{r:q(o[1]),g:q(o[2]),b:q(o[3]),format:t?"name":"hex"}:(o=J.hex4.exec(e))?{r:q(o[1]+""+o[1]),g:q(o[2]+""+o[2]),b:q(o[3]+""+o[3]),a:B(o[4]+""+o[4]),format:t?"name":"hex8"}:(o=J.hex3.exec(e))?{r:q(o[1]+""+o[1]),g:q(o[2]+""+o[2]),b:q(o[3]+""+o[3]),format:t?"name":"hex"}:!1}function j(e){var t,o;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),o=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA"),"small"!==o&&"large"!==o&&(o="small"),{level:t,size:o}}var P=/^\s+/,F=/\s+$/,L=0,R=e.round,N=e.min,z=e.max,U=e.random;t.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,o,i,n,a,r,l=this.toRgb();return t=l.r/255,o=l.g/255,i=l.b/255,n=.03928>=t?t/12.92:e.pow((t+.055)/1.055,2.4),a=.03928>=o?o/12.92:e.pow((o+.055)/1.055,2.4),r=.03928>=i?i/12.92:e.pow((i+.055)/1.055,2.4),.2126*n+.7152*a+.0722*r},setAlpha:function(e){return this._a=S(e),this._roundA=R(100*this._a)/100,this},toHsv:function(){var e=r(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=r(this._r,this._g,this._b),t=R(360*e.h),o=R(100*e.s),i=R(100*e.v);return 1==this._a?"hsv("+t+", "+o+"%, "+i+"%)":"hsva("+t+", "+o+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=n(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=n(this._r,this._g,this._b),t=R(360*e.h),o=R(100*e.s),i=R(100*e.l);return 1==this._a?"hsl("+t+", "+o+"%, "+i+"%)":"hsla("+t+", "+o+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return s(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return d(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:R(this._r),g:R(this._g),b:R(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+R(this._r)+", "+R(this._g)+", "+R(this._b)+")":"rgba("+R(this._r)+", "+R(this._g)+", "+R(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:R(100*C(this._r,255))+"%",g:R(100*C(this._g,255))+"%",b:R(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+R(100*C(this._r,255))+"%, "+R(100*C(this._g,255))+"%, "+R(100*C(this._b,255))+"%)":"rgba("+R(100*C(this._r,255))+"%, "+R(100*C(this._g,255))+"%, "+R(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":this._a<1?!1:W[s(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var o="#"+c(this._r,this._g,this._b,this._a),i=o,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=t(e);i="#"+c(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+o+",endColorstr="+i+")"},toString:function(e){var t=!!e;e=e||this._format;var o=!1,i=this._a<1&&this._a>=0,n=!t&&i&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e);return n?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(o=this.toRgbString()),"prgb"===e&&(o=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(o=this.toHexString()),"hex3"===e&&(o=this.toHexString(!0)),"hex4"===e&&(o=this.toHex8String(!0)),"hex8"===e&&(o=this.toHex8String()),"name"===e&&(o=this.toName()),"hsl"===e&&(o=this.toHslString()),"hsv"===e&&(o=this.toHsvString()),o||this.toHexString())},clone:function(){return t(this.toString())},_applyModification:function(e,t){var o=e.apply(null,[this].concat([].slice.call(t)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(u,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(f,arguments)},spin:function(){return this._applyModification(h,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(x,arguments)},complement:function(){return this._applyCombination(v,arguments)},monochromatic:function(){return this._applyCombination($,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(k,arguments)},tetrad:function(){return this._applyCombination(y,arguments)}},t.fromRatio=function(e,o){if("object"==typeof e){var i={};for(var n in e)e.hasOwnProperty(n)&&(i[n]="a"===n?e[n]:E(e[n]));e=i}return t(e,o)},t.equals=function(e,o){return e&&o?t(e).toRgbString()==t(o).toRgbString():!1},t.random=function(){return t.fromRatio({r:U(),g:U(),b:U()})},t.mix=function(e,o,i){i=0===i?0:i||50;var n=t(e).toRgb(),a=t(o).toRgb(),r=i/100,l={r:(a.r-n.r)*r+n.r,g:(a.g-n.g)*r+n.g,b:(a.b-n.b)*r+n.b,a:(a.a-n.a)*r+n.a};return t(l)},t.readability=function(o,i){var n=t(o),a=t(i);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},t.isReadable=function(e,o,i){var n,a,r=t.readability(e,o);switch(a=!1,n=j(i),n.level+n.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7}return a},t.mostReadable=function(e,o,i){var n,a,r,l,s=null,d=0;i=i||{},a=i.includeFallbackColors,r=i.level,l=i.size;for(var c=0;c<o.length;c++)n=t.readability(e,o[c]),n>d&&(d=n,s=t(o[c]));return t.isReadable(e,s,{level:r,size:l})||!a?s:(i.includeFallbackColors=!1,t.mostReadable(e,["#fff","#000"],i))};var V=t.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},W=t.hexNames=_(V),J=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",o="(?:"+t+")|(?:"+e+")",i="[\\s|\\(]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")\\s*\\)?",n="[\\s|\\(]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")\\s*\\)?";return{CSS_UNIT:new RegExp(o),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd?define(function(){return t}):window.tinycolor=t}(Math);
72
+
73
+ },{}],19:[function(require,module,exports){
74
+ (function (global){
75
+ !function(e){e(["jquery"],function(e){return function(){function t(e,t,o){return b({type:w.error,iconClass:m().iconClasses.error,message:e,optionsOverride:o,title:t})}function o(t,o){return t||(t=m()),h=e("#"+t.containerId),h.length?h:(o&&(h=u(t)),h)}function n(e,t,o){return b({type:w.info,iconClass:m().iconClasses.info,message:e,optionsOverride:o,title:t})}function i(e){v=e}function a(e,t,o){return b({type:w.success,iconClass:m().iconClasses.success,message:e,optionsOverride:o,title:t})}function r(e,t,o){return b({type:w.warning,iconClass:m().iconClasses.warning,message:e,optionsOverride:o,title:t})}function l(e,t){var n=m();h||o(n),c(e,n,t)||d(n)}function s(t){var n=m();return h||o(n),t&&0===e(":focus",t).length?(g(t),void 0):(h.children().length&&h.remove(),void 0)}function d(t){for(var o=h.children(),n=o.length-1;n>=0;n--)c(e(o[n]),t)}function c(t,o,n){var i=n&&n.force?n.force:!1;return t&&(i||0===e(":focus",t).length)?(t[o.hideMethod]({duration:o.hideDuration,easing:o.hideEasing,complete:function(){g(t)}}),!0):!1}function u(t){return h=e("<div/>").attr("id",t.containerId).addClass(t.positionClass),h.appendTo(e(t.target)),h}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">&times;</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function f(e){v&&v(e)}function b(t){function n(e){return null==e&&(e=""),e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function i(){s(),c(),u(),p(),b(),v(),d(),a()}function a(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}E.attr("aria-live",e)}function r(){S.closeOnHover&&E.hover(_,$),!S.onclick&&S.tapToDismiss&&E.click(x),S.closeButton&&A&&A.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),S.onCloseClick&&S.onCloseClick(e),x(!0)}),S.onclick&&E.click(function(e){S.onclick(e),x()})}function l(){E.hide(),E[S.showMethod]({duration:S.showDuration,easing:S.showEasing,complete:S.onShown}),S.timeOut>0&&(O=setTimeout(x,S.timeOut),D.maxHideTime=parseFloat(S.timeOut),D.hideEta=(new Date).getTime()+D.maxHideTime,S.progressBar&&(D.intervalId=setInterval(C,10)))}function s(){t.iconClass&&E.addClass(S.toastClass).addClass(T)}function d(){S.newestOnTop?h.prepend(E):h.append(E)}function c(){if(t.title){var e=t.title;S.escapeHtml&&(e=n(t.title)),H.append(e).addClass(S.titleClass),E.append(H)}}function u(){if(t.message){var e=t.message;S.escapeHtml&&(e=n(t.message)),M.append(e).addClass(S.messageClass),E.append(M)}}function p(){S.closeButton&&(A.addClass(S.closeClass).attr("role","button"),E.prepend(A))}function b(){S.progressBar&&(q.addClass(S.progressClass),E.prepend(q))}function v(){S.rtl&&E.addClass("rtl")}function w(e,t){if(e.preventDuplicates){if(t.message===y)return!0;y=t.message}return!1}function x(t){var o=t&&S.closeMethod!==!1?S.closeMethod:S.hideMethod,n=t&&S.closeDuration!==!1?S.closeDuration:S.hideDuration,i=t&&S.closeEasing!==!1?S.closeEasing:S.hideEasing;return!e(":focus",E).length||t?(clearTimeout(D.intervalId),E[o]({duration:n,easing:i,complete:function(){g(E),clearTimeout(O),S.onHidden&&"hidden"!==I.state&&S.onHidden(),I.state="hidden",I.endTime=new Date,f(I)}})):void 0}function $(){(S.timeOut>0||S.extendedTimeOut>0)&&(O=setTimeout(x,S.extendedTimeOut),D.maxHideTime=parseFloat(S.extendedTimeOut),D.hideEta=(new Date).getTime()+D.maxHideTime)}function _(){clearTimeout(O),D.hideEta=0,E.stop(!0,!0)[S.showMethod]({duration:S.showDuration,easing:S.showEasing})}function C(){var e=100*((D.hideEta-(new Date).getTime())/D.maxHideTime);q.width(e+"%")}var S=m(),T=t.iconClass||S.iconClass;if("undefined"!=typeof t.optionsOverride&&(S=e.extend(S,t.optionsOverride),T=t.optionsOverride.iconClass||T),!w(S,t)){k++,h=o(S,!0);var O=null,E=e("<div/>"),H=e("<div/>"),M=e("<div/>"),q=e("<div/>"),A=e(S.closeHtml),D={intervalId:null,hideEta:null,maxHideTime:null},I={toastId:k,state:"visible",startTime:new Date,options:S,map:t};return i(),l(),r(),f(I),S.debug&&console&&console.log(I),E}}function m(){return e.extend({},p(),x.options)}function g(e){h||(h=o()),e.is(":visible")||(e.remove(),e=null,0===h.children().length&&(h.remove(),y=void 0))}var h,v,y,k=0,w={error:"error",info:"info",success:"success",warning:"warning"},x={clear:l,remove:s,error:t,getContainer:o,info:n,options:{},subscribe:i,success:a,version:"2.1.3",warning:r};return x}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t((typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null)):window.toastr=t(window.jQuery)});
76
+
77
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
78
+
79
+ },{}],20:[function(require,module,exports){
80
+ var templateSystem=require("../src/js/bindings/choose-template.js");document.addEventListener("DOMContentLoaded",function(){templateSystem.addTemplate("array","<!-- ko foreach: $data --><!-- ko block: $data --><!-- /ko --><!-- /ko -->"),templateSystem.addTemplate("block-show","<!-- ko block: $data, scrollIntoView: $root.selectedBlock() === $data --><!-- /ko -->"),templateSystem.addTemplate("block-wysiwyg",'<div class="editable block" data-drop-content="Drop here" data-bind="attr: { \'data-drop-content\': $root.t(\'Drop here\') }, click: function(obj, evt) { $root.selectBlock(obj); return true }, clickBubble: false, css: { selected: $root.selectedBlock() === $data }, scrollIntoView: $root.selectedBlock() === $data"> <div class="mo-blockselectionhelper"></div> <div class="tools" data-bind="tooltips: {}"> <!-- ko if: typeof $index != \'undefined\' --> <div title="Drag this handle to move the block" data-bind="attr: { title: $root.t(\'Drag this handle to move the block\') }" class="tool handle"><i class="fa fa-fw fa-sort"></i></div> <!-- ko if: $index() > 0 --> <div title="Move this block upside" data-bind="attr: { title: $root.t(\'Move this block upside\') }" class="tool moveup"><i class="fa fa-fw fa-sort-asc" data-bind=\'click: $root.moveBlock.bind($element, $index, $parent, true)\'></i></div> <!-- /ko --> <!-- ko if: $index() < $parent.blocks().length -1 --> <div title="Move this block downside" data-bind="attr: { title: $root.t(\'Move this block downside\') }" class="tool movedown"><i class="fa fa-fw fa-sort-desc" data-bind=\'click: $root.moveBlock.bind($element, $index, $parent, false)\'></i></div> <!-- /ko --> <div title="Delete block" class="tool delete" data-bind="attr: { title: $root.t(\'Delete block\') }, click: $root.removeBlock.bind($element, $rawData, $parent)"><i class="fa fa-fw fa-trash-o"></i></div> <div title="Duplicate block" class="tool clone" data-bind="attr: { title: $root.t(\'Duplicate block\') }, click: $root.duplicateBlock.bind($element, $index, $parent)"><i class="fa fa-fw fa-files-o"></i></div> <!-- /ko --> <!-- ko if: typeof $data._nextVariant != \'undefined\' --><div title="Switch block variant" class="tool variant" data-bind="attr: { title: $root.t(\'Switch block variant\') }, click: $data._nextVariant"><i class="fa fa-fw fa-magic"></i></div><!-- /ko --> </div> <!-- ko block: $data --><!-- /ko --></div>'),templateSystem.addTemplate("blocks-show","<!-- ko template: { name: 'block-show', foreach: blocks } --><!-- /ko -->"),templateSystem.addTemplate("blocks-wysiwyg","<div class=\"sortable-blocks-edit\" data-drop-content=\"Drop here\" data-empty-content=\"Drop here blocks from the Blocks tab\" data-bind=\"attr: { 'data-drop-content': $root.t('Drop here'), 'data-empty-content': $root.t('Drop here blocks from the &quot;Blocks&quot; tab') }, css: { 'empty': ko.utils.unwrapObservable(blocks).length == 0 }, extsortable: { connectClass: 'sortable-blocks-edit', template: 'block-wysiwyg', data: blocks, dragging: $root.dragging, beforeMove: $root.startMultiple, afterMove: $root.stopMultiple, options: { handle: '.handle', placeholder: $root.placeholderHelper } }\"></div>"),templateSystem.addTemplate("customstyle",'<div class="customStyleHelp" data-bind="html: $root.t(\'Customized block.<ul><li>In this status changes to properties will be specific to the current block (instead of being global to all blocks in the same section)</li><li>A <span class=&quot;customStyled&quot;><span>&quot;small cube&quot; </span></span> icon beside the property will mark the customization. By clicking this icon the property value will be reverted to the value defined for the section.</li></ul>\')">Customized block.<ul><li>In this status changes to properties will be specific to the current block (instead of being global to all blocks in the same section)</li><li>A <span class="customStyled"><span>"small cube" </span></span> icon beside the property will mark the customization. By clicking this icon the property value will be reverted to the value defined for the section.</li></ul></div>'),templateSystem.addTemplate("empty",""),templateSystem.addTemplate("error",'[<div style="background-color: #fff0f0" data-bind="text: ko.toJS($data)"></div>]'),templateSystem.addTemplate("gallery-images",'<div data-bind="foreach: items.currentPageData"> <div class="draggable-item" data-bind="if: typeof thumbnailUrl != \'undefined\'"> <div class="draggable image" data-bind="click: $root.addImage, extdraggable: { data: $data, dropContainer: \'#main-wysiwyg-area\', dragging: $root.draggingImage, \'options\': { \'appendTo\': \'#page\' } }, style: { backgroundImage: \'url(\\\'\' + thumbnailUrl + \'\\\')\' }"> <img title="Drag this image and drop it on any template image placeholder" style="display: block;" data-bind="tooltips: {}, attr: { src: thumbnailUrl, \'title\': $root.t(\'Drag this image and drop it on any template image placeholder\') }"/> </div> </div></div><!-- ko if: items.pageCount() > 1 --><div class="galleryPager" data-bind="buttonset: {}"> <a href="javascript:void(0)" data-bind="click: items.moveFirst, button: { disabled: items.currentPage() == 1, icons: { primary: \'fa fa-fast-backward\' }, text: false }">First</a> <a href="javascript:void(0)" data-bind="click: items.movePrevious, button: { disabled: items.currentPage() == 1, icons: { primary: \'fa fa-backward\' }, text: false }">Previous</a> <span data-bind="button: { disabled: true, text: true, label: \' \'+items.currentPage()+\' di \'+items.pageCount()+\' \' }"> X di Y </span> <a href="javascript:void(0)" data-bind="click: items.moveNext, button: { disabled: items.currentPage() == items.pageCount(), icons: { primary: \'fa fa-forward\' }, text: false }">Next</a> <a href="javascript:void(0)" data-bind="click: items.moveLast, button: { disabled: items.currentPage() == items.pageCount(), icons: { primary: \'fa fa-fast-forward\' }, text: false }">Last</a></div><!-- /ko -->'),templateSystem.addTemplate("img-wysiwyg",'<table tabfocus="0" cellspacing="0" cellpadding="0" data-drop-content="Drop here" data-bind="style: _stylebind, click: function(obj, evt) { $root.selectItem(_item, _data); return true; }, clickBubble: false, fudroppable: { activeClass: \'ui-state-highlight\', hoverClass: \'ui-state-draghover\' }, droppable: { options: { accept: \'.image\', activeClass: \'ui-state-highlight\', hoverClass: \'ui-state-draghover\' }, data: _src, dragged: $root.fileToImage }, css: { selecteditem: $root.isSelectedItem(_item) }, scrollIntoView: $root.isSelectedItem(_item), attr: { \'data-drop-content\': $root.t(\'Drop here\'), width: _width, height: _height, align: _align }" class="img-wysiwyg selectable-img" style="display: table;"><tr><td class="uploadzone"> <div class="mo-imgselectionhelper"></div> <div class="mo-uploadzone"></div> <div class="img-size" data-bind="text: _size">size</div> <div class="midtools" data-bind="tooltips: {}"> <!-- ko if: _src() != \'\' --> <div title="Remove image" class="tool delete" data-bind="attr: { title: $root.t(\'Remove image\') }, click: _src.bind(_src, \'\'), clickBubble: false"><i class="fa fa-fw fa-trash-o"></i></div> <!-- ko if: typeof $root.editImage !== \'undefined\' --> <div title="Open the image editing tool" class="tool edit" data-bind="attr: { title: $root.t(\'Open the image editing tool\') }, click: $root.editImage.bind($element, _src), clickBubble: false"><i class="fa fa-fw fa-pencil"></i></div> <!-- /ko --> <!-- /ko --> <!-- ko if: _src() == \'\' --> <div title="Upload a new image" data-bind="attr: { title: $root.t(\'Upload a new image\') }" class="tool upload" style="position: relative; overflow: hidden;"><i class="fa fa-fw fa-upload"></i> <input class="fileupload nofile" type="file" name="files[]" data-bind="fileupload: { data: _src, onerror: $root.notifier.error, onfile: $root.loadImage, canvasPreview: true }" style="z-index: 20; position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-width: 100%; min-height: 100%; font-size: 999px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; cursor: inherit; display: block"> </div> <!-- /ko --> </div> <!-- ko template: _template --><!-- /ko --> <!-- ko if: _src() == \'\' --> <!-- <img style="display: block;" class="imgplaceholder" width="200" src="" alt="Insert an image here" data-bind="wysiwygSrc: { src: _src.preloaded, placeholder: _placeholdersrc, width: _width, height: _height, method: _method }" /> --> <span class="fileuploadtext" style="text-align: center; display: -ms-flexbox; display: flex; align-items: center; flex-align: center; justify-content: center; padding: 1em; position: absolute; top: 0; left: 0; right: 0; bottom: 0;"><span class="textMiddle" style=" text-shadow: 1px 1px 0 #FFFFFF, 0 0 10px #FFFFFF; font-weight: bold;" data-bind="text: $root.t(\'Drop an image here\')">Drop an image here</span></span> <!-- /ko --> <!-- ko if: _src() != \'\' --> <!-- <img style="display: block;" width="200" src="" data-bind="preloader: _src, wysiwygSrc: { src: _src.preloaded, placeholder: _placeholdersrc, width: _width, height: _height, method: _method }" /> --> <!-- /ko --> <!-- pulsante per la cancellazione --> <div title="Drop an image here or click the upload button" data-bind="attr: { title: $root.t(\'Drop an image here or click the upload button\') }, tooltips: {}" class="workzone" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden;"> <!-- ko if: _src.preloaded && _src() != _src.preloaded() -->PRELOADING....<!-- /ko --> <!-- ko if: _src() != \'\' --> <input class="fileupload withfile" type="file" name="files[]" data-bind="fileupload: { data: _src, onerror: $root.notifier.error, onfile: $root.galleryRecent.unshift.bind($root.galleryRecent), canvasPreview: true }" style="z-index: -20; position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-width: 100%; min-height: 100%; font-zie: 999px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; cursor: inherit; display: block"> <!-- /ko --> <div class="progress" style="opacity: .5; width: 80%; margin-left: 10%; position: absolute; bottom: 30%; height: 20px; border: 2px solid black;"> <div class="progress-bar progress-bar-success" style="height: 20px; background-color: black; "></div> </div> </div></table>'),templateSystem.addTemplate("main",'<div id="page" style="display: none;" data-bind="visible: true, css: { withToolbox: $root.showToolbox, withPreviewFrame: showPreviewFrame }"> <div id="main-edit-area" data-bind="click: function(obj, evt) { $root.selectBlock(null); return true; }, clickBubble: false"> <!-- ko withProperties: { templateMode: \'wysiwyg\', templateModeFallback: \'show\' } --> <div id="main-wysiwyg-area" data-bind="wysiwygScrollfix: true, scrollable: true, fudroppable: { active: draggingImage }, css: { isdragging: dragging, isdraggingimg: draggingImage }, block: content"></div> <!-- /ko --> </div> <div id="toolbar" class="mo" data-bind="tooltips: {}"> <!-- ko if: typeof $root.undo != \'undefined\' --> <span data-bind="buttonset: { }" class="leftButtons"> <a title="Undo last operation" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Undo last operation\') }, click: $root.undo.execute, clickBubble: false, button: { disabled: !$root.undo.enabled(), icons: { primary: \'fa fa-reply\' }, label: $root.undo.name, text: true }">UNDO</a> <a title="Redo last operation" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Redo last operation\') }, click: $root.redo.execute, clickBubble: false, button: { disabled: !$root.redo.enabled(), icons: { primary: \'fa fa-share\' }, label: $root.redo.name, text: true }">REDO</a> </span> <!-- ko if: $root.debug --> <a href="javascript:void(0)" data-bind="click: $root.undoReset, clickBubble: false, button: { disabled: !$root.undo.enabled() && !$root.redo.enabled(), label: \'reset\', text: true }">RESET</a> <!-- /ko --> <!-- /ko --> <span> <input id="showGallery" type="checkbox" data-bind="checked: $root.showGallery, button: { refreshOn: $root.showGallery, icons: { primary: \'fa fa-fw fa-picture-o\', secondary: null }, text: true, label: $root.t(\'Gallery\') }"><label title="Show image gallery" for="showGallery" data-bind="attr: { title: $root.t(\'Show image gallery\') }">show gallery</label></input> </span> <input id="previewFrameToggle" type="checkbox" data-bind="checked: $root.showPreviewFrame, button: { refreshOn: $root.showPreviewFrame, icons: { primary: \'fa fa-fw fa-tablet\', secondary: null }, text: false, label: $root.t(\'Preview\') }"><label title="Show live preview" for="previewFrameToggle" data-bind="attr: { title: $root.t(\'Show live preview\') }">PREVIEW</label></input> <!-- ko if: $root.debug --> <a href="javascript:void(0)" data-bind="click: $root.export, clickBubble: false, button: { label: \'export\', text: true }">EXPORT</a> <input type="checkbox" data-bind="checked: $root.debug" /> debug <a href="javascript:void(0)" data-bind="click: $root.loadDefaultBlocks, clickBubble: false, button: { icons: { primary: \'fa fa-fw fa-upload\' }, label: \'Default\', text: true }">LOAD BLOCKS</a> [<a id="subscriptionsCount" href="javascript:viewModel.loopSubscriptionsCount()">subs</a>] <!-- /ko --> <span data-bind="visible: false"> <input type="checkbox" data-bind="checked: $root.showToolbox" /> toolbox </span> <div class="rightButtons"> <!-- ko if: typeof $root.save !== \'undefined\' --> <a title="Save template" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Save template\') }, click: $root.save.execute, clickBubble: false, button: { disabled: !$root.save.enabled(), icons: { primary: \'fa fa-fw fa-cloud-upload\' }, label: $root.t($root.save.name), text: true }">SALVA</a> <!-- /ko --> <!-- ko if: typeof $root.test !== \'undefined\' --> <a title="Show preview and send test" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Show preview and send test\') }, click: $root.test.execute, clickBubble: false, button: { disabled: !$root.test.enabled(), icons: { primary: \'fa fa-fw fa-paper-plane\' }, label: $root.t($root.test.name), text: true }">TEST</a> <!-- /ko --> <!-- ko if: typeof $root.download !== \'undefined\' --> <form id="downloadForm" action="#" method="POST"> <input type="hidden" name="action" value="download" /> <input type="hidden" name="filename" value="email.html" /> <input type="hidden" name="html" id="downloadHtmlTextarea" /> <a title="Download template" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Download template\') }, click: $root.download.execute, clickBubble: false, button: { disabled: !$root.download.enabled(), icons: { primary: \'fa fa-fw fa-download\' }, label: $root.t($root.download.name), text: true }">DOWNLOAD</a> </form> <!-- /ko --> </div> </div> <!-- ko if: $root.showToolbox --> <div id="main-toolbox" class="mo" data-bind="scrollable: true, withProperties: { templateMode: \'edit\' }"> <div data-bind="template: { name: \'toolbox\' }"></div> </div> <!-- /ko --> <div id="main-preview" class="mo" data-bind="scrollable: true, if: $root.showPreviewFrame"> <div id="preview-toolbar"> <div data-bind="visible: $root.showPreviewFrame, buttonset: { }" style="display: inline-block"> <input id="previewLarge" type="radio" name="previewMode" value="large" data-bind="checked: $root.previewMode, button: { text: false, label: \'large\', icons: { primary: \'fa fa-fw fa-desktop\' } }" /> <label for="previewLarge" title="Large screen" data-bind="attr: { title: $root.t(\'Large screen\') }">Large screen</label> <input id="previewDesktop" type="radio" name="previewMode" value="desktop" data-bind="checked: $root.previewMode, button: { text: false, label: \'desktop\', icons: { primary: \'fa fa-fw fa-tablet\' } }" /> <label for="previewDesktop" title="Tablet" data-bind="attr: { title: $root.t(\'Tablet\') }">Tablet</label> <input id="previewMobile" type="radio" name="previewMode" value="mobile" data-bind="checked: $root.previewMode, button: { text: false, label: \'mobile\', icons: { primary: \'fa fa-fw fa-mobile\' } }" /> <label for="previewMobile" title="Smartphone" data-bind="attr: { title: $root.t(\'Smartphone\') }">Smartphone</label> </div> </div> <div id="frame-container" data-bind="css: { desktop: $root.previewMode() == \'desktop\', mobile: $root.previewMode() == \'mobile\', large: $root.previewMode() == \'large\' }"> <iframe data-bind="bindIframe: $data"></iframe> </div> </div> <div class="mo" id="mo-body"></div> <!-- TODO REMOVE ME <div id="incompatible-browser" title="Unsupported browser" style="display: none" data-bind="attr: { title: $root.t(\'Usupported browser\') }, html: \'<p>Your browser is not supported.</p><p>Use a different browser or try updaring your browser.</p><p>Supported browsers: <ul><li>Internet Explorer &gt;= 10</li><li>Google Chrome &gt;= 30</li><li>Apple Safari &gt;= 5</li><li>Mozilla Firefix &gt;= 20</li></ul></p>\'"> Unsupported browser </div> --> <div id="incompatible-template" title="Saved model is obsolete" style="display: none" data-bind="attr: { title: $root.t(\'Saved model is obsolete\') }, html: $root.t(\'<p>The saved model has been created with a previous, non completely compatible version, of the template</p><p>Some content or style in the model <b>COULD BE LOST</b> if you will <b>save</b></p><p>Contact us for more informations!</p>\')"> Incompatible template </div> <div id="fake-image-editor" title="Fake image editor" style="display: none" data-bind="attr: { title: $root.t(\'Fake image editor\') }, html: $root.t(\'<p>Fake image editor</p>\')"> <p>Fake image editor</p> </div></div><!-- ko if: $root.logoPath --><div id="loading" class="loading" style="display: block; width: 300px; text-align: center; height: 32px; position: absolute; top:0; bottom: 0; left: 0; right: 0; margin: auto;" data-bind="attr: { style: \'position: absolute; top: 5px; left: 6px; z-index: 150;\'}, css: { loading: false }"> <a href="/" data-bind="attr: { href: $root.logoUrl, alt: $root.logoAlt }"><img data-bind="attr: { src: $root.logoPath }" width="32" height="32" alt="mosaico" border="0" /></a> <div style="opacity: 0" data-bind="visible: false">Oppps... !!</div></div><!-- /ko -->'),templateSystem.addTemplate("toolbox",'<div id="tooltabs" class="tabs_horizontal button_color" data-bind="tabs: { active: $root.selectedTool }"> <ul> <li data-bind="tooltips: {}"><a title="Blocks ready to be added to the template" data-local="true" href="#toolblocks" data-bind="attr: { title: $root.t(\'Blocks ready to be added to the template\') }"><i class="fa fa-fw fa-cubes"></i> <span data-bind="html: $root.t(\'Blocks\')">Blocks</span></a></li> <li data-bind="tooltips: {}"><a title="Edit content options" href="#toolcontents" data-local="true" data-bind="attr: { title: $root.t(\'Edit content options\') }"><i class="fa fa-fw fa-pencil"></i> <span data-bind="html: $root.t(\'Content\')">Content</span></a></li> <li data-bind="tooltips: {}"><a title="Edit style options" href="#toolstyles" data-local="true" data-bind="attr: { title: $root.t(\'Edit style options\') }"><i class="fa fa-fw fa-paint-brush"></i> <span data-bind="html: $root.t(\'Style\')">Style</span></a></li> </ul> <div id="toolblocks" data-bind="scrollable: true"> <div class="block-list" data-bind="foreach: blockDefs" style="text-align: center"> <div class="draggable-item" data-bind="withProperties: { templateMode: \'show\' }"> <div class="block" data-bind="extdraggable: { connectClass: \'sortable-blocks-edit\', data: $data, dropContainer: \'#main-wysiwyg-area\', dragging: $root.dragging, \'options\': { handle: \'.handle\', distance: 10, \'appendTo\': \'#page\' } }, click: $root.addBlock" style="position: relative;"> <div title="Click or drag to add this block to the template" class="handle" data-bind="attr: { title: $root.t(\'Click or drag to add this block to the template\') }, tooltips: {}"></div> <img data-bind="attr: { alt: $root.t(\'Block __name__\', { name: ko.utils.unwrapObservable(type) }), src: $root.templatePath(\'edres/\'+ko.utils.unwrapObservable(type)+\'.png\') }" alt="Block __name__" /> </div> <a href="javascript:void(0)" class="addblockbutton" data-bind="click: $root.addBlock, button: { label: $root.t(\'Add\') }">Add</a> </div> </div> </div> <div id="toolcontents" data-bind="scrollable: true"> <!-- ko if: $root.selectedBlock() !== null --> <div data-bind="block: $root.selectedBlock"></div> <!-- /ko --> <!-- ko if: $root.selectedBlock() == null --> <div class="noSelectedBlock" data-bind="text: $root.t(\'By clicking on message parts you will select a block and content options, if any, will show here\')">By clicking on message parts you will select a block and content options, if any, will show here</div> <!-- /ko --> <!-- ko block: content --><!-- /ko --> </div> <div id="toolstyles" data-bind="scrollable: true, withProperties: { templateMode: \'styler\' }"> <!-- ko if: typeof $root.content().theme === \'undefined\' || typeof $root.content().theme().scheme === \'undefined\' || $root.content().theme().scheme() === \'custom\' --> <!-- ko if: $root.selectedBlock() !== null --> <div data-bind="block: $root.selectedBlock, css: { workLocal: $root.selectedBlock().customStyle, workGlobal: typeof $root.selectedBlock().customStyle === \'undefined\' || !$root.selectedBlock().customStyle() }"></div> <!-- /ko --> <!-- ko if: $root.selectedBlock() == null --> <div class="noSelectedBlock" data-bind="text: $root.t(\'By clicking on message parts you will select a block and style options, if available, will show here\')">By clicking on message parts you will select a block and style options, if available, will show here</div> <!-- /ko --> <div class="workGlobalContent"> <!-- ko block: content --><!-- /ko --> </div> <!-- /ko --> </div></div> <div id="toolimages" class="slidebar" data-bind="scrollable: true, css: { hidden: $root.showGallery() === false }"> <div class="close" data-bind="click: $root.showGallery.bind($element, false);">X</div> <span class="pane-title" data-bind="text: $root.t(\'Gallery:\')">Gallery:</span> <div data-drop-content="Drop here" class="img-dropzone pane uploadzone" data-bind="attr: { \'data-drop-content\': $root.t(\'Drop here\') }, fudroppable: { activeClass: \'ui-state-highlight\', hoverClass: \'ui-state-draghover\' }"> <div class="mo-uploadzone" style="position: relative; padding: 2em; border: 2px dotted #808080"> <input class="fileupload" type="file" multiple name="files[]" data-bind="fileupload: { onerror: $root.notifier.error, onfile: $root.loadImage }" style="z-index: 10; position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-width: 100%; min-height: 100%; font-zie: 999px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; cursor: inherit; display: block"> <span data-bind="text: $root.t(\'Click or drag files here\')">Click or drag files here</span> <div class="workzone" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden;"> <div class="progress" style="opacity: .5; width: 80%; margin-left: 10%; position: absolute; bottom: 30%; height: 20px; border: 2px solid black;"> <div class="progress-bar progress-bar-success" style="height: 20px; background-color: black; "></div> </div> </div> </div> </div> <!-- ko if: $root.showGallery() --> <div id="toolimagestab" class="tabs_horizontal" data-bind="tabs: { active: $root.selectedImageTab }"> <ul> <li data-bind="tooltips: {}"><a title="Session images" data-local="true" href="#toolimagesrecent" data-bind="attr: { title: $root.t(\'Session images\') }, text: $root.t(\'Recents\')">Recents</a></li> <li data-bind="tooltips: {}"><a title="Remote gallery" data-local="true" href="#toolimagesgallery" data-bind="attr: { title: $root.t(\'Remote gallery\') }, text: $root.t(\'Gallery\')">Gallery</a></li> </ul> <div id="toolimagesrecent"> <!-- ko if: galleryRecent().length == 0 --><div class="galleryEmpty" data-bind="text: $root.t(\'No images uploaded, yet\')">No images uploaded, yet</div><!-- /ko --> <!-- ko template: {name: \'gallery-images\', data: { items: galleryRecent } } --># recent gallery #<!-- /ko --> </div> <div id="toolimagesgallery" style="text-align: center"> <!-- ko if: $root.galleryLoaded() === false --><a class="loadbutton" title="Show images from the gallery" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Show images from the gallery\') }, click: $root.loadGallery, button: { disabled: $root.galleryLoaded, icons: { primary: \'fa fa-fw fa-picture-o\' }, label: $root.galleryLoaded() == \'loading\' ? $root.t(\'Loading...\') : $root.t(\'Load gallery\'), text: true }"># load gally #</a><!-- /ko --> <!-- ko if: $root.galleryLoaded() === \'loading\' --><div class="galleryEmpty" data-bind="text: $root.t(\'Loading gallery...\')">Loading gallery...</div><!-- /ko --> <!-- ko if: $root.galleryLoaded() === 0 --><div class="galleryEmpty" data-bind="text: $root.t(\'The gallery is empty\')">The gallery is empty</div><!-- /ko --> <!-- ko template: {name: \'gallery-images\', data: { items: galleryRemote } } --># remote gallery #<!-- /ko --> </div> </div> <!-- /ko --></div><div id="tooldebug" class="slidebar" data-bind="css: { hidden: $root.debug() === false }"> <div class="close" data-bind="click: $root.debug.bind($element, false);">X</div> <!-- ko if: $root.debug --> Content: <pre data-bind=\'text: ko.toJSON(content, null, 2)\' style="overflow: auto; height: 20%"></pre> BlockDefs: <pre data-bind=\'text: ko.toJSON(blockDefs, null, 2)\' style="overflow: auto; height: 20%"></pre> <!-- /ko --> <a href="javascript:void(0)" data-bind="click: $root.exportHTMLtoTextarea.bind($element, \'#outputhtml\'); clickBubble: false, button: { text: true, label:\'Generate\' }">Output</a> <a href="javascript:void(0)" data-bind="click: $root.exportJSONtoTextarea.bind($element, \'#outputhtml\'); clickBubble: false, button: { text: true, label:\'Export\' }">Export</a> <a href="javascript:void(0)" data-bind="click: $root.importJSONfromTextarea.bind($element, \'#outputhtml\'); clickBubble: false, button: { text: true, label:\'Import\' }">Import</a> <textarea id="outputhtml" rows="10" style="width: 100%;"></textarea></div><div id="tooltheme" class="ui-widget slidebar" data-bind="css: { hidden: $root.showTheme() === false }"> <div class="close" data-bind="click: $root.showTheme.bind($element, false);">X</div> <!-- ko withProperties: { templateMode: \'styler\' } --> <!-- ko if: $root.showTheme --> <!-- ko block: $root.content().theme --><!-- /ko --> <!-- /ko --> <!-- /ko --></div>')});
81
+
82
+ },{"../src/js/bindings/choose-template.js":30}],21:[function(require,module,exports){
83
+ // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
84
+ //
85
+ // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
86
+ //
87
+ // Originally from narwhal.js (http://narwhaljs.org)
88
+ // Copyright (c) 2009 Thomas Robinson <280north.com>
89
+ //
90
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
91
+ // of this software and associated documentation files (the 'Software'), to
92
+ // deal in the Software without restriction, including without limitation the
93
+ // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
94
+ // sell copies of the Software, and to permit persons to whom the Software is
95
+ // furnished to do so, subject to the following conditions:
96
+ //
97
+ // The above copyright notice and this permission notice shall be included in
98
+ // all copies or substantial portions of the Software.
99
+ //
100
+ // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
101
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
102
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
103
+ // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
104
+ // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
105
+ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
106
+
107
+ // when used in node, this will actually load the util module we depend on
108
+ // versus loading the builtin util module as happens otherwise
109
+ // this is a bug in node module loading as far as I am concerned
110
+ var util = require('util/');
111
+
112
+ var pSlice = Array.prototype.slice;
113
+ var hasOwn = Object.prototype.hasOwnProperty;
114
+
115
+ // 1. The assert module provides functions that throw
116
+ // AssertionError's when particular conditions are not met. The
117
+ // assert module must conform to the following interface.
118
+
119
+ var assert = module.exports = ok;
120
+
121
+ // 2. The AssertionError is defined in assert.
122
+ // new assert.AssertionError({ message: message,
123
+ // actual: actual,
124
+ // expected: expected })
125
+
126
+ assert.AssertionError = function AssertionError(options) {
127
+ this.name = 'AssertionError';
128
+ this.actual = options.actual;
129
+ this.expected = options.expected;
130
+ this.operator = options.operator;
131
+ if (options.message) {
132
+ this.message = options.message;
133
+ this.generatedMessage = false;
134
+ } else {
135
+ this.message = getMessage(this);
136
+ this.generatedMessage = true;
137
+ }
138
+ var stackStartFunction = options.stackStartFunction || fail;
139
+
140
+ if (Error.captureStackTrace) {
141
+ Error.captureStackTrace(this, stackStartFunction);
142
+ }
143
+ else {
144
+ // non v8 browsers so we can have a stacktrace
145
+ var err = new Error();
146
+ if (err.stack) {
147
+ var out = err.stack;
148
+
149
+ // try to strip useless frames
150
+ var fn_name = stackStartFunction.name;
151
+ var idx = out.indexOf('\n' + fn_name);
152
+ if (idx >= 0) {
153
+ // once we have located the function frame
154
+ // we need to strip out everything before it (and its line)
155
+ var next_line = out.indexOf('\n', idx + 1);
156
+ out = out.substring(next_line + 1);
157
+ }
158
+
159
+ this.stack = out;
160
+ }
161
+ }
162
+ };
163
+
164
+ // assert.AssertionError instanceof Error
165
+ util.inherits(assert.AssertionError, Error);
166
+
167
+ function replacer(key, value) {
168
+ if (util.isUndefined(value)) {
169
+ return '' + value;
170
+ }
171
+ if (util.isNumber(value) && !isFinite(value)) {
172
+ return value.toString();
173
+ }
174
+ if (util.isFunction(value) || util.isRegExp(value)) {
175
+ return value.toString();
176
+ }
177
+ return value;
178
+ }
179
+
180
+ function truncate(s, n) {
181
+ if (util.isString(s)) {
182
+ return s.length < n ? s : s.slice(0, n);
183
+ } else {
184
+ return s;
185
+ }
186
+ }
187
+
188
+ function getMessage(self) {
189
+ return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +
190
+ self.operator + ' ' +
191
+ truncate(JSON.stringify(self.expected, replacer), 128);
192
+ }
193
+
194
+ // At present only the three keys mentioned above are used and
195
+ // understood by the spec. Implementations or sub modules can pass
196
+ // other keys to the AssertionError's constructor - they will be
197
+ // ignored.
198
+
199
+ // 3. All of the following functions must throw an AssertionError
200
+ // when a corresponding condition is not met, with a message that
201
+ // may be undefined if not provided. All assertion methods provide
202
+ // both the actual and expected values to the assertion error for
203
+ // display purposes.
204
+
205
+ function fail(actual, expected, message, operator, stackStartFunction) {
206
+ throw new assert.AssertionError({
207
+ message: message,
208
+ actual: actual,
209
+ expected: expected,
210
+ operator: operator,
211
+ stackStartFunction: stackStartFunction
212
+ });
213
+ }
214
+
215
+ // EXTENSION! allows for well behaved errors defined elsewhere.
216
+ assert.fail = fail;
217
+
218
+ // 4. Pure assertion tests whether a value is truthy, as determined
219
+ // by !!guard.
220
+ // assert.ok(guard, message_opt);
221
+ // This statement is equivalent to assert.equal(true, !!guard,
222
+ // message_opt);. To test strictly for the value true, use
223
+ // assert.strictEqual(true, guard, message_opt);.
224
+
225
+ function ok(value, message) {
226
+ if (!value) fail(value, true, message, '==', assert.ok);
227
+ }
228
+ assert.ok = ok;
229
+
230
+ // 5. The equality assertion tests shallow, coercive equality with
231
+ // ==.
232
+ // assert.equal(actual, expected, message_opt);
233
+
234
+ assert.equal = function equal(actual, expected, message) {
235
+ if (actual != expected) fail(actual, expected, message, '==', assert.equal);
236
+ };
237
+
238
+ // 6. The non-equality assertion tests for whether two objects are not equal
239
+ // with != assert.notEqual(actual, expected, message_opt);
240
+
241
+ assert.notEqual = function notEqual(actual, expected, message) {
242
+ if (actual == expected) {
243
+ fail(actual, expected, message, '!=', assert.notEqual);
244
+ }
245
+ };
246
+
247
+ // 7. The equivalence assertion tests a deep equality relation.
248
+ // assert.deepEqual(actual, expected, message_opt);
249
+
250
+ assert.deepEqual = function deepEqual(actual, expected, message) {
251
+ if (!_deepEqual(actual, expected)) {
252
+ fail(actual, expected, message, 'deepEqual', assert.deepEqual);
253
+ }
254
+ };
255
+
256
+ function _deepEqual(actual, expected) {
257
+ // 7.1. All identical values are equivalent, as determined by ===.
258
+ if (actual === expected) {
259
+ return true;
260
+
261
+ } else if (util.isBuffer(actual) && util.isBuffer(expected)) {
262
+ if (actual.length != expected.length) return false;
263
+
264
+ for (var i = 0; i < actual.length; i++) {
265
+ if (actual[i] !== expected[i]) return false;
266
+ }
267
+
268
+ return true;
269
+
270
+ // 7.2. If the expected value is a Date object, the actual value is
271
+ // equivalent if it is also a Date object that refers to the same time.
272
+ } else if (util.isDate(actual) && util.isDate(expected)) {
273
+ return actual.getTime() === expected.getTime();
274
+
275
+ // 7.3 If the expected value is a RegExp object, the actual value is
276
+ // equivalent if it is also a RegExp object with the same source and
277
+ // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
278
+ } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
279
+ return actual.source === expected.source &&
280
+ actual.global === expected.global &&
281
+ actual.multiline === expected.multiline &&
282
+ actual.lastIndex === expected.lastIndex &&
283
+ actual.ignoreCase === expected.ignoreCase;
284
+
285
+ // 7.4. Other pairs that do not both pass typeof value == 'object',
286
+ // equivalence is determined by ==.
287
+ } else if (!util.isObject(actual) && !util.isObject(expected)) {
288
+ return actual == expected;
289
+
290
+ // 7.5 For all other Object pairs, including Array objects, equivalence is
291
+ // determined by having the same number of owned properties (as verified
292
+ // with Object.prototype.hasOwnProperty.call), the same set of keys
293
+ // (although not necessarily the same order), equivalent values for every
294
+ // corresponding key, and an identical 'prototype' property. Note: this
295
+ // accounts for both named and indexed properties on Arrays.
296
+ } else {
297
+ return objEquiv(actual, expected);
298
+ }
299
+ }
300
+
301
+ function isArguments(object) {
302
+ return Object.prototype.toString.call(object) == '[object Arguments]';
303
+ }
304
+
305
+ function objEquiv(a, b) {
306
+ if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))
307
+ return false;
308
+ // an identical 'prototype' property.
309
+ if (a.prototype !== b.prototype) return false;
310
+ // if one is a primitive, the other must be same
311
+ if (util.isPrimitive(a) || util.isPrimitive(b)) {
312
+ return a === b;
313
+ }
314
+ var aIsArgs = isArguments(a),
315
+ bIsArgs = isArguments(b);
316
+ if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
317
+ return false;
318
+ if (aIsArgs) {
319
+ a = pSlice.call(a);
320
+ b = pSlice.call(b);
321
+ return _deepEqual(a, b);
322
+ }
323
+ var ka = objectKeys(a),
324
+ kb = objectKeys(b),
325
+ key, i;
326
+ // having the same number of owned properties (keys incorporates
327
+ // hasOwnProperty)
328
+ if (ka.length != kb.length)
329
+ return false;
330
+ //the same set of keys (although not necessarily the same order),
331
+ ka.sort();
332
+ kb.sort();
333
+ //~~~cheap key test
334
+ for (i = ka.length - 1; i >= 0; i--) {
335
+ if (ka[i] != kb[i])
336
+ return false;
337
+ }
338
+ //equivalent values for every corresponding key, and
339
+ //~~~possibly expensive deep test
340
+ for (i = ka.length - 1; i >= 0; i--) {
341
+ key = ka[i];
342
+ if (!_deepEqual(a[key], b[key])) return false;
343
+ }
344
+ return true;
345
+ }
346
+
347
+ // 8. The non-equivalence assertion tests for any deep inequality.
348
+ // assert.notDeepEqual(actual, expected, message_opt);
349
+
350
+ assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
351
+ if (_deepEqual(actual, expected)) {
352
+ fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
353
+ }
354
+ };
355
+
356
+ // 9. The strict equality assertion tests strict equality, as determined by ===.
357
+ // assert.strictEqual(actual, expected, message_opt);
358
+
359
+ assert.strictEqual = function strictEqual(actual, expected, message) {
360
+ if (actual !== expected) {
361
+ fail(actual, expected, message, '===', assert.strictEqual);
362
+ }
363
+ };
364
+
365
+ // 10. The strict non-equality assertion tests for strict inequality, as
366
+ // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
367
+
368
+ assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
369
+ if (actual === expected) {
370
+ fail(actual, expected, message, '!==', assert.notStrictEqual);
371
+ }
372
+ };
373
+
374
+ function expectedException(actual, expected) {
375
+ if (!actual || !expected) {
376
+ return false;
377
+ }
378
+
379
+ if (Object.prototype.toString.call(expected) == '[object RegExp]') {
380
+ return expected.test(actual);
381
+ } else if (actual instanceof expected) {
382
+ return true;
383
+ } else if (expected.call({}, actual) === true) {
384
+ return true;
385
+ }
386
+
387
+ return false;
388
+ }
389
+
390
+ function _throws(shouldThrow, block, expected, message) {
391
+ var actual;
392
+
393
+ if (util.isString(expected)) {
394
+ message = expected;
395
+ expected = null;
396
+ }
397
+
398
+ try {
399
+ block();
400
+ } catch (e) {
401
+ actual = e;
402
+ }
403
+
404
+ message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
405
+ (message ? ' ' + message : '.');
406
+
407
+ if (shouldThrow && !actual) {
408
+ fail(actual, expected, 'Missing expected exception' + message);
409
+ }
410
+
411
+ if (!shouldThrow && expectedException(actual, expected)) {
412
+ fail(actual, expected, 'Got unwanted exception' + message);
413
+ }
414
+
415
+ if ((shouldThrow && actual && expected &&
416
+ !expectedException(actual, expected)) || (!shouldThrow && actual)) {
417
+ throw actual;
418
+ }
419
+ }
420
+
421
+ // 11. Expected to throw an error:
422
+ // assert.throws(block, Error_opt, message_opt);
423
+
424
+ assert.throws = function(block, /*optional*/error, /*optional*/message) {
425
+ _throws.apply(this, [true].concat(pSlice.call(arguments)));
426
+ };
427
+
428
+ // EXTENSION! This is annoying to write outside this module.
429
+ assert.doesNotThrow = function(block, /*optional*/message) {
430
+ _throws.apply(this, [false].concat(pSlice.call(arguments)));
431
+ };
432
+
433
+ assert.ifError = function(err) { if (err) {throw err;}};
434
+
435
+ var objectKeys = Object.keys || function (obj) {
436
+ var keys = [];
437
+ for (var key in obj) {
438
+ if (hasOwn.call(obj, key)) keys.push(key);
439
+ }
440
+ return keys;
441
+ };
442
+
443
+ },{"util/":26}],22:[function(require,module,exports){
444
+ exports.endianness = function () { return 'LE' };
445
+
446
+ exports.hostname = function () {
447
+ if (typeof location !== 'undefined') {
448
+ return location.hostname
449
+ }
450
+ else return '';
451
+ };
452
+
453
+ exports.loadavg = function () { return [] };
454
+
455
+ exports.uptime = function () { return 0 };
456
+
457
+ exports.freemem = function () {
458
+ return Number.MAX_VALUE;
459
+ };
460
+
461
+ exports.totalmem = function () {
462
+ return Number.MAX_VALUE;
463
+ };
464
+
465
+ exports.cpus = function () { return [] };
466
+
467
+ exports.type = function () { return 'Browser' };
468
+
469
+ exports.release = function () {
470
+ if (typeof navigator !== 'undefined') {
471
+ return navigator.appVersion;
472
+ }
473
+ return '';
474
+ };
475
+
476
+ exports.networkInterfaces
477
+ = exports.getNetworkInterfaces
478
+ = function () { return {} };
479
+
480
+ exports.arch = function () { return 'javascript' };
481
+
482
+ exports.platform = function () { return 'browser' };
483
+
484
+ exports.tmpdir = exports.tmpDir = function () {
485
+ return '/tmp';
486
+ };
487
+
488
+ exports.EOL = '\n';
489
+
490
+ },{}],23:[function(require,module,exports){
491
+ // shim for using process in browser
492
+ var process = module.exports = {};
493
+
494
+ // cached from whatever global is present so that test runners that stub it
495
+ // don't break things. But we need to wrap it in a try catch in case it is
496
+ // wrapped in strict mode code which doesn't define any globals. It's inside a
497
+ // function because try/catches deoptimize in certain engines.
498
+
499
+ var cachedSetTimeout;
500
+ var cachedClearTimeout;
501
+
502
+ function defaultSetTimout() {
503
+ throw new Error('setTimeout has not been defined');
504
+ }
505
+ function defaultClearTimeout () {
506
+ throw new Error('clearTimeout has not been defined');
507
+ }
508
+ (function () {
509
+ try {
510
+ if (typeof setTimeout === 'function') {
511
+ cachedSetTimeout = setTimeout;
512
+ } else {
513
+ cachedSetTimeout = defaultSetTimout;
514
+ }
515
+ } catch (e) {
516
+ cachedSetTimeout = defaultSetTimout;
517
+ }
518
+ try {
519
+ if (typeof clearTimeout === 'function') {
520
+ cachedClearTimeout = clearTimeout;
521
+ } else {
522
+ cachedClearTimeout = defaultClearTimeout;
523
+ }
524
+ } catch (e) {
525
+ cachedClearTimeout = defaultClearTimeout;
526
+ }
527
+ } ())
528
+ function runTimeout(fun) {
529
+ if (cachedSetTimeout === setTimeout) {
530
+ //normal enviroments in sane situations
531
+ return setTimeout(fun, 0);
532
+ }
533
+ // if setTimeout wasn't available but was latter defined
534
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
535
+ cachedSetTimeout = setTimeout;
536
+ return setTimeout(fun, 0);
537
+ }
538
+ try {
539
+ // when when somebody has screwed with setTimeout but no I.E. maddness
540
+ return cachedSetTimeout(fun, 0);
541
+ } catch(e){
542
+ try {
543
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
544
+ return cachedSetTimeout.call(null, fun, 0);
545
+ } catch(e){
546
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
547
+ return cachedSetTimeout.call(this, fun, 0);
548
+ }
549
+ }
550
+
551
+
552
+ }
553
+ function runClearTimeout(marker) {
554
+ if (cachedClearTimeout === clearTimeout) {
555
+ //normal enviroments in sane situations
556
+ return clearTimeout(marker);
557
+ }
558
+ // if clearTimeout wasn't available but was latter defined
559
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
560
+ cachedClearTimeout = clearTimeout;
561
+ return clearTimeout(marker);
562
+ }
563
+ try {
564
+ // when when somebody has screwed with setTimeout but no I.E. maddness
565
+ return cachedClearTimeout(marker);
566
+ } catch (e){
567
+ try {
568
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
569
+ return cachedClearTimeout.call(null, marker);
570
+ } catch (e){
571
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
572
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
573
+ return cachedClearTimeout.call(this, marker);
574
+ }
575
+ }
576
+
577
+
578
+
579
+ }
580
+ var queue = [];
581
+ var draining = false;
582
+ var currentQueue;
583
+ var queueIndex = -1;
584
+
585
+ function cleanUpNextTick() {
586
+ if (!draining || !currentQueue) {
587
+ return;
588
+ }
589
+ draining = false;
590
+ if (currentQueue.length) {
591
+ queue = currentQueue.concat(queue);
592
+ } else {
593
+ queueIndex = -1;
594
+ }
595
+ if (queue.length) {
596
+ drainQueue();
597
+ }
598
+ }
599
+
600
+ function drainQueue() {
601
+ if (draining) {
602
+ return;
603
+ }
604
+ var timeout = runTimeout(cleanUpNextTick);
605
+ draining = true;
606
+
607
+ var len = queue.length;
608
+ while(len) {
609
+ currentQueue = queue;
610
+ queue = [];
611
+ while (++queueIndex < len) {
612
+ if (currentQueue) {
613
+ currentQueue[queueIndex].run();
614
+ }
615
+ }
616
+ queueIndex = -1;
617
+ len = queue.length;
618
+ }
619
+ currentQueue = null;
620
+ draining = false;
621
+ runClearTimeout(timeout);
622
+ }
623
+
624
+ process.nextTick = function (fun) {
625
+ var args = new Array(arguments.length - 1);
626
+ if (arguments.length > 1) {
627
+ for (var i = 1; i < arguments.length; i++) {
628
+ args[i - 1] = arguments[i];
629
+ }
630
+ }
631
+ queue.push(new Item(fun, args));
632
+ if (queue.length === 1 && !draining) {
633
+ runTimeout(drainQueue);
634
+ }
635
+ };
636
+
637
+ // v8 likes predictible objects
638
+ function Item(fun, array) {
639
+ this.fun = fun;
640
+ this.array = array;
641
+ }
642
+ Item.prototype.run = function () {
643
+ this.fun.apply(null, this.array);
644
+ };
645
+ process.title = 'browser';
646
+ process.browser = true;
647
+ process.env = {};
648
+ process.argv = [];
649
+ process.version = ''; // empty string to avoid regexp issues
650
+ process.versions = {};
651
+
652
+ function noop() {}
653
+
654
+ process.on = noop;
655
+ process.addListener = noop;
656
+ process.once = noop;
657
+ process.off = noop;
658
+ process.removeListener = noop;
659
+ process.removeAllListeners = noop;
660
+ process.emit = noop;
661
+ process.prependListener = noop;
662
+ process.prependOnceListener = noop;
663
+
664
+ process.listeners = function (name) { return [] }
665
+
666
+ process.binding = function (name) {
667
+ throw new Error('process.binding is not supported');
668
+ };
669
+
670
+ process.cwd = function () { return '/' };
671
+ process.chdir = function (dir) {
672
+ throw new Error('process.chdir is not supported');
673
+ };
674
+ process.umask = function() { return 0; };
675
+
676
+ },{}],24:[function(require,module,exports){
677
+ if (typeof Object.create === 'function') {
678
+ // implementation from standard node.js 'util' module
679
+ module.exports = function inherits(ctor, superCtor) {
680
+ ctor.super_ = superCtor
681
+ ctor.prototype = Object.create(superCtor.prototype, {
682
+ constructor: {
683
+ value: ctor,
684
+ enumerable: false,
685
+ writable: true,
686
+ configurable: true
687
+ }
688
+ });
689
+ };
690
+ } else {
691
+ // old school shim for old browsers
692
+ module.exports = function inherits(ctor, superCtor) {
693
+ ctor.super_ = superCtor
694
+ var TempCtor = function () {}
695
+ TempCtor.prototype = superCtor.prototype
696
+ ctor.prototype = new TempCtor()
697
+ ctor.prototype.constructor = ctor
698
+ }
699
+ }
700
+
701
+ },{}],25:[function(require,module,exports){
702
+ module.exports = function isBuffer(arg) {
703
+ return arg && typeof arg === 'object'
704
+ && typeof arg.copy === 'function'
705
+ && typeof arg.fill === 'function'
706
+ && typeof arg.readUInt8 === 'function';
707
+ }
708
+ },{}],26:[function(require,module,exports){
709
+ (function (process,global){
710
+ // Copyright Joyent, Inc. and other Node contributors.
711
+ //
712
+ // Permission is hereby granted, free of charge, to any person obtaining a
713
+ // copy of this software and associated documentation files (the
714
+ // "Software"), to deal in the Software without restriction, including
715
+ // without limitation the rights to use, copy, modify, merge, publish,
716
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
717
+ // persons to whom the Software is furnished to do so, subject to the
718
+ // following conditions:
719
+ //
720
+ // The above copyright notice and this permission notice shall be included
721
+ // in all copies or substantial portions of the Software.
722
+ //
723
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
724
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
725
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
726
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
727
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
728
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
729
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
730
+
731
+ var formatRegExp = /%[sdj%]/g;
732
+ exports.format = function(f) {
733
+ if (!isString(f)) {
734
+ var objects = [];
735
+ for (var i = 0; i < arguments.length; i++) {
736
+ objects.push(inspect(arguments[i]));
737
+ }
738
+ return objects.join(' ');
739
+ }
740
+
741
+ var i = 1;
742
+ var args = arguments;
743
+ var len = args.length;
744
+ var str = String(f).replace(formatRegExp, function(x) {
745
+ if (x === '%%') return '%';
746
+ if (i >= len) return x;
747
+ switch (x) {
748
+ case '%s': return String(args[i++]);
749
+ case '%d': return Number(args[i++]);
750
+ case '%j':
751
+ try {
752
+ return JSON.stringify(args[i++]);
753
+ } catch (_) {
754
+ return '[Circular]';
755
+ }
756
+ default:
757
+ return x;
758
+ }
759
+ });
760
+ for (var x = args[i]; i < len; x = args[++i]) {
761
+ if (isNull(x) || !isObject(x)) {
762
+ str += ' ' + x;
763
+ } else {
764
+ str += ' ' + inspect(x);
765
+ }
766
+ }
767
+ return str;
768
+ };
769
+
770
+
771
+ // Mark that a method should not be used.
772
+ // Returns a modified function which warns once by default.
773
+ // If --no-deprecation is set, then it is a no-op.
774
+ exports.deprecate = function(fn, msg) {
775
+ // Allow for deprecating things in the process of starting up.
776
+ if (isUndefined(global.process)) {
777
+ return function() {
778
+ return exports.deprecate(fn, msg).apply(this, arguments);
779
+ };
780
+ }
781
+
782
+ if (process.noDeprecation === true) {
783
+ return fn;
784
+ }
785
+
786
+ var warned = false;
787
+ function deprecated() {
788
+ if (!warned) {
789
+ if (process.throwDeprecation) {
790
+ throw new Error(msg);
791
+ } else if (process.traceDeprecation) {
792
+ console.trace(msg);
793
+ } else {
794
+ console.error(msg);
795
+ }
796
+ warned = true;
797
+ }
798
+ return fn.apply(this, arguments);
799
+ }
800
+
801
+ return deprecated;
802
+ };
803
+
804
+
805
+ var debugs = {};
806
+ var debugEnviron;
807
+ exports.debuglog = function(set) {
808
+ if (isUndefined(debugEnviron))
809
+ debugEnviron = process.env.NODE_DEBUG || '';
810
+ set = set.toUpperCase();
811
+ if (!debugs[set]) {
812
+ if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
813
+ var pid = process.pid;
814
+ debugs[set] = function() {
815
+ var msg = exports.format.apply(exports, arguments);
816
+ console.error('%s %d: %s', set, pid, msg);
817
+ };
818
+ } else {
819
+ debugs[set] = function() {};
820
+ }
821
+ }
822
+ return debugs[set];
823
+ };
824
+
825
+
826
+ /**
827
+ * Echos the value of a value. Trys to print the value out
828
+ * in the best way possible given the different types.
829
+ *
830
+ * @param {Object} obj The object to print out.
831
+ * @param {Object} opts Optional options object that alters the output.
832
+ */
833
+ /* legacy: obj, showHidden, depth, colors*/
834
+ function inspect(obj, opts) {
835
+ // default options
836
+ var ctx = {
837
+ seen: [],
838
+ stylize: stylizeNoColor
839
+ };
840
+ // legacy...
841
+ if (arguments.length >= 3) ctx.depth = arguments[2];
842
+ if (arguments.length >= 4) ctx.colors = arguments[3];
843
+ if (isBoolean(opts)) {
844
+ // legacy...
845
+ ctx.showHidden = opts;
846
+ } else if (opts) {
847
+ // got an "options" object
848
+ exports._extend(ctx, opts);
849
+ }
850
+ // set default options
851
+ if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
852
+ if (isUndefined(ctx.depth)) ctx.depth = 2;
853
+ if (isUndefined(ctx.colors)) ctx.colors = false;
854
+ if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
855
+ if (ctx.colors) ctx.stylize = stylizeWithColor;
856
+ return formatValue(ctx, obj, ctx.depth);
857
+ }
858
+ exports.inspect = inspect;
859
+
860
+
861
+ // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
862
+ inspect.colors = {
863
+ 'bold' : [1, 22],
864
+ 'italic' : [3, 23],
865
+ 'underline' : [4, 24],
866
+ 'inverse' : [7, 27],
867
+ 'white' : [37, 39],
868
+ 'grey' : [90, 39],
869
+ 'black' : [30, 39],
870
+ 'blue' : [34, 39],
871
+ 'cyan' : [36, 39],
872
+ 'green' : [32, 39],
873
+ 'magenta' : [35, 39],
874
+ 'red' : [31, 39],
875
+ 'yellow' : [33, 39]
876
+ };
877
+
878
+ // Don't use 'blue' not visible on cmd.exe
879
+ inspect.styles = {
880
+ 'special': 'cyan',
881
+ 'number': 'yellow',
882
+ 'boolean': 'yellow',
883
+ 'undefined': 'grey',
884
+ 'null': 'bold',
885
+ 'string': 'green',
886
+ 'date': 'magenta',
887
+ // "name": intentionally not styling
888
+ 'regexp': 'red'
889
+ };
890
+
891
+
892
+ function stylizeWithColor(str, styleType) {
893
+ var style = inspect.styles[styleType];
894
+
895
+ if (style) {
896
+ return '\u001b[' + inspect.colors[style][0] + 'm' + str +
897
+ '\u001b[' + inspect.colors[style][1] + 'm';
898
+ } else {
899
+ return str;
900
+ }
901
+ }
902
+
903
+
904
+ function stylizeNoColor(str, styleType) {
905
+ return str;
906
+ }
907
+
908
+
909
+ function arrayToHash(array) {
910
+ var hash = {};
911
+
912
+ array.forEach(function(val, idx) {
913
+ hash[val] = true;
914
+ });
915
+
916
+ return hash;
917
+ }
918
+
919
+
920
+ function formatValue(ctx, value, recurseTimes) {
921
+ // Provide a hook for user-specified inspect functions.
922
+ // Check that value is an object with an inspect function on it
923
+ if (ctx.customInspect &&
924
+ value &&
925
+ isFunction(value.inspect) &&
926
+ // Filter out the util module, it's inspect function is special
927
+ value.inspect !== exports.inspect &&
928
+ // Also filter out any prototype objects using the circular check.
929
+ !(value.constructor && value.constructor.prototype === value)) {
930
+ var ret = value.inspect(recurseTimes, ctx);
931
+ if (!isString(ret)) {
932
+ ret = formatValue(ctx, ret, recurseTimes);
933
+ }
934
+ return ret;
935
+ }
936
+
937
+ // Primitive types cannot have properties
938
+ var primitive = formatPrimitive(ctx, value);
939
+ if (primitive) {
940
+ return primitive;
941
+ }
942
+
943
+ // Look up the keys of the object.
944
+ var keys = Object.keys(value);
945
+ var visibleKeys = arrayToHash(keys);
946
+
947
+ if (ctx.showHidden) {
948
+ keys = Object.getOwnPropertyNames(value);
949
+ }
950
+
951
+ // IE doesn't make error fields non-enumerable
952
+ // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
953
+ if (isError(value)
954
+ && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
955
+ return formatError(value);
956
+ }
957
+
958
+ // Some type of object without properties can be shortcutted.
959
+ if (keys.length === 0) {
960
+ if (isFunction(value)) {
961
+ var name = value.name ? ': ' + value.name : '';
962
+ return ctx.stylize('[Function' + name + ']', 'special');
963
+ }
964
+ if (isRegExp(value)) {
965
+ return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
966
+ }
967
+ if (isDate(value)) {
968
+ return ctx.stylize(Date.prototype.toString.call(value), 'date');
969
+ }
970
+ if (isError(value)) {
971
+ return formatError(value);
972
+ }
973
+ }
974
+
975
+ var base = '', array = false, braces = ['{', '}'];
976
+
977
+ // Make Array say that they are Array
978
+ if (isArray(value)) {
979
+ array = true;
980
+ braces = ['[', ']'];
981
+ }
982
+
983
+ // Make functions say that they are functions
984
+ if (isFunction(value)) {
985
+ var n = value.name ? ': ' + value.name : '';
986
+ base = ' [Function' + n + ']';
987
+ }
988
+
989
+ // Make RegExps say that they are RegExps
990
+ if (isRegExp(value)) {
991
+ base = ' ' + RegExp.prototype.toString.call(value);
992
+ }
993
+
994
+ // Make dates with properties first say the date
995
+ if (isDate(value)) {
996
+ base = ' ' + Date.prototype.toUTCString.call(value);
997
+ }
998
+
999
+ // Make error with message first say the error
1000
+ if (isError(value)) {
1001
+ base = ' ' + formatError(value);
1002
+ }
1003
+
1004
+ if (keys.length === 0 && (!array || value.length == 0)) {
1005
+ return braces[0] + base + braces[1];
1006
+ }
1007
+
1008
+ if (recurseTimes < 0) {
1009
+ if (isRegExp(value)) {
1010
+ return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
1011
+ } else {
1012
+ return ctx.stylize('[Object]', 'special');
1013
+ }
1014
+ }
1015
+
1016
+ ctx.seen.push(value);
1017
+
1018
+ var output;
1019
+ if (array) {
1020
+ output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
1021
+ } else {
1022
+ output = keys.map(function(key) {
1023
+ return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
1024
+ });
1025
+ }
1026
+
1027
+ ctx.seen.pop();
1028
+
1029
+ return reduceToSingleString(output, base, braces);
1030
+ }
1031
+
1032
+
1033
+ function formatPrimitive(ctx, value) {
1034
+ if (isUndefined(value))
1035
+ return ctx.stylize('undefined', 'undefined');
1036
+ if (isString(value)) {
1037
+ var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
1038
+ .replace(/'/g, "\\'")
1039
+ .replace(/\\"/g, '"') + '\'';
1040
+ return ctx.stylize(simple, 'string');
1041
+ }
1042
+ if (isNumber(value))
1043
+ return ctx.stylize('' + value, 'number');
1044
+ if (isBoolean(value))
1045
+ return ctx.stylize('' + value, 'boolean');
1046
+ // For some reason typeof null is "object", so special case here.
1047
+ if (isNull(value))
1048
+ return ctx.stylize('null', 'null');
1049
+ }
1050
+
1051
+
1052
+ function formatError(value) {
1053
+ return '[' + Error.prototype.toString.call(value) + ']';
1054
+ }
1055
+
1056
+
1057
+ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
1058
+ var output = [];
1059
+ for (var i = 0, l = value.length; i < l; ++i) {
1060
+ if (hasOwnProperty(value, String(i))) {
1061
+ output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
1062
+ String(i), true));
1063
+ } else {
1064
+ output.push('');
1065
+ }
1066
+ }
1067
+ keys.forEach(function(key) {
1068
+ if (!key.match(/^\d+$/)) {
1069
+ output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
1070
+ key, true));
1071
+ }
1072
+ });
1073
+ return output;
1074
+ }
1075
+
1076
+
1077
+ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
1078
+ var name, str, desc;
1079
+ desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
1080
+ if (desc.get) {
1081
+ if (desc.set) {
1082
+ str = ctx.stylize('[Getter/Setter]', 'special');
1083
+ } else {
1084
+ str = ctx.stylize('[Getter]', 'special');
1085
+ }
1086
+ } else {
1087
+ if (desc.set) {
1088
+ str = ctx.stylize('[Setter]', 'special');
1089
+ }
1090
+ }
1091
+ if (!hasOwnProperty(visibleKeys, key)) {
1092
+ name = '[' + key + ']';
1093
+ }
1094
+ if (!str) {
1095
+ if (ctx.seen.indexOf(desc.value) < 0) {
1096
+ if (isNull(recurseTimes)) {
1097
+ str = formatValue(ctx, desc.value, null);
1098
+ } else {
1099
+ str = formatValue(ctx, desc.value, recurseTimes - 1);
1100
+ }
1101
+ if (str.indexOf('\n') > -1) {
1102
+ if (array) {
1103
+ str = str.split('\n').map(function(line) {
1104
+ return ' ' + line;
1105
+ }).join('\n').substr(2);
1106
+ } else {
1107
+ str = '\n' + str.split('\n').map(function(line) {
1108
+ return ' ' + line;
1109
+ }).join('\n');
1110
+ }
1111
+ }
1112
+ } else {
1113
+ str = ctx.stylize('[Circular]', 'special');
1114
+ }
1115
+ }
1116
+ if (isUndefined(name)) {
1117
+ if (array && key.match(/^\d+$/)) {
1118
+ return str;
1119
+ }
1120
+ name = JSON.stringify('' + key);
1121
+ if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
1122
+ name = name.substr(1, name.length - 2);
1123
+ name = ctx.stylize(name, 'name');
1124
+ } else {
1125
+ name = name.replace(/'/g, "\\'")
1126
+ .replace(/\\"/g, '"')
1127
+ .replace(/(^"|"$)/g, "'");
1128
+ name = ctx.stylize(name, 'string');
1129
+ }
1130
+ }
1131
+
1132
+ return name + ': ' + str;
1133
+ }
1134
+
1135
+
1136
+ function reduceToSingleString(output, base, braces) {
1137
+ var numLinesEst = 0;
1138
+ var length = output.reduce(function(prev, cur) {
1139
+ numLinesEst++;
1140
+ if (cur.indexOf('\n') >= 0) numLinesEst++;
1141
+ return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
1142
+ }, 0);
1143
+
1144
+ if (length > 60) {
1145
+ return braces[0] +
1146
+ (base === '' ? '' : base + '\n ') +
1147
+ ' ' +
1148
+ output.join(',\n ') +
1149
+ ' ' +
1150
+ braces[1];
1151
+ }
1152
+
1153
+ return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
1154
+ }
1155
+
1156
+
1157
+ // NOTE: These type checking functions intentionally don't use `instanceof`
1158
+ // because it is fragile and can be easily faked with `Object.create()`.
1159
+ function isArray(ar) {
1160
+ return Array.isArray(ar);
1161
+ }
1162
+ exports.isArray = isArray;
1163
+
1164
+ function isBoolean(arg) {
1165
+ return typeof arg === 'boolean';
1166
+ }
1167
+ exports.isBoolean = isBoolean;
1168
+
1169
+ function isNull(arg) {
1170
+ return arg === null;
1171
+ }
1172
+ exports.isNull = isNull;
1173
+
1174
+ function isNullOrUndefined(arg) {
1175
+ return arg == null;
1176
+ }
1177
+ exports.isNullOrUndefined = isNullOrUndefined;
1178
+
1179
+ function isNumber(arg) {
1180
+ return typeof arg === 'number';
1181
+ }
1182
+ exports.isNumber = isNumber;
1183
+
1184
+ function isString(arg) {
1185
+ return typeof arg === 'string';
1186
+ }
1187
+ exports.isString = isString;
1188
+
1189
+ function isSymbol(arg) {
1190
+ return typeof arg === 'symbol';
1191
+ }
1192
+ exports.isSymbol = isSymbol;
1193
+
1194
+ function isUndefined(arg) {
1195
+ return arg === void 0;
1196
+ }
1197
+ exports.isUndefined = isUndefined;
1198
+
1199
+ function isRegExp(re) {
1200
+ return isObject(re) && objectToString(re) === '[object RegExp]';
1201
+ }
1202
+ exports.isRegExp = isRegExp;
1203
+
1204
+ function isObject(arg) {
1205
+ return typeof arg === 'object' && arg !== null;
1206
+ }
1207
+ exports.isObject = isObject;
1208
+
1209
+ function isDate(d) {
1210
+ return isObject(d) && objectToString(d) === '[object Date]';
1211
+ }
1212
+ exports.isDate = isDate;
1213
+
1214
+ function isError(e) {
1215
+ return isObject(e) &&
1216
+ (objectToString(e) === '[object Error]' || e instanceof Error);
1217
+ }
1218
+ exports.isError = isError;
1219
+
1220
+ function isFunction(arg) {
1221
+ return typeof arg === 'function';
1222
+ }
1223
+ exports.isFunction = isFunction;
1224
+
1225
+ function isPrimitive(arg) {
1226
+ return arg === null ||
1227
+ typeof arg === 'boolean' ||
1228
+ typeof arg === 'number' ||
1229
+ typeof arg === 'string' ||
1230
+ typeof arg === 'symbol' || // ES6 symbol
1231
+ typeof arg === 'undefined';
1232
+ }
1233
+ exports.isPrimitive = isPrimitive;
1234
+
1235
+ exports.isBuffer = require('./support/isBuffer');
1236
+
1237
+ function objectToString(o) {
1238
+ return Object.prototype.toString.call(o);
1239
+ }
1240
+
1241
+
1242
+ function pad(n) {
1243
+ return n < 10 ? '0' + n.toString(10) : n.toString(10);
1244
+ }
1245
+
1246
+
1247
+ var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
1248
+ 'Oct', 'Nov', 'Dec'];
1249
+
1250
+ // 26 Feb 16:19:34
1251
+ function timestamp() {
1252
+ var d = new Date();
1253
+ var time = [pad(d.getHours()),
1254
+ pad(d.getMinutes()),
1255
+ pad(d.getSeconds())].join(':');
1256
+ return [d.getDate(), months[d.getMonth()], time].join(' ');
1257
+ }
1258
+
1259
+
1260
+ // log is just a thin wrapper to console.log that prepends a timestamp
1261
+ exports.log = function() {
1262
+ console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
1263
+ };
1264
+
1265
+
1266
+ /**
1267
+ * Inherit the prototype methods from one constructor into another.
1268
+ *
1269
+ * The Function.prototype.inherits from lang.js rewritten as a standalone
1270
+ * function (not on Function.prototype). NOTE: If this file is to be loaded
1271
+ * during bootstrapping this function needs to be rewritten using some native
1272
+ * functions as prototype setup using normal JavaScript does not work as
1273
+ * expected during bootstrapping (see mirror.js in r114903).
1274
+ *
1275
+ * @param {function} ctor Constructor function which needs to inherit the
1276
+ * prototype.
1277
+ * @param {function} superCtor Constructor function to inherit prototype from.
1278
+ */
1279
+ exports.inherits = require('inherits');
1280
+
1281
+ exports._extend = function(origin, add) {
1282
+ // Don't do anything if add isn't an object
1283
+ if (!add || !isObject(add)) return origin;
1284
+
1285
+ var keys = Object.keys(add);
1286
+ var i = keys.length;
1287
+ while (i--) {
1288
+ origin[keys[i]] = add[keys[i]];
1289
+ }
1290
+ return origin;
1291
+ };
1292
+
1293
+ function hasOwnProperty(obj, prop) {
1294
+ return Object.prototype.hasOwnProperty.call(obj, prop);
1295
+ }
1296
+
1297
+ }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1298
+
1299
+ },{"./support/isBuffer":25,"_process":23,"inherits":24}],27:[function(require,module,exports){
1300
+ (function (global){
1301
+ "use strict";function _canonicalize(e){var t=global.document.createElement("div");return t.innerHTML="<a></a>",t.firstChild.href=e,t.innerHTML=t.innerHTML,t.firstChild.href}var templateLoader=require("./template-loader.js"),console=require("./../../bower_components/console-browserify/index.js"),ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),$=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null);require("./ko-bindings.js");var performanceAwareCaller=require("./timed-call.js").timedCall,addUndoStackExtensionMaker=require("./undomanager/undomain.js"),colorPlugin=require("./ext/color.js"),inlinerPlugin=require("./ext/inliner.js"),localStorageLoader=require("./ext/localstorage.js");if("undefined"==typeof ko)throw"Cannot find knockout.js library!";if("undefined"==typeof $)throw"Cannot find jquery library!";var applyBindingOptions=function(e,t){t.bindingHandlers.wysiwygSrc.convertedUrl=function(t,o,a,i){var l=e.imgProcessorBackend?e.imgProcessorBackend:"./upload",d=l.match(/^(https?:\/\/[^\/]*\/).*$/),r=t.match(/^(https?:\/\/[^\/]*\/).*$/);if(null===d||null!==r&&d[1]==r[1]){var s=-1==l.indexOf("?")?"?":"&";return l+s+"src="+encodeURIComponent(t)+"&method="+encodeURIComponent(o)+"&params="+encodeURIComponent(a+","+i)}return console.log("Cannot apply backend image resizing to non-local resources ",t,o,a,i,d,r),t+"?method="+o+"&width="+a+(null!==i?"&height="+i:"")},t.bindingHandlers.wysiwygSrc.placeholderUrl=function(t,o){return e.imgProcessorBackend+"?method="+"placeholder"+"&params="+t+encodeURIComponent(",")+o},e&&e.tinymceConfig&&(t.bindingHandlers.wysiwyg.standardOptions=e.tinymceConfig),e&&e.tinymceConfigFull&&(t.bindingHandlers.wysiwyg.fullOptions=e.tinymceConfigFull)},start=function(e,t,o,a,i){templateLoader.fixPageEvents();var l=function(t){var o={messages:{unknownError:t.t("Unknown error"),uploadedBytes:t.t("Uploaded bytes exceed file size"),maxNumberOfFiles:t.t("Maximum number of files exceeded"),acceptFileTypes:t.t("File type not allowed"),maxFileSize:t.t("File is too large"),minFileSize:t.t("File is too small"),post_max_size:t.t("The uploaded file exceeds the post_max_size directive in php.ini"),max_file_size:t.t("File is too big"),min_file_size:t.t("File is too small"),accept_file_types:t.t("Filetype not allowed"),max_number_of_files:t.t("Maximum number of files exceeded"),max_width:t.t("Image exceeds maximum width"),min_width:t.t("Image requires a minimum width"),max_height:t.t("Image exceeds maximum height"),min_height:t.t("Image requires a minimum height"),abort:t.t("File upload aborted"),image_resize:t.t("Failed to resize image"),generic:t.t("Unexpected upload error")}};e&&e.fileuploadConfig&&(o=$.extend(!0,o,e.fileuploadConfig)),ko.bindingHandlers.fileupload.extendOptions=o},d=function(t){e&&e.strings&&(t.t=function(o,a){var i=e.strings[o];return"undefined"==typeof i&&(console.warn("Missing translation string for",o,": using default string"),i=o),t.tt(i,a)})},r=[d,addUndoStackExtensionMaker(performanceAwareCaller),colorPlugin,inlinerPlugin];if("undefined"!=typeof i)for(var s=0;s<i.length;s++)r.push(i[s]);r.push(l);var n=e.fileuploadConfig?e.fileuploadConfig.url:"/upload/";applyBindingOptions(e,ko),$("<!-- ko template: 'main' --><!-- /ko -->").appendTo(global.document.body),"undefined"==typeof t&&"undefined"!=typeof o&&(t=o.template),templateLoader.load(performanceAwareCaller,t,o,a,r,n)},initFromLocalStorage=function(e,t,o){try{var a=localStorageLoader(t,e.emailProcessorBackend),i="undefined"!=typeof o?o:[];i.push(a.extension);var l=_canonicalize(a.metadata.template);start(e,l,a.metadata,a.model,i)}catch(d){console.error("TODO not found ",t,d)}},init=function(e,t){var o=global.location.hash?global.location.href.split("#")[1]:void 0;if(e&&(e.template||e.data))if(e.data){var a=JSON.parse(e.data);start(e,void 0,a.metadata,a.content,t)}else start(e,e.template,void 0,void 0,t);else if(o&&7==o.length)initFromLocalStorage(e,o,t);else{if(!o)return!1;start(e,_canonicalize(o),void 0,void 0,t)}return!0};module.exports={isCompatible:templateLoader.isCompatible,init:init,start:start};
1302
+
1303
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1304
+
1305
+ },{"./../../bower_components/console-browserify/index.js":1,"./ext/color.js":59,"./ext/inliner.js":60,"./ext/localstorage.js":61,"./ko-bindings.js":62,"./template-loader.js":63,"./timed-call.js":64,"./undomanager/undomain.js":65}],28:[function(require,module,exports){
1306
+ (function (global){
1307
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),console=require("./../../../bower_components/console-browserify/index.js"),addScriptTemplate=function(e,t,o){var a=e.createElement("script");return a.setAttribute("type","text/html"),a.setAttribute("id",t),a.text=o,e.body.appendChild(a),a};ko.bindingHandlers.bindIframe={tpl:'<!DOCTYPE html>\r\n<html>\r\n<head>\r\n</head>\r\n<body><div data-bind="block: content"></div></body>\r\n</html>\r\n',init:function(e,t){function o(o){try{var a=e.contentDocument;a.open(),a.write(ko.bindingHandlers.bindIframe.tpl),a.close();try{var i=a.body;if(i){for(var n=e.contentWindow.parent.document.getElementsByTagName("script"),l=0;l<n.length;l++)"text/html"==n[l].getAttribute("type")&&n[l].getAttribute("id")&&addScriptTemplate(a,n[l].getAttribute("id"),n[l].innerHTML);var r=a.getElementsByTagName("HTML");ko.utils.domNodeDisposal.addDisposeCallback(e,function(){ko.cleanNode(r[0]||i)}),ko.applyBindings(t(),r[0]||i)}else console.log("no iframedoc",o)}catch(d){throw console.log("error reading iframe.body",d,o),d}}catch(d){throw console.log("error reading iframe contentDocument",d,o),d}}o("first call")}};
1308
+
1309
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1310
+
1311
+ },{"./../../../bower_components/console-browserify/index.js":1}],29:[function(require,module,exports){
1312
+ (function (global){
1313
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),console=require("./../../../bower_components/console-browserify/index.js");ko.bindingHandlers.withProperties={init:function(e,t,o,a,i){var n=i.createChildContext(i.$rawData,null,function(e){ko.utils.extend(e,t())});return ko.applyBindingsToDescendants(n,e),{controlsDescendantBindings:!0}}},ko.virtualElements.allowedBindings.withProperties=!0,ko.bindingHandlers.log={init:function(e,t){console.log("log",t())}},ko.bindingHandlers.block={templateExists:function(e){var t=global.document.getElementById(e);return t?!0:!1},_chooseTemplate:function(e,t,o,a){var i=t+"-"+o;if(ko.bindingHandlers.block.templateExists(i))return i;if("undefined"!=typeof a&&null!==a)return ko.bindingHandlers.block._chooseTemplate(e,t,a);var n=e?"array":"object-"+o;if(ko.bindingHandlers.block.templateExists(n))return n;throw"cannot find template for "+i+"/"+n},_displayMode:function(e,t){var o="undefined"!=typeof e.type?ko.utils.unwrapObservable(e.type):"notablock-"+typeof e,a="undefined"!=typeof e.splice,i=t.templateMode?t.templateMode:"show";return ko.bindingHandlers.block._chooseTemplate(a,o,i,t.templateModeFallback)},_makeTemplateValueAccessor:function(e,t){return function(){var o,a,i=e(),n=ko.utils.peekObservable(i);if(!n||"object"!=typeof n.data&&"function"!=typeof n.data)o=i;else if(o=n.data,"undefined"!=typeof n.template){var l=ko.utils.unwrapObservable(n.template),r=t.templateMode?t.templateMode:"show";a=ko.bindingHandlers.block._chooseTemplate(!1,l,r,t.templateModeFallback)}var d=ko.utils.unwrapObservable(o);if(ko.isObservable(d)&&console.log("doubleObservable",d),"undefined"==typeof a)if(void 0===o)a="empty";else try{a=ko.bindingHandlers.block._displayMode(d,t)}catch(s){throw console.log(s,d,t.$data,t.templateMode),s}return{name:a,data:o,templateEngine:ko.nativeTemplateEngine.instance}}},init:function(e,t,o,a,i){"undefined"==typeof t()&&console.log("found a null block: check ending commas in arrays defs in IE");var n=ko.bindingHandlers.block._makeTemplateValueAccessor(t,i);return ko.bindingHandlers.template.init(e,n)},update:function(e,t,o,a,i){var n=ko.bindingHandlers.block._makeTemplateValueAccessor(t,i);return ko.bindingHandlers.template.update(e,n,o,a,i)}},ko.expressionRewriting.bindingRewriteValidators.block=!1,ko.virtualElements.allowedBindings.block=!0;
1314
+
1315
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1316
+
1317
+ },{"./../../../bower_components/console-browserify/index.js":1}],30:[function(require,module,exports){
1318
+ "use strict";module.exports=require("./string-template.js");
1319
+
1320
+ },{"./string-template.js":44}],31:[function(require,module,exports){
1321
+ (function (global){
1322
+ "use strict";require("./../../../bower_components/evol-colorpicker/js/evol.colorpicker.min.js");var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),kojqui=(typeof window !== "undefined" ? window['kojqui'] : typeof global !== "undefined" ? global['kojqui'] : null),ColorPicker=function(){kojqui.BindingHandler.call(this,"colorpicker")};ColorPicker.prototype=kojqui.utils.createObject(kojqui.BindingHandler.prototype),ColorPicker.prototype.constructor=ColorPicker,ColorPicker.prototype.init=function(e,t,o){var a=t(),i=a.color,n=ko.computed({read:i,write:i,disposeWhenNodeIsRemoved:e}),l=function(){return n};ko.bindingHandlers.value.init(e,l,o);var r=function(e,t){"undefined"!=typeof t&&n(t)};$(e).on("change.color",r),ko.computed({read:function(){var t={color:ko.utils.unwrapObservable(n),showOn:"button"};for(var o in a)"color"!==o&&a.hasOwnProperty(o)&&(t[o]=ko.utils.unwrapObservable(a[o]));$(e).colorpicker(t)},disposeWhenNodeIsRemoved:e}),ko.utils.domNodeDisposal.addDisposeCallback(e,function(){$(e).off("change.color",r),$(e).colorpicker("destroy")})},kojqui.utils.register(ColorPicker);
1323
+
1324
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1325
+
1326
+ },{"./../../../bower_components/evol-colorpicker/js/evol.colorpicker.min.js":2}],32:[function(require,module,exports){
1327
+ (function (global){
1328
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null);ko.bindingHandlers.cssText={update:function(e,t){var o=ko.utils.unwrapObservable(t());try{e.innerText=o}catch(a){e.styleSheet||(e.innerHTML="a{}"),e.styleSheet.cssText=o}}};
1329
+
1330
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1331
+
1332
+ },{}],33:[function(require,module,exports){
1333
+ (function (global){
1334
+ "use strict";var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null);!function(e){e(ko,$)}(function(e,t){var o="ko_sortItem",a="ko_dragItem",i=(e.utils.unwrapObservable,e.utils.domData.get);e.utils.domData.set,e.bindingHandlers.droppable={init:function(n,l){var r,d=t(n),s=e.utils.unwrapObservable(l())||{},c={};t.extend(!0,c,e.bindingHandlers.droppable),s.data?(s.options&&c.options&&(e.utils.extend(c.options,s.options),delete s.options),e.utils.extend(c,s)):c.data=s,r=c.options.drop,d.droppable(e.utils.extend(c.options,{drop:function(e,t){var n=t.draggable[0],l=i(n,o)||i(n,a);l&&(l.clone&&(l=l.clone()),c.dragged&&(l=c.dragged.call(this,l,e,t)||l),c.data&&c.data(l)),r&&r.apply(this,arguments)}})),void 0!==c.isEnabled&&e.computed({read:function(){d.droppable(e.utils.unwrapObservable(c.isEnabled)?"enable":"disable")},disposeWhenNodeIsRemoved:n})},update:function(){},targetIndex:null,afterMove:null,beforeMove:null,options:{}}});
1335
+
1336
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1337
+
1338
+ },{}],34:[function(require,module,exports){
1339
+ (function (global){
1340
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),$=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),console=require("./../../../bower_components/console-browserify/index.js");ko.bindingHandlers.focusable={focus:function(){},blur:function(){},init:function(e){ko.utils.domNodeDisposal.addDisposeCallback(e,function(){$(e).off("focusin",ko.bindingHandlers.focusable.focus),$(e).off("focusout",ko.bindingHandlers.focusable.blur)}),$(e).on("focusin",ko.bindingHandlers.focusable.focus),$(e).on("focusout",ko.bindingHandlers.focusable.blur)}},ko.bindingHandlers.scrollable={scroll:function(){},init:function(e){ko.utils.domNodeDisposal.addDisposeCallback(e,function(){$(e).off("scroll",ko.bindingHandlers.scrollable.scroll)}),$(e).on("scroll",ko.bindingHandlers.scrollable.scroll)}};
1341
+
1342
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1343
+
1344
+ },{"./../../../bower_components/console-browserify/index.js":1}],35:[function(require,module,exports){
1345
+ (function (global){
1346
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null);ko.extenders.paging=function(e,t){var o=ko.observable(t||10),i=ko.observable(1);return e.pageSize=ko.computed({read:o,write:function(e){e>0?o(e):o(10)}}),e.currentPage=ko.computed({read:i,write:function(t){t>e.pageCount()?i(e.pageCount()):0>=t?i(1):i(t)}}),e.pageCount=ko.computed(function(){return Math.ceil(e().length/e.pageSize())||1}),e.currentPageData=ko.computed(function(){var t=o(),n=i(),a=t*(n-1),r=t*n;return e().slice(a,r)}),e.moveFirst=function(){e.currentPage(1)},e.movePrevious=function(){e.currentPage(e.currentPage()-1)},e.moveNext=function(){e.currentPage(e.currentPage()+1)},e.moveLast=function(){e.currentPage(e.pageCount())},e};
1347
+
1348
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1349
+
1350
+ },{}],36:[function(require,module,exports){
1351
+ (function (global){
1352
+ "use strict";var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),sortable=(typeof window !== "undefined" ? window['jQuery']['ui']['sortable'] : typeof global !== "undefined" ? global['jQuery']['ui']['sortable'] : null),draggable=(typeof window !== "undefined" ? window['jQuery']['ui']['draggable'] : typeof global !== "undefined" ? global['jQuery']['ui']['draggable'] : null),console=require("./../../../bower_components/console-browserify/index.js");if(require("./../../../bower_components/knockout-sortable/build/knockout-sortable.min.js"),"undefined"==typeof sortable)throw"Cannot find jquery-ui sortable widget dependency!";if("undefined"==typeof draggable)throw"Cannot find jquery-ui sortable widget dependency!";var isDraggingHelper=function(e,t){e()?t.type==e()+"stop"&&e(!1):("dragstart"==t.type||"sortstart"==t.type)&&e(t.type.substring(0,4))},makeExtendedValueAccessor=function(e){return function(){var t=e();ko.utils.peekObservable(t),ko.utils.unwrapObservable(t),"undefined"==t.options&&(t.options={});var o=t.options.start;t.options.start=function(e,i){return"undefined"!=typeof t.dragging&&ko.isWritableObservable(t.dragging)&&isDraggingHelper(t.dragging,e),"undefined"!=typeof t.dropContainer&&(t.scrollInterval=global.setInterval(function(){var e=$(t.dropContainer).scrollTop();$(t.dropContainer).scrollTop(e+t.adding)},20)),"undefined"!=typeof o?o(e,i):void 0};var i=t.options.stop;t.options.stop=function(e,o){return"undefined"!=typeof t.dragging&&ko.isWritableObservable(t.dragging)&&isDraggingHelper(t.dragging,e),"undefined"!=typeof t.dropContainer&&global.clearInterval(t.scrollInterval),"undefined"!=typeof i?i(e,o):void 0};var n=t.options.drag;return t.options.drag=function(e,o){if("undefined"!=typeof t.dropContainer){var i=e.pageY-$(t.dropContainer).offset().top,a=i-$(t.dropContainer).height();t.adding=-20>i?-20:0>i?-10:10>i?-5:a>20?20:a>0?10:a>-10?5:0}return"undefined"!=typeof n?n(e,o):void 0},t}};ko.bindingHandlers.extsortable={init:function(e,t,o,i,n){return ko.bindingHandlers.sortable.init(e,makeExtendedValueAccessor(t),o,i,n)},update:function(e,t,o,i,n){return ko.bindingHandlers.sortable.update(e,makeExtendedValueAccessor(t),o,i,n)}},ko.bindingHandlers.extdraggable={init:function(e,t,o,i,n){return ko.bindingHandlers.draggable.init(e,makeExtendedValueAccessor(t),o,i,n)},update:function(e,t,o,i,n){return ko.bindingHandlers.draggable.update(e,makeExtendedValueAccessor(t),o,i,n)}};
1353
+
1354
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1355
+
1356
+ },{"./../../../bower_components/console-browserify/index.js":1,"./../../../bower_components/knockout-sortable/build/knockout-sortable.min.js":8}],37:[function(require,module,exports){
1357
+ (function (global){
1358
+ "use strict";var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),console=require("./../../../bower_components/console-browserify/index.js");ko.bindingHandlers.preloader={init:function(e,t){var o=t();if("undefined"==typeof o.preloaded){o.preloaded=ko.observable("");var a=function(e){if(e!=o.preloaded())if(""!==e){var t=new Image;t.onload=function(){o.preloaded(e)},t.onerror=function(){o.preloaded(e)},t.src=e}else o.preloaded(e)};o.subscribe(a),a(o())}}},ko.bindingHandlers.advattr={init:function(e,t){var o=ko.utils.unwrapObservable(t()||{});ko.utils.objectForEach(o,function(t,o){var a=e.getAttribute(t);if(ko.isWriteableObservable(o)){var i=o();i!=a&&(o(a),null!==i&&console.log("AdvAttr found a value different from the default",t,i,a))}})},update:function(e,t){var o=ko.utils.unwrapObservable(t())||{};ko.utils.objectForEach(o,function(t,o){o=ko.utils.unwrapObservable(o);var a=o===!1||null===o||void 0===o;a?e.removeAttribute(t):e.setAttribute(t,o.toString())})}},ko.bindingHandlers.advstyle={init:function(e,t){var o=ko.utils.unwrapObservable(t()||{});ko.utils.objectForEach(o,function(t,o){var a;if(t.match(/Px$/)?(t=t.substr(0,t.length-2),a=e.style[t],a.match(/px$/)?a=a.replace(/px$/,""):console.log("AdvStyle binding found an unexpected default value",t,a,e)):a=e.style[t],ko.isWriteableObservable(o)){var i=o();i!=a&&(o(a),null!==i&&console.log("AdvStyle found a value different from the default",t,i,a))}})},update:function(e,t){var o=ko.utils.unwrapObservable(t()||{});ko.utils.objectForEach(o,function(t,o){o=ko.utils.unwrapObservable(o),(null===o||"undefined"==typeof o||o===!1)&&(o=""),t.match(/Px$/)&&(t=t.substr(0,t.length-2),o+="px"),e.style[t]=o})}},ko.bindingHandlers.domlog={init:function(e){console.log("initialized",e),ko.utils.domNodeDisposal.addDisposeCallback(e,function(){console.log("disposed",e)})}},ko.bindingHandlers.fudroppable={init:function(e,t){var o=t()||{},a={},i=function(e,t,o,a,i,n){e[t]?global.clearTimeout(e[t]):("undefined"!=typeof a&&o.classList.add(a),ko.isWriteableObservable(i)&&!i()&&i(!0));var l=function(){e[t]=null,"undefined"!=typeof a&&o.classList.remove(a),ko.isWriteableObservable(i)&&i()&&i(!1)};"dragleave"==n.type?l():e[t]=global.setTimeout(l,500)};(o.active||o.activeClass)&&ko.utils.registerEventHandler(global,"dragover",i.bind(void 0,a,"activeTimeout",e,o.activeClass,o.active)),o.hoverClass&&ko.utils.registerEventHandler(e,"dragover dragenter dragleave",i.bind(void 0,a,"hoverTimeout",e,o.hoverClass,void 0))}},ko.bindingHandlers.fileupload={extendOptions:{},remoteFilePreprocessor:function(e){return e},init:function(e){ko.utils.domNodeDisposal.addDisposeCallback(e,function(){$(e).fileupload("destroy")}),global.webkitURL?$(e).attr("title"," "):$(e).attr("title","")},update:function(e,t){var o=t()||{},a=$(e),i=a.parents(".uploadzone"),n=o.data;o.data=void 0;var l=o.canvasPreview;ko.utils.extend(o,{url:"/upload/",dataType:"json",dropZone:i.find(".mo-uploadzone")[0],autoUpload:!0,acceptFileTypes:/(\.|\/)(gif|jpe?g|png)$/i,maxFileSize:1048576,disableImageResize:/Android(?!.*Chrome)|Opera/.test(global.navigator.userAgent),previewMaxWidth:200,previewMaxHeight:200,previewCrop:!1,replaceFileInput:!1,messages:{unknownError:"Unknown error",uploadedBytes:"Uploaded bytes exceed file size",maxNumberOfFiles:"Maximum number of files exceeded",acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small",post_max_size:"The uploaded file exceeds the post_max_size directive in php.ini",max_file_size:"File is too big",min_file_size:"File is too small",accept_file_types:"Filetype not allowed",max_number_of_files:"Maximum number of files exceeded",max_width:"Image exceeds maximum width",min_width:"Image requires a minimum width",max_height:"Image exceeds maximum height",min_height:"Image requires a minimum height",abort:"File upload aborted",image_resize:"Failed to resize image",generic:"Unexpected upload error"}}),ko.utils.extend(o,ko.bindingHandlers.fileupload.extendOptions);var r=0,d="",s=function(){0===--r&&(n&&n(d),d="",l&&(i.find("img").show(),i.find("canvas").remove()),i.removeClass("uploading"),i.find(".progress-bar").css("width",0))},c=function(e){if("object"==typeof o.messages&&null!==o.messages){var t=e.match(/^([^ ]+)(.*)$/);if(t&&"undefined"!=typeof o.messages[t[1]])return o.messages[t[1]]+t[2]}return e};a.fileupload(o);for(var u=["fileuploadadd","fileuploadprocessalways","fileuploadprogressall","fileuploaddone","fileuploadfail"],p=function(e,t){if("fileuploadadd"==e.type&&r++,"fileuploadfail"==e.type&&(console.log("fileuploadfail",e,t),o.onerror&&(""===t.errorThrown&&"error"==t.textStatus?o.onerror(c("generic")):o.onerror(c("generic ("+t.errorThrown+")"))),s()),"fileuploaddone"==e.type)if("undefined"!=typeof t.result.files[0].url){if(o.onfile)for(var a=0;a<t.result.files.length;a++)t.result.files[a]=ko.bindingHandlers.fileupload.remoteFilePreprocessor(t.result.files[a]),o.onfile(t.result.files[a]);if(""===d&&(d=t.result.files[0].url),l){var n=new Image;n.onload=s,n.onerror=s,n.src=t.result.files[0].url}else s()}else"undefined"!=typeof t.result.files[0].error?(console.log("remote error",e,t),o.onerror&&o.onerror(c(t.result.files[0].error)),s()):(console.log("unexpected error",e,t),o.onerror&&o.onerror(c("generic (Unexpected Error retrieving uploaded file)")),s());if("fileuploadprocessalways"==e.type){var u=t.index,p=t.files[u];if(p.preview&&0===u&&0===i.find("canvas").length){if(l){var b=$(p.preview).css("width","100%");i.find("img").hide(),i.prepend(b)}i.addClass("uploading"),i.find(".progress-bar").css("width",0)}p.error&&(o.onerror&&o.onerror(c(p.error)),s())}if("fileuploadprogressall"==e.type){var f=parseInt(100*(t.loaded/t.total),10);i.find(".progress-bar").css("width",f+"%")}},b=u.length-1;b>=0;b--){var f=u[b];a.on(f,p)}$.support.fileInput||a.prop("disabled",!0).parent().addClass("disabled")}};
1359
+
1360
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1361
+
1362
+ },{"./../../../bower_components/console-browserify/index.js":1}],38:[function(require,module,exports){
1363
+ (function (global){
1364
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),console=require("./../../../bower_components/console-browserify/index.js");ko.bindingHandlers.ifSubs={cloneNodes:function(e,t){for(var o=0,i=e.length,n=[];i>o;o++){var a=e[o].cloneNode(!0);n.push(t?ko.cleanNode(a):a)}return n},init:function(e,t,o,i,n){var a,r,l=t();return"undefined"==typeof l.data.subsCount&&ko.extenders.subscriptionsCount(l.data),ko.computed(function(){var o,i,d,s=ko.utils.unwrapObservable(t().data.subsCount),c=!r;d=-("undefined"!=typeof t().gutter?t().gutter:1),o=s+(a?d:0)>=ko.utils.unwrapObservable(l.threshold),"undefined"!=typeof t().not&&t().not&&(o=!o),i=c||o!==a,i&&(c&&ko.computedContext.getDependenciesCount()&&(r=ko.bindingHandlers.ifSubs.cloneNodes(ko.virtualElements.childNodes(e),!0)),o?(c||ko.virtualElements.setDomNodeChildren(e,ko.bindingHandlers.ifSubs.cloneNodes(r)),ko.applyBindingsToDescendants(n,e)):ko.virtualElements.emptyNode(e),a=o)},null,{disposeWhenNodeIsRemoved:e}),{controlsDescendantBindings:!0}}},ko.virtualElements.allowedBindings.ifSubs=!0;var beforeSubscriptionProp,afterSubscriptionProp;if("function"==typeof ko.subscription&&"undefined"!=typeof ko.isWritableObservable)beforeSubscriptionProp="beforeSubscriptionAdd",afterSubscriptionProp="afterSubscriptionRemove";else if("3.2.0"==ko.version)beforeSubscriptionProp="va",afterSubscriptionProp="nb";else if("3.3.0"==ko.version)beforeSubscriptionProp="ja",afterSubscriptionProp="ua";else if("3.4.0"==ko.version)beforeSubscriptionProp="sa",afterSubscriptionProp="Ia";else{if("3.4.1"!=ko.version)throw"Unsupported minimized Knockout version "+ko.version+" (supported DEBUG or minimized 3.2.0 ... 3.4.1)";beforeSubscriptionProp="sa",afterSubscriptionProp="Ia"}ko.extenders.subscriptionsCount=function(e,t,o){if("undefined"==typeof e.subsCount){e.subsCount=ko.observable(e.getSubscriptionsCount()).extend({notify:"always"});var i=e[beforeSubscriptionProp],n=e[afterSubscriptionProp];e[beforeSubscriptionProp]=function(n){i&&i.call(e,n);var a=e.getSubscriptionsCount()+1;("undefined"==typeof t||a==t||"undefined"==typeof o||a==o)&&e.subsCount(a)},e[afterSubscriptionProp]=function(i){n&&n.call(e,i);var a=e.getSubscriptionsCount();("undefined"==typeof t||a==t||"undefined"==typeof o||a==o)&&e.subsCount(a)}}else console.log("already applied subscriptionCount to observable");return null};
1365
+
1366
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1367
+
1368
+ },{"./../../../bower_components/console-browserify/index.js":1}],39:[function(require,module,exports){
1369
+ (function (global){
1370
+ "use strict";var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),spinner=(typeof window !== "undefined" ? window['jQuery']['ui']['spinner'] : typeof global !== "undefined" ? global['jQuery']['ui']['spinner'] : null),console=require("./../../../bower_components/console-browserify/index.js");if("undefined"==typeof spinner)throw"Cannot find jquery-ui spinner widget dependency!";$.widget("ui.spinner",spinner,{_adjustValue:function(e){this._super(e);var t=this.options;return e=parseFloat(e.toFixed(this._precision())),null!==t.max&&e>t.max?t.max:null!==t.min&&e<t.min?t.min:e}});
1371
+
1372
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1373
+
1374
+ },{"./../../../bower_components/console-browserify/index.js":1}],40:[function(require,module,exports){
1375
+ (function (global){
1376
+ "use strict";var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),console=require("./../../../bower_components/console-browserify/index.js"),tabs=(typeof window !== "undefined" ? window['jQuery']['ui']['tabs'] : typeof global !== "undefined" ? global['jQuery']['ui']['tabs'] : null);if("undefined"==typeof tabs)throw"Cannot find jquery-ui tabs widget dependency!";$.widget("ui.tabs",tabs,{_isLocal:function(e){return"true"==e.getAttribute("data-local")?!0:this._superApply(arguments)}});
1377
+
1378
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1379
+
1380
+ },{"./../../../bower_components/console-browserify/index.js":1}],41:[function(require,module,exports){
1381
+ (function (global){
1382
+ "use strict";function pushTemplate(e,t){var o=global.document.createElement("script");o.setAttribute("type","text/html"),o.setAttribute("id",e),o.text=t,global.document.body.appendChild(o)}function removeTemplate(e){var t=global.document.getElementById(e);t&&t.parentNode.removeChild(t)}function init(){}function getTemplateContent(e){var t=global.document.getElementById(e);return t?t.innerHTML:void 0}module.exports={init:init,addTemplate:pushTemplate,removeTemplate:removeTemplate,getTemplateContent:getTemplateContent};
1383
+
1384
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1385
+
1386
+ },{}],42:[function(require,module,exports){
1387
+ (function (global){
1388
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),$=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),console=require("./../../../bower_components/console-browserify/index.js"),tinymce=(typeof window !== "undefined" ? window['tinymce'] : typeof global !== "undefined" ? global['tinymce'] : null),timeout,render=function(){timeout=void 0,"undefined"!=typeof tinymce.activeEditor&&null!==tinymce.activeEditor&&"undefined"!=typeof tinymce.activeEditor.theme&&null!==tinymce.activeEditor.theme&&"undefined"!=typeof tinymce.activeEditor.theme.panel&&null!==tinymce.activeEditor.theme.panel&&"undefined"!=typeof tinymce.activeEditor.theme.panel.visible&&(("undefined"!=typeof tinymce.activeEditor.theme.panel._visible&&tinymce.activeEditor.theme.panel._visible&&tinymce.activeEditor.theme.panel._fixed||"undefined"!=typeof tinymce.activeEditor.theme.panel.state&&tinymce.activeEditor.theme.panel.state.get("visible")&&tinymce.activeEditor.theme.panel.state.get("fixed"))&&tinymce.activeEditor.theme.panel.fixed(!1),tinymce.activeEditor.nodeChanged(),tinymce.activeEditor.theme.panel.visible(!0),tinymce.activeEditor.theme.panel.layoutRect().y<=40&&tinymce.activeEditor.theme.panel.moveBy(0,40-tinymce.activeEditor.theme.panel.layoutRect().y))};ko.bindingHandlers.wysiwygScrollfix={scroll:function(){timeout&&global.clearTimeout(timeout),timeout=global.setTimeout(render,50)},init:function(e){ko.utils.domNodeDisposal.addDisposeCallback(e,function(){$(e).off("scroll",ko.bindingHandlers.wysiwygScrollfix.scroll)}),$(e).on("scroll",ko.bindingHandlers.wysiwygScrollfix.scroll)}};
1389
+
1390
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1391
+
1392
+ },{"./../../../bower_components/console-browserify/index.js":1}],43:[function(require,module,exports){
1393
+ (function (global){
1394
+ "use strict";var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),console=require("./../../../bower_components/console-browserify/index.js"),_scrollIntoView=function(e,t,o,i){var n=o.scrollTop(),a=n-i-(t?20:-20),r="undefined"!=typeof o[0].nodeType;if(r){var l={scrollTop:""+Math.round(a)+"px"},s=Math.round(Math.abs(a-n));o.stop().animate(l,s)}else o.scrollTop(a)};ko.bindingHandlers.scrollIntoView={update:function(e,t){var o=ko.utils.unwrapObservable(t());if(o)try{for(;8===e.nodeType;)e=e.nextSibling;if(8!==e.nodeType){var i,n=$(e).scrollParent(),a=!1;9==n[0].nodeType?(n=$(n[0].defaultView),i=0,a=!0):i=n.offset().top;var r=n.height(),l=n.scrollTop(),s=i+r,d=$(e),c=d.offset().top;a&&(c-=l);var u=d.height(),p=c+u;c>i&&s>c+u||(r>u?(i>c&&_scrollIntoView(e,!0,n,i-c),p>s&&_scrollIntoView(e,!1,n,s-p)):(i>c&&s>p&&_scrollIntoView(e,!1,n,s-p),c>i&&p>s&&_scrollIntoView(e,!0,n,i-c)))}}catch(f){console.log("TODO exception scrolling into view",f)}}},ko.virtualElements.allowedBindings.scrollIntoView=!0;
1395
+
1396
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1397
+
1398
+ },{"./../../../bower_components/console-browserify/index.js":1}],44:[function(require,module,exports){
1399
+ (function (global){
1400
+ "use strict";function createStringTemplateEngine(e){var t=e.makeTemplateSource;return e.makeTemplateSource=function(e){return"undefined"!=typeof templates[e]?new ko.templateSources.stringTemplate(e,templates[e]):t(e)},e}function pushTemplate(e,t){templates[e]=t}function removeTemplate(e){"undefined"!=typeof templates[e]?templates[e]=void 0:origTemplateSystem.removeTemplate(e)}function init(){ko.setTemplateEngine(createStringTemplateEngine(new ko.nativeTemplateEngine))}function getTemplateContent(e){return"undefined"!=typeof templates[e]?templates[e]:origTemplateSystem.getTemplateContent(e)}var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),origTemplateSystem=require("./script-template.js"),templates={};ko.templateSources.stringTemplate=function(e,t){this.templateName=e,this.template=t,this._data={}},ko.utils.extend(ko.templateSources.stringTemplate.prototype,{data:function(e,t){return 1===arguments.length?this._data[e]:(this._data[e]=t,void 0)},text:function(e){return 0===arguments.length?this.template:(this.template=e,void 0)}}),module.exports={init:init,addTemplate:pushTemplate,removeTemplate:removeTemplate,getTemplateContent:getTemplateContent};
1401
+
1402
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1403
+
1404
+ },{"./script-template.js":41}],45:[function(require,module,exports){
1405
+ (function (global){
1406
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),$=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),kojqui=(typeof window !== "undefined" ? window['kojqui'] : typeof global !== "undefined" ? global['kojqui'] : null),console=require("./../../../bower_components/console-browserify/index.js"),extendValueAccessor=function(e,t){return function(){return ko.utils.extend(t,e()),t}},options={show:{delay:500},track:!0,items:'[title][title!=""][title!=" "]'};ko.bindingHandlers.tooltips={init:function(e,t,o,i,n){return"undefined"!=typeof $.fn.tooltip&&"undefined"!=typeof ko.bindingHandlers.tooltip?ko.bindingHandlers.tooltip.init(e,extendValueAccessor(t,options),o,i,n):void 0},update:function(e,t,o,i,n){return"undefined"!=typeof $.fn.tooltip&&"undefined"!=typeof ko.bindingHandlers.tooltip?ko.bindingHandlers.tooltip.update(e,extendValueAccessor(t,options),o,i,n):void 0}};
1407
+
1408
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1409
+
1410
+ },{"./../../../bower_components/console-browserify/index.js":1}],46:[function(require,module,exports){
1411
+ (function (global){
1412
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),console=require("./../../../bower_components/console-browserify/index.js");ko.bindingHandlers.validatedValue={init:function(e,t,o){var i=t;if("undefined"!=typeof e.pattern){var n=new RegExp("^(?:"+e.pattern+")$"),a=ko.computed({read:function(){var o=ko.utils.unwrapObservable(t()),i=null===o||""===o||n.test(o);return i?e.classList.remove("invalid"):e.classList.add("invalid"),o},write:ko.isWriteableObservable(t())&&function(o){ko.selectExtensions.writeValue(e,o);var i=ko.selectExtensions.readValue(e);t()(i)},disposeWhenNodeIsRemoved:e});i=function(){return a}}ko.bindingHandlers.value.init(e,i,o)}},ko.expressionRewriting._twoWayBindings.validatedValue=!0;
1413
+
1414
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1415
+
1416
+ },{"./../../../bower_components/console-browserify/index.js":1}],47:[function(require,module,exports){
1417
+ (function (global){
1418
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),console=require("./../../../bower_components/console-browserify/index.js");ko.bindingHandlers.uniqueId={currentIndex:0,init:function(e,t){var o=ko.utils.unwrapObservable(t())||{};if(""===o.id()){var a,i,n;n="ko_"+("undefined"!=typeof o.type?ko.utils.unwrapObservable(o.type):"block");do a=n+"_"+ ++ko.bindingHandlers.uniqueId.currentIndex,i=global.document.getElementById(a);while(i);o.id(a)}}},ko.virtualElements.allowedBindings.uniqueId=!0,ko.bindingHandlers.virtualAttr={update:function(e,t){8!==e.nodeType&&ko.bindingHandlers.attr.update(e,t)}},ko.virtualElements.allowedBindings.virtualAttr=!0,ko.bindingHandlers.virtualAttrStyle={update:function(e,t,o,a,i){if(8!==e.nodeType){var n="undefined"==typeof i.templateMode||"wysiwyg"!=i.templateMode,l=["style"];n&&l.push("replacedstyle");for(var r=ko.utils.unwrapObservable(t()),d=0;d<l.length;d++){var s=l[d],c=r===!1||null===r||void 0===r;c?e.removeAttribute(s):e.setAttribute(s,r.toString())}}}},ko.virtualElements.allowedBindings.virtualAttrStyle=!0,ko.bindingHandlers.virtualStyle={update:function(e,t){8!==e.nodeType&&ko.bindingHandlers.style.update(e,t)}},ko.virtualElements.allowedBindings.virtualStyle=!0,ko.bindingHandlers.virtualHtml={init:ko.bindingHandlers.html.init,update:function(e,t){if(8===e.nodeType){var o=ko.utils.unwrapObservable(t());if(ko.virtualElements.emptyNode(e),null!==o&&void 0!==o){"string"!=typeof o&&(o=o.toString());var a=ko.utils.parseHtmlFragment(o);if(a)for(var i=e.nextSibling,n=0,l=a.length;l>n;n++)i.parentNode.insertBefore(a[n],i)}}else ko.bindingHandlers.html.update(e,t);return{controlsDescendantBindings:!0}}},ko.virtualElements.allowedBindings.virtualHtml=!0;
1419
+
1420
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1421
+
1422
+ },{"./../../../bower_components/console-browserify/index.js":1}],48:[function(require,module,exports){
1423
+ (function (global){
1424
+ "use strict";var tinymce=(typeof window !== "undefined" ? window['tinymce'] : typeof global !== "undefined" ? global['tinymce'] : null),$=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),console=require("./../../../bower_components/console-browserify/index.js");require("./eventable.js"),ko.bindingHandlers.wysiwygOrHtml={init:function(e,t,o,i,a){var n="undefined"==typeof a.templateMode||"wysiwyg"!=a.templateMode;return n?ko.bindingHandlers.virtualHtml.init():ko.bindingHandlers.wysiwyg.init(e,t,o,i,a)},update:function(e,t,o,i,a){var n="undefined"==typeof a.templateMode||"wysiwyg"!=a.templateMode;return n?ko.bindingHandlers.virtualHtml.update(e,t,o,i,a):void 0}},ko.virtualElements.allowedBindings.wysiwygOrHtml=!0,ko.bindingHandlers.wysiwygHref={init:function(e,t,o,i,a){if(8!==e.nodeType){t();var n="undefined"==typeof a.templateMode||"wysiwyg"!=a.templateMode;if(n)e.setAttribute("target","_new");else{var l=o();"undefined"!=typeof l.wysiwygOrHtml?e.setAttribute("href","javascript:void(0)"):(e.removeAttribute("href"),e.setAttribute("disabledhref","#"))}}},update:function(e,t,o,i,a){if(8!==e.nodeType){var n="undefined"==typeof a.templateMode||"wysiwyg"!=a.templateMode,l=ko.utils.unwrapObservable(t());n&&(l===!1||null===l||void 0===l?e.removeAttribute("href"):e.setAttribute("href",l.toString()))}}},ko.virtualElements.allowedBindings.wysiwygHref=!0,ko.bindingHandlers.wysiwygSrc={convertedUrl:function(e,t,o,i){var a=e+"?method="+t+"&width="+o+(null!==i?"&height="+i:"");return console.log("basic converterUrl",a),a},placeholderUrl:function(e,t,o){},update:function(e,t){var o=ko.utils.unwrapObservable(t()),i=ko.utils.unwrapObservable(o.src),a=ko.utils.unwrapObservable(o.placeholder),n=ko.utils.unwrapObservable(o.width),l=ko.utils.unwrapObservable(o.height);if(i===!1||null===i||void 0===i||""===i)"object"==typeof a&&null!==a?e.setAttribute("src",ko.bindingHandlers.wysiwygSrc.placeholderUrl(a.width,a.height,a.text)):e.removeAttribute("src");else{var r=ko.utils.unwrapObservable(o.method);r||(r=n>0&&l>0?"cover":"resize");var d=ko.bindingHandlers.wysiwygSrc.convertedUrl(i.toString(),r,n,l);e.setAttribute("src",d)}"undefined"!=typeof n&&null!==n?e.setAttribute("width",n):e.removeAttribute("width"),"undefined"!=typeof l&&null!==l?e.setAttribute("height",l):e.removeAttribute("height")}},ko.bindingHandlers.wysiwygId={init:function(e,t,o,i,a){var n="undefined"==typeof a.templateMode||"wysiwyg"!=a.templateMode;n||e.setAttribute("id",ko.utils.unwrapObservable(t()))},update:function(e,t,o,i,a){var n="undefined"==typeof a.templateMode||"wysiwyg"!=a.templateMode;n||e.setAttribute("id",ko.utils.unwrapObservable(t()))}},ko.virtualElements.allowedBindings.wysiwygId=!0,ko.bindingHandlers.wysiwygClick={init:function(e,t,o,i,a){var n="undefined"==typeof a.templateMode||"wysiwyg"!=a.templateMode;n||ko.bindingHandlers.click.init(e,t,o,i,a)}},ko.virtualElements.allowedBindings.wysiwygClick=!0,ko.bindingHandlers.wysiwygCss={update:function(e,t,o,i,a){var n="undefined"==typeof a.templateMode||"wysiwyg"!=a.templateMode;n||ko.bindingHandlers.css.update(e,t,o,i,a)}},ko.virtualElements.allowedBindings.wysiwygCss=!0,ko.bindingHandlers.wysiwygImg={makeTemplateValueAccessor:function(e,t){return function(){var o="undefined"!=typeof t.templateMode&&"wysiwyg"==t.templateMode,i=e(),a=ko.utils.peekObservable(i);return ko.utils.unwrapObservable(i),{name:o?a._editTemplate:a._template,templateEngine:ko.nativeTemplateEngine.instance}}},init:function(e,t,o,i,a){return ko.bindingHandlers.template.init(e,ko.bindingHandlers.wysiwygImg.makeTemplateValueAccessor(t,a))},update:function(e,t,o,i,a){return a=a.extend(t()),ko.bindingHandlers.template.update(e,ko.bindingHandlers.wysiwygImg.makeTemplateValueAccessor(t,a),o,i,a)}},ko.virtualElements.allowedBindings.wysiwygImg=!0,ko.bindingHandlers.wysiwyg={currentIndex:0,standardOptions:{},fullOptions:{toolbar1:"bold italic forecolor backcolor hr styleselect removeformat | link unlink | pastetext code",plugins:["link hr paste lists textcolor code"]},init:function(e,t){ko.bindingHandlers.focusable.init(e),ko.utils.domNodeDisposal.addDisposeCallback(e,function(){tinymce.remove("#"+e.getAttribute("id"))});var o=t();if(!ko.isObservable(o))throw"Wysiwyg binding called with non observable";if(8===e.nodeType)throw"Wysiwyg binding called on virtual node, ignoring...."+e.innerHTML;var i=e.getAttribute("id");i||(i="wysiwyg_"+ ++ko.bindingHandlers.wysiwyg.currentIndex,e.setAttribute("id",i));var a,n="DIV"==e.tagName||"TD"==e.tagName,l=!1,r=!1,d={selector:"#"+i,inline:!0,hidden_input:!1,plugins:["paste"],toolbar1:"bold italic",toolbar2:"",preview_styles:!1,paste_as_text:!0,language:"en",schema:"html5",extended_valid_elements:"strong/b,em/i,*[*]",menubar:!1,skin:"gray-flat",setup:function(e){e.on("change redo undo",function(){l||(r=!0,o(e.getContent({format:"raw"})),r=!1)}),e.on("focus",function(){e.nodeChanged(),e.getElement().click()}),e.on("BeforeSetContent",function(e){e.initial&&(e.format="raw")}),a=e}};return ko.utils.extend(d,ko.bindingHandlers.wysiwyg.standardOptions),n&&ko.utils.extend(d,ko.bindingHandlers.wysiwyg.fullOptions),global.setTimeout(function(){tinymce.init(d)}),ko.computed(function(){var o=ko.utils.unwrapObservable(t());if(!r){try{l=!0,"undefined"!=typeof a?a.setContent(o,{format:"raw"}):ko.utils.setHtml(e,o)}catch(i){console.log("TODO exception setting content to editable element",typeof a,i)}l=!1}},null,{disposeWhenNodeIsRemoved:e}),{controlsDescendantBindings:!0}}};
1425
+
1426
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1427
+
1428
+ },{"./../../../bower_components/console-browserify/index.js":1,"./eventable.js":34}],49:[function(require,module,exports){
1429
+ "use strict";var console=require("./../../../bower_components/console-browserify/index.js"),checkModel=function(e,t,o,n,i){var a,r,l,s=0;if("undefined"==typeof i&&(i=!1),"undefined"!=typeof t&&"function"==typeof t.splice)for(a={},r=0;r<t.length;r++)a[t[r].type]=t[r];else a=t;for(var d in e)if(e.hasOwnProperty(d))if(l="undefined"!=typeof n?n+"."+d:d,o.hasOwnProperty(d))if(typeof o[d]!=typeof e[d])null!==o[d]&&null!==e[d]&&("string"==typeof o[d]?String(e[d])!=e[d]&&(console.log("TODO Different type 1 ",l,typeof o[d],typeof e[d],o[d],e[d]),s=Math.max(s,2)):"number"==typeof o[d]?Number(e[d])!=e[d]&&(console.log("TODO Different type 2 ",l,typeof o[d],typeof e[d],o[d],e[d]),s=Math.max(s,2)):(console.log("TODO Different type 3 ",l,typeof o[d],typeof e[d],o[d],e[d]),s=Math.max(s,2)));else if("object"==typeof e[d])if(null!==e[d])if("undefined"!=typeof e[d].splice){if(e[d].length>0)if(o[d].length>0){var u=0;for(r=0;r<o[d].length;r++)if("string"==typeof o[d][r].type){for(;u<e[d].length&&e[d][u].type!==o[d][r].type;)console.log("ignoring ",l,e[d][u].type," block type in reference not found in model"),u++;if(u>=e[d].length){console.log("WARN cannot find ",l,o[d][r].type," block in reference"),s=Math.max(s,2);break}s=Math.max(s,checkModel(e[d][u],void 0,o[d][r],l+"["+r+"."+o[d][r].type+"]"))}}else for(r=0;r<e[d].length;r++)"string"!=typeof e[d][r].type?(console.log("TODO found an object with no type",l,e[d][r]),s=Math.max(s,2)):a.hasOwnProperty(e[d][r].type)?s=Math.max(s,checkModel(a[e[d][r].type],a,e[d][r],l+"["+r+"."+e[d][r].type+"]")):(console.warn("TODO the model uses a block type not defined by the template. REMOVING IT!!",l,e[d][r]),e[d].splice(r,1),r--,s=Math.max(s,2))}else null===o[d]?i?(console.log("WARN Null object in model ",l,"instead of",e[d],"deleting it"),s=Math.max(s,2),delete e[d]):(console.log("INFO Null object in model ",l,"instead of",e[d],"cloning it from the reference"),s=Math.max(s,1),o[d]=e[d]):s=Math.max(s,checkModel(e[d],a,o[d],l,i));else null!==o[d]&&(console.log("TODO Null in reference but not null in model",l,o[d]),s=Math.max(s,2));else"string"!=typeof e[d]&&"boolean"!=typeof e[d]&&"number"!=typeof e[d]&&(console.log("TODO unsupported type",l,typeof e[d]),s=Math.max(s,2));else i?(console.warn("WARN Property ",l,"found in model is not defined by template: removing it!"),s=Math.max(s,2),delete e[d]):(console.log("INFO Property ",l,"missing in model, cloning from reference!"),s=Math.max(s,1),o[d]=e[d]);return i||(s=Math.max(s,checkModel(o,t,e,"undefined"!=typeof n?n+"!R":"!R",!0))),s};module.exports=checkModel;
1430
+
1431
+ },{"./../../../bower_components/console-browserify/index.js":1}],50:[function(require,module,exports){
1432
+ "use strict";var converterUtils=require("./utils.js"),cssParse=require("./../../../bower_components/mensch/lib/parser.js"),console=require("./../../../bower_components/console-browserify/index.js"),domutils=require("./domutils.js"),_declarationValueLookup=function(e,t,o){for(var n=e.length-1;n>=0;n--)if("property"==e[n].type&&e[n].name==t)return _declarationValueUrlPrefixer(e[n].value,o);return null},_propToCamelCase=function(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})},_declarationValueUrlPrefixer=function(e,t){if(e.match(/url\(.*\)/)){var o=e.replace(/(url\()([^\)]*)(\))/g,function(e,o,n,i){var r=n.trim(),a=n.trim().charAt(0);"'"==a||'"'==a?r=r.substr(1,r.length-2):a="";var l=t(r);return null!==l?o+a+l+a+i:e});return o}return e},elaborateDeclarations=function(e,t,o,n,i,r,a){var l="object"==typeof r&&null!==r?r:{},s=null,d=0;if("undefined"==typeof t){var u=cssParse("#{\n"+e+"}",{comments:!0,position:!0});t=u.stylesheet.rules[0].declarations,d=1}for(var c=t.length-1;c>=0;c--)if("property"==t[c].type)if(a===!0&&"display"==t[c].name&&"none"==t[c].value)null===s&&(s=e),s=converterUtils.removeStyle(s,t[c].position.start,t[c].position.end,d,0,0,"");else{var f=t[c].name.match(/^-ko-(bind-|attr-)?([a-z0-9-]*?)(-if|-ifnot)?$/);if(null!==f){null===s&&"undefined"!=typeof e&&(s=e);var p,b,m,g="attr-"==f[1],h="bind-"==f[1],v=f[2],y="-if"==f[3]||"-ifnot"==f[3];if(y){p=t[c].name.substr(0,t[c].name.length-f[3].length);var k=_declarationValueLookup(t,p,o);if(null===k)throw"Unable to find declaration "+p+" for "+t[c].name}else{if((g||h)&&"undefined"==typeof i&&"undefined"!=typeof e)throw"Attributes and bind declarations are only allowed in inline styles!";var w,_=!0;if(g?(m=domutils.getAttribute(i,v),_=!1,w="virtualAttr"):h?(w=null,"text"==v?"undefined"!=typeof i?m=domutils.getInnerText(i):_=!1:"html"==v?"undefined"!=typeof i?m=domutils.getInnerHtml(i):_=!1:_=!1):(_="undefined"!=typeof e,_&&(m=_declarationValueLookup(t,v,o)),w="virtualStyle"),_&&null===m)throw console.error("Cannot find default value for",t[c].name,t),"Cannot find default value for "+t[c].name+": "+t[c].value+" in "+i+" ("+typeof e+"/"+v+")";var x=m,O=_propToCamelCase(v);try{b=converterUtils.expressionBinding(t[c].value,n,x)}catch(S){throw console.error("Model ensure path failed",S.stack,"name",t[c].name,"value",t[c].value,"default",m,"element",i),S}null!==w&&"undefined"==typeof l[w]&&(l[w]={}),"virtualAttr"==w&&"href"==O&&(w=null,O="wysiwygHref","undefined"!=typeof i&&null!==i&&domutils.removeAttribute(i,"href"));var C=_declarationValueLookup(t,t[c].name+"-if",o),$=!1;if(null===C)C=_declarationValueLookup(t,t[c].name+"-ifnot",o),$=!0;else if(null!==_declarationValueLookup(t,t[c].name+"-ifnot",o))throw"Unexpected error: cannot use both -if and -ifnot property conditions";if(null!==C)try{var T=converterUtils.conditionBinding(C,n);b=($?"!":"")+"("+T+") ? "+b+" : null"}catch(S){throw console.error("Unable to deal with -ko style binding condition",C,t[c].name),S}null!==w?l[w][O]=b:l[O]=b}if(null!==s)try{if("undefined"!=typeof i&&null!==i)s=converterUtils.removeStyle(s,t[c].position.start,t[c].position.end,d,0,0,"");else{var A="";y||(A=v+": <!-- ko text: "+b+" -->"+m+"<!-- /ko -->"),s=converterUtils.removeStyle(s,t[c].position.start,t[c].position.end,d,0,0,A)}}catch(S){throw console.warn("Remove style failed",S,"name",t[c]),S}}else{var E=_declarationValueUrlPrefixer(t[c].value,o);if(E!=t[c].value&&(null===s&&"undefined"!=typeof e&&(s=e),null!==s))try{s=converterUtils.removeStyle(s,t[c].position.start,t[c].position.end,d,0,0,t[c].name+": "+E)}catch(S){throw console.log("Remove style failed replacing url",S,"name",t[c]),S}var M=_propToCamelCase(t[c].name),D="virtualAttrStyle",j="undefined"!=typeof l.virtualStyle?l.virtualStyle[M]:void 0,P=" ";"undefined"==typeof l[D]&&(l[D]="''",P=""),"undefined"!=typeof j?(l[D]="'"+t[c].name+": '+("+j+")+';"+P+"'+"+l[D],delete l.virtualStyle[M]):l[D]="'"+t[c].name+": "+converterUtils.addSlashes(E)+";"+P+"'+"+l[D]}}if("undefined"!=typeof i&&null!==i){for(var H in l.virtualStyle)if(l.virtualStyle.hasOwnProperty(H))throw console.log("Unexpected virtualStyle binding after conversion to virtualAttr.style",H,l.virtualStyle[H],e),"Unexpected virtualStyle binding after conversion to virtualAttr.style for "+H;delete l.virtualStyle;var B=domutils.getAttribute(i,"data-bind"),I=(null!==B?B+", ":"")+_bindingSerializer(l);domutils.setAttribute(i,"data-bind",I)}if("undefined"==typeof e){var q=!1;for(var R in l.virtualStyle)if(l.virtualStyle.hasOwnProperty(R)){q=!0;break}if(q){if("undefined"!=typeof l.virtualAttrStyle){var U=l.virtualAttrStyle;delete l.virtualAttrStyle,l.virtualAttrStyle=U}}else delete l.virtualStyle;return _bindingSerializer(l)}return s},_bindingSerializer=function(e){var t=[];for(var o in e)e.hasOwnProperty(o)&&("object"==typeof e[o]?t.push(o+": "+"{ "+_bindingSerializer(e[o])+" }"):t.push(o+": "+e[o]));return t.reverse().join(", ")};module.exports=elaborateDeclarations;
1433
+
1434
+ },{"./../../../bower_components/console-browserify/index.js":1,"./../../../bower_components/mensch/lib/parser.js":15,"./domutils.js":51,"./utils.js":57}],51:[function(require,module,exports){
1435
+ (function (global){
1436
+ "use strict";function _extend(e,t){if(t)for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e}var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),objExtend=function(e,t){return"function"==typeof $.extend?$.extend(!0,e,t):_extend(e,JSON.parse(JSON.stringify(t)))},getAttribute=function(e,t){var o=$(e).attr(t);return"undefined"==typeof o&&(o=null),o},setAttribute=function(e,t,o){$(e).attr(t,o)},removeAttribute=function(e,t){$(e).removeAttr(t)},getInnerText=function(e){return $(e).text()},getInnerHtml=function(e){return $(e).html()},getLowerTagName=function(e){return""===e.tagName&&"string"==typeof e.name?e.name.toLowerCase():""!==e.tagName?e.tagName.toLowerCase():$(e).prop("tagName").toLowerCase()},setContent=function(e,t){$(e).html(t)},replaceHtml=function(e,t){$(e).replaceWith(t)},removeElements=function(e,t){t&&"undefined"!=typeof e.detach&&e.detach(),e.remove()};module.exports={getAttribute:getAttribute,setAttribute:setAttribute,removeAttribute:removeAttribute,getInnerText:getInnerText,getInnerHtml:getInnerHtml,getLowerTagName:getLowerTagName,setContent:setContent,replaceHtml:replaceHtml,removeElements:removeElements,objExtend:objExtend};
1437
+
1438
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1439
+
1440
+ },{}],52:[function(require,module,exports){
1441
+ "use strict";var console=require("./../../../bower_components/console-browserify/index.js"),elaborateDeclarations=require("./declarations.js"),utils=require("./utils.js"),modelDef=require("./model.js"),_getOptionsObject=function(e){for(var t=e.split("|"),o={},n=0;n<t.length;n++){var i=t[n].split("=");o[i[0]]=i.length>1?i[1]:i[0]}return o},_filterProps=function(e,t,o){var n=[];for(var i in e)if(!i.match(/^customStyle$/)&&!i.match(/^_/)&&e.hasOwnProperty(i)){var a=null!==e[i]&&"undefined"!=typeof e[i]._category&&"style"==e[i]._category;if("id"==i||"type"==i||i.match(/Blocks$/));else if("styler"==t)(a||o>0)&&n.push(i);else if("edit"==t){var r=null!==e[i]&&"undefined"!=typeof e[i]._category&&"content"==e[i]._category&&("undefined"==typeof e[i]._context||"block"!=e[i]._context);r&&n.push(i)}else"undefined"==typeof t&&n.push(i)}return n},_propInput=function(e,t,o,n,i){var a,r="";if(null!==e&&"undefined"!=typeof e._widget&&(a=e._widget),"undefined"==typeof a)throw"Unknown data type for "+t;var l="focusable: true";if("edit"==n&&(l+=", event: { focus: function(ui, event) { $($element).click(); } } "),r+='<label class="data-'+a+'"'+("boolean"==a?" data-bind=\"event: { mousedown: function(ui, evt) { if (evt.button == 0) { var input = $($element).find('input'); var ch = input.prop('checked'); setTimeout(function() { input.click(); input.prop('checked', !ch); input.trigger('change'); }, 0); } } }, click: function(ui, evt) { evt.preventDefault(); }, clickBubble: false\"":"")+">","undefined"!=typeof i&&"undefined"!=typeof i[a]){var s=i[a],d={};if("undefined"!=typeof s.parameters)for(var u in s.parameters)s.parameters.hasOwnProperty(u)&&"undefined"!=typeof e["_"+u]&&(d[u]=e["_"+u]);r+=s.html(o,l,d)}else if("boolean"==a)r+='<input type="checkbox" value="nothing" data-bind="checked: '+o+", "+l+'" />',r+='<span class="checkbox-replacer" ></span>';else if("color"==a)r+='<input size="7" type="text" data-bind="colorpicker: { color: '+o+", strings: $root.t('Theme Colors,Standard Colors,Web Colors,Theme Colors,Back to Palette,History,No history yet.') }, "+", "+l+'" />';else if("select"==a){if("undefined"!=typeof e._options){var c=_getOptionsObject(e._options);r+='<select data-bind="value: '+o+", "+l+'">';for(var p in c)c.hasOwnProperty(p)&&(r+='<option value="'+p+"\" data-bind=\"text: $root.ut('template', '"+utils.addSlashes(c[p])+"')\">"+c[p]+"</option>");r+="</select>"}}else if("font"==a)r+='<select type="text" data-bind="value: '+o+", "+l+'">',r+='<optgroup label="Sans-Serif Fonts">',r+='<option value="Arial,Helvetica,sans-serif">Arial</option>',r+="<option value=\"'Comic Sans MS',cursive,sans-serif\">Comic Sans MS</option>",r+='<option value="Impact,Charcoal,sans-serif">Impact</option>',r+="<option value=\"'Trebuchet MS',Helvetica,sans-serif\">Trebuchet MS</option>",r+='<option value="Verdana,Geneva,sans-serif">Verdana</option>',r+="</optgroup>",r+='<optgroup label="Serif Fonts">',r+='<option value="Georgia,serif">Georgia</option>',r+="<option value=\"'Times New Roman',Times,serif\">Times New Roman</option>",r+="</optgroup>",r+='<optgroup label="Monospace Fonts">',r+="<option value=\"'Courier New',Courier,monospace\">Courier New</option>",r+="</optgroup>",r+="</select>";else if("url"==a)r+='<div class="ui-textbutton">',r+='<input class="ui-textbutton-input" size="7" type="url" pattern="(mailto:.+@.+|https?://.+\\..+|\\[.*\\].*)" value="nothing" data-bind="css: { withButton: typeof $root.linkDialog !== \'undefined\' }, validatedValue: '+o+", "+l+'" />',r+="<a class=\"ui-textbutton-button\" data-bind=\"visible: typeof $root.linkDialog !== 'undefined', click: typeof $root.linkDialog !== 'undefined' ? $root.linkDialog.bind($element.previousSibling) : false, button: { icons: { primary: 'fa fa-fw fa-ellipsis-h' }, label: 'Opzioni', text: false }\">Opzioni</a>",r+="</div>";else if("integer"==a){var f=0,b=1e3;null!==e&&"undefined"!=typeof e._max&&(b=e._max),null!==e&&"undefined"!=typeof e._min&&(f=e._min);var m=b-f>=100?10:1,g=5*m;r+='<input class="number-spinner" size="7" step="'+m+'" type="number" value="-1" data-bind="spinner: { min: '+f+", max: "+b+", page: "+g+", value: "+o+" }, valueUpdate: ['change', 'spin']"+", "+l+'" />'}else r+='<input size="7" type="text" value="nothing" data-bind="value: '+o+", "+l+'" />';return r+="</label>"},_getGlobalStyleProp=function(e,t,o,n){var i;return("object"!=typeof t||null===t||"undefined"!=typeof t._widget)&&"undefined"!=typeof o&&"undefined"!=typeof n&&n.length>0&&"object"==typeof e&&"undefined"!=typeof e[n]&&(i=e[n]),i},_propEditor=function(e,t,o,n,i,a,r,l,s,d,u,c,p,f,b){if("undefined"==typeof s&&(s=0),"undefined"!=typeof r&&"object"==typeof n&&null!==n&&"undefined"==typeof n._usecount)return console.log("TODO EDITOR ignoring",a,"property because it is not used by the template","prop:",r,"type:",l,"level:",s,e._templateName),"";var m,g="undefined"!=typeof c?r+"._defaultComputed":r,h="",v=g,y=1,k=1;if("object"==typeof n&&null!==n&&"undefined"==typeof n._widget||"undefined"==typeof c&&(y+=1),"undefined"==typeof c&&"undefined"!=typeof d&&(k+=d),"undefined"!=typeof r&&p&&(h+="<!-- ko ifSubs: { data: "+v+", threshold: "+k+", gutter: "+y+" } -->"),"undefined"==typeof r||null!==n&&"undefined"!=typeof n._name||console.log("TODO WARN Missing label for property ",r),"undefined"==typeof r&&null!==n&&"undefined"==typeof n._name&&console.log("TODO WARN Missing label for object ",n.type),"object"==typeof n&&null!==n&&"undefined"==typeof n._widget){var w=_filterProps(n,l,s),x="styler"==l&&null!==n&&"undefined"!=typeof n.customStyle&&"undefined"!=typeof c,_="",$="";"undefined"!=typeof r&&"edit"==l&&(_=", click: function(obj, evt) { $root.selectItem("+r+", $data); return false }, clickBubble: false, css: { selecteditem: $root.isSelectedItem("+r+") }, scrollIntoView: $root.isSelectedItem("+r+"), ",$+=" selectable"),x&&($+=" supportsCustomStyles"),h+='<div class="objEdit level'+s+$+'" data-bind="tooltips: {}'+_+'">';var S=null!==n&&"undefined"!=typeof n._name?n._name:"undefined"!=typeof r?"["+r+"]":"";if(x){var C="Stile";"undefined"!=typeof i&&null!==i&&"undefined"!=typeof i._name?C=i._name:console.log("TODO missing label for theme section ",r,null!==n?n.type:"-"),S="<span class=\"blockSelectionMethod\" data-bind=\"text: customStyle() ? $root.ut('template', '"+utils.addSlashes(S)+"') : $root.ut('template', '"+utils.addSlashes(C)+"')\">Block</span>"}else S="<span data-bind=\"text: $root.ut('template', '"+utils.addSlashes(S)+"')\">"+S+"</span>";if(m=null!==n&&"undefined"!=typeof n._help?' title="'+utils.addSlashes(n._help)+"\" data-bind=\"attr: { title: $root.ut('template', '"+utils.addSlashes(n._help)+"') }\"":"",h+="<span"+m+' class="objLabel level'+s+'">'+S+"</span>","edit"==l&&"undefined"!=typeof n._blockDescription&&(h+="<div class=\"blockDescription\" data-bind=\"html: $root.ut('template', '"+utils.addSlashes(n._blockDescription)+"')\">"+n._blockDescription+"</div>"),x&&(h+='<label class="data-boolean blockCheck" data-bind="tooltips: { }">',h+='<input type="checkbox" value="nothing" data-bind="focusable: true, checked: customStyle" />',h+='<span title="Switch between global and block level styles editing" data-bind="attr: { title: $root.t(\'Switch between global and block level styles editing\') }" class="checkbox-replacer checkbox-replacer-onoff"></span>',h+="</label>",h+="<!-- ko template: { name: 'customstyle', if: customStyle } --><!-- /ko -->"),"undefined"!=typeof r&&(h+="<!-- ko with: "+r+" -->",1==s&&"undefined"!=typeof r&&"undefined"!=typeof n._previewBindings&&"undefined"!=typeof e)){"undefined"!=typeof f&&(h+='<!-- ko with: $root.content() --><div class="objPreview" data-bind="'+f+'"></div><!-- /ko -->'),"undefined"!=typeof b&&(h+='<!-- ko with: $parent --><div class="objPreview" data-bind="'+b+'"></div><!-- /ko -->');var O=elaborateDeclarations(void 0,n._previewBindings,o,e.bind(this,a+"."));h+='<div class="objPreview"><div class="objPreviewInner" data-bind="'+O+'"></div></div>'}var T;0===s&&"undefined"!=typeof n._previewBindings&&(T=elaborateDeclarations(void 0,n._previewBindings,o,e.bind(this,a.length>0?a+".":"")));var A,E,H,D,M=h.length;for(A=0;A<w.length;A++)E=a.length>0?a+"."+w[A]:w[A],("object"!=typeof n[w[A]]||null===n[w[A]]||"undefined"!=typeof n[w[A]]._widget)&&(D=void 0,0===s&&"theme"==w[A]?h+=_propEditor(e,t,o,n[w[A]],H,E,w[A],l,0,d,void 0,void 0,p,f):(D=_getGlobalStyleProp(u,n[w[A]],w[A],E),h+=_propEditor(e,t,o,n[w[A]],H,E,w[A],l,s+1,d,u,D,p,f,T)));for(A=0;A<w.length;A++)E=a.length>0?a+"."+w[A]:w[A],"object"==typeof n[w[A]]&&null!==n[w[A]]&&"undefined"==typeof n[w[A]]._widget&&(D=void 0,0===s&&"theme"==w[A]?h+=_propEditor(e,t,o,n[w[A]],H,E,w[A],l,0,d,void 0,void 0,p,f):(D=_getGlobalStyleProp(u,n[w[A]],w[A],E),h+=_propEditor(e,t,o,n[w[A]],H,E,w[A],l,s+1,d,u,D,p,f,T)));var q=h.length-M;if(0===q){if("object"==typeof n&&null!==n&&"template"==n._context)return"";h+='<div class="objEmpty" data-bind="html: $root.t(\'Selected element has no editable properties\')">Selected element has no editable properties</div>'}"undefined"!=typeof r&&(h+="<!-- /ko -->"),h+="</div>"}else{var B=!0;if("undefined"==typeof u&&(B=!1),null===n||"object"!=typeof n||"undefined"!=typeof n._widget){var I=[];"undefined"!=typeof c&&I.push("css: { notnull: "+r+"() !== null }"),m=null!==n&&"undefined"!=typeof n._help?' title="'+utils.addSlashes(n._help)+"\" data-bind=\"attr: { title: $root.ut('template', '"+utils.addSlashes(n._help)+"') }\"":"",m.length>0&&I.push("tooltips: {}");var j=I.length>0?'data-bind="'+utils.addSlashes(I.join())+'"':"";h+='<div class="propEditor '+(B?"checkboxes":"")+'"'+j+">";var P=null!==n&&"undefined"!=typeof n._name?n._name:"undefined"!=typeof r?"["+r+"]":"";P="<span data-bind=\"text: $root.ut('template', '"+utils.addSlashes(P)+"')\">"+P+"</span>",h+="<span"+m+' class="propLabel">'+P+"</span>",h+='<div class="propInput '+("undefined"!=typeof u?"local":"")+'" data-bind="css: { default: '+r+'() === null }">',h+=_propInput(n,r,g,l,t),h+="</div>","undefined"!=typeof c&&(h+='<div class="propInput global" data-bind="css: { overridden: '+r+'() !== null }">',h+=_propInput(n,r,c,l,t),h+="</div>",B&&(h+='<div class="propCheck"><label data-bind="tooltips: {}"><input type="checkbox" data-bind="focusable: true, click: function(evt, obj) { $root.localGlobalSwitch('+r+", "+c+"); return true; }, checked: "+r+'() !== null">',h+='<span class="checkbox-replacer" data-bind="css: { checked: '+r+"() !== null }, attr: { title: $root.t('This style is specific for this block: click here to remove the custom style and revert to the theme value') }\"></span>",h+="</label></div>")),h+="</div>"}else h+=null===n||"object"!=typeof n?'<div class="propEditor unknown">[A|'+r+"|"+typeof n+"]</div>":'<div class="propEditor unknown">[B|'+r+"|"+typeof n+"]</div>"}return"undefined"!=typeof r&&p&&(h+="<!-- /ko -->",h+="<!-- ko ifSubs: { not: true, data: "+v+", threshold: "+k+", gutter: 0 } -->",h+='<span class="label notused">('+r+")</span>",h+="<!-- /ko -->"),h},createBlockEditor=function(e,t,o,n,i,a,r,l,s,d,u,c){"undefined"==typeof u&&(u=!0);var p,f=modelDef.getDef(e,a),b=modelDef.getDef(e,i);"undefined"!=typeof b._previewBindings&&"thaeme"!=a&&"styler"==r&&(p=elaborateDeclarations(void 0,b._previewBindings,n,modelDef.getBindValue.bind(void 0,e,o,i,i,"")));var m,g="undefined"!=typeof d&&d?e[a]._globalStyles:void 0,h="undefined"!=typeof d&&d?e[a]._globalStyle:void 0;if("undefined"!=typeof h){var v=modelDef.getDef(e,"theme");m=v[h.replace(/^(\$theme|_theme_)\./,"")]}var y=modelDef.getBindValue.bind(void 0,e,o,i,a);y._templateName=a;var k='<div class="editor">';k+='<div class="blockType'+("undefined"!=typeof g?" withdefaults":"")+'">'+f.type+"</div>";var w=_propEditor(y,t,n,f,m,"",void 0,r,c,s,g,h,u,p);w.length>0&&(k+=w),k+="</div>",l(k,a,r)},createBlockEditors=function(e,t,o,n,i,a,r,l){createBlockEditor(e,t,o,n,i,a,"edit",r,l),createBlockEditor(e,t,o,n,i,a,"styler",r,l,!0)},generateEditors=function(e,t,o,n,i){var a,r=e._defs,l=e.templateName,s=e._blocks,d=[];for(a=0;a<s.length;a++)"undefined"!=typeof s[a].container&&d.push(modelDef.generateModel(r,s[a].block)),createBlockEditors(r,t,void 0,o,s[a].root,s[a].block,n,i);return"undefined"!=typeof r.theme&&createBlockEditor(r,t,void 0,o,l,"theme","styler",n,void 0,!1,!1,-1),d};module.exports=generateEditors;
1442
+
1443
+ },{"./../../../bower_components/console-browserify/index.js":1,"./declarations.js":50,"./model.js":54,"./utils.js":57}],53:[function(require,module,exports){
1444
+ "use strict";var modelDef=require("./model.js"),wrappedResultModel=function(e){var t=e._defs,o=e.templateName,a=modelDef.getDef(t,o),i=modelDef.generateResultModel(e),l=require("./wrapper.js"),n=l(i,a,t);return n},translateTemplate=function(){var e=require("./parser.js");return e.apply(e,arguments)},generateEditors=function(){var e=require("./editor.js");return e.apply(e,arguments)},checkModel=function(){var e=require("./checkmodel.js");return e.apply(e,arguments)};module.exports={translateTemplate:translateTemplate,wrappedResultModel:wrappedResultModel,generateResultModel:modelDef.generateResultModel,generateEditors:generateEditors,checkModel:checkModel};
1445
+
1446
+ },{"./checkmodel.js":49,"./editor.js":52,"./model.js":54,"./parser.js":55,"./wrapper.js":58}],54:[function(require,module,exports){
1447
+ "use strict";var objExtend=require("./domutils.js").objExtend,console=require("./../../../bower_components/console-browserify/index.js"),_valueSet=function(e,t,o,n){var i=o.indexOf(".");if(-1==i)if("undefined"==typeof t[o])console.log("Undefined prop "+o+" while setting value "+n+" in model._valueSet");else if(null===t[o])"object"==typeof n&&null!==n&&"undefined"==typeof n.push&&console.log("nullpropobjectvalue",o,n),t[o]=n;else if("object"==typeof t[o]&&"function"==typeof t[o].push){var a;if("string"==typeof n){var r=n.match(/^\[(.*)\]$/);if(null===r)throw"Unexpected default value for array property "+o+": "+n;a=r[1].split(",")}else{if("object"!=typeof n||"undefined"==typeof n.push)throw"Unexpected default value for array property "+o+": "+n+" typeof "+typeof n;a=n}for(var l=[],s=0;s<a.length;s++)"@"==a[s].substr(0,1)?l.push(_generateModel(e,a[s].substr(1))):a[s].length>0&&l.push(a[s]);t[o]=l}else"string"==typeof t[o]||"boolean"==typeof t[o]?t[o]=n:"object"==typeof t[o]&&null!==t[o]&&"undefined"!=typeof t[o]._widget?("object"==typeof n&&null!==n&&console.log("objectvalue",o,t[o]._widget,n),t[o]=n):console.log("setting",typeof t[o],t[o],o,n);else{var d=o.substr(0,i);_valueSet(e,t[d],o.substr(i+1),n)}},_modelCreateOrUpdateBlockDef=function(e,t,o,n){if("undefined"!=typeof e[t]&&e[t]._initialized&&!e[t]._writeable)throw console.log("_modelCreateOrUpdateBlockDef",e,t,o,n),"Trying to alter non writeable model: "+t+" / "+o;if("undefined"==typeof e[t]&&(e[t]={_writeable:!0},"undefined"==typeof n&&(n={}),"undefined"==typeof n.category&&"undefined"==typeof e[t]._category&&(n.category=t.match(/(^t|.T)heme$/)||t.match(/(^s|.S)tyle$/)||t.match(/(^c|.C)olor$/)||t.match(/(^r|.R)adius$/)?"style":"content")),"undefined"!=typeof n){if("undefined"!=typeof n.name&&(e[t]._name=n.name),"undefined"!=typeof n.themeOverride&&(e[t]._themeOverride=n.themeOverride),"undefined"!=typeof n.globalStyle){e[t]._globalStyle=n.globalStyle;var i=n.globalStyle.replace(/^(\$theme|_theme_)\./,""),a=i.indexOf("."),r=-1!=a?i.substr(0,a):i;_modelCreateOrUpdateBlockDef(e,"theme",r),("undefined"==typeof e[t]._themeOverride||e[t]._themeOverride)&&_modelCreateOrUpdateBlockDef(e,t,"customStyle=false")}"undefined"!=typeof n.contextName&&(e[t]._context=n.contextName,"block"==n.contextName&&"undefined"==typeof e[t]._globalStyle&&(e[t]._globalStyle="_theme_.bodyTheme",_modelCreateOrUpdateBlockDef(e,"theme","bodyTheme"),("undefined"==typeof e[t]._themeOverride||e[t]._themeOverride)&&_modelCreateOrUpdateBlockDef(e,t,"customStyle=false"))),"undefined"!=typeof n.extend&&(e[t].type=n.extend)}for(var l in n)n.hasOwnProperty(l)&&"undefined"!=typeof n[l]&&-1==["name","extend","contextName","globalStyle","themeOverride"].indexOf(l)&&(e[t]["_"+l]=n[l]);"undefined"!=typeof o&&o.length>0&&(e[t]._props="undefined"!=typeof e[t]._props&&e[t]._props.length>0?e[t]._props+" "+o:o)},_removePrefix=function(e){var t=e.match(/^[^A-Z]+([A-Z])(.*)$/);return null!==t?t[1].toLowerCase()+t[2]:null},_generateModelFromDef=function(e,t){var o={};for(var n in e)if(!n.match(/^_.*/)&&e.hasOwnProperty(n)){var i=e[n];if("object"==typeof i&&null!==i&&"undefined"!=typeof i._complex&&i._complex)o[n]=_generateModelFromDef(i,t);else if("type"==n)o[n]=i;else{if("object"!=typeof i)throw console.error("Unexpected model def",n,i,e),"Unexpected model def ["+n+"]="+i;o[n]=null}}if("undefined"!=typeof e._defaultValues){var a=e._defaultValues;for(var r in a)a.hasOwnProperty(r)&&_valueSet(t,o,r,a[r])}return o},_generateModel=function(e,t){var o=_getModelDef(e,t,!1,!0);return _generateModelFromDef(o,e)},_getDef=function(e,t){return _getModelDef(e,t,!1,!0)},_getModelDef=function(e,t,o,n){if("undefined"==typeof e[t]){if(-1!=t.indexOf(" "))return null;var i=_removePrefix(t);return null!==i?_getModelDef(e,i,o,n):null}var a=e[t];if("object"!=typeof a)throw"Block definition must be an object: found "+a+" for "+t;if("undefined"==typeof a._initialized){if("undefined"==typeof a.type&&(a.type=-1==t.indexOf(" ")?t:t.substr(t.indexOf(" ")+1)),a.type!=t&&"undefined"==typeof a._widget){var r=_getModelDef(e,a.type,!0),l=objExtend(r,a);a=l,e[t]=a}else"undefined"==typeof a._widget&&"undefined"==typeof a._props&&"undefined"==typeof a._complex;a._writeable=!0,a._initialized=!0}if("undefined"!=typeof a._props){var s=a._props;if(s=s.split(" "),s.length>0&&"undefined"==typeof a._writeable)throw console.error("Altering a non writable object ",t,s,a),"Altering a non writable object: "+t+" def: "+s;"undefined"==typeof a._processedDefs&&(a._processedDefs={}),"undefined"==typeof a._globalStyles&&(a._globalStyles={}),"undefined"==typeof a._defaultValues&&(a._defaultValues={});for(var d=0;d<s.length;d++){var u=s[d];if(0!==u.length){var c=u,p=null,f=u.match(/^([^=\[\]]+)(\[\])?(=?)(.*)$/);if(null!==f&&(u=f[1],"[]"==f[2]&&("undefined"==typeof a[u]&&(a[u]=[]),p=[]),"="==f[3]&&(p=u.match(/(^v|V)isible$/)?"true"==String(f[4]).toLowerCase():u.match(/^customStyle$/)?"true"==String(f[4]).toLowerCase():f[4])),null!==p&&"undefined"==typeof a._defaultValues[u]&&(a._defaultValues[u]=p),"undefined"==typeof a[u]){var b=_getModelDef(e,t+" "+u,!0);null===b&&(b=_getModelDef(e,u,!0)),a[u]=b}a._processedDefs[u]=c,a._complex=!0}}delete a._props}if(o){a._writeable=!1;var m=objExtend({},a);return m}if(n)return a._writeable=!1,a;if("undefined"==typeof a._writeable||a._writeable===!1)throw"Retrieving non writeable object definition: "+t;return a},_increaseUseCount=function(e,t){if(e){if("undefined"==typeof t._usecount)throw console.error("ERROR trying to bind an unused property while readonly",t),"ERROR trying to bind an unused property"}else"undefined"==typeof t._usecount&&(t._usecount=0),t._usecount++},ensureGlobalStyle=function(e,t,o,n,i,a,r,l){var s=o(a,r,l);if("undefined"==typeof e[n]._globalStyles[i]){if(t)throw"Cannot find _globalStyle for "+i+" in "+n+"!";(-1!=i.indexOf(".")||"object"==typeof e[n][i]&&"undefined"!=typeof e[n][i]._widget)&&(e[n]._globalStyles[i]=s)}else if(e[n]._globalStyles[i]!=s)throw"Unexpected conflicting globalStyle [2] for "+n+"/"+i+": old="+e[n]._globalStyles[i]+" new="+s},modelEnsurePathAndGetBindValue=function(e,t,o,n,i,a,r,l,s,d){var u,c,p;if("$"==r.substr(0,1)){console.warn("DEPRECATED $ in bindingProvider: ",r,i);var f=r.indexOf(".");if(-1==f)throw"Unexpected fullPath: "+r+"/"+a+"/"+i+"/"+l+"/"+s;if(u=r.substr(1,f-1),p=r.substr(f+1),"theme"!=u)throw"Unexpected $ sequence: "+u+" in "+r;var b=p.indexOf(".");u=p.substr(0,b),p=p.substr(b+1),c="$root.content().theme()."+u+"()."+p.replace(new RegExp("\\.","g"),"().")}else if("#"==r.substr(0,1))console.warn("DEPRECATED # in bindingProvider: ",r,i),u=n,p=r.substr(1),c="$root.content()."+p.replace(new RegExp("\\.","g"),"().");else if("_theme_."==r.substr(0,8)){var m=r.indexOf(".",8);u=r.substr(8,m-8),p=r.substr(m+1),c="$root.content().theme()."+u+"()."+p.replace(new RegExp("\\.","g"),"().")}else"_root_."==r.substr(0,7)?(u=n,p=r.substr(7),c="$root.content()."+p.replace(new RegExp("\\.","g"),"().")):(u=i,p=a+r,c=r.replace(new RegExp("\\.","g"),"()."));if("undefined"==typeof t[u])throw"Cannot find model def for ["+u+"]";var g=p.indexOf("."),h=-1==g?p:p.substr(0,g);if(-1!=u.indexOf("-"))throw console.error("ERROR cannot use - for block names",u),"ERROR unexpected char in block name: "+u;if(-1!=h.indexOf("-"))throw console.error("ERROR cannot use - for property names",h),"ERROR unexpected char in property name: "+u;if(e)return"undefined"!=typeof t[u]._globalStyle&&"undefined"!=typeof t[u][h]&&"style"==t[u][h]._category&&(c+="._defaultComputed"),c;var v;if(e){if("undefined"!=typeof l)throw"Cannot use defaultValue in readonly mode!";if(s)throw"Cannot use overrideDefault in readonly mode for "+u+"/"+p+"/"+s+"!";if("undefined"!=typeof d)throw"Cannot set category for "+u+"/"+p+"/"+d+" in readonly mode!";v=_getModelDef(t,u,!1,!0)}else t[u]._writeable===!1&&console.log("TODO debug use cases for this condition",u,p),v=_getModelDef(t,u,t[u]._writeable===!1);if(null===v)throw"Unexpected model for ["+u+"]";if("undefined"==typeof v[h]){if(e)throw"Cannot find path "+h+" for "+u+"!";_modelCreateOrUpdateBlockDef(t,u,h),v=_getModelDef(t,u,!1)}"undefined"!=typeof t[u]._globalStyle&&"undefined"!=typeof t[u][h]&&null!==t[u][h]&&"style"==t[u][h]._category&&(c+="._defaultComputed");var y=v;try{if(_increaseUseCount(e,y),-1!=g){var k=p;do{var w=k.substr(0,g);if("undefined"==typeof y[w])throw"Found an unexpected prop "+w+" for model "+u+" for "+p;y=y[w],_increaseUseCount(e,y),k=k.substr(g+1),g=k.indexOf(".")}while(-1!=g);if("undefined"==typeof y[k]||null===y[k])throw"Found an unexpected path termination "+k+" for model "+u+" for "+p;y=y[k]}else y=y[p];if("undefined"==typeof y||null===y)throw"Unexpected null model for "+u+"/"+a+"/"+r;"undefined"!=typeof d&&(y._category=d),_increaseUseCount(e,y)}catch(_){throw console.error("TODO ERROR Property lookup exception",_,u,p,i,r,t),_}if("undefined"!=typeof t[u]._globalStyle&&"object"==typeof t[u][h]&&null!==t[u][h]&&"undefined"!=typeof t[u][h]._category&&"style"==t[u][h]._category){var x=modelEnsurePathAndGetBindValue.bind(void 0,e,t,o,n,i,""),$=-1!=p.indexOf(".")?p.substr(p.indexOf(".")):"";if(-1!=$.indexOf(".",1))throw"TODO unsupported object nesting! "+p;var S=t[u]._globalStyle+"."+h;"object"==typeof t[u][h]&&null!==t[u][h]&&"undefined"!=typeof t[u][h]._globalStyle&&(S=t[u][h]._globalStyle),ensureGlobalStyle(t,e,x,u,h,S,void 0,!1);var O=S+$;if("undefined"==typeof l&&null!==t[u]._defaultValues[p]&&(l=t[u]._defaultValues[p]),ensureGlobalStyle(t,e,x,u,p,O,l,s),"undefined"!=typeof l){if(e)throw console.error("Cannot set a new theme default value",O.substr(7),l,"while in readonly mode"),"Cannot set a new theme default value ("+l+") for "+O.substr(7)+" while in readonly mode!";o("default",O.substr(7),l)}l=null}if("undefined"!=typeof l)if("undefined"==typeof t[u]._defaultValues[p]||"undefined"!=typeof s&&s){if(e)throw"Cannot set new _defaultValues [1] for "+p+" in "+u+"!";t[u]._defaultValues[p]=l}else if(null===l){if(e&&null!==t[u]._defaultValues[p])throw"Cannot set new _defaultValues [2] for "+p+" in "+u+"!";t[u]._defaultValues[p]=null}else if(t[u]._defaultValues[p]!=l)throw console.error("TODO error!!! Trying to set a new default value for "+u+" "+p+" while it already exists (current: "+t[u]._defaultValues[p]+", new: "+l+")"),"Trying to set a new default value for "+u+" "+p+" while it already exists (current: "+t[u].defaultValues[p]+", new: "+l+")";return c},generateResultModel=function(e){var t=e._defs,o=e.templateName,n=_generateModel(t,o);return"undefined"!=typeof t.theme&&(n.theme=_generateModel(t,"theme")),n};module.exports={ensurePathAndGetBindValue:modelEnsurePathAndGetBindValue.bind(void 0,!1),getBindValue:modelEnsurePathAndGetBindValue.bind(void 0,!0),generateModel:_generateModel,generateResultModel:generateResultModel,getDef:_getDef,createOrUpdateBlockDef:_modelCreateOrUpdateBlockDef};
1448
+
1449
+ },{"./../../../bower_components/console-browserify/index.js":1,"./domutils.js":51}],55:[function(require,module,exports){
1450
+ (function (global){
1451
+ "use strict";function conditional_replace(e){return e.replace(/<!--\[if ([^\]]*)\]>((?:(?!--)[\s\S])*?)<!\[endif\]-->/g,function(e,t,o){var n="<!-- cc:start -->";n+=o.replace(/<([A-Za-z:]+)/g,"<!-- cc:bo:$1 --><cc").replace(/<\/([A-Za-z:]+)>/g,"<!-- cc:bc:$1 --></cc><!-- cc:ac:$1 -->").replace(/\/>/g,"/><!-- cc:sc -->"),n+="<!-- cc:end -->";var i='<replacedcc condition="'+t+'" style="display: none">';return i+=$("<div>").append($(n)).html().replace(/^<!-- cc:start -->/,"").replace(/<!-- cc:end -->$/,""),i+="</replacedcc>"})}var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),console=require("./../../../bower_components/console-browserify/index.js"),converterUtils=require("./utils.js"),elaborateDeclarations=require("./declarations.js"),processStylesheetRules=require("./stylesheet.js"),modelDef=require("./model.js"),domutils=require("./domutils.js"),wrapElementWithCondition=function(e,t,o){var n=domutils.getAttribute(t,e);try{var i=converterUtils.conditionBinding(n,o);$(t).before("<!-- ko if: "+i+" -->"),$(t).after("<!-- /ko -->"),domutils.removeAttribute(t,e)}catch(a){throw console.warn("Model ensure path failed in if/variant",t,n,e),a}},replacedAttributes=function(e,t){domutils.setAttribute(e,t,domutils.getAttribute(e,"replaced"+t))},processStyle=function(e,t,o,n){var i,a=domutils.getAttribute(e,"replacedstyle"),r=null;n&&(i={uniqueId:"$data",attr:{id:"id"}});var l=null!==domutils.getAttribute(e,"data-ko-display");r=elaborateDeclarations(a,void 0,t,o,e,i,l),null===r?r=a:domutils.removeAttribute(e,"replacedstyle"),null!==r&&(r.trim().length>0?domutils.setAttribute(e,"style",r):domutils.removeAttribute(e,"style"))},_fixRelativePath=function(e,t,o,n){var i=domutils.getAttribute(n,e),a=t(i);null!==a&&domutils.setAttribute(n,e,a)},processBlock=function(e,t,o,n,i,a,r,l,s,d){try{var u;if("block"==a)u=domutils.getAttribute(e,"data-ko-block"),domutils.removeAttribute(e,"data-ko-block");else{if("template"!=a)throw"Unexpected context name while processing block: "+a;u=r}$("[data-ko-remove]",e).remove();for(var c=$("[data-ko-block]",e).replaceWith("<replacedblock>"),p=["href","src","data-ko-placeholder-src","background"],f=0;f<p.length;f++){var b=_fixRelativePath.bind(void 0,p[f],i);$("["+p[f]+"]",e).each(b)}var m=domutils.getAttribute(e,"data-ko-properties");null===m&&(m=""),$("[data-ko-properties]",e).each(function(e,t){m.length>0&&(m+=" "),m+=domutils.getAttribute(t,"data-ko-properties"),domutils.removeAttribute(t,"data-ko-properties")}),modelDef.createOrUpdateBlockDef(t,u,m,{contextName:a});var g=modelDef.ensurePathAndGetBindValue.bind(void 0,t,o,r,u,"");"block"==a&&g("id",""),$("style",e).each(function(e,n){var a=domutils.getInnerHtml(n),l=modelDef.createOrUpdateBlockDef.bind(void 0,t),s=modelDef.ensurePathAndGetBindValue.bind(void 0,t,o,r),c=processStylesheetRules(a,void 0,s,l,o,i,r,u);if(c!=a)if(""!==c.trim()){var p=d(c);domutils.setAttribute(n,"data-bind","template: { name: '"+p+"' }"),domutils.setContent(n,"")}else domutils.removeElements($(n))}),processStyle(e,i,g,s);for(var h=["data-ko-display","data-ko-editable","data-ko-wrap","href"],v=0;v<h.length;v++){var k=domutils.getAttribute(e,h[v]);if(k)throw console.warn("ERROR: Unsupported "+h[v]+" used together with data-ko-block",e),"ERROR: Unsupported "+h[v]+" used together with data-ko-block"}return $("[data-ko-link]",e).each(function(e,t){var o=domutils.getAttribute(t,"data-ko-link"),n=domutils.getAttribute(t,"replacedstyle");("undefined"==typeof n||null===n)&&(n=""),n=""!==n?"-ko-attr-href: @"+o+"; "+n:"-ko-attr-href: @"+o,domutils.setAttribute(t,"replacedstyle",n),domutils.setAttribute(t,"data-ko-wrap",o),domutils.removeAttribute(t,"data-ko-link")}),$("[replacedstyle]",e).each(function(e,t){processStyle(t,i,g,!1)}),$("[replacedhttp-equiv]",e).each(function(e,t){replacedAttributes(t,"http-equiv")}),$("[data-ko-display]",e).each(function(e,t){wrapElementWithCondition("data-ko-display",t,g)}),$("[data-ko-editable]",e).each(function(e,t){var o,n,i,a,r,l,s=domutils.getAttribute(t,"data-ko-editable");if(s.lastIndexOf(".")>0){var u=s.substr(0,s.lastIndexOf("."));r=g(u)}else r=g(s);if(l="wysiwygClick: function(obj, evt) { $root.selectItem("+r+", $data); return false }, clickBubble: false, wysiwygCss: { selecteditem: $root.isSelectedItem("+r+") }, scrollIntoView: $root.isSelectedItem("+r+")","img"!=domutils.getLowerTagName(t)){n=domutils.getInnerHtml(t);var c=g(s,n,!0,"wysiwyg");if(o="",domutils.getAttribute(t,"id")||(o+="wysiwygId: id()+'_"+s.replace(".","_")+"', "),"undefined"!=typeof l&&(o+=l+", "),o+="wysiwygOrHtml: "+c,"td"==domutils.getLowerTagName(t)){var p=$('<div data-ko-wrap="false" style="width: 100%; height: 100%"></div>')[0];domutils.setAttribute(p,"data-bind",o);var f=domutils.getInnerHtml($("<div></div>").append(p));domutils.setContent(t,f)}else i=domutils.getAttribute(t,"data-bind"),a=(null!==i?i+", ":"")+o,domutils.setAttribute(t,"data-bind",a),domutils.setContent(t,"");domutils.removeAttribute(t,"data-ko-editable")}else{var b=domutils.getAttribute(t,"width");if(""===b&&(b=null),null===b)throw console.error("ERROR: data-ko-editable images must declare a WIDTH attribute!",t),"ERROR: data-ko-editable images must declare a WIDTH attribute!";var m=domutils.getAttribute(t,"height");""===m&&(m=null);var h=domutils.getAttribute(t,"align");i=domutils.getAttribute(t,"data-bind");var v=i&&i.match(/virtualAttr: {[^}]* height: ([^,}]*)[,}]/);v&&(m=v[1]);var k=i&&i.match(/virtualAttr: {[^}]* width: ([^,}]*)[,}]/);k&&(b=k[1]);var y;n=domutils.getAttribute(t,"data-ko-placeholder-src");var w="";n?w=domutils.getAttribute(t,"src"):n=domutils.getAttribute(t,"src");var x;b&&m?x=b+"+'x'+"+m:m?b||(x="'h'+"+m+"+''"):x="'w'+"+b+"+''";var _,C=m||domutils.getAttribute(t,"data-ko-placeholder-height"),O=b||domutils.getAttribute(t,"data-ko-placeholder-width");if(domutils.removeAttribute(t,"src"),domutils.removeAttribute(t,"data-ko-editable"),domutils.removeAttribute(t,"data-ko-placeholder-height"),domutils.removeAttribute(t,"data-ko-placeholder-width"),domutils.removeAttribute(t,"data-ko-placeholder-src"),n&&(_="{ width: "+O+", height: "+C+", text: "+x+"}"),!O||!C)throw console.error("IMG data-ko-editable must declare width and height attributes, or their placeholder counterparts data-ko-placeholder-width/data-ko-placeholder-height",t),"ERROR: IMG data-ko-editable MUST declare width and height attributes, or their placeholder counterparts data-ko-placeholder-width/data-ko-placeholder-height";var S=g(s,w,!1,"wysiwyg");o="wysiwygSrc: { width: "+b+", height: "+m+", src: "+S+", placeholder: "+_+" }",a=(null!==i?i+", ":"")+o,domutils.setAttribute(t,"data-bind",a);var T=d(t),A="{ width: "+b;"left"==h?A+=", float: 'left'":"right"==h?A+=", float: 'right'":"center"==h?console.log("non so cosa fa align=center su una img e quindi non so come simularne l'editing"):"top"==h?A+=", verticalAlign: 'top'":"middle"==h?A+=", verticalAlign: 'middle'":"bottom"==h&&(A+=", verticalAlign: 'bottom'"),A+="}",$(t).before("<!-- ko wysiwygImg: { _data: $data, _item: "+r+", _template: '"+T+"', _editTemplate: 'img-wysiwyg', _src: "+S+", _width: "+b+", _height: "+m+", _align: "+(null===h?void 0:"'"+h+"'")+", _size: "+x+", _method: "+y+", _placeholdersrc: "+_+", _stylebind: "+A+" } -->"),$(t).after("<!-- /ko -->")}}),$("[href]",e).each(function(e,t){var o=domutils.getAttribute(t,"href"),n="wysiwygHref: '"+converterUtils.addSlashes(o)+"'",i=domutils.getAttribute(t,"data-bind"),a=(null!==i?i+", ":"")+n;domutils.setAttribute(t,"data-bind",a)}),$("replacedblock",e).each(function(e,a){var s=c[e],p=processBlock(s,t,o,n,i,"block",u,l,!0,d),f=modelDef.ensurePathAndGetBindValue(t,o,r,u,"",p);$(a).before("<!-- ko block: { data: "+converterUtils.addSlashes(f)+", template: 'block' } -->"),$(a).after("<!-- /ko -->"),$(a).remove()}),$($("[data-ko-wrap]",e).get().reverse(),e).each(function(e,t){var o=domutils.getAttribute(t,"data-ko-wrap");if("undefined"==typeof o||""===o||"true"===o)throw"Unsupported empty value for data-ko-wrap: use false value if you want to always remove the tag";var n,i,a=converterUtils.conditionBinding(o,g),r=domutils.getAttribute(t,"data-bind");if(""!==r&&null!==r&&r.match(/(block|wysiwygOrHtml):/)){var l="<!-- ko "+r+" -->"+domutils.getInnerHtml(t)+"<!-- /ko -->";n=d(l),domutils.removeAttribute(t,"data-ko-wrap"),i=d(t),domutils.replaceHtml(t,"<!-- ko template: /* special */ (typeof templateMode != 'undefined' && templateMode == 'wysiwyg') || "+a+" ? '"+i+"' : '"+n+"' --><!-- /ko -->")}else n=d(domutils.getInnerHtml(t)),domutils.removeAttribute(t,"data-ko-wrap"),domutils.setContent(t,"<!-- ko template: '"+n+"' --><!-- /ko -->"),i=d(t),domutils.replaceHtml(t,"<!-- ko template: (typeof templateMode != 'undefined' && templateMode == 'wysiwyg') || "+a+" ? '"+i+"' : '"+n+"' --><!-- /ko -->")}),d(e,u,"show"),n(r,u,a,l),u}catch(y){throw console.error("Exception while parsing the template",y,e),y}},translateTemplate=function(e,t,o,n){var i={},a=conditional_replace(t.replace(/(<[^>]+\s)(style|http-equiv)(="[^"]*"[^>]*>)/gi,function(e,t,o,n){return t+"replaced"+o+n})),r=$(a),l=r[0],s=[],d=function(e,t,o,n){s.push({root:e,block:t,context:o,container:n})},u=function(e,t,o){if("undefined"==typeof i.themes&&(i.themes={}),"undefined"==typeof i.themes[e]&&(i.themes[e]={}),"undefined"==typeof i.themes[e][t]||null===i.themes[e][t])i.themes[e][t]=o;else if("undefined"!=typeof o&&null!==o){var n=i.themes[e][t];n!=o&&console.log("Error setting a new default for property "+t+" in theme "+e+". old:"+n+" new:"+o+"!")}},c=$("[data-ko-container]",r),p={};c.each(function(e,t){var o=domutils.getAttribute(t,"data-ko-container")+"Blocks";domutils.removeAttribute(t,"data-ko-container"),domutils.setAttribute(t,"data-bind","block: "+o);var n=$("> [data-ko-block]",t);domutils.removeElements(n,!0),p[o]=n}),modelDef.createOrUpdateBlockDef(i,"id"),modelDef.createOrUpdateBlockDef(i,"bodyTheme"),modelDef.createOrUpdateBlockDef(i,"blocks","blocks[]"),modelDef.createOrUpdateBlockDef(i,"text"),processBlock(l,i,u,d,o,"template",e,void 0,!1,n);var f=function(t,a,r){processBlock(r,i,u,d,o,"block",e,t,!0,n)};for(var b in p)if(p.hasOwnProperty(b)){var m=p[b],g=b;modelDef.ensurePathAndGetBindValue(i,u,e,e,"",g+".blocks","[]"),m.each(f.bind(void 0,g))}var h={_defs:i,templateName:e,_blocks:s};return"undefined"!=typeof i[e]._version&&(h.version=i[e]._version),h};module.exports=translateTemplate;
1452
+
1453
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1454
+
1455
+ },{"./../../../bower_components/console-browserify/index.js":1,"./declarations.js":50,"./domutils.js":51,"./model.js":54,"./stylesheet.js":56,"./utils.js":57}],56:[function(require,module,exports){
1456
+ "use strict";var cssParse=require("./../../../bower_components/mensch/lib/parser.js"),console=require("./../../../bower_components/console-browserify/index.js"),converterUtils=require("./utils.js"),elaborateDeclarations=require("./declarations.js"),_processStyleSheetRules_processBlockDef=function(e,t){for(var o,n,i,r=0;r<t.length;r++)if("rule"==t[r].type){for(var a=t[r].selectors,l=!1,s=!1,d=0;d<a.length;d++)a[d].match(/:preview$/)?s=!0:l=!0;if(s&&l)throw console.log("cannot mix selectors type (:preview and declarations) in @supports -ko-blockdefs ",a),"Cannot mix selectors type (:preview and declarations) in @supports -ko-blockdefs";if(!s&&!l)throw console.log("cannot find known selectors in @supports -ko-blockdefs ",a),"Cannot find known selectors in @supports -ko-blockdefs";if(l){o="",n={},i=t[r].declarations;for(var u=0;u<i.length;u++)"property"==i[u].type&&("label"==i[u].name?n.name=i[u].value:"context"==i[u].name?n.contextName=i[u].value:"properties"==i[u].name?o=i[u].value:"theme"==i[u].name?n.globalStyle="_theme_."+i[u].value:"themeOverride"==i[u].name?n.themeOverride="true"==String(i[u].value).toLowerCase():n[i[u].name]=i[u].value);for(var c=0;c<a.length;c++)e(a[c],o,n)}if(s)for(var f=0;f<a.length;f++){var p=a[f].substr(0,a[f].indexOf(":")),b=t[r].declarations;e(p,void 0,{previewBindings:b})}}},processStylesheetRules=function(e,t,o,n,i,r,a,l){var s=e,d=null;if("undefined"==typeof t){var u=cssParse(e,{comments:!0,position:!0});if("stylesheet"!=u.type||"undefined"==typeof u.stylesheet)throw console.log("unable to process styleSheet",u),"Unable to parse stylesheet";t=u.stylesheet.rules}for(var c,f=t.length-1;f>=0;f--){if("supports"==t[f].type&&"-ko-blockdefs"==t[f].name)_processStyleSheetRules_processBlockDef(n,t[f].rules),s=converterUtils.removeStyle(s,t[f].position.start,d,0,0,0,"");else if("media"==t[f].type||"supports"==t[f].type)s=processStylesheetRules(s,t[f].rules,o,n,i,r,a,l);else if("comment"==t[f].type);else if("rule"==t[f].type){for(var p=t[f].selectors,b="",m=null,g=0;g<p.length;g++){b.length>0&&(b+=", ");var h=p[g].match(/\[data-ko-block=([^ ]*)\]/);if(null!==h){if(null!==m&&m!=h[1])throw"Found multiple block-match attribute selectors: cannot translate it ("+m+" vs "+h[1]+")";m=h[1]}b+="<!-- ko text: templateMode =='wysiwyg' ? '#main-wysiwyg-area ' : '' --><!-- /ko -->"+p[g]}if(m){var v="<!-- ko foreach: $root.findObjectsOfType($data, '"+m+"') -->",y="<!-- /ko -->",k=d,w=" ";t[f].declarations.length>0&&(t[f].declarations[0].position.start.line!=t[f].position.end.line&&(w="\n"+new Array(t[f].position.start.col).join(" ")),k=t[f].declarations[t[f].declarations.length-1].position.end),null===k?s+=w+y:s=k==d?converterUtils.removeStyle(s,k,d,0,0,0,w+y):converterUtils.removeStyle(s,k,d,0,0,0,w+"}"+w+y),b=v+w+b.replace(new RegExp("\\[data-ko-block="+m+"\\]","g"),"<!-- ko text: '#'+id() -->"+m+"<!-- /ko -->"),n(m,"",{contextName:"block"})}var _=m?m:l;c=o.bind(this,_,"");var x=elaborateDeclarations(s,t[f].declarations,r,c);null!==x&&(s=x),s=converterUtils.removeStyle(s,t[f].position.start,t[f].position.end,0,0,0,b)}else console.log("Unknown rule type",t[f].type,"while parsing <style> rules");d=t[f].position.start}return s};module.exports=processStylesheetRules;
1457
+
1458
+ },{"./../../../bower_components/console-browserify/index.js":1,"./../../../bower_components/mensch/lib/parser.js":15,"./declarations.js":50,"./utils.js":57}],57:[function(require,module,exports){
1459
+ "use strict";var console=require("./../../../bower_components/console-browserify/index.js"),jsep=require("./../../../bower_components/jsep/src/jsep.js");jsep.addBinaryOp("or",1),jsep.addBinaryOp("and",2),jsep.addBinaryOp("eq",6),jsep.addBinaryOp("neq",6),jsep.addBinaryOp("lt",7),jsep.addBinaryOp("lte",7),jsep.addBinaryOp("gt",7),jsep.addBinaryOp("gte",7);var addSlashes=function(e){return e.replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0")},removeStyle=function(e,t,o,n,i,r,a){for(var l=e.split("\n"),s=i,d=r,u=1+n;u<t.line;u++)s+=l[u-1-n].length+1;if(s+=t.col,null!==o){for(var c=1+n;c<o.line;c++)d+=l[c-1-n].length+1;d+=o.col}else d+=e.length+1;var f=e.substr(0,s-1)+a+e.substr(d-1);return f},expressionGenerator=function(e,t,o){function n(e){switch(e){case"or":return"||";case"and":return"&&";case"lt":return"<";case"lte":return"<=";case"gt":return">";case"gte":return">=";case"eq":return"==";case"neq":return"!=";default:return e}}function i(e,t,o,r){if("undefined"==typeof o&&(o=!0),"undefined"!=typeof r&&"Identifier"!==e.type&&"MemberExpression"!==e.type&&console.log("Cannot apply default value to variable when using expressions"),"BinaryExpression"===e.type||"LogicalExpression"===e.type)return"("+i(e.left,t,o)+" "+n(e.operator)+" "+i(e.right,t,o)+")";if("CallExpression"===e.type){var a=e.arguments.map(function(e){return i(e,t,o)});return i(e.callee,t,o)+"("+a.join(", ")+")"}if("UnaryExpression"===e.type)return e.operator+i(e.argument,t,o);if("MemberExpression"==e.type&&e.computed)throw"Unexpected computed member expression";if("MemberExpression"!=e.type||e.computed){if("Literal"===e.type)return e.raw;if("Identifier"===e.type){var l=e.name;return o?t(l,r)+"()":l}if("ConditionalExpression"===e.type)return"("+i(e.test,t,o)+" ? "+i(e.consequent,t,o)+" : "+i(e.alternate,t,o)+")";throw"Compound"===e.type?"Syntax error in expression: operator expected after "+i(e.body[0],t,!1):"Found an unsupported expression type: "+e.type}var s=i(e.object,t,!1)+"."+i(e.property,t,!1);return o&&"Math"!==e.object.name&&"Color"!==e.object.name?t(s,r)+"()":s}return i(e,t,void 0,o)},expressionBinding=function(e,t,o){var n;if("undefined"!=typeof o&&null!==o){var i=e.trim().replace(/@\[([^\]]+)\]|@([a-zA-Z0-9\._]+)\b/g,"###var###");if(i=i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),"###var###"==i)n=[null,o];else if(i="^"+i.replace(/###var###/g,"(.+)")+"$",n=o.trim().match(new RegExp(i)),!n)throw console.log("Cannot find matches",n,"for",o,e,i,e),"Cannot find default value for "+e+" in "+o}try{var r=0,a="'"+e.replace(/@\[([^\]]+)\]|@([a-zA-Z0-9\._]+)\b|(')/g,function(e,o,i,a){if(a)return"\\"+a;r++;var l,s=o||i;if(n&&("undefined"!=typeof n[r]?l=n[r].trim():console.log("ABZZZ Cannot find default value for",s,"in",n,"as",r)),o){var d=jsep(o),u=expressionGenerator(d,t,l);return"'+"+u+"+'"}return"'+"+t(s,l)+"()+'"})+"'";return a=a.replace(/(^|[^\\])''\+/g,"$1").replace(/\+''/g,""),0===r&&"false"!==a&&"true"!==a&&console.error("Unexpected expression with no valid @variable references",e),a}catch(l){throw"Exception parsing expression "+e+" "+l}},conditionBinding=function(e,t){var o=jsep(e),n=expressionGenerator(o,t);return n};module.exports={addSlashes:addSlashes,removeStyle:removeStyle,conditionBinding:conditionBinding,expressionBinding:expressionBinding};
1460
+
1461
+ },{"./../../../bower_components/console-browserify/index.js":1,"./../../../bower_components/jsep/src/jsep.js":3}],58:[function(require,module,exports){
1462
+ (function (global){
1463
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),kowrap=require("./../../../bower_components/knockout.wrap/knockout.wrap.js"),console=require("./../../../bower_components/console-browserify/index.js"),_getOptionsObject=function(e){for(var t=e.split("|"),o={},n=0;n<t.length;n++){var i=t[n].split("=");o[i[0]]=i.length>1?i[1]:i[0]}return o},_makeComputed=function(e,t,o,n,i,r){var a=ko.computed({read:function(){var o=e();if(null===o){var a=ko.utils.unwrapObservable(n);return"undefined"==typeof a||"custom"==a?ko.utils.unwrapObservable(t):r[a][i]}return o},write:function(a){var l,s=ko.utils.unwrapObservable(n);if(l="undefined"==typeof s||"custom"==s?ko.utils.peekObservable(t):r[s][i],o)a==l?e(null):e(a);else{var d=ko.utils.peekObservable(e);(a!=l||null!==d)&&e(a)}}});return a},_nextVariantFunction=function(e,t,o){for(var n,i=e.utils.unwrapObservable(t),r=0;r<o.length&&(n=e.utils.peekObservable(o[r]),n!=i);r++);r==o.length&&(console.warn("Didn't find a variant!",t,i,o),r=o.length-1);var a=r+1;a==o.length&&(a=0);var l=e.utils.peekObservable(o[a]);t(l)},_getVariants=function(e){var t,o=e._variant;if("object"!=typeof e[o]||"undefined"==typeof e[o]._widget||"string"!=typeof e[o]._options&&"boolean"!==e[o]._widget)throw console.error("Unexpected variant declaration",o,e[o]),"Unexpected variant declaration: cannot find property "+o+" or its _options string and it is not a boolean";return t="string"==typeof e[o]._options?Object.keys(_getOptionsObject(e[o]._options)):[!0,!1]},_makeComputedFunction=function(e,t,o,n,i,r,a){if("undefined"==typeof e){if("undefined"==typeof n.utils.unwrapObservable(a).type)throw console.log("TODO ERROR Found a non-typed def ",e,a),"Found a non-typed def "+e;var l=n.utils.unwrapObservable(n.utils.unwrapObservable(a).type);e=t[l],"object"!=typeof e&&console.log("TODO ERROR Found a non-object def ",e,"for",l)}"undefined"==typeof i&&"undefined"!=typeof r&&r&&(i=a);var s="$root.content().",d=e._globalStyles;if("undefined"!=typeof d)for(var u in d)if(d.hasOwnProperty(u)){var c,p,f,b="$root.content().theme().scheme";if(d[u].substr(0,s.length)!=s)throw"UNEXPECTED globalStyle path ("+d[u]+") outside selfPath ("+s+")";f=d[u].substr(s.length),p=i,b.substr(0,s.length)==s?c=b.substr(s.length):(console.log("IS THIS CORRECT?",b,s),c=b);for(var m=p,g=f.split("()."),h="",v=!0,k=0;k<g.length;k++)p=n.utils.unwrapObservable(p)[g[k]],v?"theme"==g[k]&&(v=!1):(h.length>0&&(h+="."),h+=g[k]);for(var y=c.split("()."),w=0;w<y.length;w++)m=n.utils.unwrapObservable(m)[y[w]];for(var x=!0,_=u.split("."),$=a,C=0;C<_.length;C++)$=n.utils.unwrapObservable($)[_[C]];if(!n.isObservable($))throw"Unexpected non observable target "+u+"/"+h;$._defaultComputed=_makeComputed($,p,x,m,h,o)}if("undefined"!=typeof e._variant){for(var O=e._variant.split("."),S=a,T=n.utils.unwrapObservable(a),E=0;E<O.length;E++)S=n.utils.unwrapObservable(S)[O[E]];if("undefined"!=typeof S._defaultComputed&&(console.log("Found variant on a style property: beware variants should be only used on content properties because they don't match the theme fallback behaviour",e._variant),S=S._defaultComputed),"undefined"==typeof S)throw console.log("ERROR looking for variant target",e._variant,a),"ERROR looking for variant target "+e._variant;T._nextVariant=_nextVariantFunction.bind(S,n,S,_getVariants(e))}for(var H in e)if(e.hasOwnProperty(H)){var M=e[H];if("object"==typeof M&&null!==M&&"undefined"!=typeof M._context&&"block"==M._context){var q=i[H](),A=_makeComputedFunction(t[H],t,o,n,i,r,q);a[H](A)}else if("object"==typeof M&&null!==M&&"blocks"==M.type){for(var D,I,P,B=i[H](),j=B.blocks(),F=0;F<j.length;F++)D=n.utils.unwrapObservable(j[F]),I=n.utils.unwrapObservable(D.type),P=_makeComputedFunction(t[I],t,o,n,i,r,D),j[F](P);var R=B.blocks;_augmentBlocksObservable(R,_blockInstrumentFunction.bind(B,void 0,t,o,n,void 0,i,r)),i[H]._wrap=_makeBlocksWrap.bind(i[H],R._instrumentBlock),i[H]._unwrap=_unwrap.bind(i[H])}}return a},_augmentBlocksObservable=function(e,t){e._instrumentBlock=t,"undefined"==typeof e.origPush&&(e.origPush=e.push,e.push=_makePush.bind(e),e.origSplice=e.splice,e.splice=_makeSplice.bind(e))},_makeBlocksWrap=function(e,t){var o=ko.toJS(t),n=o.blocks;o.blocks=[];var i=kowrap.fromJS(o,void 0,!0)();_augmentBlocksObservable(i.blocks,e);for(var r=0;r<n.length;r++){var a=ko.toJS(n[r]);a.id="block_"+r,i.blocks.push(a)}this(i)},_makePush=function(){if(arguments.length>1)throw"Array push with multiple arguments not implemented";if(arguments.length>0&&ko.isObservable(arguments[0])&&("function"==typeof arguments[0]._unwrap?arguments[0]=arguments[0]._unwrap():console.log("WARN: pushing observable with no _unwrap function (TODO remove me, expected condition)")),ko.isObservable(arguments[0]))return this.origPush.apply(this,arguments);var e=this._instrumentBlock(arguments[0]);return this.origPush.apply(this,[e])},_makeSplice=function(){if(arguments.length>3)throw"Array splice with multiple objects not implemented";if(arguments.length>2&&ko.isObservable(arguments[2])&&("function"==typeof arguments[2]._unwrap?arguments[2]=arguments[2]._unwrap():console.log("WARN: splicing observable with no _unwrap function (TODO remove me, expected condition)")),arguments.length>2&&!ko.isObservable(arguments[2])){var e=this._instrumentBlock(arguments[2]);return this.origSplice.apply(this,[arguments[0],arguments[1],e])}return this.origSplice.apply(this,arguments)},_blockInstrumentFunction=function(e,t,o,n,i,r,a,l){"undefined"==typeof i&&(i=l);var s;s={"":_makeComputedFunction.bind(i,e,t,o,n,r,a)};var d=kowrap.fromJS(i,s,!0);return d._unwrap=_unwrap.bind(d),d},_wrap=function(e,t){var o=ko.utils.unwrapObservable(e(ko,t,void 0,!0));this(o)},_unwrap=function(){return ko.toJS(this)},_modelInstrument=function(e,t,o){var n=_blockInstrumentFunction.bind(void 0,t,o,o.themes),i=n(ko,e,void 0,!0);return i._wrap=_wrap.bind(i,n),i._unwrap=_unwrap.bind(i),i};module.exports=_modelInstrument;
1464
+
1465
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1466
+
1467
+ },{"./../../../bower_components/console-browserify/index.js":1,"./../../../bower_components/knockout.wrap/knockout.wrap.js":10}],59:[function(require,module,exports){
1468
+ (function (global){
1469
+ function Color(e){this.getBrightness=function(t){return e(t).getBrightness()},this.isLight=function(t){return e(t).isLight()},this.isDark=function(t){return e(t).isDark()},this.getLuminance=function(t){return e(t).getLuminance()},this.lighten=function(t,o){return e(t).lighten(o).toHexString()},this.brighten=function(t,o){return e(t).brighten(o).toHexString()},this.darken=function(t,o){return e(t).darken(o).toHexString()},this.desaturate=function(t,o){return e(t).desaturate(o).toHexString()},this.saturate=function(t,o){return e(t).saturate(o).toHexString()},this.greyscale=function(t){return e(t).greyscale().toHexString()},this.spin=function(t,o){return e(t).spin(o).toHexString()},this.complement=function(t){return e(t).complement().toHexString()},this.mix=e.mix,this.readability=e.readability,this.isReadable=e.isReadable,this.mostReadable=e.mostReadable}var tinycolor=require("./../../../bower_components/tinycolor/tinycolor.js"),colorPlugin=function(){global.Color=new Color(tinycolor)};module.exports=colorPlugin;
1470
+
1471
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1472
+
1473
+ },{"./../../../bower_components/tinycolor/tinycolor.js":18}],60:[function(require,module,exports){
1474
+ (function (global){
1475
+ "use strict";var console=require("./../../../bower_components/console-browserify/index.js"),$=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),inlineDocument=require("./../../../bower_components/juice/lib/inline")({}).inlineDocument,inlinerPlugin=function(e){e.inline=function(e){$("[style]:not([replacedstyle])",e).each(function(e,t){var o=$(t);o.attr("replacedstyle",o.attr("style"))});var t=[];$('style[data-inline="true"]',e).each(function(e,o){var a=$(o).html();a=a.replace(/<!-- ko ((?!--).)*? -->/g,""),a=a.replace(/<!-- \/ko -->/g,""),t.push(a),$(o).removeAttr("data-inline")});var o=t.join("\n"),a=function(t,o){return"undefined"==typeof o&&(o=e),$(t,o)};a.root=function(){return $(":root",e)},inlineDocument(a,o,{styleAttributeName:"replacedstyle"})}};module.exports=inlinerPlugin;
1476
+
1477
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1478
+
1479
+ },{"./../../../bower_components/console-browserify/index.js":1,"./../../../bower_components/juice/lib/inline":4}],61:[function(require,module,exports){
1480
+ (function (global){
1481
+ "use strict";var console=require("./../../../bower_components/console-browserify/index.js"),ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),$=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),lsLoader=function(e,t){var o=global.localStorage.getItem("metadata-"+e);if(null!==o){var a,i=global.localStorage.getItem("template-"+e);null!==i&&(a=JSON.parse(i));var l=JSON.parse(o);return{metadata:l,model:a,extension:lsCommandPluginFactory(l,t)}}throw"Cannot find stored data for "+e},lsCommandPluginFactory=function(e,t){var o=function(e,o,a){var i={name:"Save",enabled:ko.observable(!0)};i.execute=function(){i.enabled(!1),a.metadata.changed=Date.now(),"undefined"==typeof a.metadata.key&&(console.warn("Unable to find ket in metadata object...",a.metadata),a.metadata.key=e),global.localStorage.setItem("metadata-"+e,a.exportMetadata()),global.localStorage.setItem("template-"+e,a.exportJSON()),i.enabled(!0)};var l={name:"Test",enabled:ko.observable(!0)},n={name:"Download",enabled:ko.observable(!0)};l.execute=function(){l.enabled(!1);var i=global.localStorage.getItem("testemail");if((null===i||"null"==i)&&(i=a.t("Insert here the recipient email address")),i=global.prompt(a.t("Test email address"),i),i.match(/@/)){global.localStorage.setItem("testemail",i),console.log("TODO testing...",i);var n=t?t:"/dl/",r=$.post(n,{action:"email",rcpt:i,subject:"[test] "+e+" - "+o,html:a.exportHTML()},null,"html");r.fail(function(){console.log("fail",arguments),a.notifier.error(a.t("Unexpected error talking to server: contact us!"))}),r.success(function(){console.log("success",arguments),a.notifier.success(a.t("Test email sent..."))}),r.always(function(){l.enabled(!0)})}else global.alert(a.t("Invalid email address")),l.enabled(!0)},n.execute=function(){n.enabled(!1),a.notifier.info(a.t("Downloading...")),a.exportHTMLtoTextarea("#downloadHtmlTextarea");var e=t?t:"/dl/";global.document.getElementById("downloadForm").setAttribute("action",e),global.document.getElementById("downloadForm").submit(),n.enabled(!0)},a.save=i,a.test=l,a.download=n}.bind(void 0,e.key,e.name);return o};module.exports=lsLoader;
1482
+
1483
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1484
+
1485
+ },{"./../../../bower_components/console-browserify/index.js":1}],62:[function(require,module,exports){
1486
+ "use strict";require("./../../bower_components/knockout-sortable/build/knockout-sortable.min.js"),require("./bindings/jqueryui-spinner.js"),require("./bindings/jqueryui-tabs.js"),require("./bindings/colorpicker.js"),require("./bindings/blocks.js"),require("./bindings/csstext.js"),require("./bindings/bind-iframe.js"),require("./bindings/droppable.js"),require("./bindings/fileupload.js"),require("./bindings/virtuals.js"),require("./bindings/wysiwygs.js"),require("./bindings/scrollfix.js"),require("./bindings/if-subs.js"),require("./bindings/extsortables.js"),require("./bindings/eventable.js"),require("./bindings/tooltips.js"),require("./bindings/extender-pagination.js"),require("./bindings/validated-value.js"),require("./bindings/scrollintoview.js");
1487
+
1488
+ },{"./../../bower_components/knockout-sortable/build/knockout-sortable.min.js":8,"./bindings/bind-iframe.js":28,"./bindings/blocks.js":29,"./bindings/colorpicker.js":31,"./bindings/csstext.js":32,"./bindings/droppable.js":33,"./bindings/eventable.js":34,"./bindings/extender-pagination.js":35,"./bindings/extsortables.js":36,"./bindings/fileupload.js":37,"./bindings/if-subs.js":38,"./bindings/jqueryui-spinner.js":39,"./bindings/jqueryui-tabs.js":40,"./bindings/scrollfix.js":42,"./bindings/scrollintoview.js":43,"./bindings/tooltips.js":45,"./bindings/validated-value.js":46,"./bindings/virtuals.js":47,"./bindings/wysiwygs.js":48}],63:[function(require,module,exports){
1489
+ (function (global){
1490
+ "use strict";function _viewModelPluginInstance(e){var t;return{viewModel:function(o){t=e(o)},init:function(){"undefined"!=typeof t&&"undefined"!=typeof t.init&&t.init()},dispose:function(){"undefined"!=typeof t&&"undefined"!=typeof t.dispose&&t.dispose()}}}var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),kojqui=(typeof window !== "undefined" ? window['kojqui'] : typeof global !== "undefined" ? global['kojqui'] : null),templateConverter=require("./converter/main.js"),console=require("./../../bower_components/console-browserify/index.js"),initializeViewmodel=require("./viewmodel.js"),templateSystem=require("./bindings/choose-template.js"),pluginsCall=function(e,t,o,a){var i,l,d,r,n;n=[],"undefined"!=typeof a&&a?(i=e.length-1,l=0,d=-1):(i=0,l=e.length-1,d=1);for(var s=i;s!=l+d;s+=d)"undefined"!=typeof e[s][t]&&(r=e[s][t].apply(e[s],o),"undefined"!=typeof r&&n.push(r));return n},origDisposeCallback=ko.utils.domNodeDisposal.addDisposeCallback;ko.utils.domNodeDisposal.addDisposeCallback=function(e,t){var o=function(e){try{t(e)}catch(o){console.warn("Caught unexpected dispose callback exception",o)}};origDisposeCallback(e,o)};var bindingPluginMaker=function(e){return{viewModel:function(t){try{e("applyBindings",ko.applyBindings.bind(void 0,t))}catch(o){throw console.warn(o,o.stack),o}},dispose:function(){try{e("unapplyBindings",ko.cleanNode.bind(this,global.document.body))}catch(t){throw console.warn(t,t.stack),t}}}},templateCreator=function(e,t,o,a){var i=o;for("undefined"!=typeof o&&"undefined"!=typeof a&&("object"!=typeof t||"replacedhtml"!=t.tagName.toLowerCase())&&(i+="-"+a);"undefined"==typeof i||null===i||e.exists(i);)i="anonymous-"+Math.floor(1e5*Math.random()+1);if("object"==typeof t&&"replacedhtml"==t.tagName.toLowerCase()){var l=$(t),d=$("replacedhead",l),r=$("replacedbody",l);e.adder(i+"-head",d.html()||""),e.adder(i+"-show",r.html()||""),e.adder(i+"-preview",l.html()),e.adder(i+"-wysiwyg",l.html()),d.children().detach(),d.html("<!-- ko block: content --><!-- /ko -->"),d.before("<!-- ko withProperties: { templateMode: 'head' } -->"),d.after("<!-- /ko -->"),r.html("<!-- ko block: content --><!-- /ko -->"),e.adder(i+"-iframe",l[0].outerHTML)}else"object"==typeof t?e.adder(i,t.outerHTML):e.adder(i,t);return i},_templateUrlConverter=function(e,t){return t.match(/^[^\/]*:/)||t.match(/^\//)||t.match(/^\[/)||t.match(/^#?$/)?null:e+t},templateLoader=function(e,t,o,a,i,l){var d="string"==typeof t?t:o.template,r="./",n=d.lastIndexOf("/");-1!=n&&(r=d.substr(0,n+1));var s,c=_templateUrlConverter.bind(void 0,r);s="undefined"==typeof o?{template:d,name:"No name",created:Date.now()}:o,$.get(d,function(t){var o=templateCompiler(e,c,"template",t,a,s,i,l);o.init()})},templateCompiler=function(e,t,o,a,i,l,d,r){var n=a.match(/^([\S\s]*)([<]html[^>]*>[\S\s]*<\/html>)([\S\s]*)$/i);if(null===n)throw"Unable to find <html> opening and closing tags in the template";var s=n[1],c={"<html":0,"<head":0,"<body":0,"</html":0,"</body":0,"</head":0},p=n[2].replace(/(<\/?)(html|head|body)([^>]*>)/gi,function(e,t,o,a){return c[(t+o).toLowerCase()]+=1,t+"replaced"+o+a});for(var m in c)if(c.hasOwnProperty(m)&&1!=c[m]){if(0===c[m])throw"ERROR: missing mandatory element "+m+">";if(c[m]>1)throw"ERROR: multiple element "+m+"> occourences are not supported (found "+c[m]+" occourences)"}var b=n[3],u=[],f="+$root.contentListeners()",h=[];if("undefined"!=typeof d)for(var g=0;g<d.length;g++)"function"==typeof d[g]?h.push(_viewModelPluginInstance(d[g])):h.push(d[g]);var v=[],y={adder:function(e,t){if("string"!=typeof t)throw"Template system: cannot create new template "+e;var o=t.match(/(data)?-ko-[^ =:]*/g);o&&console.error("ERROR: found unexpected -ko- attribute in compiled template",e,", you probably mispelled it:",o),templateSystem.addTemplate(e,t),v.push(e)},exists:function(e){var t=templateSystem.getTemplateContent(e);return"undefined"!=typeof t?!0:!1},dispose:function(){for(var e=v.length-1;e>=0;e--)templateSystem.removeTemplate(v[e])}};ko.bindingHandlers.block.templateExists=y.exists;for(var k=templateCreator.bind(void 0,y),w=e("translateTemplate",templateConverter.translateTemplate.bind(void 0,o,p,t,k)),x=e("generateModel",templateConverter.wrappedResultModel.bind(void 0,w)),S={},C=pluginsCall(h,"widget",[$,ko,kojqui]),B=0;B<C.length;B++)S[C[B].widget]=C[B];u.push.apply(u,e("generateEditors",templateConverter.generateEditors.bind(void 0,w,S,t,k,f)));var _=!1;if("undefined"!=typeof i&&null!==i){var T;T="string"==typeof i?ko.utils.parseJson(i):i;var M=e("checkModel",templateConverter.checkModel.bind(void 0,x._unwrap(),u,T));2==M&&(console.error("Trying to compile an incompatible template version!",x._unwrap(),u,T),_=!0);try{x._wrap(T)}catch(D){console.error("Unable to inject model content!",D),_=!0}}var L=s+templateSystem.getTemplateContent(o+"-iframe").replace(/(<\/?)replaced(html|head|body)([^>]*>)/gi,function(e,t,o,a){return t+o+a})+b,F=ko.bindingHandlers.bindIframe.tpl;ko.bindingHandlers.bindIframe.tpl=L;var P={dispose:function(){ko.bindingHandlers.bindIframe.tpl=F}};h.push(P),h.push(y);var E=e("initializeViewmodel",initializeViewmodel.bind(this,x,u,t,r));E.metadata=l;var I="0.16.0";return"undefined"!=typeof E.metadata.editorversion&&E.metadata.editorversion!==I&&console.warn("The model being loaded has been created with an older editor version",E.metadata.editorversion,"vs",I),E.metadata.editorversion=I,"undefined"!=typeof w.version&&("undefined"!=typeof E.metadata.templateversion&&E.metadata.templateversion!==w.version&&console.error("The model being loaded has been created with a different template version",w.version,"vs",E.metadata.templateversion),E.metadata.templateversion=w.version),templateSystem.init(),h.push(bindingPluginMaker(e)),pluginsCall(h,"viewModel",[E]),_&&$("#incompatible-template").dialog({modal:!0,appendTo:"#mo-body",buttons:{Ok:function(){$(this).dialog("close")}}}),{model:E,init:function(){pluginsCall(h,"init",void 0,!0)},dispose:function(){pluginsCall(h,"dispose",void 0,!0)}}},checkFeature=function(e,t){if(!t())throw console.warn("Missing feature",e),"Missing feature "+e},isCompatible=function(){try{return checkFeature("matchMedia",function(){return"undefined"!=typeof global.matchMedia}),checkFeature("XMLHttpRequest 2",function(){return"XMLHttpRequest"in global&&"withCredentials"in new global.XMLHttpRequest}),checkFeature("ES5 strict",function(){return function(){return"undefined"==typeof this}()}),checkFeature("CSS borderRadius",function(){return"undefined"!=typeof global.document.body.style.borderRadius}),checkFeature("CSS boxShadow",function(){return"undefined"!=typeof global.document.body.style.boxShadow}),checkFeature("CSS boxSizing",function(){return"undefined"!=typeof global.document.body.style.boxSizing}),checkFeature("CSS backgroundSize",function(){return"undefined"!=typeof global.document.body.style.backgroundSize}),checkFeature("CSS backgroundOrigin",function(){return"undefined"!=typeof global.document.body.style.backgroundOrigin}),checkBadBrowserExtensions(),!0}catch(e){return!1}},checkBadBrowserExtensions=function(){var e="checkbadbrowsersframe",t=ko.bindingHandlers.bindIframe.tpl;ko.bindingHandlers.bindIframe.tpl='<!DOCTYPE html>\r\n<html>\r\n<head><title>A</title>\r\n</head>\r\n<body><p style="color: blue" align="right" data-bind="style: { color: \'red\' }">B</p><div data-bind="text: content"></div></body>\r\n</html>\r\n',$("body").append('<iframe id="'+e+'" data-bind="bindIframe: $data"></iframe>');var o=global.document.getElementById(e);ko.applyBindings({content:"dummy content"},o);var a=o.contentWindow.document.doctype,i="<!DOCTYPE "+a.name+(a.publicId?' PUBLIC "'+a.publicId+'"':"")+(!a.publicId&&a.systemId?" SYSTEM":"")+(a.systemId?' "'+a.systemId+'"':"")+">",l=i+"\n"+o.contentWindow.document.documentElement.outerHTML;ko.cleanNode(o),ko.removeNode(o),ko.bindingHandlers.bindIframe.tpl=t;var d='<!DOCTYPE html>\n<html><head><title>A</title>\n</head>\n<body><p align="right" style="color: red;" data-bind="style: { color: \'red\' }">B</p><div data-bind="text: content">dummy content</div>\n\n</body></html>',r='<!DOCTYPE html>\n<html><head><title>A</title>\n</head>\n<body><p style="color: red;" data-bind="style: { color: \'red\' }" align="right">B</p><div data-bind="text: content">dummy content</div>\n\n</body></html>',n='<!DOCTYPE html>\n<html><head><title>A</title>\n</head>\n<body><p style="color: red;" align="right" data-bind="style: { color: \'red\' }">B</p><div data-bind="text: content">dummy content</div>\n\n</body></html>';if(d!==l&&r!==l&&n!==l)throw console.info("BadBrowser.FrameContentCheck",l.length,d.length,r.length,n.length,l==d,l==r,l==n),console.info(l),"Unexpected frame content. Misbehaving browser: "+l.length+"/"+d.length+"/"+r.length+"/"+n.length},fixPageEvents=function(){global.addEventListener&&(global.addEventListener("drag",function(e){e=e||global.event,e.preventDefault()},!1),global.addEventListener("dragstart",function(e){e=e||global.event,e.preventDefault()},!1),global.addEventListener("dragover",function(e){e=e||global.event,e.preventDefault()},!1),global.addEventListener("drop",function(e){e=e||global.event,e.preventDefault()},!1),global.document.body.addEventListener("drop",function(e){e.preventDefault()},!1)),global.document.ondragstart&&(global.document.ondragstart=function(){return!1})};module.exports={compile:templateCompiler,load:templateLoader,isCompatible:isCompatible,fixPageEvents:fixPageEvents};
1491
+
1492
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1493
+
1494
+ },{"./../../bower_components/console-browserify/index.js":1,"./bindings/choose-template.js":30,"./converter/main.js":53,"./viewmodel.js":67}],64:[function(require,module,exports){
1495
+ "use strict";var console=require("./../../bower_components/console-browserify/index.js"),_call=function(e){return e()},logs=[],_timedCall=function(e,t){var o,a=(new Date).getTime();"object"==typeof console&&console.time&&console.time(e),o=_call(t),"object"==typeof console&&console.time&&console.timeEnd(e);var i=(new Date).getTime()-a;return"object"!=typeof console||console.time||console.log(e,"took",i,"ms"),logs.push({name:e,time:i}),logs.length>100&&logs.unshift(),o};module.exports={timedCall:_timedCall,logs:logs};
1496
+
1497
+ },{"./../../bower_components/console-browserify/index.js":1}],65:[function(require,module,exports){
1498
+ (function (global){
1499
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),undoManager=require("./../../../bower_components/knockout-undomanager/knockout-undomanager.js"),undoserializer=require("./undoserializer.js"),addUndoStackExtensionMaker=function(e){return function(t){t.contentListeners(t.contentListeners()+2);var o=undoManager(t.content,{levels:100,undoLabel:ko.computed(function(){return t.t("Undo (#COUNT#)")}),redoLabel:ko.computed(function(){return t.t("Redo")})});return t.undo=o.undoCommand,t.undo.execute=e.bind(t,"undo",t.undo.execute),t.redo=o.redoCommand,t.redo.execute=e.bind(t,"redo",t.redo.execute),t.undoReset=e.bind(t,"undoReset",o.reset),t.setUndoModeMerge=o.setModeMerge,t.setUndoModeOnce=o.setModeOnce,o.setModeIgnore(),o.setUndoActionMaker(undoserializer.makeUndoAction.bind(void 0,t.content)),undoserializer.watchEnabled(!0),{pause:function(){o.setModeIgnore()},run:function(){o.setModeOnce()},init:function(){o.setModeOnce()},dispose:function(){t.contentListeners(t.contentListeners()-2),undoserializer.watchEnabled(!1),o.dispose()}}}};module.exports=addUndoStackExtensionMaker;
1500
+
1501
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1502
+
1503
+ },{"./../../../bower_components/knockout-undomanager/knockout-undomanager.js":9,"./undoserializer.js":66}],66:[function(require,module,exports){
1504
+ (function (global){
1505
+ "use strict";var ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),console=require("./../../../bower_components/console-browserify/index.js"),_reference=function(e,t){for(var o,n,i=0,a=e;i<t.length;)switch(t.charAt(i)){case"(":")"==t.charAt(i+1)&&(a=a()),i+=2;break;case"[":n=t.indexOf("]",i),a=a[t.substring(i+1,n)],i=n+1;break;case".":o=t.indexOf("(",i),-1==o&&(o=t.length),n=t.indexOf("[",i),-1==n&&(n=t.length),n=Math.min(o,n),a=a[t.substring(i+1,n)],i=n}return a},_getPath=function(e,t){for(var o,n="",i=0;i<=e.length;i++)if(o=i<e.length?e[i]:t,ko.isObservable(o)&&(n+="()"),"undefined"!=typeof o._fieldName)n+="."+o._fieldName;else{if(!(i>0&&"function"==typeof e[i-1].pop))throw console.error("Unexpected parent with no _fieldName and no parent array",i,e),"Unexpected parent with no _fieldName and no parent array";var a=ko.isObservable(e[i-1])?ko.utils.peekObservable(e[i-1]):e[i-1],r=ko.utils.arrayIndexOf(a,o);if(-1==r)throw console.error("Unexpected object not found in parent array",a,o,i,e.length,ko.toJS(a),ko.utils.unwrapObservable(o)),"Unexpected object not found in parent array";n+="["+r+"]"}return n},makeDereferencedUndoAction=function(e,t,o,n,i){var a=_reference(t,o);e(a,n,i)},listener,_setListener=function(e){listener=e},makeUndoActionDereferenced=function(e,t,o,n,i,a){try{var r=_getPath(o,n);if(("object"==typeof i||"function"==typeof i)&&(i=ko.toJS(i)),"undefined"!=typeof a&&("object"==typeof a.value||"function"==typeof a.value)){var l=ko.toJS(a);a=l}if("undefined"!=typeof listener)try{listener(r,n,i,a)}catch(s){console.log("Undoserializer ignoring exception in listener callback")}return makeDereferencedUndoAction.bind(void 0,t,e,r,i,a)}catch(s){console.error("Exception processing undo",s,o,n,a)}},watchEnabled,_watchEnabled=function(e){return"undefined"==typeof e?watchEnabled:(watchEnabled=e,void 0)};module.exports={dereference:_getPath,reference:_reference,makeUndoAction:makeUndoActionDereferenced,setListener:_setListener,watchEnabled:_watchEnabled};
1506
+
1507
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1508
+
1509
+ },{"./../../../bower_components/console-browserify/index.js":1}],67:[function(require,module,exports){
1510
+ (function (global){
1511
+ "use strict";function initializeEditor(e,t,o,a){function i(e){return e.replace(/<replacedcc[^>]* condition="([^"]*)"[^>]*>([\s\S]*?)<\/replacedcc>/g,function(e,t,o){var a="<!--[if "+t.replace(/&amp;/,"&")+"]>";return a+=o.replace(/<!-- cc:bc:([A-Za-z:]*) -->(<\/cc>)?<!-- cc:ac:\1 -->/g,"</$1>").replace(/><\/cc><!-- cc:sc -->/g,"/>").replace(/<!-- cc:bo:([A-Za-z:]*) --><cc/g,"<$1").replace(/^.*<!-- cc:start -->/,"").replace(/<!-- cc:end -->.*$/,""),a+="<![endif]-->"})}var l={galleryRecent:ko.observableArray([]).extend({paging:16}),galleryRemote:ko.observableArray([]).extend({paging:16}),selectedBlock:ko.observable(null),selectedItem:ko.observable(null),selectedTool:ko.observable(0),selectedImageTab:ko.observable(0),dragging:ko.observable(!1),draggingImage:ko.observable(!1),galleryLoaded:ko.observable(!1),showPreviewFrame:ko.observable(!1),previewMode:ko.observable("mobile"),showToolbox:ko.observable(!0),showTheme:ko.observable(!1),showGallery:ko.observable(!1),debug:ko.observable(!1),contentListeners:ko.observable(0),logoPath:"dist/img/mosaico32.png",logoUrl:".",logoAlt:"mosaico"};return l.content=e,l.blockDefs=t,l.notifier=toastr,l.tt=function(e,t){if("undefined"!=typeof t)for(var o in t)t.hasOwnProperty(o)&&(e=e.replace(new RegExp("__"+o+"__","g"),t[o]));return e},l.t=l.tt,l.ut=function(e,t){return t},l.templatePath=o,l.remoteUrlProcessor=function(e){return e},l.remoteFileProcessor=function(e){return"undefined"!=typeof e.url&&(e.url=l.remoteUrlProcessor(e.url)),"undefined"!=typeof e.thumbnailUrl&&(e.thumbnailUrl=l.remoteUrlProcessor(e.thumbnailUrl)),e},l.loadGallery=function(){l.galleryLoaded("loading");var e=a?a:"/upload/";$.getJSON(e,function(e){for(var t=0;t<e.files.length;t++)e.files[t]=l.remoteFileProcessor(e.files[t]);l.galleryLoaded(e.files.length),l.galleryRemote(e.files.reverse())}).fail(function(){l.galleryLoaded(!1),l.notifier.error(l.t("Unexpected error listing files"))})},l.fileToImage=function(e){return e.url},l.removeBlock=function(e,t){ko.utils.unwrapObservable(l.selectedBlock)==ko.utils.unwrapObservable(e)&&l.selectBlock(null,!0);var o=t.blocks.remove(e);return l.notifier.info(l.t("Block removed: use undo button to restore it...")),o},l.duplicateBlock=function(e,t){var o=ko.utils.unwrapObservable(e),a=ko.toJS(ko.utils.unwrapObservable(t.blocks)[o]);"undefined"!=typeof a.id&&(a.id=""),t.blocks.splice(o+1,0,a)},l.moveBlock=function(e,t,o){var a=ko.utils.unwrapObservable(e),i=ko.utils.unwrapObservable(t.blocks);if(o&&a>0||!o&&a<i.length-1){var n=a+(o?-1:1),r=i[n];l.startMultiple(),t.blocks.splice(n,1),t.blocks.splice(a,0,r),l.stopMultiple()}},l.loadDefaultBlocks=function(){var e=ko.toJS(l.content().mainBlocks);e.blocks=[];for(var t=ko.utils.unwrapObservable(l.blockDefs),o=0;o<t.length;o++){var a=ko.toJS(t[o]);a.id="block_"+o,e.blocks.push(a)}performanceAwareCaller("setMainBlocks",l.content().mainBlocks._wrap.bind(l.content().mainBlocks,e))},l.addImage=function(e){var t=$("#main-wysiwyg-area .selectable-img.selecteditem");return 1==t.length&&"object"==typeof e&&"undefined"!=typeof e.url?(ko.contextFor(t[0])._src(e.url),!0):!1},l.addBlock=function(e){var t,o=l.selectedBlock();if(null!==o)for(var a=l.content().mainBlocks().blocks().length-1;a>=0;a--)if(l.content().mainBlocks().blocks()[a]()==o){t=a;break}var i;"undefined"!=typeof t?(i=t+1,l.content().mainBlocks().blocks.splice(i,0,e),l.notifier.info(l.t("New block added after the selected one (__pos__)",{pos:i}))):(l.content().mainBlocks().blocks.push(e),i=l.content().mainBlocks().blocks().length-1,l.notifier.info(l.t("New block added at the model bottom (__pos__)",{pos:i})));var n=l.content().mainBlocks().blocks()[i]();return l.selectBlock(n,!0),!1},l.findObjectsOfType=function(e,t){var o=[],a=ko.utils.unwrapObservable(e);for(var i in a)if(a.hasOwnProperty(i)){var l=ko.utils.unwrapObservable(a[i]);if(i.match(/Blocks$/))for(var n=ko.utils.unwrapObservable(l.blocks),r=0;r<n.length;r++){var d=ko.utils.unwrapObservable(n[r]);(null===t||ko.utils.unwrapObservable(d.type)==t)&&o.push(d)}else"object"==typeof l&&null!==l&&(null===t||ko.utils.unwrapObservable(l.type)==t)&&o.push(l)}return o},l.placeholderHelper={element:function(e){return $(e[0].outerHTML).removeClass("ui-draggable").addClass("sortable-placeholder").css("display","block").css("position","relative").css("width","100%").css("height","auto").css("opacity",".8")[0]},update:function(){}},l.startMultiple=function(){"undefined"!=typeof l.setUndoModeMerge&&l.setUndoModeMerge()},l.stopMultiple=function(){"undefined"!=typeof l.setUndoModeOnce&&l.setUndoModeOnce()},l.localGlobalSwitch=function(e,t){var o=e();return null===o?e(t()):e(null),!1},l.selectItem=function(e,t,o){var a=ko.utils.peekObservable(e);return"undefined"!=typeof o&&l.selectBlock(o,!1,!0),a!=t&&(e(t),null!==t&&0===l.selectedTool()&&l.selectedTool(1)),!1}.bind(l,l.selectedItem),l.isSelectedItem=function(e){return l.selectedItem()==e},l.selectBlock=function(e,t,o,a){var i=ko.utils.peekObservable(e);a||l.selectItem(null),i!=t&&(e(t),l.showGallery(!1),null===t||o||0!==l.selectedTool()||l.selectedTool(1))}.bind(l,l.selectedBlock),l.countSubscriptions=function(e,t){var o=0;for(var a in e)if(e.hasOwnProperty(a)){var i=e[a];if(ko.isObservable(i)&&("undefined"!=typeof i._defaultComputed&&("undefined"!=typeof t&&console.log(t+"/"+a+"/_",i._defaultComputed.getSubscriptionsCount()),o+=i._defaultComputed.getSubscriptionsCount()),"undefined"!=typeof t&&console.log(t+"/"+a+"/-",i.getSubscriptionsCount()),o+=i.getSubscriptionsCount(),i=ko.utils.unwrapObservable(i)),"object"==typeof i&&null!==i){var n=l.countSubscriptions(i,"undefined"!=typeof t?t+"/"+a+"@":void 0);"undefined"!=typeof t&&console.log(t+"/"+a+"@",n),o+=n}}return o},l.loopSubscriptionsCount=function(){var e=l.countSubscriptions(l.content());global.document.getElementById("subscriptionsCount").innerHTML=e,global.setTimeout(l.loopSubscriptionsCount,1e3)},l.export=function(){var e=performanceAwareCaller("exportHTML",l.exportHTML);return e},l.exportHTML=function(){var e="exportframe";$("body").append('<iframe id="'+e+'" data-bind="bindIframe: $data"></iframe>');var t=global.document.getElementById(e);ko.applyBindings(l,t),ko.cleanNode(t),l.inline&&l.inline(t.contentWindow.document);var o=t.contentWindow.document.doctype,a="<!DOCTYPE "+o.name+(o.publicId?' PUBLIC "'+o.publicId+'"':"")+(!o.publicId&&o.systemId?" SYSTEM":"")+(o.systemId?' "'+o.systemId+'"':"")+">",n=a+"\n"+t.contentWindow.document.documentElement.outerHTML;ko.removeNode(t),n=n.replace(/<script ([^>]* )?type="text\/html"[^>]*>[\s\S]*?<\/script>/gm,""),n=n.replace(/<!-- ko ((?!--).)*? -->/g,""),n=n.replace(/<!-- \/ko -->/g,""),n=n.replace(/ data-bind="[^"]*"/gm,""),n=n.replace(/ data-mce-(href|src|style)="[^"]*"/gm,""),n=n.replace(/ style="[^"]*"([^>]*) replaced(style="[^"]*")/gm,"$1 $2"),n=n.replace(/ replaced(style="[^"]*")([^>]*) style="[^"]*"/gm," $1$2"),n=n.replace(/ replaced(style="[^"]*")/gm," $1"),n=n.replace(/ http-equiv="[^"]*"([^>]*) replaced(http-equiv="[^"]*")/gm,"$1 $2"),n=n.replace(/ replaced(http-equiv="[^"]*")([^>]*) http-equiv="[^"]*"/gm," $1$2"),n=n.replace(/ replaced(http-equiv="[^"]*")/gm," $1"),n=i(n);var r=n.match(/ data-[^ =]+(="[^"]+")? /)||n.match(/ replaced([^= ]*=)/);return r&&console.warn("Output HTML contains unexpected data- attributes or replaced attributes",r),n},l.exportHTMLtoTextarea=function(e){$(e).val(l.exportHTML())},l.exportJSONtoTextarea=function(e){$(e).val(l.exportJSON())},l.importJSONfromTextarea=function(e){l.importJSON($(e).val())},l.exportMetadata=function(){var e=ko.toJSON(l.metadata);return e},l.exportJSON=function(){var e=ko.toJSON(l.content);return e},l.exportJS=function(){return ko.toJS(l.content)},l.importJSON=function(e){var t=ko.utils.parseJson(e);l.content._wrap(t)},l.exportTheme=function(){var e={},t=l.content().theme(),o=function(e,t,a){for(var i in a)if(a.hasOwnProperty(i)){var l=ko.utils.unwrapObservable(a[i]);null!==l&&"object"==typeof l?o(i+".",t,l):t[e+i]=l}};o("",e,t);var a="";for(var i in e)e.hasOwnProperty(i)&&"type"!=i&&(a+=i+": "+e[i]+";"+"\n");return a},l.loadImage=function(e){l.galleryRecent.unshift(e),l.selectedImageTab(0)},l.dialog=function(e,t){$(e).dialog(t)},l.log=function(){},l.selectedImageTab.subscribe(function(e){1==e&&l.galleryLoaded()===!1&&l.loadGallery()},l,"change"),l}var $=(typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null),ko=(typeof window !== "undefined" ? window['ko'] : typeof global !== "undefined" ? global['ko'] : null),console=require("./../../bower_components/console-browserify/index.js"),performanceAwareCaller=require("./timed-call.js").timedCall,toastr=require("./../../bower_components/toastr/toastr.js");toastr.options={closeButton:!1,debug:!1,positionClass:"toast-bottom-full-width",target:"#mo-body",onclick:null,showDuration:"300",hideDuration:"1000",timeOut:"5000",extendedTimeOut:"1000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"},module.exports=initializeEditor;
1512
+
1513
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1514
+
1515
+ },{"./../../bower_components/console-browserify/index.js":1,"./../../bower_components/toastr/toastr.js":19,"./timed-call.js":64}]},{},[27,20])(27)
1516
+ });
1517
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJib3dlcl9jb21wb25lbnRzL2NvbnNvbGUtYnJvd3NlcmlmeS9pbmRleC5qcyIsImJvd2VyX2NvbXBvbmVudHMvZXZvbC1jb2xvcn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bGVtZW50cyddLmluZGV4T2YoZWxOYW1lKSA+IC0xKSB7XG4gICAgICBmb3IgKHZhciBpIGluIGVsLnN0eWxlUHJvcHMpIHtcbiAgICAgICAgaWYgKGVsLnN0eWxlUHJvcHNbaV0ucHJvcCA9PT0gZGltZW5zaW9uKSB7XG4gICAgICAgICAgaWYgKGVsLnN0eWxlUHJvcHNbaV0udmFsdWUubWF0Y2goL3B4LykpIHtcbiAgICAgICAgICAgIHZhciBweFNpemUgPSBlbC5zdHlsZVByb3BzW2ldLnZhbHVlLnJlcGxhY2UoJ3B4JywgJycpO1xuICAgICAgICAgICAgJChlbCkuYXR0cihkaW1lbnNpb24sIHB4U2l6ZSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChqdWljZUNsaWVudC50YWJsZUVsZW1lbnRzLmluZGV4T2YoZWxOYW1lKSA+IC0xICYmIGVsLnN0eWxlUHJvcHNbaV0udmFsdWUubWF0Y2goL1xcJS8pKSB7XG4gICAgICAgICAgICAkKGVsKS5hdHRyKGRpbWVuc2lvbiwgZWwuc3R5bGVQcm9wc1tpXS52YWx1ZSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgZnVuY3Rpb24gc2V0QXR0cmlidXRlc09uVGFibGVFbGVtZW50cyhlbCkge1xuICAgIGlmICghZWwubmFtZSkgeyByZXR1cm47IH1cbiAgICB2YXIgZWxOYW1lID0gZWwubmFtZS50b1VwcGVyQ2FzZSgpO1xuICAgIHZhciBzdHlsZVByb3BzID0gT2JqZWN0LmtleXMoanVpY2VDbGllbnQuc3R5bGVUb0F0dHJpYnV0ZSk7XG5cbiAgICBpZiAoanVpY2VDbGllbnQudGFibGVFbGVtZW50cy5pbmRleE9mKGVsTmFtZSkgPiAtMSkge1xuICAgICAgZm9yICh2YXIgaSBpbiBlbC5zdHlsZVByb3BzKSB7XG4gICAgICAg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aWxkLndhdGNoYWJsZSA9PT0gZmFsc2UpXHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcblxyXG4gICAgICAgICAgICAvLyBQcmV2ZW50IHN1YnNlcXVlbnQgd2F0Y2hlcnMgZnJvbSB3YXRjaGluZyB0aGUgdGFyZ2V0IHdoZW4gc2VhbGVkLlxyXG4gICAgICAgICAgICBpZiAob3B0aW9ucy5zZWFsID09PSB0cnVlKVxyXG4gICAgICAgICAgICAgICAgY2hpbGQud2F0Y2hhYmxlID0gZmFsc2U7XHJcblxyXG4gICAgICAgICAgICB2YXIgdHlwZSA9IHR5cGVvZiBjaGlsZDtcclxuXHJcbiAgICAgICAgICAgIGlmICh0eXBlID09PSAnb2JqZWN0JyB8fCB0eXBlID09PSAnZnVuY3Rpb24nKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBCeXBhc3MgY2lyY3VsYXIgcmVmZXJlbmNlcy5cclxuICAgICAgICAgICAgICAgIGlmIChjaGlsZC5fd2F0Y2hlciA9PT0gY29udGV4dClcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcblxyXG4gICAgICAgICAgICAgICAgLy8gSWdub3JlIGhpZGRlbiBvYmplY3RzLiBBbHNvIGFwcGxpZXMgdG8gYW55IG9mIHRoZWlyIGNoaWxkcmVuLlxyXG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuaGlkZSlcclxuICAgICAgICAgICAgICAgICAgICBpZiAoa28udXRpbHMuYXJyYXlJbmRleE9mKG9wdGlvbnMuaGlkZSwgY2hpbGQpID4gLTEpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBNZXJnZSBwYXJlbnRzLiBVc2luZyBhIGZyZXNoIGFycmF5IHNvIGl0IGlzIG5vdCByZWZlcmVuY2VkIGluIHRoZSBuZXh0IHJlY3Vyc2lvbiBpZiBhbnkuXHJcbiAgICAgICAgICAgICAgICB2YXIgcGFyZW50cyA9IFtdLmNvbmNhdChncmFuZFBhcmVudHMsIHBhcmVudCAmJiBwYXJlbnQgIT09IHRhcmdldCA/IHBhcmVudCA6IFtdKTtcclxuXHJcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gJ2Z1bmN0aW9uJykge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgY2hpbGRbJ25vdGlmeVN1YnNjcmliZXJzJ10gPT0gJ2Z1bmN0aW9uJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUYXJnZXQgaXMgYSBzdWJzY3JpYmFibGUuIFdhdGNoIGl0LlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXZhbHVhdG9yQ2FsbGJhY2spIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmVuYWJsZWQgPT09IHRydWUgJiYgY2hpbGQud2F0Y2hhYmxlID09PSBmYWxzZSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IHdha2luZyB1cCBhbiBleGlzdGluZyB3YXRjaGVyLiBMZXQncyBub3QgYWRkIGFub3RoZXIuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1bndhdGNoIHx8ICFvcHRpb25zLmJlZm9yZVdhdGNoIHx8IG9wdGlvbnMuYmVmb3JlV2F0Y2guY2FsbChjb250ZXh0LCBwYXJlbnRzLCBjaGlsZCwgZmllbGROYW1lKSAhPT0gZmFsc2UpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNBcnJheSA9IHR5cGVvZiBjaGlsZC5wb3AgPT09ICdmdW5jdGlvbic7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1bndhdGNoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3Bvc2VXYXRjaGVyKGNoaWxkKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhc3NpZ25XYXRjaGVyKGNoaWxkLCBpc0FycmF5LCBwYXJlbnRzLCBrZWVwT2ZmUGFyZW50TGlzdCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNBcnJheSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YXRjaENoaWxkcmVuKGNoaWxkKCksIGtlZXBPZmZQYXJlbnRMaXN0ID8gbnVsbCA6IGNoaWxkLCBwYXJlbnRzLCB1bndhdGNoLCB0cnVlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuaGlkZVdyYXBwZWRWYWx1ZXMgIT09IHRydWUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gd2F0Y2hDaGlsZHJlbihjaGlsZCgpLCBrZWVwT2ZmUGFyZW50TGlzdCA/IG51bGwgOiBjaGlsZCwgcGFyZW50cywgdW53YXRjaCwgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKGNoaWxkKSA9PT0gJ1tvYmplY3QgT2JqZWN0XScpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAga28udXRpbHMub2JqZWN0Rm9yRWFjaChjaGlsZCwgZnVuY3Rpb24gKHByb3BlcnR5LCBzdWIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YiA9IG9wdGlvbnMuZ2V0dGVyID8gb3B0aW9ucy5nZXR0ZXIuY2FsbChjb250ZXh0LCBwYXJlbnRzLCBjaGlsZCwgcHJvcGVydHkpIDogc3ViO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN1Yikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLndyYXApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gV3JhcCBzaW1wbGUgb2JqZWN0cyBhbmQgYXJyYXlzIGludG8gb2JzZXJ2YWJsZXMuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0eXBlID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKHN1Yik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlICE9PSAnW29iamVjdCBGdW5jdGlvbl0nICYmIHR5cGUgIT09ICdbb2JqZWN0IE9iamVjdF0nKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW9wdGlvbnMuYmVmb3JlV3JhcCB8fCBvcHRpb25zLmJlZm9yZVdyYXAuY2FsbChjb250ZXh0LCBwYXJlbnRzLCBjaGlsZCwgc3ViKSAhPT0gZmFsc2UpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWIgPSBjaGlsZFtwcm9wZXJ0eV0gPSB0eXBlID09PSAnW29iamVjdCBBcnJheV0nXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8ga28ub2JzZXJ2YWJsZUFycmF5KHN1YilcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBrby5vYnNlcnZhYmxlKHN1Yik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnVubG9vcClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViLl93YXRjaGVyID0gdW53YXRjaCA/IHVuZGVmaW5lZCA6IGNvbnRleHQ7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBoYXNDaGlsZHJlbiA9IHdhdGNoQ2hpbGRyZW4oc3ViLCBrZWVwT2ZmUGFyZW50TGlzdCA/IG51bGwgOiBjaGlsZCwgcGFyZW50cywgdW53YXRjaCwgbnVsbCwgcHJvcGVydHkpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy50YWdGaWVsZHMgJiYgc3ViLl9maWVsZE5hbWUgPT09IHVuZGVmaW5lZClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc0NoaWxkcmVuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAob3B0aW9ucy50YWdGaWVsZHMgIT09ICdwYXJlbnRzT25seScgJiYgdHlwZW9mIHN1YiA9PT0gJ2Z1bmN0aW9uJyB8fCB0eXBlb2Ygc3ViID09PSAnb2JqZWN0JykpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWIuX2ZpZWxkTmFtZSA9IHByb3BlcnR5O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyAvLyAnW29iamVjdCBBcnJheV0nXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmhpZGVBcnJheXMgIT09IHRydWUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNoaWxkLmxlbmd0aDsgaSsrKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhdGNoQ2hpbGRyZW4oY2hpbGRbaV0sIGtlZXBPZmZQYXJlbnRMaXN0ID8gbnVsbCA6IGNoaWxkLCBwYXJlbnRzLCB1bndhdGNoKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8vIFN1YnNjcmlwdGlvbnMgYXJlIHN0b3JlZCB1bmRlciBlaXRoZXIgdGhlIF9zdWJzY3JpcHRpb25zIGZpZWxkIGZvciB0aGUgZGVidWcgdmVyc2lvblxyXG4gICAgLy8gb3IgdGhlIEYsIEggb3IgTSBmaWVsZHMgd2hlbiBtaW5pZmllZCBkZXBlbmRpbmcgb24gdGhlIHZlcnNpb24gdXNlZC5cclxuICAgIC8vIE5PVEU6IHdlIHVzZWQgdG8gdXNlIGtvLkRFQlVHIHRvIGRldGVjdCB0aGUgZGVidWcgdmVyc2lvbmJ1dCBpdCB3YXMgcmVtb3ZlZCBpbiAzLjQuMCssXHJcbiAgICAvLyAgICAgICBzbyB3ZSBub3cgY2hlY2sgdGhlIGV4aXN0ZW5jZSBvZiBhIFwic3Vic2NyaXB0aW9uXCIgZnVuY3Rpb24uXHJcbiAgICB2YXIgc3Vic2NyaXB0aW9uc0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AgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2F0Y2hDaGlsZHJlbihpdGVtLnZhbHVlLCAoa2VlcE9mZlBhcmVudExpc3QgPyBudWxsIDogY2hpbGQpLCBwYXJlbnRzLCBpdGVtLnN0YXR1cyA9PT0gJ2RlbGV0ZWQnKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH0sIHVuZGVmaW5lZCwgJ2FycmF5Q2hhbmdlJykuX3dhdGNoZXIgPSBjb250ZXh0O1xyXG5cclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICBjaGlsZC5zdWJzY3JpYmUoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgaWYgKGNoaWxkLndhdGNoYWJsZSAhPT0gZmFsc2UpIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgcmV0dXJuVmFsdWUgPSBldmFsdWF0b3JDYWxsYmFjay5jYWxsKGNvbnRleHQsIHBhcmVudHMsIGNoaWxkKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJldHVyblZhbHVlICE9PSB1bmRlZmluZWQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQocmV0dXJuVmFsdWUpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5tdXRhYmxlICYmIHR5cGVvZiBjaGlsZCgpID09PSAnb2JqZWN0JylcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2F0Y2ggdGhlIG5ldyBjb21lci5cclxuICAgICAgICAgICAgICAgICAgICAgICAgd2F0Y2hDaGlsZHJlbihjaGlsZCgpLCAoa2VlcE9mZlBhcmVudExpc3QgPyBudWxsIDogY2hpbGQpLCBwYXJlbnRzKTtcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIH0sIG51bGwsICdjaGFuZ2UnKS5fd2F0Y2hlciA9IGNvbnRleHQ7XHJcblxyXG4gICAgICAgICAgICBpZiAob3B0aW9ucy5vbGRWYWx1ZXMgPiAwIHx8IG9wdGlvbnMubXV0YWJsZSkge1xyXG4gICAgICAgICAgICAgICAgY2hpbGQuc3Vic2NyaWJlKGZ1bmN0aW9uIChvbGRWYWx1ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLm9sZFZhbHVlcyA+IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWRkIG9sZCB2YWx1ZSB0byBoaXN0b3J5IGxpc3QgYmVmb3JlIGV2ZXJ5IHVwZGF0ZS5cclxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlcyA9IChjaGlsZFsnb2xkVmFsdWVzJ11cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gY2hpbGRbJ29sZFZhbHVlcyddXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNoaWxkWydvbGRWYWx1ZXMnXSA9IFtdKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcy51bnNoaWZ0KG9sZFZhbHVlKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICh2YWx1ZXMubGVuZ3RoID4gb3B0aW9ucy5vbGRWYWx1ZXMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXMucG9wKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5tdXRhYmxlICYmIHR5cGVvZiBvbGRWYWx1ZSA9PT0gJ29iamVjdCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIENsZWFuIHVwIGFsbCBzdWJzY3JpcHRpb25zIGZvciB0aGUgb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sIHByb3BlcnRpZXMgYW5kIHZhbHVlcy4gVGhleSBhcmVcbiAgICAgICAgICAvLyBkaWZmaWN1bHQgdG8gcmVwcmVzZW50IGluIHRoZSBBU1QuXG4gICAgICAgICAgdmFyIHBvcyA9IGZpbmQoJyovJyk7XG5cbiAgICAgICAgICBpZiAocG9zKSB7XG4gICAgICAgICAgICBza2lwKHBvcyArIDEpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoZ2V0U3RhdGUoKSA9PSAnYmVmb3JlLXZhbHVlJykgcmVwbGFjZVN0YXRlKCd2YWx1ZScpO1xuICAgICAgICAgIGJ1ZmZlciArPSBjaDtcbiAgICAgICAgfVxuICAgICAgICBicmVhaztcblxuICAgICAgZGVmYXVsdDpcbiAgICAgICAgaWYgKGlzTmV4dENoYXIoJyonKSkge1xuICAgICAgICAgIC8vIENyZWF0ZSBhIGNvbW1lbnQgdG9rZW5cbiAgICAgICAgICBpbml0aWFsaXplVG9rZW4oJ2NvbW1lbnQnKTtcbiAgICAgICAgICBwdXNoU3RhdGUoJ2NvbW1lbnQnKTtcbiAgICAgICAgICBza2lwKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgYnVmZmVyICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgYnJlYWs7XG5cbiAgICAvLyBDb21tZW50IGVuZCBvciB1bml2ZXJzYWwgc2VsZWN0b3JcbiAgICBjYXNlICcqJzpcbiAgICAgIHN3aXRjaCAoZ2V0U3RhdGUoKSkge1xuICAgICAgY2FzZSAnY29tbWVudCc6XG4gICAgICAgIGlmIChpc05leHRDaGFyKCcvJykpIHtcbiAgICAgICAgICAvLyBUb2tlbml6ZSBhIGNvbW1lbnRcbiAgICAgICAgICB0b2tlbi50ZXh0ID0gYnVmZmVyOyAvLyBEb24ndCB0cmltKCkhXG4gICAgICAgICAgc2tpcCgpO1xuICAgIC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emVkID0gZmFsc2U7XG4gICAgICAgIHZhciBuYW1lO1xuICAgICAgICB2YXIgcnVsZTtcblxuICAgICAgICBmb3IgKHZhciBqID0gMCwgbGVuID0gYXRSdWxlcy5sZW5ndGg7ICF0b2tlbml6ZWQgJiYgaiA8IGxlbjsgKytqKSB7XG4gICAgICAgICAgcnVsZSA9IGF0UnVsZXNbal07XG4gICAgICAgICAgbmFtZSA9IHJ1bGUubmFtZSB8fCBydWxlO1xuXG4gICAgICAgICAgaWYgKCFpc05leHRTdHJpbmcobmFtZSkpIHsgY29udGludWU7IH1cblxuICAgICAgICAgIHRva2VuaXplZCA9IHRydWU7XG5cbiAgICAgICAgICBpbml0aWFsaXplVG9rZW4obmFtZSk7XG4gICAgICAgICAgcHVzaFN0YXRlKHJ1bGUuc3RhdGUgfHwgJ2F0LWdyb3VwJyk7XG4gICAgICAgICAgc2tpcChuYW1lLmxlbmd0aCk7XG5cbiAgICAgICAgICBpZiAocnVsZS5wcmVmaXgpIHtcbiAgICAgICAgICAgIHRva2VuLnByZWZpeCA9IHJ1bGUucHJlZml4O1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChydWxlLnR5cGUpIHtcbiAgICAgICAgICAgIHRva2VuLnR5cGUgPSBydWxlLnR5cGU7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCF0b2tlbml6ZWQpIHtcbiAgICAgICAgICAvLyBLZWVwIG9uIHRydWNraW4nIEFtZXJpY2EhXG4gICAgICAgICAgYnVmZmVyICs9IGNoO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgYnJlYWs7XG5cbiAgICAvLyBQYXJlbnRoZXNlcyBhcmUgdHJhY2tlZCB0byBkaXNhbWJpZ3VhdGUgc2VtaS1jb2xvbnMsIHN1Y2ggYXMgd2l0aGluIGFcbiAgICAvLyBkYXRhIFVSSS5cbiAgICBjYXNlICcoJzpcbiAgICAgIHN3aXRjaCAoZ2V0U3R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hcGVSZSwgJ1xcXFwkMScpXG59XG5cbnZhciB1bmVzY2FwZSA9IGZ1bmN0aW9uKHN0cmluZyl7XG4gICAgcmV0dXJuIChzdHJpbmcgKyBcIlwiKS5yZXBsYWNlKHVuZXNjYXBlUmUsICcnKVxufVxuXG52YXIgc2xpY2tSZSA9IFJlZ0V4cChcbi8qXG4jIS91c3IvYmluL2VudiBydWJ5XG5wdXRzIFwiXFx0XFx0XCIgKyBEQVRBLnJlYWQuZ3N1YigvXFwoXFw/eFxcKXxcXHMrIy4qJHxcXHMrfFxcXFwkfFxcXFxuLywnJylcbl9fRU5EX19cbiAgICBcIig/eCleKD86XFxcbiAgICAgIFxcXFxzKiAoICwgKSBcXFxccyogICAgICAgICAgICAgICAjIFNlcGFyYXRvciAgICAgICAgICBcXG5cXFxuICAgIHwgXFxcXHMqICggPGNvbWJpbmF0b3I+KyApIFxcXFxzKiAgICMgQ29tYmluYXRvciAgICAgICAgIFxcblxcXG4gICAgfCAgICAgICggXFxcXHMrICkgICAgICAgICAgICAgICAgICMgQ29tYmluYXRvckNoaWxkcmVuIFxcblxcXG4gICAgfCAgICAgICggPHVuaWNvZGU+KyB8IFxcXFwqICkgICAgICMgVGFnICAgICAgICAgICAgICAgIFxcblxcXG4gICAgfCBcXFxcIyAgKCA8dW5pY29kZT4rICAgICAgICkgICAgICMgSUQgICAgICAgICAgICAgICAgIFxcblxcXG4gICAgfCBcXFxcLiAgKCA8dW5pY29kZT4rICAgICAgICkgICAgICMgQ2xhc3NOYW1lICAgICAgICAgIFxcblxcXG4gICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjIEF0dHJpYnV0ZSAgICAgICAgICBcXG5cXFxuICAgIFxcXFxbICBcXFxuICAgICAgICBcXFxccyogKDx1bmljb2RlMT4rKSAgKD86ICBcXFxuICAgICAgICAgICAgXFxcXHMqIChbKl4kIX58XT89KSAgKD86ICBcXFxuICAgICAgICAgICAgICAgIFxcXFxzKiAoPzpcXFxuICAgICAgICAgICAgICAgICAgICAoW1xcXCInXT8pKC4qPylcXFxcOSBcXFxuICAgICAgICAgICAgICAgIClcXFxuICAgICAgICAgICAgKSAgXFxcbiAgICAgICAgKT8gIFxcXFxzKiAgXFxcbiAgICBcXFxcXSg/IVxcXFxdKSBcXG5cXFxuICAgIHwgICA6KyAoIDx1bmljb2RlPisgKSg/OlxcXG4gICAgXFxcXCggKD86XFxcbiAgICAgICAgKD86KFtcXFwiJ10pKFteXFxcXDEyXSopXFxcXDEyKXwoKD86XFxcXChbXildK1xcXFwpfFteKCldKikrKVxcXG4gICAgKSBcXFxcKVxcXG4gICAgKT9cXFxuICAgIClcIlxuKi9cblwiXig/OlxcXFxzKigsKVxcXFxzKnxcXFxccyooPGNvbWJpbmF0b3I+KylcXFxccyp8KFxcXFxzKyl8KDx1bmljb2RlPit8XFxcXCopfFxcXFwjKDx1bmljb2RlPispfFxcXFwuKDx1bmljb2RlPispfFxcXFxbXFxcXHMqKDx1bmljb2RlMT4rKSg/OlxcXFxzKihbKl4kIX58XT89KSg/OlxcXFxzKig/OihbXFxcIiddPykoLio/KVxcXFw5KSkpP1xcXFxzKlxcXFxdKD8hXFxcXF0pfCg6KykoPHVuaWNvZGU+KykoPzpcXFxcKCg/Oig/OihbXFxcIiddKShbXlxcXFwxM10qKVxcXFwxMyl8KCg/OlxcXFwoW14pXStcXFxcKXxbXigpXSopKykpXFxcXCkpPylcIlxuICAgIC5yZXBsYWNlKC88Y29tYmluYXRvcj4vLCAnWycgKyBlc2NhcGUoXCI+K35gIUAkJV4mPXt9XFxcXDs8L1wiKSArICddJylcbiAgICAucmVwbGFjZSgvPHVuaWNvZGU+L2csICcoPzpbXFxcXHdcXFxcdTAwYTEtXFxcXHVGRkZGLV18XFxcXFxcXFxbXlxcXFxzMC05YS1mXSknKVxuICAgIC5yZXBsYWNlKC88dW5pY29kZTE+L2csICcoPzpbOlxcXFx3XFxcXHUwMGExLVxcXFx1RkZGRi1dfFxcXFxcXFxcW15cXFxcczAtOWEtZl0pJylcbilcblxuLy8gUGFydFxuXG52YXIgUGFydCA9IGZ1bmN0aW9uIFBhcnQoY29tYmluYXRvcil7XG4gICAgdGhpcy5jb21iaW5hdG9yID0gY29tYmluYXRvciB8fCBcIiBcIlxuICAgIHRoaXMudGFnID0gXCIqXCJcbn1cblxuUGFydC5wcm90b3R5cGUudG9TdHJpbmcgPSBmdW5jdGlvbigpe1xuXG4gICAgaWYgKCF0aGlzLnJhdyl7XG5cbiAgICAgICAgdmFyIHhwciA9IFwiXCIsIGssIHBhcnRcblxuICAgICAgICB4cHIgKz0gdGhpcy50YWcgfHwgXCIqXCJcbiAgICAgICAgaWYgKHRoaXMuaWQpIHhwciArPSBcIiNcIiArIHRoaXMuaWRcbiAgICAgICAgaWYgKHRoaXMuY2xhc3NlcykgeHByICs9IFwiLlwiICsgdGhpcy5jbGFzc0xpc3Quam9pbihcIi5cIilcbiAgICAgICAgaWYgKHRoaXMuYXR0cmlidXRlcykgZm9yIChrID0gMDsgcGFydCA9IHRoaXMuYXR0cmlidXRlc1trKytdOyl7XG4gICAgICAgICAgICB4cHIgKz0gXCJbXCIgKyBwYXJ0Lm5hbWUgKyAocGFydC5vcGVyYXRvciA/IHBhcnQub3BlcmF0b3IgKyAnXCInICsgcGFydC52YWx1ZSArICdcIicgOiAnJykgKyBcIl1cIlxuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLnBzZXVkb3MpIGZvciAoayA9IDA7IHBhcnQgPSB0aGlzLnBzZXVkb3NbaysrXTspe1xuICAgICAgICAgICAgeHByICs9IFwiOlwiICsgcGFydC5uYW1lXG4gICAgICAgICAgICBpZiAocGFydC52YWx1ZSkgeHByICs9IFwiKFwiICsgcGFydC52YWx1ZSArIFwiKVwiXG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnJhdyA9IHhwclxuXG4gICAgfVxuXG4gICAgcmV0dXJuIHRoaXMucmF3XG59XG5cbi8vIEV4cHJlc3Npb25cblxudmFyIEV4cHJlc3Npb24gPSB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IChmb3JtYXQgPT09IFwibmFtZVwiICYmIHRoaXMuX2EgPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy50b05hbWUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLnRvUmdiU3RyaW5nKCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGZvcm1hdCA9PT0gXCJyZ2JcIikge1xuICAgICAgICAgICAgZm9ybWF0dGVkU3RyaW5nID0gdGhpcy50b1JnYlN0cmluZygpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmb3JtYXQgPT09IFwicHJnYlwiKSB7XG4gICAgICAgICAgICBmb3JtYXR0ZWRTdHJpbmcgPSB0aGlzLnRvUGVyY2VudGFnZVJnYlN0cmluZygpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmb3JtYXQgPT09IFwiaGV4XCIgfHwgZm9ybWF0ID09PSBcImhleDZcIikge1xuICAgICAgICAgICAgZm9ybWF0dGVkU3RyaW5nID0gdGhpcy50b0hleFN0cmluZygpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmb3JtYXQgPT09IFwiaGV4M1wiKSB7XG4gICAgICAgICAgICBmb3JtYXR0ZWRTdHJpbmcgPSB0aGlzLnRvSGV4U3RyaW5nKHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmb3JtYXQgPT09IFwiaGV4NFwiKSB7XG4gICAgICAgICAgICBmb3JtYXR0ZWRTdHJpbmcgPSB0aGlzLnRvSGV4OFN0cmluZyh0cnVlKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZm9ybWF0ID09PSBcImhleDhcIikge1xuICAgICAgICAgICAgZm9ybWF0dGVkU3RyaW5nID0gdGhpcy50b0hleDhTdHJpbmcoKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZm9ybWF0ID09PSBcIm5hbWVcIikge1xuICAgICAgICAgICAgZm9ybWF0dGVkU3RyaW5nID0gdGhpcy50b05hbWUoKTtcbiAg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lvbiAoJCkge1xuICAgICAgICByZXR1cm4gKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAkY29udGFpbmVyO1xuICAgICAgICAgICAgdmFyIGxpc3RlbmVyO1xuICAgICAgICAgICAgdmFyIHRvYXN0SWQgPSAwO1xuICAgICAgICAgICAgdmFyIHRvYXN0VHlwZSA9IHtcbiAgICAgICAgICAgICAgICBlcnJvcjogJ2Vycm9yJyxcbiAgICAgICAgICAgICAgICBpbmZvOiAnaW5mbycsXG4gICAgICAgICAgICAgICAgc3VjY2VzczogJ3N1Y2Nlc3MnLFxuICAgICAgICAgICAgICAgIHdhcm5pbmc6ICd3YXJuaW5nJ1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgdmFyIHRvYXN0ciA9IHtcbiAgICAgICAgICAgICAgICBjbGVhcjogY2xlYXIsXG4gICAgICAgICAgICAgICAgcmVtb3ZlOiByZW1vdmUsXG4gICAgICAgICAgICAgICAgZXJyb3I6IGVycm9yLFxuICAgICAgICAgICAgICAgIGdldENvbnRhaW5lcjogZ2V0Q29udGFpbmVyLFxuICAgICAgICAgICAgICAgIGluZm86IGluZm8sXG4gICAgICAgICAgICAgICAgb3B0aW9uczoge30sXG4gICAgICAgICAgICAgICAgc3Vic2NyaWJlOiBzdWJzY3JpYmUsXG4gICAgICAgICAgICAgICAgc3VjY2Vzczogc3VjY2VzcyxcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiAnMi4xLjMnLFxuICAgICAgICAgICAgICAgIHdhcm5pbmc6IHdhcm5pbmdcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHZhciBwcmV2aW91c1RvYXN0O1xuXG4gICAgICAgICAgICByZXR1cm4gdG9hc3RyO1xuXG4gICAgICAgICAgICAvLy8vLy8vLy8vLy8vLy8vXG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGVycm9yKG1lc3NhZ2UsIHRpdGxlLCBvcHRpb25zT3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm90aWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogdG9hc3RUeXBlLmVycm9yLFxuICAgICAgICAgICAgICAgICAgICBpY29uQ2xhc3M6IGdldE9wdGlvbnMoKS5pY29uQ2xhc3Nlcy5lcnJvcixcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogbWVzc2FnZSxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uc092ZXJyaWRlOiBvcHRpb25zT3ZlcnJpZGUsXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBnZXRDb250YWluZXIob3B0aW9ucywgY3JlYXRlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFvcHRpb25zKSB7IG9wdGlvbnMgPSBnZXRPcHRpb25zKCk7IH1cbiAgICAgICAgICAgICAgICAkY29udGFpbmVyID0gJCgnIycgKyBvcHRpb25zLmNvbnRhaW5lcklkKTtcbiAgICAgICAgICAgICAgICBpZiAoJGNvbnRhaW5lci5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRjb250YWluZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjcmVhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgJGNvbnRhaW5lciA9IGNyZWF0ZUNvbnRhaW5lcihvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuICRjb250YWluZXI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGluZm8obWVzc2FnZSwgdGl0bGUsIG9wdGlvbnNPdmVycmlkZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBub3RpZnkoe1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiB0b2FzdFR5cGUuaW5mbyxcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzOiBnZXRPcHRpb25zKCkuaWNvbkNsYXNzZXMuaW5mbyxcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogbWVzc2FnZSxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uc092ZXJyaWRlOiBvcHRpb25zT3ZlcnJpZGUsXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBzdWJzY3JpYmUoY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lciA9IGNhbGxiYWNrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBzdWNjZXNzKG1lc3NhZ2UsIHRpdGxlLCBvcHRpb25zT3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm90aWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogdG9hc3RUeXBlLnN1Y2Nlc3MsXG4gICAgICAgICAgICAgICAgICAgIGljb25DbGFzczogZ2V0T3B0aW9ucygpLmljb25DbGFzc2VzLnN1Y2Nlc3MsXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnNPdmVycmlkZTogb3B0aW9uc092ZXJyaWRlLFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gd2FybmluZyhtZXNzYWdlLCB0aXRsZSwgb3B0aW9uc092ZXJyaWRlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vdGlmeSh7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHRvYXN0VHlwZS53YXJuaW5nLFxuICAgICAgICAgICAgICAgICAgICBpY29uQ2xhc3M6IGdldE9wdGlvbnMoKS5pY29uQ2xhc3Nlcy53YXJuaW5nLFxuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBtZXNzYWdlLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zT3ZlcnJpZGU6IG9wdGlvbnNPdmVycmlkZSxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNsZWFyKCR0b2FzdEVsZW1lbnQsIGNsZWFyT3B0aW9ucykge1xuICAgICAgICAgICAgICAgIHZhciBvcHRpb25zID0gZ2V0T3B0aW9ucygpO1xuICAgICAgICAgICAgICAgIGlmICghJGNvbnRhaW5lcikgeyBnZXRDb250YWluZXIob3B0aW9ucyk7IH1cbiAgICAgICAgICAgICAgICBpZiAoIWNsZWFyVG9hc3QoJHRvYXN0RWxlbWVudCwgb3B0aW9ucywgY2xlYXJPcHRpb25zKSkge1xuICAgICAgICAgICAgICAgICAgICBjbGVhckNvbnRhaW5lcihvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHJlbW92ZSgkdG9hc3RFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSBnZXRPcHRpb25zKCk7XG4gICAgICAgICAgICAgICAgaWYgKCEkY29udGFpbmVyKSB7IGdldENvbnRhaW5lcihvcHRpb25zKTsgfVxuICAgICAgICAgICAgICAgIGlmICgkdG9hc3RFbGVtZW50ICYmICQoJzpmb2N1cycsICR0b2FzdEVsZW1lbnQpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByZW1vdmVUb2FzdCgkdG9hc3RFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoJGNvbnRhaW5lci5jaGlsZHJlbigpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAkY29udGFpbmVyLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gaW50ZXJuYWwgZnVuY3Rpb25zXG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNsZWFyQ29udGFpbmVyIChvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRvYXN0c1RvQ2xlYXIgPSAkY29udGFpbmVyLmNoaWxkcmVuKCk7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IHRvYXN0c1RvQ2xlYXIubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJUb2FzdCgkKHRvYXN0c1RvQ2xlYXJbaV0pLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNsZWFyVG9hc3QgKCR0b2FzdEVsZW1lbnQsIG9wdGlvbnMsIGNsZWFyT3B0aW9ucykge1xuICAgICAgICAgICAgICAgIHZhciBmb3JjZSA9IGNsZWFyT3B0aW9ucyAmJiBjbGVhck9wdGlvbnMuZm9yY2UgPyBjbGVhck9wdGlvbnMuZm9yY2UgOiBmYWxzZTtcbiAgICAgICAgICAgICAgICBpZiAoJHRvYXN0RWxlbWVudCAmJiAoZm9yY2UgfHwgJCgnOmZvY3VzJywgJHRvYXN0RWxlbWVudCkubGVuZ3RoID09PSAwKSkge1xuICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50W29wdGlvbnMuaGlkZU1ldGhvZF0oe1xuICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb246IG9wdGlvbnMuaGlkZUR1cmF0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgZWFzaW5nOiBvcHRpb25zLmhpZGVFYXNpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZTogZnVuY3Rpb24gKCkgeyByZW1vdmVUb2FzdCgkdG9hc3RFbGVtZW50KTsgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gY3JlYXRlQ29udGFpbmVyKG9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAkY29udGFpbmVyID0gJCgnPGRpdi8+JylcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgb3B0aW9ucy5jb250YWluZXJJZClcbiAgICAgICAgICAgICAgICAgICAgLmFkZENsYXNzKG9wdGlvbnMucG9zaXRpb25DbGFzcyk7XG5cbiAgICAgICAgICAgICAgICAkY29udGFpbmVyLmFwcGVuZFRvKCQob3B0aW9ucy50YXJnZXQpKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gJGNvbnRhaW5lcjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0RGVmYXVsdHMoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgdGFwVG9EaXNtaXNzOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICB0b2FzdENsYXNzOiAndG9hc3QnLFxuICAgICAgICAgICAgICAgICAgICBjb250YWluZXJJZDogJ3RvYXN0LWNvbnRhaW5lcicsXG4gICAgICAgICAgICAgICAgICAgIGRlYnVnOiBmYWxzZSxcblxuICAgICAgICAgICAgICAgICAgICBzaG93TWV0aG9kOiAnZmFkZUluJywgLy9mYWRlSW4sIHNsaWRlRG93biwgYW5kIHNob3cgYXJlIGJ1aWx0IGludG8galF1ZXJ5XG4gICAgICAgICAgICAgICAgICAgIHNob3dEdXJhdGlvbjogMzAwLFxuICAgICAgICAgICAgICAgICAgICBzaG93RWFzaW5nOiAnc3dpbmcnLCAvL3N3aW5nIGFuZCBsaW5lYXIgYXJlIGJ1aWx0IGludG8galF1ZXJ5XG4gICAgICAgICAgICAgICAgICAgIG9uU2hvd246IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgaGlkZU1ldGhvZDogJ2ZhZGVPdXQnLFxuICAgICAgICAgICAgICAgICAgICBoaWRlRHVyYXRpb246IDEwMDAsXG4gICAgICAgICAgICAgICAgICAgIGhpZGVFYXNpbmc6ICdzd2luZycsXG4gICAgICAgICAgICAgICAgICAgIG9uSGlkZGVuOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlTWV0aG9kOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgY2xvc2VEdXJhdGlvbjogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlRWFzaW5nOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgY2xvc2VPbkhvdmVyOiB0cnVlLFxuXG4gICAgICAgICAgICAgICAgICAgIGV4dGVuZGVkVGltZU91dDogMTAwMCxcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzZXM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiAndG9hc3QtZXJyb3InLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5mbzogJ3RvYXN0LWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzczogJ3RvYXN0LXN1Y2Nlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgd2FybmluZzogJ3RvYXN0LXdhcm5pbmcnXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGljb25DbGFzczogJ3RvYXN0LWluZm8nLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbkNsYXNzOiAndG9hc3QtdG9wLXJpZ2h0JyxcbiAgICAgICAgICAgICAgICAgICAgdGltZU91dDogNTAwMCwgLy8gU2V0IHRpbWVPdXQgYW5kIGV4dGVuZGVkVGltZU91dCB0byAwIHRvIG1ha2UgaXQgc3RpY2t5XG4gICAgICAgICAgICAgICAgICAgIHRpdGxlQ2xhc3M6ICd0b2FzdC10aXRsZScsXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VDbGFzczogJ3RvYXN0LW1lc3NhZ2UnLFxuICAgICAgICAgICAgICAgICAgICBlc2NhcGVIdG1sOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0OiAnYm9keScsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlSHRtbDogJzxidXR0b24gdHlwZT1cImJ1dHRvblwiPiZ0aW1lczs8L2J1dHRvbj4nLFxuICAgICAgICAgICAgICAgICAgICBjbG9zZUNsYXNzOiAndG9hc3QtY2xvc2UtYnV0dG9uJyxcbiAgICAgICAgICAgICAgICAgICAgbmV3ZXN0T25Ub3A6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgIHByZXZlbnREdXBsaWNhdGVzOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXI6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBwcm9ncmVzc0NsYXNzOiAndG9hc3QtcHJvZ3Jlc3MnLFxuICAgICAgICAgICAgICAgICAgICBydGw6IGZhbHNlXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gcHVibGlzaChhcmdzKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFsaXN0ZW5lcikgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICBsaXN0ZW5lcihhcmdzKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gbm90aWZ5KG1hcCkge1xuICAgICAgICAgICAgICAgIHZhciBvcHRpb25zID0gZ2V0T3B0aW9ucygpO1xuICAgICAgICAgICAgICAgIHZhciBpY29uQ2xhc3MgPSBtYXAuaWNvbkNsYXNzIHx8IG9wdGlvbnMuaWNvbkNsYXNzO1xuXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiAobWFwLm9wdGlvbnNPdmVycmlkZSkgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMgPSAkLmV4dGVuZChvcHRpb25zLCBtYXAub3B0aW9uc092ZXJyaWRlKTtcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzID0gbWFwLm9wdGlvbnNPdmVycmlkZS5pY29uQ2xhc3MgfHwgaWNvbkNsYXNzO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChzaG91bGRFeGl0KG9wdGlvbnMsIG1hcCkpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICAgICAgICB0b2FzdElkKys7XG5cbiAgICAgICAgICAgICAgICAkY29udGFpbmVyID0gZ2V0Q29udGFpbmVyKG9wdGlvbnMsIHRydWUpO1xuXG4gICAgICAgICAgICAgICAgdmFyIGludGVydmFsSWQgPSBudWxsO1xuICAgICAgICAgICAgICAgIHZhciAkdG9hc3RFbGVtZW50ID0gJCgnPGRpdi8+Jyk7XG4gICAgICAgICAgICAgICAgdmFyICR0aXRsZUVsZW1lbnQgPSAkKCc8ZGl2Lz4nKTtcbiAgICAgICAgICAgICAgICB2YXIgJG1lc3NhZ2VFbGVtZW50ID0gJCgnPGRpdi8+Jyk7XG4gICAgICAgICAgICAgICAgdmFyICRwcm9ncmVzc0VsZW1lbnQgPSAkKCc8ZGl2Lz4nKTtcbiAgICAgICAgICAgICAgICB2YXIgJGNsb3NlRWxlbWVudCA9ICQob3B0aW9ucy5jbG9zZUh0bWwpO1xuICAgICAgICAgICAgICAgIHZhciBwcm9ncmVzc0JhciA9IHtcbiAgICAgICAgICAgICAgICAgICAgaW50ZXJ2YWxJZDogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgaGlkZUV0YTogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbWF4SGlkZVRpbWU6IG51bGxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHZhciByZXNwb25zZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgdG9hc3RJZDogdG9hc3RJZCxcbiAgICAgICAgICAgICAgICAgICAgc3RhdGU6ICd2aXNpYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgc3RhcnRUaW1lOiBuZXcgRGF0ZSgpLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiBvcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICBtYXA6IG1hcFxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICBwZXJzb25hbGl6ZVRvYXN0KCk7XG5cbiAgICAgICAgICAgICAgICBkaXNwbGF5VG9hc3QoKTtcblxuICAgICAgICAgICAgICAgIGhhbmRsZUV2ZW50cygpO1xuXG4gICAgICAgICAgICAgICAgcHVibGlzaChyZXNwb25zZSk7XG5cbiAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5kZWJ1ZyAmJiBjb25zb2xlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gJHRvYXN0RWxlbWVudDtcblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGVzY2FwZUh0bWwoc291cmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2UgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlID0gJyc7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvJi9nLCAnJmFtcDsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1wiL2csICcmcXVvdDsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLycvZywgJyYjMzk7JylcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC88L2csICcmbHQ7JylcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8+L2csICcmZ3Q7Jyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gcGVyc29uYWxpemVUb2FzdCgpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0SWNvbigpO1xuICAgICAgICAgICAgICAgICAgICBzZXRUaXRsZSgpO1xuICAgICAgICAgICAgICAgICAgICBzZXRNZXNzYWdlKCk7XG4gICAgICAgICAgICAgICAgICAgIHNldENsb3NlQnV0dG9uKCk7XG4gICAgICAgICAgICAgICAgICAgIHNldFByb2dyZXNzQmFyKCk7XG4gICAgICAgICAgICAgICAgICAgIHNldFJUTCgpO1xuICAgICAgICAgICAgICAgICAgICBzZXRTZXF1ZW5jZSgpO1xuICAgICAgICAgICAgICAgICAgICBzZXRBcmlhKCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0QXJpYSgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGFyaWFWYWx1ZSA9ICcnO1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKG1hcC5pY29uQ2xhc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3RvYXN0LXN1Y2Nlc3MnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAndG9hc3QtaW5mbyc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJpYVZhbHVlID0gICdwb2xpdGUnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmlhVmFsdWUgPSAnYXNzZXJ0aXZlJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmF0dHIoJ2FyaWEtbGl2ZScsIGFyaWFWYWx1ZSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gaGFuZGxlRXZlbnRzKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jbG9zZU9uSG92ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuaG92ZXIoc3RpY2tBcm91bmQsIGRlbGF5ZWRIaWRlVG9hc3QpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFvcHRpb25zLm9uY2xpY2sgJiYgb3B0aW9ucy50YXBUb0Rpc21pc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuY2xpY2soaGlkZVRvYXN0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmNsb3NlQnV0dG9uICYmICRjbG9zZUVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICRjbG9zZUVsZW1lbnQuY2xpY2soZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50LnN0b3BQcm9wYWdhdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5zdG9wUHJvcGFnYXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50LmNhbmNlbEJ1YmJsZSAhPT0gdW5kZWZpbmVkICYmIGV2ZW50LmNhbmNlbEJ1YmJsZSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5jYW5jZWxCdWJibGUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLm9uQ2xvc2VDbGljaykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uQ2xvc2VDbGljayhldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZVRvYXN0KHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5vbmNsaWNrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmNsaWNrKGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25jbGljayhldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZVRvYXN0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRpc3BsYXlUb2FzdCgpIHtcbiAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5oaWRlKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudFtvcHRpb25zLnNob3dNZXRob2RdKFxuICAgICAgICAgICAgICAgICAgICAgICAge2R1cmF0aW9uOiBvcHRpb25zLnNob3dEdXJhdGlvbiwgZWFzaW5nOiBvcHRpb25zLnNob3dFYXNpbmcsIGNvbXBsZXRlOiBvcHRpb25zLm9uU2hvd259XG4gICAgICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMudGltZU91dCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGludGVydmFsSWQgPSBzZXRUaW1lb3V0KGhpZGVUb2FzdCwgb3B0aW9ucy50aW1lT3V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLm1heEhpZGVUaW1lID0gcGFyc2VGbG9hdChvcHRpb25zLnRpbWVPdXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXIuaGlkZUV0YSA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpICsgcHJvZ3Jlc3NCYXIubWF4SGlkZVRpbWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5wcm9ncmVzc0Jhcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLmludGVydmFsSWQgPSBzZXRJbnRlcnZhbCh1cGRhdGVQcm9ncmVzcywgMTApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0SWNvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5pY29uQ2xhc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuYWRkQ2xhc3Mob3B0aW9ucy50b2FzdENsYXNzKS5hZGRDbGFzcyhpY29uQ2xhc3MpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0U2VxdWVuY2UoKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLm5ld2VzdE9uVG9wKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkY29udGFpbmVyLnByZXBlbmQoJHRvYXN0RWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkY29udGFpbmVyLmFwcGVuZCgkdG9hc3RFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldFRpdGxlKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobWFwLnRpdGxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3VmZml4ID0gbWFwLnRpdGxlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXNjYXBlSHRtbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1ZmZpeCA9IGVzY2FwZUh0bWwobWFwLnRpdGxlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICR0aXRsZUVsZW1lbnQuYXBwZW5kKHN1ZmZpeCkuYWRkQ2xhc3Mob3B0aW9ucy50aXRsZUNsYXNzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuYXBwZW5kKCR0aXRsZUVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0TWVzc2FnZSgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5tZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3VmZml4ID0gbWFwLm1lc3NhZ2U7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5lc2NhcGVIdG1sKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VmZml4ID0gZXNjYXBlSHRtbChtYXAubWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAkbWVzc2FnZUVsZW1lbnQuYXBwZW5kKHN1ZmZpeCkuYWRkQ2xhc3Mob3B0aW9ucy5tZXNzYWdlQ2xhc3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5hcHBlbmQoJG1lc3NhZ2VFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldENsb3NlQnV0dG9uKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jbG9zZUJ1dHRvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgJGNsb3NlRWxlbWVudC5hZGRDbGFzcyhvcHRpb25zLmNsb3NlQ2xhc3MpLmF0dHIoJ3JvbGUnLCAnYnV0dG9uJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LnByZXBlbmQoJGNsb3NlRWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZXRQcm9ncmVzc0JhcigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMucHJvZ3Jlc3NCYXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICRwcm9ncmVzc0VsZW1lbnQuYWRkQ2xhc3Mob3B0aW9ucy5wcm9ncmVzc0NsYXNzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQucHJlcGVuZCgkcHJvZ3Jlc3NFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldFJUTCgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMucnRsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmFkZENsYXNzKCdydGwnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNob3VsZEV4aXQob3B0aW9ucywgbWFwKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnByZXZlbnREdXBsaWNhdGVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWFwLm1lc3NhZ2UgPT09IHByZXZpb3VzVG9hc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNUb2FzdCA9IG1hcC5tZXNzYWdlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBoaWRlVG9hc3Qob3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1ldGhvZCA9IG92ZXJyaWRlICYmIG9wdGlvbnMuY2xvc2VNZXRob2QgIT09IGZhbHNlID8gb3B0aW9ucy5jbG9zZU1ldGhvZCA6IG9wdGlvbnMuaGlkZU1ldGhvZDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGR1cmF0aW9uID0gb3ZlcnJpZGUgJiYgb3B0aW9ucy5jbG9zZUR1cmF0aW9uICE9PSBmYWxzZSA/XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmNsb3NlRHVyYXRpb24gOiBvcHRpb25zLmhpZGVEdXJhdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVhc2luZyA9IG92ZXJyaWRlICYmIG9wdGlvbnMuY2xvc2VFYXNpbmcgIT09IGZhbHNlID8gb3B0aW9ucy5jbG9zZUVhc2luZyA6IG9wdGlvbnMuaGlkZUVhc2luZztcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQoJzpmb2N1cycsICR0b2FzdEVsZW1lbnQpLmxlbmd0aCAmJiAhb3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocHJvZ3Jlc3NCYXIuaW50ZXJ2YWxJZCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkdG9hc3RFbGVtZW50W21ldGhvZF0oe1xuICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb246IGR1cmF0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgZWFzaW5nOiBlYXNpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZVRvYXN0KCR0b2FzdEVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dChpbnRlcnZhbElkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5vbkhpZGRlbiAmJiByZXNwb25zZS5zdGF0ZSAhPT0gJ2hpZGRlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkhpZGRlbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZS5zdGF0ZSA9ICdoaWRkZW4nO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLmVuZFRpbWUgPSBuZXcgRGF0ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1Ymxpc2gocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBkZWxheWVkSGlkZVRvYXN0KCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy50aW1lT3V0ID4gMCB8fCBvcHRpb25zLmV4dGVuZGVkVGltZU91dCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGludGVydmFsSWQgPSBzZXRUaW1lb3V0KGhpZGVUb2FzdCwgb3B0aW9ucy5leHRlbmRlZFRpbWVPdXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXIubWF4SGlkZVRpbWUgPSBwYXJzZUZsb2F0KG9wdGlvbnMuZXh0ZW5kZWRUaW1lT3V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLmhpZGVFdGEgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKSArIHByb2dyZXNzQmFyLm1heEhpZGVUaW1lO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc3RpY2tBcm91bmQoKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dChpbnRlcnZhbElkKTtcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXIuaGlkZUV0YSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuc3RvcCh0cnVlLCB0cnVlKVtvcHRpb25zLnNob3dNZXRob2RdKFxuICAgICAgICAgICAgICAgICAgICAgICAge2R1cmF0aW9uOiBvcHRpb25zLnNob3dEdXJhdGlvbiwgZWFzaW5nOiBvcHRpb25zLnNob3dFYXNpbmd9XG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlUHJvZ3Jlc3MoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwZXJjZW50YWdlID0gKChwcm9ncmVzc0Jhci5oaWRlRXRhIC0gKG5ldyBEYXRlKCkuZ2V0VGltZSgpKSkgLyBwcm9ncmVzc0Jhci5tYXhIaWRlVGltZSkgKiAxMDA7XG4gICAgICAgICAgICAgICAgICAgICRwcm9ncmVzc0VsZW1lbnQud2lkdGgocGVyY2VudGFnZSArICclJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBnZXRPcHRpb25zKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAkLmV4dGVuZCh7fSwgZ2V0RGVmYXVsdHMoKSwgdG9hc3RyLm9wdGlvbnMpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiByZW1vdmVUb2FzdCgkdG9hc3RFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgaWYgKCEkY29udGFpbmVyKSB7ICRjb250YWluZXIgPSBnZXRDb250YWluZXIoKTsgfVxuICAgICAgICAgICAgICAgIGlmICgkdG9hc3RFbGVtZW50LmlzKCc6dmlzaWJsZScpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICAgICAgICBpZiAoJGNvbnRhaW5lci5jaGlsZHJlbigpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAkY29udGFpbmVyLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICBwcmV2aW91c1RvYXN0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICB9KSgpO1xuICAgIH0pO1xufSh0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUgOiB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VtKSB7XG5cbiAgICAgICAgICAgIGlmIChpdGVtLmNsb25lKSB7XG4gICAgICAgICAgICAgIGl0ZW0gPSBpdGVtLmNsb25lKCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChkcm9wcGFibGUuZHJhZ2dlZCkge1xuICAgICAgICAgICAgICBpdGVtID0gZHJvcHBhYmxlLmRyYWdnZWQuY2FsbCh0aGlzLCBpdGVtLCBldmVudCwgdWkpIHx8IGl0ZW07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChkcm9wcGFibGUuZGF0YSkge1xuICAgICAgICAgICAgICBkcm9wcGFibGUuZGF0YShpdGVtKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChkcm9wQWN0dWFsKSB7XG4gICAgICAgICAgICBkcm9wQWN0dWFsLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgIH1cbiAgICAgIH0pKTtcblxuICAgICAgLy9oYW5kbGUgZW5hYmxpbmcvZGlzYWJsaW5nXG4gICAgICBpZiAoZHJvcHBhYmxlLmlzRW5hYmxlZCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGtvLmNvbXB1dGVkKHtcbiAgICAgICAgICByZWFkOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICRlbGVtZW50LmRyb3BwYWJsZShrby51dGlscy51bndyYXBPYnNlcnZhYmxlKGRyb3BwYWJsZS5pc0VuYWJsZWQpID8gXCJlbmFibGVcIiA6IFwiZGlzYWJsZVwiKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGRpc3Bvc2VXaGVuTm9kZUlzUmVtb3ZlZDogZWxlbWVudFxuICAgICAgICB9KTtcbiAgICAgIH1cblxuICAgIH0sXG4gICAgdXBkYXRlOiBmdW5jdGlvbihlbGVtZW50LCB2YWx1ZUFjY2Vzc29yLCBhbGxCaW5kaW5nc0FjY2Vzc29yLC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TWVzc2FnZSgnZ2VuZXJpYycpKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3B0aW9ucy5vbmVycm9yKHRyYW5zbGF0ZWRNZXNzYWdlKCdnZW5lcmljICgnICsgZGF0YS5lcnJvclRocm93biArICcpJykpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjbGVhbnVwKCk7XG4gICAgICB9XG4gICAgICBpZiAoZS50eXBlID09ICdmaWxldXBsb2FkZG9uZScpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBkYXRhLnJlc3VsdC5maWxlc1swXS51cmwgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgaWYgKG9wdGlvbnMub25maWxlKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGRhdGEucmVzdWx0LmZpbGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgIGRhdGEucmVzdWx0LmZpbGVzW2ldID0ga28uYmluZGluZ0hhbmRsZXJzWydmaWxldXBsb2FkJ10ucmVtb3RlRmlsZVByZXByb2Nlc3NvcihkYXRhLnJlc3VsdC5maWxlc1tpXSk7XG4gICAgICAgICAgICAgIG9wdGlvbnMub25maWxlKGRhdGEucmVzdWx0LmZpbGVzW2ldKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmlyc3RXb3JrZWQgPT09ICcnKSBmaXJzdFdvcmtlZCA9IGRhdGEucmVzdWx0LmZpbGVzWzBdLnVybDtcblxuICAgICAgICAgIGlmIChjYW52YXNQcmV2aWV3KSB7XG4gICAgICAgICAgICB2YXIgaW1nID0gbmV3IEltYWdlKCk7XG4gICAgICAgICAgICBpbWcub25sb2FkID0gY2xlYW51cDtcbiAgICAgICAgICAgIGltZy5vbmVycm9yID0gY2xlYW51cDtcbiAgICAgICAgICAgIGltZy5zcmMgPSBkYXRhLnJlc3VsdC5maWxlc1swXS51cmw7XG4gICAgICAgICAg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FzJykubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICBpZiAoY2FudmFzUHJldmlldykge1xuICAgICAgICAgICAgICB2YXIgZWwgPSAkKGZpbGUucHJldmlldykuY3NzKCd3aWR0aCcsICcxMDAlJyk7IC8vIC5jc3MoJ3Bvc2l0aW9uJywgJ2Fic29sdXRlJykuY3NzKCdsZWZ0JywgJzAnKTtcbiAgICAgICAgICAgICAgJHBhcmVudC5maW5kKCdpbWcnKS5oaWRlKCk7XG4gICAgICAgICAgICAgICRwYXJlbnQucHJlcGVuZChlbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkcGFyZW50LmFkZENsYXNzKFwidXBsb2FkaW5nXCIpO1xuICAgICAgICAgICAgJHBhcmVudC5maW5kKCcucHJvZ3Jlc3MtYmFyJykuY3NzKCd3aWR0aCcsIDApO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoZmlsZS5lcnJvcikge1xuICAgICAgICAgIC8vIEZpbGUgdHlwZSBub3QgYWxsb3dlZFxuICAgICAgICAgIC8vIEZpbGUgaXMgdG9vIGxhcmdlXG4gICAgICAgICAgaWYgKG9wdGlvbnMub25lcnJvcikge1xuICAgICAgICAgICAgb3B0aW9ucy5vbmVycm9yKHRyYW5zbGF0ZWRNZXNzYWdlKGZpbGUuZXJyb3IpKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY2xlYW51cCgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoZS50eXBlID09ICdmaWxldXBsb2FkcHJvZ3Jlc3NhbGwnKSB7XG4gICAgICAgIHZhciBwcm9ncmVzcyA9IHBhcnNlSW50KGRhdGEubG9hZGVkIC8gZGF0YS50b3RhbCAqIDEwMCwgMTApO1xuICAgICAgICAkcGFyZW50LmZpbmQoJy5wcm9ncmVzcy1iYXInKS5jc3MoJ3dpZHRoJywgcHJvZ3Jlc3MgKyAnJScpO1xuICAgICAgfVxuICAgIH07XG4gICAgZm9yICh2YXIg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ogPCByZWZlcmVuY2VbcHJvcF0ubGVuZ3RoICYmIHJlZmVyZW5jZVtwcm9wXVtqXS50eXBlICE9PSBtb2RlbFtwcm9wXVtpXS50eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJpZ25vcmluZyBcIiwgcHJlZml4LCByZWZlcmVuY2VbcHJvcF1bal0udHlwZSwgXCIgYmxvY2sgdHlwZSBpbiByZWZlcmVuY2Ugbm90IGZvdW5kIGluIG1vZGVsXCIpO1xuICAgICAgICAgICAgICAgICAgICAgIGorKztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoaiA+PSByZWZlcmVuY2VbcHJvcF0ubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJXQVJOIGNhbm5vdCBmaW5kIFwiLCBwcmVmaXgsIG1vZGVsW3Byb3BdW2ldLnR5cGUsIFwiIGJsb2NrIGluIHJlZmVyZW5jZVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICB2YWxpZCA9IE1hdGgubWF4KHZhbGlkLCAyKTtcbiAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyByZXZlcnNlIGNvbmRpdGlvbiBzbyB0byBza2lwIFwiZGVlcCB0cmF2ZXJzaW5nXCIgb24gZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgdmFsaWQgPSBNYXRoLm1heCh2YWxpZCwgY2hlY2tNb2RlbChyZWZlcmVuY2VbcHJvcF1bal0sIHVuZGVmaW5lZCwgbW9kZWxbcHJvcF1baV0sIHByZWZpeCArIFwiW1wiICsgaSArIFwiLlwiICsgbW9kZWxbcHJvcF1baV0udHlwZSArIFwiXVwiKSk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIGluIHRoZSBjYXNlIG9mIGRpZmZlcmVudCBhcnJheSB3ZSBjaGVjayBibG9ja0RlZnNcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcmVmZXJlbmNlW3Byb3BdLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlZmVyZW5jZVtwcm9wXVtpXS50eXBlICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhcIlRPRE8gZm91bmQgYW4gb2JqZWN0IHdpdGggbm8gdHlwZVwiLCBwcmVmaXgsIHJlZmVyZW5jZVtwcm9wXVtpXSk7XG4gICAgICAgICAgICAgICAgICAgIHZhbGlkID0gTWF0aC5tYXgodmFsaWQsIDIpO1xuICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghYmxvY2tEZWZzT2JqLmhhc093blByb3BlcnR5KHJlZmVyZW5jZVtwcm9wXVtpXS50eXBlKSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXCJUT0RPIHRoZSBtb2RlbCB1c2VzIGEgYmxvY2sgdHlwZSBub3QgZGVmaW5lZCBieSB0aGUgdGVtcGxhdGUuIFJFTU9WSU5HIElUISFcIiwgcHJlZml4LCByZWZlcmVuY2VbcHJvcF1baV0pO1xuICAgICAgICAgICAgICAgICAgICByZWZlcmVuY2VbcHJvcF0uc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICBpLS07XG4gICAgICAgICAgICAgICAgICAgIHZhbGlkID0gTWF0aC5tYXgodmFsaWQsIDIpO1xuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWQgPSBNYXRoLm1heCh2YWxpZCwgY2hlY2tNb2RlbChibG9ja0RlZnNPYmpbcmVmZXJlbmNlW3Byb3BdW2ldLnR5cGVdLCBibG9ja0RlZnNPYmosIHJlZmVyZW5jZVtwcm9wXVtpXSwgcHJlZml4ICsgXCJbXCIgKyBpICsgXCIuXCIgKyByZWZlcmVuY2VbcHJvcF1baV0udHlwZSArIFwiXVwiKSk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChtb2RlbFtwcm9wXSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICBpZiAocmV2ZXJzZSkge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiV0FSTiBOdWxsIG9iamVjdCBpbiBtb2RlbCBcIiwgcHJlZml4LCBcImluc3RlYWQgb2ZcIiwgcmVmZXJlbmNlW3Byb3BdLCBcImRlbGV0aW5nIGl0XCIpO1xuICAgICAgICAgICAgICAgIHZhbGlkID0gTWF0aC5tYXgodmFsaWQsIDIpO1xuICAgICAgICAgICAgICAgIGRlbGV0ZSByZWZlcmVuY2VbcHJvcF07XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coXCJJTkZPIE51bGwgb2JqZWN0IGluIG1vZGVsIFwiLCBwcmVmaXgsIFwiaW5zdGVhZCBvZlwiLCByZWZlcmVuY2VbcHJvcF0sIFwiY2xvbmluZyBpdCBmcm9tIHRoZSByZWZlcmVuY2VcIik7XG4gICAgICAgICAgICAgICAgdmFsaWQgPSBNYXRoLm1heCh2YWxpZCwgMSk7XG4gICAgICAgICAgICAgICAgbW9kZWxbcHJvcF0gPSByZWZlcmVuY2VbcHJvcF07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHZhbGlkID0gTWF0aC5tYXgodmFsaWQsIGNoZWNrTW9kZWwocmVmZXJlbmNlW3Byb3BdLCBibG9ja0RlZnNPYmosIG1vZGVsW3Byb3BdLCBwcmVmaXgsIHJldmVyc2UpKTtcbiAgICAgICAgICAgI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AgICAgICBiaW5kVHlwZSA9IG51bGw7XG4gICAgICAgICAgICAgIGlmIChwcm9wTmFtZSA9PSAndGV4dCcpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGVsZW1lbnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICBwcm9wRGVmYXVsdFZhbHVlID0gZG9tdXRpbHMuZ2V0SW5uZXJUZXh0KGVsZW1lbnQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBuZWVkRGVmYXVsdFZhbHVlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2UgaWYgKHByb3BOYW1lID09ICdodG1sJykge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZWxlbWVudCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgIHByb3BEZWZhdWx0VmFsdWUgPSBkb211dGlscy5nZXRJbm5lckh0bWwoZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIG5lZWREZWZhdWx0VmFsdWUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbmVlZERlZmF1bHRWYWx1ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChuZWVkRGVmYXVsdFZhbHVlICYmIHByb3BEZWZhdWx0VmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihcIkNhbm5vdCBmaW5kIGRlZmF1bHQgdmFsdWUgZm9yXCIsIGRlY2xhcmF0aW9uc1tpXS5uYW1lLCBkZWNsYXJhdGlvbnMpO1xuICAgICAgICAgICAgICB0aHJvdyBcIkNhbm5vdCBmaW5kIGRlZmF1bHQgdmFsdWUg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lICcoJzpcbiAgICAgICAgaWYgKHBhdGguY2hhckF0KHAgKyAxKSA9PSAnKScpIHtcbiAgICAgICAgICBtID0gbSgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIFRPRE8gZXJyb3JcbiAgICAgICAgfVxuICAgICAgICBwICs9IDI7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAnWyc6XG4gICAgICAgIHAyID0gcGF0aC5pbmRleE9mKCddJywgcCk7XG4gICAgICAgIG0gPSBtW3BhdGguc3Vic3RyaW5nKHAgKyAxLCBwMildO1xuICAgICAgICBwID0gcDIgKyAxO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJy4nOlxuICAgICAgICBwMSA9IHBhdGguaW5kZXhPZignKCcsIHApO1xuICAgICAgICBpZiAocDEgPT0gLTEpIHAxID0gcGF0aC5sZW5ndGg7XG4gICAgICAgIHAyID0gcGF0aC5pbmRleE9mKCdbJywgcCk7XG4gICAgICAgIGlmIChwMiA9PSAtMSkgcDIgPSBwYXRoLmxlbmd0aDtcbiAgICAgICAgcDIgPSBNYXRoLm1pbihwMSwgcDIpO1xuICAgICAgICBtID0gbVtwYXRoLnN1YnN0cmluZyhwICsgMSwgcDIpXTtcbiAgICAgICAgcCA9IHAyO1xuICAgICAgICBicmVhaztcbiAgICAgIGRlZmF1bHQ6XG4gICAgICAgIC8vIFRPRE8gZXJyb3JcbiAgICB9XG4gIH1cbiAgcmV0dXJuIG07XG59O1xuXG52YXIgX2dldFBhdGggPSBmdW5jdGlvbihwYXJlbnRzLCBjaGlsZCkge1xuICB2YXIgcGF0aCA9IFwiXCI7XG4gIHZhciBwO1xuICBmb3IgKHZhciBrID0gMDsgayA8PSBwYXJlbnRzLmxlbmd0aDsgaysrKSB7XG4gICAgcCA9IGsgPCBwYXJlbnRzLmxlbmd0aCA/IHBhcmVudHNba10gOiBjaGlsZDtcbiAgICBpZiAoa28uaXNPYnNlcnZhYmxlKHApKSBwYXRoICs9ICcoKSc7XG4gICAgaWYgKHR5cGVvZiBwLl9maWVsZE5hbWUgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICBwYXRoICs9IFwiLlwiICsgcC5fZmllbGROYW1lO1xuICAgIH0gZWxzZSBpZiAoayA+IDAgJiYgdHlwZW9mIHBhcmVudHNbayAtIDFdLnBvcCA9PSAnZnVuY3Rpb24nKSB7XG4gICAgICB2YXIgcGFyZW50QXJyYXkgPSBrby5pc09ic2VydmFibGUocGFyZW50c1trIC0gMV0pID8ga28udXRpbHMucGVla09ic2VydmFibGUocGFyZW50c1trIC0gMV0pIDogcGFyZW50c1trIC0gMV07XG4gICAgICB2YXIgcG9zID0ga28udXRpbHMuYXJyYXlJbmRleE9mKHBhcmVudEFycmF5LCBwKTtcbiAgICAgIGlmIChwb3MgIT0gLTEpIHtcbiAgICAgICAgcGF0aCArPSBcIltcIiArIHBvcyArIFwiXVwiO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8gTk9URSB0aGlzIGhhcHBlbiwgc29tZXRpbWVzIHdoZW4gVGlueU1DRSBzZW5kcyB1cGRhdGVzIGZvciBvYmplY3RzIGFscmVhZHkgcmVtb3ZlZC5cbiAgICAgICAgY29uc29sZS5lcnJvcihcIlVuZXhwZWN0ZWQgb2JqZWN0IG5vdCBmb3VuZCBpbiBwYXJlbnQgYXJyYXlcIiwgcGFyZW50QXJyYXksIHAsIGssIHBhcmVudHMubGVuZ3RoLCBrby50b0pTKHBhcmVudEFycmF5KSwga28udXRpbHMudW53cmFwT2JzZXJ2YWJsZShwKSk7XG4gICAgICAgIHRocm93IFwiVW5leHBlY3RlZCBvYmplY3Qgbm90IGZvdW5kIGluIHBhcmVudCBhcnJheVwiO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBjb25zb2xlLmVycm9yKFwiVW5leHBlY3RlZCBwYXJlbnQgd2l0aCBubyBfZmllbGROYW1lIGFuZCBubyBwYXJlbnQgYXJyYXlcIiwgaywgcGFyZW50cyk7XG4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5kT2JqZWN0c09mVHlwZSA9IGZ1bmN0aW9uKGRhdGEsIHR5cGUpIHtcbiAgICB2YXIgcmVzID0gW107XG4gICAgdmFyIG9iaiA9IGtvLnV0aWxzLnVud3JhcE9ic2VydmFibGUoZGF0YSk7XG4gICAgZm9yICh2YXIgcHJvcCBpbiBvYmopXG4gICAgICBpZiAob2JqLmhhc093blByb3BlcnR5KHByb3ApKSB7XG4gICAgICAgIHZhciB2YWwgPSBrby51dGlscy51bndyYXBPYnNlcnZhYmxlKG9ialtwcm9wXSk7XG4gICAgICAgIC8vIFRPRE8gdGhpcyBpcyBub3QgdGhlIHJpZ2h0IHdheSB0byBkZWFsIHdpdGggXCJibG9jayBsaXN0XCIgb2JqZWN0cy5cbiAgICAgICAgaWYgKHByb3AubWF0Y2goL0Jsb2NrcyQvKSkge1xuICAgICAgICAgIHZhciBjb250ZW50cyA9IGtvLnV0aWxzLnVud3JhcE9ic2VydmFibGUodmFsLmJsb2Nrcyk7XG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250ZW50cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGMgPSBrby51dGlscy51bndyYXBPYnNlcnZhYmxlKGNvbnRlbnRzW2ldKTtcbiAgICAgICAgICAgIGlmICh0eXBlID09PSBudWxsIHx8IGtvLnV0aWxzLnVud3JhcE9ic2VydmFibGUoYy50eXBlKSA9PSB0eXBlKSByZXMucHVzaChjKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgLy8gVE9ETyBpbnZlc3RpZ2F0ZSB3aGljaCBjb25kaXRpb24gcHJvdmlkZSBhIG51bGwgdmFsdWUuXG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIHZhbCA9PSAnb2JqZWN0JyAmJiB2YWwgIT09IG51bGwpIHtcbiAgICAgICAgICBpZiAodHlwZSA9PT0gbnVsbCB8fCBrby51dGlscy51bndyYXBPYnNlcnZhYmxlKHZhbC50eXBlKSA9PSB0eXBlKSByZXMucH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