@poe-platform/safe-bash 0.1.816 → 0.1.818

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 (461) hide show
  1. package/dist/image-ast/index.js +2 -2
  2. package/dist/mp4-ast/index.d.ts +2 -1
  3. package/dist/mp4-ast/mp4-metadata-source.d.ts +10 -0
  4. package/dist/mp4-ast/mp4-packets-source.d.ts +8 -1
  5. package/dist/mp4-ast/types.d.ts +21 -3
  6. package/dist/pdf-ast/ast.d.ts +2 -0
  7. package/dist/pdf-ast/content/evaluator.d.ts +11 -0
  8. package/dist/pdf-ast/content/retained-evaluator.d.ts +2 -2
  9. package/dist/pdf-ast/content/retained-page.d.ts +2 -2
  10. package/dist/pdf-ast/cos/value-parser.d.ts +2 -0
  11. package/dist/pdf-ast/extract/html-text-stream.d.ts +14 -0
  12. package/dist/pdf-ast/extract/logical-text-stream.d.ts +14 -0
  13. package/dist/pdf-ast/extract/raw-text-index.d.ts +18 -4
  14. package/dist/pdf-ast/extract/retained-color.d.ts +6 -6
  15. package/dist/pdf-ast/extract/retained-decoded-image.d.ts +2 -2
  16. package/dist/pdf-ast/extract/stored-text-glyphs.d.ts +8 -0
  17. package/dist/pdf-ast/fonts/resolve.d.ts +5 -1
  18. package/dist/pdf-ast/fonts/retained.d.ts +2 -2
  19. package/dist/pdf-ast/image.d.ts +2 -0
  20. package/dist/pdf-ast/image.js +19 -0
  21. package/dist/pdf-ast/index.d.ts +3 -0
  22. package/dist/pdf-ast/index.js +264 -66845
  23. package/dist/pdf-ast/render/postscript.d.ts +6 -0
  24. package/dist/pdf-ast/render/raster.d.ts +21 -1
  25. package/dist/pdf-ast/retained-document.d.ts +16 -95
  26. package/dist/pdf-ast/retained-reader.d.ts +109 -0
  27. package/dist/safe-bash/command-chunks/biff-AYJZR2YV-JPESBEOO.js +5741 -0
  28. package/dist/safe-bash/command-chunks/{chunk-SL4LD25A.js → chunk-232N24HE.js} +9 -9
  29. package/dist/safe-bash/command-chunks/{chunk-ALD53QFL.js → chunk-2C4QMQQD.js} +42 -12
  30. package/dist/safe-bash/command-chunks/{chunk-3PM46VWH.js → chunk-2FEMMALH.js} +4 -4
  31. package/dist/safe-bash/command-chunks/chunk-2J4OQT3F.js +153 -0
  32. package/dist/safe-bash/command-chunks/{chunk-QDV2NIFR.js → chunk-2TMTGVJR.js} +1 -1
  33. package/dist/safe-bash/command-chunks/{chunk-ARE267HR.js → chunk-2WTDP3TP.js} +5 -5
  34. package/dist/safe-bash/command-chunks/{chunk-GEDO5V32.js → chunk-2XR7B6DY.js} +602 -211
  35. package/dist/safe-bash/command-chunks/{chunk-EY3UE26F.js → chunk-2YC6MWQB.js} +1 -1
  36. package/dist/safe-bash/command-chunks/{chunk-UPWLHHZ2.js → chunk-37KBCKDF.js} +13 -13
  37. package/dist/safe-bash/command-chunks/{chunk-DOVWHVHI.js → chunk-3B6554G6.js} +5 -5
  38. package/dist/safe-bash/command-chunks/{chunk-FB2WPI3M.js → chunk-3ZGO24WG.js} +1 -1
  39. package/dist/safe-bash/command-chunks/{chunk-GR4ONCQ5.js → chunk-424NYO35.js} +7 -7
  40. package/dist/safe-bash/command-chunks/{chunk-MQE77MEQ.js → chunk-45GTHPL5.js} +3 -3
  41. package/dist/safe-bash/command-chunks/{chunk-AF2IO57Q.js → chunk-4OHTYYNU.js} +8 -136
  42. package/dist/safe-bash/command-chunks/{chunk-ICJH6A73.js → chunk-4PMMJ45F.js} +3 -3
  43. package/dist/safe-bash/command-chunks/{chunk-57PK2QFX.js → chunk-4SFX6YGC.js} +6 -6
  44. package/dist/safe-bash/command-chunks/{chunk-G3LUT475.js → chunk-4WHTTCKY.js} +6 -6
  45. package/dist/safe-bash/command-chunks/{chunk-DBZCTL7C.js → chunk-4Z7PBIMP.js} +20 -18
  46. package/dist/safe-bash/command-chunks/{chunk-A4P37F3P.js → chunk-57SKL76U.js} +3 -3
  47. package/dist/safe-bash/command-chunks/{chunk-J6FNSVHT.js → chunk-5GP4A3TD.js} +5 -5
  48. package/dist/safe-bash/command-chunks/{chunk-OFONWWEZ.js → chunk-5IHJWBDR.js} +2 -2
  49. package/dist/safe-bash/command-chunks/{chunk-A2L3U7DW.js → chunk-5OS4Q3AX.js} +4 -4
  50. package/dist/safe-bash/command-chunks/{chunk-FUYZUETI.js → chunk-5PMLTSQ5.js} +2 -2
  51. package/dist/safe-bash/command-chunks/{chunk-TXU7MMHN.js → chunk-5RDS6CNQ.js} +13 -13
  52. package/dist/safe-bash/command-chunks/{chunk-FR63MJSO.js → chunk-5UGQGB5Y.js} +7 -7
  53. package/dist/safe-bash/command-chunks/{chunk-UKAGRRLZ.js → chunk-5VY5O37W.js} +1 -1
  54. package/dist/safe-bash/command-chunks/chunk-5WS6DXYE.js +68444 -0
  55. package/dist/safe-bash/command-chunks/{chunk-2ALHVXEM.js → chunk-6EK76ERE.js} +2 -2
  56. package/dist/safe-bash/command-chunks/{chunk-4772DJKS.js → chunk-6GCK2KSL.js} +61 -26
  57. package/dist/safe-bash/command-chunks/{chunk-T5OQ53XS.js → chunk-6IID5HTY.js} +1 -1
  58. package/dist/safe-bash/command-chunks/{chunk-EZDWPTYB.js → chunk-6LOAJOWK.js} +13 -13
  59. package/dist/safe-bash/command-chunks/{chunk-WMBELKPP.js → chunk-6PE2L522.js} +6 -6
  60. package/dist/safe-bash/command-chunks/{chunk-ZAYTFXUX.js → chunk-73KY3MZ3.js} +4 -4
  61. package/dist/safe-bash/command-chunks/{chunk-BOVDUJ3A.js → chunk-77WBFVZQ.js} +7 -7
  62. package/dist/safe-bash/command-chunks/{chunk-3DWFXESW.js → chunk-7GJJDM2F.js} +2 -2
  63. package/dist/safe-bash/command-chunks/{chunk-WIW3KDBS.js → chunk-7NFICYRU.js} +2 -2
  64. package/dist/safe-bash/command-chunks/{chunk-35DU6I2M.js → chunk-7ZEGARPB.js} +5 -5
  65. package/dist/safe-bash/command-chunks/{chunk-A5SPMSKD.js → chunk-A32PUWYE.js} +2 -2
  66. package/dist/safe-bash/command-chunks/{chunk-KYIGYYEY.js → chunk-A32ZROH5.js} +3 -3
  67. package/dist/safe-bash/command-chunks/{chunk-IOXMGD2H.js → chunk-ADVQZLLE.js} +2 -2
  68. package/dist/safe-bash/command-chunks/{chunk-CGJ7GMHO.js → chunk-AEZU6NZE.js} +2 -2
  69. package/dist/safe-bash/command-chunks/{chunk-KDDXLHN7.js → chunk-ATHU53C2.js} +3 -3
  70. package/dist/safe-bash/command-chunks/{chunk-R7LF4XQV.js → chunk-B6T2526I.js} +2 -2
  71. package/dist/safe-bash/command-chunks/{chunk-PPN53PX3.js → chunk-BB7HBO56.js} +2 -2
  72. package/dist/safe-bash/command-chunks/{chunk-ZM7HMBAJ.js → chunk-BDGNKRY4.js} +7 -7
  73. package/dist/safe-bash/command-chunks/{chunk-VMZIAFVJ.js → chunk-BFRSYJUC.js} +8 -8
  74. package/dist/safe-bash/command-chunks/{chunk-X42MJT2J.js → chunk-BJL7AGA5.js} +1 -1
  75. package/dist/safe-bash/command-chunks/{chunk-VZTVR3JI.js → chunk-C2QUG7IP.js} +3 -3
  76. package/dist/safe-bash/command-chunks/{chunk-IVKAFEPO.js → chunk-C34RLMAC.js} +9 -9
  77. package/dist/safe-bash/command-chunks/{chunk-5O45KGW5.js → chunk-C5VUJOUQ.js} +1 -1
  78. package/dist/safe-bash/command-chunks/{chunk-LQDANF2B.js → chunk-CCNOZKAK.js} +8 -8
  79. package/dist/safe-bash/command-chunks/{chunk-FEBTT5NH.js → chunk-CEHICGP6.js} +2 -2
  80. package/dist/safe-bash/command-chunks/{chunk-SICTBSLW.js → chunk-CODJMTSA.js} +6 -6
  81. package/dist/safe-bash/command-chunks/{chunk-LJ3UYESS.js → chunk-CP5EO5TT.js} +1 -1
  82. package/dist/safe-bash/command-chunks/{chunk-45DKGZYO.js → chunk-CSS5KXQC.js} +329 -152
  83. package/dist/safe-bash/command-chunks/{chunk-6RLWPB44.js → chunk-CZSLXQU2.js} +1 -1
  84. package/dist/safe-bash/command-chunks/{chunk-3ZWFE4CK.js → chunk-D2ZT2UUT.js} +3 -3
  85. package/dist/safe-bash/command-chunks/{chunk-WH624PKJ.js → chunk-D5XSGHXN.js} +2 -2
  86. package/dist/safe-bash/command-chunks/{chunk-NDALIHKK.js → chunk-D7UFAIBS.js} +18 -18
  87. package/dist/safe-bash/command-chunks/{chunk-ISFGPCED.js → chunk-DCKAY6HV.js} +6 -6
  88. package/dist/safe-bash/command-chunks/{chunk-LNAZ3E4Q.js → chunk-DGCJVZW6.js} +1 -1
  89. package/dist/safe-bash/command-chunks/{chunk-LFSWLJPR.js → chunk-DJB5RB6U.js} +288 -32
  90. package/dist/safe-bash/command-chunks/{chunk-FGHSE3RZ.js → chunk-DZ4ELL34.js} +1 -1
  91. package/dist/safe-bash/command-chunks/{chunk-LQX7RAF7.js → chunk-EBKKYRQJ.js} +5 -5
  92. package/dist/safe-bash/command-chunks/{chunk-QNETPOMH.js → chunk-EDBNI7WE.js} +14 -14
  93. package/dist/safe-bash/command-chunks/{chunk-5GDF5FAS.js → chunk-EEJ3YXVO.js} +1 -1
  94. package/dist/safe-bash/command-chunks/{chunk-RTHYAGKI.js → chunk-ETN25WCR.js} +2 -2
  95. package/dist/safe-bash/command-chunks/{chunk-ET6LMDEX.js → chunk-EV3DPRWE.js} +9 -9
  96. package/dist/safe-bash/command-chunks/{chunk-3MUFXGA2.js → chunk-F2JUB7JI.js} +1 -1
  97. package/dist/safe-bash/command-chunks/{chunk-345YBIHP.js → chunk-F42WV2YO.js} +19 -19
  98. package/dist/safe-bash/command-chunks/{chunk-FTZFCMVI.js → chunk-FAVWWMFW.js} +12 -12
  99. package/dist/safe-bash/command-chunks/{chunk-XBWD6SI3.js → chunk-FDRE535F.js} +16 -16
  100. package/dist/safe-bash/command-chunks/{chunk-WMV5224N.js → chunk-FILE5PBI.js} +3 -3
  101. package/dist/safe-bash/command-chunks/{chunk-XPQUUFQD.js → chunk-FPOM47UA.js} +2 -2
  102. package/dist/safe-bash/command-chunks/{chunk-QMBMZSJF.js → chunk-FQ2WRT4Q.js} +3 -3
  103. package/dist/safe-bash/command-chunks/{chunk-H56BSMFQ.js → chunk-FVAFISPY.js} +4 -4
  104. package/dist/safe-bash/command-chunks/{chunk-2QZUAZTH.js → chunk-GIQUIF6E.js} +1 -1
  105. package/dist/safe-bash/command-chunks/{chunk-2TWXRJPB.js → chunk-GNORF6RY.js} +13 -13
  106. package/dist/safe-bash/command-chunks/{chunk-K7VDCBXW.js → chunk-GPLN6JV2.js} +24 -24
  107. package/dist/safe-bash/command-chunks/{chunk-DZOKH5BL.js → chunk-GQ7BD75U.js} +3 -3
  108. package/dist/safe-bash/command-chunks/{chunk-N4HWOLGZ.js → chunk-GY2C555A.js} +2 -2
  109. package/dist/safe-bash/command-chunks/{chunk-N32AP43V.js → chunk-GZNX5SS4.js} +7 -7
  110. package/dist/safe-bash/command-chunks/{chunk-YPG55QTP.js → chunk-HCJWEB6P.js} +1 -1
  111. package/dist/safe-bash/command-chunks/{chunk-4ABR3KGK.js → chunk-HNY7LZ5P.js} +3 -3
  112. package/dist/safe-bash/command-chunks/{chunk-P462JTNT.js → chunk-HOBXZX23.js} +5 -5
  113. package/dist/safe-bash/command-chunks/{chunk-5KZMR6AJ.js → chunk-HW3IOXT6.js} +6 -6
  114. package/dist/safe-bash/command-chunks/{chunk-3VGQTLO6.js → chunk-HX7QQNWS.js} +4 -4
  115. package/dist/safe-bash/command-chunks/{chunk-TXWDR2P4.js → chunk-IBT3OWXB.js} +1 -1
  116. package/dist/safe-bash/command-chunks/{chunk-OHEZQ4QA.js → chunk-IFBLXBBM.js} +9 -9
  117. package/dist/safe-bash/command-chunks/{chunk-HOJ7WDTS.js → chunk-IJZUUXLL.js} +3 -3
  118. package/dist/safe-bash/command-chunks/{chunk-BZRWZ6GO.js → chunk-IKU7ZBF3.js} +2 -2
  119. package/dist/safe-bash/command-chunks/{chunk-CKIXC7AO.js → chunk-IPKYPADE.js} +3 -3
  120. package/dist/safe-bash/command-chunks/{chunk-IWVANZWH.js → chunk-JLPBGKVC.js} +3 -3
  121. package/dist/safe-bash/command-chunks/{chunk-6M3JTPKE.js → chunk-JNRX5EFF.js} +5 -5
  122. package/dist/safe-bash/command-chunks/{chunk-5YL453ZF.js → chunk-JSX5CFZY.js} +36 -36
  123. package/dist/safe-bash/command-chunks/{chunk-V6JPIZUW.js → chunk-JT656DKZ.js} +7 -7
  124. package/dist/safe-bash/command-chunks/{chunk-DM5WURQL.js → chunk-JY2T3KV2.js} +2 -2
  125. package/dist/safe-bash/command-chunks/{chunk-IZ3SD5S2.js → chunk-K2NV6H7E.js} +4 -4
  126. package/dist/safe-bash/command-chunks/{chunk-62RG3GHF.js → chunk-K6E56LND.js} +6 -6
  127. package/dist/safe-bash/command-chunks/{chunk-FLSXHLJG.js → chunk-KADQKXZE.js} +9 -9
  128. package/dist/safe-bash/command-chunks/{chunk-URQSUMMJ.js → chunk-KFFV7HBL.js} +4 -4
  129. package/dist/safe-bash/command-chunks/{chunk-ONQP4FNV.js → chunk-KZICRCQ7.js} +1 -1
  130. package/dist/safe-bash/command-chunks/{chunk-N35IJXBK.js → chunk-L6X4EEN6.js} +9 -9
  131. package/dist/safe-bash/command-chunks/{chunk-SHLT5R64.js → chunk-LF7YJ5VQ.js} +9 -9
  132. package/dist/safe-bash/command-chunks/{chunk-GMBUOYTN.js → chunk-LNHTLWIL.js} +4 -4
  133. package/dist/safe-bash/command-chunks/{chunk-A6OTPNNI.js → chunk-LPKMNCC5.js} +3 -3
  134. package/dist/safe-bash/command-chunks/{chunk-MUTARE5I.js → chunk-LSKA4IR4.js} +6 -6
  135. package/dist/safe-bash/command-chunks/{chunk-N3ZH4YYH.js → chunk-LTWX23FS.js} +3 -3
  136. package/dist/safe-bash/command-chunks/{chunk-JA36YOZI.js → chunk-LUJUYUOG.js} +1 -1
  137. package/dist/safe-bash/command-chunks/{chunk-4X2MPZXW.js → chunk-M42GCI5F.js} +2 -2
  138. package/dist/safe-bash/command-chunks/{chunk-AYQPJQJR.js → chunk-M5BFAMXD.js} +6 -6
  139. package/dist/safe-bash/command-chunks/{chunk-OFDJJRAD.js → chunk-M7DZ7COK.js} +9 -9
  140. package/dist/safe-bash/command-chunks/{chunk-RINR7XPR.js → chunk-MMSKDYK6.js} +234 -8
  141. package/dist/safe-bash/command-chunks/{chunk-NKK76B4V.js → chunk-MN7EEK6Y.js} +8 -8
  142. package/dist/safe-bash/command-chunks/{chunk-OBIXFO25.js → chunk-MOJQT6RW.js} +8 -8
  143. package/dist/safe-bash/command-chunks/{chunk-HOKPYTHQ.js → chunk-MPRUGL4W.js} +2 -2
  144. package/dist/safe-bash/command-chunks/{chunk-CORUUCS2.js → chunk-MRBX4KEP.js} +3 -3
  145. package/dist/safe-bash/command-chunks/chunk-MTWFSBNG.js +137 -0
  146. package/dist/safe-bash/command-chunks/{chunk-RRAQII52.js → chunk-MURNTGDL.js} +5 -5
  147. package/dist/safe-bash/command-chunks/{chunk-KDBU5Q2N.js → chunk-MWVELMXZ.js} +6 -6
  148. package/dist/safe-bash/command-chunks/{chunk-PRO7JOIH.js → chunk-N3MAYM6Y.js} +8 -8
  149. package/dist/safe-bash/command-chunks/{chunk-E22EAYJN.js → chunk-NFWLZDMY.js} +177 -34
  150. package/dist/safe-bash/command-chunks/{chunk-GAROGIVU.js → chunk-NP2QXF2X.js} +1 -1
  151. package/dist/safe-bash/command-chunks/{chunk-SNA2LVBX.js → chunk-NPVOYY2A.js} +1 -1
  152. package/dist/safe-bash/command-chunks/{chunk-ENMJHB2C.js → chunk-NTXRKJPZ.js} +3 -3
  153. package/dist/safe-bash/command-chunks/{chunk-3K5CVXUV.js → chunk-NZF56C25.js} +10 -10
  154. package/dist/safe-bash/command-chunks/{chunk-5MNQTHED.js → chunk-OA4MEWTN.js} +4 -4
  155. package/dist/safe-bash/command-chunks/{chunk-SWIF6BBY.js → chunk-OL75SBZL.js} +5 -5
  156. package/dist/safe-bash/command-chunks/{chunk-LT2YCGC5.js → chunk-OVQSILY3.js} +5 -5
  157. package/dist/safe-bash/command-chunks/{chunk-WDVPHDBH.js → chunk-P57V45F2.js} +2 -2
  158. package/dist/safe-bash/command-chunks/{chunk-OWCBX5M2.js → chunk-PAY4ULWY.js} +1 -1
  159. package/dist/safe-bash/command-chunks/{chunk-CHZE6FNT.js → chunk-PFUZPAXQ.js} +2 -2
  160. package/dist/safe-bash/command-chunks/{chunk-NLCUQD7Y.js → chunk-PX6E5MHY.js} +9 -9
  161. package/dist/safe-bash/command-chunks/{chunk-POGVOCOB.js → chunk-QCN7MRRU.js} +8 -8
  162. package/dist/safe-bash/command-chunks/{chunk-ZZERSKAR.js → chunk-QLE6JUR7.js} +5 -5
  163. package/dist/safe-bash/command-chunks/{chunk-LZY46GYY.js → chunk-QMWBKR4C.js} +5 -5
  164. package/dist/safe-bash/command-chunks/{chunk-BIJW6QWB.js → chunk-QNLX3CZH.js} +13 -13
  165. package/dist/safe-bash/command-chunks/{chunk-MDFNUNK5.js → chunk-QWX5IERU.js} +6 -6
  166. package/dist/safe-bash/command-chunks/{chunk-WOL3LBXE.js → chunk-R2N3E267.js} +1 -1
  167. package/dist/safe-bash/command-chunks/{chunk-ZNCPIZCN.js → chunk-R6X63VAO.js} +1 -1
  168. package/dist/safe-bash/command-chunks/{chunk-FGARVKAX.js → chunk-RNIFPFGC.js} +13 -11
  169. package/dist/safe-bash/command-chunks/{chunk-OIHQXURE.js → chunk-ROE6KD4C.js} +1 -1
  170. package/dist/safe-bash/command-chunks/{chunk-BKK4MS3V.js → chunk-RR6XG2I6.js} +1 -1
  171. package/dist/safe-bash/command-chunks/chunk-RYOHOS2I.js +398 -0
  172. package/dist/safe-bash/command-chunks/{chunk-4QEJPP3K.js → chunk-S5X7PBO4.js} +1 -1
  173. package/dist/safe-bash/command-chunks/{chunk-IHLZ6HNQ.js → chunk-TSKJNCKD.js} +3 -2
  174. package/dist/safe-bash/command-chunks/{chunk-U42WHQRH.js → chunk-TTTNFKT6.js} +5 -5
  175. package/dist/safe-bash/command-chunks/{chunk-EWC56JNI.js → chunk-TTVJJZOM.js} +5 -5
  176. package/dist/safe-bash/command-chunks/{chunk-TY7JXEWI.js → chunk-UBX5I5HY.js} +11 -11
  177. package/dist/safe-bash/command-chunks/{chunk-QOKFSYD5.js → chunk-UE34SQET.js} +9 -9
  178. package/dist/safe-bash/command-chunks/{chunk-DXOXUKQB.js → chunk-UH4CQIU3.js} +4 -4
  179. package/dist/safe-bash/command-chunks/{chunk-VNNNVT4C.js → chunk-UZZ2WJQV.js} +4 -4
  180. package/dist/safe-bash/command-chunks/{chunk-QNX5LZBK.js → chunk-V6NZVM7C.js} +7 -7
  181. package/dist/safe-bash/command-chunks/{chunk-KLAC2MIZ.js → chunk-VEZULAIA.js} +6 -6
  182. package/dist/safe-bash/command-chunks/{chunk-OCV5ZU35.js → chunk-VSTAHYCV.js} +3 -3
  183. package/dist/safe-bash/command-chunks/{chunk-UFLMOU3B.js → chunk-VUJCVXD4.js} +1 -1
  184. package/dist/safe-bash/command-chunks/{chunk-5V7WIQ2D.js → chunk-VW67MA53.js} +3 -3
  185. package/dist/safe-bash/command-chunks/{chunk-B2C3UPJS.js → chunk-W42SUPD6.js} +13 -1
  186. package/dist/safe-bash/command-chunks/{chunk-2IMIKROX.js → chunk-WI5NEHPD.js} +2 -2
  187. package/dist/safe-bash/command-chunks/{chunk-SBXS4S6Y.js → chunk-WJSU2UVG.js} +2 -2
  188. package/dist/safe-bash/command-chunks/{chunk-VVWHFNHD.js → chunk-WPEIOUJN.js} +415 -25
  189. package/dist/safe-bash/command-chunks/{chunk-YKODRSGT.js → chunk-WRCYZJNO.js} +1 -1
  190. package/dist/safe-bash/command-chunks/{chunk-TID5TSQW.js → chunk-WRJV7OVO.js} +1 -1
  191. package/dist/safe-bash/command-chunks/{chunk-T4SEQU66.js → chunk-X4TWJNW7.js} +3 -3
  192. package/dist/safe-bash/command-chunks/{chunk-CKA7ZROU.js → chunk-X6KFCAWZ.js} +7 -7
  193. package/dist/safe-bash/command-chunks/{chunk-ROQ3VNVX.js → chunk-X6KO7D6R.js} +8 -8
  194. package/dist/safe-bash/command-chunks/{chunk-S5ER73EA.js → chunk-XB5ZZHFD.js} +3 -3
  195. package/dist/safe-bash/command-chunks/{chunk-FHQOFEQK.js → chunk-XLFOLLUZ.js} +8 -8
  196. package/dist/safe-bash/command-chunks/{chunk-UJYXSLM6.js → chunk-XLPEPCQC.js} +2 -2
  197. package/dist/safe-bash/command-chunks/{chunk-UT5X6QRU.js → chunk-XQFEP43Y.js} +5 -5
  198. package/dist/safe-bash/command-chunks/chunk-Y7XL6CWB.js +771 -0
  199. package/dist/safe-bash/command-chunks/{chunk-RVWIEXR7.js → chunk-YKEMSPJZ.js} +4 -4
  200. package/dist/safe-bash/command-chunks/{chunk-ERWIJYCS.js → chunk-YN3OEJAZ.js} +7 -7
  201. package/dist/safe-bash/command-chunks/{chunk-6YF2QADH.js → chunk-YOYK2I4N.js} +2 -2
  202. package/dist/safe-bash/command-chunks/{chunk-26JE5JEB.js → chunk-YS5ZKMRJ.js} +4 -4
  203. package/dist/safe-bash/command-chunks/{chunk-LMLBQSAM.js → chunk-YW7WU7W2.js} +5 -5
  204. package/dist/safe-bash/command-chunks/{chunk-YXR4JE4U.js → chunk-Z33YS3DW.js} +3 -3
  205. package/dist/safe-bash/command-chunks/{chunk-T2FRXSQT.js → chunk-ZBXUAM34.js} +2 -2
  206. package/dist/safe-bash/command-chunks/{chunk-VVV45NLY.js → chunk-ZJUU5IAS.js} +1 -1
  207. package/dist/safe-bash/command-chunks/{chunk-7OCTMVYJ.js → chunk-ZNABMTV3.js} +1 -1
  208. package/dist/safe-bash/command-chunks/{chunk-6JGICYHP.js → chunk-ZSF2T5D4.js} +1 -1
  209. package/dist/safe-bash/command-chunks/{command-engine-GHE6QUHU.js → command-engine-PFYHL7GS.js} +14 -4
  210. package/dist/safe-bash/command-chunks/{engine-RG6HQCCB-FXYZS264.js → engine-5AVSKFBI-D7Q5VPUN.js} +1 -1
  211. package/dist/safe-bash/command-chunks/model-store-IIWQHSEZ.js +54 -0
  212. package/dist/safe-bash/command-chunks/odf-SL5TG4B3-XI3FNOTN.js +3041 -0
  213. package/dist/safe-bash/command-chunks/{xlsx-RE54MFCS-IQ6OXXKK.js → xlsx-RE54MFCS-4UZ5W3U7.js} +1 -1
  214. package/dist/safe-bash-command-apply-patch/apply.js +1 -1
  215. package/dist/safe-bash-command-apply-patch/index.js +1 -1
  216. package/dist/safe-bash-command-awk/awk-inspection.js +2 -2
  217. package/dist/safe-bash-command-awk/awk.js +5 -5
  218. package/dist/safe-bash-command-awk/index.js +5 -5
  219. package/dist/safe-bash-command-cp/index.js +4 -4
  220. package/dist/safe-bash-command-csvkit/index.js +1 -1
  221. package/dist/safe-bash-command-diff/diff.js +2 -2
  222. package/dist/safe-bash-command-diff/index.js +2 -2
  223. package/dist/safe-bash-command-ffmpeg/index.js +1 -1
  224. package/dist/safe-bash-command-ffprobe/index.js +2 -2
  225. package/dist/safe-bash-command-ffprobe/media.js +2 -2
  226. package/dist/safe-bash-command-node/commands/node/browser.js +6 -6
  227. package/dist/safe-bash-command-node/commands/node/default-runtime.js +6 -6
  228. package/dist/safe-bash-command-node/commands/node/filesystem.js +2 -2
  229. package/dist/safe-bash-command-node/commands/node/safejs.js +6 -6
  230. package/dist/safe-bash-command-node/commands/node/timers.js +2 -2
  231. package/dist/safe-bash-command-patch/index.js +3 -3
  232. package/dist/safe-bash-command-patch/patch-formats.js +2 -2
  233. package/dist/safe-bash-command-patch/patch.js +3 -3
  234. package/dist/safe-bash-command-patch/unified.js +1 -1
  235. package/dist/safe-bash-command-pdftoppm/index.js +89 -124
  236. package/dist/safe-bash-command-pdftotext/index.d.ts +1 -1
  237. package/dist/safe-bash-command-pdftotext/index.js +538 -379
  238. package/dist/safe-bash-command-playwright-cli/index.js +19 -19
  239. package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +6 -6
  240. package/dist/safe-bash-command-playwright-cli/playwright/adapter.js +3 -3
  241. package/dist/safe-bash-command-playwright-cli/playwright/controller.js +13 -13
  242. package/dist/safe-bash-command-playwright-cli/playwright/index.js +19 -19
  243. package/dist/safe-bash-command-playwright-cli/playwright/native-storage-replacement.js +2 -2
  244. package/dist/safe-bash-command-playwright-cli/playwright/open-options.js +2 -2
  245. package/dist/safe-bash-command-playwright-cli/playwright/profile.js +5 -5
  246. package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +4 -4
  247. package/dist/safe-bash-command-playwright-cli/playwright/storage-capabilities.js +3 -3
  248. package/dist/safe-bash-command-pptx/engine.js +1 -1
  249. package/dist/safe-bash-command-python/executor.js +10 -10
  250. package/dist/safe-bash-command-python/index.js +10 -10
  251. package/dist/safe-bash-command-python/jspi.js +2 -2
  252. package/dist/safe-bash-command-safejs/index.js +2 -2
  253. package/dist/safe-bash-command-safejs/runtime.js +2 -2
  254. package/dist/safe-bash-command-ssconvert/index.js +16 -16
  255. package/dist/safe-bash-command-unzip/index.js +4 -4
  256. package/dist/safe-bash-docx-engine/ancillary-resources.js +10 -10
  257. package/dist/safe-bash-docx-engine/batch-operations.js +67 -67
  258. package/dist/safe-bash-docx-engine/batch-result-schema.js +79 -79
  259. package/dist/safe-bash-docx-engine/batch.js +78 -78
  260. package/dist/safe-bash-docx-engine/bookmarks.js +18 -18
  261. package/dist/safe-bash-docx-engine/charts.js +11 -11
  262. package/dist/safe-bash-docx-engine/command-option-rules.js +6 -6
  263. package/dist/safe-bash-docx-engine/command-properties.js +3 -3
  264. package/dist/safe-bash-docx-engine/comments.js +26 -26
  265. package/dist/safe-bash-docx-engine/control-bindings.js +21 -21
  266. package/dist/safe-bash-docx-engine/control-repeat.js +21 -21
  267. package/dist/safe-bash-docx-engine/controls.js +19 -19
  268. package/dist/safe-bash-docx-engine/create.js +11 -11
  269. package/dist/safe-bash-docx-engine/diagrams.js +11 -11
  270. package/dist/safe-bash-docx-engine/diff.js +13 -13
  271. package/dist/safe-bash-docx-engine/document-properties.js +16 -16
  272. package/dist/safe-bash-docx-engine/equations.js +17 -17
  273. package/dist/safe-bash-docx-engine/extract.js +14 -14
  274. package/dist/safe-bash-docx-engine/fields.js +23 -23
  275. package/dist/safe-bash-docx-engine/font-inventory.js +18 -18
  276. package/dist/safe-bash-docx-engine/font-resources.js +6 -6
  277. package/dist/safe-bash-docx-engine/image-batch-operations.js +14 -14
  278. package/dist/safe-bash-docx-engine/image-insertion.js +21 -21
  279. package/dist/safe-bash-docx-engine/image-layout.js +19 -19
  280. package/dist/safe-bash-docx-engine/image-replacement.js +22 -22
  281. package/dist/safe-bash-docx-engine/images.js +19 -19
  282. package/dist/safe-bash-docx-engine/index.js +111 -111
  283. package/dist/safe-bash-docx-engine/inspection.js +20 -20
  284. package/dist/safe-bash-docx-engine/invocation.js +9 -9
  285. package/dist/safe-bash-docx-engine/io.js +9 -9
  286. package/dist/safe-bash-docx-engine/links.js +21 -21
  287. package/dist/safe-bash-docx-engine/lists.js +20 -20
  288. package/dist/safe-bash-docx-engine/locations.js +15 -15
  289. package/dist/safe-bash-docx-engine/notes.js +22 -22
  290. package/dist/safe-bash-docx-engine/objects.js +19 -19
  291. package/dist/safe-bash-docx-engine/operation-json-schema.js +3 -3
  292. package/dist/safe-bash-docx-engine/operation-schema.js +2 -2
  293. package/dist/safe-bash-docx-engine/pack.js +14 -14
  294. package/dist/safe-bash-docx-engine/package-view-batch-operations.js +22 -22
  295. package/dist/safe-bash-docx-engine/pandoc-adapter.js +29 -29
  296. package/dist/safe-bash-docx-engine/paragraph-edit.js +25 -25
  297. package/dist/safe-bash-docx-engine/part-provider.js +3 -3
  298. package/dist/safe-bash-docx-engine/property-values.js +3 -3
  299. package/dist/safe-bash-docx-engine/publication.js +9 -9
  300. package/dist/safe-bash-docx-engine/removal.js +21 -21
  301. package/dist/safe-bash-docx-engine/revision-decisions.js +22 -22
  302. package/dist/safe-bash-docx-engine/revision-edit.js +20 -20
  303. package/dist/safe-bash-docx-engine/revisions.js +18 -18
  304. package/dist/safe-bash-docx-engine/run-format.js +20 -20
  305. package/dist/safe-bash-docx-engine/sanitize.js +34 -34
  306. package/dist/safe-bash-docx-engine/sections.js +19 -19
  307. package/dist/safe-bash-docx-engine/settings.js +11 -11
  308. package/dist/safe-bash-docx-engine/shape-edit.js +21 -21
  309. package/dist/safe-bash-docx-engine/signatures.js +15 -15
  310. package/dist/safe-bash-docx-engine/stories.js +22 -22
  311. package/dist/safe-bash-docx-engine/structure-model-batch-operations.js +38 -38
  312. package/dist/safe-bash-docx-engine/style-model-batch-operations.js +27 -27
  313. package/dist/safe-bash-docx-engine/style-model-result-schema.js +44 -44
  314. package/dist/safe-bash-docx-engine/styles.js +18 -18
  315. package/dist/safe-bash-docx-engine/table-edit.js +27 -27
  316. package/dist/safe-bash-docx-engine/table-read.js +16 -16
  317. package/dist/safe-bash-docx-engine/template.js +22 -22
  318. package/dist/safe-bash-docx-engine/text-replace.js +20 -20
  319. package/dist/safe-bash-docx-engine/text-resource-read.js +16 -16
  320. package/dist/safe-bash-docx-engine/text.js +16 -16
  321. package/dist/safe-bash-docx-engine/validation.js +7 -7
  322. package/dist/safe-bash-docx-engine/xml-parts.js +22 -22
  323. package/dist/safe-bash-network-engine/index.js +4 -4
  324. package/dist/safe-bash-network-engine/transfer.js +12 -12
  325. package/dist/safe-bash-presentation-engine/accessibility.js +15 -15
  326. package/dist/safe-bash-presentation-engine/animation-editing.js +5 -5
  327. package/dist/safe-bash-presentation-engine/animations.js +5 -5
  328. package/dist/safe-bash-presentation-engine/backgrounds.js +6 -6
  329. package/dist/safe-bash-presentation-engine/chart-editing.js +18 -18
  330. package/dist/safe-bash-presentation-engine/chart-object-operations.js +12 -12
  331. package/dist/safe-bash-presentation-engine/charts.js +15 -15
  332. package/dist/safe-bash-presentation-engine/command-placeholder.js +39 -38
  333. package/dist/safe-bash-presentation-engine/comments.js +6 -6
  334. package/dist/safe-bash-presentation-engine/connector-operations.js +16 -16
  335. package/dist/safe-bash-presentation-engine/connectors.js +13 -13
  336. package/dist/safe-bash-presentation-engine/diff.js +21 -20
  337. package/dist/safe-bash-presentation-engine/drawing-format.js +7 -7
  338. package/dist/safe-bash-presentation-engine/drawing-operations.js +15 -15
  339. package/dist/safe-bash-presentation-engine/drawing-schema.js +8 -8
  340. package/dist/safe-bash-presentation-engine/equations.js +6 -6
  341. package/dist/safe-bash-presentation-engine/fields.js +6 -6
  342. package/dist/safe-bash-presentation-engine/image-extraction.js +7 -7
  343. package/dist/safe-bash-presentation-engine/image-formatting.js +16 -16
  344. package/dist/safe-bash-presentation-engine/image-insertion.js +6 -6
  345. package/dist/safe-bash-presentation-engine/image-replacement.js +7 -7
  346. package/dist/safe-bash-presentation-engine/images.js +6 -6
  347. package/dist/safe-bash-presentation-engine/index.js +96 -95
  348. package/dist/safe-bash-presentation-engine/layouts.js +5 -5
  349. package/dist/safe-bash-presentation-engine/links.js +5 -5
  350. package/dist/safe-bash-presentation-engine/masters.js +4 -4
  351. package/dist/safe-bash-presentation-engine/media-editing.js +10 -10
  352. package/dist/safe-bash-presentation-engine/media-extraction.js +6 -6
  353. package/dist/safe-bash-presentation-engine/media.js +5 -5
  354. package/dist/safe-bash-presentation-engine/memberships.d.ts +1 -0
  355. package/dist/safe-bash-presentation-engine/memberships.js +12 -6
  356. package/dist/safe-bash-presentation-engine/notes.js +6 -6
  357. package/dist/safe-bash-presentation-engine/ole-insertion.js +6 -6
  358. package/dist/safe-bash-presentation-engine/opaque-objects.js +2 -2
  359. package/dist/safe-bash-presentation-engine/package-tools.js +6 -6
  360. package/dist/safe-bash-presentation-engine/presentation-model.js +38 -37
  361. package/dist/safe-bash-presentation-engine/presentation-settings.d.ts +1 -0
  362. package/dist/safe-bash-presentation-engine/presentation-settings.js +12 -5
  363. package/dist/safe-bash-presentation-engine/properties.js +7 -6
  364. package/dist/safe-bash-presentation-engine/retained-inspection.js +3 -3
  365. package/dist/safe-bash-presentation-engine/retained-memberships.d.ts +25 -0
  366. package/dist/safe-bash-presentation-engine/retained-presentation-settings.d.ts +25 -0
  367. package/dist/safe-bash-presentation-engine/retained-tags.d.ts +20 -0
  368. package/dist/safe-bash-presentation-engine/retained-text.d.ts +24 -4
  369. package/dist/safe-bash-presentation-engine/retained-text.js +17 -15
  370. package/dist/safe-bash-presentation-engine/sanitize.js +8 -7
  371. package/dist/safe-bash-presentation-engine/selectors.js +2 -2
  372. package/dist/safe-bash-presentation-engine/shape-groups.js +15 -15
  373. package/dist/safe-bash-presentation-engine/shape-operations.js +14 -14
  374. package/dist/safe-bash-presentation-engine/shape-path-operations.js +16 -16
  375. package/dist/safe-bash-presentation-engine/shape-paths.js +5 -5
  376. package/dist/safe-bash-presentation-engine/shape-selection.js +15 -15
  377. package/dist/safe-bash-presentation-engine/shape-transforms.js +5 -5
  378. package/dist/safe-bash-presentation-engine/shapes.js +11 -11
  379. package/dist/safe-bash-presentation-engine/slide-copy.js +7 -5
  380. package/dist/safe-bash-presentation-engine/slide-import.js +6 -6
  381. package/dist/safe-bash-presentation-engine/slide-merge-split.js +8 -8
  382. package/dist/safe-bash-presentation-engine/slide-model.js +24 -24
  383. package/dist/safe-bash-presentation-engine/slide-removal.js +7 -7
  384. package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +2 -2
  385. package/dist/safe-bash-presentation-engine/slides.js +5 -5
  386. package/dist/safe-bash-presentation-engine/table-operations.js +17 -17
  387. package/dist/safe-bash-presentation-engine/table-spans.js +16 -16
  388. package/dist/safe-bash-presentation-engine/tables.js +15 -15
  389. package/dist/safe-bash-presentation-engine/tags.d.ts +2 -0
  390. package/dist/safe-bash-presentation-engine/tags.js +15 -7
  391. package/dist/safe-bash-presentation-engine/template-bindings.js +16 -16
  392. package/dist/safe-bash-presentation-engine/template-repeat.js +24 -22
  393. package/dist/safe-bash-presentation-engine/text-fitting.js +11 -11
  394. package/dist/safe-bash-presentation-engine/text-frames.js +11 -11
  395. package/dist/safe-bash-presentation-engine/text-paragraphs.js +11 -11
  396. package/dist/safe-bash-presentation-engine/text-reading.js +3 -3
  397. package/dist/safe-bash-presentation-engine/text-replacement.js +6 -6
  398. package/dist/safe-bash-presentation-engine/text-runs.js +8 -8
  399. package/dist/safe-bash-presentation-engine/themes.js +5 -5
  400. package/dist/safe-bash-presentation-engine/transitions.js +5 -5
  401. package/dist/safe-bash-presentation-engine/validation.js +2 -2
  402. package/dist/safe-bash-presentation-engine/xml-parts.js +5 -5
  403. package/dist/safe-bash-xml-engine/document.js +2 -2
  404. package/dist/safe-bash-xml-engine/index.js +2 -2
  405. package/dist/safe-bash-xml-engine/recovery.d.ts +6 -2
  406. package/dist/safe-bash-xml-engine/stored-document.d.ts +3 -0
  407. package/dist/safe-bash-xml-engine/stored-document.js +1 -1
  408. package/dist/safe-bash-xml-engine/stored-evaluate.js +2 -2
  409. package/dist/safe-bash-xml-engine/stored-map.d.ts +21 -0
  410. package/dist/safe-bash-zip-engine/index.js +3 -3
  411. package/dist/safe-bash-zip-engine/zip/repair.js +3 -3
  412. package/dist/safe-bash-zip-engine/zip/safety.js +1 -1
  413. package/dist/safe-bash-zip-engine/zip/sfx.js +3 -3
  414. package/dist/safe-bash-zip-engine/zip/volumes.js +1 -1
  415. package/dist/safe-bash-zip-engine/zip-format.js +3 -3
  416. package/dist/spreadsheet-engine/formatting/cell-text.js +1 -1
  417. package/dist/spreadsheet-engine/{rendering/print → formatting}/general-number.js +3 -3
  418. package/dist/spreadsheet-engine/formulas/functions/python-printf.js +9 -7
  419. package/dist/spreadsheet-engine/solver/program.js +3 -2
  420. package/dist/spreadsheet-engine/solver/run.js +8 -2
  421. package/dist/spreadsheet-engine/solver/sensitivity.d.ts +4 -2
  422. package/dist/spreadsheet-engine/solver/sensitivity.js +80 -42
  423. package/dist/spreadsheet-format-xls/biff-properties-merge.d.ts +2 -1
  424. package/dist/spreadsheet-format-xls/biff-properties-merge.js +36 -30
  425. package/dist/spreadsheet-format-xls/biff-properties-write.js +16 -7
  426. package/dist/spreadsheet-format-xls/biff-properties.d.ts +4 -2
  427. package/dist/spreadsheet-format-xls/biff-properties.js +141 -122
  428. package/dist/spreadsheet-format-xls/biff-property-names.d.ts +27 -0
  429. package/dist/spreadsheet-format-xls/biff-property-names.js +210 -0
  430. package/dist/spreadsheet-format-xls/biff-property-observations.d.ts +33 -0
  431. package/dist/spreadsheet-format-xls/biff-property-observations.js +160 -0
  432. package/dist/xlsx-ast/comment-geometry.js +1 -1
  433. package/package.json +7 -4
  434. package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +15 -0
  435. package/third-party/pdf-ast/licenses/PYTHON-PSF.txt +254 -0
  436. package/third-party/pdf-ast/licenses/V8-BSD.txt +61 -0
  437. package/dist/safe-bash/command-chunks/biff-UBP2BZLK-JPODPKS3.js +0 -5448
  438. package/dist/safe-bash/command-chunks/chunk-6EZWG56T.js +0 -455
  439. package/dist/safe-bash/command-chunks/chunk-O2HNOQQG.js +0 -161
  440. package/dist/safe-bash/command-chunks/chunk-ZUP5TBRG.js +0 -99
  441. package/dist/safe-bash/command-chunks/model-store-I7YAWL5V.js +0 -54
  442. package/dist/safe-bash/command-chunks/odf-3EA3EVSD-7B5GVNTC.js +0 -3097
  443. package/dist/safe-bash/command-chunks/{chunk-SRXARACJ.js → chunk-3TP4SSPS.js} +3 -3
  444. package/dist/safe-bash/command-chunks/{chunk-NCNHJRIY.js → chunk-3W3HLPCX.js} +3 -3
  445. package/dist/safe-bash/command-chunks/{chunk-P4OWVKMD.js → chunk-BQXKO3X7.js} +3 -3
  446. package/dist/safe-bash/command-chunks/{chunk-OCOJMKDP.js → chunk-CVMHDJ7J.js} +3 -3
  447. package/dist/safe-bash/command-chunks/{chunk-AV6N7DDA.js → chunk-DDYPQAXN.js} +3 -3
  448. package/dist/safe-bash/command-chunks/{chunk-FEKECRJP.js → chunk-EBTKM7KX.js} +3 -3
  449. package/dist/safe-bash/command-chunks/{chunk-WVD5WZXD.js → chunk-FPNUGKCX.js} +3 -3
  450. package/dist/safe-bash/command-chunks/{chunk-6W4RMBFH.js → chunk-N6VNHC3B.js} +3 -3
  451. package/dist/safe-bash/command-chunks/{chunk-M3OXQXCU.js → chunk-NBRXQUK7.js} +3 -3
  452. package/dist/safe-bash/command-chunks/{chunk-LECGQSQW.js → chunk-SF56V6QK.js} +3 -3
  453. package/dist/safe-bash/command-chunks/{chunk-2ANW3FXH.js → chunk-U33GIOUY.js} +3 -3
  454. package/dist/safe-bash/command-chunks/{chunk-5QXRIZSS.js → chunk-V3NKL42J.js} +3 -3
  455. package/dist/safe-bash/command-chunks/{chunk-OEKLEUUW.js → chunk-YZE7BKHC.js} +3 -3
  456. package/dist/safe-bash/command-chunks/{chunk-WXW665TV.js → chunk-ZSHXZ3XG.js} +6 -6
  457. package/dist/safe-bash/command-chunks/{dif-BXKPQOCO-4KB3RC6G.js → dif-BXKPQOCO-FVJYYGYB.js} +4 -4
  458. package/dist/safe-bash/command-chunks/{pln-DFS7VLVS-OVOBS4QX.js → pln-DFS7VLVS-JATX6FS7.js} +3 -3
  459. package/dist/safe-bash/command-chunks/{psion-YBI6JEQI-GY4S6ZLC.js → psion-YBI6JEQI-6OMC2PGC.js} +3 -3
  460. package/dist/safe-bash/command-chunks/{sylk-25D7TL2Y-RU6ANKGT.js → sylk-25D7TL2Y-NJKBZZTF.js} +4 -4
  461. /package/dist/spreadsheet-engine/{rendering/print → formatting}/general-number.d.ts +0 -0
