pulpweaver4 0.0.91 → 0.0.185

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 (502) hide show
  1. package/dist/ast/djot.js +23 -0
  2. package/dist/ast/djot.js.map +1 -1
  3. package/dist/ast/index.d.ts +1 -0
  4. package/dist/ast/index.js +1 -0
  5. package/dist/ast/index.js.map +1 -1
  6. package/dist/ast/nodes.d.ts +59 -5
  7. package/dist/ast/nodes.js.map +1 -1
  8. package/dist/ast/table.d.ts +27 -0
  9. package/dist/ast/table.js +32 -0
  10. package/dist/ast/table.js.map +1 -0
  11. package/dist/browser.js +2420 -0
  12. package/dist/citations/index.d.ts +1 -1
  13. package/dist/citations/index.js +1 -1
  14. package/dist/citations/index.js.map +1 -1
  15. package/dist/citations/project.d.ts +12 -2
  16. package/dist/citations/project.js +21 -7
  17. package/dist/citations/project.js.map +1 -1
  18. package/dist/colour/images.d.ts +11 -2
  19. package/dist/colour/images.js +53 -3
  20. package/dist/colour/images.js.map +1 -1
  21. package/dist/colour/ink-limit.d.ts +2 -2
  22. package/dist/colour/ink-limit.js +6 -0
  23. package/dist/colour/ink-limit.js.map +1 -1
  24. package/dist/colour/previews.d.ts +8 -4
  25. package/dist/colour/previews.js +11 -8
  26. package/dist/colour/previews.js.map +1 -1
  27. package/dist/config/config.d.ts +91 -3
  28. package/dist/config/config.js +200 -3
  29. package/dist/config/config.js.map +1 -1
  30. package/dist/config/project-schema.d.ts +0 -8
  31. package/dist/config/project-schema.js +207 -12
  32. package/dist/config/project-schema.js.map +1 -1
  33. package/dist/config/schema.js +10 -0
  34. package/dist/config/schema.js.map +1 -1
  35. package/dist/config/secrets.d.ts +11 -0
  36. package/dist/config/secrets.js +19 -0
  37. package/dist/config/secrets.js.map +1 -0
  38. package/dist/csl/project.d.ts +19 -4
  39. package/dist/csl/project.js +23 -10
  40. package/dist/csl/project.js.map +1 -1
  41. package/dist/fonts/index.d.ts +1 -1
  42. package/dist/fonts/index.js +1 -1
  43. package/dist/fonts/index.js.map +1 -1
  44. package/dist/fonts/lint.d.ts +51 -0
  45. package/dist/fonts/lint.js +101 -16
  46. package/dist/fonts/lint.js.map +1 -1
  47. package/dist/fonts/walk.d.ts +13 -0
  48. package/dist/fonts/walk.js +50 -33
  49. package/dist/fonts/walk.js.map +1 -1
  50. package/dist/html/css.d.ts +4 -0
  51. package/dist/html/css.js +11 -3
  52. package/dist/html/css.js.map +1 -1
  53. package/dist/html/dom.d.ts +6 -1
  54. package/dist/html/dom.js +28 -6
  55. package/dist/html/dom.js.map +1 -1
  56. package/dist/html/generated.d.ts +17 -0
  57. package/dist/html/generated.js +21 -0
  58. package/dist/html/generated.js.map +1 -0
  59. package/dist/html/images.d.ts +18 -0
  60. package/dist/html/images.js +49 -2
  61. package/dist/html/images.js.map +1 -1
  62. package/dist/html/index.d.ts +1 -0
  63. package/dist/html/index.js +1 -0
  64. package/dist/html/index.js.map +1 -1
  65. package/dist/html/render.d.ts +5 -4
  66. package/dist/html/render.js +24 -6
  67. package/dist/html/render.js.map +1 -1
  68. package/dist/hyphenation/exceptions.d.ts +5 -0
  69. package/dist/hyphenation/exceptions.js +11 -0
  70. package/dist/hyphenation/exceptions.js.map +1 -1
  71. package/dist/hyphenation/index.d.ts +1 -1
  72. package/dist/hyphenation/index.js +1 -1
  73. package/dist/hyphenation/index.js.map +1 -1
  74. package/dist/import/convert.d.ts +21 -0
  75. package/dist/import/convert.js +65 -0
  76. package/dist/import/convert.js.map +1 -0
  77. package/dist/incremental/cache.d.ts +59 -0
  78. package/dist/incremental/cache.js +64 -0
  79. package/dist/incremental/cache.js.map +1 -0
  80. package/dist/incremental/index.d.ts +3 -0
  81. package/dist/incremental/index.js +4 -0
  82. package/dist/incremental/index.js.map +1 -0
  83. package/dist/incremental/keys.d.ts +27 -0
  84. package/dist/incremental/keys.js +89 -0
  85. package/dist/incremental/keys.js.map +1 -0
  86. package/dist/incremental/session.d.ts +180 -0
  87. package/dist/incremental/session.js +401 -0
  88. package/dist/incremental/session.js.map +1 -0
  89. package/dist/index.d.ts +6 -0
  90. package/dist/index.js +6 -0
  91. package/dist/index.js.map +1 -1
  92. package/dist/indexes/layout.d.ts +8 -2
  93. package/dist/indexes/layout.js +6 -4
  94. package/dist/indexes/layout.js.map +1 -1
  95. package/dist/layout/cache.d.ts +174 -0
  96. package/dist/layout/cache.js +150 -0
  97. package/dist/layout/cache.js.map +1 -0
  98. package/dist/layout/converge.d.ts +28 -0
  99. package/dist/layout/converge.js +102 -9
  100. package/dist/layout/converge.js.map +1 -1
  101. package/dist/layout/counters.d.ts +4 -0
  102. package/dist/layout/counters.js +15 -0
  103. package/dist/layout/counters.js.map +1 -1
  104. package/dist/layout/index.d.ts +5 -2
  105. package/dist/layout/index.js +3 -0
  106. package/dist/layout/index.js.map +1 -1
  107. package/dist/layout/lists.d.ts +52 -3
  108. package/dist/layout/lists.js +513 -46
  109. package/dist/layout/lists.js.map +1 -1
  110. package/dist/layout/lookahead.d.ts +151 -0
  111. package/dist/layout/lookahead.js +581 -0
  112. package/dist/layout/lookahead.js.map +1 -0
  113. package/dist/layout/margin-boxes.d.ts +11 -1
  114. package/dist/layout/margin-boxes.js +24 -1
  115. package/dist/layout/margin-boxes.js.map +1 -1
  116. package/dist/layout/page-rules.d.ts +6 -1
  117. package/dist/layout/page-rules.js +42 -1
  118. package/dist/layout/page-rules.js.map +1 -1
  119. package/dist/layout/page.js +4 -2
  120. package/dist/layout/page.js.map +1 -1
  121. package/dist/layout/pagebuilder.d.ts +248 -3
  122. package/dist/layout/pagebuilder.js +512 -19
  123. package/dist/layout/pagebuilder.js.map +1 -1
  124. package/dist/layout/pages.d.ts +108 -1
  125. package/dist/layout/pages.js +1362 -159
  126. package/dist/layout/pages.js.map +1 -1
  127. package/dist/layout/paragraph.d.ts +14 -0
  128. package/dist/layout/paragraph.js +304 -31
  129. package/dist/layout/paragraph.js.map +1 -1
  130. package/dist/layout/pre.js +4 -0
  131. package/dist/layout/pre.js.map +1 -1
  132. package/dist/layout/protrusion.d.ts +26 -0
  133. package/dist/layout/protrusion.js +39 -0
  134. package/dist/layout/protrusion.js.map +1 -0
  135. package/dist/layout/ranges.d.ts +2 -0
  136. package/dist/layout/ranges.js +22 -0
  137. package/dist/layout/ranges.js.map +1 -0
  138. package/dist/layout/region.d.ts +2 -1
  139. package/dist/layout/region.js +9 -5
  140. package/dist/layout/region.js.map +1 -1
  141. package/dist/layout/templates.d.ts +71 -0
  142. package/dist/layout/templates.js +290 -0
  143. package/dist/layout/templates.js.map +1 -0
  144. package/dist/layout/vlist.d.ts +3 -3
  145. package/dist/linebreak/items.d.ts +27 -2
  146. package/dist/linebreak/items.js +10 -3
  147. package/dist/linebreak/items.js.map +1 -1
  148. package/dist/linebreak/knuth-plass.d.ts +20 -0
  149. package/dist/linebreak/knuth-plass.js +68 -16
  150. package/dist/linebreak/knuth-plass.js.map +1 -1
  151. package/dist/lint/book.d.ts +13 -0
  152. package/dist/lint/book.js +52 -0
  153. package/dist/lint/book.js.map +1 -0
  154. package/dist/lint/config.d.ts +9 -0
  155. package/dist/lint/config.js +40 -6
  156. package/dist/lint/config.js.map +1 -1
  157. package/dist/lint/linter.js +1 -0
  158. package/dist/lint/linter.js.map +1 -1
  159. package/dist/lint/project.js +1 -1
  160. package/dist/lint/project.js.map +1 -1
  161. package/dist/lint/rules/layout.d.ts +3 -1
  162. package/dist/lint/rules/layout.js +8 -6
  163. package/dist/lint/rules/layout.js.map +1 -1
  164. package/dist/lint/rules/source.js +1 -1
  165. package/dist/lint/rules/source.js.map +1 -1
  166. package/dist/lint/testing.js +1 -0
  167. package/dist/lint/testing.js.map +1 -1
  168. package/dist/measure/bidi-data.d.ts +14 -0
  169. package/dist/measure/bidi-data.js +69 -0
  170. package/dist/measure/bidi-data.js.map +1 -0
  171. package/dist/measure/bidi.d.ts +70 -0
  172. package/dist/measure/bidi.js +225 -0
  173. package/dist/measure/bidi.js.map +1 -0
  174. package/dist/measure/css.d.ts +5 -0
  175. package/dist/measure/css.js +2 -0
  176. package/dist/measure/css.js.map +1 -1
  177. package/dist/measure/measurer.d.ts +36 -2
  178. package/dist/measure/measurer.js +220 -22
  179. package/dist/measure/measurer.js.map +1 -1
  180. package/dist/measure/model.d.ts +20 -2
  181. package/dist/measure/model.js +13 -6
  182. package/dist/measure/model.js.map +1 -1
  183. package/dist/measure/script-data.d.ts +6 -0
  184. package/dist/measure/script-data.js +34 -0
  185. package/dist/measure/script-data.js.map +1 -0
  186. package/dist/measure/scripts.d.ts +36 -0
  187. package/dist/measure/scripts.js +293 -0
  188. package/dist/measure/scripts.js.map +1 -0
  189. package/dist/output/output.d.ts +35 -3
  190. package/dist/output/output.js +26 -4
  191. package/dist/output/output.js.map +1 -1
  192. package/dist/paint/backgrounds.js +7 -20
  193. package/dist/paint/backgrounds.js.map +1 -1
  194. package/dist/paint/blend.d.ts +33 -13
  195. package/dist/paint/blend.js +73 -21
  196. package/dist/paint/blend.js.map +1 -1
  197. package/dist/paint/cache.d.ts +80 -0
  198. package/dist/paint/cache.js +537 -0
  199. package/dist/paint/cache.js.map +1 -0
  200. package/dist/paint/canvas.d.ts +4 -13
  201. package/dist/paint/canvas.js +45 -5
  202. package/dist/paint/canvas.js.map +1 -1
  203. package/dist/paint/context.d.ts +2 -0
  204. package/dist/paint/emphasis.js +1 -1
  205. package/dist/paint/emphasis.js.map +1 -1
  206. package/dist/paint/flatten.d.ts +24 -2
  207. package/dist/paint/flatten.js +55 -12
  208. package/dist/paint/flatten.js.map +1 -1
  209. package/dist/paint/forms.d.ts +64 -0
  210. package/dist/paint/forms.js +319 -0
  211. package/dist/paint/forms.js.map +1 -0
  212. package/dist/paint/images.d.ts +4 -1
  213. package/dist/paint/images.js +13 -2
  214. package/dist/paint/images.js.map +1 -1
  215. package/dist/paint/layers.d.ts +64 -0
  216. package/dist/paint/layers.js +137 -0
  217. package/dist/paint/layers.js.map +1 -0
  218. package/dist/paint/painter.d.ts +19 -6
  219. package/dist/paint/painter.js +15 -135
  220. package/dist/paint/painter.js.map +1 -1
  221. package/dist/paint/stacking.d.ts +1 -1
  222. package/dist/paint/stacking.js +9 -2
  223. package/dist/paint/stacking.js.map +1 -1
  224. package/dist/paint/text.d.ts +14 -3
  225. package/dist/paint/text.js +25 -4
  226. package/dist/paint/text.js.map +1 -1
  227. package/dist/paint/vertical.js +2 -2
  228. package/dist/paint/vertical.js.map +1 -1
  229. package/dist/pdf/encoded.d.ts +16 -0
  230. package/dist/pdf/encoded.js +35 -0
  231. package/dist/pdf/encoded.js.map +1 -0
  232. package/dist/pdf/include/colour.d.ts +105 -0
  233. package/dist/pdf/include/colour.js +349 -0
  234. package/dist/pdf/include/colour.js.map +1 -0
  235. package/dist/pdf/include/functions.d.ts +17 -0
  236. package/dist/pdf/include/functions.js +389 -0
  237. package/dist/pdf/include/functions.js.map +1 -0
  238. package/dist/pdf/include/pages.d.ts +14 -0
  239. package/dist/pdf/include/pages.js +27 -0
  240. package/dist/pdf/include/pages.js.map +1 -0
  241. package/dist/pdf/include/pdfjs/LICENSE +177 -0
  242. package/dist/pdf/include/pdfjs/pdf.min.mjs +27 -0
  243. package/dist/pdf/include/pdfjs/pdf.worker.min.mjs +27 -0
  244. package/dist/pdf/include/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  245. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  246. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  247. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  248. package/dist/pdf/include/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  249. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  250. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  251. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  252. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  253. package/dist/pdf/include/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  254. package/dist/pdf/include/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  255. package/dist/pdf/include/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  256. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  257. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  258. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  259. package/dist/pdf/include/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  260. package/dist/pdf/include/pdfjs/wasm/LICENSE_JBIG2 +196 -0
  261. package/dist/pdf/include/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
  262. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  263. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  264. package/dist/pdf/include/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
  265. package/dist/pdf/include/pdfjs/wasm/LICENSE_QCMS +21 -0
  266. package/dist/pdf/include/pdfjs/wasm/jbig2.wasm +0 -0
  267. package/dist/pdf/include/pdfjs/wasm/openjpeg.wasm +0 -0
  268. package/dist/pdf/include/pdfjs/wasm/qcms_bg.wasm +0 -0
  269. package/dist/pdf/include/pdfjs/wasm/quickjs-eval.wasm +0 -0
  270. package/dist/pdf/include/prepare.d.ts +58 -0
  271. package/dist/pdf/include/prepare.js +266 -0
  272. package/dist/pdf/include/prepare.js.map +1 -0
  273. package/dist/pdf/include/preview.d.ts +38 -0
  274. package/dist/pdf/include/preview.js +101 -0
  275. package/dist/pdf/include/preview.js.map +1 -0
  276. package/dist/pdf/include/rewrite.d.ts +57 -0
  277. package/dist/pdf/include/rewrite.js +803 -0
  278. package/dist/pdf/include/rewrite.js.map +1 -0
  279. package/dist/pdf/include/serialize.d.ts +32 -0
  280. package/dist/pdf/include/serialize.js +158 -0
  281. package/dist/pdf/include/serialize.js.map +1 -0
  282. package/dist/pdf/include/testing.d.ts +26 -0
  283. package/dist/pdf/include/testing.js +50 -0
  284. package/dist/pdf/include/testing.js.map +1 -0
  285. package/dist/pdf/index.d.ts +1 -0
  286. package/dist/pdf/index.js +1 -0
  287. package/dist/pdf/index.js.map +1 -1
  288. package/dist/pdf/structure/annotations.d.ts +33 -0
  289. package/dist/pdf/structure/annotations.js +112 -0
  290. package/dist/pdf/structure/annotations.js.map +1 -0
  291. package/dist/pdf/structure/forms.d.ts +10 -0
  292. package/dist/pdf/structure/forms.js +46 -0
  293. package/dist/pdf/structure/forms.js.map +1 -0
  294. package/dist/pdf/structure/index.d.ts +41 -5
  295. package/dist/pdf/structure/index.js +40 -5
  296. package/dist/pdf/structure/index.js.map +1 -1
  297. package/dist/pdf/structure/links.d.ts +2 -0
  298. package/dist/pdf/structure/links.js +1 -1
  299. package/dist/pdf/structure/links.js.map +1 -1
  300. package/dist/pdf/structure/presentation.d.ts +28 -0
  301. package/dist/pdf/structure/presentation.js +79 -0
  302. package/dist/pdf/structure/presentation.js.map +1 -0
  303. package/dist/pdf/structure/tags.d.ts +34 -2
  304. package/dist/pdf/structure/tags.js +117 -14
  305. package/dist/pdf/structure/tags.js.map +1 -1
  306. package/dist/pdf/types.d.ts +357 -11
  307. package/dist/pdf/wasm/pulpweaver4_pdf.d.ts +44 -2
  308. package/dist/pdf/wasm/pulpweaver4_pdf.js +191 -2
  309. package/dist/pdf/wasm/pulpweaver4_pdf_bg.wasm +0 -0
  310. package/dist/pdf/writer.d.ts +13 -1
  311. package/dist/pdf/writer.js +26 -1
  312. package/dist/pdf/writer.js.map +1 -1
  313. package/dist/plugin/define.d.ts +200 -15
  314. package/dist/plugin/define.js +124 -15
  315. package/dist/plugin/define.js.map +1 -1
  316. package/dist/plugin/failure.d.ts +1 -1
  317. package/dist/plugin/index.d.ts +5 -4
  318. package/dist/plugin/index.js +5 -4
  319. package/dist/plugin/index.js.map +1 -1
  320. package/dist/plugin/reference.d.ts +38 -0
  321. package/dist/plugin/reference.js +287 -0
  322. package/dist/plugin/reference.js.map +1 -0
  323. package/dist/plugin/register.d.ts +39 -7
  324. package/dist/plugin/register.js +83 -2
  325. package/dist/plugin/register.js.map +1 -1
  326. package/dist/preflight/index.d.ts +1 -1
  327. package/dist/preflight/index.js +1 -1
  328. package/dist/preflight/index.js.map +1 -1
  329. package/dist/preflight/pdfx.d.ts +35 -0
  330. package/dist/preflight/pdfx.js +33 -2
  331. package/dist/preflight/pdfx.js.map +1 -1
  332. package/dist/preflight/reader.d.ts +10 -3
  333. package/dist/preflight/reader.js +86 -5
  334. package/dist/preflight/reader.js.map +1 -1
  335. package/dist/print/impose.d.ts +66 -0
  336. package/dist/print/impose.js +331 -0
  337. package/dist/print/impose.js.map +1 -0
  338. package/dist/print/output.js +400 -50
  339. package/dist/print/output.js.map +1 -1
  340. package/dist/problem.js +4 -3
  341. package/dist/problem.js.map +1 -1
  342. package/dist/profile/index.d.ts +1 -0
  343. package/dist/profile/index.js +1 -0
  344. package/dist/profile/index.js.map +1 -1
  345. package/dist/profile/lint.d.ts +1 -1
  346. package/dist/profile/lint.js +29 -1
  347. package/dist/profile/lint.js.map +1 -1
  348. package/dist/profile/list-table.d.ts +51 -0
  349. package/dist/profile/list-table.js +137 -0
  350. package/dist/profile/list-table.js.map +1 -0
  351. package/dist/profile/metadata.js +3 -0
  352. package/dist/profile/metadata.js.map +1 -1
  353. package/dist/profile/profile.d.ts +3 -0
  354. package/dist/profile/profile.js +9 -1
  355. package/dist/profile/profile.js.map +1 -1
  356. package/dist/project.js +3 -0
  357. package/dist/project.js.map +1 -1
  358. package/dist/qpdf/index.d.ts +2 -0
  359. package/dist/qpdf/index.js +3 -0
  360. package/dist/qpdf/index.js.map +1 -0
  361. package/dist/qpdf/qpdf.d.ts +125 -0
  362. package/dist/qpdf/qpdf.js +205 -0
  363. package/dist/qpdf/qpdf.js.map +1 -0
  364. package/dist/qpdf/testing.d.ts +12 -0
  365. package/dist/qpdf/testing.js +9 -0
  366. package/dist/qpdf/testing.js.map +1 -0
  367. package/dist/qpdf/wasm/LICENSE-qpdf +202 -0
  368. package/dist/qpdf/wasm/LICENSE-zlib +22 -0
  369. package/dist/qpdf/wasm/NOTICE-qpdf.md +42 -0
  370. package/dist/qpdf/wasm/qpdf.wasm +0 -0
  371. package/dist/render/index.d.ts +3 -0
  372. package/dist/render/index.js +2 -0
  373. package/dist/render/index.js.map +1 -0
  374. package/dist/render/render.d.ts +98 -0
  375. package/dist/render/render.js +243 -0
  376. package/dist/render/render.js.map +1 -0
  377. package/dist/reproducible/clock.d.ts +4 -5
  378. package/dist/reproducible/clock.js +4 -5
  379. package/dist/reproducible/clock.js.map +1 -1
  380. package/dist/spike/spike-page.chromium.json +4 -4
  381. package/dist/style/colours.d.ts +7 -2
  382. package/dist/style/colours.js +24 -2
  383. package/dist/style/colours.js.map +1 -1
  384. package/dist/style/compile.js +1 -1
  385. package/dist/style/compile.js.map +1 -1
  386. package/dist/style/defaults.d.ts +9 -3
  387. package/dist/style/defaults.js +14 -2
  388. package/dist/style/defaults.js.map +1 -1
  389. package/dist/style/gcpm.d.ts +1 -1
  390. package/dist/style/gcpm.js +17 -5
  391. package/dist/style/gcpm.js.map +1 -1
  392. package/dist/style/properties.js +84 -0
  393. package/dist/style/properties.js.map +1 -1
  394. package/dist/test/book.d.ts +22 -2
  395. package/dist/test/book.js +35 -2
  396. package/dist/test/book.js.map +1 -1
  397. package/dist/test/build.d.ts +23 -0
  398. package/dist/test/build.js +86 -33
  399. package/dist/test/build.js.map +1 -1
  400. package/dist/test/layout.js +128 -19
  401. package/dist/test/layout.js.map +1 -1
  402. package/dist/test/limits.d.ts +8 -0
  403. package/dist/test/limits.js +9 -0
  404. package/dist/test/limits.js.map +1 -0
  405. package/dist/test/pipeline.d.ts +23 -0
  406. package/dist/test/pipeline.js.map +1 -1
  407. package/dist/test/render.d.ts +26 -3
  408. package/dist/test/render.js +151 -23
  409. package/dist/test/render.js.map +1 -1
  410. package/dist/test/runner.d.ts +6 -3
  411. package/dist/test/runner.js +172 -105
  412. package/dist/test/runner.js.map +1 -1
  413. package/dist/test/text.js +2 -2
  414. package/dist/test/text.js.map +1 -1
  415. package/dist/text/output.js +2 -2
  416. package/dist/text/output.js.map +1 -1
  417. package/dist/text/render.d.ts +4 -3
  418. package/dist/text/render.js +126 -4
  419. package/dist/text/render.js.map +1 -1
  420. package/dist/transform/index.d.ts +1 -1
  421. package/dist/transform/index.js +1 -1
  422. package/dist/transform/index.js.map +1 -1
  423. package/dist/transform/run.d.ts +2 -0
  424. package/dist/transform/run.js +32 -16
  425. package/dist/transform/run.js.map +1 -1
  426. package/dist/web/output.js +116 -10
  427. package/dist/web/output.js.map +1 -1
  428. package/dist/web/runtime/justify.js.txt +2 -2
  429. package/dist/web/site.d.ts +2 -0
  430. package/dist/web/site.js +8 -1
  431. package/dist/web/site.js.map +1 -1
  432. package/docs/README.md +6 -1
  433. package/docs/manual/chapters/front.dj +34 -0
  434. package/docs/manual/chapters/guides/citations.dj +426 -0
  435. package/docs/manual/chapters/guides/colour-and-prepress.dj +261 -0
  436. package/docs/manual/chapters/guides/editions.dj +329 -0
  437. package/docs/manual/chapters/guides/in-a-web-page.dj +143 -0
  438. package/docs/manual/chapters/guides/lines-and-pages.dj +681 -0
  439. package/docs/manual/chapters/guides/lint-rules.dj +355 -0
  440. package/docs/manual/chapters/guides/pdfs.dj +501 -0
  441. package/docs/manual/chapters/guides/plugins.dj +425 -0
  442. package/docs/manual/chapters/guides/testing.dj +264 -0
  443. package/docs/manual/chapters/guides/writing-in-djot.dj +537 -0
  444. package/docs/manual/chapters/start/for-latex-users.dj +256 -0
  445. package/docs/manual/chapters/start/getting-started.dj +167 -0
  446. package/docs/manual/chapters/start/your-first-book.dj +426 -0
  447. package/docs/manual/fonts/CrimsonPro-Italic-VF.ttf +0 -0
  448. package/docs/manual/fonts/CrimsonPro-VF.ttf +0 -0
  449. package/docs/manual/fonts/JetBrainsMono-Regular.otf +0 -0
  450. package/docs/manual/fonts/NotoSansSymbols2-Boxes.ttf +0 -0
  451. package/docs/manual/fonts/OFL.txt +95 -0
  452. package/docs/manual/pulpweaver4.toml +39 -0
  453. package/docs/manual/styles/manual.css +137 -0
  454. package/docs/reference/css-properties/index.md +9 -0
  455. package/docs/reference/css-properties/pw-expansion.md +31 -0
  456. package/docs/reference/css-properties/pw-flow-into.md +31 -0
  457. package/docs/reference/css-properties/pw-knockout.md +26 -0
  458. package/docs/reference/css-properties/pw-layer.md +24 -0
  459. package/docs/reference/css-properties/pw-page-breaking.md +30 -0
  460. package/docs/reference/css-properties/pw-page-duration.md +28 -0
  461. package/docs/reference/css-properties/pw-page-rotate.md +29 -0
  462. package/docs/reference/css-properties/pw-page-transition.md +29 -0
  463. package/docs/reference/css-properties/pw-protrusion.md +31 -0
  464. package/docs/reference/lint-rules/ibid-across-page.md +2 -2
  465. package/docs/reference/plugin-api/capabilities.md +2 -2
  466. package/docs/reference/plugin-api/claim-kind.md +1 -1
  467. package/docs/reference/plugin-api/combine-exceptions.md +19 -0
  468. package/docs/reference/plugin-api/element-break-context.md +34 -0
  469. package/docs/reference/plugin-api/element-break-item.md +24 -0
  470. package/docs/reference/plugin-api/element-breaker.md +24 -0
  471. package/docs/reference/plugin-api/flow-definition.md +30 -0
  472. package/docs/reference/plugin-api/generated-reference.md +32 -0
  473. package/docs/reference/plugin-api/index-definition.md +32 -0
  474. package/docs/reference/plugin-api/index-titles.md +18 -0
  475. package/docs/reference/plugin-api/index.md +27 -3
  476. package/docs/reference/plugin-api/insert-class-definition.md +46 -0
  477. package/docs/reference/plugin-api/insert-placement.md +22 -0
  478. package/docs/reference/plugin-api/insert-placements.md +18 -0
  479. package/docs/reference/plugin-api/layout-definition.md +9 -5
  480. package/docs/reference/plugin-api/layout-slot.md +6 -16
  481. package/docs/reference/plugin-api/lint-context.md +3 -1
  482. package/docs/reference/plugin-api/lint-definition.md +1 -1
  483. package/docs/reference/plugin-api/lint-edition.md +2 -0
  484. package/docs/reference/plugin-api/page-builder-event.md +22 -0
  485. package/docs/reference/plugin-api/page-builder-hook.md +7 -3
  486. package/docs/reference/plugin-api/page-builder-page-event.md +30 -0
  487. package/docs/reference/plugin-api/page-template-definition.md +34 -0
  488. package/docs/reference/plugin-api/page-template-region-definition.md +46 -0
  489. package/docs/reference/plugin-api/plugin-definition.md +5 -1
  490. package/docs/reference/plugin-api/plugin-reference-options.md +32 -0
  491. package/docs/reference/plugin-api/plugin-reference.md +22 -0
  492. package/docs/reference/plugin-api/plugin-registry.md +15 -5
  493. package/docs/reference/plugin-api/plugin-stage.md +1 -1
  494. package/docs/reference/plugin-api/plugin.md +9 -2
  495. package/docs/reference/plugin-api/reference-page.md +34 -0
  496. package/docs/reference/plugin-api/render-reference-page.md +18 -0
  497. package/docs/reference/plugin-api/renderers.md +1 -1
  498. package/docs/reference/pulpweaver4-toml/editions.md +239 -2
  499. package/docs/reference/pulpweaver4-toml/index.md +44 -1
  500. package/docs/reference/pulpweaver4-toml/inks.md +15 -4
  501. package/docs/reference/pulpweaver4-toml/lint.md +1 -1
  502. package/package.json +5 -1
@@ -1,2 +1,2 @@
1
- var jo=Object.defineProperty;var ze=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var Wo=(r,e)=>{for(var t in e)jo(r,t,{get:e[t],enumerable:!0})};async function Jo(r={}){var e,t=r,n=typeof window=="object",s=typeof WorkerGlobalScope<"u",o=typeof process=="object"&&process.versions?.node&&process.type!="renderer";if(o){let{createRequire:c}=await import("module");var a=c(import.meta.url)}var l=[],_="./this.program",f=(c,E)=>{throw E},p=import.meta.url,b="";function m(c){return t.locateFile?t.locateFile(c,b):b+c}var h,g;if(o){var w=a("fs");p.startsWith("file:")&&(b=a("path").dirname(a("url").fileURLToPath(p))+"/"),g=c=>{c=R(c)?new URL(c):c;var E=w.readFileSync(c);return E},h=async(c,E=!0)=>{c=R(c)?new URL(c):c;var B=w.readFileSync(c,E?void 0:"utf8");return B},process.argv.length>1&&(_=process.argv[1].replace(/\\/g,"/")),l=process.argv.slice(2),f=(c,E)=>{throw process.exitCode=c,E}}else if(n||s){try{b=new URL(".",p).href}catch{}s&&(g=c=>{var E=new XMLHttpRequest;return E.open("GET",c,!1),E.responseType="arraybuffer",E.send(null),new Uint8Array(E.response)}),h=async c=>{if(R(c))return new Promise((B,V)=>{var W=new XMLHttpRequest;W.open("GET",c,!0),W.responseType="arraybuffer",W.onload=()=>{if(W.status==200||W.status==0&&W.response){B(W.response);return}V(W.status)},W.onerror=V,W.send(null)});var E=await fetch(c,{credentials:"same-origin"});if(E.ok)return E.arrayBuffer();throw new Error(E.status+" : "+E.url)}}var A=console.log.bind(console),v=console.error.bind(console),k,S=!1,M,R=c=>c.startsWith("file://"),x,F,L,D,$,z,O,G,q,nt,st,gt,kt,Q=!1;function J(){var c=L.buffer;t.HEAP8=D=new Int8Array(c),z=new Int16Array(c),t.HEAPU8=$=new Uint8Array(c),t.HEAPU16=O=new Uint16Array(c),t.HEAP32=G=new Int32Array(c),t.HEAPU32=q=new Uint32Array(c),t.HEAPF32=nt=new Float32Array(c),st=new Float64Array(c),gt=new BigInt64Array(c),kt=new BigUint64Array(c)}function tt(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)Et(t.preRun.shift());Z(mt)}function ct(){Q=!0,Pt.__wasm_call_ctors()}function j(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)ft(t.postRun.shift());Z(K)}var at=0,ut=null;function It(c){at++,t.monitorRunDependencies?.(at)}function d(c){if(at--,t.monitorRunDependencies?.(at),at==0&&ut){var E=ut;ut=null,E()}}function y(c){t.onAbort?.(c),c="Aborted("+c+")",v(c),S=!0,c+=". Build with -sASSERTIONS for more info.";var E=new WebAssembly.RuntimeError(c);throw F?.(E),E}var T;function P(){return t.locateFile?m("harfbuzz.wasm"):new URL("harfbuzz.wasm",import.meta.url).href}function U(c){if(c==T&&k)return new Uint8Array(k);if(g)return g(c);throw"both async and sync fetching of the wasm failed"}async function I(c){if(!k)try{var E=await h(c);return new Uint8Array(E)}catch{}return U(c)}async function H(c,E){try{var B=await I(c),V=await WebAssembly.instantiate(B,E);return V}catch(W){v(`failed to asynchronously prepare wasm: ${W}`),y(W)}}async function rt(c,E,B){if(!c&&!R(E)&&!o)try{var V=fetch(E,{credentials:"same-origin"}),W=await WebAssembly.instantiateStreaming(V,B);return W}catch(_t){v(`wasm streaming compile failed: ${_t}`),v("falling back to ArrayBuffer instantiation")}return H(E,B)}function it(){return{env:Ge,wasi_snapshot_preview1:Ge}}async function et(){function c(_t,ce){return Pt=_t.exports,t.wasmExports=Pt,L=Pt.memory,J(),Mt=Pt.__indirect_function_table,Do(Pt),d("wasm-instantiate"),Pt}It("wasm-instantiate");function E(_t){return c(_t.instance)}var B=it();if(t.instantiateWasm)return new Promise((_t,ce)=>{t.instantiateWasm(B,(Go,zo)=>{_t(c(Go,zo))})});T??=P();var V=await rt(k,T,B),W=E(V);return W}class X{name="ExitStatus";constructor(E){this.message=`Program terminated with exit(${E})`,this.status=E}}var Z=c=>{for(;c.length>0;)c.shift()(t)},K=[],ft=c=>K.push(c),mt=[],Et=c=>mt.push(c),lt=!0,ht=c=>Ce(c),Ot=()=>Be(),Un=()=>y(""),Le=0,In=()=>{lt=!1,Le=0},Nt={},xe=c=>{if(c instanceof X||c=="unwind")return M;f(1,c)},He=()=>lt||Le>0,Ue=c=>{M=c,He()||(t.onExit?.(c),S=!0),f(c,new X(c))},On=(c,E)=>{M=c,Ue(c)},Nn=On,Mn=()=>{if(!He())try{Nn(M)}catch(c){xe(c)}},Cn=c=>{if(!S)try{c(),Mn()}catch(E){xe(E)}},Dn=()=>performance.now(),Bn=(c,E)=>{if(Nt[c]&&(clearTimeout(Nt[c].id),delete Nt[c]),!E)return 0;var B=setTimeout(()=>{delete Nt[c],Cn(()=>Me(c,Dn()))},E);return Nt[c]={id:B,timeout_ms:E},0},Gn=()=>2147483648,zn=(c,E)=>Math.ceil(c/E)*E,jn=c=>{var E=L.buffer.byteLength,B=(c-E+65535)/65536|0;try{return L.grow(B),J(),1}catch{}},Wn=c=>{var E=$.length;c>>>=0;var B=Gn();if(c>B)return!1;for(var V=1;V<=4;V*=2){var W=E*(1+.2/V);W=Math.min(W,c+100663296);var _t=Math.min(B,zn(Math.max(c,W),65536)),ce=jn(_t);if(ce)return!0}return!1},Ie=c=>{let E=c.length;return[E%128|128,E>>7,...c]},$n={i:127,p:127,j:126,f:125,d:124,e:111},Oe=c=>Ie(Array.from(c,E=>{var B=$n[E];return B})),Vn=(c,E)=>{var B=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Ie([1,96,...Oe(E.slice(1)),...Oe(E[0]==="v"?"":E[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),V=new WebAssembly.Module(B),W=new WebAssembly.Instance(V,{e:{f:c}}),_t=W.exports.f;return _t},Mt,Ne=c=>Mt.get(c),Yn=(c,E)=>{if(Rt)for(var B=c;B<c+E;B++){var V=Ne(B);V&&Rt.set(V,B)}},Rt,qn=c=>(Rt||(Rt=new WeakMap,Yn(0,Mt.length)),Rt.get(c)||0),oe=[],Xn=()=>oe.length?oe.pop():Mt.grow(1),ae=(c,E)=>Mt.set(c,E),Zn=(c,E)=>{var B=qn(c);if(B)return B;var V=Xn();try{ae(V,c)}catch(_t){if(!(_t instanceof TypeError))throw _t;var W=Vn(c,E);ae(V,W)}return Rt.set(c,V),V},Kn=c=>{Rt.delete(Ne(c)),ae(c,null),oe.push(c)},Jn=c=>De(c);t.noExitRuntime&&(lt=t.noExitRuntime),t.print&&(A=t.print),t.printErr&&(v=t.printErr),t.wasmBinary&&(k=t.wasmBinary),t.arguments&&(l=t.arguments),t.thisProgram&&(_=t.thisProgram),t.wasmExports=Pt,t.stackSave=Ot,t.stackRestore=ht,t.stackAlloc=Jn,t.addFunction=Zn,t.removeFunction=Kn;var Qn,tr,er,nr,rr,sr,or,ar,ir,cr,lr,_r,ur,fr,hr,pr,dr,gr,br,mr,yr,Pr,wr,Sr,Ar,vr,kr,Er,Rr,Fr,Tr,Lr,xr,Hr,Ur,Ir,Or,Nr,Mr,Cr,Dr,Br,Gr,zr,jr,Wr,$r,Vr,Yr,qr,Xr,Zr,Kr,Jr,Qr,ts,es,ns,rs,ss,os,as,is,cs,ls,_s,us,fs,hs,ps,ds,gs,bs,ms,ys,Ps,ws,Ss,As,vs,ks,Es,Rs,Fs,Ts,Ls,xs,Hs,Us,Is,Os,Ns,Ms,Cs,Ds,Bs,Gs,zs,js,Ws,$s,Vs,Ys,qs,Xs,Zs,Ks,Js,Qs,to,eo,no,ro,so,oo,ao,io,co,lo,_o,uo,fo,ho,po,go,bo,mo,yo,Po,wo,So,Ao,vo,ko,Eo,Ro,Fo,To,Lo,xo,Ho,Uo,Io,Oo,No,Mo,Co,Me,Ce,De,Be;function Do(c){t._hb_blob_create=Qn=c.hb_blob_create,t._hb_blob_destroy=tr=c.hb_blob_destroy,t._hb_blob_get_length=er=c.hb_blob_get_length,t._hb_blob_get_data=nr=c.hb_blob_get_data,t._hb_buffer_serialize=rr=c.hb_buffer_serialize,t._hb_buffer_create=sr=c.hb_buffer_create,t._hb_buffer_reset=or=c.hb_buffer_reset,t._hb_buffer_reference=ar=c.hb_buffer_reference,t._hb_buffer_destroy=ir=c.hb_buffer_destroy,t._hb_buffer_get_content_type=cr=c.hb_buffer_get_content_type,t._hb_buffer_set_direction=lr=c.hb_buffer_set_direction,t._hb_buffer_set_script=_r=c.hb_buffer_set_script,t._hb_buffer_set_language=ur=c.hb_buffer_set_language,t._hb_buffer_set_flags=fr=c.hb_buffer_set_flags,t._hb_buffer_set_cluster_level=hr=c.hb_buffer_set_cluster_level,t._hb_buffer_clear_contents=pr=c.hb_buffer_clear_contents,t._hb_buffer_add=dr=c.hb_buffer_add,t._hb_buffer_get_length=gr=c.hb_buffer_get_length,t._hb_buffer_get_glyph_infos=br=c.hb_buffer_get_glyph_infos,t._hb_buffer_get_glyph_positions=mr=c.hb_buffer_get_glyph_positions,t._hb_glyph_info_get_glyph_flags=yr=c.hb_glyph_info_get_glyph_flags,t._hb_buffer_guess_segment_properties=Pr=c.hb_buffer_guess_segment_properties,t._hb_buffer_add_utf8=wr=c.hb_buffer_add_utf8,t._hb_buffer_add_utf16=Sr=c.hb_buffer_add_utf16,t._hb_buffer_add_codepoints=Ar=c.hb_buffer_add_codepoints,t._hb_buffer_set_message_func=vr=c.hb_buffer_set_message_func,t._hb_language_from_string=kr=c.hb_language_from_string,t._hb_language_to_string=Er=c.hb_language_to_string,t._hb_script_from_string=Rr=c.hb_script_from_string,t._hb_version=Fr=c.hb_version,t._hb_version_string=Tr=c.hb_version_string,t._hb_feature_from_string=Lr=c.hb_feature_from_string,t._hb_feature_to_string=xr=c.hb_feature_to_string,t._hb_variation_from_string=Hr=c.hb_variation_from_string,t._hb_variation_to_string=Ur=c.hb_variation_to_string,t._malloc=Ir=c.malloc,t._free=Or=c.free,t._hb_draw_funcs_set_move_to_func=Nr=c.hb_draw_funcs_set_move_to_func,t._hb_draw_funcs_set_line_to_func=Mr=c.hb_draw_funcs_set_line_to_func,t._hb_draw_funcs_set_quadratic_to_func=Cr=c.hb_draw_funcs_set_quadratic_to_func,t._hb_draw_funcs_set_cubic_to_func=Dr=c.hb_draw_funcs_set_cubic_to_func,t._hb_draw_funcs_set_close_path_func=Br=c.hb_draw_funcs_set_close_path_func,t._hb_draw_funcs_create=Gr=c.hb_draw_funcs_create,t._hb_draw_funcs_destroy=zr=c.hb_draw_funcs_destroy,t._hb_face_create=jr=c.hb_face_create,t._hb_face_reference=Wr=c.hb_face_reference,t._hb_face_destroy=$r=c.hb_face_destroy,t._hb_face_reference_table=Vr=c.hb_face_reference_table,t._hb_face_get_upem=Yr=c.hb_face_get_upem,t._hb_face_collect_unicodes=qr=c.hb_face_collect_unicodes,t._hb_font_funcs_create=Xr=c.hb_font_funcs_create,t._hb_font_funcs_destroy=Zr=c.hb_font_funcs_destroy,t._hb_font_funcs_set_font_h_extents_func=Kr=c.hb_font_funcs_set_font_h_extents_func,t._hb_font_funcs_set_font_v_extents_func=Jr=c.hb_font_funcs_set_font_v_extents_func,t._hb_font_funcs_set_nominal_glyph_func=Qr=c.hb_font_funcs_set_nominal_glyph_func,t._hb_font_funcs_set_nominal_glyphs_func=ts=c.hb_font_funcs_set_nominal_glyphs_func,t._hb_font_funcs_set_variation_glyph_func=es=c.hb_font_funcs_set_variation_glyph_func,t._hb_font_funcs_set_glyph_h_advance_func=ns=c.hb_font_funcs_set_glyph_h_advance_func,t._hb_font_funcs_set_glyph_v_advance_func=rs=c.hb_font_funcs_set_glyph_v_advance_func,t._hb_font_funcs_set_glyph_h_advances_func=ss=c.hb_font_funcs_set_glyph_h_advances_func,t._hb_font_funcs_set_glyph_v_advances_func=os=c.hb_font_funcs_set_glyph_v_advances_func,t._hb_font_funcs_set_glyph_h_origin_func=as=c.hb_font_funcs_set_glyph_h_origin_func,t._hb_font_funcs_set_glyph_v_origin_func=is=c.hb_font_funcs_set_glyph_v_origin_func,t._hb_font_funcs_set_glyph_h_kerning_func=cs=c.hb_font_funcs_set_glyph_h_kerning_func,t._hb_font_funcs_set_glyph_extents_func=ls=c.hb_font_funcs_set_glyph_extents_func,t._hb_font_funcs_set_glyph_name_func=_s=c.hb_font_funcs_set_glyph_name_func,t._hb_font_funcs_set_glyph_from_name_func=us=c.hb_font_funcs_set_glyph_from_name_func,t._hb_font_get_h_extents=fs=c.hb_font_get_h_extents,t._hb_font_get_v_extents=hs=c.hb_font_get_v_extents,t._hb_font_get_glyph=ps=c.hb_font_get_glyph,t._hb_font_get_nominal_glyph=ds=c.hb_font_get_nominal_glyph,t._hb_font_get_variation_glyph=gs=c.hb_font_get_variation_glyph,t._hb_font_get_glyph_h_advance=bs=c.hb_font_get_glyph_h_advance,t._hb_font_get_glyph_v_advance=ms=c.hb_font_get_glyph_v_advance,t._hb_font_get_glyph_h_origin=ys=c.hb_font_get_glyph_h_origin,t._hb_font_get_glyph_v_origin=Ps=c.hb_font_get_glyph_v_origin,t._hb_font_get_glyph_extents=ws=c.hb_font_get_glyph_extents,t._hb_font_get_glyph_from_name=Ss=c.hb_font_get_glyph_from_name,t._hb_font_draw_glyph_or_fail=As=c.hb_font_draw_glyph_or_fail,t._hb_font_paint_glyph_or_fail=vs=c.hb_font_paint_glyph_or_fail,t._hb_font_draw_glyph=ks=c.hb_font_draw_glyph,t._hb_font_paint_glyph=Es=c.hb_font_paint_glyph,t._hb_font_glyph_to_string=Rs=c.hb_font_glyph_to_string,t._hb_font_create=Fs=c.hb_font_create,t._hb_font_set_variations=Ts=c.hb_font_set_variations,t._hb_font_create_sub_font=Ls=c.hb_font_create_sub_font,t._hb_font_reference=xs=c.hb_font_reference,t._hb_font_destroy=Hs=c.hb_font_destroy,t._hb_font_get_face=Us=c.hb_font_get_face,t._hb_font_set_funcs=Is=c.hb_font_set_funcs,t._hb_font_set_scale=Os=c.hb_font_set_scale,t._hb_ot_color_has_palettes=Ns=c.hb_ot_color_has_palettes,t._hb_ot_color_palette_get_count=Ms=c.hb_ot_color_palette_get_count,t._hb_ot_color_palette_get_name_id=Cs=c.hb_ot_color_palette_get_name_id,t._hb_ot_color_palette_color_get_name_id=Ds=c.hb_ot_color_palette_color_get_name_id,t._hb_ot_color_palette_get_flags=Bs=c.hb_ot_color_palette_get_flags,t._hb_ot_color_palette_get_colors=Gs=c.hb_ot_color_palette_get_colors,t._hb_ot_color_has_layers=zs=c.hb_ot_color_has_layers,t._hb_ot_color_has_paint=js=c.hb_ot_color_has_paint,t._hb_ot_color_glyph_has_paint=Ws=c.hb_ot_color_glyph_has_paint,t._hb_ot_color_glyph_get_layers=$s=c.hb_ot_color_glyph_get_layers,t._hb_ot_color_has_png=Vs=c.hb_ot_color_has_png,t._hb_ot_color_glyph_reference_png=Ys=c.hb_ot_color_glyph_reference_png,t._hb_ot_layout_get_glyph_class=qs=c.hb_ot_layout_get_glyph_class,t._hb_ot_layout_get_ligature_carets=Xs=c.hb_ot_layout_get_ligature_carets,t._hb_ot_layout_table_get_script_tags=Zs=c.hb_ot_layout_table_get_script_tags,t._hb_ot_layout_table_get_feature_tags=Ks=c.hb_ot_layout_table_get_feature_tags,t._hb_ot_layout_script_get_language_tags=Js=c.hb_ot_layout_script_get_language_tags,t._hb_ot_layout_language_get_feature_tags=Qs=c.hb_ot_layout_language_get_feature_tags,t._hb_ot_layout_feature_get_lookups=to=c.hb_ot_layout_feature_get_lookups,t._hb_ot_layout_feature_get_name_ids=eo=c.hb_ot_layout_feature_get_name_ids,t._hb_ot_metrics_get_position_with_fallback=no=c.hb_ot_metrics_get_position_with_fallback,t._hb_ot_layout_lookup_get_optical_bound=ro=c.hb_ot_layout_lookup_get_optical_bound,t._hb_ot_tags_from_script_and_language=so=c.hb_ot_tags_from_script_and_language,t._hb_ot_metrics_get_position=oo=c.hb_ot_metrics_get_position,t._hb_ot_metrics_get_variation=ao=c.hb_ot_metrics_get_variation,t._hb_ot_metrics_get_x_variation=io=c.hb_ot_metrics_get_x_variation,t._hb_ot_metrics_get_y_variation=co=c.hb_ot_metrics_get_y_variation,t._hb_ot_name_list_names=lo=c.hb_ot_name_list_names,t._hb_ot_name_get_utf16=_o=c.hb_ot_name_get_utf16,t._hb_set_create=uo=c.hb_set_create,t._hb_set_destroy=fo=c.hb_set_destroy,t._hb_ot_tag_to_script=ho=c.hb_ot_tag_to_script,t._hb_ot_tag_to_language=po=c.hb_ot_tag_to_language,t._hb_ot_tags_to_script_and_language=go=c.hb_ot_tags_to_script_and_language,t._hb_ot_var_get_axis_infos=bo=c.hb_ot_var_get_axis_infos,t._hb_paint_funcs_set_push_transform_func=mo=c.hb_paint_funcs_set_push_transform_func,t._hb_paint_funcs_set_pop_transform_func=yo=c.hb_paint_funcs_set_pop_transform_func,t._hb_paint_funcs_set_color_glyph_func=Po=c.hb_paint_funcs_set_color_glyph_func,t._hb_paint_funcs_set_push_clip_glyph_func=wo=c.hb_paint_funcs_set_push_clip_glyph_func,t._hb_paint_funcs_set_push_clip_rectangle_func=So=c.hb_paint_funcs_set_push_clip_rectangle_func,t._hb_paint_funcs_set_pop_clip_func=Ao=c.hb_paint_funcs_set_pop_clip_func,t._hb_paint_funcs_set_color_func=vo=c.hb_paint_funcs_set_color_func,t._hb_paint_funcs_set_image_func=ko=c.hb_paint_funcs_set_image_func,t._hb_paint_funcs_set_linear_gradient_func=Eo=c.hb_paint_funcs_set_linear_gradient_func,t._hb_paint_funcs_set_radial_gradient_func=Ro=c.hb_paint_funcs_set_radial_gradient_func,t._hb_paint_funcs_set_sweep_gradient_func=Fo=c.hb_paint_funcs_set_sweep_gradient_func,t._hb_paint_funcs_set_push_group_func=To=c.hb_paint_funcs_set_push_group_func,t._hb_paint_funcs_set_pop_group_func=Lo=c.hb_paint_funcs_set_pop_group_func,t._hb_paint_funcs_set_custom_palette_color_func=xo=c.hb_paint_funcs_set_custom_palette_color_func,t._hb_paint_funcs_create=Ho=c.hb_paint_funcs_create,t._hb_paint_funcs_destroy=Uo=c.hb_paint_funcs_destroy,t._hb_color_line_get_color_stops=Io=c.hb_color_line_get_color_stops,t._hb_color_line_get_extend=Oo=c.hb_color_line_get_extend,t._hb_set_get_population=No=c.hb_set_get_population,t._hb_set_next_many=Mo=c.hb_set_next_many,t._hb_shape=Co=c.hb_shape,Me=c._emscripten_timeout,Ce=c._emscripten_stack_restore,De=c._emscripten_stack_alloc,Be=c.emscripten_stack_get_current}var Ge={_abort_js:Un,_emscripten_runtime_keepalive_clear:In,_setitimer_js:Bn,emscripten_resize_heap:Wn,proc_exit:Ue},Pt=await et();function ie(){if(at>0){ut=ie;return}if(tt(),at>0){ut=ie;return}function c(){t.calledRun=!0,!S&&(ct(),x?.(t),t.onRuntimeInitialized?.(),j())}t.setStatus?(t.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>t.setStatus(""),1),c()},1)):c()}function Bo(){if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()()}return Bo(),ie(),Q?e=t:e=new Promise((c,E)=>{x=c,F=E}),e}var qe,Xe=ze(()=>{qe=Jo});var cn={};Wo(cn,{AxisFlags:()=>_a,Blob:()=>fa,Buffer:()=>Sa,BufferContentType:()=>nn,BufferFlag:()=>ya,BufferSerializeFlag:()=>rn,BufferSerializeFormat:()=>we,ClusterLevel:()=>wa,ColorPaletteFlags:()=>ia,Direction:()=>Pa,DrawFuncs:()=>Pe,Face:()=>tn,Feature:()=>Aa,Font:()=>ot,FontFuncs:()=>ba,GlyphClass:()=>ha,GlyphFlag:()=>ua,MetricsTag:()=>pa,PaintCompositeMode:()=>la,PaintExtend:()=>ca,PaintFuncs:()=>ma,TracePhase:()=>Bt,Variation:()=>va,otTagToLanguage:()=>Ta,otTagToScript:()=>Fa,otTagsFromScriptAndLanguage:()=>La,otTagsToScriptAndLanguage:()=>xa,shape:()=>an,shapeWithTrace:()=>ka,version:()=>Ea,versionString:()=>Ra});function Gt(r,e){let t=r.ptr;be.register(r,()=>e(t))}function ea(r){i=r,u=i.wasmExports,Je=i.addFunction(e=>{u.free(e)},"vi")}function N(r){return(r.charCodeAt(0)&255)<<24|(r.charCodeAt(1)&255)<<16|(r.charCodeAt(2)&255)<<8|(r.charCodeAt(3)&255)<<0}function pt(r){return String.fromCharCode(r>>24&255,r>>16&255,r>>8&255,r>>0&255)}function At(r,e){let t;return e==null?t=i.HEAPU8.indexOf(0,r):t=r+e,Qo.decode(i.HEAPU8.subarray(r,t))}function na(r,e){let t=r/2+e;return String.fromCharCode(...i.HEAPU16.subarray(r/2,t))}function Ft(r){let e=u.malloc(r.length+1);for(let t=0;t<r.length;++t){let n=r.charCodeAt(t);if(n>127)throw new Error("Expected ASCII text");i.HEAPU8[e+t]=n}return i.HEAPU8[e+r.length]=0,{ptr:e,length:r.length,free:function(){u.free(e)}}}function ra(r){let e=u.malloc(r.length);return ta.encodeInto(r,i.HEAPU8.subarray(e,e+r.length)),{ptr:e,length:r.length,free:function(){u.free(e)}}}function sa(r){let e=u.malloc(r.length*2),t=i.HEAPU16.subarray(e/2,e/2+r.length);for(let n=0;n<t.length;++n)t[n]=r.charCodeAt(n);return{ptr:e,length:t.length,free:function(){u.free(e)}}}function me(r){return At(u.hb_language_to_string(r))}function oa(r){let e=Ft(r),t=u.hb_language_from_string(e.ptr,-1);return e.free(),t}function aa(r){let e=u.hb_set_get_population(r),t=u.malloc(e<<2),n=t>>2;return u.hb_set_next_many(r,-1,t,e),i.HEAPU32.subarray(n,n+e)}function Y(r){if(r===void 0)return 0;let e=Qe.pop()??Vt.length;return Vt[e]=r,e}function C(r){return Vt[r]}function Ht(r){r!==0&&(Vt[r]=void 0,Qe.push(r))}function ye(r){return{red:r>>8&255,green:r>>16&255,blue:r>>24&255,alpha:r&255}}function ge(r){return(r.red<<8|r.green<<16|r.blue<<24|r.alpha)>>>0}function da(){return wt||(wt=new Pe,wt.setMoveToFunc((r,e,t)=>{t.push(`M${r},${e}`)}),wt.setLineToFunc((r,e,t)=>{t.push(`L${r},${e}`)}),wt.setCubicToFunc((r,e,t,n,s,o,a)=>{a.push(`C${r},${e} ${t},${n} ${s},${o}`)}),wt.setQuadraticToFunc((r,e,t,n,s)=>{s.push(`Q${r},${e} ${t},${n}`)}),wt.setClosePathFunc(r=>{r.push("Z")})),wt}function ga(){return St||(St=new Pe,St.setMoveToFunc((r,e,t)=>{t.push({type:"M",values:[r,e]})}),St.setLineToFunc((r,e,t)=>{t.push({type:"L",values:[r,e]})}),St.setCubicToFunc((r,e,t,n,s,o,a)=>{a.push({type:"C",values:[r,e,t,n,s,o]})}),St.setQuadraticToFunc((r,e,t,n,s)=>{s.push({type:"Q",values:[r,e,t,n]})}),St.setClosePathFunc(r=>{r.push({type:"Z",values:[]})})),St}function de(r){let e=u.hb_color_line_get_extend(r),t=[],n=i.stackSave(),s=i.stackAlloc(4),o=i.stackAlloc(1536),a=0,l=128;for(;l===128;){i.HEAPU32[s/4]=l,u.hb_color_line_get_color_stops(r,a,s,o),l=i.HEAPU32[s/4];for(let _=0;_<l;_++){let f=(o+_*12)/4;t.push({offset:i.HEAPF32[f],isForeground:i.HEAPU32[f+1]!==0,color:ye(i.HEAPU32[f+2])})}a+=l}return i.stackRestore(n),{extend:e,colorStops:t}}function an(r,e,t){let n=t?.length??0,s=i.stackSave(),o=0;n&&(o=i.stackAlloc(16*n),t.forEach((a,l)=>{a.writeTo(o+l*16)})),u.hb_shape(r.ptr,e.ptr,o,n),i.stackRestore(s)}function ka(r,e,t,n,s){let o=[],a=Bt.DONT_STOP,l=!1;return e.setMessageFunc((_,f,p)=>{if(p.startsWith("start table GSUB")?a=Bt.GSUB:p.startsWith("start table GPOS")&&(a=Bt.GPOS),a!=s&&(l=!1),s!=Bt.DONT_STOP&&a==s&&p.startsWith("end lookup "+n)&&(l=!0),l)return!1;let b=_.serialize({font:f,format:we.JSON,flags:rn.NO_GLYPH_NAMES});return o.push({m:p,t:JSON.parse(b),glyphs:_.getContentType()==nn.GLYPHS}),!0}),an(r,e,t),o}function Ea(){let r=i.stackSave(),e=i.stackAlloc(12);u.hb_version(e,e+4,e+8);let t={major:i.HEAPU32[e/4],minor:i.HEAPU32[(e+4)/4],micro:i.HEAPU32[(e+8)/4]};return i.stackRestore(r),t}function Ra(){return At(u.hb_version_string())}function Fa(r){let e=N(r);return pt(u.hb_ot_tag_to_script(e))}function Ta(r){let e=N(r);return me(u.hb_ot_tag_to_language(e))}function La(r,e){let t=i.stackSave(),n=Ft(r),s=Ft(e),o=i.stackAlloc(4);i.HEAPU32[o/4]=Ke;let a=i.stackAlloc(Ke*4),l=i.stackAlloc(4);i.HEAPU32[l/4]=Ze;let _=i.stackAlloc(Ze*4);u.hb_ot_tags_from_script_and_language(u.hb_script_from_string(n.ptr,-1),u.hb_language_from_string(s.ptr,-1),o,a,l,_),n.free(),s.free();let f=i.HEAPU32.subarray(a/4,a/4+i.HEAPU32[o/4]),p=i.HEAPU32.subarray(_/4,_/4+i.HEAPU32[l/4]);return i.stackRestore(t),{scriptTags:[...f].map(pt),languageTags:[...p].map(pt)}}function xa(r,e){let t=i.stackSave(),n=i.stackAlloc(4),s=i.stackAlloc(4);u.hb_ot_tags_to_script_and_language(N(r),N(e),n,s);let o=i.HEAPU32[n/4],a=i.HEAPU32[s/4];return i.stackRestore(t),{script:pt(o),language:me(a)}}var i,u,Je,Qo,ta,be,Vt,Qe,ia,ca,la,_a,ua,fa,Dt,ha,tn,Pe,pa,wt,St,ot,ba,ma,nn,rn,ya,Pa,wa,we,Sa,Aa,va,Bt,Ze,Ke,ln=ze(async()=>{Xe();Qo=new TextDecoder("utf8"),ta=new TextEncoder,be=new FinalizationRegistry(r=>{r()});Vt=[void 0],Qe=[];ia={DEFAULT:0,USABLE_WITH_LIGHT_BACKGROUND:1,USABLE_WITH_DARK_BACKGROUND:2},ca={PAD:0,REPEAT:1,REFLECT:2},la={CLEAR:0,SRC:1,DEST:2,SRC_OVER:3,DEST_OVER:4,SRC_IN:5,DEST_IN:6,SRC_OUT:7,DEST_OUT:8,SRC_ATOP:9,DEST_ATOP:10,XOR:11,PLUS:12,SCREEN:13,OVERLAY:14,DARKEN:15,LIGHTEN:16,COLOR_DODGE:17,COLOR_BURN:18,HARD_LIGHT:19,SOFT_LIGHT:20,DIFFERENCE:21,EXCLUSION:22,MULTIPLY:23,HSL_HUE:24,HSL_SATURATION:25,HSL_COLOR:26,HSL_LUMINOSITY:27},_a={HIDDEN:1},ua={UNSAFE_TO_BREAK:1,UNSAFE_TO_CONCAT:2,SAFE_TO_INSERT_TATWEEL:4,DEFINED:7},fa=class{constructor(r){let e=r instanceof Uint8Array?r:new Uint8Array(r),t=u.malloc(e.byteLength);i.HEAPU8.set(e,t),this.ptr=u.hb_blob_create(t,e.byteLength,2,t,Je),Gt(this,u.hb_blob_destroy)}},Dt=65535,ha={UNCLASSIFIED:0,BASE_GLYPH:1,LIGATURE:2,MARK:3,COMPONENT:4},tn=class{constructor(r,e=0){typeof r=="number"?this.ptr=u.hb_face_reference(r):this.ptr=u.hb_face_create(r.ptr,e),this.upem=u.hb_face_get_upem(this.ptr),Gt(this,u.hb_face_destroy)}referenceTable(r){let e=u.hb_face_reference_table(this.ptr,N(r)),t=u.hb_blob_get_length(e);if(!t)return;let n=u.hb_blob_get_data(e,0);return i.HEAPU8.subarray(n,n+t)}getAxisInfos(){let r=i.stackSave(),e=i.stackAlloc(2048),t=i.stackAlloc(4);i.HEAPU32[t/4]=64,u.hb_ot_var_get_axis_infos(this.ptr,0,t,e);let n={};return Array.from({length:i.HEAPU32[t/4]}).forEach((s,o)=>{let a={axisIndex:i.HEAPU32[e/4+o*8],tag:pt(i.HEAPU32[e/4+o*8+1]),nameId:i.HEAPU32[e/4+o*8+2],flags:i.HEAPU32[e/4+o*8+3],min:i.HEAPF32[e/4+o*8+4],default:i.HEAPF32[e/4+o*8+5],max:i.HEAPF32[e/4+o*8+6]};n[a.tag]=a}),i.stackRestore(r),n}collectUnicodes(){let r=u.hb_set_create();u.hb_face_collect_unicodes(this.ptr,r);let e=aa(r);return u.hb_set_destroy(r),e}getTableScriptTags(r){let e=i.stackSave(),t=N(r),n=0,s=128,o=i.stackAlloc(4),a=i.stackAlloc(512),l=[];for(;s==128;){i.HEAPU32[o/4]=s,u.hb_ot_layout_table_get_script_tags(this.ptr,t,n,o,a),s=i.HEAPU32[o/4];let _=i.HEAPU32.subarray(a/4,a/4+s);l.push(...Array.from(_).map(pt)),n+=s}return i.stackRestore(e),l}getTableFeatureTags(r){let e=i.stackSave(),t=N(r),n=0,s=128,o=i.stackAlloc(4),a=i.stackAlloc(512),l=[];for(;s==128;){i.HEAPU32[o/4]=s,u.hb_ot_layout_table_get_feature_tags(this.ptr,t,n,o,a),s=i.HEAPU32[o/4];let _=i.HEAPU32.subarray(a/4,a/4+s);l.push(...Array.from(_).map(pt)),n+=s}return i.stackRestore(e),l}getScriptLanguageTags(r,e){let t=i.stackSave(),n=N(r),s=0,o=128,a=i.stackAlloc(4),l=i.stackAlloc(512),_=[];for(;o==128;){i.HEAPU32[a/4]=o,u.hb_ot_layout_script_get_language_tags(this.ptr,n,e,s,a,l),o=i.HEAPU32[a/4];let f=i.HEAPU32.subarray(l/4,l/4+o);_.push(...Array.from(f).map(pt)),s+=o}return i.stackRestore(t),_}getLanguageFeatureTags(r,e,t){let n=i.stackSave(),s=N(r),o=0,a=128,l=i.stackAlloc(4),_=i.stackAlloc(512),f=[];for(;a==128;){i.HEAPU32[l/4]=a,u.hb_ot_layout_language_get_feature_tags(this.ptr,s,e,t,o,l,_),a=i.HEAPU32[l/4];let p=i.HEAPU32.subarray(_/4,_/4+a);f.push(...Array.from(p).map(pt)),o+=a}return i.stackRestore(n),f}getFeatureLookups(r,e){let t=i.stackSave(),n=N(r),s=0,o=128,a=i.stackAlloc(4),l=i.stackAlloc(512),_=[];for(;o==128;){i.HEAPU32[a/4]=o,u.hb_ot_layout_feature_get_lookups(this.ptr,n,e,s,a,l),o=i.HEAPU32[a/4];let f=i.HEAPU32.subarray(l/4,l/4+o);_.push(...Array.from(f)),s+=o}return i.stackRestore(t),_}getGlyphClass(r){return u.hb_ot_layout_get_glyph_class(this.ptr,r)}listNames(){let r=i.stackSave(),e=i.stackAlloc(4),t=u.hb_ot_name_list_names(this.ptr,e),n=i.HEAPU32[e/4],s=[];for(let o=0;o<n;o++)s.push({nameId:i.HEAPU32[t/4+o*3],language:me(i.HEAPU32[t/4+o*3+2])});return i.stackRestore(r),s}getName(r,e){let t=i.stackSave(),n=oa(e),s=u.hb_ot_name_get_utf16(this.ptr,r,n,0,0)+1,o=i.stackAlloc(4),a=u.malloc(s*2);i.HEAPU32[o/4]=s,u.hb_ot_name_get_utf16(this.ptr,r,n,o,a);let l=na(a,s-1);return u.free(a),i.stackRestore(t),l}getFeatureNameIds(r,e){let t=i.stackSave(),n=N(r),s=i.stackAlloc(4),o=i.stackAlloc(4),a=i.stackAlloc(4),l=i.stackAlloc(4),_=i.stackAlloc(4),f=u.hb_ot_layout_feature_get_name_ids(this.ptr,n,e,s,o,a,l,_),p;if(f){let b=i.HEAPU32[s/4],m=i.HEAPU32[o/4],h=i.HEAPU32[a/4],g=i.HEAPU32[l/4],w=i.HEAPU32[_/4];p={paramUiLabelNameIds:Array.from({length:g},(A,v)=>w+v)},b!=Dt&&(p.uiLabelNameId=b),m!=Dt&&(p.uiTooltipTextNameId=m),h!=Dt&&(p.sampleTextNameId=h)}return i.stackRestore(t),p}hasColorPalettes(){return!!u.hb_ot_color_has_palettes(this.ptr)}getColorPalettes(){let r=u.hb_ot_color_palette_get_count(this.ptr),e=[],t=i.stackSave(),n=i.stackAlloc(4),s=i.stackAlloc(512);for(let o=0;o<r;o++){let a=[],l=0,_=128;for(;_===128;){i.HEAPU32[n/4]=_,u.hb_ot_color_palette_get_colors(this.ptr,o,l,n,s),_=i.HEAPU32[n/4];for(let b=0;b<_;b++){let m=ye(i.HEAPU32[s/4+b]),h=u.hb_ot_color_palette_color_get_name_id(this.ptr,l+b);h!=Dt&&(m.nameId=h),a.push(m)}l+=_}let f={colors:a,flags:u.hb_ot_color_palette_get_flags(this.ptr,o)},p=u.hb_ot_color_palette_get_name_id(this.ptr,o);p!=Dt&&(f.nameId=p),e.push(f)}return i.stackRestore(t),e}hasColorLayers(){return!!u.hb_ot_color_has_layers(this.ptr)}getGlyphColorLayers(r){let e=[],t=i.stackSave(),n=i.stackAlloc(4),s=i.stackAlloc(1024),o=0,a=128;for(;a===128;){i.HEAPU32[n/4]=a,u.hb_ot_color_glyph_get_layers(this.ptr,r,o,n,s),a=i.HEAPU32[n/4];for(let l=0;l<a;l++){let _=s/4+l*2,f={glyph:i.HEAPU32[_]},p=i.HEAPU32[_+1];p!=65535&&(f.colorIndex=p),e.push(f)}o+=a}return i.stackRestore(t),e}hasColorPaint(){return!!u.hb_ot_color_has_paint(this.ptr)}glyphHasColorPaint(r){return!!u.hb_ot_color_glyph_has_paint(this.ptr,r)}hasColorPng(){return!!u.hb_ot_color_has_png(this.ptr)}},Pe=class{constructor(){this.funcPtrs=[],this.userDataPtrs=[],this.ptr=u.hb_draw_funcs_create();let r=this.ptr,e=this.funcPtrs,t=this.userDataPtrs;be.register(this,()=>{u.hb_draw_funcs_destroy(r);for(let n of e)i.removeFunction(n);for(let n of t)Ht(n)})}setMoveToFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_,f)=>{r(l,_,C(o),C(f))},"viiiffi");this.funcPtrs.push(n),u.hb_draw_funcs_set_move_to_func(this.ptr,n,t,0)}setLineToFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_,f)=>{r(l,_,C(o),C(f))},"viiiffi");this.funcPtrs.push(n),u.hb_draw_funcs_set_line_to_func(this.ptr,n,t,0)}setQuadraticToFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_,f,p,b)=>{r(l,_,f,p,C(o),C(b))},"viiiffffi");this.funcPtrs.push(n),u.hb_draw_funcs_set_quadratic_to_func(this.ptr,n,t,0)}setCubicToFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_,f,p,b,m,h)=>{r(l,_,f,p,b,m,C(o),C(h))},"viiiffffffi");this.funcPtrs.push(n),u.hb_draw_funcs_set_cubic_to_func(this.ptr,n,t,0)}setClosePathFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l)=>{r(C(o),C(l))},"viiii");this.funcPtrs.push(n),u.hb_draw_funcs_set_close_path_func(this.ptr,n,t,0)}},pa={HORIZONTAL_ASCENDER:N("hasc"),HORIZONTAL_DESCENDER:N("hdsc"),HORIZONTAL_LINE_GAP:N("hlgp"),HORIZONTAL_CLIPPING_ASCENT:N("hcla"),HORIZONTAL_CLIPPING_DESCENT:N("hcld"),VERTICAL_ASCENDER:N("vasc"),VERTICAL_DESCENDER:N("vdsc"),VERTICAL_LINE_GAP:N("vlgp"),HORIZONTAL_CARET_RISE:N("hcrs"),HORIZONTAL_CARET_RUN:N("hcrn"),HORIZONTAL_CARET_OFFSET:N("hcof"),VERTICAL_CARET_RISE:N("vcrs"),VERTICAL_CARET_RUN:N("vcrn"),VERTICAL_CARET_OFFSET:N("vcof"),X_HEIGHT:N("xhgt"),CAP_HEIGHT:N("cpht"),SUBSCRIPT_EM_X_SIZE:N("sbxs"),SUBSCRIPT_EM_Y_SIZE:N("sbys"),SUBSCRIPT_EM_X_OFFSET:N("sbxo"),SUBSCRIPT_EM_Y_OFFSET:N("sbyo"),SUPERSCRIPT_EM_X_SIZE:N("spxs"),SUPERSCRIPT_EM_Y_SIZE:N("spys"),SUPERSCRIPT_EM_X_OFFSET:N("spxo"),SUPERSCRIPT_EM_Y_OFFSET:N("spyo"),STRIKEOUT_SIZE:N("strs"),STRIKEOUT_OFFSET:N("stro"),UNDERLINE_SIZE:N("unds"),UNDERLINE_OFFSET:N("undo")};ot=class en{constructor(e){typeof e=="number"?this.ptr=u.hb_font_reference(e):(this.ptr=u.hb_font_create(e.ptr),this._face=e),Gt(this,u.hb_font_destroy)}get face(){return this._face||(this._face=new tn(u.hb_font_get_face(this.ptr))),this._face}subFont(){return new en(u.hb_font_create_sub_font(this.ptr))}hExtents(){let e=i.stackSave(),t=i.stackAlloc(48);u.hb_font_get_h_extents(this.ptr,t);let n={ascender:i.HEAP32[t/4],descender:i.HEAP32[t/4+1],lineGap:i.HEAP32[t/4+2]};return i.stackRestore(e),n}vExtents(){let e=i.stackSave(),t=i.stackAlloc(48);u.hb_font_get_v_extents(this.ptr,t);let n={ascender:i.HEAP32[t/4],descender:i.HEAP32[t/4+1],lineGap:i.HEAP32[t/4+2]};return i.stackRestore(e),n}glyphName(e){let t=i.stackSave(),n=256,s=i.stackAlloc(n);u.hb_font_glyph_to_string(this.ptr,e,s,n);let o=At(s);return i.stackRestore(t),o}drawGlyph(e,t,n){let s=Y(n);try{u.hb_font_draw_glyph(this.ptr,e,t.ptr,s)}finally{Ht(s)}}drawGlyphOrFail(e,t,n){let s=Y(n);try{return!!u.hb_font_draw_glyph_or_fail(this.ptr,e,t.ptr,s)}finally{Ht(s)}}paintGlyph(e,t,n,s=0,o={red:0,green:0,blue:0,alpha:255}){let a=Y(n);try{u.hb_font_paint_glyph(this.ptr,e,t.ptr,a,s,ge(o))}finally{Ht(a)}}paintGlyphOrFail(e,t,n,s=0,o={red:0,green:0,blue:0,alpha:255}){let a=Y(n);try{return!!u.hb_font_paint_glyph_or_fail(this.ptr,e,t.ptr,a,s,ge(o))}finally{Ht(a)}}getGlyphColorPng(e){let t=u.hb_ot_color_glyph_reference_png(this.ptr,e),n=u.hb_blob_get_length(t),s;if(n){let o=u.hb_blob_get_data(t,0);s=i.HEAPU8.slice(o,o+n)}return u.hb_blob_destroy(t),s}glyphToPath(e){let t=[];return this.drawGlyph(e,da(),t),t.join("")}glyphHAdvance(e){return u.hb_font_get_glyph_h_advance(this.ptr,e)}glyphVAdvance(e){return u.hb_font_get_glyph_v_advance(this.ptr,e)}glyphHOrigin(e){let t=i.stackSave(),n=i.stackAlloc(4),s=i.stackAlloc(4),o;return u.hb_font_get_glyph_h_origin(this.ptr,e,n,s)&&(o=[i.HEAP32[n/4],i.HEAP32[s/4]]),i.stackRestore(t),o}glyphVOrigin(e){let t=i.stackSave(),n=i.stackAlloc(4),s=i.stackAlloc(4),o;return u.hb_font_get_glyph_v_origin(this.ptr,e,n,s)&&(o=[i.HEAP32[n/4],i.HEAP32[s/4]]),i.stackRestore(t),o}glyphExtents(e){let t=i.stackSave(),n=i.stackAlloc(16),s;return u.hb_font_get_glyph_extents(this.ptr,e,n)&&(s={xBearing:i.HEAP32[n/4],yBearing:i.HEAP32[n/4+1],width:i.HEAP32[n/4+2],height:i.HEAP32[n/4+3]}),i.stackRestore(t),s}glyph(e,t=0){let n=i.stackSave(),s=i.stackAlloc(4),o;return u.hb_font_get_glyph(this.ptr,e,t,s)&&(o=i.HEAPU32[s/4]),i.stackRestore(n),o}nominalGlyph(e){let t=i.stackSave(),n=i.stackAlloc(4),s;return u.hb_font_get_nominal_glyph(this.ptr,e,n)&&(s=i.HEAPU32[n/4]),i.stackRestore(t),s}variationGlyph(e,t){let n=i.stackSave(),s=i.stackAlloc(4),o;return u.hb_font_get_variation_glyph(this.ptr,e,t,s)&&(o=i.HEAPU32[s/4]),i.stackRestore(n),o}glyphFromName(e){let t=i.stackSave(),n=i.stackAlloc(4),s=ra(e),o;return u.hb_font_get_glyph_from_name(this.ptr,s.ptr,s.length,n)&&(o=i.HEAPU32[n/4]),s.free(),i.stackRestore(t),o}glyphToJson(e){let t=[];return this.drawGlyph(e,ga(),t),t}setScale(e,t){u.hb_font_set_scale(this.ptr,e,t)}setVariations(e){let t=i.stackSave(),n=i.stackAlloc(8*e.length);e.forEach((s,o)=>{s.writeTo(n+o*8)}),u.hb_font_set_variations(this.ptr,n,e.length),i.stackRestore(t)}setFuncs(e){u.hb_font_set_funcs(this.ptr,e.ptr)}getLookupOpticalBound(e,t,n){return u.hb_ot_layout_lookup_get_optical_bound(this.ptr,e,t,n)}getLigatureCarets(e,t){let n=i.stackSave(),s=0,o=128,a=i.stackAlloc(4),l=i.stackAlloc(512),_=[];for(;o==128;){i.HEAPU32[a/4]=o,u.hb_ot_layout_get_ligature_carets(this.ptr,e,t,s,a,l),o=i.HEAPU32[a/4];let f=i.HEAP32.subarray(l/4,l/4+o);_.push(...Array.from(f)),s+=o}return i.stackRestore(n),_}getMetricPosition(e){let t=i.stackSave(),n=i.stackAlloc(4),s;return u.hb_ot_metrics_get_position(this.ptr,e,n)&&(s=i.HEAP32[n/4]),i.stackRestore(t),s}getMetricPositionWithFallback(e){let t=i.stackSave(),n=i.stackAlloc(4);u.hb_ot_metrics_get_position_with_fallback(this.ptr,e,n);let s=i.HEAP32[n/4];return i.stackRestore(t),s}getMetricVariation(e){return u.hb_ot_metrics_get_variation(this.ptr,e)}getMetricXVariation(e){return u.hb_ot_metrics_get_x_variation(this.ptr,e)}getMetricYVariation(e){return u.hb_ot_metrics_get_y_variation(this.ptr,e)}},ba=class{constructor(){this.ptr=u.hb_font_funcs_create(),Gt(this,u.hb_font_funcs_destroy)}setGlyphExtentsFunc(r){let e=i.addFunction((t,n,s,o,a)=>{let l=r(new ot(t),s);return l?(i.HEAP32[o/4]=l.xBearing,i.HEAP32[o/4+1]=l.yBearing,i.HEAP32[o/4+2]=l.width,i.HEAP32[o/4+3]=l.height,1):0},"ippipp");u.hb_font_funcs_set_glyph_extents_func(this.ptr,e,0,0)}setGlyphFromNameFunc(r){let e=i.addFunction((t,n,s,o,a,l)=>{let _=r(new ot(t),At(s,o));return _?(i.HEAPU32[a/4]=_,1):0},"ipppipp");u.hb_font_funcs_set_glyph_from_name_func(this.ptr,e,0,0)}setGlyphHAdvanceFunc(r){let e=i.addFunction((t,n,s,o)=>r(new ot(t),s),"ippip");u.hb_font_funcs_set_glyph_h_advance_func(this.ptr,e,0,0)}setGlyphVAdvanceFunc(r){let e=i.addFunction((t,n,s,o)=>r(new ot(t),s),"ippip");u.hb_font_funcs_set_glyph_v_advance_func(this.ptr,e,0,0)}setGlyphHOriginFunc(r){let e=i.addFunction((t,n,s,o,a,l)=>{let _=r(new ot(t),s);return _?(i.HEAP32[o/4]=_[0],i.HEAP32[a/4]=_[1],1):0},"ippippp");u.hb_font_funcs_set_glyph_h_origin_func(this.ptr,e,0,0)}setGlyphVOriginFunc(r){let e=i.addFunction((t,n,s,o,a,l)=>{let _=r(new ot(t),s);return _?(i.HEAP32[o/4]=_[0],i.HEAP32[a/4]=_[1],1):0},"ippippp");u.hb_font_funcs_set_glyph_v_origin_func(this.ptr,e,0,0)}setGlyphHKerningFunc(r){let e=i.addFunction((t,n,s,o,a)=>r(new ot(t),s,o),"ippiip");u.hb_font_funcs_set_glyph_h_kerning_func(this.ptr,e,0,0)}setGlyphNameFunc(r){let e=new TextEncoder,t=i.addFunction((n,s,o,a,l,_)=>{let f=r(new ot(n),o);return f?(e.encodeInto(f,i.HEAPU8.subarray(a,a+l)),1):0},"ippipip");u.hb_font_funcs_set_glyph_name_func(this.ptr,t,0,0)}setNominalGlyphFunc(r){let e=i.addFunction((t,n,s,o,a)=>{let l=r(new ot(t),s);return l?(i.HEAPU32[o/4]=l,1):0},"ippipp");u.hb_font_funcs_set_nominal_glyph_func(this.ptr,e,0,0)}setVariationGlyphFunc(r){let e=i.addFunction((t,n,s,o,a,l)=>{let _=r(new ot(t),s,o);return _?(i.HEAPU32[a/4]=_,1):0},"ippiipp");u.hb_font_funcs_set_variation_glyph_func(this.ptr,e,0,0)}setFontHExtentsFunc(r){let e=i.addFunction((t,n,s,o)=>{let a=r(new ot(t));return a?(i.HEAP32[s/4]=a.ascender,i.HEAP32[s/4+1]=a.descender,i.HEAP32[s/4+2]=a.lineGap,1):0},"ipppp");u.hb_font_funcs_set_font_h_extents_func(this.ptr,e,0,0)}setFontVExtentsFunc(r){let e=i.addFunction((t,n,s,o)=>{let a=r(new ot(t));return a?(i.HEAP32[s/4]=a.ascender,i.HEAP32[s/4+1]=a.descender,i.HEAP32[s/4+2]=a.lineGap,1):0},"ipppp");u.hb_font_funcs_set_font_v_extents_func(this.ptr,e,0,0)}};ma=class{constructor(){this.funcPtrs=[],this.userDataPtrs=[],this.ptr=u.hb_paint_funcs_create();let r=this.ptr,e=this.funcPtrs,t=this.userDataPtrs;be.register(this,()=>{u.hb_paint_funcs_destroy(r);for(let n of e)i.removeFunction(n);for(let n of t)Ht(n)})}setPushTransformFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_,f,p,b,m)=>r(a,l,_,f,p,b,C(o),C(m)),"viiffffffi");this.funcPtrs.push(n),u.hb_paint_funcs_set_push_transform_func(this.ptr,n,t,0)}setPopTransformFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a)=>r(C(o),C(a)),"viii");this.funcPtrs.push(n),u.hb_paint_funcs_set_pop_transform_func(this.ptr,n,t,0)}setColorGlyphFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_)=>r(a,new ot(l),C(o),C(_))?1:0,"iiiiii");this.funcPtrs.push(n),u.hb_paint_funcs_set_color_glyph_func(this.ptr,n,t,0)}setPushClipGlyphFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_)=>r(a,new ot(l),C(o),C(_)),"viiiii");this.funcPtrs.push(n),u.hb_paint_funcs_set_push_clip_glyph_func(this.ptr,n,t,0)}setPushClipRectangleFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_,f,p)=>r(a,l,_,f,C(o),C(p)),"viiffffi");this.funcPtrs.push(n),u.hb_paint_funcs_set_push_clip_rectangle_func(this.ptr,n,t,0)}setPopClipFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a)=>r(C(o),C(a)),"viii");this.funcPtrs.push(n),u.hb_paint_funcs_set_pop_clip_func(this.ptr,n,t,0)}setColorFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_)=>r(a!==0,ye(l),C(o),C(_)),"viiiii");this.funcPtrs.push(n),u.hb_paint_funcs_set_color_func(this.ptr,n,t,0)}setImageFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_,f,p,b,m)=>{let h=u.hb_blob_get_length(a),g=u.hb_blob_get_data(a,0),w=i.HEAPU8.subarray(g,g+h),A;return b&&(A={xBearing:i.HEAP32[b/4],yBearing:i.HEAP32[b/4+1],width:i.HEAP32[b/4+2],height:i.HEAP32[b/4+3]}),r(w,l,_,pt(f),A,C(o),C(m))?1:0},"iiiiiiifii");this.funcPtrs.push(n),u.hb_paint_funcs_set_image_func(this.ptr,n,t,0)}setLinearGradientFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_,f,p,b,m,h)=>r(de(a),l,_,f,p,b,m,C(o),C(h)),"viiiffffffi");this.funcPtrs.push(n),u.hb_paint_funcs_set_linear_gradient_func(this.ptr,n,t,0)}setRadialGradientFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_,f,p,b,m,h)=>r(de(a),l,_,f,p,b,m,C(o),C(h)),"viiiffffffi");this.funcPtrs.push(n),u.hb_paint_funcs_set_radial_gradient_func(this.ptr,n,t,0)}setSweepGradientFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_,f,p,b)=>r(de(a),l,_,f,p,C(o),C(b)),"viiiffffi");this.funcPtrs.push(n),u.hb_paint_funcs_set_sweep_gradient_func(this.ptr,n,t,0)}setPushGroupFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a)=>r(C(o),C(a)),"viii");this.funcPtrs.push(n),u.hb_paint_funcs_set_push_group_func(this.ptr,n,t,0)}setPopGroupFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l)=>r(a,C(o),C(l)),"viiii");this.funcPtrs.push(n),u.hb_paint_funcs_set_pop_group_func(this.ptr,n,t,0)}setCustomPaletteColorFunc(r,e){let t=Y(e);this.userDataPtrs.push(t);let n=i.addFunction((s,o,a,l,_)=>{let f=r(a,C(o),C(_));return f!==void 0?(i.HEAPU32[l/4]=ge(f),1):0},"iiiiii");this.funcPtrs.push(n),u.hb_paint_funcs_set_custom_palette_color_func(this.ptr,n,t,0)}},nn={INVALID:0,UNICODE:1,GLYPHS:2},rn={DEFAULT:0,NO_CLUSTERS:1,NO_POSITIONS:2,NO_GLYPH_NAMES:4,GLYPH_EXTENTS:8,GLYPH_FLAGS:16,NO_ADVANCES:32,DEFINED:63},ya={DEFAULT:0,BOT:1,EOT:2,PRESERVE_DEFAULT_IGNORABLES:4,REMOVE_DEFAULT_IGNORABLES:8,DO_NOT_INSERT_DOTTED_CIRCLE:16,VERIFY:32,PRODUCE_UNSAFE_TO_CONCAT:64,PRODUCE_SAFE_TO_INSERT_TATWEEL:128,DEFINED:255},Pa={INVALID:0,LTR:4,RTL:5,TTB:6,BTT:7},wa={MONOTONE_GRAPHEMES:0,MONOTONE_CHARACTERS:1,CHARACTERS:2,GRAPHEMES:3,DEFAULT:0},we={INVALID:0,TEXT:N("TEXT"),JSON:N("JSON")},Sa=class sn{constructor(e){e!=null?this.ptr=u.hb_buffer_reference(e):this.ptr=u.hb_buffer_create(),Gt(this,u.hb_buffer_destroy)}add(e,t){u.hb_buffer_add(this.ptr,e,t)}addText(e,t=0,n){let s=sa(e);u.hb_buffer_add_utf16(this.ptr,s.ptr,s.length,t,n??s.length),s.free()}addCodePoints(e,t=0,n){let s=u.malloc(e.length*4);i.HEAPU32.subarray(s/4,s/4+e.length).set(e),u.hb_buffer_add_codepoints(this.ptr,s,e.length,t,n??e.length),u.free(s)}guessSegmentProperties(){u.hb_buffer_guess_segment_properties(this.ptr)}setDirection(e){u.hb_buffer_set_direction(this.ptr,e)}setFlags(e){u.hb_buffer_set_flags(this.ptr,e)}setLanguage(e){let t=Ft(e);u.hb_buffer_set_language(this.ptr,u.hb_language_from_string(t.ptr,-1)),t.free()}setScript(e){let t=Ft(e);u.hb_buffer_set_script(this.ptr,u.hb_script_from_string(t.ptr,-1)),t.free()}setClusterLevel(e){u.hb_buffer_set_cluster_level(this.ptr,e)}reset(){u.hb_buffer_reset(this.ptr)}clearContents(){u.hb_buffer_clear_contents(this.ptr)}setMessageFunc(e){let t=(s,o,a,l)=>{let _=At(a);return e(new sn(s),new ot(o),_)?1:0},n=i.addFunction(t,"iiiii");u.hb_buffer_set_message_func(this.ptr,n,0,0)}getLength(){return u.hb_buffer_get_length(this.ptr)}getGlyphInfos(){let e=u.hb_buffer_get_glyph_infos(this.ptr,0),t=i.HEAPU32.subarray(e/4,e/4+this.getLength()*5),n=[];for(let s=0;s<t.length;s+=5)n.push({codepoint:t[s],cluster:t[s+2],flags:u.hb_glyph_info_get_glyph_flags(e+s*4)});return n}getGlyphPositions(){let e=u.hb_buffer_get_glyph_positions(this.ptr,0)/4;if(e==0)return[];let t=i.HEAP32.subarray(e,e+this.getLength()*5),n=[];for(let s=0;s<t.length;s+=5)n.push({xAdvance:t[s],yAdvance:t[s+1],xOffset:t[s+2],yOffset:t[s+3]});return n}getGlyphInfosAndPositions(){let e=u.hb_buffer_get_glyph_infos(this.ptr,0),t=i.HEAPU32.subarray(e/4,e/4+this.getLength()*5),n=u.hb_buffer_get_glyph_positions(this.ptr,0)/4,s=n?i.HEAP32.subarray(n,n+this.getLength()*5):void 0,o=[];for(let a=0;a<t.length;a+=5){let l={codepoint:t[a],cluster:t[a+2],flags:u.hb_glyph_info_get_glyph_flags(e+a*4)};for(let[_,f]of[["mask",1],["var1",3],["var2",4]])Object.defineProperty(l,_,{value:t[a+f],enumerable:!1});s&&(l.xAdvance=s[a],l.yAdvance=s[a+1],l.xOffset=s[a+2],l.yOffset=s[a+3],Object.defineProperty(l,"var",{value:s[a+4],enumerable:!1})),o.push(l)}return o}updateGlyphPositions(e){let t=u.hb_buffer_get_glyph_positions(this.ptr,0)/4;if(t==0)return;let n=Math.min(e.length,this.getLength()),s=i.HEAP32.subarray(t,t+n*5);for(let o=0;o<n;o++)s[o*5]=e[o].xAdvance,s[o*5+1]=e[o].yAdvance,s[o*5+2]=e[o].xOffset,s[o*5+3]=e[o].yOffset}serialize(e={}){let{font:t,start:n=0,end:s,format:o=we.TEXT,flags:a=0}=e,l=i.stackSave(),_=s??this.getLength(),f=32*1024,p=u.malloc(f),b=i.stackAlloc(4),m="";for(;n<_;){n+=u.hb_buffer_serialize(this.ptr,n,_,p,f,b,t?t.ptr:0,o,a);let h=i.HEAPU32[b/4];if(h==0)break;m+=At(p,h)}return u.free(p),i.stackRestore(l),m}getContentType(){return u.hb_buffer_get_content_type(this.ptr)}},Aa=class $t{static{this.GLOBAL_START=0}static{this.GLOBAL_END=4294967295}constructor(e,t=1,n=$t.GLOBAL_START,s=$t.GLOBAL_END){this.tag=e,this.value=t,this.start=n,this.end=s}static fromString(e){let t=i.stackSave(),n=i.stackAlloc(16),s=Ft(e),o;return u.hb_feature_from_string(s.ptr,-1,n)&&(o=new $t(pt(i.HEAPU32[n/4]),i.HEAPU32[n/4+1],i.HEAPU32[n/4+2],i.HEAPU32[n/4+3])),s.free(),i.stackRestore(t),o}toString(){let e=i.stackSave(),t=i.stackAlloc(16);this.writeTo(t);let n=128,s=i.stackAlloc(n);u.hb_feature_to_string(t,s,n);let o=At(s);return i.stackRestore(e),o}writeTo(e){i.HEAPU32[e/4]=N(this.tag),i.HEAPU32[e/4+1]=this.value,i.HEAPU32[e/4+2]=this.start,i.HEAPU32[e/4+3]=this.end}},va=class on{constructor(e,t=0){this.tag=e,this.value=t}static fromString(e){let t=i.stackSave(),n=i.stackAlloc(8),s=Ft(e),o;return u.hb_variation_from_string(s.ptr,-1,n)&&(o=new on(pt(i.HEAPU32[n/4]),i.HEAPF32[n/4+1])),s.free(),i.stackRestore(t),o}toString(){let e=i.stackSave(),t=i.stackAlloc(8);this.writeTo(t);let n=128,s=i.stackAlloc(n);u.hb_variation_to_string(t,s,n);let o=At(s);return i.stackRestore(e),o}writeTo(e){i.HEAPU32[e/4]=N(this.tag),i.HEAPF32[e/4+1]=this.value}},Bt={DONT_STOP:0,GSUB:1,GPOS:2};Ze=3,Ke=3;ea(await qe())});function $o(r,e){if(r.startsWith("/*",e)){let n=r.indexOf("*/",e+2);return n===-1?r.length:n+2}let t=r[e];if(t==='"'||t==="'"){for(let n=e+1;n<r.length;n++)if(r[n]==="\\")n++;else if(r[n]===t||r[n]===`
2
- `)return n+1;return r.length}return e}function jt(r){return r.replace(/\\(?:([0-9a-fA-F]{1,6})\s?|(\n)|(.))/gs,(e,t,n,s)=>t?String.fromCodePoint(Number.parseInt(t,16)||65533):n?"":s??"")}function le(r){let e=/^(["'])((?:\\.|(?!\1).)*)\1$/s.exec(r);if(e)return jt(e[2]);if(/^(?:-?[_a-zA-Z -\u{10ffff}\\][-\w -\u{10ffff}\\]*\s*)+$/u.test(r))return jt(r).replace(/\s+/g," ").trim()}function je(r,e=0){let t=[];for(let n of Vo(r)){let s=n.text,o=s.length-s.trimStart().length,a=e+n.start+o,l=a+s.trim().length,_=/^\s*(url|local)\(\s*(?:(["'])((?:\\.|(?!\2).)*)\2|([^)]*?))\s*\)\s*(.*)$/is.exec(s);if(!_)continue;let f=_[3]!==void 0?jt(_[3]):jt(_[4].trim());if(_[1].toLowerCase()==="local"){t.push({kind:"local",name:le(f)??f,start:a,end:l});continue}let p=/format\(\s*["']?([^"')]+)["']?\s*\)/i.exec(_[5]??"");t.push({kind:"url",url:f,...p?{format:p[1].toLowerCase()}:{},start:a,end:l})}return t}function Vo(r){let e=[],t=0,n=0;for(let s=0;s<=r.length;){let o=s<r.length?$o(r,s):s;if(o!==s){s=o;continue}let a=r[s];a==="("?t++:a===")"?t--:(s===r.length||a===","&&t<=0)&&(e.push({text:r.slice(n,s),start:n}),n=s+1),s++}return e}var Yo={normal:400,bold:700};function We(r){let e=(r??"normal").trim().toLowerCase().split(/\s+/);if(e[0]==="auto")return[400,400];let t=e.map(n=>Yo[n]??Number(n));if(!(t.length>2||t.some(n=>!Number.isFinite(n)||n<1||n>1e3)))return fe(t)}var qo={"ultra-condensed":50,"extra-condensed":62.5,condensed:75,"semi-condensed":87.5,normal:100,"semi-expanded":112.5,expanded:125,"extra-expanded":150,"ultra-expanded":200};function _e(r){let e=(r??"normal").trim().toLowerCase().split(/\s+/);if(e[0]==="auto")return[100,100];let t=e.map(n=>qo[n]??(n.endsWith("%")?Number(n.slice(0,-1)):Number.NaN));if(!(t.length>2||t.some(n=>!Number.isFinite(n)||n<=0)))return fe(t)}function ue(r){let e=(r??"normal").trim().toLowerCase().split(/\s+/);if(e[0]==="normal"||e[0]==="auto")return{kind:"normal"};if(e[0]==="italic"&&e.length===1)return{kind:"italic"};if(e[0]!=="oblique")return;if(e.length===1)return{kind:"oblique",angle:[14,14]};let t=e.slice(1).map(n=>n.endsWith("deg")?Number(n.slice(0,-3)):Number.NaN);if(!(t.length>2||t.some(n=>!Number.isFinite(n)||n<-90||n>90)))return{kind:"oblique",angle:fe(t)}}function fe(r){let[e,t=e]=r;return e<=t?[e,t]:[t,e]}function $e(r,e){if(r.length<=1)return[...r];let t=he(r,n=>n.stretch,e.stretch,e.stretch<=100?"down":"up");return t=Zo(t,e.style),t=he(t,n=>n.weight,e.weight,Xo(e.weight)),t}function he(r,e,t,n){let s=r.filter(l=>e(l)[0]<=t&&t<=e(l)[1]);if(s.length)return s;let o=l=>{let[_,f]=e(l),p=f<t,b=p?t-f:_-t;return n==="down"?p?b:1e6+b:n==="up"?p?1e6+b:b:!p&&_<=500?b:p?1e6+b:2e6+b},a=Number.POSITIVE_INFINITY;for(let l of r)a=Math.min(a,o(l));return r.filter(l=>o(l)===a)}function Xo(r){return r<400?"down":r>500?"up":"weight"}function Zo(r,e){let t=e.kind==="italic"?["italic","oblique","normal"]:e.kind==="oblique"?["oblique","italic","normal"]:["normal","oblique","italic"];for(let n of t){let s=r.filter(a=>a.style.kind===n);if(!s.length)continue;if(n!=="oblique")return s;let o=e.kind==="oblique"?e.angle[0]:14;return he(s,a=>a.style.kind==="oblique"?a.style.angle:[0,0],o,o>=0?"up":"down")}return[...r]}var Wt=class{constructor(e){this.measurer=e}measurer;families=new Map;async add(e,t,n={}){let s=t instanceof Uint8Array?t:new Uint8Array(t),o=this.measurer.loadFont(s);if(n.page!==!1&&typeof FontFace<"u"&&typeof document<"u"){let _={};n.weight&&(_.weight=n.weight),n.stretch&&(_.stretch=n.stretch),n.style&&(_.style=n.style);let f=new FontFace(e,s.slice().buffer,_);await f.load(),document.fonts.add(f)}let a=e.toLowerCase(),l=this.families.get(a)??[];return l.push({family:e,font:o,weight:We(n.weight)??[400,400],stretch:_e(n.stretch)??[100,100],style:ue(n.style)??{kind:"normal"}}),this.families.set(a,l),o}use(e,t,n={}){let s=e.toLowerCase(),o=this.families.get(s)??[];o.unshift({family:e,font:t,weight:n.weight??[400,400],stretch:n.stretch??[100,100],style:n.style??{kind:"normal"}}),this.families.set(s,o)}lookup(e,t){for(let n of Ko(e)){let s=this.families.get(n.toLowerCase());if(!s?.length)continue;if(!t||s.length===1)return s[0].font;let o=Number.parseFloat(t.fontWeight),a=t.fontStretch.endsWith("%")?Number.parseFloat(t.fontStretch):_e(t.fontStretch)?.[0]??100;return $e(s,{weight:Number.isFinite(o)?o:400,stretch:a,style:ue(t.fontStyle)??{kind:"normal"}})[0].font}}faces(){return[...this.families.values()].flat()}fallback(){for(let e of this.families.values())if(e.length)return e[0].font}};function Ko(r){let e=[];for(let t of r.matchAll(/\s*("((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|[^,]+)\s*(?:,|$)/g)){let n=(t[2]??t[3]??t[1]??"").trim();n&&e.push(n)}return e}var Ve={chromium:{engine:"chromium",sizeUnit:.015625,cffSizeUnit:.015625,opticalSize:"css-size",advanceUnit:0,layoutUnit:.015625},firefox:{engine:"firefox",sizeUnit:.015625,cffSizeUnit:.016666666666666666,opticalSize:"set-size",advanceUnit:.016666666666666666,layoutUnit:.016666666666666666},webkit:{engine:"webkit",sizeUnit:.015625,cffSizeUnit:.015625,opticalSize:"none",advanceUnit:0,layoutUnit:.015625}};function Ye(r){return/\bFirefox\//.test(r)?"firefox":/\bAppleWebKit\//.test(r)&&!/\b(Chrome|Chromium|HeadlessChrome)\//.test(r)?"webkit":"chromium"}function pe(){let r=globalThis.navigator?.userAgent??"";return Ve[Ye(r)]}function Ct(r,e,t){let n=t?r.cffSizeUnit:r.sizeUnit;return n?Math.round(e/n)*n:e}function xt(r,e){if(!r.advanceUnit)return e;let t=1/r.advanceUnit;return Math.round(Math.fround(Math.fround(e)*t))/t}var _n;function Ha(){return _n??=ln().then(()=>cn),_n}var Se=class{constructor(e,t,n){this.data=t;this.index=n;this.face=new e.Face(new e.Blob(t),n),this.upem=this.face.upem,this.cff=this.face.referenceTable("CFF ")!==void 0||this.face.referenceTable("CFF2")!==void 0;let s={};for(let[o,a]of Object.entries(this.face.getAxisInfos()))s[o]={min:a.min,default:a.default,max:a.max};this.axes=s}data;index;upem;cff;axes;face;cmap;codepoints(){return this.cmap??=new Set(this.face.collectUnicodes()),this.cmap}instances=new Map;outlines=new Map;outline(e,t,n){let s=`${n}|${Object.entries(t).sort(([a],[l])=>a<l?-1:1).join(",")}`,o=this.outlines.get(s);if(!o){let a=this.upem*64,l=[],_=0,f=0,p=0,b=0,m=(h,g)=>{l.push([_/a,f/a,h/a,g/a]),_=h,f=g};for(let{type:h,values:g}of this.instance(e,t).glyphToJson(n))if(h==="M")[_,f,p,b]=[g[0],g[1],g[0],g[1]];else if(h==="L")m(g[0],g[1]);else if(h==="Q"||h==="C"){let[w,A]=[_,f];for(let v=1;v<=8;v++){let k=v/8,S=1-k;h==="Q"?m(S*S*w+2*S*k*g[0]+k*k*g[2],S*S*A+2*S*k*g[1]+k*k*g[3]):m(S**3*w+3*S*S*k*g[0]+3*S*k*k*g[2]+k**3*g[4],S**3*A+3*S*S*k*g[1]+3*S*k*k*g[3]+k**3*g[5])}}else h==="Z"&&m(p,b);o=l,this.outlines.set(s,o)}return o}instance(e,t){let n=Object.entries(t).sort(([a],[l])=>a<l?-1:1),s=n.map(([a,l])=>`${a}=${l}`).join(","),o=this.instances.get(s);return o||(o=new e.Font(this.face),o.setScale(this.upem*64,this.upem*64),n.length&&o.setVariations(n.map(([a,l])=>new e.Variation(a,l))),this.instances.set(s,o)),o}},Yt=class r{constructor(e,t){this.hb=e;this.model=t}hb;model;static async create(e=pe()){return new r(await Ha(),e)}loadFont(e,t=0){return new Se(this.hb,e instanceof Uint8Array?e:new Uint8Array(e),t)}metrics(e,t){let n=e.instance(this.hb,t),s=e.upem*64,o=this.hb.MetricsTag,a=l=>n.getMetricPositionWithFallback(l)/s;return{ascender:a(o.HORIZONTAL_ASCENDER),descender:a(o.HORIZONTAL_DESCENDER),underlineOffset:a(o.UNDERLINE_OFFSET),underlineThickness:a(o.UNDERLINE_SIZE),strikeoutOffset:a(o.STRIKEOUT_OFFSET),strikeoutThickness:a(o.STRIKEOUT_SIZE)}}verticalOrigin(e,t,n){let s=e.instance(this.hb,t),o=e.upem*64,a=s.hExtents().ascender/o,l=e.face.referenceTable("VORG");if(l&&l.length>=8){let b=new DataView(l.buffer,l.byteOffset,l.byteLength),m=b.getUint16(6),h=0,g=m-1;for(;h<=g;){let w=h+g>>1,A=b.getUint16(8+w*4);if(A===n)return{origin:b.getInt16(10+w*4)/e.upem,ascender:a};A<n?h=w+1:g=w-1}return{origin:b.getInt16(4)/e.upem,ascender:a}}let _=e.face.referenceTable("vhea"),f=e.face.referenceTable("vmtx"),p=s.glyphExtents(n);if(_&&f&&p){let b=new DataView(_.buffer,_.byteOffset,_.byteLength).getUint16(34),m=new DataView(f.buffer,f.byteOffset,f.byteLength),h=n<b?n*4+2:b*4+(n-b)*2;if(h+2<=f.byteLength)return{origin:m.getInt16(h)/e.upem+p.yBearing/o,ascender:a}}return{origin:a,ascender:a}}glyphBounds(e,t,n){let s=e.instance(this.hb,t).glyphExtents(n);if(!s||!s.width&&!s.height)return;let o=e.upem*64;return[s.xBearing/o,(s.yBearing+s.height)/o,(s.xBearing+s.width)/o,s.yBearing/o]}inkBetween(e,t,n,s,o){let a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let[_,f,p,b]of e.outline(this.hb,t,n)){let m=Math.max(Math.min(f,b),s),h=Math.min(Math.max(f,b),o);if(m>h)continue;let g=f===b?[_,p]:[m,h].map(w=>_+(p-_)*(w-f)/(b-f));for(let w of g)a=Math.min(a,w),l=Math.max(l,w)}return a<=l?[a,l]:void 0}outline(e,t,n){let s=e.upem*64;return e.instance(this.hb,t).glyphToJson(n).map(o=>({type:o.type,values:o.values.map(a=>a/s)}))}shape(e,t,n,s={}){let{hb:o,model:a}=this,l=s.start??0,_=s.end??t.length,f=n.setSizePx??Ct(a,n.sizePx,e.cff),p={};for(let[R,x]of Object.entries(n.variations))R in e.axes&&(p[R]=x);n.opticalSizing&&"opsz"in e.axes&&!("opsz"in n.variations)&&(a.opticalSize==="css-size"?p.opsz=n.sizePx:a.opticalSize==="set-size"&&(p.opsz=f));let b=e.upem*64,m=e.instance(o,p),h=new o.Buffer;h.addText(t,l,_-l),h.guessSegmentProperties(),s.direction&&h.setDirection(o.Direction[s.direction==="ltr"?"LTR":s.direction==="rtl"?"RTL":"TTB"]),n.lang&&h.setLanguage(n.lang);let g=Object.entries(n.features).map(([R,x])=>new o.Feature(R,x));o.shape(m,h,g);let w=f/b,A=a.advanceUnit,v=R=>A?Math.round(R/A)*A:R,k=s.direction==="ttb",S=h.getGlyphPositions(),M=h.getGlyphInfos().map((R,x)=>{let F=S[x];return{id:R.codepoint,cluster:R.cluster,advance:v((k?-F.yAdvance:F.xAdvance)*w),offsetX:F.xOffset*w,offsetY:F.yOffset*w}});return new Ae(t,l,_,M,f,p,xt(a,n.letterSpacingPx),xt(a,n.wordSpacingPx))}},Ua=new Intl.Segmenter(void 0,{granularity:"grapheme"}),Ia=/[  ፡\u{10100}\u{10101}\u{1039f}\u{1091f}]/u,Ae=class{constructor(e,t,n,s,o,a,l,_){this.text=e;this.start=t;this.end=n;this.glyphs=s;this.setSize=o;this.variations=a;this.letterSpacing=l;this.wordSpacing=_;this.width=this.widthBetween(t,n)}text;start;end;glyphs;setSize;variations;letterSpacing;wordSpacing;width;widthBetween(e,t){let n=0;for(let s of this.glyphs)s.cluster>=e&&s.cluster<t&&(n+=s.advance);if(this.letterSpacing||this.wordSpacing)for(let{segment:s,index:o}of Ua.segment(this.text.slice(e,t)))n+=this.letterSpacing,Ia.test(s)&&(n+=this.wordSpacing);return n}};var Oa="hyphenation.txt";function un(r,e=Oa){let t=[],n=[],s=(a,l,_,f,p,b)=>n.push({severity:"error",code:f,message:p,fix:b,file:e,line:a,column:l,endLine:a,endColumn:l+_}),o;for(let[a,l]of r.split(/\r?\n/).entries()){let _=l.replace(/%.*$/,""),f=_.trim();if(!f)continue;let p=f.match(/^\[(.*)\]$/);if(p){let b=p[1].trim();if(!/^[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*$/.test(b)){s(a+1,_.indexOf("[")+1,f.length,"bad-language-tag",`"${b}" is not a language tag`,"name a language as BCP 47 does: [en-GB], [grc]"),o=void 0;continue}o=b;continue}for(let b of _.matchAll(/\S+/g)){let m=b[0];if(/^-|-$|--/.test(m)){s(a+1,b.index+1,m.length,"bad-hyphenation",`"${m}": a hyphen must be between two letters`,"mark each place a word may break with one hyphen between its letters: hy-phen-ation");continue}t.push(o===void 0?{word:m}:{word:m,lang:o})}}return{exceptions:t,problems:n}}var qt={af:{name:"Afrikaans",left:1,right:2,url:()=>new URL("./patterns/af.wasm",import.meta.url)},as:{name:"Assamese",left:1,right:1,url:()=>new URL("./patterns/as.wasm",import.meta.url)},be:{name:"Belarusian",left:2,right:2,url:()=>new URL("./patterns/be.wasm",import.meta.url)},bg:{name:"Bulgarian",left:2,right:2,url:()=>new URL("./patterns/bg.wasm",import.meta.url)},bn:{name:"Bengali",left:1,right:1,url:()=>new URL("./patterns/bn.wasm",import.meta.url)},ca:{name:"Catalan",left:2,right:2,url:()=>new URL("./patterns/ca.wasm",import.meta.url)},cy:{name:"Welsh",left:2,right:3,url:()=>new URL("./patterns/cy.wasm",import.meta.url)},da:{name:"Danish",left:2,right:2,url:()=>new URL("./patterns/da.wasm",import.meta.url)},de:{name:"German, reformed spelling",left:2,right:2,url:()=>new URL("./patterns/de.wasm",import.meta.url)},"el-monoton":{name:"Modern Greek, monotonic spelling",left:1,right:1,url:()=>new URL("./patterns/el-monoton.wasm",import.meta.url)},"el-polyton":{name:"Modern Greek, polytonic spelling",left:1,right:1,url:()=>new URL("./patterns/el-polyton.wasm",import.meta.url)},"en-gb":{name:"English, British spelling",left:2,right:3,url:()=>new URL("./patterns/en-gb.wasm",import.meta.url)},"en-us":{name:"English, American spelling",left:2,right:3,url:()=>new URL("./patterns/en-us.wasm",import.meta.url)},eo:{name:"Esperanto",left:2,right:2,url:()=>new URL("./patterns/eo.wasm",import.meta.url)},es:{name:"Spanish",left:2,right:2,url:()=>new URL("./patterns/es.wasm",import.meta.url)},et:{name:"Estonian",left:2,right:3,url:()=>new URL("./patterns/et.wasm",import.meta.url)},eu:{name:"Basque",left:2,right:2,url:()=>new URL("./patterns/eu.wasm",import.meta.url)},"fi-x-school":{name:"Finnish, school hyphenation",left:1,right:1,url:()=>new URL("./patterns/fi-x-school.wasm",import.meta.url)},fr:{name:"French",left:2,right:2,url:()=>new URL("./patterns/fr.wasm",import.meta.url)},fur:{name:"Friulan",left:2,right:2,url:()=>new URL("./patterns/fur.wasm",import.meta.url)},ga:{name:"Irish",left:2,right:3,url:()=>new URL("./patterns/ga.wasm",import.meta.url)},gl:{name:"Galician",left:2,right:2,url:()=>new URL("./patterns/gl.wasm",import.meta.url)},gu:{name:"Gujarati",left:1,right:1,url:()=>new URL("./patterns/gu.wasm",import.meta.url)},hi:{name:"Hindi",left:1,right:1,url:()=>new URL("./patterns/hi.wasm",import.meta.url)},hr:{name:"Croatian",left:2,right:2,url:()=>new URL("./patterns/hr.wasm",import.meta.url)},hsb:{name:"Upper Sorbian",left:2,right:2,url:()=>new URL("./patterns/hsb.wasm",import.meta.url)},ia:{name:"Interlingua",left:2,right:2,url:()=>new URL("./patterns/ia.wasm",import.meta.url)},is:{name:"Icelandic",left:2,right:2,url:()=>new URL("./patterns/is.wasm",import.meta.url)},it:{name:"Italian",left:2,right:2,url:()=>new URL("./patterns/it.wasm",import.meta.url)},ka:{name:"Georgian",left:1,right:2,url:()=>new URL("./patterns/ka.wasm",import.meta.url)},kmr:{name:"Kurmanji, Northern Kurdish",left:2,right:2,url:()=>new URL("./patterns/kmr.wasm",import.meta.url)},kn:{name:"Kannada",left:1,right:1,url:()=>new URL("./patterns/kn.wasm",import.meta.url)},la:{name:"Latin",left:2,right:2,url:()=>new URL("./patterns/la.wasm",import.meta.url)},lt:{name:"Lithuanian",left:2,right:2,url:()=>new URL("./patterns/lt.wasm",import.meta.url)},ml:{name:"Malayalam",left:1,right:1,url:()=>new URL("./patterns/ml.wasm",import.meta.url)},"mn-cyrl":{name:"Mongolian, Cyrillic script",left:2,right:2,url:()=>new URL("./patterns/mn-cyrl.wasm",import.meta.url)},mr:{name:"Marathi",left:1,right:1,url:()=>new URL("./patterns/mr.wasm",import.meta.url)},nb:{name:"Norwegian Bokm\xE5l, bokm\xE5l, norsk bokm\xE5l",left:2,right:2,url:()=>new URL("./patterns/nb.wasm",import.meta.url)},nl:{name:"Dutch",left:2,right:2,url:()=>new URL("./patterns/nl.wasm",import.meta.url)},nn:{name:"Norwegian Nynorsk, nynorsk",left:2,right:2,url:()=>new URL("./patterns/nn.wasm",import.meta.url)},no:{name:"Norwegian, norsk",left:2,right:2,url:()=>new URL("./patterns/no.wasm",import.meta.url)},oc:{name:"Occitan",left:2,right:2,url:()=>new URL("./patterns/oc.wasm",import.meta.url)},or:{name:"Odia, Oriya",left:1,right:1,url:()=>new URL("./patterns/or.wasm",import.meta.url)},pa:{name:"Panjabi, Punjabi",left:1,right:1,url:()=>new URL("./patterns/pa.wasm",import.meta.url)},pi:{name:"P\u0101li",left:1,right:2,url:()=>new URL("./patterns/pi.wasm",import.meta.url)},pl:{name:"Polish",left:2,right:2,url:()=>new URL("./patterns/pl.wasm",import.meta.url)},pms:{name:"Piedmontese",left:2,right:2,url:()=>new URL("./patterns/pms.wasm",import.meta.url)},pt:{name:"Portuguese",left:2,right:3,url:()=>new URL("./patterns/pt.wasm",import.meta.url)},rm:{name:"Romansh",left:2,right:2,url:()=>new URL("./patterns/rm.wasm",import.meta.url)},ru:{name:"Russian",left:2,right:2,url:()=>new URL("./patterns/ru.wasm",import.meta.url)},"sh-cyrl":{name:"Serbocroatian, Cyrillic script",left:2,right:2,url:()=>new URL("./patterns/sh-cyrl.wasm",import.meta.url)},"sh-latn":{name:"Serbocroatian, Latin script",left:2,right:2,url:()=>new URL("./patterns/sh-latn.wasm",import.meta.url)},sk:{name:"Slovak",left:2,right:3,url:()=>new URL("./patterns/sk.wasm",import.meta.url)},sl:{name:"Slovenian",left:2,right:2,url:()=>new URL("./patterns/sl.wasm",import.meta.url)},sq:{name:"Albanian",left:2,right:2,url:()=>new URL("./patterns/sq.wasm",import.meta.url)},sv:{name:"Swedish",left:2,right:2,url:()=>new URL("./patterns/sv.wasm",import.meta.url)},ta:{name:"Tamil",left:1,right:1,url:()=>new URL("./patterns/ta.wasm",import.meta.url)},te:{name:"Telugu",left:1,right:1,url:()=>new URL("./patterns/te.wasm",import.meta.url)},th:{name:"Thai",left:2,right:3,url:()=>new URL("./patterns/th.wasm",import.meta.url)},tk:{name:"Turkmen",left:2,right:2,url:()=>new URL("./patterns/tk.wasm",import.meta.url)},tr:{name:"Turkish",left:2,right:2,url:()=>new URL("./patterns/tr.wasm",import.meta.url)},uk:{name:"Ukrainian",left:2,right:2,url:()=>new URL("./patterns/uk.wasm",import.meta.url)},"zh-latn-pinyin":{name:"Mandarin Chinese, pinyin transliteration",left:1,right:2,url:()=>new URL("./patterns/zh-latn-pinyin.wasm",import.meta.url)}};var Na={left:2,right:3},Ma=/[-­‐-—]/,Ca=/\p{L}/u,Da=61,Ba="\xAD",Ga={en:"en-us","en-au":"en-gb","en-ie":"en-gb","en-in":"en-gb","en-nz":"en-gb","en-za":"en-gb",el:"el-monoton",mn:"mn-cyrl",sh:"sh-latn","sr-latn":"sh-latn","sr-cyrl":"sh-cyrl"};function Xt(r){let e=r.trim().toLowerCase().replaceAll("_","-");for(;e;){if(Object.hasOwn(qt,e))return e;let t=Ga[e];if(t)return t;let n=e.lastIndexOf("-");e=n<0?"":e.slice(0,n)}}function Zt(r){let e=Xt(r),t=e===void 0?void 0:qt[e];return t?{left:t.left,right:t.right}:Na}async function za(r){let e=r instanceof Response?await r.arrayBuffer():r,{instance:t}=await WebAssembly.instantiate(e),n=t.exports,s=new Set(String.fromCharCode(...new Uint16Array(n.mem.buffer,1664,n.lct.value))),o=45;return{alphabet:s,hyphenate(a,l){let _=new Uint16Array(n.mem.buffer,0,64);for(let h=0;h<a.length;h++)_[h]=a.charCodeAt(h);_[a.length]=0;let f=n.hyphenate(l.left,l.right,o),p=[];if(f<=0)return p;let b=new Uint16Array(n.mem.buffer,0,f),m=0;for(let h of b)h===o?p.push(m):m++;return p}}}var Kt=class{loader;engines;loading;exceptions=new Map;constructor(e={}){let t=e.patterns;this.loader=t?.loader??e.load??(n=>fetch(n)),this.engines=t?.engines??new Map,this.loading=t?.loading??new Map}async load(...e){let t=new Set(e.map(Xt).filter(n=>n!==void 0));await Promise.all([...t].map(n=>this.engine(n)))}async prepare(e){let t=[e.closest("[lang]")?.getAttribute("lang")??""];for(let n of e.querySelectorAll("[lang]"))t.push(n.getAttribute("lang")??"");await this.load(...t)}ready(e){let t=Xt(e);return t===void 0||this.engines.has(t)}engine(e){let t=this.loading.get(e);if(!t){let n=qt[e];t=Promise.resolve().then(()=>this.loader(n.url(),e)).then(za).then(s=>(this.engines.set(e,s),s)),t.catch(()=>this.loading.delete(e)),this.loading.set(e,t)}return t}addExceptions(e){for(let{word:t,lang:n}of e){let s=n?.toLowerCase()??"",o=this.exceptions.get(s);o||this.exceptions.set(s,o=new Map);let a=[],l="";for(let _ of t)_==="-"?a.push(l.length):l+=_.toLowerCase();o.set(l,a)}}exception(e,t){let n=t.toLowerCase();for(;;){let s=this.exceptions.get(n)?.get(e);if(s)return s;if(!n)return;let o=n.lastIndexOf("-");n=o<0?"":n.slice(0,o)}}points(e,t,n=Zt(t)){if(Ma.test(e))return[];let s=Xt(t),o;if(s!==void 0&&(o=this.engines.get(s),!o))throw new Error(`hyphenation: the patterns for ${t} (${s}) aren't loaded: await hyphenator.load('${t}')`);let a=h=>h.toLowerCase().length===1&&Ca.test(h),l=0;for(;l<e.length&&!a(e[l]);)l++;let _=l;for(;_<e.length&&a(e[_]);)_++;let f=_-l;if(f===0||f>Da||f<n.left+n.right)return[];let p=Array.from(e.slice(l,_),h=>h.toLowerCase()).join(""),b=o&&[...p].every(h=>o.alphabet.has(h))?o:void 0;return(this.exception(p,t)??b?.hyphenate(p,n)??[]).filter(h=>h>=n.left&&f-h>=n.right).map(h=>l+h)}hyphenateText(e,t,n=Zt(t)){return e.replace(/[^\s]+/g,s=>{let o=this.points(s,t,n);if(!o.length)return s;let a="",l=0;for(let _ of o)a+=s.slice(l,_)+Ba,l=_;return a+s.slice(l)})}};function yt(r){return{type:"box",width:r}}function vt(r,e=0,t=!1){return{type:"penalty",width:e,penalty:r,flagged:t}}function fn(r,e=50){return{type:"penalty",width:r,penalty:e,flagged:!0,auto:!0}}var ja={width:0,stretch:1,shrink:0,stretchOrder:1};function hn(r,e=ja){let t=r.at(-1)?.type==="glue"?r.slice(0,-1):r.slice();return t.push(vt(1e4),{type:"glue",...e},vt(-1e4)),t}var Tt=1e4,bt={VeryLoose:0,Loose:1,Decent:2,Tight:3},Ee={tolerance:200,pretolerance:100,linePenalty:10,adjDemerits:1e4,doubleHyphenDemerits:1e4,finalHyphenDemerits:5e3,emergencyStretch:0,looseness:0,leftSkip:{width:0,stretch:0,shrink:0},rightSkip:{width:0,stretch:0,shrink:0},hbadness:1e3},dt=1073741823,Ut=-1e4,ve=Number.MAX_SAFE_INTEGER;function Jt(r,e){if(r===0)return 0;if(e<=0)return Tt;let t;return r<=7230584?t=Math.floor(r*297/e):e>=1663497?t=Math.floor(r/Math.floor(e/297)):t=r,t>1290?Tt:Math.floor((t*t*t+131072)/262144)}var Qt=class{width;stretch;shrink;constructor(e){let t=e.length+1;this.width=new Float64Array(t),this.stretch=[new Float64Array(t),new Float64Array(t),new Float64Array(t),new Float64Array(t)],this.shrink=new Float64Array(t);for(let n=0;n<e.length;n++){let s=e[n];this.width[n+1]=this.width[n]+(s.type==="penalty"?0:s.width);for(let o=0;o<4;o++){let a=s.type==="glue"&&(s.stretchOrder??0)===o?s.stretch:0;this.stretch[o][n+1]=this.stretch[o][n]+a}this.shrink[n+1]=this.shrink[n]+(s.type==="glue"?s.shrink:0)}}};function pn(r){if(typeof r=="number")return{width:()=>r,lastSpecialLine:0};if(typeof r=="function")return{width:r,lastSpecialLine:1/0};if(r.length===0)throw new RangeError("measure: an array of line widths needs at least one");return{width:e=>r[Math.min(e,r.length)-1],lastSpecialLine:r.length-1}}function dn(r){let e=r.length,t=new Int32Array(e+1);t[e]=e;for(let n=e-1;n>=0;n--)t[n]=r[n].type==="box"?n:t[n+1];return t}function gn({leftSkip:r,rightSkip:e}){return{width:r.width+e.width,stretch:[0,1,2,3].map(t=>((r.stretchOrder??0)===t?r.stretch:0)+((e.stretchOrder??0)===t?e.stretch:0)),shrink:r.shrink+e.shrink}}function bn(r,e,t){let n={...Ee,...yn(t)},s=r.length-1,o=null,a=0;for(let _ of[...e.filter(f=>f<s),s])o={serial:++a,at:_,previous:o,fitness:bt.Decent,total:0};let l={start:0,line:a+1,fitness:bt.Decent,hyphenated:!1,total:0,passive:o};return Pn(r,new Qt(r),dn(r),l,pn(t.measure).width,n.hbadness,gn(n),"given",0,void 0)}function mn(r,e){let t={...Ee,...yn(e)},n=r.at(-1);if(n?.type!=="penalty"||n.penalty>Ut)throw new RangeError("breakLines: the paragraph must end with a forced break (see finishParagraph)");let s=r.length,o=s-1,a=new Qt(r),{width:l,lastSpecialLine:_}=pn(e.measure),f=t.looseness===0?_:ve,p=Number.isFinite(_)?l(_+1):0,b=e.trace?[]:void 0,m=dn(r),h=gn(t),g=0,w=t.pretolerance,A,v,k;for(w>=0?(A=!1,v=!1,k="first"):(w=t.tolerance,A=!0,v=t.emergencyStretch<=0,k="second");;){w>Tt&&(w=Tt),b?.push({type:"pass",pass:k});let S=0,M=[{start:0,line:1,fitness:bt.Decent,hyphenated:!1,total:0,passive:null}],R=(F,L,D)=>{if(L>=1e4)return;L<=Ut&&(L=Ut);let $=F===o,z=r[F],O=z.type==="penalty"?z.width:0,G=[dt,dt,dt,dt],q=[null,null,null,null],nt=[0,0,0,0],st=dt,gt=0,kt=0,Q=tt=>{let ct=Math.abs(t.adjDemerits);st=ct>=dt-st?dt-1:st+ct;for(let j=0;j<4;j++){if(G[j]<=st){let at={serial:++S,at:F,previous:q[j],fitness:j,total:G[j]},ut={start:m[F],line:nt[j]+1,fitness:j,hyphenated:D,total:G[j],passive:at};M.splice(tt++,0,ut),b?.push({type:"break",serial:at.serial,at:F,line:nt[j],fitness:j,hyphenated:D,total:G[j],previous:at.previous?.serial??0})}G[j]=dt}return st=dt,tt},J=0;for(;;){let tt=M[J],ct=tt?tt.line:ve;if(ct>gt){if(st<dt&&(gt!==f||!tt)&&(J=Q(J)),!tt)return;ct>f?(kt=p,gt=ve-1):(gt=ct,kt=l(ct))}if(!tt)return;let j=tt.start,at=a.width[F]-a.width[j]+h.width+O,ut=a.stretch[0][F]-a.stretch[0][j]+h.stretch[0]+g,It=a.stretch[1][F]-a.stretch[1][j]+h.stretch[1]!==0||a.stretch[2][F]-a.stretch[2][j]+h.stretch[2]!==0||a.stretch[3][F]-a.stretch[3][j]+h.stretch[3]!==0,d=a.shrink[F]-a.shrink[j]+h.shrink,y=kt-at,T,P;y>0?It?(T=0,P=bt.Decent):y>7230584&&ut<1663497?(T=Tt,P=bt.VeryLoose):(T=Jt(y,ut),P=T>99?bt.VeryLoose:T>12?bt.Loose:bt.Decent):(T=-y>d?Tt+1:Jt(-y,d),P=T>12?bt.Tight:bt.Decent);let U=!1,I;if(T>Tt||L===Ut){if(v&&st===dt&&M.length===1)U=!0;else if(T>w){M.splice(J,1);continue}I=!1}else{if(T>w){J++;continue}I=!0}let H=0;U||(H=t.linePenalty+T,H=Math.abs(H)>=1e4?1e8:H*H,L!==0&&(L>0?H+=L*L:L>Ut&&(H-=L*L)),D&&tt.hyphenated&&(H+=$?t.finalHyphenDemerits:t.doubleHyphenDemerits),Math.abs(P-tt.fitness)>1&&(H+=t.adjDemerits)),b?.push({type:"feasible",at:F,kind:$?"par":z.type==="penalty"?z.flagged?"discretionary":"penalty":"glue",via:tt.passive?.serial??0,badness:T,penalty:L,demerits:U?null:H}),H+=tt.total,H<=G[P]&&(G[P]=H,q[P]=tt.passive,nt[P]=ct,H<st&&(st=H)),I?J++:M.splice(J,1)}},x=!1;for(let F=0;F<s&&M.length>0;F++){let L=r[F];F===o?(R(F,L.type==="penalty"?L.penalty:Ut,!0),x=!0):L.type==="glue"?F>0&&r[F-1].type==="box"&&R(F,0,!1):L.type==="penalty"&&(A||!L.auto)&&R(F,L.penalty,L.flagged)}if(x&&M.length>0){let F=M[0];for(let D of M)D.total<F.total&&(F=D);let L=0;if(t.looseness!==0){let D=F.line;for(let $ of M){let z=$.line-D;z<L&&t.looseness<=z||z>L&&t.looseness>=z?(F=$,L=z):z===L&&$.total<F.total&&(F=$)}}if(L===t.looseness||v)return Pn(r,a,m,F,l,t.hbadness,h,k,L,b)}A?(g+=t.emergencyStretch,v=!0,k="emergency"):(w=t.tolerance,A=!0,v=t.emergencyStretch<=0,k="second")}}function yn(r){let e={};for(let[t,n]of Object.entries(r))n!==void 0&&t in Ee&&(e[t]=n);return e}function Pn(r,e,t,n,s,o,a,l,_,f){let p=[];for(let w=n.passive;w;w=w.previous)p.push(w);p.reverse();let b=[],m=0,h=0,g=r.length-1;for(let[w,A]of p.entries()){let v=A.at,k=r[v],S=k.type==="penalty"?k.width:0,M=e.width[v]-e.width[m]+a.width+S,R=e.stretch.map((q,nt)=>q[v]-q[m]+a.stretch[nt]),x=e.shrink[v]-e.shrink[m]+a.shrink,F=s(w+1),L=F-M,D=0,$=0,z=0,O=0,G=!1;if(L>0){$=R[3]!==0?3:R[2]!==0?2:R[1]!==0?1:0;let q=R[$];D=q!==0?L/q:0,$===0&&(z=Jt(L,q),G=z>o)}else L<0&&(x<-L?(O=-L-x,D=x>0?-1:0,z=1e6):(D=L/x,z=Jt(-L,x)));b.push({start:m,end:v,measure:F,width:M,stretch:R[0],shrink:x,ratio:D,glueOrder:$,badness:z,fitness:A.fitness,demerits:A.total-h,hyphenated:v!==g&&k.type==="penalty"&&k.flagged,overfull:O,underfull:G}),h=A.total,m=t[v]}return{breaks:p.map(w=>w.at),lines:b,demerits:n.total,pass:l,looseness:_,...f?{trace:f}:{}}}function te(r,e=""){let t=m=>r.getPropertyValue(m).trim(),n=Sn(t("font-size"))??16,s={},o={};t("font-kerning")==="none"&&(s.kern=0);let a=wn(t("letter-spacing"),n);if(a!==0)for(let m of["liga","clig","dlig","hlig","calt"])s[m]=0;for(let m of t("font-variant-ligatures").split(/\s+/)){let h=Wa[m];h&&Object.assign(s,h)}for(let m of t("font-variant-caps").split(/\s+/))for(let h of $a[m]??[])s[h]=1;for(let m of t("font-variant-numeric").split(/\s+/)){let h=Va[m];h&&(s[h]=1)}for(let m of t("font-variant-east-asian").split(/\s+/)){let h=Ya[m];h&&(s[h]=1)}let l=qa[t("font-variant-position")];l&&(s[l]=1),/\bhistorical-forms\b/.test(t("font-variant-alternates"))&&(s.hist=1);let _=Number.parseFloat(t("font-weight"));o.wght=Number.isFinite(_)?_:400;let f=t("font-stretch");o.wdth=f.endsWith("%")?Number.parseFloat(f):Xa[f]??100;let p=t("font-style");p==="italic"&&(o.ital=1);let b=/^oblique\s+(-?[\d.]+)deg$/.exec(p);return b?o.slnt=-Number.parseFloat(b[1]):p==="oblique"&&(o.slnt=-14),Object.assign(o,Re(t("font-variation-settings"),"variation")),Object.assign(s,Re(t("font-feature-settings"),"feature")),{sizePx:n,features:s,variations:o,opticalSizing:t("font-optical-sizing")!=="none",letterSpacingPx:a,wordSpacingPx:wn(t("word-spacing"),n),lang:e||"",direction:t("direction")==="rtl"?"rtl":"ltr"}}var Wa={none:{liga:0,clig:0,dlig:0,hlig:0,calt:0},"common-ligatures":{liga:1,clig:1},"no-common-ligatures":{liga:0,clig:0},"discretionary-ligatures":{dlig:1},"no-discretionary-ligatures":{dlig:0},"historical-ligatures":{hlig:1},"no-historical-ligatures":{hlig:0},contextual:{calt:1},"no-contextual":{calt:0}},$a={"small-caps":["smcp"],"all-small-caps":["smcp","c2sc"],"petite-caps":["pcap"],"all-petite-caps":["pcap","c2pc"],unicase:["unic"],"titling-caps":["titl"]},Va={"lining-nums":"lnum","oldstyle-nums":"onum","proportional-nums":"pnum","tabular-nums":"tnum","diagonal-fractions":"frac","stacked-fractions":"afrc",ordinal:"ordn","slashed-zero":"zero"},Ya={jis78:"jp78",jis83:"jp83",jis90:"jp90",jis04:"jp04",simplified:"smpl",traditional:"trad","full-width":"fwid","proportional-width":"pwid",ruby:"ruby"},qa={sub:"subs",super:"sups"},Xa={"ultra-condensed":50,"extra-condensed":62.5,condensed:75,"semi-condensed":87.5,normal:100,"semi-expanded":112.5,expanded:125,"extra-expanded":150,"ultra-expanded":200};function Sn(r){let e=/^(-?[\d.]+(?:e-?\d+)?)px$/.exec(r);return e?Number.parseFloat(e[1]):void 0}function wn(r,e){if(r===""||r==="normal")return 0;let t=Sn(r);if(t!==void 0)return t;let n=/^(-?[\d.]+)em$/.exec(r);return n?Number.parseFloat(n[1])*e:0}function Re(r,e){let t={};if(!r||r==="normal")return t;for(let n of r.split(",")){let s=/^\s*["']([\x20-\x7e]{4})["']\s*(on|off|-?[\d.]+)?\s*$/.exec(n);if(!s)continue;let o=s[2];t[s[1]]=o===void 0?e==="feature"?1:0:o==="on"?1:o==="off"?0:Number.parseFloat(o)}return t}var An=new WeakMap;function Fe(r,e,t,n,s){let o=s.replace(/\s+/g," ").trim().slice(0,200)||"Hamburgefonstiv",a=JSON.stringify([n.sizePx,n.variations,n.features,n.opticalSizing,n.letterSpacingPx,n.lang,o.length<200?o:""]),l=An.get(t);l||An.set(t,l=new Map);let _=l.get(a);if(_!==void 0)return _;let f=document.createElement("span");f.setAttribute("aria-hidden","true"),f.style.cssText="position:absolute;visibility:hidden;white-space:pre;word-spacing:0;text-indent:0;text-transform:none;text-rendering:geometricPrecision;left:0;top:0",f.textContent=o,e.append(f);let p=f.getBoundingClientRect().width;f.remove();let b={...n,wordSpacingPx:0};delete b.setSizePx;let m=n.sizePx*64,h=new Set([n.sizePx,Ct(r.model,n.sizePx,t.cff)]);for(let A=Math.floor(m)-1;A<=Math.ceil(m)+1;A++)h.add(A/64);let g=n.sizePx,w=Number.POSITIVE_INFINITY;for(let A of h){let v=Math.abs(r.shape(t,o,{...b,setSizePx:A}).width-p);v<w&&(g=A,w=v)}return l.set(a,g),g}var vn="0.333em plus 0.167em minus 0.111em";var Za={fil:1,fill:2,filll:3};function kn(r,e){let t=/^\s*(\S+)(?:\s+plus\s+(\S+))?(?:\s+minus\s+(\S+))?\s*$/.exec(r);if(!t)throw new Error(`not glue: ${JSON.stringify(r)}`);let n=Lt(t[1],e),s=0,o=0;if(t[2]){let l=/^(-?[\d.]+)(filll|fill|fil)$/.exec(t[2]);l?(s=Number.parseFloat(l[1]),o=Za[l[2]]):s=Lt(t[2],e)}let a=t[3]?Lt(t[3],e):0;return o?{width:n,stretch:s,shrink:a,stretchOrder:o}:{width:n,stretch:s,shrink:a}}var Ka={px:1,pt:4/3,pc:16,in:96,cm:96/2.54,mm:96/25.4,q:96/101.6};function Lt(r,e){let t=/^(-?(?:\d+\.?\d*|\.\d+)(?:e-?\d+)?)([a-z]*)$/i.exec(r.trim());if(!t)throw new Error(`not a length: ${JSON.stringify(r)}`);let n=Number.parseFloat(t[1]),s=t[2].toLowerCase();if(s==="em")return n*e;if(s===""&&n===0)return 0;let o=Ka[s];if(o===void 0)throw new Error(`unknown unit in ${JSON.stringify(r)}`);return n*o}var zt="\xAD",Ja="\uFFFC",Qa=/[\p{Pe}\p{Pf}"']/u,ti=/[-‐–]/,ei=/^[(<\[]?(?:[a-z][a-z0-9+.-]*:\/\/|www\.)/i;function ni(r,e,t){let n=r[e];return n!=="/"&&n!=="."||e+1>=t||!/[\p{L}\p{N}_~%-]/u.test(r[e+1])?!1:n==="."||r[e-1]!=="/"&&r[e+1]!=="/"}function Rn(r,e){let t=e.fonts.measurer,n=t.model,s=getComputedStyle(r),o=e.shape?.length?e.shape:void 0,a=o?o.map(d=>d.measure):e.measure??_i(r,s),l=d=>o?o[Math.min(d,o.length-1)]:{measure:a,left:0},_=ai(s),f=_.body==="justify",p=ci(_,Number.parseFloat(s.fontSize)),b=s.getPropertyValue("--pw-line-breaking").trim()==="browser",{segments:m,atoms:h,text:g,migrated:w}=gi(r,e),A=new Map(h.map(d=>[d.at,d])),v=d=>m.find(y=>d>=y.start&&d<y.end)??m.at(-1),k=(d,y)=>{let T=0;for(let P of m)P.end>d&&P.start<y&&(T+=P.run.widthBetween(Math.max(d,P.start),Math.min(y,P.end)));for(let P of h)P.at>=d&&P.at<y&&(T+=P.width);return T},S=d=>{let y=v(d);return y.run.widthBetween(d,d+1)-y.run.wordSpacing},M=[],R=[],x=(d,y)=>{M.push(d),R.push(y)},F=Lt(s.getPropertyValue("text-indent")||"0px",Number.parseFloat(s.fontSize));F&&x(yt(F),{kind:"box",start:0,end:0});let L=ne(s,"--pw-hyphen-penalty",50),D=ne(s,"--pw-ex-hyphen-penalty",50),$=(d,y)=>{if(!e.hyphenator)return[];let T=v(d);if(Te(T.computed)!=="auto")return[];let P=T.style.lang,U=Zt(P),I=ne(T.computed,"--pw-left-hyphen-min",U.left),H=ne(T.computed,"--pw-right-hyphen-min",U.right);return e.hyphenator.points(g.slice(d,y),P,{left:I,right:H}).map(rt=>d+rt)},z=b?si(g,m,h,ri(g,A).flatMap(([d,y])=>$(d,y))):void 0,O=0;for(;O<g.length;){if(g[O]===" "){let P=v(O);if(b){x({type:"glue",width:P.run.widthBetween(O,O+1),stretch:f?1:0,shrink:0},{kind:"space",at:O,segment:P,sentence:!1}),O++;continue}let U=P.computed.getPropertyValue("--pw-word-space").trim()||vn,I=P.computed.getPropertyValue("--pw-xspace").trim(),H=I!==""&&I!==U&&oi(g,O),rt=kn(H?I:U,P.style.sizePx);x({type:"glue",...rt,...f?{}:{stretch:0,shrink:0,stretchOrder:0}},{kind:"space",at:O,segment:P,sentence:H}),O++;continue}if(A.get(O)?.leader){x(vt(1e4),{kind:"leader",at:O}),x({type:"glue",width:0,stretch:1,shrink:0,stretchOrder:2},{kind:"leader",at:O}),O++;continue}if(A.has(O)){x(yt(A.get(O).width),{kind:"box",start:O,end:O+1}),O++;continue}let d=Fn(g,A,O),y=O;for(let P of $(O,d))x(yt(k(y,P)),{kind:"box",start:y,end:P}),x(fn(ee(t,v(P-1),g.slice(O,d),P-O,"-"),L),{kind:"break",at:P,hyphen:"-",auto:!0}),y=P;let T=ei.test(g.slice(O,d));for(let P=O;P<d;P++){let U=g[P];if(T&&P>y&&ni(g,P,d)&&(x(yt(k(y,P)),{kind:"box",start:y,end:P}),x(vt(D,ee(t,v(P-1),g.slice(O,d),P-O,""),!0),{kind:"break",at:P,hyphen:""}),y=P),!(U===zt&&Te(v(P).computed)==="none")&&(U===zt||ti.test(U)&&P>O&&P+1<d)){let I=P+1;x(yt(k(y,I)),{kind:"box",start:y,end:I}),U===zt?x(vt(L,ee(t,v(P),g.slice(O,d),I-O,"-"),!0),{kind:"break",at:I,hyphen:"-"}):x(vt(D,ee(t,v(P),g.slice(O,d),I-O,""),!0),{kind:"break",at:I,hyphen:""}),y=I}}y<d&&x(yt(k(y,d)),{kind:"box",start:y,end:d}),O=d}let G=[];if(z){let d=M.splice(0),y=R.splice(0);for(let[T,P]of d.entries()){let U=y[T];if(U.kind!=="box"||U.end<=U.start){x(P,U);continue}let I=U.start;for(let H of z)H<I||H>=U.end||H===I&&y[T-1]?.kind==="leader"||(H>I&&x(yt(k(I,H)),{kind:"box",start:I,end:H}),(H>I||M.at(-1)?.type==="box")&&x(vt(0),{kind:"break",at:H,hyphen:""}),G.push(M.length-1),I=H);x(I===U.start?P:yt(k(I,U.end)),{kind:"box",start:I,end:U.end})}}let q=hn(M,p.parFillSkip);for(;R.length>q.length-3;)R.pop();R.push({kind:"end"},{kind:"end"},{kind:"end"});let nt=z?bn(q,G,{measure:a,leftSkip:p.start,rightSkip:p.end}):(e.lineBreaker?.(r)??mn)(q,{measure:a,...li(s),leftSkip:p.start,rightSkip:p.end}),st=d=>f&&nt.lines[d].glueOrder===0,gt=new Map;for(let[d,y]of nt.lines.entries())for(let T=y.start;T<y.end;T++){let P=R[T],U=q[T];if(P.kind!=="leader"||U.type!=="glue")continue;let I=A.get(P.at);I.width=U.width+(y.ratio>0&&(U.stretchOrder??0)===y.glueOrder?y.ratio*U.stretch:0),gt.set(I,d)}let kt=(d,y,T)=>{let P=Z=>Math.ceil(Z*64-1e-6)/64,U=Z=>Math.round(Z*64)/64,I=0;for(let[Z,K]of d.spacing)d.sentences.has(Z)||(I=K);let H=(Z,K,ft="")=>{let mt=0,Et=m.filter(lt=>lt.end>Z&&lt.start<K);for(let[lt,ht]of Et.entries()){let Ot=g.slice(Math.max(Z,ht.start),Math.min(K,ht.end))+(lt===Et.length-1?ft:"");mt+=P(t.shape(ht.font,Ot,{...ht.style,wordSpacingPx:I}).width)}for(let lt of h)lt.at>=Z&&lt.at<K&&(mt+=lt.width);return mt},rt=[...d.sentences.keys()].sort((Z,K)=>Z-K),it=U(y),et=y,X=d.start;for(let[Z,K]of rt.entries()){it+=H(X,K);let ft=X;for(let[ht,Ot]of d.spacing)ht<X||ht>=K||(et+=k(ft,ht)+S(ht)+Ot,ft=ht+1);et+=k(ft,K)+d.sentences.get(K);let mt=Z===rt.length-1&&T!==void 0?U(T)-H(K+1,d.end,d.hyphen):U(et),Et=v(K),lt=t.shape(Et.font," ",{...Et.style,wordSpacingPx:0}).width;d.spacing.set(K,mt-it-lt-1/256),it=mt,X=K+1}return it+H(X,d.end,d.hyphen)},Q=[];for(let d of nt.lines){let y=g.length;for(let et=d.start;et<=d.end&&et<R.length;et++){let X=R[et];if(X.kind==="box"&&X.end>X.start){y=X.start;break}}Q.length===0&&(y=0);let T=R[d.end],P=T.kind==="space"||T.kind==="break"?T.at:g.length,U=d.hyphenated&&T.kind==="break"?T.hyphen:"",I=new Map,H=new Map;for(let et=d.start;et<d.end;et++){let X=R[et],Z=q[et];if(X.kind!=="space"||Z.type!=="glue")continue;let K=Z.stretchOrder??0,ft=Z.width;d.ratio>0&&K===d.glueOrder?ft+=d.ratio*Z.stretch:d.ratio<0&&(ft+=d.ratio*Z.shrink),X.sentence&&H.set(X.at,ft),I.set(X.at,ft-S(X.at))}let rt=q[d.end],it=T.kind==="break"&&rt.type==="penalty"?rt.width:0;Q.push({start:y,end:P,hyphen:U,auto:!!U&&T.kind==="break"&&!!T.auto,spacing:I,sentences:H,width:it})}let J=n.advanceUnit;if(!J)for(let d of Q){let y=[...d.spacing.keys()].filter(P=>!d.sentences.has(P)),T=0;for(let P of y)T+=d.spacing.get(P);for(let P of y)d.spacing.set(P,T/y.length)}for(let[d,y]of Q.entries()){let T=nt.lines[d];if(!J&&y.sentences.size){y.width=kt(y,d===0?F:0,st(d)?T.measure:void 0);continue}let P=y.width,U=y.start;for(let[H,rt]of y.spacing){P+=k(U,H)+S(H);let it=xt(n,rt);P+=it,y.spacing.set(H,it),U=H+1}P+=k(U,y.end)+(d===0?F:0);let I=st(d)&&y.spacing.size>0;if(J&&I){let H=Math.round((T.measure-P)/J),rt=[...y.spacing.keys()];for(let it=0;H!==0&&it<rt.length*4;it++){let et=rt[it%rt.length],X=Math.sign(H)*J;y.spacing.set(et,y.spacing.get(et)+X),P+=X,H-=Math.sign(H)}}y.width=P}let tt=Q.map(d=>{if(J)return Ai([...d.spacing.values()]);for(let[y,T]of d.spacing)if(!d.sentences.has(y))return T}),{elements:ct,hyphens:j}=bi(r,m,h,Q.map(d=>({start:d.start,end:d.end,hyphen:d.hyphen})),Q.map(d=>d.spacing),tt,l,F);if(di(r,s,[...gt.keys()]),n.engine==="firefox"&&J)for(let[d,y]of Q.entries()){let T=nt.lines[d],P=ct[d],U=Pi(P)+(d===0?F:0);if(!st(d)||!y.spacing.size){y.width=U;continue}let I=Math.round((T.measure-U)/J);y.width=U+(I?wi(P,I,J):0)}let at=s.direction==="rtl";for(let[d,y]of Q.entries()){let T=d===Q.length-1?_.last:_.body,P=T==="end"?1:T==="center"?.5:0,U=Math.max(0,nt.lines[d].measure-y.width)*P;if(!U||st(d)||[...gt.values()].includes(d))continue;let I=ct[d].style,H=at?"paddingRight":"paddingLeft";I.width=`${Number.parseFloat(I.width)-U}px`,I[H]=`${(Number.parseFloat(I[H])||0)+U}px`}let ut=d=>{let y=0;for(;y+1<Q.length&&Q[y+1].start<=d;)y++;return y},It=w.map(d=>({...d,line:ut(d.removed?Math.max(0,d.offset-1):d.offset)}));return{text:g,items:q,breaks:nt,migrated:It,lines:Q.map((d,y)=>({start:d.start,end:d.end,measure:nt.lines[y].measure,ratio:nt.lines[y].ratio,hyphenated:d.hyphen!=="",width:d.width,element:ct[y],...j[y]?{hyphen:{text:d.hyphen,offset:d.end,auto:d.auto,element:j[y]}}:{}}))}}function Fn(r,e,t){let n=t;for(;n<r.length&&r[n]!==" "&&!e.has(n);)n++;return n}function ri(r,e){let t=[];for(let n=0;n<r.length;){if(r[n]===" "||e.has(n)){n++;continue}let s=Fn(r,e,n);t.push([n,s]),n=s}return t}function si(r,e,t,n){let s=[],o=new Map,a=new Set,l=new Set(n);try{for(let h of e){let g=h.node.data,w=[],A="";for(let k=0;k<g.length;k++)k>0&&l.has(h.start+k)&&(A+=zt,w.push(-1)),A+=g[k],w.push(h.start+k);l.has(h.end)&&(A+=zt,w.push(-1)),o.set(h,w),A!==g&&(h.node.data=A,s.push(()=>{h.node.data=g}));let v=h.element;if(Te(h.computed)==="auto"&&!a.has(v)){a.add(v);let k=v.getAttribute("style");v.style.setProperty("hyphens","manual","important"),v.style.setProperty("-webkit-hyphens","manual","important"),s.push(()=>k===null?v.removeAttribute("style"):v.setAttribute("style",k))}}let _=[...e.map(h=>({at:h.start,segment:h})),...t.map(h=>({at:h.at,atom:h}))].sort((h,g)=>h.at-g.at),f=[],p,b=(h,g)=>{g.height<=0||(p&&g.top+g.bottom-p.top-p.bottom>Math.max(g.height,p.height)&&f.push(h),p=g)},m=document.createRange();for(let h of _){if("atom"in h){b(h.at,h.atom.element.getBoundingClientRect());continue}let g=h.segment;for(let[w,A]of o.get(g).entries()){if(A<0)continue;m.setStart(g.node,w),m.setEnd(g.node,w+1);let v=[...m.getClientRects()].at(-1);v&&b(A,v)}}return[...new Set(f.map(h=>r[h]===" "?h+1:h))].filter(h=>h<r.length)}finally{for(let _ of s.reverse())_()}}function ee(r,e,t,n,s){return r.shape(e.font,t.slice(0,n)+s,e.style).width-r.shape(e.font,t,e.style).widthBetween(0,n)}function oi(r,e){let t=e-1;for(;t>=0&&Qa.test(r[t]);)t--;if(t<0||!".?!:".includes(r[t]))return!1;let n=[...r.slice(Math.max(0,t-2),t)].at(-1)??"";return!/\p{Lu}/u.test(n)}function ai(r){let e=r.direction==="rtl",t=o=>{switch(o.replace(/^-(webkit|moz)-/,"")){case"left":return e?"end":"start";case"right":return e?"start":"end";case"end":return"end";case"center":return"center";case"justify":return"justify";case"start":return"start";default:return}},n=t(r.textAlign)??"start",s=t(r.getPropertyValue("text-align-last"))??(n==="justify"?"start":n);return{body:n,last:s}}var ii=2;function ci(r,e){let t={width:0,stretch:0,shrink:0},n={width:0,stretch:1,shrink:0,stretchOrder:1};switch(r.body){case"justify":return{start:t,end:t,...r.last==="justify"?{parFillSkip:t}:{}};case"start":return{start:t,end:{width:0,stretch:ii*e,shrink:0}};case"end":return{start:n,end:t,parFillSkip:t};case"center":return{start:n,end:n,parFillSkip:t}}}function li(r){let e=Number.parseFloat(r.fontSize),t={},n=[["--pw-tolerance","tolerance"],["--pw-pretolerance","pretolerance"],["--pw-line-penalty","linePenalty"],["--pw-adj-demerits","adjDemerits"],["--pw-double-hyphen-demerits","doubleHyphenDemerits"],["--pw-final-hyphen-demerits","finalHyphenDemerits"],["--pw-looseness","looseness"]];for(let[o,a]of n){let l=r.getPropertyValue(o).trim();l&&(t[a]=Number.parseInt(l,10))}let s=r.getPropertyValue("--pw-emergency-stretch").trim();return s&&(t.emergencyStretch=Lt(s,e)),t}function Te(r){let e=r.getPropertyValue("hyphens")||r.getPropertyValue("-webkit-hyphens");return e==="auto"||e==="none"?e:"manual"}function ne(r,e,t){let n=r.getPropertyValue(e).trim();return n?Number.parseInt(n,10):t}function _i(r,e){let t=r.getBoundingClientRect().width,n=s=>Number.parseFloat(e.getPropertyValue(s))||0;return t-n("padding-left")-n("padding-right")-n("border-left-width")-n("border-right-width")}var ui=new Set(["img","svg","math","video","canvas","iframe","object","embed","input","select","textarea","button","audio"]);function fi(r,e){if(ui.has(r.localName))return!0;let t=e.display;return/^inline[- ](block|flex|grid|table|flow-root)$/.test(t)||t==="inline math"||t==="math"}var hi="0.25em";function En(r){return r.getPropertyValue("--pw-leader").trim()!==""}function pi(r,e,t){let n=e.getPropertyValue("--pw-leader").trim(),s=/^(["'])(.*)\1$/.exec(n),o=s?s[2].replace(/\\(.)/g,"$1"):"",a=Number.parseFloat(e.fontSize),l=Lt(e.getPropertyValue("--pw-leader-space").trim()||hi,a);if(!o)return{text:o,space:l,textWidth:0,box:0,spaceWidth:0};let{fonts:_}=t,f=_.lookup(e.fontFamily,e)??_.fallback();if(!f)throw new Error(`no font registered for font-family ${e.fontFamily}`);let p=te(e,r.closest("[lang]")?.getAttribute("lang")??"");p.setSizePx=Fe(_.measurer,r,f,p,o);let b={...p,letterSpacingPx:0,wordSpacingPx:0},m=_.measurer.shape(f,o,b).width,h=_.measurer.shape(f," ",b).width;return{text:o,space:l,textWidth:m,box:m+2*l,spaceWidth:h}}function di(r,e,t){if(!t.length)return;let n=e.direction==="rtl";for(let _ of t){let f=_.element;f.replaceChildren(),f.style.cssText+=`;display:inline-block;box-sizing:border-box;width:${Math.max(0,_.width)}px;margin:0;padding:0;border:0;white-space:pre;text-indent:0;letter-spacing:0;font-kerning:none`}let s=r.getBoundingClientRect(),o=_=>Number.parseFloat(e.getPropertyValue(_))||0,a=n?s.right-o("border-right-width"):s.left+o("border-left-width"),l=t.map(_=>{let f=_.element.getBoundingClientRect();return n?a-f.right:f.left-a});for(let[_,f]of t.entries()){let p=f.leader;if(!p.text||p.box<=0)continue;let b=l[_],m=Math.ceil(b/p.box-1e-6),h=Math.floor((b+f.width)/p.box+1e-6)-m;if(h<=0)continue;let g=f.element;g.style.paddingInlineStart=`${m*p.box-b+p.space}px`,g.style.wordSpacing=`${p.box-p.textWidth-p.spaceWidth}px`,g.textContent=Array.from({length:h},()=>p.text).join(" ")}}function gi(r,e){let{fonts:t}=e,n=[],s=[],o=new Set,a=g=>{for(let w of[...g.childNodes]){if(w.nodeType===Node.TEXT_NODE){n.push(w);continue}if(w.nodeType!==Node.ELEMENT_NODE)continue;let A=w,v=getComputedStyle(A);if(v.display==="none")continue;let k=e.migrate?.(A,v);if(k&&s.push({element:A,piece:n.length,removed:k!=="keep"}),k==="remove")A.remove();else{if(k==="hold")continue;En(v)||fi(A,v)?(n.push(A),o.add(A)):a(A)}}};a(r);let l=!0;for(let g of n){if(!(g instanceof Text)){l=!1;continue}let w="";for(let A of g.data.replace(/[\t\n\r\f ]+/g," "))A===" "&&l||(w+=A,l=A===" ");g.data=w}for(let g=n.length-1;g>=0;g--){let w=n[g];if(!(w instanceof Text)||!w.data.endsWith(" ")&&w.data)break;w.data=w.data.trimEnd()}let _=n.map(g=>g instanceof Text?g.data:Ja).join(""),f=[],p=[],b=[],m=0;for(let g of n){let w=m;if(b.push(w),!(g instanceof Text)){m++;let R=getComputedStyle(g);if(En(R)){p.push({at:w,element:g,width:0,leader:pi(g,R,e)});continue}let x=(Number.parseFloat(R.marginLeft)||0)+(Number.parseFloat(R.marginRight)||0);p.push({at:w,element:g,width:g.getBoundingClientRect().width+x});continue}if(m+=g.data.length,w===m)continue;let A=g.parentElement,v=getComputedStyle(A),k=t.lookup(v.fontFamily,v)??(e.givenFontsOnly?void 0:t.fallback());if(!k)throw new Error(`no font registered for font-family ${v.fontFamily}`);let S=te(v,A.closest("[lang]")?.getAttribute("lang")??"");S.setSizePx=Fe(t.measurer,A,k,S,_.slice(w,m));let M=t.measurer.shape(k,_,S,{start:w,end:m});f.push({node:g,start:w,end:m,style:S,font:k,run:M,element:A,computed:v})}if(b.push(m),!f.length&&!p.length)throw new Error("a paragraph with no text");if(!f.length)throw new Error("a paragraph of atomic inlines alone: it needs text, for its font");let h=s.map(g=>({element:g.element,offset:b[g.piece],removed:g.removed}));return{segments:f,atoms:p,text:_,migrated:h}}function bi(r,e,t,n,s,o,a,l){let _=0;for(let S of r.querySelectorAll("*"))t.some(M=>M.element.contains(S))||S.setAttribute(re,String(_++));let f=S=>{let M=[],R=S.commonAncestorContainer;for(let F=R.nodeType===Node.ELEMENT_NODE?R:R.parentElement;F&&F!==r;F=F.parentElement)M.push(F);let x=S.extractContents();for(let F of M){let L=F.cloneNode(!1);L.append(x),x=L}return x},p=(S,M=0)=>{let R=document.createRange(),x=t.find(D=>D.at===S),F=e.find(D=>S>=D.start&&S<D.end),L=t.find(D=>D.at===S-1);if(x)R.setStartBefore(x.element),R.collapse(!0);else if(!F&&L)R.setStartAfter(L.element),R.collapse(!0);else{let D=F??e.at(-1),$=Math.min(S-D.start,D.node.length);R.setStart(D.node,$),R.setEnd(D.node,Math.min($+M,D.node.length))}return R},b=document.createRange();b.selectNodeContents(r),b.collapse(!0);let m=Math.max(e.at(-1).end,(t.at(-1)?.at??-1)+1),h=[b,...n.slice(1).map(S=>p(S.start)),p(m)],g=[...r.querySelectorAll("*")].filter(S=>!S.textContent&&!S.childElementCount),w=n.map(S=>p(S.end)),A=s.flatMap((S,M)=>[...S].filter(([,R])=>R!==o[M]).map(([R,x])=>({range:p(R,1),v:x})));for(let{range:S,v:M}of A){let R=document.createElement("span");R.className="pw-space",R.style.wordSpacing=`${M}px`,S.surroundContents(R)}let v=[],k=[];for(let[S,M]of n.entries()){let R=o[S],x=document.createRange();x.setStart(h[S].startContainer,h[S].startOffset),x.setEnd(w[S].startContainer,w[S].startOffset);let F=f(x),L=document.createElement("span");L.className="pw-line";let{measure:D,left:$}=a(S),z=S===0?D-l:D;if(L.style.cssText=`display:block;width:${z}px;white-space:pre;text-align:start;text-align-last:auto;text-indent:0;text-rendering:geometricPrecision;word-spacing:${R??0}px`+(S===0&&l>0?`;padding-left:${l}px`:"")+($+(S===0&&l<0?l:0)?`;margin-left:${$+(S===0&&l<0?l:0)}px`:""),L.append(F),M.hyphen){let G=document.createElement("span");G.className="pw-hyphen",G.setAttribute("aria-hidden","true"),G.textContent=M.hyphen;let q=Si(L);q?q.after(G):L.append(G),k[S]=G}let O=document.createRange();if(O.setStart(w[S].startContainer,w[S].startOffset),O.setEnd(h[S+1].startContainer,h[S+1].startOffset),!O.collapsed){let G=document.createElement("span");G.className="pw-break",G.append(f(O)),L.append(G)}v.push(L)}return v.at(-1)?.append(...g.filter(S=>r.contains(S)&&!S.closest(".pw-line"))),r.replaceChildren(...v),mi(v),{elements:v,hyphens:k}}var re="data-pw-piece";function mi(r){let e=new Map;for(let s of r)for(let o of s.querySelectorAll(`[${re}]`)){let a=o.getAttribute(re);o.removeAttribute(re);let l=e.get(a);l?l.push(o):e.set(a,[o])}let t=[];for(let s of e.values()){if(s.length<2)continue;let o=m=>!!m.closest(".pw-break");for(let m of s)o(m)&&!m.hasChildNodes()&&m.remove();s=s.filter(m=>m.parentNode);let a=s.filter(m=>!o(m)),l=a[0]??s[0],_=a.at(-1)??s.at(-1);for(let m of s)m!==l&&m.removeAttribute("id");let f=getComputedStyle(l);if((f.getPropertyValue("box-decoration-break")||f.getPropertyValue("-webkit-box-decoration-break"))==="clone")continue;let[p,b]=f.direction==="rtl"?["right","left"]:["left","right"];for(let m of s){let h=[...m!==l?[p]:[],...m!==_?[b]:[]];h.length&&t.push({piece:m,sides:h})}}let n=t.map(({piece:s,sides:o})=>{let a=getComputedStyle(s);return{piece:s,props:o.flatMap(l=>yi(l).filter(_=>(Number.parseFloat(a.getPropertyValue(_))||0)!==0))}});for(let{piece:s,props:o}of n)for(let a of o)s.style.setProperty(a,a.startsWith("--")?"0px":"0")}var yi=r=>[`padding-${r}`,`border-${r}-width`,`--pw-border-${r}-width`,`margin-${r}`,`border-top-${r}-radius`,`border-bottom-${r}-radius`];function Pi(r){let e=document.createRange();e.setStart(r,0);let t=r.querySelector(":scope > .pw-break");return t?e.setEndBefore(t):e.setEnd(r,r.childNodes.length),e.getBoundingClientRect().width}function wi(r,e,t){let n=[],s=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(let _=s.nextNode();_;_=s.nextNode())if(!_.parentElement?.closest(".pw-break"))for(let f=0;f<_.length;f++)_.data[f]===" "&&n.push({node:_,offset:f});if(!n.length)return 0;let o=Number.parseFloat(r.style.wordSpacing)||0,a=Math.sign(e)*t,l=new Map;for(let _=0;_<Math.abs(e);_++)l.set(_%n.length,(l.get(_%n.length)??0)+a);for(let[_,f]of[...l].sort(([p],[b])=>b-p)){let{node:p,offset:b}=n[_],m=p.parentElement;if(m.classList.contains("pw-space")){m.style.wordSpacing=`${(Number.parseFloat(m.style.wordSpacing)||0)+f}px`;continue}let h=document.createRange();h.setStart(p,b),h.setEnd(p,b+1);let g=document.createElement("span");g.className="pw-space",g.style.wordSpacing=`${o+f}px`,h.surroundContents(g)}return e*t}function Si(r){let e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),t;for(let n=e.nextNode();n;n=e.nextNode())n.length&&(t=n);return t}function Ai(r){let e=new Map,t,n=0;for(let s of r){let o=(e.get(s)??0)+1;e.set(s,o),o>n&&(t=s,n=o)}return t}function vi(r){let e=getComputedStyle(r);return e.getPropertyValue("--pw-line-breaking").trim()==="knuth-plass"&&e.textAlign==="justify"&&e.display==="block"}function Tn(r){return[...r.querySelectorAll("p")].filter(vi)}var se=class{constructor(e){this.options=e;typeof ResizeObserver<"u"&&(this.#e=new ResizeObserver(t=>{for(let n of t){let s=n.target;Math.abs(n.contentRect.width-(this.#t.get(s)?.width??-1))>=.5&&this.justify(s)}}))}options;#t=new WeakMap;#e;justify(e){let t=this.#t.get(e);if(t)e.replaceChildren(t.content.cloneNode(!0));else{let s=document.createDocumentFragment();for(let o of e.childNodes)s.append(o.cloneNode(!0));t={content:s,width:-1},this.#t.set(e,t)}let n=e.getBoundingClientRect().width;if(t.width=n,n<=0)return!1;try{return Rn(e,{fonts:this.options.fonts,givenFontsOnly:!0,...this.options.hyphenator?{hyphenator:this.options.hyphenator}:{}}),e.classList.add("pw-justified"),!0}catch{return e.replaceChildren(t.content.cloneNode(!0)),e.classList.remove("pw-justified"),!1}}observe(e){for(let t of e)this.justify(t),this.#e?.observe(t)}disconnect(){this.#e?.disconnect()}};async function Ln(r,e){let t=new Kt,[n]=await Promise.all([fetch(e).catch(()=>{}),t.prepare(r).catch(()=>{})]);return n?.ok&&t.addExceptions(un(await n.text()).exceptions),t}function xn(r=document){let e=[],t=(n,s)=>{for(let o of n)if(o instanceof CSSFontFaceRule){let a=f=>o.style.getPropertyValue(f).trim(),l=le(a("font-family")),_=je(a("src"))?.find(f=>f.kind==="url");if(!l||!_||_.kind!=="url")continue;e.push({family:l,url:new URL(_.url,s).href,...a("font-weight")?{weight:a("font-weight")}:{},...a("font-style")?{style:a("font-style")}:{},...a("font-stretch")?{stretch:a("font-stretch")}:{}})}else"cssRules"in o&&t(o.cssRules,s)};for(let n of r.styleSheets){let s;try{s=n.cssRules}catch{continue}t(s,n.href??r.baseURI)}return e}async function Hn(){let r=Tn(document);if(!r.length)return;await document.fonts.ready;let e=new Wt(await Yt.create());await Promise.all(xn().map(async n=>{let s=await fetch(n.url);s.ok&&await e.add(n.family,new Uint8Array(await s.arrayBuffer()),{...n.weight?{weight:n.weight}:{},...n.style?{style:n.style}:{},...n.stretch?{stretch:n.stretch}:{},page:!1})}));let t=await Ln(document.documentElement,new URL("hyphenation.txt",import.meta.url));new se({fonts:e,hyphenator:t}).observe(r),document.documentElement.dataset.pwJustified=String(r.filter(n=>n.classList.contains("pw-justified")).length)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Hn()},{once:!0}):Hn();
1
+ var Ho=Object.defineProperty;var ua=(r,t,e)=>()=>{if(e)throw e[0];try{return r&&(t=r(r=0)),t}catch(n){throw e=[n],n}};var Mo=(r,t)=>{for(var e in t)Ho(r,e,{get:t[e],enumerable:!0})};async function ci(r={}){var t,e=r,n=typeof window=="object",a=typeof WorkerGlobalScope<"u",s=typeof process=="object"&&process.versions?.node&&process.type!="renderer";if(s){let{createRequire:l}=await import("module");var o=l(import.meta.url)}var i=[],u="./this.program",_=(l,T)=>{throw T},d=import.meta.url,m="";function b(l){return e.locateFile?e.locateFile(l,m):m+l}var p,y;if(s){var P=o("fs");d.startsWith("file:")&&(m=o("path").dirname(o("url").fileURLToPath(d))+"/"),y=l=>{l=H(l)?new URL(l):l;var T=P.readFileSync(l);return T},p=async(l,T=!0)=>{l=H(l)?new URL(l):l;var oe=P.readFileSync(l,T?void 0:"utf8");return oe},process.argv.length>1&&(u=process.argv[1].replace(/\\/g,"/")),i=process.argv.slice(2),_=(l,T)=>{throw process.exitCode=l,T}}else if(n||a){try{m=new URL(".",d).href}catch{}a&&(y=l=>{var T=new XMLHttpRequest;return T.open("GET",l,!1),T.responseType="arraybuffer",T.send(null),new Uint8Array(T.response)}),p=async l=>{if(H(l))return new Promise((oe,_e)=>{var fe=new XMLHttpRequest;fe.open("GET",l,!0),fe.responseType="arraybuffer",fe.onload=()=>{if(fe.status==200||fe.status==0&&fe.response){oe(fe.response);return}_e(fe.status)},fe.onerror=_e,fe.send(null)});var T=await fetch(l,{credentials:"same-origin"});if(T.ok)return T.arrayBuffer();throw new Error(T.status+" : "+T.url)}}var v=console.log.bind(console),S=console.error.bind(console),I,k=!1,R,H=l=>l.startsWith("file://"),Y,N,F,G,ee,D,q,ie,$,te,j,ve,ae,Ne=!1;function xe(){var l=F.buffer;e.HEAP8=G=new Int8Array(l),D=new Int16Array(l),e.HEAPU8=ee=new Uint8Array(l),e.HEAPU16=q=new Uint16Array(l),e.HEAP32=ie=new Int32Array(l),e.HEAPU32=$=new Uint32Array(l),e.HEAPF32=te=new Float32Array(l),j=new Float64Array(l),ve=new BigInt64Array(l),ae=new BigUint64Array(l)}function z(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)E(e.preRun.shift());M(f)}function Pe(){Ne=!0,tt.__wasm_call_ctors()}function X(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)h(e.postRun.shift());M(re)}var se=0,me=null;function Oe(l){se++,e.monitorRunDependencies?.(se)}function Je(l){if(se--,e.monitorRunDependencies?.(se),se==0&&me){var T=me;me=null,T()}}function le(l){e.onAbort?.(l),l="Aborted("+l+")",S(l),k=!0,l+=". Build with -sASSERTIONS for more info.";var T=new WebAssembly.RuntimeError(l);throw N?.(T),T}var De;function Ue(){return e.locateFile?b("harfbuzz.wasm"):new URL("harfbuzz.wasm",import.meta.url).href}function Ae(l){if(l==De&&I)return new Uint8Array(I);if(y)return y(l);throw"both async and sync fetching of the wasm failed"}async function Ee(l){if(!I)try{var T=await p(l);return new Uint8Array(T)}catch{}return Ae(l)}async function pe(l,T){try{var oe=await Ee(l),_e=await WebAssembly.instantiate(oe,T);return _e}catch(fe){S(`failed to asynchronously prepare wasm: ${fe}`),le(fe)}}async function Ye(l,T,oe){if(!l&&!H(T)&&!s)try{var _e=fetch(T,{credentials:"same-origin"}),fe=await WebAssembly.instantiateStreaming(_e,oe);return fe}catch(Re){S(`wasm streaming compile failed: ${Re}`),S("falling back to ArrayBuffer instantiation")}return pe(T,oe)}function ue(){return{env:la,wasi_snapshot_preview1:la}}async function Pt(){function l(Re,wr){return tt=Re.exports,e.wasmExports=tt,F=tt.memory,xe(),Le=tt.__indirect_function_table,Ro(tt),Je("wasm-instantiate"),tt}Oe("wasm-instantiate");function T(Re){return l(Re.instance)}var oe=ue();if(e.instantiateWasm)return new Promise((Re,wr)=>{e.instantiateWasm(oe,(Fo,To)=>{Re(l(Fo,To))})});De??=Ue();var _e=await Ye(I,De,oe),fe=T(_e);return fe}class it{name="ExitStatus";constructor(T){this.message=`Program terminated with exit(${T})`,this.status=T}}var M=l=>{for(;l.length>0;)l.shift()(e)},re=[],h=l=>re.push(l),f=[],E=l=>f.push(l),A=!0,x=l=>oa(l),w=()=>ca(),L=()=>le(""),U=0,C=()=>{A=!1,U=0},O={},K=l=>{if(l instanceof it||l=="unwind")return R;_(1,l)},W=()=>A||U>0,J=l=>{R=l,W()||(e.onExit?.(l),k=!0),_(l,new it(l))},ce=(l,T)=>{R=l,J(l)},Z=ce,ne=()=>{if(!W())try{Z(R)}catch(l){K(l)}},ge=l=>{if(!k)try{l(),ne()}catch(T){K(T)}},be=()=>performance.now(),Ge=(l,T)=>{if(O[l]&&(clearTimeout(O[l].id),delete O[l]),!T)return 0;var oe=setTimeout(()=>{delete O[l],ge(()=>sa(l,be()))},T);return O[l]={id:oe,timeout_ms:T},0},de=()=>2147483648,ye=(l,T)=>Math.ceil(l/T)*T,Pn=l=>{var T=F.buffer.byteLength,oe=(l-T+65535)/65536|0;try{return F.grow(oe),xe(),1}catch{}},wn=l=>{var T=ee.length;l>>>=0;var oe=de();if(l>oe)return!1;for(var _e=1;_e<=4;_e*=2){var fe=T*(1+.2/_e);fe=Math.min(fe,l+100663296);var Re=Math.min(oe,ye(Math.max(l,fe),65536)),wr=Pn(Re);if(wr)return!0}return!1},Yt=l=>{let T=l.length;return[T%128|128,T>>7,...l]},Kt={i:127,p:127,j:126,f:125,d:124,e:111},Ke=l=>Yt(Array.from(l,T=>{var oe=Kt[T];return oe})),He=(l,T)=>{var oe=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Yt([1,96,...Ke(T.slice(1)),...Ke(T[0]==="v"?"":T[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),_e=new WebAssembly.Module(oe),fe=new WebAssembly.Instance(_e,{e:{f:l}}),Re=fe.exports.f;return Re},Le,wt=l=>Le.get(l),Sn=(l,T)=>{if(ze)for(var oe=l;oe<l+T;oe++){var _e=wt(oe);_e&&ze.set(_e,oe)}},ze,dr=l=>(ze||(ze=new WeakMap,Sn(0,Le.length)),ze.get(l)||0),ct=[],St=()=>ct.length?ct.pop():Le.grow(1),Ze=(l,T)=>Le.set(l,T),Jt=(l,T)=>{var oe=dr(l);if(oe)return oe;var _e=St();try{Ze(_e,l)}catch(Re){if(!(Re instanceof TypeError))throw Re;var fe=He(l,T);Ze(_e,fe)}return ze.set(l,_e),_e},In=l=>{ze.delete(wt(l)),Ze(l,null),ct.push(l)},It=l=>ia(l);e.noExitRuntime&&(A=e.noExitRuntime),e.print&&(v=e.print),e.printErr&&(S=e.printErr),e.wasmBinary&&(I=e.wasmBinary),e.arguments&&(i=e.arguments),e.thisProgram&&(u=e.thisProgram),e.wasmExports=tt,e.stackSave=w,e.stackRestore=x,e.stackAlloc=It,e.addFunction=Jt,e.removeFunction=In;var Xe,Zt,En,Xt,mr,kn,Et,Qt,br,Nn,kt,qt,$t,B,lt,yr,Qe,Nt,Rn,en,Rt,Lt,Ln,Ft,Fn,tn,Tn,ut,nn,qe,rn,an,sn,Me,Ar,Tt,ft,Hn,Ht,Mt,on,Mn,Cn,cn,_t,On,Ct,$e,et,ht,Un,pt,ln,un,Bn,Ot,fn,Dn,Fe,_n,Gn,zn,hn,jn,Wn,gt,dt,je,Vn,pn,gn,mt,Yn,bt,dn,ke,vr,Ut,Bt,Kn,xr,we,Te,Se,We,Jn,xs,Ps,ws,Ss,Is,Es,ks,Ns,Rs,Ls,Fs,Ts,Hs,Ms,Cs,Os,Us,Bs,Ds,Gs,zs,js,Ws,Vs,Ys,Ks,Js,Zs,Xs,Qs,qs,$s,eo,to,no,ro,ao,so,oo,io,co,lo,uo,fo,_o,ho,po,go,mo,bo,yo,Ao,vo,xo,Po,wo,So,Io,Eo,ko,No,sa,oa,ia,ca;function Ro(l){e._hb_blob_create=Xe=l.hb_blob_create,e._hb_blob_destroy=Zt=l.hb_blob_destroy,e._hb_blob_get_length=En=l.hb_blob_get_length,e._hb_blob_get_data=Xt=l.hb_blob_get_data,e._hb_buffer_serialize=mr=l.hb_buffer_serialize,e._hb_buffer_create=kn=l.hb_buffer_create,e._hb_buffer_reset=Et=l.hb_buffer_reset,e._hb_buffer_reference=Qt=l.hb_buffer_reference,e._hb_buffer_destroy=br=l.hb_buffer_destroy,e._hb_buffer_get_content_type=Nn=l.hb_buffer_get_content_type,e._hb_buffer_set_direction=kt=l.hb_buffer_set_direction,e._hb_buffer_set_script=qt=l.hb_buffer_set_script,e._hb_buffer_set_language=$t=l.hb_buffer_set_language,e._hb_buffer_set_flags=B=l.hb_buffer_set_flags,e._hb_buffer_set_cluster_level=lt=l.hb_buffer_set_cluster_level,e._hb_buffer_clear_contents=yr=l.hb_buffer_clear_contents,e._hb_buffer_add=Qe=l.hb_buffer_add,e._hb_buffer_get_length=Nt=l.hb_buffer_get_length,e._hb_buffer_get_glyph_infos=Rn=l.hb_buffer_get_glyph_infos,e._hb_buffer_get_glyph_positions=en=l.hb_buffer_get_glyph_positions,e._hb_glyph_info_get_glyph_flags=Rt=l.hb_glyph_info_get_glyph_flags,e._hb_buffer_guess_segment_properties=Lt=l.hb_buffer_guess_segment_properties,e._hb_buffer_add_utf8=Ln=l.hb_buffer_add_utf8,e._hb_buffer_add_utf16=Ft=l.hb_buffer_add_utf16,e._hb_buffer_add_codepoints=Fn=l.hb_buffer_add_codepoints,e._hb_buffer_set_message_func=tn=l.hb_buffer_set_message_func,e._hb_language_from_string=Tn=l.hb_language_from_string,e._hb_language_to_string=ut=l.hb_language_to_string,e._hb_script_from_string=nn=l.hb_script_from_string,e._hb_version=qe=l.hb_version,e._hb_version_string=rn=l.hb_version_string,e._hb_feature_from_string=an=l.hb_feature_from_string,e._hb_feature_to_string=sn=l.hb_feature_to_string,e._hb_variation_from_string=Me=l.hb_variation_from_string,e._hb_variation_to_string=Ar=l.hb_variation_to_string,e._malloc=Tt=l.malloc,e._free=ft=l.free,e._hb_draw_funcs_set_move_to_func=Hn=l.hb_draw_funcs_set_move_to_func,e._hb_draw_funcs_set_line_to_func=Ht=l.hb_draw_funcs_set_line_to_func,e._hb_draw_funcs_set_quadratic_to_func=Mt=l.hb_draw_funcs_set_quadratic_to_func,e._hb_draw_funcs_set_cubic_to_func=on=l.hb_draw_funcs_set_cubic_to_func,e._hb_draw_funcs_set_close_path_func=Mn=l.hb_draw_funcs_set_close_path_func,e._hb_draw_funcs_create=Cn=l.hb_draw_funcs_create,e._hb_draw_funcs_destroy=cn=l.hb_draw_funcs_destroy,e._hb_face_create=_t=l.hb_face_create,e._hb_face_reference=On=l.hb_face_reference,e._hb_face_destroy=Ct=l.hb_face_destroy,e._hb_face_reference_table=$e=l.hb_face_reference_table,e._hb_face_get_upem=et=l.hb_face_get_upem,e._hb_face_collect_unicodes=ht=l.hb_face_collect_unicodes,e._hb_font_funcs_create=Un=l.hb_font_funcs_create,e._hb_font_funcs_destroy=pt=l.hb_font_funcs_destroy,e._hb_font_funcs_set_font_h_extents_func=ln=l.hb_font_funcs_set_font_h_extents_func,e._hb_font_funcs_set_font_v_extents_func=un=l.hb_font_funcs_set_font_v_extents_func,e._hb_font_funcs_set_nominal_glyph_func=Bn=l.hb_font_funcs_set_nominal_glyph_func,e._hb_font_funcs_set_nominal_glyphs_func=Ot=l.hb_font_funcs_set_nominal_glyphs_func,e._hb_font_funcs_set_variation_glyph_func=fn=l.hb_font_funcs_set_variation_glyph_func,e._hb_font_funcs_set_glyph_h_advance_func=Dn=l.hb_font_funcs_set_glyph_h_advance_func,e._hb_font_funcs_set_glyph_v_advance_func=Fe=l.hb_font_funcs_set_glyph_v_advance_func,e._hb_font_funcs_set_glyph_h_advances_func=_n=l.hb_font_funcs_set_glyph_h_advances_func,e._hb_font_funcs_set_glyph_v_advances_func=Gn=l.hb_font_funcs_set_glyph_v_advances_func,e._hb_font_funcs_set_glyph_h_origin_func=zn=l.hb_font_funcs_set_glyph_h_origin_func,e._hb_font_funcs_set_glyph_v_origin_func=hn=l.hb_font_funcs_set_glyph_v_origin_func,e._hb_font_funcs_set_glyph_h_kerning_func=jn=l.hb_font_funcs_set_glyph_h_kerning_func,e._hb_font_funcs_set_glyph_extents_func=Wn=l.hb_font_funcs_set_glyph_extents_func,e._hb_font_funcs_set_glyph_name_func=gt=l.hb_font_funcs_set_glyph_name_func,e._hb_font_funcs_set_glyph_from_name_func=dt=l.hb_font_funcs_set_glyph_from_name_func,e._hb_font_get_h_extents=je=l.hb_font_get_h_extents,e._hb_font_get_v_extents=Vn=l.hb_font_get_v_extents,e._hb_font_get_glyph=pn=l.hb_font_get_glyph,e._hb_font_get_nominal_glyph=gn=l.hb_font_get_nominal_glyph,e._hb_font_get_variation_glyph=mt=l.hb_font_get_variation_glyph,e._hb_font_get_glyph_h_advance=Yn=l.hb_font_get_glyph_h_advance,e._hb_font_get_glyph_v_advance=bt=l.hb_font_get_glyph_v_advance,e._hb_font_get_glyph_h_origin=dn=l.hb_font_get_glyph_h_origin,e._hb_font_get_glyph_v_origin=ke=l.hb_font_get_glyph_v_origin,e._hb_font_get_glyph_extents=vr=l.hb_font_get_glyph_extents,e._hb_font_get_glyph_from_name=Ut=l.hb_font_get_glyph_from_name,e._hb_font_draw_glyph_or_fail=Bt=l.hb_font_draw_glyph_or_fail,e._hb_font_paint_glyph_or_fail=Kn=l.hb_font_paint_glyph_or_fail,e._hb_font_draw_glyph=xr=l.hb_font_draw_glyph,e._hb_font_paint_glyph=we=l.hb_font_paint_glyph,e._hb_font_glyph_to_string=Te=l.hb_font_glyph_to_string,e._hb_font_create=Se=l.hb_font_create,e._hb_font_set_variations=We=l.hb_font_set_variations,e._hb_font_create_sub_font=Jn=l.hb_font_create_sub_font,e._hb_font_reference=xs=l.hb_font_reference,e._hb_font_destroy=Ps=l.hb_font_destroy,e._hb_font_get_face=ws=l.hb_font_get_face,e._hb_font_set_funcs=Ss=l.hb_font_set_funcs,e._hb_font_set_scale=Is=l.hb_font_set_scale,e._hb_ot_color_has_palettes=Es=l.hb_ot_color_has_palettes,e._hb_ot_color_palette_get_count=ks=l.hb_ot_color_palette_get_count,e._hb_ot_color_palette_get_name_id=Ns=l.hb_ot_color_palette_get_name_id,e._hb_ot_color_palette_color_get_name_id=Rs=l.hb_ot_color_palette_color_get_name_id,e._hb_ot_color_palette_get_flags=Ls=l.hb_ot_color_palette_get_flags,e._hb_ot_color_palette_get_colors=Fs=l.hb_ot_color_palette_get_colors,e._hb_ot_color_has_layers=Ts=l.hb_ot_color_has_layers,e._hb_ot_color_has_paint=Hs=l.hb_ot_color_has_paint,e._hb_ot_color_glyph_has_paint=Ms=l.hb_ot_color_glyph_has_paint,e._hb_ot_color_glyph_get_layers=Cs=l.hb_ot_color_glyph_get_layers,e._hb_ot_color_has_png=Os=l.hb_ot_color_has_png,e._hb_ot_color_glyph_reference_png=Us=l.hb_ot_color_glyph_reference_png,e._hb_ot_layout_get_glyph_class=Bs=l.hb_ot_layout_get_glyph_class,e._hb_ot_layout_get_ligature_carets=Ds=l.hb_ot_layout_get_ligature_carets,e._hb_ot_layout_table_get_script_tags=Gs=l.hb_ot_layout_table_get_script_tags,e._hb_ot_layout_table_get_feature_tags=zs=l.hb_ot_layout_table_get_feature_tags,e._hb_ot_layout_script_get_language_tags=js=l.hb_ot_layout_script_get_language_tags,e._hb_ot_layout_language_get_feature_tags=Ws=l.hb_ot_layout_language_get_feature_tags,e._hb_ot_layout_feature_get_lookups=Vs=l.hb_ot_layout_feature_get_lookups,e._hb_ot_layout_feature_get_name_ids=Ys=l.hb_ot_layout_feature_get_name_ids,e._hb_ot_metrics_get_position_with_fallback=Ks=l.hb_ot_metrics_get_position_with_fallback,e._hb_ot_layout_lookup_get_optical_bound=Js=l.hb_ot_layout_lookup_get_optical_bound,e._hb_ot_tags_from_script_and_language=Zs=l.hb_ot_tags_from_script_and_language,e._hb_ot_metrics_get_position=Xs=l.hb_ot_metrics_get_position,e._hb_ot_metrics_get_variation=Qs=l.hb_ot_metrics_get_variation,e._hb_ot_metrics_get_x_variation=qs=l.hb_ot_metrics_get_x_variation,e._hb_ot_metrics_get_y_variation=$s=l.hb_ot_metrics_get_y_variation,e._hb_ot_name_list_names=eo=l.hb_ot_name_list_names,e._hb_ot_name_get_utf16=to=l.hb_ot_name_get_utf16,e._hb_set_create=no=l.hb_set_create,e._hb_set_destroy=ro=l.hb_set_destroy,e._hb_ot_tag_to_script=ao=l.hb_ot_tag_to_script,e._hb_ot_tag_to_language=so=l.hb_ot_tag_to_language,e._hb_ot_tags_to_script_and_language=oo=l.hb_ot_tags_to_script_and_language,e._hb_ot_var_get_axis_infos=io=l.hb_ot_var_get_axis_infos,e._hb_paint_funcs_set_push_transform_func=co=l.hb_paint_funcs_set_push_transform_func,e._hb_paint_funcs_set_pop_transform_func=lo=l.hb_paint_funcs_set_pop_transform_func,e._hb_paint_funcs_set_color_glyph_func=uo=l.hb_paint_funcs_set_color_glyph_func,e._hb_paint_funcs_set_push_clip_glyph_func=fo=l.hb_paint_funcs_set_push_clip_glyph_func,e._hb_paint_funcs_set_push_clip_rectangle_func=_o=l.hb_paint_funcs_set_push_clip_rectangle_func,e._hb_paint_funcs_set_pop_clip_func=ho=l.hb_paint_funcs_set_pop_clip_func,e._hb_paint_funcs_set_color_func=po=l.hb_paint_funcs_set_color_func,e._hb_paint_funcs_set_image_func=go=l.hb_paint_funcs_set_image_func,e._hb_paint_funcs_set_linear_gradient_func=mo=l.hb_paint_funcs_set_linear_gradient_func,e._hb_paint_funcs_set_radial_gradient_func=bo=l.hb_paint_funcs_set_radial_gradient_func,e._hb_paint_funcs_set_sweep_gradient_func=yo=l.hb_paint_funcs_set_sweep_gradient_func,e._hb_paint_funcs_set_push_group_func=Ao=l.hb_paint_funcs_set_push_group_func,e._hb_paint_funcs_set_pop_group_func=vo=l.hb_paint_funcs_set_pop_group_func,e._hb_paint_funcs_set_custom_palette_color_func=xo=l.hb_paint_funcs_set_custom_palette_color_func,e._hb_paint_funcs_create=Po=l.hb_paint_funcs_create,e._hb_paint_funcs_destroy=wo=l.hb_paint_funcs_destroy,e._hb_color_line_get_color_stops=So=l.hb_color_line_get_color_stops,e._hb_color_line_get_extend=Io=l.hb_color_line_get_extend,e._hb_set_get_population=Eo=l.hb_set_get_population,e._hb_set_next_many=ko=l.hb_set_next_many,e._hb_shape=No=l.hb_shape,sa=l._emscripten_timeout,oa=l._emscripten_stack_restore,ia=l._emscripten_stack_alloc,ca=l.emscripten_stack_get_current}var la={_abort_js:L,_emscripten_runtime_keepalive_clear:C,_setitimer_js:Ge,emscripten_resize_heap:wn,proc_exit:J},tt=await Pt();function Pr(){if(se>0){me=Pr;return}if(z(),se>0){me=Pr;return}function l(){e.calledRun=!0,!k&&(Pe(),Y?.(e),e.onRuntimeInitialized?.(),X())}e.setStatus?(e.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>e.setStatus(""),1),l()},1)):l()}function Lo(){if(e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.shift()()}return Lo(),Pr(),Ne?t=e:t=new Promise((l,T)=>{Y=l,N=T}),t}var Ta,Ha=ua(()=>{Ta=ci});var Ya={};Mo(Ya,{AxisFlags:()=>Ai,Blob:()=>xi,Buffer:()=>Fi,BufferContentType:()=>Ga,BufferFlag:()=>Ni,BufferSerializeFlag:()=>za,BufferSerializeFormat:()=>Kr,ClusterLevel:()=>Li,ColorPaletteFlags:()=>mi,Direction:()=>Ri,DrawFuncs:()=>Yr,Face:()=>Ba,Feature:()=>Ti,Font:()=>Ie,FontFuncs:()=>Ei,GlyphClass:()=>Pi,GlyphFlag:()=>vi,MetricsTag:()=>wi,PaintCompositeMode:()=>yi,PaintExtend:()=>bi,PaintFuncs:()=>ki,TracePhase:()=>An,Variation:()=>Hi,otTagToLanguage:()=>Bi,otTagToScript:()=>Ui,otTagsFromScriptAndLanguage:()=>Di,otTagsToScriptAndLanguage:()=>Gi,shape:()=>Va,shapeWithTrace:()=>Mi,version:()=>Ci,versionString:()=>Oi});function vn(r,t){let e=r.ptr;jr.register(r,()=>t(e))}function fi(r){c=r,g=c.wasmExports,Oa=c.addFunction(t=>{g.free(t)},"vi")}function V(r){return(r.charCodeAt(0)&255)<<24|(r.charCodeAt(1)&255)<<16|(r.charCodeAt(2)&255)<<8|(r.charCodeAt(3)&255)<<0}function Ce(r){return String.fromCharCode(r>>24&255,r>>16&255,r>>8&255,r>>0&255)}function st(r,t){let e;return t==null?e=c.HEAPU8.indexOf(0,r):e=r+t,li.decode(c.HEAPU8.subarray(r,e))}function _i(r,t){let e=r/2+t;return String.fromCharCode(...c.HEAPU16.subarray(r/2,e))}function At(r){let t=g.malloc(r.length+1);for(let e=0;e<r.length;++e){let n=r.charCodeAt(e);if(n>127)throw new Error("Expected ASCII text");c.HEAPU8[t+e]=n}return c.HEAPU8[t+r.length]=0,{ptr:t,length:r.length,free:function(){g.free(t)}}}function hi(r){let t=g.malloc(r.length);return ui.encodeInto(r,c.HEAPU8.subarray(t,t+r.length)),{ptr:t,length:r.length,free:function(){g.free(t)}}}function pi(r){let t=g.malloc(r.length*2),e=c.HEAPU16.subarray(t/2,t/2+r.length);for(let n=0;n<e.length;++n)e[n]=r.charCodeAt(n);return{ptr:t,length:e.length,free:function(){g.free(t)}}}function Wr(r){return st(g.hb_language_to_string(r))}function gi(r){let t=At(r),e=g.hb_language_from_string(t.ptr,-1);return t.free(),e}function di(r){let t=g.hb_set_get_population(r),e=g.malloc(t<<2),n=e>>2;return g.hb_set_next_many(r,-1,e,t),c.HEAPU32.subarray(n,n+t)}function he(r){if(r===void 0)return 0;let t=Ua.pop()??ar.length;return ar[t]=r,t}function Q(r){return ar[r]}function zt(r){r!==0&&(ar[r]=void 0,Ua.push(r))}function Vr(r){return{red:r>>8&255,green:r>>16&255,blue:r>>24&255,alpha:r&255}}function zr(r){return(r.red<<8|r.green<<16|r.blue<<24|r.alpha)>>>0}function Si(){return rt||(rt=new Yr,rt.setMoveToFunc((r,t,e)=>{e.push(`M${r},${t}`)}),rt.setLineToFunc((r,t,e)=>{e.push(`L${r},${t}`)}),rt.setCubicToFunc((r,t,e,n,a,s,o)=>{o.push(`C${r},${t} ${e},${n} ${a},${s}`)}),rt.setQuadraticToFunc((r,t,e,n,a)=>{a.push(`Q${r},${t} ${e},${n}`)}),rt.setClosePathFunc(r=>{r.push("Z")})),rt}function Ii(){return at||(at=new Yr,at.setMoveToFunc((r,t,e)=>{e.push({type:"M",values:[r,t]})}),at.setLineToFunc((r,t,e)=>{e.push({type:"L",values:[r,t]})}),at.setCubicToFunc((r,t,e,n,a,s,o)=>{o.push({type:"C",values:[r,t,e,n,a,s]})}),at.setQuadraticToFunc((r,t,e,n,a)=>{a.push({type:"Q",values:[r,t,e,n]})}),at.setClosePathFunc(r=>{r.push({type:"Z",values:[]})})),at}function Gr(r){let t=g.hb_color_line_get_extend(r),e=[],n=c.stackSave(),a=c.stackAlloc(4),s=c.stackAlloc(1536),o=0,i=128;for(;i===128;){c.HEAPU32[a/4]=i,g.hb_color_line_get_color_stops(r,o,a,s),i=c.HEAPU32[a/4];for(let u=0;u<i;u++){let _=(s+u*12)/4;e.push({offset:c.HEAPF32[_],isForeground:c.HEAPU32[_+1]!==0,color:Vr(c.HEAPU32[_+2])})}o+=i}return c.stackRestore(n),{extend:t,colorStops:e}}function Va(r,t,e){let n=e?.length??0,a=c.stackSave(),s=0;n&&(s=c.stackAlloc(16*n),e.forEach((o,i)=>{o.writeTo(s+i*16)})),g.hb_shape(r.ptr,t.ptr,s,n),c.stackRestore(a)}function Mi(r,t,e,n,a){let s=[],o=An.DONT_STOP,i=!1;return t.setMessageFunc((u,_,d)=>{if(d.startsWith("start table GSUB")?o=An.GSUB:d.startsWith("start table GPOS")&&(o=An.GPOS),o!=a&&(i=!1),a!=An.DONT_STOP&&o==a&&d.startsWith("end lookup "+n)&&(i=!0),i)return!1;let m=u.serialize({font:_,format:Kr.JSON,flags:za.NO_GLYPH_NAMES});return s.push({m:d,t:JSON.parse(m),glyphs:u.getContentType()==Ga.GLYPHS}),!0}),Va(r,t,e),s}function Ci(){let r=c.stackSave(),t=c.stackAlloc(12);g.hb_version(t,t+4,t+8);let e={major:c.HEAPU32[t/4],minor:c.HEAPU32[(t+4)/4],micro:c.HEAPU32[(t+8)/4]};return c.stackRestore(r),e}function Oi(){return st(g.hb_version_string())}function Ui(r){let t=V(r);return Ce(g.hb_ot_tag_to_script(t))}function Bi(r){let t=V(r);return Wr(g.hb_ot_tag_to_language(t))}function Di(r,t){let e=c.stackSave(),n=At(r),a=At(t),s=c.stackAlloc(4);c.HEAPU32[s/4]=Ca;let o=c.stackAlloc(Ca*4),i=c.stackAlloc(4);c.HEAPU32[i/4]=Ma;let u=c.stackAlloc(Ma*4);g.hb_ot_tags_from_script_and_language(g.hb_script_from_string(n.ptr,-1),g.hb_language_from_string(a.ptr,-1),s,o,i,u),n.free(),a.free();let _=c.HEAPU32.subarray(o/4,o/4+c.HEAPU32[s/4]),d=c.HEAPU32.subarray(u/4,u/4+c.HEAPU32[i/4]);return c.stackRestore(e),{scriptTags:[..._].map(Ce),languageTags:[...d].map(Ce)}}function Gi(r,t){let e=c.stackSave(),n=c.stackAlloc(4),a=c.stackAlloc(4);g.hb_ot_tags_to_script_and_language(V(r),V(t),n,a);let s=c.HEAPU32[n/4],o=c.HEAPU32[a/4];return c.stackRestore(e),{script:Ce(s),language:Wr(o)}}var c,g,Oa,li,ui,jr,ar,Ua,mi,bi,yi,Ai,vi,xi,yn,Pi,Ba,Yr,wi,rt,at,Ie,Ei,ki,Ga,za,Ni,Ri,Li,Kr,Fi,Ti,Hi,An,Ma,Ca,Ka=ua(async()=>{Ha();li=new TextDecoder("utf8"),ui=new TextEncoder,jr=new FinalizationRegistry(r=>{r()});ar=[void 0],Ua=[];mi={DEFAULT:0,USABLE_WITH_LIGHT_BACKGROUND:1,USABLE_WITH_DARK_BACKGROUND:2},bi={PAD:0,REPEAT:1,REFLECT:2},yi={CLEAR:0,SRC:1,DEST:2,SRC_OVER:3,DEST_OVER:4,SRC_IN:5,DEST_IN:6,SRC_OUT:7,DEST_OUT:8,SRC_ATOP:9,DEST_ATOP:10,XOR:11,PLUS:12,SCREEN:13,OVERLAY:14,DARKEN:15,LIGHTEN:16,COLOR_DODGE:17,COLOR_BURN:18,HARD_LIGHT:19,SOFT_LIGHT:20,DIFFERENCE:21,EXCLUSION:22,MULTIPLY:23,HSL_HUE:24,HSL_SATURATION:25,HSL_COLOR:26,HSL_LUMINOSITY:27},Ai={HIDDEN:1},vi={UNSAFE_TO_BREAK:1,UNSAFE_TO_CONCAT:2,SAFE_TO_INSERT_TATWEEL:4,DEFINED:7},xi=class{constructor(r){let t=r instanceof Uint8Array?r:new Uint8Array(r),e=g.malloc(t.byteLength);c.HEAPU8.set(t,e),this.ptr=g.hb_blob_create(e,t.byteLength,2,e,Oa),vn(this,g.hb_blob_destroy)}},yn=65535,Pi={UNCLASSIFIED:0,BASE_GLYPH:1,LIGATURE:2,MARK:3,COMPONENT:4},Ba=class{constructor(r,t=0){typeof r=="number"?this.ptr=g.hb_face_reference(r):this.ptr=g.hb_face_create(r.ptr,t),this.upem=g.hb_face_get_upem(this.ptr),vn(this,g.hb_face_destroy)}referenceTable(r){let t=g.hb_face_reference_table(this.ptr,V(r)),e=g.hb_blob_get_length(t);if(!e)return;let n=g.hb_blob_get_data(t,0);return c.HEAPU8.subarray(n,n+e)}getAxisInfos(){let r=c.stackSave(),t=c.stackAlloc(2048),e=c.stackAlloc(4);c.HEAPU32[e/4]=64,g.hb_ot_var_get_axis_infos(this.ptr,0,e,t);let n={};return Array.from({length:c.HEAPU32[e/4]}).forEach((a,s)=>{let o={axisIndex:c.HEAPU32[t/4+s*8],tag:Ce(c.HEAPU32[t/4+s*8+1]),nameId:c.HEAPU32[t/4+s*8+2],flags:c.HEAPU32[t/4+s*8+3],min:c.HEAPF32[t/4+s*8+4],default:c.HEAPF32[t/4+s*8+5],max:c.HEAPF32[t/4+s*8+6]};n[o.tag]=o}),c.stackRestore(r),n}collectUnicodes(){let r=g.hb_set_create();g.hb_face_collect_unicodes(this.ptr,r);let t=di(r);return g.hb_set_destroy(r),t}getTableScriptTags(r){let t=c.stackSave(),e=V(r),n=0,a=128,s=c.stackAlloc(4),o=c.stackAlloc(512),i=[];for(;a==128;){c.HEAPU32[s/4]=a,g.hb_ot_layout_table_get_script_tags(this.ptr,e,n,s,o),a=c.HEAPU32[s/4];let u=c.HEAPU32.subarray(o/4,o/4+a);i.push(...Array.from(u).map(Ce)),n+=a}return c.stackRestore(t),i}getTableFeatureTags(r){let t=c.stackSave(),e=V(r),n=0,a=128,s=c.stackAlloc(4),o=c.stackAlloc(512),i=[];for(;a==128;){c.HEAPU32[s/4]=a,g.hb_ot_layout_table_get_feature_tags(this.ptr,e,n,s,o),a=c.HEAPU32[s/4];let u=c.HEAPU32.subarray(o/4,o/4+a);i.push(...Array.from(u).map(Ce)),n+=a}return c.stackRestore(t),i}getScriptLanguageTags(r,t){let e=c.stackSave(),n=V(r),a=0,s=128,o=c.stackAlloc(4),i=c.stackAlloc(512),u=[];for(;s==128;){c.HEAPU32[o/4]=s,g.hb_ot_layout_script_get_language_tags(this.ptr,n,t,a,o,i),s=c.HEAPU32[o/4];let _=c.HEAPU32.subarray(i/4,i/4+s);u.push(...Array.from(_).map(Ce)),a+=s}return c.stackRestore(e),u}getLanguageFeatureTags(r,t,e){let n=c.stackSave(),a=V(r),s=0,o=128,i=c.stackAlloc(4),u=c.stackAlloc(512),_=[];for(;o==128;){c.HEAPU32[i/4]=o,g.hb_ot_layout_language_get_feature_tags(this.ptr,a,t,e,s,i,u),o=c.HEAPU32[i/4];let d=c.HEAPU32.subarray(u/4,u/4+o);_.push(...Array.from(d).map(Ce)),s+=o}return c.stackRestore(n),_}getFeatureLookups(r,t){let e=c.stackSave(),n=V(r),a=0,s=128,o=c.stackAlloc(4),i=c.stackAlloc(512),u=[];for(;s==128;){c.HEAPU32[o/4]=s,g.hb_ot_layout_feature_get_lookups(this.ptr,n,t,a,o,i),s=c.HEAPU32[o/4];let _=c.HEAPU32.subarray(i/4,i/4+s);u.push(...Array.from(_)),a+=s}return c.stackRestore(e),u}getGlyphClass(r){return g.hb_ot_layout_get_glyph_class(this.ptr,r)}listNames(){let r=c.stackSave(),t=c.stackAlloc(4),e=g.hb_ot_name_list_names(this.ptr,t),n=c.HEAPU32[t/4],a=[];for(let s=0;s<n;s++)a.push({nameId:c.HEAPU32[e/4+s*3],language:Wr(c.HEAPU32[e/4+s*3+2])});return c.stackRestore(r),a}getName(r,t){let e=c.stackSave(),n=gi(t),a=g.hb_ot_name_get_utf16(this.ptr,r,n,0,0)+1,s=c.stackAlloc(4),o=g.malloc(a*2);c.HEAPU32[s/4]=a,g.hb_ot_name_get_utf16(this.ptr,r,n,s,o);let i=_i(o,a-1);return g.free(o),c.stackRestore(e),i}getFeatureNameIds(r,t){let e=c.stackSave(),n=V(r),a=c.stackAlloc(4),s=c.stackAlloc(4),o=c.stackAlloc(4),i=c.stackAlloc(4),u=c.stackAlloc(4),_=g.hb_ot_layout_feature_get_name_ids(this.ptr,n,t,a,s,o,i,u),d;if(_){let m=c.HEAPU32[a/4],b=c.HEAPU32[s/4],p=c.HEAPU32[o/4],y=c.HEAPU32[i/4],P=c.HEAPU32[u/4];d={paramUiLabelNameIds:Array.from({length:y},(v,S)=>P+S)},m!=yn&&(d.uiLabelNameId=m),b!=yn&&(d.uiTooltipTextNameId=b),p!=yn&&(d.sampleTextNameId=p)}return c.stackRestore(e),d}hasColorPalettes(){return!!g.hb_ot_color_has_palettes(this.ptr)}getColorPalettes(){let r=g.hb_ot_color_palette_get_count(this.ptr),t=[],e=c.stackSave(),n=c.stackAlloc(4),a=c.stackAlloc(512);for(let s=0;s<r;s++){let o=[],i=0,u=128;for(;u===128;){c.HEAPU32[n/4]=u,g.hb_ot_color_palette_get_colors(this.ptr,s,i,n,a),u=c.HEAPU32[n/4];for(let m=0;m<u;m++){let b=Vr(c.HEAPU32[a/4+m]),p=g.hb_ot_color_palette_color_get_name_id(this.ptr,i+m);p!=yn&&(b.nameId=p),o.push(b)}i+=u}let _={colors:o,flags:g.hb_ot_color_palette_get_flags(this.ptr,s)},d=g.hb_ot_color_palette_get_name_id(this.ptr,s);d!=yn&&(_.nameId=d),t.push(_)}return c.stackRestore(e),t}hasColorLayers(){return!!g.hb_ot_color_has_layers(this.ptr)}getGlyphColorLayers(r){let t=[],e=c.stackSave(),n=c.stackAlloc(4),a=c.stackAlloc(1024),s=0,o=128;for(;o===128;){c.HEAPU32[n/4]=o,g.hb_ot_color_glyph_get_layers(this.ptr,r,s,n,a),o=c.HEAPU32[n/4];for(let i=0;i<o;i++){let u=a/4+i*2,_={glyph:c.HEAPU32[u]},d=c.HEAPU32[u+1];d!=65535&&(_.colorIndex=d),t.push(_)}s+=o}return c.stackRestore(e),t}hasColorPaint(){return!!g.hb_ot_color_has_paint(this.ptr)}glyphHasColorPaint(r){return!!g.hb_ot_color_glyph_has_paint(this.ptr,r)}hasColorPng(){return!!g.hb_ot_color_has_png(this.ptr)}},Yr=class{constructor(){this.funcPtrs=[],this.userDataPtrs=[],this.ptr=g.hb_draw_funcs_create();let r=this.ptr,t=this.funcPtrs,e=this.userDataPtrs;jr.register(this,()=>{g.hb_draw_funcs_destroy(r);for(let n of t)c.removeFunction(n);for(let n of e)zt(n)})}setMoveToFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u,_)=>{r(i,u,Q(s),Q(_))},"viiiffi");this.funcPtrs.push(n),g.hb_draw_funcs_set_move_to_func(this.ptr,n,e,0)}setLineToFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u,_)=>{r(i,u,Q(s),Q(_))},"viiiffi");this.funcPtrs.push(n),g.hb_draw_funcs_set_line_to_func(this.ptr,n,e,0)}setQuadraticToFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u,_,d,m)=>{r(i,u,_,d,Q(s),Q(m))},"viiiffffi");this.funcPtrs.push(n),g.hb_draw_funcs_set_quadratic_to_func(this.ptr,n,e,0)}setCubicToFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u,_,d,m,b,p)=>{r(i,u,_,d,m,b,Q(s),Q(p))},"viiiffffffi");this.funcPtrs.push(n),g.hb_draw_funcs_set_cubic_to_func(this.ptr,n,e,0)}setClosePathFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i)=>{r(Q(s),Q(i))},"viiii");this.funcPtrs.push(n),g.hb_draw_funcs_set_close_path_func(this.ptr,n,e,0)}},wi={HORIZONTAL_ASCENDER:V("hasc"),HORIZONTAL_DESCENDER:V("hdsc"),HORIZONTAL_LINE_GAP:V("hlgp"),HORIZONTAL_CLIPPING_ASCENT:V("hcla"),HORIZONTAL_CLIPPING_DESCENT:V("hcld"),VERTICAL_ASCENDER:V("vasc"),VERTICAL_DESCENDER:V("vdsc"),VERTICAL_LINE_GAP:V("vlgp"),HORIZONTAL_CARET_RISE:V("hcrs"),HORIZONTAL_CARET_RUN:V("hcrn"),HORIZONTAL_CARET_OFFSET:V("hcof"),VERTICAL_CARET_RISE:V("vcrs"),VERTICAL_CARET_RUN:V("vcrn"),VERTICAL_CARET_OFFSET:V("vcof"),X_HEIGHT:V("xhgt"),CAP_HEIGHT:V("cpht"),SUBSCRIPT_EM_X_SIZE:V("sbxs"),SUBSCRIPT_EM_Y_SIZE:V("sbys"),SUBSCRIPT_EM_X_OFFSET:V("sbxo"),SUBSCRIPT_EM_Y_OFFSET:V("sbyo"),SUPERSCRIPT_EM_X_SIZE:V("spxs"),SUPERSCRIPT_EM_Y_SIZE:V("spys"),SUPERSCRIPT_EM_X_OFFSET:V("spxo"),SUPERSCRIPT_EM_Y_OFFSET:V("spyo"),STRIKEOUT_SIZE:V("strs"),STRIKEOUT_OFFSET:V("stro"),UNDERLINE_SIZE:V("unds"),UNDERLINE_OFFSET:V("undo")};Ie=class Da{constructor(t){typeof t=="number"?this.ptr=g.hb_font_reference(t):(this.ptr=g.hb_font_create(t.ptr),this._face=t),vn(this,g.hb_font_destroy)}get face(){return this._face||(this._face=new Ba(g.hb_font_get_face(this.ptr))),this._face}subFont(){return new Da(g.hb_font_create_sub_font(this.ptr))}hExtents(){let t=c.stackSave(),e=c.stackAlloc(48);g.hb_font_get_h_extents(this.ptr,e);let n={ascender:c.HEAP32[e/4],descender:c.HEAP32[e/4+1],lineGap:c.HEAP32[e/4+2]};return c.stackRestore(t),n}vExtents(){let t=c.stackSave(),e=c.stackAlloc(48);g.hb_font_get_v_extents(this.ptr,e);let n={ascender:c.HEAP32[e/4],descender:c.HEAP32[e/4+1],lineGap:c.HEAP32[e/4+2]};return c.stackRestore(t),n}glyphName(t){let e=c.stackSave(),n=256,a=c.stackAlloc(n);g.hb_font_glyph_to_string(this.ptr,t,a,n);let s=st(a);return c.stackRestore(e),s}drawGlyph(t,e,n){let a=he(n);try{g.hb_font_draw_glyph(this.ptr,t,e.ptr,a)}finally{zt(a)}}drawGlyphOrFail(t,e,n){let a=he(n);try{return!!g.hb_font_draw_glyph_or_fail(this.ptr,t,e.ptr,a)}finally{zt(a)}}paintGlyph(t,e,n,a=0,s={red:0,green:0,blue:0,alpha:255}){let o=he(n);try{g.hb_font_paint_glyph(this.ptr,t,e.ptr,o,a,zr(s))}finally{zt(o)}}paintGlyphOrFail(t,e,n,a=0,s={red:0,green:0,blue:0,alpha:255}){let o=he(n);try{return!!g.hb_font_paint_glyph_or_fail(this.ptr,t,e.ptr,o,a,zr(s))}finally{zt(o)}}getGlyphColorPng(t){let e=g.hb_ot_color_glyph_reference_png(this.ptr,t),n=g.hb_blob_get_length(e),a;if(n){let s=g.hb_blob_get_data(e,0);a=c.HEAPU8.slice(s,s+n)}return g.hb_blob_destroy(e),a}glyphToPath(t){let e=[];return this.drawGlyph(t,Si(),e),e.join("")}glyphHAdvance(t){return g.hb_font_get_glyph_h_advance(this.ptr,t)}glyphVAdvance(t){return g.hb_font_get_glyph_v_advance(this.ptr,t)}glyphHOrigin(t){let e=c.stackSave(),n=c.stackAlloc(4),a=c.stackAlloc(4),s;return g.hb_font_get_glyph_h_origin(this.ptr,t,n,a)&&(s=[c.HEAP32[n/4],c.HEAP32[a/4]]),c.stackRestore(e),s}glyphVOrigin(t){let e=c.stackSave(),n=c.stackAlloc(4),a=c.stackAlloc(4),s;return g.hb_font_get_glyph_v_origin(this.ptr,t,n,a)&&(s=[c.HEAP32[n/4],c.HEAP32[a/4]]),c.stackRestore(e),s}glyphExtents(t){let e=c.stackSave(),n=c.stackAlloc(16),a;return g.hb_font_get_glyph_extents(this.ptr,t,n)&&(a={xBearing:c.HEAP32[n/4],yBearing:c.HEAP32[n/4+1],width:c.HEAP32[n/4+2],height:c.HEAP32[n/4+3]}),c.stackRestore(e),a}glyph(t,e=0){let n=c.stackSave(),a=c.stackAlloc(4),s;return g.hb_font_get_glyph(this.ptr,t,e,a)&&(s=c.HEAPU32[a/4]),c.stackRestore(n),s}nominalGlyph(t){let e=c.stackSave(),n=c.stackAlloc(4),a;return g.hb_font_get_nominal_glyph(this.ptr,t,n)&&(a=c.HEAPU32[n/4]),c.stackRestore(e),a}variationGlyph(t,e){let n=c.stackSave(),a=c.stackAlloc(4),s;return g.hb_font_get_variation_glyph(this.ptr,t,e,a)&&(s=c.HEAPU32[a/4]),c.stackRestore(n),s}glyphFromName(t){let e=c.stackSave(),n=c.stackAlloc(4),a=hi(t),s;return g.hb_font_get_glyph_from_name(this.ptr,a.ptr,a.length,n)&&(s=c.HEAPU32[n/4]),a.free(),c.stackRestore(e),s}glyphToJson(t){let e=[];return this.drawGlyph(t,Ii(),e),e}setScale(t,e){g.hb_font_set_scale(this.ptr,t,e)}setVariations(t){let e=c.stackSave(),n=c.stackAlloc(8*t.length);t.forEach((a,s)=>{a.writeTo(n+s*8)}),g.hb_font_set_variations(this.ptr,n,t.length),c.stackRestore(e)}setFuncs(t){g.hb_font_set_funcs(this.ptr,t.ptr)}getLookupOpticalBound(t,e,n){return g.hb_ot_layout_lookup_get_optical_bound(this.ptr,t,e,n)}getLigatureCarets(t,e){let n=c.stackSave(),a=0,s=128,o=c.stackAlloc(4),i=c.stackAlloc(512),u=[];for(;s==128;){c.HEAPU32[o/4]=s,g.hb_ot_layout_get_ligature_carets(this.ptr,t,e,a,o,i),s=c.HEAPU32[o/4];let _=c.HEAP32.subarray(i/4,i/4+s);u.push(...Array.from(_)),a+=s}return c.stackRestore(n),u}getMetricPosition(t){let e=c.stackSave(),n=c.stackAlloc(4),a;return g.hb_ot_metrics_get_position(this.ptr,t,n)&&(a=c.HEAP32[n/4]),c.stackRestore(e),a}getMetricPositionWithFallback(t){let e=c.stackSave(),n=c.stackAlloc(4);g.hb_ot_metrics_get_position_with_fallback(this.ptr,t,n);let a=c.HEAP32[n/4];return c.stackRestore(e),a}getMetricVariation(t){return g.hb_ot_metrics_get_variation(this.ptr,t)}getMetricXVariation(t){return g.hb_ot_metrics_get_x_variation(this.ptr,t)}getMetricYVariation(t){return g.hb_ot_metrics_get_y_variation(this.ptr,t)}},Ei=class{constructor(){this.ptr=g.hb_font_funcs_create(),vn(this,g.hb_font_funcs_destroy)}setGlyphExtentsFunc(r){let t=c.addFunction((e,n,a,s,o)=>{let i=r(new Ie(e),a);return i?(c.HEAP32[s/4]=i.xBearing,c.HEAP32[s/4+1]=i.yBearing,c.HEAP32[s/4+2]=i.width,c.HEAP32[s/4+3]=i.height,1):0},"ippipp");g.hb_font_funcs_set_glyph_extents_func(this.ptr,t,0,0)}setGlyphFromNameFunc(r){let t=c.addFunction((e,n,a,s,o,i)=>{let u=r(new Ie(e),st(a,s));return u?(c.HEAPU32[o/4]=u,1):0},"ipppipp");g.hb_font_funcs_set_glyph_from_name_func(this.ptr,t,0,0)}setGlyphHAdvanceFunc(r){let t=c.addFunction((e,n,a,s)=>r(new Ie(e),a),"ippip");g.hb_font_funcs_set_glyph_h_advance_func(this.ptr,t,0,0)}setGlyphVAdvanceFunc(r){let t=c.addFunction((e,n,a,s)=>r(new Ie(e),a),"ippip");g.hb_font_funcs_set_glyph_v_advance_func(this.ptr,t,0,0)}setGlyphHOriginFunc(r){let t=c.addFunction((e,n,a,s,o,i)=>{let u=r(new Ie(e),a);return u?(c.HEAP32[s/4]=u[0],c.HEAP32[o/4]=u[1],1):0},"ippippp");g.hb_font_funcs_set_glyph_h_origin_func(this.ptr,t,0,0)}setGlyphVOriginFunc(r){let t=c.addFunction((e,n,a,s,o,i)=>{let u=r(new Ie(e),a);return u?(c.HEAP32[s/4]=u[0],c.HEAP32[o/4]=u[1],1):0},"ippippp");g.hb_font_funcs_set_glyph_v_origin_func(this.ptr,t,0,0)}setGlyphHKerningFunc(r){let t=c.addFunction((e,n,a,s,o)=>r(new Ie(e),a,s),"ippiip");g.hb_font_funcs_set_glyph_h_kerning_func(this.ptr,t,0,0)}setGlyphNameFunc(r){let t=new TextEncoder,e=c.addFunction((n,a,s,o,i,u)=>{let _=r(new Ie(n),s);return _?(t.encodeInto(_,c.HEAPU8.subarray(o,o+i)),1):0},"ippipip");g.hb_font_funcs_set_glyph_name_func(this.ptr,e,0,0)}setNominalGlyphFunc(r){let t=c.addFunction((e,n,a,s,o)=>{let i=r(new Ie(e),a);return i?(c.HEAPU32[s/4]=i,1):0},"ippipp");g.hb_font_funcs_set_nominal_glyph_func(this.ptr,t,0,0)}setVariationGlyphFunc(r){let t=c.addFunction((e,n,a,s,o,i)=>{let u=r(new Ie(e),a,s);return u?(c.HEAPU32[o/4]=u,1):0},"ippiipp");g.hb_font_funcs_set_variation_glyph_func(this.ptr,t,0,0)}setFontHExtentsFunc(r){let t=c.addFunction((e,n,a,s)=>{let o=r(new Ie(e));return o?(c.HEAP32[a/4]=o.ascender,c.HEAP32[a/4+1]=o.descender,c.HEAP32[a/4+2]=o.lineGap,1):0},"ipppp");g.hb_font_funcs_set_font_h_extents_func(this.ptr,t,0,0)}setFontVExtentsFunc(r){let t=c.addFunction((e,n,a,s)=>{let o=r(new Ie(e));return o?(c.HEAP32[a/4]=o.ascender,c.HEAP32[a/4+1]=o.descender,c.HEAP32[a/4+2]=o.lineGap,1):0},"ipppp");g.hb_font_funcs_set_font_v_extents_func(this.ptr,t,0,0)}};ki=class{constructor(){this.funcPtrs=[],this.userDataPtrs=[],this.ptr=g.hb_paint_funcs_create();let r=this.ptr,t=this.funcPtrs,e=this.userDataPtrs;jr.register(this,()=>{g.hb_paint_funcs_destroy(r);for(let n of t)c.removeFunction(n);for(let n of e)zt(n)})}setPushTransformFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u,_,d,m,b)=>r(o,i,u,_,d,m,Q(s),Q(b)),"viiffffffi");this.funcPtrs.push(n),g.hb_paint_funcs_set_push_transform_func(this.ptr,n,e,0)}setPopTransformFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o)=>r(Q(s),Q(o)),"viii");this.funcPtrs.push(n),g.hb_paint_funcs_set_pop_transform_func(this.ptr,n,e,0)}setColorGlyphFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u)=>r(o,new Ie(i),Q(s),Q(u))?1:0,"iiiiii");this.funcPtrs.push(n),g.hb_paint_funcs_set_color_glyph_func(this.ptr,n,e,0)}setPushClipGlyphFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u)=>r(o,new Ie(i),Q(s),Q(u)),"viiiii");this.funcPtrs.push(n),g.hb_paint_funcs_set_push_clip_glyph_func(this.ptr,n,e,0)}setPushClipRectangleFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u,_,d)=>r(o,i,u,_,Q(s),Q(d)),"viiffffi");this.funcPtrs.push(n),g.hb_paint_funcs_set_push_clip_rectangle_func(this.ptr,n,e,0)}setPopClipFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o)=>r(Q(s),Q(o)),"viii");this.funcPtrs.push(n),g.hb_paint_funcs_set_pop_clip_func(this.ptr,n,e,0)}setColorFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u)=>r(o!==0,Vr(i),Q(s),Q(u)),"viiiii");this.funcPtrs.push(n),g.hb_paint_funcs_set_color_func(this.ptr,n,e,0)}setImageFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u,_,d,m,b)=>{let p=g.hb_blob_get_length(o),y=g.hb_blob_get_data(o,0),P=c.HEAPU8.subarray(y,y+p),v;return m&&(v={xBearing:c.HEAP32[m/4],yBearing:c.HEAP32[m/4+1],width:c.HEAP32[m/4+2],height:c.HEAP32[m/4+3]}),r(P,i,u,Ce(_),v,Q(s),Q(b))?1:0},"iiiiiiifii");this.funcPtrs.push(n),g.hb_paint_funcs_set_image_func(this.ptr,n,e,0)}setLinearGradientFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u,_,d,m,b,p)=>r(Gr(o),i,u,_,d,m,b,Q(s),Q(p)),"viiiffffffi");this.funcPtrs.push(n),g.hb_paint_funcs_set_linear_gradient_func(this.ptr,n,e,0)}setRadialGradientFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u,_,d,m,b,p)=>r(Gr(o),i,u,_,d,m,b,Q(s),Q(p)),"viiiffffffi");this.funcPtrs.push(n),g.hb_paint_funcs_set_radial_gradient_func(this.ptr,n,e,0)}setSweepGradientFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u,_,d,m)=>r(Gr(o),i,u,_,d,Q(s),Q(m)),"viiiffffi");this.funcPtrs.push(n),g.hb_paint_funcs_set_sweep_gradient_func(this.ptr,n,e,0)}setPushGroupFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o)=>r(Q(s),Q(o)),"viii");this.funcPtrs.push(n),g.hb_paint_funcs_set_push_group_func(this.ptr,n,e,0)}setPopGroupFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i)=>r(o,Q(s),Q(i)),"viiii");this.funcPtrs.push(n),g.hb_paint_funcs_set_pop_group_func(this.ptr,n,e,0)}setCustomPaletteColorFunc(r,t){let e=he(t);this.userDataPtrs.push(e);let n=c.addFunction((a,s,o,i,u)=>{let _=r(o,Q(s),Q(u));return _!==void 0?(c.HEAPU32[i/4]=zr(_),1):0},"iiiiii");this.funcPtrs.push(n),g.hb_paint_funcs_set_custom_palette_color_func(this.ptr,n,e,0)}},Ga={INVALID:0,UNICODE:1,GLYPHS:2},za={DEFAULT:0,NO_CLUSTERS:1,NO_POSITIONS:2,NO_GLYPH_NAMES:4,GLYPH_EXTENTS:8,GLYPH_FLAGS:16,NO_ADVANCES:32,DEFINED:63},Ni={DEFAULT:0,BOT:1,EOT:2,PRESERVE_DEFAULT_IGNORABLES:4,REMOVE_DEFAULT_IGNORABLES:8,DO_NOT_INSERT_DOTTED_CIRCLE:16,VERIFY:32,PRODUCE_UNSAFE_TO_CONCAT:64,PRODUCE_SAFE_TO_INSERT_TATWEEL:128,DEFINED:255},Ri={INVALID:0,LTR:4,RTL:5,TTB:6,BTT:7},Li={MONOTONE_GRAPHEMES:0,MONOTONE_CHARACTERS:1,CHARACTERS:2,GRAPHEMES:3,DEFAULT:0},Kr={INVALID:0,TEXT:V("TEXT"),JSON:V("JSON")},Fi=class ja{constructor(t){t!=null?this.ptr=g.hb_buffer_reference(t):this.ptr=g.hb_buffer_create(),vn(this,g.hb_buffer_destroy)}add(t,e){g.hb_buffer_add(this.ptr,t,e)}addText(t,e=0,n){let a=pi(t);g.hb_buffer_add_utf16(this.ptr,a.ptr,a.length,e,n??a.length),a.free()}addCodePoints(t,e=0,n){let a=g.malloc(t.length*4);c.HEAPU32.subarray(a/4,a/4+t.length).set(t),g.hb_buffer_add_codepoints(this.ptr,a,t.length,e,n??t.length),g.free(a)}guessSegmentProperties(){g.hb_buffer_guess_segment_properties(this.ptr)}setDirection(t){g.hb_buffer_set_direction(this.ptr,t)}setFlags(t){g.hb_buffer_set_flags(this.ptr,t)}setLanguage(t){let e=At(t);g.hb_buffer_set_language(this.ptr,g.hb_language_from_string(e.ptr,-1)),e.free()}setScript(t){let e=At(t);g.hb_buffer_set_script(this.ptr,g.hb_script_from_string(e.ptr,-1)),e.free()}setClusterLevel(t){g.hb_buffer_set_cluster_level(this.ptr,t)}reset(){g.hb_buffer_reset(this.ptr)}clearContents(){g.hb_buffer_clear_contents(this.ptr)}setMessageFunc(t){let e=(a,s,o,i)=>{let u=st(o);return t(new ja(a),new Ie(s),u)?1:0},n=c.addFunction(e,"iiiii");g.hb_buffer_set_message_func(this.ptr,n,0,0)}getLength(){return g.hb_buffer_get_length(this.ptr)}getGlyphInfos(){let t=g.hb_buffer_get_glyph_infos(this.ptr,0),e=c.HEAPU32.subarray(t/4,t/4+this.getLength()*5),n=[];for(let a=0;a<e.length;a+=5)n.push({codepoint:e[a],cluster:e[a+2],flags:g.hb_glyph_info_get_glyph_flags(t+a*4)});return n}getGlyphPositions(){let t=g.hb_buffer_get_glyph_positions(this.ptr,0)/4;if(t==0)return[];let e=c.HEAP32.subarray(t,t+this.getLength()*5),n=[];for(let a=0;a<e.length;a+=5)n.push({xAdvance:e[a],yAdvance:e[a+1],xOffset:e[a+2],yOffset:e[a+3]});return n}getGlyphInfosAndPositions(){let t=g.hb_buffer_get_glyph_infos(this.ptr,0),e=c.HEAPU32.subarray(t/4,t/4+this.getLength()*5),n=g.hb_buffer_get_glyph_positions(this.ptr,0)/4,a=n?c.HEAP32.subarray(n,n+this.getLength()*5):void 0,s=[];for(let o=0;o<e.length;o+=5){let i={codepoint:e[o],cluster:e[o+2],flags:g.hb_glyph_info_get_glyph_flags(t+o*4)};for(let[u,_]of[["mask",1],["var1",3],["var2",4]])Object.defineProperty(i,u,{value:e[o+_],enumerable:!1});a&&(i.xAdvance=a[o],i.yAdvance=a[o+1],i.xOffset=a[o+2],i.yOffset=a[o+3],Object.defineProperty(i,"var",{value:a[o+4],enumerable:!1})),s.push(i)}return s}updateGlyphPositions(t){let e=g.hb_buffer_get_glyph_positions(this.ptr,0)/4;if(e==0)return;let n=Math.min(t.length,this.getLength()),a=c.HEAP32.subarray(e,e+n*5);for(let s=0;s<n;s++)a[s*5]=t[s].xAdvance,a[s*5+1]=t[s].yAdvance,a[s*5+2]=t[s].xOffset,a[s*5+3]=t[s].yOffset}serialize(t={}){let{font:e,start:n=0,end:a,format:s=Kr.TEXT,flags:o=0}=t,i=c.stackSave(),u=a??this.getLength(),_=32*1024,d=g.malloc(_),m=c.stackAlloc(4),b="";for(;n<u;){n+=g.hb_buffer_serialize(this.ptr,n,u,d,_,m,e?e.ptr:0,s,o);let p=c.HEAPU32[m/4];if(p==0)break;b+=st(d,p)}return g.free(d),c.stackRestore(i),b}getContentType(){return g.hb_buffer_get_content_type(this.ptr)}},Ti=class rr{static{this.GLOBAL_START=0}static{this.GLOBAL_END=4294967295}constructor(t,e=1,n=rr.GLOBAL_START,a=rr.GLOBAL_END){this.tag=t,this.value=e,this.start=n,this.end=a}static fromString(t){let e=c.stackSave(),n=c.stackAlloc(16),a=At(t),s;return g.hb_feature_from_string(a.ptr,-1,n)&&(s=new rr(Ce(c.HEAPU32[n/4]),c.HEAPU32[n/4+1],c.HEAPU32[n/4+2],c.HEAPU32[n/4+3])),a.free(),c.stackRestore(e),s}toString(){let t=c.stackSave(),e=c.stackAlloc(16);this.writeTo(e);let n=128,a=c.stackAlloc(n);g.hb_feature_to_string(e,a,n);let s=st(a);return c.stackRestore(t),s}writeTo(t){c.HEAPU32[t/4]=V(this.tag),c.HEAPU32[t/4+1]=this.value,c.HEAPU32[t/4+2]=this.start,c.HEAPU32[t/4+3]=this.end}},Hi=class Wa{constructor(t,e=0){this.tag=t,this.value=e}static fromString(t){let e=c.stackSave(),n=c.stackAlloc(8),a=At(t),s;return g.hb_variation_from_string(a.ptr,-1,n)&&(s=new Wa(Ce(c.HEAPU32[n/4]),c.HEAPF32[n/4+1])),a.free(),c.stackRestore(e),s}toString(){let t=c.stackSave(),e=c.stackAlloc(8);this.writeTo(e);let n=128,a=c.stackAlloc(n);g.hb_variation_to_string(e,a,n);let s=st(a);return c.stackRestore(t),s}writeTo(t){c.HEAPU32[t/4]=V(this.tag),c.HEAPF32[t/4+1]=this.value}},An={DONT_STOP:0,GSUB:1,GPOS:2};Ma=3,Ca=3;fi(await Ta())});function Co(r,t){if(r.startsWith("/*",t)){let n=r.indexOf("*/",t+2);return n===-1?r.length:n+2}let e=r[t];if(e==='"'||e==="'"){for(let n=t+1;n<r.length;n++)if(r[n]==="\\")n++;else if(r[n]===e||r[n]===`
2
+ `)return n+1;return r.length}return t}function Zn(r){return r.replace(/\\(?:([0-9a-fA-F]{1,6})\s?|(\n)|(.))/gs,(t,e,n,a)=>e?String.fromCodePoint(Number.parseInt(e,16)||65533):n?"":a??"")}function Sr(r){let t=/^(["'])((?:\\.|(?!\1).)*)\1$/s.exec(r);if(t)return Zn(t[2]);if(/^(?:-?[_a-zA-Z -\u{10ffff}\\][-\w -\u{10ffff}\\]*\s*)+$/u.test(r))return Zn(r).replace(/\s+/g," ").trim()}function fa(r,t=0){let e=[];for(let n of Oo(r)){let a=n.text,s=a.length-a.trimStart().length,o=t+n.start+s,i=o+a.trim().length,u=/^\s*(url|local)\(\s*(?:(["'])((?:\\.|(?!\2).)*)\2|([^)]*?))\s*\)\s*(.*)$/is.exec(a);if(!u)continue;let _=u[3]!==void 0?Zn(u[3]):Zn(u[4].trim());if(u[1].toLowerCase()==="local"){e.push({kind:"local",name:Sr(_)??_,start:o,end:i});continue}let d=/format\(\s*["']?([^"')]+)["']?\s*\)/i.exec(u[5]??"");e.push({kind:"url",url:_,...d?{format:d[1].toLowerCase()}:{},start:o,end:i})}return e}function Oo(r){let t=[],e=0,n=0;for(let a=0;a<=r.length;){let s=a<r.length?Co(r,a):a;if(s!==a){a=s;continue}let o=r[a];o==="("?e++:o===")"?e--:(a===r.length||o===","&&e<=0)&&(t.push({text:r.slice(n,a),start:n}),n=a+1),a++}return t}var Uo={normal:400,bold:700};function _a(r){let t=(r??"normal").trim().toLowerCase().split(/\s+/);if(t[0]==="auto")return[400,400];let e=t.map(n=>Uo[n]??Number(n));if(!(e.length>2||e.some(n=>!Number.isFinite(n)||n<1||n>1e3)))return kr(e)}var Bo={"ultra-condensed":50,"extra-condensed":62.5,condensed:75,"semi-condensed":87.5,normal:100,"semi-expanded":112.5,expanded:125,"extra-expanded":150,"ultra-expanded":200};function Ir(r){let t=(r??"normal").trim().toLowerCase().split(/\s+/);if(t[0]==="auto")return[100,100];let e=t.map(n=>Bo[n]??(n.endsWith("%")?Number(n.slice(0,-1)):Number.NaN));if(!(e.length>2||e.some(n=>!Number.isFinite(n)||n<=0)))return kr(e)}function Er(r){let t=(r??"normal").trim().toLowerCase().split(/\s+/);if(t[0]==="normal"||t[0]==="auto")return{kind:"normal"};if(t[0]==="italic"&&t.length===1)return{kind:"italic"};if(t[0]!=="oblique")return;if(t.length===1)return{kind:"oblique",angle:[14,14]};let e=t.slice(1).map(n=>n.endsWith("deg")?Number(n.slice(0,-3)):Number.NaN);if(!(e.length>2||e.some(n=>!Number.isFinite(n)||n<-90||n>90)))return{kind:"oblique",angle:kr(e)}}function kr(r){let[t,e=t]=r;return t<=e?[t,e]:[e,t]}function ha(r,t){if(r.length<=1)return[...r];let e=Nr(r,n=>n.stretch,t.stretch,t.stretch<=100?"down":"up");return e=Go(e,t.style),e=Nr(e,n=>n.weight,t.weight,Do(t.weight)),e}function Nr(r,t,e,n){let a=r.filter(i=>t(i)[0]<=e&&e<=t(i)[1]);if(a.length)return a;let s=i=>{let[u,_]=t(i),d=_<e,m=d?e-_:u-e;return n==="down"?d?m:1e6+m:n==="up"?d?1e6+m:m:!d&&u<=500?m:d?1e6+m:2e6+m},o=Number.POSITIVE_INFINITY;for(let i of r)o=Math.min(o,s(i));return r.filter(i=>s(i)===o)}function Do(r){return r<400?"down":r>500?"up":"weight"}function Go(r,t){let e=t.kind==="italic"?["italic","oblique","normal"]:t.kind==="oblique"?["oblique","italic","normal"]:["normal","oblique","italic"];for(let n of e){let a=r.filter(o=>o.style.kind===n);if(!a.length)continue;if(n!=="oblique")return a;let s=t.kind==="oblique"?t.angle[0]:14;return Nr(a,o=>o.style.kind==="oblique"?o.style.angle:[0,0],s,s>=0?"up":"down")}return[...r]}var Xn=class{constructor(t){this.measurer=t}measurer;families=new Map;async add(t,e,n={}){let a=e instanceof Uint8Array?e:new Uint8Array(e),s=this.measurer.loadFont(a);if(n.page!==!1&&typeof FontFace<"u"&&typeof document<"u"){let u={};n.weight&&(u.weight=n.weight),n.stretch&&(u.stretch=n.stretch),n.style&&(u.style=n.style);let _=new FontFace(t,a.slice().buffer,u);await _.load(),document.fonts.add(_)}let o=t.toLowerCase(),i=this.families.get(o)??[];return i.push({family:t,font:s,weight:_a(n.weight)??[400,400],stretch:Ir(n.stretch)??[100,100],style:Er(n.style)??{kind:"normal"}}),this.families.set(o,i),s}use(t,e,n={}){let a=t.toLowerCase(),s=this.families.get(a)??[];s.unshift({family:t,font:e,weight:n.weight??[400,400],stretch:n.stretch??[100,100],style:n.style??{kind:"normal"}}),this.families.set(a,s)}lookup(t,e){for(let n of zo(t)){let a=this.families.get(n.toLowerCase());if(!a?.length)continue;if(!e||a.length===1)return a[0].font;let s=Number.parseFloat(e.fontWeight),o=e.fontStretch.endsWith("%")?Number.parseFloat(e.fontStretch):Ir(e.fontStretch)?.[0]??100;return ha(a,{weight:Number.isFinite(s)?s:400,stretch:o,style:Er(e.fontStyle)??{kind:"normal"}})[0].font}}faces(){return[...this.families.values()].flat()}fallback(){for(let t of this.families.values())if(t.length)return t[0].font}};function zo(r){let t=[];for(let e of r.matchAll(/\s*("((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|[^,]+)\s*(?:,|$)/g)){let n=(e[2]??e[3]??e[1]??"").trim();n&&t.push(n)}return t}var Qn={chromium:{engine:"chromium",sizeUnit:.015625,cffSizeUnit:.015625,sizeRound:"nearest",opticalSize:"css-size",advanceUnit:0,layoutUnit:.015625,syntheticSmallCaps:!1,shapeSegments:!1},firefox:{engine:"firefox",sizeUnit:.015625,cffSizeUnit:.016666666666666666,sizeRound:"nearest",opticalSize:"set-size",advanceUnit:.016666666666666666,layoutUnit:.016666666666666666,syntheticSmallCaps:!1,shapeSegments:!1},webkit:{engine:"webkit",sizeUnit:.015625,cffSizeUnit:.015625,sizeRound:"toward-zero",opticalSize:"none",advanceUnit:0,layoutUnit:.015625,syntheticSmallCaps:!0,shapeSegments:!0}};function qn(r){return/\bFirefox\//.test(r)?"firefox":/\bAppleWebKit\//.test(r)&&!/\b(Chrome|Chromium|HeadlessChrome)\//.test(r)?"webkit":"chromium"}function Rr(){let r=globalThis.navigator?.userAgent??"";return Qn[qn(r)]}function Dt(r,t,e){let n=e?r.cffSizeUnit:r.sizeUnit;if(!n)return t;let a=t/n;return(r.sizeRound==="toward-zero"?Math.trunc(a):Math.round(a))*n}function yt(r,t){if(!r.advanceUnit)return t;let e=1/r.advanceUnit;return Math.round(Math.fround(Math.fround(t)*e))/e}function Lr(){var r=(function(t){var e={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},n={},a={};n.L=1,a[1]="L",Object.keys(e).forEach(function(M,re){n[M]=1<<re+1,a[n[M]]=M}),Object.freeze(n);var s=n.LRI|n.RLI|n.FSI,o=n.L|n.R|n.AL,i=n.B|n.S|n.WS|n.ON|n.FSI|n.LRI|n.RLI|n.PDI,u=n.BN|n.RLE|n.LRE|n.RLO|n.LRO|n.PDF,_=n.S|n.WS|n.B|s|n.PDI|u,d=null;function m(){if(!d){d=new Map;var M=0;for(var re in e)if(e.hasOwnProperty(re))for(var h=e[re],f="",E=void 0,A=!1,x=0,w=0;w<=h.length+1;w+=1){var L=h[w];if(L!==","&&w!==h.length)L==="+"?(A=!0,x=M=x+parseInt(f,36),f=""):f+=L;else{A?E=M+parseInt(f,36):(x=M=x+parseInt(f,36),E=M),A=!1,f="",x=E;for(var U=M;U<E+1;U+=1)d.set(U,n[re])}}}}function b(M){return m(),d.get(M.codePointAt(0))||n.L}function p(M){return a[b(M)]}var y={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function P(M,re){var h=36,f=0,E=new Map,A=re&&new Map,x;return M.split(",").forEach(function w(L){if(L.indexOf("+")!==-1)for(var U=+L;U--;)w(x);else{x=L;var C=L.split(">"),O=C[0],K=C[1];O=String.fromCodePoint(f+=parseInt(O,h)),K=String.fromCodePoint(f+=parseInt(K,h)),E.set(O,K),re&&A.set(K,O)}}),{map:E,reverseMap:A}}var v,S,I;function k(){if(!v){var M=P(y.pairs,!0),re=M.map,h=M.reverseMap;v=re,S=h,I=P(y.canonical,!1).map}}function R(M){return k(),v.get(M)||null}function H(M){return k(),S.get(M)||null}function Y(M){return k(),I.get(M)||null}var N=n.L,F=n.R,G=n.EN,ee=n.ES,D=n.ET,q=n.AN,ie=n.CS,$=n.B,te=n.S,j=n.ON,ve=n.BN,ae=n.NSM,Ne=n.AL,xe=n.LRO,z=n.RLO,Pe=n.LRE,X=n.RLE,se=n.PDF,me=n.LRI,Oe=n.RLI,Je=n.FSI,le=n.PDI;function De(M,re){for(var h=125,f=new Uint32Array(M.length),E=0;E<M.length;E++)f[E]=b(M[E]);var A=new Map;function x(we,Te){var Se=f[we];f[we]=Te,A.set(Se,A.get(Se)-1),Se&i&&A.set(i,A.get(i)-1),A.set(Te,(A.get(Te)||0)+1),Te&i&&A.set(i,(A.get(i)||0)+1)}for(var w=new Uint8Array(M.length),L=new Map,U=[],C=null,O=0;O<M.length;O++)C||U.push(C={start:O,end:M.length-1,level:re==="rtl"?1:re==="ltr"?0:Kn(O,!1)}),f[O]&$&&(C.end=O,C=null);for(var K=X|Pe|z|xe|s|le|se|$,W=function(we){return we+(we&1?1:2)},J=function(we){return we+(we&1?2:1)},ce=0;ce<U.length;ce++){C=U[ce];var Z=[{_level:C.level,_override:0,_isolate:0}],ne=void 0,ge=0,be=0,Ge=0;A.clear();for(var de=C.start;de<=C.end;de++){var ye=f[de];if(ne=Z[Z.length-1],A.set(ye,(A.get(ye)||0)+1),ye&i&&A.set(i,(A.get(i)||0)+1),ye&K)if(ye&(X|Pe)){w[de]=ne._level;var Pn=(ye===X?J:W)(ne._level);Pn<=h&&!ge&&!be?Z.push({_level:Pn,_override:0,_isolate:0}):ge||be++}else if(ye&(z|xe)){w[de]=ne._level;var wn=(ye===z?J:W)(ne._level);wn<=h&&!ge&&!be?Z.push({_level:wn,_override:ye&z?F:N,_isolate:0}):ge||be++}else if(ye&s){ye&Je&&(ye=Kn(de+1,!0)===1?Oe:me),w[de]=ne._level,ne._override&&x(de,ne._override);var Yt=(ye===Oe?J:W)(ne._level);Yt<=h&&ge===0&&be===0?(Ge++,Z.push({_level:Yt,_override:0,_isolate:1,_isolInitIndex:de})):ge++}else if(ye&le){if(ge>0)ge--;else if(Ge>0){for(be=0;!Z[Z.length-1]._isolate;)Z.pop();var Kt=Z[Z.length-1]._isolInitIndex;Kt!=null&&(L.set(Kt,de),L.set(de,Kt)),Z.pop(),Ge--}ne=Z[Z.length-1],w[de]=ne._level,ne._override&&x(de,ne._override)}else ye&se?(ge===0&&(be>0?be--:!ne._isolate&&Z.length>1&&(Z.pop(),ne=Z[Z.length-1])),w[de]=ne._level):ye&$&&(w[de]=C.level);else w[de]=ne._level,ne._override&&ye!==ve&&x(de,ne._override)}for(var Ke=[],He=null,Le=C.start;Le<=C.end;Le++){var wt=f[Le];if(!(wt&u)){var Sn=w[Le],ze=wt&s,dr=wt===le;He&&Sn===He._level?(He._end=Le,He._endsWithIsolInit=ze):Ke.push(He={_start:Le,_end:Le,_level:Sn,_startsWithPDI:dr,_endsWithIsolInit:ze})}}for(var ct=[],St=0;St<Ke.length;St++){var Ze=Ke[St];if(!Ze._startsWithPDI||Ze._startsWithPDI&&!L.has(Ze._start)){for(var Jt=[He=Ze],In=void 0;He&&He._endsWithIsolInit&&(In=L.get(He._end))!=null;)for(var It=St+1;It<Ke.length;It++)if(Ke[It]._start===In){Jt.push(He=Ke[It]);break}for(var Xe=[],Zt=0;Zt<Jt.length;Zt++)for(var En=Jt[Zt],Xt=En._start;Xt<=En._end;Xt++)Xe.push(Xt);for(var mr=w[Xe[0]],kn=C.level,Et=Xe[0]-1;Et>=0;Et--)if(!(f[Et]&u)){kn=w[Et];break}var Qt=Xe[Xe.length-1],br=w[Qt],Nn=C.level;if(!(f[Qt]&s)){for(var kt=Qt+1;kt<=C.end;kt++)if(!(f[kt]&u)){Nn=w[kt];break}}ct.push({_seqIndices:Xe,_sosType:Math.max(kn,mr)%2?F:N,_eosType:Math.max(Nn,br)%2?F:N})}}for(var qt=0;qt<ct.length;qt++){var $t=ct[qt],B=$t._seqIndices,lt=$t._sosType,yr=$t._eosType,Qe=w[B[0]]&1?F:N;if(A.get(ae))for(var Nt=0;Nt<B.length;Nt++){var Rn=B[Nt];if(f[Rn]&ae){for(var en=lt,Rt=Nt-1;Rt>=0;Rt--)if(!(f[B[Rt]]&u)){en=f[B[Rt]];break}x(Rn,en&(s|le)?j:en)}}if(A.get(G))for(var Lt=0;Lt<B.length;Lt++){var Ln=B[Lt];if(f[Ln]&G)for(var Ft=Lt-1;Ft>=-1;Ft--){var Fn=Ft===-1?lt:f[B[Ft]];if(Fn&o){Fn===Ne&&x(Ln,q);break}}}if(A.get(Ne))for(var tn=0;tn<B.length;tn++){var Tn=B[tn];f[Tn]&Ne&&x(Tn,F)}if(A.get(ee)||A.get(ie))for(var ut=1;ut<B.length-1;ut++){var nn=B[ut];if(f[nn]&(ee|ie)){for(var qe=0,rn=0,an=ut-1;an>=0&&(qe=f[B[an]],!!(qe&u));an--);for(var sn=ut+1;sn<B.length&&(rn=f[B[sn]],!!(rn&u));sn++);qe===rn&&(f[nn]===ee?qe===G:qe&(G|q))&&x(nn,qe)}}if(A.get(G))for(var Me=0;Me<B.length;Me++){var Ar=B[Me];if(f[Ar]&G){for(var Tt=Me-1;Tt>=0&&f[B[Tt]]&(D|u);Tt--)x(B[Tt],G);for(Me++;Me<B.length&&f[B[Me]]&(D|u|G);Me++)f[B[Me]]!==G&&x(B[Me],G)}}if(A.get(D)||A.get(ee)||A.get(ie))for(var ft=0;ft<B.length;ft++){var Hn=B[ft];if(f[Hn]&(D|ee|ie)){x(Hn,j);for(var Ht=ft-1;Ht>=0&&f[B[Ht]]&u;Ht--)x(B[Ht],j);for(var Mt=ft+1;Mt<B.length&&f[B[Mt]]&u;Mt++)x(B[Mt],j)}}if(A.get(G))for(var on=0,Mn=lt;on<B.length;on++){var Cn=B[on],cn=f[Cn];cn&G?Mn===N&&x(Cn,N):cn&o&&(Mn=cn)}if(A.get(i)){var _t=F|G|q,On=_t|N,Ct=[];{for(var $e=[],et=0;et<B.length;et++)if(f[B[et]]&i){var ht=M[B[et]],Un=void 0;if(R(ht)!==null)if($e.length<63)$e.push({char:ht,seqIndex:et});else break;else if((Un=H(ht))!==null)for(var pt=$e.length-1;pt>=0;pt--){var ln=$e[pt].char;if(ln===Un||ln===H(Y(ht))||R(Y(ln))===ht){Ct.push([$e[pt].seqIndex,et]),$e.length=pt;break}}}Ct.sort(function(we,Te){return we[0]-Te[0]})}for(var un=0;un<Ct.length;un++){for(var Bn=Ct[un],Ot=Bn[0],fn=Bn[1],Dn=!1,Fe=0,_n=Ot+1;_n<fn;_n++){var Gn=B[_n];if(f[Gn]&On){Dn=!0;var zn=f[Gn]&_t?F:N;if(zn===Qe){Fe=zn;break}}}if(Dn&&!Fe){Fe=lt;for(var hn=Ot-1;hn>=0;hn--){var jn=B[hn];if(f[jn]&On){var Wn=f[jn]&_t?F:N;Wn!==Qe?Fe=Wn:Fe=Qe;break}}}if(Fe){if(f[B[Ot]]=f[B[fn]]=Fe,Fe!==Qe){for(var gt=Ot+1;gt<B.length;gt++)if(!(f[B[gt]]&u)){b(M[B[gt]])&ae&&(f[B[gt]]=Fe);break}}if(Fe!==Qe){for(var dt=fn+1;dt<B.length;dt++)if(!(f[B[dt]]&u)){b(M[B[dt]])&ae&&(f[B[dt]]=Fe);break}}}}for(var je=0;je<B.length;je++)if(f[B[je]]&i){for(var Vn=je,pn=je,gn=lt,mt=je-1;mt>=0;mt--)if(f[B[mt]]&u)Vn=mt;else{gn=f[B[mt]]&_t?F:N;break}for(var Yn=yr,bt=je+1;bt<B.length;bt++)if(f[B[bt]]&(i|u))pn=bt;else{Yn=f[B[bt]]&_t?F:N;break}for(var dn=Vn;dn<=pn;dn++)f[B[dn]]=gn===Yn?gn:Qe;je=pn}}}for(var ke=C.start;ke<=C.end;ke++){var vr=w[ke],Ut=f[ke];if(vr&1?Ut&(N|G|q)&&w[ke]++:Ut&F?w[ke]++:Ut&(q|G)&&(w[ke]+=2),Ut&u&&(w[ke]=ke===0?C.level:w[ke-1]),ke===C.end||b(M[ke])&(te|$))for(var Bt=ke;Bt>=0&&b(M[Bt])&_;Bt--)w[Bt]=C.level}}return{levels:w,paragraphs:U};function Kn(we,Te){for(var Se=we;Se<M.length;Se++){var We=f[Se];if(We&(F|Ne))return 1;if(We&($|N)||Te&&We===le)return 0;if(We&s){var Jn=xr(Se);Se=Jn===-1?M.length:Jn}}return 0}function xr(we){for(var Te=1,Se=we+1;Se<M.length;Se++){var We=f[Se];if(We&$)break;if(We&le){if(--Te===0)return Se}else We&s&&Te++}return-1}}var Ue="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",Ae;function Ee(){if(!Ae){var M=P(Ue,!0),re=M.map,h=M.reverseMap;h.forEach(function(f,E){re.set(E,f)}),Ae=re}}function pe(M){return Ee(),Ae.get(M)||null}function Ye(M,re,h,f){var E=M.length;h=Math.max(0,h==null?0:+h),f=Math.min(E-1,f==null?E-1:+f);for(var A=new Map,x=h;x<=f;x++)if(re[x]&1){var w=pe(M[x]);w!==null&&A.set(x,w)}return A}function ue(M,re,h,f){var E=M.length;h=Math.max(0,h==null?0:+h),f=Math.min(E-1,f==null?E-1:+f);var A=[];return re.paragraphs.forEach(function(x){var w=Math.max(h,x.start),L=Math.min(f,x.end);if(w<L){for(var U=re.levels.slice(w,L+1),C=L;C>=w&&b(M[C])&_;C--)U[C]=x.level;for(var O=x.level,K=1/0,W=0;W<U.length;W++){var J=U[W];J>O&&(O=J),J<K&&(K=J|1)}for(var ce=O;ce>=K;ce--)for(var Z=0;Z<U.length;Z++)if(U[Z]>=ce){for(var ne=Z;Z+1<U.length&&U[Z+1]>=ce;)Z++;Z>ne&&A.push([ne+w,Z+w])}}}),A}function Pt(M,re,h,f){var E=it(M,re,h,f),A=[].concat(M);return E.forEach(function(x,w){A[w]=(re.levels[x]&1?pe(M[x]):null)||M[x]}),A.join("")}function it(M,re,h,f){for(var E=ue(M,re,h,f),A=[],x=0;x<M.length;x++)A[x]=x;return E.forEach(function(w){for(var L=w[0],U=w[1],C=A.slice(L,U+1),O=C.length;O--;)A[U-O]=C[O]}),A}return t.closingToOpeningBracket=H,t.getBidiCharType=b,t.getBidiCharTypeName=p,t.getCanonicalBracket=Y,t.getEmbeddingLevels=De,t.getMirroredCharacter=pe,t.getMirroredCharactersMap=Ye,t.getReorderSegments=ue,t.getReorderedIndices=it,t.getReorderedString=Pt,t.openingToClosingBracket=R,Object.defineProperty(t,"__esModule",{value:!0}),t})({});return r}var Fr="L R AL EN ES ET AN CS NSM BN B S WS ON LRE LRO RLE RLO PDF LRI RLI FSI PDI".split(" "),pa="0J9L1K1L1M1K1JeK3L1M1N2F3N5E1H1E1H2DaH1N6AqN6AqN4J6K1JqH1N1F4N4A1N2J1N2F2D2N1A1N3D1A1N5AnN1AvN1AchN2A7NeA2NeA5N9A1NhI34A4N2A8N1A5N2A1N1A32N1A3wI7A74N1A2N2F1B1I19B1I1B1I2B1I2B1I1B1kG6N2C1F2C1H1C1N2IbC1cIlGaF1G2C3I1C2tI7G1N1I6C2I2N1I4C2DaCnI1CuIrC2jIbCfB17I9B2N4B3I1BoI4B1I9B1I3B1I5B17I3B4C1cG2C5I9C16IoG1IwA1jI1A1I1A4I8A4I1A3I7AaI2AtI1A1mI1A4I4A8I1AkI2AeF2A7F1A2I1A2I2A1lI1A4I2A4I2A2I3A3I1AuI2A3I1AbI2A1lI1A4I5A1I2A4I1AkI2AdF1A8I6A1I1A1mI1A2I1A1I4A8I1A7I2AbI2AuI1A1pI1AcI1A11N6F1N1A5I1A3I1A1jI1A1I3A5I3A1I4A7I2AbI2AkN7A2I1A1mI1AfI2AkI2AsI2A1lI2A4I4A8I1AkI2AtI1A20I1A7I3A1I1A2iI1A2I7A4F1A7I8A2qI1A2I9AbI7A21I2ArI1A1I1A1I1N4A1fIeA1I5A1I2A5IbA1I10A9I1A2uI4A1I6A1I2A2I2ApI2A4I3AgI4AdI1A2I2A6I1AfI1AjjI3A1cNaA2uN1AhrM1AqN2A39I3AtI2AuI2AuI2A1sI2A1I7A8I1A2IbA7F1A1I1AiNaA6NbI3J1I1A39I2AyI1A3aI3A4I2A9I1A6I3A4N1A3N2A48NyAnI2A2I1A1mI1A1I7A1I1A1I1A2I8A6IaA2I1A1cI1aA2IcAkI4A1cI1A1I5A1I1A5I1A14I9AcI2AwI4A2I2A1I3A1kI1A1I2A3I1A1I3A1mI8A2I2A48I3A1IdA1I7A4I1A6I1A3I2A5iI1sAcdN1A1N3AbN3AdN3AdN3AdN2A1MbJ3A1B1NoM1K1O1Q1S1P1R1H1F5NfH1NqM1J6T1U1V1W1J6D1A3D6E2N3A1DaE2N3AhF1cIxAfN2A1N4A1N2AaN1A1N3A5N6A1N1A1N1A1N1A4F1AbN2A4N5A5N4A2NgA15N3A4N3mE1F1N82A1xNqA1N44AmNbAlN14DkA26NciA1N9fA74NhgA2N3uA6dN6A4I3A7N7A3jI1A2oIwN2mAyNqA1N2hAcN5yAqNgM1N4A3NpA9I4A2N1A5N2A5N3A2hI2N2A3N1A2iN1A5gN12A9N1A19N2A1dNgAsN3A1eNfAcN4A4nN4A2rN2AvN1A534N1sAh3kN1jA92N3A2nI4N1IaN2AuI2A28I2AeNyA2uN1A3dI1A3I1A4I1ApI2A1N4I1AbF2A1mN4A24I2AqIiAdI1A12I8ApIbA1aI3A1cI1A2I4A2I2A13I1A1vI6A2I2A2I2AcI1A8I1A1bI1A1fI1A1I3A2I2A5I2A1I1A16I2A8I1A37N2A3dI1A2I1A4I1Afn3B1I1BaE1B12C37NgCa3NiC1sN2C1iN8JwCdN3IgNaA6IgNwH1N1H1A1N1H1N9F1N2E2N3A1N1F2N1A4C3zJ1A1N2F3N5E1H1E1H2DaH1N6AqN6AqNbA3eF2N3F2A1N7A1J9N5J2A75N1A1qN25A3NdA3N1A2kI1A6aI1DrA3eI5Aw5B7zN1B69I3B1I2B5I4B14I3B4I1B4lI2B2aN7BcgC10I4C8GaC6GaBvI5N1B6pGvB18I2BjCgN9CxI6B1cCmIbCvBiI4B3eA1I1A1iIfAbNkAaI1A2I2AaI3A1dI4A2I2A7I1A1pI3A10I5A1I8A1qI1AcI2A1gI9AaI4A2I1A2nI3A2I1A1I2A6I1A2I1A4dI1A3I8AlI2A1lI2A3I1A11I7A3I5A1yI6AdI1A1I1A1I1AeI2A2dI8A2I3A1I1AnI1A2cI6A1I1A4I2A1I2A6mI4A6I2A1I2ArI2A2dI8A2I1A1I2AvNdA1qI1A1I1A2I6A1I1A2tI1A1I1A2I4A1I5A77I9A1I2A74I2A1I1A4I1A40I4A2I2A4I1AwI6A2I2A14I6A2I4A8I1A9I6A2I3A1aIdA1I2A5iI1A1I3A1I1A5lI7A1I6A2cImA2I7A1I2A1I2A3eI6A3I1A1I2A1I7A1I1A20I2A3I1A1I1A9nI2AbI2A1gI5A5I1A1I1AnI1A3eN8F4NhA40eI1A6IfA8ugIcA3I3A1xcI5A1nI7At4I1A1rI4A27N1A1I1Af5kI2A1J4A318N5yAqDaN3A3Nc4A6NnAfNhAfI1aA2InAf4I3A9J8I8A2I7AuI4A1nN2AlN1uI3N1A56N2fAoaN1ApN1AvN1ApN1AvN1ApN1AvN1ApN1AvN1ApN1AaD1eAe8I1jA4I1eA8I1AeI1AmI5A1IfA11sI7A1IhA2I7A1I2A1I5A2sI1A4gI7AafI1A1pI4AfF1AdoI4A72I2A6rI1A2I1A7I2A5I1A7eB5sI7B31I7BmdC28B1sC28B4wC6oN2CeB74N18A4N2sAcNfA2NfA1NfA1N11AaDbN5AvN1A1mN6A1pN1A4yN6A4aNrdA3NhA3NdA3N62A6NcA4N1AfNcA4N1kA8NaA6N14A8NuA2NcA4N2AeN9A13N9kA8NeA2NdA3NbA3N1lA1N1A4NgA2NcA4NaA7N43A1N2kDaN1AsjJ2A1ekeJ2A1ekeJ2A1ekeJ2A1ekeJ2A1ekeJ2A1ekeJ2A1ekeJ2A1ekeJ2A1ekeJ2A1ekeJ2A1ekeJ2A1ekeJ76I6oJ2s0A1bemJ2A1ekeJ2A1ekeJ",mn=[[40,1],[41,-1],[91,2],[93,-2],[123,3],[125,-3],[3898,4],[3899,-4],[3900,5],[3901,-5],[5787,6],[5788,-6],[8261,7],[8262,-7],[8317,8],[8318,-8],[8333,9],[8334,-9],[8968,10],[8969,-10],[8970,11],[8971,-11],[9001,12],[9002,-12],[10088,13],[10089,-13],[10090,14],[10091,-14],[10092,15],[10093,-15],[10094,16],[10095,-16],[10096,17],[10097,-17],[10098,18],[10099,-18],[10100,19],[10101,-19],[10181,20],[10182,-20],[10214,21],[10215,-21],[10216,22],[10217,-22],[10218,23],[10219,-23],[10220,24],[10221,-24],[10222,25],[10223,-25],[10627,26],[10628,-26],[10629,27],[10630,-27],[10631,28],[10632,-28],[10633,29],[10634,-29],[10635,30],[10636,-30],[10637,31],[10638,-32],[10639,32],[10640,-31],[10641,33],[10642,-33],[10643,34],[10644,-34],[10645,35],[10646,-35],[10647,36],[10648,-36],[10712,37],[10713,-37],[10714,38],[10715,-38],[10748,39],[10749,-39],[11810,40],[11811,-40],[11812,41],[11813,-41],[11814,42],[11815,-42],[11816,43],[11817,-43],[11861,44],[11862,-44],[11863,45],[11864,-45],[11865,46],[11866,-46],[11867,47],[11868,-47],[12296,12],[12297,-12],[12298,48],[12299,-48],[12300,49],[12301,-49],[12302,50],[12303,-50],[12304,51],[12305,-51],[12308,52],[12309,-52],[12310,53],[12311,-53],[12312,54],[12313,-54],[12314,55],[12315,-55],[65113,56],[65114,-56],[65115,57],[65116,-57],[65117,58],[65118,-58],[65288,59],[65289,-59],[65339,60],[65341,-60],[65371,61],[65373,-61],[65375,62],[65376,-62],[65378,63],[65379,-63]];var jo=Lr.default??Lr,er=jo(),Wo={L:"a",R:"\u05D0",AL:"\u0627",EN:"0",ES:"+",ET:"#",AN:"\u0660",CS:",",NSM:"\u0300",BN:"\xAD",B:"\u2029",S:" ",WS:" ",ON:"!",LRE:"\u202A",LRO:"\u202D",RLE:"\u202B",RLO:"\u202E",PDF:"\u202C",LRI:"\u2066",RLI:"\u2067",FSI:"\u2068",PDI:"\u2069"},nt,bn,$n;function Vo(){if(!nt||!bn||!$n){let r=[...pa.matchAll(/([0-9a-z]+)([A-Z])/g)];nt=new Uint32Array(r.length),bn=new Uint8Array(r.length);let t=0;for(let[e,[,n,a]]of r.entries())t+=Number.parseInt(n,36),nt[e]=t,bn[e]=a.charCodeAt(0)-65;$n=new Uint8Array(65536);for(let e=0;e<nt.length&&nt[e]<65536;e++)$n.fill(bn[e],nt[e],Math.min(nt[e+1]??65536,65536))}return{starts:nt,classes:bn,bmp:$n}}function ga(r){let t=Vo();if(r<65536)return t.bmp[r];let e=0,n=t.starts.length-1;for(;e<n;){let a=e+n+1>>1;t.starts[a]<=r?e=a:n=a-1}return t.classes[e]}var Yo=Fr.map(r=>Wo[r]),da=new Set(["R","AL","AN","LRE","LRO","RLE","RLO","LRI","RLI","FSI"].map(r=>Fr.indexOf(r))),Ko=new Map(mn),ma;function Jo(){return ma??=mn.filter(([r,t])=>t>0&&r<65536).flatMap(([r,t])=>{let e=mn.find(([s,o])=>o===-t&&s<65536),n=String.fromCharCode(r);if(!e||mn.filter(([,s])=>s===t).length>1)return[];let a=String.fromCharCode(e[0]);return er.openingToClosingBracket(n)!==a||er.getCanonicalBracket(n)||er.getCanonicalBracket(a)?[]:[[n,a]]}),ma}function Tr(r,t,e=[]){let n="",a=new Uint32Array(r.length),s=t==="rtl",o=new Map,i=0;for(let _=0;_<r.length;){for(;i<e.length&&e[i].at<=_;i++){for(let P of e[i].controls)da.has(ga(P.codePointAt(0)))&&(s=!0);n+=e[i].controls}let d=r.codePointAt(_),m=d>65535?2:1,b=ga(d);da.has(b)&&(s=!0);let p=Yo[b],y=Ko.get(d);if(y!==void 0){let P=Math.abs(y);o.has(P)||o.set(P,o.size);let v=Jo()[o.get(P)];v&&(p=v[y>0?0:1])}for(let P=0;P<m;P++)a[_+P]=n.length,n+=p;_+=m}if(!s)return new Uint8Array(r.length);for(;i<e.length;i++)n+=e[i].controls;let u=er.getEmbeddingLevels(n,t).levels;return e.length?Uint8Array.from(a,_=>u[_]):u}function ba(r,t){let e=r==="rtl";switch(t.replace(/^-\w+-/,"")){case"embed":return{open:e?"\u202B":"\u202A",close:"\u202C"};case"isolate":return{open:e?"\u2067":"\u2066",close:"\u2069"};case"bidi-override":return{open:e?"\u202E":"\u202D",close:"\u202C"};case"isolate-override":return{open:e?"\u2067\u202E":"\u2066\u202D",close:"\u202C\u2069"};case"plaintext":return{open:"\u2068",close:"\u2069"};default:return{open:"",close:""}}}function Hr(r,t=0,e=r.length){let n=[];for(let a=t;a<e;a++){let s=r[a]??r[r.length-1]??0,o=n.at(-1);o?.level===s?o.end=a+1:n.push({start:a,end:a+1,level:s})}return n}var Gt=new Map,Zo=16;function ya(r,t,e=0,n=r.length){if(e>=n)return[];let a=t+r,s=Gt.get(a);return s?Gt.delete(a):(s=Tr(r,t),Gt.size>=Zo&&Gt.delete(Gt.keys().next().value)),Gt.set(a,s),Hr(s,e,n)}function Aa(r){let t=r.map((a,s)=>s);if(!r.length)return t;let e=Math.max(...r),n=Math.min(...r.map(a=>a%2?a:a+1));for(let a=e;a>=n;a--)for(let s=0;s<t.length;){if(r[t[s]]<a){s++;continue}let o=s;for(;o<t.length&&r[t[o]]>=a;)o++;let i=t.slice(s,o).reverse();t.splice(s,o-s,...i),s=o}return t}var Mr="Zyyy Zinh Arab Armn Beng Bopo Cher Copt Cyrl Dsrt Deva Ethi Geor Goth Grek Gujr Guru Hani Hang Hebr Hira Knda Kana Khmr Laoo Latn Mlym Mong Mymr Ogam Ital Orya Runr Sinh Syrc Taml Telu Thaa Thai Tibt Cans Yiii Tglg Hano Buhd Tagb Brai Cprt Limb Linb Osma Shaw Tale Ugar Hrkt Bugi Glag Khar Sylo Talu Tfng Xpeo Bali Batk Blis Brah Cham Cirt Cyrs Egyd Egyh Egyp Geok Hans Hant Hmng Hung Inds Java Kali Latf Latg Lepc Lina Mand Maya Mero Nkoo Orkh Perm Phag Phnx Plrd Roro Sara Syre Syrj Syrn Teng Vaii Visp Xsux Zxxx Zzzz Cari Jpan Lana Lyci Lydi Olck Rjng Saur Sgnw Sund Moon Mtei Armi Avst Cakm Kore Kthi Mani Phli Phlp Phlv Prti Samr Tavt Zmth Zsym Bamu Lisu Nkgb Sarb Bass Dupl Elba Gran Kpel Loma Mend Merc Narb Nbat Palm Sind Wara Afak Jurc Mroo Nshu Shrd Sora Takr Tang Wole Hluw Khoj Tirh Aghb Mahj Ahom Hatr Modi Mult Pauc Sidd Adlm Bhks Marc Newa Osge Hanb Jamo Zsye Gonm Soyo Zanb Dogr Gong Maka Medf Rohg Sogd Sogo Elym Hmnp Nand Wcho Chrs Diak Kits Yezi Cpmn Ougr Tnsa Toto Vith Kawi Nagm Aran Gara Gukh Krai Onao Sunu Todr Tutg Berf Sidt Tayo Tols Hntl".split(" "),Cr=[[40,41],[91,93],[123,125],[3898,3899],[3900,3901],[5787,5788],[8261,8262],[8317,8318],[8333,8334],[8968,8969],[8970,8971],[9001,9002],[10088,10089],[10090,10091],[10092,10093],[10094,10095],[10096,10097],[10098,10099],[10100,10101],[10181,10182],[10214,10215],[10216,10217],[10218,10219],[10220,10221],[10222,10223],[10627,10628],[10629,10630],[10631,10632],[10633,10634],[10635,10636],[10637,10640],[10639,10638],[10641,10642],[10643,10644],[10645,10646],[10647,10648],[10712,10713],[10714,10715],[10748,10749],[11810,11811],[11812,11813],[11814,11815],[11816,11817],[11861,11862],[11863,11864],[11865,11866],[11867,11868],[12296,12297],[12298,12299],[12300,12301],[12302,12303],[12304,12305],[12308,12309],[12310,12311],[12312,12313],[12314,12315],[65113,65114],[65115,65116],[65117,65118],[65288,65289],[65339,65341],[65371,65373],[65375,65376],[65378,65379]],va=[9001,12296,12298,12300,12302,12304,12308,12310,12312,12314,65113,65115,65117,65288,65339,65371,65375,65378];var Dr="Latn Grek Cyrl Arab Hebr Hani Hira Kana Hang Deva Beng Thai Armn Geor Ethi Taml Telu Knda Mlym Gujr Guru Orya Sinh Khmr Laoo Mymr Tibt Syrc Thaa Nkoo Copt Glag Goth Runr Ogam Cher Cans Mong Bopo Yiii Tfng Vaii Adlm Aghb Ahom Armi Avst Bali Bamu Bass Batk Berf Bhks Brah Brai Bugi Buhd Cakm Cari Cham Chrs Cpmn Cprt Diak Dogr Dsrt Dupl Egyp Elba Elym Gara Gong Gonm Gran Gukh Hano Hatr Hluw Hmng Hmnp Hung Ital Java Kali Kawi Khar Khoj Kits Krai Kthi Lana Lepc Limb Lina Linb Lisu Lyci Lydi Mahj Maka Mand Mani Marc Medf Mend Merc Mero Miao Modi Mroo Mtei Mult Nagm Nand Narb Nbat Newa Nshu Olck Onao Orkh Osge Osma Ougr Palm Pauc Perm Phag Phli Phlp Phnx Plrd Prti Rjng Rohg Samr Sarb Saur Sgnw Shaw Shrd Sidd Sidt Sind Sogd Sogo Sora Soyo Sund Sunu Sylo Tagb Takr Tale Talu Tang Tavt Tayo Tglg Tirh Tnsa Todr Tols Toto Tutg Ugar Vith Wara Wcho Xpeo Xsux Yezi Zanb".split(" "),ka={Hira:"Hani",Kana:"Hani"},Xo=new Map(Cr),Qo=new Map(Cr.map(([r,t])=>[t,r])),qo=new Set(va),xa=32,$o=/[\p{sc=Zyyy}\p{sc=Zinh}\p{sc=Zzzz}]/u,Pa=new Map,Or=new Map;function Br(r){if(r<128)return r>=65&&r<=90||r>=97&&r<=122?"Latn":void 0;if(Or.has(r))return Or.get(r);let t=String.fromCodePoint(r),e;if(!$o.test(t))for(let n of Dr){let a=Pa.get(n);if(a===void 0){try{a=new RegExp(`\\p{sc=${n}}`,"u")}catch{a=null}Pa.set(n,a)}if(a?.test(t)){e=n;break}}return Or.set(r,e),e}var ei=/\p{sc=Zinh}/u,ti=new Map(Mr.map((r,t)=>[r,t])),nr=r=>ti.get(r)??Mr.length,wa=new Set(["Hani","Bopo"]),Sa=new Map,Ia=new Map,ni=["Latn"],Na=["Zyyy"],ri=["Zinh"],Ur,ai;function si(r){let t=Sa.get(r);if(t===void 0){try{t=new RegExp(`\\p{scx=${r}}`,"u")}catch{t=null}Sa.set(r,t)}return t}function oi(){if(Ur===void 0){let r=e=>`[\\p{scx=${e}}--\\p{sc=${e}}]`,t=Dr.filter(e=>{try{return!!new RegExp(r(e),"v")}catch{return!1}});Ur=t.length?new RegExp(`[${t.map(r).join("")}]`,"v"):null}return Ur}function Ra(r,t){return oi()?.test(r)===!1?t?[t]:[]:Dr.filter(e=>si(e)?.test(r)).sort((e,n)=>nr(e)-nr(n))}function La(r){return[...new Set(r.map(t=>ka[t]??t))]}function Ea(r){for(let t=1;t<r.length;t++)(r[0]==="Latn"||nr(r[t])<nr(r[0]))&&([r[0],r[t]]=[r[t],r[0]]);return r}function ii(r){if(r<128)return Br(r)?ni:Na;let t=Ia.get(r);if(t)return t;let e=Br(r),n=String.fromCodePoint(r),a=e??(ei.test(n)?"Zinh":"Zyyy"),s=e==="Hira"||e==="Kana"?[e]:Ra(n,e),o;if(s.length===0||s[0]===a)o=s.length?s:[a];else if(e){let i=s.indexOf(e);i<0?o=[e,...s.slice(1),s[0]]:(s[i]=s[0],s[0]=e,o=s)}else a==="Zyyy"?o=s.length===1?["Zyyy",s[0]]:Ea(s):o=["Zinh",...Ea([...s.slice(1),s[0]])];return t=La(o),Ia.set(r,t),t}var tr=r=>r==="Zyyy"||r==="Zinh";function Fa(r,t=0,e=r.length){let n=[],a=[];for(let P=t;P<e;){let v=r.codePointAt(P),S=ii(v),I=a.length;I>0&&S[0]==="Zinh"&&S.length>1&&(a[I-1][0]==="Zyyy"&&(a[I-1]=S.slice(1)),S=ri),n.push(P),a.push(S),P+=v>65535?2:1}let s=[],o=Na,i="Zyyy",u,_=t,d=[],m=0,b=()=>o[0]==="Zyyy"?i:o[0],p=P=>{let v=b(),S=tr(v)?void 0:u&&(ka[u]??u)===v?u:v;return s.push(S===void 0?{start:_,end:P}:{start:_,end:P,script:S}),v},y=P=>{let v=o[0];if(tr(P[0]))return P.length===2&&tr(v)&&i==="Zyyy"&&(i=P[1]),!0;if(tr(v))return o=P,!0;let S=P.includes(v);if(o.length===1)return S;let I=v,k=0;S||(I=P[0],k=1,S=o.indexOf(I,1)>0);let R=S?[I]:[];if(k<P.length)for(let H of o.slice(1))P.indexOf(H,k)>=0&&R.push(H);return R.length===0?!1:(o=R,!0)};for(let P=0;P<n.length;P++){let v=r.codePointAt(n[P]),S=a[P],I=Xo.has(v);if(I)S.length===1&&S[0]==="Zyyy"&&qo.has(v)&&(S=ai??=La(Ra("\u300C",void 0))),d.length===xa&&(d.shift(),m===xa&&m--),d.push({cp:v,script:"Zyyy"}),m++;else{let k=Qo.get(v),R=k===void 0?-1:d.findLastIndex(H=>H.cp===k);if(R>=0){let H=d[R].script;wa.has(H)&&(H=o.find(Y=>wa.has(Y))??H),H!=="Zyyy"&&(S=[H]),m=Math.max(0,m-(d.length-1-R)),d.length=R+1}}if(!y(S)){let k=p(n[P]),R=Math.min(m,d.length);if(R>0){let H=d.length-1;for(I&&(H--,R--),m=I?1:0;R>0;H--,R--)d[H].script=k}o=S,_=n[P],u=void 0}u??=Br(v)}return n.length&&p(e),s}var Ja;function zi(){return Ja??=Ka().then(()=>Ya),Ja}var Jr=class{constructor(t,e,n){this.data=e;this.index=n;this.face=new t.Face(new t.Blob(e),n),this.upem=this.face.upem,this.cff=this.face.referenceTable("CFF ")!==void 0||this.face.referenceTable("CFF2")!==void 0;let a={};for(let[s,o]of Object.entries(this.face.getAxisInfos()))a[s]={min:o.min,default:o.default,max:o.max};this.axes=a}data;index;upem;cff;axes;face;cmap;codepoints(){return this.cmap??=new Set(this.face.collectUnicodes()),this.cmap}instances=new Map;outlines=new Map;outline(t,e,n){let a=`${n}|${Object.entries(e).sort(([o],[i])=>o<i?-1:1).join(",")}`,s=this.outlines.get(a);if(!s){let o=this.upem*64,i=[],u=0,_=0,d=0,m=0,b=(p,y)=>{i.push([u/o,_/o,p/o,y/o]),u=p,_=y};for(let{type:p,values:y}of this.instance(t,e).glyphToJson(n))if(p==="M")[u,_,d,m]=[y[0],y[1],y[0],y[1]];else if(p==="L")b(y[0],y[1]);else if(p==="Q"||p==="C"){let[P,v]=[u,_];for(let S=1;S<=8;S++){let I=S/8,k=1-I;p==="Q"?b(k*k*P+2*k*I*y[0]+I*I*y[2],k*k*v+2*k*I*y[1]+I*I*y[3]):b(k**3*P+3*k*k*I*y[0]+3*k*I*I*y[2]+I**3*y[4],k**3*v+3*k*k*I*y[1]+3*k*I*I*y[3]+I**3*y[5])}}else p==="Z"&&b(d,m);s=i,this.outlines.set(a,s)}return s}instance(t,e){let n=Object.entries(e).sort(([o],[i])=>o<i?-1:1),a=n.map(([o,i])=>`${o}=${i}`).join(","),s=this.instances.get(a);return s||(s=new t.Font(this.face),s.setScale(this.upem*64,this.upem*64),n.length&&s.setVariations(n.map(([o,i])=>new t.Variation(o,i))),this.instances.set(a,s)),s}},sr=class r{constructor(t,e){this.hb=t;this.model=e}hb;model;static async create(t=Rr()){return new r(await zi(),t)}loadFont(t,e=0){return new Jr(this.hb,t instanceof Uint8Array?t:new Uint8Array(t),e)}metrics(t,e){let n=t.instance(this.hb,e),a=t.upem*64,s=this.hb.MetricsTag,o=i=>n.getMetricPositionWithFallback(i)/a;return{ascender:o(s.HORIZONTAL_ASCENDER),descender:o(s.HORIZONTAL_DESCENDER),underlineOffset:o(s.UNDERLINE_OFFSET),underlineThickness:o(s.UNDERLINE_SIZE),strikeoutOffset:o(s.STRIKEOUT_OFFSET),strikeoutThickness:o(s.STRIKEOUT_SIZE)}}verticalOrigin(t,e,n){let a=t.instance(this.hb,e),s=t.upem*64,o=a.hExtents().ascender/s,i=t.face.referenceTable("VORG");if(i&&i.length>=8){let m=new DataView(i.buffer,i.byteOffset,i.byteLength),b=m.getUint16(6),p=0,y=b-1;for(;p<=y;){let P=p+y>>1,v=m.getUint16(8+P*4);if(v===n)return{origin:m.getInt16(10+P*4)/t.upem,ascender:o};v<n?p=P+1:y=P-1}return{origin:m.getInt16(4)/t.upem,ascender:o}}let u=t.face.referenceTable("vhea"),_=t.face.referenceTable("vmtx"),d=a.glyphExtents(n);if(u&&_&&d){let m=new DataView(u.buffer,u.byteOffset,u.byteLength).getUint16(34),b=new DataView(_.buffer,_.byteOffset,_.byteLength),p=n<m?n*4+2:m*4+(n-m)*2;if(p+2<=_.byteLength)return{origin:b.getInt16(p)/t.upem+d.yBearing/s,ascender:o}}return{origin:o,ascender:o}}glyphBounds(t,e,n){let a=t.instance(this.hb,e).glyphExtents(n);if(!a||!a.width&&!a.height)return;let s=t.upem*64;return[a.xBearing/s,(a.yBearing+a.height)/s,(a.xBearing+a.width)/s,a.yBearing/s]}inkBetween(t,e,n,a,s){let o=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let[u,_,d,m]of t.outline(this.hb,e,n)){let b=Math.max(Math.min(_,m),a),p=Math.min(Math.max(_,m),s);if(b>p)continue;let y=_===m?[u,d]:[b,p].map(P=>u+(d-u)*(P-_)/(m-_));for(let P of y)o=Math.min(o,P),i=Math.max(i,P)}return o<=i?[o,i]:void 0}outline(t,e,n){let a=t.upem*64;return t.instance(this.hb,e).glyphToJson(n).map(s=>({type:s.type,values:s.values.map(o=>o/a)}))}shape(t,e,n,a={}){let{model:s}=this,o=a.start??0,i=a.end??e.length,u=n.setSizePx??Dt(s,n.sizePx,t.cff),_={};for(let[p,y]of Object.entries(n.variations))p in t.axes&&(_[p]=y);n.opticalSizing&&"opsz"in t.axes&&!("opsz"in n.variations)&&(s.opticalSize==="css-size"?_.opsz=n.sizePx:s.opticalSize==="set-size"&&(_.opsz=u));let d=Object.entries(n.features),b=!a.glyphs&&(s.syntheticSmallCaps||s.shapeSegments)?this.shapePreview(t,e,n,a,o,i,u,_,d):this.shapeSlice(t,e,a,n,u,_,d,o,i,0,!0);return new Zr(e,o,i,b,u,_,yt(s,n.letterSpacingPx),yt(s,n.wordSpacingPx))}shapePreview(t,e,n,a,s,o,i,u,_){let{model:d}=this,m=d.syntheticSmallCaps?a.smallCapsScale??$i(n.family):void 0,b=m?Zi(n.features):"off",p=m?Dt(d,i*m,t.cff):i,y=d.shapeSegments?Ji(e,s,o):[{from:s,to:o}],P=[];for(let v of y){let S=b==="off"?[{text:e.slice(v.from,v.to),clusterBase:v.from,size:i,dropCaps:!1}]:qi(e,v.from,v.to,i,p,b);for(let I of S){let k=I.dropCaps?_.filter(([R])=>!Vi.has(R)):_;P.push(...this.shapeSlice(t,I.text,a,n,I.size,u,k,0,I.text.length,I.clusterBase,!1))}}return P}shapeSlice(t,e,n,a,s,o,i,u,_,d,m){let{hb:b,model:p}=this,y=t.instance(b,o),[P,v]=m?[u,_]:[0,e.length],{direction:S}=n,I=n.levels&&(m?n.levels:ji(n.levels,d,e.length)),k=S?[{start:P,end:v,level:S==="rtl"?1:0}]:I?Hr(I,P,v):ya(e,a.direction,P,v),R=[];for(let D of k)for(let q of Fa(e,D.start,D.end))R.push({...q,level:D.level});let H=i.map(([D,q])=>new b.Feature(D,q)),Y=s/(t.upem*64),N=p.advanceUnit,F=D=>N?Math.round(D/N)*N:D,G=S==="ttb",ee=R.map(D=>{let q=new b.Buffer;q.addText(e,D.start,D.end-D.start),q.setDirection(b.Direction[G?"TTB":D.level%2?"RTL":"LTR"]),D.script&&q.setScript(D.script),a.lang&&q.setLanguage(a.lang),q.guessSegmentProperties(),b.shape(y,q,H);let ie=q.getGlyphPositions();return q.getGlyphInfos().map(($,te)=>{let j=ie[te];return{id:$.codepoint,cluster:$.cluster+(m?0:d),advance:F((G?-j.yAdvance:j.xAdvance)*Y),offsetX:j.xOffset*Y,offsetY:j.yOffset*Y}})});return G?ee.flat():Aa(R.map(D=>D.level)).flatMap(D=>ee[D])}};function ji(r,t,e){let n=r[r.length-1]??0;return Array.from({length:e},(a,s)=>r[t+s]??n)}var Xa=new Intl.Segmenter(void 0,{granularity:"grapheme"}),Wi=/[  ፡\u{10100}\u{10101}\u{1039f}\u{1091f}]/u,Vi=new Set(["smcp","c2sc","pcap","c2pc"]),Yi=new Set([8211,8212,11834,11835]);function Ki(r){return r===32||r===9}function Ji(r,t,e){let n=[],a=t;for(let s=t;s<e;){let o=r.codePointAt(s),i=o>65535?2:1;Yi.has(o)?(s>a&&n.push({from:a,to:s}),n.push({from:s,to:s+i}),a=s+i):Ki(o)&&(n.push({from:a,to:s+i}),a=s+i),s+=i}return a<e&&n.push({from:a,to:e}),n}function Zi(r){return r.c2sc||r.c2pc?"all":r.smcp||r.pcap?"small":"off"}function Xi(r){let t=String.fromCodePoint(r),e=t.toUpperCase();if(!(e===t||e.length!==t.length||[...e].length!==1))return e.codePointAt(0)}function Qi(r){return r===32||r===9||r===10||r===13||r===12}function qi(r,t,e,n,a,s){let o=[],i;for(let{segment:u,index:_}of Xa.segment(r.slice(t,e))){let d=t+_,m=u.codePointAt(0),b=Xi(m),p=s==="all"?!Qi(m):b!==void 0,y=m>65535?2:1,P=p&&b!==void 0?String.fromCodePoint(b)+u.slice(y):u;i&&i.dropCaps===p?i.text+=P:(i={text:P,clusterBase:d,size:p?a:n,dropCaps:p},o.push(i))}return o}var Za=new Map;function $i(r){if(!r)return;let t=globalThis.navigator?.userAgent;if(!t||qn(t)!=="webkit"||!globalThis.document?.body)return;let e=Za.get(r);if(e!==void 0)return e;let n=(d,m)=>{let b=document.createElement("span");b.style.cssText=`font-family:${r};font-size:100px;white-space:pre;font-kerning:normal;${d?"font-variant-caps:small-caps":""}`,b.textContent=m,document.body.append(b);let p=b.getBoundingClientRect().width;return b.remove(),p},a=n(!0,"h"),s=n(!1,"H");if(!(a>0)||!(s>0))return;let o=100,i=Qn.webkit.sizeUnit,_=Math.round(a/s*o/i)*i/o;return Za.set(r,_),_}var Zr=class{constructor(t,e,n,a,s,o,i,u){this.text=t;this.start=e;this.end=n;this.glyphs=a;this.setSize=s;this.variations=o;this.letterSpacing=i;this.wordSpacing=u;this.width=this.widthBetween(e,n)}text;start;end;glyphs;setSize;variations;letterSpacing;wordSpacing;width;widthBetween(t,e){let n=0;for(let a of this.glyphs)a.cluster>=t&&a.cluster<e&&(n+=a.advance);if(this.letterSpacing||this.wordSpacing)for(let{segment:a,index:s}of Xa.segment(this.text.slice(t,e)))n+=this.letterSpacing,Wi.test(a)&&(n+=this.wordSpacing);return n}};var ec="hyphenation.txt";function Qa(r,t=ec){let e=[],n=[],a=(o,i,u,_,d,m)=>n.push({severity:"error",code:_,message:d,fix:m,file:t,line:o,column:i,endLine:o,endColumn:i+u}),s;for(let[o,i]of r.split(/\r?\n/).entries()){let u=i.replace(/%.*$/,""),_=u.trim();if(!_)continue;let d=_.match(/^\[(.*)\]$/);if(d){let m=d[1].trim();if(!/^[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*$/.test(m)){a(o+1,u.indexOf("[")+1,_.length,"bad-language-tag",`"${m}" is not a language tag`,"name a language as BCP 47 does: [en-GB], [grc]"),s=void 0;continue}s=m;continue}for(let m of u.matchAll(/\S+/g)){let b=m[0];if(/^-|-$|--/.test(b)){a(o+1,m.index+1,b.length,"bad-hyphenation",`"${b}": a hyphen must be between two letters`,"mark each place a word may break with one hyphen between its letters: hy-phen-ation");continue}e.push(s===void 0?{word:b}:{word:b,lang:s})}}return{exceptions:e,problems:n}}var or={af:{name:"Afrikaans",left:1,right:2,url:()=>new URL("./patterns/af.wasm",import.meta.url)},as:{name:"Assamese",left:1,right:1,url:()=>new URL("./patterns/as.wasm",import.meta.url)},be:{name:"Belarusian",left:2,right:2,url:()=>new URL("./patterns/be.wasm",import.meta.url)},bg:{name:"Bulgarian",left:2,right:2,url:()=>new URL("./patterns/bg.wasm",import.meta.url)},bn:{name:"Bengali",left:1,right:1,url:()=>new URL("./patterns/bn.wasm",import.meta.url)},ca:{name:"Catalan",left:2,right:2,url:()=>new URL("./patterns/ca.wasm",import.meta.url)},cy:{name:"Welsh",left:2,right:3,url:()=>new URL("./patterns/cy.wasm",import.meta.url)},da:{name:"Danish",left:2,right:2,url:()=>new URL("./patterns/da.wasm",import.meta.url)},de:{name:"German, reformed spelling",left:2,right:2,url:()=>new URL("./patterns/de.wasm",import.meta.url)},"el-monoton":{name:"Modern Greek, monotonic spelling",left:1,right:1,url:()=>new URL("./patterns/el-monoton.wasm",import.meta.url)},"el-polyton":{name:"Modern Greek, polytonic spelling",left:1,right:1,url:()=>new URL("./patterns/el-polyton.wasm",import.meta.url)},"en-gb":{name:"English, British spelling",left:2,right:3,url:()=>new URL("./patterns/en-gb.wasm",import.meta.url)},"en-us":{name:"English, American spelling",left:2,right:3,url:()=>new URL("./patterns/en-us.wasm",import.meta.url)},eo:{name:"Esperanto",left:2,right:2,url:()=>new URL("./patterns/eo.wasm",import.meta.url)},es:{name:"Spanish",left:2,right:2,url:()=>new URL("./patterns/es.wasm",import.meta.url)},et:{name:"Estonian",left:2,right:3,url:()=>new URL("./patterns/et.wasm",import.meta.url)},eu:{name:"Basque",left:2,right:2,url:()=>new URL("./patterns/eu.wasm",import.meta.url)},"fi-x-school":{name:"Finnish, school hyphenation",left:1,right:1,url:()=>new URL("./patterns/fi-x-school.wasm",import.meta.url)},fr:{name:"French",left:2,right:2,url:()=>new URL("./patterns/fr.wasm",import.meta.url)},fur:{name:"Friulan",left:2,right:2,url:()=>new URL("./patterns/fur.wasm",import.meta.url)},ga:{name:"Irish",left:2,right:3,url:()=>new URL("./patterns/ga.wasm",import.meta.url)},gl:{name:"Galician",left:2,right:2,url:()=>new URL("./patterns/gl.wasm",import.meta.url)},gu:{name:"Gujarati",left:1,right:1,url:()=>new URL("./patterns/gu.wasm",import.meta.url)},hi:{name:"Hindi",left:1,right:1,url:()=>new URL("./patterns/hi.wasm",import.meta.url)},hr:{name:"Croatian",left:2,right:2,url:()=>new URL("./patterns/hr.wasm",import.meta.url)},hsb:{name:"Upper Sorbian",left:2,right:2,url:()=>new URL("./patterns/hsb.wasm",import.meta.url)},ia:{name:"Interlingua",left:2,right:2,url:()=>new URL("./patterns/ia.wasm",import.meta.url)},is:{name:"Icelandic",left:2,right:2,url:()=>new URL("./patterns/is.wasm",import.meta.url)},it:{name:"Italian",left:2,right:2,url:()=>new URL("./patterns/it.wasm",import.meta.url)},ka:{name:"Georgian",left:1,right:2,url:()=>new URL("./patterns/ka.wasm",import.meta.url)},kmr:{name:"Kurmanji, Northern Kurdish",left:2,right:2,url:()=>new URL("./patterns/kmr.wasm",import.meta.url)},kn:{name:"Kannada",left:1,right:1,url:()=>new URL("./patterns/kn.wasm",import.meta.url)},la:{name:"Latin",left:2,right:2,url:()=>new URL("./patterns/la.wasm",import.meta.url)},lt:{name:"Lithuanian",left:2,right:2,url:()=>new URL("./patterns/lt.wasm",import.meta.url)},ml:{name:"Malayalam",left:1,right:1,url:()=>new URL("./patterns/ml.wasm",import.meta.url)},"mn-cyrl":{name:"Mongolian, Cyrillic script",left:2,right:2,url:()=>new URL("./patterns/mn-cyrl.wasm",import.meta.url)},mr:{name:"Marathi",left:1,right:1,url:()=>new URL("./patterns/mr.wasm",import.meta.url)},nb:{name:"Norwegian Bokm\xE5l, bokm\xE5l, norsk bokm\xE5l",left:2,right:2,url:()=>new URL("./patterns/nb.wasm",import.meta.url)},nl:{name:"Dutch",left:2,right:2,url:()=>new URL("./patterns/nl.wasm",import.meta.url)},nn:{name:"Norwegian Nynorsk, nynorsk",left:2,right:2,url:()=>new URL("./patterns/nn.wasm",import.meta.url)},no:{name:"Norwegian, norsk",left:2,right:2,url:()=>new URL("./patterns/no.wasm",import.meta.url)},oc:{name:"Occitan",left:2,right:2,url:()=>new URL("./patterns/oc.wasm",import.meta.url)},or:{name:"Odia, Oriya",left:1,right:1,url:()=>new URL("./patterns/or.wasm",import.meta.url)},pa:{name:"Panjabi, Punjabi",left:1,right:1,url:()=>new URL("./patterns/pa.wasm",import.meta.url)},pi:{name:"P\u0101li",left:1,right:2,url:()=>new URL("./patterns/pi.wasm",import.meta.url)},pl:{name:"Polish",left:2,right:2,url:()=>new URL("./patterns/pl.wasm",import.meta.url)},pms:{name:"Piedmontese",left:2,right:2,url:()=>new URL("./patterns/pms.wasm",import.meta.url)},pt:{name:"Portuguese",left:2,right:3,url:()=>new URL("./patterns/pt.wasm",import.meta.url)},rm:{name:"Romansh",left:2,right:2,url:()=>new URL("./patterns/rm.wasm",import.meta.url)},ru:{name:"Russian",left:2,right:2,url:()=>new URL("./patterns/ru.wasm",import.meta.url)},"sh-cyrl":{name:"Serbocroatian, Cyrillic script",left:2,right:2,url:()=>new URL("./patterns/sh-cyrl.wasm",import.meta.url)},"sh-latn":{name:"Serbocroatian, Latin script",left:2,right:2,url:()=>new URL("./patterns/sh-latn.wasm",import.meta.url)},sk:{name:"Slovak",left:2,right:3,url:()=>new URL("./patterns/sk.wasm",import.meta.url)},sl:{name:"Slovenian",left:2,right:2,url:()=>new URL("./patterns/sl.wasm",import.meta.url)},sq:{name:"Albanian",left:2,right:2,url:()=>new URL("./patterns/sq.wasm",import.meta.url)},sv:{name:"Swedish",left:2,right:2,url:()=>new URL("./patterns/sv.wasm",import.meta.url)},ta:{name:"Tamil",left:1,right:1,url:()=>new URL("./patterns/ta.wasm",import.meta.url)},te:{name:"Telugu",left:1,right:1,url:()=>new URL("./patterns/te.wasm",import.meta.url)},th:{name:"Thai",left:2,right:3,url:()=>new URL("./patterns/th.wasm",import.meta.url)},tk:{name:"Turkmen",left:2,right:2,url:()=>new URL("./patterns/tk.wasm",import.meta.url)},tr:{name:"Turkish",left:2,right:2,url:()=>new URL("./patterns/tr.wasm",import.meta.url)},uk:{name:"Ukrainian",left:2,right:2,url:()=>new URL("./patterns/uk.wasm",import.meta.url)},"zh-latn-pinyin":{name:"Mandarin Chinese, pinyin transliteration",left:1,right:2,url:()=>new URL("./patterns/zh-latn-pinyin.wasm",import.meta.url)}};var tc={left:2,right:3},nc=/[-­‐-—]/,rc=/\p{L}/u,ac=61,sc="\xAD",oc={en:"en-us","en-au":"en-gb","en-ie":"en-gb","en-in":"en-gb","en-nz":"en-gb","en-za":"en-gb",el:"el-monoton",mn:"mn-cyrl",sh:"sh-latn","sr-latn":"sh-latn","sr-cyrl":"sh-cyrl"};function ir(r){let t=r.trim().toLowerCase().replaceAll("_","-");for(;t;){if(Object.hasOwn(or,t))return t;let e=oc[t];if(e)return e;let n=t.lastIndexOf("-");t=n<0?"":t.slice(0,n)}}function cr(r){let t=ir(r),e=t===void 0?void 0:or[t];return e?{left:e.left,right:e.right}:tc}async function ic(r){let t=r instanceof Response?await r.arrayBuffer():r,{instance:e}=await WebAssembly.instantiate(t),n=e.exports,a=new Set(String.fromCharCode(...new Uint16Array(n.mem.buffer,1664,n.lct.value))),s=45;return{alphabet:a,hyphenate(o,i){let u=new Uint16Array(n.mem.buffer,0,64);for(let p=0;p<o.length;p++)u[p]=o.charCodeAt(p);u[o.length]=0;let _=n.hyphenate(i.left,i.right,s),d=[];if(_<=0)return d;let m=new Uint16Array(n.mem.buffer,0,_),b=0;for(let p of m)p===s?d.push(b):b++;return d}}}var lr=class{loader;engines;loading;exceptions=new Map;constructor(t={}){let e=t.patterns;this.loader=e?.loader??t.load??(n=>fetch(n)),this.engines=e?.engines??new Map,this.loading=e?.loading??new Map}async load(...t){let e=new Set(t.map(ir).filter(n=>n!==void 0));await Promise.all([...e].map(n=>this.engine(n)))}async prepare(t){let e=[t.closest("[lang]")?.getAttribute("lang")??""];for(let n of t.querySelectorAll("[lang]"))e.push(n.getAttribute("lang")??"");await this.load(...e)}ready(t){let e=ir(t);return e===void 0||this.engines.has(e)}engine(t){let e=this.loading.get(t);if(!e){let n=or[t];e=Promise.resolve().then(()=>this.loader(n.url(),t)).then(ic).then(a=>(this.engines.set(t,a),a)),e.catch(()=>this.loading.delete(t)),this.loading.set(t,e)}return e}addExceptions(t){for(let{word:e,lang:n}of t){let a=n?.toLowerCase()??"",s=this.exceptions.get(a);s||this.exceptions.set(a,s=new Map);let o=[],i="";for(let u of e)u==="-"?o.push(i.length):i+=u.toLowerCase();s.set(i,o)}}exception(t,e){let n=e.toLowerCase();for(;;){let a=this.exceptions.get(n)?.get(t);if(a)return a;if(!n)return;let s=n.lastIndexOf("-");n=s<0?"":n.slice(0,s)}}points(t,e,n=cr(e)){if(nc.test(t))return[];let a=ir(e),s;if(a!==void 0&&(s=this.engines.get(a),!s))throw new Error(`hyphenation: the patterns for ${e} (${a}) aren't loaded: await hyphenator.load('${e}')`);let o=p=>p.toLowerCase().length===1&&rc.test(p),i=0;for(;i<t.length&&!o(t[i]);)i++;let u=i;for(;u<t.length&&o(t[u]);)u++;let _=u-i;if(_===0||_>ac||_<n.left+n.right)return[];let d=Array.from(t.slice(i,u),p=>p.toLowerCase()).join(""),m=s&&[...d].every(p=>s.alphabet.has(p))?s:void 0;return(this.exception(d,e)??m?.hyphenate(d,n)??[]).filter(p=>p>=n.left&&_-p>=n.right).map(p=>i+p)}hyphenateText(t,e,n=cr(e)){return t.replace(/[^\s]+/g,a=>{let s=this.points(a,e,n);if(!s.length)return a;let o="",i=0;for(let u of s)o+=a.slice(i,u)+sc,i=u;return o+a.slice(i)})}};function xn(r,t){let e={};return t?.leftHang&&(e.leftHang=t.leftHang),t?.rightHang&&(e.rightHang=t.rightHang),t?.expand&&(e.expand=t.expand),{type:"box",width:r,...e}}function jt(r,t=0,e=!1){return{type:"penalty",width:t,penalty:r,flagged:e}}function qa(r,t=50){return{type:"penalty",width:r,penalty:t,flagged:!0,auto:!0}}var cc={width:0,stretch:1,shrink:0,stretchOrder:1};function $a(r,t=cc){let e=r.at(-1)?.type==="glue"?r.slice(0,-1):r.slice();return e.push(jt(1e4),{type:"glue",...t},jt(-1e4)),e}var vt=1e4,Ve={VeryLoose:0,Loose:1,Decent:2,Tight:3},qr={tolerance:200,pretolerance:100,linePenalty:10,adjDemerits:1e4,doubleHyphenDemerits:1e4,finalHyphenDemerits:5e3,emergencyStretch:0,looseness:0,leftSkip:{width:0,stretch:0,shrink:0},rightSkip:{width:0,stretch:0,shrink:0},hbadness:1e3,expansion:0},Be=1073741823,Wt=-1e4,Xr=Number.MAX_SAFE_INTEGER;function ur(r,t){if(r===0)return 0;if(t<=0)return vt;let e;return r<=7230584?e=Math.floor(r*297/t):t>=1663497?e=Math.floor(r/Math.floor(t/297)):e=r,e>1290?vt:Math.floor((e*e*e+131072)/262144)}var fr=class{width;stretch;shrink;expand;constructor(t){let e=t.length+1;this.width=new Float64Array(e),this.stretch=[new Float64Array(e),new Float64Array(e),new Float64Array(e),new Float64Array(e)],this.shrink=new Float64Array(e),this.expand=new Float64Array(e);for(let n=0;n<t.length;n++){let a=t[n];this.width[n+1]=this.width[n]+(a.type==="penalty"?0:a.width);for(let s=0;s<4;s++){let o=a.type==="glue"&&(a.stretchOrder??0)===s?a.stretch:0;this.stretch[s][n+1]=this.stretch[s][n]+o}this.shrink[n+1]=this.shrink[n]+(a.type==="glue"?a.shrink:0),this.expand[n+1]=this.expand[n]+(a.type==="box"?a.expand??0:0)}}};function es(r,t,e){let n=r[t],a=n?.type==="box"?n.leftHang??0:0,s=r[e];if(s?.type==="penalty"&&(s.rightHang??0)!==0)return{left:a,right:s.rightHang??0};let o=e-1;for(;o>t&&r[o]?.type!=="box";)o--;let i=o>=t?r[o]:void 0;return{left:a,right:i?.type==="box"?i.rightHang??0:0}}function ts(r,t,e,n){let a=t[n],s=a?.type==="penalty"?a.expand??0:0;return r.expand[n]-r.expand[e]+s}function ns(r){if(typeof r=="number")return{width:()=>r,lastSpecialLine:0};if(typeof r=="function")return{width:r,lastSpecialLine:1/0};if(r.length===0)throw new RangeError("measure: an array of line widths needs at least one");return{width:t=>r[Math.min(t,r.length)-1],lastSpecialLine:r.length-1}}function rs(r){let t=r.length,e=new Int32Array(t+1);e[t]=t;for(let n=t-1;n>=0;n--)e[n]=r[n].type==="box"?n:e[n+1];return e}function as({leftSkip:r,rightSkip:t}){return{width:r.width+t.width,stretch:[0,1,2,3].map(e=>((r.stretchOrder??0)===e?r.stretch:0)+((t.stretchOrder??0)===e?t.stretch:0)),shrink:r.shrink+t.shrink}}function ss(r,t,e){let n={...qr,...is(e)},a=r.length-1,s=null,o=0;for(let u of[...t.filter(_=>_<a),a])s={serial:++o,at:u,previous:s,fitness:Ve.Decent,total:0};let i={start:0,line:o+1,fitness:Ve.Decent,hyphenated:!1,total:0,passive:s};return cs(r,new fr(r),rs(r),i,ns(e.measure).width,n.hbadness,n.expansion,as(n),"given",0,void 0)}function os(r,t){let e={...qr,...is(t)},n=r.at(-1);if(n?.type!=="penalty"||n.penalty>Wt)throw new RangeError("breakLines: the paragraph must end with a forced break (see finishParagraph)");let a=r.length,s=a-1,o=new fr(r),{width:i,lastSpecialLine:u}=ns(t.measure),_=e.looseness===0?u:Xr,d=Number.isFinite(u)?i(u+1):0,m=t.trace?[]:void 0,b=rs(r),p=as(e),y=0,P=e.pretolerance,v,S,I;for(P>=0?(v=!1,S=!1,I="first"):(P=e.tolerance,v=!0,S=e.emergencyStretch<=0,I="second");;){P>vt&&(P=vt),m?.push({type:"pass",pass:I});let k=0,R=[{start:0,line:1,fitness:Ve.Decent,hyphenated:!1,total:0,passive:null}],H=(N,F,G)=>{if(F>=1e4)return;F<=Wt&&(F=Wt);let ee=N===s,D=r[N],q=D.type==="penalty"?D.width:0,ie=[Be,Be,Be,Be],$=[null,null,null,null],te=[0,0,0,0],j=Be,ve=0,ae=0,Ne=z=>{let Pe=Math.abs(e.adjDemerits);j=Pe>=Be-j?Be-1:j+Pe;for(let X=0;X<4;X++){if(ie[X]<=j){let se={serial:++k,at:N,previous:$[X],fitness:X,total:ie[X]},me={start:b[N],line:te[X]+1,fitness:X,hyphenated:G,total:ie[X],passive:se};R.splice(z++,0,me),m?.push({type:"break",serial:se.serial,at:N,line:te[X],fitness:X,hyphenated:G,total:ie[X],previous:se.previous?.serial??0})}ie[X]=Be}return j=Be,z},xe=0;for(;;){let z=R[xe],Pe=z?z.line:Xr;if(Pe>ve){if(j<Be&&(ve!==_||!z)&&(xe=Ne(xe)),!z)return;Pe>_?(ae=d,ve=Xr-1):(ve=Pe,ae=i(Pe))}if(!z)return;let X=z.start,se=o.width[N]-o.width[X]+p.width+q,me=es(r,X,N),Oe=e.expansion>0?ts(o,r,X,N)*e.expansion:0,Je=o.stretch[0][N]-o.stretch[0][X]+p.stretch[0]+y+Oe,le=o.stretch[1][N]-o.stretch[1][X]+p.stretch[1]!==0||o.stretch[2][N]-o.stretch[2][X]+p.stretch[2]!==0||o.stretch[3][N]-o.stretch[3][X]+p.stretch[3]!==0,De=o.shrink[N]-o.shrink[X]+p.shrink+Oe,Ue=ae+me.left+me.right-se,Ae,Ee;Ue>0?le?(Ae=0,Ee=Ve.Decent):Ue>7230584&&Je<1663497?(Ae=vt,Ee=Ve.VeryLoose):(Ae=ur(Ue,Je),Ee=Ae>99?Ve.VeryLoose:Ae>12?Ve.Loose:Ve.Decent):(Ae=-Ue>De?vt+1:ur(-Ue,De),Ee=Ae>12?Ve.Tight:Ve.Decent);let pe=!1,Ye;if(Ae>vt||F===Wt){if(S&&j===Be&&R.length===1)pe=!0;else if(Ae>P){R.splice(xe,1);continue}Ye=!1}else{if(Ae>P){xe++;continue}Ye=!0}let ue=0;pe||(ue=e.linePenalty+Ae,ue=Math.abs(ue)>=1e4?1e8:ue*ue,F!==0&&(F>0?ue+=F*F:F>Wt&&(ue-=F*F)),G&&z.hyphenated&&(ue+=ee?e.finalHyphenDemerits:e.doubleHyphenDemerits),Math.abs(Ee-z.fitness)>1&&(ue+=e.adjDemerits)),m?.push({type:"feasible",at:N,kind:ee?"par":D.type==="penalty"?D.flagged?"discretionary":"penalty":"glue",via:z.passive?.serial??0,badness:Ae,penalty:F,demerits:pe?null:ue}),ue+=z.total,ue<=ie[Ee]&&(ie[Ee]=ue,$[Ee]=z.passive,te[Ee]=Pe,ue<j&&(j=ue)),Ye?xe++:R.splice(xe,1)}},Y=!1;for(let N=0;N<a&&R.length>0;N++){let F=r[N];N===s?(H(N,F.type==="penalty"?F.penalty:Wt,!0),Y=!0):F.type==="glue"?N>0&&r[N-1].type==="box"&&H(N,0,!1):F.type==="penalty"&&(v||!F.auto)&&H(N,F.penalty,F.flagged)}if(Y&&R.length>0){let N=R[0];for(let G of R)G.total<N.total&&(N=G);let F=0;if(e.looseness!==0){let G=N.line;for(let ee of R){let D=ee.line-G;D<F&&e.looseness<=D||D>F&&e.looseness>=D?(N=ee,F=D):D===F&&ee.total<N.total&&(N=ee)}}if(F===e.looseness||S)return cs(r,o,b,N,i,e.hbadness,e.expansion,p,I,F,m)}v?(y+=e.emergencyStretch,S=!0,I="emergency"):(P=e.tolerance,v=!0,S=e.emergencyStretch<=0,I="second")}}function is(r){let t={};for(let[e,n]of Object.entries(r))n!==void 0&&e in qr&&(t[e]=n);return t}function cs(r,t,e,n,a,s,o,i,u,_,d){let m=[];for(let v=n.passive;v;v=v.previous)m.push(v);m.reverse();let b=[],p=0,y=0,P=r.length-1;for(let[v,S]of m.entries()){let I=S.at,k=r[I],R=k.type==="penalty"?k.width:0,H=t.width[I]-t.width[p]+i.width+R,Y=t.stretch.map((ae,Ne)=>ae[I]-ae[p]+i.stretch[Ne]),N=t.shrink[I]-t.shrink[p]+i.shrink,F=a(v+1),G=es(r,p,I),ee=o>0?ts(t,r,p,I)*o:0,D=F+G.left+G.right-H,q=0,ie=0,$=0,te=0,j=!1,ve=0;if(D>0)if(ie=Y[3]!==0?3:Y[2]!==0?2:Y[1]!==0?1:0,ie===0){let ae=Y[0]+ee;q=ae!==0?D/ae:0,$=ur(D,ae),j=$>s,ve=ee>0?q*o:0}else{let ae=Y[ie];q=ae!==0?D/ae:0}else if(D<0){let ae=N+ee;ae<-D?(te=-D-ae,q=ae>0?-1:0,$=1e6,ve=ee>0?-o:0):(q=ae!==0?D/ae:0,$=ur(-D,ae),ve=ee>0?q*o:0)}b.push({start:p,end:I,measure:F,width:H,stretch:Y[0],shrink:N,ratio:q,glueOrder:ie,badness:$,fitness:S.fitness,demerits:S.total-y,hyphenated:I!==P&&k.type==="penalty"&&k.flagged,overfull:te,underfull:j,leftHang:G.left,rightHang:G.right,expansion:ve}),y=S.total,p=e[I]}return{breaks:m.map(v=>v.at),lines:b,demerits:n.total,pass:u,looseness:_,...d?{trace:d}:{}}}function _r(r,t=""){let e=p=>r.getPropertyValue(p).trim(),n=us(e("font-size"))??16,a={},s={};e("font-kerning")==="none"&&(a.kern=0);let o=ls(e("letter-spacing"),n);if(o!==0)for(let p of["liga","clig","dlig","hlig","calt"])a[p]=0;for(let p of e("font-variant-ligatures").split(/\s+/)){let y=lc[p];y&&Object.assign(a,y)}for(let p of e("font-variant-caps").split(/\s+/))for(let y of uc[p]??[])a[y]=1;for(let p of e("font-variant-numeric").split(/\s+/)){let y=fc[p];y&&(a[y]=1)}for(let p of e("font-variant-east-asian").split(/\s+/)){let y=_c[p];y&&(a[y]=1)}let i=hc[e("font-variant-position")];i&&(a[i]=1),/\bhistorical-forms\b/.test(e("font-variant-alternates"))&&(a.hist=1);let u=Number.parseFloat(e("font-weight"));s.wght=Number.isFinite(u)?u:400;let _=e("font-stretch");s.wdth=_.endsWith("%")?Number.parseFloat(_):pc[_]??100;let d=e("font-style");d==="italic"&&(s.ital=1);let m=/^oblique\s+(-?[\d.]+)deg$/.exec(d);m?s.slnt=-Number.parseFloat(m[1]):d==="oblique"&&(s.slnt=-14),Object.assign(s,$r(e("font-variation-settings"),"variation")),Object.assign(a,$r(e("font-feature-settings"),"feature"));let b=e("font-family");return{sizePx:n,features:a,variations:s,opticalSizing:e("font-optical-sizing")!=="none",letterSpacingPx:o,wordSpacingPx:ls(e("word-spacing"),n),lang:t||"",direction:e("direction")==="rtl"?"rtl":"ltr",...b?{family:b}:{}}}var lc={none:{liga:0,clig:0,dlig:0,hlig:0,calt:0},"common-ligatures":{liga:1,clig:1},"no-common-ligatures":{liga:0,clig:0},"discretionary-ligatures":{dlig:1},"no-discretionary-ligatures":{dlig:0},"historical-ligatures":{hlig:1},"no-historical-ligatures":{hlig:0},contextual:{calt:1},"no-contextual":{calt:0}},uc={"small-caps":["smcp"],"all-small-caps":["smcp","c2sc"],"petite-caps":["pcap"],"all-petite-caps":["pcap","c2pc"],unicase:["unic"],"titling-caps":["titl"]},fc={"lining-nums":"lnum","oldstyle-nums":"onum","proportional-nums":"pnum","tabular-nums":"tnum","diagonal-fractions":"frac","stacked-fractions":"afrc",ordinal:"ordn","slashed-zero":"zero"},_c={jis78:"jp78",jis83:"jp83",jis90:"jp90",jis04:"jp04",simplified:"smpl",traditional:"trad","full-width":"fwid","proportional-width":"pwid",ruby:"ruby"},hc={sub:"subs",super:"sups"},pc={"ultra-condensed":50,"extra-condensed":62.5,condensed:75,"semi-condensed":87.5,normal:100,"semi-expanded":112.5,expanded:125,"extra-expanded":150,"ultra-expanded":200};function us(r){let t=/^(-?[\d.]+(?:e-?\d+)?)px$/.exec(r);return t?Number.parseFloat(t[1]):void 0}function ls(r,t){if(r===""||r==="normal")return 0;let e=us(r);if(e!==void 0)return e;let n=/^(-?[\d.]+)em$/.exec(r);return n?Number.parseFloat(n[1])*t:0}function $r(r,t){let e={};if(!r||r==="normal")return e;for(let n of r.split(",")){let a=/^\s*["']([\x20-\x7e]{4})["']\s*(on|off|-?[\d.]+)?\s*$/.exec(n);if(!a)continue;let s=a[2];e[a[1]]=s===void 0?t==="feature"?1:0:s==="on"?1:s==="off"?0:Number.parseFloat(s)}return e}var fs=new WeakMap;function ea(r,t,e,n,a){let s=a.replace(/\s+/g," ").trim().slice(0,200)||"Hamburgefonstiv",o=JSON.stringify([n.sizePx,n.variations,n.features,n.opticalSizing,n.letterSpacingPx,n.lang,s.length<200?s:""]),i=fs.get(e);i||fs.set(e,i=new Map);let u=i.get(o);if(u!==void 0)return u;let _=document.createElement("span");_.setAttribute("aria-hidden","true"),_.style.cssText="position:absolute;visibility:hidden;white-space:pre;word-spacing:0;text-indent:0;text-transform:none;text-rendering:geometricPrecision;left:0;top:0",_.textContent=s,t.append(_);let d=_.getBoundingClientRect().width;_.remove();let m={...n,wordSpacingPx:0};delete m.setSizePx;let b=n.sizePx*64,p=new Set([n.sizePx,Dt(r.model,n.sizePx,e.cff)]);for(let v=Math.floor(b)-1;v<=Math.ceil(b)+1;v++)p.add(v/64);let y=n.sizePx,P=Number.POSITIVE_INFINITY;for(let v of p){let S=Math.abs(r.shape(e,s,{...m,setSizePx:v}).width-d);S<P&&(y=v,P=S)}return i.set(o,y),y}var _s="0.333em plus 0.167em minus 0.111em";var gc={fil:1,fill:2,filll:3};function hs(r,t){let e=/^\s*(\S+)(?:\s+plus\s+(\S+))?(?:\s+minus\s+(\S+))?\s*$/.exec(r);if(!e)throw new Error(`not glue: ${JSON.stringify(r)}`);let n=xt(e[1],t),a=0,s=0;if(e[2]){let i=/^(-?[\d.]+)(filll|fill|fil)$/.exec(e[2]);i?(a=Number.parseFloat(i[1]),s=gc[i[2]]):a=xt(e[2],t)}let o=e[3]?xt(e[3],t):0;return s?{width:n,stretch:a,shrink:o,stretchOrder:s}:{width:n,stretch:a,shrink:o}}var dc={px:1,pt:4/3,pc:16,in:96,cm:96/2.54,mm:96/25.4,q:96/101.6};function xt(r,t){let e=/^(-?(?:\d+\.?\d*|\.\d+)(?:e-?\d+)?)([a-z]*)$/i.exec(r.trim());if(!e)throw new Error(`not a length: ${JSON.stringify(r)}`);let n=Number.parseFloat(e[1]),a=e[2].toLowerCase();if(a==="em")return n*t;if(a===""&&n===0)return 0;let s=dc[a];if(s===void 0)throw new Error(`unknown unit in ${JSON.stringify(r)}`);return n*s}var ps=new WeakMap;function ot(...r){for(let t of r){let e=t.startContainer.ownerDocument??t.startContainer,n=ps.get(e);n||ps.set(e,n=e.createTextNode("")),t.selectNodeContents(n)}}var ta={".":{left:0,right:.7},",":{left:0,right:.5},"-":{left:0,right:.7},"\u2010":{left:0,right:.7},"'":{left:.7,right:.7},'"':{left:.7,right:.7},"\u2018":{left:.7,right:0},"\u201C":{left:.7,right:0},"\xAB":{left:.7,right:0},"\u2039":{left:.7,right:0},"\u201E":{left:.7,right:0},"\u201A":{left:.7,right:0},"\u2019":{left:0,right:.7},"\u201D":{left:0,right:.7},"\xBB":{left:0,right:.7},"\u203A":{left:0,right:.7}};function na(r,t,e=ta){return e[r]?.[t]??0}var Vt="\xAD",mc="\uFFFC",bc=/[\p{Pe}\p{Pf}"']/u,yc=/[-‐–]/,Ac=/^[(<\[]?(?:[a-z][a-z0-9+.-]*:\/\/|www\.)/i;function vc(r,t,e){let n=r[t];return n!=="/"&&n!=="."||t+1>=e||!/[\p{L}\p{N}_~%-]/u.test(r[t+1])?!1:n==="."||r[t-1]!=="/"&&r[t+1]!=="/"}function ds(r,t){let e=t.fonts.measurer,n=e.model,a=getComputedStyle(r),s=t.shape?.length?t.shape:void 0,o=s?s.map(h=>h.measure):t.measure??Rc(r,a),i=h=>s?s[Math.min(h,s.length-1)]:{measure:o,left:0},u=Ic(a),_=u.body==="justify",d=kc(u,Number.parseFloat(a.fontSize)),m=a.getPropertyValue("--pw-line-breaking").trim()==="browser",{segments:b,atoms:p,text:y,levels:P,migrated:v}=Cc(r,t),S=new Map(p.map(h=>[h.at,h])),I=h=>b.find(f=>h>=f.start&&h<f.end)??b.at(-1),k=(h,f)=>{let E=0;for(let A of b)A.end>h&&A.start<f&&(E+=A.run.widthBetween(Math.max(h,A.start),Math.min(f,A.end)));for(let A of p)A.at>=h&&A.at<f&&(E+=A.width);return E},R=h=>{let f=I(h);return f.run.widthBetween(h,h+1)-f.run.wordSpacing},H=Nc(a),Y=Number.parseFloat(a.getPropertyValue("--pw-protrusion")),N=Number.isFinite(Y)?Y:0,F=(H.expansion??0)>0,G=t.protrusion??ta,ee=(h,f)=>{if(!(N>0)||h<0||h>=y.length)return 0;let E=y[h],A=na(E,f,G);if(!A)return 0;let x=I(h);return h<x.start||h>=x.end?0:x.run.widthBetween(h,h+1)*A*N},D=(h,f)=>{let E=k(h,f);return!(N>0)&&!F||f<=h?xn(E):xn(E,{leftHang:ee(h,"left"),rightHang:ee(f-1,"right"),expand:F?E:0})},q=(h,f,E,A,x,w,L=!1)=>{te(D(h,f),{kind:"box",start:h,end:f});let U=I(Math.max(0,f-1)),C=wc(e,U,y.slice(E,A),f-E,x),O=L?qa(C,w):jt(w,C,!0);if(x!=="-"||!(N>0)&&!F){te(O,{kind:"break",at:f,hyphen:x,...L?{auto:!0}:{}});return}let K=e.shape(U.font,"-",U.style).width,W=N>0?K*na("-","right",G)*N:0;te({...O,...W?{rightHang:W}:{},...F?{expand:K}:{}},{kind:"break",at:f,hyphen:x,...L?{auto:!0}:{}})},ie=[],$=[],te=(h,f)=>{ie.push(h),$.push(f)},j=xt(a.getPropertyValue("text-indent")||"0px",Number.parseFloat(a.fontSize));j&&te(xn(j),{kind:"box",start:0,end:0});let ve=hr(a,"--pw-hyphen-penalty",50),ae=hr(a,"--pw-ex-hyphen-penalty",50),Ne=(h,f)=>{if(!t.hyphenator)return[];let E=I(h);if(aa(E.computed)!=="auto")return[];let A=E.style.lang,x=cr(A),w=hr(E.computed,"--pw-left-hyphen-min",x.left),L=hr(E.computed,"--pw-right-hyphen-min",x.right);return t.hyphenator.points(y.slice(h,f),A,{left:w,right:L}).map(U=>h+U)},xe=m?Pc(y,b,p,xc(y,S).flatMap(([h,f])=>Ne(h,f))):void 0,z=0;for(;z<y.length;){if(y[z]===" "){let A=I(z);if(m){te({type:"glue",width:A.run.widthBetween(z,z+1),stretch:_?1:0,shrink:0},{kind:"space",at:z,segment:A,sentence:!1}),z++;continue}let x=A.computed.getPropertyValue("--pw-word-space").trim()||_s,w=A.computed.getPropertyValue("--pw-xspace").trim(),L=w!==""&&w!==x&&Sc(y,z),U=hs(L?w:x,A.style.sizePx);te({type:"glue",...U,..._?{}:{stretch:0,shrink:0,stretchOrder:0}},{kind:"space",at:z,segment:A,sentence:L}),z++;continue}if(S.get(z)?.leader){te(jt(1e4),{kind:"leader",at:z}),te({type:"glue",width:0,stretch:1,shrink:0,stretchOrder:2},{kind:"leader",at:z}),z++;continue}if(S.has(z)){te(xn(S.get(z).width),{kind:"box",start:z,end:z+1}),z++;continue}let h=ms(y,S,z),f=z;for(let A of Ne(z,h))q(f,A,z,h,"-",ve,!0),f=A;let E=Ac.test(y.slice(z,h));for(let A=z;A<h;A++){let x=y[A];if(E&&A>f&&vc(y,A,h)&&(q(f,A,z,h,"",ae),f=A),!(x===Vt&&aa(I(A).computed)==="none")&&(x===Vt||yc.test(x)&&A>z&&A+1<h)){let w=A+1;q(f,w,z,h,x===Vt?"-":"",x===Vt?ve:ae),f=w}}f<h&&te(D(f,h),{kind:"box",start:f,end:h}),z=h}let Pe=[];if(xe){let h=ie.splice(0),f=$.splice(0);for(let[E,A]of h.entries()){let x=f[E];if(x.kind!=="box"||x.end<=x.start){te(A,x);continue}let w=x.start;for(let L of xe)L<w||L>=x.end||L===w&&f[E-1]?.kind==="leader"||(L>w&&te(D(w,L),{kind:"box",start:w,end:L}),(L>w||ie.at(-1)?.type==="box")&&te(jt(0),{kind:"break",at:L,hyphen:""}),Pe.push(ie.length-1),w=L);te(w===x.start?A:D(w,x.end),{kind:"box",start:w,end:x.end})}}let X=$a(ie,d.parFillSkip);for(;$.length>X.length-3;)$.pop();$.push({kind:"end"},{kind:"end"},{kind:"end"});let se=xe?ss(X,Pe,{measure:o,...H,leftSkip:d.start,rightSkip:d.end}):(t.lineBreaker?.(r)??os)(X,{measure:o,...H,leftSkip:d.start,rightSkip:d.end}),me=h=>_&&se.lines[h].glueOrder===0,Oe=new Map;for(let[h,f]of se.lines.entries())for(let E=f.start;E<f.end;E++){let A=$[E],x=X[E];if(A.kind!=="leader"||x.type!=="glue")continue;let w=S.get(A.at);w.width=x.width+(f.ratio>0&&(x.stretchOrder??0)===f.glueOrder?f.ratio*x.stretch:0),Oe.set(w,h)}let Je=(h,f,E)=>{let A=W=>Math.ceil(W*64-1e-6)/64,x=W=>Math.round(W*64)/64,w=0;for(let[W,J]of h.spacing)h.sentences.has(W)||(w=J);let L=(W,J,ce="")=>{let Z=0,ne=b.filter(ge=>ge.end>W&&ge.start<J);for(let[ge,be]of ne.entries()){let[Ge,de]=[Math.max(W,be.start),Math.min(J,be.end)],ye=y.slice(Ge,de)+(ge===ne.length-1?ce:"");Z+=A(e.shape(be.font,ye,{...be.style,wordSpacingPx:w},{levels:P.subarray(Ge,de)}).width)}for(let ge of p)ge.at>=W&&ge.at<J&&(Z+=ge.width);return Z},U=[...h.sentences.keys()].sort((W,J)=>W-J),C=x(f),O=f,K=h.start;for(let[W,J]of U.entries()){C+=L(K,J);let ce=K;for(let[be,Ge]of h.spacing)be<K||be>=J||(O+=k(ce,be)+R(be)+Ge,ce=be+1);O+=k(ce,J)+h.sentences.get(J);let Z=W===U.length-1&&E!==void 0?x(E)-L(J+1,h.end,h.hyphen):x(O),ne=I(J),ge=e.shape(ne.font," ",{...ne.style,wordSpacingPx:0}).width;h.spacing.set(J,Z-C-ge-1/256),C=Z,K=J+1}return C+L(K,h.end,h.hyphen)},le=[];for(let h of se.lines){let f=y.length;for(let O=h.start;O<=h.end&&O<$.length;O++){let K=$[O];if(K.kind==="box"&&K.end>K.start){f=K.start;break}}le.length===0&&(f=0);let E=$[h.end],A=E.kind==="space"||E.kind==="break"?E.at:y.length,x=h.hyphenated&&E.kind==="break"?E.hyphen:"",w=new Map,L=new Map;for(let O=h.start;O<h.end;O++){let K=$[O],W=X[O];if(K.kind!=="space"||W.type!=="glue")continue;let J=W.stretchOrder??0,ce=W.width;h.ratio>0&&J===h.glueOrder?ce+=h.ratio*W.stretch:h.ratio<0&&(ce+=h.ratio*W.shrink),K.sentence&&L.set(K.at,ce),w.set(K.at,ce-R(K.at))}let U=X[h.end],C=E.kind==="break"&&U.type==="penalty"?U.width:0;le.push({start:f,end:A,hyphen:x,auto:!!x&&E.kind==="break"&&!!E.auto,spacing:w,sentences:L,width:C,tracking:0,wdth:0})}let De=new Intl.Segmenter(void 0,{granularity:"grapheme"}),Ue=h=>{let f=se.lines[h];if(f.expansion===0)return;let E=le[h],A=b.filter(U=>U.end>E.start&&U.start<E.end);if(A.length>0&&A.every(U=>"wdth"in U.font.axes))return{tracking:0,wdth:100*(1+f.expansion)};let x=0;for(let U=f.start;U<f.end;U++){let C=X[U];C?.type==="box"&&(x+=C.expand??0)}let w=X[f.end];w?.type==="penalty"&&(x+=w.expand??0);let L=0;for(let{segment:U}of De.segment(y.slice(E.start,E.end)+E.hyphen))/^\s$/u.test(U)||L++;return{tracking:L>0?f.expansion*x/L:0,wdth:0}},Ae=(h,f)=>{let E=f.wdth;if(E){let A=h.font.axes.wdth;A&&(E=Math.min(A.max,Math.max(A.min,E)))}return{...h.style,letterSpacingPx:h.style.letterSpacingPx+f.tracking,wordSpacingPx:0,features:f.tracking!==0?{...h.style.features,liga:0,clig:0,dlig:0,hlig:0,calt:0}:h.style.features,variations:E?{...h.style.variations,wdth:E}:h.style.variations}},Ee=(h,f,E)=>{let A=f===0?j:0,x=b.filter(w=>w.end>h.start&&w.start<h.end);for(let[w,L]of x.entries()){let U=Math.max(h.start,L.start),C=Math.min(h.end,L.end),O=y.slice(U,C)+(w===x.length-1?h.hyphen:"");O&&(A+=e.shape(L.font,O,Ae(L,E),{levels:P.subarray(U,C)}).width)}for(let w of p)w.at>=h.start&&w.at<h.end&&(A+=w.width);for(let w of h.spacing.values())A+=w;return A},pe=n.advanceUnit;if(!pe)for(let h of le){let f=[...h.spacing.keys()].filter(A=>!h.sentences.has(A)),E=0;for(let A of f)E+=h.spacing.get(A);for(let A of f)h.spacing.set(A,E/f.length)}for(let[h,f]of le.entries()){let E=se.lines[h],A=E.measure+(me(h)?E.leftHang+E.rightHang:0),x=Ue(h);if(x){let C=x.tracking&&Number.parseFloat(a.letterSpacing)||0;if(f.tracking=x.tracking?C+x.tracking:0,f.wdth=x.wdth,x.tracking)for(let[W,J]of f.spacing)f.spacing.set(W,yt(n,J-x.tracking));let O=Ee(f,h,x);if(me(h)&&f.spacing.size>0)if(pe){let W=Math.round((A-O)/pe),J=[...f.spacing.keys()];for(let ce=0;W!==0&&ce<J.length*4;ce++){let Z=J[ce%J.length],ne=Math.sign(W)*pe;f.spacing.set(Z,f.spacing.get(Z)+ne),O+=ne,W-=Math.sign(W)}}else{let W=[...f.spacing.keys()],J=(A-O)/W.length;for(let ce of W)f.spacing.set(ce,f.spacing.get(ce)+J);O=A}f.width=O;continue}if(!pe&&f.sentences.size){f.width=Je(f,h===0?j:0,me(h)?A:void 0);continue}let w=f.width,L=f.start;for(let[C,O]of f.spacing){w+=k(L,C)+R(C);let K=yt(n,O);w+=K,f.spacing.set(C,K),L=C+1}w+=k(L,f.end)+(h===0?j:0);let U=me(h)&&f.spacing.size>0;if(pe&&U){let C=Math.round((A-w)/pe),O=[...f.spacing.keys()];for(let K=0;C!==0&&K<O.length*4;K++){let W=O[K%O.length],J=Math.sign(C)*pe;f.spacing.set(W,f.spacing.get(W)+J),w+=J,C-=Math.sign(C)}}f.width=w}let Ye=le.map(h=>{if(pe)return jc([...h.spacing.values()]);for(let[f,E]of h.spacing)if(!h.sentences.has(f))return E}),{elements:ue,hyphens:Pt}=Uc(r,b,p,le.map((h,f)=>({start:h.start,end:h.end,hyphen:h.hyphen,leftHang:se.lines[f].leftHang,rightHang:me(f)?se.lines[f].rightHang:0,tracking:h.tracking,wdth:h.wdth})),le.map(h=>h.spacing),Ye,i,j);if(Mc(r,a,[...Oe.keys()]),n.engine==="firefox"&&pe)for(let[h,f]of le.entries()){let E=se.lines[h],A=ue[h],x=ra(A)+(h===0?j:0);if(!me(h)||!f.spacing.size){f.width=x;continue}let w=Math.round((E.measure+E.leftHang+E.rightHang-x)/pe);f.width=x+(w?Gc(A,w,pe):0)}else for(let[h,f]of le.entries()){let E=se.lines[h],A=b.filter(L=>L.end>f.start&&L.start<f.end).length+p.filter(L=>L.at>=f.start&&L.at<f.end).length;if(E.expansion===0&&(A<2||f.sentences.size))continue;let x=ue[h];if(!me(h)||!f.spacing.size){E.expansion===0&&(f.width=ra(x)+(h===0?j:0));continue}let w=E.measure+E.leftHang+E.rightHang;for(let L=0;L<3;L++){let U=w-(ra(x)+(h===0?j:0));if(Math.abs(U)<1/128)break;let C=U/f.spacing.size;x.style.wordSpacing=`${(Number.parseFloat(x.style.wordSpacing)||0)+C}px`;for(let O of x.querySelectorAll(".pw-space"))O.closest(".pw-break")||!O.style.wordSpacing||(O.style.wordSpacing=`${(Number.parseFloat(O.style.wordSpacing)||0)+C}px`)}f.width=w}let it=a.direction==="rtl";for(let[h,f]of le.entries()){let E=h===le.length-1?u.last:u.body,A=E==="end"?1:E==="center"?.5:0,x=Math.max(0,se.lines[h].measure-f.width)*A;if(!x||me(h)||[...Oe.values()].includes(h))continue;let w=ue[h].style,L=it?"paddingRight":"paddingLeft";w.width=`${Number.parseFloat(w.width)-x}px`,w[L]=`${(Number.parseFloat(w[L])||0)+x}px`}let M=h=>{let f=0;for(;f+1<le.length&&le[f+1].start<=h;)f++;return f},re=v.map(h=>({...h,line:M(h.removed?Math.max(0,h.offset-1):h.offset)}));return{text:y,items:X,breaks:se,migrated:re,lines:le.map((h,f)=>({start:h.start,end:h.end,measure:se.lines[f].measure,ratio:se.lines[f].ratio,hyphenated:h.hyphen!=="",width:h.width,element:ue[f],...Pt[f]?{hyphen:{text:h.hyphen,offset:h.end,auto:h.auto,element:Pt[f]}}:{}}))}}function ms(r,t,e){let n=e;for(;n<r.length&&r[n]!==" "&&!t.has(n);)n++;return n}function xc(r,t){let e=[];for(let n=0;n<r.length;){if(r[n]===" "||t.has(n)){n++;continue}let a=ms(r,t,n);e.push([n,a]),n=a}return e}function Pc(r,t,e,n){let a=[],s=new Map,o=new Set,i=new Set(n);try{for(let p of t){let y=p.node.data,P=[],v="";for(let I=0;I<y.length;I++)I>0&&i.has(p.start+I)&&(v+=Vt,P.push(-1)),v+=y[I],P.push(p.start+I);i.has(p.end)&&(v+=Vt,P.push(-1)),s.set(p,P),v!==y&&(p.node.data=v,a.push(()=>{p.node.data=y}));let S=p.element;if(aa(p.computed)==="auto"&&!o.has(S)){o.add(S);let I=S.getAttribute("style");S.style.setProperty("hyphens","manual","important"),S.style.setProperty("-webkit-hyphens","manual","important"),a.push(()=>I===null?S.removeAttribute("style"):S.setAttribute("style",I))}}let u=[...t.map(p=>({at:p.start,segment:p})),...e.map(p=>({at:p.at,atom:p}))].sort((p,y)=>p.at-y.at),_=[],d,m=(p,y)=>{y.height<=0||(d&&y.top+y.bottom-d.top-d.bottom>Math.max(y.height,d.height)&&_.push(p),d=y)},b=document.createRange();for(let p of u){if("atom"in p){m(p.at,p.atom.element.getBoundingClientRect());continue}let y=p.segment;for(let[P,v]of s.get(y).entries()){if(v<0)continue;b.setStart(y.node,P),b.setEnd(y.node,P+1);let S=[...b.getClientRects()].at(-1);S&&m(v,S)}}return ot(b),[...new Set(_.map(p=>r[p]===" "?p+1:p))].filter(p=>p<r.length)}finally{for(let u of a.reverse())u()}}function wc(r,t,e,n,a){return r.shape(t.font,e.slice(0,n)+a,t.style).width-r.shape(t.font,e,t.style).widthBetween(0,n)}function Sc(r,t){let e=t-1;for(;e>=0&&bc.test(r[e]);)e--;if(e<0||!".?!:".includes(r[e]))return!1;let n=[...r.slice(Math.max(0,e-2),e)].at(-1)??"";return!/\p{Lu}/u.test(n)}function Ic(r){let t=r.direction==="rtl",e=s=>{switch(s.replace(/^-(webkit|moz)-/,"")){case"left":return t?"end":"start";case"right":return t?"start":"end";case"end":return"end";case"center":return"center";case"justify":return"justify";case"start":return"start";default:return}},n=e(r.textAlign)??"start",a=e(r.getPropertyValue("text-align-last"))??(n==="justify"?"start":n);return{body:n,last:a}}var Ec=2;function kc(r,t){let e={width:0,stretch:0,shrink:0},n={width:0,stretch:1,shrink:0,stretchOrder:1};switch(r.body){case"justify":return{start:e,end:e,...r.last==="justify"?{parFillSkip:e}:{}};case"start":return{start:e,end:{width:0,stretch:Ec*t,shrink:0}};case"end":return{start:n,end:e,parFillSkip:e};case"center":return{start:n,end:n,parFillSkip:e}}}function Nc(r){let t=Number.parseFloat(r.fontSize),e={},n=[["--pw-tolerance","tolerance"],["--pw-pretolerance","pretolerance"],["--pw-line-penalty","linePenalty"],["--pw-adj-demerits","adjDemerits"],["--pw-double-hyphen-demerits","doubleHyphenDemerits"],["--pw-final-hyphen-demerits","finalHyphenDemerits"],["--pw-looseness","looseness"]];for(let[o,i]of n){let u=r.getPropertyValue(o).trim();u&&(e[i]=Number.parseInt(u,10))}let a=r.getPropertyValue("--pw-emergency-stretch").trim();a&&(e.emergencyStretch=xt(a,t));let s=r.getPropertyValue("--pw-expansion").trim();return s&&(e.expansion=Number.parseInt(s,10)/1e3),e}function aa(r){let t=r.getPropertyValue("hyphens")||r.getPropertyValue("-webkit-hyphens");return t==="auto"||t==="none"?t:"manual"}function hr(r,t,e){let n=r.getPropertyValue(t).trim();return n?Number.parseInt(n,10):e}function Rc(r,t){let e=r.getBoundingClientRect().width,n=a=>Number.parseFloat(t.getPropertyValue(a))||0;return e-n("padding-left")-n("padding-right")-n("border-left-width")-n("border-right-width")}var Lc=new Set(["img","svg","math","video","canvas","iframe","object","embed","input","select","textarea","button","audio"]);function Fc(r,t){if(Lc.has(r.localName))return!0;let e=t.display;return/^inline[- ](block|flex|grid|table|flow-root)$/.test(e)||e==="inline math"||e==="math"}var Tc="0.25em";function gs(r){return r.getPropertyValue("--pw-leader").trim()!==""}function Hc(r,t,e){let n=t.getPropertyValue("--pw-leader").trim(),a=/^(["'])(.*)\1$/.exec(n),s=a?a[2].replace(/\\(.)/g,"$1"):"",o=Number.parseFloat(t.fontSize),i=xt(t.getPropertyValue("--pw-leader-space").trim()||Tc,o);if(!s)return{text:s,space:i,textWidth:0,box:0,spaceWidth:0};let{fonts:u}=e,_=u.lookup(t.fontFamily,t)??u.fallback();if(!_)throw new Error(`no font registered for font-family ${t.fontFamily}`);let d=_r(t,r.closest("[lang]")?.getAttribute("lang")??"");d.setSizePx=ea(u.measurer,r,_,d,s);let m={...d,letterSpacingPx:0,wordSpacingPx:0},b=u.measurer.shape(_,s,m).width,p=u.measurer.shape(_," ",m).width;return{text:s,space:i,textWidth:b,box:b+2*i,spaceWidth:p}}function Mc(r,t,e){if(!e.length)return;let n=t.direction==="rtl";for(let u of e){let _=u.element;_.replaceChildren(),_.style.cssText+=`;display:inline-block;box-sizing:border-box;width:${Math.max(0,u.width)}px;margin:0;padding:0;border:0;white-space:pre;text-indent:0;letter-spacing:0;font-kerning:none`}let a=r.getBoundingClientRect(),s=u=>Number.parseFloat(t.getPropertyValue(u))||0,o=n?a.right-s("border-right-width"):a.left+s("border-left-width"),i=e.map(u=>{let _=u.element.getBoundingClientRect();return n?o-_.right:_.left-o});for(let[u,_]of e.entries()){let d=_.leader;if(!d.text||d.box<=0)continue;let m=i[u],b=Math.ceil(m/d.box-1e-6),p=Math.floor((m+_.width)/d.box+1e-6)-b;if(p<=0)continue;let y=_.element;y.style.paddingInlineStart=`${b*d.box-m+d.space}px`,y.style.wordSpacing=`${d.box-d.textWidth-d.spaceWidth}px`,y.textContent=Array.from({length:p},()=>d.text).join(" "),y.dataset.pwGenerated="leader"}}function Cc(r,t){let{fonts:e}=t,n=[],a=[],s=new Set,o=v=>{for(let S of[...v.childNodes]){if(S.nodeType===Node.TEXT_NODE){n.push(S);continue}if(S.nodeType!==Node.ELEMENT_NODE)continue;let I=S,k=getComputedStyle(I);if(k.display==="none")continue;let R=t.migrate?.(I,k);if(R&&a.push({element:I,piece:n.length,removed:R!=="keep"}),R==="remove")I.remove();else{if(R==="hold")continue;gs(k)||Fc(I,k)?(n.push(I),s.add(I)):o(I)}}};o(r);let i=!0;for(let v of n){if(!(v instanceof Text)){i=!1;continue}let S="";for(let I of v.data.replace(/[\t\n\r\f ]+/g," "))I===" "&&i||(S+=I,i=I===" ");v.data=S}for(let v=n.length-1;v>=0;v--){let S=n[v];if(!(S instanceof Text)||!S.data.endsWith(" ")&&S.data)break;S.data=S.data.trimEnd()}let u=n.map(v=>v instanceof Text?v.data:mc).join(""),_=Oc(r,n,u),d=[],m=[],b=[],p=new Map;for(let v of n)v instanceof Text&&v.parentElement&&p.set(v.parentElement,(p.get(v.parentElement)??"")+v.data);let y=0;for(let v of n){let S=y;if(b.push(S),!(v instanceof Text)){y++;let N=getComputedStyle(v);if(gs(N)){m.push({at:S,element:v,width:0,leader:Hc(v,N,t)});continue}let F=(Number.parseFloat(N.marginLeft)||0)+(Number.parseFloat(N.marginRight)||0);m.push({at:S,element:v,width:v.getBoundingClientRect().width+F});continue}if(y+=v.data.length,S===y)continue;let I=v.parentElement,k=getComputedStyle(I),R=e.lookup(k.fontFamily,k)??(t.givenFontsOnly?void 0:e.fallback());if(!R)throw new Error(`no font registered for font-family ${k.fontFamily}`);let H=_r(k,I.closest("[lang]")?.getAttribute("lang")??"");H.setSizePx=ea(e.measurer,I,R,H,p.get(I));let Y=e.measurer.shape(R,u,H,{start:S,end:y,levels:_});d.push({node:v,start:S,end:y,style:H,font:R,run:Y,element:I,computed:k})}if(b.push(y),!d.length&&!m.length)throw new Error("a paragraph with no text");if(!d.length)throw new Error("a paragraph of atomic inlines alone: it needs text, for its font");let P=a.map(v=>({element:v.element,offset:b[v.piece],removed:v.removed}));return{segments:d,atoms:m,text:u,levels:_,migrated:P}}function Oc(r,t,e){let n=getComputedStyle(r),a=n.unicodeBidi==="plaintext"?"auto":n.direction==="rtl"?"rtl":"ltr",s=[],o=[],i=0;for(let _ of t){let d=_ instanceof Text?_.data.length:1,m=[];for(let P=_.parentElement;P&&P!==r;P=P.parentElement)m.unshift(P);let b=0;for(;b<o.length&&o[b].element===m[b];)b++;let p=o.splice(b).reverse().map(P=>P.close).join(""),y="";for(let P of m.slice(b)){let v=getComputedStyle(P),S=ba(v.direction,v.unicodeBidi);y+=S.open,o.push({element:P,close:S.close})}(p||y)&&s.push({at:i,controls:p+y}),i+=d}let u=o.reverse().map(_=>_.close).join("");return u&&s.push({at:i,controls:u}),Tr(e,a,s)}function Uc(r,t,e,n,a,s,o,i){let u=0;for(let k of r.querySelectorAll("*"))e.some(R=>R.element.contains(k))||k.setAttribute(pr,String(u++));let _=k=>{let R=[],H=k.commonAncestorContainer;for(let N=H.nodeType===Node.ELEMENT_NODE?H:H.parentElement;N&&N!==r;N=N.parentElement)R.push(N);let Y=k.extractContents();for(let N of R){let F=N.cloneNode(!1);F.append(Y),Y=F}return Y},d=(k,R=0)=>{let H=document.createRange(),Y=e.find(G=>G.at===k),N=t.find(G=>k>=G.start&&k<G.end),F=e.find(G=>G.at===k-1);if(Y)H.setStartBefore(Y.element),H.collapse(!0);else if(!N&&F)H.setStartAfter(F.element),H.collapse(!0);else{let G=N??t.at(-1),ee=Math.min(k-G.start,G.node.length);H.setStart(G.node,ee),H.setEnd(G.node,Math.min(ee+R,G.node.length))}return H},m=document.createRange();m.selectNodeContents(r),m.collapse(!0);let b=Math.max(t.at(-1).end,(e.at(-1)?.at??-1)+1),p=[m,...n.slice(1).map(k=>d(k.start)),d(b)],y=[...r.querySelectorAll("*")].filter(k=>!k.textContent&&!k.childElementCount),P=n.map(k=>d(k.end)),v=a.flatMap((k,R)=>[...k].filter(([,H])=>H!==s[R]).map(([H,Y])=>({range:d(H,1),v:Y})));for(let{range:k,v:R}of v){let H=document.createElement("span");H.className="pw-space",H.style.wordSpacing=`${R}px`,k.surroundContents(H),ot(k)}let S=[],I=[];for(let[k,R]of n.entries()){let H=s[k],Y=document.createRange();Y.setStart(p[k].startContainer,p[k].startOffset),Y.setEnd(P[k].startContainer,P[k].startOffset);let N=_(Y);ot(Y);let F=document.createElement("span");F.className="pw-line";let{measure:G,left:ee}=o(k),D=R.leftHang??0,q=R.rightHang??0,ie=(k===0?G-i:G)+D+q,$=ee+(k===0&&i<0?i:0)-D;if(F.style.cssText=`display:block;width:${ie}px;white-space:pre;text-align:start;text-align-last:auto;text-indent:0;text-rendering:geometricPrecision;word-spacing:${H??0}px`+(k===0&&i>0?`;padding-left:${i}px`:"")+($?`;margin-left:${$}px`:"")+(R.tracking?`;letter-spacing:${R.tracking}px`:"")+(R.wdth?`;font-stretch:${R.wdth}%`:""),F.append(N),R.hyphen){let j=document.createElement("span");j.className="pw-generated pw-hyphen",j.dataset.pwGenerated="hyphen",j.setAttribute("aria-hidden","true"),j.textContent=R.hyphen;let ve=zc(F);ve?ve.after(j):F.append(j),I[k]=j}let te=document.createRange();if(te.setStart(P[k].startContainer,P[k].startOffset),te.setEnd(p[k+1].startContainer,p[k+1].startOffset),!te.collapsed){let j=document.createElement("span");j.className="pw-break",j.append(_(te)),F.append(j)}ot(te),S.push(F)}return ot(...p,...P),S.at(-1)?.append(...y.filter(k=>r.contains(k)&&!k.closest(".pw-line"))),r.replaceChildren(...S),Bc(S),{elements:S,hyphens:I}}var pr="data-pw-piece";function Bc(r){let t=new Map;for(let a of r)for(let s of a.querySelectorAll(`[${pr}]`)){let o=s.getAttribute(pr);s.removeAttribute(pr);let i=t.get(o);i?i.push(s):t.set(o,[s])}let e=[];for(let a of t.values()){if(a.length<2)continue;let s=b=>!!b.closest(".pw-break");for(let b of a)s(b)&&!b.hasChildNodes()&&b.remove();a=a.filter(b=>b.parentNode);let o=a.filter(b=>!s(b)),i=o[0]??a[0],u=o.at(-1)??a.at(-1);for(let b of a)b!==i&&b.removeAttribute("id");let _=getComputedStyle(i);if((_.getPropertyValue("box-decoration-break")||_.getPropertyValue("-webkit-box-decoration-break"))==="clone")continue;let[d,m]=_.direction==="rtl"?["right","left"]:["left","right"];for(let b of a){let p=[...b!==i?[d]:[],...b!==u?[m]:[]];p.length&&e.push({piece:b,sides:p})}}let n=e.map(({piece:a,sides:s})=>{let o=getComputedStyle(a);return{piece:a,props:s.flatMap(i=>Dc(i).filter(u=>(Number.parseFloat(o.getPropertyValue(u))||0)!==0))}});for(let{piece:a,props:s}of n)for(let o of s)a.style.setProperty(o,o.startsWith("--")?"0px":"0")}var Dc=r=>[`padding-${r}`,`border-${r}-width`,`--pw-border-${r}-width`,`margin-${r}`,`border-top-${r}-radius`,`border-bottom-${r}-radius`];function ra(r){let t=document.createRange();t.setStart(r,0);let e=r.querySelector(":scope > .pw-break");e?t.setEndBefore(e):t.setEnd(r,r.childNodes.length);let n=t.getBoundingClientRect().width;return ot(t),n}function Gc(r,t,e){let n=[],a=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(let u=a.nextNode();u;u=a.nextNode())if(!u.parentElement?.closest(".pw-break"))for(let _=0;_<u.length;_++)u.data[_]===" "&&n.push({node:u,offset:_});if(!n.length)return 0;let s=Number.parseFloat(r.style.wordSpacing)||0,o=Math.sign(t)*e,i=new Map;for(let u=0;u<Math.abs(t);u++)i.set(u%n.length,(i.get(u%n.length)??0)+o);for(let[u,_]of[...i].sort(([d],[m])=>m-d)){let{node:d,offset:m}=n[u],b=d.parentElement;if(b.classList.contains("pw-space")){b.style.wordSpacing=`${(Number.parseFloat(b.style.wordSpacing)||0)+_}px`;continue}let p=document.createRange();p.setStart(d,m),p.setEnd(d,m+1);let y=document.createElement("span");y.className="pw-space",y.style.wordSpacing=`${s+_}px`,p.surroundContents(y),ot(p)}return t*e}function zc(r){let t=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),e;for(let n=t.nextNode();n;n=t.nextNode())n.length&&(e=n);return e}function jc(r){let t=new Map,e,n=0;for(let a of r){let s=(t.get(a)??0)+1;t.set(a,s),s>n&&(e=a,n=s)}return e}function Wc(r){let t=getComputedStyle(r);return t.getPropertyValue("--pw-line-breaking").trim()==="knuth-plass"&&t.textAlign==="justify"&&t.display==="block"}function bs(r){return[...r.querySelectorAll("p")].filter(Wc)}var gr=class{constructor(t){this.options=t;typeof ResizeObserver<"u"&&(this.#t=new ResizeObserver(e=>{for(let n of e){let a=n.target;Math.abs(n.contentRect.width-(this.#e.get(a)?.width??-1))>=.5&&this.justify(a)}}))}options;#e=new WeakMap;#t;justify(t){let e=this.#e.get(t);if(e)t.replaceChildren(e.content.cloneNode(!0));else{let a=document.createDocumentFragment();for(let s of t.childNodes)a.append(s.cloneNode(!0));e={content:a,width:-1},this.#e.set(t,e)}let n=t.getBoundingClientRect().width;if(e.width=n,n<=0)return!1;try{return ds(t,{fonts:this.options.fonts,givenFontsOnly:!0,...this.options.hyphenator?{hyphenator:this.options.hyphenator}:{}}),t.classList.add("pw-justified"),!0}catch{return t.replaceChildren(e.content.cloneNode(!0)),t.classList.remove("pw-justified"),!1}}observe(t){for(let e of t)this.justify(e),this.#t?.observe(e)}disconnect(){this.#t?.disconnect()}};async function ys(r,t){let e=new lr,[n]=await Promise.all([fetch(t).catch(()=>{}),e.prepare(r).catch(()=>{})]);return n?.ok&&e.addExceptions(Qa(await n.text()).exceptions),e}function As(r=document){let t=[],e=(n,a)=>{for(let s of n)if(s instanceof CSSFontFaceRule){let o=_=>s.style.getPropertyValue(_).trim(),i=Sr(o("font-family")),u=fa(o("src"))?.find(_=>_.kind==="url");if(!i||!u||u.kind!=="url")continue;t.push({family:i,url:new URL(u.url,a).href,...o("font-weight")?{weight:o("font-weight")}:{},...o("font-style")?{style:o("font-style")}:{},...o("font-stretch")?{stretch:o("font-stretch")}:{}})}else"cssRules"in s&&e(s.cssRules,a)};for(let n of r.styleSheets){let a;try{a=n.cssRules}catch{continue}e(a,n.href??r.baseURI)}return t}async function vs(){let r=bs(document);if(!r.length)return;await document.fonts.ready;let t=new Xn(await sr.create());await Promise.all(As().map(async n=>{let a=await fetch(n.url);a.ok&&await t.add(n.family,new Uint8Array(await a.arrayBuffer()),{...n.weight?{weight:n.weight}:{},...n.style?{style:n.style}:{},...n.stretch?{stretch:n.stretch}:{},page:!1})}));let e=await ys(document.documentElement,new URL("hyphenation.txt",import.meta.url));new gr({fonts:t,hyphenator:e}).observe(r),document.documentElement.dataset.pwJustified=String(r.filter(n=>n.classList.contains("pw-justified")).length)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{vs()},{once:!0}):vs();