@wordpress/edit-site 6.33.5 → 6.34.1-next.2f1c7c01b.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1074) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +6 -4
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-post/index.js +3 -1
  5. package/build/components/add-new-post/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -1
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.js +4 -2
  9. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  10. package/build/components/add-new-template/index.js +7 -5
  11. package/build/components/add-new-template/index.js.map +1 -1
  12. package/build/components/add-new-template/utils.js +14 -12
  13. package/build/components/add-new-template/utils.js.map +1 -1
  14. package/build/components/app/index.js +4 -2
  15. package/build/components/app/index.js.map +1 -1
  16. package/build/components/block-editor/use-editor-iframe-props.js +3 -1
  17. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  18. package/build/components/block-editor/use-navigate-to-entity-record.js +3 -1
  19. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  20. package/build/components/block-editor/use-site-editor-settings.js +17 -3
  21. package/build/components/block-editor/use-site-editor-settings.js.map +3 -3
  22. package/build/components/canvas-loader/index.js +9 -10
  23. package/build/components/canvas-loader/index.js.map +3 -3
  24. package/build/components/dataviews-actions/index.js +5 -3
  25. package/build/components/dataviews-actions/index.js.map +1 -1
  26. package/build/components/editor/index.js +10 -46
  27. package/build/components/editor/index.js.map +3 -3
  28. package/build/components/editor/site-preview.js +3 -1
  29. package/build/components/editor/site-preview.js.map +1 -1
  30. package/build/components/editor/use-adapt-editor-to-canvas.js +2 -0
  31. package/build/components/editor/use-adapt-editor-to-canvas.js.map +1 -1
  32. package/build/components/editor/use-editor-title.js +3 -1
  33. package/build/components/editor/use-editor-title.js.map +1 -1
  34. package/build/components/editor/use-resolve-edited-entity.js +5 -3
  35. package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
  36. package/build/components/layout/animation.js +3 -1
  37. package/build/components/layout/animation.js.map +1 -1
  38. package/build/components/layout/hooks.js +3 -1
  39. package/build/components/layout/hooks.js.map +1 -1
  40. package/build/components/layout/index.js +10 -10
  41. package/build/components/layout/index.js.map +3 -3
  42. package/build/components/media/index.js +3 -1
  43. package/build/components/media/index.js.map +1 -1
  44. package/build/components/more-menu/index.js +4 -2
  45. package/build/components/more-menu/index.js.map +1 -1
  46. package/build/components/more-menu/site-export.js +3 -1
  47. package/build/components/more-menu/site-export.js.map +1 -1
  48. package/build/components/more-menu/welcome-guide-menu-item.js +3 -1
  49. package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -1
  50. package/build/components/page-patterns/actions.js +3 -1
  51. package/build/components/page-patterns/actions.js.map +1 -1
  52. package/build/components/page-patterns/delete-category-menu-item.js +4 -2
  53. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  54. package/build/components/page-patterns/fields.js +11 -8
  55. package/build/components/page-patterns/fields.js.map +3 -3
  56. package/build/components/page-patterns/index.js +9 -7
  57. package/build/components/page-patterns/index.js.map +1 -1
  58. package/build/components/page-patterns/rename-category-menu-item.js +4 -2
  59. package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
  60. package/build/components/page-patterns/search-items.js +10 -8
  61. package/build/components/page-patterns/search-items.js.map +1 -1
  62. package/build/components/page-patterns/use-pattern-settings.js +2 -0
  63. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  64. package/build/components/page-patterns/use-patterns.js +8 -6
  65. package/build/components/page-patterns/use-patterns.js.map +1 -1
  66. package/build/components/page-patterns/utils.js +3 -1
  67. package/build/components/page-patterns/utils.js.map +1 -1
  68. package/build/components/page-templates/fields.js +13 -11
  69. package/build/components/page-templates/fields.js.map +3 -3
  70. package/build/components/page-templates/hooks.js +2 -0
  71. package/build/components/page-templates/hooks.js.map +1 -1
  72. package/build/components/page-templates/index.js +6 -4
  73. package/build/components/page-templates/index.js.map +1 -1
  74. package/build/components/page-templates/view-utils.js +4 -2
  75. package/build/components/page-templates/view-utils.js.map +1 -1
  76. package/build/components/pagination/index.js +3 -1
  77. package/build/components/pagination/index.js.map +1 -1
  78. package/build/components/plugin-template-setting-panel/index.js +5 -3
  79. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  80. package/build/components/post-edit/index.js +5 -3
  81. package/build/components/post-edit/index.js.map +1 -1
  82. package/build/components/post-list/index.js +8 -6
  83. package/build/components/post-list/index.js.map +1 -1
  84. package/build/components/post-list/view-utils.js +5 -3
  85. package/build/components/post-list/view-utils.js.map +1 -1
  86. package/build/components/posts-app/index.js +4 -2
  87. package/build/components/posts-app/index.js.map +1 -1
  88. package/build/components/posts-app-routes/index.js +3 -1
  89. package/build/components/posts-app-routes/index.js.map +1 -1
  90. package/build/components/posts-app-routes/post-item.js +4 -2
  91. package/build/components/posts-app-routes/post-item.js.map +1 -1
  92. package/build/components/posts-app-routes/posts.js +5 -3
  93. package/build/components/posts-app-routes/posts.js.map +1 -1
  94. package/build/components/resizable-frame/index.js +10 -8
  95. package/build/components/resizable-frame/index.js.map +1 -1
  96. package/build/components/routes/use-title.js +3 -1
  97. package/build/components/routes/use-title.js.map +1 -1
  98. package/build/components/save-button/index.js +4 -2
  99. package/build/components/save-button/index.js.map +1 -1
  100. package/build/components/save-hub/index.js +3 -1
  101. package/build/components/save-hub/index.js.map +1 -1
  102. package/build/components/save-keyboard-shortcut/index.js +3 -1
  103. package/build/components/save-keyboard-shortcut/index.js.map +1 -1
  104. package/build/components/save-panel/index.js +7 -5
  105. package/build/components/save-panel/index.js.map +1 -1
  106. package/build/components/sidebar/index.js +4 -2
  107. package/build/components/sidebar/index.js.map +1 -1
  108. package/build/components/sidebar-button/index.js +3 -1
  109. package/build/components/sidebar-button/index.js.map +1 -1
  110. package/build/components/sidebar-dataviews/dataview-item.js +4 -2
  111. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  112. package/build/components/sidebar-dataviews/index.js +4 -2
  113. package/build/components/sidebar-dataviews/index.js.map +1 -1
  114. package/build/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +28 -50
  115. package/build/components/sidebar-global-styles/index.js.map +7 -0
  116. package/build/components/sidebar-navigation-item/index.js +4 -2
  117. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  118. package/build/components/sidebar-navigation-screen/index.js +4 -2
  119. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  120. package/build/components/sidebar-navigation-screen-details-footer/index.js +3 -1
  121. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  122. package/build/components/sidebar-navigation-screen-global-styles/content.js +41 -17
  123. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +3 -3
  124. package/build/components/sidebar-navigation-screen-global-styles/index.js +10 -9
  125. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +3 -3
  126. package/build/components/sidebar-navigation-screen-main/index.js +3 -10
  127. package/build/components/sidebar-navigation-screen-main/index.js.map +3 -3
  128. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +3 -1
  129. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  130. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +5 -3
  131. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  132. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +5 -3
  133. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  134. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +4 -2
  135. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  136. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +4 -2
  137. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  138. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -1
  139. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  140. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
  141. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  142. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +2 -0
  143. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  144. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
  145. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  146. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +4 -2
  147. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  148. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +5 -3
  149. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  150. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +6 -4
  151. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  152. package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -1
  153. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  154. package/build/components/sidebar-navigation-screen-patterns/index.js +4 -2
  155. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  156. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +2 -0
  157. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  158. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +2 -0
  159. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  160. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +3 -1
  161. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  162. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -0
  163. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  164. package/build/components/sidebar-navigation-screen-templates-browse/content.js +5 -3
  165. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  166. package/build/components/sidebar-navigation-screen-templates-browse/index.js +3 -1
  167. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  168. package/build/components/sidebar-navigation-screen-unsupported/index.js +3 -1
  169. package/build/components/sidebar-navigation-screen-unsupported/index.js.map +1 -1
  170. package/build/components/site-editor-routes/home.js +4 -2
  171. package/build/components/site-editor-routes/home.js.map +1 -1
  172. package/build/components/site-editor-routes/index.js +3 -1
  173. package/build/components/site-editor-routes/index.js.map +1 -1
  174. package/build/components/site-editor-routes/navigation-item.js +5 -3
  175. package/build/components/site-editor-routes/navigation-item.js.map +1 -1
  176. package/build/components/site-editor-routes/navigation.js +5 -3
  177. package/build/components/site-editor-routes/navigation.js.map +1 -1
  178. package/build/components/site-editor-routes/notfound.js +4 -2
  179. package/build/components/site-editor-routes/notfound.js.map +1 -1
  180. package/build/components/site-editor-routes/page-item.js +4 -2
  181. package/build/components/site-editor-routes/page-item.js.map +1 -1
  182. package/build/components/site-editor-routes/pages.js +5 -3
  183. package/build/components/site-editor-routes/pages.js.map +1 -1
  184. package/build/components/site-editor-routes/pattern-item.js +4 -2
  185. package/build/components/site-editor-routes/pattern-item.js.map +1 -1
  186. package/build/components/site-editor-routes/patterns.js +4 -2
  187. package/build/components/site-editor-routes/patterns.js.map +1 -1
  188. package/build/components/site-editor-routes/stylebook.js +9 -5
  189. package/build/components/site-editor-routes/stylebook.js.map +3 -3
  190. package/build/components/site-editor-routes/styles.js +37 -13
  191. package/build/components/site-editor-routes/styles.js.map +3 -3
  192. package/build/components/site-editor-routes/template-item.js +5 -3
  193. package/build/components/site-editor-routes/template-item.js.map +1 -1
  194. package/build/components/site-editor-routes/template-part-item.js +4 -2
  195. package/build/components/site-editor-routes/template-part-item.js.map +1 -1
  196. package/build/components/site-editor-routes/templates.js +4 -2
  197. package/build/components/site-editor-routes/templates.js.map +1 -1
  198. package/build/components/site-editor-routes/utils.js +2 -0
  199. package/build/components/site-editor-routes/utils.js.map +1 -1
  200. package/build/components/site-hub/index.js +6 -4
  201. package/build/components/site-hub/index.js.map +1 -1
  202. package/build/components/site-icon/index.js +3 -1
  203. package/build/components/site-icon/index.js.map +1 -1
  204. package/build/components/welcome-guide/editor.js +3 -1
  205. package/build/components/welcome-guide/editor.js.map +1 -1
  206. package/build/components/welcome-guide/image.js +2 -0
  207. package/build/components/welcome-guide/image.js.map +1 -1
  208. package/build/components/welcome-guide/index.js +3 -3
  209. package/build/components/welcome-guide/index.js.map +3 -3
  210. package/build/components/welcome-guide/page.js +3 -1
  211. package/build/components/welcome-guide/page.js.map +1 -1
  212. package/build/components/welcome-guide/template.js +3 -1
  213. package/build/components/welcome-guide/template.js.map +1 -1
  214. package/build/deprecated.js +5 -3
  215. package/build/deprecated.js.map +1 -1
  216. package/build/hooks/commands/use-common-commands.js +16 -16
  217. package/build/hooks/commands/use-common-commands.js.map +3 -3
  218. package/build/hooks/commands/use-set-command-context.js +4 -7
  219. package/build/hooks/commands/use-set-command-context.js.map +2 -2
  220. package/build/index.js +4 -3
  221. package/build/index.js.map +2 -2
  222. package/build/lock-unlock.js +3 -1
  223. package/build/lock-unlock.js.map +1 -1
  224. package/build/posts.js +3 -2
  225. package/build/posts.js.map +2 -2
  226. package/build/store/actions.js +14 -12
  227. package/build/store/actions.js.map +1 -1
  228. package/build/store/constants.js +3 -1
  229. package/build/store/constants.js.map +1 -1
  230. package/build/store/index.js +4 -2
  231. package/build/store/index.js.map +1 -1
  232. package/build/store/private-actions.js +2 -8
  233. package/build/store/private-actions.js.map +2 -2
  234. package/build/store/private-selectors.js +2 -5
  235. package/build/store/private-selectors.js.map +2 -2
  236. package/build/store/reducer.js +2 -8
  237. package/build/store/reducer.js.map +2 -2
  238. package/build/store/selectors.js +11 -9
  239. package/build/store/selectors.js.map +1 -1
  240. package/build/utils/constants.js +18 -16
  241. package/build/utils/constants.js.map +1 -1
  242. package/build/utils/get-filtered-template-parts.js +3 -1
  243. package/build/utils/get-filtered-template-parts.js.map +1 -1
  244. package/build/utils/is-previewing-theme.js +2 -0
  245. package/build/utils/is-previewing-theme.js.map +1 -1
  246. package/build/utils/is-template-removable.js +2 -0
  247. package/build/utils/is-template-removable.js.map +1 -1
  248. package/build/utils/is-template-revertable.js +2 -0
  249. package/build/utils/is-template-revertable.js.map +2 -2
  250. package/build/utils/use-activate-theme.js +3 -1
  251. package/build/utils/use-activate-theme.js.map +1 -1
  252. package/build/utils/use-actual-current-theme.js +3 -1
  253. package/build/utils/use-actual-current-theme.js.map +1 -1
  254. package/build-module/components/add-new-pattern/index.js +5 -4
  255. package/build-module/components/add-new-pattern/index.js.map +1 -1
  256. package/build-module/components/add-new-post/index.js +2 -1
  257. package/build-module/components/add-new-post/index.js.map +1 -1
  258. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +2 -1
  259. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  260. package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -2
  261. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  262. package/build-module/components/add-new-template/index.js +6 -5
  263. package/build-module/components/add-new-template/index.js.map +1 -1
  264. package/build-module/components/add-new-template/utils.js +13 -12
  265. package/build-module/components/add-new-template/utils.js.map +1 -1
  266. package/build-module/components/app/index.js +3 -2
  267. package/build-module/components/app/index.js.map +1 -1
  268. package/build-module/components/block-editor/use-editor-iframe-props.js +2 -1
  269. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  270. package/build-module/components/block-editor/use-navigate-to-entity-record.js +2 -1
  271. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  272. package/build-module/components/block-editor/use-site-editor-settings.js +16 -3
  273. package/build-module/components/block-editor/use-site-editor-settings.js.map +2 -2
  274. package/build-module/components/canvas-loader/index.js +8 -10
  275. package/build-module/components/canvas-loader/index.js.map +2 -2
  276. package/build-module/components/dataviews-actions/index.js +4 -3
  277. package/build-module/components/dataviews-actions/index.js.map +1 -1
  278. package/build-module/components/editor/index.js +11 -52
  279. package/build-module/components/editor/index.js.map +2 -2
  280. package/build-module/components/editor/site-preview.js +2 -1
  281. package/build-module/components/editor/site-preview.js.map +1 -1
  282. package/build-module/components/editor/use-adapt-editor-to-canvas.js +1 -0
  283. package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +1 -1
  284. package/build-module/components/editor/use-editor-title.js +2 -1
  285. package/build-module/components/editor/use-editor-title.js.map +1 -1
  286. package/build-module/components/editor/use-resolve-edited-entity.js +4 -3
  287. package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
  288. package/build-module/components/layout/animation.js +2 -1
  289. package/build-module/components/layout/animation.js.map +1 -1
  290. package/build-module/components/layout/hooks.js +2 -1
  291. package/build-module/components/layout/hooks.js.map +1 -1
  292. package/build-module/components/layout/index.js +9 -10
  293. package/build-module/components/layout/index.js.map +2 -2
  294. package/build-module/components/media/index.js +2 -1
  295. package/build-module/components/media/index.js.map +1 -1
  296. package/build-module/components/more-menu/index.js +3 -2
  297. package/build-module/components/more-menu/index.js.map +1 -1
  298. package/build-module/components/more-menu/site-export.js +2 -1
  299. package/build-module/components/more-menu/site-export.js.map +1 -1
  300. package/build-module/components/more-menu/welcome-guide-menu-item.js +2 -1
  301. package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -1
  302. package/build-module/components/page-patterns/actions.js +2 -1
  303. package/build-module/components/page-patterns/actions.js.map +1 -1
  304. package/build-module/components/page-patterns/delete-category-menu-item.js +3 -2
  305. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  306. package/build-module/components/page-patterns/fields.js +11 -12
  307. package/build-module/components/page-patterns/fields.js.map +2 -2
  308. package/build-module/components/page-patterns/index.js +8 -7
  309. package/build-module/components/page-patterns/index.js.map +1 -1
  310. package/build-module/components/page-patterns/rename-category-menu-item.js +3 -2
  311. package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
  312. package/build-module/components/page-patterns/search-items.js +11 -10
  313. package/build-module/components/page-patterns/search-items.js.map +1 -1
  314. package/build-module/components/page-patterns/use-pattern-settings.js +1 -0
  315. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  316. package/build-module/components/page-patterns/use-patterns.js +7 -6
  317. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  318. package/build-module/components/page-patterns/utils.js +2 -1
  319. package/build-module/components/page-patterns/utils.js.map +1 -1
  320. package/build-module/components/page-templates/fields.js +16 -15
  321. package/build-module/components/page-templates/fields.js.map +2 -2
  322. package/build-module/components/page-templates/hooks.js +1 -0
  323. package/build-module/components/page-templates/hooks.js.map +1 -1
  324. package/build-module/components/page-templates/index.js +5 -4
  325. package/build-module/components/page-templates/index.js.map +1 -1
  326. package/build-module/components/page-templates/view-utils.js +3 -2
  327. package/build-module/components/page-templates/view-utils.js.map +1 -1
  328. package/build-module/components/pagination/index.js +2 -1
  329. package/build-module/components/pagination/index.js.map +1 -1
  330. package/build-module/components/plugin-template-setting-panel/index.js +4 -3
  331. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  332. package/build-module/components/post-edit/index.js +4 -3
  333. package/build-module/components/post-edit/index.js.map +1 -1
  334. package/build-module/components/post-list/index.js +7 -6
  335. package/build-module/components/post-list/index.js.map +1 -1
  336. package/build-module/components/post-list/view-utils.js +4 -3
  337. package/build-module/components/post-list/view-utils.js.map +1 -1
  338. package/build-module/components/posts-app/index.js +3 -2
  339. package/build-module/components/posts-app/index.js.map +1 -1
  340. package/build-module/components/posts-app-routes/index.js +2 -1
  341. package/build-module/components/posts-app-routes/index.js.map +1 -1
  342. package/build-module/components/posts-app-routes/post-item.js +3 -2
  343. package/build-module/components/posts-app-routes/post-item.js.map +1 -1
  344. package/build-module/components/posts-app-routes/posts.js +4 -3
  345. package/build-module/components/posts-app-routes/posts.js.map +1 -1
  346. package/build-module/components/resizable-frame/index.js +9 -8
  347. package/build-module/components/resizable-frame/index.js.map +1 -1
  348. package/build-module/components/routes/use-title.js +2 -1
  349. package/build-module/components/routes/use-title.js.map +1 -1
  350. package/build-module/components/save-button/index.js +3 -2
  351. package/build-module/components/save-button/index.js.map +1 -1
  352. package/build-module/components/save-hub/index.js +2 -1
  353. package/build-module/components/save-hub/index.js.map +1 -1
  354. package/build-module/components/save-keyboard-shortcut/index.js +2 -1
  355. package/build-module/components/save-keyboard-shortcut/index.js.map +1 -1
  356. package/build-module/components/save-panel/index.js +6 -5
  357. package/build-module/components/save-panel/index.js.map +1 -1
  358. package/build-module/components/sidebar/index.js +3 -2
  359. package/build-module/components/sidebar/index.js.map +1 -1
  360. package/build-module/components/sidebar-button/index.js +2 -1
  361. package/build-module/components/sidebar-button/index.js.map +1 -1
  362. package/build-module/components/sidebar-dataviews/dataview-item.js +3 -2
  363. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  364. package/build-module/components/sidebar-dataviews/index.js +3 -2
  365. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  366. package/build-module/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +26 -45
  367. package/build-module/components/sidebar-global-styles/index.js.map +7 -0
  368. package/build-module/components/sidebar-navigation-item/index.js +3 -2
  369. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  370. package/build-module/components/sidebar-navigation-screen/index.js +3 -2
  371. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  372. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +2 -1
  373. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  374. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +44 -7
  375. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +2 -2
  376. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +8 -8
  377. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +2 -2
  378. package/build-module/components/sidebar-navigation-screen-main/index.js +3 -11
  379. package/build-module/components/sidebar-navigation-screen-main/index.js.map +2 -2
  380. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +2 -1
  381. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  382. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +4 -3
  383. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  384. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +4 -3
  385. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  386. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +3 -2
  387. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
  388. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -2
  389. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
  390. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +2 -1
  391. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  392. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -1
  393. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  394. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +1 -0
  395. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
  396. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -1
  397. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  398. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
  399. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  400. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +5 -4
  401. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  402. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +5 -4
  403. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  404. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
  405. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  406. package/build-module/components/sidebar-navigation-screen-patterns/index.js +3 -2
  407. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  408. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +1 -0
  409. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
  410. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -0
  411. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  412. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +2 -1
  413. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  414. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -0
  415. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  416. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +4 -3
  417. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  418. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +2 -1
  419. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  420. package/build-module/components/sidebar-navigation-screen-unsupported/index.js +2 -1
  421. package/build-module/components/sidebar-navigation-screen-unsupported/index.js.map +1 -1
  422. package/build-module/components/site-editor-routes/home.js +3 -2
  423. package/build-module/components/site-editor-routes/home.js.map +1 -1
  424. package/build-module/components/site-editor-routes/index.js +2 -1
  425. package/build-module/components/site-editor-routes/index.js.map +1 -1
  426. package/build-module/components/site-editor-routes/navigation-item.js +4 -3
  427. package/build-module/components/site-editor-routes/navigation-item.js.map +1 -1
  428. package/build-module/components/site-editor-routes/navigation.js +4 -3
  429. package/build-module/components/site-editor-routes/navigation.js.map +1 -1
  430. package/build-module/components/site-editor-routes/notfound.js +3 -2
  431. package/build-module/components/site-editor-routes/notfound.js.map +1 -1
  432. package/build-module/components/site-editor-routes/page-item.js +3 -2
  433. package/build-module/components/site-editor-routes/page-item.js.map +1 -1
  434. package/build-module/components/site-editor-routes/pages.js +4 -3
  435. package/build-module/components/site-editor-routes/pages.js.map +1 -1
  436. package/build-module/components/site-editor-routes/pattern-item.js +3 -2
  437. package/build-module/components/site-editor-routes/pattern-item.js.map +1 -1
  438. package/build-module/components/site-editor-routes/patterns.js +3 -2
  439. package/build-module/components/site-editor-routes/patterns.js.map +1 -1
  440. package/build-module/components/site-editor-routes/stylebook.js +6 -3
  441. package/build-module/components/site-editor-routes/stylebook.js.map +2 -2
  442. package/build-module/components/site-editor-routes/styles.js +34 -11
  443. package/build-module/components/site-editor-routes/styles.js.map +2 -2
  444. package/build-module/components/site-editor-routes/template-item.js +4 -3
  445. package/build-module/components/site-editor-routes/template-item.js.map +1 -1
  446. package/build-module/components/site-editor-routes/template-part-item.js +3 -2
  447. package/build-module/components/site-editor-routes/template-part-item.js.map +1 -1
  448. package/build-module/components/site-editor-routes/templates.js +3 -2
  449. package/build-module/components/site-editor-routes/templates.js.map +1 -1
  450. package/build-module/components/site-editor-routes/utils.js +1 -0
  451. package/build-module/components/site-editor-routes/utils.js.map +1 -1
  452. package/build-module/components/site-hub/index.js +5 -4
  453. package/build-module/components/site-hub/index.js.map +1 -1
  454. package/build-module/components/site-icon/index.js +2 -1
  455. package/build-module/components/site-icon/index.js.map +1 -1
  456. package/build-module/components/welcome-guide/editor.js +2 -1
  457. package/build-module/components/welcome-guide/editor.js.map +1 -1
  458. package/build-module/components/welcome-guide/image.js +1 -0
  459. package/build-module/components/welcome-guide/image.js.map +1 -1
  460. package/build-module/components/welcome-guide/index.js +2 -3
  461. package/build-module/components/welcome-guide/index.js.map +2 -2
  462. package/build-module/components/welcome-guide/page.js +2 -1
  463. package/build-module/components/welcome-guide/page.js.map +1 -1
  464. package/build-module/components/welcome-guide/template.js +2 -1
  465. package/build-module/components/welcome-guide/template.js.map +1 -1
  466. package/build-module/deprecated.js +4 -3
  467. package/build-module/deprecated.js.map +1 -1
  468. package/build-module/hooks/commands/use-common-commands.js +18 -16
  469. package/build-module/hooks/commands/use-common-commands.js.map +2 -2
  470. package/build-module/hooks/commands/use-set-command-context.js +3 -7
  471. package/build-module/hooks/commands/use-set-command-context.js.map +2 -2
  472. package/build-module/index.js +7 -7
  473. package/build-module/index.js.map +2 -2
  474. package/build-module/lock-unlock.js +2 -1
  475. package/build-module/lock-unlock.js.map +1 -1
  476. package/build-module/posts.js +2 -2
  477. package/build-module/posts.js.map +2 -2
  478. package/build-module/store/actions.js +13 -12
  479. package/build-module/store/actions.js.map +1 -1
  480. package/build-module/store/constants.js +2 -1
  481. package/build-module/store/constants.js.map +1 -1
  482. package/build-module/store/index.js +3 -2
  483. package/build-module/store/index.js.map +1 -1
  484. package/build-module/store/private-actions.js +1 -7
  485. package/build-module/store/private-actions.js.map +2 -2
  486. package/build-module/store/private-selectors.js +1 -4
  487. package/build-module/store/private-selectors.js.map +2 -2
  488. package/build-module/store/reducer.js +1 -8
  489. package/build-module/store/reducer.js.map +2 -2
  490. package/build-module/store/selectors.js +10 -9
  491. package/build-module/store/selectors.js.map +1 -1
  492. package/build-module/utils/constants.js +17 -16
  493. package/build-module/utils/constants.js.map +1 -1
  494. package/build-module/utils/get-filtered-template-parts.js +2 -1
  495. package/build-module/utils/get-filtered-template-parts.js.map +1 -1
  496. package/build-module/utils/is-previewing-theme.js +1 -0
  497. package/build-module/utils/is-previewing-theme.js.map +1 -1
  498. package/build-module/utils/is-template-removable.js +1 -0
  499. package/build-module/utils/is-template-removable.js.map +1 -1
  500. package/build-module/utils/is-template-revertable.js +1 -0
  501. package/build-module/utils/is-template-revertable.js.map +2 -2
  502. package/build-module/utils/use-activate-theme.js +2 -1
  503. package/build-module/utils/use-activate-theme.js.map +1 -1
  504. package/build-module/utils/use-actual-current-theme.js +2 -1
  505. package/build-module/utils/use-actual-current-theme.js.map +1 -1
  506. package/build-style/posts-rtl.css +13 -50
  507. package/build-style/posts.css +13 -50
  508. package/build-style/style-rtl.css +722 -726
  509. package/build-style/style.css +722 -726
  510. package/package.json +49 -44
  511. package/src/components/block-editor/use-site-editor-settings.js +21 -2
  512. package/src/components/canvas-loader/index.js +5 -9
  513. package/src/components/editor/index.js +2 -50
  514. package/src/components/layout/index.js +6 -10
  515. package/src/components/page-patterns/fields.js +5 -7
  516. package/src/components/page-templates/fields.js +6 -6
  517. package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +16 -48
  518. package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/style.scss +3 -3
  519. package/src/components/sidebar-navigation-screen/style.scss +5 -12
  520. package/src/components/sidebar-navigation-screen-global-styles/content.js +34 -6
  521. package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -9
  522. package/src/components/sidebar-navigation-screen-main/index.js +1 -12
  523. package/src/components/sidebar-navigation-screen-patterns/style.scss +1 -1
  524. package/src/components/site-editor-routes/stylebook.js +4 -1
  525. package/src/components/site-editor-routes/styles.js +35 -9
  526. package/src/components/site-hub/style.scss +1 -1
  527. package/src/components/welcome-guide/index.js +0 -2
  528. package/src/components/welcome-guide/style.scss +1 -2
  529. package/src/hooks/commands/use-common-commands.js +19 -12
  530. package/src/hooks/commands/use-set-command-context.js +0 -11
  531. package/src/index.js +0 -1
  532. package/src/posts.js +0 -1
  533. package/src/posts.scss +0 -1
  534. package/src/store/private-actions.js +0 -14
  535. package/src/store/private-selectors.js +0 -11
  536. package/src/store/reducer.js +0 -18
  537. package/src/style.scss +2 -9
  538. package/src/utils/is-template-revertable.js +1 -2
  539. package/tsconfig.json +3 -11
  540. package/build/components/editor-canvas-container/index.js +0 -139
  541. package/build/components/editor-canvas-container/index.js.map +0 -7
  542. package/build/components/global-styles/background-panel.js +0 -62
  543. package/build/components/global-styles/background-panel.js.map +0 -7
  544. package/build/components/global-styles/block-preview-panel.js +0 -87
  545. package/build/components/global-styles/block-preview-panel.js.map +0 -7
  546. package/build/components/global-styles/color-indicator-wrapper.js +0 -50
  547. package/build/components/global-styles/color-indicator-wrapper.js.map +0 -7
  548. package/build/components/global-styles/color-palette-panel.js +0 -133
  549. package/build/components/global-styles/color-palette-panel.js.map +0 -7
  550. package/build/components/global-styles/confirm-reset-shadow-dialog.js +0 -55
  551. package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
  552. package/build/components/global-styles/dimensions-panel.js +0 -92
  553. package/build/components/global-styles/dimensions-panel.js.map +0 -7
  554. package/build/components/global-styles/font-families.js +0 -114
  555. package/build/components/global-styles/font-families.js.map +0 -7
  556. package/build/components/global-styles/font-family-item.js +0 -48
  557. package/build/components/global-styles/font-family-item.js.map +0 -7
  558. package/build/components/global-styles/font-library-modal/collection-font-variant.js +0 -75
  559. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
  560. package/build/components/global-styles/font-library-modal/context.js +0 -386
  561. package/build/components/global-styles/font-library-modal/context.js.map +0 -7
  562. package/build/components/global-styles/font-library-modal/font-card.js +0 -76
  563. package/build/components/global-styles/font-library-modal/font-card.js.map +0 -7
  564. package/build/components/global-styles/font-library-modal/font-collection.js +0 -504
  565. package/build/components/global-styles/font-library-modal/font-collection.js.map +0 -7
  566. package/build/components/global-styles/font-library-modal/font-demo.js +0 -108
  567. package/build/components/global-styles/font-library-modal/font-demo.js.map +0 -7
  568. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -58
  569. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
  570. package/build/components/global-styles/font-library-modal/index.js +0 -110
  571. package/build/components/global-styles/font-library-modal/index.js.map +0 -7
  572. package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -455
  573. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
  574. package/build/components/global-styles/font-library-modal/library-font-details.js +0 -63
  575. package/build/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
  576. package/build/components/global-styles/font-library-modal/library-font-variant.js +0 -78
  577. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
  578. package/build/components/global-styles/font-library-modal/resolvers.js +0 -115
  579. package/build/components/global-styles/font-library-modal/resolvers.js.map +0 -7
  580. package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -205
  581. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
  582. package/build/components/global-styles/font-library-modal/utils/constants.js +0 -49
  583. package/build/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
  584. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -39
  585. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
  586. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -51
  587. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
  588. package/build/components/global-styles/font-library-modal/utils/index.js +0 -277
  589. package/build/components/global-styles/font-library-modal/utils/index.js.map +0 -7
  590. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -42
  591. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
  592. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +0 -117
  593. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
  594. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -56
  595. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
  596. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +0 -63
  597. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
  598. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -60
  599. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
  600. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -55
  601. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
  602. package/build/components/global-styles/font-sizes/font-size-preview.js +0 -51
  603. package/build/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
  604. package/build/components/global-styles/font-sizes/font-size.js +0 -260
  605. package/build/components/global-styles/font-sizes/font-size.js.map +0 -7
  606. package/build/components/global-styles/font-sizes/font-sizes-count.js +0 -50
  607. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
  608. package/build/components/global-styles/font-sizes/font-sizes.js +0 -220
  609. package/build/components/global-styles/font-sizes/font-sizes.js.map +0 -7
  610. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -90
  611. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
  612. package/build/components/global-styles/gradients-palette-panel.js +0 -144
  613. package/build/components/global-styles/gradients-palette-panel.js.map +0 -7
  614. package/build/components/global-styles/header.js +0 -54
  615. package/build/components/global-styles/header.js.map +0 -7
  616. package/build/components/global-styles/highlighted-colors.js +0 -57
  617. package/build/components/global-styles/highlighted-colors.js.map +0 -7
  618. package/build/components/global-styles/hooks.js +0 -113
  619. package/build/components/global-styles/hooks.js.map +0 -7
  620. package/build/components/global-styles/icon-with-current-color.js +0 -53
  621. package/build/components/global-styles/icon-with-current-color.js.map +0 -7
  622. package/build/components/global-styles/index.js +0 -39
  623. package/build/components/global-styles/index.js.map +0 -7
  624. package/build/components/global-styles/navigation-button.js +0 -48
  625. package/build/components/global-styles/navigation-button.js.map +0 -7
  626. package/build/components/global-styles/palette.js +0 -86
  627. package/build/components/global-styles/palette.js.map +0 -7
  628. package/build/components/global-styles/preset-colors.js +0 -40
  629. package/build/components/global-styles/preset-colors.js.map +0 -7
  630. package/build/components/global-styles/preview-colors.js +0 -82
  631. package/build/components/global-styles/preview-colors.js.map +0 -7
  632. package/build/components/global-styles/preview-styles.js +0 -214
  633. package/build/components/global-styles/preview-styles.js.map +0 -7
  634. package/build/components/global-styles/preview-typography.js +0 -68
  635. package/build/components/global-styles/preview-typography.js.map +0 -7
  636. package/build/components/global-styles/preview-wrapper.js +0 -101
  637. package/build/components/global-styles/preview-wrapper.js.map +0 -7
  638. package/build/components/global-styles/root-menu.js +0 -72
  639. package/build/components/global-styles/root-menu.js.map +0 -7
  640. package/build/components/global-styles/screen-background.js +0 -59
  641. package/build/components/global-styles/screen-background.js.map +0 -7
  642. package/build/components/global-styles/screen-block-list.js +0 -170
  643. package/build/components/global-styles/screen-block-list.js.map +0 -7
  644. package/build/components/global-styles/screen-block.js +0 -316
  645. package/build/components/global-styles/screen-block.js.map +0 -7
  646. package/build/components/global-styles/screen-color-palette.js +0 -64
  647. package/build/components/global-styles/screen-color-palette.js.map +0 -7
  648. package/build/components/global-styles/screen-colors.js +0 -81
  649. package/build/components/global-styles/screen-colors.js.map +0 -7
  650. package/build/components/global-styles/screen-css.js +0 -92
  651. package/build/components/global-styles/screen-css.js.map +0 -7
  652. package/build/components/global-styles/screen-layout.js +0 -51
  653. package/build/components/global-styles/screen-layout.js.map +0 -7
  654. package/build/components/global-styles/screen-revisions/index.js +0 -179
  655. package/build/components/global-styles/screen-revisions/index.js.map +0 -7
  656. package/build/components/global-styles/screen-revisions/revisions-buttons.js +0 -192
  657. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
  658. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -148
  659. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
  660. package/build/components/global-styles/screen-root.js +0 -99
  661. package/build/components/global-styles/screen-root.js.map +0 -7
  662. package/build/components/global-styles/screen-shadows.js +0 -49
  663. package/build/components/global-styles/screen-shadows.js.map +0 -7
  664. package/build/components/global-styles/screen-style-variations.js +0 -70
  665. package/build/components/global-styles/screen-style-variations.js.map +0 -7
  666. package/build/components/global-styles/screen-typography-element.js +0 -167
  667. package/build/components/global-styles/screen-typography-element.js.map +0 -7
  668. package/build/components/global-styles/screen-typography.js +0 -68
  669. package/build/components/global-styles/screen-typography.js.map +0 -7
  670. package/build/components/global-styles/shadow-utils.js +0 -125
  671. package/build/components/global-styles/shadow-utils.js.map +0 -7
  672. package/build/components/global-styles/shadows-edit-panel.js +0 -501
  673. package/build/components/global-styles/shadows-edit-panel.js.map +0 -7
  674. package/build/components/global-styles/shadows-panel.js +0 -206
  675. package/build/components/global-styles/shadows-panel.js.map +0 -7
  676. package/build/components/global-styles/size-control/index.js +0 -80
  677. package/build/components/global-styles/size-control/index.js.map +0 -7
  678. package/build/components/global-styles/style-variations-container.js +0 -124
  679. package/build/components/global-styles/style-variations-container.js.map +0 -7
  680. package/build/components/global-styles/subtitle.js +0 -37
  681. package/build/components/global-styles/subtitle.js.map +0 -7
  682. package/build/components/global-styles/typeset.js +0 -78
  683. package/build/components/global-styles/typeset.js.map +0 -7
  684. package/build/components/global-styles/typography-elements.js +0 -123
  685. package/build/components/global-styles/typography-elements.js.map +0 -7
  686. package/build/components/global-styles/typography-example.js +0 -81
  687. package/build/components/global-styles/typography-example.js.map +0 -7
  688. package/build/components/global-styles/typography-panel.js +0 -69
  689. package/build/components/global-styles/typography-panel.js.map +0 -7
  690. package/build/components/global-styles/typography-preview.js +0 -80
  691. package/build/components/global-styles/typography-preview.js.map +0 -7
  692. package/build/components/global-styles/ui.js +0 -355
  693. package/build/components/global-styles/ui.js.map +0 -7
  694. package/build/components/global-styles/utils.js +0 -92
  695. package/build/components/global-styles/utils.js.map +0 -7
  696. package/build/components/global-styles/variations/variation.js +0 -118
  697. package/build/components/global-styles/variations/variation.js.map +0 -7
  698. package/build/components/global-styles/variations/variations-color.js +0 -61
  699. package/build/components/global-styles/variations/variations-color.js.map +0 -7
  700. package/build/components/global-styles/variations/variations-panel.js +0 -71
  701. package/build/components/global-styles/variations/variations-panel.js.map +0 -7
  702. package/build/components/global-styles/variations/variations-typography.js +0 -75
  703. package/build/components/global-styles/variations/variations-typography.js.map +0 -7
  704. package/build/components/global-styles-renderer/index.js +0 -57
  705. package/build/components/global-styles-renderer/index.js.map +0 -7
  706. package/build/components/global-styles-sidebar/default-sidebar.js +0 -68
  707. package/build/components/global-styles-sidebar/default-sidebar.js.map +0 -7
  708. package/build/components/global-styles-sidebar/index.js +0 -202
  709. package/build/components/global-styles-sidebar/index.js.map +0 -7
  710. package/build/components/revisions/index.js +0 -120
  711. package/build/components/revisions/index.js.map +0 -7
  712. package/build/components/sidebar-global-styles-wrapper/index.js.map +0 -7
  713. package/build/components/style-book/categories.js +0 -86
  714. package/build/components/style-book/categories.js.map +0 -7
  715. package/build/components/style-book/color-examples.js +0 -65
  716. package/build/components/style-book/color-examples.js.map +0 -7
  717. package/build/components/style-book/constants.js +0 -319
  718. package/build/components/style-book/constants.js.map +0 -7
  719. package/build/components/style-book/duotone-examples.js +0 -69
  720. package/build/components/style-book/duotone-examples.js.map +0 -7
  721. package/build/components/style-book/examples.js +0 -237
  722. package/build/components/style-book/examples.js.map +0 -7
  723. package/build/components/style-book/index.js +0 -644
  724. package/build/components/style-book/index.js.map +0 -7
  725. package/build/components/style-book/types.js +0 -17
  726. package/build/components/style-book/types.js.map +0 -7
  727. package/build/components/welcome-guide/styles.js +0 -145
  728. package/build/components/welcome-guide/styles.js.map +0 -7
  729. package/build/hooks/index.js +0 -3
  730. package/build/hooks/index.js.map +0 -7
  731. package/build/hooks/push-changes-to-global-styles/index.js +0 -319
  732. package/build/hooks/push-changes-to-global-styles/index.js.map +0 -7
  733. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -126
  734. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
  735. package/build/utils/set-nested-value.js +0 -43
  736. package/build/utils/set-nested-value.js.map +0 -7
  737. package/build-module/components/editor-canvas-container/index.js +0 -120
  738. package/build-module/components/editor-canvas-container/index.js.map +0 -7
  739. package/build-module/components/global-styles/background-panel.js +0 -38
  740. package/build-module/components/global-styles/background-panel.js.map +0 -7
  741. package/build-module/components/global-styles/block-preview-panel.js +0 -67
  742. package/build-module/components/global-styles/block-preview-panel.js.map +0 -7
  743. package/build-module/components/global-styles/color-indicator-wrapper.js +0 -20
  744. package/build-module/components/global-styles/color-indicator-wrapper.js.map +0 -7
  745. package/build-module/components/global-styles/color-palette-panel.js +0 -107
  746. package/build-module/components/global-styles/color-palette-panel.js.map +0 -7
  747. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +0 -35
  748. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
  749. package/build-module/components/global-styles/dimensions-panel.js +0 -72
  750. package/build-module/components/global-styles/dimensions-panel.js.map +0 -7
  751. package/build-module/components/global-styles/font-families.js +0 -92
  752. package/build-module/components/global-styles/font-families.js.map +0 -7
  753. package/build-module/components/global-styles/font-family-item.js +0 -32
  754. package/build-module/components/global-styles/font-family-item.js.map +0 -7
  755. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +0 -45
  756. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
  757. package/build-module/components/global-styles/font-library-modal/context.js +0 -372
  758. package/build-module/components/global-styles/font-library-modal/context.js.map +0 -7
  759. package/build-module/components/global-styles/font-library-modal/font-card.js +0 -53
  760. package/build-module/components/global-styles/font-library-modal/font-card.js.map +0 -7
  761. package/build-module/components/global-styles/font-library-modal/font-collection.js +0 -505
  762. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +0 -7
  763. package/build-module/components/global-styles/font-library-modal/font-demo.js +0 -91
  764. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +0 -7
  765. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -45
  766. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
  767. package/build-module/components/global-styles/font-library-modal/index.js +0 -83
  768. package/build-module/components/global-styles/font-library-modal/index.js.map +0 -7
  769. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -444
  770. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
  771. package/build-module/components/global-styles/font-library-modal/library-font-details.js +0 -36
  772. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
  773. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +0 -48
  774. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
  775. package/build-module/components/global-styles/font-library-modal/resolvers.js +0 -76
  776. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +0 -7
  777. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -185
  778. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
  779. package/build-module/components/global-styles/font-library-modal/utils/constants.js +0 -23
  780. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
  781. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -19
  782. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
  783. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -26
  784. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
  785. package/build-module/components/global-styles/font-library-modal/utils/index.js +0 -241
  786. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +0 -7
  787. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -22
  788. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
  789. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +0 -90
  790. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
  791. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -32
  792. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
  793. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +0 -39
  794. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
  795. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -40
  796. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
  797. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -35
  798. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
  799. package/build-module/components/global-styles/font-sizes/font-size-preview.js +0 -34
  800. package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
  801. package/build-module/components/global-styles/font-sizes/font-size.js +0 -240
  802. package/build-module/components/global-styles/font-sizes/font-size.js.map +0 -7
  803. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +0 -25
  804. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
  805. package/build-module/components/global-styles/font-sizes/font-sizes.js +0 -205
  806. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +0 -7
  807. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -76
  808. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
  809. package/build-module/components/global-styles/gradients-palette-panel.js +0 -119
  810. package/build-module/components/global-styles/gradients-palette-panel.js.map +0 -7
  811. package/build-module/components/global-styles/header.js +0 -41
  812. package/build-module/components/global-styles/header.js.map +0 -7
  813. package/build-module/components/global-styles/highlighted-colors.js +0 -37
  814. package/build-module/components/global-styles/highlighted-colors.js.map +0 -7
  815. package/build-module/components/global-styles/hooks.js +0 -77
  816. package/build-module/components/global-styles/hooks.js.map +0 -7
  817. package/build-module/components/global-styles/icon-with-current-color.js +0 -19
  818. package/build-module/components/global-styles/icon-with-current-color.js.map +0 -7
  819. package/build-module/components/global-styles/index.js +0 -5
  820. package/build-module/components/global-styles/index.js.map +0 -7
  821. package/build-module/components/global-styles/navigation-button.js +0 -28
  822. package/build-module/components/global-styles/navigation-button.js.map +0 -7
  823. package/build-module/components/global-styles/palette.js +0 -63
  824. package/build-module/components/global-styles/palette.js.map +0 -7
  825. package/build-module/components/global-styles/preset-colors.js +0 -20
  826. package/build-module/components/global-styles/preset-colors.js.map +0 -7
  827. package/build-module/components/global-styles/preview-colors.js +0 -55
  828. package/build-module/components/global-styles/preview-colors.js.map +0 -7
  829. package/build-module/components/global-styles/preview-styles.js +0 -188
  830. package/build-module/components/global-styles/preview-styles.js.map +0 -7
  831. package/build-module/components/global-styles/preview-typography.js +0 -38
  832. package/build-module/components/global-styles/preview-typography.js.map +0 -7
  833. package/build-module/components/global-styles/preview-wrapper.js +0 -85
  834. package/build-module/components/global-styles/preview-wrapper.js.map +0 -7
  835. package/build-module/components/global-styles/root-menu.js +0 -58
  836. package/build-module/components/global-styles/root-menu.js.map +0 -7
  837. package/build-module/components/global-styles/screen-background.js +0 -29
  838. package/build-module/components/global-styles/screen-background.js.map +0 -7
  839. package/build-module/components/global-styles/screen-block-list.js +0 -150
  840. package/build-module/components/global-styles/screen-block-list.js.map +0 -7
  841. package/build-module/components/global-styles/screen-block.js +0 -293
  842. package/build-module/components/global-styles/screen-block.js.map +0 -7
  843. package/build-module/components/global-styles/screen-color-palette.js +0 -34
  844. package/build-module/components/global-styles/screen-color-palette.js.map +0 -7
  845. package/build-module/components/global-styles/screen-colors.js +0 -51
  846. package/build-module/components/global-styles/screen-colors.js.map +0 -7
  847. package/build-module/components/global-styles/screen-css.js +0 -62
  848. package/build-module/components/global-styles/screen-css.js.map +0 -7
  849. package/build-module/components/global-styles/screen-layout.js +0 -21
  850. package/build-module/components/global-styles/screen-layout.js.map +0 -7
  851. package/build-module/components/global-styles/screen-revisions/index.js +0 -155
  852. package/build-module/components/global-styles/screen-revisions/index.js.map +0 -7
  853. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +0 -172
  854. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
  855. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -128
  856. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
  857. package/build-module/components/global-styles/screen-root.js +0 -79
  858. package/build-module/components/global-styles/screen-root.js.map +0 -7
  859. package/build-module/components/global-styles/screen-shadows.js +0 -14
  860. package/build-module/components/global-styles/screen-shadows.js.map +0 -7
  861. package/build-module/components/global-styles/screen-style-variations.js +0 -43
  862. package/build-module/components/global-styles/screen-style-variations.js.map +0 -7
  863. package/build-module/components/global-styles/screen-typography-element.js +0 -141
  864. package/build-module/components/global-styles/screen-typography-element.js.map +0 -7
  865. package/build-module/components/global-styles/screen-typography.js +0 -38
  866. package/build-module/components/global-styles/screen-typography.js.map +0 -7
  867. package/build-module/components/global-styles/shadow-utils.js +0 -98
  868. package/build-module/components/global-styles/shadow-utils.js.map +0 -7
  869. package/build-module/components/global-styles/shadows-edit-panel.js +0 -500
  870. package/build-module/components/global-styles/shadows-edit-panel.js.map +0 -7
  871. package/build-module/components/global-styles/shadows-panel.js +0 -185
  872. package/build-module/components/global-styles/shadows-panel.js.map +0 -7
  873. package/build-module/components/global-styles/size-control/index.js +0 -70
  874. package/build-module/components/global-styles/size-control/index.js.map +0 -7
  875. package/build-module/components/global-styles/style-variations-container.js +0 -94
  876. package/build-module/components/global-styles/style-variations-container.js.map +0 -7
  877. package/build-module/components/global-styles/subtitle.js +0 -17
  878. package/build-module/components/global-styles/subtitle.js.map +0 -7
  879. package/build-module/components/global-styles/typeset.js +0 -54
  880. package/build-module/components/global-styles/typeset.js.map +0 -7
  881. package/build-module/components/global-styles/typography-elements.js +0 -98
  882. package/build-module/components/global-styles/typography-elements.js.map +0 -7
  883. package/build-module/components/global-styles/typography-example.js +0 -61
  884. package/build-module/components/global-styles/typography-example.js.map +0 -7
  885. package/build-module/components/global-styles/typography-panel.js +0 -49
  886. package/build-module/components/global-styles/typography-panel.js.map +0 -7
  887. package/build-module/components/global-styles/typography-preview.js +0 -60
  888. package/build-module/components/global-styles/typography-preview.js.map +0 -7
  889. package/build-module/components/global-styles/ui.js +0 -334
  890. package/build-module/components/global-styles/ui.js.map +0 -7
  891. package/build-module/components/global-styles/utils.js +0 -66
  892. package/build-module/components/global-styles/utils.js.map +0 -7
  893. package/build-module/components/global-styles/variations/variation.js +0 -88
  894. package/build-module/components/global-styles/variations/variation.js.map +0 -7
  895. package/build-module/components/global-styles/variations/variations-color.js +0 -34
  896. package/build-module/components/global-styles/variations/variations-color.js.map +0 -7
  897. package/build-module/components/global-styles/variations/variations-panel.js +0 -46
  898. package/build-module/components/global-styles/variations/variations-panel.js.map +0 -7
  899. package/build-module/components/global-styles/variations/variations-typography.js +0 -48
  900. package/build-module/components/global-styles/variations/variations-typography.js.map +0 -7
  901. package/build-module/components/global-styles-renderer/index.js +0 -33
  902. package/build-module/components/global-styles-renderer/index.js.map +0 -7
  903. package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -48
  904. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +0 -7
  905. package/build-module/components/global-styles-sidebar/index.js +0 -175
  906. package/build-module/components/global-styles-sidebar/index.js.map +0 -7
  907. package/build-module/components/revisions/index.js +0 -96
  908. package/build-module/components/revisions/index.js.map +0 -7
  909. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +0 -7
  910. package/build-module/components/style-book/categories.js +0 -64
  911. package/build-module/components/style-book/categories.js.map +0 -7
  912. package/build-module/components/style-book/color-examples.js +0 -38
  913. package/build-module/components/style-book/color-examples.js.map +0 -7
  914. package/build-module/components/style-book/constants.js +0 -290
  915. package/build-module/components/style-book/constants.js.map +0 -7
  916. package/build-module/components/style-book/duotone-examples.js +0 -49
  917. package/build-module/components/style-book/duotone-examples.js.map +0 -7
  918. package/build-module/components/style-book/examples.js +0 -208
  919. package/build-module/components/style-book/examples.js.map +0 -7
  920. package/build-module/components/style-book/index.js +0 -635
  921. package/build-module/components/style-book/index.js.map +0 -7
  922. package/build-module/components/style-book/types.js +0 -1
  923. package/build-module/components/style-book/types.js.map +0 -7
  924. package/build-module/components/welcome-guide/styles.js +0 -115
  925. package/build-module/components/welcome-guide/styles.js.map +0 -7
  926. package/build-module/hooks/index.js +0 -2
  927. package/build-module/hooks/index.js.map +0 -7
  928. package/build-module/hooks/push-changes-to-global-styles/index.js +0 -305
  929. package/build-module/hooks/push-changes-to-global-styles/index.js.map +0 -7
  930. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -99
  931. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
  932. package/build-module/utils/set-nested-value.js +0 -23
  933. package/build-module/utils/set-nested-value.js.map +0 -7
  934. package/build-types/components/style-book/categories.d.ts +0 -18
  935. package/build-types/components/style-book/categories.d.ts.map +0 -1
  936. package/build-types/components/style-book/color-examples.d.ts +0 -7
  937. package/build-types/components/style-book/color-examples.d.ts.map +0 -1
  938. package/build-types/components/style-book/constants.d.ts +0 -11
  939. package/build-types/components/style-book/constants.d.ts.map +0 -1
  940. package/build-types/components/style-book/duotone-examples.d.ts +0 -9
  941. package/build-types/components/style-book/duotone-examples.d.ts.map +0 -1
  942. package/build-types/components/style-book/examples.d.ts +0 -12
  943. package/build-types/components/style-book/examples.d.ts.map +0 -1
  944. package/build-types/components/style-book/types.d.ts +0 -72
  945. package/build-types/components/style-book/types.d.ts.map +0 -1
  946. package/lib/inflate.js +0 -3333
  947. package/lib/lib-font.browser.js +0 -3861
  948. package/lib/unbrotli.js +0 -2039
  949. package/src/components/editor-canvas-container/index.js +0 -149
  950. package/src/components/editor-canvas-container/style.scss +0 -43
  951. package/src/components/global-styles/README.md +0 -17
  952. package/src/components/global-styles/background-panel.js +0 -55
  953. package/src/components/global-styles/block-preview-panel.js +0 -81
  954. package/src/components/global-styles/color-indicator-wrapper.js +0 -23
  955. package/src/components/global-styles/color-palette-panel.js +0 -110
  956. package/src/components/global-styles/confirm-reset-shadow-dialog.js +0 -37
  957. package/src/components/global-styles/dimensions-panel.js +0 -86
  958. package/src/components/global-styles/font-families.js +0 -128
  959. package/src/components/global-styles/font-family-item.js +0 -47
  960. package/src/components/global-styles/font-library-modal/collection-font-variant.js +0 -51
  961. package/src/components/global-styles/font-library-modal/context.js +0 -540
  962. package/src/components/global-styles/font-library-modal/font-card.js +0 -67
  963. package/src/components/global-styles/font-library-modal/font-collection.js +0 -575
  964. package/src/components/global-styles/font-library-modal/font-demo.js +0 -116
  965. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -57
  966. package/src/components/global-styles/font-library-modal/index.js +0 -106
  967. package/src/components/global-styles/font-library-modal/installed-fonts.js +0 -518
  968. package/src/components/global-styles/font-library-modal/library-font-details.js +0 -45
  969. package/src/components/global-styles/font-library-modal/library-font-variant.js +0 -60
  970. package/src/components/global-styles/font-library-modal/resolvers.js +0 -78
  971. package/src/components/global-styles/font-library-modal/style.scss +0 -220
  972. package/src/components/global-styles/font-library-modal/upload-fonts.js +0 -253
  973. package/src/components/global-styles/font-library-modal/utils/constants.js +0 -23
  974. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -35
  975. package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -22
  976. package/src/components/global-styles/font-library-modal/utils/index.js +0 -333
  977. package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -27
  978. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +0 -152
  979. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -37
  980. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +0 -99
  981. package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +0 -109
  982. package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +0 -42
  983. package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +0 -30
  984. package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +0 -31
  985. package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +0 -57
  986. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +0 -56
  987. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +0 -108
  988. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +0 -216
  989. package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +0 -41
  990. package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +0 -74
  991. package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +0 -141
  992. package/src/components/global-styles/font-library-modal/utils/toggleFont.js +0 -90
  993. package/src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -43
  994. package/src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -37
  995. package/src/components/global-styles/font-sizes/font-size-preview.js +0 -43
  996. package/src/components/global-styles/font-sizes/font-size.js +0 -265
  997. package/src/components/global-styles/font-sizes/font-sizes-count.js +0 -37
  998. package/src/components/global-styles/font-sizes/font-sizes.js +0 -261
  999. package/src/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -70
  1000. package/src/components/global-styles/gradients-palette-panel.js +0 -123
  1001. package/src/components/global-styles/header.js +0 -48
  1002. package/src/components/global-styles/highlighted-colors.js +0 -39
  1003. package/src/components/global-styles/hooks.js +0 -111
  1004. package/src/components/global-styles/icon-with-current-color.js +0 -21
  1005. package/src/components/global-styles/index.js +0 -1
  1006. package/src/components/global-styles/navigation-button.js +0 -38
  1007. package/src/components/global-styles/palette.js +0 -90
  1008. package/src/components/global-styles/preset-colors.js +0 -18
  1009. package/src/components/global-styles/preview-colors.js +0 -58
  1010. package/src/components/global-styles/preview-styles.js +0 -185
  1011. package/src/components/global-styles/preview-typography.js +0 -39
  1012. package/src/components/global-styles/preview-wrapper.js +0 -126
  1013. package/src/components/global-styles/root-menu.js +0 -84
  1014. package/src/components/global-styles/screen-background.js +0 -37
  1015. package/src/components/global-styles/screen-block-list.js +0 -187
  1016. package/src/components/global-styles/screen-block.js +0 -358
  1017. package/src/components/global-styles/screen-color-palette.js +0 -42
  1018. package/src/components/global-styles/screen-colors.js +0 -55
  1019. package/src/components/global-styles/screen-css.js +0 -67
  1020. package/src/components/global-styles/screen-layout.js +0 -30
  1021. package/src/components/global-styles/screen-revisions/index.js +0 -202
  1022. package/src/components/global-styles/screen-revisions/revisions-buttons.js +0 -238
  1023. package/src/components/global-styles/screen-revisions/style.scss +0 -194
  1024. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +0 -228
  1025. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -159
  1026. package/src/components/global-styles/screen-root.js +0 -102
  1027. package/src/components/global-styles/screen-shadows.js +0 -13
  1028. package/src/components/global-styles/screen-style-variations.js +0 -52
  1029. package/src/components/global-styles/screen-typography-element.js +0 -121
  1030. package/src/components/global-styles/screen-typography.js +0 -45
  1031. package/src/components/global-styles/shadow-utils.js +0 -158
  1032. package/src/components/global-styles/shadows-edit-panel.js +0 -525
  1033. package/src/components/global-styles/shadows-panel.js +0 -196
  1034. package/src/components/global-styles/size-control/index.js +0 -89
  1035. package/src/components/global-styles/stories/index.story.js +0 -427
  1036. package/src/components/global-styles/style-variations-container.js +0 -132
  1037. package/src/components/global-styles/style.scss +0 -265
  1038. package/src/components/global-styles/subtitle.js +0 -17
  1039. package/src/components/global-styles/test/shadow-utils.spec.js +0 -251
  1040. package/src/components/global-styles/test/utils.spec.js +0 -59
  1041. package/src/components/global-styles/typeset.js +0 -73
  1042. package/src/components/global-styles/typography-elements.js +0 -102
  1043. package/src/components/global-styles/typography-example.js +0 -76
  1044. package/src/components/global-styles/typography-panel.js +0 -54
  1045. package/src/components/global-styles/typography-preview.js +0 -70
  1046. package/src/components/global-styles/ui.js +0 -448
  1047. package/src/components/global-styles/utils.js +0 -88
  1048. package/src/components/global-styles/variations/style.scss +0 -43
  1049. package/src/components/global-styles/variations/variation.js +0 -108
  1050. package/src/components/global-styles/variations/variations-color.js +0 -45
  1051. package/src/components/global-styles/variations/variations-panel.js +0 -65
  1052. package/src/components/global-styles/variations/variations-typography.js +0 -54
  1053. package/src/components/global-styles-renderer/index.js +0 -42
  1054. package/src/components/global-styles-sidebar/default-sidebar.js +0 -51
  1055. package/src/components/global-styles-sidebar/index.js +0 -206
  1056. package/src/components/global-styles-sidebar/style.scss +0 -80
  1057. package/src/components/revisions/index.js +0 -109
  1058. package/src/components/style-book/categories.ts +0 -97
  1059. package/src/components/style-book/color-examples.tsx +0 -57
  1060. package/src/components/style-book/constants.ts +0 -308
  1061. package/src/components/style-book/duotone-examples.tsx +0 -57
  1062. package/src/components/style-book/examples.tsx +0 -273
  1063. package/src/components/style-book/index.js +0 -804
  1064. package/src/components/style-book/style.scss +0 -44
  1065. package/src/components/style-book/test/categories.js +0 -166
  1066. package/src/components/style-book/types.ts +0 -80
  1067. package/src/components/welcome-guide/styles.js +0 -139
  1068. package/src/hooks/index.js +0 -4
  1069. package/src/hooks/push-changes-to-global-styles/index.js +0 -388
  1070. package/src/hooks/push-changes-to-global-styles/style.scss +0 -4
  1071. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +0 -271
  1072. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -175
  1073. package/src/utils/set-nested-value.js +0 -39
  1074. package/tsconfig.tsbuildinfo +0 -1
