yummies 5.7.0 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/async.js +26 -59
  2. package/async.js.map +1 -0
  3. package/common.d.ts +1 -1
  4. package/common.d.ts.map +1 -1
  5. package/common.js +5 -13
  6. package/common.js.map +1 -0
  7. package/complex/global-config.d.ts +1 -1
  8. package/complex/global-config.d.ts.map +1 -1
  9. package/complex/index.d.ts +3 -3
  10. package/complex/index.d.ts.map +1 -1
  11. package/complex/modules-factory.d.ts +1 -1
  12. package/complex/modules-factory.d.ts.map +1 -1
  13. package/complex.js +66 -0
  14. package/complex.js.map +1 -0
  15. package/cookie.d.ts +1 -1
  16. package/cookie.d.ts.map +1 -1
  17. package/cookie.js +4 -8
  18. package/cookie.js.map +1 -0
  19. package/css.d.ts +1 -1
  20. package/css.js +2780 -49
  21. package/css.js.map +1 -0
  22. package/data.js +32 -50
  23. package/data.js.map +1 -0
  24. package/date-time.d.ts +2 -3
  25. package/date-time.d.ts.map +1 -1
  26. package/date-time.js +588 -154
  27. package/date-time.js.map +1 -0
  28. package/device.js +23 -20
  29. package/device.js.map +1 -0
  30. package/encodings.js +269 -265
  31. package/encodings.js.map +1 -0
  32. package/errors.d.ts +1 -1
  33. package/errors.d.ts.map +1 -1
  34. package/errors.js +8 -29
  35. package/errors.js.map +1 -0
  36. package/file.js +19 -23
  37. package/file.js.map +1 -0
  38. package/format/_exports.d.ts +4 -4
  39. package/format/_exports.d.ts.map +1 -1
  40. package/format/index.d.ts +1 -1
  41. package/format/index.d.ts.map +1 -1
  42. package/format/number.d.ts +1 -1
  43. package/format/number.d.ts.map +1 -1
  44. package/format/percent.d.ts +2 -2
  45. package/format/percent.d.ts.map +1 -1
  46. package/format.js +27 -0
  47. package/format.js.map +1 -0
  48. package/html.d.ts +2 -2
  49. package/html.d.ts.map +1 -1
  50. package/html.js +636 -169
  51. package/html.js.map +1 -0
  52. package/id.js +25 -70
  53. package/id.js.map +1 -0
  54. package/imports.js +22 -37
  55. package/imports.js.map +1 -0
  56. package/math.d.ts +1 -1
  57. package/math.d.ts.map +1 -1
  58. package/math.js +10 -14
  59. package/math.js.map +1 -0
  60. package/media.js +54 -96
  61. package/media.js.map +1 -0
  62. package/mobx/apply-observable.d.ts +1 -1
  63. package/mobx/apply-observable.d.ts.map +1 -1
  64. package/mobx/create-enhanced-atom.d.ts +2 -2
  65. package/mobx/create-enhanced-atom.d.ts.map +1 -1
  66. package/mobx/deep-observable-struct.d.ts +1 -1
  67. package/mobx/deep-observable-struct.d.ts.map +1 -1
  68. package/mobx/get-mobx-administration.d.ts +2 -2
  69. package/mobx/get-mobx-administration.d.ts.map +1 -1
  70. package/mobx/index.d.ts +5 -5
  71. package/mobx/index.d.ts.map +1 -1
  72. package/mobx/lazy-observe.d.ts +6 -0
  73. package/mobx/lazy-observe.d.ts.map +1 -1
  74. package/mobx.js +89 -0
  75. package/mobx.js.map +1 -0
  76. package/ms.js +12 -17
  77. package/ms.js.map +1 -0
  78. package/number.js +9 -12
  79. package/number.js.map +1 -0
  80. package/package.json +93 -92
  81. package/parser/_exports.d.ts +3 -3
  82. package/parser/_exports.d.ts.map +1 -1
  83. package/parser/index.d.ts +1 -1
  84. package/parser/index.d.ts.map +1 -1
  85. package/parser/number.d.ts +1 -1
  86. package/parser/number.d.ts.map +1 -1
  87. package/parser/percent.d.ts +2 -2
  88. package/parser/percent.d.ts.map +1 -1
  89. package/parser/string.d.ts +1 -1
  90. package/parser/string.d.ts.map +1 -1
  91. package/parser.js +15 -0
  92. package/parser.js.map +1 -0
  93. package/price.js +13 -16
  94. package/price.js.map +1 -0
  95. package/random.js +11 -13
  96. package/random.js.map +1 -0
  97. package/react/hooks/index.d.ts +21 -21
  98. package/react/hooks/index.d.ts.map +1 -1
  99. package/react/hooks/use-click-outside.d.ts +1 -1
  100. package/react/hooks/use-define-ref.d.ts +1 -1
  101. package/react/hooks/use-element-ref.d.ts +1 -1
  102. package/react/hooks/use-event.d.ts +1 -1
  103. package/react/hooks/use-event.d.ts.map +1 -1
  104. package/react/hooks/use-initial-height.d.ts +1 -1
  105. package/react/hooks/use-last-value-ref.d.ts +1 -1
  106. package/react/hooks/use-resize-observer.d.ts +1 -1
  107. package/react/hooks/use-sync-ref.d.ts +1 -1
  108. package/react/hooks/use-toggle.d.ts +1 -1
  109. package/react/hooks/use-value.d.ts +1 -1
  110. package/react/index.d.ts +1 -1
  111. package/react/index.d.ts.map +1 -1
  112. package/react.js +152 -0
  113. package/react.js.map +1 -0
  114. package/sound.js +7 -11
  115. package/sound.js.map +1 -0
  116. package/text.js +20 -46
  117. package/text.js.map +1 -0
  118. package/type-guard/_exports.d.ts +1 -1
  119. package/type-guard/_exports.d.ts.map +1 -1
  120. package/type-guard/index.d.ts +1 -1
  121. package/type-guard/index.d.ts.map +1 -1
  122. package/type-guard.js +5 -0
  123. package/type-guard.js.map +1 -0
  124. package/utility-types.d.ts.map +1 -0
  125. package/utility-types.js +2 -0
  126. package/utility-types.js.map +1 -0
  127. package/utils/types.js +2 -1
  128. package/utils/types.js.map +1 -0
  129. package/vibrate.js +6 -7
  130. package/vibrate.js.map +1 -0
  131. package/~index-C3wKHvHr.js +80 -0
  132. package/~index-C3wKHvHr.js.map +1 -0
  133. package/~number-EWff2XI6.js +25 -0
  134. package/~number-EWff2XI6.js.map +1 -0
  135. package/~number-baxVnzrJ.js +32 -0
  136. package/~number-baxVnzrJ.js.map +1 -0
  137. package/async.cjs +0 -70
  138. package/async.d.cts +0 -28
  139. package/async.d.cts.map +0 -1
  140. package/common.cjs +0 -18
  141. package/common.d.cts +0 -15
  142. package/common.d.cts.map +0 -1
  143. package/complex/counter.cjs +0 -21
  144. package/complex/counter.d.cts +0 -15
  145. package/complex/counter.d.cts.map +0 -1
  146. package/complex/counter.js +0 -17
  147. package/complex/global-config.cjs +0 -46
  148. package/complex/global-config.d.cts +0 -11
  149. package/complex/global-config.d.cts.map +0 -1
  150. package/complex/global-config.js +0 -41
  151. package/complex/index.cjs +0 -19
  152. package/complex/index.d.cts +0 -4
  153. package/complex/index.d.cts.map +0 -1
  154. package/complex/index.js +0 -3
  155. package/complex/modules-factory.cjs +0 -50
  156. package/complex/modules-factory.d.cts +0 -49
  157. package/complex/modules-factory.d.cts.map +0 -1
  158. package/complex/modules-factory.js +0 -46
  159. package/cookie.cjs +0 -13
  160. package/cookie.d.cts +0 -3
  161. package/cookie.d.cts.map +0 -1
  162. package/css.cjs +0 -64
  163. package/css.d.cts +0 -42
  164. package/css.d.cts.map +0 -1
  165. package/data.cjs +0 -58
  166. package/data.d.cts +0 -4
  167. package/data.d.cts.map +0 -1
  168. package/date-time.cjs +0 -171
  169. package/date-time.d.cts +0 -28
  170. package/date-time.d.cts.map +0 -1
  171. package/device.cjs +0 -28
  172. package/device.d.cts +0 -8
  173. package/device.d.cts.map +0 -1
  174. package/encodings.cjs +0 -270
  175. package/encodings.d.cts +0 -2
  176. package/encodings.d.cts.map +0 -1
  177. package/errors.cjs +0 -34
  178. package/errors.d.cts +0 -19
  179. package/errors.d.cts.map +0 -1
  180. package/file.cjs +0 -29
  181. package/file.d.cts +0 -3
  182. package/file.d.cts.map +0 -1
  183. package/format/_exports.cjs +0 -20
  184. package/format/_exports.d.cts +0 -5
  185. package/format/_exports.d.cts.map +0 -1
  186. package/format/_exports.js +0 -4
  187. package/format/constants.cjs +0 -6
  188. package/format/constants.d.cts +0 -4
  189. package/format/constants.d.cts.map +0 -1
  190. package/format/constants.js +0 -3
  191. package/format/index.cjs +0 -40
  192. package/format/index.d.cts +0 -3
  193. package/format/index.d.cts.map +0 -1
  194. package/format/index.js +0 -4
  195. package/format/number.cjs +0 -48
  196. package/format/number.d.cts +0 -36
  197. package/format/number.d.cts.map +0 -1
  198. package/format/number.js +0 -44
  199. package/format/percent.cjs +0 -27
  200. package/format/percent.d.cts +0 -15
  201. package/format/percent.d.cts.map +0 -1
  202. package/format/percent.js +0 -23
  203. package/format/skip-spaces.cjs +0 -8
  204. package/format/skip-spaces.d.cts +0 -5
  205. package/format/skip-spaces.d.cts.map +0 -1
  206. package/format/skip-spaces.js +0 -4
  207. package/html.cjs +0 -202
  208. package/html.d.cts +0 -44
  209. package/html.d.cts.map +0 -1
  210. package/id.cjs +0 -76
  211. package/id.d.cts +0 -63
  212. package/id.d.cts.map +0 -1
  213. package/imports.cjs +0 -45
  214. package/imports.d.cts +0 -15
  215. package/imports.d.cts.map +0 -1
  216. package/math.cjs +0 -23
  217. package/math.d.cts +0 -13
  218. package/math.d.cts.map +0 -1
  219. package/media.cjs +0 -115
  220. package/media.d.cts +0 -20
  221. package/media.d.cts.map +0 -1
  222. package/mobx/apply-observable.cjs +0 -16
  223. package/mobx/apply-observable.d.cts +0 -4
  224. package/mobx/apply-observable.d.cts.map +0 -1
  225. package/mobx/apply-observable.js +0 -12
  226. package/mobx/create-enhanced-atom.cjs +0 -16
  227. package/mobx/create-enhanced-atom.d.cts +0 -11
  228. package/mobx/create-enhanced-atom.d.cts.map +0 -1
  229. package/mobx/create-enhanced-atom.js +0 -12
  230. package/mobx/deep-observable-struct.cjs +0 -61
  231. package/mobx/deep-observable-struct.d.cts +0 -7
  232. package/mobx/deep-observable-struct.d.cts.map +0 -1
  233. package/mobx/deep-observable-struct.js +0 -57
  234. package/mobx/get-mobx-administration.cjs +0 -6
  235. package/mobx/get-mobx-administration.d.cts +0 -6
  236. package/mobx/get-mobx-administration.d.cts.map +0 -1
  237. package/mobx/get-mobx-administration.js +0 -2
  238. package/mobx/index.cjs +0 -21
  239. package/mobx/index.d.cts +0 -6
  240. package/mobx/index.d.cts.map +0 -1
  241. package/mobx/index.js +0 -5
  242. package/mobx/lazy-observe.cjs +0 -52
  243. package/mobx/lazy-observe.d.cts +0 -8
  244. package/mobx/lazy-observe.d.cts.map +0 -1
  245. package/mobx/lazy-observe.js +0 -48
  246. package/ms.cjs +0 -22
  247. package/ms.d.cts +0 -19
  248. package/ms.d.cts.map +0 -1
  249. package/number.cjs +0 -16
  250. package/number.d.cts +0 -8
  251. package/number.d.cts.map +0 -1
  252. package/parser/_exports.cjs +0 -19
  253. package/parser/_exports.d.cts +0 -4
  254. package/parser/_exports.d.cts.map +0 -1
  255. package/parser/_exports.js +0 -3
  256. package/parser/index.cjs +0 -40
  257. package/parser/index.d.cts +0 -3
  258. package/parser/index.d.cts.map +0 -1
  259. package/parser/index.js +0 -4
  260. package/parser/number.cjs +0 -48
  261. package/parser/number.d.cts +0 -21
  262. package/parser/number.d.cts.map +0 -1
  263. package/parser/number.js +0 -44
  264. package/parser/percent.cjs +0 -8
  265. package/parser/percent.d.cts +0 -4
  266. package/parser/percent.d.cts.map +0 -1
  267. package/parser/percent.js +0 -4
  268. package/parser/string.cjs +0 -18
  269. package/parser/string.d.cts +0 -7
  270. package/parser/string.d.cts.map +0 -1
  271. package/parser/string.js +0 -14
  272. package/price.cjs +0 -21
  273. package/price.d.cts +0 -6
  274. package/price.d.cts.map +0 -1
  275. package/random.cjs +0 -25
  276. package/random.d.cts +0 -9
  277. package/random.d.cts.map +0 -1
  278. package/react/hooks/index.cjs +0 -37
  279. package/react/hooks/index.d.cts +0 -22
  280. package/react/hooks/index.d.cts.map +0 -1
  281. package/react/hooks/index.js +0 -21
  282. package/react/hooks/use-abort-controller.cjs +0 -15
  283. package/react/hooks/use-abort-controller.d.cts +0 -2
  284. package/react/hooks/use-abort-controller.d.cts.map +0 -1
  285. package/react/hooks/use-abort-controller.js +0 -11
  286. package/react/hooks/use-abort-signal.cjs +0 -8
  287. package/react/hooks/use-abort-signal.d.cts +0 -2
  288. package/react/hooks/use-abort-signal.d.cts.map +0 -1
  289. package/react/hooks/use-abort-signal.js +0 -4
  290. package/react/hooks/use-click-outside.cjs +0 -17
  291. package/react/hooks/use-click-outside.d.cts +0 -9
  292. package/react/hooks/use-click-outside.d.cts.map +0 -1
  293. package/react/hooks/use-click-outside.js +0 -13
  294. package/react/hooks/use-constant.cjs +0 -19
  295. package/react/hooks/use-constant.d.cts +0 -9
  296. package/react/hooks/use-constant.d.cts.map +0 -1
  297. package/react/hooks/use-constant.js +0 -15
  298. package/react/hooks/use-define-ref.cjs +0 -19
  299. package/react/hooks/use-define-ref.d.cts +0 -10
  300. package/react/hooks/use-define-ref.d.cts.map +0 -1
  301. package/react/hooks/use-define-ref.js +0 -15
  302. package/react/hooks/use-element-ref.cjs +0 -12
  303. package/react/hooks/use-element-ref.d.cts +0 -2
  304. package/react/hooks/use-element-ref.d.cts.map +0 -1
  305. package/react/hooks/use-element-ref.js +0 -8
  306. package/react/hooks/use-event-listener.cjs +0 -17
  307. package/react/hooks/use-event-listener.d.cts +0 -8
  308. package/react/hooks/use-event-listener.d.cts.map +0 -1
  309. package/react/hooks/use-event-listener.js +0 -13
  310. package/react/hooks/use-event.cjs +0 -23
  311. package/react/hooks/use-event.d.cts +0 -3
  312. package/react/hooks/use-event.d.cts.map +0 -1
  313. package/react/hooks/use-event.js +0 -19
  314. package/react/hooks/use-flag.cjs +0 -19
  315. package/react/hooks/use-flag.d.cts +0 -8
  316. package/react/hooks/use-flag.d.cts.map +0 -1
  317. package/react/hooks/use-flag.js +0 -15
  318. package/react/hooks/use-force-update.cjs +0 -11
  319. package/react/hooks/use-force-update.d.cts +0 -2
  320. package/react/hooks/use-force-update.d.cts.map +0 -1
  321. package/react/hooks/use-force-update.js +0 -7
  322. package/react/hooks/use-initial-height.cjs +0 -15
  323. package/react/hooks/use-initial-height.d.cts +0 -5
  324. package/react/hooks/use-initial-height.d.cts.map +0 -1
  325. package/react/hooks/use-initial-height.js +0 -11
  326. package/react/hooks/use-instance.cjs +0 -31
  327. package/react/hooks/use-instance.d.cts +0 -27
  328. package/react/hooks/use-instance.d.cts.map +0 -1
  329. package/react/hooks/use-instance.js +0 -27
  330. package/react/hooks/use-intersection-observer.cjs +0 -14
  331. package/react/hooks/use-intersection-observer.d.cts +0 -2
  332. package/react/hooks/use-intersection-observer.d.cts.map +0 -1
  333. package/react/hooks/use-intersection-observer.js +0 -10
  334. package/react/hooks/use-last-defined-value.cjs +0 -12
  335. package/react/hooks/use-last-defined-value.d.cts +0 -2
  336. package/react/hooks/use-last-defined-value.d.cts.map +0 -1
  337. package/react/hooks/use-last-defined-value.js +0 -8
  338. package/react/hooks/use-last-value-ref.cjs +0 -12
  339. package/react/hooks/use-last-value-ref.d.cts +0 -2
  340. package/react/hooks/use-last-value-ref.d.cts.map +0 -1
  341. package/react/hooks/use-last-value-ref.js +0 -8
  342. package/react/hooks/use-life-cycle.cjs +0 -14
  343. package/react/hooks/use-life-cycle.d.cts +0 -5
  344. package/react/hooks/use-life-cycle.d.cts.map +0 -1
  345. package/react/hooks/use-life-cycle.js +0 -10
  346. package/react/hooks/use-resize-observer.cjs +0 -15
  347. package/react/hooks/use-resize-observer.d.cts +0 -2
  348. package/react/hooks/use-resize-observer.d.cts.map +0 -1
  349. package/react/hooks/use-resize-observer.js +0 -11
  350. package/react/hooks/use-sync-ref.cjs +0 -10
  351. package/react/hooks/use-sync-ref.d.cts +0 -2
  352. package/react/hooks/use-sync-ref.d.cts.map +0 -1
  353. package/react/hooks/use-sync-ref.js +0 -6
  354. package/react/hooks/use-toggle.cjs +0 -10
  355. package/react/hooks/use-toggle.d.cts +0 -2
  356. package/react/hooks/use-toggle.d.cts.map +0 -1
  357. package/react/hooks/use-toggle.js +0 -6
  358. package/react/hooks/use-value.cjs +0 -12
  359. package/react/hooks/use-value.d.cts +0 -5
  360. package/react/hooks/use-value.d.cts.map +0 -1
  361. package/react/hooks/use-value.js +0 -8
  362. package/react/hooks/use-visibility-state.cjs +0 -18
  363. package/react/hooks/use-visibility-state.d.cts +0 -2
  364. package/react/hooks/use-visibility-state.d.cts.map +0 -1
  365. package/react/hooks/use-visibility-state.js +0 -14
  366. package/react/index.cjs +0 -17
  367. package/react/index.d.cts +0 -2
  368. package/react/index.d.cts.map +0 -1
  369. package/react/index.js +0 -1
  370. package/sound.cjs +0 -16
  371. package/sound.d.cts +0 -7
  372. package/sound.d.cts.map +0 -1
  373. package/storage.cjs +0 -48
  374. package/storage.d.cts +0 -39
  375. package/storage.d.cts.map +0 -1
  376. package/storage.js +0 -43
  377. package/text.cjs +0 -53
  378. package/text.d.cts +0 -15
  379. package/text.d.cts.map +0 -1
  380. package/type-guard/_exports.cjs +0 -129
  381. package/type-guard/_exports.d.cts +0 -86
  382. package/type-guard/_exports.d.cts.map +0 -1
  383. package/type-guard/_exports.js +0 -125
  384. package/type-guard/index.cjs +0 -40
  385. package/type-guard/index.d.cts +0 -3
  386. package/type-guard/index.d.cts.map +0 -1
  387. package/type-guard/index.js +0 -4
  388. package/utils/types.cjs +0 -2
  389. package/utils/types.d.cts +0 -395
  390. package/utils/types.d.cts.map +0 -1
  391. package/vibrate.cjs +0 -12
  392. package/vibrate.d.cts +0 -5
  393. package/vibrate.d.cts.map +0 -1
