django-handyhelpers 0.3.20__py3-none-any.whl → 0.3.35__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (571) hide show
  1. {django_handyhelpers-0.3.20.dist-info → django_handyhelpers-0.3.35.dist-info}/METADATA +16 -6
  2. {django_handyhelpers-0.3.20.dist-info → django_handyhelpers-0.3.35.dist-info}/RECORD +562 -75
  3. {django_handyhelpers-0.3.20.dist-info → django_handyhelpers-0.3.35.dist-info}/WHEEL +1 -1
  4. handyhelpers/__init__.py +6 -6
  5. handyhelpers/forms.py +9 -1
  6. handyhelpers/mixins/form_mixins.py +61 -0
  7. handyhelpers/mixins/model_mixins.py +21 -0
  8. handyhelpers/mixins/serializer_mixins.py +35 -0
  9. handyhelpers/mixins/view_mixins.py +5 -2
  10. handyhelpers/serializers.py +23 -3
  11. handyhelpers/static/handyhelpers/css/table_sortable.css +17 -0
  12. handyhelpers/static/handyhelpers/js/sidebar.js +8 -4
  13. handyhelpers/static/handyhelpers/js/table_sortable.js +119 -0
  14. handyhelpers/static/node_modules/.bin/acorn +4 -0
  15. handyhelpers/static/node_modules/.bin/css-b64-images +13 -0
  16. handyhelpers/static/node_modules/.bin/esbuild +0 -0
  17. handyhelpers/static/node_modules/.bin/html-minifier-terser +308 -0
  18. handyhelpers/static/node_modules/.bin/minify +98 -0
  19. handyhelpers/static/node_modules/.bin/terser +21 -0
  20. handyhelpers/static/node_modules/.bin/uglifyjs +624 -0
  21. handyhelpers/static/node_modules/.package-lock.json +750 -0
  22. handyhelpers/static/node_modules/@esbuild/linux-x64/README.md +3 -0
  23. handyhelpers/static/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  24. handyhelpers/static/node_modules/@esbuild/linux-x64/package.json +20 -0
  25. handyhelpers/static/node_modules/@jridgewell/gen-mapping/LICENSE +19 -0
  26. handyhelpers/static/node_modules/@jridgewell/gen-mapping/README.md +227 -0
  27. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs +230 -0
  28. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map +1 -0
  29. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js +246 -0
  30. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map +1 -0
  31. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +88 -0
  32. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
  33. handyhelpers/static/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts +36 -0
  34. handyhelpers/static/node_modules/@jridgewell/gen-mapping/package.json +76 -0
  35. handyhelpers/static/node_modules/@jridgewell/resolve-uri/LICENSE +19 -0
  36. handyhelpers/static/node_modules/@jridgewell/resolve-uri/README.md +40 -0
  37. handyhelpers/static/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs +232 -0
  38. handyhelpers/static/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +1 -0
  39. handyhelpers/static/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js +240 -0
  40. handyhelpers/static/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +1 -0
  41. handyhelpers/static/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts +4 -0
  42. handyhelpers/static/node_modules/@jridgewell/resolve-uri/package.json +69 -0
  43. handyhelpers/static/node_modules/@jridgewell/set-array/LICENSE +19 -0
  44. handyhelpers/static/node_modules/@jridgewell/set-array/README.md +37 -0
  45. handyhelpers/static/node_modules/@jridgewell/set-array/dist/set-array.mjs +69 -0
  46. handyhelpers/static/node_modules/@jridgewell/set-array/dist/set-array.mjs.map +1 -0
  47. handyhelpers/static/node_modules/@jridgewell/set-array/dist/set-array.umd.js +83 -0
  48. handyhelpers/static/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map +1 -0
  49. handyhelpers/static/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts +32 -0
  50. handyhelpers/static/node_modules/@jridgewell/set-array/package.json +65 -0
  51. handyhelpers/static/node_modules/@jridgewell/source-map/LICENSE +19 -0
  52. handyhelpers/static/node_modules/@jridgewell/source-map/README.md +184 -0
  53. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.cjs +95 -0
  54. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.cjs.map +1 -0
  55. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.mjs +90 -0
  56. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.mjs.map +1 -0
  57. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.umd.js +1242 -0
  58. handyhelpers/static/node_modules/@jridgewell/source-map/dist/source-map.umd.js.map +1 -0
  59. handyhelpers/static/node_modules/@jridgewell/source-map/dist/types/source-map.d.ts +35 -0
  60. handyhelpers/static/node_modules/@jridgewell/source-map/package.json +71 -0
  61. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/LICENSE +21 -0
  62. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/README.md +264 -0
  63. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +424 -0
  64. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
  65. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +439 -0
  66. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +1 -0
  67. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/types/scopes.d.ts +49 -0
  68. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts +8 -0
  69. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/types/strings.d.ts +15 -0
  70. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/dist/types/vlq.d.ts +6 -0
  71. handyhelpers/static/node_modules/@jridgewell/sourcemap-codec/package.json +75 -0
  72. handyhelpers/static/node_modules/@jridgewell/trace-mapping/LICENSE +19 -0
  73. handyhelpers/static/node_modules/@jridgewell/trace-mapping/README.md +257 -0
  74. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +580 -0
  75. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +1 -0
  76. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +600 -0
  77. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +1 -0
  78. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts +8 -0
  79. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts +32 -0
  80. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts +7 -0
  81. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts +1 -0
  82. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts +2 -0
  83. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
  84. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts +4 -0
  85. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +79 -0
  86. handyhelpers/static/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts +99 -0
  87. handyhelpers/static/node_modules/@jridgewell/trace-mapping/package.json +77 -0
  88. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/enums.js +1 -1
  89. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper-base.js +12 -170
  90. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper-base.js.map +1 -1
  91. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper-lite.js +14 -184
  92. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper-lite.js.map +1 -1
  93. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper.js +14 -197
  94. handyhelpers/static/node_modules/@popperjs/core/dist/cjs/popper.js.map +1 -1
  95. handyhelpers/static/node_modules/@popperjs/core/dist/esm/createPopper.js +6 -66
  96. handyhelpers/static/node_modules/@popperjs/core/dist/esm/modifiers/arrow.js +1 -12
  97. handyhelpers/static/node_modules/@popperjs/core/dist/esm/modifiers/computeStyles.js +2 -14
  98. handyhelpers/static/node_modules/@popperjs/core/dist/esm/utils/computeAutoPlacement.js +0 -4
  99. handyhelpers/static/node_modules/@popperjs/core/dist/esm/utils/userAgent.js +1 -1
  100. handyhelpers/static/node_modules/@popperjs/core/dist/umd/enums.js +1 -1
  101. handyhelpers/static/node_modules/@popperjs/core/dist/umd/enums.min.js +1 -1
  102. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-base.js +12 -170
  103. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-base.js.map +1 -1
  104. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-base.min.js +2 -2
  105. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-base.min.js.map +1 -1
  106. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-lite.js +14 -184
  107. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-lite.js.map +1 -1
  108. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-lite.min.js +2 -2
  109. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper-lite.min.js.map +1 -1
  110. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper.js +14 -197
  111. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper.js.map +1 -1
  112. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper.min.js +2 -2
  113. handyhelpers/static/node_modules/@popperjs/core/dist/umd/popper.min.js.map +1 -1
  114. handyhelpers/static/node_modules/@popperjs/core/lib/createPopper.js +6 -66
  115. handyhelpers/static/node_modules/@popperjs/core/lib/createPopper.js.flow +2 -80
  116. handyhelpers/static/node_modules/@popperjs/core/lib/modifiers/arrow.js +1 -12
  117. handyhelpers/static/node_modules/@popperjs/core/lib/modifiers/arrow.js.flow +0 -22
  118. handyhelpers/static/node_modules/@popperjs/core/lib/modifiers/computeStyles.js +2 -14
  119. handyhelpers/static/node_modules/@popperjs/core/lib/modifiers/computeStyles.js.flow +3 -33
  120. handyhelpers/static/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js +0 -4
  121. handyhelpers/static/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js.flow +0 -12
  122. handyhelpers/static/node_modules/@popperjs/core/lib/utils/userAgent.js +1 -1
  123. handyhelpers/static/node_modules/@popperjs/core/lib/utils/userAgent.js.flow +1 -1
  124. handyhelpers/static/node_modules/@popperjs/core/package.json +1 -1
  125. handyhelpers/static/node_modules/@putout/minify/LICENSE +21 -0
  126. handyhelpers/static/node_modules/@putout/minify/README.md +110 -0
  127. handyhelpers/static/node_modules/@putout/minify/bundle/minify.min.js +52 -0
  128. handyhelpers/static/node_modules/@putout/minify/package.json +112 -0
  129. handyhelpers/static/node_modules/@swc/core/Visitor.d.ts +218 -0
  130. handyhelpers/static/node_modules/@swc/core/Visitor.js +1407 -0
  131. handyhelpers/static/node_modules/@swc/core/binding.d.ts +56 -0
  132. handyhelpers/static/node_modules/@swc/core/binding.js +351 -0
  133. handyhelpers/static/node_modules/@swc/core/index.d.ts +118 -0
  134. handyhelpers/static/node_modules/@swc/core/index.js +439 -0
  135. handyhelpers/static/node_modules/@swc/core/package.json +114 -0
  136. handyhelpers/static/node_modules/@swc/core/postinstall.js +148 -0
  137. handyhelpers/static/node_modules/@swc/core/spack.d.ts +51 -0
  138. handyhelpers/static/node_modules/@swc/core/spack.js +87 -0
  139. handyhelpers/static/node_modules/@swc/core/util.d.ts +1 -0
  140. handyhelpers/static/node_modules/@swc/core/util.js +104 -0
  141. handyhelpers/static/node_modules/@swc/core-linux-x64-gnu/README.md +3 -0
  142. handyhelpers/static/node_modules/@swc/core-linux-x64-gnu/package.json +45 -0
  143. handyhelpers/static/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
  144. handyhelpers/static/node_modules/@swc/counter/CHANGELOG.md +7 -0
  145. handyhelpers/static/node_modules/@swc/counter/README.md +7 -0
  146. handyhelpers/static/node_modules/@swc/counter/index.js +1 -0
  147. handyhelpers/static/node_modules/@swc/counter/package.json +27 -0
  148. handyhelpers/static/node_modules/@swc/types/LICENSE +201 -0
  149. handyhelpers/static/node_modules/@swc/types/README.md +4 -0
  150. handyhelpers/static/node_modules/@swc/types/assumptions.d.ts +92 -0
  151. handyhelpers/static/node_modules/@swc/types/assumptions.js +2 -0
  152. handyhelpers/static/node_modules/@swc/types/index.d.ts +1977 -0
  153. handyhelpers/static/node_modules/@swc/types/index.js +2 -0
  154. handyhelpers/static/node_modules/@swc/types/package.json +39 -0
  155. handyhelpers/static/node_modules/acorn/CHANGELOG.md +928 -0
  156. handyhelpers/static/node_modules/acorn/LICENSE +21 -0
  157. handyhelpers/static/node_modules/acorn/README.md +282 -0
  158. handyhelpers/static/node_modules/acorn/bin/acorn +4 -0
  159. handyhelpers/static/node_modules/acorn/dist/acorn.d.mts +866 -0
  160. handyhelpers/static/node_modules/acorn/dist/acorn.d.ts +866 -0
  161. handyhelpers/static/node_modules/acorn/dist/acorn.js +6174 -0
  162. handyhelpers/static/node_modules/acorn/dist/acorn.mjs +6145 -0
  163. handyhelpers/static/node_modules/acorn/dist/bin.js +90 -0
  164. handyhelpers/static/node_modules/acorn/package.json +50 -0
  165. handyhelpers/static/node_modules/buffer-from/LICENSE +21 -0
  166. handyhelpers/static/node_modules/buffer-from/index.js +72 -0
  167. handyhelpers/static/node_modules/buffer-from/package.json +19 -0
  168. handyhelpers/static/node_modules/buffer-from/readme.md +69 -0
  169. handyhelpers/static/node_modules/camel-case/LICENSE +21 -0
  170. handyhelpers/static/node_modules/camel-case/README.md +47 -0
  171. handyhelpers/static/node_modules/camel-case/dist/index.d.ts +5 -0
  172. handyhelpers/static/node_modules/camel-case/dist/index.js +23 -0
  173. handyhelpers/static/node_modules/camel-case/dist/index.js.map +1 -0
  174. handyhelpers/static/node_modules/camel-case/dist/index.spec.d.ts +1 -0
  175. handyhelpers/static/node_modules/camel-case/dist/index.spec.js +26 -0
  176. handyhelpers/static/node_modules/camel-case/dist/index.spec.js.map +1 -0
  177. handyhelpers/static/node_modules/camel-case/dist.es2015/index.d.ts +5 -0
  178. handyhelpers/static/node_modules/camel-case/dist.es2015/index.js +17 -0
  179. handyhelpers/static/node_modules/camel-case/dist.es2015/index.js.map +1 -0
  180. handyhelpers/static/node_modules/camel-case/dist.es2015/index.spec.d.ts +1 -0
  181. handyhelpers/static/node_modules/camel-case/dist.es2015/index.spec.js +24 -0
  182. handyhelpers/static/node_modules/camel-case/dist.es2015/index.spec.js.map +1 -0
  183. handyhelpers/static/node_modules/camel-case/package.json +89 -0
  184. handyhelpers/static/node_modules/clean-css/History.md +1504 -0
  185. handyhelpers/static/node_modules/clean-css/LICENSE +19 -0
  186. handyhelpers/static/node_modules/clean-css/README.md +987 -0
  187. handyhelpers/static/node_modules/clean-css/index.js +1 -0
  188. handyhelpers/static/node_modules/clean-css/package.json +48 -0
  189. handyhelpers/static/node_modules/commander/LICENSE +22 -0
  190. handyhelpers/static/node_modules/commander/Readme.md +1134 -0
  191. handyhelpers/static/node_modules/commander/esm.mjs +16 -0
  192. handyhelpers/static/node_modules/commander/index.js +27 -0
  193. handyhelpers/static/node_modules/commander/package-support.json +16 -0
  194. handyhelpers/static/node_modules/commander/package.json +80 -0
  195. handyhelpers/static/node_modules/commander/typings/index.d.ts +889 -0
  196. handyhelpers/static/node_modules/css-b64-images/.npmignore +15 -0
  197. handyhelpers/static/node_modules/css-b64-images/.travis.yml +5 -0
  198. handyhelpers/static/node_modules/css-b64-images/README.md +78 -0
  199. handyhelpers/static/node_modules/css-b64-images/bin/css-b64-images +13 -0
  200. handyhelpers/static/node_modules/css-b64-images/draft.png +0 -0
  201. handyhelpers/static/node_modules/css-b64-images/draft.xcf +0 -0
  202. handyhelpers/static/node_modules/css-b64-images/package.json +30 -0
  203. handyhelpers/static/node_modules/css-b64-images/test/css-b64-images-test.js +38 -0
  204. handyhelpers/static/node_modules/css-b64-images/test/fixture/css/style.css +52 -0
  205. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/callunasansregular-webfont.eot +0 -0
  206. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/callunasansregular-webfont.svg +248 -0
  207. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/callunasansregular-webfont.ttf +0 -0
  208. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/callunasansregular-webfont.woff +0 -0
  209. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/maven_pro_medium-webfont.eot +0 -0
  210. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/maven_pro_medium-webfont.svg +245 -0
  211. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/maven_pro_medium-webfont.ttf +0 -0
  212. handyhelpers/static/node_modules/css-b64-images/test/fixture/fonts/maven_pro_medium-webfont.woff +0 -0
  213. handyhelpers/static/node_modules/css-b64-images/test/fixture/img/background-pattern.gif +0 -0
  214. handyhelpers/static/node_modules/css-b64-images/test/fixture/img/dots.svg +6 -0
  215. handyhelpers/static/node_modules/css-b64-images/test/fixture/img/mixit-banner.png +0 -0
  216. handyhelpers/static/node_modules/debug/LICENSE +20 -0
  217. handyhelpers/static/node_modules/debug/README.md +481 -0
  218. handyhelpers/static/node_modules/debug/package.json +65 -0
  219. handyhelpers/static/node_modules/debug/src/browser.js +272 -0
  220. handyhelpers/static/node_modules/debug/src/common.js +292 -0
  221. handyhelpers/static/node_modules/debug/src/index.js +10 -0
  222. handyhelpers/static/node_modules/debug/src/node.js +263 -0
  223. handyhelpers/static/node_modules/dot-case/LICENSE +21 -0
  224. handyhelpers/static/node_modules/dot-case/README.md +37 -0
  225. handyhelpers/static/node_modules/dot-case/dist/index.d.ts +3 -0
  226. handyhelpers/static/node_modules/dot-case/dist/index.js +11 -0
  227. handyhelpers/static/node_modules/dot-case/dist/index.js.map +1 -0
  228. handyhelpers/static/node_modules/dot-case/dist/index.spec.d.ts +1 -0
  229. handyhelpers/static/node_modules/dot-case/dist/index.spec.js +26 -0
  230. handyhelpers/static/node_modules/dot-case/dist/index.spec.js.map +1 -0
  231. handyhelpers/static/node_modules/dot-case/dist.es2015/index.d.ts +3 -0
  232. handyhelpers/static/node_modules/dot-case/dist.es2015/index.js +7 -0
  233. handyhelpers/static/node_modules/dot-case/dist.es2015/index.js.map +1 -0
  234. handyhelpers/static/node_modules/dot-case/dist.es2015/index.spec.d.ts +1 -0
  235. handyhelpers/static/node_modules/dot-case/dist.es2015/index.spec.js +24 -0
  236. handyhelpers/static/node_modules/dot-case/dist.es2015/index.spec.js.map +1 -0
  237. handyhelpers/static/node_modules/dot-case/package.json +89 -0
  238. handyhelpers/static/node_modules/entities/LICENSE +11 -0
  239. handyhelpers/static/node_modules/entities/package.json +90 -0
  240. handyhelpers/static/node_modules/entities/readme.md +122 -0
  241. handyhelpers/static/node_modules/esbuild/LICENSE.md +21 -0
  242. handyhelpers/static/node_modules/esbuild/README.md +3 -0
  243. handyhelpers/static/node_modules/esbuild/bin/esbuild +0 -0
  244. handyhelpers/static/node_modules/esbuild/install.js +286 -0
  245. handyhelpers/static/node_modules/esbuild/package.json +47 -0
  246. handyhelpers/static/node_modules/find-up/index.d.ts +247 -0
  247. handyhelpers/static/node_modules/find-up/index.js +107 -0
  248. handyhelpers/static/node_modules/find-up/license +9 -0
  249. handyhelpers/static/node_modules/find-up/package.json +61 -0
  250. handyhelpers/static/node_modules/find-up/readme.md +160 -0
  251. handyhelpers/static/node_modules/fun-effects/LICENSE +674 -0
  252. handyhelpers/static/node_modules/fun-effects/README.md +10 -0
  253. handyhelpers/static/node_modules/fun-effects/dist/css/background_icons.min.css +1 -0
  254. handyhelpers/static/node_modules/fun-effects/dist/css/blur_group.min.css +1 -0
  255. handyhelpers/static/node_modules/fun-effects/dist/css/fades.min.css +1 -0
  256. handyhelpers/static/node_modules/fun-effects/dist/css/marquee.min.css +1 -0
  257. handyhelpers/static/node_modules/fun-effects/dist/css/scroller.min.css +1 -0
  258. handyhelpers/static/node_modules/fun-effects/dist/index.js +15 -0
  259. handyhelpers/static/node_modules/fun-effects/dist/js/background_icons.min.js +1 -0
  260. handyhelpers/static/node_modules/fun-effects/dist/js/marquee.min.js +1 -0
  261. handyhelpers/static/node_modules/fun-effects/dist/js/scroller.min.js +1 -0
  262. handyhelpers/static/node_modules/fun-effects/package.json +39 -0
  263. handyhelpers/static/node_modules/fun-effects/src/css/background_icons.css +39 -0
  264. handyhelpers/static/node_modules/fun-effects/src/css/blur_group.css +22 -0
  265. handyhelpers/static/node_modules/fun-effects/src/css/fades.css +94 -0
  266. handyhelpers/static/node_modules/fun-effects/src/css/marquee.css +45 -0
  267. handyhelpers/static/node_modules/fun-effects/src/css/scroller.css +144 -0
  268. handyhelpers/static/node_modules/fun-effects/src/index.js +15 -0
  269. handyhelpers/static/node_modules/fun-effects/src/js/background_icons.js +101 -0
  270. handyhelpers/static/node_modules/fun-effects/src/js/marquee.js +81 -0
  271. handyhelpers/static/node_modules/fun-effects/src/js/scroller.js +37 -0
  272. handyhelpers/static/node_modules/html-minifier-terser/LICENSE +22 -0
  273. handyhelpers/static/node_modules/html-minifier-terser/README.md +168 -0
  274. handyhelpers/static/node_modules/html-minifier-terser/cli.js +308 -0
  275. handyhelpers/static/node_modules/html-minifier-terser/dist/htmlminifier.cjs +1857 -0
  276. handyhelpers/static/node_modules/html-minifier-terser/dist/htmlminifier.esm.bundle.js +57509 -0
  277. handyhelpers/static/node_modules/html-minifier-terser/dist/htmlminifier.umd.bundle.js +57520 -0
  278. handyhelpers/static/node_modules/html-minifier-terser/dist/htmlminifier.umd.bundle.min.js +9 -0
  279. handyhelpers/static/node_modules/html-minifier-terser/package.json +105 -0
  280. handyhelpers/static/node_modules/html-minifier-terser/src/htmlminifier.js +1366 -0
  281. handyhelpers/static/node_modules/html-minifier-terser/src/htmlparser.js +565 -0
  282. handyhelpers/static/node_modules/html-minifier-terser/src/tokenchain.js +68 -0
  283. handyhelpers/static/node_modules/html-minifier-terser/src/utils.js +11 -0
  284. handyhelpers/static/node_modules/jju/LICENSE +21 -0
  285. handyhelpers/static/node_modules/jju/Makefile +20 -0
  286. handyhelpers/static/node_modules/jju/README.md +249 -0
  287. handyhelpers/static/node_modules/jju/index.js +32 -0
  288. handyhelpers/static/node_modules/jju/package.json +34 -0
  289. handyhelpers/static/node_modules/jju/package.yaml +36 -0
  290. handyhelpers/static/node_modules/locate-path/index.d.ts +92 -0
  291. handyhelpers/static/node_modules/locate-path/index.js +77 -0
  292. handyhelpers/static/node_modules/locate-path/license +9 -0
  293. handyhelpers/static/node_modules/locate-path/package.json +48 -0
  294. handyhelpers/static/node_modules/locate-path/readme.md +123 -0
  295. handyhelpers/static/node_modules/lower-case/LICENSE +21 -0
  296. handyhelpers/static/node_modules/lower-case/README.md +35 -0
  297. handyhelpers/static/node_modules/lower-case/dist/index.d.ts +8 -0
  298. handyhelpers/static/node_modules/lower-case/dist/index.js +53 -0
  299. handyhelpers/static/node_modules/lower-case/dist/index.js.map +1 -0
  300. handyhelpers/static/node_modules/lower-case/dist/index.spec.d.ts +1 -0
  301. handyhelpers/static/node_modules/lower-case/dist/index.spec.js +36 -0
  302. handyhelpers/static/node_modules/lower-case/dist/index.spec.js.map +1 -0
  303. handyhelpers/static/node_modules/lower-case/dist.es2015/index.d.ts +8 -0
  304. handyhelpers/static/node_modules/lower-case/dist.es2015/index.js +48 -0
  305. handyhelpers/static/node_modules/lower-case/dist.es2015/index.js.map +1 -0
  306. handyhelpers/static/node_modules/lower-case/dist.es2015/index.spec.d.ts +1 -0
  307. handyhelpers/static/node_modules/lower-case/dist.es2015/index.spec.js +34 -0
  308. handyhelpers/static/node_modules/lower-case/dist.es2015/index.spec.js.map +1 -0
  309. handyhelpers/static/node_modules/lower-case/package.json +87 -0
  310. handyhelpers/static/node_modules/minify/ChangeLog +1307 -0
  311. handyhelpers/static/node_modules/minify/LICENSE +22 -0
  312. handyhelpers/static/node_modules/minify/README.md +177 -0
  313. handyhelpers/static/node_modules/minify/bin/minify.js +98 -0
  314. handyhelpers/static/node_modules/minify/deno.json +5 -0
  315. handyhelpers/static/node_modules/minify/help.json +8 -0
  316. handyhelpers/static/node_modules/minify/package.json +65 -0
  317. handyhelpers/static/node_modules/ms/index.js +162 -0
  318. handyhelpers/static/node_modules/ms/license.md +21 -0
  319. handyhelpers/static/node_modules/ms/package.json +38 -0
  320. handyhelpers/static/node_modules/ms/readme.md +59 -0
  321. handyhelpers/static/node_modules/no-case/LICENSE +21 -0
  322. handyhelpers/static/node_modules/no-case/README.md +37 -0
  323. handyhelpers/static/node_modules/no-case/dist/index.d.ts +10 -0
  324. handyhelpers/static/node_modules/no-case/dist/index.js +35 -0
  325. handyhelpers/static/node_modules/no-case/dist/index.js.map +1 -0
  326. handyhelpers/static/node_modules/no-case/dist/index.spec.d.ts +1 -0
  327. handyhelpers/static/node_modules/no-case/dist/index.spec.js +59 -0
  328. handyhelpers/static/node_modules/no-case/dist/index.spec.js.map +1 -0
  329. handyhelpers/static/node_modules/no-case/dist.es2015/index.d.ts +10 -0
  330. handyhelpers/static/node_modules/no-case/dist.es2015/index.js +31 -0
  331. handyhelpers/static/node_modules/no-case/dist.es2015/index.js.map +1 -0
  332. handyhelpers/static/node_modules/no-case/dist.es2015/index.spec.d.ts +1 -0
  333. handyhelpers/static/node_modules/no-case/dist.es2015/index.spec.js +57 -0
  334. handyhelpers/static/node_modules/no-case/dist.es2015/index.spec.js.map +1 -0
  335. handyhelpers/static/node_modules/no-case/package.json +85 -0
  336. handyhelpers/static/node_modules/p-limit/index.d.ts +40 -0
  337. handyhelpers/static/node_modules/p-limit/index.js +68 -0
  338. handyhelpers/static/node_modules/p-limit/license +9 -0
  339. handyhelpers/static/node_modules/p-limit/package.json +54 -0
  340. handyhelpers/static/node_modules/p-limit/readme.md +99 -0
  341. handyhelpers/static/node_modules/p-locate/index.d.ts +49 -0
  342. handyhelpers/static/node_modules/p-locate/index.js +48 -0
  343. handyhelpers/static/node_modules/p-locate/license +9 -0
  344. handyhelpers/static/node_modules/p-locate/package.json +56 -0
  345. handyhelpers/static/node_modules/p-locate/readme.md +91 -0
  346. handyhelpers/static/node_modules/param-case/LICENSE +21 -0
  347. handyhelpers/static/node_modules/param-case/README.md +37 -0
  348. handyhelpers/static/node_modules/param-case/dist/index.d.ts +3 -0
  349. handyhelpers/static/node_modules/param-case/dist/index.js +11 -0
  350. handyhelpers/static/node_modules/param-case/dist/index.js.map +1 -0
  351. handyhelpers/static/node_modules/param-case/dist/index.spec.d.ts +1 -0
  352. handyhelpers/static/node_modules/param-case/dist/index.spec.js +24 -0
  353. handyhelpers/static/node_modules/param-case/dist/index.spec.js.map +1 -0
  354. handyhelpers/static/node_modules/param-case/dist.es2015/index.d.ts +3 -0
  355. handyhelpers/static/node_modules/param-case/dist.es2015/index.js +7 -0
  356. handyhelpers/static/node_modules/param-case/dist.es2015/index.js.map +1 -0
  357. handyhelpers/static/node_modules/param-case/dist.es2015/index.spec.d.ts +1 -0
  358. handyhelpers/static/node_modules/param-case/dist.es2015/index.spec.js +22 -0
  359. handyhelpers/static/node_modules/param-case/dist.es2015/index.spec.js.map +1 -0
  360. handyhelpers/static/node_modules/param-case/package.json +91 -0
  361. handyhelpers/static/node_modules/pascal-case/LICENSE +21 -0
  362. handyhelpers/static/node_modules/pascal-case/README.md +47 -0
  363. handyhelpers/static/node_modules/pascal-case/dist/index.d.ts +5 -0
  364. handyhelpers/static/node_modules/pascal-case/dist/index.js +24 -0
  365. handyhelpers/static/node_modules/pascal-case/dist/index.js.map +1 -0
  366. handyhelpers/static/node_modules/pascal-case/dist/index.spec.d.ts +1 -0
  367. handyhelpers/static/node_modules/pascal-case/dist/index.spec.js +25 -0
  368. handyhelpers/static/node_modules/pascal-case/dist/index.spec.js.map +1 -0
  369. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.d.ts +5 -0
  370. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.js +18 -0
  371. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.js.map +1 -0
  372. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.spec.d.ts +1 -0
  373. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.spec.js +23 -0
  374. handyhelpers/static/node_modules/pascal-case/dist.es2015/index.spec.js.map +1 -0
  375. handyhelpers/static/node_modules/pascal-case/package.json +90 -0
  376. handyhelpers/static/node_modules/path-exists/index.d.ts +31 -0
  377. handyhelpers/static/node_modules/path-exists/index.js +19 -0
  378. handyhelpers/static/node_modules/path-exists/license +9 -0
  379. handyhelpers/static/node_modules/path-exists/package.json +41 -0
  380. handyhelpers/static/node_modules/path-exists/readme.md +52 -0
  381. handyhelpers/static/node_modules/readjson/ChangeLog +110 -0
  382. handyhelpers/static/node_modules/readjson/LICENSE +21 -0
  383. handyhelpers/static/node_modules/readjson/README.md +36 -0
  384. handyhelpers/static/node_modules/readjson/package.json +46 -0
  385. handyhelpers/static/node_modules/relateurl/README.md +159 -0
  386. handyhelpers/static/node_modules/relateurl/license +21 -0
  387. handyhelpers/static/node_modules/relateurl/package.json +46 -0
  388. handyhelpers/static/node_modules/simport/ChangeLog +77 -0
  389. handyhelpers/static/node_modules/simport/LICENSE +21 -0
  390. handyhelpers/static/node_modules/simport/README.md +81 -0
  391. handyhelpers/static/node_modules/simport/fixture/context.js +3 -0
  392. handyhelpers/static/node_modules/simport/fixture/default-frozen-function.mjs +2 -0
  393. handyhelpers/static/node_modules/simport/fixture/default-frozen-object.mjs +2 -0
  394. handyhelpers/static/node_modules/simport/package.json +65 -0
  395. handyhelpers/static/node_modules/simport/simport.js +84 -0
  396. handyhelpers/static/node_modules/simport/simport.mjs +22 -0
  397. handyhelpers/static/node_modules/source-map/CHANGELOG.md +301 -0
  398. handyhelpers/static/node_modules/source-map/LICENSE +28 -0
  399. handyhelpers/static/node_modules/source-map/README.md +742 -0
  400. handyhelpers/static/node_modules/source-map/dist/source-map.debug.js +3234 -0
  401. handyhelpers/static/node_modules/source-map/dist/source-map.js +3233 -0
  402. handyhelpers/static/node_modules/source-map/dist/source-map.min.js +2 -0
  403. handyhelpers/static/node_modules/source-map/dist/source-map.min.js.map +1 -0
  404. handyhelpers/static/node_modules/source-map/package.json +73 -0
  405. handyhelpers/static/node_modules/source-map/source-map.d.ts +98 -0
  406. handyhelpers/static/node_modules/source-map/source-map.js +8 -0
  407. handyhelpers/static/node_modules/source-map-support/LICENSE.md +21 -0
  408. handyhelpers/static/node_modules/source-map-support/README.md +284 -0
  409. handyhelpers/static/node_modules/source-map-support/browser-source-map-support.js +114 -0
  410. handyhelpers/static/node_modules/source-map-support/package.json +31 -0
  411. handyhelpers/static/node_modules/source-map-support/register-hook-require.js +1 -0
  412. handyhelpers/static/node_modules/source-map-support/register.js +1 -0
  413. handyhelpers/static/node_modules/source-map-support/source-map-support.js +625 -0
  414. handyhelpers/static/node_modules/terser/CHANGELOG.md +783 -0
  415. handyhelpers/static/node_modules/terser/LICENSE +27 -0
  416. handyhelpers/static/node_modules/terser/PATRONS.md +15 -0
  417. handyhelpers/static/node_modules/terser/README.md +1421 -0
  418. handyhelpers/static/node_modules/terser/bin/package.json +10 -0
  419. handyhelpers/static/node_modules/terser/bin/terser +21 -0
  420. handyhelpers/static/node_modules/terser/bin/uglifyjs +10 -0
  421. handyhelpers/static/node_modules/terser/dist/.gitkeep +0 -0
  422. handyhelpers/static/node_modules/terser/dist/bundle.min.js +32962 -0
  423. handyhelpers/static/node_modules/terser/dist/package.json +10 -0
  424. handyhelpers/static/node_modules/terser/main.js +27 -0
  425. handyhelpers/static/node_modules/terser/node_modules/commander/CHANGELOG.md +419 -0
  426. handyhelpers/static/node_modules/terser/node_modules/commander/LICENSE +22 -0
  427. handyhelpers/static/node_modules/terser/node_modules/commander/Readme.md +428 -0
  428. handyhelpers/static/node_modules/terser/node_modules/commander/index.js +1224 -0
  429. handyhelpers/static/node_modules/terser/node_modules/commander/package.json +38 -0
  430. handyhelpers/static/node_modules/terser/node_modules/commander/typings/index.d.ts +310 -0
  431. handyhelpers/static/node_modules/terser/package.json +153 -0
  432. handyhelpers/static/node_modules/terser/tools/domprops.js +9026 -0
  433. handyhelpers/static/node_modules/terser/tools/exit.cjs +7 -0
  434. handyhelpers/static/node_modules/terser/tools/props.html +68 -0
  435. handyhelpers/static/node_modules/terser/tools/terser.d.ts +216 -0
  436. handyhelpers/static/node_modules/tippy.js/LICENSE +21 -0
  437. handyhelpers/static/node_modules/tippy.js/README.md +63 -0
  438. handyhelpers/static/node_modules/tippy.js/animations/perspective-extreme.css +1 -0
  439. handyhelpers/static/node_modules/tippy.js/animations/perspective-subtle.css +1 -0
  440. handyhelpers/static/node_modules/tippy.js/animations/perspective.css +1 -0
  441. handyhelpers/static/node_modules/tippy.js/animations/scale-extreme.css +1 -0
  442. handyhelpers/static/node_modules/tippy.js/animations/scale-subtle.css +1 -0
  443. handyhelpers/static/node_modules/tippy.js/animations/scale.css +1 -0
  444. handyhelpers/static/node_modules/tippy.js/animations/shift-away-extreme.css +1 -0
  445. handyhelpers/static/node_modules/tippy.js/animations/shift-away-subtle.css +1 -0
  446. handyhelpers/static/node_modules/tippy.js/animations/shift-away.css +1 -0
  447. handyhelpers/static/node_modules/tippy.js/animations/shift-toward-extreme.css +1 -0
  448. handyhelpers/static/node_modules/tippy.js/animations/shift-toward-subtle.css +1 -0
  449. handyhelpers/static/node_modules/tippy.js/animations/shift-toward.css +1 -0
  450. handyhelpers/static/node_modules/tippy.js/dist/backdrop.css +1 -0
  451. handyhelpers/static/node_modules/tippy.js/dist/border.css +1 -0
  452. handyhelpers/static/node_modules/tippy.js/dist/svg-arrow.css +1 -0
  453. handyhelpers/static/node_modules/tippy.js/dist/tippy-bundle.umd.js +2516 -0
  454. handyhelpers/static/node_modules/tippy.js/dist/tippy-bundle.umd.js.map +1 -0
  455. handyhelpers/static/node_modules/tippy.js/dist/tippy-bundle.umd.min.js +2 -0
  456. handyhelpers/static/node_modules/tippy.js/dist/tippy-bundle.umd.min.js.map +1 -0
  457. handyhelpers/static/node_modules/tippy.js/dist/tippy.cjs.js +2497 -0
  458. handyhelpers/static/node_modules/tippy.js/dist/tippy.cjs.js.map +1 -0
  459. handyhelpers/static/node_modules/tippy.js/dist/tippy.css +1 -0
  460. handyhelpers/static/node_modules/tippy.js/dist/tippy.esm.js +2486 -0
  461. handyhelpers/static/node_modules/tippy.js/dist/tippy.esm.js.map +1 -0
  462. handyhelpers/static/node_modules/tippy.js/dist/tippy.umd.js +2496 -0
  463. handyhelpers/static/node_modules/tippy.js/dist/tippy.umd.js.map +1 -0
  464. handyhelpers/static/node_modules/tippy.js/dist/tippy.umd.min.js +2 -0
  465. handyhelpers/static/node_modules/tippy.js/dist/tippy.umd.min.js.map +1 -0
  466. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.cjs.js +2388 -0
  467. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.cjs.js.map +1 -0
  468. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.esm.js +2377 -0
  469. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.esm.js.map +1 -0
  470. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.umd.js +2382 -0
  471. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.umd.js.map +1 -0
  472. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.umd.min.js +2 -0
  473. handyhelpers/static/node_modules/tippy.js/headless/dist/tippy-headless.umd.min.js.map +1 -0
  474. handyhelpers/static/node_modules/tippy.js/headless/package.json +16 -0
  475. handyhelpers/static/node_modules/tippy.js/index.d.ts +260 -0
  476. handyhelpers/static/node_modules/tippy.js/package.json +157 -0
  477. handyhelpers/static/node_modules/tippy.js/themes/light-border.css +1 -0
  478. handyhelpers/static/node_modules/tippy.js/themes/light.css +1 -0
  479. handyhelpers/static/node_modules/tippy.js/themes/material.css +1 -0
  480. handyhelpers/static/node_modules/tippy.js/themes/translucent.css +1 -0
  481. handyhelpers/static/node_modules/try-catch/ChangeLog +55 -0
  482. handyhelpers/static/node_modules/try-catch/LICENSE +21 -0
  483. handyhelpers/static/node_modules/try-catch/README.md +38 -0
  484. handyhelpers/static/node_modules/try-catch/package.json +34 -0
  485. handyhelpers/static/node_modules/try-to-catch/ChangeLog +64 -0
  486. handyhelpers/static/node_modules/try-to-catch/LICENSE +21 -0
  487. handyhelpers/static/node_modules/try-to-catch/README.md +74 -0
  488. handyhelpers/static/node_modules/try-to-catch/package.json +47 -0
  489. handyhelpers/static/node_modules/tslib/CopyrightNotice.txt +15 -0
  490. handyhelpers/static/node_modules/tslib/LICENSE.txt +12 -0
  491. handyhelpers/static/node_modules/tslib/README.md +164 -0
  492. handyhelpers/static/node_modules/tslib/SECURITY.md +41 -0
  493. handyhelpers/static/node_modules/tslib/modules/index.d.ts +38 -0
  494. handyhelpers/static/node_modules/tslib/modules/index.js +70 -0
  495. handyhelpers/static/node_modules/tslib/modules/package.json +3 -0
  496. handyhelpers/static/node_modules/tslib/package.json +47 -0
  497. handyhelpers/static/node_modules/tslib/tslib.d.ts +460 -0
  498. handyhelpers/static/node_modules/tslib/tslib.es6.html +1 -0
  499. handyhelpers/static/node_modules/tslib/tslib.es6.js +402 -0
  500. handyhelpers/static/node_modules/tslib/tslib.es6.mjs +401 -0
  501. handyhelpers/static/node_modules/tslib/tslib.html +1 -0
  502. handyhelpers/static/node_modules/tslib/tslib.js +484 -0
  503. handyhelpers/static/node_modules/uglify-js/LICENSE +29 -0
  504. handyhelpers/static/node_modules/uglify-js/README.md +1479 -0
  505. handyhelpers/static/node_modules/uglify-js/bin/uglifyjs +624 -0
  506. handyhelpers/static/node_modules/uglify-js/package.json +56 -0
  507. handyhelpers/static/node_modules/uglify-js/tools/domprops.html +456 -0
  508. handyhelpers/static/node_modules/uglify-js/tools/domprops.json +8327 -0
  509. handyhelpers/static/node_modules/uglify-js/tools/exports.js +8 -0
  510. handyhelpers/static/node_modules/uglify-js/tools/node.js +115 -0
  511. handyhelpers/static/node_modules/uglify-js/tools/tty.js +22 -0
  512. handyhelpers/static/node_modules/unicorn-magic/default.js +14 -0
  513. handyhelpers/static/node_modules/unicorn-magic/index.d.ts +29 -0
  514. handyhelpers/static/node_modules/unicorn-magic/license +9 -0
  515. handyhelpers/static/node_modules/unicorn-magic/node.js +7 -0
  516. handyhelpers/static/node_modules/unicorn-magic/package.json +49 -0
  517. handyhelpers/static/node_modules/unicorn-magic/readme.md +25 -0
  518. handyhelpers/static/node_modules/yocto-queue/index.d.ts +61 -0
  519. handyhelpers/static/node_modules/yocto-queue/index.js +78 -0
  520. handyhelpers/static/node_modules/yocto-queue/license +9 -0
  521. handyhelpers/static/node_modules/yocto-queue/package.json +48 -0
  522. handyhelpers/static/node_modules/yocto-queue/readme.md +70 -0
  523. handyhelpers/static/package.json +3 -1
  524. handyhelpers/static/yarn.lock +393 -20
  525. handyhelpers/templates/handyhelpers/generic/bs5/generic_index.html +5 -8
  526. handyhelpers/templates/handyhelpers/handyhelpers_base_bs5.htm +5 -1
  527. handyhelpers/templates/handyhelpers/handyhelpers_with_sidebar.htm +50 -3
  528. handyhelpers/templates/handyhelpers/htmx/bs5/filter_form/generic_modal_swap.htm +48 -0
  529. handyhelpers/templates/handyhelpers/htmx/bs5/form/form_wrapper.htm +48 -0
  530. handyhelpers/templates/handyhelpers/htmx/bs5/form/inline_form.htm +166 -0
  531. handyhelpers/templates/handyhelpers/htmx/bs5/form/inline_form_disabled.htm +125 -0
  532. handyhelpers/templates/handyhelpers/htmx/bs5/generic_modal_swap.htm +2 -3
  533. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/content_title.htm +38 -0
  534. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/controls.htm +21 -0
  535. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/examples/card.htm +17 -0
  536. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/examples/list.htm +11 -0
  537. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/examples/table.htm +21 -0
  538. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/filter_form_modal_swap.htm +48 -0
  539. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/full.html +6 -0
  540. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/wrapper_card.htm +7 -0
  541. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/wrapper_list.htm +7 -0
  542. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/wrapper_minimal.htm +7 -0
  543. handyhelpers/templates/handyhelpers/htmx/bs5/htmx_option_multi_filter_view/wrapper_table.htm +18 -0
  544. handyhelpers/templates/handyhelpers/htmx/bs5/index.htm +34 -0
  545. handyhelpers/templates/handyhelpers/report/annual_stats.html +6 -0
  546. handyhelpers/templates/handyhelpers/report/annual_stats_content.htm +43 -0
  547. handyhelpers/templates/handyhelpers/report/chartjs/annual_progress_chart.htm +1 -1
  548. handyhelpers/templates/handyhelpers/report/chartjs/annual_progress_content.htm +40 -39
  549. handyhelpers/templates/handyhelpers/report/chartjs/annual_stats.html +25 -36
  550. handyhelpers/templates/handyhelpers/report/chartjs/annual_trends_content.htm +35 -34
  551. handyhelpers/templates/handyhelpers/report/chartjs/day_count_chart.htm +1 -1
  552. handyhelpers/templates/handyhelpers/report/chartjs/month_count_chart.htm +1 -1
  553. handyhelpers/templates/handyhelpers/report/chartjs/week_count_chart.htm +1 -1
  554. handyhelpers/templates/handyhelpers/report/chartjs/year_count_chart.htm +1 -1
  555. handyhelpers/templatetags/form_tags.py +47 -0
  556. handyhelpers/templatetags/htmx_tags.py +21 -0
  557. handyhelpers/views/action.py +3 -1
  558. handyhelpers/views/calendar.py +33 -14
  559. handyhelpers/views/htmx.py +396 -4
  560. handyhelpers/views/report.py +12 -5
  561. handyhelpers/management/commands/generate_admin.py +0 -110
  562. handyhelpers/static/node_modules/@popperjs/core/dist/esm/utils/format.js +0 -9
  563. handyhelpers/static/node_modules/@popperjs/core/dist/esm/utils/validateModifiers.js +0 -81
  564. handyhelpers/static/node_modules/@popperjs/core/lib/utils/format.d.ts +0 -1
  565. handyhelpers/static/node_modules/@popperjs/core/lib/utils/format.js +0 -9
  566. handyhelpers/static/node_modules/@popperjs/core/lib/utils/format.js.flow +0 -5
  567. handyhelpers/static/node_modules/@popperjs/core/lib/utils/validateModifiers.d.ts +0 -1
  568. handyhelpers/static/node_modules/@popperjs/core/lib/utils/validateModifiers.js +0 -81
  569. handyhelpers/static/node_modules/@popperjs/core/lib/utils/validateModifiers.js.flow +0 -151
  570. {django_handyhelpers-0.3.20.dist-info → django_handyhelpers-0.3.35.dist-info}/LICENSE +0 -0
  571. {django_handyhelpers-0.3.20.dist-info → django_handyhelpers-0.3.35.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1366 @@
1
+ import CleanCSS from 'clean-css';
2
+ import { decodeHTMLStrict, decodeHTML } from 'entities';
3
+ import RelateURL from 'relateurl';
4
+ import { minify as terser } from 'terser';
5
+
6
+ import { HTMLParser, endTag } from './htmlparser.js';
7
+ import TokenChain from './tokenchain.js';
8
+ import { replaceAsync } from './utils.js';
9
+
10
+ function trimWhitespace(str) {
11
+ return str && str.replace(/^[ \n\r\t\f]+/, '').replace(/[ \n\r\t\f]+$/, '');
12
+ }
13
+
14
+ function collapseWhitespaceAll(str) {
15
+ // Non-breaking space is specifically handled inside the replacer function here:
16
+ return str && str.replace(/[ \n\r\t\f\xA0]+/g, function (spaces) {
17
+ return spaces === '\t' ? '\t' : spaces.replace(/(^|\xA0+)[^\xA0]+/g, '$1 ');
18
+ });
19
+ }
20
+
21
+ function collapseWhitespace(str, options, trimLeft, trimRight, collapseAll) {
22
+ let lineBreakBefore = ''; let lineBreakAfter = '';
23
+
24
+ if (options.preserveLineBreaks) {
25
+ str = str.replace(/^[ \n\r\t\f]*?[\n\r][ \n\r\t\f]*/, function () {
26
+ lineBreakBefore = '\n';
27
+ return '';
28
+ }).replace(/[ \n\r\t\f]*?[\n\r][ \n\r\t\f]*$/, function () {
29
+ lineBreakAfter = '\n';
30
+ return '';
31
+ });
32
+ }
33
+
34
+ if (trimLeft) {
35
+ // Non-breaking space is specifically handled inside the replacer function here:
36
+ str = str.replace(/^[ \n\r\t\f\xA0]+/, function (spaces) {
37
+ const conservative = !lineBreakBefore && options.conservativeCollapse;
38
+ if (conservative && spaces === '\t') {
39
+ return '\t';
40
+ }
41
+ return spaces.replace(/^[^\xA0]+/, '').replace(/(\xA0+)[^\xA0]+/g, '$1 ') || (conservative ? ' ' : '');
42
+ });
43
+ }
44
+
45
+ if (trimRight) {
46
+ // Non-breaking space is specifically handled inside the replacer function here:
47
+ str = str.replace(/[ \n\r\t\f\xA0]+$/, function (spaces) {
48
+ const conservative = !lineBreakAfter && options.conservativeCollapse;
49
+ if (conservative && spaces === '\t') {
50
+ return '\t';
51
+ }
52
+ return spaces.replace(/[^\xA0]+(\xA0+)/g, ' $1').replace(/[^\xA0]+$/, '') || (conservative ? ' ' : '');
53
+ });
54
+ }
55
+
56
+ if (collapseAll) {
57
+ // strip non space whitespace then compress spaces to one
58
+ str = collapseWhitespaceAll(str);
59
+ }
60
+
61
+ return lineBreakBefore + str + lineBreakAfter;
62
+ }
63
+
64
+ // non-empty tags that will maintain whitespace around them
65
+ const inlineTags = new Set(['a', 'abbr', 'acronym', 'b', 'bdi', 'bdo', 'big', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'ins', 'kbd', 'label', 'mark', 'math', 'nobr', 'object', 'q', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'select', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'svg', 'textarea', 'time', 'tt', 'u', 'var']);
66
+ // non-empty tags that will maintain whitespace within them
67
+ const inlineTextTags = new Set(['a', 'abbr', 'acronym', 'b', 'big', 'del', 'em', 'font', 'i', 'ins', 'kbd', 'mark', 'nobr', 'rp', 's', 'samp', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'time', 'tt', 'u', 'var']);
68
+ // self-closing tags that will maintain whitespace around them
69
+ const selfClosingInlineTags = new Set(['comment', 'img', 'input', 'wbr']);
70
+
71
+ function collapseWhitespaceSmart(str, prevTag, nextTag, options) {
72
+ let trimLeft = prevTag && !selfClosingInlineTags.has(prevTag);
73
+ if (trimLeft && !options.collapseInlineTagWhitespace) {
74
+ trimLeft = prevTag.charAt(0) === '/' ? !inlineTags.has(prevTag.slice(1)) : !inlineTextTags.has(prevTag);
75
+ }
76
+ let trimRight = nextTag && !selfClosingInlineTags.has(nextTag);
77
+ if (trimRight && !options.collapseInlineTagWhitespace) {
78
+ trimRight = nextTag.charAt(0) === '/' ? !inlineTextTags.has(nextTag.slice(1)) : !inlineTags.has(nextTag);
79
+ }
80
+ return collapseWhitespace(str, options, trimLeft, trimRight, prevTag && nextTag);
81
+ }
82
+
83
+ function isConditionalComment(text) {
84
+ return /^\[if\s[^\]]+]|\[endif]$/.test(text);
85
+ }
86
+
87
+ function isIgnoredComment(text, options) {
88
+ for (let i = 0, len = options.ignoreCustomComments.length; i < len; i++) {
89
+ if (options.ignoreCustomComments[i].test(text)) {
90
+ return true;
91
+ }
92
+ }
93
+ return false;
94
+ }
95
+
96
+ function isEventAttribute(attrName, options) {
97
+ const patterns = options.customEventAttributes;
98
+ if (patterns) {
99
+ for (let i = patterns.length; i--;) {
100
+ if (patterns[i].test(attrName)) {
101
+ return true;
102
+ }
103
+ }
104
+ return false;
105
+ }
106
+ return /^on[a-z]{3,}$/.test(attrName);
107
+ }
108
+
109
+ function canRemoveAttributeQuotes(value) {
110
+ // https://mathiasbynens.be/notes/unquoted-attribute-values
111
+ return /^[^ \t\n\f\r"'`=<>]+$/.test(value);
112
+ }
113
+
114
+ function attributesInclude(attributes, attribute) {
115
+ for (let i = attributes.length; i--;) {
116
+ if (attributes[i].name.toLowerCase() === attribute) {
117
+ return true;
118
+ }
119
+ }
120
+ return false;
121
+ }
122
+
123
+ function isAttributeRedundant(tag, attrName, attrValue, attrs) {
124
+ attrValue = attrValue ? trimWhitespace(attrValue.toLowerCase()) : '';
125
+
126
+ return (
127
+ (tag === 'script' &&
128
+ attrName === 'language' &&
129
+ attrValue === 'javascript') ||
130
+
131
+ (tag === 'form' &&
132
+ attrName === 'method' &&
133
+ attrValue === 'get') ||
134
+
135
+ (tag === 'input' &&
136
+ attrName === 'type' &&
137
+ attrValue === 'text') ||
138
+
139
+ (tag === 'script' &&
140
+ attrName === 'charset' &&
141
+ !attributesInclude(attrs, 'src')) ||
142
+
143
+ (tag === 'a' &&
144
+ attrName === 'name' &&
145
+ attributesInclude(attrs, 'id')) ||
146
+
147
+ (tag === 'area' &&
148
+ attrName === 'shape' &&
149
+ attrValue === 'rect')
150
+ );
151
+ }
152
+
153
+ // https://mathiasbynens.be/demo/javascript-mime-type
154
+ // https://developer.mozilla.org/en/docs/Web/HTML/Element/script#attr-type
155
+ const executableScriptsMimetypes = new Set([
156
+ 'text/javascript',
157
+ 'text/ecmascript',
158
+ 'text/jscript',
159
+ 'application/javascript',
160
+ 'application/x-javascript',
161
+ 'application/ecmascript',
162
+ 'module'
163
+ ]);
164
+
165
+ const keepScriptsMimetypes = new Set([
166
+ 'module'
167
+ ]);
168
+
169
+ function isScriptTypeAttribute(attrValue = '') {
170
+ attrValue = trimWhitespace(attrValue.split(/;/, 2)[0]).toLowerCase();
171
+ return attrValue === '' || executableScriptsMimetypes.has(attrValue);
172
+ }
173
+
174
+ function keepScriptTypeAttribute(attrValue = '') {
175
+ attrValue = trimWhitespace(attrValue.split(/;/, 2)[0]).toLowerCase();
176
+ return keepScriptsMimetypes.has(attrValue);
177
+ }
178
+
179
+ function isExecutableScript(tag, attrs) {
180
+ if (tag !== 'script') {
181
+ return false;
182
+ }
183
+ for (let i = 0, len = attrs.length; i < len; i++) {
184
+ const attrName = attrs[i].name.toLowerCase();
185
+ if (attrName === 'type') {
186
+ return isScriptTypeAttribute(attrs[i].value);
187
+ }
188
+ }
189
+ return true;
190
+ }
191
+
192
+ function isStyleLinkTypeAttribute(attrValue = '') {
193
+ attrValue = trimWhitespace(attrValue).toLowerCase();
194
+ return attrValue === '' || attrValue === 'text/css';
195
+ }
196
+
197
+ function isStyleSheet(tag, attrs) {
198
+ if (tag !== 'style') {
199
+ return false;
200
+ }
201
+ for (let i = 0, len = attrs.length; i < len; i++) {
202
+ const attrName = attrs[i].name.toLowerCase();
203
+ if (attrName === 'type') {
204
+ return isStyleLinkTypeAttribute(attrs[i].value);
205
+ }
206
+ }
207
+ return true;
208
+ }
209
+
210
+ const isSimpleBoolean = new Set(['allowfullscreen', 'async', 'autofocus', 'autoplay', 'checked', 'compact', 'controls', 'declare', 'default', 'defaultchecked', 'defaultmuted', 'defaultselected', 'defer', 'disabled', 'enabled', 'formnovalidate', 'hidden', 'indeterminate', 'inert', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nohref', 'noresize', 'noshade', 'novalidate', 'nowrap', 'open', 'pauseonexit', 'readonly', 'required', 'reversed', 'scoped', 'seamless', 'selected', 'sortable', 'truespeed', 'typemustmatch', 'visible']);
211
+ const isBooleanValue = new Set(['true', 'false']);
212
+
213
+ function isBooleanAttribute(attrName, attrValue) {
214
+ return isSimpleBoolean.has(attrName) || (attrName === 'draggable' && !isBooleanValue.has(attrValue));
215
+ }
216
+
217
+ function isUriTypeAttribute(attrName, tag) {
218
+ return (
219
+ (/^(?:a|area|link|base)$/.test(tag) && attrName === 'href') ||
220
+ (tag === 'img' && /^(?:src|longdesc|usemap)$/.test(attrName)) ||
221
+ (tag === 'object' && /^(?:classid|codebase|data|usemap)$/.test(attrName)) ||
222
+ (tag === 'q' && attrName === 'cite') ||
223
+ (tag === 'blockquote' && attrName === 'cite') ||
224
+ ((tag === 'ins' || tag === 'del') && attrName === 'cite') ||
225
+ (tag === 'form' && attrName === 'action') ||
226
+ (tag === 'input' && (attrName === 'src' || attrName === 'usemap')) ||
227
+ (tag === 'head' && attrName === 'profile') ||
228
+ (tag === 'script' && (attrName === 'src' || attrName === 'for'))
229
+ );
230
+ }
231
+
232
+ function isNumberTypeAttribute(attrName, tag) {
233
+ return (
234
+ (/^(?:a|area|object|button)$/.test(tag) && attrName === 'tabindex') ||
235
+ (tag === 'input' && (attrName === 'maxlength' || attrName === 'tabindex')) ||
236
+ (tag === 'select' && (attrName === 'size' || attrName === 'tabindex')) ||
237
+ (tag === 'textarea' && /^(?:rows|cols|tabindex)$/.test(attrName)) ||
238
+ (tag === 'colgroup' && attrName === 'span') ||
239
+ (tag === 'col' && attrName === 'span') ||
240
+ ((tag === 'th' || tag === 'td') && (attrName === 'rowspan' || attrName === 'colspan'))
241
+ );
242
+ }
243
+
244
+ function isLinkType(tag, attrs, value) {
245
+ if (tag !== 'link') {
246
+ return false;
247
+ }
248
+ for (let i = 0, len = attrs.length; i < len; i++) {
249
+ if (attrs[i].name === 'rel' && attrs[i].value === value) {
250
+ return true;
251
+ }
252
+ }
253
+ }
254
+
255
+ function isMediaQuery(tag, attrs, attrName) {
256
+ return attrName === 'media' && (isLinkType(tag, attrs, 'stylesheet') || isStyleSheet(tag, attrs));
257
+ }
258
+
259
+ const srcsetTags = new Set(['img', 'source']);
260
+
261
+ function isSrcset(attrName, tag) {
262
+ return attrName === 'srcset' && srcsetTags.has(tag);
263
+ }
264
+
265
+ async function cleanAttributeValue(tag, attrName, attrValue, options, attrs) {
266
+ if (isEventAttribute(attrName, options)) {
267
+ attrValue = trimWhitespace(attrValue).replace(/^javascript:\s*/i, '');
268
+ return options.minifyJS(attrValue, true);
269
+ } else if (attrName === 'class') {
270
+ attrValue = trimWhitespace(attrValue);
271
+ if (options.sortClassName) {
272
+ attrValue = options.sortClassName(attrValue);
273
+ } else {
274
+ attrValue = collapseWhitespaceAll(attrValue);
275
+ }
276
+ return attrValue;
277
+ } else if (isUriTypeAttribute(attrName, tag)) {
278
+ attrValue = trimWhitespace(attrValue);
279
+ return isLinkType(tag, attrs, 'canonical') ? attrValue : options.minifyURLs(attrValue);
280
+ } else if (isNumberTypeAttribute(attrName, tag)) {
281
+ return trimWhitespace(attrValue);
282
+ } else if (attrName === 'style') {
283
+ attrValue = trimWhitespace(attrValue);
284
+ if (attrValue) {
285
+ if (/;$/.test(attrValue) && !/&#?[0-9a-zA-Z]+;$/.test(attrValue)) {
286
+ attrValue = attrValue.replace(/\s*;$/, ';');
287
+ }
288
+ attrValue = await options.minifyCSS(attrValue, 'inline');
289
+ }
290
+ return attrValue;
291
+ } else if (isSrcset(attrName, tag)) {
292
+ // https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-srcset
293
+ attrValue = trimWhitespace(attrValue).split(/\s+,\s*|\s*,\s+/).map(function (candidate) {
294
+ let url = candidate;
295
+ let descriptor = '';
296
+ const match = candidate.match(/\s+([1-9][0-9]*w|[0-9]+(?:\.[0-9]+)?x)$/);
297
+ if (match) {
298
+ url = url.slice(0, -match[0].length);
299
+ const num = +match[1].slice(0, -1);
300
+ const suffix = match[1].slice(-1);
301
+ if (num !== 1 || suffix !== 'x') {
302
+ descriptor = ' ' + num + suffix;
303
+ }
304
+ }
305
+ return options.minifyURLs(url) + descriptor;
306
+ }).join(', ');
307
+ } else if (isMetaViewport(tag, attrs) && attrName === 'content') {
308
+ attrValue = attrValue.replace(/\s+/g, '').replace(/[0-9]+\.[0-9]+/g, function (numString) {
309
+ // "0.90000" -> "0.9"
310
+ // "1.0" -> "1"
311
+ // "1.0001" -> "1.0001" (unchanged)
312
+ return (+numString).toString();
313
+ });
314
+ } else if (isContentSecurityPolicy(tag, attrs) && attrName.toLowerCase() === 'content') {
315
+ return collapseWhitespaceAll(attrValue);
316
+ } else if (options.customAttrCollapse && options.customAttrCollapse.test(attrName)) {
317
+ attrValue = trimWhitespace(attrValue.replace(/ ?[\n\r]+ ?/g, '').replace(/\s{2,}/g, options.conservativeCollapse ? ' ' : ''));
318
+ } else if (tag === 'script' && attrName === 'type') {
319
+ attrValue = trimWhitespace(attrValue.replace(/\s*;\s*/g, ';'));
320
+ } else if (isMediaQuery(tag, attrs, attrName)) {
321
+ attrValue = trimWhitespace(attrValue);
322
+ return options.minifyCSS(attrValue, 'media');
323
+ }
324
+ return attrValue;
325
+ }
326
+
327
+ function isMetaViewport(tag, attrs) {
328
+ if (tag !== 'meta') {
329
+ return false;
330
+ }
331
+ for (let i = 0, len = attrs.length; i < len; i++) {
332
+ if (attrs[i].name === 'name' && attrs[i].value === 'viewport') {
333
+ return true;
334
+ }
335
+ }
336
+ }
337
+
338
+ function isContentSecurityPolicy(tag, attrs) {
339
+ if (tag !== 'meta') {
340
+ return false;
341
+ }
342
+ for (let i = 0, len = attrs.length; i < len; i++) {
343
+ if (attrs[i].name.toLowerCase() === 'http-equiv' && attrs[i].value.toLowerCase() === 'content-security-policy') {
344
+ return true;
345
+ }
346
+ }
347
+ }
348
+
349
+ function ignoreCSS(id) {
350
+ return '/* clean-css ignore:start */' + id + '/* clean-css ignore:end */';
351
+ }
352
+
353
+ // Wrap CSS declarations for CleanCSS > 3.x
354
+ // See https://github.com/jakubpawlowicz/clean-css/issues/418
355
+ function wrapCSS(text, type) {
356
+ switch (type) {
357
+ case 'inline':
358
+ return '*{' + text + '}';
359
+ case 'media':
360
+ return '@media ' + text + '{a{top:0}}';
361
+ default:
362
+ return text;
363
+ }
364
+ }
365
+
366
+ function unwrapCSS(text, type) {
367
+ let matches;
368
+ switch (type) {
369
+ case 'inline':
370
+ matches = text.match(/^\*\{([\s\S]*)\}$/);
371
+ break;
372
+ case 'media':
373
+ matches = text.match(/^@media ([\s\S]*?)\s*{[\s\S]*}$/);
374
+ break;
375
+ }
376
+ return matches ? matches[1] : text;
377
+ }
378
+
379
+ async function cleanConditionalComment(comment, options) {
380
+ return options.processConditionalComments
381
+ ? await replaceAsync(comment, /^(\[if\s[^\]]+]>)([\s\S]*?)(<!\[endif])$/, async function (match, prefix, text, suffix) {
382
+ return prefix + await minifyHTML(text, options, true) + suffix;
383
+ })
384
+ : comment;
385
+ }
386
+
387
+ async function processScript(text, options, currentAttrs) {
388
+ for (let i = 0, len = currentAttrs.length; i < len; i++) {
389
+ if (currentAttrs[i].name.toLowerCase() === 'type' &&
390
+ options.processScripts.indexOf(currentAttrs[i].value) > -1) {
391
+ return await minifyHTML(text, options);
392
+ }
393
+ }
394
+ return text;
395
+ }
396
+
397
+ // Tag omission rules from https://html.spec.whatwg.org/multipage/syntax.html#optional-tags
398
+ // with the following deviations:
399
+ // - retain <body> if followed by <noscript>
400
+ // - </rb>, </rt>, </rtc>, </rp> & </tfoot> follow https://www.w3.org/TR/html5/syntax.html#optional-tags
401
+ // - retain all tags which are adjacent to non-standard HTML tags
402
+ const optionalStartTags = new Set(['html', 'head', 'body', 'colgroup', 'tbody']);
403
+ const optionalEndTags = new Set(['html', 'head', 'body', 'li', 'dt', 'dd', 'p', 'rb', 'rt', 'rtc', 'rp', 'optgroup', 'option', 'colgroup', 'caption', 'thead', 'tbody', 'tfoot', 'tr', 'td', 'th']);
404
+ const headerTags = new Set(['meta', 'link', 'script', 'style', 'template', 'noscript']);
405
+ const descriptionTags = new Set(['dt', 'dd']);
406
+ const pBlockTags = new Set(['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'main', 'menu', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul']);
407
+ const pInlineTags = new Set(['a', 'audio', 'del', 'ins', 'map', 'noscript', 'video']);
408
+ const rubyTags = new Set(['rb', 'rt', 'rtc', 'rp']);
409
+ const rtcTag = new Set(['rb', 'rtc', 'rp']);
410
+ const optionTag = new Set(['option', 'optgroup']);
411
+ const tableContentTags = new Set(['tbody', 'tfoot']);
412
+ const tableSectionTags = new Set(['thead', 'tbody', 'tfoot']);
413
+ const cellTags = new Set(['td', 'th']);
414
+ const topLevelTags = new Set(['html', 'head', 'body']);
415
+ const compactTags = new Set(['html', 'body']);
416
+ const looseTags = new Set(['head', 'colgroup', 'caption']);
417
+ const trailingTags = new Set(['dt', 'thead']);
418
+ const htmlTags = new Set(['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'bgsound', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'content', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'multicol', 'nav', 'nobr', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr', 'xmp']);
419
+
420
+ function canRemoveParentTag(optionalStartTag, tag) {
421
+ switch (optionalStartTag) {
422
+ case 'html':
423
+ case 'head':
424
+ return true;
425
+ case 'body':
426
+ return !headerTags.has(tag);
427
+ case 'colgroup':
428
+ return tag === 'col';
429
+ case 'tbody':
430
+ return tag === 'tr';
431
+ }
432
+ return false;
433
+ }
434
+
435
+ function isStartTagMandatory(optionalEndTag, tag) {
436
+ switch (tag) {
437
+ case 'colgroup':
438
+ return optionalEndTag === 'colgroup';
439
+ case 'tbody':
440
+ return tableSectionTags.has(optionalEndTag);
441
+ }
442
+ return false;
443
+ }
444
+
445
+ function canRemovePrecedingTag(optionalEndTag, tag) {
446
+ switch (optionalEndTag) {
447
+ case 'html':
448
+ case 'head':
449
+ case 'body':
450
+ case 'colgroup':
451
+ case 'caption':
452
+ return true;
453
+ case 'li':
454
+ case 'optgroup':
455
+ case 'tr':
456
+ return tag === optionalEndTag;
457
+ case 'dt':
458
+ case 'dd':
459
+ return descriptionTags.has(tag);
460
+ case 'p':
461
+ return pBlockTags.has(tag);
462
+ case 'rb':
463
+ case 'rt':
464
+ case 'rp':
465
+ return rubyTags.has(tag);
466
+ case 'rtc':
467
+ return rtcTag.has(tag);
468
+ case 'option':
469
+ return optionTag.has(tag);
470
+ case 'thead':
471
+ case 'tbody':
472
+ return tableContentTags.has(tag);
473
+ case 'tfoot':
474
+ return tag === 'tbody';
475
+ case 'td':
476
+ case 'th':
477
+ return cellTags.has(tag);
478
+ }
479
+ return false;
480
+ }
481
+
482
+ const reEmptyAttribute = new RegExp(
483
+ '^(?:class|id|style|title|lang|dir|on(?:focus|blur|change|click|dblclick|mouse(' +
484
+ '?:down|up|over|move|out)|key(?:press|down|up)))$');
485
+
486
+ function canDeleteEmptyAttribute(tag, attrName, attrValue, options) {
487
+ const isValueEmpty = !attrValue || /^\s*$/.test(attrValue);
488
+ if (!isValueEmpty) {
489
+ return false;
490
+ }
491
+ if (typeof options.removeEmptyAttributes === 'function') {
492
+ return options.removeEmptyAttributes(attrName, tag);
493
+ }
494
+ return (tag === 'input' && attrName === 'value') || reEmptyAttribute.test(attrName);
495
+ }
496
+
497
+ function hasAttrName(name, attrs) {
498
+ for (let i = attrs.length - 1; i >= 0; i--) {
499
+ if (attrs[i].name === name) {
500
+ return true;
501
+ }
502
+ }
503
+ return false;
504
+ }
505
+
506
+ function canRemoveElement(tag, attrs) {
507
+ switch (tag) {
508
+ case 'textarea':
509
+ return false;
510
+ case 'audio':
511
+ case 'script':
512
+ case 'video':
513
+ if (hasAttrName('src', attrs)) {
514
+ return false;
515
+ }
516
+ break;
517
+ case 'iframe':
518
+ if (hasAttrName('src', attrs) || hasAttrName('srcdoc', attrs)) {
519
+ return false;
520
+ }
521
+ break;
522
+ case 'object':
523
+ if (hasAttrName('data', attrs)) {
524
+ return false;
525
+ }
526
+ break;
527
+ case 'applet':
528
+ if (hasAttrName('code', attrs)) {
529
+ return false;
530
+ }
531
+ break;
532
+ }
533
+ return true;
534
+ }
535
+
536
+ function canCollapseWhitespace(tag) {
537
+ return !/^(?:script|style|pre|textarea)$/.test(tag);
538
+ }
539
+
540
+ function canTrimWhitespace(tag) {
541
+ return !/^(?:pre|textarea)$/.test(tag);
542
+ }
543
+
544
+ async function normalizeAttr(attr, attrs, tag, options) {
545
+ const attrName = options.name(attr.name);
546
+ let attrValue = attr.value;
547
+
548
+ if (options.decodeEntities && attrValue) {
549
+ attrValue = decodeHTMLStrict(attrValue);
550
+ }
551
+
552
+ if ((options.removeRedundantAttributes &&
553
+ isAttributeRedundant(tag, attrName, attrValue, attrs)) ||
554
+ (options.removeScriptTypeAttributes && tag === 'script' &&
555
+ attrName === 'type' && isScriptTypeAttribute(attrValue) && !keepScriptTypeAttribute(attrValue)) ||
556
+ (options.removeStyleLinkTypeAttributes && (tag === 'style' || tag === 'link') &&
557
+ attrName === 'type' && isStyleLinkTypeAttribute(attrValue))) {
558
+ return;
559
+ }
560
+
561
+ if (attrValue) {
562
+ attrValue = await cleanAttributeValue(tag, attrName, attrValue, options, attrs);
563
+ }
564
+
565
+ if (options.removeEmptyAttributes &&
566
+ canDeleteEmptyAttribute(tag, attrName, attrValue, options)) {
567
+ return;
568
+ }
569
+
570
+ if (options.decodeEntities && attrValue) {
571
+ attrValue = attrValue.replace(/&(#?[0-9a-zA-Z]+;)/g, '&amp;$1');
572
+ }
573
+
574
+ return {
575
+ attr,
576
+ name: attrName,
577
+ value: attrValue
578
+ };
579
+ }
580
+
581
+ function buildAttr(normalized, hasUnarySlash, options, isLast, uidAttr) {
582
+ const attrName = normalized.name;
583
+ let attrValue = normalized.value;
584
+ const attr = normalized.attr;
585
+ let attrQuote = attr.quote;
586
+ let attrFragment;
587
+ let emittedAttrValue;
588
+
589
+ if (typeof attrValue !== 'undefined' && (!options.removeAttributeQuotes ||
590
+ ~attrValue.indexOf(uidAttr) || !canRemoveAttributeQuotes(attrValue))) {
591
+ if (!options.preventAttributesEscaping) {
592
+ if (typeof options.quoteCharacter === 'undefined') {
593
+ const apos = (attrValue.match(/'/g) || []).length;
594
+ const quot = (attrValue.match(/"/g) || []).length;
595
+ attrQuote = apos < quot ? '\'' : '"';
596
+ } else {
597
+ attrQuote = options.quoteCharacter === '\'' ? '\'' : '"';
598
+ }
599
+ if (attrQuote === '"') {
600
+ attrValue = attrValue.replace(/"/g, '&#34;');
601
+ } else {
602
+ attrValue = attrValue.replace(/'/g, '&#39;');
603
+ }
604
+ }
605
+ emittedAttrValue = attrQuote + attrValue + attrQuote;
606
+ if (!isLast && !options.removeTagWhitespace) {
607
+ emittedAttrValue += ' ';
608
+ }
609
+ } else if (isLast && !hasUnarySlash && !/\/$/.test(attrValue)) {
610
+ // make sure trailing slash is not interpreted as HTML self-closing tag
611
+ emittedAttrValue = attrValue;
612
+ } else {
613
+ emittedAttrValue = attrValue + ' ';
614
+ }
615
+
616
+ if (typeof attrValue === 'undefined' || (options.collapseBooleanAttributes &&
617
+ isBooleanAttribute(attrName.toLowerCase(), attrValue.toLowerCase()))) {
618
+ attrFragment = attrName;
619
+ if (!isLast) {
620
+ attrFragment += ' ';
621
+ }
622
+ } else {
623
+ attrFragment = attrName + attr.customAssign + emittedAttrValue;
624
+ }
625
+
626
+ return attr.customOpen + attrFragment + attr.customClose;
627
+ }
628
+
629
+ function identity(value) {
630
+ return value;
631
+ }
632
+
633
+ function identityAsync(value) {
634
+ return Promise.resolve(value);
635
+ }
636
+
637
+ const processOptions = (inputOptions) => {
638
+ const options = {
639
+ name: function (name) {
640
+ return name.toLowerCase();
641
+ },
642
+ canCollapseWhitespace,
643
+ canTrimWhitespace,
644
+ html5: true,
645
+ ignoreCustomComments: [
646
+ /^!/,
647
+ /^\s*#/
648
+ ],
649
+ ignoreCustomFragments: [
650
+ /<%[\s\S]*?%>/,
651
+ /<\?[\s\S]*?\?>/
652
+ ],
653
+ includeAutoGeneratedTags: true,
654
+ log: identity,
655
+ minifyCSS: identityAsync,
656
+ minifyJS: identity,
657
+ minifyURLs: identity
658
+ };
659
+
660
+ Object.keys(inputOptions).forEach(function (key) {
661
+ const option = inputOptions[key];
662
+
663
+ if (key === 'caseSensitive') {
664
+ if (option) {
665
+ options.name = identity;
666
+ }
667
+ } else if (key === 'log') {
668
+ if (typeof option === 'function') {
669
+ options.log = option;
670
+ }
671
+ } else if (key === 'minifyCSS' && typeof option !== 'function') {
672
+ if (!option) {
673
+ return;
674
+ }
675
+
676
+ const cleanCssOptions = typeof option === 'object' ? option : {};
677
+
678
+ options.minifyCSS = async function (text, type) {
679
+ text = text.replace(/(url\s*\(\s*)("|'|)(.*?)\2(\s*\))/ig, function (match, prefix, quote, url, suffix) {
680
+ return prefix + quote + options.minifyURLs(url) + quote + suffix;
681
+ });
682
+
683
+ const inputCSS = wrapCSS(text, type);
684
+
685
+ return new Promise((resolve) => {
686
+ new CleanCSS(cleanCssOptions).minify(inputCSS, (_err, output) => {
687
+ if (output.errors.length > 0) {
688
+ output.errors.forEach(options.log);
689
+ resolve(text);
690
+ }
691
+
692
+ const outputCSS = unwrapCSS(output.styles, type);
693
+ resolve(outputCSS);
694
+ });
695
+ });
696
+ };
697
+ } else if (key === 'minifyJS' && typeof option !== 'function') {
698
+ if (!option) {
699
+ return;
700
+ }
701
+
702
+ const terserOptions = typeof option === 'object' ? option : {};
703
+
704
+ terserOptions.parse = {
705
+ ...terserOptions.parse,
706
+ bare_returns: false
707
+ };
708
+
709
+ options.minifyJS = async function (text, inline) {
710
+ const start = text.match(/^\s*<!--.*/);
711
+ const code = start ? text.slice(start[0].length).replace(/\n\s*-->\s*$/, '') : text;
712
+
713
+ terserOptions.parse.bare_returns = inline;
714
+
715
+ try {
716
+ const result = await terser(code, terserOptions);
717
+ return result.code.replace(/;$/, '');
718
+ } catch (error) {
719
+ options.log(error);
720
+ return text;
721
+ }
722
+ };
723
+ } else if (key === 'minifyURLs' && typeof option !== 'function') {
724
+ if (!option) {
725
+ return;
726
+ }
727
+
728
+ let relateUrlOptions = option;
729
+
730
+ if (typeof option === 'string') {
731
+ relateUrlOptions = { site: option };
732
+ } else if (typeof option !== 'object') {
733
+ relateUrlOptions = {};
734
+ }
735
+
736
+ options.minifyURLs = function (text) {
737
+ try {
738
+ return RelateURL.relate(text, relateUrlOptions);
739
+ } catch (err) {
740
+ options.log(err);
741
+ return text;
742
+ }
743
+ };
744
+ } else {
745
+ options[key] = option;
746
+ }
747
+ });
748
+ return options;
749
+ };
750
+
751
+ function uniqueId(value) {
752
+ let id;
753
+ do {
754
+ id = Math.random().toString(36).replace(/^0\.[0-9]*/, '');
755
+ } while (~value.indexOf(id));
756
+ return id;
757
+ }
758
+
759
+ const specialContentTags = new Set(['script', 'style']);
760
+
761
+ async function createSortFns(value, options, uidIgnore, uidAttr) {
762
+ const attrChains = options.sortAttributes && Object.create(null);
763
+ const classChain = options.sortClassName && new TokenChain();
764
+
765
+ function attrNames(attrs) {
766
+ return attrs.map(function (attr) {
767
+ return options.name(attr.name);
768
+ });
769
+ }
770
+
771
+ function shouldSkipUID(token, uid) {
772
+ return !uid || token.indexOf(uid) === -1;
773
+ }
774
+
775
+ function shouldSkipUIDs(token) {
776
+ return shouldSkipUID(token, uidIgnore) && shouldSkipUID(token, uidAttr);
777
+ }
778
+
779
+ async function scan(input) {
780
+ let currentTag, currentType;
781
+ const parser = new HTMLParser(input, {
782
+ start: function (tag, attrs) {
783
+ if (attrChains) {
784
+ if (!attrChains[tag]) {
785
+ attrChains[tag] = new TokenChain();
786
+ }
787
+ attrChains[tag].add(attrNames(attrs).filter(shouldSkipUIDs));
788
+ }
789
+ for (let i = 0, len = attrs.length; i < len; i++) {
790
+ const attr = attrs[i];
791
+ if (classChain && attr.value && options.name(attr.name) === 'class') {
792
+ classChain.add(trimWhitespace(attr.value).split(/[ \t\n\f\r]+/).filter(shouldSkipUIDs));
793
+ } else if (options.processScripts && attr.name.toLowerCase() === 'type') {
794
+ currentTag = tag;
795
+ currentType = attr.value;
796
+ }
797
+ }
798
+ },
799
+ end: function () {
800
+ currentTag = '';
801
+ },
802
+ chars: async function (text) {
803
+ if (options.processScripts && specialContentTags.has(currentTag) &&
804
+ options.processScripts.indexOf(currentType) > -1) {
805
+ await scan(text);
806
+ }
807
+ }
808
+ });
809
+
810
+ await parser.parse();
811
+ }
812
+
813
+ const log = options.log;
814
+ options.log = identity;
815
+ options.sortAttributes = false;
816
+ options.sortClassName = false;
817
+ await scan(await minifyHTML(value, options));
818
+ options.log = log;
819
+ if (attrChains) {
820
+ const attrSorters = Object.create(null);
821
+ for (const tag in attrChains) {
822
+ attrSorters[tag] = attrChains[tag].createSorter();
823
+ }
824
+ options.sortAttributes = function (tag, attrs) {
825
+ const sorter = attrSorters[tag];
826
+ if (sorter) {
827
+ const attrMap = Object.create(null);
828
+ const names = attrNames(attrs);
829
+ names.forEach(function (name, index) {
830
+ (attrMap[name] || (attrMap[name] = [])).push(attrs[index]);
831
+ });
832
+ sorter.sort(names).forEach(function (name, index) {
833
+ attrs[index] = attrMap[name].shift();
834
+ });
835
+ }
836
+ };
837
+ }
838
+ if (classChain) {
839
+ const sorter = classChain.createSorter();
840
+ options.sortClassName = function (value) {
841
+ return sorter.sort(value.split(/[ \n\f\r]+/)).join(' ');
842
+ };
843
+ }
844
+ }
845
+
846
+ async function minifyHTML(value, options, partialMarkup) {
847
+ if (options.collapseWhitespace) {
848
+ value = collapseWhitespace(value, options, true, true);
849
+ }
850
+
851
+ const buffer = [];
852
+ let charsPrevTag;
853
+ let currentChars = '';
854
+ let hasChars;
855
+ let currentTag = '';
856
+ let currentAttrs = [];
857
+ const stackNoTrimWhitespace = [];
858
+ const stackNoCollapseWhitespace = [];
859
+ let optionalStartTag = '';
860
+ let optionalEndTag = '';
861
+ const ignoredMarkupChunks = [];
862
+ const ignoredCustomMarkupChunks = [];
863
+ let uidIgnore;
864
+ let uidAttr;
865
+ let uidPattern;
866
+
867
+ // temporarily replace ignored chunks with comments,
868
+ // so that we don't have to worry what's there.
869
+ // for all we care there might be
870
+ // completely-horribly-broken-alien-non-html-emoj-cthulhu-filled content
871
+ value = value.replace(/<!-- htmlmin:ignore -->([\s\S]*?)<!-- htmlmin:ignore -->/g, function (match, group1) {
872
+ if (!uidIgnore) {
873
+ uidIgnore = uniqueId(value);
874
+ const pattern = new RegExp('^' + uidIgnore + '([0-9]+)$');
875
+ if (options.ignoreCustomComments) {
876
+ options.ignoreCustomComments = options.ignoreCustomComments.slice();
877
+ } else {
878
+ options.ignoreCustomComments = [];
879
+ }
880
+ options.ignoreCustomComments.push(pattern);
881
+ }
882
+ const token = '<!--' + uidIgnore + ignoredMarkupChunks.length + '-->';
883
+ ignoredMarkupChunks.push(group1);
884
+ return token;
885
+ });
886
+
887
+ const customFragments = options.ignoreCustomFragments.map(function (re) {
888
+ return re.source;
889
+ });
890
+ if (customFragments.length) {
891
+ const reCustomIgnore = new RegExp('\\s*(?:' + customFragments.join('|') + ')+\\s*', 'g');
892
+ // temporarily replace custom ignored fragments with unique attributes
893
+ value = value.replace(reCustomIgnore, function (match) {
894
+ if (!uidAttr) {
895
+ uidAttr = uniqueId(value);
896
+ uidPattern = new RegExp('(\\s*)' + uidAttr + '([0-9]+)' + uidAttr + '(\\s*)', 'g');
897
+
898
+ if (options.minifyCSS) {
899
+ options.minifyCSS = (function (fn) {
900
+ return function (text, type) {
901
+ text = text.replace(uidPattern, function (match, prefix, index) {
902
+ const chunks = ignoredCustomMarkupChunks[+index];
903
+ return chunks[1] + uidAttr + index + uidAttr + chunks[2];
904
+ });
905
+
906
+ const ids = [];
907
+ new CleanCSS().minify(wrapCSS(text, type)).warnings.forEach(function (warning) {
908
+ const match = uidPattern.exec(warning);
909
+ if (match) {
910
+ const id = uidAttr + match[2] + uidAttr;
911
+ text = text.replace(id, ignoreCSS(id));
912
+ ids.push(id);
913
+ }
914
+ });
915
+
916
+ return fn(text, type).then(chunk => {
917
+ ids.forEach(function (id) {
918
+ chunk = chunk.replace(ignoreCSS(id), id);
919
+ });
920
+
921
+ return chunk;
922
+ });
923
+ };
924
+ })(options.minifyCSS);
925
+ }
926
+
927
+ if (options.minifyJS) {
928
+ options.minifyJS = (function (fn) {
929
+ return function (text, type) {
930
+ return fn(text.replace(uidPattern, function (match, prefix, index) {
931
+ const chunks = ignoredCustomMarkupChunks[+index];
932
+ return chunks[1] + uidAttr + index + uidAttr + chunks[2];
933
+ }), type);
934
+ };
935
+ })(options.minifyJS);
936
+ }
937
+ }
938
+
939
+ const token = uidAttr + ignoredCustomMarkupChunks.length + uidAttr;
940
+ ignoredCustomMarkupChunks.push(/^(\s*)[\s\S]*?(\s*)$/.exec(match));
941
+ return '\t' + token + '\t';
942
+ });
943
+ }
944
+
945
+ if ((options.sortAttributes && typeof options.sortAttributes !== 'function') ||
946
+ (options.sortClassName && typeof options.sortClassName !== 'function')) {
947
+ await createSortFns(value, options, uidIgnore, uidAttr);
948
+ }
949
+
950
+ function _canCollapseWhitespace(tag, attrs) {
951
+ return options.canCollapseWhitespace(tag, attrs, canCollapseWhitespace);
952
+ }
953
+
954
+ function _canTrimWhitespace(tag, attrs) {
955
+ return options.canTrimWhitespace(tag, attrs, canTrimWhitespace);
956
+ }
957
+
958
+ function removeStartTag() {
959
+ let index = buffer.length - 1;
960
+ while (index > 0 && !/^<[^/!]/.test(buffer[index])) {
961
+ index--;
962
+ }
963
+ buffer.length = Math.max(0, index);
964
+ }
965
+
966
+ function removeEndTag() {
967
+ let index = buffer.length - 1;
968
+ while (index > 0 && !/^<\//.test(buffer[index])) {
969
+ index--;
970
+ }
971
+ buffer.length = Math.max(0, index);
972
+ }
973
+
974
+ // look for trailing whitespaces, bypass any inline tags
975
+ function trimTrailingWhitespace(index, nextTag) {
976
+ for (let endTag = null; index >= 0 && _canTrimWhitespace(endTag); index--) {
977
+ const str = buffer[index];
978
+ const match = str.match(/^<\/([\w:-]+)>$/);
979
+ if (match) {
980
+ endTag = match[1];
981
+ } else if (/>$/.test(str) || (buffer[index] = collapseWhitespaceSmart(str, null, nextTag, options))) {
982
+ break;
983
+ }
984
+ }
985
+ }
986
+
987
+ // look for trailing whitespaces from previously processed text
988
+ // which may not be trimmed due to a following comment or an empty
989
+ // element which has now been removed
990
+ function squashTrailingWhitespace(nextTag) {
991
+ let charsIndex = buffer.length - 1;
992
+ if (buffer.length > 1) {
993
+ const item = buffer[buffer.length - 1];
994
+ if (/^(?:<!|$)/.test(item) && item.indexOf(uidIgnore) === -1) {
995
+ charsIndex--;
996
+ }
997
+ }
998
+ trimTrailingWhitespace(charsIndex, nextTag);
999
+ }
1000
+
1001
+ const parser = new HTMLParser(value, {
1002
+ partialMarkup,
1003
+ continueOnParseError: options.continueOnParseError,
1004
+ customAttrAssign: options.customAttrAssign,
1005
+ customAttrSurround: options.customAttrSurround,
1006
+ html5: options.html5,
1007
+
1008
+ start: async function (tag, attrs, unary, unarySlash, autoGenerated) {
1009
+ if (tag.toLowerCase() === 'svg') {
1010
+ options = Object.create(options);
1011
+ options.caseSensitive = true;
1012
+ options.keepClosingSlash = true;
1013
+ options.name = identity;
1014
+ }
1015
+ tag = options.name(tag);
1016
+ currentTag = tag;
1017
+ charsPrevTag = tag;
1018
+ if (!inlineTextTags.has(tag)) {
1019
+ currentChars = '';
1020
+ }
1021
+ hasChars = false;
1022
+ currentAttrs = attrs;
1023
+
1024
+ let optional = options.removeOptionalTags;
1025
+ if (optional) {
1026
+ const htmlTag = htmlTags.has(tag);
1027
+ // <html> may be omitted if first thing inside is not comment
1028
+ // <head> may be omitted if first thing inside is an element
1029
+ // <body> may be omitted if first thing inside is not space, comment, <meta>, <link>, <script>, <style> or <template>
1030
+ // <colgroup> may be omitted if first thing inside is <col>
1031
+ // <tbody> may be omitted if first thing inside is <tr>
1032
+ if (htmlTag && canRemoveParentTag(optionalStartTag, tag)) {
1033
+ removeStartTag();
1034
+ }
1035
+ optionalStartTag = '';
1036
+ // end-tag-followed-by-start-tag omission rules
1037
+ if (htmlTag && canRemovePrecedingTag(optionalEndTag, tag)) {
1038
+ removeEndTag();
1039
+ // <colgroup> cannot be omitted if preceding </colgroup> is omitted
1040
+ // <tbody> cannot be omitted if preceding </tbody>, </thead> or </tfoot> is omitted
1041
+ optional = !isStartTagMandatory(optionalEndTag, tag);
1042
+ }
1043
+ optionalEndTag = '';
1044
+ }
1045
+
1046
+ // set whitespace flags for nested tags (eg. <code> within a <pre>)
1047
+ if (options.collapseWhitespace) {
1048
+ if (!stackNoTrimWhitespace.length) {
1049
+ squashTrailingWhitespace(tag);
1050
+ }
1051
+ if (!unary) {
1052
+ if (!_canTrimWhitespace(tag, attrs) || stackNoTrimWhitespace.length) {
1053
+ stackNoTrimWhitespace.push(tag);
1054
+ }
1055
+ if (!_canCollapseWhitespace(tag, attrs) || stackNoCollapseWhitespace.length) {
1056
+ stackNoCollapseWhitespace.push(tag);
1057
+ }
1058
+ }
1059
+ }
1060
+
1061
+ const openTag = '<' + tag;
1062
+ const hasUnarySlash = unarySlash && options.keepClosingSlash;
1063
+
1064
+ buffer.push(openTag);
1065
+
1066
+ if (options.sortAttributes) {
1067
+ options.sortAttributes(tag, attrs);
1068
+ }
1069
+
1070
+ const parts = [];
1071
+ for (let i = attrs.length, isLast = true; --i >= 0;) {
1072
+ const normalized = await normalizeAttr(attrs[i], attrs, tag, options);
1073
+ if (normalized) {
1074
+ parts.unshift(buildAttr(normalized, hasUnarySlash, options, isLast, uidAttr));
1075
+ isLast = false;
1076
+ }
1077
+ }
1078
+ if (parts.length > 0) {
1079
+ buffer.push(' ');
1080
+ buffer.push.apply(buffer, parts);
1081
+ } else if (optional && optionalStartTags.has(tag)) {
1082
+ // start tag must never be omitted if it has any attributes
1083
+ optionalStartTag = tag;
1084
+ }
1085
+
1086
+ buffer.push(buffer.pop() + (hasUnarySlash ? '/' : '') + '>');
1087
+
1088
+ if (autoGenerated && !options.includeAutoGeneratedTags) {
1089
+ removeStartTag();
1090
+ optionalStartTag = '';
1091
+ }
1092
+ },
1093
+ end: function (tag, attrs, autoGenerated) {
1094
+ if (tag.toLowerCase() === 'svg') {
1095
+ options = Object.getPrototypeOf(options);
1096
+ }
1097
+ tag = options.name(tag);
1098
+
1099
+ // check if current tag is in a whitespace stack
1100
+ if (options.collapseWhitespace) {
1101
+ if (stackNoTrimWhitespace.length) {
1102
+ if (tag === stackNoTrimWhitespace[stackNoTrimWhitespace.length - 1]) {
1103
+ stackNoTrimWhitespace.pop();
1104
+ }
1105
+ } else {
1106
+ squashTrailingWhitespace('/' + tag);
1107
+ }
1108
+ if (stackNoCollapseWhitespace.length &&
1109
+ tag === stackNoCollapseWhitespace[stackNoCollapseWhitespace.length - 1]) {
1110
+ stackNoCollapseWhitespace.pop();
1111
+ }
1112
+ }
1113
+
1114
+ let isElementEmpty = false;
1115
+ if (tag === currentTag) {
1116
+ currentTag = '';
1117
+ isElementEmpty = !hasChars;
1118
+ }
1119
+
1120
+ if (options.removeOptionalTags) {
1121
+ // <html>, <head> or <body> may be omitted if the element is empty
1122
+ if (isElementEmpty && topLevelTags.has(optionalStartTag)) {
1123
+ removeStartTag();
1124
+ }
1125
+ optionalStartTag = '';
1126
+ // </html> or </body> may be omitted if not followed by comment
1127
+ // </head> may be omitted if not followed by space or comment
1128
+ // </p> may be omitted if no more content in non-</a> parent
1129
+ // except for </dt> or </thead>, end tags may be omitted if no more content in parent element
1130
+ if (htmlTags.has(tag) && optionalEndTag && !trailingTags.has(optionalEndTag) && (optionalEndTag !== 'p' || !pInlineTags.has(tag))) {
1131
+ removeEndTag();
1132
+ }
1133
+ optionalEndTag = optionalEndTags.has(tag) ? tag : '';
1134
+ }
1135
+
1136
+ if (options.removeEmptyElements && isElementEmpty && canRemoveElement(tag, attrs)) {
1137
+ // remove last "element" from buffer
1138
+ removeStartTag();
1139
+ optionalStartTag = '';
1140
+ optionalEndTag = '';
1141
+ } else {
1142
+ if (autoGenerated && !options.includeAutoGeneratedTags) {
1143
+ optionalEndTag = '';
1144
+ } else {
1145
+ buffer.push('</' + tag + '>');
1146
+ }
1147
+ charsPrevTag = '/' + tag;
1148
+ if (!inlineTags.has(tag)) {
1149
+ currentChars = '';
1150
+ } else if (isElementEmpty) {
1151
+ currentChars += '|';
1152
+ }
1153
+ }
1154
+ },
1155
+ chars: async function (text, prevTag, nextTag) {
1156
+ prevTag = prevTag === '' ? 'comment' : prevTag;
1157
+ nextTag = nextTag === '' ? 'comment' : nextTag;
1158
+ if (options.decodeEntities && text && !specialContentTags.has(currentTag)) {
1159
+ text = decodeHTML(text);
1160
+ }
1161
+ if (options.collapseWhitespace) {
1162
+ if (!stackNoTrimWhitespace.length) {
1163
+ if (prevTag === 'comment') {
1164
+ const prevComment = buffer[buffer.length - 1];
1165
+ if (prevComment.indexOf(uidIgnore) === -1) {
1166
+ if (!prevComment) {
1167
+ prevTag = charsPrevTag;
1168
+ }
1169
+ if (buffer.length > 1 && (!prevComment || (!options.conservativeCollapse && / $/.test(currentChars)))) {
1170
+ const charsIndex = buffer.length - 2;
1171
+ buffer[charsIndex] = buffer[charsIndex].replace(/\s+$/, function (trailingSpaces) {
1172
+ text = trailingSpaces + text;
1173
+ return '';
1174
+ });
1175
+ }
1176
+ }
1177
+ }
1178
+ if (prevTag) {
1179
+ if (prevTag === '/nobr' || prevTag === 'wbr') {
1180
+ if (/^\s/.test(text)) {
1181
+ let tagIndex = buffer.length - 1;
1182
+ while (tagIndex > 0 && buffer[tagIndex].lastIndexOf('<' + prevTag) !== 0) {
1183
+ tagIndex--;
1184
+ }
1185
+ trimTrailingWhitespace(tagIndex - 1, 'br');
1186
+ }
1187
+ } else if (inlineTextTags.has(prevTag.charAt(0) === '/' ? prevTag.slice(1) : prevTag)) {
1188
+ text = collapseWhitespace(text, options, /(?:^|\s)$/.test(currentChars));
1189
+ }
1190
+ }
1191
+ if (prevTag || nextTag) {
1192
+ text = collapseWhitespaceSmart(text, prevTag, nextTag, options);
1193
+ } else {
1194
+ text = collapseWhitespace(text, options, true, true);
1195
+ }
1196
+ if (!text && /\s$/.test(currentChars) && prevTag && prevTag.charAt(0) === '/') {
1197
+ trimTrailingWhitespace(buffer.length - 1, nextTag);
1198
+ }
1199
+ }
1200
+ if (!stackNoCollapseWhitespace.length && nextTag !== 'html' && !(prevTag && nextTag)) {
1201
+ text = collapseWhitespace(text, options, false, false, true);
1202
+ }
1203
+ }
1204
+ if (options.processScripts && specialContentTags.has(currentTag)) {
1205
+ text = await processScript(text, options, currentAttrs);
1206
+ }
1207
+ if (isExecutableScript(currentTag, currentAttrs)) {
1208
+ text = await options.minifyJS(text);
1209
+ }
1210
+ if (isStyleSheet(currentTag, currentAttrs)) {
1211
+ text = await options.minifyCSS(text);
1212
+ }
1213
+ if (options.removeOptionalTags && text) {
1214
+ // <html> may be omitted if first thing inside is not comment
1215
+ // <body> may be omitted if first thing inside is not space, comment, <meta>, <link>, <script>, <style> or <template>
1216
+ if (optionalStartTag === 'html' || (optionalStartTag === 'body' && !/^\s/.test(text))) {
1217
+ removeStartTag();
1218
+ }
1219
+ optionalStartTag = '';
1220
+ // </html> or </body> may be omitted if not followed by comment
1221
+ // </head>, </colgroup> or </caption> may be omitted if not followed by space or comment
1222
+ if (compactTags.has(optionalEndTag) || (looseTags.has(optionalEndTag) && !/^\s/.test(text))) {
1223
+ removeEndTag();
1224
+ }
1225
+ optionalEndTag = '';
1226
+ }
1227
+ charsPrevTag = /^\s*$/.test(text) ? prevTag : 'comment';
1228
+ if (options.decodeEntities && text && !specialContentTags.has(currentTag)) {
1229
+ // Escape any `&` symbols that start either:
1230
+ // 1) a legacy named character reference (i.e. one that doesn't end with `;`)
1231
+ // 2) or any other character reference (i.e. one that does end with `;`)
1232
+ // Note that `&` can be escaped as `&amp`, without the semi-colon.
1233
+ // https://mathiasbynens.be/notes/ambiguous-ampersands
1234
+ text = text.replace(/&((?:Iacute|aacute|uacute|plusmn|Otilde|otilde|agrave|Agrave|Yacute|yacute|Oslash|oslash|atilde|Atilde|brvbar|ccedil|Ccedil|Ograve|curren|divide|eacute|Eacute|ograve|Oacute|egrave|Egrave|Ugrave|frac12|frac14|frac34|ugrave|oacute|iacute|Ntilde|ntilde|Uacute|middot|igrave|Igrave|iquest|Aacute|cedil|laquo|micro|iexcl|Icirc|icirc|acirc|Ucirc|Ecirc|ocirc|Ocirc|ecirc|ucirc|Aring|aring|AElig|aelig|acute|pound|raquo|Acirc|times|THORN|szlig|thorn|COPY|auml|ordf|ordm|Uuml|macr|uuml|Auml|ouml|Ouml|para|nbsp|euml|quot|QUOT|Euml|yuml|cent|sect|copy|sup1|sup2|sup3|iuml|Iuml|ETH|shy|reg|not|yen|amp|AMP|REG|uml|eth|deg|gt|GT|LT|lt)(?!;)|(?:#?[0-9a-zA-Z]+;))/g, '&amp$1').replace(/</g, '&lt;');
1235
+ }
1236
+ if (uidPattern && options.collapseWhitespace && stackNoTrimWhitespace.length) {
1237
+ text = text.replace(uidPattern, function (match, prefix, index) {
1238
+ return ignoredCustomMarkupChunks[+index][0];
1239
+ });
1240
+ }
1241
+ currentChars += text;
1242
+ if (text) {
1243
+ hasChars = true;
1244
+ }
1245
+ buffer.push(text);
1246
+ },
1247
+ comment: async function (text, nonStandard) {
1248
+ const prefix = nonStandard ? '<!' : '<!--';
1249
+ const suffix = nonStandard ? '>' : '-->';
1250
+ if (isConditionalComment(text)) {
1251
+ text = prefix + await cleanConditionalComment(text, options) + suffix;
1252
+ } else if (options.removeComments) {
1253
+ if (isIgnoredComment(text, options)) {
1254
+ text = '<!--' + text + '-->';
1255
+ } else {
1256
+ text = '';
1257
+ }
1258
+ } else {
1259
+ text = prefix + text + suffix;
1260
+ }
1261
+ if (options.removeOptionalTags && text) {
1262
+ // preceding comments suppress tag omissions
1263
+ optionalStartTag = '';
1264
+ optionalEndTag = '';
1265
+ }
1266
+ buffer.push(text);
1267
+ },
1268
+ doctype: function (doctype) {
1269
+ buffer.push(options.useShortDoctype
1270
+ ? '<!doctype' +
1271
+ (options.removeTagWhitespace ? '' : ' ') + 'html>'
1272
+ : collapseWhitespaceAll(doctype));
1273
+ }
1274
+ });
1275
+
1276
+ await parser.parse();
1277
+
1278
+ if (options.removeOptionalTags) {
1279
+ // <html> may be omitted if first thing inside is not comment
1280
+ // <head> or <body> may be omitted if empty
1281
+ if (topLevelTags.has(optionalStartTag)) {
1282
+ removeStartTag();
1283
+ }
1284
+ // except for </dt> or </thead>, end tags may be omitted if no more content in parent element
1285
+ if (optionalEndTag && !trailingTags.has(optionalEndTag)) {
1286
+ removeEndTag();
1287
+ }
1288
+ }
1289
+ if (options.collapseWhitespace) {
1290
+ squashTrailingWhitespace('br');
1291
+ }
1292
+
1293
+ return joinResultSegments(buffer, options, uidPattern
1294
+ ? function (str) {
1295
+ return str.replace(uidPattern, function (match, prefix, index, suffix) {
1296
+ let chunk = ignoredCustomMarkupChunks[+index][0];
1297
+ if (options.collapseWhitespace) {
1298
+ if (prefix !== '\t') {
1299
+ chunk = prefix + chunk;
1300
+ }
1301
+ if (suffix !== '\t') {
1302
+ chunk += suffix;
1303
+ }
1304
+ return collapseWhitespace(chunk, {
1305
+ preserveLineBreaks: options.preserveLineBreaks,
1306
+ conservativeCollapse: !options.trimCustomFragments
1307
+ }, /^[ \n\r\t\f]/.test(chunk), /[ \n\r\t\f]$/.test(chunk));
1308
+ }
1309
+ return chunk;
1310
+ });
1311
+ }
1312
+ : identity, uidIgnore
1313
+ ? function (str) {
1314
+ return str.replace(new RegExp('<!--' + uidIgnore + '([0-9]+)-->', 'g'), function (match, index) {
1315
+ return ignoredMarkupChunks[+index];
1316
+ });
1317
+ }
1318
+ : identity);
1319
+ }
1320
+
1321
+ function joinResultSegments(results, options, restoreCustom, restoreIgnore) {
1322
+ let str;
1323
+ const maxLineLength = options.maxLineLength;
1324
+ const noNewlinesBeforeTagClose = options.noNewlinesBeforeTagClose;
1325
+
1326
+ if (maxLineLength) {
1327
+ let line = ''; const lines = [];
1328
+ while (results.length) {
1329
+ const len = line.length;
1330
+ const end = results[0].indexOf('\n');
1331
+ const isClosingTag = Boolean(results[0].match(endTag));
1332
+ const shouldKeepSameLine = noNewlinesBeforeTagClose && isClosingTag;
1333
+
1334
+ if (end < 0) {
1335
+ line += restoreIgnore(restoreCustom(results.shift()));
1336
+ } else {
1337
+ line += restoreIgnore(restoreCustom(results[0].slice(0, end)));
1338
+ results[0] = results[0].slice(end + 1);
1339
+ }
1340
+ if (len > 0 && line.length > maxLineLength && !shouldKeepSameLine) {
1341
+ lines.push(line.slice(0, len));
1342
+ line = line.slice(len);
1343
+ } else if (end >= 0) {
1344
+ lines.push(line);
1345
+ line = '';
1346
+ }
1347
+ }
1348
+ if (line) {
1349
+ lines.push(line);
1350
+ }
1351
+ str = lines.join('\n');
1352
+ } else {
1353
+ str = restoreIgnore(restoreCustom(results.join('')));
1354
+ }
1355
+ return options.collapseWhitespace ? collapseWhitespace(str, options, true, true) : str;
1356
+ }
1357
+
1358
+ export const minify = async function (value, options) {
1359
+ const start = Date.now();
1360
+ options = processOptions(options || {});
1361
+ const result = await minifyHTML(value, options);
1362
+ options.log('minified in: ' + (Date.now() - start) + 'ms');
1363
+ return result;
1364
+ };
1365
+
1366
+ export default { minify };