@jean-is/render 0.8.0-rba68a676ffad → 0.8.0-rede3e4e8e9a5

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 (1421) hide show
  1. package/brand.js +3 -1
  2. package/caps/charts/charts.css +5 -2
  3. package/caps/charts/charts.js +45 -24
  4. package/caps/charts/option.js +11 -1
  5. package/caps/files/midi.js +1 -1
  6. package/caps/files/office.js +4 -4
  7. package/caps/games/file.js +56 -0
  8. package/caps/games/frame.css +22 -0
  9. package/caps/games/guard.js +86 -0
  10. package/caps/games/page.js +52 -0
  11. package/caps/games/shell.js +260 -0
  12. package/caps/interactive/apps.js +23 -8
  13. package/caps/interactive/diagram.js +96 -22
  14. package/caps/interactive/interactive.css +22 -6
  15. package/caps/interactive/interactive.js +25 -10
  16. package/caps/interactive/live.js +96 -0
  17. package/caps/interactive/map.js +22 -2
  18. package/caps/interactive/mode.js +9 -6
  19. package/caps/interactive/page-diagram.js +6 -2
  20. package/caps/interactive/parts.js +124 -0
  21. package/caps/interactive/view-parts.js +209 -0
  22. package/caps/layouts/layouts.css +12 -12
  23. package/caps/layouts/layouts.js +25 -17
  24. package/caps/layouts/shapes.js +1 -1
  25. package/caps/made/formats.js +84 -46
  26. package/caps/made/paper.js +142 -0
  27. package/caps/math/math.js +2 -2
  28. package/caps/scores/scores.css +10 -4
  29. package/caps/scores/scores.js +99 -51
  30. package/caps/share/view.js +1 -1
  31. package/caps/skills/directory.js +6 -3
  32. package/caps/skills/sources.js +4 -2
  33. package/caps/slides/edit.js +2 -2
  34. package/caps/slides/kit-page.css +8 -2
  35. package/caps/slides/kit-page.js +47 -38
  36. package/caps/slides/kit-sample.js +36 -0
  37. package/caps/slides/kit-slot.js +10 -0
  38. package/caps/slides/kit.js +3 -0
  39. package/caps/slides/save.js +24 -58
  40. package/caps/slides/slides.css +9 -9
  41. package/caps/slides/slides.js +24 -24
  42. package/caps/tables/formula.js +133 -0
  43. package/core/conversations.js +151 -0
  44. package/core/deferred.js +36 -16
  45. package/core/events.js +1 -1
  46. package/core/files.js +9 -3
  47. package/core/fs.js +3 -11
  48. package/core/hooks.js +2 -2
  49. package/core/i18n.js +1 -1
  50. package/core/llm.js +34 -45
  51. package/core/loop.js +15 -17
  52. package/core/oauth.js +31 -0
  53. package/core/search.js +1 -1
  54. package/core/settings.js +12 -11
  55. package/core/skills.js +3 -3
  56. package/core/vertex.js +37 -0
  57. package/locales/am.json +19 -3
  58. package/locales/approvals/am.json +2 -1
  59. package/locales/approvals/ar.json +2 -1
  60. package/locales/approvals/bg.json +2 -1
  61. package/locales/approvals/bn.json +2 -1
  62. package/locales/approvals/br.json +2 -1
  63. package/locales/approvals/co.json +2 -1
  64. package/locales/approvals/cs.json +2 -1
  65. package/locales/approvals/da.json +2 -1
  66. package/locales/approvals/de.json +2 -1
  67. package/locales/approvals/el.json +2 -1
  68. package/locales/approvals/en.json +2 -1
  69. package/locales/approvals/es.json +2 -1
  70. package/locales/approvals/fa.json +2 -1
  71. package/locales/approvals/fi.json +2 -1
  72. package/locales/approvals/fr-CA.json +2 -1
  73. package/locales/approvals/fr.json +2 -1
  74. package/locales/approvals/ha.json +2 -1
  75. package/locales/approvals/he.json +2 -1
  76. package/locales/approvals/hi.json +2 -1
  77. package/locales/approvals/hr.json +2 -1
  78. package/locales/approvals/hu.json +2 -1
  79. package/locales/approvals/id.json +2 -1
  80. package/locales/approvals/it.json +2 -1
  81. package/locales/approvals/ja.json +2 -1
  82. package/locales/approvals/ko.json +2 -1
  83. package/locales/approvals/mr.json +2 -1
  84. package/locales/approvals/ms.json +2 -1
  85. package/locales/approvals/nl.json +2 -1
  86. package/locales/approvals/pl.json +2 -1
  87. package/locales/approvals/pt.json +2 -1
  88. package/locales/approvals/ro.json +2 -1
  89. package/locales/approvals/ru.json +2 -1
  90. package/locales/approvals/sk.json +2 -1
  91. package/locales/approvals/sv.json +2 -1
  92. package/locales/approvals/sw.json +2 -1
  93. package/locales/approvals/ta.json +2 -1
  94. package/locales/approvals/te.json +2 -1
  95. package/locales/approvals/th.json +2 -1
  96. package/locales/approvals/tl.json +2 -1
  97. package/locales/approvals/tr.json +2 -1
  98. package/locales/approvals/uk.json +2 -1
  99. package/locales/approvals/ur.json +2 -1
  100. package/locales/approvals/vi.json +2 -1
  101. package/locales/approvals/yo.json +2 -1
  102. package/locales/approvals/zh-Hans.json +2 -1
  103. package/locales/approvals/zh-Hant.json +2 -1
  104. package/locales/ar.json +23 -3
  105. package/locales/bg.json +19 -3
  106. package/locales/bn.json +19 -3
  107. package/locales/br.json +22 -3
  108. package/locales/brains/am.json +6 -3
  109. package/locales/brains/ar.json +6 -3
  110. package/locales/brains/bg.json +6 -3
  111. package/locales/brains/bn.json +6 -3
  112. package/locales/brains/br.json +6 -3
  113. package/locales/brains/co.json +6 -3
  114. package/locales/brains/cs.json +6 -3
  115. package/locales/brains/da.json +6 -3
  116. package/locales/brains/de.json +6 -3
  117. package/locales/brains/el.json +6 -3
  118. package/locales/brains/en.json +6 -3
  119. package/locales/brains/es.json +6 -3
  120. package/locales/brains/fa.json +6 -3
  121. package/locales/brains/fi.json +6 -3
  122. package/locales/brains/fr-CA.json +6 -3
  123. package/locales/brains/fr.json +6 -3
  124. package/locales/brains/ha.json +6 -3
  125. package/locales/brains/he.json +6 -3
  126. package/locales/brains/hi.json +6 -3
  127. package/locales/brains/hr.json +6 -3
  128. package/locales/brains/hu.json +6 -3
  129. package/locales/brains/id.json +6 -3
  130. package/locales/brains/it.json +6 -3
  131. package/locales/brains/ja.json +6 -3
  132. package/locales/brains/ko.json +6 -3
  133. package/locales/brains/mr.json +6 -3
  134. package/locales/brains/ms.json +6 -3
  135. package/locales/brains/nl.json +6 -3
  136. package/locales/brains/pl.json +6 -3
  137. package/locales/brains/pt.json +6 -3
  138. package/locales/brains/ro.json +6 -3
  139. package/locales/brains/ru.json +6 -3
  140. package/locales/brains/sk.json +6 -3
  141. package/locales/brains/sv.json +6 -3
  142. package/locales/brains/sw.json +6 -3
  143. package/locales/brains/ta.json +6 -3
  144. package/locales/brains/te.json +6 -3
  145. package/locales/brains/th.json +6 -3
  146. package/locales/brains/tl.json +6 -3
  147. package/locales/brains/tr.json +6 -3
  148. package/locales/brains/uk.json +6 -3
  149. package/locales/brains/ur.json +6 -3
  150. package/locales/brains/vi.json +6 -3
  151. package/locales/brains/yo.json +6 -3
  152. package/locales/brains/zh-Hans.json +6 -3
  153. package/locales/brains/zh-Hant.json +6 -3
  154. package/locales/camera/am.json +20 -0
  155. package/locales/camera/ar.json +20 -0
  156. package/locales/camera/bg.json +20 -0
  157. package/locales/camera/bn.json +20 -0
  158. package/locales/camera/br.json +20 -0
  159. package/locales/camera/co.json +20 -0
  160. package/locales/camera/cs.json +20 -0
  161. package/locales/camera/da.json +20 -0
  162. package/locales/camera/de.json +20 -0
  163. package/locales/camera/el.json +20 -0
  164. package/locales/camera/en.json +20 -0
  165. package/locales/camera/es.json +20 -0
  166. package/locales/camera/fa.json +20 -0
  167. package/locales/camera/fi.json +20 -0
  168. package/locales/camera/fr-CA.json +20 -0
  169. package/locales/camera/fr.json +20 -0
  170. package/locales/camera/ha.json +20 -0
  171. package/locales/camera/he.json +20 -0
  172. package/locales/camera/hi.json +20 -0
  173. package/locales/camera/hr.json +20 -0
  174. package/locales/camera/hu.json +20 -0
  175. package/locales/camera/id.json +20 -0
  176. package/locales/camera/it.json +20 -0
  177. package/locales/camera/ja.json +20 -0
  178. package/locales/camera/ko.json +20 -0
  179. package/locales/camera/mr.json +20 -0
  180. package/locales/camera/ms.json +20 -0
  181. package/locales/camera/nl.json +20 -0
  182. package/locales/camera/pl.json +20 -0
  183. package/locales/camera/pt.json +20 -0
  184. package/locales/camera/ro.json +20 -0
  185. package/locales/camera/ru.json +20 -0
  186. package/locales/camera/sk.json +20 -0
  187. package/locales/camera/sv.json +20 -0
  188. package/locales/camera/sw.json +20 -0
  189. package/locales/camera/ta.json +20 -0
  190. package/locales/camera/te.json +20 -0
  191. package/locales/camera/th.json +20 -0
  192. package/locales/camera/tl.json +20 -0
  193. package/locales/camera/tr.json +20 -0
  194. package/locales/camera/uk.json +20 -0
  195. package/locales/camera/ur.json +20 -0
  196. package/locales/camera/vi.json +20 -0
  197. package/locales/camera/yo.json +20 -0
  198. package/locales/camera/zh-Hans.json +20 -0
  199. package/locales/camera/zh-Hant.json +20 -0
  200. package/locales/charts/am.json +2 -0
  201. package/locales/charts/ar.json +2 -0
  202. package/locales/charts/bg.json +2 -0
  203. package/locales/charts/bn.json +2 -0
  204. package/locales/charts/br.json +2 -0
  205. package/locales/charts/co.json +2 -0
  206. package/locales/charts/cs.json +2 -0
  207. package/locales/charts/da.json +2 -0
  208. package/locales/charts/de.json +2 -0
  209. package/locales/charts/el.json +2 -0
  210. package/locales/charts/en.json +2 -0
  211. package/locales/charts/es.json +2 -0
  212. package/locales/charts/fa.json +2 -0
  213. package/locales/charts/fi.json +2 -0
  214. package/locales/charts/fr-CA.json +2 -0
  215. package/locales/charts/fr.json +2 -0
  216. package/locales/charts/ha.json +2 -0
  217. package/locales/charts/he.json +2 -0
  218. package/locales/charts/hi.json +2 -0
  219. package/locales/charts/hr.json +2 -0
  220. package/locales/charts/hu.json +2 -0
  221. package/locales/charts/id.json +2 -0
  222. package/locales/charts/it.json +2 -0
  223. package/locales/charts/ja.json +2 -0
  224. package/locales/charts/ko.json +2 -0
  225. package/locales/charts/mr.json +2 -0
  226. package/locales/charts/ms.json +2 -0
  227. package/locales/charts/nl.json +2 -0
  228. package/locales/charts/pl.json +2 -0
  229. package/locales/charts/pt.json +2 -0
  230. package/locales/charts/ro.json +2 -0
  231. package/locales/charts/ru.json +2 -0
  232. package/locales/charts/sk.json +2 -0
  233. package/locales/charts/sv.json +2 -0
  234. package/locales/charts/sw.json +2 -0
  235. package/locales/charts/ta.json +2 -0
  236. package/locales/charts/te.json +2 -0
  237. package/locales/charts/th.json +2 -0
  238. package/locales/charts/tl.json +2 -0
  239. package/locales/charts/tr.json +2 -0
  240. package/locales/charts/uk.json +2 -0
  241. package/locales/charts/ur.json +2 -0
  242. package/locales/charts/vi.json +2 -0
  243. package/locales/charts/yo.json +2 -0
  244. package/locales/charts/zh-Hans.json +2 -0
  245. package/locales/charts/zh-Hant.json +2 -0
  246. package/locales/co.json +20 -3
  247. package/locales/creations/am.json +4 -0
  248. package/locales/creations/ar.json +4 -0
  249. package/locales/creations/bg.json +4 -0
  250. package/locales/creations/bn.json +4 -0
  251. package/locales/creations/br.json +4 -0
  252. package/locales/creations/co.json +4 -0
  253. package/locales/creations/cs.json +4 -0
  254. package/locales/creations/da.json +4 -0
  255. package/locales/creations/de.json +4 -0
  256. package/locales/creations/el.json +4 -0
  257. package/locales/creations/en.json +4 -0
  258. package/locales/creations/es.json +4 -0
  259. package/locales/creations/fa.json +4 -0
  260. package/locales/creations/fi.json +4 -0
  261. package/locales/creations/fr-CA.json +4 -0
  262. package/locales/creations/fr.json +4 -0
  263. package/locales/creations/ha.json +4 -0
  264. package/locales/creations/he.json +4 -0
  265. package/locales/creations/hi.json +4 -0
  266. package/locales/creations/hr.json +4 -0
  267. package/locales/creations/hu.json +4 -0
  268. package/locales/creations/id.json +4 -0
  269. package/locales/creations/it.json +4 -0
  270. package/locales/creations/ja.json +4 -0
  271. package/locales/creations/ko.json +4 -0
  272. package/locales/creations/mr.json +4 -0
  273. package/locales/creations/ms.json +4 -0
  274. package/locales/creations/nl.json +4 -0
  275. package/locales/creations/pl.json +4 -0
  276. package/locales/creations/pt.json +4 -0
  277. package/locales/creations/ro.json +4 -0
  278. package/locales/creations/ru.json +4 -0
  279. package/locales/creations/sk.json +4 -0
  280. package/locales/creations/sv.json +4 -0
  281. package/locales/creations/sw.json +4 -0
  282. package/locales/creations/ta.json +4 -0
  283. package/locales/creations/te.json +4 -0
  284. package/locales/creations/th.json +4 -0
  285. package/locales/creations/tl.json +4 -0
  286. package/locales/creations/tr.json +4 -0
  287. package/locales/creations/uk.json +4 -0
  288. package/locales/creations/ur.json +4 -0
  289. package/locales/creations/vi.json +4 -0
  290. package/locales/creations/yo.json +4 -0
  291. package/locales/creations/zh-Hans.json +4 -0
  292. package/locales/creations/zh-Hant.json +4 -0
  293. package/locales/cs.json +21 -3
  294. package/locales/da.json +19 -3
  295. package/locales/de.json +19 -3
  296. package/locales/designs/am.json +0 -14
  297. package/locales/designs/ar.json +0 -14
  298. package/locales/designs/bg.json +0 -14
  299. package/locales/designs/bn.json +0 -14
  300. package/locales/designs/br.json +0 -14
  301. package/locales/designs/co.json +0 -14
  302. package/locales/designs/cs.json +0 -14
  303. package/locales/designs/da.json +0 -14
  304. package/locales/designs/de.json +0 -14
  305. package/locales/designs/el.json +0 -14
  306. package/locales/designs/en.json +0 -14
  307. package/locales/designs/es.json +0 -14
  308. package/locales/designs/fa.json +0 -14
  309. package/locales/designs/fi.json +0 -14
  310. package/locales/designs/fr-CA.json +0 -14
  311. package/locales/designs/fr.json +0 -14
  312. package/locales/designs/ha.json +0 -14
  313. package/locales/designs/he.json +0 -14
  314. package/locales/designs/hi.json +0 -14
  315. package/locales/designs/hr.json +0 -14
  316. package/locales/designs/hu.json +0 -14
  317. package/locales/designs/id.json +0 -14
  318. package/locales/designs/it.json +0 -14
  319. package/locales/designs/ja.json +0 -14
  320. package/locales/designs/ko.json +0 -14
  321. package/locales/designs/mr.json +0 -14
  322. package/locales/designs/ms.json +0 -14
  323. package/locales/designs/nl.json +0 -14
  324. package/locales/designs/pl.json +0 -14
  325. package/locales/designs/pt.json +0 -14
  326. package/locales/designs/ro.json +0 -14
  327. package/locales/designs/ru.json +0 -14
  328. package/locales/designs/sk.json +0 -14
  329. package/locales/designs/sv.json +0 -14
  330. package/locales/designs/sw.json +0 -14
  331. package/locales/designs/ta.json +0 -14
  332. package/locales/designs/te.json +0 -14
  333. package/locales/designs/th.json +0 -14
  334. package/locales/designs/tl.json +0 -14
  335. package/locales/designs/tr.json +0 -14
  336. package/locales/designs/uk.json +0 -14
  337. package/locales/designs/ur.json +0 -14
  338. package/locales/designs/vi.json +0 -14
  339. package/locales/designs/yo.json +0 -14
  340. package/locales/designs/zh-Hans.json +0 -14
  341. package/locales/designs/zh-Hant.json +0 -14
  342. package/locales/dialogs/am.json +7 -0
  343. package/locales/dialogs/ar.json +7 -0
  344. package/locales/dialogs/bg.json +7 -0
  345. package/locales/dialogs/bn.json +7 -0
  346. package/locales/dialogs/br.json +7 -0
  347. package/locales/dialogs/co.json +7 -0
  348. package/locales/dialogs/cs.json +7 -0
  349. package/locales/dialogs/da.json +7 -0
  350. package/locales/dialogs/de.json +7 -0
  351. package/locales/dialogs/el.json +7 -0
  352. package/locales/dialogs/en.json +7 -0
  353. package/locales/dialogs/es.json +7 -0
  354. package/locales/dialogs/fa.json +7 -0
  355. package/locales/dialogs/fi.json +7 -0
  356. package/locales/dialogs/fr-CA.json +9 -2
  357. package/locales/dialogs/fr.json +9 -2
  358. package/locales/dialogs/ha.json +7 -0
  359. package/locales/dialogs/he.json +7 -0
  360. package/locales/dialogs/hi.json +7 -0
  361. package/locales/dialogs/hr.json +7 -0
  362. package/locales/dialogs/hu.json +7 -0
  363. package/locales/dialogs/id.json +7 -0
  364. package/locales/dialogs/it.json +7 -0
  365. package/locales/dialogs/ja.json +7 -0
  366. package/locales/dialogs/ko.json +7 -0
  367. package/locales/dialogs/mr.json +7 -0
  368. package/locales/dialogs/ms.json +7 -0
  369. package/locales/dialogs/nl.json +7 -0
  370. package/locales/dialogs/pl.json +7 -0
  371. package/locales/dialogs/pt.json +7 -0
  372. package/locales/dialogs/ro.json +7 -0
  373. package/locales/dialogs/ru.json +7 -0
  374. package/locales/dialogs/sk.json +7 -0
  375. package/locales/dialogs/sv.json +7 -0
  376. package/locales/dialogs/sw.json +7 -0
  377. package/locales/dialogs/ta.json +7 -0
  378. package/locales/dialogs/te.json +7 -0
  379. package/locales/dialogs/th.json +7 -0
  380. package/locales/dialogs/tl.json +7 -0
  381. package/locales/dialogs/tr.json +7 -0
  382. package/locales/dialogs/uk.json +7 -0
  383. package/locales/dialogs/ur.json +7 -0
  384. package/locales/dialogs/vi.json +7 -0
  385. package/locales/dialogs/yo.json +7 -0
  386. package/locales/dialogs/zh-Hans.json +7 -0
  387. package/locales/dialogs/zh-Hant.json +7 -0
  388. package/locales/documents/am.json +6 -0
  389. package/locales/documents/ar.json +6 -0
  390. package/locales/documents/bg.json +6 -0
  391. package/locales/documents/bn.json +6 -0
  392. package/locales/documents/br.json +6 -0
  393. package/locales/documents/co.json +6 -0
  394. package/locales/documents/cs.json +6 -0
  395. package/locales/documents/da.json +6 -0
  396. package/locales/documents/de.json +6 -0
  397. package/locales/documents/el.json +6 -0
  398. package/locales/documents/en.json +6 -0
  399. package/locales/documents/es.json +6 -0
  400. package/locales/documents/fa.json +6 -0
  401. package/locales/documents/fi.json +6 -0
  402. package/locales/documents/fr-CA.json +6 -0
  403. package/locales/documents/fr.json +6 -0
  404. package/locales/documents/ha.json +6 -0
  405. package/locales/documents/he.json +6 -0
  406. package/locales/documents/hi.json +6 -0
  407. package/locales/documents/hr.json +6 -0
  408. package/locales/documents/hu.json +6 -0
  409. package/locales/documents/id.json +6 -0
  410. package/locales/documents/it.json +6 -0
  411. package/locales/documents/ja.json +6 -0
  412. package/locales/documents/ko.json +6 -0
  413. package/locales/documents/mr.json +6 -0
  414. package/locales/documents/ms.json +6 -0
  415. package/locales/documents/nl.json +6 -0
  416. package/locales/documents/pl.json +6 -0
  417. package/locales/documents/pt.json +6 -0
  418. package/locales/documents/ro.json +6 -0
  419. package/locales/documents/ru.json +6 -0
  420. package/locales/documents/sk.json +6 -0
  421. package/locales/documents/sv.json +6 -0
  422. package/locales/documents/sw.json +6 -0
  423. package/locales/documents/ta.json +6 -0
  424. package/locales/documents/te.json +6 -0
  425. package/locales/documents/th.json +6 -0
  426. package/locales/documents/tl.json +6 -0
  427. package/locales/documents/tr.json +6 -0
  428. package/locales/documents/uk.json +6 -0
  429. package/locales/documents/ur.json +6 -0
  430. package/locales/documents/vi.json +6 -0
  431. package/locales/documents/yo.json +6 -0
  432. package/locales/documents/zh-Hans.json +6 -0
  433. package/locales/documents/zh-Hant.json +6 -0
  434. package/locales/el.json +19 -3
  435. package/locales/en.json +19 -3
  436. package/locales/enterprise/am.json +29 -1
  437. package/locales/enterprise/ar.json +29 -1
  438. package/locales/enterprise/bg.json +29 -1
  439. package/locales/enterprise/bn.json +29 -1
  440. package/locales/enterprise/br.json +29 -1
  441. package/locales/enterprise/co.json +29 -1
  442. package/locales/enterprise/cs.json +29 -1
  443. package/locales/enterprise/da.json +29 -1
  444. package/locales/enterprise/de.json +29 -1
  445. package/locales/enterprise/el.json +29 -1
  446. package/locales/enterprise/en.json +29 -1
  447. package/locales/enterprise/es.json +29 -1
  448. package/locales/enterprise/fa.json +29 -1
  449. package/locales/enterprise/fi.json +29 -1
  450. package/locales/enterprise/fr-CA.json +29 -1
  451. package/locales/enterprise/fr.json +29 -1
  452. package/locales/enterprise/ha.json +29 -1
  453. package/locales/enterprise/he.json +29 -1
  454. package/locales/enterprise/hi.json +29 -1
  455. package/locales/enterprise/hr.json +29 -1
  456. package/locales/enterprise/hu.json +29 -1
  457. package/locales/enterprise/id.json +29 -1
  458. package/locales/enterprise/it.json +29 -1
  459. package/locales/enterprise/ja.json +29 -1
  460. package/locales/enterprise/ko.json +29 -1
  461. package/locales/enterprise/mr.json +29 -1
  462. package/locales/enterprise/ms.json +29 -1
  463. package/locales/enterprise/nl.json +29 -1
  464. package/locales/enterprise/pl.json +29 -1
  465. package/locales/enterprise/pt.json +29 -1
  466. package/locales/enterprise/ro.json +29 -1
  467. package/locales/enterprise/ru.json +29 -1
  468. package/locales/enterprise/sk.json +29 -1
  469. package/locales/enterprise/sv.json +29 -1
  470. package/locales/enterprise/sw.json +29 -1
  471. package/locales/enterprise/ta.json +29 -1
  472. package/locales/enterprise/te.json +29 -1
  473. package/locales/enterprise/th.json +29 -1
  474. package/locales/enterprise/tl.json +29 -1
  475. package/locales/enterprise/tr.json +29 -1
  476. package/locales/enterprise/uk.json +29 -1
  477. package/locales/enterprise/ur.json +29 -1
  478. package/locales/enterprise/vi.json +29 -1
  479. package/locales/enterprise/yo.json +29 -1
  480. package/locales/enterprise/zh-Hans.json +29 -1
  481. package/locales/enterprise/zh-Hant.json +29 -1
  482. package/locales/es.json +20 -3
  483. package/locales/fa.json +19 -3
  484. package/locales/fi.json +19 -3
  485. package/locales/fr-CA.json +21 -4
  486. package/locales/fr.json +21 -4
  487. package/locales/games/am.json +16 -0
  488. package/locales/games/ar.json +16 -0
  489. package/locales/games/bg.json +16 -0
  490. package/locales/games/bn.json +16 -0
  491. package/locales/games/br.json +16 -0
  492. package/locales/games/co.json +16 -0
  493. package/locales/games/cs.json +16 -0
  494. package/locales/games/da.json +16 -0
  495. package/locales/games/de.json +16 -0
  496. package/locales/games/el.json +16 -0
  497. package/locales/games/en.json +16 -0
  498. package/locales/games/es.json +16 -0
  499. package/locales/games/fa.json +16 -0
  500. package/locales/games/fi.json +16 -0
  501. package/locales/games/fr-CA.json +16 -0
  502. package/locales/games/fr.json +16 -0
  503. package/locales/games/ha.json +16 -0
  504. package/locales/games/he.json +16 -0
  505. package/locales/games/hi.json +16 -0
  506. package/locales/games/hr.json +16 -0
  507. package/locales/games/hu.json +16 -0
  508. package/locales/games/id.json +16 -0
  509. package/locales/games/it.json +16 -0
  510. package/locales/games/ja.json +16 -0
  511. package/locales/games/ko.json +16 -0
  512. package/locales/games/mr.json +16 -0
  513. package/locales/games/ms.json +16 -0
  514. package/locales/games/nl.json +16 -0
  515. package/locales/games/pl.json +16 -0
  516. package/locales/games/pt.json +16 -0
  517. package/locales/games/ro.json +16 -0
  518. package/locales/games/ru.json +16 -0
  519. package/locales/games/sk.json +16 -0
  520. package/locales/games/sv.json +16 -0
  521. package/locales/games/sw.json +16 -0
  522. package/locales/games/ta.json +16 -0
  523. package/locales/games/te.json +16 -0
  524. package/locales/games/th.json +16 -0
  525. package/locales/games/tl.json +16 -0
  526. package/locales/games/tr.json +16 -0
  527. package/locales/games/uk.json +16 -0
  528. package/locales/games/ur.json +16 -0
  529. package/locales/games/vi.json +16 -0
  530. package/locales/games/yo.json +16 -0
  531. package/locales/games/zh-Hans.json +16 -0
  532. package/locales/games/zh-Hant.json +16 -0
  533. package/locales/ha.json +19 -3
  534. package/locales/he.json +20 -3
  535. package/locales/hi.json +19 -3
  536. package/locales/hr.json +20 -3
  537. package/locales/hu.json +19 -3
  538. package/locales/id.json +18 -3
  539. package/locales/interactive/am.json +11 -2
  540. package/locales/interactive/ar.json +11 -2
  541. package/locales/interactive/bg.json +11 -2
  542. package/locales/interactive/bn.json +11 -2
  543. package/locales/interactive/br.json +11 -2
  544. package/locales/interactive/co.json +11 -2
  545. package/locales/interactive/cs.json +11 -2
  546. package/locales/interactive/da.json +11 -2
  547. package/locales/interactive/de.json +11 -2
  548. package/locales/interactive/el.json +11 -2
  549. package/locales/interactive/en.json +11 -2
  550. package/locales/interactive/es.json +11 -2
  551. package/locales/interactive/fa.json +11 -2
  552. package/locales/interactive/fi.json +11 -2
  553. package/locales/interactive/fr-CA.json +11 -2
  554. package/locales/interactive/fr.json +11 -2
  555. package/locales/interactive/ha.json +11 -2
  556. package/locales/interactive/he.json +11 -2
  557. package/locales/interactive/hi.json +11 -2
  558. package/locales/interactive/hr.json +11 -2
  559. package/locales/interactive/hu.json +11 -2
  560. package/locales/interactive/id.json +11 -2
  561. package/locales/interactive/it.json +11 -2
  562. package/locales/interactive/ja.json +11 -2
  563. package/locales/interactive/ko.json +11 -2
  564. package/locales/interactive/mr.json +11 -2
  565. package/locales/interactive/ms.json +11 -2
  566. package/locales/interactive/nl.json +11 -2
  567. package/locales/interactive/pl.json +11 -2
  568. package/locales/interactive/pt.json +11 -2
  569. package/locales/interactive/ro.json +11 -2
  570. package/locales/interactive/ru.json +11 -2
  571. package/locales/interactive/sk.json +11 -2
  572. package/locales/interactive/sv.json +11 -2
  573. package/locales/interactive/sw.json +11 -2
  574. package/locales/interactive/ta.json +11 -2
  575. package/locales/interactive/te.json +11 -2
  576. package/locales/interactive/th.json +11 -2
  577. package/locales/interactive/tl.json +11 -2
  578. package/locales/interactive/tr.json +11 -2
  579. package/locales/interactive/uk.json +11 -2
  580. package/locales/interactive/ur.json +11 -2
  581. package/locales/interactive/vi.json +11 -2
  582. package/locales/interactive/yo.json +11 -2
  583. package/locales/interactive/zh-Hans.json +11 -2
  584. package/locales/interactive/zh-Hant.json +11 -2
  585. package/locales/it.json +20 -3
  586. package/locales/ja.json +18 -3
  587. package/locales/ko.json +18 -3
  588. package/locales/lock/am.json +6 -3
  589. package/locales/lock/ar.json +6 -3
  590. package/locales/lock/bg.json +6 -3
  591. package/locales/lock/bn.json +6 -3
  592. package/locales/lock/br.json +6 -3
  593. package/locales/lock/co.json +6 -3
  594. package/locales/lock/cs.json +6 -3
  595. package/locales/lock/da.json +6 -3
  596. package/locales/lock/de.json +6 -3
  597. package/locales/lock/el.json +6 -3
  598. package/locales/lock/en.json +6 -3
  599. package/locales/lock/es.json +6 -3
  600. package/locales/lock/fa.json +6 -3
  601. package/locales/lock/fi.json +6 -3
  602. package/locales/lock/fr-CA.json +6 -3
  603. package/locales/lock/fr.json +6 -3
  604. package/locales/lock/ha.json +6 -3
  605. package/locales/lock/he.json +6 -3
  606. package/locales/lock/hi.json +6 -3
  607. package/locales/lock/hr.json +6 -3
  608. package/locales/lock/hu.json +6 -3
  609. package/locales/lock/id.json +6 -3
  610. package/locales/lock/it.json +6 -3
  611. package/locales/lock/ja.json +6 -3
  612. package/locales/lock/ko.json +6 -3
  613. package/locales/lock/mr.json +6 -3
  614. package/locales/lock/ms.json +6 -3
  615. package/locales/lock/nl.json +6 -3
  616. package/locales/lock/pl.json +6 -3
  617. package/locales/lock/pt.json +6 -3
  618. package/locales/lock/ro.json +6 -3
  619. package/locales/lock/ru.json +6 -3
  620. package/locales/lock/sk.json +6 -3
  621. package/locales/lock/sv.json +6 -3
  622. package/locales/lock/sw.json +6 -3
  623. package/locales/lock/ta.json +6 -3
  624. package/locales/lock/te.json +6 -3
  625. package/locales/lock/th.json +6 -3
  626. package/locales/lock/tl.json +6 -3
  627. package/locales/lock/tr.json +6 -3
  628. package/locales/lock/uk.json +6 -3
  629. package/locales/lock/ur.json +6 -3
  630. package/locales/lock/vi.json +6 -3
  631. package/locales/lock/yo.json +6 -3
  632. package/locales/lock/zh-Hans.json +6 -3
  633. package/locales/lock/zh-Hant.json +6 -3
  634. package/locales/look/am.json +5 -0
  635. package/locales/look/ar.json +5 -0
  636. package/locales/look/bg.json +5 -0
  637. package/locales/look/bn.json +5 -0
  638. package/locales/look/br.json +5 -0
  639. package/locales/look/co.json +5 -0
  640. package/locales/look/cs.json +5 -0
  641. package/locales/look/da.json +5 -0
  642. package/locales/look/de.json +5 -0
  643. package/locales/look/el.json +5 -0
  644. package/locales/look/en.json +5 -0
  645. package/locales/look/es.json +5 -0
  646. package/locales/look/fa.json +5 -0
  647. package/locales/look/fi.json +5 -0
  648. package/locales/look/fr-CA.json +5 -0
  649. package/locales/look/fr.json +5 -0
  650. package/locales/look/ha.json +5 -0
  651. package/locales/look/he.json +5 -0
  652. package/locales/look/hi.json +5 -0
  653. package/locales/look/hr.json +5 -0
  654. package/locales/look/hu.json +5 -0
  655. package/locales/look/id.json +5 -0
  656. package/locales/look/it.json +5 -0
  657. package/locales/look/ja.json +5 -0
  658. package/locales/look/ko.json +5 -0
  659. package/locales/look/mr.json +5 -0
  660. package/locales/look/ms.json +5 -0
  661. package/locales/look/nl.json +5 -0
  662. package/locales/look/pl.json +5 -0
  663. package/locales/look/pt.json +5 -0
  664. package/locales/look/ro.json +5 -0
  665. package/locales/look/ru.json +5 -0
  666. package/locales/look/sk.json +5 -0
  667. package/locales/look/sv.json +5 -0
  668. package/locales/look/sw.json +5 -0
  669. package/locales/look/ta.json +5 -0
  670. package/locales/look/te.json +5 -0
  671. package/locales/look/th.json +5 -0
  672. package/locales/look/tl.json +5 -0
  673. package/locales/look/tr.json +5 -0
  674. package/locales/look/uk.json +5 -0
  675. package/locales/look/ur.json +5 -0
  676. package/locales/look/vi.json +5 -0
  677. package/locales/look/yo.json +5 -0
  678. package/locales/look/zh-Hans.json +5 -0
  679. package/locales/look/zh-Hant.json +5 -0
  680. package/locales/made/am.json +6 -1
  681. package/locales/made/ar.json +6 -1
  682. package/locales/made/bg.json +6 -1
  683. package/locales/made/bn.json +6 -1
  684. package/locales/made/br.json +6 -1
  685. package/locales/made/co.json +6 -1
  686. package/locales/made/cs.json +6 -1
  687. package/locales/made/da.json +6 -1
  688. package/locales/made/de.json +6 -1
  689. package/locales/made/el.json +6 -1
  690. package/locales/made/en.json +6 -1
  691. package/locales/made/es.json +6 -1
  692. package/locales/made/fa.json +6 -1
  693. package/locales/made/fi.json +6 -1
  694. package/locales/made/fr-CA.json +6 -1
  695. package/locales/made/fr.json +6 -1
  696. package/locales/made/ha.json +6 -1
  697. package/locales/made/he.json +6 -1
  698. package/locales/made/hi.json +6 -1
  699. package/locales/made/hr.json +6 -1
  700. package/locales/made/hu.json +6 -1
  701. package/locales/made/id.json +6 -1
  702. package/locales/made/it.json +6 -1
  703. package/locales/made/ja.json +6 -1
  704. package/locales/made/ko.json +6 -1
  705. package/locales/made/mr.json +6 -1
  706. package/locales/made/ms.json +6 -1
  707. package/locales/made/nl.json +6 -1
  708. package/locales/made/pl.json +6 -1
  709. package/locales/made/pt.json +6 -1
  710. package/locales/made/ro.json +6 -1
  711. package/locales/made/ru.json +6 -1
  712. package/locales/made/sk.json +6 -1
  713. package/locales/made/sv.json +6 -1
  714. package/locales/made/sw.json +6 -1
  715. package/locales/made/ta.json +6 -1
  716. package/locales/made/te.json +6 -1
  717. package/locales/made/th.json +6 -1
  718. package/locales/made/tl.json +6 -1
  719. package/locales/made/tr.json +6 -1
  720. package/locales/made/uk.json +6 -1
  721. package/locales/made/ur.json +6 -1
  722. package/locales/made/vi.json +6 -1
  723. package/locales/made/yo.json +6 -1
  724. package/locales/made/zh-Hans.json +6 -1
  725. package/locales/made/zh-Hant.json +6 -1
  726. package/locales/mr.json +19 -3
  727. package/locales/ms.json +18 -3
  728. package/locales/nl.json +19 -3
  729. package/locales/out/am.json +13 -0
  730. package/locales/out/ar.json +13 -0
  731. package/locales/out/bg.json +13 -0
  732. package/locales/out/bn.json +13 -0
  733. package/locales/out/br.json +13 -0
  734. package/locales/out/co.json +13 -0
  735. package/locales/out/cs.json +13 -0
  736. package/locales/out/da.json +13 -0
  737. package/locales/out/de.json +13 -0
  738. package/locales/out/el.json +13 -0
  739. package/locales/out/en.json +13 -0
  740. package/locales/out/es.json +13 -0
  741. package/locales/out/fa.json +13 -0
  742. package/locales/out/fi.json +13 -0
  743. package/locales/out/fr-CA.json +13 -0
  744. package/locales/out/fr.json +13 -0
  745. package/locales/out/ha.json +13 -0
  746. package/locales/out/he.json +13 -0
  747. package/locales/out/hi.json +13 -0
  748. package/locales/out/hr.json +13 -0
  749. package/locales/out/hu.json +13 -0
  750. package/locales/out/id.json +13 -0
  751. package/locales/out/it.json +13 -0
  752. package/locales/out/ja.json +13 -0
  753. package/locales/out/ko.json +13 -0
  754. package/locales/out/mr.json +13 -0
  755. package/locales/out/ms.json +13 -0
  756. package/locales/out/nl.json +13 -0
  757. package/locales/out/pl.json +13 -0
  758. package/locales/out/pt.json +13 -0
  759. package/locales/out/ro.json +13 -0
  760. package/locales/out/ru.json +13 -0
  761. package/locales/out/sk.json +13 -0
  762. package/locales/out/sv.json +13 -0
  763. package/locales/out/sw.json +13 -0
  764. package/locales/out/ta.json +13 -0
  765. package/locales/out/te.json +13 -0
  766. package/locales/out/th.json +13 -0
  767. package/locales/out/tl.json +13 -0
  768. package/locales/out/tr.json +13 -0
  769. package/locales/out/uk.json +13 -0
  770. package/locales/out/ur.json +13 -0
  771. package/locales/out/vi.json +13 -0
  772. package/locales/out/yo.json +13 -0
  773. package/locales/out/zh-Hans.json +13 -0
  774. package/locales/out/zh-Hant.json +13 -0
  775. package/locales/pl.json +21 -3
  776. package/locales/profiles/am.json +5 -0
  777. package/locales/profiles/ar.json +5 -0
  778. package/locales/profiles/bg.json +5 -0
  779. package/locales/profiles/bn.json +5 -0
  780. package/locales/profiles/br.json +5 -0
  781. package/locales/profiles/co.json +5 -0
  782. package/locales/profiles/cs.json +5 -0
  783. package/locales/profiles/da.json +5 -0
  784. package/locales/profiles/de.json +5 -0
  785. package/locales/profiles/el.json +5 -0
  786. package/locales/profiles/en.json +5 -0
  787. package/locales/profiles/es.json +5 -0
  788. package/locales/profiles/fa.json +5 -0
  789. package/locales/profiles/fi.json +5 -0
  790. package/locales/profiles/fr-CA.json +5 -0
  791. package/locales/profiles/fr.json +5 -0
  792. package/locales/profiles/ha.json +5 -0
  793. package/locales/profiles/he.json +5 -0
  794. package/locales/profiles/hi.json +5 -0
  795. package/locales/profiles/hr.json +5 -0
  796. package/locales/profiles/hu.json +5 -0
  797. package/locales/profiles/id.json +5 -0
  798. package/locales/profiles/it.json +5 -0
  799. package/locales/profiles/ja.json +5 -0
  800. package/locales/profiles/ko.json +5 -0
  801. package/locales/profiles/mr.json +5 -0
  802. package/locales/profiles/ms.json +5 -0
  803. package/locales/profiles/nl.json +5 -0
  804. package/locales/profiles/pl.json +5 -0
  805. package/locales/profiles/pt.json +5 -0
  806. package/locales/profiles/ro.json +5 -0
  807. package/locales/profiles/ru.json +5 -0
  808. package/locales/profiles/sk.json +5 -0
  809. package/locales/profiles/sv.json +5 -0
  810. package/locales/profiles/sw.json +5 -0
  811. package/locales/profiles/ta.json +5 -0
  812. package/locales/profiles/te.json +5 -0
  813. package/locales/profiles/th.json +5 -0
  814. package/locales/profiles/tl.json +5 -0
  815. package/locales/profiles/tr.json +5 -0
  816. package/locales/profiles/uk.json +5 -0
  817. package/locales/profiles/ur.json +5 -0
  818. package/locales/profiles/vi.json +5 -0
  819. package/locales/profiles/yo.json +5 -0
  820. package/locales/profiles/zh-Hans.json +5 -0
  821. package/locales/profiles/zh-Hant.json +5 -0
  822. package/locales/pt.json +20 -3
  823. package/locales/ro.json +20 -3
  824. package/locales/routines/am.json +9 -0
  825. package/locales/routines/ar.json +9 -0
  826. package/locales/routines/bg.json +9 -0
  827. package/locales/routines/bn.json +9 -0
  828. package/locales/routines/br.json +9 -0
  829. package/locales/routines/co.json +9 -0
  830. package/locales/routines/cs.json +9 -0
  831. package/locales/routines/da.json +9 -0
  832. package/locales/routines/de.json +9 -0
  833. package/locales/routines/el.json +9 -0
  834. package/locales/routines/en.json +9 -0
  835. package/locales/routines/es.json +9 -0
  836. package/locales/routines/fa.json +9 -0
  837. package/locales/routines/fi.json +9 -0
  838. package/locales/routines/fr-CA.json +9 -0
  839. package/locales/routines/fr.json +9 -0
  840. package/locales/routines/ha.json +9 -0
  841. package/locales/routines/he.json +9 -0
  842. package/locales/routines/hi.json +9 -0
  843. package/locales/routines/hr.json +9 -0
  844. package/locales/routines/hu.json +9 -0
  845. package/locales/routines/id.json +9 -0
  846. package/locales/routines/it.json +9 -0
  847. package/locales/routines/ja.json +9 -0
  848. package/locales/routines/ko.json +9 -0
  849. package/locales/routines/mr.json +9 -0
  850. package/locales/routines/ms.json +9 -0
  851. package/locales/routines/nl.json +9 -0
  852. package/locales/routines/pl.json +9 -0
  853. package/locales/routines/pt.json +9 -0
  854. package/locales/routines/ro.json +9 -0
  855. package/locales/routines/ru.json +9 -0
  856. package/locales/routines/sk.json +9 -0
  857. package/locales/routines/sv.json +9 -0
  858. package/locales/routines/sw.json +9 -0
  859. package/locales/routines/ta.json +9 -0
  860. package/locales/routines/te.json +9 -0
  861. package/locales/routines/th.json +9 -0
  862. package/locales/routines/tl.json +9 -0
  863. package/locales/routines/tr.json +9 -0
  864. package/locales/routines/uk.json +9 -0
  865. package/locales/routines/ur.json +9 -0
  866. package/locales/routines/vi.json +9 -0
  867. package/locales/routines/yo.json +9 -0
  868. package/locales/routines/zh-Hans.json +9 -0
  869. package/locales/routines/zh-Hant.json +9 -0
  870. package/locales/ru.json +21 -3
  871. package/locales/scores/am.json +5 -1
  872. package/locales/scores/ar.json +5 -1
  873. package/locales/scores/bg.json +5 -1
  874. package/locales/scores/bn.json +5 -1
  875. package/locales/scores/br.json +5 -1
  876. package/locales/scores/co.json +5 -1
  877. package/locales/scores/cs.json +5 -1
  878. package/locales/scores/da.json +5 -1
  879. package/locales/scores/de.json +5 -1
  880. package/locales/scores/el.json +5 -1
  881. package/locales/scores/en.json +5 -1
  882. package/locales/scores/es.json +5 -1
  883. package/locales/scores/fa.json +5 -1
  884. package/locales/scores/fi.json +5 -1
  885. package/locales/scores/fr-CA.json +5 -1
  886. package/locales/scores/fr.json +5 -1
  887. package/locales/scores/ha.json +5 -1
  888. package/locales/scores/he.json +5 -1
  889. package/locales/scores/hi.json +5 -1
  890. package/locales/scores/hr.json +5 -1
  891. package/locales/scores/hu.json +5 -1
  892. package/locales/scores/id.json +5 -1
  893. package/locales/scores/it.json +5 -1
  894. package/locales/scores/ja.json +5 -1
  895. package/locales/scores/ko.json +5 -1
  896. package/locales/scores/mr.json +5 -1
  897. package/locales/scores/ms.json +5 -1
  898. package/locales/scores/nl.json +5 -1
  899. package/locales/scores/pl.json +5 -1
  900. package/locales/scores/pt.json +5 -1
  901. package/locales/scores/ro.json +5 -1
  902. package/locales/scores/ru.json +5 -1
  903. package/locales/scores/sk.json +5 -1
  904. package/locales/scores/sv.json +5 -1
  905. package/locales/scores/sw.json +5 -1
  906. package/locales/scores/ta.json +5 -1
  907. package/locales/scores/te.json +5 -1
  908. package/locales/scores/th.json +5 -1
  909. package/locales/scores/tl.json +5 -1
  910. package/locales/scores/tr.json +5 -1
  911. package/locales/scores/uk.json +5 -1
  912. package/locales/scores/ur.json +5 -1
  913. package/locales/scores/vi.json +5 -1
  914. package/locales/scores/yo.json +5 -1
  915. package/locales/scores/zh-Hans.json +5 -1
  916. package/locales/scores/zh-Hant.json +5 -1
  917. package/locales/search/am.json +10 -1
  918. package/locales/search/ar.json +10 -1
  919. package/locales/search/bg.json +10 -1
  920. package/locales/search/bn.json +10 -1
  921. package/locales/search/br.json +10 -1
  922. package/locales/search/co.json +10 -1
  923. package/locales/search/cs.json +10 -1
  924. package/locales/search/da.json +10 -1
  925. package/locales/search/de.json +10 -1
  926. package/locales/search/el.json +10 -1
  927. package/locales/search/en.json +10 -1
  928. package/locales/search/es.json +10 -1
  929. package/locales/search/fa.json +10 -1
  930. package/locales/search/fi.json +10 -1
  931. package/locales/search/fr-CA.json +10 -1
  932. package/locales/search/fr.json +10 -1
  933. package/locales/search/ha.json +10 -1
  934. package/locales/search/he.json +10 -1
  935. package/locales/search/hi.json +10 -1
  936. package/locales/search/hr.json +10 -1
  937. package/locales/search/hu.json +10 -1
  938. package/locales/search/id.json +10 -1
  939. package/locales/search/it.json +10 -1
  940. package/locales/search/ja.json +10 -1
  941. package/locales/search/ko.json +10 -1
  942. package/locales/search/mr.json +10 -1
  943. package/locales/search/ms.json +10 -1
  944. package/locales/search/nl.json +10 -1
  945. package/locales/search/pl.json +10 -1
  946. package/locales/search/pt.json +10 -1
  947. package/locales/search/ro.json +10 -1
  948. package/locales/search/ru.json +10 -1
  949. package/locales/search/sk.json +10 -1
  950. package/locales/search/sv.json +10 -1
  951. package/locales/search/sw.json +10 -1
  952. package/locales/search/ta.json +10 -1
  953. package/locales/search/te.json +10 -1
  954. package/locales/search/th.json +10 -1
  955. package/locales/search/tl.json +10 -1
  956. package/locales/search/tr.json +10 -1
  957. package/locales/search/uk.json +10 -1
  958. package/locales/search/ur.json +10 -1
  959. package/locales/search/vi.json +10 -1
  960. package/locales/search/yo.json +10 -1
  961. package/locales/search/zh-Hans.json +10 -1
  962. package/locales/search/zh-Hant.json +10 -1
  963. package/locales/signin/am.json +3 -1
  964. package/locales/signin/ar.json +3 -1
  965. package/locales/signin/bg.json +3 -1
  966. package/locales/signin/bn.json +3 -1
  967. package/locales/signin/br.json +3 -1
  968. package/locales/signin/co.json +3 -1
  969. package/locales/signin/cs.json +3 -1
  970. package/locales/signin/da.json +3 -1
  971. package/locales/signin/de.json +3 -1
  972. package/locales/signin/el.json +3 -1
  973. package/locales/signin/en.json +3 -1
  974. package/locales/signin/es.json +3 -1
  975. package/locales/signin/fa.json +3 -1
  976. package/locales/signin/fi.json +3 -1
  977. package/locales/signin/fr-CA.json +3 -1
  978. package/locales/signin/fr.json +3 -1
  979. package/locales/signin/ha.json +3 -1
  980. package/locales/signin/he.json +3 -1
  981. package/locales/signin/hi.json +3 -1
  982. package/locales/signin/hr.json +3 -1
  983. package/locales/signin/hu.json +3 -1
  984. package/locales/signin/id.json +3 -1
  985. package/locales/signin/it.json +3 -1
  986. package/locales/signin/ja.json +3 -1
  987. package/locales/signin/ko.json +3 -1
  988. package/locales/signin/mr.json +3 -1
  989. package/locales/signin/ms.json +3 -1
  990. package/locales/signin/nl.json +3 -1
  991. package/locales/signin/pl.json +3 -1
  992. package/locales/signin/pt.json +3 -1
  993. package/locales/signin/ro.json +3 -1
  994. package/locales/signin/ru.json +3 -1
  995. package/locales/signin/sk.json +3 -1
  996. package/locales/signin/sv.json +3 -1
  997. package/locales/signin/sw.json +3 -1
  998. package/locales/signin/ta.json +3 -1
  999. package/locales/signin/te.json +3 -1
  1000. package/locales/signin/th.json +3 -1
  1001. package/locales/signin/tl.json +3 -1
  1002. package/locales/signin/tr.json +3 -1
  1003. package/locales/signin/uk.json +3 -1
  1004. package/locales/signin/ur.json +3 -1
  1005. package/locales/signin/vi.json +3 -1
  1006. package/locales/signin/yo.json +3 -1
  1007. package/locales/signin/zh-Hans.json +3 -1
  1008. package/locales/signin/zh-Hant.json +3 -1
  1009. package/locales/sk.json +21 -3
  1010. package/locales/slides/am.json +16 -11
  1011. package/locales/slides/ar.json +16 -11
  1012. package/locales/slides/bg.json +16 -11
  1013. package/locales/slides/bn.json +16 -11
  1014. package/locales/slides/br.json +16 -11
  1015. package/locales/slides/co.json +16 -11
  1016. package/locales/slides/cs.json +16 -11
  1017. package/locales/slides/da.json +16 -11
  1018. package/locales/slides/de.json +16 -11
  1019. package/locales/slides/el.json +16 -11
  1020. package/locales/slides/en.json +16 -11
  1021. package/locales/slides/es.json +16 -11
  1022. package/locales/slides/fa.json +16 -11
  1023. package/locales/slides/fi.json +16 -11
  1024. package/locales/slides/fr-CA.json +16 -11
  1025. package/locales/slides/fr.json +16 -11
  1026. package/locales/slides/ha.json +16 -11
  1027. package/locales/slides/he.json +16 -11
  1028. package/locales/slides/hi.json +16 -11
  1029. package/locales/slides/hr.json +16 -11
  1030. package/locales/slides/hu.json +16 -11
  1031. package/locales/slides/id.json +16 -11
  1032. package/locales/slides/it.json +16 -11
  1033. package/locales/slides/ja.json +16 -11
  1034. package/locales/slides/ko.json +16 -11
  1035. package/locales/slides/mr.json +16 -11
  1036. package/locales/slides/ms.json +16 -11
  1037. package/locales/slides/nl.json +16 -11
  1038. package/locales/slides/pl.json +16 -11
  1039. package/locales/slides/pt.json +16 -11
  1040. package/locales/slides/ro.json +16 -11
  1041. package/locales/slides/ru.json +16 -11
  1042. package/locales/slides/sk.json +16 -11
  1043. package/locales/slides/sv.json +16 -11
  1044. package/locales/slides/sw.json +16 -11
  1045. package/locales/slides/ta.json +16 -11
  1046. package/locales/slides/te.json +16 -11
  1047. package/locales/slides/th.json +16 -11
  1048. package/locales/slides/tl.json +16 -11
  1049. package/locales/slides/tr.json +16 -11
  1050. package/locales/slides/uk.json +16 -11
  1051. package/locales/slides/ur.json +16 -11
  1052. package/locales/slides/vi.json +16 -11
  1053. package/locales/slides/yo.json +16 -11
  1054. package/locales/slides/zh-Hans.json +16 -11
  1055. package/locales/slides/zh-Hant.json +16 -11
  1056. package/locales/sv.json +19 -3
  1057. package/locales/sw.json +19 -3
  1058. package/locales/sync/am.json +1 -0
  1059. package/locales/sync/ar.json +1 -0
  1060. package/locales/sync/bg.json +1 -0
  1061. package/locales/sync/bn.json +1 -0
  1062. package/locales/sync/br.json +1 -0
  1063. package/locales/sync/co.json +1 -0
  1064. package/locales/sync/cs.json +1 -0
  1065. package/locales/sync/da.json +1 -0
  1066. package/locales/sync/de.json +1 -0
  1067. package/locales/sync/el.json +1 -0
  1068. package/locales/sync/en.json +1 -0
  1069. package/locales/sync/es.json +1 -0
  1070. package/locales/sync/fa.json +1 -0
  1071. package/locales/sync/fi.json +1 -0
  1072. package/locales/sync/fr-CA.json +1 -0
  1073. package/locales/sync/fr.json +1 -0
  1074. package/locales/sync/ha.json +1 -0
  1075. package/locales/sync/he.json +1 -0
  1076. package/locales/sync/hi.json +1 -0
  1077. package/locales/sync/hr.json +1 -0
  1078. package/locales/sync/hu.json +1 -0
  1079. package/locales/sync/id.json +1 -0
  1080. package/locales/sync/it.json +1 -0
  1081. package/locales/sync/ja.json +1 -0
  1082. package/locales/sync/ko.json +1 -0
  1083. package/locales/sync/mr.json +1 -0
  1084. package/locales/sync/ms.json +1 -0
  1085. package/locales/sync/nl.json +1 -0
  1086. package/locales/sync/pl.json +1 -0
  1087. package/locales/sync/pt.json +1 -0
  1088. package/locales/sync/ro.json +1 -0
  1089. package/locales/sync/ru.json +1 -0
  1090. package/locales/sync/sk.json +1 -0
  1091. package/locales/sync/sv.json +1 -0
  1092. package/locales/sync/sw.json +1 -0
  1093. package/locales/sync/ta.json +1 -0
  1094. package/locales/sync/te.json +1 -0
  1095. package/locales/sync/th.json +1 -0
  1096. package/locales/sync/tl.json +1 -0
  1097. package/locales/sync/tr.json +1 -0
  1098. package/locales/sync/uk.json +1 -0
  1099. package/locales/sync/ur.json +1 -0
  1100. package/locales/sync/vi.json +1 -0
  1101. package/locales/sync/yo.json +1 -0
  1102. package/locales/sync/zh-Hans.json +1 -0
  1103. package/locales/sync/zh-Hant.json +1 -0
  1104. package/locales/ta.json +19 -3
  1105. package/locales/tables/am.json +27 -2
  1106. package/locales/tables/ar.json +35 -2
  1107. package/locales/tables/bg.json +27 -2
  1108. package/locales/tables/bn.json +27 -2
  1109. package/locales/tables/br.json +33 -2
  1110. package/locales/tables/co.json +29 -2
  1111. package/locales/tables/cs.json +33 -4
  1112. package/locales/tables/da.json +27 -2
  1113. package/locales/tables/de.json +27 -2
  1114. package/locales/tables/el.json +27 -2
  1115. package/locales/tables/en.json +27 -2
  1116. package/locales/tables/es.json +29 -2
  1117. package/locales/tables/fa.json +27 -2
  1118. package/locales/tables/fi.json +27 -2
  1119. package/locales/tables/fr-CA.json +29 -2
  1120. package/locales/tables/fr.json +29 -2
  1121. package/locales/tables/ha.json +27 -2
  1122. package/locales/tables/he.json +31 -4
  1123. package/locales/tables/hi.json +27 -2
  1124. package/locales/tables/hr.json +29 -2
  1125. package/locales/tables/hu.json +27 -2
  1126. package/locales/tables/id.json +25 -2
  1127. package/locales/tables/it.json +29 -2
  1128. package/locales/tables/ja.json +25 -2
  1129. package/locales/tables/ko.json +25 -2
  1130. package/locales/tables/mr.json +27 -2
  1131. package/locales/tables/ms.json +25 -2
  1132. package/locales/tables/nl.json +27 -2
  1133. package/locales/tables/pl.json +31 -2
  1134. package/locales/tables/pt.json +29 -2
  1135. package/locales/tables/ro.json +29 -2
  1136. package/locales/tables/ru.json +31 -2
  1137. package/locales/tables/sk.json +33 -4
  1138. package/locales/tables/sv.json +29 -4
  1139. package/locales/tables/sw.json +27 -2
  1140. package/locales/tables/ta.json +27 -2
  1141. package/locales/tables/te.json +29 -4
  1142. package/locales/tables/th.json +25 -2
  1143. package/locales/tables/tl.json +29 -4
  1144. package/locales/tables/tr.json +27 -2
  1145. package/locales/tables/uk.json +31 -2
  1146. package/locales/tables/ur.json +27 -2
  1147. package/locales/tables/vi.json +27 -4
  1148. package/locales/tables/yo.json +27 -4
  1149. package/locales/tables/zh-Hans.json +27 -4
  1150. package/locales/tables/zh-Hant.json +27 -4
  1151. package/locales/te.json +19 -3
  1152. package/locales/th.json +18 -3
  1153. package/locales/tl.json +19 -3
  1154. package/locales/tr.json +19 -3
  1155. package/locales/uk.json +21 -3
  1156. package/locales/ur.json +19 -3
  1157. package/locales/vi.json +18 -3
  1158. package/locales/yo.json +18 -3
  1159. package/locales/zh-Hans.json +18 -3
  1160. package/locales/zh-Hant.json +18 -3
  1161. package/package.json +5 -1
  1162. package/ui/caps.js +9 -4
  1163. package/ui/csp.js +1 -1
  1164. package/ui/export.js +10 -4
  1165. package/ui/icons.js +2 -1
  1166. package/ui/kit.js +44 -10
  1167. package/ui/language.js +172 -0
  1168. package/ui/looks/classic.css +3 -2
  1169. package/ui/looks/human.css +7 -9
  1170. package/ui/looks/mail.css +1 -1
  1171. package/ui/looks/minimal.css +1 -1
  1172. package/ui/looks.js +1 -1
  1173. package/ui/markdown.js +17 -6
  1174. package/ui/model.js +6 -0
  1175. package/ui/reader-state.js +1 -1
  1176. package/ui/review.js +1 -1
  1177. package/ui/save.js +16 -0
  1178. package/ui/seal.js +5 -4
  1179. package/ui/sheet.js +21 -2
  1180. package/ui/style.css +54 -32
  1181. package/ui/touches.js +4 -1
  1182. package/ui/view.css +1 -1
  1183. package/ui/view.js +10 -8
  1184. package/vendor/LICENSES/babylonjs-core.txt +2 -0
  1185. package/vendor/LICENSES/eventemitter3.txt +21 -0
  1186. package/vendor/LICENSES/maplibre-gl.txt +1 -1
  1187. package/vendor/LICENSES/phaser.txt +20 -0
  1188. package/vendor/LICENSES/zzfx.txt +21 -0
  1189. package/vendor/abcjs/abcjs.mjs +2 -2
  1190. package/vendor/babylon/babylon.mjs +8122 -0
  1191. package/vendor/deck/deck.css +2 -2
  1192. package/vendor/deck/deck.mjs +37 -37
  1193. package/vendor/deck/pptx.mjs +1 -1
  1194. package/vendor/maplibre/maplibre-gl-worker.js +3 -3
  1195. package/vendor/maplibre/maplibre-gl.css +1 -1
  1196. package/vendor/maplibre/maplibre-gl.mjs +37 -37
  1197. package/vendor/marked.esm.js +40 -38
  1198. package/vendor/ooxml/abort-JztSoyw2.js +8 -0
  1199. package/vendor/ooxml/{hyperlink-Cxzhet30.js → bounded-raw-part-cache-B8t03tSP.js} +4460 -7080
  1200. package/vendor/ooxml/bundled-asset-url-BMJ8vNHP.js +13 -0
  1201. package/vendor/ooxml/canvas-viewer-mechanics-DI38gHNV.js +653 -0
  1202. package/vendor/ooxml/cfb-guard-BIaHdonq.js +516 -0
  1203. package/vendor/ooxml/{chunk-DmhlhrBa.js → chunk-D5OxutzX.js} +0 -2
  1204. package/vendor/ooxml/comment-overlay-controller-Crm5Syhx.js +974 -0
  1205. package/vendor/ooxml/{comment-ui-runtime-CWGqn5Vr.js → comment-ui-runtime-BfEPgl5r.js} +5 -7
  1206. package/vendor/ooxml/comment-ui-runtime-BtP_TpvT.js +2 -0
  1207. package/vendor/ooxml/{comment-ui-runtime-DcJOYlw-.js → comment-ui-runtime-hfewTmVJ.js} +5 -7
  1208. package/vendor/ooxml/delimited-text-worker-host-RwvuSsP2.js +21 -0
  1209. package/vendor/ooxml/document-model-source-BUTSwkyP.js +247 -0
  1210. package/vendor/ooxml/document-pull-client-C_D779tO.js +36230 -0
  1211. package/vendor/ooxml/docx-BfLZeiwa.js +3509 -0
  1212. package/vendor/ooxml/docx.mjs +7 -7
  1213. package/vendor/ooxml/docx_parser_bg.wasm +0 -0
  1214. package/vendor/ooxml/drawingml-shape-BcXkRayC.js +306 -0
  1215. package/vendor/ooxml/duotone-BI7CoghW.js +122 -0
  1216. package/vendor/ooxml/emf-DgUBx9BU.js +1788 -0
  1217. package/vendor/ooxml/font-preload-demand-B6HPFxDp.js +2052 -0
  1218. package/vendor/ooxml/graph.json +1 -1
  1219. package/vendor/ooxml/grid-geometry-CqTDvpDr.js +379 -0
  1220. package/vendor/ooxml/host-layout-Cz_lCuTZ.js +55 -0
  1221. package/vendor/ooxml/line-distribute-DR9Qwd3u.js +2783 -0
  1222. package/vendor/ooxml/{mathjax-DoyWZbSp.js → mathjax-DvwccQ8e.js} +0 -2
  1223. package/vendor/ooxml/model-source-COXegBNA.js +177 -0
  1224. package/vendor/ooxml/{pixel-budget-9P63Bsk5.js → pixel-budget-DI82Hn3R.js} +13 -12
  1225. package/vendor/ooxml/plot-area-frame-D3JtHvov.js +41645 -0
  1226. package/vendor/ooxml/pptx-CfCiVlNB.js +2888 -0
  1227. package/vendor/ooxml/pptx.mjs +8 -7
  1228. package/vendor/ooxml/pptx_parser_bg.wasm +0 -0
  1229. package/vendor/ooxml/presentation-model-source-DL6duh5l.js +75 -0
  1230. package/vendor/ooxml/raster-target-Ca3tyA0L.js +40 -0
  1231. package/vendor/ooxml/{read-only-comment-decoration-Dz7eTQ4d.js → read-only-comment-decoration-B06YO2zk.js} +0 -4
  1232. package/vendor/ooxml/{read-only-comment-margin-DkgzASAl.js → read-only-comment-margin-Ee9Y6vPg.js} +0 -2
  1233. package/vendor/ooxml/renderer-IFuBkPvF.js +5197 -0
  1234. package/vendor/ooxml/{renderer-module-contract-D91rkYHH.js → renderer-module-contract-BuTx2FWJ.js} +0 -2
  1235. package/vendor/ooxml/renderer-xdugdcMd.js +5769 -0
  1236. package/vendor/ooxml/resource-measurement-D2bu0Qfx.js +756 -0
  1237. package/vendor/ooxml/slide-pull-client-BUuJQQVE.js +6431 -0
  1238. package/vendor/ooxml/three-d-ByHGsYrX.js +868 -0
  1239. package/vendor/ooxml/tiff-contract-DEd8CGuz.js +48 -0
  1240. package/vendor/ooxml/{visible-index-BgiHEc1z.js → visible-index-vN-4BNn7.js} +0 -2
  1241. package/vendor/ooxml/workbook-model-source-DBfVsWj7.js +92 -0
  1242. package/vendor/ooxml/worker-source-C29EQNUj.js +18 -0
  1243. package/vendor/ooxml/worker-source-D3NwPe6l.js +18 -0
  1244. package/vendor/ooxml/worker-source-ZQE9C1j6.js +18 -0
  1245. package/vendor/ooxml/worksheet-pull-client-Du0MuIro.js +565 -0
  1246. package/vendor/ooxml/xlsx-CCMRAxPB.js +5812 -0
  1247. package/vendor/ooxml/xlsx.mjs +8 -7
  1248. package/vendor/ooxml/xlsx_parser_bg.wasm +0 -0
  1249. package/vendor/pele/chunks/2CHDFZHC.js +1 -0
  1250. package/vendor/pele/chunks/{GAP5KXLD.js → 2S3JPEOY.js} +1 -1
  1251. package/vendor/pele/chunks/2U463FD2.js +11 -0
  1252. package/vendor/pele/chunks/3OKCTCH7.js +1 -0
  1253. package/vendor/pele/chunks/42UK3TL6.js +8 -0
  1254. package/vendor/pele/chunks/43YPWK3Q.js +1 -0
  1255. package/vendor/pele/chunks/45MVAN6X.js +1 -0
  1256. package/vendor/pele/chunks/46GJKBLZ.js +1 -0
  1257. package/vendor/pele/chunks/4WR52FRP.js +4 -0
  1258. package/vendor/pele/chunks/63WH7YNF.js +1 -0
  1259. package/vendor/pele/chunks/{2TH3V34D.js → 673H7YBG.js} +1 -1
  1260. package/vendor/pele/chunks/6DDU7VKX.js +1 -0
  1261. package/vendor/pele/chunks/{3MKGV5HX.js → 6Y6FML25.js} +1 -1
  1262. package/vendor/pele/chunks/{4AG6A4TK.js → 7HQPULDG.js} +1 -1
  1263. package/vendor/pele/chunks/7N3VAIG2.js +2 -0
  1264. package/vendor/pele/chunks/{QFOMM5LR.js → 7NY54ILO.js} +1 -1
  1265. package/vendor/pele/chunks/{VHJMZXCQ.js → BJNHMTN6.js} +1 -1
  1266. package/vendor/pele/chunks/{6PEWY3TN.js → BK7N5KMP.js} +1 -1
  1267. package/vendor/pele/chunks/CLQLV5VT.js +1 -0
  1268. package/vendor/pele/chunks/CUSPXG5M.js +1 -0
  1269. package/vendor/pele/chunks/D3L7O4X2.js +1 -0
  1270. package/vendor/pele/chunks/{D4V2MWCI.js → D5TW5CPZ.js} +1 -1
  1271. package/vendor/pele/chunks/DDVFZY3L.js +7 -0
  1272. package/vendor/pele/chunks/{3S2YGJBL.js → DO6ND2WD.js} +5 -5
  1273. package/vendor/pele/chunks/EGADTWYV.js +1 -0
  1274. package/vendor/pele/chunks/EI4VGK5C.js +4 -0
  1275. package/vendor/pele/chunks/EOJSJZXM.js +1 -0
  1276. package/vendor/pele/chunks/F4O23KYR.js +5 -0
  1277. package/vendor/pele/chunks/G2OEIG6X.js +1 -0
  1278. package/vendor/pele/chunks/GER2CN75.js +2 -0
  1279. package/vendor/pele/chunks/{RGVCULFG.js → GP5YUCAR.js} +1 -1
  1280. package/vendor/pele/chunks/GXJ2T77W.js +1 -0
  1281. package/vendor/pele/chunks/HX3UMAK7.js +1 -0
  1282. package/vendor/pele/chunks/IU7WZTP6.js +4 -0
  1283. package/vendor/pele/chunks/J3JF2HV4.js +12 -0
  1284. package/vendor/pele/chunks/J5J2NR2G.js +1 -0
  1285. package/vendor/pele/chunks/JRCWTJEL.js +1 -0
  1286. package/vendor/pele/chunks/{M7II5KMO.js → K2ZHGJKH.js} +1 -1
  1287. package/vendor/pele/chunks/{E3FWOBN4.js → KHUP5TOH.js} +3 -3
  1288. package/vendor/pele/chunks/L74FQTH5.js +1 -0
  1289. package/vendor/pele/chunks/LAV4ZXOS.js +1 -0
  1290. package/vendor/pele/chunks/LBIZYCRR.js +1 -0
  1291. package/vendor/pele/chunks/LFFXNLRS.js +1 -0
  1292. package/vendor/pele/chunks/LJ44NU43.js +3 -0
  1293. package/vendor/pele/chunks/LLLWOAQD.js +1 -0
  1294. package/vendor/pele/chunks/LTY5LMQH.js +5 -0
  1295. package/vendor/pele/chunks/LTYQZ5U5.js +1 -0
  1296. package/vendor/pele/chunks/MJBOF5Q6.js +2 -0
  1297. package/vendor/pele/chunks/NDSCUZ25.js +1 -0
  1298. package/vendor/pele/chunks/NMN3IKWL.js +1 -0
  1299. package/vendor/pele/chunks/NMUA3R2D.js +1 -0
  1300. package/vendor/pele/chunks/NY5A6PPW.js +1 -0
  1301. package/vendor/pele/chunks/O3ACPFEJ.js +8 -0
  1302. package/vendor/pele/chunks/{A6VFOGAO.js → O4MQT6AV.js} +1 -1
  1303. package/vendor/pele/chunks/{DUZNPW7S.js → OHJ2EJXK.js} +1 -1
  1304. package/vendor/pele/chunks/OU2GIT2H.js +1 -0
  1305. package/vendor/pele/chunks/{E65FQMJL.js → PDMLSE6I.js} +1 -1
  1306. package/vendor/pele/chunks/PJ7X32S5.js +1 -0
  1307. package/vendor/pele/chunks/RLLQ44NJ.js +1 -0
  1308. package/vendor/pele/chunks/S6DWMCK5.js +1 -0
  1309. package/vendor/pele/chunks/STIOTUT7.js +1 -0
  1310. package/vendor/pele/chunks/{UO52YEYL.js → SXSLPWUD.js} +1 -1
  1311. package/vendor/pele/chunks/TBJXKAT4.js +3 -0
  1312. package/vendor/pele/chunks/TIVX74RS.js +2 -0
  1313. package/vendor/pele/chunks/{KIF544NL.js → TK23BXEA.js} +1 -1
  1314. package/vendor/pele/chunks/{STAXBNH4.js → TR4WJQGX.js} +1 -1
  1315. package/vendor/pele/chunks/UWRPUF3N.js +1 -0
  1316. package/vendor/pele/chunks/VMTWYMKQ.js +2 -0
  1317. package/vendor/pele/chunks/VSWIZJ7B.js +1 -0
  1318. package/vendor/pele/chunks/{STMK7JZH.js → W2WY5CQX.js} +2 -2
  1319. package/vendor/pele/chunks/W77N5H3K.js +2 -0
  1320. package/vendor/pele/chunks/WM7NR6YK.js +1 -0
  1321. package/vendor/pele/chunks/WSTWNLCU.js +4 -0
  1322. package/vendor/pele/chunks/WXKV2YEK.js +1 -0
  1323. package/vendor/pele/chunks/XQ5S3AI3.js +13 -0
  1324. package/vendor/pele/chunks/YNX532HU.js +1 -0
  1325. package/vendor/pele/chunks/{DHKBVIA3.js → YUPSMAUO.js} +1 -1
  1326. package/vendor/pele/chunks/{IHVFDU4A.js → YWXUFHC7.js} +7 -7
  1327. package/vendor/pele/chunks/Z3ZRV7NH.js +2 -0
  1328. package/vendor/pele/chunks/ZFRCZTLK.js +1 -0
  1329. package/vendor/pele/chunks/ZZDR4CN3.js +1 -0
  1330. package/vendor/pele/lazy.js +1 -1
  1331. package/vendor/phaser/phaser.mjs +1 -0
  1332. package/vendor/signals-core.mjs +1 -1
  1333. package/vendor/spessasynth/fflate.mjs +1 -0
  1334. package/vendor/spessasynth/spessasynth.mjs +37033 -15099
  1335. package/vendor/temml/temml.mjs +1 -1
  1336. package/vendor/zzfx/zzfx.mjs +1 -0
  1337. package/ui/acts.js +0 -12
  1338. package/vendor/ooxml/bounded-raw-part-cache-Cg1BsSZQ.js +0 -119
  1339. package/vendor/ooxml/canvas-viewer-mechanics-DbLz0rYW.js +0 -1384
  1340. package/vendor/ooxml/cjk-fallback-bLI3z70h.js +0 -46
  1341. package/vendor/ooxml/comment-occurrence-C8Y2uoVr.js +0 -6
  1342. package/vendor/ooxml/comment-ui-runtime-BsK8pmUT.js +0 -2
  1343. package/vendor/ooxml/comments-Diid5ujN.js +0 -246
  1344. package/vendor/ooxml/delimited-text-worker-host-BVY-Ecni.js +0 -25
  1345. package/vendor/ooxml/document-pull-client-B9PTM-pL.js +0 -27280
  1346. package/vendor/ooxml/docx-BF9WXrYH.js +0 -3101
  1347. package/vendor/ooxml/dom-interaction-boundary-Cnm8DSBN.js +0 -223
  1348. package/vendor/ooxml/highlight-rect-C5hkRqUr.js +0 -13
  1349. package/vendor/ooxml/line-distribute-D1WNHKz_.js +0 -1023
  1350. package/vendor/ooxml/line-metrics-B60C86uh.js +0 -60
  1351. package/vendor/ooxml/plot-area-frame-DLTYKHNP.js +0 -4354
  1352. package/vendor/ooxml/pptx-DkyYBYoL.js +0 -3063
  1353. package/vendor/ooxml/raster-target-ojDdQizC.js +0 -91
  1354. package/vendor/ooxml/renderer-B4GZb5We.js +0 -6492
  1355. package/vendor/ooxml/resource-measurement-SHQCbkh2.js +0 -150
  1356. package/vendor/ooxml/slide-pull-client-DiPnm240.js +0 -6253
  1357. package/vendor/ooxml/source-key-DIJG8BA0.js +0 -42
  1358. package/vendor/ooxml/three-d-DJBl8g8M.js +0 -1162
  1359. package/vendor/ooxml/transfer-p6iCC2R7.js +0 -6
  1360. package/vendor/ooxml/units-BzZ0gAxs.js +0 -4
  1361. package/vendor/ooxml/worksheet-pull-client-BM8ywvbu.js +0 -458
  1362. package/vendor/ooxml/xlsx-C9NVjgaV.js +0 -8482
  1363. package/vendor/pele/chunks/23I4SOAX.js +0 -1
  1364. package/vendor/pele/chunks/25ITEZ43.js +0 -2
  1365. package/vendor/pele/chunks/26H2HVXD.js +0 -1
  1366. package/vendor/pele/chunks/2IZ5MNOH.js +0 -1
  1367. package/vendor/pele/chunks/2P3CZEXH.js +0 -1
  1368. package/vendor/pele/chunks/3E5HRNYT.js +0 -1
  1369. package/vendor/pele/chunks/3JIRLDUO.js +0 -1
  1370. package/vendor/pele/chunks/5MJ3UKSG.js +0 -1
  1371. package/vendor/pele/chunks/63N73SV4.js +0 -1
  1372. package/vendor/pele/chunks/A255FCTW.js +0 -1
  1373. package/vendor/pele/chunks/AM43MQ64.js +0 -1
  1374. package/vendor/pele/chunks/AOZTNTMC.js +0 -1
  1375. package/vendor/pele/chunks/AQNLM6KG.js +0 -1
  1376. package/vendor/pele/chunks/BNU2RHQB.js +0 -1
  1377. package/vendor/pele/chunks/C5HTQT3I.js +0 -4
  1378. package/vendor/pele/chunks/CPKRWH5G.js +0 -1
  1379. package/vendor/pele/chunks/CPRVZL76.js +0 -11
  1380. package/vendor/pele/chunks/CUVCMPQX.js +0 -1
  1381. package/vendor/pele/chunks/D6K5RLPD.js +0 -5
  1382. package/vendor/pele/chunks/EENBF6R3.js +0 -5
  1383. package/vendor/pele/chunks/G3OATVW2.js +0 -1
  1384. package/vendor/pele/chunks/GFBBR3DD.js +0 -13
  1385. package/vendor/pele/chunks/IV52FOAS.js +0 -1
  1386. package/vendor/pele/chunks/JTJEEBDN.js +0 -1
  1387. package/vendor/pele/chunks/JX3HYMZ6.js +0 -8
  1388. package/vendor/pele/chunks/K3TAFXGN.js +0 -3
  1389. package/vendor/pele/chunks/K7FUICZ3.js +0 -1
  1390. package/vendor/pele/chunks/LHH2HHRB.js +0 -1
  1391. package/vendor/pele/chunks/LT5IS45C.js +0 -2
  1392. package/vendor/pele/chunks/MSPQPZZY.js +0 -1
  1393. package/vendor/pele/chunks/NY2EJWPH.js +0 -2
  1394. package/vendor/pele/chunks/OB6ZFVKF.js +0 -1
  1395. package/vendor/pele/chunks/OJBDHQO2.js +0 -4
  1396. package/vendor/pele/chunks/PLTZDMI2.js +0 -1
  1397. package/vendor/pele/chunks/R7EPXMMD.js +0 -1
  1398. package/vendor/pele/chunks/S4GSSVLN.js +0 -3
  1399. package/vendor/pele/chunks/SPBWZ4VS.js +0 -1
  1400. package/vendor/pele/chunks/SR7OOV3Q.js +0 -1
  1401. package/vendor/pele/chunks/STXEMZPJ.js +0 -2
  1402. package/vendor/pele/chunks/SXFARSFO.js +0 -1
  1403. package/vendor/pele/chunks/TC77ISAL.js +0 -1
  1404. package/vendor/pele/chunks/TXE3YXUM.js +0 -2
  1405. package/vendor/pele/chunks/TYIQQHVC.js +0 -1
  1406. package/vendor/pele/chunks/TZUXETIT.js +0 -1
  1407. package/vendor/pele/chunks/U7N72BGE.js +0 -1
  1408. package/vendor/pele/chunks/UFPIB6EZ.js +0 -1
  1409. package/vendor/pele/chunks/V52Z4AG3.js +0 -4
  1410. package/vendor/pele/chunks/VBDLARNP.js +0 -4
  1411. package/vendor/pele/chunks/VIK3ONSK.js +0 -1
  1412. package/vendor/pele/chunks/VPGC3RUM.js +0 -7
  1413. package/vendor/pele/chunks/VVVO4ZVP.js +0 -1
  1414. package/vendor/pele/chunks/WRGXZO53.js +0 -1
  1415. package/vendor/pele/chunks/X5SG7MGC.js +0 -1
  1416. package/vendor/pele/chunks/XXYPNCD5.js +0 -1
  1417. package/vendor/pele/chunks/XZO3CX7R.js +0 -12
  1418. package/vendor/pele/chunks/YZBJM2QT.js +0 -2
  1419. package/vendor/pele/chunks/YZHV477W.js +0 -2
  1420. package/vendor/pele/chunks/Z6WRYFJC.js +0 -1
  1421. package/vendor/pele/chunks/ZI2QNEGF.js +0 -8
@@ -0,0 +1,2888 @@
1
+ import { t as e } from "ooxml/chunk-D5OxutzX.js";
2
+ import { a as t, c as n, d as r, f as i, i as a, l as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "ooxml/slide-pull-client-BUuJQQVE.js";
3
+ import { Aa as m, vo as h, yo as g } from "ooxml/plot-area-frame-D3JtHvov.js";
4
+ import { n as _, t as ee } from "ooxml/cfb-guard-BIaHdonq.js";
5
+ import { H as v, M as y, N as b, Tn as x, V as S, X as C, Xt as w, Y as T, Yt as te, Zt as E, fn as ne, hn as re, j as ie, lt as ae, mt as oe, n as se, ot as ce, qt as le, t as ue, u as D } from "ooxml/bounded-raw-part-cache-B8t03tSP.js";
6
+ import { C as de, D as fe, E as O, N as pe, O as me, P as k, S as he, T as A, _ as ge, a as _e, b as ve, c as ye, d as be, f as xe, g as Se, h as Ce, i as we, l as Te, m as Ee, n as De, o as Oe, p as ke, r as Ae, t as je, u as Me, v as Ne, w as j, x as Pe, y as Fe } from "ooxml/comment-overlay-controller-Crm5Syhx.js";
7
+ import { f as M, u as Ie } from "ooxml/pixel-budget-DI82Hn3R.js";
8
+ import { i as Le, t as Re } from "ooxml/tiff-contract-DEd8CGuz.js";
9
+ import { D as ze, E as Be, T as Ve, a as N, b as He, c as Ue, f as We, i as Ge, l as Ke, n as qe, o as P, p as Je, r as Ye, s as Xe, t as Ze, u as F, v as Qe, w as $e, x as et, y as tt } from "ooxml/canvas-viewer-mechanics-DI38gHNV.js";
10
+ import { n as nt } from "ooxml/renderer-module-contract-BuTx2FWJ.js";
11
+ import { t as rt } from "ooxml/visible-index-vN-4BNn7.js";
12
+ import { n as it } from "ooxml/resource-measurement-D2bu0Qfx.js";
13
+ function at(e, t) {
14
+ let n = t.startsWith("/") ? [] : e.split("/").filter((e) => e !== "");
15
+ for (let e of t.split("/")) if (e === "..") n.pop();
16
+ else if (e === "." || e === "") continue;
17
+ else n.push(e);
18
+ return n.join("/");
19
+ }
20
+ function ot(e) {
21
+ let t = /[?&]jump=([a-zA-Z]+)/.exec(e);
22
+ if (!t) return null;
23
+ let n = t[1].toLowerCase();
24
+ return n === "firstslide" || n === "lastslide" || n === "nextslide" || n === "previousslide" ? n : null;
25
+ }
26
+ function st(e, t, n) {
27
+ if (!(n <= 0)) switch (e) {
28
+ case "firstslide": return 0;
29
+ case "lastslide": return n - 1;
30
+ case "nextslide": return Math.min(t + 1, n - 1);
31
+ case "previousslide": return Math.max(t - 1, 0);
32
+ }
33
+ }
34
+ function I(e) {
35
+ let t = e.textBodyRotation ?? 0, n = e.shapeFlipH === !0, r = e.shapeFlipV === !0;
36
+ if (n || r) return `rotate(${e.rotation}deg) scale(${n ? -1 : 1}, ${r ? -1 : 1})` + (t === 0 ? "" : ` rotate(${t}deg)`);
37
+ let i = e.rotation + t;
38
+ return i === 0 ? "" : `rotate(${i}deg)`;
39
+ }
40
+ function ct(e, t) {
41
+ return `${e.shapeX},${e.shapeY},${e.shapeW},${e.shapeH},${e.cellHorzOverflow ?? "shape"},${t}`;
42
+ }
43
+ function lt(e, t, n, r, i, a) {
44
+ let o = e.createElement("div"), s = t.cellHorzOverflow !== void 0;
45
+ o.style.cssText = `position:absolute;left:${O(t.shapeX, n)};top:${O(t.shapeY, r)};width:${O(t.shapeW, n)};height:${O(t.shapeH, r)};pointer-events:${i};overflow:${s ? "visible" : a};`, t.cellHorzOverflow === "clip" && (o.style.overflowX = "clip", o.style.overflowY = "visible");
46
+ let c = I(t);
47
+ return c && (o.style.transformOrigin = "center center", o.style.transform = c), {
48
+ div: o,
49
+ w: t.shapeW,
50
+ h: t.shapeH
51
+ };
52
+ }
53
+ function L(e, t, n, r, i, a) {
54
+ e.innerHTML = "", A(e, "ooxmlSelectionSurface", "pptx"), A(e, "slideIndex", a === void 0 ? void 0 : String(a));
55
+ let o = /* @__PURE__ */ new Map(), s = e.ownerDocument ?? document;
56
+ for (let [a, c] of t.entries()) {
57
+ let t = ct(c, I(c)), l = o.get(t);
58
+ if (!l) {
59
+ let i = lt(s, c, n, r, "all", "visible");
60
+ l = i, o.set(t, l), e.appendChild(i.div);
61
+ }
62
+ let u = s.createElement("span");
63
+ A(u, "ooxmlSelectionRun", "pptx"), A(u, "runIndex", String(a)), c.shapeId !== void 0 && A(u, "shapeId", c.shapeId), c.elementIndex !== void 0 && A(u, "elementIndex", String(c.elementIndex)), c.origin !== void 0 && A(u, "elementOrigin", c.origin), u.textContent = c.text;
64
+ let d = i ? c.hyperlink : void 0;
65
+ u.style.cssText = `position:absolute;left:${O(c.inShapeX, l.w)};top:${O(c.inShapeY, l.h)};font:${c.font};line-height:${c.h}px;letter-spacing:0;white-space:pre;color:transparent;cursor:${d ? "pointer" : "text"};`, d && i && (u.title = d.kind === "external" ? d.url : d.ref, u.addEventListener("click", (e) => {
66
+ e.preventDefault(), i(d);
67
+ })), l.div.appendChild(u);
68
+ }
69
+ }
70
+ function R(e, t, n, r, i, a, o = {}) {
71
+ e.innerHTML = "";
72
+ let s = o.match ?? "rgba(255, 214, 0, 0.42)", c = o.active ?? "rgba(255, 140, 0, 0.55)", l = e.ownerDocument ?? document, u = /* @__PURE__ */ new Map(), d = (t) => {
73
+ let n = ct(t, I(t)), a = u.get(n);
74
+ if (!a) {
75
+ let o = lt(l, t, r, i, "none", "hidden");
76
+ a = o, u.set(n, a), e.appendChild(o.div);
77
+ }
78
+ return a;
79
+ };
80
+ for (let e of n) {
81
+ let n = e.active ? c : s;
82
+ for (let r of e.slices) {
83
+ let e = t[r.runIndex];
84
+ if (!e) continue;
85
+ let i = a(e.font), { x: o, width: s } = fe(e.text, r.start, r.end, i);
86
+ if (s <= 0) continue;
87
+ let c = d(e), u = l.createElement("div");
88
+ u.style.cssText = `position:absolute;left:${O(e.inShapeX + o, c.w)};top:${O(e.inShapeY, c.h)};width:${O(s, c.w)};height:${O(e.h, c.h)};background:${n};pointer-events:none;`, c.div.appendChild(u);
89
+ }
90
+ }
91
+ }
92
+ function ut(e, t) {
93
+ let n = e.tableCell, r = t.tableCell;
94
+ return !n && !r ? !0 : !n || !r ? !1 : (e.renderElementIndex ?? e.elementIndex) === (t.renderElementIndex ?? t.elementIndex) && e.origin === t.origin && e.shapeId === t.shapeId && n.row === r.row && n.column === r.column;
95
+ }
96
+ function dt(e, t) {
97
+ for (let n = 1; n < t.length; n++) {
98
+ let r = e[t[n - 1].runIndex], i = e[t[n].runIndex];
99
+ if (!r || !i || !ut(r, i)) return !1;
100
+ }
101
+ return !0;
102
+ }
103
+ var ft = class extends de {
104
+ constructor(e, t) {
105
+ super(e, t, (e) => ({ slide: e }), dt);
106
+ }
107
+ slideRuns(e) {
108
+ return this.unitRuns(e);
109
+ }
110
+ setSlideRuns(e, t) {
111
+ this.setUnitRuns(e, t);
112
+ }
113
+ slideHighlights(e) {
114
+ return this.unitHighlights(e);
115
+ }
116
+ activeSlide() {
117
+ return this.activeUnit();
118
+ }
119
+ };
120
+ async function pt(e) {
121
+ return e ? (await import("ooxml/font-preload-demand-B6HPFxDp.js")).collectSlideFontDemand : void 0;
122
+ }
123
+ var mt = (e) => e >= "0" && e <= "9";
124
+ function ht(e) {
125
+ let t = 0;
126
+ for (let n = 0; n < 10; n++) t = Math.max(t, e.measureText(String(n)).width);
127
+ return t;
128
+ }
129
+ function gt(e, t, n) {
130
+ let r = 0;
131
+ for (let i of t) r += mt(i) ? n : e.measureText(i).width;
132
+ return r;
133
+ }
134
+ function _t(e, t, n, r, i) {
135
+ let a = e.textAlign;
136
+ e.textAlign = "left";
137
+ let o = n;
138
+ for (let n of t) if (mt(n)) {
139
+ let t = e.measureText(n).width;
140
+ e.fillText(n, o + (i - t) / 2, r), o += i;
141
+ } else e.fillText(n, o, r), o += e.measureText(n).width;
142
+ e.textAlign = a;
143
+ }
144
+ var z = (e, t) => e / m * t;
145
+ async function vt(e, t, n) {
146
+ let i = e.getContext("2d");
147
+ if (!i) throw Error("2D context not available");
148
+ let a = n.width / (n.slideWidthEmu / m);
149
+ await n.drawBase();
150
+ let o = document.createElement("canvas");
151
+ o.width = e.width, o.height = e.height;
152
+ let s = o.getContext("2d");
153
+ if (!s) throw Error("base 2D context not available");
154
+ s.drawImage(e, 0, 0);
155
+ let c = [], l = !1, u = () => {
156
+ for (let e of c) {
157
+ e.detachListeners(), e.media.pause(), e.media.removeAttribute("src");
158
+ try {
159
+ e.media.load();
160
+ } catch {}
161
+ URL.revokeObjectURL(e.objectUrl);
162
+ }
163
+ c.length = 0;
164
+ }, d = (e) => {
165
+ l || (n.onError ? n.onError(e) : console.error("[ooxml] PPTX embedded media failed:", e));
166
+ };
167
+ for (let e of t) {
168
+ let t;
169
+ try {
170
+ t = await n.fetchMedia(e.mediaPath);
171
+ } catch (t) {
172
+ throw u(), t instanceof g || M(t) ? t : xt(e, t);
173
+ }
174
+ let r = e.mimeType || t.type, i = t.type === r ? t : new Blob([t], { type: r }), o = URL.createObjectURL(i), s = e.mediaKind === "video" ? document.createElement("video") : document.createElement("audio");
175
+ s.src = o, s.preload = "metadata", e.mediaKind === "video" && (s.playsInline = !0);
176
+ let f = yt(e, a), p = {
177
+ el: e,
178
+ rect: e.mediaKind === "audio" ? {
179
+ x: f.x + f.w / 2 - Math.max(f.w, 260) / 2,
180
+ y: f.y,
181
+ w: Math.max(f.w, 260),
182
+ h: f.h + 36
183
+ } : f,
184
+ posterRect: f,
185
+ media: s,
186
+ objectUrl: o,
187
+ loadState: "loading",
188
+ detachListeners: () => {}
189
+ }, m = () => {
190
+ l || (p.loadState = "metadata");
191
+ }, h = () => {
192
+ l || (p.loadState = "ready");
193
+ }, _ = () => {
194
+ l || (p.loadState = "error", d(B(e, s, "decode")));
195
+ };
196
+ s.addEventListener("loadedmetadata", m), s.addEventListener("canplay", h), s.addEventListener("error", _), p.detachListeners = () => {
197
+ s.removeEventListener("loadedmetadata", m), s.removeEventListener("canplay", h), s.removeEventListener("error", _);
198
+ }, c.push(p);
199
+ try {
200
+ s.load();
201
+ } catch (t) {
202
+ let n = B(e, s, "load", t);
203
+ throw u(), n;
204
+ }
205
+ }
206
+ let f = null, p = null, h = () => {
207
+ i.setTransform(e.width / n.width, 0, 0, e.height / n.height, 0, 0), i.drawImage(o, 0, 0, e.width, e.height, 0, 0, n.width, n.height);
208
+ for (let e of c) {
209
+ let t = e.media;
210
+ if (e.loadState !== "loading") {
211
+ if (e.loadState === "error") {
212
+ bt(i, e.posterRect, "Media unavailable");
213
+ continue;
214
+ }
215
+ if (e.el.mediaKind === "video" && t.readyState >= 2) {
216
+ let { x: n, y: r, w: a, h: o } = e.posterRect;
217
+ i.drawImage(t, n, r, a, o);
218
+ }
219
+ if (e === p || y?.state === e) Et(i, e, t);
220
+ else if (t.paused) {
221
+ let { x: t, y: n, w: a, h: o } = e.posterRect;
222
+ r(i, t + a / 2, n + o / 2, a, o, "paused");
223
+ }
224
+ }
225
+ }
226
+ }, _ = () => {
227
+ l || (h(), f = requestAnimationFrame(_));
228
+ }, ee = (t, r) => {
229
+ let i = e.getBoundingClientRect();
230
+ return {
231
+ x: (t - i.left) / i.width * n.width,
232
+ y: (r - i.top) / i.height * n.height
233
+ };
234
+ }, v = (e, t) => {
235
+ for (let n of c) {
236
+ let { x: r, y: i, w: a, h: o } = n.rect;
237
+ if (e < r || e > r + a || t < i || t > i + o) continue;
238
+ let s = U(n), c = s.y - 12, l = s.y + s.h + 8;
239
+ return (Number.isFinite(n.media.duration) ? n.media.duration : 0) > 0 && e >= s.x && e <= s.x + s.w && t >= c && t <= l ? {
240
+ kind: "seek",
241
+ state: n,
242
+ fraction: Math.max(0, Math.min(1, (e - s.x) / s.w))
243
+ } : {
244
+ kind: "toggle",
245
+ state: n
246
+ };
247
+ }
248
+ return null;
249
+ }, y = null, b = (e, t) => {
250
+ let n = Number.isFinite(e.media.duration) ? e.media.duration : 0;
251
+ n <= 0 || (e.media.currentTime = n * t);
252
+ }, x = (e) => {
253
+ try {
254
+ e.media.play().catch((t) => {
255
+ d(B(e.el, e.media, "play", t));
256
+ });
257
+ } catch (t) {
258
+ d(B(e.el, e.media, "play", t));
259
+ }
260
+ }, S = (t) => {
261
+ let { x: n, y: r } = ee(t.clientX, t.clientY), i = v(n, r);
262
+ i && (i.kind === "seek" ? (y = {
263
+ state: i.state,
264
+ wasPlaying: !i.state.media.paused
265
+ }, i.state.media.pause(), b(i.state, i.fraction), e.setPointerCapture(t.pointerId), t.preventDefault()) : i.state.media.paused ? x(i.state) : i.state.media.pause());
266
+ }, C = (e) => {
267
+ let { x: t, y: n } = ee(e.clientX, e.clientY);
268
+ p = null;
269
+ for (let e of c) {
270
+ let { x: r, y: i, w: a, h: o } = e.rect;
271
+ if (t >= r && t <= r + a && n >= i && n <= i + o) {
272
+ p = e;
273
+ break;
274
+ }
275
+ }
276
+ if (y) {
277
+ let e = U(y.state), n = Math.max(0, Math.min(1, (t - e.x) / e.w));
278
+ b(y.state, n);
279
+ }
280
+ }, w = () => {
281
+ p = null;
282
+ }, T = (t) => {
283
+ if (!y) return;
284
+ let { wasPlaying: n, state: r } = y;
285
+ y = null, e.releasePointerCapture(t.pointerId), n && x(r);
286
+ };
287
+ return c.length > 0 && (e.addEventListener("pointerdown", S), e.addEventListener("pointermove", C), e.addEventListener("pointerleave", w), e.addEventListener("pointerup", T), e.addEventListener("pointercancel", T), e.style.cursor = "pointer", _()), {
288
+ play(e) {
289
+ for (let t of c) (!e || t.el.mediaPath === e) && x(t);
290
+ },
291
+ pause(e) {
292
+ for (let t of c) (!e || t.el.mediaPath === e) && t.media.pause();
293
+ },
294
+ destroy() {
295
+ l || (l = !0, f !== null && cancelAnimationFrame(f), e.removeEventListener("pointerdown", S), e.removeEventListener("pointermove", C), e.removeEventListener("pointerleave", w), e.removeEventListener("pointerup", T), e.removeEventListener("pointercancel", T), e.style.cursor = "", u());
296
+ }
297
+ };
298
+ }
299
+ function yt(e, t) {
300
+ return {
301
+ x: z(e.x, t),
302
+ y: z(e.y, t),
303
+ w: z(e.width, t),
304
+ h: z(e.height, t)
305
+ };
306
+ }
307
+ function bt(e, t, n) {
308
+ let r = Math.max(10, Math.min(14, t.h * .12));
309
+ e.save(), e.font = `500 ${r}px system-ui, -apple-system, sans-serif`, e.textAlign = "center", e.textBaseline = "middle";
310
+ let i = r + 12, a = Math.min(t.w, Math.max(100, e.measureText(n).width + 24));
311
+ W(e, t.x + (t.w - a) / 2, t.y + (t.h - i) / 2, a, i, i / 2), e.fillStyle = "rgba(20, 20, 20, 0.72)", e.fill(), e.fillStyle = "rgba(255, 255, 255, 0.95)", e.fillText(n, t.x + t.w / 2, t.y + t.h / 2), e.restore();
312
+ }
313
+ function xt(e, t) {
314
+ return /* @__PURE__ */ Error(`Embedded ${e.mediaKind} fetch failed for "${e.mediaPath}" (mime=${e.mimeType || "unknown"}): ${St(t)}`);
315
+ }
316
+ function B(e, t, n, r) {
317
+ let i = "";
318
+ try {
319
+ i = e.mimeType ? t.canPlayType(e.mimeType) : "";
320
+ } catch {}
321
+ let a = t.error, o = [
322
+ `mime=${e.mimeType || "unknown"}`,
323
+ `canPlayType=${i || "no"}`,
324
+ `readyState=${t.readyState}`,
325
+ `networkState=${t.networkState}`
326
+ ];
327
+ a && o.push(`mediaError=${a.code}${a.message ? ` ${a.message}` : ""}`);
328
+ let s = r === void 0 ? "" : `: ${St(r)}`;
329
+ return /* @__PURE__ */ Error(`Embedded ${e.mediaKind} ${n} failed for "${e.mediaPath}" (${o.join("; ")})${s}`);
330
+ }
331
+ function St(e) {
332
+ return e instanceof Error ? `${e.name || "Error"}${e.message ? `: ${e.message}` : ""}` : String(e);
333
+ }
334
+ var Ct = 28, V = 14, wt = 72, Tt = 10, H = 3;
335
+ function Et(e, t, n) {
336
+ let i = Number.isFinite(n.duration) ? n.duration : 0, a = i > 0 ? Math.min(1, n.currentTime / i) : 0, o = t.posterRect;
337
+ r(e, o.x + o.w / 2, o.y + o.h / 2, o.w, o.h, n.paused ? "paused" : "playing"), t.el.mediaKind === "audio" ? Ot(e, t, n, i, a) : Dt(e, t, n, i, a);
338
+ }
339
+ function Dt(e, t, n, r, i) {
340
+ let { x: a, y: o, w: s, h: c } = t.rect, l = Math.max(28, Math.min(56, c * .22)), u = o + c - l;
341
+ e.save();
342
+ let d = e.createLinearGradient(0, u, 0, o + c);
343
+ d.addColorStop(0, "rgba(0, 0, 0, 0)"), d.addColorStop(1, "rgba(0, 0, 0, 0.55)"), e.fillStyle = d, e.fillRect(a, u, s, l), e.restore();
344
+ let f = U(t);
345
+ At(e, f, i, r > 0), e.save(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.shadowColor = "rgba(0, 0, 0, 0.75)", e.shadowBlur = 3, e.fillStyle = "rgba(255, 255, 255, 0.95)", kt(e, n.currentTime, r, f.x, f.y - 10, "bottom"), e.restore();
346
+ }
347
+ function Ot(e, t, n, r, i) {
348
+ let a = jt(t.rect);
349
+ e.save(), W(e, a.x, a.y, a.w, a.h, a.h / 2), e.fillStyle = "rgba(20, 20, 20, 0.72)", e.fill(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.fillStyle = "rgba(255, 255, 255, 0.95)", kt(e, n.currentTime, r, a.x + V, a.y + a.h / 2, "middle"), e.restore(), At(e, U(t), i, r > 0);
350
+ }
351
+ function kt(e, t, n, r, i, a) {
352
+ let o = Mt(t), s = Mt(n), c = ht(e), l = gt(e, o, c), u = gt(e, s, c), d = e.measureText(" / ").width, f = Math.max(l, u);
353
+ _t(e, o, r + f - l, i, c);
354
+ let p = e.textAlign;
355
+ e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p, _t(e, s, r + f + d, i, c);
356
+ }
357
+ function At(e, t, n, r) {
358
+ let i = t.h / 2;
359
+ if (e.save(), W(e, t.x, t.y, t.w, t.h, i), e.fillStyle = "rgba(255, 255, 255, 0.35)", e.fill(), n > 0 && (W(e, t.x, t.y, t.w * n, t.h, i), e.fillStyle = "#fff", e.fill()), r) {
360
+ let r = Math.max(t.x + 5, Math.min(t.x + t.w - 5, t.x + t.w * n));
361
+ e.shadowColor = "rgba(0, 0, 0, 0.3)", e.shadowBlur = 3, e.fillStyle = "#fff", e.beginPath(), e.arc(r, t.y + t.h / 2, 5, 0, Math.PI * 2), e.fill();
362
+ }
363
+ e.restore();
364
+ }
365
+ function jt(e) {
366
+ let t = Math.max(220, e.w - 24);
367
+ return {
368
+ x: e.x + e.w / 2 - t / 2,
369
+ y: e.y + e.h - Ct - 4,
370
+ w: t,
371
+ h: Ct
372
+ };
373
+ }
374
+ function U(e) {
375
+ if (e.el.mediaKind === "audio") {
376
+ let t = jt(e.rect), n = t.x + V + wt + Tt, r = Math.max(40, t.x + t.w - V - n);
377
+ return {
378
+ x: n,
379
+ y: t.y + (t.h - H) / 2,
380
+ w: r,
381
+ h: H
382
+ };
383
+ }
384
+ let t = e.rect, n = Math.max(12, t.w * .025), r = Math.max(12, Math.min(18, t.h * .05));
385
+ return {
386
+ x: t.x + n,
387
+ y: t.y + t.h - H - r,
388
+ w: t.w - n * 2,
389
+ h: H
390
+ };
391
+ }
392
+ function W(e, t, n, r, i, a) {
393
+ let o = Math.min(a, i / 2, r / 2);
394
+ e.beginPath(), e.moveTo(t + o, n), e.lineTo(t + r - o, n), e.quadraticCurveTo(t + r, n, t + r, n + o), e.lineTo(t + r, n + i - o), e.quadraticCurveTo(t + r, n + i, t + r - o, n + i), e.lineTo(t + o, n + i), e.quadraticCurveTo(t, n + i, t, n + i - o), e.lineTo(t, n + o), e.quadraticCurveTo(t, n, t + o, n), e.closePath();
395
+ }
396
+ function Mt(e) {
397
+ if (!Number.isFinite(e) || e < 0) return "0:00";
398
+ let t = Math.floor(e);
399
+ return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
400
+ }
401
+ function Nt(e) {
402
+ let t = /* @__PURE__ */ new Map();
403
+ for (let n = 0; n < e.length; n++) {
404
+ let r = e[n];
405
+ r !== void 0 && r !== "" && !t.has(r) && t.set(r, n);
406
+ }
407
+ return t;
408
+ }
409
+ function Pt(e, t) {
410
+ if (e === "") return;
411
+ if (e.startsWith("ppt/")) return t.get(e);
412
+ let n = at("ppt/slides", e);
413
+ return t.get(n);
414
+ }
415
+ function Ft(e, t, n) {
416
+ let r = ot(e);
417
+ return r === null ? Pt(e, t) : st(r, n, t.size);
418
+ }
419
+ function It(e) {
420
+ let t = E(e.family);
421
+ return e.presenceOnly ? `presence:${t}` : `${t}:${e.weight ?? 400}:${e.style ?? "normal"}`;
422
+ }
423
+ async function Lt(e, t, n, r = null) {
424
+ let i = /* @__PURE__ */ new Map();
425
+ for (let n of t) {
426
+ let t = It(n);
427
+ !e.has(t) && !i.has(t) && i.set(t, n);
428
+ }
429
+ if (i.size > 0) {
430
+ let t = n([...i.values()]);
431
+ for (let n of i.keys()) e.set(n, t);
432
+ }
433
+ let a = new Set(t.map((t) => e.get(It(t)))), o = await Promise.all(a), s = Object.assign({}, ...o.map((e) => e.routes)), c = new Set(o.flatMap((e) => e.installed ?? [])), l = {}, u = /* @__PURE__ */ new Set();
434
+ for (let e of t) {
435
+ let t = E(e.family);
436
+ if (e.presenceOnly) {
437
+ c.has(t) && u.add(t);
438
+ continue;
439
+ }
440
+ let n = zt(e);
441
+ s[n] && (l[n] = s[n], u.add(t));
442
+ }
443
+ for (let e of Rt(r)) u.delete(e);
444
+ return {
445
+ routes: l,
446
+ installed: [...u].sort()
447
+ };
448
+ }
449
+ function Rt(e) {
450
+ return !e || typeof e[Symbol.iterator] != "function" ? /* @__PURE__ */ new Set() : new Set([...e].map((e) => E(e.family.replace(/^(['"])(.*)\1$/u, "$2"))));
451
+ }
452
+ function zt(e) {
453
+ let t = E(e.family), n = e.weight ?? 400, r = e.style ?? "normal";
454
+ return n === 400 && r === "normal" ? t : `${t}:${n}:${r}`;
455
+ }
456
+ function Bt(e) {
457
+ return [...new Set(e.values())];
458
+ }
459
+ var Vt = class {
460
+ #e;
461
+ #t;
462
+ #n;
463
+ #r = 0;
464
+ #i = Promise.resolve();
465
+ #a;
466
+ #o;
467
+ constructor(e) {
468
+ if (!Number.isSafeInteger(e.slideCount) || e.slideCount < 0) throw TypeError("slideCount must be a non-negative safe integer");
469
+ this.#e = e.slideCount, this.#t = e.loadSlide, this.#n = new se({
470
+ maxEntries: e.maxCachedSlides,
471
+ maxWeight: e.maxCachedStructuralBytes,
472
+ measure: (e) => it(e).jsonBytes
473
+ });
474
+ }
475
+ get slideCount() {
476
+ return this.#e;
477
+ }
478
+ get usage() {
479
+ return this.#n.usage;
480
+ }
481
+ withSlide(e, t) {
482
+ this.#c(e);
483
+ let n = this.#r, r = this.#i.then(async () => {
484
+ if (n !== this.#r) throw this.#a ? this.#a : Error("PPTX slide repository generation is stale");
485
+ if (this.#a) throw this.#a;
486
+ let r = await this.#s(e, n);
487
+ try {
488
+ return await t(r);
489
+ } catch (e) {
490
+ let t = Ht(e);
491
+ throw t ? (this.#l(t, n), this.#o === n ? this.#a ?? t : t) : e;
492
+ }
493
+ });
494
+ return this.#i = r.then(() => void 0, () => void 0), r;
495
+ }
496
+ async #s(e, t) {
497
+ return this.#n.getOrLoad(e, async () => {
498
+ let n;
499
+ try {
500
+ n = await this.#t(e);
501
+ } catch (e) {
502
+ let n = Ht(e);
503
+ throw n ? (this.#l(n, t), this.#o === t ? this.#a ?? n : n) : e;
504
+ }
505
+ if (this.#o === t && this.#a) throw this.#a;
506
+ return n;
507
+ });
508
+ }
509
+ clear() {
510
+ this.#r += 1, this.#a = void 0, this.#o = void 0, this.#n.clear();
511
+ }
512
+ #c(e) {
513
+ if (!Number.isSafeInteger(e) || e < 0 || e >= this.#e) throw RangeError(`Slide index ${e} out of range (count: ${this.#e})`);
514
+ }
515
+ #l(e, t) {
516
+ t !== this.#r || this.#a || (this.#a = e, this.#o = t, this.#r += 1, this.#n.clear());
517
+ }
518
+ };
519
+ function Ht(e) {
520
+ return e instanceof g ? e : v(e);
521
+ }
522
+ function Ut(e, t) {
523
+ return e.filter((e) => !t.has(`${e.family.toLowerCase()}:${e.weight}:${e.style}`));
524
+ }
525
+ var Wt = 1;
526
+ function G(e) {
527
+ return e.trim().toLowerCase();
528
+ }
529
+ async function Gt(e, t) {
530
+ if (e.length === 0) return {
531
+ faces: [],
532
+ aliases: /* @__PURE__ */ new Map(),
533
+ authoredFamilies: /* @__PURE__ */ new Map(),
534
+ tuples: /* @__PURE__ */ new Set()
535
+ };
536
+ let n = Wt++, r = /* @__PURE__ */ new Map();
537
+ for (let t of e) {
538
+ let e = G(t.fontName);
539
+ r.has(e) || r.set(e, `__ooxml_pptx_${n}_${r.size + 1}`);
540
+ }
541
+ let i = [], a = /* @__PURE__ */ new Set();
542
+ try {
543
+ for (let n = 0; n < e.length; n += 2) {
544
+ let o = (await Promise.all(e.slice(n, n + 2).map(async (e) => {
545
+ try {
546
+ return {
547
+ family: r.get(G(e.fontName)),
548
+ bytes: await t(e.partPath),
549
+ odttf: !1,
550
+ weight: e.style === "bold" || e.style === "boldItalic" ? "bold" : "normal",
551
+ style: e.style === "italic" || e.style === "boldItalic" ? "italic" : "normal"
552
+ };
553
+ } catch (e) {
554
+ if (e instanceof g || M(e)) throw e;
555
+ let t = v(e);
556
+ if (t) throw t;
557
+ return null;
558
+ }
559
+ }))).filter((e) => e !== null);
560
+ if (o.length !== 0) for (let e of await pe(o)) a.has(e) ? k([e]) : (a.add(e), i.push(e));
561
+ }
562
+ } catch (e) {
563
+ throw k(i), e;
564
+ }
565
+ let o = new Set(i.map((e) => G(e.family))), s = new Map([...r].filter(([, e]) => o.has(G(e)))), c = new Map([...s].map(([e, t]) => [t, e]));
566
+ return {
567
+ faces: i,
568
+ aliases: s,
569
+ authoredFamilies: c,
570
+ tuples: new Set(i.map((e) => `${c.get(e.family)}:${e.weight === "bold" || e.weight === "700" ? 700 : 400}:${e.style === "italic" ? "italic" : "normal"}`))
571
+ };
572
+ }
573
+ function K(e, t) {
574
+ return e.filter((e) => e === null || !t.has(e.trim().toLowerCase()));
575
+ }
576
+ var Kt = "var e=Object.defineProperty,t=(e,t)=>()=>(e&&(t=e(e=0)),t),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r,i,a=t((()=>{r=class e extends Error{code;details;constructor(t,n,r){super(n),this.name=`OoxmlError`,this.code=t,t===`unsupported-content`&&r&&(this.details=Object.freeze({format:r.format,reason:r.reason})),Object.setPrototypeOf(this,e.prototype)}},i=class e extends Error{code=`ooxml-resource-limit`;details;constructor(t,n){super(t),this.name=`OoxmlResourceLimitError`;let r=n.violation,i=Object.freeze({format:r.format,operation:r.operation,resource:r.resource,metric:r.metric,...r.part===void 0?{}:{part:r.part},limit:r.limit,observed:r.observed,configurable:r.configurable,usage:Object.freeze({archiveEntryCount:r.usage.archiveEntryCount,declaredInflatedBytes:r.usage.declaredInflatedBytes,...r.usage.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:r.usage.largestInflatedEntryBytes},distinctInflatedBytes:r.usage.distinctInflatedBytes,operationInflatedBytes:r.usage.operationInflatedBytes})});this.details=Object.freeze({stage:n.stage,violation:i}),Object.setPrototypeOf(this,e.prototype)}}}));function o(e,t){return t!=null&&Object.hasOwn(e,t)?e[t]:void 0}var s=t((()=>{})),c,l,u,d,f,p=t((()=>{c=134217728,l=268435456,u=4096,d=67108864,f=67108864})),m,h,g,_,v=t((()=>{m=`https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;700&display=swap`,h=`https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;700&display=swap`,g=`https://fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap`,_={calibri:{url:`https://fonts.googleapis.com/css2?family=Carlito:ital,wght@0,400;0,700;1,400;1,700&display=swap`,loadFamily:`Carlito`},cambria:{url:`https://fonts.googleapis.com/css2?family=Caladea:ital,wght@0,400;0,700;1,400;1,700&display=swap`,loadFamily:`Caladea`},\"franklin gothic book\":{url:g,loadFamily:`Libre Franklin`},\"franklin gothic medium\":{url:g,loadFamily:`Libre Franklin`},\"nunito sans\":{url:`https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap`},nunito:{url:`https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,700;1,400;1,700&display=swap`},\"open sans\":{url:`https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap`},roboto:{url:`https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap`},lato:{url:`https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400;1,700&display=swap`},montserrat:{url:`https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,700;1,400;1,700&display=swap`},poppins:{url:`https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,700;1,400;1,700&display=swap`},raleway:{url:`https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,700;1,400;1,700&display=swap`},\"playfair display\":{url:`https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&display=swap`},ubuntu:{url:`https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,700;1,400;1,700&display=swap`},\"sakkal majalla\":{url:m,loadFamily:`Noto Naskh Arabic`,script:`arabic`},\"traditional arabic\":{url:m,loadFamily:`Noto Naskh Arabic`,script:`arabic`},\"simplified arabic\":{url:m,loadFamily:`Noto Naskh Arabic`,script:`arabic`},\"arabic typesetting\":{url:m,loadFamily:`Noto Naskh Arabic`,script:`arabic`},\"univers next arabic\":{url:h,loadFamily:`Noto Sans Arabic`,script:`arabic`},\"noto naskh arabic\":{url:m,loadFamily:`Noto Naskh Arabic`},\"noto sans arabic\":{url:h,loadFamily:`Noto Sans Arabic`}}}));function ee(e){return e?o(re,e.trim().toLowerCase())??null:null}function y(e){if(!e)return null;let t=ee(e)??e.trim(),n=t.toLowerCase(),r=n.match(/^noto\\s+(?:sans|serif)\\s+(?:cjk\\s+)?(sc|tc|hk|jp|kr)$/);return r?r[1]:/[ᄀ-ᇿ㄰-㆏가-힯]/.test(t)?`kr`:/[぀-ヿ]/.test(t)?`jp`:/jhenghei|微軟正黑|新細明|細明|pmingliu|mingliu|dfkai|標楷|華康|cns11643|kaiti tc|ming\\s*liu/.test(n)||/新細明體|細明體|標楷體|微軟正黑體|華康/.test(t)?`tc`:/simsun|nsimsun|simhei|simkai|simfang|yahei|dengxian|fangsong|kaiti|youyuan|lisu|stsong|stkaiti|stfangsong|stheiti|stxihei|stzhongsong|songti sc|heiti sc|微软雅黑/.test(n)||/宋体|黑体|楷体|仿宋|等线|微软雅黑|隶书|幼圆/.test(t)?`sc`:/malgun|batang|gulim|dotum|gungsuh|nanum|new gulim|hancom|hy(gothic|graphic|namu)?/.test(n)?`kr`:/\\bmeiryo\\b|\\byu\\s*(gothic|mincho)\\b|yugothic|yumincho|hiragino|\\bms\\s*(gothic|mincho|pgothic|pmincho|ui\\s*gothic)\\b|\\bms[pg]?(gothic|mincho)\\b|ipa(ex)?(gothic|mincho)|noto\\s+(sans|serif)\\s+jp|游ゴシック|游明朝|MS|メイリオ|ヒラギノ/.test(n)||/游ゴシック|游明朝|MS ゴシック|MS 明朝|MS Pゴシック|メイリオ|ヒラギノ/.test(t)?`jp`:null}function te(e){return/\\p{Script=Han}/u.test(e)}function ne(e,t,n=!1){let r=new se(t);return r.addText(e),r.names(n)}var re,b,ie,ae,oe,se,ce=t((()=>{s(),re={\"noto sans cjk sc\":`Noto Sans SC`,\"noto serif cjk sc\":`Noto Serif SC`,\"noto sans cjk tc\":`Noto Sans TC`,\"noto serif cjk tc\":`Noto Serif TC`,\"noto sans cjk jp\":`Noto Sans JP`,\"noto serif cjk jp\":`Noto Serif JP`,\"noto sans cjk kr\":`Noto Sans KR`,\"noto serif cjk kr\":`Noto Serif KR`,\"noto sans cjk hk\":`Noto Sans HK`},b=e=>`https://fonts.googleapis.com/css2?family=${e}:wght@400;700&display=swap`,ie={\"noto sans kr\":{url:b(`Noto+Sans+KR`)},\"noto sans sc\":{url:b(`Noto+Sans+SC`)},\"noto sans tc\":{url:b(`Noto+Sans+TC`)},\"noto sans hk\":{url:b(`Noto+Sans+HK`)},\"noto sans jp\":{url:b(`Noto+Sans+JP`)},\"noto serif kr\":{url:b(`Noto+Serif+KR`)},\"noto serif sc\":{url:b(`Noto+Serif+SC`)},\"noto serif tc\":{url:b(`Noto+Serif+TC`)},\"noto serif jp\":{url:b(`Noto+Serif+JP`)}},ae=Object.fromEntries(Object.entries(re).map(([e,t])=>[e,{...ie[t.toLowerCase()],loadFamily:t}])),oe={...ie,...ae,\"noto sans\":{url:b(`Noto+Sans`)},\"noto serif\":{url:b(`Noto+Serif`)},\"noto sans devanagari\":{url:b(`Noto+Sans+Devanagari`)},\"noto sans thai\":{url:b(`Noto+Sans+Thai`)},\"noto sans hebrew\":{url:b(`Noto+Sans+Hebrew`)},\"noto serif hebrew\":{url:b(`Noto+Serif+Hebrew`)}},se=class e{cjkLang;hasHan=!1;hasHangul=!1;hasKana=!1;hasArabic=!1;hasThai=!1;hasHebrew=!1;hasDevanagari=!1;hasCyrGreek=!1;constructor(e){this.cjkLang=e}scriptCjkLanguage(){return this.hasHangul?`kr`:this.hasKana?`jp`:null}preferredCjkLanguage(){return this.scriptCjkLanguage()??this.cjkLang??`jp`}clone(){let t=new e(this.cjkLang);return t.hasHan=this.hasHan,t.hasHangul=this.hasHangul,t.hasKana=this.hasKana,t.hasArabic=this.hasArabic,t.hasThai=this.hasThai,t.hasHebrew=this.hasHebrew,t.hasDevanagari=this.hasDevanagari,t.hasCyrGreek=this.hasCyrGreek,t}addText(e){let t=()=>this.hasHan&&this.hasHangul&&this.hasKana&&this.hasArabic&&this.hasThai&&this.hasHebrew&&this.hasDevanagari&&this.hasCyrGreek;outer:for(let n of e)if(n)for(let e of n){let n=e.codePointAt(0);if(n!==void 0&&!(n<=591)&&(n>=4352&&n<=4607||n>=12592&&n<=12687||n>=44032&&n<=55215?this.hasHangul=!0:n>=12352&&n<=12543?this.hasKana=!0:te(e)?this.hasHan=!0:n>=1536&&n<=1791||n>=1872&&n<=1919||n>=2208&&n<=2303||n>=64336&&n<=65023||n>=65136&&n<=65279?this.hasArabic=!0:n>=3584&&n<=3711?this.hasThai=!0:n>=1424&&n<=1535||n>=64285&&n<=64335?this.hasHebrew=!0:n>=2304&&n<=2431?this.hasDevanagari=!0:(n>=1024&&n<=1279||n>=880&&n<=1023)&&(this.hasCyrGreek=!0),t()))break outer}}names(e=!1){let t=[],n=new Set;this.hasHangul&&n.add(`kr`),this.hasKana&&n.add(`jp`),this.hasHan&&(n.size===0||e)&&n.add(this.cjkLang??`jp`);for(let e of[`kr`,`sc`,`tc`,`hk`,`jp`])if(n.has(e)){let n={kr:`KR`,sc:`SC`,tc:`TC`,hk:`HK`,jp:`JP`}[e];t.push(`Noto Sans ${n}`),e!==`hk`&&t.push(`Noto Serif ${n}`)}return this.hasCyrGreek&&t.push(`Noto Sans`,`Noto Serif`),this.hasArabic&&t.push(`Noto Naskh Arabic`,`Noto Sans Arabic`),this.hasThai&&t.push(`Noto Sans Thai`),this.hasHebrew&&t.push(`Noto Sans Hebrew`,`Noto Serif Hebrew`),this.hasDevanagari&&t.push(`Noto Sans Devanagari`),t}}}));function le(e){return e===`image-dimension`||e===`image-pixels`||e===`active-decoded-bytes`||e===`image-effect-count`||e===`image-effect-work`||e===`tiff-lzw-work`||e===`metafile-path-commands`||e===`metafile-record-points`||e===`metafile-record-polygons`||e===`metafile-record-rectangles`||e===`metafile-record-text-units`}function ue(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function de(e){if(!(!e||typeof e!=`object`))try{let t=e,n=t.code,r=t.metric,i=t.limit,a=t.observed;return n!==`ooxml-decoded-image-limit`||!le(r)||!ue(i)||!ue(a)||a<=i?void 0:{metric:r,limit:i,observed:a}}catch{return}}var fe,pe,me,he,ge,_e=t((()=>{fe=1<<25,pe=1<<27,fe*4,pe*4,me=Math.floor(fe/4),he=pe,he/me,ge=class e extends RangeError{metric;limit;observed;code=`ooxml-decoded-image-limit`;constructor(t,n,r){super(`OOXML decoded image limit exceeded: ${t} ${r} > ${n}`),this.metric=t,this.limit=n,this.observed=r,this.name=`OoxmlDecodedImageLimitError`,Object.setPrototypeOf(this,e.prototype)}}}));function ve(e){return ye.test(e)}var ye,be=t((()=>{ye=/[\\u0590-\\u08FF\\uFB1D-\\uFDFF\\uFE70-\\uFEFF\\u200F\\u202B\\u202E\\u2067]|[\\u{10800}-\\u{10FFF}\\u{1E800}-\\u{1EFFF}]/u}));function xe(e){if(!(typeof e!=`object`||!e))try{let t=e,n=t.code,r=t.message;return n===`ooxml-tiff-decode`&&typeof r==`string`?{message:r}:void 0}catch{return}}var Se,Ce=t((()=>{Se=class e extends Error{code=`ooxml-tiff-decode`;constructor(t,n){super(t,n),this.name=`TiffDecodeError`,Object.setPrototypeOf(this,e.prototype)}}}));function we(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}var Te=t((()=>{}));function Ee(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function De(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return Ee(t.requiredBytes)&&Ee(t.offeredBytes)&&t.requiredBytes>t.offeredBytes}function Oe(e){if(e instanceof x)return e;let t=e instanceof Error?e.message:String(e);if(!t.startsWith(je))return;let n;try{n=JSON.parse(t.slice(26))}catch{return}if(!n||typeof n!=`object`||Array.isArray(n))return;let r=n;if(!(r.code!==`ooxml-insufficient-credit`||!De(r)))return new x(r)}function ke(e,t,n){let r=Oe(e);if(!(!r||r.offeredBytes!==t||r.requiredBytes>n))return r}var Ae,je,x,Me=t((()=>{Ae=`ooxml-insufficient-credit`,je=`OOXML_INSUFFICIENT_CREDIT:`,x=class e extends RangeError{code=Ae;requiredBytes;offeredBytes;constructor(t){super(`Pull unit requires ${t.requiredBytes} bytes but credit is ${t.offeredBytes}`),this.name=`PullSessionInsufficientCreditError`,this.requiredBytes=t.requiredBytes,this.offeredBytes=t.offeredBytes,Object.setPrototypeOf(this,e.prototype)}}}));function S(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function Ne(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return S(t.archiveEntryCount)&&S(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||S(t.largestInflatedEntryBytes))&&S(t.distinctInflatedBytes)&&S(t.operationInflatedBytes)}function Pe(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{throw TypeError(`OOXML resource usage checkpoint is not valid JSON`)}if(!Ne(t))throw TypeError(`OOXML resource usage checkpoint is invalid`);return t}function Fe(e){return e===`docx`||e===`xlsx`||e===`pptx`}function Ie(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function C(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function w(e){return C(e,D)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function Le(e){return!C(e,rt)||e.startsWith(`/`)||e.startsWith(`\\\\`)||e.includes(`\\\\`)||e.includes(`?`)||e.includes(`#`)||e.includes(`://`)||/^[a-z]:/iu.test(e)?!1:e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)}function Re(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!Fe(t.format)||!C(t.operation,nt)||!w(t.resource)||!w(t.metric)||!S(t.limit)||!S(t.observed)||typeof t.configurable!=`boolean`||!Ne(t.usage)?!1:!(`part`in t)||Le(t.part)}function T(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!Ie(t.stage)||!Re(t.violation))return!1;let n=t.violation,r=it.get(`${n.resource}:${n.metric}`);return r?t.stage!==r.stage||r.configurable===!1&&n.configurable!==!1?!1:r.part===`required`?n.part!==void 0:r.part===`forbidden`?n.part===void 0:!0:!(at.has(n.resource)&&ot.has(n.metric))}function ze(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function Be(e){if(!T(e))return;let t=e.violation,n={stage:e.stage,violation:{format:t.format,operation:t.operation,resource:t.resource,metric:t.metric,...t.part===void 0?{}:{part:t.part},limit:t.limit,observed:t.observed,configurable:t.configurable,usage:ze(t.usage)}};return T(n)?n:void 0}function Ve(e){let t=e.violation;return`OOXML resource limit exceeded${t.part?` for ${t.part}`:``} (${t.resource}, ${e.stage}): ${t.metric} ${t.observed} > ${t.limit}`}function He(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(et))return;let n;try{n=JSON.parse(t.slice(21))}catch{return}if(!n||typeof n!=`object`)return;let r=n;if(!(r.code!==`ooxml-resource-limit`||!T(r.details)))return new i(Ve(r.details),r.details)}function Ue(e){try{return e()}catch(e){throw e instanceof i||typeof e!=`string`&&!(e instanceof Error)?e:He(e)??e}}function We(e){let t=e instanceof Error?e.message:String(e);if(t.startsWith(tt))return new r(`not-ooxml`,`This file is not an Office Open XML document: ${t.slice(16)}`)}function Ge(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=t.format,r=t.reason;if(!(!w(n)||r!==`source-subset`))return{format:n,reason:r}}function Ke(e){return new r(`unsupported-content`,`Input is outside the source’s supported subset.`,e)}function qe(e){let t=typeof e==`string`?e:e instanceof Error?e.message:``;if(!(!t.startsWith(`MODEL_SOURCE_UNSUPPORTED:`)||t.length>1024))try{let e=Ge(JSON.parse(t.slice(25)));return e?Ke(e):void 0}catch{return}}function Je(e){return e===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`||e instanceof Error&&e.message===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`?new r(`unsupported-encryption`,`The configured source cannot decrypt this input.`):qe(e)??He(e)??We(e)}function Ye(e){let t=de(e);if(t){let e=new ge(t.metric,t.limit,t.observed);return{message:e.message,errorName:e.name,code:e.code,decodedImage:t}}let n=xe(e);if(n)return{message:n.message,errorName:`TiffDecodeError`,code:`ooxml-tiff-decode`};let a=Oe(e);if(a)return{message:a.message,errorName:a.name,code:a.code,insufficientCredit:{requiredBytes:a.requiredBytes,offeredBytes:a.offeredBytes}};let o=e instanceof r||e instanceof i?e:Je(e),s=o??e;if(o instanceof i||s&&typeof s==`object`&&s.code===`ooxml-resource-limit`){let e=s,t=Be(e.details);return t?{message:typeof e.message==`string`?e.message:Ve(t),errorName:`OoxmlResourceLimitError`,code:`ooxml-resource-limit`,resourceLimit:t}:{message:`Invalid OOXML resource-limit error payload`,errorName:`Error`}}if(s&&typeof s==`object`&&s.code===`unsupported-content`){let e=Ge(s.details);return e?{message:Ke(e).message,code:`unsupported-content`,unsupportedContent:e}:{message:`Invalid unsupported-content error payload`,errorName:`Error`}}if(o instanceof r)return{message:typeof o.message==`string`?o.message:String(o.message),errorName:C(o.name,D)?o.name:`OoxmlError`,...w(o.code)?{code:o.code}:{}};let c=e instanceof Error?e.message:String(e);if(typeof c==`string`&&c.startsWith(et))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let l=e instanceof Error?e:Error(c),u=l;return{message:typeof l.message==`string`?l.message:String(l.message),errorName:C(l.name,D)?l.name:`Error`,...typeof u.code==`string`?{code:u.code}:{}}}function E(e){try{return Ye(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}function Xe(e){return typeof e==`string`&&Object.prototype.hasOwnProperty.call(ct,e)}function Ze(e,t){if(e!==`ooxml-decoded-image-limit`||!t||typeof t!=`object`)return;let n=t,r=n.metric,i=n.limit,a=n.observed;if(!(!Xe(r)||!S(i)||!S(a)||a<=i))return{metric:r,limit:i,observed:a}}function Qe(e){let t=e.message,n=e.errorName,a=e.code,o=e.decodedImage,s=e.insufficientCredit,c=e.resourceLimit,l=e.unsupportedContent,u=typeof t==`string`?t:`Worker operation failed with an invalid error payload`,d=C(n,D)?n:void 0,f=typeof a==`string`?a:void 0;if(f===`unsupported-content`){let e=Ge(l);return e?Ke(e):Error(`Invalid unsupported-content error payload`)}let p=Ze(f,o);if(p)return new ge(p.metric,p.limit,p.observed);if(f===`ooxml-tiff-decode`)return new Se(u);if(f===`ooxml-insufficient-credit`&&De(s))return new x(s);if(f===`ooxml-resource-limit`&&T(c))return new i(u,c);if(f&&st.has(f))return new r(f,u);let m=d===`TypeError`?TypeError(u):d===`RangeError`?RangeError(u):Error(u);return d&&(m.name=d),f!==void 0&&Object.assign(m,{code:f}),m}function $e(e){try{return Qe(e)}catch{return Error(`Worker operation failed with an unreadable error payload`)}}var et,tt,D,nt,rt,it,at,ot,st,ct,lt=t((()=>{a(),_e(),Ce(),Me(),et=`OOXML_RESOURCE_LIMIT:`,tt=`OOXML_NOT_OOXML:`,D=128,nt=256,rt=4096,it=new Map([[`archive-entry:declared-inflated-bytes`,{stage:`container`,part:`required`}],[`archive-entry:actual-inflated-bytes`,{stage:`decompression`,part:`required`}],[`archive:entry-count`,{stage:`container`,part:`forbidden`}],[`archive:central-directory-bytes`,{stage:`container`,part:`forbidden`,configurable:!1}],[`archive:distinct-inflated-bytes`,{stage:`decompression`,part:`required`}],[`xml-event:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-context:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`image-effect:work`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chartex-allocation:elements`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chartex-allocation:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chart-cache:points`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`numbering-marker:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chart-style-formats:entries`,{stage:`parsing`,part:`required`,configurable:!1}],[`chart-custom-number-formats:entries`,{stage:`parsing`,part:`required`,configurable:!1}],[`chart-number-format-bytes:bytes`,{stage:`parsing`,part:`required`,configurable:!1}],[`xml-tree:depth`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-row:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-shell:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`theme-style-reparse:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`style-inheritance:depth`,{stage:`parsing`,part:`required`,configurable:!1}],[`complex-field:depth`,{stage:`parsing`,part:`forbidden`,configurable:!1}]]),at=new Set([...it.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),ot=new Set([...it.keys()].map(e=>e.slice(e.indexOf(`:`)+1))),st=new Set([`encrypted`,`invalid-password`,`unsupported-encryption`,`legacy-binary-format`,`not-ooxml`,`invalid-numbering`,`unsupported-image-effect`]),ct={\"image-dimension\":!0,\"image-pixels\":!0,\"active-decoded-bytes\":!0,\"image-effect-count\":!0,\"image-effect-work\":!0,\"tiff-lzw-work\":!0,\"metafile-path-commands\":!0,\"metafile-record-points\":!0,\"metafile-record-polygons\":!0,\"metafile-record-rectangles\":!0,\"metafile-record-text-units\":!0}})),ut,dt=t((()=>{ut=class{initialize;reinitialize;normalizeFailure;state=`uninitialized`;generationValue=0;readiness;poisonListeners=new Set;constructor(e,t,n){this.initialize=e,this.reinitialize=t,this.normalizeFailure=n}get generation(){return this.generationValue}get poisoned(){return this.state===`poisoned`}onPoison(e){return this.poisonListeners.add(e),()=>this.poisonListeners.delete(e)}async ensureReady(){if(this.state!==`ready`){if(!this.readiness){let e=this.state===`uninitialized`?this.initialize:this.reinitialize;this.readiness=Promise.resolve().then(e).then(()=>{this.generationValue+=1,this.state=`ready`,this.readiness=void 0},e=>{throw this.readiness=void 0,e})}await this.readiness}}run(e){try{return e()}catch(e){let t=this.normalizeFailure(e);throw t?(this.poison(t),t):e}}tryRunReady(e){if(this.state!==`ready`)return{current:!1};let t=this.generationValue,n=this.run(e);return this.state!==`ready`||t!==this.generationValue?{current:!1}:{current:!0,generation:t,value:n}}poison(e){this.state=`poisoned`,this.readiness=void 0;for(let t of this.poisonListeners)t(e)}assertCurrent(e){if(this.state!==`ready`||e!==this.generationValue)throw Error(`WASM archive session belongs to a discarded runtime generation`)}}}));function ft(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function pt(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}function mt(e,t){return e({module_or_path:t})}function ht(e){return ft(e)?new gt(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`):null}var gt,_t,vt=t((()=>{lt(),dt(),gt=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}},_t=class{init;options;runtime;wasmInput=null;currentArchive=null;constructor(e,t={}){this.init=e,this.options=t,this.runtime=new ut(()=>this.invokeConfigured(this.init),()=>this.invokeConfigured(this.options.reinit??this.init),ht),this.runtime.onPoison(()=>this.dropPoisonedArchive())}setWasmInput(e){this.wasmInput=e,this.runtime.ensureReady().catch(()=>void 0)}setWasmUrl(e){this.setWasmInput(e)}get archive(){return this.currentArchive}setArchive(e){this.freeArchive(),this.currentArchive=e}disposeArchive(){this.freeArchive()}get poisoned(){return this.runtime.poisoned}async ensureReady(){await this.runtime.ensureReady()}run(e){return Ue(()=>this.runtime.run(e))}poison(){this.runtime.poison(new gt(`WASM parser was recycled`))}invokeConfigured(e){return this.wasmInput===null?Promise.reject(Error(`WasmParserHost: setWasmInput was never called`)):mt(e,this.wasmInput)}freeArchive(){this.currentArchive!==null&&this.options.freeArchive&&this.options.freeArchive(this.currentArchive),this.currentArchive=null}dropPoisonedArchive(){let e=this.currentArchive;this.currentArchive=null,pt(e)}}}));function yt(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer instanceof ArrayBuffer?e.buffer:e.slice().buffer}var bt=t((()=>{}));function xt(e){return[e.maxArchiveEntryBytes===null?0n:BigInt(e.maxArchiveEntryBytes),e.maxTotalInflatedBytes===null?0n:BigInt(e.maxTotalInflatedBytes),e.maxArchiveEntries===null?0n:BigInt(e.maxArchiveEntries)]}var St=t((()=>{p(),Object.freeze({maxArchiveEntryBytes:c,maxTotalInflatedBytes:l,maxArchiveEntries:u})}));function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} must be a positive safe integer`)}function Ct(e){if(!(typeof e==`string`&&e.length>0||typeof e==`number`&&Number.isSafeInteger(e)&&e>0))throw RangeError(`session id must be a non-empty string or positive safe integer`)}var k,wt,Tt,Et=t((()=>{lt(),Me(),k=`ooxml-pull-v1`,wt=class{owner;queue=Promise.resolve();leases=new Map;retainedBytes=0;retainedCount=0;maxRetainedBytes;maxRetainedCount;cleanups=new Set;pendingFatalCleanups=[];poisonRunning=!1;fatal;constructor(e){this.maxRetainedBytes=e?.maxRetainedBytes??64*1024*1024,this.maxRetainedCount=e?.maxRetainedCount??256,O(this.maxRetainedBytes,`max retained lease bytes`),O(this.maxRetainedCount,`max retained lease count`)}enqueue(e){let t=this.queue.then(e,e);return this.queue=t.then(()=>void 0,()=>void 0),t}acquire(e){return this.owner===void 0?(this.owner=e,!0):this.owner===e}release(e){this.owner===e&&(this.owner=void 0)}retainLease(e,t,n){if(!Number.isSafeInteger(n)||n<0)throw RangeError(`retained lease bytes are invalid`);let r=this.leases.get(e)??new Map;if(r.has(t))throw Error(`driver returned a duplicate lease id`);if(this.retainedCount+1>this.maxRetainedCount)throw RangeError(`retained lease count exceeds limit`);if(this.retainedBytes+n>this.maxRetainedBytes)throw RangeError(`retained lease bytes exceed limit`);r.set(t,n),this.leases.set(e,r),this.retainedCount++,this.retainedBytes+=n}releaseLease(e,t){let n=this.leases.get(e),r=n?.get(t);r!==void 0&&(n?.delete(t),n?.size===0&&this.leases.delete(e),this.retainedCount--,this.retainedBytes-=r)}registerCleanup(e){return this.fatal?(this.poisonRunning?this.pendingFatalCleanups.push(e):this.enqueue(e).catch(()=>void 0),()=>void 0):(this.cleanups.add(e),()=>this.cleanups.delete(e))}get fatalError(){return this.fatal}get registeredHostCount(){return this.cleanups.size}async poison(e){if(this.fatal??=e,this.poisonRunning)return this.fatal;this.poisonRunning=!0,this.pendingFatalCleanups.push(...this.cleanups);try{let e;for(;(e=this.pendingFatalCleanups.shift())!==void 0;)await e().catch(()=>void 0)}finally{this.poisonRunning=!1}return this.fatal}},Tt=class{options;coordinator;coordinatorOwner=Symbol(`pull-session-host`);unregisterCleanup;sequence=0;unacked;leases=new Map;activeDriverLeases=new Set;nextWireLeaseId;cancelRequested=!1;cancelComplete=!1;closeRequested=!1;closeComplete=!1;driverCancelComplete=!1;driverCloseComplete=!1;completed=!1;constructor(e){Ct(e.sessionId),O(e.operationId,`operation id`),O(e.generation,`generation`),O(e.maxByteCredit,`max byte credit`),e.wireLeaseIdStart!==void 0&&O(e.wireLeaseIdStart,`wire lease id start`),this.options=e,this.coordinator=e.coordinator,this.nextWireLeaseId=e.wireLeaseIdStart??1,this.unregisterCleanup=this.coordinator.registerCleanup(()=>this.forceFatalCleanup())}dispatch(e,t){return this.coordinator.enqueue(async()=>{let n=await this.execute(e);try{t(n.response,n.transfer)}catch(e){throw await this.rollbackFailedPost(n),e}})}async rollbackFailedPost(e){let t=e.response;if(t.kind===`chunk`){let n=t.leaseId===void 0?void 0:this.leases.get(t.leaseId);try{await this.options.driver.disposeInvalidChunk?.({payload:t.payload,byteLength:t.byteLength,done:t.done,leaseId:n?.driverLeaseId,retainedBytes:n?.retainedBytes,transfer:e.transfer})}catch{}}this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);for(let[e,t]of[...this.leases])try{await this.options.driver.releaseLease?.(t.driverLeaseId)}catch{}finally{this.leases.delete(e),this.activeDriverLeases.delete(t.driverLeaseId),this.coordinator.releaseLease(this.coordinatorOwner,e)}if(this.cancelRequested=!0,!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch{}this.unregisterCleanup()}async execute(e){try{if(this.isStaleLifecycle(e)){let t=e.kind===`cancel`?`cancel`:`close`;return this.sameOperationIdentity(e)?{response:this.accepted(e,t,!0)}:{response:this.errorResponse(e,{message:`stale lifecycle targets another session or operation`,errorName:`PullSessionProtocolError`,code:`ooxml-stale-lifecycle`})}}this.validateCommandIdentity(e);let t=this.coordinator.fatalError;if(t)return e.kind===`pull`?{response:this.errorResponse(e,t)}:(e.kind===`cancel`?await this.cancel():e.kind===`close`?await this.close():e.kind===`release`&&await this.release(e.leaseId),{response:this.accepted(e,e.kind)});switch(e.kind){case`pull`:return await this.pull(e);case`ack`:return await this.ack(e.sequence),{response:this.accepted(e,`ack`)};case`release`:return await this.release(e.leaseId),{response:this.accepted(e,`release`)};case`cancel`:return await this.cancel(),{response:this.accepted(e,`cancel`)};case`close`:return await this.close(),{response:this.accepted(e,`close`)}}}catch(t){let n=E(t);return n.code===`ooxml-resource-limit`&&(n=await this.coordinator.poison(n)),{response:this.errorResponse(e,n)}}}async pull(e){if(this.closeRequested||this.cancelRequested||this.completed)throw Error(`pull session is closed`);if(this.unacked)throw Error(`previous chunk is not acknowledged`);if(!Number.isSafeInteger(e.sequence)||e.sequence<0||e.sequence!==this.sequence)throw Error(`pull command sequence mismatch`);if(this.validateHostCredit(e.byteCredit),!this.coordinator.acquire(this.coordinatorOwner))throw Error(`another operation has an unacknowledged package chunk`);let t;try{t=await this.options.driver.pull(e.byteCredit)}catch(e){throw this.coordinator.release(this.coordinatorOwner),e}let n=!1,r=!1,i,a;try{let o=this.options.driver.measureChunk(t),s=this.arrayBufferTransferBytes(t.transfer);if(o<s)throw RangeError(`measured chunk bytes are below ArrayBuffer transfer bytes`);if(a=Math.max(o,s),t.leaseId!==void 0){if(O(t.leaseId,`lease id`),t.retainedBytes===void 0)throw Error(`retained lease bytes are required`);if(this.activeDriverLeases.has(t.leaseId))throw r=!0,Error(`driver returned an active duplicate lease id`);i=this.allocateWireLeaseId(),this.coordinator.retainLease(this.coordinatorOwner,i,t.retainedBytes),this.leases.set(i,{driverLeaseId:t.leaseId,retainedBytes:t.retainedBytes}),this.activeDriverLeases.add(t.leaseId),n=!0}else if(t.retainedBytes!==void 0)throw Error(`retained lease bytes require a lease id`);if(!Number.isSafeInteger(a)||a<0)throw RangeError(`host chunk byte length must be a non-negative safe integer`);if(a>e.byteCredit)throw RangeError(`host chunk exceeds byte credit`)}catch(e){let a;try{await this.options.driver.disposeInvalidChunk?.(t)}catch(e){a=e}if(n&&i!==void 0)try{await this.release(i)}catch(e){a??=e}else if(t.leaseId!==void 0&&!r)try{await this.options.driver.releaseLease?.(t.leaseId)}catch(e){a??=e}if(r)try{await this.cancel()}catch(e){a??=e}throw this.coordinator.release(this.coordinatorOwner),a||e}return this.unacked={sequence:this.sequence,done:t.done},{response:{kind:`chunk`,protocol:k,...this.identity(),requestId:e.requestId,sequence:this.sequence,byteLength:a,done:t.done,payload:t.payload,leaseId:i,usage:this.resourceUsage()},transfer:t.transfer}}async ack(e){if(!Number.isSafeInteger(e)||e<0)throw RangeError(`invalid ack sequence`);if(e<this.sequence)return;if(!this.unacked||e!==this.sequence)throw Error(`ack sequence mismatch`);let t=this.unacked.done;await this.options.driver.acknowledge?.(e),this.unacked=void 0,this.coordinator.release(this.coordinatorOwner),this.sequence++,t&&(this.completed=!0,this.maybeUnregisterCompleted())}async release(e){O(e,`wire lease id`);let t=this.leases.get(e);t&&(await this.options.driver.releaseLease?.(t.driverLeaseId),this.leases.delete(e),this.activeDriverLeases.delete(t.driverLeaseId),this.coordinator.releaseLease(this.coordinatorOwner,e),this.maybeUnregisterCompleted())}async cancel(){if(this.cancelComplete)return;this.cancelRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;try{await this.releaseAllLeases()}catch(t){e=t}if(!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch(t){e??=t}if(e)throw e;this.cancelComplete=!0,this.unregisterCleanup()}async close(){if(this.closeComplete)return;this.closeRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;try{await this.releaseAllLeases()}catch(t){e=t}if(!this.driverCloseComplete)try{await this.options.driver.close?.(),this.driverCloseComplete=!0}catch(t){e??=t}if(e)throw e;this.closeComplete=!0,this.unregisterCleanup()}async releaseAllLeases(){let e;for(let t of[...this.leases.keys()])try{await this.release(t)}catch(t){e??=t}if(e)throw e}validateCommandIdentity(e){if(e.protocol!==`ooxml-pull-v1`||e.sessionId!==this.options.sessionId||e.operationId!==this.options.operationId||e.generation!==this.options.generation||!Number.isSafeInteger(e.requestId)||e.requestId<=0)throw Error(`stale or mismatched pull session command`)}validateHostCredit(e){if(O(e,`byte credit`),e>this.options.maxByteCredit)throw RangeError(`byte credit exceeds host maximum`)}accepted(e,t,n=!1){return{kind:`accepted`,protocol:k,...n?{sessionId:e.sessionId,operationId:e.operationId,generation:e.generation}:this.identity(),requestId:e.requestId,command:t,usage:this.resourceUsage()}}identity(){return{sessionId:this.options.sessionId,operationId:this.options.operationId,generation:this.options.generation}}isStaleLifecycle(e){return(e.kind===`cancel`||e.kind===`close`)&&e.protocol===`ooxml-pull-v1`&&Number.isSafeInteger(e.requestId)&&e.requestId>0&&Number.isSafeInteger(e.generation)&&e.generation>0&&e.generation<this.options.generation}sameOperationIdentity(e){return e.sessionId===this.options.sessionId&&e.operationId===this.options.operationId}errorResponse(e,t){return{kind:`error`,protocol:k,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:t,usage:this.errorResourceUsage()}}async forceFatalCleanup(){this.cancelRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;for(let t of[...this.leases.keys()])try{await this.release(t)}catch(t){e??=t}if(!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch(t){e??=t}if(e)throw e;this.unregisterCleanup()}allocateWireLeaseId(){if(!Number.isSafeInteger(this.nextWireLeaseId)||this.nextWireLeaseId<=0)throw RangeError(`wire lease id space exhausted`);return this.nextWireLeaseId++}arrayBufferTransferBytes(e){let t=0;for(let n of e??[])if(n instanceof ArrayBuffer&&(t+=n.byteLength,!Number.isSafeInteger(t)))throw RangeError(`ArrayBuffer transfer bytes overflow`);return t}maybeUnregisterCompleted(){this.completed&&this.leases.size===0&&this.unregisterCleanup()}resourceUsage(){return this.options.driver.resourceUsage?.()}errorResourceUsage(){try{return this.resourceUsage()}catch{return}}}})),A=t((()=>{Te(),a(),vt(),lt(),Me(),bt(),_e(),Ce(),s(),v(),ce(),be(),St(),p(),Et()})),Dt=t((()=>{be()})),j=t((()=>{a(),s(),p(),v(),ce(),_e(),be(),Ce(),A(),Dt()})),Ot=t((()=>{}));function kt(){return At??=[0,191,198,198,208,208,215,216,222,223,230,230,240,240,247,248,254,254,272,273,294,295,305,307,312,312,319,322,329,331,338,339,358,359,383,415,418,430,433,460,477,477,484,485,497,499,502,503,540,541,544,549,564,767,847,847,880,883,885,887,890,893,895,895,900,900,913,929,931,937,945,969,975,978,981,1023,1026,1026,1028,1030,1032,1035,1039,1048,1050,1080,1082,1103,1106,1106,1108,1110,1112,1115,1119,1141,1144,1154,1160,1216,1219,1231,1236,1237,1240,1241,1248,1249,1256,1257,1270,1271,1274,1327,1329,1366,1369,1418,1421,1423,1470,1470,1472,1472,1475,1475,1478,1478,1488,1514,1519,1524,1536,1551,1563,1569,1575,1610,1632,1647,1649,1727,1729,1729,1731,1746,1748,1749,1757,1758,1765,1766,1769,1769,1774,1805,1807,1808,1810,1839,1869,1969,1984,2026,2036,2042,2046,2069,2074,2074,2084,2084,2088,2088,2096,2110,2112,2136,2142,2142,2144,2154,2160,2193,2208,2249,2274,2274,2304,2344,2346,2352,2354,2355,2357,2363,2365,2380,2382,2384,2389,2391,2400,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2495,2500,2503,2504,2510,2510,2528,2531,2534,2557,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2610,2613,2613,2616,2617,2622,2626,2631,2632,2635,2636,2641,2641,2652,2652,2662,2678,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2757,2759,2761,2763,2764,2768,2768,2784,2787,2790,2801,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2879,2884,2887,2887,2901,2901,2911,2915,2918,2935,2946,2947,2949,2954,2958,2960,2962,2963,2965,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3007,3010,3014,3016,3024,3024,3046,3066,3072,3084,3086,3088,3090,3112,3114,3129,3133,3140,3142,3143,3146,3148,3160,3162,3164,3165,3168,3171,3174,3183,3191,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3263,3265,3265,3267,3268,3270,3270,3276,3276,3292,3294,3296,3299,3302,3311,3313,3315,3328,3340,3342,3344,3346,3386,3389,3389,3391,3396,3398,3400,3406,3407,3412,3414,3416,3427,3430,3455,3457,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3536,3540,3542,3542,3544,3545,3547,3547,3558,3567,3570,3572,3585,3639,3647,3655,3660,3675,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3767,3771,3773,3776,3780,3782,3782,3788,3790,3792,3801,3804,3807,3840,3863,3866,3892,3894,3894,3896,3896,3898,3906,3908,3911,3913,3916,3918,3921,3923,3926,3928,3931,3933,3944,3946,3948,3959,3959,3961,3961,3966,3967,3973,3973,3976,3986,3988,3991,3993,3996,3998,4001,4003,4006,4008,4011,4013,4020,4022,4022,4024,4024,4026,4028,4030,4037,4039,4044,4046,4058,4096,4133,4135,4141,4143,4150,4152,4152,4155,4236,4238,4293,4295,4295,4301,4301,4304,4351,4371,4448,4470,4519,4547,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4960,4988,4992,5017,5024,5109,5112,5117,5120,5788,5792,5880,5888,5907,5919,5939,5941,5942,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6097,6099,6108,6112,6121,6128,6137,6144,6169,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6432,6443,6448,6456,6464,6464,6468,6509,6512,6516,6528,6571,6576,6601,6608,6618,6622,6678,6681,6683,6686,6750,6753,6772,6784,6793,6800,6809,6816,6829,6846,6846,6912,6917,6919,6919,6921,6921,6923,6923,6925,6925,6927,6929,6931,6963,6966,6970,6972,6972,6974,6975,6978,6978,6981,6988,6990,7018,7028,7081,7084,7141,7143,7153,7164,7222,7227,7241,7245,7306,7312,7354,7357,7367,7379,7379,7393,7393,7401,7404,7406,7411,7413,7415,7418,7418,7424,7615,7834,7834,7836,7839,7930,7935,8125,8125,8127,8128,8190,8190,8194,8292,8294,8305,8308,8334,8336,8348,8352,8385,8413,8416,8418,8420,8448,8485,8487,8489,8492,8587,8592,8601,8604,8621,8623,8652,8656,8707,8709,8712,8714,8715,8717,8739,8741,8741,8743,8768,8770,8771,8773,8774,8776,8776,8778,8799,8801,8801,8803,8812,8818,8819,8822,8823,8826,8831,8834,8835,8838,8839,8842,8875,8880,8927,8932,8937,8942,9e3,9003,9257,9280,9290,9312,10971,10973,11123,11126,11502,11506,11507,11513,11557,11559,11559,11565,11565,11568,11623,11631,11632,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11776,11869,11904,11929,11931,12019,12032,12245,12272,12329,12336,12351,12353,12363,12365,12365,12367,12367,12369,12369,12371,12371,12373,12373,12375,12375,12377,12377,12379,12379,12381,12381,12383,12383,12385,12385,12387,12388,12390,12390,12392,12392,12394,12399,12402,12402,12405,12405,12408,12408,12411,12411,12414,12435,12437,12438,12443,12445,12447,12459,12461,12461,12463,12463,12465,12465,12467,12467,12469,12469,12471,12471,12473,12473,12475,12475,12477,12477,12479,12479,12481,12481,12483,12484,12486,12486,12488,12488,12490,12495,12498,12498,12501,12501,12504,12504,12507,12507,12510,12531,12533,12534,12539,12541,12543,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,42124,42128,42182,42192,42539,42560,42606,42608,42611,42622,42653,42656,42735,42738,42743,42752,42972,42993,43013,43015,43051,43056,43065,43072,43127,43136,43203,43205,43205,43214,43225,43250,43306,43310,43346,43359,43388,43392,43442,43444,43455,43457,43469,43471,43481,43486,43518,43520,43574,43584,43597,43600,43609,43612,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43765,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43883,43888,44012,44016,44025,55216,55238,55243,55291,57344,63743,64014,64015,64017,64017,64019,64020,64031,64031,64033,64033,64035,64036,64039,64041,64256,64262,64275,64279,64288,64297,64335,64975,65008,65049,65072,65106,65108,65126,65128,65131,65136,65140,65142,65276,65279,65279,65281,65470,65474,65479,65482,65487,65490,65495,65498,65500,65504,65510,65512,65518,65529,65533,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65792,65794,65799,65843,65847,65934,65936,65948,65952,65952,66e3,66044,66176,66204,66208,66256,66273,66299,66304,66339,66349,66378,66384,66421,66432,66461,66463,66499,66504,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,66927,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67008,67016,67018,67043,67045,67059,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67671,67742,67751,67759,67808,67826,67828,67829,67835,67867,67871,67897,67903,67929,67968,68023,68028,68047,68050,68099,68101,68102,68108,68108,68110,68110,68112,68115,68117,68119,68121,68149,68160,68168,68176,68184,68192,68255,68288,68324,68331,68342,68352,68405,68409,68437,68440,68466,68472,68497,68505,68508,68521,68527,68608,68680,68736,68786,68800,68850,68858,68899,68912,68921,68928,68965,68974,68997,69006,69007,69216,69246,69248,69289,69293,69293,69296,69297,69314,69319,69328,69336,69372,69372,69376,69415,69424,69445,69457,69465,69488,69505,69510,69513,69552,69579,69600,69622,69632,69701,69703,69709,69714,69743,69745,69749,69760,69785,69787,69787,69789,69802,69804,69816,69819,69826,69837,69837,69840,69864,69872,69881,69891,69926,69928,69933,69936,69938,69942,69959,69968,70002,70004,70006,70016,70079,70081,70089,70091,70111,70113,70132,70144,70161,70163,70196,70199,70209,70272,70278,70280,70280,70282,70285,70287,70301,70303,70313,70320,70376,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70463,70468,70471,70472,70480,70480,70493,70499,70528,70530,70532,70532,70534,70537,70539,70539,70544,70544,70546,70581,70583,70583,70585,70586,70588,70592,70602,70602,70604,70605,70609,70613,70615,70616,70625,70626,70656,70721,70723,70725,70727,70747,70749,70749,70751,70753,70784,70831,70833,70841,70847,70849,70852,70855,70864,70873,71040,71086,71088,71093,71096,71097,71100,71102,71105,71133,71168,71230,71232,71236,71248,71257,71264,71276,71296,71349,71352,71353,71360,71369,71376,71395,71424,71450,71453,71466,71472,71494,71680,71736,71739,71739,71840,71922,71935,71942,71945,71945,71948,71955,71957,71958,71960,71983,71985,71989,71991,71991,71995,71996,71999,72002,72004,72006,72016,72025,72096,72103,72106,72151,72154,72159,72161,72164,72192,72243,72245,72262,72272,72344,72346,72354,72368,72440,72448,72457,72544,72551,72640,72673,72688,72697,72704,72712,72714,72758,72760,72766,72768,72773,72784,72812,72816,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73025,73027,73027,73030,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73110,73112,73112,73120,73129,73136,73179,73184,73193,73440,73464,73472,73488,73490,73530,73534,73536,73539,73562,73648,73648,73664,73713,73727,74649,74752,74862,74864,74868,74880,75075,77712,77810,77824,78933,78944,82938,82944,83526,90368,90397,90410,90414,90416,90425,92160,92728,92736,92766,92768,92777,92782,92862,92864,92873,92880,92909,92917,92917,92928,92975,92983,92997,93008,93017,93019,93025,93027,93047,93053,93071,93504,93542,93547,93561,93760,93850,93856,93880,93883,93907,93952,94026,94031,94087,94095,94111,94176,94180,94194,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113820,113821,113823,113827,117760,118012,118016,118451,118458,118480,118496,118512,118528,118573,118576,118598,118608,118723,118784,119029,119040,119078,119081,119133,119146,119148,119155,119162,119171,119172,119180,119209,119214,119226,119233,119274,119296,119361,119365,119365,119488,119507,119520,119539,119552,119638,119648,119672,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120779,120782,121483,121499,121503,121505,121519,122624,122654,122661,122666,122928,122989,123136,123180,123191,123197,123200,123209,123214,123215,123536,123565,123584,123627,123632,123641,123647,123647,124112,124139,124144,124153,124368,124397,124400,124410,124415,124415,124608,124638,124640,124642,124644,124645,124647,124653,124656,124660,124670,124671,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125127,125135,125184,125251,125259,125259,125264,125273,125278,125279,126065,126132,126209,126269,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,126704,126705,126976,127019,127024,127123,127136,127150,127153,127167,127169,127183,127185,127221,127232,127405,127462,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,128728,128732,128748,128752,128764,128768,128985,128992,129003,129008,129008,129024,129035,129040,129095,129104,129113,129120,129159,129168,129197,129200,129211,129216,129217,129232,129240,129280,129623,129632,129645,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,129792,129938,129940,130042,131072,173791,173824,178205,178208,183981,183984,191456,191472,192093,196608,201546,201552,210041,917505,917505,917536,917631,917760,917999,983040,1048573,1048576,1114109]}var At,jt=t((()=>{}));function Mt(e){if(!Number.isInteger(e))return!1;let t=kt(),n=0,r=t.length/2-1;for(;n<=r;){let i=n+r>>>1;if(e<t[i*2])r=i-1;else if(e>t[i*2+1])n=i+1;else return!0}return!1}var Nt=t((()=>{jt()}));function Pt(e,t){let n=e.fieldType===`slidenum`&&t!==void 0?String(t):e.text;return e.caps===`all`||e.caps===`small`?n.toUpperCase():n}var Ft=t((()=>{})),It=n({collectSlideFontDemand:()=>Lt});function Lt(e,t,n){let r=new Set,i=2;if(i>n)return`all`;let a=e=>{if(ve(e))return!1;for(let a of e){let e=a.codePointAt(0);if(!Mt(e)||e>=61472&&e<=61695)return!1;if(!t.has(e)&&!r.has(e)){if(i+=String(e).length+1,i>n)return!1;r.add(e)}}return!0},o=t=>{if(!t)return!0;if(t.vert&&t.vert!==`horz`||`textWarp`in t)return!1;for(let n of t.paragraphs){if(n.rtl||n.bullet?.type!==`none`&&n.bullet?.type!==`inherit`)return!1;for(let t of n.runs)if(t.type!==`break`&&(t.type!==`text`||t.fontFamilySym||t.fieldType&&t.fieldType!==`slidenum`||!a(t.text)||!a(Pt(t,e.slideNumber))))return!1}return!0};if(e.parseError||!a(`Mii `))return`all`;for(let t of e.elements)if(t.type===`shape`){if(!o(t.textBody))return`all`}else if(t.type===`table`){for(let e of t.rows)for(let t of e.cells)if(!o(t.textBody))return`all`}else return`all`;return[...r]}var Rt=t((()=>{j(),Ot(),Nt(),Ft()}));async function zt(e){return e?(await Promise.resolve().then(()=>(Rt(),It))).collectSlideFontDemand:void 0}function M(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`)}function N(e,t,n){return M(e,`resource measurement`),M(t,`resource measurement`),M(n,`resource measurement limit`),e>n||t>n||t>n-e?n===2**53-1?n:n+1:e+t}function Bt(e,t=2**53-1){M(t,`resource measurement limit`);let n=0;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=3}else a=3;if(n=N(n,a,t),n>t)return n}return n}function Vt(e,t=2**53-1){M(t,`resource measurement limit`);let n=N(0,2,t);if(n>t)return n;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i===34||i===92||i===8||i===9||i===10||i===12||i===13)a=2;else if(i<=31)a=6;else if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=6}else a=i>=55296&&i<=57343?6:3;if(n=N(n,a,t),n>t)return n}return n}function P(e,t){return N(0,e,t)}function F(e,t=2**53-1,n=!1){if(M(t,`resource measurement limit`),e===null)return{jsonBytes:P(4,t),stringValueUtf8Bytes:0};if(typeof e==`string`)return{jsonBytes:Vt(e,t),stringValueUtf8Bytes:Bt(e,t)};if(typeof e==`boolean`)return{jsonBytes:P(e?4:5,t),stringValueUtf8Bytes:0};if(typeof e==`number`)return{jsonBytes:P((Number.isFinite(e)?String(Object.is(e,-0)?0:e):`null`).length,t),stringValueUtf8Bytes:0};if(typeof e==`bigint`)throw TypeError(`BigInt values cannot be serialized to JSON`);if(Array.isArray(e)){let n=P(2,t),r=0;for(let i=0;i<e.length;i+=1){i!==0&&(n=N(n,1,t));let a=F(e[i],t,!0);n=N(n,a.jsonBytes,t),r=N(r,a.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}if(typeof e==`object`){let n=P(2,t),r=0,i=0;for(let[a,o]of Object.entries(e)){if(o===void 0||typeof o==`function`||typeof o==`symbol`)continue;i++!==0&&(n=N(n,1,t)),n=N(n,Vt(a,t),t),n=N(n,1,t);let e=F(o,t);n=N(n,e.jsonBytes,t),r=N(r,e.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}return{jsonBytes:n?P(4,t):0,stringValueUtf8Bytes:0}}j(),ce(),{..._,...oe};function*Ht(e){let t=[e[Symbol.iterator]()];for(;t.length;){let e=t[t.length-1].next();if(e.done){t.pop();continue}let n=e.value;yield n,(n.type===`shape`||n.type===`table`)&&n.mathFallback&&t.push(n.mathFallback.elements[Symbol.iterator]())}}function*Ut(e){for(let t of e?.paragraphs??[]){for(let e of t.mathFallbacks??[])yield e.text;for(let e of t.runs)e.type===`text`&&(yield e.text),e.type===`math`&&e.fallbackText&&(yield e.fallbackText)}}function*Wt(e){for(let t of e?.paragraphs??[]){t.defFontFamily&&(yield t.defFontFamily);for(let e of t.runs)e.type===`text`&&(e.fontFamily&&(yield e.fontFamily),e.fontFamilyEa&&(yield e.fontFamilyEa),e.fontFamilyCs&&(yield e.fontFamilyCs),e.fontFamilySym&&(yield e.fontFamilySym))}}function*Gt(e){for(let t of Ht(e.elements))if(t.type===`shape`)yield*Ut(t.textBody);else if(t.type===`table`)for(let e of t.rows)for(let t of e.cells)yield*Ut(t.textBody);else if(t.type===`chart`){t.chart.title&&(yield t.chart.title);for(let e of t.chart.categories)yield e;for(let e of t.chart.series)e.name&&(yield e.name)}}var Kt=class e{majorFont;minorFont;fallback;scriptNames;scripts;families;constructor(e,t,n,r,i,a=new Set){this.majorFont=e,this.minorFont=t,this.fallback=i,this.scriptNames=a;let o=y(e)??y(t)??i??null;this.scripts=n??new se(o),this.families=r??new Set,e&&this.families.add(e),t&&this.families.add(t)}addSlide(e){e.theme?.majorFont&&this.families.add(e.theme.majorFont),e.theme?.minorFont&&this.families.add(e.theme.minorFont),this.scripts.addText(Gt(e));for(let t of ne(Gt(e),y(e.theme?e.theme.majorFont:this.majorFont)??y(e.theme?e.theme.minorFont:this.minorFont)??this.fallback??null))this.scriptNames.add(t);for(let t of Ht(e.elements))if(t.type===`shape`)for(let e of Wt(t.textBody))this.families.add(e);else if(t.type===`table`)for(let e of t.rows)for(let t of e.cells)for(let e of Wt(t.textBody))this.families.add(e)}names(){return[...new Set([...this.families,...this.scripts.names(),...this.scriptNames])]}withSlide(t){let n=new e(this.majorFont,this.minorFont,this.scripts.clone(),new Set(this.families),this.fallback,new Set(this.scriptNames));return n.addSlide(t),n}};j(),A();const qt=Object.freeze({archiveEntryCount:0,declaredInflatedBytes:0,distinctInflatedBytes:0,operationInflatedBytes:0}),Jt=f;function I(e,t){if(e!==null&&typeof e!=`string`)throw Error(`invalid PPTX presentation bootstrap ${t}`)}function Yt(e,t){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`invalid PPTX presentation bootstrap slide at ${t}`);let n=e;if(n.index!==t)throw Error(`invalid PPTX presentation bootstrap slide index ${n.index}`);if(n.partName!==void 0&&typeof n.partName!=`string`)throw Error(`invalid PPTX presentation bootstrap slide partName at ${t}`);return Object.freeze({index:n.index,...n.partName===void 0?{}:{partName:n.partName}})}function Xt(e,t){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`invalid PPTX presentation bootstrap embedded font at ${t}`);let n=e;if(typeof n.fontName!=`string`||n.fontName.length===0||![`regular`,`bold`,`italic`,`boldItalic`].includes(n.style??``)||typeof n.partPath!=`string`||n.partPath.length===0||n.partPath.startsWith(`/`)||n.partPath.split(`/`).includes(`..`)||![`application/x-font-ttf`,`application/x-fontdata`].includes(n.contentType??``))throw Error(`invalid PPTX presentation bootstrap embedded font fields at ${t}`);return Object.freeze({fontName:n.fontName,style:n.style,partPath:n.partPath,contentType:n.contentType})}function Zt(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`invalid PPTX presentation bootstrap payload`);let t=e;if(!Number.isSafeInteger(t.slideCount)||(t.slideCount??-1)<0||!Number.isSafeInteger(t.slideWidth)||(t.slideWidth??0)<=0||!Number.isSafeInteger(t.slideHeight)||(t.slideHeight??0)<=0||!Array.isArray(t.embeddedFonts)||!Array.isArray(t.slides)||t.slides.length!==t.slideCount)throw Error(`invalid PPTX presentation bootstrap dimensions or slide count`);return I(t.defaultTextColor,`defaultTextColor`),I(t.majorFont,`majorFont`),I(t.minorFont,`minorFont`),I(t.hlinkColor,`hlinkColor`),I(t.folHlinkColor,`folHlinkColor`),Object.freeze({slideCount:t.slideCount,slideWidth:t.slideWidth,slideHeight:t.slideHeight,defaultTextColor:t.defaultTextColor,majorFont:t.majorFont,minorFont:t.minorFont,hlinkColor:t.hlinkColor,folHlinkColor:t.folHlinkColor,embeddedFonts:Object.freeze(t.embeddedFonts.map(Xt)),slides:Object.freeze(t.slides.map(Yt))})}function Qt(e){return Object.freeze({type:`media`,x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,flipH:e.flipH,flipV:e.flipV,mediaKind:e.mediaKind,posterPath:e.posterPath,posterMimeType:e.posterMimeType,mediaPath:e.mediaPath,mimeType:e.mimeType})}function $t(e){return Object.freeze({...e.id===void 0?{}:{id:e.id},...e.authorId===void 0?{}:{authorId:e.authorId},...e.author===void 0?{}:{author:e.author},...e.date===void 0?{}:{date:e.date},...e.status===void 0?{}:{status:e.status},text:e.text})}function en(e){return Object.freeze({...e})}function tn(e){return Object.freeze({...e.authorId===void 0?{}:{authorId:e.authorId},...e.modernAuthorId===void 0?{}:{modernAuthorId:e.modernAuthorId},...e.id===void 0?{}:{id:e.id},...e.index===void 0?{}:{index:e.index},...e.author===void 0?{}:{author:e.author},...e.date===void 0?{}:{date:e.date},...e.x===void 0?{}:{x:e.x},...e.y===void 0?{}:{y:e.y},...e.anchors?.length?{anchors:Object.freeze(e.anchors.map(en))}:{},...e.status===void 0?{}:{status:e.status},text:e.text,...e.replies?.length?{replies:Object.freeze(e.replies.map($t))}:{}})}function nn(e,t){if(e.index!==t.index||e.partName!==t.partName)throw Error(`PPTX pulled slide identity does not match bootstrap index ${t.index}`);return Object.freeze({index:t.index,...t.partName===void 0?{}:{partName:t.partName},notes:e.notes??null,hidden:e.hidden??!1,mediaElements:Object.freeze(e.elements.filter(e=>e.type===`media`).map(Qt)),...e.comments?.length?{comments:Object.freeze(e.comments.map(tn))}:{}})}function rn(e,t,n){if(!(e<=t))throw new i(`PPTX presentation preflight exceeded its hard limit of ${t} projected bytes`,{stage:`parsing`,violation:{format:`pptx`,operation:`presentation-preflight`,resource:`presentation-preflight`,metric:`projected-bytes`,limit:t,observed:Math.min(e,t+1),configurable:!1,usage:n}})}var an=class{slideCountValue;slideWidthValue;slideHeightValue;defaultTextColorValue;majorFontValue;minorFontValue;hlinkColorValue;folHlinkColorValue;embeddedFontsValue;descriptors;slides=[];fonts;fontPreloadNames;fontProjectionBytes;projectionBytesValue;limit;pending=null;finished=null;demandPoints;demandAll=!1;demandBytes=0;demandMembershipBytes=0;demandDeltaBytes=0;collectFontDemand;demandDelta;constructor(e,t={}){let n=Zt(e),r=t.maxProjectionBytes??Jt;if(!Number.isSafeInteger(r)||r<=0||r>Jt)throw Error(`invalid PPTX presentation preflight limit`);this.limit=r,this.collectFontDemand=t.collectFontDemand,this.demandPoints=this.collectFontDemand?new Set:void 0,this.demandBytes=this.collectFontDemand?F({fontPreloadDemand:[]},this.limit).jsonBytes-1:0,this.demandMembershipBytes=this.demandBytes,this.slideCountValue=n.slideCount,this.slideWidthValue=n.slideWidth,this.slideHeightValue=n.slideHeight,this.defaultTextColorValue=n.defaultTextColor,this.majorFontValue=n.majorFont,this.minorFontValue=n.minorFont,this.hlinkColorValue=n.hlinkColor,this.folHlinkColorValue=n.folHlinkColor,this.embeddedFontsValue=n.embeddedFonts,this.descriptors=[...n.slides],this.fonts=new Kt(this.majorFontValue,this.minorFontValue,void 0,void 0,t.cjkFallback),this.fontPreloadNames=Object.freeze(this.fonts.names()),this.fontProjectionBytes=F(this.fontPreloadNames,this.limit).jsonBytes,this.projectionBytesValue=F({slideCount:this.slideCountValue,slideWidth:this.slideWidthValue,slideHeight:this.slideHeightValue,defaultTextColor:this.defaultTextColorValue,majorFont:this.majorFontValue,minorFont:this.minorFontValue,hlinkColor:this.hlinkColorValue,folHlinkColor:this.folHlinkColorValue,embeddedFonts:this.embeddedFontsValue,remainingSlides:this.descriptors,slides:[],fontPreloadNames:this.fontPreloadNames},this.limit).jsonBytes,this.projectionBytesValue+this.demandBytes>this.limit&&(this.demandAll=!0,this.demandBytes=0,this.demandMembershipBytes=0),this.projectionBytesValue=N(this.projectionBytesValue,this.demandBytes,this.limit),rn(this.projectionBytesValue,this.limit,qt)}get acceptedSlideCount(){return this.finished?.slideCount??this.slides.length}get projectedBytes(){return this.projectionBytesValue}get remainingDescriptorCount(){return this.descriptors.reduce((e,t)=>e+Number(t!==void 0),0)}get latestSlide(){return this.slides[this.slides.length-1]}get currentFontPreloadNames(){return this.fontPreloadNames}get currentFontPreloadDemandDelta(){return this.demandDelta}snapshot(){if(this.finished)return this.finished;if(this.pending)throw Error(`PPTX presentation preflight has an uncommitted slide`);return Object.freeze({slideCount:this.slideCountValue,slideWidth:this.slideWidthValue,slideHeight:this.slideHeightValue,defaultTextColor:this.defaultTextColorValue,majorFont:this.majorFontValue,minorFont:this.minorFontValue,hlinkColor:this.hlinkColorValue,folHlinkColor:this.folHlinkColorValue,embeddedFonts:this.embeddedFontsValue,slides:Object.freeze([...this.slides]),fontPreloadNames:this.fontPreloadNames})}addSlide(e,t=qt){this.prepareSlide(e,t).commit()}prepareSlide(e,t=qt){if(this.finished)throw Error(`PPTX presentation preflight is already finished`);if(this.pending)throw Error(`PPTX presentation preflight already has a prepared slide`);let n=this.slides.length,r=this.descriptors[n];if(!r)throw Error(`PPTX presentation preflight received an extra slide`);let i=nn(e,r),a=this.fonts.withSlide(e),o=Object.freeze(a.names()),s=F(o,this.limit).jsonBytes,c=F(i,this.limit).jsonBytes,l=this.projectionBytesValue-this.demandBytes-this.fontProjectionBytes-F(r,this.limit).jsonBytes+4;l=N(l,s,this.limit),l=N(l,c,this.limit),this.slides.length!==0&&(l=N(l,1,this.limit));let u=F({slide:i,fontPreloadNames:o},this.limit).jsonBytes,d=N(this.projectionBytesValue-this.demandBytes,u,this.limit),f=l;rn(Math.max(d,f),this.limit,t);let p=d+this.demandBytes;l+=this.demandBytes,Math.max(p,l)>this.limit&&this.demandBytes&&(this.projectionBytesValue-=this.demandBytes,this.demandBytes=0,this.demandMembershipBytes=0,this.demandDeltaBytes=0,this.demandPoints?.clear(),this.demandAll=!0,this.demandDelta=`all`,p=d,l=f);let m,h=this.demandBytes,g=this.demandMembershipBytes,_=this.demandDeltaBytes;if(this.collectFontDemand){let t=F([],this.limit).jsonBytes,n=this.limit-p,r=this.limit-f-this.demandMembershipBytes,i=Math.min(n,Math.floor((r+t-Number((this.demandPoints?.size??0)>0))/2));if(m=this.demandAll?`all`:this.collectFontDemand(e,this.demandPoints,Math.max(0,i)),m===`all`)h=0,g=0,_=0;else{_=F(m,this.limit).jsonBytes;let e=m.length===0?0:_-t+Number((this.demandPoints?.size??0)>0);g+=e,h=g+_,p+=_}l=f+h}rn(Math.max(p,l),this.limit,t);let v={state:`prepared`,fact:i,fonts:a,fontNames:o,fontBytes:s,committedBytes:l,demandDelta:m,demandBytes:h,demandMembershipBytes:g,demandDeltaBytes:_};return this.pending=v,{projectedBytes:p,commit:()=>{if(v.state!==`committed`){if(v.state===`rolled-back`)throw Error(`PPTX presentation preflight cannot commit a rolled-back slide`);if(this.pending!==v)throw Error(`PPTX presentation preflight prepared slide is stale`);if(this.descriptors[n]=void 0,this.slides.push(v.fact),this.fonts=v.fonts,this.fontPreloadNames=v.fontNames,this.fontProjectionBytes=v.fontBytes,this.projectionBytesValue=v.committedBytes,this.demandDelta=v.demandDelta,v.demandDelta===`all`)this.demandAll=!0,this.demandPoints?.clear();else for(let e of v.demandDelta??[])this.demandPoints?.add(e);this.demandBytes=v.demandBytes,this.demandMembershipBytes=v.demandMembershipBytes,this.demandDeltaBytes=v.demandDeltaBytes,v.state=`committed`,this.pending=null}},rollback:()=>{if(v.state!==`rolled-back`){if(v.state===`committed`)throw Error(`PPTX presentation preflight cannot roll back a committed slide`);if(this.pending!==v)throw Error(`PPTX presentation preflight prepared slide is stale`);v.state=`rolled-back`,this.pending=null}}}}finish(){if(this.finished)return this.finished;if(this.pending)throw Error(`PPTX presentation preflight has an uncommitted slide`);if(this.slides.length!==this.slideCountValue)throw Error(`PPTX presentation preflight is incomplete: ${this.slides.length}/${this.slideCountValue} slides`);return this.finished=Object.freeze({slideCount:this.slideCountValue,slideWidth:this.slideWidthValue,slideHeight:this.slideHeightValue,defaultTextColor:this.defaultTextColorValue,majorFont:this.majorFontValue,minorFont:this.minorFontValue,hlinkColor:this.hlinkColorValue,folHlinkColor:this.folHlinkColorValue,embeddedFonts:this.embeddedFontsValue,slides:Object.freeze([...this.slides]),fontPreloadNames:this.fontPreloadNames,...this.collectFontDemand&&!this.demandAll&&this.demandBytes?{fontPreloadDemand:Object.freeze([...this.demandPoints??[]])}:{}}),this.demandPoints?.clear(),this.demandDelta=void 0,this.descriptors=[],this.slides=[],this.projectionBytesValue=F(this.finished,this.limit).jsonBytes,this.finished}};A();function on(e){try{return Pe(e(e=>e.slide_cursor_resource_usage()))}catch(e){if(String(e).includes(`slide cursor usage is unavailable`))return;throw e}}function sn(e,t,n,r,i){let a,o;try{if(i){if(!r)throw Error(`slide payload is missing before acknowledgement`);let t=i(n,r,on(e));typeof t==`function`?a=t:t&&({rollback:a,commit:o}=t)}e(e=>e.acknowledge_slide(t.operationId,t.generation)),o?.()}catch(e){try{a?.()}catch{}throw e}}j(),A();var cn=class{archive;acceptSlide;executeArchive;coordinatorGeneration=new wt;sessions=new Map;pendingOpens=new Map;operationTail=Promise.resolve();resourceFailure;lifecycleState=`ready`;resetBarrier;resetIdentities=new Map;constructor(e,t,n=e=>e(this.requireArchive())){this.archive=e,this.acceptSlide=t,this.executeArchive=n}get coordinator(){return this.coordinatorGeneration}reserveOpen(e){if(this.assertReady(),un(e),this.pendingOpens.has(e.sessionId)||this.sessions.has(e.sessionId))throw Error(`slide pull session id is already reserved`);this.pendingOpens.set(e.sessionId,{identity:e,canceled:!1})}abandonOpen(e){this.pendingOpens.delete(e)}get pendingOpenCount(){return this.pendingOpens.size}async open(e,t){if(this.assertReady(),this.resourceFailure)throw this.resourceFailure;if(!Number.isSafeInteger(e)||e<0)throw RangeError(`slide index must be a non-negative safe integer`);let n=this.pendingOpens.get(t.sessionId);if(!n||!L(n.identity,t))throw Error(`slide pull session open reservation is stale or missing`);let r,i=new Promise(e=>{r=e}),a=this.operationTail.then(()=>this.coordinator.enqueue(async()=>{if(n.canceled)throw Error(`slide pull session open was canceled`);let i,a=!1,o=new Tt({...t,maxByteCredit:d,coordinator:this.coordinator,driver:{pull:n=>{let r;try{r=this.executeArchive(r=>r.pull_slide(e,t.operationId,t.generation,n))}catch(e){throw ke(e,n,d)||(this.latchResourceFailure(e),e)}let o=yt(r);return this.acceptSlide&&(i=JSON.parse(new TextDecoder().decode(new Uint8Array(o)))),a=!0,{payload:o,byteLength:o.byteLength,done:!0,transfer:[o]}},measureChunk:({payload:e})=>e.byteLength,acknowledge:()=>{if(!a)throw Error(`slide unit is not awaiting acknowledgement`);try{sn(this.executeArchive,t,e,i,this.acceptSlide)}catch(e){throw this.latchResourceFailure(e),e}a=!1,i=void 0,this.sessions.delete(t.sessionId),r()},cancel:async()=>{try{this.archive()&&await this.executeArchive(e=>e.cancel_slide())}finally{i=void 0,a=!1,this.sessions.delete(t.sessionId),r()}},close:async()=>{try{this.archive()&&await this.executeArchive(e=>e.cancel_slide())}finally{i=void 0,a=!1,this.sessions.delete(t.sessionId),r()}},resourceUsage:()=>{try{return this.readResourceUsage()}catch(e){throw this.latchResourceFailure(e),e}}}});this.sessions.set(t.sessionId,{host:o,identity:t}),this.pendingOpens.delete(t.sessionId)}));this.operationTail=a.then(()=>i,()=>void 0);try{await a}catch(e){throw this.pendingOpens.delete(t.sessionId),r(),e}}async postOpenedSafely(e,t,n){if(this.lifecycleState!==`ready`){try{n(this.lifecycleError())}catch{}return}try{t()}catch(t){await this.closeIdentity(e);try{n(t)}catch{}}}dispatch(e,t){if(this.lifecycleState!==`ready`)return t(this.responseDuringReset(e)),Promise.resolve();let n=this.sessions.get(e.sessionId);if(n)return n.host.dispatch(e,t);let r=this.pendingOpens.get(e.sessionId);if(r&&(e.kind===`cancel`||e.kind===`close`)){let n=L(r.identity,e);return n&&(r.canceled=!0),t(n?{protocol:k,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}:this.staleLifecycleResponse(e)),Promise.resolve()}return e.kind===`cancel`||e.kind===`close`?(t({protocol:k,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}),Promise.resolve()):(t({protocol:k,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:E(Error(`slide pull session is not open`))}),Promise.resolve())}async dispatchSafely(e,t){try{await this.dispatch(e,t)}catch(n){try{t({protocol:k,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:E(n)})}catch{}}}run(e){if(this.lifecycleState!==`ready`)return Promise.reject(this.lifecycleError());let t=this.operationTail.then(()=>this.coordinator.enqueue(async()=>{if(this.resourceFailure)throw this.resourceFailure;return e()})).catch(e=>{throw this.latchResourceFailure(e),e});return this.operationTail=t.then(()=>void 0,()=>void 0),t}reset(){if(this.resetBarrier)return this.resetBarrier;this.lifecycleState=`resetting`,this.captureResetIdentities();let e=this.performReset().then(()=>{this.resetIdentities.clear(),this.lifecycleState=`ready`},e=>{throw this.lifecycleState=`reset-failed`,e}).finally(()=>{this.resetBarrier===e&&(this.resetBarrier=void 0)});return this.resetBarrier=e,e}async performReset(){for(let e of this.pendingOpens.values())e.canceled=!0;let e=1;for(let{host:t,identity:n}of[...this.sessions.values()]){let r;if(await t.dispatch({protocol:k,kind:`close`,...n,requestId:e++},e=>{e.kind===`error`&&(r=$e(e.error))}),r)throw r}this.sessions.clear(),await this.operationTail,this.pendingOpens.clear(),this.archive()&&await this.executeArchive(e=>e.close_presentation_session()),this.coordinatorGeneration=new wt,this.resourceFailure=void 0}assertReady(){if(this.lifecycleState!==`ready`)throw this.lifecycleError()}lifecycleError(){let e=this.lifecycleState===`reset-failed`,t=Error(e?`slide pull worker reset failed; retry reset before new work`:`slide pull worker reset is in progress`);return t.name=`PullSessionLifecycleError`,Object.assign(t,{code:e?`ooxml-pull-reset-failed`:`ooxml-pull-resetting`})}captureResetIdentities(){for(let{identity:e}of this.sessions.values())this.resetIdentities.set(e.sessionId,e);for(let{identity:e}of this.pendingOpens.values())this.resetIdentities.set(e.sessionId,e)}responseDuringReset(e){if(e.kind===`cancel`||e.kind===`close`){let t=this.resetIdentities.get(e.sessionId);return t&&!L(t,e)?this.staleLifecycleResponse(e):{protocol:k,kind:`accepted`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,command:e.kind}}return{protocol:k,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:E(this.lifecycleError())}}requireArchive(){let e=this.archive();if(!e)throw Error(`Presentation not loaded`);return e}async closeIdentity(e){if(this.lifecycleState!==`ready`)return;let t=this.sessions.get(e.sessionId);if(t){await t.host.dispatch({protocol:k,kind:`close`,...e,requestId:1},()=>void 0);return}let n=this.pendingOpens.get(e.sessionId);n&&L(n.identity,e)&&(n.canceled=!0)}readResourceUsage(){return on(this.executeArchive)}latchResourceFailure(e){let t=e instanceof i?e:He(e);t&&(this.resourceFailure??=t)}staleLifecycleResponse(e){return{protocol:k,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:{message:`stale lifecycle targets another slide operation`,errorName:`PullSessionProtocolError`,code:`ooxml-stale-lifecycle`}}}};function ln(e){return!!e&&typeof e==`object`&&e.protocol===`ooxml-pull-v1`}function un(e){if(!Number.isSafeInteger(e.sessionId)||e.sessionId<=0)throw RangeError(`session id must be a positive safe integer`);if(!Number.isSafeInteger(e.operationId)||e.operationId<=0)throw RangeError(`operation id must be a positive safe integer`);if(!Number.isSafeInteger(e.generation)||e.generation<=0)throw RangeError(`generation must be a positive safe integer`)}function L(e,t){return e.sessionId===t.sessionId&&e.operationId===t.operationId&&e.generation===t.generation}var dn=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,pn.unregister(this),e}free(){let e=this.__destroy_into_raw();Y.__wbg_pptxarchive_free(e,0)}acknowledge_slide(e,t){let n=Y.pptxarchive_acknowledge_slide(this.__wbg_ptr,e,t);if(n[1])throw G(n[0])}assert_healthy(){let e=Y.pptxarchive_assert_healthy(this.__wbg_ptr);if(e[1])throw G(e[0])}cancel_slide(){Y.pptxarchive_cancel_slide(this.__wbg_ptr)}close_presentation_session(){Y.pptxarchive_close_presentation_session(this.__wbg_ptr)}extract_font(e){let t=W(e,Y.__wbindgen_malloc,Y.__wbindgen_realloc),n=J,r=Y.pptxarchive_extract_font(this.__wbg_ptr,t,n);if(r[3])throw G(r[2]);var i=R(r[0],r[1]).slice();return Y.__wbindgen_free(r[0],r[1]*1,1),i}extract_image(e){let t=W(e,Y.__wbindgen_malloc,Y.__wbindgen_realloc),n=J,r=Y.pptxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw G(r[2]);var i=R(r[0],r[1]).slice();return Y.__wbindgen_free(r[0],r[1]*1,1),i}extract_media(e){let t=W(e,Y.__wbindgen_malloc,Y.__wbindgen_realloc),n=J,r=Y.pptxarchive_extract_media(this.__wbg_ptr,t,n);if(r[3])throw G(r[2]);var i=R(r[0],r[1]).slice();return Y.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e,t,n,r){let i=hn(e,Y.__wbindgen_malloc),a=J,o=Y.pptxarchive_new(i,a,!U(t),U(t)?BigInt(0):t,!U(n),U(n)?BigInt(0):n,!U(r),U(r)?BigInt(0):r);if(o[2])throw G(o[1]);return this.__wbg_ptr=o[0]>>>0,pn.register(this,this.__wbg_ptr,this),this}parse(){let e=Y.pptxarchive_parse(this.__wbg_ptr);if(e[3])throw G(e[2]);var t=R(e[0],e[1]).slice();return Y.__wbindgen_free(e[0],e[1]*1,1),t}presentation_bootstrap(){let e=Y.pptxarchive_presentation_bootstrap(this.__wbg_ptr);if(e[3])throw G(e[2]);var t=R(e[0],e[1]).slice();return Y.__wbindgen_free(e[0],e[1]*1,1),t}pull_slide(e,t,n,r){let i=Y.pptxarchive_pull_slide(this.__wbg_ptr,e,t,n,r);if(i[3])throw G(i[2]);var a=R(i[0],i[1]).slice();return Y.__wbindgen_free(i[0],i[1]*1,1),a}resource_usage(){let e=Y.pptxarchive_resource_usage(this.__wbg_ptr);if(e[3])throw G(e[2]);var t=R(e[0],e[1]).slice();return Y.__wbindgen_free(e[0],e[1]*1,1),t}slide_cursor_resource_usage(){let e=Y.pptxarchive_slide_cursor_resource_usage(this.__wbg_ptr);if(e[3])throw G(e[2]);var t=R(e[0],e[1]).slice();return Y.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=Y.pptxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,G(i[2]);return e=n,t=r,B(n,r)}finally{Y.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(dn.prototype[Symbol.dispose]=dn.prototype.free);function fn(){return{__proto__:null,\"./pptx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(B(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(B(e,t))}finally{Y.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=W(n,Y.__wbindgen_malloc,Y.__wbindgen_realloc),i=J;mn().setInt32(e+4,i,!0),mn().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return B(e,t)},__wbindgen_init_externref_table:function(){let e=Y.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const pn=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>Y.__wbg_pptxarchive_free(e>>>0,1));function R(e,t){return e>>>=0,H().subarray(e/1,e/1+t)}let z=null;function mn(){return(z===null||z.buffer.detached===!0||z.buffer.detached===void 0&&z.buffer!==Y.memory.buffer)&&(z=new DataView(Y.memory.buffer)),z}function B(e,t){return e>>>=0,_n(e,t)}let V=null;function H(){return(V===null||V.byteLength===0)&&(V=new Uint8Array(Y.memory.buffer)),V}function U(e){return e==null}function hn(e,t){let n=t(e.length*1,1)>>>0;return H().set(e,n/1),J=e.length,n}function W(e,t,n){if(n===void 0){let n=q.encode(e),r=t(n.length,1)>>>0;return H().subarray(r,r+n.length).set(n),J=n.length,r}let r=e.length,i=t(r,1)>>>0,a=H(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=H().subarray(i+o,i+r),a=q.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return J=o,i}function G(e){let t=Y.__wbindgen_externrefs.get(e);return Y.__externref_table_dealloc(e),t}let K=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});K.decode();let gn=0;function _n(e,t){return gn+=t,gn>=2146435072&&(K=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),K.decode(),gn=t),K.decode(H().subarray(e,e+t))}const q=new TextEncoder;`encodeInto`in q||(q.encodeInto=function(e,t){let n=q.encode(e);return t.set(n),{read:e.length,written:n.length}});let J=0,Y;function vn(e,t){return Y=e.exports,z=null,V=null,Y.__wbindgen_start(),Y}async function yn(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function bn(e){if(Y!==void 0)return Y;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let t=fn();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await yn(await e,t);return vn(n,r)}async function xn(e){return Y=void 0,z=null,V=null,bn(e)}j(),A();const X=new _t(bn,{freeArchive:e=>e.free(),reinit:xn});let Z=null,Sn=`empty`;function Cn(){if(Sn!==`empty`){let e=Error(`this PPTX worker already owns a presentation parse`);throw e.name=`PptxWorkerStateError`,Object.assign(e,{code:`ooxml-pptx-parse-already-started`})}Sn=`opening`}const Q=new cn(()=>X.archive,(e,t,n)=>{if(Z){if(e!==Z.acceptedSlideCount)throw Error(`PPTX preflight expected slide ${Z.acceptedSlideCount}, received ${e}`);return Z.prepareSlide(t,n)}},e=>{let t=X.archive;if(!t)throw Error(`Presentation not loaded`);return X.run(()=>e(t))}),$=(e,t)=>self.postMessage(e,t);self.onmessage=async e=>{let t=e.data;if(ln(t)){await Q.dispatchSafely(t,$);return}if(t.kind===`init`){X.setWasmInput(we(t.wasmUrl)??t.wasmUrl);return}let n=t.id,r=!1;try{if(t.kind===`openSlideSession`&&Q.reserveOpen(t),t.kind===`parse`&&(Cn(),r=!0),t.kind===`openSlideSession`){await X.ensureReady(),await Q.open(t.slideIndex,t),await Q.postOpenedSafely(t,()=>$({kind:`slideSessionOpened`,id:n,sessionId:t.sessionId,operationId:t.operationId,generation:t.generation}),e=>$({kind:`error`,id:n,...E(e)}));return}t.kind===`parse`&&await Q.reset(),await Q.run(async()=>{if(await X.ensureReady(),t.kind!==`parse`&&X.archive){let e=X.archive;X.run(()=>e.assert_healthy())}if(t.kind===`parse`){Z=null;let[e,r,i]=xt(t.resourcePolicy),a=X.run(()=>{let n=new dn(new Uint8Array(t.buffer),e,r,i);return X.setArchive(n),JSON.parse(new TextDecoder().decode(n.presentation_bootstrap()))});Z=t.progressiveLayout?null:new an(a,{cjkFallback:t.cjkFallback,collectFontDemand:t.collectFontDemand===!0?await zt(!0):void 0}),$({kind:`presentationOpened`,id:n,bootstrap:a}),Sn=`ready`;return}let e=X.archive;if(!e)throw Error(`No pptx loaded`);if(t.kind===`finishPresentationPreflight`){if(!Z)throw Error(`PPTX presentation preflight is not active`);let e=Z.finish();Z=null,$({kind:`presentationPreflightReady`,id:n,preflight:e});return}if(t.kind===`extractMedia`){let r=X.run(()=>e.extract_media(t.path).buffer);$({kind:`mediaExtracted`,id:n,bytes:r},[r]);return}if(t.kind===`extractImage`){let r=X.run(()=>e.extract_image(t.path).buffer);$({kind:`imageExtracted`,id:n,bytes:r},[r]);return}if(t.kind===`extractFont`){let r=X.run(()=>e.extract_font(t.path).buffer);$({kind:`fontExtracted`,id:n,bytes:r},[r]);return}if(t.kind===`resourceUsage`){$({kind:`resourceUsage`,id:n,usage:Pe(X.run(()=>e.resource_usage()))});return}t.kind===`toMarkdown`&&$({kind:`markdownRendered`,id:n,markdown:X.run(()=>e.to_markdown())})})}catch(e){r&&(Sn=`failed`),t.kind===`openSlideSession`&&Q.abandonOpen(t.sessionId);try{$({kind:`error`,id:n,...E(e)})}catch{}}};", qt = typeof self < "u" && self.Blob && new Blob([Kt], { type: "text/javascript;charset=utf-8" });
577
+ function Jt(e) {
578
+ let t;
579
+ try {
580
+ if (t = qt && (self.URL || self.webkitURL).createObjectURL(qt), !t) throw "";
581
+ let n = new Worker(t, {
582
+ name: e?.name
583
+ });
584
+ return n.addEventListener("error", () => {
585
+ (self.URL || self.webkitURL).revokeObjectURL(t);
586
+ }), n;
587
+ } catch {
588
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Kt), {
589
+ name: e?.name
590
+ });
591
+ }
592
+ }
593
+ var Yt = new URL("pptx_parser_bg.wasm", "https://package.invalid/").href, q = 65536, Xt = 16384, Zt = new Set(["line", "straightconnector1"]);
594
+ function Qt(e, t) {
595
+ let n = e.x + e.width / 2, r = e.y + e.height / 2, i = -e.rotation * Math.PI / 180, a = Math.cos(i), o = Math.sin(i), s = t.x - n, c = t.y - r, l = n + a * s - o * c, u = r + o * s + a * c;
596
+ return e.flipH && (l = 2 * n - l), e.flipV && (u = 2 * r - u), {
597
+ x: l,
598
+ y: u
599
+ };
600
+ }
601
+ function $t(e, t, n) {
602
+ let r = n.x - t.x, i = n.y - t.y, a = r * r + i * i;
603
+ if (a === 0) return Math.hypot(e.x - t.x, e.y - t.y);
604
+ let o = Math.max(0, Math.min(1, ((e.x - t.x) * r + (e.y - t.y) * i) / a));
605
+ return Math.hypot(e.x - (t.x + o * r), e.y - (t.y + o * i));
606
+ }
607
+ function en(e, t, n = 0) {
608
+ if (!Number.isFinite(t.x) || !Number.isFinite(t.y)) return !1;
609
+ let r = Qt(e, t), i = Number.isFinite(n) && n > 0 ? n : 0;
610
+ if (e.type === "shape" && (Zt.has(e.geometry.toLowerCase()) || e.width === 0 || e.height === 0)) return $t(r, {
611
+ x: e.x,
612
+ y: e.y
613
+ }, {
614
+ x: e.x + e.width,
615
+ y: e.y + e.height
616
+ }) <= i;
617
+ let a = Math.min(e.x, e.x + e.width), o = Math.max(e.x, e.x + e.width), s = Math.min(e.y, e.y + e.height), c = Math.max(e.y, e.y + e.height);
618
+ return r.x >= a && r.x <= o && r.y >= s && r.y <= c;
619
+ }
620
+ function* tn(e) {
621
+ if (e) for (let t of e.paragraphs) {
622
+ let e = !0;
623
+ for (let n of t.runs) {
624
+ let t = n.type === "text" ? n.text : n.type === "break" ? "\n" : "[equation]";
625
+ t && (yield {
626
+ text: t,
627
+ beginsPart: e
628
+ }, e = !1);
629
+ }
630
+ }
631
+ }
632
+ function* nn(e) {
633
+ if (e.type === "shape") {
634
+ yield* tn(e.textBody);
635
+ return;
636
+ }
637
+ if (e.type === "table") {
638
+ for (let t of e.rows) for (let e of t.cells) yield* tn(e.textBody);
639
+ return;
640
+ }
641
+ }
642
+ function rn(e, t = Xt) {
643
+ if (!Number.isFinite(t) || t < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
644
+ let n = Math.min(q, Math.floor(t)), r = e.text, i = r === void 0 ? void 0 : Je(r, n), a = r !== void 0 && i.length < r.length;
645
+ return {
646
+ ...structuredClone(e),
647
+ ...i === void 0 ? {} : { text: i },
648
+ truncated: e.truncated || a,
649
+ truncationReasons: e.truncated || a ? ["text"] : [],
650
+ textCharacters: i?.length ?? 0,
651
+ maxTextCharacters: n
652
+ };
653
+ }
654
+ function an(e, t) {
655
+ let n = [], r = 0, i = !1, a = !1;
656
+ for (let o of e) {
657
+ if (a = !0, o.beginsPart && n.length > 0) {
658
+ if (r >= t) {
659
+ i = !0;
660
+ break;
661
+ }
662
+ n.push("\n"), r++;
663
+ }
664
+ let e = Math.max(0, t - r), s = Je(o.text, e);
665
+ if (n.push(s), r += s.length, s.length < o.text.length) {
666
+ i = !0;
667
+ break;
668
+ }
669
+ }
670
+ return a ? {
671
+ text: n.join(""),
672
+ truncated: i,
673
+ textCharacters: r
674
+ } : {
675
+ truncated: !1,
676
+ textCharacters: 0
677
+ };
678
+ }
679
+ function on(e, t, n, r = {}) {
680
+ if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) throw RangeError("PPTX hit-test point must contain finite coordinates.");
681
+ let i = r.maxTextCharacters ?? Xt;
682
+ if (!Number.isFinite(i) || i < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
683
+ let a = Math.min(q, Math.floor(i)), o = r.tolerance ?? 0;
684
+ if (!Number.isFinite(o) || o < 0) throw RangeError("tolerance must be a finite non-negative number.");
685
+ for (let r = t.elements.length - 1; r >= 0; r--) {
686
+ let i = t.elements[r];
687
+ if (!en(i, n, o)) continue;
688
+ let s = i.type === "chart" ? We(i.chart, a) : an(nn(i), a);
689
+ return {
690
+ format: "pptx",
691
+ kind: "element",
692
+ slideIndex: e,
693
+ elementIndex: r,
694
+ origin: t.elementSources?.[r]?.origin ?? "unknown",
695
+ elementType: i.type,
696
+ point: { ...n },
697
+ bounds: {
698
+ x: i.x,
699
+ y: i.y,
700
+ width: i.width,
701
+ height: i.height,
702
+ rotation: i.rotation,
703
+ flipH: i.flipH,
704
+ flipV: i.flipV
705
+ },
706
+ ...i.type === "shape" ? {
707
+ ...i.id === void 0 ? {} : { shapeId: i.id },
708
+ ...i.name === void 0 ? {} : { name: i.name },
709
+ geometry: i.geometry
710
+ } : {},
711
+ ...s.text === void 0 ? {} : { text: s.text },
712
+ ...i.type === "picture" ? { mimeType: i.mimeType } : {},
713
+ ...i.type === "media" ? {
714
+ mimeType: i.mimeType,
715
+ mediaKind: i.mediaKind
716
+ } : {},
717
+ ...i.type === "table" ? {
718
+ rowCount: i.rows.length,
719
+ columnCount: i.cols.length
720
+ } : {},
721
+ ...i.type === "chart" ? { seriesCount: i.chart.series.length } : {},
722
+ truncated: s.truncated,
723
+ truncationReasons: s.truncated ? ["text"] : [],
724
+ textCharacters: s.textCharacters,
725
+ maxTextCharacters: a
726
+ };
727
+ }
728
+ return null;
729
+ }
730
+ function sn(e, t) {
731
+ let n = new Set(t.filter((e) => e.length > 0));
732
+ if (n.size === 0) return Object.freeze([]);
733
+ let r = /* @__PURE__ */ new Map();
734
+ for (let [t, i] of e.elements.entries()) {
735
+ let a = i.id;
736
+ if (!a || !n.has(a)) continue;
737
+ let o = e.elementSources?.[t]?.origin ?? "unknown", s = o === "slide" ? 3 : o === "layout" ? 2 : +(o === "master"), c = r.get(a), l = c?.origin === "slide" ? 3 : c?.origin === "layout" ? 2 : +(c?.origin === "master");
738
+ c && l > s || r.set(a, Object.freeze({
739
+ elementId: a,
740
+ elementIndex: t,
741
+ origin: o,
742
+ elementType: i.type,
743
+ bounds: Object.freeze({
744
+ x: i.x,
745
+ y: i.y,
746
+ width: i.width,
747
+ height: i.height,
748
+ rotation: i.rotation,
749
+ flipH: i.flipH,
750
+ flipV: i.flipV
751
+ })
752
+ }));
753
+ }
754
+ return Object.freeze(t.flatMap((e) => {
755
+ let t = r.get(e);
756
+ return t ? [t] : [];
757
+ }));
758
+ }
759
+ var J = /* @__PURE__ */ new WeakMap();
760
+ function Y(e, t) {
761
+ let n = Object.freeze({ ...t });
762
+ for (let t of [...J.get(e) ?? []]) try {
763
+ t.notify(n);
764
+ } catch (e) {
765
+ try {
766
+ t.report(e);
767
+ } catch {}
768
+ }
769
+ }
770
+ function cn(e, t, n, r) {
771
+ let i = J.get(e);
772
+ i || (i = /* @__PURE__ */ new Set(), J.set(e, i));
773
+ let a = Object.freeze({
774
+ notify: n,
775
+ report: r
776
+ });
777
+ i.add(a);
778
+ try {
779
+ n(Object.freeze({ ...t() }));
780
+ } catch (e) {
781
+ try {
782
+ r(e);
783
+ } catch {}
784
+ }
785
+ return () => {
786
+ i?.delete(a), i?.size === 0 && J.delete(e);
787
+ };
788
+ }
789
+ function ln() {
790
+ return new Promise((e) => {
791
+ let t = new MessageChannel();
792
+ t.port1.onmessage = () => {
793
+ t.port1.close(), t.port2.close(), e();
794
+ }, t.port2.postMessage(void 0);
795
+ });
796
+ }
797
+ var X = class e {
798
+ _cjkFallback = "jp";
799
+ _googleSubstitutes = !1;
800
+ _metrics = null;
801
+ _worker;
802
+ _bridge;
803
+ _mode = "main";
804
+ _bootstrap = null;
805
+ _preflight = null;
806
+ _availableSlideCount = 0;
807
+ _layoutLifecycle = new he();
808
+ _layoutObservers = new Pe();
809
+ _layoutCompletion = null;
810
+ _parseRequestId = null;
811
+ _progressive = null;
812
+ _progressiveWatchdog;
813
+ _progressiveWatchdogMs;
814
+ _layoutWaiters = /* @__PURE__ */ new Set();
815
+ _slides = null;
816
+ _slidePullClient = null;
817
+ _resourceFailure = null;
818
+ _slidePartIndex = null;
819
+ _rawParts = new ue({
820
+ maxEntries: 64,
821
+ maxBytes: re
822
+ });
823
+ _googleFonts = null;
824
+ _officeFontLoads = /* @__PURE__ */ new Map();
825
+ _embeddedFontFaces = [];
826
+ _embeddedFontAliases = /* @__PURE__ */ new Map();
827
+ _embeddedFontAuthoredFamilies = /* @__PURE__ */ new Map();
828
+ _embeddedFontTuples = /* @__PURE__ */ new Set();
829
+ _destroyed = !1;
830
+ _fetchImage = (e, t) => this.getImage(e, t);
831
+ _fetchMedia = (e) => this.getMedia(e);
832
+ _math;
833
+ _threeD;
834
+ _regionMap;
835
+ _chartEx;
836
+ _tiff;
837
+ constructor(e, t, n) {
838
+ this._worker = e, this._mode = t, this._bridge = new Be(this._worker, {
839
+ correlate: (e) => "protocol" in e && e.protocol === "ooxml-pull-v1" ? e.requestId : "id" in e ? e.id : void 0,
840
+ toError: (e) => !("protocol" in e) && e.kind === "error" ? S(e) : void 0,
841
+ onUnsolicited: (e) => this._onWorkerLayoutPush(e)
842
+ });
843
+ let r = new URL(n ?? Yt, location.href).href;
844
+ this._bridge.post({
845
+ kind: "init",
846
+ wasmUrl: r
847
+ });
848
+ }
849
+ _assertResourceHealthy() {
850
+ if (this._resourceFailure) throw this._resourceFailure;
851
+ }
852
+ _rethrowWithResourceFailure(e) {
853
+ let t = e instanceof g ? e : v(e);
854
+ throw t ? (this._resourceFailure ??= t, this._resourceFailure) : e;
855
+ }
856
+ static async load(t, n = {}) {
857
+ if (n.legacyPpt !== void 0) {
858
+ let { loadPptxModelSource: e } = await import("ooxml/presentation-model-source-DL6duh5l.js");
859
+ return e(t, n);
860
+ }
861
+ let r = le(n.cjkFallback), i = b(n), a = n.mode ?? "main", o = new ie({
862
+ enabled: !0,
863
+ format: "pptx",
864
+ mode: a,
865
+ policy: i.policy,
866
+ onMetrics: i.onResourceMetrics,
867
+ emitToConsole: i.debug
868
+ });
869
+ try {
870
+ if (a === "worker" && (typeof Worker > "u" || typeof OffscreenCanvas > "u")) throw Error("mode: 'worker' requires Worker and OffscreenCanvas support");
871
+ let s;
872
+ if (typeof t == "string") {
873
+ let e = await fetch(t);
874
+ if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
875
+ s = await e.arrayBuffer();
876
+ } else s = t;
877
+ s = _(await ee(s, n.password)), o.setSourceBytes(s.byteLength), o.checkpoint("container ready");
878
+ let c = a === "worker" ? (await import("ooxml/render-worker-host-CtlBbau5.js")).createRenderWorker() : new Jt(), l = a === "worker" ? nt(n) : void 0, u;
879
+ try {
880
+ u = new e(c, a, n.wasmUrl), u._metrics = o, n.math && a === "worker" && !l?.math && console.warn("[ooxml] a custom math renderer cannot cross the worker boundary; equations will be skipped in mode: 'worker'. Use the math renderer from @silurus/ooxml/math."), n.threeD && a === "worker" && !l?.threeD && console.warn("[ooxml] a custom 3-D chart renderer cannot cross the worker boundary; charts use their 2-D family fallback in mode: 'worker'. Use the renderer from @silurus/ooxml/three-d."), u._cjkFallback = r, u._math = a === "worker" ? void 0 : n.math, u._threeD = a === "worker" ? void 0 : n.threeD, n.regionMap && a === "worker" && !l?.regionMap && console.warn("[ooxml] a custom Region Map renderer cannot cross the worker boundary; geospatial charts use the unsupported-chart placeholder in mode: 'worker'. Use the renderer from @silurus/ooxml/region-map."), u._regionMap = a === "worker" ? void 0 : n.regionMap, n.chartEx && a === "worker" && !l?.chartEx && console.warn("[ooxml] a custom ChartEx renderer cannot cross the worker boundary; ChartEx charts use the unsupported-chart placeholder in mode: 'worker'. Use the renderer from @silurus/ooxml/chart-ex."), u._chartEx = a === "worker" ? void 0 : n.chartEx, n.tiff && a === "worker" && !l?.tiff && console.warn("[ooxml] a custom TIFF codec cannot cross the worker boundary; recognized TIFF images will use an unavailable-image placeholder in mode: 'worker'. Use the codec from @silurus/ooxml/tiff to display them."), u._tiff = a === "worker" ? void 0 : n.tiff;
881
+ let t = n.progressiveLayout ? {
882
+ onProgress: n.onLayoutProgress,
883
+ onPartial: n.onLayoutPartial,
884
+ onComplete: n.onLayoutComplete,
885
+ firstPublication: ve(),
886
+ published: !1,
887
+ deferred: !1,
888
+ settled: !1
889
+ } : void 0;
890
+ return u._googleSubstitutes = !!n.useGoogleFonts, await u._parse(s, i.policy, !!n.useGoogleFonts, n.workerTimeoutMs, (e) => o.observeUsage(e), l, t), o.checkpoint("presentation preflight ready"), a === "main" && n.useGoogleFonts && u._preflight && !t && await u._ensureGoogleFonts(K(u._preflight.fontPreloadNames, u._embeddedFontAliases), u._preflight.fontPreloadDemand), o.succeed({ slides: u.slideCount }), u;
891
+ } catch (e) {
892
+ let t = u;
893
+ throw Ve(c, t ? () => t.destroy() : void 0), e;
894
+ }
895
+ } catch (e) {
896
+ throw o.fail(e), e;
897
+ }
898
+ }
899
+ async _ensureGoogleFonts(e, t) {
900
+ this._destroyed || (this._googleFonts ??= new x(i), await this._googleFonts.ensure(e, t));
901
+ }
902
+ async _parse(e, n, r = !1, i, a, o, l) {
903
+ if (l) {
904
+ this._progressive = l, this._mode === "worker" ? await this._parseWorkerProgressively(e, n, r, i, a, o, l) : await this._parseMainProgressively(e, n, r, i, a, l, r && !o);
905
+ return;
906
+ }
907
+ let u = await this._bridge.request((t) => this._mode === "worker" ? {
908
+ kind: "parse",
909
+ id: t,
910
+ buffer: e,
911
+ resourcePolicy: n,
912
+ useGoogleFonts: r,
913
+ cjkFallback: this._cjkFallback,
914
+ renderers: o
915
+ } : {
916
+ kind: "parse",
917
+ id: t,
918
+ buffer: e,
919
+ resourcePolicy: n,
920
+ cjkFallback: this._cjkFallback,
921
+ ...r && !o ? { collectFontDemand: !0 } : {}
922
+ }, [e], { timeoutMs: i });
923
+ if (this._mode === "worker") {
924
+ let e = u;
925
+ e.usage && a?.(e.usage), this._preflight = c(u.preflight), this._bootstrap = this._preflight, this._availableSlideCount = this._preflight.slideCount;
926
+ return;
927
+ }
928
+ let d = t(u.bootstrap);
929
+ this._bootstrap = d;
930
+ let p = Gt(d.embeddedFonts, (e) => this.getFontBytes(e)).then((e) => {
931
+ this._destroyed ? k(e.faces) : (this._embeddedFontFaces = e.faces, this._embeddedFontAliases = e.aliases, this._embeddedFontAuthoredFamilies = e.authoredFamilies, this._embeddedFontTuples = e.tuples);
932
+ });
933
+ p.catch(() => void 0), this._slidePullClient = new f({
934
+ slideCount: d.slideCount,
935
+ transport: this._bridge.transport(s),
936
+ open: async (e, t, n) => {
937
+ await this._bridge.request((n) => ({
938
+ kind: "openSlideSession",
939
+ id: n,
940
+ slideIndex: e,
941
+ ...t
942
+ }), void 0, { timeoutMs: n });
943
+ },
944
+ onUsage: a
945
+ });
946
+ let m;
947
+ try {
948
+ for (let e = 0; e < d.slideCount; e += 1) await this._slidePullClient.load(e, !1, i);
949
+ m = await this._bridge.request((e) => ({
950
+ kind: "finishPresentationPreflight",
951
+ id: e
952
+ }), void 0, { timeoutMs: i }), await p;
953
+ } catch (e) {
954
+ throw p.catch(() => void 0), e;
955
+ }
956
+ this._preflight = c(m.preflight), this._availableSlideCount = this._preflight.slideCount, this._slides = new Vt({
957
+ slideCount: this._preflight.slideCount,
958
+ maxCachedSlides: 8,
959
+ maxCachedStructuralBytes: ne,
960
+ loadSlide: async (e) => {
961
+ let t = await this._slidePullClient?.load(e, !0, i);
962
+ if (!t) throw Error("PPTX slide pull client is unavailable");
963
+ return t;
964
+ }
965
+ });
966
+ }
967
+ async _parseMainProgressively(e, n, r, i, a, o, s = r) {
968
+ let c = t((await this._bridge.request((t) => ({
969
+ kind: "parse",
970
+ id: t,
971
+ buffer: e,
972
+ resourcePolicy: n,
973
+ cjkFallback: this._cjkFallback,
974
+ progressiveLayout: !0
975
+ }), [e], { timeoutMs: i })).bootstrap);
976
+ this._bootstrap = c;
977
+ let l = Gt(c.embeddedFonts, (e) => this.getFontBytes(e)).then((e) => {
978
+ this._destroyed ? k(e.faces) : (this._embeddedFontFaces = e.faces, this._embeddedFontAliases = e.aliases, this._embeddedFontAuthoredFamilies = e.authoredFamilies, this._embeddedFontTuples = e.tuples);
979
+ });
980
+ l.catch(() => void 0), this._slidePullClient = this._createSlidePullClient(c.slideCount, i, a), this._slides = new Vt({
981
+ slideCount: c.slideCount,
982
+ maxCachedSlides: 8,
983
+ maxCachedStructuralBytes: ne,
984
+ loadSlide: async (e) => {
985
+ let t = await this._slidePullClient?.load(e, !0, i);
986
+ if (!t) throw Error("PPTX slide pull client is unavailable");
987
+ return t;
988
+ }
989
+ });
990
+ let d = new u(c, {
991
+ cjkFallback: this._cjkFallback,
992
+ collectFontDemand: s ? await pt(!0) : void 0
993
+ }), f = async () => {
994
+ await l, r && await this._ensureGoogleFonts(K(d.currentFontPreloadNames, this._embeddedFontAliases), d.currentFontPreloadDemandDelta);
995
+ }, p = (async () => {
996
+ for (let e = 0; e < c.slideCount; e += 1) await this._slides.withSlide(e, (e) => {
997
+ d.addSlide(e);
998
+ }), await f(), this._applyProgressivePrefix(d.snapshot(), o), e === 0 && o.deferred && await ln();
999
+ await l, this._finishProgressiveLayout(d.finish(), o);
1000
+ })();
1001
+ this._layoutCompletion = p.then(() => void 0, (e) => this._failProgressiveLayout(e, o)), await o.firstPublication.promise;
1002
+ }
1003
+ async _parseWorkerProgressively(e, t, n, r, i, a, o) {
1004
+ this._progressiveWatchdogMs = r;
1005
+ let s = this._bridge.request((r) => (this._parseRequestId = r, {
1006
+ kind: "parse",
1007
+ id: r,
1008
+ buffer: e,
1009
+ resourcePolicy: t,
1010
+ useGoogleFonts: n,
1011
+ cjkFallback: this._cjkFallback,
1012
+ renderers: a,
1013
+ progressiveLayout: !0
1014
+ }), [e], { timeoutMs: !1 });
1015
+ this._rearmProgressiveWatchdog(), this._layoutCompletion = s.then((e) => {
1016
+ this._parseRequestId = null;
1017
+ let t = e;
1018
+ t.usage && i?.(t.usage), this._finishProgressiveLayout(c(t.preflight), o);
1019
+ }, (e) => {
1020
+ this._parseRequestId = null, this._failProgressiveLayout(e, o);
1021
+ }), await o.firstPublication.promise;
1022
+ }
1023
+ _createSlidePullClient(e, t, n) {
1024
+ return new f({
1025
+ slideCount: e,
1026
+ transport: this._bridge.transport(s),
1027
+ open: async (e, n, r) => {
1028
+ await this._bridge.request((t) => ({
1029
+ kind: "openSlideSession",
1030
+ id: t,
1031
+ slideIndex: e,
1032
+ ...n
1033
+ }), void 0, { timeoutMs: r ?? t });
1034
+ },
1035
+ onUsage: n
1036
+ });
1037
+ }
1038
+ _onWorkerLayoutPush(e) {
1039
+ if (!$e((e, t) => this._worker.postMessage(e, t), e) && !(!("kind" in e) || e.kind !== "presentationLayoutPartial" || e.forId !== this._parseRequestId || !this._progressive)) try {
1040
+ this._rearmProgressiveWatchdog(), e.usage && this._metrics?.observeUsage(e.usage), e.bootstrap && (this._bootstrap = t(e.bootstrap));
1041
+ let n = this._bootstrap;
1042
+ if (!n) throw Error("PPTX progressive worker published before bootstrap");
1043
+ let r = this._preflight?.slides ?? [];
1044
+ if (e.availableSlides !== r.length + 1 || e.slide.index !== r.length) throw Error("PPTX progressive worker published a non-sequential slide");
1045
+ this._applyProgressivePrefix(d({
1046
+ ...n,
1047
+ slides: [...r, e.slide],
1048
+ fontPreloadNames: e.fontPreloadNames
1049
+ }), this._progressive), ln().then(() => {
1050
+ this._destroyed || this._parseRequestId !== e.forId || this._bridge.post({
1051
+ kind: "continuePresentationPreflight",
1052
+ forId: e.forId,
1053
+ availableSlides: e.availableSlides
1054
+ });
1055
+ }).catch((t) => {
1056
+ this._destroyed || this._parseRequestId !== e.forId || !this._progressive || (this._failProgressiveLayout(t, this._progressive), this._bridge.terminate());
1057
+ });
1058
+ } catch (e) {
1059
+ this._failProgressiveLayout(e, this._progressive), this._bridge.terminate();
1060
+ }
1061
+ }
1062
+ _applyProgressivePrefix(e, t) {
1063
+ if (!(t.settled || this._destroyed)) {
1064
+ if (this._preflight = e, this._availableSlideCount = e.slides.length, !t.published && e.slides.length === e.slideCount) {
1065
+ t.published = !0, t.deferred = !1;
1066
+ return;
1067
+ }
1068
+ if (this._layoutLifecycle.begin(), this._wakeLayoutWaiters(), this._layoutObservers.notify("onLayoutProgress", t.onProgress, { committedUnits: this._availableSlideCount }), Y(this, {
1069
+ availableSlides: this._availableSlideCount,
1070
+ slideCount: this.slideCount,
1071
+ exact: !1,
1072
+ complete: !1
1073
+ }), !t.published) {
1074
+ t.published = !0, t.deferred = e.slides.length < e.slideCount, t.firstPublication.resolve();
1075
+ return;
1076
+ }
1077
+ this._layoutObservers.notify("onLayoutPartial", t.onPartial, {
1078
+ availableUnits: this._availableSlideCount,
1079
+ totalUnits: this.slideCount,
1080
+ exact: !1
1081
+ });
1082
+ }
1083
+ }
1084
+ _finishProgressiveLayout(e, t) {
1085
+ t.settled || this._destroyed || (t.settled = !0, this._clearProgressiveWatchdog(), this._preflight = e, this._bootstrap ??= e, this._availableSlideCount = e.slideCount, this._layoutLifecycle.succeed(), this._wakeLayoutWaiters(), t.firstPublication.resolve(), Y(this, {
1086
+ availableSlides: this._availableSlideCount,
1087
+ slideCount: this.slideCount,
1088
+ exact: !0,
1089
+ complete: !0
1090
+ }), this._layoutObservers.notify("onLayoutComplete", t.onComplete));
1091
+ }
1092
+ _failProgressiveLayout(e, t) {
1093
+ if (t.settled || (t.settled = !0, this._clearProgressiveWatchdog(), this._destroyed)) return;
1094
+ if (!t.deferred) {
1095
+ t.firstPublication.reject(e);
1096
+ return;
1097
+ }
1098
+ let n = this._layoutLifecycle.fail(e);
1099
+ this._wakeLayoutWaiters(), Y(this, {
1100
+ availableSlides: this._availableSlideCount,
1101
+ slideCount: this.slideCount,
1102
+ exact: !1,
1103
+ complete: !1,
1104
+ error: n
1105
+ }), this._layoutObservers.notify("onLayoutComplete", t.onComplete, n);
1106
+ }
1107
+ _wakeLayoutWaiters() {
1108
+ for (let e of this._layoutWaiters) e();
1109
+ this._layoutWaiters.clear();
1110
+ }
1111
+ _rearmProgressiveWatchdog() {
1112
+ this._progressiveWatchdogMs !== void 0 && (clearTimeout(this._progressiveWatchdog), this._progressiveWatchdog = setTimeout(() => {
1113
+ let e = this._progressive, t = this._progressiveWatchdogMs;
1114
+ if (!e || e.settled || t === void 0 || this._destroyed) return;
1115
+ let n = /* @__PURE__ */ Error(`worker layout produced no progress for ${t}ms`);
1116
+ this._failProgressiveLayout(n, e), this._bridge.terminate();
1117
+ }, this._progressiveWatchdogMs));
1118
+ }
1119
+ _clearProgressiveWatchdog() {
1120
+ clearTimeout(this._progressiveWatchdog), this._progressiveWatchdog = void 0, this._progressiveWatchdogMs = void 0;
1121
+ }
1122
+ async _waitForSlide(e) {
1123
+ for (; !this._destroyed && e >= this._availableSlideCount && !this._layoutLifecycle.settled;) await new Promise((e) => this._layoutWaiters.add(e));
1124
+ e >= this._availableSlideCount && await this.waitUntilLayoutComplete();
1125
+ }
1126
+ _assertSlideIndex(e) {
1127
+ if (!Number.isInteger(e) || e < 0 || e >= this.slideCount) throw Error(`Slide index ${e} out of range (count: ${this.slideCount})`);
1128
+ }
1129
+ get slideCount() {
1130
+ return this._bootstrap?.slideCount ?? this._preflight?.slideCount ?? 0;
1131
+ }
1132
+ get availableSlideCount() {
1133
+ return this._availableSlideCount;
1134
+ }
1135
+ get layoutComplete() {
1136
+ return this._layoutLifecycle.complete;
1137
+ }
1138
+ async waitUntilLayoutComplete() {
1139
+ this._layoutCompletion && await this._layoutCompletion, this._layoutLifecycle.throwIfFailed();
1140
+ }
1141
+ get slideWidth() {
1142
+ return this._bootstrap?.slideWidth ?? this._preflight?.slideWidth ?? 0;
1143
+ }
1144
+ get slideHeight() {
1145
+ return this._bootstrap?.slideHeight ?? this._preflight?.slideHeight ?? 0;
1146
+ }
1147
+ get mode() {
1148
+ return this._mode;
1149
+ }
1150
+ getNotes(e) {
1151
+ return Number.isInteger(e) ? this._preflight?.slides[e]?.notes ?? null : null;
1152
+ }
1153
+ getComments(e) {
1154
+ return Number.isInteger(e) ? this._preflight?.slides[e]?.comments ?? [] : [];
1155
+ }
1156
+ isHidden(e) {
1157
+ return Number.isInteger(e) ? this._preflight?.slides[e]?.hidden ?? !1 : !1;
1158
+ }
1159
+ _partNames() {
1160
+ return (this._bootstrap?.slides ?? this._preflight?.slides ?? []).map((e) => e.partName);
1161
+ }
1162
+ _partIndex() {
1163
+ return this._slidePartIndex ||= Nt(this._partNames()), this._slidePartIndex;
1164
+ }
1165
+ getSlideIndexByPartName(e) {
1166
+ return this._partIndex().get(e);
1167
+ }
1168
+ resolveInternalTarget(e, t = 0) {
1169
+ return Ft(e, this._partIndex(), t);
1170
+ }
1171
+ async _officeRoutesForRequests(e, t) {
1172
+ if (this._destroyed) throw Error("Presentation destroyed");
1173
+ if (!t) return {
1174
+ routes: {},
1175
+ installed: []
1176
+ };
1177
+ let n = Ut(e, this._embeddedFontTuples), r = this._officeFontLoads.get(t);
1178
+ r || (r = /* @__PURE__ */ new Map(), this._officeFontLoads.set(t, r));
1179
+ let i = await Lt(r, n, (e) => te(e, t), t);
1180
+ if (this._destroyed) throw Error("Presentation destroyed");
1181
+ return i;
1182
+ }
1183
+ async renderSlide(e, t, n = {}) {
1184
+ this._assertResourceHealthy();
1185
+ try {
1186
+ if (this._mode === "worker") throw Error("renderSlide(canvas) is unavailable in mode: 'worker'; use renderSlideToBitmap() and paint it via an ImageBitmapRenderingContext");
1187
+ if (this._assertSlideIndex(t), await this._waitForSlide(t), this._destroyed) throw Error("Presentation destroyed");
1188
+ let r = this._preflight, i = this._slides;
1189
+ if (!r || !i) throw Error("Presentation not loaded");
1190
+ let a = n.dpr ?? T(), o = n.width ?? ((C(e) ? e.offsetWidth : 0) || 960), s = await i.withSlide(t, (e) => l(e, r.majorFont, r.minorFont));
1191
+ if (this._destroyed) throw Error("Presentation destroyed");
1192
+ let c = C(e) ? e.ownerDocument.fonts : typeof document < "u" ? document.fonts : null, { routes: u, installed: d } = await this._officeRoutesForRequests(s, c);
1193
+ await i.withSlide(t, (t) => {
1194
+ if (this._destroyed) throw Error("Presentation destroyed");
1195
+ return this._assertResourceHealthy(), p(e, t, r.slideWidth, r.slideHeight, {
1196
+ width: o,
1197
+ dpr: a,
1198
+ defaultTextColor: r.defaultTextColor,
1199
+ cjkFallback: this._cjkFallback,
1200
+ majorFont: r.majorFont,
1201
+ minorFont: r.minorFont,
1202
+ hlinkColor: r.hlinkColor,
1203
+ embeddedFontAliases: this._embeddedFontAliases,
1204
+ embeddedFontAuthoredFamilies: this._embeddedFontAuthoredFamilies,
1205
+ embeddedFontTuples: this._embeddedFontTuples,
1206
+ officeFontRoutes: u,
1207
+ officeInstalledFamilies: d,
1208
+ googleSubstitutes: this._googleSubstitutes,
1209
+ fetchMedia: this._fetchMedia,
1210
+ fetchImage: this._fetchImage,
1211
+ skipMediaControls: n.skipMediaControls,
1212
+ dim: n.dim,
1213
+ math: this._math,
1214
+ threeD: this._threeD,
1215
+ regionMap: this._regionMap,
1216
+ chartEx: this._chartEx,
1217
+ tiff: this._tiff,
1218
+ imageResources: n.imageResources
1219
+ }, n.onTextRun);
1220
+ });
1221
+ } catch (e) {
1222
+ this._rethrowWithResourceFailure(e);
1223
+ }
1224
+ }
1225
+ async renderSlideToBitmap(e, t = {}) {
1226
+ this._assertResourceHealthy();
1227
+ try {
1228
+ this._assertSlideIndex(e), await this._waitForSlide(e);
1229
+ let n = t.width ?? 960, r = t.dpr ?? T();
1230
+ if (this._mode === "worker") {
1231
+ let i = new OffscreenCanvas(1, 1), a = await this._bridge.request((a) => ({
1232
+ kind: "renderSlide",
1233
+ id: a,
1234
+ slideIndex: e,
1235
+ width: n,
1236
+ dpr: r,
1237
+ imageResources: t.imageResources,
1238
+ skipMediaControls: t.skipMediaControls,
1239
+ dim: t.dim,
1240
+ canvas: i
1241
+ }), [i]);
1242
+ try {
1243
+ if (t.onTextRun) for (let e of a.runs) t.onTextRun(e);
1244
+ } catch (e) {
1245
+ throw oe(a.bitmap), e;
1246
+ }
1247
+ return a.bitmap;
1248
+ }
1249
+ let i = new OffscreenCanvas(1, 1);
1250
+ return await this.renderSlide(i, e, {
1251
+ width: n,
1252
+ dpr: r,
1253
+ imageResources: t.imageResources,
1254
+ skipMediaControls: t.skipMediaControls,
1255
+ dim: t.dim,
1256
+ onTextRun: t.onTextRun
1257
+ }), i.transferToImageBitmap();
1258
+ } catch (e) {
1259
+ this._rethrowWithResourceFailure(e);
1260
+ }
1261
+ }
1262
+ async collectSlideRuns(e, t = 960) {
1263
+ this._assertResourceHealthy();
1264
+ try {
1265
+ if (this._assertSlideIndex(e), await this._waitForSlide(e), this._mode === "worker") {
1266
+ let n = new OffscreenCanvas(1, 1);
1267
+ return (await this._bridge.request((r) => ({
1268
+ kind: "collectRuns",
1269
+ id: r,
1270
+ slideIndex: e,
1271
+ width: t,
1272
+ canvas: n
1273
+ }), [n])).runs;
1274
+ }
1275
+ let n = [], r = new OffscreenCanvas(1, 1);
1276
+ return await this.renderSlide(r, e, {
1277
+ width: t,
1278
+ onTextRun: (e) => n.push(e)
1279
+ }), n;
1280
+ } catch (e) {
1281
+ this._rethrowWithResourceFailure(e);
1282
+ }
1283
+ }
1284
+ async getElementContextAt(e, t, n = {}) {
1285
+ this._assertResourceHealthy(), this._assertSlideIndex(e);
1286
+ try {
1287
+ if (await this._waitForSlide(e), this._mode === "worker") return (await this._bridge.request((r) => ({
1288
+ kind: "hitTestElement",
1289
+ id: r,
1290
+ slideIndex: e,
1291
+ point: t,
1292
+ options: n
1293
+ }))).context;
1294
+ if (!this._slides) throw Error("Presentation not loaded");
1295
+ return await this._slides.withSlide(e, (r) => on(e, r, t, n));
1296
+ } catch (e) {
1297
+ this._rethrowWithResourceFailure(e);
1298
+ }
1299
+ }
1300
+ async getElementBoundsByIds(e, t) {
1301
+ this._assertResourceHealthy(), this._assertSlideIndex(e);
1302
+ let n = Object.freeze(t.filter((e) => typeof e == "string" && e.length > 0));
1303
+ if (n.length === 0) return Object.freeze([]);
1304
+ try {
1305
+ if (await this._waitForSlide(e), this._mode === "worker") return (await this._bridge.request((t) => ({
1306
+ kind: "resolveElementBounds",
1307
+ id: t,
1308
+ slideIndex: e,
1309
+ elementIds: n
1310
+ }))).bounds;
1311
+ if (!this._slides) throw Error("Presentation not loaded");
1312
+ return await this._slides.withSlide(e, (e) => sn(e, n));
1313
+ } catch (e) {
1314
+ this._rethrowWithResourceFailure(e);
1315
+ }
1316
+ }
1317
+ async getMedia(e) {
1318
+ this._assertResourceHealthy();
1319
+ try {
1320
+ let t = this._findMimeTypeForPath(e);
1321
+ return await this._rawParts.get(e, t, async () => {
1322
+ let n = (await this._bridge.request((t) => ({
1323
+ kind: "extractMedia",
1324
+ id: t,
1325
+ path: e
1326
+ }))).bytes;
1327
+ return new Blob([n], { type: t });
1328
+ });
1329
+ } catch (e) {
1330
+ this._rethrowWithResourceFailure(e);
1331
+ }
1332
+ }
1333
+ _findMimeTypeForPath(e) {
1334
+ return this._preflight ? a(this._preflight, e) : "";
1335
+ }
1336
+ async getImage(e, t) {
1337
+ this._assertResourceHealthy();
1338
+ try {
1339
+ return await this._rawParts.get(e, t, async () => {
1340
+ let n = (await this._bridge.request((t) => ({
1341
+ kind: "extractImage",
1342
+ id: t,
1343
+ path: e
1344
+ }))).bytes;
1345
+ return new Blob([n], { type: t });
1346
+ });
1347
+ } catch (e) {
1348
+ this._rethrowWithResourceFailure(e);
1349
+ }
1350
+ }
1351
+ async getFontBytes(e) {
1352
+ this._assertResourceHealthy();
1353
+ try {
1354
+ let t = await this._bridge.request((t) => ({
1355
+ kind: "extractFont",
1356
+ id: t,
1357
+ path: e
1358
+ }));
1359
+ return new Uint8Array(t.bytes);
1360
+ } catch (e) {
1361
+ this._rethrowWithResourceFailure(e);
1362
+ }
1363
+ }
1364
+ async getResourceMetrics() {
1365
+ let e = this._metrics;
1366
+ if (!e) throw Error("Presentation not loaded");
1367
+ return y(e, async (e) => (await this._bridge.request((e) => ({
1368
+ kind: "resourceUsage",
1369
+ id: e
1370
+ }), void 0, { timeoutMs: e })).usage);
1371
+ }
1372
+ async toMarkdown() {
1373
+ this._assertResourceHealthy();
1374
+ try {
1375
+ return (await this._bridge.request((e) => ({
1376
+ kind: "toMarkdown",
1377
+ id: e
1378
+ }))).markdown;
1379
+ } catch (e) {
1380
+ this._rethrowWithResourceFailure(e);
1381
+ }
1382
+ }
1383
+ async presentSlide(e, t, n = {}) {
1384
+ this._assertResourceHealthy();
1385
+ try {
1386
+ if (this._assertSlideIndex(t), await this._waitForSlide(t), !this._preflight) throw Error("Presentation not loaded");
1387
+ let r = n.dpr ?? T(), i = n.width ?? (e.offsetWidth || 960), a = this.slideWidth > 0 ? i * this.slideHeight / this.slideWidth : 0;
1388
+ e.style.width = `${Math.round(i)}px`, e.style.height = `${Math.round(a)}px`, e.style.display || (e.style.display = "block");
1389
+ let o = this._mode === "worker" ? async () => {
1390
+ let a = await this.renderSlideToBitmap(t, {
1391
+ width: i,
1392
+ dpr: r,
1393
+ imageResources: n.imageResources,
1394
+ skipMediaControls: !0,
1395
+ dim: n.dim,
1396
+ onTextRun: n.onTextRun
1397
+ });
1398
+ try {
1399
+ e.width = a.width, e.height = a.height;
1400
+ let t = e.getContext("2d");
1401
+ if (!t) throw Error("2D context not available");
1402
+ t.drawImage(a, 0, 0);
1403
+ } finally {
1404
+ oe(a);
1405
+ }
1406
+ } : () => this.renderSlide(e, t, {
1407
+ width: i,
1408
+ dpr: r,
1409
+ imageResources: n.imageResources,
1410
+ skipMediaControls: !0,
1411
+ dim: n.dim,
1412
+ onTextRun: n.onTextRun
1413
+ });
1414
+ return await vt(e, this._preflight.slides[t]?.mediaElements ?? [], {
1415
+ width: i,
1416
+ height: a,
1417
+ slideWidthEmu: this.slideWidth,
1418
+ fetchMedia: this._fetchMedia,
1419
+ fetchImage: this._fetchImage,
1420
+ drawBase: o,
1421
+ onError: n.onError
1422
+ });
1423
+ } catch (e) {
1424
+ this._rethrowWithResourceFailure(e);
1425
+ }
1426
+ }
1427
+ destroy() {
1428
+ this._destroyed = !0, this._clearProgressiveWatchdog(), this._slidePullClient?.cancelAll(), this._bridge.terminate(), this._slides?.clear(), this._slides = null, this._slidePullClient = null, this._bootstrap = null, this._preflight = null, this._availableSlideCount = 0, this._layoutLifecycle.succeed(), this._layoutCompletion = null, this._progressive = null, this._parseRequestId = null, this._wakeLayoutWaiters(), this._resourceFailure = null, this._slidePartIndex = null, this._rawParts.clear(), this._googleFonts?.release(), this._googleFonts = null;
1429
+ for (let e of this._officeFontLoads.values()) for (let t of Bt(e)) t.then((e) => w(e.faces));
1430
+ this._officeFontLoads.clear(), this._embeddedFontFaces.length > 0 && (k(this._embeddedFontFaces), this._embeddedFontFaces = []), this._embeddedFontAliases = /* @__PURE__ */ new Map(), this._embeddedFontAuthoredFamilies = /* @__PURE__ */ new Map(), this._embeddedFontTuples = /* @__PURE__ */ new Set(), ae(this._fetchImage), ce(this._fetchImage);
1431
+ }
1432
+ };
1433
+ function un(e, t, n, r, i = {}) {
1434
+ let a = Fe({
1435
+ id: e.id,
1436
+ author: e.author,
1437
+ date: e.date,
1438
+ text: e.text,
1439
+ status: e.status ?? "active"
1440
+ }, (e.replies ?? []).map((e) => ({
1441
+ id: e.id,
1442
+ author: e.author,
1443
+ date: e.date,
1444
+ text: e.text,
1445
+ status: e.status ?? "active"
1446
+ })), i.maxTextCharacters);
1447
+ return Object.freeze({
1448
+ format: "pptx",
1449
+ kind: "comment",
1450
+ slideIndex: t,
1451
+ commentIndex: n,
1452
+ occurrenceId: r,
1453
+ ...e.id ? { commentId: e.id } : {},
1454
+ ...Number.isFinite(e.x) && Number.isFinite(e.y) ? { point: Object.freeze({
1455
+ x: e.x,
1456
+ y: e.y
1457
+ }) } : {},
1458
+ thread: a.thread,
1459
+ truncated: a.truncated,
1460
+ truncationReasons: a.truncated ? ["text"] : [],
1461
+ textCharacters: a.textCharacters,
1462
+ maxTextCharacters: a.maxTextCharacters
1463
+ });
1464
+ }
1465
+ function dn(e) {
1466
+ for (let t = e; t; t = t.parentElement) {
1467
+ let e = j(t.dataset.slideIndex);
1468
+ if (e !== null) return e;
1469
+ }
1470
+ return null;
1471
+ }
1472
+ function Z(e, t, n = {}) {
1473
+ let r = Ue(e, t, (e) => {
1474
+ let t = dn(e), n = j(e.dataset.runIndex);
1475
+ if (t === null || n === null) return null;
1476
+ let r = j(e.dataset.elementIndex), i = e.dataset.elementOrigin, a = r !== null && (i === "master" || i === "layout" || i === "slide");
1477
+ return {
1478
+ slideIndex: t,
1479
+ runIndex: n,
1480
+ ...e.dataset.shapeId === void 0 ? {} : { shapeId: e.dataset.shapeId },
1481
+ ...a ? {
1482
+ elementIndex: r,
1483
+ origin: i
1484
+ } : {}
1485
+ };
1486
+ }, {
1487
+ maxChars: n.maxTextCharacters,
1488
+ maxLocators: n.maxRunLocators
1489
+ });
1490
+ if (!r) return null;
1491
+ let i = [...r.locators].sort((e, t) => e.slideIndex - t.slideIndex || e.runIndex - t.runIndex);
1492
+ return {
1493
+ format: "pptx",
1494
+ kind: "text",
1495
+ text: r.text,
1496
+ slideIndexes: [...new Set(i.map((e) => e.slideIndex))],
1497
+ shapeIds: [...new Set(i.flatMap((e) => e.shapeId ? [e.shapeId] : []))],
1498
+ runs: i,
1499
+ truncated: r.truncated,
1500
+ truncationReasons: r.truncationReasons,
1501
+ textCharacters: r.textCharacters,
1502
+ maxTextCharacters: r.maxTextCharacters,
1503
+ maxRunLocators: r.maxLocators
1504
+ };
1505
+ }
1506
+ function Q(e, t, n, r, i) {
1507
+ return r === "worker" ? e.renderSlideToBitmap(n, i) : e.renderSlide(t, n, i);
1508
+ }
1509
+ function fn(e) {
1510
+ let t = e.ownerDocument ?? document, n = new qe(e, "Loading slide"), r = n.layer;
1511
+ r.style.backdropFilter = "blur(2px)";
1512
+ let i = t.createElement("span");
1513
+ return i.className = "ooxml-pptx-progress-circle", i.style.cssText = [
1514
+ "width:34px",
1515
+ "height:34px",
1516
+ "box-sizing:border-box",
1517
+ "border-radius:50%",
1518
+ "border:3px solid var(--border-bright, rgba(100,116,139,0.28))",
1519
+ "border-top-color:var(--signal, #12bfd8)",
1520
+ "box-shadow:0 2px 10px rgba(15,23,42,0.08)"
1521
+ ].join(";"), i.setAttribute("aria-hidden", "true"), r.appendChild(i), !(t.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1) && typeof i.animate == "function" && i.animate([{ transform: "rotate(0deg)" }, { transform: "rotate(360deg)" }], {
1522
+ duration: 800,
1523
+ iterations: Infinity,
1524
+ easing: "linear"
1525
+ }), n;
1526
+ }
1527
+ var pn = Symbol("PptxViewer.borrowedPresentation"), mn = {
1528
+ color: "#ffffff",
1529
+ opacity: .6
1530
+ }, hn = class e {
1531
+ canvas;
1532
+ wrapper;
1533
+ canvasMount;
1534
+ _scale = null;
1535
+ textLayer = null;
1536
+ highlightLayer = null;
1537
+ elementLayer = null;
1538
+ _find;
1539
+ _findGeneration = 0;
1540
+ _measureCtx = null;
1541
+ presentationOwner;
1542
+ get engine() {
1543
+ return this.presentationOwner.current;
1544
+ }
1545
+ borrowed;
1546
+ hostWindow;
1547
+ opts;
1548
+ currentSlide = 0;
1549
+ _renderedSlide = -1;
1550
+ _hiddenMode;
1551
+ handle = null;
1552
+ _mode;
1553
+ renderDispatcher;
1554
+ errorRouter;
1555
+ destroyed = !1;
1556
+ selectionChangeListener = null;
1557
+ selectionContextKey = "null";
1558
+ elementClickListener = null;
1559
+ contextMenuListener = null;
1560
+ elementContext = null;
1561
+ elementHitGeneration = 0;
1562
+ elementHitTolerance;
1563
+ _loadingIndicator;
1564
+ _layoutUnsubscribe = null;
1565
+ _layoutWaiters = /* @__PURE__ */ new Set();
1566
+ _layoutFailed = !1;
1567
+ _navigationGeneration = 0;
1568
+ _renderProgressGeneration = 0;
1569
+ _lastReportedSlide = -1;
1570
+ _lastReportedTotal = -1;
1571
+ _lastReportedAvailable = -1;
1572
+ _lastReportedLayoutComplete = null;
1573
+ static fromPresentation(t, n, r = {}) {
1574
+ return new e(t, {
1575
+ ...r,
1576
+ [pn]: n
1577
+ });
1578
+ }
1579
+ constructor(e, t = {}) {
1580
+ this.opts = t, this.canvas = e;
1581
+ let n = t[pn];
1582
+ this.borrowed = n !== void 0, this._mode = F("PptxViewer", t.mode, n), this.presentationOwner = new P("PptxViewer", n ?? null, !1);
1583
+ let r = e.ownerDocument?.defaultView ?? (typeof window < "u" ? window : null);
1584
+ if (!r) throw Error("PptxViewer requires a canvas with an active Window");
1585
+ this.hostWindow = r;
1586
+ let i = t.elementHitTolerance ?? 6;
1587
+ if (!Number.isFinite(i) || i < 0) throw RangeError("elementHitTolerance must be a finite non-negative number.");
1588
+ this.elementHitTolerance = i, this._hiddenMode = t.hiddenSlideMode ?? "show", this.canvasMount = new Ze(e, {
1589
+ wrapperCssText: "position:relative;display:inline-block;vertical-align:top;",
1590
+ forceDisplayBlock: !0
1591
+ }), this.wrapper = this.canvasMount.wrapper, this.renderDispatcher = new N(e, this._mode === "worker" && !t.enableMediaPlayback), this.errorRouter = new Ge("PptxViewer", t.onError);
1592
+ let a = new Ye(this.wrapper, t.enableTextSelection === !0, t.enableElementSelection === !0);
1593
+ this.textLayer = a.textLayer, this.highlightLayer = a.highlightLayer, this.elementLayer = a.elementLayer, this._loadingIndicator = fn(this.wrapper), this.wrapper.insertBefore(this._loadingIndicator.layer, this.elementLayer), this.textLayer && (t.onSelectionContextChange || t.enableElementSelection) && (this.selectionChangeListener = () => this._emitSelectionContextChange(), this.wrapper.ownerDocument.addEventListener("selectionchange", this.selectionChangeListener)), t.enableElementSelection && (this.elementClickListener = (e) => {
1594
+ this._onElementClick(e).catch((e) => this._reportRenderError(e));
1595
+ }, this.wrapper.addEventListener("click", this.elementClickListener)), t.onContextMenu && (this.contextMenuListener = (e) => this._onContextMenu(e), this.wrapper.addEventListener("contextmenu", this.contextMenuListener)), this._find = new ft(() => this.slideCount, (e) => this._collectSlideRuns(e)), n && this._bindLayoutPresentation(n);
1596
+ }
1597
+ async load(e) {
1598
+ if (this.destroyed) throw Error("PptxViewer is destroyed");
1599
+ if (this.borrowed) throw Error("PptxViewer.load() is unsupported on a Viewer created by fromPresentation(); the borrowed presentation is already loaded.");
1600
+ let t = !1;
1601
+ try {
1602
+ let n = await this.presentationOwner.replace(() => X.load(e, {
1603
+ password: this.opts.password,
1604
+ useGoogleFonts: this.opts.useGoogleFonts,
1605
+ cjkFallback: this.opts.cjkFallback,
1606
+ maxZipEntryBytes: this.opts.maxZipEntryBytes,
1607
+ resourceLimits: this.opts.resourceLimits,
1608
+ debug: this.opts.debug,
1609
+ onResourceMetrics: this.opts.onResourceMetrics,
1610
+ workerTimeoutMs: this.opts.workerTimeoutMs,
1611
+ wasmUrl: this.opts.wasmUrl,
1612
+ math: this.opts.math,
1613
+ threeD: this.opts.threeD,
1614
+ regionMap: this.opts.regionMap,
1615
+ chartEx: this.opts.chartEx,
1616
+ tiff: this.opts.tiff,
1617
+ mode: this._mode,
1618
+ ...this.opts.legacyPpt === void 0 ? void 0 : { legacyPpt: this.opts.legacyPpt },
1619
+ progressiveLayout: this.opts.progressiveLayout,
1620
+ onLayoutProgress: this.opts.onLayoutProgress,
1621
+ onLayoutPartial: this.opts.onLayoutPartial,
1622
+ onLayoutComplete: this.opts.onLayoutComplete
1623
+ }), () => {
1624
+ this._invalidateElementSelection(!1), t = !0, this.renderDispatcher.begin(), this._invalidateFind(), this.handle?.destroy(), this.handle = null, this._unbindLayoutPresentation();
1625
+ });
1626
+ if (!n) return;
1627
+ if (this.destroyed) throw Error("PptxViewer is destroyed");
1628
+ this._bindLayoutPresentation(n);
1629
+ let r = this._beginNavigation();
1630
+ if (this.currentSlide = await this._initialSlide(r), r !== this._navigationGeneration || n !== this.engine) return;
1631
+ this._renderedSlide = -1, this._invalidateFind(), await this.renderCurrentSlide();
1632
+ } catch (e) {
1633
+ throw this.destroyed ? Error("PptxViewer is destroyed") : e instanceof Error ? e : Error(String(e));
1634
+ }
1635
+ t && !this.destroyed && this._emitSelectionContextChange();
1636
+ }
1637
+ async goToSlide(e) {
1638
+ let t = this._beginNavigation();
1639
+ await this._goToSlide(e, t);
1640
+ }
1641
+ async _goToSlide(e, t) {
1642
+ if (t !== this._navigationGeneration || !this.engine || this.slideCount === 0) return;
1643
+ let n = Math.max(0, Math.min(e, this.slideCount - 1)), r = n !== this.currentSlide;
1644
+ r && this._invalidateElementSelection(!1), this.currentSlide = n, await this.renderCurrentSlide(), r && !this.destroyed && this._emitSelectionContextChange();
1645
+ }
1646
+ async nextSlide() {
1647
+ let e = this._beginNavigation(), t = await this._step(1, e);
1648
+ await this._goToSlide(t, e);
1649
+ }
1650
+ async prevSlide() {
1651
+ let e = this._beginNavigation(), t = await this._step(-1, e);
1652
+ await this._goToSlide(t, e);
1653
+ }
1654
+ async _step(e, t) {
1655
+ let n = this.engine, r = this.currentSlide;
1656
+ if (this._hiddenMode !== "skip" || !n) return r + e;
1657
+ for (let i = r + e; i >= 0 && i < this.slideCount; i += e) {
1658
+ if (i >= n.availableSlideCount && (n.layoutComplete || this._setLoading(!0), !await this._waitForSlide(n, i, () => t === this._navigationGeneration))) return r;
1659
+ if (!n.isHidden(i)) return i;
1660
+ }
1661
+ return r;
1662
+ }
1663
+ async _initialSlide(e) {
1664
+ let t = this.engine;
1665
+ if (this._hiddenMode !== "skip" || !t || this.slideCount === 0 || t.availableSlideCount === 0 && !await this._waitForSlide(t, 0, () => e === this._navigationGeneration) || !t.isHidden(0)) return 0;
1666
+ let n = await this._step(1, e);
1667
+ return n === 0 ? 0 : n;
1668
+ }
1669
+ _dim() {
1670
+ return {
1671
+ color: this.opts.hiddenSlideDim?.color ?? mn.color,
1672
+ opacity: this.opts.hiddenSlideDim?.opacity ?? mn.opacity
1673
+ };
1674
+ }
1675
+ async setHiddenSlideMode(e) {
1676
+ let t = this._beginNavigation();
1677
+ this._hiddenMode = e;
1678
+ let n = this.currentSlide;
1679
+ if (e === "skip" && this.engine) {
1680
+ let e = this.engine;
1681
+ if (this.currentSlide >= e.availableSlideCount && !await this._waitForSlide(e, this.currentSlide, () => t === this._navigationGeneration)) return;
1682
+ e.isHidden(this.currentSlide) && (n = await this._step(1, t), n === this.currentSlide && (n = await this._step(-1, t)));
1683
+ }
1684
+ if (t !== this._navigationGeneration) return;
1685
+ let r = n !== this.currentSlide;
1686
+ r && this._invalidateElementSelection(!1), this.currentSlide = n, await this.renderCurrentSlide(), r && !this.destroyed && this._emitSelectionContextChange();
1687
+ }
1688
+ get hiddenSlideMode() {
1689
+ return this._hiddenMode;
1690
+ }
1691
+ get visibleSlideCount() {
1692
+ if (!this.engine) return 0;
1693
+ let e = this.engine;
1694
+ return rt((t) => e.isHidden(t), this.slideCount);
1695
+ }
1696
+ get slideIndex() {
1697
+ return this.currentSlide;
1698
+ }
1699
+ get slideCount() {
1700
+ return this.engine?.slideCount ?? 0;
1701
+ }
1702
+ get availableSlideCount() {
1703
+ return this.engine?.availableSlideCount ?? this.slideCount;
1704
+ }
1705
+ get layoutComplete() {
1706
+ return this.engine?.layoutComplete ?? !0;
1707
+ }
1708
+ async waitUntilLayoutComplete() {
1709
+ await this.errorRouter.ownBackgroundLifecycle(async () => {
1710
+ await this.engine?.waitUntilLayoutComplete?.();
1711
+ });
1712
+ }
1713
+ getNotes(e) {
1714
+ return this.engine?.getNotes(e) ?? null;
1715
+ }
1716
+ get canvasElement() {
1717
+ return this.canvas;
1718
+ }
1719
+ _naturalWidthPx() {
1720
+ let e = this.engine?.slideWidth ?? 0;
1721
+ return e > 0 ? e / m : 0;
1722
+ }
1723
+ _targetWidth() {
1724
+ if (this._scale === null) return this.opts.width ?? (this.canvas.offsetWidth || 960);
1725
+ let e = this._naturalWidthPx();
1726
+ return e <= 0 ? this.opts.width ?? (this.canvas.offsetWidth || 960) : Math.round(e * this._scale);
1727
+ }
1728
+ getScale() {
1729
+ if (this._scale !== null) return this._scale;
1730
+ let e = this._naturalWidthPx();
1731
+ return e <= 0 ? 1 : this._targetWidth() / e;
1732
+ }
1733
+ _zoomMin() {
1734
+ return this.opts.zoomMin ?? .1;
1735
+ }
1736
+ _zoomMax() {
1737
+ return this.opts.zoomMax ?? 4;
1738
+ }
1739
+ async setScale(e) {
1740
+ let t = Qe(e, this._zoomMin(), this._zoomMax()), n = t !== this.getScale();
1741
+ this._scale = t, await this.renderCurrentSlide(), n && this.opts.onScaleChange?.(t);
1742
+ }
1743
+ async zoomIn() {
1744
+ await this.setScale(He(this.getScale()));
1745
+ }
1746
+ async zoomOut() {
1747
+ await this.setScale(et(this.getScale()));
1748
+ }
1749
+ async fitWidth() {
1750
+ await this._fit("width");
1751
+ }
1752
+ async fitPage() {
1753
+ await this._fit("page");
1754
+ }
1755
+ async _fit(e) {
1756
+ if (!this.engine) return;
1757
+ let t = this.wrapper.parentElement;
1758
+ if (!t) return;
1759
+ let n = tt({
1760
+ contentWidth: this.engine.slideWidth / m,
1761
+ contentHeight: this.engine.slideHeight / m,
1762
+ containerWidth: t.clientWidth,
1763
+ containerHeight: t.clientHeight
1764
+ }, e);
1765
+ n <= 0 || await this.setScale(n);
1766
+ }
1767
+ async renderCurrentSlide() {
1768
+ let e = this.engine;
1769
+ if (!e) return;
1770
+ let t = this.currentSlide, n = ++this._renderProgressGeneration;
1771
+ this._setLoading(t >= this.availableSlideCount && !this.layoutComplete);
1772
+ let r = this.renderDispatcher.begin();
1773
+ try {
1774
+ if (t >= e.availableSlideCount && !await this._waitForSlide(e, t, () => n === this._renderProgressGeneration && this.renderDispatcher.isCurrent(r) && e === this.engine && t === this.currentSlide)) return;
1775
+ let i = this._hiddenMode === "dim" && e.isHidden(t) ? this._dim() : void 0, a = this._targetWidth(), o = this.opts.dpr ?? T(), s = a / e.slideWidth, c = Math.round(e.slideHeight * s);
1776
+ this.canvas.style.width = `${a}px`, this.canvas.style.height = `${c}px`, this.handle?.destroy(), this.handle = null;
1777
+ let l = this._mode === "worker", u = [], d = (e) => u.push(e);
1778
+ if (this.opts.enableMediaPlayback) {
1779
+ let n = await e.presentSlide(this.canvas, t, {
1780
+ width: a,
1781
+ dpr: o,
1782
+ imageResources: this.opts.imageResources,
1783
+ dim: i,
1784
+ onTextRun: d,
1785
+ onError: (e) => {
1786
+ this.renderDispatcher.isCurrent(r) && this._reportRenderError(e);
1787
+ }
1788
+ });
1789
+ if (!this.renderDispatcher.isCurrent(r)) {
1790
+ n.destroy();
1791
+ return;
1792
+ }
1793
+ this.handle = n;
1794
+ } else if (l) {
1795
+ let e = await Q(this.engine, this.canvas, t, "worker", {
1796
+ width: a,
1797
+ dpr: o,
1798
+ imageResources: this.opts.imageResources,
1799
+ dim: i,
1800
+ onTextRun: d
1801
+ });
1802
+ if (!this.renderDispatcher.commitBitmap(r, e)) return;
1803
+ } else if (await Q(this.engine, this.canvas, t, "main", {
1804
+ width: a,
1805
+ dpr: o,
1806
+ imageResources: this.opts.imageResources,
1807
+ onTextRun: d,
1808
+ dim: i
1809
+ }), !this.renderDispatcher.isCurrent(r)) return;
1810
+ this._renderedSlide = t, this._emitSlideChange(!0), this.textLayer && this._buildTextLayer(this.textLayer, u, a, c), this._find.setSlideRuns(t, u), this._buildHighlightLayer(u, a, c);
1811
+ } catch (t) {
1812
+ if (!this.renderDispatcher.isCurrent(r) && !(e === this.engine && this._layoutFailed)) return;
1813
+ throw t;
1814
+ } finally {
1815
+ n === this._renderProgressGeneration && this._setLoading(!1);
1816
+ }
1817
+ }
1818
+ _bindLayoutPresentation(e) {
1819
+ this._unbindLayoutPresentation(), this._layoutFailed = !1;
1820
+ let t = !0;
1821
+ this._layoutUnsubscribe = cn(e, () => ({
1822
+ availableSlides: e.availableSlideCount,
1823
+ slideCount: e.slideCount,
1824
+ exact: e.layoutComplete,
1825
+ complete: e.layoutComplete
1826
+ }), (n) => {
1827
+ if (t) {
1828
+ t = !1;
1829
+ return;
1830
+ }
1831
+ this._onLayoutPublication(e, n);
1832
+ }, (e) => this._reportRenderError(e));
1833
+ }
1834
+ _unbindLayoutPresentation() {
1835
+ this._layoutUnsubscribe?.(), this._layoutUnsubscribe = null, this._layoutFailed = !1, this._navigationGeneration++, this._renderProgressGeneration++, this._wakeLayoutWaiters(), this._setLoading(!1);
1836
+ }
1837
+ _beginNavigation() {
1838
+ let e = ++this._navigationGeneration;
1839
+ return this._wakeLayoutWaiters(), e;
1840
+ }
1841
+ _onLayoutPublication(e, t) {
1842
+ if (!(this.destroyed || e !== this.engine)) {
1843
+ if (this._wakeLayoutWaiters(), t.error !== void 0) {
1844
+ this._layoutFailed = !0, this.errorRouter.reportBackground(t.error, this.opts.onLayoutComplete !== void 0);
1845
+ return;
1846
+ }
1847
+ this._renderedSlide === this.currentSlide && this._emitSlideChange();
1848
+ }
1849
+ }
1850
+ async _waitForSlide(e, t, n) {
1851
+ return await this.errorRouter.ownBackgroundLifecycle(async () => {
1852
+ for (; !this.destroyed && n() && e === this.engine && t >= e.availableSlideCount && !e.layoutComplete && !this._layoutFailed;) await new Promise((e) => this._layoutWaiters.add(e));
1853
+ return this.destroyed || e !== this.engine || ((e.layoutComplete || this._layoutFailed) && await e.waitUntilLayoutComplete?.(), !n()) ? !1 : t < e.availableSlideCount;
1854
+ });
1855
+ }
1856
+ _wakeLayoutWaiters() {
1857
+ for (let e of this._layoutWaiters) e();
1858
+ this._layoutWaiters.clear();
1859
+ }
1860
+ _emitSlideChange(e = !1) {
1861
+ let t = this.slideCount, n = this.availableSlideCount, r = this.layoutComplete;
1862
+ !e && this.currentSlide === this._lastReportedSlide && t === this._lastReportedTotal && n === this._lastReportedAvailable && r === this._lastReportedLayoutComplete || (this._lastReportedSlide = this.currentSlide, this._lastReportedTotal = t, this._lastReportedAvailable = n, this._lastReportedLayoutComplete = r, this.opts.onSlideChange?.(this.currentSlide, t, r));
1863
+ }
1864
+ _setLoading(e) {
1865
+ this._loadingIndicator.setLoading(e);
1866
+ }
1867
+ _buildHighlightLayer(e, t, n) {
1868
+ let r = this.highlightLayer;
1869
+ r && R(r, e, this._find.slideHighlights(this.currentSlide), t, n, (e) => this._measureForFont(e), this.opts.findHighlightColors);
1870
+ }
1871
+ _measureForFont(e) {
1872
+ if (!this._measureCtx) {
1873
+ let e = document.createElement("canvas");
1874
+ this._measureCtx = e.getContext("2d");
1875
+ }
1876
+ let t = this._measureCtx;
1877
+ return t ? (t.font = e, (e) => t.measureText(e).width) : (e) => e.length;
1878
+ }
1879
+ async _collectSlideRuns(e) {
1880
+ return this.engine ? this.engine.collectSlideRuns(e, this._targetWidth()) : [];
1881
+ }
1882
+ async findText(e, t = {}) {
1883
+ let n = this.engine;
1884
+ if (!n) return [];
1885
+ let r = ++this._findGeneration;
1886
+ if (e.length === 0) return this._find.invalidate(), this._redrawHighlights(), [];
1887
+ if (n.layoutComplete || await this.errorRouter.ownBackgroundLifecycle(() => n.waitUntilLayoutComplete()), this.destroyed || r !== this._findGeneration || n !== this.engine) return [];
1888
+ let i = await this.errorRouter.ownAwaitable(() => this._find.find(e, t));
1889
+ return this.destroyed || r !== this._findGeneration || n !== this.engine ? [] : (this._redrawHighlights(), i);
1890
+ }
1891
+ async findNext() {
1892
+ return this._activateMatch(this._find.next());
1893
+ }
1894
+ async findPrev() {
1895
+ return this._activateMatch(this._find.prev());
1896
+ }
1897
+ clearFind() {
1898
+ this._invalidateFind(), this._redrawHighlights();
1899
+ }
1900
+ _invalidateFind() {
1901
+ this._findGeneration++, this._find.invalidate();
1902
+ }
1903
+ async _activateMatch(e) {
1904
+ return e ? (e.location.slide === this.currentSlide ? this._redrawHighlights() : await this.goToSlide(e.location.slide), e) : (this._redrawHighlights(), null);
1905
+ }
1906
+ _redrawHighlights() {
1907
+ let e = this._find.slideRuns(this.currentSlide) ?? [], t = this._targetWidth(), n = this.engine ? Math.round(this.engine.slideHeight * (t / this.engine.slideWidth)) : 0;
1908
+ this._buildHighlightLayer(e, t, n);
1909
+ }
1910
+ _buildTextLayer(e, t, n, r) {
1911
+ L(e, t, n, r, this._hyperlinkHandler(), this.currentSlide);
1912
+ }
1913
+ _hyperlinkHandler() {
1914
+ if (this.opts.enableHyperlinks !== !1) return (e) => this._onHyperlinkClick(e);
1915
+ }
1916
+ _onHyperlinkClick(e) {
1917
+ let t = this._resolveInternalSlideIndex(e);
1918
+ if (this.opts.onHyperlinkClick) {
1919
+ this.opts.onHyperlinkClick(t);
1920
+ return;
1921
+ }
1922
+ if (t.kind === "external") {
1923
+ D(t.url, void 0, this.hostWindow);
1924
+ return;
1925
+ }
1926
+ t.slideIndex !== void 0 && this.goToSlide(t.slideIndex).catch((e) => this._reportRenderError(e));
1927
+ }
1928
+ _resolveInternalSlideIndex(e) {
1929
+ if (e.kind !== "internal" || e.slideIndex !== void 0) return e;
1930
+ let t = this.engine?.resolveInternalTarget(e.ref, this.currentSlide);
1931
+ return t === void 0 ? e : {
1932
+ ...e,
1933
+ slideIndex: t
1934
+ };
1935
+ }
1936
+ _reportRenderError(e) {
1937
+ this.errorRouter.report(e);
1938
+ }
1939
+ async getResourceMetrics() {
1940
+ if (!this.engine) throw Error("Presentation not loaded");
1941
+ return await this.engine.getResourceMetrics();
1942
+ }
1943
+ getSelectionContext(e = {}) {
1944
+ if (this.destroyed) throw Error("PptxViewer is destroyed");
1945
+ return (this.textLayer ? Z(this.wrapper, this.wrapper.ownerDocument?.getSelection?.() ?? null, e) : null) ?? (this.elementContext ? rn(this.elementContext, e.maxTextCharacters) : null);
1946
+ }
1947
+ _emitSelectionContextChange() {
1948
+ let e = this.getSelectionContext();
1949
+ e?.kind === "text" && (this.elementHitGeneration++, this.elementContext = null, this._redrawElementOutline());
1950
+ let t = JSON.stringify(e);
1951
+ t !== this.selectionContextKey && (this.selectionContextKey = t, this.opts.onSelectionContextChange?.(e ? structuredClone(e) : null));
1952
+ }
1953
+ _setElementContext(e) {
1954
+ this.elementContext = e ? structuredClone(e) : null, this._redrawElementOutline(), this._emitSelectionContextChange();
1955
+ }
1956
+ _invalidateElementSelection(e = !0) {
1957
+ this.elementHitGeneration++, this.elementContext = null, this._redrawElementOutline(), e && this._emitSelectionContextChange();
1958
+ }
1959
+ _redrawElementOutline() {
1960
+ let e = this.elementContext, t = this.engine;
1961
+ if (!e || !t || e.slideIndex !== this.currentSlide) {
1962
+ Ke(this.elementLayer, null);
1963
+ return;
1964
+ }
1965
+ Ke(this.elementLayer, {
1966
+ x: e.bounds.x / t.slideWidth,
1967
+ y: e.bounds.y / t.slideHeight,
1968
+ width: e.bounds.width / t.slideWidth,
1969
+ height: e.bounds.height / t.slideHeight,
1970
+ rotation: e.bounds.rotation
1971
+ });
1972
+ }
1973
+ async _onElementClick(e) {
1974
+ this.destroyed || e.defaultPrevented || e.button !== 0 || await this._resolveContextAt(e);
1975
+ }
1976
+ _onContextMenu(e) {
1977
+ let t;
1978
+ this.opts.onContextMenu?.({
1979
+ originalEvent: e,
1980
+ getContext: () => t ??= this._resolveContextAt(e)
1981
+ });
1982
+ }
1983
+ async _resolveContextAt(e) {
1984
+ let t = this.engine;
1985
+ if (this.destroyed || !t) return null;
1986
+ if (this.textLayer && Z(this.wrapper, this.wrapper.ownerDocument?.getSelection?.() ?? null)) return this._emitSelectionContextChange(), this.destroyed ? null : this.getSelectionContext();
1987
+ if (!this.opts.enableElementSelection) return this.getSelectionContext();
1988
+ let n = this.canvas.getBoundingClientRect();
1989
+ if (n.width <= 0 || n.height <= 0) return this._invalidateElementSelection(), null;
1990
+ let r = e.clientX - n.left, i = e.clientY - n.top;
1991
+ if (r < 0 || i < 0 || r > n.width || i > n.height) return this._invalidateElementSelection(), null;
1992
+ let a = ++this.elementHitGeneration, o = this.currentSlide, s = {
1993
+ x: r / n.width * t.slideWidth,
1994
+ y: i / n.height * t.slideHeight
1995
+ }, c;
1996
+ try {
1997
+ c = await t.getElementContextAt(o, s, {
1998
+ tolerance: this.elementHitTolerance / n.width * t.slideWidth,
1999
+ maxTextCharacters: q
2000
+ });
2001
+ } catch (e) {
2002
+ if (this.destroyed || a !== this.elementHitGeneration || o !== this.currentSlide || t !== this.engine) return null;
2003
+ throw e;
2004
+ }
2005
+ return this.destroyed || a !== this.elementHitGeneration || o !== this.currentSlide || t !== this.engine ? null : (this._setElementContext(c), this.destroyed ? null : this.getSelectionContext());
2006
+ }
2007
+ destroy() {
2008
+ this.destroyed || (this.destroyed = !0, this.errorRouter.close(), this.renderDispatcher.destroy(), n(this.canvas), this.handle?.destroy(), this.handle = null, this._unbindLayoutPresentation(), this.presentationOwner.close(), this._invalidateFind(), this.selectionChangeListener &&= (this.wrapper.ownerDocument.removeEventListener("selectionchange", this.selectionChangeListener), null), this.elementHitGeneration++, this.elementClickListener &&= (this.wrapper.removeEventListener("click", this.elementClickListener), null), this.contextMenuListener &&= (this.wrapper.removeEventListener("contextmenu", this.contextMenuListener), null), this.elementContext = null, this.canvasMount.restore());
2009
+ }
2010
+ };
2011
+ function $(e, t, n) {
2012
+ return `slide:${n}:${e.id ?? `classic:${e.authorId ?? "unknown"}:${e.index ?? t}`}`;
2013
+ }
2014
+ var gn = class {
2015
+ hooks;
2016
+ unsubscribe = null;
2017
+ constructor(e) {
2018
+ this.hooks = e;
2019
+ }
2020
+ bind(e) {
2021
+ this.unbind();
2022
+ let t = !0;
2023
+ this.unsubscribe = cn(e, () => ({
2024
+ availableSlides: e.availableSlideCount,
2025
+ slideCount: e.slideCount,
2026
+ exact: e.layoutComplete,
2027
+ complete: e.layoutComplete
2028
+ }), (n) => {
2029
+ if (t) {
2030
+ t = !1;
2031
+ return;
2032
+ }
2033
+ this.onPublication(e, n);
2034
+ }, this.hooks.report);
2035
+ }
2036
+ unbind() {
2037
+ this.unsubscribe?.(), this.unsubscribe = null, this.hooks.resetComments(), this.hooks.wakeComments();
2038
+ }
2039
+ onPublication(e, t) {
2040
+ if (!(this.hooks.destroyed() || e !== this.hooks.current())) {
2041
+ if (this.hooks.wakeComments(), t.error !== void 0) {
2042
+ this.hooks.failComments(), this.hooks.reportBackground(t.error);
2043
+ return;
2044
+ }
2045
+ this.hooks.scanComments(e), this.hooks.renderAvailable(e), this.hooks.emitVisible();
2046
+ }
2047
+ }
2048
+ destroy() {
2049
+ this.unbind();
2050
+ }
2051
+ }, _n = class {
2052
+ hooks;
2053
+ constructor(e) {
2054
+ this.hooks = e;
2055
+ }
2056
+ renderInteractive(e, t, n, r, i, a, o = !0) {
2057
+ let s = this.hooks.presentation();
2058
+ if (!s) return Promise.resolve();
2059
+ let c = ++t.presentationGeneration;
2060
+ t.presentationHandle?.destroy(), t.presentationHandle = null;
2061
+ let l = [], u = this.hooks.textSelection() && !!t.textLayer, d = u || this.hooks.findActive();
2062
+ return s.presentSlide(t.canvas, e, {
2063
+ width: n,
2064
+ dpr: r,
2065
+ imageResources: this.hooks.imageResources(),
2066
+ onTextRun: d ? (e) => l.push(e) : void 0,
2067
+ onError: (e) => {
2068
+ c === t.presentationGeneration && this.hooks.reportError(e);
2069
+ }
2070
+ }).then((r) => {
2071
+ if (!this.isCurrent(e, t, c, a)) {
2072
+ r.destroy();
2073
+ return;
2074
+ }
2075
+ t.presentationHandle = r, t.renderedScale = i, u && t.textLayer && L(t.textLayer, l, Math.round(n), Math.round(this.hooks.height()), this.hooks.hyperlinkHandler(), e), d && this.hooks.refreshFindRuns(e, l), this.hooks.commitComments(e, t), this.hooks.redrawHighlights(e, t);
2076
+ }).catch((e) => {
2077
+ if (c === t.presentationGeneration) if (o) this.hooks.reportError(e);
2078
+ else throw e;
2079
+ });
2080
+ }
2081
+ sync(e = this.hooks.mediaRange()) {
2082
+ if (this.hooks.mediaEnabled()) for (let [t, n] of this.hooks.slots()) {
2083
+ let r = this.hooks.rangeContains(e, t);
2084
+ r !== n.mediaInteractive && (r ? (n.mediaInteractive = !0, this.settleInteractive(t, n, this.hooks.width(), this.hooks.dpr(), this.hooks.scale(), this.hooks.epoch())) : (n.mediaInteractive = !1, n.presentationGeneration++, n.presentationHandle?.destroy(), n.presentationHandle = null));
2085
+ }
2086
+ }
2087
+ settleInteractive(e, t, n, r, i, a) {
2088
+ let o = this.hooks.presentation();
2089
+ if (!o) return;
2090
+ let s = ++t.presentationGeneration, c = document.createElement("canvas");
2091
+ c.style.cssText = "display:block;background:#fff;";
2092
+ let l = this.hooks.shadow();
2093
+ l !== !1 && (c.style.boxShadow = l);
2094
+ let u = [], d = this.hooks.textSelection() && !!t.textLayer, f = d || this.hooks.findActive();
2095
+ o.presentSlide(c, e, {
2096
+ width: n,
2097
+ dpr: r,
2098
+ onTextRun: f ? (e) => u.push(e) : void 0,
2099
+ onError: (e) => {
2100
+ s === t.presentationGeneration && this.hooks.reportError(e);
2101
+ }
2102
+ }).then((r) => {
2103
+ if (!this.isCurrent(e, t, s, a)) {
2104
+ r.destroy();
2105
+ return;
2106
+ }
2107
+ let o = t.canvas, l = t.presentationHandle;
2108
+ t.dispatcher.destroy(), t.wrapper.insertBefore(c, o), o.remove(), t.canvas = c, t.dispatcher = new N(c, !1), t.presentationHandle = r, t.renderedScale = i, l?.destroy(), t.textLayer && (this.hooks.clearTextPreview(t.textLayer), d && L(t.textLayer, u, Math.round(n), Math.round(this.hooks.height()), this.hooks.hyperlinkHandler(), e)), f && this.hooks.refreshFindRuns(e, u), this.hooks.commitComments(e, t), this.hooks.redrawHighlights(e, t);
2109
+ }).catch((e) => {
2110
+ s === t.presentationGeneration && this.hooks.reportError(e);
2111
+ });
2112
+ }
2113
+ isCurrent(e, t, n, r) {
2114
+ return n === t.presentationGeneration && t.mediaInteractive && r === this.hooks.epoch() && this.hooks.slots().get(e) === t && t.renderedSlide === e;
2115
+ }
2116
+ destroy() {
2117
+ for (let e of this.hooks.slots().values()) e.presentationGeneration++, e.presentationHandle?.destroy(), e.presentationHandle = null, e.mediaInteractive = !1;
2118
+ }
2119
+ }, vn = class {
2120
+ hooks;
2121
+ generation = 0;
2122
+ layoutWaiters = /* @__PURE__ */ new Set();
2123
+ layoutFailed = !1;
2124
+ constructor(e) {
2125
+ this.hooks = e;
2126
+ }
2127
+ resetLayout() {
2128
+ this.layoutFailed = !1, this.wake();
2129
+ }
2130
+ failLayout() {
2131
+ this.layoutFailed = !0, this.wake();
2132
+ }
2133
+ wake() {
2134
+ for (let e of this.layoutWaiters) e();
2135
+ this.layoutWaiters.clear();
2136
+ }
2137
+ begin() {
2138
+ let e = ++this.generation;
2139
+ return this.wake(), e;
2140
+ }
2141
+ async waitForSlideMetadata(e, t, n) {
2142
+ return await this.hooks.ownBackground(async () => {
2143
+ for (; !this.hooks.destroyed() && n === this.generation && e === this.hooks.presentation() && t >= e.availableSlideCount && !e.layoutComplete && !this.layoutFailed;) await new Promise((e) => this.layoutWaiters.add(e));
2144
+ return this.hooks.destroyed() || e !== this.hooks.presentation() || ((e.layoutComplete || this.layoutFailed) && await e.waitUntilLayoutComplete?.(), n !== this.generation) ? !1 : t < e.availableSlideCount;
2145
+ });
2146
+ }
2147
+ async resolveBounds(e, t) {
2148
+ let n = this.hooks.presentation();
2149
+ if (!n) return;
2150
+ let r = (t.anchors ?? []).flatMap((e) => (e.type === "drawingElement" || e.type === "textRange") && e.elementId ? [e.elementId] : []);
2151
+ if (r.length === 0) return;
2152
+ let i = new Map((this.hooks.slots().get(e)?.commentElementBounds ?? []).map((e) => [e.elementId, e.bounds])), a = r.flatMap((e) => {
2153
+ let t = i.get(e);
2154
+ return t ? [t] : [];
2155
+ })[0];
2156
+ if (a) return a;
2157
+ let o = await n.getElementBoundsByIds(e, r);
2158
+ return r.flatMap((e) => {
2159
+ let t = o.find((t) => t.elementId === e);
2160
+ return t ? [t.bounds] : [];
2161
+ })[0];
2162
+ }
2163
+ scrollToTarget(e, t, n, r) {
2164
+ if (!this.hooks.presentation()) return !1;
2165
+ let i = this.hooks.slots().get(e), a = new Map((i?.commentElementBounds ?? []).map((e) => [e.elementId, e.bounds])), o = r ?? (t.anchors ?? []).flatMap((e) => {
2166
+ if (e.type !== "drawingElement" && e.type !== "textRange" || !e.elementId) return [];
2167
+ let t = a.get(e.elementId);
2168
+ return t ? [t] : [];
2169
+ })[0], s = t.anchors ?? [], c = Number.isFinite(t.x) && Number.isFinite(t.y) && (s.length === 0 || s.some((e) => e.type === "slide"));
2170
+ if (!o && !c) return !1;
2171
+ let l = o ? o.x + (c ? t.x : o.width) : t.x, u = o ? o.y + (c ? t.y : 0) : t.y, d = l / m * this.hooks.scale(), f = u / m * this.hooks.scale();
2172
+ return this.hooks.scrollPoint(e, d, f, n), !0;
2173
+ }
2174
+ async goToComment(e, t, n) {
2175
+ if (this.hooks.destroyed()) throw Error("PptxScrollViewer is destroyed");
2176
+ let r = this.hooks.presentation();
2177
+ if (!r || !Number.isInteger(e) || !Number.isInteger(t) || e < 0 || e >= r.slideCount || t < 0) return !1;
2178
+ let i = this.begin();
2179
+ if (e >= r.availableSlideCount && !r.layoutComplete && !await this.waitForSlideMetadata(r, e, i)) return !1;
2180
+ if (this.hooks.destroyed()) throw Error("PptxScrollViewer is destroyed");
2181
+ if (i !== this.generation || r !== this.hooks.presentation()) return !1;
2182
+ let a = r.getComments(e)[t];
2183
+ if (!a) return !1;
2184
+ let o = await this.resolveBounds(e, a);
2185
+ if (this.hooks.destroyed()) throw Error("PptxScrollViewer is destroyed");
2186
+ if (i !== this.generation || r !== this.hooks.presentation()) return !1;
2187
+ let s = a.anchors ?? [], c = Number.isFinite(a.x) && Number.isFinite(a.y) && (s.length === 0 || s.some((e) => e.type === "slide"));
2188
+ return !o && !c || (this.hooks.scrollToSlide(e, n), !this.scrollToTarget(e, a, n, o)) ? !1 : (this.hooks.select($(a, t, e), e), !0);
2189
+ }
2190
+ destroy() {
2191
+ this.begin();
2192
+ }
2193
+ }, yn = 12, bn;
2194
+ function xn() {
2195
+ return bn ??= import("ooxml/comment-ui-runtime-BfEPgl5r.js");
2196
+ }
2197
+ var Sn = 440, Cn = 20, wn = Symbol("PptxScrollViewer.borrowedPresentation"), Tn = class e {
2198
+ _presentationOwner;
2199
+ get _pres() {
2200
+ return this._presentationOwner.current;
2201
+ }
2202
+ _borrowed;
2203
+ _opts;
2204
+ _errorRouter;
2205
+ _container;
2206
+ _shell;
2207
+ get _wrapper() {
2208
+ return this._shell.wrapper;
2209
+ }
2210
+ get _scrollHost() {
2211
+ return this._shell.scrollHost;
2212
+ }
2213
+ get _spacer() {
2214
+ return this._shell.spacer;
2215
+ }
2216
+ _mode;
2217
+ _viewport = new ye({
2218
+ options: () => this._opts,
2219
+ container: () => this._container,
2220
+ scrollHost: () => this._scrollHost
2221
+ });
2222
+ _zoom = new Ae({
2223
+ scrollHost: () => this._scrollHost,
2224
+ spacer: () => this._spacer,
2225
+ count: () => this._pres?.slideCount ?? 0,
2226
+ zoomMin: () => this._opts.zoomMin ?? .1,
2227
+ zoomMax: () => this._opts.zoomMax ?? 4,
2228
+ baseScale: () => this._baseScale(),
2229
+ fitWidthPx: () => this._viewport.fitWidth(),
2230
+ fitContentSize: () => this._pres ? {
2231
+ width: this._pres.slideWidth / m,
2232
+ height: this._pres.slideHeight / m
2233
+ } : null,
2234
+ indexAt: (e) => this._slideIndexAtOffset(e),
2235
+ offset: (e) => this._slideOffset(e),
2236
+ height: () => this._uniformSlideHeight,
2237
+ totalHeight: () => this._rangeAt(0, this._viewport.overscan()).totalHeight,
2238
+ recomputeHeights: () => this._recomputeHeights(),
2239
+ syncSpacerWidth: () => this._syncSpacerWidth(),
2240
+ padLeft: () => this._viewport.horizontalPadding().left,
2241
+ invalidateRender: () => {
2242
+ this._renderEpoch++;
2243
+ },
2244
+ preview: () => this._previewVisible(),
2245
+ scheduleSettle: () => this._scheduleSettle(),
2246
+ onScaleChange: (e) => this._opts.onScaleChange?.(e),
2247
+ relayout: () => this.relayout(),
2248
+ mountVisible: () => this._mountVisible(),
2249
+ refitOnResize: () => this._opts.refitOnResize !== !1
2250
+ });
2251
+ get _scale() {
2252
+ return this._zoom.scale;
2253
+ }
2254
+ get _scaleEstablished() {
2255
+ return this._zoom.established;
2256
+ }
2257
+ _scroller = new be({
2258
+ spacer: () => this._spacer,
2259
+ count: () => this._pres?.slideCount ?? 0,
2260
+ range: () => this._range(),
2261
+ createSlot: () => this._createSlot(),
2262
+ attachSlot: (e) => this._scrollHost.appendChild(e.wrapper),
2263
+ resetSlot: (e, t) => this._resetSlot(e, t),
2264
+ positionSlot: (e, t, n) => this._positionSlot(t, e, n),
2265
+ renderSlot: (e, t, n) => this._renderSlot(e, t, this._opts.enableMediaPlayback === !0 && this._rangeContains(this._mediaRange(), e), n),
2266
+ previewSlot: (e, t, n) => this._previewSlot(t, e, n),
2267
+ settleSlot: (e, t) => this._settleSlot(e, t),
2268
+ renderedScale: (e) => e.renderedScale,
2269
+ scale: () => this._scale,
2270
+ syncSpacerWidth: () => this._syncSpacerWidth(),
2271
+ onRange: (e) => this._emitVisibleSlideChange(e),
2272
+ onNewSlot: (e, t) => this._redrawSlotComments(e, t),
2273
+ afterMount: () => {
2274
+ this._opts.enableMediaPlayback && this._media.sync();
2275
+ },
2276
+ awaitInitialRender: (e) => e < this.availableSlideCount,
2277
+ shouldSettle: (e) => !this._opts.enableMediaPlayback || this._rangeContains(this._mediaRange(), e)
2278
+ });
2279
+ _slots = this._scroller.slots;
2280
+ _layout = new gn({
2281
+ current: () => this._pres,
2282
+ destroyed: () => this._destroyed,
2283
+ report: (e) => this._reportRenderError(e),
2284
+ reportBackground: (e) => this._errorRouter.reportBackground(e, this._opts.onLayoutComplete !== void 0),
2285
+ wakeComments: () => this._commentNavigation.wake(),
2286
+ resetComments: () => this._commentNavigation.resetLayout(),
2287
+ failComments: () => this._commentNavigation.failLayout(),
2288
+ scanComments: (e) => this._scanAvailableComments(e, !0),
2289
+ renderAvailable: (e) => {
2290
+ let t = this._opts.enableMediaPlayback ? this._mediaRange() : null;
2291
+ for (let [n, r] of this._slots) n >= e.availableSlideCount || r.renderedSlide === n || this._renderSlot(n, r, !!t && this._rangeContains(t, n));
2292
+ },
2293
+ emitVisible: () => {
2294
+ this._scroller.lastRange && this._emitVisibleSlideChange(this._scroller.lastRange);
2295
+ }
2296
+ });
2297
+ _renderHooks = {
2298
+ slots: () => this._slots,
2299
+ epoch: () => this._renderEpoch,
2300
+ scale: () => this._scale,
2301
+ slotIndex: (e) => e.renderedSlide,
2302
+ token: (e) => e.renderGeneration,
2303
+ nextToken: (e) => ++e.renderGeneration,
2304
+ wantRuns: (e) => !!(this._opts.enableTextSelection && e.textLayer) || this._findActive,
2305
+ reportError: (e) => this._reportRenderError(e)
2306
+ };
2307
+ _bitmap = new Se({
2308
+ ...this._renderHooks,
2309
+ inFlight: () => this._scroller.inFlight,
2310
+ destroyed: () => this._destroyed,
2311
+ width: () => this._slideWidthPx(),
2312
+ dpr: () => this._viewport.dpr(),
2313
+ canRetry: (e) => !(this._opts.enableMediaPlayback && e.mediaInteractive),
2314
+ render: (e, t, n, r, i) => Q(this._pres, t, e, "worker", {
2315
+ width: n,
2316
+ dpr: r,
2317
+ imageResources: this._opts.imageResources,
2318
+ onTextRun: i
2319
+ }),
2320
+ commitBitmap: (e, t, n, r, i, a) => {
2321
+ let o = {
2322
+ cssWidth: Math.round(a),
2323
+ cssHeight: Math.round(this._slideHeightPx())
2324
+ };
2325
+ return this._opts.enableMediaPlayback ? n.commitBitmapTo2d(r, i, o) : n.commitBitmap(r, i, o);
2326
+ },
2327
+ commitRuns: (e, t, n, r, i) => this._commitRenderedRuns(e, t, n, r, i, !0)
2328
+ });
2329
+ _main = new Ce({
2330
+ ...this._renderHooks,
2331
+ render: (e, t, n, r, i, a) => Q(this._pres, t, e, "main", {
2332
+ width: n,
2333
+ dpr: r,
2334
+ ...a ? {} : { imageResources: this._opts.imageResources },
2335
+ onTextRun: i
2336
+ }),
2337
+ commitRuns: (e, t, n, r, i, a, o) => this._commitRenderedRuns(e, t, n, i, a, o),
2338
+ shadow: () => this._pageShadow
2339
+ });
2340
+ _media = new _n({
2341
+ presentation: () => this._pres,
2342
+ slots: () => this._slots,
2343
+ epoch: () => this._renderEpoch,
2344
+ scale: () => this._scale,
2345
+ dpr: () => this._viewport.dpr(),
2346
+ width: () => this._slideWidthPx(),
2347
+ height: () => this._slideHeightPx(),
2348
+ imageResources: () => this._opts.imageResources,
2349
+ textSelection: () => this._opts.enableTextSelection === !0,
2350
+ findActive: () => this._findActive,
2351
+ mediaEnabled: () => this._opts.enableMediaPlayback === !0,
2352
+ mediaRange: () => this._mediaRange(),
2353
+ rangeContains: (e, t) => this._rangeContains(e, t),
2354
+ shadow: () => this._pageShadow,
2355
+ hyperlinkHandler: () => this._hyperlinkHandler(),
2356
+ refreshFindRuns: (e, t) => this._highlights.refreshRuns(e, t),
2357
+ redrawHighlights: (e, t) => this._highlights.redrawSlot(e, t),
2358
+ commitComments: (e, t) => this._commitSlotComments(e, t),
2359
+ clearTextPreview: (e) => this._clearTextLayerPreview(e),
2360
+ reportError: (e) => this._reportRenderError(e)
2361
+ });
2362
+ _commentNavigation = new vn({
2363
+ presentation: () => this._pres,
2364
+ destroyed: () => this._destroyed,
2365
+ slots: () => this._slots,
2366
+ scale: () => this._scale,
2367
+ scrollPoint: (e, t, n, r) => this._navigation.scrollToPoint(e, t, n, r),
2368
+ scrollToSlide: (e, t) => this.scrollToSlide(e, t),
2369
+ select: (e, t) => {
2370
+ this._activeCommentId = e, this._activeCommentSlide = t, this._selection.clearElementContext();
2371
+ for (let [e, t] of this._slots) this._redrawSlotComments(e, t);
2372
+ this._selection.emitChange();
2373
+ },
2374
+ ownBackground: (e) => this._errorRouter.ownBackgroundLifecycle(e)
2375
+ });
2376
+ _navigation = new Te({
2377
+ host: () => this._scrollHost,
2378
+ spacer: () => this._spacer,
2379
+ count: () => this.slideCount,
2380
+ established: () => this._scaleEstablished,
2381
+ offset: (e) => this._slideOffset(e),
2382
+ height: () => this._uniformSlideHeight,
2383
+ indexAt: (e) => this._slideIndexAtOffset(e),
2384
+ totalHeight: () => this._rangeAt(0, this._viewport.overscan()).totalHeight,
2385
+ width: () => this._slideWidthPx(),
2386
+ padLeft: () => this._viewport.horizontalPadding().left,
2387
+ marginOrigin: () => this._commentMargin.originPx,
2388
+ mount: () => this._mountVisible()
2389
+ });
2390
+ _selection = new De({
2391
+ wrapper: () => this._wrapper,
2392
+ scrollHost: () => this._scrollHost,
2393
+ slots: () => this._slots,
2394
+ resource: () => this._pres,
2395
+ destroyed: () => this._destroyed,
2396
+ textSelectionEnabled: () => this._opts.enableTextSelection === !0,
2397
+ elementSelectionEnabled: () => this._opts.enableElementSelection === !0,
2398
+ textSelected: () => Z(this._wrapper, this._wrapper.ownerDocument?.getSelection?.() ?? null) !== null,
2399
+ getContext: () => this.getSelectionContext(),
2400
+ hitTest: (e, t, n, r, i) => e.getElementContextAt(t, {
2401
+ x: n * e.slideWidth,
2402
+ y: r * e.slideHeight
2403
+ }, {
2404
+ tolerance: this._elementHitTolerance / i * e.slideWidth,
2405
+ maxTextCharacters: q
2406
+ }),
2407
+ outline: (e, t, n) => n.slideIndex === t ? {
2408
+ x: n.bounds.x / e.slideWidth,
2409
+ y: n.bounds.y / e.slideHeight,
2410
+ width: n.bounds.width / e.slideWidth,
2411
+ height: n.bounds.height / e.slideHeight,
2412
+ rotation: n.bounds.rotation
2413
+ } : null,
2414
+ onChange: (e) => this._opts.onSelectionContextChange?.(e),
2415
+ onContextMenu: (e, t) => this._opts.onContextMenu?.({
2416
+ originalEvent: e,
2417
+ getContext: t
2418
+ }),
2419
+ reportError: (e) => this._reportRenderError(e)
2420
+ });
2421
+ _uniformSlideHeight = 0;
2422
+ _visibleEvents = new Oe((e, t, n) => this._opts.onVisibleSlideChange?.(e, t, n));
2423
+ _loader = new _e({
2424
+ name: () => "PptxScrollViewer",
2425
+ borrowed: () => this._borrowed,
2426
+ borrowedMessage: () => "PptxScrollViewer.load() is unsupported on a Viewer created by fromPresentation(); the borrowed presentation is already loaded.",
2427
+ destroyed: () => this._destroyed,
2428
+ owner: () => this._presentationOwner,
2429
+ acquire: (e) => X.load(e, {
2430
+ password: this._opts.password,
2431
+ useGoogleFonts: this._opts.useGoogleFonts,
2432
+ cjkFallback: this._opts.cjkFallback,
2433
+ maxZipEntryBytes: this._opts.maxZipEntryBytes,
2434
+ resourceLimits: this._opts.resourceLimits,
2435
+ debug: this._opts.debug,
2436
+ onResourceMetrics: this._opts.onResourceMetrics,
2437
+ workerTimeoutMs: this._opts.workerTimeoutMs,
2438
+ wasmUrl: this._opts.wasmUrl,
2439
+ math: this._opts.math,
2440
+ threeD: this._opts.threeD,
2441
+ regionMap: this._opts.regionMap,
2442
+ chartEx: this._opts.chartEx,
2443
+ tiff: this._opts.tiff,
2444
+ mode: this._mode,
2445
+ ...this._opts.legacyPpt === void 0 ? void 0 : { legacyPpt: this._opts.legacyPpt },
2446
+ progressiveLayout: this._opts.progressiveLayout,
2447
+ onLayoutProgress: this._opts.onLayoutProgress,
2448
+ onLayoutPartial: this._opts.onLayoutPartial,
2449
+ onLayoutComplete: this._opts.onLayoutComplete
2450
+ }),
2451
+ beforeReplace: (e) => {
2452
+ if (this._selection.invalidateElementContext(!1), this._invalidateFind(), this._findActive = !1, this._activeCommentId = null, this._activeCommentSlide = null, this._hasComments = !1, this._commentScanFrontier = 0, this._commentNavigation.begin(), this._layout.unbind(), e) {
2453
+ for (let [e, t] of [...this._slots]) this._recycleSlot(e, t);
2454
+ this._visibleEvents.resetIndex();
2455
+ }
2456
+ },
2457
+ afterReplace: (e) => {
2458
+ this._invalidateFind(), this._findActive = !1, this._activeCommentId = null, this._activeCommentSlide = null, this._hasComments = !1, this._commentScanFrontier = 0, this._scanAvailableComments(e, !1), this._layout.bind(e);
2459
+ },
2460
+ mountOpeningWindow: async () => {
2461
+ let e = [];
2462
+ this._relayout(e), await Promise.all(e);
2463
+ },
2464
+ selectionChanged: () => this._selection.emitChange()
2465
+ });
2466
+ _activeCommentId = null;
2467
+ _activeCommentSlide = null;
2468
+ _commentUi = null;
2469
+ _hasComments = !1;
2470
+ _commentMargin = new we({
2471
+ container: () => this._container,
2472
+ scrollHost: () => this._scrollHost,
2473
+ spacer: () => this._spacer,
2474
+ enabled: () => this._commentsEnabled(),
2475
+ cards: () => this._commentsOptions()?.cards !== !1,
2476
+ hasDisplayableComments: () => this._hasComments,
2477
+ requestedSide: () => this._commentsOptions()?.side,
2478
+ zoom: () => this._scaleEstablished ? this._scale : 1,
2479
+ gapPx: yn,
2480
+ widthPx: Sn,
2481
+ fontSizePx: Cn
2482
+ });
2483
+ _layers = new Me({
2484
+ markerLayer: (e) => e.commentMarkerLayer,
2485
+ syncMargin: (e) => this._commentMargin.syncMargin(e),
2486
+ marginSide: () => this._commentMargin.side(),
2487
+ marginExtent: () => this._commentMargin.extent(),
2488
+ commentsEnabled: () => this._commentsEnabled(),
2489
+ previewMargin: (e, t) => this._commentUi?.previewReadOnlyCommentMargin(e, t),
2490
+ disposeMargin: (e) => {
2491
+ this._commentUi?.disposeReadOnlyCommentMargin(e), this._commentUi || e.replaceChildren();
2492
+ },
2493
+ disposeDecoration: (e) => {
2494
+ this._commentUi?.disposeReadOnlyCommentDecoration(e), this._commentUi || e.replaceChildren();
2495
+ },
2496
+ redrawOutline: (e, t) => this._selection.redrawOutlineForSlot(e, t),
2497
+ markerRatio: (e) => Math.round(e * 1e6) / 1e6,
2498
+ resetMarkerTransform: () => !1,
2499
+ resetDecorationVisibility: () => !0
2500
+ });
2501
+ _commentOverlay = new je({
2502
+ slots: () => this._slots,
2503
+ scale: () => this._scale,
2504
+ destroyed: () => this._destroyed,
2505
+ ownerWindow: () => this._wrapper.ownerDocument.defaultView,
2506
+ width: () => this._slideWidthPx(),
2507
+ height: () => this._slideHeightPx(),
2508
+ side: () => this._commentMargin.side(),
2509
+ marginExtent: () => this._commentMargin.extent(),
2510
+ connectorOptions: () => this._commentsOptions()?.connectors,
2511
+ runtime: () => this._commentUi,
2512
+ redrawComments: (e, t) => this._redrawSlotComments(e, t)
2513
+ });
2514
+ _commentScanFrontier = 0;
2515
+ _elementHitTolerance;
2516
+ _destroyed = !1;
2517
+ get _renderEpoch() {
2518
+ return this._scroller.renderEpoch;
2519
+ }
2520
+ set _renderEpoch(e) {
2521
+ this._scroller.renderEpoch = e;
2522
+ }
2523
+ _pageShadow;
2524
+ _find = new ft(() => this.slideCount, (e) => this._collectSlideRuns(e));
2525
+ _findGeneration = 0;
2526
+ _findActive = !1;
2527
+ _highlights = new ge({
2528
+ slots: () => this._slots,
2529
+ active: () => this._findActive,
2530
+ runs: (e) => this._find.slideRuns(e),
2531
+ setRuns: (e, t) => this._find.setSlideRuns(e, t),
2532
+ paint: (e, t, n, r) => R(t.highlightLayer, n, this._find.slideHighlights(e), this._slideWidthPx(), this._slideHeightPx(), r, this._opts.findHighlightColors),
2533
+ reveal: (e) => this.scrollToSlide(e),
2534
+ unitOf: (e) => e.slide
2535
+ });
2536
+ static fromPresentation(t, n, r = {}) {
2537
+ return new e(t, {
2538
+ ...r,
2539
+ [wn]: n
2540
+ });
2541
+ }
2542
+ constructor(e, t = {}) {
2543
+ if (e.tagName === "CANVAS") throw Error("PptxScrollViewer takes a container element (e.g. a <div>), not a <canvas> — the viewer creates and manages its own canvases. Pass a block container; for the single-slide canvas API use PptxViewer.");
2544
+ this._container = e, this._opts = t, this._errorRouter = new Ge("PptxScrollViewer", t.onError);
2545
+ let n = t.elementHitTolerance ?? 6;
2546
+ if (!Number.isFinite(n) || n < 0) throw RangeError("elementHitTolerance must be a finite non-negative number.");
2547
+ this._elementHitTolerance = n, this._pageShadow = t.pageShadow ?? "0 1px 3px rgba(0,0,0,0.2)";
2548
+ let r = t[wn];
2549
+ this._borrowed = r !== void 0, r ? (this._presentationOwner = new P("PptxScrollViewer", r, !1), this._mode = F("PptxScrollViewer", t.mode, r), this._scanAvailableComments(r, !1)) : (this._presentationOwner = new P("PptxScrollViewer"), this._mode = F("PptxScrollViewer", t.mode, void 0)), this._shell = new Ne(e, {
2550
+ background: t.background,
2551
+ comments: !!t.comments,
2552
+ onScroll: () => this._onScroll(),
2553
+ onOutsideComment: () => {
2554
+ if (this._activeCommentId !== null) {
2555
+ this._activeCommentId = null, this._activeCommentSlide = null;
2556
+ for (let [e, t] of this._slots) this._redrawSlotComments(e, t);
2557
+ this._selection.emitChange();
2558
+ }
2559
+ }
2560
+ }), this._commentsEnabled() && xn().then((e) => {
2561
+ if (!this._destroyed) {
2562
+ this._commentUi = e;
2563
+ for (let [e, t] of this._slots) this._redrawSlotComments(e, t);
2564
+ }
2565
+ }).catch((e) => this._reportRenderError(e)), this._selection.bind(!!t.onSelectionContextChange, !!t.onContextMenu), this._zoom.bind(this._container, this._scrollHost, this._opts.enableZoom !== !1), this._borrowed && (this._layout.bind(r), this.relayout());
2566
+ }
2567
+ async load(e) {
2568
+ await this._loader.load(e);
2569
+ }
2570
+ get slideCount() {
2571
+ return this._pres?.slideCount ?? 0;
2572
+ }
2573
+ get availableSlideCount() {
2574
+ return this._pres?.availableSlideCount ?? this.slideCount;
2575
+ }
2576
+ get layoutComplete() {
2577
+ return this._pres?.layoutComplete ?? !0;
2578
+ }
2579
+ async waitUntilLayoutComplete() {
2580
+ await this._errorRouter.ownBackgroundLifecycle(async () => {
2581
+ await this._pres?.waitUntilLayoutComplete?.();
2582
+ });
2583
+ }
2584
+ _slideWidthPx() {
2585
+ return this._pres.slideWidth / m * this._scale;
2586
+ }
2587
+ _slideHeightPx() {
2588
+ return this._pres.slideHeight / m * this._scale;
2589
+ }
2590
+ _commentsEnabled() {
2591
+ return this._opts.comments === !0 || typeof this._opts.comments == "object";
2592
+ }
2593
+ _commentsOptions() {
2594
+ return typeof this._opts.comments == "object" ? this._opts.comments : void 0;
2595
+ }
2596
+ _scanAvailableComments(e, t) {
2597
+ if (!this._commentsEnabled() || this._hasComments) return;
2598
+ let n = this._commentsOptions()?.includeResolved === !0, r = Math.min(e.availableSlideCount, e.slideCount);
2599
+ for (let i = this._commentScanFrontier; i < r; i++) if (e.getComments(i).some((e) => n || e.status !== "resolved" && e.status !== "closed")) {
2600
+ this._commentScanFrontier = r, this._hasComments = !0, t && this._refreshDiscoveredComments();
2601
+ return;
2602
+ }
2603
+ this._commentScanFrontier = Math.max(this._commentScanFrontier, r);
2604
+ }
2605
+ _refreshDiscoveredComments() {
2606
+ this._syncSpacerWidth();
2607
+ for (let [e, t] of this._slots) this._redrawSlotComments(e, t);
2608
+ }
2609
+ _baseScale() {
2610
+ if (!this._pres || this._pres.slideCount === 0) return 0;
2611
+ let e = this._viewport.fitWidth(), t = this._pres.slideWidth / m;
2612
+ return e <= 0 || t <= 0 ? 0 : e / t;
2613
+ }
2614
+ relayout() {
2615
+ this._relayout();
2616
+ }
2617
+ _relayout(e) {
2618
+ this._pres && (!this._scaleEstablished && !this._zoom.establishBase() || (this._recomputeHeights(), this._syncSpacer(), this._mountVisible(e)));
2619
+ }
2620
+ _recomputeHeights() {
2621
+ this._uniformSlideHeight = this._slideHeightPx();
2622
+ }
2623
+ _mediaOverscan() {
2624
+ return this._opts.mediaOverscan ?? 1;
2625
+ }
2626
+ _slideOffset(e) {
2627
+ return this._viewport.verticalPadding().leading + e * (this._uniformSlideHeight + this._viewport.gap());
2628
+ }
2629
+ _slideIndexAtOffset(e) {
2630
+ return me(this._pres?.slideCount ?? 0, this._uniformSlideHeight, this._viewport.gap(), e, 0, 0, this._viewport.verticalPadding()).topIndex;
2631
+ }
2632
+ _rangeAt(e, t) {
2633
+ return me(this._pres?.slideCount ?? 0, this._uniformSlideHeight, this._viewport.gap(), e, this._scrollHost.clientHeight, t, this._viewport.verticalPadding());
2634
+ }
2635
+ _range() {
2636
+ return this._rangeAt(this._scrollHost.scrollTop, this._viewport.overscan());
2637
+ }
2638
+ _mediaRange() {
2639
+ return this._rangeAt(this._scrollHost.scrollTop, this._mediaOverscan());
2640
+ }
2641
+ _rangeContains(e, t) {
2642
+ return t >= e.start && t <= e.end;
2643
+ }
2644
+ _syncSpacer() {
2645
+ this._scroller.syncSpacer();
2646
+ }
2647
+ _syncSpacerWidth() {
2648
+ let { left: e, right: t } = this._viewport.horizontalPadding();
2649
+ this._commentMargin.syncSpacerWidth(this._slideWidthPx(), e, t);
2650
+ }
2651
+ _onScroll() {
2652
+ !this._pres || !this._scaleEstablished || this._mountVisible(void 0, !1);
2653
+ }
2654
+ _mountVisible(e, t = !0) {
2655
+ this._scroller.mount(e, t);
2656
+ }
2657
+ _createSlot() {
2658
+ let { wrapper: e, canvas: t, textLayer: n, highlightLayer: r } = Ee(this._scrollHost, this._opts.enableTextSelection === !0, this._pageShadow), i = fn(e), { markerLayer: a, margin: o, decorationLayer: s } = ke(e, this._commentsEnabled(), this._commentsOptions()?.cards !== !1, this._commentsOptions()?.connectors !== void 0, (e) => this._commentMargin.syncMargin(e)), c = Xe(e, this._opts.enableElementSelection === !0);
2659
+ return this._scrollHost.appendChild(e), {
2660
+ wrapper: e,
2661
+ canvas: t,
2662
+ textLayer: n,
2663
+ highlightLayer: r,
2664
+ elementLayer: c,
2665
+ loadingIndicator: i,
2666
+ commentMarkerLayer: a,
2667
+ commentMargin: o,
2668
+ commentDecorationLayer: s,
2669
+ commentElementBounds: Object.freeze([]),
2670
+ commentGeometry: null,
2671
+ commentAnchorSlide: -1,
2672
+ commentAnchorGeneration: 0,
2673
+ renderedSlide: -1,
2674
+ renderedScale: -1,
2675
+ dispatcher: new N(t, this._mode === "worker" && !this._opts.enableMediaPlayback),
2676
+ presentationHandle: null,
2677
+ mediaInteractive: !1,
2678
+ renderGeneration: 0,
2679
+ presentationGeneration: 0
2680
+ };
2681
+ }
2682
+ _recycleSlot(e, t) {
2683
+ this._scroller.recycleSlot(e, t);
2684
+ }
2685
+ _resetSlot(e, t) {
2686
+ t.renderGeneration++, t.presentationGeneration++, t.presentationHandle?.destroy(), t.presentationHandle = null, t.mediaInteractive = !1, t.dispatcher.destroy(), this._destroyed || (t.dispatcher = new N(t.canvas, this._mode === "worker" && !this._opts.enableMediaPlayback)), this._layers.reset(t), t.loadingIndicator.setLoading(!1), t.commentElementBounds = Object.freeze([]), t.commentGeometry = null, t.commentAnchorSlide = -1, t.commentAnchorGeneration++, t.canvas.style.height = "", t.renderedSlide = -1, t.renderedScale = -1, t.wrapper.remove();
2687
+ }
2688
+ _positionSlot(e, t, n) {
2689
+ e.wrapper.dataset.slideIndex = String(t), this._layers.position(t, e, this._slideOffset(t), this._slideWidthPx(), this._slideHeightPx(), this._scrollHost.clientWidth, this._viewport.horizontalPadding().left);
2690
+ }
2691
+ _renderSlot(e, t, n = !1, r = !0) {
2692
+ if (!this._pres || t.renderedSlide === e) return null;
2693
+ if (e >= this.availableSlideCount && !this.layoutComplete) return t.renderedSlide = -1, t.mediaInteractive = !1, t.loadingIndicator.setLoading(!0), null;
2694
+ t.renderedSlide = e;
2695
+ let i = ++t.renderGeneration;
2696
+ t.loadingIndicator.setLoading(e >= this.availableSlideCount && !this.layoutComplete);
2697
+ let a = this._viewport.dpr(), o = this._slideWidthPx(), s = this._renderEpoch, c = this._scale, l = t.dispatcher, u = l.begin();
2698
+ return this._opts.enableMediaPlayback && n ? (t.mediaInteractive = !0, this._trackSlotLoading(e, t, i, this._media.renderInteractive(e, t, o, a, c, s, r))) : (t.mediaInteractive = !1, this._mode === "worker" ? this._trackSlotLoading(e, t, i, this._renderSlotBitmap(e, t, o, a, c, i, l, u, r)) : this._trackSlotLoading(e, t, i, this._main.render(e, t, o, a, i, l, u, r)));
2699
+ }
2700
+ async _trackSlotLoading(e, t, n, r) {
2701
+ try {
2702
+ await r;
2703
+ } finally {
2704
+ n === t.renderGeneration && this._slots.get(e) === t && t.renderedSlide === e && t.loadingIndicator.setLoading(!1);
2705
+ }
2706
+ }
2707
+ _emitVisibleSlideChange(e) {
2708
+ this._pres && this._visibleEvents.publish(e, this._pres.slideCount, this.layoutComplete);
2709
+ }
2710
+ _reportRenderError(e) {
2711
+ this._errorRouter.report(e);
2712
+ }
2713
+ _commitRenderedRuns(e, t, n, r, i, a) {
2714
+ t.textLayer && (a && this._clearTextLayerPreview(t.textLayer), this._opts.enableTextSelection && L(t.textLayer, n, Math.round(r), Math.round(this._slideHeightPx()), this._hyperlinkHandler(), e)), i && this._highlights.refreshRuns(e, n), this._commitSlotComments(e, t), this._highlights.redrawSlot(e, t);
2715
+ }
2716
+ _renderSlotBitmap(e, t, n, r, i, a = ++t.renderGeneration, o = t.dispatcher, s = o.begin(), c = !0) {
2717
+ return this._bitmap.render(e, t, n, r, i, a, o, s, c);
2718
+ }
2719
+ setScale(e) {
2720
+ this._zoom.setScale(e);
2721
+ }
2722
+ getScale() {
2723
+ return this._zoom.getScale();
2724
+ }
2725
+ zoomIn() {
2726
+ this._zoom.zoomIn();
2727
+ }
2728
+ zoomOut() {
2729
+ this._zoom.zoomOut();
2730
+ }
2731
+ fitWidth() {
2732
+ this._zoom.fit("width");
2733
+ }
2734
+ fitPage() {
2735
+ this._zoom.fit("page");
2736
+ }
2737
+ _previewVisible() {
2738
+ this._scroller.preview();
2739
+ }
2740
+ _previewSlot(e, t, n) {
2741
+ this._positionSlot(e, t, n), this._layers.preview(e, this._slideWidthPx(), this._slideHeightPx(), this._scale);
2742
+ }
2743
+ _clearTextLayerPreview(e) {
2744
+ xe(e);
2745
+ }
2746
+ _scheduleSettle() {
2747
+ this._scroller.scheduleSettle(150);
2748
+ }
2749
+ _settleSlot(e, t) {
2750
+ if (!this._pres) return;
2751
+ let n = this._viewport.dpr(), r = this._slideWidthPx(), i = this._scale, a = this._renderEpoch;
2752
+ if (this._opts.enableMediaPlayback && t.mediaInteractive) {
2753
+ this._media.settleInteractive(e, t, r, n, i, a);
2754
+ return;
2755
+ }
2756
+ if (!this._opts.enableMediaPlayback) {
2757
+ if (this._mode === "worker") {
2758
+ this._renderSlotBitmap(e, t, r, n, i);
2759
+ return;
2760
+ }
2761
+ this._main.settle(e, t, r, n);
2762
+ }
2763
+ }
2764
+ scrollToSlide(e, t) {
2765
+ this._navigation.scrollToUnit(e, t);
2766
+ }
2767
+ async goToComment(e, t, n) {
2768
+ return this._commentNavigation.goToComment(e, t, n);
2769
+ }
2770
+ async findText(e, t = {}) {
2771
+ let n = this._pres;
2772
+ if (!n) return [];
2773
+ let r = ++this._findGeneration;
2774
+ if (this._findActive = e.length > 0, e.length === 0) return this._find.invalidate(), this._highlights.redrawAll(), [];
2775
+ if (n.layoutComplete || await this._errorRouter.ownBackgroundLifecycle(() => n.waitUntilLayoutComplete()), this._destroyed || r !== this._findGeneration || n !== this._pres) return [];
2776
+ let i = await this._errorRouter.ownAwaitable(() => this._find.find(e, t));
2777
+ return this._destroyed || r !== this._findGeneration || n !== this._pres ? [] : (this._highlights.redrawAll(), i);
2778
+ }
2779
+ async findNext() {
2780
+ return this._highlights.activate(this._find.next());
2781
+ }
2782
+ async findPrev() {
2783
+ return this._highlights.activate(this._find.prev());
2784
+ }
2785
+ clearFind() {
2786
+ this._findActive = !1, this._invalidateFind(), this._highlights.redrawAll();
2787
+ }
2788
+ _invalidateFind() {
2789
+ this._findGeneration++, this._find.invalidate();
2790
+ }
2791
+ async _collectSlideRuns(e) {
2792
+ return this._pres ? this._pres.collectSlideRuns(e, this._slideWidthPx()) : [];
2793
+ }
2794
+ _redrawSlotComments(e, t) {
2795
+ if (!this._pres || !t.commentMarkerLayer) return;
2796
+ this._commentMargin.syncMargin(t.commentMargin);
2797
+ let n = this._commentUi;
2798
+ if (!n) {
2799
+ t.commentMarkerLayer.replaceChildren(), t.commentMargin?.replaceChildren(), t.commentDecorationLayer?.replaceChildren(), t.commentGeometry = null;
2800
+ return;
2801
+ }
2802
+ t.commentGeometry = n.buildPptxCommentMargin(t.commentMarkerLayer, t.commentMargin, this._pres.getComments(e), t.commentElementBounds, e, this._pres.slideWidth, this._pres.slideHeight, this._activeCommentId, (t, n) => {
2803
+ let r = n ? t : this._activeCommentId === t ? null : this._activeCommentId;
2804
+ if (r !== this._activeCommentId) {
2805
+ this._activeCommentId = r, this._activeCommentSlide = r ? e : null, this._selection.clearElementContext();
2806
+ for (let [e, t] of this._slots) this._redrawSlotComments(e, t);
2807
+ this._selection.emitChange();
2808
+ }
2809
+ }, this._commentMargin.zoom(), Sn, this._commentsOptions()?.markers !== !1, this._commentsOptions()?.includeResolved === !0, t.commentDecorationLayer ? () => this._commentOverlay.schedule(e, t, !1) : void 0, t.commentDecorationLayer ? () => this._commentOverlay.schedule(e, t, !0) : void 0), this._commentOverlay.drawConnectors(e, t);
2810
+ }
2811
+ _commitSlotComments(e, t) {
2812
+ this._ensureSlotCommentAnchors(e, t), this._redrawSlotComments(e, t), t.commentMarkerLayer && (t.commentMarkerLayer.style.visibility = ""), t.commentMargin && (t.commentMargin.style.visibility = ""), t.commentDecorationLayer && (t.commentDecorationLayer.style.visibility = "");
2813
+ }
2814
+ _ensureSlotCommentAnchors(e, t) {
2815
+ let n = this._pres;
2816
+ if (!n || t.commentAnchorSlide === e) return;
2817
+ t.commentAnchorSlide = e, t.commentElementBounds = Object.freeze([]);
2818
+ let r = [...new Set(n.getComments(e).flatMap((e) => (e.anchors ?? []).flatMap((e) => (e.type === "drawingElement" || e.type === "textRange") && e.elementId ? [e.elementId] : [])))];
2819
+ if (r.length === 0) return;
2820
+ let i = ++t.commentAnchorGeneration;
2821
+ n.getElementBoundsByIds(e, r).then((r) => {
2822
+ if (this._destroyed || i !== t.commentAnchorGeneration || n !== this._pres || this._slots.get(e) !== t || t.commentAnchorSlide !== e) return;
2823
+ t.commentElementBounds = r, this._redrawSlotComments(e, t);
2824
+ let a = n.getComments(e).find((t, n) => $(t, n, e) === this._activeCommentId);
2825
+ a && this._commentNavigation.scrollToTarget(e, a);
2826
+ }).catch((e) => {
2827
+ !this._destroyed && i === t.commentAnchorGeneration && this._reportRenderError(e);
2828
+ });
2829
+ }
2830
+ _hyperlinkHandler() {
2831
+ if (this._opts.enableHyperlinks !== !1) return (e) => this._onHyperlinkClick(e);
2832
+ }
2833
+ _onHyperlinkClick(e) {
2834
+ let t = this._resolveInternalSlideIndex(e);
2835
+ if (this._opts.onHyperlinkClick) {
2836
+ this._opts.onHyperlinkClick(t);
2837
+ return;
2838
+ }
2839
+ if (t.kind === "external") {
2840
+ D(t.url);
2841
+ return;
2842
+ }
2843
+ t.slideIndex !== void 0 && this.scrollToSlide(t.slideIndex);
2844
+ }
2845
+ _resolveInternalSlideIndex(e) {
2846
+ if (e.kind !== "internal" || e.slideIndex !== void 0) return e;
2847
+ let t = this._pres?.resolveInternalTarget(e.ref, this._range().topIndex);
2848
+ return t === void 0 ? e : {
2849
+ ...e,
2850
+ slideIndex: t
2851
+ };
2852
+ }
2853
+ get topVisibleSlide() {
2854
+ return this._scroller.lastRange?.topIndex ?? 0;
2855
+ }
2856
+ async getResourceMetrics() {
2857
+ if (!this._pres) throw Error("Presentation not loaded");
2858
+ return await this._pres.getResourceMetrics();
2859
+ }
2860
+ getSelectionContext(e = {}) {
2861
+ if (this._destroyed) throw Error("PptxScrollViewer is destroyed");
2862
+ if (this._pres && this._activeCommentId !== null && this._activeCommentSlide !== null) {
2863
+ let t = this._pres.getComments(this._activeCommentSlide), n = t.findIndex((e, t) => $(e, t, this._activeCommentSlide) === this._activeCommentId), r = t[n];
2864
+ if (r && n >= 0) return un(r, this._activeCommentSlide, n, this._activeCommentId, e);
2865
+ }
2866
+ return (this._opts.enableTextSelection ? Z(this._wrapper, this._wrapper.ownerDocument?.getSelection?.() ?? null, e) : null) ?? (this._selection.elementContext ? rn(this._selection.elementContext, e.maxTextCharacters) : null);
2867
+ }
2868
+ destroy() {
2869
+ this._destroyed || (this._destroyed = !0, this._commentNavigation.begin(), this._errorRouter.close(), this._invalidateFind(), this._findActive = !1, this._layout.unbind(), this._selection.destroy(), this._media.destroy(), this._commentNavigation.destroy(), this._highlights.destroy(), this._commentOverlay.destroy(), this._selection.clearElementContext(), this._scroller.destroy(), this._zoom.destroy(), this._commentMargin.destroy(), this._presentationOwner.close(), this._shell.destroy());
2870
+ }
2871
+ }, En = /* @__PURE__ */ e({
2872
+ OoxmlDecodedImageLimitError: () => Ie,
2873
+ OoxmlError: () => h,
2874
+ OoxmlResourceLimitError: () => g,
2875
+ PptxPresentation: () => X,
2876
+ PptxScrollViewer: () => Tn,
2877
+ PptxViewer: () => hn,
2878
+ TiffDecodeError: () => Re,
2879
+ autoResize: () => ze,
2880
+ buildPptxHighlightLayer: () => R,
2881
+ buildPptxTextLayer: () => L,
2882
+ isOoxmlDecodedImageLimitError: () => M,
2883
+ isTiffDecodeError: () => Le,
2884
+ openExternalHyperlink: () => D,
2885
+ readPptxTextSelectionContext: () => Z,
2886
+ renderSlide: () => o
2887
+ });
2888
+ export { Z as a, R as c, hn as i, L as l, Tn as n, X as o, $ as r, K as s, En as t };