package/html.js CHANGED
@@ -1,182 +1,649 @@
1
- import DOMPurify from 'dompurify';
2
- import { blobToUrl } from "./media.js";
3
- /**
4
- * Вытаскивает RGB из любого цвета
5
- *
6
- * Не рекомендуется к использованию так как вызывает reflow
7
- */
8
- export const getComputedColor = (color) => {
9
- if (!color)
10
- return null;
11
- const d = document.createElement('div');
12
- d.style.color = color;
13
- document.body.append(d);
14
- const rgbcolor = globalThis.getComputedStyle(d).color;
15
- const match = /rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*\d+[.d+]*)*\)/g.exec(rgbcolor);
16
- d.remove();
17
- if (!match)
18
- return null;
19
- return `${match[1]}, ${match[2]}, ${match[3]}`;
20
- };
21
- export const downloadUsingAnchor = (urlOrBlob, fileName) => {
22
- const url = blobToUrl(urlOrBlob);
23
- const a = document.createElement('a');
24
- a.href = url;
25
- a.download = fileName ?? 'file';
26
- a.target = '_blank';
27
- document.body.append(a);
28
- a.click();
29
- a.remove();
30
- };
31
- /**
32
- * Surrounds string in an anchor tag
33
- */
34
- export function wrapTextToTagLink(link) {
35
- const descr = String(link).replace(/^(https?:\/{0,2})?(w{3}\.)?/, 'www.');
36
- if (!/^https?:\/{2}/.test(link))
37
- link = `http://${link}`;
38
- return `<a href=${link} target="_blank">${descr}</a>`;
1
+ import { blobToUrl as Bt } from "yummies/media";
2
+ /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
3
+ const {
4
+ entries: Tt,
5
+ setPrototypeOf: at,
6
+ isFrozen: Yt,
7
+ getPrototypeOf: Vt,
8
+ getOwnPropertyDescriptor: Xt
9
+ } = Object;
10
+ let {
11
+ freeze: S,
12
+ seal: y,
13
+ create: ht
14
+ } = Object, {
15
+ apply: Me,
16
+ construct: xe
17
+ } = typeof Reflect < "u" && Reflect;
18
+ S || (S = function(n) {
19
+ return n;
20
+ });
21
+ y || (y = function(n) {
22
+ return n;
23
+ });
24
+ Me || (Me = function(n, r, s) {
25
+ return n.apply(r, s);
26
+ });
27
+ xe || (xe = function(n, r) {
28
+ return new n(...r);
29
+ });
30
+ const le = b(Array.prototype.forEach), $t = b(Array.prototype.lastIndexOf), st = b(Array.prototype.pop), j = b(Array.prototype.push), jt = b(Array.prototype.splice), fe = b(String.prototype.toLowerCase), De = b(String.prototype.toString), lt = b(String.prototype.match), q = b(String.prototype.replace), qt = b(String.prototype.indexOf), Kt = b(String.prototype.trim), O = b(Object.prototype.hasOwnProperty), A = b(RegExp.prototype.test), K = Zt(TypeError);
31
+ function b(o) {
32
+ return function(n) {
33
+ n instanceof RegExp && (n.lastIndex = 0);
34
+ for (var r = arguments.length, s = new Array(r > 1 ? r - 1 : 0), m = 1; m < r; m++)
35
+ s[m - 1] = arguments[m];
36
+ return Me(o, n, s);
37
+ };
39
38
  }
40
- export const collectOffsetTop = (element) => {
41
- let offsetTop = 0;
42
- let node = element;
43
- while (node != null) {
44
- offsetTop += node.offsetTop;
45
- node = node.parentElement;
39
+ function Zt(o) {
40
+ return function() {
41
+ for (var n = arguments.length, r = new Array(n), s = 0; s < n; s++)
42
+ r[s] = arguments[s];
43
+ return xe(o, r);
44
+ };
45
+ }
46
+ function l(o, n) {
47
+ let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : fe;
48
+ at && at(o, null);
49
+ let s = n.length;
50
+ for (; s--; ) {
51
+ let m = n[s];
52
+ if (typeof m == "string") {
53
+ const L = r(m);
54
+ L !== m && (Yt(n) || (n[s] = L), m = L);
46
55
  }
47
- return offsetTop;
48
- };
49
- export const skipEvent = (e) => {
50
- e.preventDefault();
51
- e.stopPropagation();
52
- return false;
53
- };
54
- export const globalScrollIntoViewForY = (node) => {
55
- const scrollContainer = document.body;
56
- const pageHeight = window.innerHeight;
57
- const nodeBounding = node.getBoundingClientRect();
58
- const scrollPagesCount = scrollContainer.scrollHeight / pageHeight;
59
- const scrollPageNumber = Math.min(Math.max(nodeBounding.top / pageHeight, 1), scrollPagesCount);
60
- window.scroll({
61
- top: scrollPageNumber * pageHeight,
62
- behavior: 'smooth',
56
+ o[m] = !0;
57
+ }
58
+ return o;
59
+ }
60
+ function Jt(o) {
61
+ for (let n = 0; n < o.length; n++)
62
+ O(o, n) || (o[n] = null);
63
+ return o;
64
+ }
65
+ function C(o) {
66
+ const n = ht(null);
67
+ for (const [r, s] of Tt(o))
68
+ O(o, r) && (Array.isArray(s) ? n[r] = Jt(s) : s && typeof s == "object" && s.constructor === Object ? n[r] = C(s) : n[r] = s);
69
+ return n;
70
+ }
71
+ function Z(o, n) {
72
+ for (; o !== null; ) {
73
+ const s = Xt(o, n);
74
+ if (s) {
75
+ if (s.get)
76
+ return b(s.get);
77
+ if (typeof s.value == "function")
78
+ return b(s.value);
79
+ }
80
+ o = Vt(o);
81
+ }
82
+ function r() {
83
+ return null;
84
+ }
85
+ return r;
86
+ }
87
+ const ct = S(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Ne = S(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ie = S(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Qt = S(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), we = S(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), en = S(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ft = S(["#text"]), ut = S(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Ce = S(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), mt = S(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), ce = S(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), tn = y(/\{\{[\w\W]*|[\w\W]*\}\}/gm), nn = y(/<%[\w\W]*|[\w\W]*%>/gm), on = y(/\$\{[\w\W]*/gm), rn = y(/^data-[\-\w.\u00B7-\uFFFF]+$/), an = y(/^aria-[\-\w]+$/), gt = y(
88
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
89
+ // eslint-disable-line no-useless-escape
90
+ ), sn = y(/^(?:\w+script|data):/i), ln = y(
91
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
92
+ // eslint-disable-line no-control-regex
93
+ ), Et = y(/^html$/i), cn = y(/^[a-z][.\w]*(-[.\w]+)+$/i);
94
+ var pt = /* @__PURE__ */ Object.freeze({
95
+ __proto__: null,
96
+ ARIA_ATTR: an,
97
+ ATTR_WHITESPACE: ln,
98
+ CUSTOM_ELEMENT: cn,
99
+ DATA_ATTR: rn,
100
+ DOCTYPE_NAME: Et,
101
+ ERB_EXPR: nn,
102
+ IS_ALLOWED_URI: gt,
103
+ IS_SCRIPT_OR_DATA: sn,
104
+ MUSTACHE_EXPR: tn,
105
+ TMPLIT_EXPR: on
106
+ });
107
+ const J = {
108
+ element: 1,
109
+ text: 3,
110
+ // Deprecated
111
+ progressingInstruction: 7,
112
+ comment: 8,
113
+ document: 9
114
+ }, fn = function() {
115
+ return typeof window > "u" ? null : window;
116
+ }, un = function(n, r) {
117
+ if (typeof n != "object" || typeof n.createPolicy != "function")
118
+ return null;
119
+ let s = null;
120
+ const m = "data-tt-policy-suffix";
121
+ r && r.hasAttribute(m) && (s = r.getAttribute(m));
122
+ const L = "dompurify" + (s ? "#" + s : "");
123
+ try {
124
+ return n.createPolicy(L, {
125
+ createHTML(x) {
126
+ return x;
127
+ },
128
+ createScriptURL(x) {
129
+ return x;
130
+ }
63
131
  });
132
+ } catch {
133
+ return console.warn("TrustedTypes policy " + L + " could not be created."), null;
134
+ }
135
+ }, dt = function() {
136
+ return {
137
+ afterSanitizeAttributes: [],
138
+ afterSanitizeElements: [],
139
+ afterSanitizeShadowDOM: [],
140
+ beforeSanitizeAttributes: [],
141
+ beforeSanitizeElements: [],
142
+ beforeSanitizeShadowDOM: [],
143
+ uponSanitizeAttribute: [],
144
+ uponSanitizeElement: [],
145
+ uponSanitizeShadowNode: []
146
+ };
64
147
  };
65
- const sanitizeDefaults = {
66
- ALLOWED_TAGS: [
67
- 'a',
68
- 'article',
69
- 'b',
70
- 'blockquote',
71
- 'br',
72
- 'caption',
73
- 'code',
74
- 'del',
75
- 'details',
76
- 'div',
77
- 'em',
78
- 'h1',
79
- 'h2',
80
- 'h3',
81
- 'h4',
82
- 'h5',
83
- 'h6',
84
- 'hr',
85
- 'i',
86
- 'img',
87
- 'ins',
88
- 'kbd',
89
- 'li',
90
- 'main',
91
- 'ol',
92
- 'p',
93
- 'pre',
94
- 'section',
95
- 'span',
96
- 'strong',
97
- 'sub',
98
- 'summary',
99
- 'sup',
100
- 'table',
101
- 'tbody',
102
- 'td',
103
- 'th',
104
- 'thead',
105
- 'tr',
106
- 'u',
107
- 'ul',
108
- ],
109
- ALLOWED_ATTR: ['href', 'target', 'name', 'src', 'class'],
110
- };
111
- export const sanitizeHtml = (html, config) => {
112
- return DOMPurify.sanitize(html || '', {
113
- ...sanitizeDefaults,
114
- ...config,
148
+ function _t() {
149
+ let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fn();
150
+ const n = (a) => _t(a);
151
+ if (n.version = "3.2.6", n.removed = [], !o || !o.document || o.document.nodeType !== J.document || !o.Element)
152
+ return n.isSupported = !1, n;
153
+ let {
154
+ document: r
155
+ } = o;
156
+ const s = r, m = s.currentScript, {
157
+ DocumentFragment: L,
158
+ HTMLTemplateElement: x,
159
+ Node: ue,
160
+ Element: Pe,
161
+ NodeFilter: W,
162
+ NamedNodeMap: At = o.NamedNodeMap || o.MozNamedAttrMap,
163
+ HTMLFormElement: St,
164
+ DOMParser: bt,
165
+ trustedTypes: Q
166
+ } = o, G = Pe.prototype, Rt = Z(G, "cloneNode"), yt = Z(G, "remove"), Lt = Z(G, "nextSibling"), Ot = Z(G, "childNodes"), ee = Z(G, "parentNode");
167
+ if (typeof x == "function") {
168
+ const a = r.createElement("template");
169
+ a.content && a.content.ownerDocument && (r = a.content.ownerDocument);
170
+ }
171
+ let E, B = "";
172
+ const {
173
+ implementation: me,
174
+ createNodeIterator: Dt,
175
+ createDocumentFragment: Nt,
176
+ getElementsByTagName: It
177
+ } = r, {
178
+ importNode: wt
179
+ } = s;
180
+ let _ = dt();
181
+ n.isSupported = typeof Tt == "function" && typeof ee == "function" && me && me.createHTMLDocument !== void 0;
182
+ const {
183
+ MUSTACHE_EXPR: pe,
184
+ ERB_EXPR: de,
185
+ TMPLIT_EXPR: Te,
186
+ DATA_ATTR: Ct,
187
+ ARIA_ATTR: Mt,
188
+ IS_SCRIPT_OR_DATA: xt,
189
+ ATTR_WHITESPACE: ve,
190
+ CUSTOM_ELEMENT: Pt
191
+ } = pt;
192
+ let {
193
+ IS_ALLOWED_URI: ke
194
+ } = pt, p = null;
195
+ const Ue = l({}, [...ct, ...Ne, ...Ie, ...we, ...ft]);
196
+ let T = null;
197
+ const Fe = l({}, [...ut, ...Ce, ...mt, ...ce]);
198
+ let f = Object.seal(ht(null, {
199
+ tagNameCheck: {
200
+ writable: !0,
201
+ configurable: !1,
202
+ enumerable: !0,
203
+ value: null
204
+ },
205
+ attributeNameCheck: {
206
+ writable: !0,
207
+ configurable: !1,
208
+ enumerable: !0,
209
+ value: null
210
+ },
211
+ allowCustomizedBuiltInElements: {
212
+ writable: !0,
213
+ configurable: !1,
214
+ enumerable: !0,
215
+ value: !1
216
+ }
217
+ })), Y = null, he = null, He = !0, ge = !0, ze = !1, We = !0, P = !1, te = !0, M = !1, Ee = !1, _e = !1, v = !1, ne = !1, oe = !1, Ge = !0, Be = !1;
218
+ const vt = "user-content-";
219
+ let Ae = !0, V = !1, k = {}, U = null;
220
+ const Ye = l({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
221
+ let Ve = null;
222
+ const Xe = l({}, ["audio", "video", "img", "source", "image", "track"]);
223
+ let Se = null;
224
+ const $e = l({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ie = "http://www.w3.org/1998/Math/MathML", re = "http://www.w3.org/2000/svg", N = "http://www.w3.org/1999/xhtml";
225
+ let F = N, be = !1, Re = null;
226
+ const kt = l({}, [ie, re, N], De);
227
+ let ae = l({}, ["mi", "mo", "mn", "ms", "mtext"]), se = l({}, ["annotation-xml"]);
228
+ const Ut = l({}, ["title", "style", "font", "a", "script"]);
229
+ let X = null;
230
+ const Ft = ["application/xhtml+xml", "text/html"], Ht = "text/html";
231
+ let d = null, H = null;
232
+ const zt = r.createElement("form"), je = function(e) {
233
+ return e instanceof RegExp || e instanceof Function;
234
+ }, ye = function() {
235
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
236
+ if (!(H && H === e)) {
237
+ if ((!e || typeof e != "object") && (e = {}), e = C(e), X = // eslint-disable-next-line unicorn/prefer-includes
238
+ Ft.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Ht : e.PARSER_MEDIA_TYPE, d = X === "application/xhtml+xml" ? De : fe, p = O(e, "ALLOWED_TAGS") ? l({}, e.ALLOWED_TAGS, d) : Ue, T = O(e, "ALLOWED_ATTR") ? l({}, e.ALLOWED_ATTR, d) : Fe, Re = O(e, "ALLOWED_NAMESPACES") ? l({}, e.ALLOWED_NAMESPACES, De) : kt, Se = O(e, "ADD_URI_SAFE_ATTR") ? l(C($e), e.ADD_URI_SAFE_ATTR, d) : $e, Ve = O(e, "ADD_DATA_URI_TAGS") ? l(C(Xe), e.ADD_DATA_URI_TAGS, d) : Xe, U = O(e, "FORBID_CONTENTS") ? l({}, e.FORBID_CONTENTS, d) : Ye, Y = O(e, "FORBID_TAGS") ? l({}, e.FORBID_TAGS, d) : C({}), he = O(e, "FORBID_ATTR") ? l({}, e.FORBID_ATTR, d) : C({}), k = O(e, "USE_PROFILES") ? e.USE_PROFILES : !1, He = e.ALLOW_ARIA_ATTR !== !1, ge = e.ALLOW_DATA_ATTR !== !1, ze = e.ALLOW_UNKNOWN_PROTOCOLS || !1, We = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, P = e.SAFE_FOR_TEMPLATES || !1, te = e.SAFE_FOR_XML !== !1, M = e.WHOLE_DOCUMENT || !1, v = e.RETURN_DOM || !1, ne = e.RETURN_DOM_FRAGMENT || !1, oe = e.RETURN_TRUSTED_TYPE || !1, _e = e.FORCE_BODY || !1, Ge = e.SANITIZE_DOM !== !1, Be = e.SANITIZE_NAMED_PROPS || !1, Ae = e.KEEP_CONTENT !== !1, V = e.IN_PLACE || !1, ke = e.ALLOWED_URI_REGEXP || gt, F = e.NAMESPACE || N, ae = e.MATHML_TEXT_INTEGRATION_POINTS || ae, se = e.HTML_INTEGRATION_POINTS || se, f = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && je(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (f.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && je(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (f.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), P && (ge = !1), ne && (v = !0), k && (p = l({}, ft), T = [], k.html === !0 && (l(p, ct), l(T, ut)), k.svg === !0 && (l(p, Ne), l(T, Ce), l(T, ce)), k.svgFilters === !0 && (l(p, Ie), l(T, Ce), l(T, ce)), k.mathMl === !0 && (l(p, we), l(T, mt), l(T, ce))), e.ADD_TAGS && (p === Ue && (p = C(p)), l(p, e.ADD_TAGS, d)), e.ADD_ATTR && (T === Fe && (T = C(T)), l(T, e.ADD_ATTR, d)), e.ADD_URI_SAFE_ATTR && l(Se, e.ADD_URI_SAFE_ATTR, d), e.FORBID_CONTENTS && (U === Ye && (U = C(U)), l(U, e.FORBID_CONTENTS, d)), Ae && (p["#text"] = !0), M && l(p, ["html", "head", "body"]), p.table && (l(p, ["tbody"]), delete Y.tbody), e.TRUSTED_TYPES_POLICY) {
239
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
240
+ throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
241
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
242
+ throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
243
+ E = e.TRUSTED_TYPES_POLICY, B = E.createHTML("");
244
+ } else
245
+ E === void 0 && (E = un(Q, m)), E !== null && typeof B == "string" && (B = E.createHTML(""));
246
+ S && S(e), H = e;
247
+ }
248
+ }, qe = l({}, [...Ne, ...Ie, ...Qt]), Ke = l({}, [...we, ...en]), Wt = function(e) {
249
+ let t = ee(e);
250
+ (!t || !t.tagName) && (t = {
251
+ namespaceURI: F,
252
+ tagName: "template"
115
253
  });
116
- };
117
- export const checkElementHasParent = (element, parent) => {
118
- let node = element;
119
- if (!parent)
120
- return false;
121
- while (node != null) {
122
- if (node === parent) {
123
- return true;
254
+ const i = fe(e.tagName), c = fe(t.tagName);
255
+ return Re[e.namespaceURI] ? e.namespaceURI === re ? t.namespaceURI === N ? i === "svg" : t.namespaceURI === ie ? i === "svg" && (c === "annotation-xml" || ae[c]) : !!qe[i] : e.namespaceURI === ie ? t.namespaceURI === N ? i === "math" : t.namespaceURI === re ? i === "math" && se[c] : !!Ke[i] : e.namespaceURI === N ? t.namespaceURI === re && !se[c] || t.namespaceURI === ie && !ae[c] ? !1 : !Ke[i] && (Ut[i] || !qe[i]) : !!(X === "application/xhtml+xml" && Re[e.namespaceURI]) : !1;
256
+ }, D = function(e) {
257
+ j(n.removed, {
258
+ element: e
259
+ });
260
+ try {
261
+ ee(e).removeChild(e);
262
+ } catch {
263
+ yt(e);
264
+ }
265
+ }, z = function(e, t) {
266
+ try {
267
+ j(n.removed, {
268
+ attribute: t.getAttributeNode(e),
269
+ from: t
270
+ });
271
+ } catch {
272
+ j(n.removed, {
273
+ attribute: null,
274
+ from: t
275
+ });
276
+ }
277
+ if (t.removeAttribute(e), e === "is")
278
+ if (v || ne)
279
+ try {
280
+ D(t);
281
+ } catch {
124
282
  }
125
- else {
126
- node = node.parentElement;
283
+ else
284
+ try {
285
+ t.setAttribute(e, "");
286
+ } catch {
127
287
  }
288
+ }, Ze = function(e) {
289
+ let t = null, i = null;
290
+ if (_e)
291
+ e = "<remove></remove>" + e;
292
+ else {
293
+ const u = lt(e, /^[\r\n\t ]+/);
294
+ i = u && u[0];
128
295
  }
129
- return false;
130
- };
131
- /**
132
- * Executes a function within a view transition if supported by the browser.
133
- *
134
- * @param {VoidFunction} fn - The function to be executed.
135
- * @returns {ViewTransition} - The result of the executed function.
136
- *
137
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition | MDN: Document.startViewTransition}
138
- */
139
- export const startViewTransitionSafety = (fn, params) => {
140
- if (document.startViewTransition && !params?.disabled) {
141
- return document.startViewTransition(fn);
296
+ X === "application/xhtml+xml" && F === N && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
297
+ const c = E ? E.createHTML(e) : e;
298
+ if (F === N)
299
+ try {
300
+ t = new bt().parseFromString(c, X);
301
+ } catch {
302
+ }
303
+ if (!t || !t.documentElement) {
304
+ t = me.createDocument(F, "template", null);
305
+ try {
306
+ t.documentElement.innerHTML = be ? B : c;
307
+ } catch {
308
+ }
309
+ }
310
+ const h = t.body || t.documentElement;
311
+ return e && i && h.insertBefore(r.createTextNode(i), h.childNodes[0] || null), F === N ? It.call(t, M ? "html" : "body")[0] : M ? t.documentElement : h;
312
+ }, Je = function(e) {
313
+ return Dt.call(
314
+ e.ownerDocument || e,
315
+ e,
316
+ // eslint-disable-next-line no-bitwise
317
+ W.SHOW_ELEMENT | W.SHOW_COMMENT | W.SHOW_TEXT | W.SHOW_PROCESSING_INSTRUCTION | W.SHOW_CDATA_SECTION,
318
+ null
319
+ );
320
+ }, Le = function(e) {
321
+ return e instanceof St && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof At) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
322
+ }, Qe = function(e) {
323
+ return typeof ue == "function" && e instanceof ue;
324
+ };
325
+ function I(a, e, t) {
326
+ le(a, (i) => {
327
+ i.call(n, e, t, H);
328
+ });
329
+ }
330
+ const et = function(e) {
331
+ let t = null;
332
+ if (I(_.beforeSanitizeElements, e, null), Le(e))
333
+ return D(e), !0;
334
+ const i = d(e.nodeName);
335
+ if (I(_.uponSanitizeElement, e, {
336
+ tagName: i,
337
+ allowedTags: p
338
+ }), te && e.hasChildNodes() && !Qe(e.firstElementChild) && A(/<[/\w!]/g, e.innerHTML) && A(/<[/\w!]/g, e.textContent) || e.nodeType === J.progressingInstruction || te && e.nodeType === J.comment && A(/<[/\w]/g, e.data))
339
+ return D(e), !0;
340
+ if (!p[i] || Y[i]) {
341
+ if (!Y[i] && nt(i) && (f.tagNameCheck instanceof RegExp && A(f.tagNameCheck, i) || f.tagNameCheck instanceof Function && f.tagNameCheck(i)))
342
+ return !1;
343
+ if (Ae && !U[i]) {
344
+ const c = ee(e) || e.parentNode, h = Ot(e) || e.childNodes;
345
+ if (h && c) {
346
+ const u = h.length;
347
+ for (let R = u - 1; R >= 0; --R) {
348
+ const w = Rt(h[R], !0);
349
+ w.__removalCount = (e.__removalCount || 0) + 1, c.insertBefore(w, Lt(e));
350
+ }
351
+ }
352
+ }
353
+ return D(e), !0;
354
+ }
355
+ return e instanceof Pe && !Wt(e) || (i === "noscript" || i === "noembed" || i === "noframes") && A(/<\/no(script|embed|frames)/i, e.innerHTML) ? (D(e), !0) : (P && e.nodeType === J.text && (t = e.textContent, le([pe, de, Te], (c) => {
356
+ t = q(t, c, " ");
357
+ }), e.textContent !== t && (j(n.removed, {
358
+ element: e.cloneNode()
359
+ }), e.textContent = t)), I(_.afterSanitizeElements, e, null), !1);
360
+ }, tt = function(e, t, i) {
361
+ if (Ge && (t === "id" || t === "name") && (i in r || i in zt))
362
+ return !1;
363
+ if (!(ge && !he[t] && A(Ct, t))) {
364
+ if (!(He && A(Mt, t))) {
365
+ if (!T[t] || he[t]) {
366
+ if (
367
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
368
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
369
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
370
+ !(nt(e) && (f.tagNameCheck instanceof RegExp && A(f.tagNameCheck, e) || f.tagNameCheck instanceof Function && f.tagNameCheck(e)) && (f.attributeNameCheck instanceof RegExp && A(f.attributeNameCheck, t) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
371
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
372
+ t === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && A(f.tagNameCheck, i) || f.tagNameCheck instanceof Function && f.tagNameCheck(i)))
373
+ ) return !1;
374
+ } else if (!Se[t]) {
375
+ if (!A(ke, q(i, ve, ""))) {
376
+ if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && qt(i, "data:") === 0 && Ve[e])) {
377
+ if (!(ze && !A(xt, q(i, ve, "")))) {
378
+ if (i)
379
+ return !1;
380
+ }
381
+ }
382
+ }
383
+ }
384
+ }
385
+ }
386
+ return !0;
387
+ }, nt = function(e) {
388
+ return e !== "annotation-xml" && lt(e, Pt);
389
+ }, ot = function(e) {
390
+ I(_.beforeSanitizeAttributes, e, null);
391
+ const {
392
+ attributes: t
393
+ } = e;
394
+ if (!t || Le(e))
395
+ return;
396
+ const i = {
397
+ attrName: "",
398
+ attrValue: "",
399
+ keepAttr: !0,
400
+ allowedAttributes: T,
401
+ forceKeepAttr: void 0
402
+ };
403
+ let c = t.length;
404
+ for (; c--; ) {
405
+ const h = t[c], {
406
+ name: u,
407
+ namespaceURI: R,
408
+ value: w
409
+ } = h, $ = d(u), Oe = w;
410
+ let g = u === "value" ? Oe : Kt(Oe);
411
+ if (i.attrName = $, i.attrValue = g, i.keepAttr = !0, i.forceKeepAttr = void 0, I(_.uponSanitizeAttribute, e, i), g = i.attrValue, Be && ($ === "id" || $ === "name") && (z(u, e), g = vt + g), te && A(/((--!?|])>)|<\/(style|title)/i, g)) {
412
+ z(u, e);
413
+ continue;
414
+ }
415
+ if (i.forceKeepAttr)
416
+ continue;
417
+ if (!i.keepAttr) {
418
+ z(u, e);
419
+ continue;
420
+ }
421
+ if (!We && A(/\/>/i, g)) {
422
+ z(u, e);
423
+ continue;
424
+ }
425
+ P && le([pe, de, Te], (rt) => {
426
+ g = q(g, rt, " ");
427
+ });
428
+ const it = d(e.nodeName);
429
+ if (!tt(it, $, g)) {
430
+ z(u, e);
431
+ continue;
432
+ }
433
+ if (E && typeof Q == "object" && typeof Q.getAttributeType == "function" && !R)
434
+ switch (Q.getAttributeType(it, $)) {
435
+ case "TrustedHTML": {
436
+ g = E.createHTML(g);
437
+ break;
438
+ }
439
+ case "TrustedScriptURL": {
440
+ g = E.createScriptURL(g);
441
+ break;
442
+ }
443
+ }
444
+ if (g !== Oe)
445
+ try {
446
+ R ? e.setAttributeNS(R, u, g) : e.setAttribute(u, g), Le(e) ? D(e) : st(n.removed);
447
+ } catch {
448
+ z(u, e);
449
+ }
450
+ }
451
+ I(_.afterSanitizeAttributes, e, null);
452
+ }, Gt = function a(e) {
453
+ let t = null;
454
+ const i = Je(e);
455
+ for (I(_.beforeSanitizeShadowDOM, e, null); t = i.nextNode(); )
456
+ I(_.uponSanitizeShadowNode, t, null), et(t), ot(t), t.content instanceof L && a(t.content);
457
+ I(_.afterSanitizeShadowDOM, e, null);
458
+ };
459
+ return n.sanitize = function(a) {
460
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, i = null, c = null, h = null;
461
+ if (be = !a, be && (a = "<!-->"), typeof a != "string" && !Qe(a))
462
+ if (typeof a.toString == "function") {
463
+ if (a = a.toString(), typeof a != "string")
464
+ throw K("dirty is not a string, aborting");
465
+ } else
466
+ throw K("toString is not a function");
467
+ if (!n.isSupported)
468
+ return a;
469
+ if (Ee || ye(e), n.removed = [], typeof a == "string" && (V = !1), V) {
470
+ if (a.nodeName) {
471
+ const w = d(a.nodeName);
472
+ if (!p[w] || Y[w])
473
+ throw K("root node is forbidden and cannot be sanitized in-place");
474
+ }
475
+ } else if (a instanceof ue)
476
+ t = Ze("<!---->"), i = t.ownerDocument.importNode(a, !0), i.nodeType === J.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? t = i : t.appendChild(i);
477
+ else {
478
+ if (!v && !P && !M && // eslint-disable-next-line unicorn/prefer-includes
479
+ a.indexOf("<") === -1)
480
+ return E && oe ? E.createHTML(a) : a;
481
+ if (t = Ze(a), !t)
482
+ return v ? null : oe ? B : "";
483
+ }
484
+ t && _e && D(t.firstChild);
485
+ const u = Je(V ? a : t);
486
+ for (; c = u.nextNode(); )
487
+ et(c), ot(c), c.content instanceof L && Gt(c.content);
488
+ if (V)
489
+ return a;
490
+ if (v) {
491
+ if (ne)
492
+ for (h = Nt.call(t.ownerDocument); t.firstChild; )
493
+ h.appendChild(t.firstChild);
494
+ else
495
+ h = t;
496
+ return (T.shadowroot || T.shadowrootmode) && (h = wt.call(s, h, !0)), h;
142
497
  }
143
- fn();
498
+ let R = M ? t.outerHTML : t.innerHTML;
499
+ return M && p["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && A(Et, t.ownerDocument.doctype.name) && (R = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
500
+ ` + R), P && le([pe, de, Te], (w) => {
501
+ R = q(R, w, " ");
502
+ }), E && oe ? E.createHTML(R) : R;
503
+ }, n.setConfig = function() {
504
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
505
+ ye(a), Ee = !0;
506
+ }, n.clearConfig = function() {
507
+ H = null, Ee = !1;
508
+ }, n.isValidAttribute = function(a, e, t) {
509
+ H || ye({});
510
+ const i = d(a), c = d(e);
511
+ return tt(i, c, t);
512
+ }, n.addHook = function(a, e) {
513
+ typeof e == "function" && j(_[a], e);
514
+ }, n.removeHook = function(a, e) {
515
+ if (e !== void 0) {
516
+ const t = $t(_[a], e);
517
+ return t === -1 ? void 0 : jt(_[a], t, 1)[0];
518
+ }
519
+ return st(_[a]);
520
+ }, n.removeHooks = function(a) {
521
+ _[a] = [];
522
+ }, n.removeAllHooks = function() {
523
+ _ = dt();
524
+ }, n;
525
+ }
526
+ var mn = _t();
527
+ const Tn = (o) => {
528
+ if (!o) return null;
529
+ const n = document.createElement("div");
530
+ n.style.color = o, document.body.append(n);
531
+ const r = globalThis.getComputedStyle(n).color, s = /rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*\d+[.d+]*)*\)/g.exec(r);
532
+ return n.remove(), s ? `${s[1]}, ${s[2]}, ${s[3]}` : null;
533
+ }, hn = (o, n) => {
534
+ const r = Bt(o), s = document.createElement("a");
535
+ s.href = r, s.download = n ?? "file", s.target = "_blank", document.body.append(s), s.click(), s.remove();
144
536
  };
145
- /**
146
- * Вычисляет размер скроллбара
147
- */
148
- export const calcScrollbarWidth = () => {
149
- const outer = document.createElement('div');
150
- outer.style.visibility = 'hidden';
151
- outer.style.width = '100px';
152
- outer.style.overflow = 'scroll';
153
- document.body.append(outer);
154
- const inner = document.createElement('div');
155
- inner.style.width = '100%';
156
- outer.append(inner);
157
- const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
158
- outer.parentNode?.removeChild(outer);
159
- return scrollbarWidth;
537
+ function gn(o) {
538
+ const n = String(o).replace(/^(https?:\/{0,2})?(w{3}\.)?/, "www.");
539
+ return /^https?:\/{2}/.test(o) || (o = `http://${o}`), `<a href=${o} target="_blank">${n}</a>`;
540
+ }
541
+ const En = (o) => {
542
+ let n = 0, r = o;
543
+ for (; r != null; )
544
+ n += r.offsetTop, r = r.parentElement;
545
+ return n;
546
+ }, _n = (o) => (o.preventDefault(), o.stopPropagation(), !1), An = (o) => {
547
+ const n = document.body, r = window.innerHeight, s = o.getBoundingClientRect(), m = n.scrollHeight / r, L = Math.min(
548
+ Math.max(s.top / r, 1),
549
+ m
550
+ );
551
+ window.scroll({
552
+ top: L * r,
553
+ behavior: "smooth"
554
+ });
555
+ }, pn = {
556
+ ALLOWED_TAGS: [
557
+ "a",
558
+ "article",
559
+ "b",
560
+ "blockquote",
561
+ "br",
562
+ "caption",
563
+ "code",
564
+ "del",
565
+ "details",
566
+ "div",
567
+ "em",
568
+ "h1",
569
+ "h2",
570
+ "h3",
571
+ "h4",
572
+ "h5",
573
+ "h6",
574
+ "hr",
575
+ "i",
576
+ "img",
577
+ "ins",
578
+ "kbd",
579
+ "li",
580
+ "main",
581
+ "ol",
582
+ "p",
583
+ "pre",
584
+ "section",
585
+ "span",
586
+ "strong",
587
+ "sub",
588
+ "summary",
589
+ "sup",
590
+ "table",
591
+ "tbody",
592
+ "td",
593
+ "th",
594
+ "thead",
595
+ "tr",
596
+ "u",
597
+ "ul"
598
+ ],
599
+ ALLOWED_ATTR: ["href", "target", "name", "src", "class"]
600
+ }, Sn = (o, n) => mn.sanitize(o || "", {
601
+ ...pn,
602
+ ...n
603
+ }), bn = (o, n) => {
604
+ let r = o;
605
+ if (!n) return !1;
606
+ for (; r != null; ) {
607
+ if (r === n)
608
+ return !0;
609
+ r = r.parentElement;
610
+ }
611
+ return !1;
612
+ }, Rn = (o, n) => {
613
+ if (document.startViewTransition && !n?.disabled)
614
+ return document.startViewTransition(o);
615
+ o();
616
+ }, yn = () => {
617
+ const o = document.createElement("div");
618
+ o.style.visibility = "hidden", o.style.width = "100px", o.style.overflow = "scroll", document.body.append(o);
619
+ const n = document.createElement("div");
620
+ n.style.width = "100%", o.append(n);
621
+ const r = o.offsetWidth - n.offsetWidth;
622
+ return o.parentNode?.removeChild(o), r;
160
623
  };
161
- /**
162
- * Calculates the inner height of an HTML element, accounting for padding.
163
- */
164
- export function getElementInnerHeight(element) {
165
- const { clientHeight } = element;
166
- const { paddingTop, paddingBottom } = getComputedStyle(element);
167
- return (clientHeight -
168
- Number.parseFloat(paddingTop) -
169
- Number.parseFloat(paddingBottom));
624
+ function Ln(o) {
625
+ const { clientHeight: n } = o, { paddingTop: r, paddingBottom: s } = getComputedStyle(o);
626
+ return n - Number.parseFloat(r) - Number.parseFloat(s);
170
627
  }
171
- /**
172
- * Calculates the inner width of an HTML element, accounting for padding.
173
- */
174
- export function getElementInnerWidth(el) {
175
- const { clientWidth } = el;
176
- const { paddingLeft, paddingRight } = getComputedStyle(el);
177
- return (clientWidth -
178
- Number.parseFloat(paddingLeft) -
179
- Number.parseFloat(paddingRight));
628
+ function On(o) {
629
+ const { clientWidth: n } = o, { paddingLeft: r, paddingRight: s } = getComputedStyle(o);
630
+ return n - Number.parseFloat(r) - Number.parseFloat(s);
180
631
  }
181
- export const isPrefersDarkTheme = () => !!globalThis.matchMedia?.('(prefers-color-scheme: dark)')?.matches;
182
- export const isPrefersLightTheme = () => !!globalThis.matchMedia?.('(prefers-color-scheme: light)')?.matches;
632
+ const Dn = () => !!globalThis.matchMedia?.("(prefers-color-scheme: dark)")?.matches, Nn = () => !!globalThis.matchMedia?.("(prefers-color-scheme: light)")?.matches;
633
+ export {
634
+ yn as calcScrollbarWidth,
635
+ bn as checkElementHasParent,
636
+ En as collectOffsetTop,
637
+ hn as downloadUsingAnchor,
638
+ Tn as getComputedColor,
639
+ Ln as getElementInnerHeight,
640
+ On as getElementInnerWidth,
641
+ An as globalScrollIntoViewForY,
642
+ Dn as isPrefersDarkTheme,
643
+ Nn as isPrefersLightTheme,
644
+ Sn as sanitizeHtml,
645
+ _n as skipEvent,
646
+ Rn as startViewTransitionSafety,
647
+ gn as wrapTextToTagLink
648
+ };
649
+ //# sourceMappingURL=html.js.map