package/lib/inflate.js DELETED
@@ -1,3333 +0,0 @@
1
- /**
2
- * Credits:
3
- *
4
- * lib-font
5
- * https://github.com/Pomax/lib-font
6
- * https://github.com/Pomax/lib-font/blob/master/lib/inflate.js
7
- *
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2020 pomax@nihongoresources.com
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /* eslint eslint-comments/no-unlimited-disable: 0 */
32
- /* eslint-disable */
33
- /* pako 1.0.10 nodeca/pako */(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.pako = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
34
- 'use strict';
35
-
36
-
37
- var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
38
- (typeof Uint16Array !== 'undefined') &&
39
- (typeof Int32Array !== 'undefined');
40
-
41
- function _has(obj, key) {
42
- return Object.prototype.hasOwnProperty.call(obj, key);
43
- }
44
-
45
- exports.assign = function (obj /*from1, from2, from3, ...*/) {
46
- var sources = Array.prototype.slice.call(arguments, 1);
47
- while (sources.length) {
48
- var source = sources.shift();
49
- if (!source) { continue; }
50
-
51
- if (typeof source !== 'object') {
52
- throw new TypeError(source + 'must be non-object');
53
- }
54
-
55
- for (var p in source) {
56
- if (_has(source, p)) {
57
- obj[p] = source[p];
58
- }
59
- }
60
- }
61
-
62
- return obj;
63
- };
64
-
65
-
66
- // reduce buffer size, avoiding mem copy
67
- exports.shrinkBuf = function (buf, size) {
68
- if (buf.length === size) { return buf; }
69
- if (buf.subarray) { return buf.subarray(0, size); }
70
- buf.length = size;
71
- return buf;
72
- };
73
-
74
-
75
- var fnTyped = {
76
- arraySet: function (dest, src, src_offs, len, dest_offs) {
77
- if (src.subarray && dest.subarray) {
78
- dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
79
- return;
80
- }
81
- // Fallback to ordinary array
82
- for (var i = 0; i < len; i++) {
83
- dest[dest_offs + i] = src[src_offs + i];
84
- }
85
- },
86
- // Join array of chunks to single array.
87
- flattenChunks: function (chunks) {
88
- var i, l, len, pos, chunk, result;
89
-
90
- // calculate data length
91
- len = 0;
92
- for (i = 0, l = chunks.length; i < l; i++) {
93
- len += chunks[i].length;
94
- }
95
-
96
- // join chunks
97
- result = new Uint8Array(len);
98
- pos = 0;
99
- for (i = 0, l = chunks.length; i < l; i++) {
100
- chunk = chunks[i];
101
- result.set(chunk, pos);
102
- pos += chunk.length;
103
- }
104
-
105
- return result;
106
- }
107
- };
108
-
109
- var fnUntyped = {
110
- arraySet: function (dest, src, src_offs, len, dest_offs) {
111
- for (var i = 0; i < len; i++) {
112
- dest[dest_offs + i] = src[src_offs + i];
113
- }
114
- },
115
- // Join array of chunks to single array.
116
- flattenChunks: function (chunks) {
117
- return [].concat.apply([], chunks);
118
- }
119
- };
120
-
121
-
122
- // Enable/Disable typed arrays use, for testing
123
- //
124
- exports.setTyped = function (on) {
125
- if (on) {
126
- exports.Buf8 = Uint8Array;
127
- exports.Buf16 = Uint16Array;
128
- exports.Buf32 = Int32Array;
129
- exports.assign(exports, fnTyped);
130
- } else {
131
- exports.Buf8 = Array;
132
- exports.Buf16 = Array;
133
- exports.Buf32 = Array;
134
- exports.assign(exports, fnUntyped);
135
- }
136
- };
137
-
138
- exports.setTyped(TYPED_OK);
139
-
140
- },{}],2:[function(require,module,exports){
141
- // String encode/decode helpers
142
- 'use strict';
143
-
144
-
145
- var utils = require('./common');
146
-
147
-
148
- // Quick check if we can use fast array to bin string conversion
149
- //
150
- // - apply(Array) can fail on Android 2.2
151
- // - apply(Uint8Array) can fail on iOS 5.1 Safari
152
- //
153
- var STR_APPLY_OK = true;
154
- var STR_APPLY_UIA_OK = true;
155
-
156
- try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }
157
- try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }
158
-
159
-
160
- // Table with utf8 lengths (calculated by first byte of sequence)
161
- // Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
162
- // because max possible codepoint is 0x10ffff
163
- var _utf8len = new utils.Buf8(256);
164
- for (var q = 0; q < 256; q++) {
165
- _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
166
- }
167
- _utf8len[254] = _utf8len[254] = 1; // Invalid sequence start
168
-
169
-
170
- // convert string to array (typed, when possible)
171
- exports.string2buf = function (str) {
172
- var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
173
-
174
- // count binary size
175
- for (m_pos = 0; m_pos < str_len; m_pos++) {
176
- c = str.charCodeAt(m_pos);
177
- if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
178
- c2 = str.charCodeAt(m_pos + 1);
179
- if ((c2 & 0xfc00) === 0xdc00) {
180
- c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
181
- m_pos++;
182
- }
183
- }
184
- buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
185
- }
186
-
187
- // allocate buffer
188
- buf = new utils.Buf8(buf_len);
189
-
190
- // convert
191
- for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
192
- c = str.charCodeAt(m_pos);
193
- if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
194
- c2 = str.charCodeAt(m_pos + 1);
195
- if ((c2 & 0xfc00) === 0xdc00) {
196
- c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
197
- m_pos++;
198
- }
199
- }
200
- if (c < 0x80) {
201
- /* one byte */
202
- buf[i++] = c;
203
- } else if (c < 0x800) {
204
- /* two bytes */
205
- buf[i++] = 0xC0 | (c >>> 6);
206
- buf[i++] = 0x80 | (c & 0x3f);
207
- } else if (c < 0x10000) {
208
- /* three bytes */
209
- buf[i++] = 0xE0 | (c >>> 12);
210
- buf[i++] = 0x80 | (c >>> 6 & 0x3f);
211
- buf[i++] = 0x80 | (c & 0x3f);
212
- } else {
213
- /* four bytes */
214
- buf[i++] = 0xf0 | (c >>> 18);
215
- buf[i++] = 0x80 | (c >>> 12 & 0x3f);
216
- buf[i++] = 0x80 | (c >>> 6 & 0x3f);
217
- buf[i++] = 0x80 | (c & 0x3f);
218
- }
219
- }
220
-
221
- return buf;
222
- };
223
-
224
- // Helper (used in 2 places)
225
- function buf2binstring(buf, len) {
226
- // On Chrome, the arguments in a function call that are allowed is `65534`.
227
- // If the length of the buffer is smaller than that, we can use this optimization,
228
- // otherwise we will take a slower path.
229
- if (len < 65534) {
230
- if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
231
- return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
232
- }
233
- }
234
-
235
- var result = '';
236
- for (var i = 0; i < len; i++) {
237
- result += String.fromCharCode(buf[i]);
238
- }
239
- return result;
240
- }
241
-
242
-
243
- // Convert byte array to binary string
244
- exports.buf2binstring = function (buf) {
245
- return buf2binstring(buf, buf.length);
246
- };
247
-
248
-
249
- // Convert binary string (typed, when possible)
250
- exports.binstring2buf = function (str) {
251
- var buf = new utils.Buf8(str.length);
252
- for (var i = 0, len = buf.length; i < len; i++) {
253
- buf[i] = str.charCodeAt(i);
254
- }
255
- return buf;
256
- };
257
-
258
-
259
- // convert array to string
260
- exports.buf2string = function (buf, max) {
261
- var i, out, c, c_len;
262
- var len = max || buf.length;
263
-
264
- // Reserve max possible length (2 words per char)
265
- // NB: by unknown reasons, Array is significantly faster for
266
- // String.fromCharCode.apply than Uint16Array.
267
- var utf16buf = new Array(len * 2);
268
-
269
- for (out = 0, i = 0; i < len;) {
270
- c = buf[i++];
271
- // quick process ascii
272
- if (c < 0x80) { utf16buf[out++] = c; continue; }
273
-
274
- c_len = _utf8len[c];
275
- // skip 5 & 6 byte codes
276
- if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }
277
-
278
- // apply mask on first byte
279
- c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
280
- // join the rest
281
- while (c_len > 1 && i < len) {
282
- c = (c << 6) | (buf[i++] & 0x3f);
283
- c_len--;
284
- }
285
-
286
- // terminated by end of string?
287
- if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
288
-
289
- if (c < 0x10000) {
290
- utf16buf[out++] = c;
291
- } else {
292
- c -= 0x10000;
293
- utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
294
- utf16buf[out++] = 0xdc00 | (c & 0x3ff);
295
- }
296
- }
297
-
298
- return buf2binstring(utf16buf, out);
299
- };
300
-
301
-
302
- // Calculate max possible position in utf8 buffer,
303
- // that will not break sequence. If that's not possible
304
- // - (very small limits) return max size as is.
305
- //
306
- // buf[] - utf8 bytes array
307
- // max - length limit (mandatory);
308
- exports.utf8border = function (buf, max) {
309
- var pos;
310
-
311
- max = max || buf.length;
312
- if (max > buf.length) { max = buf.length; }
313
-
314
- // go back from last position, until start of sequence found
315
- pos = max - 1;
316
- while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
317
-
318
- // Very small and broken sequence,
319
- // return max, because we should return something anyway.
320
- if (pos < 0) { return max; }
321
-
322
- // If we came to start of buffer - that means buffer is too small,
323
- // return max too.
324
- if (pos === 0) { return max; }
325
-
326
- return (pos + _utf8len[buf[pos]] > max) ? pos : max;
327
- };
328
-
329
- },{"./common":1}],3:[function(require,module,exports){
330
- 'use strict';
331
-
332
- // Note: adler32 takes 12% for level 0 and 2% for level 6.
333
- // It isn't worth it to make additional optimizations as in original.
334
- // Small size is preferable.
335
-
336
- // (C) 1995-2013 Jean-loup Gailly and Mark Adler
337
- // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
338
- //
339
- // This software is provided 'as-is', without any express or implied
340
- // warranty. In no event will the authors be held liable for any damages
341
- // arising from the use of this software.
342
- //
343
- // Permission is granted to anyone to use this software for any purpose,
344
- // including commercial applications, and to alter it and redistribute it
345
- // freely, subject to the following restrictions:
346
- //
347
- // 1. The origin of this software must not be misrepresented; you must not
348
- // claim that you wrote the original software. If you use this software
349
- // in a product, an acknowledgment in the product documentation would be
350
- // appreciated but is not required.
351
- // 2. Altered source versions must be plainly marked as such, and must not be
352
- // misrepresented as being the original software.
353
- // 3. This notice may not be removed or altered from any source distribution.
354
-
355
- function adler32(adler, buf, len, pos) {
356
- var s1 = (adler & 0xffff) |0,
357
- s2 = ((adler >>> 16) & 0xffff) |0,
358
- n = 0;
359
-
360
- while (len !== 0) {
361
- // Set limit ~ twice less than 5552, to keep
362
- // s2 in 31-bits, because we force signed ints.
363
- // in other case %= will fail.
364
- n = len > 2000 ? 2000 : len;
365
- len -= n;
366
-
367
- do {
368
- s1 = (s1 + buf[pos++]) |0;
369
- s2 = (s2 + s1) |0;
370
- } while (--n);
371
-
372
- s1 %= 65521;
373
- s2 %= 65521;
374
- }
375
-
376
- return (s1 | (s2 << 16)) |0;
377
- }
378
-
379
-
380
- module.exports = adler32;
381
-
382
- },{}],4:[function(require,module,exports){
383
- 'use strict';
384
-
385
- // (C) 1995-2013 Jean-loup Gailly and Mark Adler
386
- // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
387
- //
388
- // This software is provided 'as-is', without any express or implied
389
- // warranty. In no event will the authors be held liable for any damages
390
- // arising from the use of this software.
391
- //
392
- // Permission is granted to anyone to use this software for any purpose,
393
- // including commercial applications, and to alter it and redistribute it
394
- // freely, subject to the following restrictions:
395
- //
396
- // 1. The origin of this software must not be misrepresented; you must not
397
- // claim that you wrote the original software. If you use this software
398
- // in a product, an acknowledgment in the product documentation would be
399
- // appreciated but is not required.
400
- // 2. Altered source versions must be plainly marked as such, and must not be
401
- // misrepresented as being the original software.
402
- // 3. This notice may not be removed or altered from any source distribution.
403
-
404
- module.exports = {
405
-
406
- /* Allowed flush values; see deflate() and inflate() below for details */
407
- Z_NO_FLUSH: 0,
408
- Z_PARTIAL_FLUSH: 1,
409
- Z_SYNC_FLUSH: 2,
410
- Z_FULL_FLUSH: 3,
411
- Z_FINISH: 4,
412
- Z_BLOCK: 5,
413
- Z_TREES: 6,
414
-
415
- /* Return codes for the compression/decompression functions. Negative values
416
- * are errors, positive values are used for special but normal events.
417
- */
418
- Z_OK: 0,
419
- Z_STREAM_END: 1,
420
- Z_NEED_DICT: 2,
421
- Z_ERRNO: -1,
422
- Z_STREAM_ERROR: -2,
423
- Z_DATA_ERROR: -3,
424
- //Z_MEM_ERROR: -4,
425
- Z_BUF_ERROR: -5,
426
- //Z_VERSION_ERROR: -6,
427
-
428
- /* compression levels */
429
- Z_NO_COMPRESSION: 0,
430
- Z_BEST_SPEED: 1,
431
- Z_BEST_COMPRESSION: 9,
432
- Z_DEFAULT_COMPRESSION: -1,
433
-
434
-
435
- Z_FILTERED: 1,
436
- Z_HUFFMAN_ONLY: 2,
437
- Z_RLE: 3,
438
- Z_FIXED: 4,
439
- Z_DEFAULT_STRATEGY: 0,
440
-
441
- /* Possible values of the data_type field (though see inflate()) */
442
- Z_BINARY: 0,
443
- Z_TEXT: 1,
444
- //Z_ASCII: 1, // = Z_TEXT (deprecated)
445
- Z_UNKNOWN: 2,
446
-
447
- /* The deflate compression method */
448
- Z_DEFLATED: 8
449
- //Z_NULL: null // Use -1 or null inline, depending on var type
450
- };
451
-
452
- },{}],5:[function(require,module,exports){
453
- 'use strict';
454
-
455
- // Note: we can't get significant speed boost here.
456
- // So write code to minimize size - no pregenerated tables
457
- // and array tools dependencies.
458
-
459
- // (C) 1995-2013 Jean-loup Gailly and Mark Adler
460
- // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
461
- //
462
- // This software is provided 'as-is', without any express or implied
463
- // warranty. In no event will the authors be held liable for any damages
464
- // arising from the use of this software.
465
- //
466
- // Permission is granted to anyone to use this software for any purpose,
467
- // including commercial applications, and to alter it and redistribute it
468
- // freely, subject to the following restrictions:
469
- //
470
- // 1. The origin of this software must not be misrepresented; you must not
471
- // claim that you wrote the original software. If you use this software
472
- // in a product, an acknowledgment in the product documentation would be
473
- // appreciated but is not required.
474
- // 2. Altered source versions must be plainly marked as such, and must not be
475
- // misrepresented as being the original software.
476
- // 3. This notice may not be removed or altered from any source distribution.
477
-
478
- // Use ordinary array, since untyped makes no boost here
479
- function makeTable() {
480
- var c, table = [];
481
-
482
- for (var n = 0; n < 256; n++) {
483
- c = n;
484
- for (var k = 0; k < 8; k++) {
485
- c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
486
- }
487
- table[n] = c;
488
- }
489
-
490
- return table;
491
- }
492
-
493
- // Create table on load. Just 255 signed longs. Not a problem.
494
- var crcTable = makeTable();
495
-
496
-
497
- function crc32(crc, buf, len, pos) {
498
- var t = crcTable,
499
- end = pos + len;
500
-
501
- crc ^= -1;
502
-
503
- for (var i = pos; i < end; i++) {
504
- crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
505
- }
506
-
507
- return (crc ^ (-1)); // >>> 0;
508
- }
509
-
510
-
511
- module.exports = crc32;
512
-
513
- },{}],6:[function(require,module,exports){
514
- 'use strict';
515
-
516
- // (C) 1995-2013 Jean-loup Gailly and Mark Adler
517
- // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
518
- //
519
- // This software is provided 'as-is', without any express or implied
520
- // warranty. In no event will the authors be held liable for any damages
521
- // arising from the use of this software.
522
- //
523
- // Permission is granted to anyone to use this software for any purpose,
524
- // including commercial applications, and to alter it and redistribute it
525
- // freely, subject to the following restrictions:
526
- //
527
- // 1. The origin of this software must not be misrepresented; you must not
528
- // claim that you wrote the original software. If you use this software
529
- // in a product, an acknowledgment in the product documentation would be
530
- // appreciated but is not required.
531
- // 2. Altered source versions must be plainly marked as such, and must not be
532
- // misrepresented as being the original software.
533
- // 3. This notice may not be removed or altered from any source distribution.
534
-
535
- function GZheader() {
536
- /* true if compressed data believed to be text */
537
- this.text = 0;
538
- /* modification time */
539
- this.time = 0;
540
- /* extra flags (not used when writing a gzip file) */
541
- this.xflags = 0;
542
- /* operating system */
543
- this.os = 0;
544
- /* pointer to extra field or Z_NULL if none */
545
- this.extra = null;
546
- /* extra field length (valid if extra != Z_NULL) */
547
- this.extra_len = 0; // Actually, we don't need it in JS,
548
- // but leave for few code modifications
549
-
550
- //
551
- // Setup limits is not necessary because in js we should not preallocate memory
552
- // for inflate use constant limit in 65536 bytes
553
- //
554
-
555
- /* space at extra (only when reading header) */
556
- // this.extra_max = 0;
557
- /* pointer to zero-terminated file name or Z_NULL */
558
- this.name = '';
559
- /* space at name (only when reading header) */
560
- // this.name_max = 0;
561
- /* pointer to zero-terminated comment or Z_NULL */
562
- this.comment = '';
563
- /* space at comment (only when reading header) */
564
- // this.comm_max = 0;
565
- /* true if there was or will be a header crc */
566
- this.hcrc = 0;
567
- /* true when done reading gzip header (not used when writing a gzip file) */
568
- this.done = false;
569
- }
570
-
571
- module.exports = GZheader;
572
-
573
- },{}],7:[function(require,module,exports){
574
- 'use strict';
575
-
576
- // (C) 1995-2013 Jean-loup Gailly and Mark Adler
577
- // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
578
- //
579
- // This software is provided 'as-is', without any express or implied
580
- // warranty. In no event will the authors be held liable for any damages
581
- // arising from the use of this software.
582
- //
583
- // Permission is granted to anyone to use this software for any purpose,
584
- // including commercial applications, and to alter it and redistribute it
585
- // freely, subject to the following restrictions:
586
- //
587
- // 1. The origin of this software must not be misrepresented; you must not
588
- // claim that you wrote the original software. If you use this software
589
- // in a product, an acknowledgment in the product documentation would be
590
- // appreciated but is not required.
591
- // 2. Altered source versions must be plainly marked as such, and must not be
592
- // misrepresented as being the original software.
593
- // 3. This notice may not be removed or altered from any source distribution.
594
-
595
- // See state defs from inflate.js
596
- var BAD = 30; /* got a data error -- remain here until reset */
597
- var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
598
-
599
- /*
600
- Decode literal, length, and distance codes and write out the resulting
601
- literal and match bytes until either not enough input or output is
602
- available, an end-of-block is encountered, or a data error is encountered.
603
- When large enough input and output buffers are supplied to inflate(), for
604
- example, a 16K input buffer and a 64K output buffer, more than 95% of the
605
- inflate execution time is spent in this routine.
606
-
607
- Entry assumptions:
608
-
609
- state.mode === LEN
610
- strm.avail_in >= 6
611
- strm.avail_out >= 258
612
- start >= strm.avail_out
613
- state.bits < 8
614
-
615
- On return, state.mode is one of:
616
-
617
- LEN -- ran out of enough output space or enough available input
618
- TYPE -- reached end of block code, inflate() to interpret next block
619
- BAD -- error in block data
620
-
621
- Notes:
622
-
623
- - The maximum input bits used by a length/distance pair is 15 bits for the
624
- length code, 5 bits for the length extra, 15 bits for the distance code,
625
- and 13 bits for the distance extra. This totals 48 bits, or six bytes.
626
- Therefore if strm.avail_in >= 6, then there is enough input to avoid
627
- checking for available input while decoding.
628
-
629
- - The maximum bytes that a single length/distance pair can output is 258
630
- bytes, which is the maximum length that can be coded. inflate_fast()
631
- requires strm.avail_out >= 258 for each loop to avoid checking for
632
- output space.
633
- */
634
- module.exports = function inflate_fast(strm, start) {
635
- var state;
636
- var _in; /* local strm.input */
637
- var last; /* have enough input while in < last */
638
- var _out; /* local strm.output */
639
- var beg; /* inflate()'s initial strm.output */
640
- var end; /* while out < end, enough space available */
641
- //#ifdef INFLATE_STRICT
642
- var dmax; /* maximum distance from zlib header */
643
- //#endif
644
- var wsize; /* window size or zero if not using window */
645
- var whave; /* valid bytes in the window */
646
- var wnext; /* window write index */
647
- // Use `s_window` instead `window`, avoid conflict with instrumentation tools
648
- var s_window; /* allocated sliding window, if wsize != 0 */
649
- var hold; /* local strm.hold */
650
- var bits; /* local strm.bits */
651
- var lcode; /* local strm.lencode */
652
- var dcode; /* local strm.distcode */
653
- var lmask; /* mask for first level of length codes */
654
- var dmask; /* mask for first level of distance codes */
655
- var here; /* retrieved table entry */
656
- var op; /* code bits, operation, extra bits, or */
657
- /* window position, window bytes to copy */
658
- var len; /* match length, unused bytes */
659
- var dist; /* match distance */
660
- var from; /* where to copy match from */
661
- var from_source;
662
-
663
-
664
- var input, output; // JS specific, because we have no pointers
665
-
666
- /* copy state to local variables */
667
- state = strm.state;
668
- //here = state.here;
669
- _in = strm.next_in;
670
- input = strm.input;
671
- last = _in + (strm.avail_in - 5);
672
- _out = strm.next_out;
673
- output = strm.output;
674
- beg = _out - (start - strm.avail_out);
675
- end = _out + (strm.avail_out - 257);
676
- //#ifdef INFLATE_STRICT
677
- dmax = state.dmax;
678
- //#endif
679
- wsize = state.wsize;
680
- whave = state.whave;
681
- wnext = state.wnext;
682
- s_window = state.window;
683
- hold = state.hold;
684
- bits = state.bits;
685
- lcode = state.lencode;
686
- dcode = state.distcode;
687
- lmask = (1 << state.lenbits) - 1;
688
- dmask = (1 << state.distbits) - 1;
689
-
690
-
691
- /* decode literals and length/distances until end-of-block or not enough
692
- input data or output space */
693
-
694
- top:
695
- do {
696
- if (bits < 15) {
697
- hold += input[_in++] << bits;
698
- bits += 8;
699
- hold += input[_in++] << bits;
700
- bits += 8;
701
- }
702
-
703
- here = lcode[hold & lmask];
704
-
705
- dolen:
706
- for (;;) { // Goto emulation
707
- op = here >>> 24/*here.bits*/;
708
- hold >>>= op;
709
- bits -= op;
710
- op = (here >>> 16) & 0xff/*here.op*/;
711
- if (op === 0) { /* literal */
712
- //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
713
- // "inflate: literal '%c'\n" :
714
- // "inflate: literal 0x%02x\n", here.val));
715
- output[_out++] = here & 0xffff/*here.val*/;
716
- }
717
- else if (op & 16) { /* length base */
718
- len = here & 0xffff/*here.val*/;
719
- op &= 15; /* number of extra bits */
720
- if (op) {
721
- if (bits < op) {
722
- hold += input[_in++] << bits;
723
- bits += 8;
724
- }
725
- len += hold & ((1 << op) - 1);
726
- hold >>>= op;
727
- bits -= op;
728
- }
729
- //Tracevv((stderr, "inflate: length %u\n", len));
730
- if (bits < 15) {
731
- hold += input[_in++] << bits;
732
- bits += 8;
733
- hold += input[_in++] << bits;
734
- bits += 8;
735
- }
736
- here = dcode[hold & dmask];
737
-
738
- dodist:
739
- for (;;) { // goto emulation
740
- op = here >>> 24/*here.bits*/;
741
- hold >>>= op;
742
- bits -= op;
743
- op = (here >>> 16) & 0xff/*here.op*/;
744
-
745
- if (op & 16) { /* distance base */
746
- dist = here & 0xffff/*here.val*/;
747
- op &= 15; /* number of extra bits */
748
- if (bits < op) {
749
- hold += input[_in++] << bits;
750
- bits += 8;
751
- if (bits < op) {
752
- hold += input[_in++] << bits;
753
- bits += 8;
754
- }
755
- }
756
- dist += hold & ((1 << op) - 1);
757
- //#ifdef INFLATE_STRICT
758
- if (dist > dmax) {
759
- strm.msg = 'invalid distance too far back';
760
- state.mode = BAD;
761
- break top;
762
- }
763
- //#endif
764
- hold >>>= op;
765
- bits -= op;
766
- //Tracevv((stderr, "inflate: distance %u\n", dist));
767
- op = _out - beg; /* max distance in output */
768
- if (dist > op) { /* see if copy from window */
769
- op = dist - op; /* distance back in window */
770
- if (op > whave) {
771
- if (state.sane) {
772
- strm.msg = 'invalid distance too far back';
773
- state.mode = BAD;
774
- break top;
775
- }
776
-
777
- // (!) This block is disabled in zlib defaults,
778
- // don't enable it for binary compatibility
779
- //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
780
- // if (len <= op - whave) {
781
- // do {
782
- // output[_out++] = 0;
783
- // } while (--len);
784
- // continue top;
785
- // }
786
- // len -= op - whave;
787
- // do {
788
- // output[_out++] = 0;
789
- // } while (--op > whave);
790
- // if (op === 0) {
791
- // from = _out - dist;
792
- // do {
793
- // output[_out++] = output[from++];
794
- // } while (--len);
795
- // continue top;
796
- // }
797
- //#endif
798
- }
799
- from = 0; // window index
800
- from_source = s_window;
801
- if (wnext === 0) { /* very common case */
802
- from += wsize - op;
803
- if (op < len) { /* some from window */
804
- len -= op;
805
- do {
806
- output[_out++] = s_window[from++];
807
- } while (--op);
808
- from = _out - dist; /* rest from output */
809
- from_source = output;
810
- }
811
- }
812
- else if (wnext < op) { /* wrap around window */
813
- from += wsize + wnext - op;
814
- op -= wnext;
815
- if (op < len) { /* some from end of window */
816
- len -= op;
817
- do {
818
- output[_out++] = s_window[from++];
819
- } while (--op);
820
- from = 0;
821
- if (wnext < len) { /* some from start of window */
822
- op = wnext;
823
- len -= op;
824
- do {
825
- output[_out++] = s_window[from++];
826
- } while (--op);
827
- from = _out - dist; /* rest from output */
828
- from_source = output;
829
- }
830
- }
831
- }
832
- else { /* contiguous in window */
833
- from += wnext - op;
834
- if (op < len) { /* some from window */
835
- len -= op;
836
- do {
837
- output[_out++] = s_window[from++];
838
- } while (--op);
839
- from = _out - dist; /* rest from output */
840
- from_source = output;
841
- }
842
- }
843
- while (len > 2) {
844
- output[_out++] = from_source[from++];
845
- output[_out++] = from_source[from++];
846
- output[_out++] = from_source[from++];
847
- len -= 3;
848
- }
849
- if (len) {
850
- output[_out++] = from_source[from++];
851
- if (len > 1) {
852
- output[_out++] = from_source[from++];
853
- }
854
- }
855
- }
856
- else {
857
- from = _out - dist; /* copy direct from output */
858
- do { /* minimum length is three */
859
- output[_out++] = output[from++];
860
- output[_out++] = output[from++];
861
- output[_out++] = output[from++];
862
- len -= 3;
863
- } while (len > 2);
864
- if (len) {
865
- output[_out++] = output[from++];
866
- if (len > 1) {
867
- output[_out++] = output[from++];
868
- }
869
- }
870
- }
871
- }
872
- else if ((op & 64) === 0) { /* 2nd level distance code */
873
- here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
874
- continue dodist;
875
- }
876
- else {
877
- strm.msg = 'invalid distance code';
878
- state.mode = BAD;
879
- break top;
880
- }
881
-
882
- break; // need to emulate goto via "continue"
883
- }
884
- }
885
- else if ((op & 64) === 0) { /* 2nd level length code */
886
- here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
887
- continue dolen;
888
- }
889
- else if (op & 32) { /* end-of-block */
890
- //Tracevv((stderr, "inflate: end of block\n"));
891
- state.mode = TYPE;
892
- break top;
893
- }
894
- else {
895
- strm.msg = 'invalid literal/length code';
896
- state.mode = BAD;
897
- break top;
898
- }
899
-
900
- break; // need to emulate goto via "continue"
901
- }
902
- } while (_in < last && _out < end);
903
-
904
- /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
905
- len = bits >> 3;
906
- _in -= len;
907
- bits -= len << 3;
908
- hold &= (1 << bits) - 1;
909
-
910
- /* update state and return */
911
- strm.next_in = _in;
912
- strm.next_out = _out;
913
- strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
914
- strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
915
- state.hold = hold;
916
- state.bits = bits;
917
- return;
918
- };
919
-
920
- },{}],8:[function(require,module,exports){
921
- 'use strict';
922
-
923
- // (C) 1995-2013 Jean-loup Gailly and Mark Adler
924
- // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
925
- //
926
- // This software is provided 'as-is', without any express or implied
927
- // warranty. In no event will the authors be held liable for any damages
928
- // arising from the use of this software.
929
- //
930
- // Permission is granted to anyone to use this software for any purpose,
931
- // including commercial applications, and to alter it and redistribute it
932
- // freely, subject to the following restrictions:
933
- //
934
- // 1. The origin of this software must not be misrepresented; you must not
935
- // claim that you wrote the original software. If you use this software
936
- // in a product, an acknowledgment in the product documentation would be
937
- // appreciated but is not required.
938
- // 2. Altered source versions must be plainly marked as such, and must not be
939
- // misrepresented as being the original software.
940
- // 3. This notice may not be removed or altered from any source distribution.
941
-
942
- var utils = require('../utils/common');
943
- var adler32 = require('./adler32');
944
- var crc32 = require('./crc32');
945
- var inflate_fast = require('./inffast');
946
- var inflate_table = require('./inftrees');
947
-
948
- var CODES = 0;
949
- var LENS = 1;
950
- var DISTS = 2;
951
-
952
- /* Public constants ==========================================================*/
953
- /* ===========================================================================*/
954
-
955
-
956
- /* Allowed flush values; see deflate() and inflate() below for details */
957
- //var Z_NO_FLUSH = 0;
958
- //var Z_PARTIAL_FLUSH = 1;
959
- //var Z_SYNC_FLUSH = 2;
960
- //var Z_FULL_FLUSH = 3;
961
- var Z_FINISH = 4;
962
- var Z_BLOCK = 5;
963
- var Z_TREES = 6;
964
-
965
-
966
- /* Return codes for the compression/decompression functions. Negative values
967
- * are errors, positive values are used for special but normal events.
968
- */
969
- var Z_OK = 0;
970
- var Z_STREAM_END = 1;
971
- var Z_NEED_DICT = 2;
972
- //var Z_ERRNO = -1;
973
- var Z_STREAM_ERROR = -2;
974
- var Z_DATA_ERROR = -3;
975
- var Z_MEM_ERROR = -4;
976
- var Z_BUF_ERROR = -5;
977
- //var Z_VERSION_ERROR = -6;
978
-
979
- /* The deflate compression method */
980
- var Z_DEFLATED = 8;
981
-
982
-
983
- /* STATES ====================================================================*/
984
- /* ===========================================================================*/
985
-
986
-
987
- var HEAD = 1; /* i: waiting for magic header */
988
- var FLAGS = 2; /* i: waiting for method and flags (gzip) */
989
- var TIME = 3; /* i: waiting for modification time (gzip) */
990
- var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
991
- var EXLEN = 5; /* i: waiting for extra length (gzip) */
992
- var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
993
- var NAME = 7; /* i: waiting for end of file name (gzip) */
994
- var COMMENT = 8; /* i: waiting for end of comment (gzip) */
995
- var HCRC = 9; /* i: waiting for header crc (gzip) */
996
- var DICTID = 10; /* i: waiting for dictionary check value */
997
- var DICT = 11; /* waiting for inflateSetDictionary() call */
998
- var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
999
- var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
1000
- var STORED = 14; /* i: waiting for stored size (length and complement) */
1001
- var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
1002
- var COPY = 16; /* i/o: waiting for input or output to copy stored block */
1003
- var TABLE = 17; /* i: waiting for dynamic block table lengths */
1004
- var LENLENS = 18; /* i: waiting for code length code lengths */
1005
- var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
1006
- var LEN_ = 20; /* i: same as LEN below, but only first time in */
1007
- var LEN = 21; /* i: waiting for length/lit/eob code */
1008
- var LENEXT = 22; /* i: waiting for length extra bits */
1009
- var DIST = 23; /* i: waiting for distance code */
1010
- var DISTEXT = 24; /* i: waiting for distance extra bits */
1011
- var MATCH = 25; /* o: waiting for output space to copy string */
1012
- var LIT = 26; /* o: waiting for output space to write literal */
1013
- var CHECK = 27; /* i: waiting for 32-bit check value */
1014
- var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
1015
- var DONE = 29; /* finished check, done -- remain here until reset */
1016
- var BAD = 30; /* got a data error -- remain here until reset */
1017
- var MEM = 31; /* got an inflate() memory error -- remain here until reset */
1018
- var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
1019
-
1020
- /* ===========================================================================*/
1021
-
1022
-
1023
-
1024
- var ENOUGH_LENS = 852;
1025
- var ENOUGH_DISTS = 592;
1026
- //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
1027
-
1028
- var MAX_WBITS = 15;
1029
- /* 32K LZ77 window */
1030
- var DEF_WBITS = MAX_WBITS;
1031
-
1032
-
1033
- function zswap32(q) {
1034
- return (((q >>> 24) & 0xff) +
1035
- ((q >>> 8) & 0xff00) +
1036
- ((q & 0xff00) << 8) +
1037
- ((q & 0xff) << 24));
1038
- }
1039
-
1040
-
1041
- function InflateState() {
1042
- this.mode = 0; /* current inflate mode */
1043
- this.last = false; /* true if processing last block */
1044
- this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
1045
- this.havedict = false; /* true if dictionary provided */
1046
- this.flags = 0; /* gzip header method and flags (0 if zlib) */
1047
- this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
1048
- this.check = 0; /* protected copy of check value */
1049
- this.total = 0; /* protected copy of output count */
1050
- // TODO: may be {}
1051
- this.head = null; /* where to save gzip header information */
1052
-
1053
- /* sliding window */
1054
- this.wbits = 0; /* log base 2 of requested window size */
1055
- this.wsize = 0; /* window size or zero if not using window */
1056
- this.whave = 0; /* valid bytes in the window */
1057
- this.wnext = 0; /* window write index */
1058
- this.window = null; /* allocated sliding window, if needed */
1059
-
1060
- /* bit accumulator */
1061
- this.hold = 0; /* input bit accumulator */
1062
- this.bits = 0; /* number of bits in "in" */
1063
-
1064
- /* for string and stored block copying */
1065
- this.length = 0; /* literal or length of data to copy */
1066
- this.offset = 0; /* distance back to copy string from */
1067
-
1068
- /* for table and code decoding */
1069
- this.extra = 0; /* extra bits needed */
1070
-
1071
- /* fixed and dynamic code tables */
1072
- this.lencode = null; /* starting table for length/literal codes */
1073
- this.distcode = null; /* starting table for distance codes */
1074
- this.lenbits = 0; /* index bits for lencode */
1075
- this.distbits = 0; /* index bits for distcode */
1076
-
1077
- /* dynamic table building */
1078
- this.ncode = 0; /* number of code length code lengths */
1079
- this.nlen = 0; /* number of length code lengths */
1080
- this.ndist = 0; /* number of distance code lengths */
1081
- this.have = 0; /* number of code lengths in lens[] */
1082
- this.next = null; /* next available space in codes[] */
1083
-
1084
- this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
1085
- this.work = new utils.Buf16(288); /* work area for code table building */
1086
-
1087
- /*
1088
- because we don't have pointers in js, we use lencode and distcode directly
1089
- as buffers so we don't need codes
1090
- */
1091
- //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
1092
- this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
1093
- this.distdyn = null; /* dynamic table for distance codes (JS specific) */
1094
- this.sane = 0; /* if false, allow invalid distance too far */
1095
- this.back = 0; /* bits back of last unprocessed length/lit */
1096
- this.was = 0; /* initial length of match */
1097
- }
1098
-
1099
- function inflateResetKeep(strm) {
1100
- var state;
1101
-
1102
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
1103
- state = strm.state;
1104
- strm.total_in = strm.total_out = state.total = 0;
1105
- strm.msg = ''; /*Z_NULL*/
1106
- if (state.wrap) { /* to support ill-conceived Java test suite */
1107
- strm.adler = state.wrap & 1;
1108
- }
1109
- state.mode = HEAD;
1110
- state.last = 0;
1111
- state.havedict = 0;
1112
- state.dmax = 32768;
1113
- state.head = null/*Z_NULL*/;
1114
- state.hold = 0;
1115
- state.bits = 0;
1116
- //state.lencode = state.distcode = state.next = state.codes;
1117
- state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
1118
- state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
1119
-
1120
- state.sane = 1;
1121
- state.back = -1;
1122
- //Tracev((stderr, "inflate: reset\n"));
1123
- return Z_OK;
1124
- }
1125
-
1126
- function inflateReset(strm) {
1127
- var state;
1128
-
1129
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
1130
- state = strm.state;
1131
- state.wsize = 0;
1132
- state.whave = 0;
1133
- state.wnext = 0;
1134
- return inflateResetKeep(strm);
1135
-
1136
- }
1137
-
1138
- function inflateReset2(strm, windowBits) {
1139
- var wrap;
1140
- var state;
1141
-
1142
- /* get the state */
1143
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
1144
- state = strm.state;
1145
-
1146
- /* extract wrap request from windowBits parameter */
1147
- if (windowBits < 0) {
1148
- wrap = 0;
1149
- windowBits = -windowBits;
1150
- }
1151
- else {
1152
- wrap = (windowBits >> 4) + 1;
1153
- if (windowBits < 48) {
1154
- windowBits &= 15;
1155
- }
1156
- }
1157
-
1158
- /* set number of window bits, free window if different */
1159
- if (windowBits && (windowBits < 8 || windowBits > 15)) {
1160
- return Z_STREAM_ERROR;
1161
- }
1162
- if (state.window !== null && state.wbits !== windowBits) {
1163
- state.window = null;
1164
- }
1165
-
1166
- /* update state and reset the rest of it */
1167
- state.wrap = wrap;
1168
- state.wbits = windowBits;
1169
- return inflateReset(strm);
1170
- }
1171
-
1172
- function inflateInit2(strm, windowBits) {
1173
- var ret;
1174
- var state;
1175
-
1176
- if (!strm) { return Z_STREAM_ERROR; }
1177
- //strm.msg = Z_NULL; /* in case we return an error */
1178
-
1179
- state = new InflateState();
1180
-
1181
- //if (state === Z_NULL) return Z_MEM_ERROR;
1182
- //Tracev((stderr, "inflate: allocated\n"));
1183
- strm.state = state;
1184
- state.window = null/*Z_NULL*/;
1185
- ret = inflateReset2(strm, windowBits);
1186
- if (ret !== Z_OK) {
1187
- strm.state = null/*Z_NULL*/;
1188
- }
1189
- return ret;
1190
- }
1191
-
1192
- function inflateInit(strm) {
1193
- return inflateInit2(strm, DEF_WBITS);
1194
- }
1195
-
1196
-
1197
- /*
1198
- Return state with length and distance decoding tables and index sizes set to
1199
- fixed code decoding. Normally this returns fixed tables from inffixed.h.
1200
- If BUILDFIXED is defined, then instead this routine builds the tables the
1201
- first time it's called, and returns those tables the first time and
1202
- thereafter. This reduces the size of the code by about 2K bytes, in
1203
- exchange for a little execution time. However, BUILDFIXED should not be
1204
- used for threaded applications, since the rewriting of the tables and virgin
1205
- may not be thread-safe.
1206
- */
1207
- var virgin = true;
1208
-
1209
- var lenfix, distfix; // We have no pointers in JS, so keep tables separate
1210
-
1211
- function fixedtables(state) {
1212
- /* build fixed huffman tables if first call (may not be thread safe) */
1213
- if (virgin) {
1214
- var sym;
1215
-
1216
- lenfix = new utils.Buf32(512);
1217
- distfix = new utils.Buf32(32);
1218
-
1219
- /* literal/length table */
1220
- sym = 0;
1221
- while (sym < 144) { state.lens[sym++] = 8; }
1222
- while (sym < 256) { state.lens[sym++] = 9; }
1223
- while (sym < 280) { state.lens[sym++] = 7; }
1224
- while (sym < 288) { state.lens[sym++] = 8; }
1225
-
1226
- inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
1227
-
1228
- /* distance table */
1229
- sym = 0;
1230
- while (sym < 32) { state.lens[sym++] = 5; }
1231
-
1232
- inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
1233
-
1234
- /* do this just once */
1235
- virgin = false;
1236
- }
1237
-
1238
- state.lencode = lenfix;
1239
- state.lenbits = 9;
1240
- state.distcode = distfix;
1241
- state.distbits = 5;
1242
- }
1243
-
1244
-
1245
- /*
1246
- Update the window with the last wsize (normally 32K) bytes written before
1247
- returning. If window does not exist yet, create it. This is only called
1248
- when a window is already in use, or when output has been written during this
1249
- inflate call, but the end of the deflate stream has not been reached yet.
1250
- It is also called to create a window for dictionary data when a dictionary
1251
- is loaded.
1252
-
1253
- Providing output buffers larger than 32K to inflate() should provide a speed
1254
- advantage, since only the last 32K of output is copied to the sliding window
1255
- upon return from inflate(), and since all distances after the first 32K of
1256
- output will fall in the output data, making match copies simpler and faster.
1257
- The advantage may be dependent on the size of the processor's data caches.
1258
- */
1259
- function updatewindow(strm, src, end, copy) {
1260
- var dist;
1261
- var state = strm.state;
1262
-
1263
- /* if it hasn't been done already, allocate space for the window */
1264
- if (state.window === null) {
1265
- state.wsize = 1 << state.wbits;
1266
- state.wnext = 0;
1267
- state.whave = 0;
1268
-
1269
- state.window = new utils.Buf8(state.wsize);
1270
- }
1271
-
1272
- /* copy state->wsize or less output bytes into the circular window */
1273
- if (copy >= state.wsize) {
1274
- utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
1275
- state.wnext = 0;
1276
- state.whave = state.wsize;
1277
- }
1278
- else {
1279
- dist = state.wsize - state.wnext;
1280
- if (dist > copy) {
1281
- dist = copy;
1282
- }
1283
- //zmemcpy(state->window + state->wnext, end - copy, dist);
1284
- utils.arraySet(state.window, src, end - copy, dist, state.wnext);
1285
- copy -= dist;
1286
- if (copy) {
1287
- //zmemcpy(state->window, end - copy, copy);
1288
- utils.arraySet(state.window, src, end - copy, copy, 0);
1289
- state.wnext = copy;
1290
- state.whave = state.wsize;
1291
- }
1292
- else {
1293
- state.wnext += dist;
1294
- if (state.wnext === state.wsize) { state.wnext = 0; }
1295
- if (state.whave < state.wsize) { state.whave += dist; }
1296
- }
1297
- }
1298
- return 0;
1299
- }
1300
-
1301
- function inflate(strm, flush) {
1302
- var state;
1303
- var input, output; // input/output buffers
1304
- var next; /* next input INDEX */
1305
- var put; /* next output INDEX */
1306
- var have, left; /* available input and output */
1307
- var hold; /* bit buffer */
1308
- var bits; /* bits in bit buffer */
1309
- var _in, _out; /* save starting available input and output */
1310
- var copy; /* number of stored or match bytes to copy */
1311
- var from; /* where to copy match bytes from */
1312
- var from_source;
1313
- var here = 0; /* current decoding table entry */
1314
- var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
1315
- //var last; /* parent table entry */
1316
- var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
1317
- var len; /* length to copy for repeats, bits to drop */
1318
- var ret; /* return code */
1319
- var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
1320
- var opts;
1321
-
1322
- var n; // temporary var for NEED_BITS
1323
-
1324
- var order = /* permutation of code lengths */
1325
- [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];
1326
-
1327
-
1328
- if (!strm || !strm.state || !strm.output ||
1329
- (!strm.input && strm.avail_in !== 0)) {
1330
- return Z_STREAM_ERROR;
1331
- }
1332
-
1333
- state = strm.state;
1334
- if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
1335
-
1336
-
1337
- //--- LOAD() ---
1338
- put = strm.next_out;
1339
- output = strm.output;
1340
- left = strm.avail_out;
1341
- next = strm.next_in;
1342
- input = strm.input;
1343
- have = strm.avail_in;
1344
- hold = state.hold;
1345
- bits = state.bits;
1346
- //---
1347
-
1348
- _in = have;
1349
- _out = left;
1350
- ret = Z_OK;
1351
-
1352
- inf_leave: // goto emulation
1353
- for (;;) {
1354
- switch (state.mode) {
1355
- case HEAD:
1356
- if (state.wrap === 0) {
1357
- state.mode = TYPEDO;
1358
- break;
1359
- }
1360
- //=== NEEDBITS(16);
1361
- while (bits < 16) {
1362
- if (have === 0) { break inf_leave; }
1363
- have--;
1364
- hold += input[next++] << bits;
1365
- bits += 8;
1366
- }
1367
- //===//
1368
- if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
1369
- state.check = 0/*crc32(0L, Z_NULL, 0)*/;
1370
- //=== CRC2(state.check, hold);
1371
- hbuf[0] = hold & 0xff;
1372
- hbuf[1] = (hold >>> 8) & 0xff;
1373
- state.check = crc32(state.check, hbuf, 2, 0);
1374
- //===//
1375
-
1376
- //=== INITBITS();
1377
- hold = 0;
1378
- bits = 0;
1379
- //===//
1380
- state.mode = FLAGS;
1381
- break;
1382
- }
1383
- state.flags = 0; /* expect zlib header */
1384
- if (state.head) {
1385
- state.head.done = false;
1386
- }
1387
- if (!(state.wrap & 1) || /* check if zlib header allowed */
1388
- (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
1389
- strm.msg = 'incorrect header check';
1390
- state.mode = BAD;
1391
- break;
1392
- }
1393
- if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
1394
- strm.msg = 'unknown compression method';
1395
- state.mode = BAD;
1396
- break;
1397
- }
1398
- //--- DROPBITS(4) ---//
1399
- hold >>>= 4;
1400
- bits -= 4;
1401
- //---//
1402
- len = (hold & 0x0f)/*BITS(4)*/ + 8;
1403
- if (state.wbits === 0) {
1404
- state.wbits = len;
1405
- }
1406
- else if (len > state.wbits) {
1407
- strm.msg = 'invalid window size';
1408
- state.mode = BAD;
1409
- break;
1410
- }
1411
- state.dmax = 1 << len;
1412
- //Tracev((stderr, "inflate: zlib header ok\n"));
1413
- strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
1414
- state.mode = hold & 0x200 ? DICTID : TYPE;
1415
- //=== INITBITS();
1416
- hold = 0;
1417
- bits = 0;
1418
- //===//
1419
- break;
1420
- case FLAGS:
1421
- //=== NEEDBITS(16); */
1422
- while (bits < 16) {
1423
- if (have === 0) { break inf_leave; }
1424
- have--;
1425
- hold += input[next++] << bits;
1426
- bits += 8;
1427
- }
1428
- //===//
1429
- state.flags = hold;
1430
- if ((state.flags & 0xff) !== Z_DEFLATED) {
1431
- strm.msg = 'unknown compression method';
1432
- state.mode = BAD;
1433
- break;
1434
- }
1435
- if (state.flags & 0xe000) {
1436
- strm.msg = 'unknown header flags set';
1437
- state.mode = BAD;
1438
- break;
1439
- }
1440
- if (state.head) {
1441
- state.head.text = ((hold >> 8) & 1);
1442
- }
1443
- if (state.flags & 0x0200) {
1444
- //=== CRC2(state.check, hold);
1445
- hbuf[0] = hold & 0xff;
1446
- hbuf[1] = (hold >>> 8) & 0xff;
1447
- state.check = crc32(state.check, hbuf, 2, 0);
1448
- //===//
1449
- }
1450
- //=== INITBITS();
1451
- hold = 0;
1452
- bits = 0;
1453
- //===//
1454
- state.mode = TIME;
1455
- /* falls through */
1456
- case TIME:
1457
- //=== NEEDBITS(32); */
1458
- while (bits < 32) {
1459
- if (have === 0) { break inf_leave; }
1460
- have--;
1461
- hold += input[next++] << bits;
1462
- bits += 8;
1463
- }
1464
- //===//
1465
- if (state.head) {
1466
- state.head.time = hold;
1467
- }
1468
- if (state.flags & 0x0200) {
1469
- //=== CRC4(state.check, hold)
1470
- hbuf[0] = hold & 0xff;
1471
- hbuf[1] = (hold >>> 8) & 0xff;
1472
- hbuf[2] = (hold >>> 16) & 0xff;
1473
- hbuf[3] = (hold >>> 24) & 0xff;
1474
- state.check = crc32(state.check, hbuf, 4, 0);
1475
- //===
1476
- }
1477
- //=== INITBITS();
1478
- hold = 0;
1479
- bits = 0;
1480
- //===//
1481
- state.mode = OS;
1482
- /* falls through */
1483
- case OS:
1484
- //=== NEEDBITS(16); */
1485
- while (bits < 16) {
1486
- if (have === 0) { break inf_leave; }
1487
- have--;
1488
- hold += input[next++] << bits;
1489
- bits += 8;
1490
- }
1491
- //===//
1492
- if (state.head) {
1493
- state.head.xflags = (hold & 0xff);
1494
- state.head.os = (hold >> 8);
1495
- }
1496
- if (state.flags & 0x0200) {
1497
- //=== CRC2(state.check, hold);
1498
- hbuf[0] = hold & 0xff;
1499
- hbuf[1] = (hold >>> 8) & 0xff;
1500
- state.check = crc32(state.check, hbuf, 2, 0);
1501
- //===//
1502
- }
1503
- //=== INITBITS();
1504
- hold = 0;
1505
- bits = 0;
1506
- //===//
1507
- state.mode = EXLEN;
1508
- /* falls through */
1509
- case EXLEN:
1510
- if (state.flags & 0x0400) {
1511
- //=== NEEDBITS(16); */
1512
- while (bits < 16) {
1513
- if (have === 0) { break inf_leave; }
1514
- have--;
1515
- hold += input[next++] << bits;
1516
- bits += 8;
1517
- }
1518
- //===//
1519
- state.length = hold;
1520
- if (state.head) {
1521
- state.head.extra_len = hold;
1522
- }
1523
- if (state.flags & 0x0200) {
1524
- //=== CRC2(state.check, hold);
1525
- hbuf[0] = hold & 0xff;
1526
- hbuf[1] = (hold >>> 8) & 0xff;
1527
- state.check = crc32(state.check, hbuf, 2, 0);
1528
- //===//
1529
- }
1530
- //=== INITBITS();
1531
- hold = 0;
1532
- bits = 0;
1533
- //===//
1534
- }
1535
- else if (state.head) {
1536
- state.head.extra = null/*Z_NULL*/;
1537
- }
1538
- state.mode = EXTRA;
1539
- /* falls through */
1540
- case EXTRA:
1541
- if (state.flags & 0x0400) {
1542
- copy = state.length;
1543
- if (copy > have) { copy = have; }
1544
- if (copy) {
1545
- if (state.head) {
1546
- len = state.head.extra_len - state.length;
1547
- if (!state.head.extra) {
1548
- // Use untyped array for more convenient processing later
1549
- state.head.extra = new Array(state.head.extra_len);
1550
- }
1551
- utils.arraySet(
1552
- state.head.extra,
1553
- input,
1554
- next,
1555
- // extra field is limited to 65536 bytes
1556
- // - no need for additional size check
1557
- copy,
1558
- /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
1559
- len
1560
- );
1561
- //zmemcpy(state.head.extra + len, next,
1562
- // len + copy > state.head.extra_max ?
1563
- // state.head.extra_max - len : copy);
1564
- }
1565
- if (state.flags & 0x0200) {
1566
- state.check = crc32(state.check, input, copy, next);
1567
- }
1568
- have -= copy;
1569
- next += copy;
1570
- state.length -= copy;
1571
- }
1572
- if (state.length) { break inf_leave; }
1573
- }
1574
- state.length = 0;
1575
- state.mode = NAME;
1576
- /* falls through */
1577
- case NAME:
1578
- if (state.flags & 0x0800) {
1579
- if (have === 0) { break inf_leave; }
1580
- copy = 0;
1581
- do {
1582
- // TODO: 2 or 1 bytes?
1583
- len = input[next + copy++];
1584
- /* use constant limit because in js we should not preallocate memory */
1585
- if (state.head && len &&
1586
- (state.length < 65536 /*state.head.name_max*/)) {
1587
- state.head.name += String.fromCharCode(len);
1588
- }
1589
- } while (len && copy < have);
1590
-
1591
- if (state.flags & 0x0200) {
1592
- state.check = crc32(state.check, input, copy, next);
1593
- }
1594
- have -= copy;
1595
- next += copy;
1596
- if (len) { break inf_leave; }
1597
- }
1598
- else if (state.head) {
1599
- state.head.name = null;
1600
- }
1601
- state.length = 0;
1602
- state.mode = COMMENT;
1603
- /* falls through */
1604
- case COMMENT:
1605
- if (state.flags & 0x1000) {
1606
- if (have === 0) { break inf_leave; }
1607
- copy = 0;
1608
- do {
1609
- len = input[next + copy++];
1610
- /* use constant limit because in js we should not preallocate memory */
1611
- if (state.head && len &&
1612
- (state.length < 65536 /*state.head.comm_max*/)) {
1613
- state.head.comment += String.fromCharCode(len);
1614
- }
1615
- } while (len && copy < have);
1616
- if (state.flags & 0x0200) {
1617
- state.check = crc32(state.check, input, copy, next);
1618
- }
1619
- have -= copy;
1620
- next += copy;
1621
- if (len) { break inf_leave; }
1622
- }
1623
- else if (state.head) {
1624
- state.head.comment = null;
1625
- }
1626
- state.mode = HCRC;
1627
- /* falls through */
1628
- case HCRC:
1629
- if (state.flags & 0x0200) {
1630
- //=== NEEDBITS(16); */
1631
- while (bits < 16) {
1632
- if (have === 0) { break inf_leave; }
1633
- have--;
1634
- hold += input[next++] << bits;
1635
- bits += 8;
1636
- }
1637
- //===//
1638
- if (hold !== (state.check & 0xffff)) {
1639
- strm.msg = 'header crc mismatch';
1640
- state.mode = BAD;
1641
- break;
1642
- }
1643
- //=== INITBITS();
1644
- hold = 0;
1645
- bits = 0;
1646
- //===//
1647
- }
1648
- if (state.head) {
1649
- state.head.hcrc = ((state.flags >> 9) & 1);
1650
- state.head.done = true;
1651
- }
1652
- strm.adler = state.check = 0;
1653
- state.mode = TYPE;
1654
- break;
1655
- case DICTID:
1656
- //=== NEEDBITS(32); */
1657
- while (bits < 32) {
1658
- if (have === 0) { break inf_leave; }
1659
- have--;
1660
- hold += input[next++] << bits;
1661
- bits += 8;
1662
- }
1663
- //===//
1664
- strm.adler = state.check = zswap32(hold);
1665
- //=== INITBITS();
1666
- hold = 0;
1667
- bits = 0;
1668
- //===//
1669
- state.mode = DICT;
1670
- /* falls through */
1671
- case DICT:
1672
- if (state.havedict === 0) {
1673
- //--- RESTORE() ---
1674
- strm.next_out = put;
1675
- strm.avail_out = left;
1676
- strm.next_in = next;
1677
- strm.avail_in = have;
1678
- state.hold = hold;
1679
- state.bits = bits;
1680
- //---
1681
- return Z_NEED_DICT;
1682
- }
1683
- strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
1684
- state.mode = TYPE;
1685
- /* falls through */
1686
- case TYPE:
1687
- if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
1688
- /* falls through */
1689
- case TYPEDO:
1690
- if (state.last) {
1691
- //--- BYTEBITS() ---//
1692
- hold >>>= bits & 7;
1693
- bits -= bits & 7;
1694
- //---//
1695
- state.mode = CHECK;
1696
- break;
1697
- }
1698
- //=== NEEDBITS(3); */
1699
- while (bits < 3) {
1700
- if (have === 0) { break inf_leave; }
1701
- have--;
1702
- hold += input[next++] << bits;
1703
- bits += 8;
1704
- }
1705
- //===//
1706
- state.last = (hold & 0x01)/*BITS(1)*/;
1707
- //--- DROPBITS(1) ---//
1708
- hold >>>= 1;
1709
- bits -= 1;
1710
- //---//
1711
-
1712
- switch ((hold & 0x03)/*BITS(2)*/) {
1713
- case 0: /* stored block */
1714
- //Tracev((stderr, "inflate: stored block%s\n",
1715
- // state.last ? " (last)" : ""));
1716
- state.mode = STORED;
1717
- break;
1718
- case 1: /* fixed block */
1719
- fixedtables(state);
1720
- //Tracev((stderr, "inflate: fixed codes block%s\n",
1721
- // state.last ? " (last)" : ""));
1722
- state.mode = LEN_; /* decode codes */
1723
- if (flush === Z_TREES) {
1724
- //--- DROPBITS(2) ---//
1725
- hold >>>= 2;
1726
- bits -= 2;
1727
- //---//
1728
- break inf_leave;
1729
- }
1730
- break;
1731
- case 2: /* dynamic block */
1732
- //Tracev((stderr, "inflate: dynamic codes block%s\n",
1733
- // state.last ? " (last)" : ""));
1734
- state.mode = TABLE;
1735
- break;
1736
- case 3:
1737
- strm.msg = 'invalid block type';
1738
- state.mode = BAD;
1739
- }
1740
- //--- DROPBITS(2) ---//
1741
- hold >>>= 2;
1742
- bits -= 2;
1743
- //---//
1744
- break;
1745
- case STORED:
1746
- //--- BYTEBITS() ---// /* go to byte boundary */
1747
- hold >>>= bits & 7;
1748
- bits -= bits & 7;
1749
- //---//
1750
- //=== NEEDBITS(32); */
1751
- while (bits < 32) {
1752
- if (have === 0) { break inf_leave; }
1753
- have--;
1754
- hold += input[next++] << bits;
1755
- bits += 8;
1756
- }
1757
- //===//
1758
- if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
1759
- strm.msg = 'invalid stored block lengths';
1760
- state.mode = BAD;
1761
- break;
1762
- }
1763
- state.length = hold & 0xffff;
1764
- //Tracev((stderr, "inflate: stored length %u\n",
1765
- // state.length));
1766
- //=== INITBITS();
1767
- hold = 0;
1768
- bits = 0;
1769
- //===//
1770
- state.mode = COPY_;
1771
- if (flush === Z_TREES) { break inf_leave; }
1772
- /* falls through */
1773
- case COPY_:
1774
- state.mode = COPY;
1775
- /* falls through */
1776
- case COPY:
1777
- copy = state.length;
1778
- if (copy) {
1779
- if (copy > have) { copy = have; }
1780
- if (copy > left) { copy = left; }
1781
- if (copy === 0) { break inf_leave; }
1782
- //--- zmemcpy(put, next, copy); ---
1783
- utils.arraySet(output, input, next, copy, put);
1784
- //---//
1785
- have -= copy;
1786
- next += copy;
1787
- left -= copy;
1788
- put += copy;
1789
- state.length -= copy;
1790
- break;
1791
- }
1792
- //Tracev((stderr, "inflate: stored end\n"));
1793
- state.mode = TYPE;
1794
- break;
1795
- case TABLE:
1796
- //=== NEEDBITS(14); */
1797
- while (bits < 14) {
1798
- if (have === 0) { break inf_leave; }
1799
- have--;
1800
- hold += input[next++] << bits;
1801
- bits += 8;
1802
- }
1803
- //===//
1804
- state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
1805
- //--- DROPBITS(5) ---//
1806
- hold >>>= 5;
1807
- bits -= 5;
1808
- //---//
1809
- state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
1810
- //--- DROPBITS(5) ---//
1811
- hold >>>= 5;
1812
- bits -= 5;
1813
- //---//
1814
- state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
1815
- //--- DROPBITS(4) ---//
1816
- hold >>>= 4;
1817
- bits -= 4;
1818
- //---//
1819
- //#ifndef PKZIP_BUG_WORKAROUND
1820
- if (state.nlen > 286 || state.ndist > 30) {
1821
- strm.msg = 'too many length or distance symbols';
1822
- state.mode = BAD;
1823
- break;
1824
- }
1825
- //#endif
1826
- //Tracev((stderr, "inflate: table sizes ok\n"));
1827
- state.have = 0;
1828
- state.mode = LENLENS;
1829
- /* falls through */
1830
- case LENLENS:
1831
- while (state.have < state.ncode) {
1832
- //=== NEEDBITS(3);
1833
- while (bits < 3) {
1834
- if (have === 0) { break inf_leave; }
1835
- have--;
1836
- hold += input[next++] << bits;
1837
- bits += 8;
1838
- }
1839
- //===//
1840
- state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
1841
- //--- DROPBITS(3) ---//
1842
- hold >>>= 3;
1843
- bits -= 3;
1844
- //---//
1845
- }
1846
- while (state.have < 19) {
1847
- state.lens[order[state.have++]] = 0;
1848
- }
1849
- // We have separate tables & no pointers. 2 commented lines below not needed.
1850
- //state.next = state.codes;
1851
- //state.lencode = state.next;
1852
- // Switch to use dynamic table
1853
- state.lencode = state.lendyn;
1854
- state.lenbits = 7;
1855
-
1856
- opts = { bits: state.lenbits };
1857
- ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
1858
- state.lenbits = opts.bits;
1859
-
1860
- if (ret) {
1861
- strm.msg = 'invalid code lengths set';
1862
- state.mode = BAD;
1863
- break;
1864
- }
1865
- //Tracev((stderr, "inflate: code lengths ok\n"));
1866
- state.have = 0;
1867
- state.mode = CODELENS;
1868
- /* falls through */
1869
- case CODELENS:
1870
- while (state.have < state.nlen + state.ndist) {
1871
- for (;;) {
1872
- here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
1873
- here_bits = here >>> 24;
1874
- here_op = (here >>> 16) & 0xff;
1875
- here_val = here & 0xffff;
1876
-
1877
- if ((here_bits) <= bits) { break; }
1878
- //--- PULLBYTE() ---//
1879
- if (have === 0) { break inf_leave; }
1880
- have--;
1881
- hold += input[next++] << bits;
1882
- bits += 8;
1883
- //---//
1884
- }
1885
- if (here_val < 16) {
1886
- //--- DROPBITS(here.bits) ---//
1887
- hold >>>= here_bits;
1888
- bits -= here_bits;
1889
- //---//
1890
- state.lens[state.have++] = here_val;
1891
- }
1892
- else {
1893
- if (here_val === 16) {
1894
- //=== NEEDBITS(here.bits + 2);
1895
- n = here_bits + 2;
1896
- while (bits < n) {
1897
- if (have === 0) { break inf_leave; }
1898
- have--;
1899
- hold += input[next++] << bits;
1900
- bits += 8;
1901
- }
1902
- //===//
1903
- //--- DROPBITS(here.bits) ---//
1904
- hold >>>= here_bits;
1905
- bits -= here_bits;
1906
- //---//
1907
- if (state.have === 0) {
1908
- strm.msg = 'invalid bit length repeat';
1909
- state.mode = BAD;
1910
- break;
1911
- }
1912
- len = state.lens[state.have - 1];
1913
- copy = 3 + (hold & 0x03);//BITS(2);
1914
- //--- DROPBITS(2) ---//
1915
- hold >>>= 2;
1916
- bits -= 2;
1917
- //---//
1918
- }
1919
- else if (here_val === 17) {
1920
- //=== NEEDBITS(here.bits + 3);
1921
- n = here_bits + 3;
1922
- while (bits < n) {
1923
- if (have === 0) { break inf_leave; }
1924
- have--;
1925
- hold += input[next++] << bits;
1926
- bits += 8;
1927
- }
1928
- //===//
1929
- //--- DROPBITS(here.bits) ---//
1930
- hold >>>= here_bits;
1931
- bits -= here_bits;
1932
- //---//
1933
- len = 0;
1934
- copy = 3 + (hold & 0x07);//BITS(3);
1935
- //--- DROPBITS(3) ---//
1936
- hold >>>= 3;
1937
- bits -= 3;
1938
- //---//
1939
- }
1940
- else {
1941
- //=== NEEDBITS(here.bits + 7);
1942
- n = here_bits + 7;
1943
- while (bits < n) {
1944
- if (have === 0) { break inf_leave; }
1945
- have--;
1946
- hold += input[next++] << bits;
1947
- bits += 8;
1948
- }
1949
- //===//
1950
- //--- DROPBITS(here.bits) ---//
1951
- hold >>>= here_bits;
1952
- bits -= here_bits;
1953
- //---//
1954
- len = 0;
1955
- copy = 11 + (hold & 0x7f);//BITS(7);
1956
- //--- DROPBITS(7) ---//
1957
- hold >>>= 7;
1958
- bits -= 7;
1959
- //---//
1960
- }
1961
- if (state.have + copy > state.nlen + state.ndist) {
1962
- strm.msg = 'invalid bit length repeat';
1963
- state.mode = BAD;
1964
- break;
1965
- }
1966
- while (copy--) {
1967
- state.lens[state.have++] = len;
1968
- }
1969
- }
1970
- }
1971
-
1972
- /* handle error breaks in while */
1973
- if (state.mode === BAD) { break; }
1974
-
1975
- /* check for end-of-block code (better have one) */
1976
- if (state.lens[256] === 0) {
1977
- strm.msg = 'invalid code -- missing end-of-block';
1978
- state.mode = BAD;
1979
- break;
1980
- }
1981
-
1982
- /* build code tables -- note: do not change the lenbits or distbits
1983
- values here (9 and 6) without reading the comments in inftrees.h
1984
- concerning the ENOUGH constants, which depend on those values */
1985
- state.lenbits = 9;
1986
-
1987
- opts = { bits: state.lenbits };
1988
- ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
1989
- // We have separate tables & no pointers. 2 commented lines below not needed.
1990
- // state.next_index = opts.table_index;
1991
- state.lenbits = opts.bits;
1992
- // state.lencode = state.next;
1993
-
1994
- if (ret) {
1995
- strm.msg = 'invalid literal/lengths set';
1996
- state.mode = BAD;
1997
- break;
1998
- }
1999
-
2000
- state.distbits = 6;
2001
- //state.distcode.copy(state.codes);
2002
- // Switch to use dynamic table
2003
- state.distcode = state.distdyn;
2004
- opts = { bits: state.distbits };
2005
- ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
2006
- // We have separate tables & no pointers. 2 commented lines below not needed.
2007
- // state.next_index = opts.table_index;
2008
- state.distbits = opts.bits;
2009
- // state.distcode = state.next;
2010
-
2011
- if (ret) {
2012
- strm.msg = 'invalid distances set';
2013
- state.mode = BAD;
2014
- break;
2015
- }
2016
- //Tracev((stderr, 'inflate: codes ok\n'));
2017
- state.mode = LEN_;
2018
- if (flush === Z_TREES) { break inf_leave; }
2019
- /* falls through */
2020
- case LEN_:
2021
- state.mode = LEN;
2022
- /* falls through */
2023
- case LEN:
2024
- if (have >= 6 && left >= 258) {
2025
- //--- RESTORE() ---
2026
- strm.next_out = put;
2027
- strm.avail_out = left;
2028
- strm.next_in = next;
2029
- strm.avail_in = have;
2030
- state.hold = hold;
2031
- state.bits = bits;
2032
- //---
2033
- inflate_fast(strm, _out);
2034
- //--- LOAD() ---
2035
- put = strm.next_out;
2036
- output = strm.output;
2037
- left = strm.avail_out;
2038
- next = strm.next_in;
2039
- input = strm.input;
2040
- have = strm.avail_in;
2041
- hold = state.hold;
2042
- bits = state.bits;
2043
- //---
2044
-
2045
- if (state.mode === TYPE) {
2046
- state.back = -1;
2047
- }
2048
- break;
2049
- }
2050
- state.back = 0;
2051
- for (;;) {
2052
- here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/
2053
- here_bits = here >>> 24;
2054
- here_op = (here >>> 16) & 0xff;
2055
- here_val = here & 0xffff;
2056
-
2057
- if (here_bits <= bits) { break; }
2058
- //--- PULLBYTE() ---//
2059
- if (have === 0) { break inf_leave; }
2060
- have--;
2061
- hold += input[next++] << bits;
2062
- bits += 8;
2063
- //---//
2064
- }
2065
- if (here_op && (here_op & 0xf0) === 0) {
2066
- last_bits = here_bits;
2067
- last_op = here_op;
2068
- last_val = here_val;
2069
- for (;;) {
2070
- here = state.lencode[last_val +
2071
- ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
2072
- here_bits = here >>> 24;
2073
- here_op = (here >>> 16) & 0xff;
2074
- here_val = here & 0xffff;
2075
-
2076
- if ((last_bits + here_bits) <= bits) { break; }
2077
- //--- PULLBYTE() ---//
2078
- if (have === 0) { break inf_leave; }
2079
- have--;
2080
- hold += input[next++] << bits;
2081
- bits += 8;
2082
- //---//
2083
- }
2084
- //--- DROPBITS(last.bits) ---//
2085
- hold >>>= last_bits;
2086
- bits -= last_bits;
2087
- //---//
2088
- state.back += last_bits;
2089
- }
2090
- //--- DROPBITS(here.bits) ---//
2091
- hold >>>= here_bits;
2092
- bits -= here_bits;
2093
- //---//
2094
- state.back += here_bits;
2095
- state.length = here_val;
2096
- if (here_op === 0) {
2097
- //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
2098
- // "inflate: literal '%c'\n" :
2099
- // "inflate: literal 0x%02x\n", here.val));
2100
- state.mode = LIT;
2101
- break;
2102
- }
2103
- if (here_op & 32) {
2104
- //Tracevv((stderr, "inflate: end of block\n"));
2105
- state.back = -1;
2106
- state.mode = TYPE;
2107
- break;
2108
- }
2109
- if (here_op & 64) {
2110
- strm.msg = 'invalid literal/length code';
2111
- state.mode = BAD;
2112
- break;
2113
- }
2114
- state.extra = here_op & 15;
2115
- state.mode = LENEXT;
2116
- /* falls through */
2117
- case LENEXT:
2118
- if (state.extra) {
2119
- //=== NEEDBITS(state.extra);
2120
- n = state.extra;
2121
- while (bits < n) {
2122
- if (have === 0) { break inf_leave; }
2123
- have--;
2124
- hold += input[next++] << bits;
2125
- bits += 8;
2126
- }
2127
- //===//
2128
- state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
2129
- //--- DROPBITS(state.extra) ---//
2130
- hold >>>= state.extra;
2131
- bits -= state.extra;
2132
- //---//
2133
- state.back += state.extra;
2134
- }
2135
- //Tracevv((stderr, "inflate: length %u\n", state.length));
2136
- state.was = state.length;
2137
- state.mode = DIST;
2138
- /* falls through */
2139
- case DIST:
2140
- for (;;) {
2141
- here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
2142
- here_bits = here >>> 24;
2143
- here_op = (here >>> 16) & 0xff;
2144
- here_val = here & 0xffff;
2145
-
2146
- if ((here_bits) <= bits) { break; }
2147
- //--- PULLBYTE() ---//
2148
- if (have === 0) { break inf_leave; }
2149
- have--;
2150
- hold += input[next++] << bits;
2151
- bits += 8;
2152
- //---//
2153
- }
2154
- if ((here_op & 0xf0) === 0) {
2155
- last_bits = here_bits;
2156
- last_op = here_op;
2157
- last_val = here_val;
2158
- for (;;) {
2159
- here = state.distcode[last_val +
2160
- ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
2161
- here_bits = here >>> 24;
2162
- here_op = (here >>> 16) & 0xff;
2163
- here_val = here & 0xffff;
2164
-
2165
- if ((last_bits + here_bits) <= bits) { break; }
2166
- //--- PULLBYTE() ---//
2167
- if (have === 0) { break inf_leave; }
2168
- have--;
2169
- hold += input[next++] << bits;
2170
- bits += 8;
2171
- //---//
2172
- }
2173
- //--- DROPBITS(last.bits) ---//
2174
- hold >>>= last_bits;
2175
- bits -= last_bits;
2176
- //---//
2177
- state.back += last_bits;
2178
- }
2179
- //--- DROPBITS(here.bits) ---//
2180
- hold >>>= here_bits;
2181
- bits -= here_bits;
2182
- //---//
2183
- state.back += here_bits;
2184
- if (here_op & 64) {
2185
- strm.msg = 'invalid distance code';
2186
- state.mode = BAD;
2187
- break;
2188
- }
2189
- state.offset = here_val;
2190
- state.extra = (here_op) & 15;
2191
- state.mode = DISTEXT;
2192
- /* falls through */
2193
- case DISTEXT:
2194
- if (state.extra) {
2195
- //=== NEEDBITS(state.extra);
2196
- n = state.extra;
2197
- while (bits < n) {
2198
- if (have === 0) { break inf_leave; }
2199
- have--;
2200
- hold += input[next++] << bits;
2201
- bits += 8;
2202
- }
2203
- //===//
2204
- state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
2205
- //--- DROPBITS(state.extra) ---//
2206
- hold >>>= state.extra;
2207
- bits -= state.extra;
2208
- //---//
2209
- state.back += state.extra;
2210
- }
2211
- //#ifdef INFLATE_STRICT
2212
- if (state.offset > state.dmax) {
2213
- strm.msg = 'invalid distance too far back';
2214
- state.mode = BAD;
2215
- break;
2216
- }
2217
- //#endif
2218
- //Tracevv((stderr, "inflate: distance %u\n", state.offset));
2219
- state.mode = MATCH;
2220
- /* falls through */
2221
- case MATCH:
2222
- if (left === 0) { break inf_leave; }
2223
- copy = _out - left;
2224
- if (state.offset > copy) { /* copy from window */
2225
- copy = state.offset - copy;
2226
- if (copy > state.whave) {
2227
- if (state.sane) {
2228
- strm.msg = 'invalid distance too far back';
2229
- state.mode = BAD;
2230
- break;
2231
- }
2232
- // (!) This block is disabled in zlib defaults,
2233
- // don't enable it for binary compatibility
2234
- //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
2235
- // Trace((stderr, "inflate.c too far\n"));
2236
- // copy -= state.whave;
2237
- // if (copy > state.length) { copy = state.length; }
2238
- // if (copy > left) { copy = left; }
2239
- // left -= copy;
2240
- // state.length -= copy;
2241
- // do {
2242
- // output[put++] = 0;
2243
- // } while (--copy);
2244
- // if (state.length === 0) { state.mode = LEN; }
2245
- // break;
2246
- //#endif
2247
- }
2248
- if (copy > state.wnext) {
2249
- copy -= state.wnext;
2250
- from = state.wsize - copy;
2251
- }
2252
- else {
2253
- from = state.wnext - copy;
2254
- }
2255
- if (copy > state.length) { copy = state.length; }
2256
- from_source = state.window;
2257
- }
2258
- else { /* copy from output */
2259
- from_source = output;
2260
- from = put - state.offset;
2261
- copy = state.length;
2262
- }
2263
- if (copy > left) { copy = left; }
2264
- left -= copy;
2265
- state.length -= copy;
2266
- do {
2267
- output[put++] = from_source[from++];
2268
- } while (--copy);
2269
- if (state.length === 0) { state.mode = LEN; }
2270
- break;
2271
- case LIT:
2272
- if (left === 0) { break inf_leave; }
2273
- output[put++] = state.length;
2274
- left--;
2275
- state.mode = LEN;
2276
- break;
2277
- case CHECK:
2278
- if (state.wrap) {
2279
- //=== NEEDBITS(32);
2280
- while (bits < 32) {
2281
- if (have === 0) { break inf_leave; }
2282
- have--;
2283
- // Use '|' instead of '+' to make sure that result is signed
2284
- hold |= input[next++] << bits;
2285
- bits += 8;
2286
- }
2287
- //===//
2288
- _out -= left;
2289
- strm.total_out += _out;
2290
- state.total += _out;
2291
- if (_out) {
2292
- strm.adler = state.check =
2293
- /*UPDATE(state.check, put - _out, _out);*/
2294
- (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
2295
-
2296
- }
2297
- _out = left;
2298
- // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
2299
- if ((state.flags ? hold : zswap32(hold)) !== state.check) {
2300
- strm.msg = 'incorrect data check';
2301
- state.mode = BAD;
2302
- break;
2303
- }
2304
- //=== INITBITS();
2305
- hold = 0;
2306
- bits = 0;
2307
- //===//
2308
- //Tracev((stderr, "inflate: check matches trailer\n"));
2309
- }
2310
- state.mode = LENGTH;
2311
- /* falls through */
2312
- case LENGTH:
2313
- if (state.wrap && state.flags) {
2314
- //=== NEEDBITS(32);
2315
- while (bits < 32) {
2316
- if (have === 0) { break inf_leave; }
2317
- have--;
2318
- hold += input[next++] << bits;
2319
- bits += 8;
2320
- }
2321
- //===//
2322
- if (hold !== (state.total & 0xffffffff)) {
2323
- strm.msg = 'incorrect length check';
2324
- state.mode = BAD;
2325
- break;
2326
- }
2327
- //=== INITBITS();
2328
- hold = 0;
2329
- bits = 0;
2330
- //===//
2331
- //Tracev((stderr, "inflate: length matches trailer\n"));
2332
- }
2333
- state.mode = DONE;
2334
- /* falls through */
2335
- case DONE:
2336
- ret = Z_STREAM_END;
2337
- break inf_leave;
2338
- case BAD:
2339
- ret = Z_DATA_ERROR;
2340
- break inf_leave;
2341
- case MEM:
2342
- return Z_MEM_ERROR;
2343
- case SYNC:
2344
- /* falls through */
2345
- default:
2346
- return Z_STREAM_ERROR;
2347
- }
2348
- }
2349
-
2350
- // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
2351
-
2352
- /*
2353
- Return from inflate(), updating the total counts and the check value.
2354
- If there was no progress during the inflate() call, return a buffer
2355
- error. Call updatewindow() to create and/or update the window state.
2356
- Note: a memory error from inflate() is non-recoverable.
2357
- */
2358
-
2359
- //--- RESTORE() ---
2360
- strm.next_out = put;
2361
- strm.avail_out = left;
2362
- strm.next_in = next;
2363
- strm.avail_in = have;
2364
- state.hold = hold;
2365
- state.bits = bits;
2366
- //---
2367
-
2368
- if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
2369
- (state.mode < CHECK || flush !== Z_FINISH))) {
2370
- if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
2371
- state.mode = MEM;
2372
- return Z_MEM_ERROR;
2373
- }
2374
- }
2375
- _in -= strm.avail_in;
2376
- _out -= strm.avail_out;
2377
- strm.total_in += _in;
2378
- strm.total_out += _out;
2379
- state.total += _out;
2380
- if (state.wrap && _out) {
2381
- strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
2382
- (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
2383
- }
2384
- strm.data_type = state.bits + (state.last ? 64 : 0) +
2385
- (state.mode === TYPE ? 128 : 0) +
2386
- (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
2387
- if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
2388
- ret = Z_BUF_ERROR;
2389
- }
2390
- return ret;
2391
- }
2392
-
2393
- function inflateEnd(strm) {
2394
-
2395
- if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
2396
- return Z_STREAM_ERROR;
2397
- }
2398
-
2399
- var state = strm.state;
2400
- if (state.window) {
2401
- state.window = null;
2402
- }
2403
- strm.state = null;
2404
- return Z_OK;
2405
- }
2406
-
2407
- function inflateGetHeader(strm, head) {
2408
- var state;
2409
-
2410
- /* check state */
2411
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
2412
- state = strm.state;
2413
- if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
2414
-
2415
- /* save header structure */
2416
- state.head = head;
2417
- head.done = false;
2418
- return Z_OK;
2419
- }
2420
-
2421
- function inflateSetDictionary(strm, dictionary) {
2422
- var dictLength = dictionary.length;
2423
-
2424
- var state;
2425
- var dictid;
2426
- var ret;
2427
-
2428
- /* check state */
2429
- if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
2430
- state = strm.state;
2431
-
2432
- if (state.wrap !== 0 && state.mode !== DICT) {
2433
- return Z_STREAM_ERROR;
2434
- }
2435
-
2436
- /* check for correct dictionary identifier */
2437
- if (state.mode === DICT) {
2438
- dictid = 1; /* adler32(0, null, 0)*/
2439
- /* dictid = adler32(dictid, dictionary, dictLength); */
2440
- dictid = adler32(dictid, dictionary, dictLength, 0);
2441
- if (dictid !== state.check) {
2442
- return Z_DATA_ERROR;
2443
- }
2444
- }
2445
- /* copy dictionary to window using updatewindow(), which will amend the
2446
- existing dictionary if appropriate */
2447
- ret = updatewindow(strm, dictionary, dictLength, dictLength);
2448
- if (ret) {
2449
- state.mode = MEM;
2450
- return Z_MEM_ERROR;
2451
- }
2452
- state.havedict = 1;
2453
- // Tracev((stderr, "inflate: dictionary set\n"));
2454
- return Z_OK;
2455
- }
2456
-
2457
- exports.inflateReset = inflateReset;
2458
- exports.inflateReset2 = inflateReset2;
2459
- exports.inflateResetKeep = inflateResetKeep;
2460
- exports.inflateInit = inflateInit;
2461
- exports.inflateInit2 = inflateInit2;
2462
- exports.inflate = inflate;
2463
- exports.inflateEnd = inflateEnd;
2464
- exports.inflateGetHeader = inflateGetHeader;
2465
- exports.inflateSetDictionary = inflateSetDictionary;
2466
- exports.inflateInfo = 'pako inflate (from Nodeca project)';
2467
-
2468
- /* Not implemented
2469
- exports.inflateCopy = inflateCopy;
2470
- exports.inflateGetDictionary = inflateGetDictionary;
2471
- exports.inflateMark = inflateMark;
2472
- exports.inflatePrime = inflatePrime;
2473
- exports.inflateSync = inflateSync;
2474
- exports.inflateSyncPoint = inflateSyncPoint;
2475
- exports.inflateUndermine = inflateUndermine;
2476
- */
2477
-
2478
- },{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(require,module,exports){
2479
- 'use strict';
2480
-
2481
- // (C) 1995-2013 Jean-loup Gailly and Mark Adler
2482
- // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
2483
- //
2484
- // This software is provided 'as-is', without any express or implied
2485
- // warranty. In no event will the authors be held liable for any damages
2486
- // arising from the use of this software.
2487
- //
2488
- // Permission is granted to anyone to use this software for any purpose,
2489
- // including commercial applications, and to alter it and redistribute it
2490
- // freely, subject to the following restrictions:
2491
- //
2492
- // 1. The origin of this software must not be misrepresented; you must not
2493
- // claim that you wrote the original software. If you use this software
2494
- // in a product, an acknowledgment in the product documentation would be
2495
- // appreciated but is not required.
2496
- // 2. Altered source versions must be plainly marked as such, and must not be
2497
- // misrepresented as being the original software.
2498
- // 3. This notice may not be removed or altered from any source distribution.
2499
-
2500
- var utils = require('../utils/common');
2501
-
2502
- var MAXBITS = 15;
2503
- var ENOUGH_LENS = 852;
2504
- var ENOUGH_DISTS = 592;
2505
- //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
2506
-
2507
- var CODES = 0;
2508
- var LENS = 1;
2509
- var DISTS = 2;
2510
-
2511
- var lbase = [ /* Length codes 257..285 base */
2512
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
2513
- 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
2514
- ];
2515
-
2516
- var lext = [ /* Length codes 257..285 extra */
2517
- 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
2518
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
2519
- ];
2520
-
2521
- var dbase = [ /* Distance codes 0..29 base */
2522
- 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
2523
- 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
2524
- 8193, 12289, 16385, 24577, 0, 0
2525
- ];
2526
-
2527
- var dext = [ /* Distance codes 0..29 extra */
2528
- 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
2529
- 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
2530
- 28, 28, 29, 29, 64, 64
2531
- ];
2532
-
2533
- module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
2534
- {
2535
- var bits = opts.bits;
2536
- //here = opts.here; /* table entry for duplication */
2537
-
2538
- var len = 0; /* a code's length in bits */
2539
- var sym = 0; /* index of code symbols */
2540
- var min = 0, max = 0; /* minimum and maximum code lengths */
2541
- var root = 0; /* number of index bits for root table */
2542
- var curr = 0; /* number of index bits for current table */
2543
- var drop = 0; /* code bits to drop for sub-table */
2544
- var left = 0; /* number of prefix codes available */
2545
- var used = 0; /* code entries in table used */
2546
- var huff = 0; /* Huffman code */
2547
- var incr; /* for incrementing code, index */
2548
- var fill; /* index for replicating entries */
2549
- var low; /* low bits for current root entry */
2550
- var mask; /* mask for low root bits */
2551
- var next; /* next available space in table */
2552
- var base = null; /* base value table to use */
2553
- var base_index = 0;
2554
- // var shoextra; /* extra bits table to use */
2555
- var end; /* use base and extra for symbol > end */
2556
- var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */
2557
- var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */
2558
- var extra = null;
2559
- var extra_index = 0;
2560
-
2561
- var here_bits, here_op, here_val;
2562
-
2563
- /*
2564
- Process a set of code lengths to create a canonical Huffman code. The
2565
- code lengths are lens[0..codes-1]. Each length corresponds to the
2566
- symbols 0..codes-1. The Huffman code is generated by first sorting the
2567
- symbols by length from short to long, and retaining the symbol order
2568
- for codes with equal lengths. Then the code starts with all zero bits
2569
- for the first code of the shortest length, and the codes are integer
2570
- increments for the same length, and zeros are appended as the length
2571
- increases. For the deflate format, these bits are stored backwards
2572
- from their more natural integer increment ordering, and so when the
2573
- decoding tables are built in the large loop below, the integer codes
2574
- are incremented backwards.
2575
-
2576
- This routine assumes, but does not check, that all of the entries in
2577
- lens[] are in the range 0..MAXBITS. The caller must assure this.
2578
- 1..MAXBITS is interpreted as that code length. zero means that that
2579
- symbol does not occur in this code.
2580
-
2581
- The codes are sorted by computing a count of codes for each length,
2582
- creating from that a table of starting indices for each length in the
2583
- sorted table, and then entering the symbols in order in the sorted
2584
- table. The sorted table is work[], with that space being provided by
2585
- the caller.
2586
-
2587
- The length counts are used for other purposes as well, i.e. finding
2588
- the minimum and maximum length codes, determining if there are any
2589
- codes at all, checking for a valid set of lengths, and looking ahead
2590
- at length counts to determine sub-table sizes when building the
2591
- decoding tables.
2592
- */
2593
-
2594
- /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
2595
- for (len = 0; len <= MAXBITS; len++) {
2596
- count[len] = 0;
2597
- }
2598
- for (sym = 0; sym < codes; sym++) {
2599
- count[lens[lens_index + sym]]++;
2600
- }
2601
-
2602
- /* bound code lengths, force root to be within code lengths */
2603
- root = bits;
2604
- for (max = MAXBITS; max >= 1; max--) {
2605
- if (count[max] !== 0) { break; }
2606
- }
2607
- if (root > max) {
2608
- root = max;
2609
- }
2610
- if (max === 0) { /* no symbols to code at all */
2611
- //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
2612
- //table.bits[opts.table_index] = 1; //here.bits = (var char)1;
2613
- //table.val[opts.table_index++] = 0; //here.val = (var short)0;
2614
- table[table_index++] = (1 << 24) | (64 << 16) | 0;
2615
-
2616
-
2617
- //table.op[opts.table_index] = 64;
2618
- //table.bits[opts.table_index] = 1;
2619
- //table.val[opts.table_index++] = 0;
2620
- table[table_index++] = (1 << 24) | (64 << 16) | 0;
2621
-
2622
- opts.bits = 1;
2623
- return 0; /* no symbols, but wait for decoding to report error */
2624
- }
2625
- for (min = 1; min < max; min++) {
2626
- if (count[min] !== 0) { break; }
2627
- }
2628
- if (root < min) {
2629
- root = min;
2630
- }
2631
-
2632
- /* check for an over-subscribed or incomplete set of lengths */
2633
- left = 1;
2634
- for (len = 1; len <= MAXBITS; len++) {
2635
- left <<= 1;
2636
- left -= count[len];
2637
- if (left < 0) {
2638
- return -1;
2639
- } /* over-subscribed */
2640
- }
2641
- if (left > 0 && (type === CODES || max !== 1)) {
2642
- return -1; /* incomplete set */
2643
- }
2644
-
2645
- /* generate offsets into symbol table for each length for sorting */
2646
- offs[1] = 0;
2647
- for (len = 1; len < MAXBITS; len++) {
2648
- offs[len + 1] = offs[len] + count[len];
2649
- }
2650
-
2651
- /* sort symbols by length, by symbol order within each length */
2652
- for (sym = 0; sym < codes; sym++) {
2653
- if (lens[lens_index + sym] !== 0) {
2654
- work[offs[lens[lens_index + sym]]++] = sym;
2655
- }
2656
- }
2657
-
2658
- /*
2659
- Create and fill in decoding tables. In this loop, the table being
2660
- filled is at next and has curr index bits. The code being used is huff
2661
- with length len. That code is converted to an index by dropping drop
2662
- bits off of the bottom. For codes where len is less than drop + curr,
2663
- those top drop + curr - len bits are incremented through all values to
2664
- fill the table with replicated entries.
2665
-
2666
- root is the number of index bits for the root table. When len exceeds
2667
- root, sub-tables are created pointed to by the root entry with an index
2668
- of the low root bits of huff. This is saved in low to check for when a
2669
- new sub-table should be started. drop is zero when the root table is
2670
- being filled, and drop is root when sub-tables are being filled.
2671
-
2672
- When a new sub-table is needed, it is necessary to look ahead in the
2673
- code lengths to determine what size sub-table is needed. The length
2674
- counts are used for this, and so count[] is decremented as codes are
2675
- entered in the tables.
2676
-
2677
- used keeps track of how many table entries have been allocated from the
2678
- provided *table space. It is checked for LENS and DIST tables against
2679
- the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
2680
- the initial root table size constants. See the comments in inftrees.h
2681
- for more information.
2682
-
2683
- sym increments through all symbols, and the loop terminates when
2684
- all codes of length max, i.e. all codes, have been processed. This
2685
- routine permits incomplete codes, so another loop after this one fills
2686
- in the rest of the decoding tables with invalid code markers.
2687
- */
2688
-
2689
- /* set up for code type */
2690
- // poor man optimization - use if-else instead of switch,
2691
- // to avoid deopts in old v8
2692
- if (type === CODES) {
2693
- base = extra = work; /* dummy value--not used */
2694
- end = 19;
2695
-
2696
- } else if (type === LENS) {
2697
- base = lbase;
2698
- base_index -= 257;
2699
- extra = lext;
2700
- extra_index -= 257;
2701
- end = 256;
2702
-
2703
- } else { /* DISTS */
2704
- base = dbase;
2705
- extra = dext;
2706
- end = -1;
2707
- }
2708
-
2709
- /* initialize opts for loop */
2710
- huff = 0; /* starting code */
2711
- sym = 0; /* starting code symbol */
2712
- len = min; /* starting code length */
2713
- next = table_index; /* current table to fill in */
2714
- curr = root; /* current table index bits */
2715
- drop = 0; /* current bits to drop from code for index */
2716
- low = -1; /* trigger new sub-table when len > root */
2717
- used = 1 << root; /* use root table entries */
2718
- mask = used - 1; /* mask for comparing low */
2719
-
2720
- /* check available table space */
2721
- if ((type === LENS && used > ENOUGH_LENS) ||
2722
- (type === DISTS && used > ENOUGH_DISTS)) {
2723
- return 1;
2724
- }
2725
-
2726
- /* process all codes and make table entries */
2727
- for (;;) {
2728
- /* create table entry */
2729
- here_bits = len - drop;
2730
- if (work[sym] < end) {
2731
- here_op = 0;
2732
- here_val = work[sym];
2733
- }
2734
- else if (work[sym] > end) {
2735
- here_op = extra[extra_index + work[sym]];
2736
- here_val = base[base_index + work[sym]];
2737
- }
2738
- else {
2739
- here_op = 32 + 64; /* end of block */
2740
- here_val = 0;
2741
- }
2742
-
2743
- /* replicate for those indices with low len bits equal to huff */
2744
- incr = 1 << (len - drop);
2745
- fill = 1 << curr;
2746
- min = fill; /* save offset to next table */
2747
- do {
2748
- fill -= incr;
2749
- table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
2750
- } while (fill !== 0);
2751
-
2752
- /* backwards increment the len-bit code huff */
2753
- incr = 1 << (len - 1);
2754
- while (huff & incr) {
2755
- incr >>= 1;
2756
- }
2757
- if (incr !== 0) {
2758
- huff &= incr - 1;
2759
- huff += incr;
2760
- } else {
2761
- huff = 0;
2762
- }
2763
-
2764
- /* go to next symbol, update count, len */
2765
- sym++;
2766
- if (--count[len] === 0) {
2767
- if (len === max) { break; }
2768
- len = lens[lens_index + work[sym]];
2769
- }
2770
-
2771
- /* create new sub-table if needed */
2772
- if (len > root && (huff & mask) !== low) {
2773
- /* if first time, transition to sub-tables */
2774
- if (drop === 0) {
2775
- drop = root;
2776
- }
2777
-
2778
- /* increment past last table */
2779
- next += min; /* here min is 1 << curr */
2780
-
2781
- /* determine length of next table */
2782
- curr = len - drop;
2783
- left = 1 << curr;
2784
- while (curr + drop < max) {
2785
- left -= count[curr + drop];
2786
- if (left <= 0) { break; }
2787
- curr++;
2788
- left <<= 1;
2789
- }
2790
-
2791
- /* check for enough space */
2792
- used += 1 << curr;
2793
- if ((type === LENS && used > ENOUGH_LENS) ||
2794
- (type === DISTS && used > ENOUGH_DISTS)) {
2795
- return 1;
2796
- }
2797
-
2798
- /* point entry in root table to sub-table */
2799
- low = huff & mask;
2800
- /*table.op[low] = curr;
2801
- table.bits[low] = root;
2802
- table.val[low] = next - opts.table_index;*/
2803
- table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
2804
- }
2805
- }
2806
-
2807
- /* fill in remaining table entry if code is incomplete (guaranteed to have
2808
- at most one remaining entry, since if the code is incomplete, the
2809
- maximum code length that was allowed to get this far is one bit) */
2810
- if (huff !== 0) {
2811
- //table.op[next + huff] = 64; /* invalid code marker */
2812
- //table.bits[next + huff] = len - drop;
2813
- //table.val[next + huff] = 0;
2814
- table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
2815
- }
2816
-
2817
- /* set return parameters */
2818
- //opts.table_index += used;
2819
- opts.bits = root;
2820
- return 0;
2821
- };
2822
-
2823
- },{"../utils/common":1}],10:[function(require,module,exports){
2824
- 'use strict';
2825
-
2826
- // (C) 1995-2013 Jean-loup Gailly and Mark Adler
2827
- // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
2828
- //
2829
- // This software is provided 'as-is', without any express or implied
2830
- // warranty. In no event will the authors be held liable for any damages
2831
- // arising from the use of this software.
2832
- //
2833
- // Permission is granted to anyone to use this software for any purpose,
2834
- // including commercial applications, and to alter it and redistribute it
2835
- // freely, subject to the following restrictions:
2836
- //
2837
- // 1. The origin of this software must not be misrepresented; you must not
2838
- // claim that you wrote the original software. If you use this software
2839
- // in a product, an acknowledgment in the product documentation would be
2840
- // appreciated but is not required.
2841
- // 2. Altered source versions must be plainly marked as such, and must not be
2842
- // misrepresented as being the original software.
2843
- // 3. This notice may not be removed or altered from any source distribution.
2844
-
2845
- module.exports = {
2846
- 2: 'need dictionary', /* Z_NEED_DICT 2 */
2847
- 1: 'stream end', /* Z_STREAM_END 1 */
2848
- 0: '', /* Z_OK 0 */
2849
- '-1': 'file error', /* Z_ERRNO (-1) */
2850
- '-2': 'stream error', /* Z_STREAM_ERROR (-2) */
2851
- '-3': 'data error', /* Z_DATA_ERROR (-3) */
2852
- '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
2853
- '-5': 'buffer error', /* Z_BUF_ERROR (-5) */
2854
- '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
2855
- };
2856
-
2857
- },{}],11:[function(require,module,exports){
2858
- 'use strict';
2859
-
2860
- // (C) 1995-2013 Jean-loup Gailly and Mark Adler
2861
- // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
2862
- //
2863
- // This software is provided 'as-is', without any express or implied
2864
- // warranty. In no event will the authors be held liable for any damages
2865
- // arising from the use of this software.
2866
- //
2867
- // Permission is granted to anyone to use this software for any purpose,
2868
- // including commercial applications, and to alter it and redistribute it
2869
- // freely, subject to the following restrictions:
2870
- //
2871
- // 1. The origin of this software must not be misrepresented; you must not
2872
- // claim that you wrote the original software. If you use this software
2873
- // in a product, an acknowledgment in the product documentation would be
2874
- // appreciated but is not required.
2875
- // 2. Altered source versions must be plainly marked as such, and must not be
2876
- // misrepresented as being the original software.
2877
- // 3. This notice may not be removed or altered from any source distribution.
2878
-
2879
- function ZStream() {
2880
- /* next input byte */
2881
- this.input = null; // JS specific, because we have no pointers
2882
- this.next_in = 0;
2883
- /* number of bytes available at input */
2884
- this.avail_in = 0;
2885
- /* total number of input bytes read so far */
2886
- this.total_in = 0;
2887
- /* next output byte should be put there */
2888
- this.output = null; // JS specific, because we have no pointers
2889
- this.next_out = 0;
2890
- /* remaining free space at output */
2891
- this.avail_out = 0;
2892
- /* total number of bytes output so far */
2893
- this.total_out = 0;
2894
- /* last error message, NULL if no error */
2895
- this.msg = ''/*Z_NULL*/;
2896
- /* not visible by applications */
2897
- this.state = null;
2898
- /* best guess about the data type: binary or text */
2899
- this.data_type = 2/*Z_UNKNOWN*/;
2900
- /* adler32 value of the uncompressed data */
2901
- this.adler = 0;
2902
- }
2903
-
2904
- module.exports = ZStream;
2905
-
2906
- },{}],"/lib/inflate.js":[function(require,module,exports){
2907
- 'use strict';
2908
-
2909
-
2910
- var zlib_inflate = require('./zlib/inflate');
2911
- var utils = require('./utils/common');
2912
- var strings = require('./utils/strings');
2913
- var c = require('./zlib/constants');
2914
- var msg = require('./zlib/messages');
2915
- var ZStream = require('./zlib/zstream');
2916
- var GZheader = require('./zlib/gzheader');
2917
-
2918
- var toString = Object.prototype.toString;
2919
-
2920
- /**
2921
- * class Inflate
2922
- *
2923
- * Generic JS-style wrapper for zlib calls. If you don't need
2924
- * streaming behaviour - use more simple functions: [[inflate]]
2925
- * and [[inflateRaw]].
2926
- **/
2927
-
2928
- /* internal
2929
- * inflate.chunks -> Array
2930
- *
2931
- * Chunks of output data, if [[Inflate#onData]] not overridden.
2932
- **/
2933
-
2934
- /**
2935
- * Inflate.result -> Uint8Array|Array|String
2936
- *
2937
- * Uncompressed result, generated by default [[Inflate#onData]]
2938
- * and [[Inflate#onEnd]] handlers. Filled after you push last chunk
2939
- * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
2940
- * push a chunk with explicit flush (call [[Inflate#push]] with
2941
- * `Z_SYNC_FLUSH` param).
2942
- **/
2943
-
2944
- /**
2945
- * Inflate.err -> Number
2946
- *
2947
- * Error code after inflate finished. 0 (Z_OK) on success.
2948
- * Should be checked if broken data possible.
2949
- **/
2950
-
2951
- /**
2952
- * Inflate.msg -> String
2953
- *
2954
- * Error message, if [[Inflate.err]] != 0
2955
- **/
2956
-
2957
-
2958
- /**
2959
- * new Inflate(options)
2960
- * - options (Object): zlib inflate options.
2961
- *
2962
- * Creates new inflator instance with specified params. Throws exception
2963
- * on bad params. Supported options:
2964
- *
2965
- * - `windowBits`
2966
- * - `dictionary`
2967
- *
2968
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
2969
- * for more information on these.
2970
- *
2971
- * Additional options, for internal needs:
2972
- *
2973
- * - `chunkSize` - size of generated data chunks (16K by default)
2974
- * - `raw` (Boolean) - do raw inflate
2975
- * - `to` (String) - if equal to 'string', then result will be converted
2976
- * from utf8 to utf16 (javascript) string. When string output requested,
2977
- * chunk length can differ from `chunkSize`, depending on content.
2978
- *
2979
- * By default, when no options set, autodetect deflate/gzip data format via
2980
- * wrapper header.
2981
- *
2982
- * ##### Example:
2983
- *
2984
- * ```javascript
2985
- * var pako = require('pako')
2986
- * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
2987
- * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
2988
- *
2989
- * var inflate = new pako.Inflate({ level: 3});
2990
- *
2991
- * inflate.push(chunk1, false);
2992
- * inflate.push(chunk2, true); // true -> last chunk
2993
- *
2994
- * if (inflate.err) { throw new Error(inflate.err); }
2995
- *
2996
- * console.log(inflate.result);
2997
- * ```
2998
- **/
2999
- function Inflate(options) {
3000
- if (!(this instanceof Inflate)) return new Inflate(options);
3001
-
3002
- this.options = utils.assign({
3003
- chunkSize: 16384,
3004
- windowBits: 0,
3005
- to: ''
3006
- }, options || {});
3007
-
3008
- var opt = this.options;
3009
-
3010
- // Force window size for `raw` data, if not set directly,
3011
- // because we have no header for autodetect.
3012
- if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
3013
- opt.windowBits = -opt.windowBits;
3014
- if (opt.windowBits === 0) { opt.windowBits = -15; }
3015
- }
3016
-
3017
- // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
3018
- if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
3019
- !(options && options.windowBits)) {
3020
- opt.windowBits += 32;
3021
- }
3022
-
3023
- // Gzip header has no info about windows size, we can do autodetect only
3024
- // for deflate. So, if window size not set, force it to max when gzip possible
3025
- if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
3026
- // bit 3 (16) -> gzipped data
3027
- // bit 4 (32) -> autodetect gzip/deflate
3028
- if ((opt.windowBits & 15) === 0) {
3029
- opt.windowBits |= 15;
3030
- }
3031
- }
3032
-
3033
- this.err = 0; // error code, if happens (0 = Z_OK)
3034
- this.msg = ''; // error message
3035
- this.ended = false; // used to avoid multiple onEnd() calls
3036
- this.chunks = []; // chunks of compressed data
3037
-
3038
- this.strm = new ZStream();
3039
- this.strm.avail_out = 0;
3040
-
3041
- var status = zlib_inflate.inflateInit2(
3042
- this.strm,
3043
- opt.windowBits
3044
- );
3045
-
3046
- if (status !== c.Z_OK) {
3047
- throw new Error(msg[status]);
3048
- }
3049
-
3050
- this.header = new GZheader();
3051
-
3052
- zlib_inflate.inflateGetHeader(this.strm, this.header);
3053
-
3054
- // Setup dictionary
3055
- if (opt.dictionary) {
3056
- // Convert data if needed
3057
- if (typeof opt.dictionary === 'string') {
3058
- opt.dictionary = strings.string2buf(opt.dictionary);
3059
- } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
3060
- opt.dictionary = new Uint8Array(opt.dictionary);
3061
- }
3062
- if (opt.raw) { //In raw mode we need to set the dictionary early
3063
- status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);
3064
- if (status !== c.Z_OK) {
3065
- throw new Error(msg[status]);
3066
- }
3067
- }
3068
- }
3069
- }
3070
-
3071
- /**
3072
- * Inflate#push(data[, mode]) -> Boolean
3073
- * - data (Uint8Array|Array|ArrayBuffer|String): input data
3074
- * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
3075
- * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
3076
- *
3077
- * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
3078
- * new output chunks. Returns `true` on success. The last data block must have
3079
- * mode Z_FINISH (or `true`). That will flush internal pending buffers and call
3080
- * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
3081
- * can use mode Z_SYNC_FLUSH, keeping the decompression context.
3082
- *
3083
- * On fail call [[Inflate#onEnd]] with error code and return false.
3084
- *
3085
- * We strongly recommend to use `Uint8Array` on input for best speed (output
3086
- * format is detected automatically). Also, don't skip last param and always
3087
- * use the same type in your code (boolean or number). That will improve JS speed.
3088
- *
3089
- * For regular `Array`-s make sure all elements are [0..255].
3090
- *
3091
- * ##### Example
3092
- *
3093
- * ```javascript
3094
- * push(chunk, false); // push one of data chunks
3095
- * ...
3096
- * push(chunk, true); // push last chunk
3097
- * ```
3098
- **/
3099
- Inflate.prototype.push = function (data, mode) {
3100
- var strm = this.strm;
3101
- var chunkSize = this.options.chunkSize;
3102
- var dictionary = this.options.dictionary;
3103
- var status, _mode;
3104
- var next_out_utf8, tail, utf8str;
3105
-
3106
- // Flag to properly process Z_BUF_ERROR on testing inflate call
3107
- // when we check that all output data was flushed.
3108
- var allowBufError = false;
3109
-
3110
- if (this.ended) { return false; }
3111
- _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);
3112
-
3113
- // Convert data if needed
3114
- if (typeof data === 'string') {
3115
- // Only binary strings can be decompressed on practice
3116
- strm.input = strings.binstring2buf(data);
3117
- } else if (toString.call(data) === '[object ArrayBuffer]') {
3118
- strm.input = new Uint8Array(data);
3119
- } else {
3120
- strm.input = data;
3121
- }
3122
-
3123
- strm.next_in = 0;
3124
- strm.avail_in = strm.input.length;
3125
-
3126
- do {
3127
- if (strm.avail_out === 0) {
3128
- strm.output = new utils.Buf8(chunkSize);
3129
- strm.next_out = 0;
3130
- strm.avail_out = chunkSize;
3131
- }
3132
-
3133
- status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */
3134
-
3135
- if (status === c.Z_NEED_DICT && dictionary) {
3136
- status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);
3137
- }
3138
-
3139
- if (status === c.Z_BUF_ERROR && allowBufError === true) {
3140
- status = c.Z_OK;
3141
- allowBufError = false;
3142
- }
3143
-
3144
- if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
3145
- this.onEnd(status);
3146
- this.ended = true;
3147
- return false;
3148
- }
3149
-
3150
- if (strm.next_out) {
3151
- if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {
3152
-
3153
- if (this.options.to === 'string') {
3154
-
3155
- next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
3156
-
3157
- tail = strm.next_out - next_out_utf8;
3158
- utf8str = strings.buf2string(strm.output, next_out_utf8);
3159
-
3160
- // move tail
3161
- strm.next_out = tail;
3162
- strm.avail_out = chunkSize - tail;
3163
- if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
3164
-
3165
- this.onData(utf8str);
3166
-
3167
- } else {
3168
- this.onData(utils.shrinkBuf(strm.output, strm.next_out));
3169
- }
3170
- }
3171
- }
3172
-
3173
- // When no more input data, we should check that internal inflate buffers
3174
- // are flushed. The only way to do it when avail_out = 0 - run one more
3175
- // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.
3176
- // Here we set flag to process this error properly.
3177
- //
3178
- // NOTE. Deflate does not return error in this case and does not needs such
3179
- // logic.
3180
- if (strm.avail_in === 0 && strm.avail_out === 0) {
3181
- allowBufError = true;
3182
- }
3183
-
3184
- } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);
3185
-
3186
- if (status === c.Z_STREAM_END) {
3187
- _mode = c.Z_FINISH;
3188
- }
3189
-
3190
- // Finalize on the last chunk.
3191
- if (_mode === c.Z_FINISH) {
3192
- status = zlib_inflate.inflateEnd(this.strm);
3193
- this.onEnd(status);
3194
- this.ended = true;
3195
- return status === c.Z_OK;
3196
- }
3197
-
3198
- // callback interim results if Z_SYNC_FLUSH.
3199
- if (_mode === c.Z_SYNC_FLUSH) {
3200
- this.onEnd(c.Z_OK);
3201
- strm.avail_out = 0;
3202
- return true;
3203
- }
3204
-
3205
- return true;
3206
- };
3207
-
3208
-
3209
- /**
3210
- * Inflate#onData(chunk) -> Void
3211
- * - chunk (Uint8Array|Array|String): output data. Type of array depends
3212
- * on js engine support. When string output requested, each chunk
3213
- * will be string.
3214
- *
3215
- * By default, stores data blocks in `chunks[]` property and glue
3216
- * those in `onEnd`. Override this handler, if you need another behaviour.
3217
- **/
3218
- Inflate.prototype.onData = function (chunk) {
3219
- this.chunks.push(chunk);
3220
- };
3221
-
3222
-
3223
- /**
3224
- * Inflate#onEnd(status) -> Void
3225
- * - status (Number): inflate status. 0 (Z_OK) on success,
3226
- * other if not.
3227
- *
3228
- * Called either after you tell inflate that the input stream is
3229
- * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
3230
- * or if an error happened. By default - join collected chunks,
3231
- * free memory and fill `results` / `err` properties.
3232
- **/
3233
- Inflate.prototype.onEnd = function (status) {
3234
- // On success - join
3235
- if (status === c.Z_OK) {
3236
- if (this.options.to === 'string') {
3237
- // Glue & convert here, until we teach pako to send
3238
- // utf8 aligned strings to onData
3239
- this.result = this.chunks.join('');
3240
- } else {
3241
- this.result = utils.flattenChunks(this.chunks);
3242
- }
3243
- }
3244
- this.chunks = [];
3245
- this.err = status;
3246
- this.msg = this.strm.msg;
3247
- };
3248
-
3249
-
3250
- /**
3251
- * inflate(data[, options]) -> Uint8Array|Array|String
3252
- * - data (Uint8Array|Array|String): input data to decompress.
3253
- * - options (Object): zlib inflate options.
3254
- *
3255
- * Decompress `data` with inflate/ungzip and `options`. Autodetect
3256
- * format via wrapper header by default. That's why we don't provide
3257
- * separate `ungzip` method.
3258
- *
3259
- * Supported options are:
3260
- *
3261
- * - windowBits
3262
- *
3263
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
3264
- * for more information.
3265
- *
3266
- * Sugar (options):
3267
- *
3268
- * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
3269
- * negative windowBits implicitly.
3270
- * - `to` (String) - if equal to 'string', then result will be converted
3271
- * from utf8 to utf16 (javascript) string. When string output requested,
3272
- * chunk length can differ from `chunkSize`, depending on content.
3273
- *
3274
- *
3275
- * ##### Example:
3276
- *
3277
- * ```javascript
3278
- * var pako = require('pako')
3279
- * , input = pako.deflate([1,2,3,4,5,6,7,8,9])
3280
- * , output;
3281
- *
3282
- * try {
3283
- * output = pako.inflate(input);
3284
- * } catch (err)
3285
- * console.log(err);
3286
- * }
3287
- * ```
3288
- **/
3289
- function inflate(input, options) {
3290
- var inflator = new Inflate(options);
3291
-
3292
- inflator.push(input, true);
3293
-
3294
- // That will never happens, if you don't cheat with options :)
3295
- if (inflator.err) { throw inflator.msg || msg[inflator.err]; }
3296
-
3297
- return inflator.result;
3298
- }
3299
-
3300
-
3301
- /**
3302
- * inflateRaw(data[, options]) -> Uint8Array|Array|String
3303
- * - data (Uint8Array|Array|String): input data to decompress.
3304
- * - options (Object): zlib inflate options.
3305
- *
3306
- * The same as [[inflate]], but creates raw data, without wrapper
3307
- * (header and adler32 crc).
3308
- **/
3309
- function inflateRaw(input, options) {
3310
- options = options || {};
3311
- options.raw = true;
3312
- return inflate(input, options);
3313
- }
3314
-
3315
-
3316
- /**
3317
- * ungzip(data[, options]) -> Uint8Array|Array|String
3318
- * - data (Uint8Array|Array|String): input data to decompress.
3319
- * - options (Object): zlib inflate options.
3320
- *
3321
- * Just shortcut to [[inflate]], because it autodetects format
3322
- * by header.content. Done for convenience.
3323
- **/
3324
-
3325
-
3326
- exports.Inflate = Inflate;
3327
- exports.inflate = inflate;
3328
- exports.inflateRaw = inflateRaw;
3329
- exports.ungzip = inflate;
3330
-
3331
- },{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")
3332
- });
3333
- /* eslint-enable */