@@ -1,455 +0,0 @@
1
- import {
2
- writePackageArchive
3
- } from "./chunk-TG2RVQLP.js";
4
- import {
5
- SelectionError
6
- } from "./chunk-NCNHJRIY.js";
7
- import {
8
- readPackage
9
- } from "./chunk-Q65GWGQR.js";
10
- import {
11
- readBinary
12
- } from "./chunk-FAU2KL6I.js";
13
- import {
14
- validatePresentation
15
- } from "./chunk-6W4RMBFH.js";
16
- import {
17
- parseXmlPart
18
- } from "./chunk-7PYDVQPB.js";
19
- import {
20
- parseContentTypes
21
- } from "./chunk-XFIDOCYH.js";
22
- import {
23
- readRelationshipGraph
24
- } from "./chunk-4YFTJS5U.js";
25
- import {
26
- OfficeError
27
- } from "./chunk-KM2SMMXZ.js";
28
-
29
- // packages/safe-bash-presentation-engine/src/memberships.ts
30
- var sectionNamespace = "http://schemas.microsoft.com/office/powerpoint/2010/main";
31
- var sectionExtension = "{521415D9-36F7-43E2-AB2F-B90AF26B5E84}";
32
- var dialects = [
33
- {
34
- p: "http://schemas.openxmlformats.org/presentationml/2006/main",
35
- r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
36
- },
37
- {
38
- p: "http://purl.oclc.org/ooxml/presentationml/main",
39
- r: "http://purl.oclc.org/ooxml/officeDocument/relationships"
40
- }
41
- ];
42
- function fail(code, message) {
43
- throw new OfficeError(code, message, code === "invalid-value" ? "usage" : "validate-intent");
44
- }
45
- function attr(node, name, namespace = "") {
46
- return node.attributes.find((a) => a.name.namespace === namespace && a.name.localName === name)?.value;
47
- }
48
- function children(node, name, namespace) {
49
- return node.children.filter(
50
- (child) => child.name.namespace === namespace && child.name.localName === name
51
- );
52
- }
53
- function only(node, name, namespace) {
54
- const found = children(node, name, namespace);
55
- if (found.length > 1) fail("unsupported-edit", "Ambiguous membership structure.");
56
- return found[0];
57
- }
58
- function locate(xml, kind) {
59
- const p = xml.root.name.namespace;
60
- if (kind === "shows") return only(xml.root, "custShowLst", p);
61
- const extensions = only(xml.root, "extLst", p);
62
- const matching = extensions?.children.filter((node) => attr(node, "uri")?.toUpperCase() === sectionExtension) ?? [];
63
- if (matching.length > 1) fail("unsupported-edit", "Multiple section extensions.");
64
- const extension = matching[0];
65
- if (extensions?.children.some(
66
- (node) => node !== extension && node.children.some((child) => child.name.localName === "sectionLst")
67
- ))
68
- fail("unsupported-edit", "Unsupported section extension identity.");
69
- if (!extension) return void 0;
70
- if (extension.name.namespace !== p || extension.name.localName !== "ext" || extension.children.length !== 1)
71
- fail("unsupported-edit", "Unsupported section extension structure.");
72
- const list = only(extension, "sectionLst", sectionNamespace);
73
- if (!list) fail("unsupported-edit", "Unsupported section extension namespace.");
74
- return list;
75
- }
76
- function inspect(xml, kind) {
77
- const d = dialects.find((value) => value.p === xml.root.name.namespace);
78
- if (!d) fail("unsupported-edit", "Unsupported presentation namespace.");
79
- const slideList = only(xml.root, "sldIdLst", d.p);
80
- const slides = slideList ? children(slideList, "sldId", d.p) : [];
81
- const ids = slides.map((node) => attr(node, "id"));
82
- const rels = slides.map((node) => attr(node, "id", d.r));
83
- const list = locate(xml, kind);
84
- const ns = kind === "sections" ? sectionNamespace : d.p;
85
- const itemName = kind === "sections" ? "section" : "custShow";
86
- if (list?.children.some((node) => node.name.namespace !== ns || node.name.localName !== itemName))
87
- fail("unsupported-edit", "Unsupported membership list content.");
88
- const seen = /* @__PURE__ */ new Set();
89
- const sectionSlides = /* @__PURE__ */ new Set();
90
- const records = (list?.children ?? []).map((node, i) => {
91
- const id = attr(node, "id"), name = attr(node, "name");
92
- if (id === void 0 || !id || name === void 0)
93
- fail("invalid-opc", "Membership identities and names must be present.");
94
- let identity = id.toUpperCase();
95
- if (kind === "shows") {
96
- if (![...id].every((character) => character >= "0" && character <= "9") || !Number.isSafeInteger(Number(id)) || Number(id) > 4294967295)
97
- fail("invalid-opc", "Invalid custom show identity.");
98
- identity = String(Number(id));
99
- } else {
100
- const segments = id.slice(1, -1).split("-");
101
- if (!id.startsWith("{") || !id.endsWith("}") || segments.length !== 5 || segments.some(
102
- (segment, i2) => segment.length !== [8, 4, 4, 4, 12][i2] || [...segment].some((character) => !"0123456789ABCDEF".includes(character.toUpperCase()))
103
- ))
104
- fail("invalid-opc", "Invalid section identity.");
105
- }
106
- if (seen.has(identity)) fail("invalid-opc", "Membership identities must be unique.");
107
- seen.add(identity);
108
- if (kind === "sections" && (node.attributes.some(
109
- (a) => a.name.namespace !== "http://www.w3.org/2000/xmlns/" && (a.name.namespace !== "" || !["id", "name"].includes(a.name.localName))
110
- ) || node.children.some(
111
- (child) => child.name.namespace !== sectionNamespace || child.name.localName !== "sldIdLst"
112
- )))
113
- fail("unsupported-edit", "Unsupported section extension content.");
114
- const members = only(node, kind === "sections" ? "sldIdLst" : "sldLst", ns);
115
- if (!members) fail("unsupported-edit", "Missing membership slide list.");
116
- if (kind === "sections" && members.attributes.some((a) => a.name.namespace !== "http://www.w3.org/2000/xmlns/"))
117
- fail("unsupported-edit", "Unsupported section list attributes.");
118
- const positions = members.children.map((member) => {
119
- if (member.name.namespace !== ns || member.name.localName !== (kind === "sections" ? "sldId" : "sld"))
120
- fail("unsupported-edit", "Unsupported membership slide entry.");
121
- if (kind === "sections" && (member.children.length || member.attributes.some(
122
- (a) => a.name.namespace !== "http://www.w3.org/2000/xmlns/" && (a.name.namespace !== "" || a.name.localName !== "id")
123
- )))
124
- fail("unsupported-edit", "Unsupported section member extension.");
125
- const position = kind === "sections" ? ids.indexOf(attr(member, "id") ?? "") : rels.indexOf(attr(member, "id", d.r) ?? "");
126
- if (position < 0) fail("invalid-opc", "Membership references an absent slide.");
127
- return position + 1;
128
- });
129
- if (kind === "sections")
130
- for (const [j, position] of positions.entries()) {
131
- if (sectionSlides.has(position) || j > 0 && position !== positions[j - 1] + 1)
132
- fail("unsupported-edit", "Existing sections must be contiguous and nonoverlapping.");
133
- sectionSlides.add(position);
134
- }
135
- return { id, name, position: i + 1, slides: positions };
136
- });
137
- return { d, ids, rels, list, ns, records };
138
- }
139
- async function load(input, context) {
140
- if (!context?.xmlLimits || !context.relationshipLimits)
141
- fail("invalid-value", "Explicit XML and relationship limits are required.");
142
- const source = await readBinary(input, context);
143
- const reader = await readPackage(source, context);
144
- const graph = readRelationshipGraph(reader, context.relationshipLimits);
145
- const main = graph.outgoing("/").find((edge) => dialects.some((d) => edge.type === `${d.r}/officeDocument`))?.targetPart;
146
- if (!main) fail("invalid-opc", "Presentation relationship is missing.");
147
- return { source, reader, graph, main, xml: parseXmlPart(reader.get(main), context.xmlLimits) };
148
- }
149
- async function readMemberships(input, kind, context) {
150
- if (!["sections", "shows"].includes(kind)) fail("invalid-value", "Unknown membership resource.");
151
- return inspect((await load(input, context)).xml, kind).records;
152
- }
153
- function fields(value, allowed) {
154
- if (!value || typeof value !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(value)) || Object.keys(value).some((key) => !allowed.includes(key)))
155
- fail("invalid-value", "Invalid membership options.");
156
- }
157
- async function mutateMemberships(input, kind, options, context) {
158
- fields(options, ["action", "selection", "name", "slides", "position", "allowEmpty"]);
159
- if (!["sections", "shows"].includes(kind) || !["add", "set", "remove"].includes(options.action))
160
- fail("invalid-value", "Unknown membership operation.");
161
- if (options.name !== void 0 && typeof options.name !== "string")
162
- fail("invalid-value", "Membership name must be text.");
163
- if (options.allowEmpty !== void 0 && typeof options.allowEmpty !== "boolean")
164
- fail("invalid-value", "allowEmpty must be boolean.");
165
- if (options.position !== void 0 && (!Number.isSafeInteger(options.position) || options.position < 1))
166
- fail("invalid-value", "Invalid membership position.");
167
- if (options.action === "add" && (options.name === void 0 || options.slides === void 0 || options.selection !== void 0))
168
- fail("invalid-value", "Creation requires a name and slide membership.");
169
- if (options.action === "set" && options.name === void 0 && options.slides === void 0 && options.position === void 0)
170
- fail("invalid-value", "At least one membership update is required.");
171
- if (options.action === "remove" && [options.name, options.slides, options.position].some((value) => value !== void 0))
172
- fail("invalid-value", "Removal cannot include updates.");
173
- if (options.selection !== void 0) {
174
- fields(options.selection, ["id", "ids", "name", "position", "all"]);
175
- const q2 = options.selection;
176
- if (q2.ids !== void 0 && (!Array.isArray(q2.ids) || new Set(q2.ids).size !== q2.ids.length || q2.ids.some((id) => typeof id !== "string" || !id)) || q2.id !== void 0 && (typeof q2.id !== "string" || !q2.id) || q2.name !== void 0 && (typeof q2.name !== "string" || !q2.name) || q2.position !== void 0 && (!Number.isSafeInteger(q2.position) || q2.position < 1) || q2.all !== void 0 && typeof q2.all !== "boolean" || !q2.all && q2.ids === void 0 && q2.id === void 0 && q2.name === void 0 && q2.position === void 0)
177
- throw new SelectionError("invalid-selection");
178
- } else if (options.action !== "add") throw new SelectionError("invalid-selection");
179
- const loaded = await load(input, context);
180
- let xml = loaded.xml;
181
- const { source, reader, graph, main } = loaded;
182
- const limits = {
183
- ...context.xmlLimits,
184
- ...context.relationshipLimits,
185
- maxBytes: Math.min(context.xmlLimits.maxBytes, context.relationshipLimits.maxBytes),
186
- maxEntries: context.archiveLimits.maxMembers
187
- };
188
- const types = parseContentTypes(reader.get("/[Content_Types].xml"), limits);
189
- for (const name of reader.names) {
190
- if (name === "/[Content_Types].xml") continue;
191
- const type = types.get(name).toLowerCase();
192
- if (type.includes("digital-signature") || type.includes("macroenabled") || type.includes("vbaproject") || name.toLowerCase().startsWith("/_xmlsignatures/"))
193
- fail("unsupported-edit", "Signed and macro-enabled presentations cannot be changed.");
194
- }
195
- for (const owner of ["/", ...graph.parts])
196
- if (graph.outgoing(owner).some(
197
- (edge) => edge.type.includes("/digital-signature/") || edge.type.endsWith("/vbaProject")
198
- ))
199
- fail("unsupported-edit", "Signed and macro-enabled presentations cannot be changed.");
200
- if (!validatePresentation(reader, limits).valid)
201
- fail("invalid-opc", "Membership editing requires a valid presentation graph.");
202
- const pending = [xml.root];
203
- while (pending.length) {
204
- const node = pending.pop();
205
- if (node.name.localName === "modifyVerifier" || node.name.namespace === "http://schemas.openxmlformats.org/markup-compatibility/2006")
206
- fail(
207
- "unsupported-edit",
208
- "Protected or conditional presentation structures cannot be changed."
209
- );
210
- pending.push(...node.children);
211
- }
212
- if (options.name !== void 0)
213
- xml.merge(xml.root, {
214
- attributes: [{ namespace: "", localName: "name", value: options.name }]
215
- });
216
- const state = inspect(xml, kind);
217
- const q = options.selection;
218
- const selected = options.action === "add" ? [] : state.records.filter(
219
- (record) => (!q?.id || record.id === q.id) && (q?.ids === void 0 || q.ids.includes(record.id)) && (q?.name === void 0 || record.name === q.name) && (q?.position === void 0 || record.position === q.position)
220
- );
221
- if (selected.length > 1 && !q?.all) throw new SelectionError("ambiguous-selection");
222
- if (options.slides !== void 0) {
223
- if (!Array.isArray(options.slides) || !options.slides.length || new Set(options.slides).size !== options.slides.length || options.slides.some(
224
- (position) => !Number.isSafeInteger(position) || position < 1 || position > state.ids.length
225
- ))
226
- fail("invalid-value", "Membership requires unique existing slide positions.");
227
- if (kind === "sections" && options.slides.some((position, i) => i > 0 && position !== options.slides[i - 1] + 1))
228
- fail("invalid-value", "Section members must be ordered and contiguous.");
229
- }
230
- if (kind === "sections") {
231
- const used = /* @__PURE__ */ new Set();
232
- const records = state.records.filter(
233
- (record) => options.action !== "remove" || !selected.includes(record)
234
- );
235
- const memberships = records.map(
236
- (record) => selected.includes(record) && options.slides !== void 0 ? options.slides : record.slides
237
- );
238
- if (options.action === "add") memberships.push(options.slides);
239
- for (const members of memberships)
240
- for (const [i, slide] of members.entries()) {
241
- if (used.has(slide) || i > 0 && slide !== members[i - 1] + 1)
242
- fail("invalid-value", "Section members must be contiguous and nonoverlapping.");
243
- used.add(slide);
244
- }
245
- for (const node of state.list?.children ?? []) {
246
- if (node.children.some(
247
- (child) => child.name.namespace !== sectionNamespace || child.name.localName !== "sldIdLst"
248
- ))
249
- fail("unsupported-edit", "Unsupported section extension content.");
250
- }
251
- }
252
- const finalCount = state.records.length + (options.action === "add" ? 1 : 0);
253
- if (options.position !== void 0 && options.position > finalCount - selected.length + (options.action === "add" ? 0 : 1))
254
- fail("invalid-value", "Membership position is outside the list.");
255
- if (options.action !== "add" && !selected.length) {
256
- if (options.allowEmpty) return source;
257
- throw new SelectionError("missing-selection");
258
- }
259
- if (kind === "shows" && options.action === "remove") {
260
- const removedIds = new Set(selected.map((record) => Number(record.id)));
261
- const dangling = () => {
262
- throw new OfficeError(
263
- "dangling-reference",
264
- "Custom show removal would leave an active or unsupported show reference.",
265
- "validate-intent"
266
- );
267
- };
268
- const checkId = (id) => {
269
- if (id === void 0 || !id || [...id].some((character) => character < "0" || character > "9") || !Number.isSafeInteger(Number(id)) || Number(id) > 4294967295 || removedIds.has(Number(id)))
270
- dangling();
271
- };
272
- for (const name of reader.names) {
273
- context.signal?.throwIfAborted();
274
- if (name === "/[Content_Types].xml") continue;
275
- const type = types.get(name).toLowerCase();
276
- if (!type.endsWith("+xml") && !type.endsWith("/xml")) continue;
277
- const doc = name === main ? xml : parseXmlPart(reader.get(name), context.xmlLimits);
278
- const nodes = [{ node: doc.root }];
279
- while (nodes.length) {
280
- const { node, parent } = nodes.pop();
281
- if (node.name.namespace === state.d.p && node.name.localName === "custShow" && parent?.name.localName !== "custShowLst")
282
- checkId(attr(node, "id"));
283
- for (const attribute of node.attributes) {
284
- if (attribute.name.localName !== "action" || !attribute.value.toLowerCase().startsWith("ppaction://customshow"))
285
- continue;
286
- let action;
287
- try {
288
- action = new URL(attribute.value);
289
- } catch {
290
- dangling();
291
- }
292
- if (action.hostname !== "customshow" || action.pathname || action.hash || action.username || action.password || action.port)
293
- dangling();
294
- const ids = action.searchParams.getAll("id");
295
- if (ids.length !== 1) dangling();
296
- action.searchParams.forEach((_value, key) => {
297
- if (!["id", "return"].includes(key)) dangling();
298
- });
299
- checkId(ids[0]);
300
- }
301
- nodes.push(...node.children.map((child) => ({ node: child, parent: node })));
302
- }
303
- }
304
- }
305
- if (options.action === "add") {
306
- if (!locate(xml, kind)) {
307
- if (kind === "shows") {
308
- const preceding = [
309
- "sldMasterIdLst",
310
- "notesMasterIdLst",
311
- "handoutMasterIdLst",
312
- "sldIdLst",
313
- "sldSz",
314
- "notesSz",
315
- "smartTags",
316
- "embeddedFontLst"
317
- ];
318
- const following = xml.root.children.findIndex(
319
- (node) => !preceding.includes(node.name.localName)
320
- );
321
- xml = xml.spliceChildren(
322
- xml.root,
323
- following < 0 ? xml.root.children.length : following,
324
- 0,
325
- [`<p:custShowLst xmlns:p="${state.d.p}"/>`]
326
- );
327
- } else {
328
- let ext = only(xml.root, "extLst", state.d.p);
329
- if (!ext) {
330
- xml = xml.spliceChildren(xml.root, xml.root.children.length, 0, [
331
- `<p:extLst xmlns:p="${state.d.p}"/>`
332
- ]);
333
- ext = only(xml.root, "extLst", state.d.p);
334
- }
335
- xml = xml.spliceChildren(ext, ext.children.length, 0, [
336
- `<p:ext xmlns:p="${state.d.p}" uri="${sectionExtension}"><s:sectionLst xmlns:s="${sectionNamespace}"/></p:ext>`
337
- ]);
338
- }
339
- }
340
- let number = kind === "shows" ? 0 : 1;
341
- const idFor = (n) => kind === "shows" ? String(n) : `{00000000-0000-0000-0000-${n.toString(16).toUpperCase().padStart(12, "0")}}`;
342
- const used = new Set(
343
- state.records.map(
344
- (record2) => kind === "shows" ? String(Number(record2.id)) : record2.id.toUpperCase()
345
- )
346
- );
347
- while (used.has(idFor(number))) number++;
348
- if (number > 4294967295)
349
- throw new OfficeError(
350
- "resource-limit",
351
- "Membership identities exhausted.",
352
- "validate-intent"
353
- );
354
- const list = locate(xml, kind);
355
- const element = kind === "shows" ? `<p:custShow xmlns:p="${state.d.p}" name="" id="${idFor(number)}"><p:sldLst/></p:custShow>` : `<s:section xmlns:s="${sectionNamespace}" name="" id="${idFor(number)}"><s:sldIdLst/></s:section>`;
356
- xml = xml.spliceChildren(
357
- list,
358
- options.position === void 0 ? list.children.length : options.position - 1,
359
- 0,
360
- [element]
361
- );
362
- const record = { id: idFor(number), name: "", position: 0, slides: [] };
363
- selected.push(record);
364
- }
365
- for (const record of selected) {
366
- let list = locate(xml, kind);
367
- const index = list.children.findIndex((node2) => attr(node2, "id") === record.id);
368
- if (options.action === "remove") {
369
- xml = xml.spliceChildren(list, index, 1, []);
370
- continue;
371
- }
372
- let node = list.children[index];
373
- if (options.name !== void 0) {
374
- xml = xml.merge(node, {
375
- attributes: [{ namespace: "", localName: "name", value: options.name }]
376
- });
377
- list = locate(xml, kind);
378
- node = list.children[index];
379
- }
380
- if (options.slides !== void 0) {
381
- const members = only(node, kind === "shows" ? "sldLst" : "sldIdLst", state.ns);
382
- if (members.attributes.some((a) => a.name.namespace !== "http://www.w3.org/2000/xmlns/") || members.children.some(
383
- (child) => child.children.length || child.attributes.some(
384
- (a) => a.name.namespace !== "http://www.w3.org/2000/xmlns/" && !(a.name.localName === "id" && a.name.namespace === (kind === "shows" ? state.d.r : ""))
385
- )
386
- ))
387
- fail("unsupported-edit", "Unsupported membership entry extension.");
388
- xml = xml.spliceChildren(
389
- members,
390
- 0,
391
- members.children.length,
392
- options.slides.map((position) => {
393
- const member = parseXmlPart(
394
- new TextEncoder().encode(
395
- kind === "shows" ? `<p:sld xmlns:p="${state.d.p}" xmlns:r="${state.d.r}" r:id=""/>` : `<s:sldId xmlns:s="${sectionNamespace}" id=""/>`
396
- ),
397
- context.xmlLimits
398
- );
399
- const edited = member.merge(member.root, {
400
- attributes: [
401
- {
402
- namespace: kind === "shows" ? state.d.r : "",
403
- localName: "id",
404
- value: (kind === "shows" ? state.rels : state.ids)[position - 1]
405
- }
406
- ]
407
- });
408
- return edited.markup(edited.root);
409
- })
410
- );
411
- }
412
- }
413
- if (options.action === "set" && options.position !== void 0) {
414
- const list = locate(xml, kind);
415
- const ids = new Set(selected.map((record) => record.id));
416
- const moving = list.children.filter((node) => ids.has(attr(node, "id")));
417
- const ordered = list.children.filter((node) => !ids.has(attr(node, "id")));
418
- ordered.splice(options.position - 1, 0, ...moving);
419
- xml = xml.reorderChildren(list, ordered);
420
- }
421
- const remaining = locate(xml, kind);
422
- if (remaining && !remaining.children.length) {
423
- if (kind === "shows")
424
- xml = xml.spliceChildren(xml.root, xml.root.children.indexOf(remaining), 1, []);
425
- else {
426
- const ext = only(xml.root, "extLst", state.d.p);
427
- const index = ext.children.findIndex((node) => node.children.includes(remaining));
428
- xml = xml.spliceChildren(ext, index, 1, []);
429
- const remainingExtensions = only(xml.root, "extLst", state.d.p);
430
- if (!remainingExtensions.children.length && remainingExtensions.attributes.every(
431
- (a) => a.name.namespace === "http://www.w3.org/2000/xmlns/"
432
- ))
433
- xml = xml.spliceChildren(xml.root, xml.root.children.indexOf(remainingExtensions), 1, []);
434
- }
435
- }
436
- const original = reader.get(main), changed = xml.bytes();
437
- if (original.length === changed.length && original.every((value, index) => value === changed[index]))
438
- return source;
439
- const output = await writePackageArchive(
440
- reader.names.map((name) => ({
441
- name: name.slice(1),
442
- bytes: name === main ? xml.bytes() : reader.get(name)
443
- })),
444
- context,
445
- { compression: "auto", source }
446
- );
447
- if (!validatePresentation(await readPackage(output, context), limits).valid)
448
- fail("invalid-opc", "Changed memberships fail graph validation.");
449
- return output;
450
- }
451
-
452
- export {
453
- readMemberships,
454
- mutateMemberships
455
- };
@@ -1,161 +0,0 @@
1
- import {
2
- attr,
3
- child,
4
- escape,
5
- invalid,
6
- loadShared,
7
- nextRel,
8
- relPart
9
- } from "./chunk-A5SPMSKD.js";
10
- import {
11
- SelectionError,
12
- decodeSelectionToken
13
- } from "./chunk-NCNHJRIY.js";
14
- import {
15
- parseXmlPart
16
- } from "./chunk-7PYDVQPB.js";
17
- import {
18
- relativePartReference
19
- } from "./chunk-MOUCMZZP.js";
20
- import {
21
- OfficeError
22
- } from "./chunk-KM2SMMXZ.js";
23
-
24
- // packages/safe-bash-presentation-engine/src/tags.ts
25
- var relns = "http://schemas.openxmlformats.org/package/2006/relationships";
26
- function validate(options, action) {
27
- if (!options || ![Object.prototype, null].includes(Object.getPrototypeOf(options)) || Object.keys(options).some((key) => !["scope", "selection", "name", "value", "allowEmpty"].includes(key)) || options.scope !== void 0 && !["presentation", "slides"].includes(options.scope) || options.allowEmpty !== void 0 && typeof options.allowEmpty !== "boolean") invalid("Invalid tag options.");
28
- if (options.scope === "presentation" && options.selection && Object.keys(options.selection).some((key) => key !== "all" && key !== "token")) invalid("Presentation tags do not accept slide selectors.");
29
- if (action === "add" && (options.name === void 0 || options.value === void 0)) invalid("New tags require name and value.");
30
- if (action === "set" && options.name === void 0 && options.value === void 0) invalid("A tag edit requires name or value.");
31
- for (const value of [options.name, options.value]) {
32
- if (value === void 0) continue;
33
- if (typeof value !== "string") invalid("Tag fields require strings.");
34
- for (const c of value) {
35
- const n = c.codePointAt(0);
36
- if (n < 32 && ![9, 10, 13].includes(n) || n >= 55296 && n <= 57343 || n === 65534 || n === 65535) invalid("Tag fields require XML characters.");
37
- }
38
- }
39
- if (options.name === "") invalid("Tag names cannot be empty.");
40
- if (!action && (options.name !== void 0 || options.value !== void 0 || options.allowEmpty !== void 0)) invalid("Tag reads accept selection and scope only.");
41
- if (action === "remove" && (options.name !== void 0 || options.value !== void 0)) invalid("Tag removal does not accept edit fields.");
42
- }
43
- function owners(s, options) {
44
- if (options.scope === "presentation") return [{ part: s.main, slide: null }];
45
- const selection = options.selection;
46
- return (selection ? s.index.select({ kind: "slide", ...selection }) : s.index.slides).map((record) => {
47
- if (record.kind !== "slide") throw new SelectionError("invalid-selection");
48
- return { part: record.part, slide: record.position };
49
- });
50
- }
51
- function association(s, owner) {
52
- const doc = s.doc(owner);
53
- const base = owner === s.main ? doc.root : child(doc.root, "cSld");
54
- if (!base) invalid("Tag owner lacks common slide data.");
55
- const list = child(base, "custDataLst");
56
- const tags = list ? child(list, "tags") : void 0;
57
- if (!tags) return void 0;
58
- const id = tags.attributes.find((a) => a.name.namespace === s.r && a.name.localName === "id")?.value;
59
- const edges = s.index.inventory.relationships.filter((e) => e.owner === owner && e.id === id && e.type === `${s.r}/tags` && !e.external);
60
- if (edges.length !== 1 || !edges[0].targetPart) invalid("Invalid tag association.");
61
- return edges[0].targetPart;
62
- }
63
- function records(s, options) {
64
- let token;
65
- if (options.selection?.token) {
66
- if (Object.keys(options.selection).some((key) => key !== "token")) throw new SelectionError("invalid-selection");
67
- token = decodeSelectionToken(options.selection.token);
68
- if (token.fingerprint !== s.index.fingerprint) throw new SelectionError("stale-selection");
69
- if (token.scope !== "slides" && token.scope !== "presentation") throw new SelectionError("invalid-selection");
70
- if (options.scope !== void 0 && options.scope !== token.scope) throw new SelectionError("invalid-selection");
71
- }
72
- const selected = owners(s, token ? { scope: token.scope } : options);
73
- const result = selected.flatMap((owner) => {
74
- const part = association(s, owner.part);
75
- if (!part) return [];
76
- const doc = s.doc(part);
77
- if (doc.root.name.namespace !== s.p || doc.root.name.localName !== "tagLst") invalid("Invalid tag list.");
78
- return doc.root.children.flatMap((node, index) => {
79
- if (node.name.namespace !== s.p || node.name.localName !== "tag") return [];
80
- const name = attr(node, "name"), value = attr(node, "val");
81
- if (name === void 0 || value === void 0) invalid("Tag requires name and value attributes.");
82
- const location = { fingerprint: s.index.fingerprint, scope: owner.slide === null ? "presentation" : "slides", owner: owner.part, objectId: `tag:${part}:${index}`, coordinateSystem: "identity" };
83
- return [{ name, value, part, owner: owner.part, slide: owner.slide, selector: JSON.stringify(location), location }];
84
- });
85
- });
86
- return token ? result.filter((r) => r.selector === options.selection.token) : result;
87
- }
88
- async function readTags(input, options, context) {
89
- validate(options);
90
- return records(await loadShared(input, context, false), options);
91
- }
92
- function createAssociation(s, owner, context) {
93
- let n = 1;
94
- while (s.reader.has(`/ppt/tags/tag${n}.xml`) || s.changes.has(`/ppt/tags/tag${n}.xml`)) n++;
95
- const part = `/ppt/tags/tag${n}.xml`;
96
- s.save(part, parseXmlPart(new TextEncoder().encode(`<p:tagLst xmlns:p="${s.p}"/>`), context.xmlLimits));
97
- const types = s.doc("/[Content_Types].xml");
98
- s.save("/[Content_Types].xml", types.spliceChildren(types.root, types.root.children.length, 0, [`<Override xmlns="${types.root.name.namespace}" PartName="${part}" ContentType="application/vnd.openxmlformats-officedocument.presentationml.tags+xml"/>`]));
99
- const relName = relPart(owner);
100
- const rels = s.reader.has(relName) ? s.doc(relName) : parseXmlPart(new TextEncoder().encode(`<Relationships xmlns="${relns}"/>`), context.xmlLimits);
101
- const id = nextRel(rels);
102
- s.save(relName, rels.spliceChildren(rels.root, rels.root.children.length, 0, [`<Relationship xmlns="${relns}" Id="${id}" Type="${s.r}/tags" Target="${escape(relativePartReference(part, owner.slice(0, owner.lastIndexOf("/"))))}"/>`]));
103
- let doc = s.doc(owner);
104
- let base = owner === s.main ? doc.root : child(doc.root, "cSld");
105
- let list = child(base, "custDataLst");
106
- if (!list) {
107
- const order = owner === s.main ? ["sldMasterIdLst", "notesMasterIdLst", "handoutMasterIdLst", "sldIdLst", "sldSz", "notesSz", "smartTags", "embeddedFontLst", "custShowLst", "photoAlbum", "custDataLst", "kinsoku", "defaultTextStyle", "modifyVerifier", "extLst"] : ["bg", "spTree", "custDataLst", "controls", "extLst"];
108
- doc = doc.merge(base, { children: { sequence: order.map((localName) => ({ namespace: s.p, localName })), upsert: [{ name: { namespace: s.p, localName: "custDataLst" }, merge: {} }] } });
109
- base = owner === s.main ? doc.root : child(doc.root, "cSld");
110
- list = child(base, "custDataLst");
111
- }
112
- s.save(owner, doc.spliceChildren(list, list.children.length, 0, [`<p:tags xmlns:p="${s.p}" xmlns:r="${s.r}" r:id="${id}"/>`]));
113
- return part;
114
- }
115
- async function mutateTags(input, action, options, context) {
116
- if (!["add", "set", "remove"].includes(action)) invalid("Invalid tag action.");
117
- validate(options, action);
118
- if ((options.name?.length ?? 0) + (options.value?.length ?? 0) > context.xmlLimits.maxBytes) throw new OfficeError("resource-limit", "Tag exceeds XML limits.", "usage");
119
- if (!options.selection && options.scope !== "presentation") throw new SelectionError("missing-selection");
120
- const s = await loadShared(input, context);
121
- const existing = records(s, options);
122
- const locations = [];
123
- if (action === "add") {
124
- if (options.selection?.token) throw new SelectionError("invalid-selection");
125
- const selected = owners(s, options);
126
- if (!selected.length && !options.allowEmpty) throw new SelectionError("missing-selection");
127
- for (const owner of selected) {
128
- if (existing.some((r) => r.owner === owner.part && r.name === options.name)) invalid("Duplicate tag name.");
129
- const part = association(s, owner.part) ?? createAssociation(s, owner.part, context);
130
- if (s.index.inventory.relationships.filter((e) => e.targetPart === part).length > 1) throw new OfficeError("unsupported-edit", "Shared tag lists cannot be edited.", "validate-intent");
131
- const doc = s.doc(part);
132
- const location = { fingerprint: s.index.fingerprint, scope: owner.slide === null ? "presentation" : "slides", owner: owner.part, objectId: `tag:${part}:${doc.root.children.length}`, coordinateSystem: "identity" };
133
- s.save(part, doc.spliceChildren(doc.root, doc.root.children.length, 0, [`<p:tag xmlns:p="${s.p}" name="${escape(options.name)}" val="${escape(options.value)}"/>`]));
134
- locations.push(location);
135
- }
136
- } else {
137
- if (!existing.length && !options.allowEmpty) throw new SelectionError("missing-selection");
138
- if (existing.length > 1 && !options.selection?.all) throw new SelectionError("ambiguous-selection");
139
- if (options.name !== void 0) {
140
- const all = records(s, { scope: existing[0]?.location.scope });
141
- for (const record of existing) if (all.some((r) => r.owner === record.owner && r.name === options.name && r.selector !== record.selector)) invalid("Duplicate tag name.");
142
- if (existing.some((r, i) => existing.slice(0, i).some((v) => v.owner === r.owner))) invalid("Duplicate tag name.");
143
- }
144
- for (const record of [...existing].reverse()) {
145
- if (s.index.inventory.relationships.filter((e) => e.targetPart === record.part).length > 1) throw new OfficeError("unsupported-edit", "Shared tag lists cannot be edited.", "validate-intent");
146
- const doc = s.doc(record.part);
147
- const index = Number(record.location.objectId.slice(record.location.objectId.lastIndexOf(":") + 1));
148
- const node = doc.root.children[index];
149
- if (action === "remove" && (node.children.length || node.attributes.some((a) => a.name.namespace !== "" || !["name", "val"].includes(a.name.localName)))) throw new OfficeError("unsupported-edit", "Decorated tags are preserved on removal.", "validate-intent");
150
- s.save(record.part, action === "remove" ? doc.spliceChildren(doc.root, index, 1, []) : doc.merge(doc.root.children[index], { attributes: [...options.name === void 0 ? [] : [{ namespace: "", localName: "name", value: options.name }], ...options.value === void 0 ? [] : [{ namespace: "", localName: "val", value: options.value }]] }));
151
- locations.push(record.location);
152
- }
153
- }
154
- const result = await s.finish(s.main, []);
155
- return { bytes: result.bytes, affected: locations.length, locations };
156
- }
157
-
158
- export {
159
- readTags,
160
- mutateTags
161
- };