@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
@@ -0,0 +1,771 @@
1
+ import {
2
+ openRetainedPresentationIndex,
3
+ stageRetainedOutput,
4
+ streamJson
5
+ } from "./chunk-3ZGO24WG.js";
6
+ import {
7
+ writePackageArchive
8
+ } from "./chunk-TG2RVQLP.js";
9
+ import {
10
+ SelectionError,
11
+ decodeSelectionToken
12
+ } from "./chunk-3W3HLPCX.js";
13
+ import {
14
+ readPackage
15
+ } from "./chunk-Q65GWGQR.js";
16
+ import {
17
+ readBinary
18
+ } from "./chunk-FAU2KL6I.js";
19
+ import {
20
+ validatePresentation
21
+ } from "./chunk-N6VNHC3B.js";
22
+ import {
23
+ dialects,
24
+ openRetainedRelationshipGraph
25
+ } from "./chunk-6KJDTKE4.js";
26
+ import {
27
+ parseXmlPart
28
+ } from "./chunk-7PYDVQPB.js";
29
+ import {
30
+ readRelationshipGraph
31
+ } from "./chunk-4YFTJS5U.js";
32
+ import {
33
+ parseContentTypes
34
+ } from "./chunk-XFIDOCYH.js";
35
+ import {
36
+ OfficeError,
37
+ RetainedValues,
38
+ characters,
39
+ equal,
40
+ literal,
41
+ openRetainedXmlDocument,
42
+ resolveOfficeResources
43
+ } from "./chunk-KM2SMMXZ.js";
44
+
45
+ // packages/safe-bash-presentation-engine/src/retained-memberships.ts
46
+ import { PagedStorage } from "@poe-platform/safe-fs/storage";
47
+ var sectionNamespace = "http://schemas.microsoft.com/office/powerpoint/2010/main";
48
+ var sectionExtension = "{521415D9-36F7-43E2-AB2F-B90AF26B5E84}";
49
+ function fail(code, message) {
50
+ throw new OfficeError(code, message, code === "invalid-value" ? "usage" : "validate-intent");
51
+ }
52
+ async function* upper(source) {
53
+ let buffer = "";
54
+ for await (const character of characters(source)) {
55
+ buffer += character.toUpperCase();
56
+ if (buffer.length >= 2048) {
57
+ yield* literal(buffer);
58
+ buffer = "";
59
+ }
60
+ }
61
+ if (buffer) yield* literal(buffer);
62
+ }
63
+ async function* children(document, node) {
64
+ for await (const child of document.children(node)) if (child.kind === "element") yield child;
65
+ }
66
+ async function is(document, node, name, namespace) {
67
+ return await equal(document.raw(node.localName), literal(name)) && await equal(document.namespace(node), literal(namespace));
68
+ }
69
+ async function attr(document, node, name, namespace = "") {
70
+ for await (const value of document.attributes(node)) if (await is(document, value, name, namespace)) return value;
71
+ return void 0;
72
+ }
73
+ async function only(document, node, name, namespace) {
74
+ let found;
75
+ for await (const child of children(document, node)) if (await is(document, child, name, namespace)) {
76
+ if (found) fail("unsupported-edit", "Ambiguous membership structure.");
77
+ found = child;
78
+ }
79
+ return found;
80
+ }
81
+ async function locate(document, kind, p) {
82
+ if (kind === "shows") return only(document, document.root, "custShowLst", p);
83
+ const extensions = await only(document, document.root, "extLst", p);
84
+ if (!extensions) return void 0;
85
+ let extension;
86
+ for await (const node of children(document, extensions)) {
87
+ const uri = await attr(document, node, "uri");
88
+ if (uri && await equal(upper(document.text(uri)), literal(sectionExtension))) {
89
+ if (extension) fail("unsupported-edit", "Multiple section extensions.");
90
+ extension = node;
91
+ }
92
+ }
93
+ for await (const node of children(document, extensions)) if (!extension || document.reference(node) !== document.reference(extension)) {
94
+ for await (const child of children(document, node)) if (await equal(document.raw(child.localName), literal("sectionLst"))) fail("unsupported-edit", "Unsupported section extension identity.");
95
+ }
96
+ if (!extension) return void 0;
97
+ let count = 0;
98
+ for await (const ignored of children(document, extension)) count++;
99
+ if (!await is(document, extension, "ext", p) || count !== 1) fail("unsupported-edit", "Unsupported section extension structure.");
100
+ const list = await only(document, extension, "sectionLst", sectionNamespace);
101
+ if (!list) fail("unsupported-edit", "Unsupported section extension namespace.");
102
+ return list;
103
+ }
104
+ async function openRetainedMemberships(archive, kind, settings) {
105
+ if (!["sections", "shows"].includes(kind)) fail("invalid-value", "Unknown membership resource.");
106
+ const context = { ...resolveOfficeResources(settings), workingStorage: { ...settings.workingStorage } }, working = context.workingStorage, signal = context.signal ?? new AbortController().signal;
107
+ const graph = await openRetainedRelationshipGraph(archive, context), pages = new PagedStorage({ fs: working.fs, cwd: working.directory, env: {}, signal }, (working.cacheBytes ?? 1024 * 1024) / 16384);
108
+ let document, closed = false, closing, first = 0, last = 0;
109
+ const close = () => {
110
+ closed = true;
111
+ return closing ??= (async () => {
112
+ const results = await Promise.allSettled([graph.close(), document?.close(), pages.close()]);
113
+ for (const result of results) if (result.status === "rejected") throw result.reason;
114
+ })();
115
+ };
116
+ const check = () => {
117
+ if (closed) throw new OfficeError("invalid-handle", "Memberships are closed.", "index");
118
+ if (signal.aborted) throw new OfficeError("cancelled", "Operation cancelled.", "index");
119
+ };
120
+ const values = new RetainedValues(pages, check, signal);
121
+ async function row(pointer, count = 7) {
122
+ check();
123
+ const bytes = await pages.read(pointer, count * 8), view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
124
+ return Array.from({ length: count }, (_, n) => view.getFloat64(n * 8, true));
125
+ }
126
+ async function write(pointer, data) {
127
+ check();
128
+ const bytes = new Uint8Array(data.length * 8), view = new DataView(bytes.buffer);
129
+ data.forEach((value, n) => view.setFloat64(n * 8, value, true));
130
+ await pages.write(pointer, bytes);
131
+ }
132
+ const range = (data, n) => ({ start: data[n], length: data[n + 1] });
133
+ async function* slides(pointer) {
134
+ check();
135
+ while (pointer) {
136
+ const data = await row(pointer, 2);
137
+ pointer = data[0];
138
+ yield data[1];
139
+ }
140
+ check();
141
+ }
142
+ try {
143
+ let main;
144
+ for await (const edge of graph.outgoing("/")) {
145
+ let match = false;
146
+ for (const dialect of dialects) if (await equal(edge.type(), literal(`${dialect.r}/officeDocument`))) match = true;
147
+ if (match) {
148
+ if (edge.targetPart) {
149
+ const decoder = new TextDecoder();
150
+ main = "";
151
+ for await (const bytes of edge.targetPart()) main += decoder.decode(bytes, { stream: true });
152
+ main += decoder.decode();
153
+ }
154
+ break;
155
+ }
156
+ }
157
+ if (!main) fail("invalid-opc", "Presentation relationship is missing.");
158
+ document = await openRetainedXmlDocument(archive.read(main), context);
159
+ const doc = document;
160
+ let d;
161
+ for (const dialect of dialects) if (await equal(doc.namespace(doc.root), literal(dialect.p))) d = dialect;
162
+ if (!d) fail("unsupported-edit", "Unsupported presentation namespace.");
163
+ const slideList = await only(doc, doc.root, "sldIdLst", d.p);
164
+ let slidePosition = 0;
165
+ if (slideList) {
166
+ for await (const slide of children(doc, slideList)) if (await is(doc, slide, "sldId", d.p)) {
167
+ slidePosition++;
168
+ for (const [scope, namespace2] of [["id", ""], ["rel", d.r]]) {
169
+ const id = await attr(doc, slide, "id", namespace2);
170
+ if (id) {
171
+ const key = await values.store(doc.text(id)), pointer = pages.allocate(8);
172
+ await write(pointer, [slidePosition]);
173
+ await values.insert(scope, key, { start: pointer, length: 8 });
174
+ }
175
+ }
176
+ }
177
+ }
178
+ const list = await locate(doc, kind, d.p), namespace = kind === "sections" ? sectionNamespace : d.p, itemName = kind === "sections" ? "section" : "custShow";
179
+ if (list) {
180
+ for await (const node of children(doc, list)) if (!await is(doc, node, itemName, namespace)) fail("unsupported-edit", "Unsupported membership list content.");
181
+ }
182
+ let position = 0;
183
+ if (list) for await (const node of children(doc, list)) {
184
+ const id = await attr(doc, node, "id"), name = await attr(doc, node, "name");
185
+ if (!id || !name || await equal(doc.text(id), literal(""))) fail("invalid-opc", "Membership identities and names must be present.");
186
+ let identity = "";
187
+ if (kind === "shows") {
188
+ let number = 0;
189
+ for await (const character of characters(doc.text(id))) {
190
+ if (character < "0" || character > "9") fail("invalid-opc", "Invalid custom show identity.");
191
+ number = number * 10 + (character.charCodeAt(0) - 48);
192
+ if (number > 4294967295) fail("invalid-opc", "Invalid custom show identity.");
193
+ }
194
+ identity = String(number);
195
+ } else {
196
+ for await (const character of characters(doc.text(id))) {
197
+ identity += character;
198
+ if (identity.length > 38) fail("invalid-opc", "Invalid section identity.");
199
+ }
200
+ const segments = identity.slice(1, -1).split("-");
201
+ if (!identity.startsWith("{") || !identity.endsWith("}") || segments.length !== 5 || segments.some((segment, n) => segment.length !== [8, 4, 4, 4, 12][n] || [...segment].some((character) => !"0123456789ABCDEF".includes(character.toUpperCase())))) fail("invalid-opc", "Invalid section identity.");
202
+ identity = identity.toUpperCase();
203
+ }
204
+ const identityRange = await values.store(literal(identity));
205
+ if (!await values.insert("seen", identityRange, identityRange)) fail("invalid-opc", "Membership identities must be unique.");
206
+ if (kind === "sections") {
207
+ for await (const value of doc.attributes(node)) if (!await is(doc, value, "id", "") && !await is(doc, value, "name", "")) fail("unsupported-edit", "Unsupported section extension content.");
208
+ for await (const value of children(doc, node)) if (!await is(doc, value, "sldIdLst", sectionNamespace)) fail("unsupported-edit", "Unsupported section extension content.");
209
+ }
210
+ const members = await only(doc, node, kind === "sections" ? "sldIdLst" : "sldLst", namespace);
211
+ if (!members) fail("unsupported-edit", "Missing membership slide list.");
212
+ if (kind === "sections") for await (const ignored of doc.attributes(members)) fail("unsupported-edit", "Unsupported section list attributes.");
213
+ let head = 0, tail = 0;
214
+ for await (const member of children(doc, members)) {
215
+ if (!await is(doc, member, kind === "sections" ? "sldId" : "sld", namespace)) fail("unsupported-edit", "Unsupported membership slide entry.");
216
+ if (kind === "sections") {
217
+ for await (const ignored of children(doc, member)) fail("unsupported-edit", "Unsupported section member extension.");
218
+ for await (const value of doc.attributes(member)) if (!await is(doc, value, "id", "")) fail("unsupported-edit", "Unsupported section member extension.");
219
+ }
220
+ const reference = await attr(doc, member, "id", kind === "sections" ? "" : d.r), found = await values.find(kind === "sections" ? "id" : "rel", () => reference ? doc.text(reference) : literal(""));
221
+ if (!found) fail("invalid-opc", "Membership references an absent slide.");
222
+ const memberPosition = (await row(found.start, 1))[0], pointer2 = pages.allocate(16);
223
+ await write(pointer2, [0, memberPosition]);
224
+ if (tail) await write(tail, [pointer2]);
225
+ else head = pointer2;
226
+ tail = pointer2;
227
+ }
228
+ if (kind === "sections") {
229
+ let previous = 0;
230
+ for await (const memberPosition of slides(head)) {
231
+ const key = await values.store(literal(String(memberPosition)));
232
+ if (!await values.insert("section-slides", key, key) || previous && memberPosition !== previous + 1) fail("unsupported-edit", "Existing sections must be contiguous and nonoverlapping.");
233
+ previous = memberPosition;
234
+ }
235
+ }
236
+ const idValue = await values.store(doc.text(id)), nameValue = await values.store(doc.text(name)), pointer = pages.allocate(56);
237
+ await write(pointer, [0, idValue.start, idValue.length, nameValue.start, nameValue.length, head, ++position]);
238
+ if (last) await write(last, [pointer]);
239
+ else first = pointer;
240
+ last = pointer;
241
+ }
242
+ await doc.close();
243
+ await graph.close();
244
+ return Object.freeze({ owner: main, close, async *records() {
245
+ check();
246
+ for (let pointer = first; pointer; ) {
247
+ const data = await row(pointer);
248
+ pointer = data[0];
249
+ yield { id: () => values.read(range(data, 1)), name: () => values.read(range(data, 3)), position: data[6], slides: () => slides(data[5]) };
250
+ }
251
+ check();
252
+ } });
253
+ } catch (error) {
254
+ await close().catch(() => {
255
+ });
256
+ throw error instanceof OfficeError ? error : new OfficeError(signal.aborted ? "cancelled" : "io-failure", "Membership storage operation failed.", "index");
257
+ }
258
+ }
259
+ async function stageRetainedMemberships(archive, fingerprint, kind, selection, settings, output) {
260
+ const query = { ...selection }, format = { ...output };
261
+ if (!["sections", "shows"].includes(kind) || ![`${kind}.list`, `${kind}.get`].includes(format.operation)) fail("invalid-value", "Unknown membership operation.");
262
+ const index = await openRetainedPresentationIndex(archive, fingerprint, settings);
263
+ let view, staged;
264
+ try {
265
+ let owner = "";
266
+ for await (const record of index.records.records("part")) if (record.scope === "presentation") {
267
+ owner = record.part;
268
+ break;
269
+ }
270
+ view = await openRetainedMemberships(archive, kind, settings);
271
+ const token = query.token ? decodeSelectionToken(query.token) : void 0;
272
+ if (token) {
273
+ if (token.fingerprint !== fingerprint) throw new SelectionError("stale-selection");
274
+ if (token.scope !== "presentation" || token.owner !== owner || !token.objectId?.startsWith(`${kind}:`)) throw new SelectionError("invalid-selection");
275
+ }
276
+ async function* selected() {
277
+ for await (const record of view.records()) {
278
+ if (token) {
279
+ if (!await equal(record.id(), literal(token.objectId.slice(kind.length + 1)))) continue;
280
+ } else if (query.slide !== void 0) {
281
+ let present = false;
282
+ for await (const position of record.slides()) if (position === query.slide) {
283
+ present = true;
284
+ break;
285
+ }
286
+ if (!present) continue;
287
+ }
288
+ yield record;
289
+ }
290
+ }
291
+ if (format.operation.endsWith(".get")) {
292
+ let count = 0;
293
+ for await (const ignored of selected()) count++;
294
+ if (!count) throw new SelectionError("missing-selection");
295
+ if (count > 1) throw new SelectionError("ambiguous-selection");
296
+ }
297
+ const location = (record) => ({ fingerprint, scope: "presentation", owner, objectId: async function* () {
298
+ yield* literal(`${kind}:`);
299
+ yield* record.id();
300
+ }, coordinateSystem: "identity" });
301
+ async function* records() {
302
+ for await (const record of selected()) {
303
+ const where = location(record);
304
+ yield { id: record.id, name: record.name, position: record.position, slides: record.slides(), location: where, token: () => streamJson(where) };
305
+ }
306
+ }
307
+ async function* locations() {
308
+ for await (const record of selected()) yield location(record);
309
+ }
310
+ async function* render() {
311
+ if (format.json) {
312
+ yield* streamJson({ version: 1, operation: format.operation, ok: true, data: { fingerprint, records: records() }, warnings: [], errors: [], affected: 0, locations: locations() });
313
+ yield* literal("\n");
314
+ } else {
315
+ let first = true;
316
+ for await (const record of selected()) {
317
+ if (!first) yield* literal("\n");
318
+ first = false;
319
+ yield* literal(`${record.position} `);
320
+ yield* streamJson(record.name);
321
+ yield* literal(" [");
322
+ let member = false;
323
+ for await (const position of record.slides()) {
324
+ if (member) yield* literal(", ");
325
+ member = true;
326
+ yield* literal(String(position));
327
+ }
328
+ yield* literal("]");
329
+ }
330
+ yield* literal("\n");
331
+ }
332
+ }
333
+ staged = await stageRetainedOutput(render(), settings, format.maxOutputBytes);
334
+ await view.close();
335
+ await index.close();
336
+ return staged;
337
+ } catch (error) {
338
+ await Promise.allSettled([view?.close(), index.close(), staged?.close()]);
339
+ throw error;
340
+ }
341
+ }
342
+
343
+ // packages/safe-bash-presentation-engine/src/memberships.ts
344
+ var sectionNamespace2 = "http://schemas.microsoft.com/office/powerpoint/2010/main";
345
+ var sectionExtension2 = "{521415D9-36F7-43E2-AB2F-B90AF26B5E84}";
346
+ var dialects2 = [
347
+ {
348
+ p: "http://schemas.openxmlformats.org/presentationml/2006/main",
349
+ r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
350
+ },
351
+ {
352
+ p: "http://purl.oclc.org/ooxml/presentationml/main",
353
+ r: "http://purl.oclc.org/ooxml/officeDocument/relationships"
354
+ }
355
+ ];
356
+ function fail2(code, message) {
357
+ throw new OfficeError(code, message, code === "invalid-value" ? "usage" : "validate-intent");
358
+ }
359
+ function attr2(node, name, namespace = "") {
360
+ return node.attributes.find((a) => a.name.namespace === namespace && a.name.localName === name)?.value;
361
+ }
362
+ function children2(node, name, namespace) {
363
+ return node.children.filter(
364
+ (child) => child.name.namespace === namespace && child.name.localName === name
365
+ );
366
+ }
367
+ function only2(node, name, namespace) {
368
+ const found = children2(node, name, namespace);
369
+ if (found.length > 1) fail2("unsupported-edit", "Ambiguous membership structure.");
370
+ return found[0];
371
+ }
372
+ function locate2(xml, kind) {
373
+ const p = xml.root.name.namespace;
374
+ if (kind === "shows") return only2(xml.root, "custShowLst", p);
375
+ const extensions = only2(xml.root, "extLst", p);
376
+ const matching = extensions?.children.filter((node) => attr2(node, "uri")?.toUpperCase() === sectionExtension2) ?? [];
377
+ if (matching.length > 1) fail2("unsupported-edit", "Multiple section extensions.");
378
+ const extension = matching[0];
379
+ if (extensions?.children.some(
380
+ (node) => node !== extension && node.children.some((child) => child.name.localName === "sectionLst")
381
+ ))
382
+ fail2("unsupported-edit", "Unsupported section extension identity.");
383
+ if (!extension) return void 0;
384
+ if (extension.name.namespace !== p || extension.name.localName !== "ext" || extension.children.length !== 1)
385
+ fail2("unsupported-edit", "Unsupported section extension structure.");
386
+ const list = only2(extension, "sectionLst", sectionNamespace2);
387
+ if (!list) fail2("unsupported-edit", "Unsupported section extension namespace.");
388
+ return list;
389
+ }
390
+ function inspect(xml, kind) {
391
+ const d = dialects2.find((value) => value.p === xml.root.name.namespace);
392
+ if (!d) fail2("unsupported-edit", "Unsupported presentation namespace.");
393
+ const slideList = only2(xml.root, "sldIdLst", d.p);
394
+ const slides = slideList ? children2(slideList, "sldId", d.p) : [];
395
+ const ids = slides.map((node) => attr2(node, "id"));
396
+ const rels = slides.map((node) => attr2(node, "id", d.r));
397
+ const list = locate2(xml, kind);
398
+ const ns = kind === "sections" ? sectionNamespace2 : d.p;
399
+ const itemName = kind === "sections" ? "section" : "custShow";
400
+ if (list?.children.some((node) => node.name.namespace !== ns || node.name.localName !== itemName))
401
+ fail2("unsupported-edit", "Unsupported membership list content.");
402
+ const seen = /* @__PURE__ */ new Set();
403
+ const sectionSlides = /* @__PURE__ */ new Set();
404
+ const records = (list?.children ?? []).map((node, i) => {
405
+ const id = attr2(node, "id"), name = attr2(node, "name");
406
+ if (id === void 0 || !id || name === void 0)
407
+ fail2("invalid-opc", "Membership identities and names must be present.");
408
+ let identity = id.toUpperCase();
409
+ if (kind === "shows") {
410
+ if (![...id].every((character) => character >= "0" && character <= "9") || !Number.isSafeInteger(Number(id)) || Number(id) > 4294967295)
411
+ fail2("invalid-opc", "Invalid custom show identity.");
412
+ identity = String(Number(id));
413
+ } else {
414
+ const segments = id.slice(1, -1).split("-");
415
+ if (!id.startsWith("{") || !id.endsWith("}") || segments.length !== 5 || segments.some(
416
+ (segment, i2) => segment.length !== [8, 4, 4, 4, 12][i2] || [...segment].some((character) => !"0123456789ABCDEF".includes(character.toUpperCase()))
417
+ ))
418
+ fail2("invalid-opc", "Invalid section identity.");
419
+ }
420
+ if (seen.has(identity)) fail2("invalid-opc", "Membership identities must be unique.");
421
+ seen.add(identity);
422
+ if (kind === "sections" && (node.attributes.some(
423
+ (a) => a.name.namespace !== "http://www.w3.org/2000/xmlns/" && (a.name.namespace !== "" || !["id", "name"].includes(a.name.localName))
424
+ ) || node.children.some(
425
+ (child) => child.name.namespace !== sectionNamespace2 || child.name.localName !== "sldIdLst"
426
+ )))
427
+ fail2("unsupported-edit", "Unsupported section extension content.");
428
+ const members = only2(node, kind === "sections" ? "sldIdLst" : "sldLst", ns);
429
+ if (!members) fail2("unsupported-edit", "Missing membership slide list.");
430
+ if (kind === "sections" && members.attributes.some((a) => a.name.namespace !== "http://www.w3.org/2000/xmlns/"))
431
+ fail2("unsupported-edit", "Unsupported section list attributes.");
432
+ const positions = members.children.map((member) => {
433
+ if (member.name.namespace !== ns || member.name.localName !== (kind === "sections" ? "sldId" : "sld"))
434
+ fail2("unsupported-edit", "Unsupported membership slide entry.");
435
+ if (kind === "sections" && (member.children.length || member.attributes.some(
436
+ (a) => a.name.namespace !== "http://www.w3.org/2000/xmlns/" && (a.name.namespace !== "" || a.name.localName !== "id")
437
+ )))
438
+ fail2("unsupported-edit", "Unsupported section member extension.");
439
+ const position = kind === "sections" ? ids.indexOf(attr2(member, "id") ?? "") : rels.indexOf(attr2(member, "id", d.r) ?? "");
440
+ if (position < 0) fail2("invalid-opc", "Membership references an absent slide.");
441
+ return position + 1;
442
+ });
443
+ if (kind === "sections")
444
+ for (const [j, position] of positions.entries()) {
445
+ if (sectionSlides.has(position) || j > 0 && position !== positions[j - 1] + 1)
446
+ fail2("unsupported-edit", "Existing sections must be contiguous and nonoverlapping.");
447
+ sectionSlides.add(position);
448
+ }
449
+ return { id, name, position: i + 1, slides: positions };
450
+ });
451
+ return { d, ids, rels, list, ns, records };
452
+ }
453
+ async function load(input, context) {
454
+ if (!context?.xmlLimits || !context.relationshipLimits)
455
+ fail2("invalid-value", "Explicit XML and relationship limits are required.");
456
+ const source = await readBinary(input, context);
457
+ const reader = await readPackage(source, context);
458
+ const graph = readRelationshipGraph(reader, context.relationshipLimits);
459
+ const main = graph.outgoing("/").find((edge) => dialects2.some((d) => edge.type === `${d.r}/officeDocument`))?.targetPart;
460
+ if (!main) fail2("invalid-opc", "Presentation relationship is missing.");
461
+ return { source, reader, graph, main, xml: parseXmlPart(reader.get(main), context.xmlLimits) };
462
+ }
463
+ async function readMemberships(input, kind, context) {
464
+ if (!["sections", "shows"].includes(kind)) fail2("invalid-value", "Unknown membership resource.");
465
+ return inspect((await load(input, context)).xml, kind).records;
466
+ }
467
+ function fields(value, allowed) {
468
+ if (!value || typeof value !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(value)) || Object.keys(value).some((key) => !allowed.includes(key)))
469
+ fail2("invalid-value", "Invalid membership options.");
470
+ }
471
+ async function mutateMemberships(input, kind, options, context) {
472
+ fields(options, ["action", "selection", "name", "slides", "position", "allowEmpty"]);
473
+ if (!["sections", "shows"].includes(kind) || !["add", "set", "remove"].includes(options.action))
474
+ fail2("invalid-value", "Unknown membership operation.");
475
+ if (options.name !== void 0 && typeof options.name !== "string")
476
+ fail2("invalid-value", "Membership name must be text.");
477
+ if (options.allowEmpty !== void 0 && typeof options.allowEmpty !== "boolean")
478
+ fail2("invalid-value", "allowEmpty must be boolean.");
479
+ if (options.position !== void 0 && (!Number.isSafeInteger(options.position) || options.position < 1))
480
+ fail2("invalid-value", "Invalid membership position.");
481
+ if (options.action === "add" && (options.name === void 0 || options.slides === void 0 || options.selection !== void 0))
482
+ fail2("invalid-value", "Creation requires a name and slide membership.");
483
+ if (options.action === "set" && options.name === void 0 && options.slides === void 0 && options.position === void 0)
484
+ fail2("invalid-value", "At least one membership update is required.");
485
+ if (options.action === "remove" && [options.name, options.slides, options.position].some((value) => value !== void 0))
486
+ fail2("invalid-value", "Removal cannot include updates.");
487
+ if (options.selection !== void 0) {
488
+ fields(options.selection, ["id", "ids", "name", "position", "all"]);
489
+ const q2 = options.selection;
490
+ 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)
491
+ throw new SelectionError("invalid-selection");
492
+ } else if (options.action !== "add") throw new SelectionError("invalid-selection");
493
+ const loaded = await load(input, context);
494
+ let xml = loaded.xml;
495
+ const { source, reader, graph, main } = loaded;
496
+ const limits = {
497
+ ...context.xmlLimits,
498
+ ...context.relationshipLimits,
499
+ maxBytes: Math.min(context.xmlLimits.maxBytes, context.relationshipLimits.maxBytes),
500
+ maxEntries: context.archiveLimits.maxMembers
501
+ };
502
+ const types = parseContentTypes(reader.get("/[Content_Types].xml"), limits);
503
+ for (const name of reader.names) {
504
+ if (name === "/[Content_Types].xml") continue;
505
+ const type = types.get(name).toLowerCase();
506
+ if (type.includes("digital-signature") || type.includes("macroenabled") || type.includes("vbaproject") || name.toLowerCase().startsWith("/_xmlsignatures/"))
507
+ fail2("unsupported-edit", "Signed and macro-enabled presentations cannot be changed.");
508
+ }
509
+ for (const owner of ["/", ...graph.parts])
510
+ if (graph.outgoing(owner).some(
511
+ (edge) => edge.type.includes("/digital-signature/") || edge.type.endsWith("/vbaProject")
512
+ ))
513
+ fail2("unsupported-edit", "Signed and macro-enabled presentations cannot be changed.");
514
+ if (!validatePresentation(reader, limits).valid)
515
+ fail2("invalid-opc", "Membership editing requires a valid presentation graph.");
516
+ const pending = [xml.root];
517
+ while (pending.length) {
518
+ const node = pending.pop();
519
+ if (node.name.localName === "modifyVerifier" || node.name.namespace === "http://schemas.openxmlformats.org/markup-compatibility/2006")
520
+ fail2(
521
+ "unsupported-edit",
522
+ "Protected or conditional presentation structures cannot be changed."
523
+ );
524
+ pending.push(...node.children);
525
+ }
526
+ if (options.name !== void 0)
527
+ xml.merge(xml.root, {
528
+ attributes: [{ namespace: "", localName: "name", value: options.name }]
529
+ });
530
+ const state = inspect(xml, kind);
531
+ const q = options.selection;
532
+ const selected = options.action === "add" ? [] : state.records.filter(
533
+ (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)
534
+ );
535
+ if (selected.length > 1 && !q?.all) throw new SelectionError("ambiguous-selection");
536
+ if (options.slides !== void 0) {
537
+ if (!Array.isArray(options.slides) || !options.slides.length || new Set(options.slides).size !== options.slides.length || options.slides.some(
538
+ (position) => !Number.isSafeInteger(position) || position < 1 || position > state.ids.length
539
+ ))
540
+ fail2("invalid-value", "Membership requires unique existing slide positions.");
541
+ if (kind === "sections" && options.slides.some((position, i) => i > 0 && position !== options.slides[i - 1] + 1))
542
+ fail2("invalid-value", "Section members must be ordered and contiguous.");
543
+ }
544
+ if (kind === "sections") {
545
+ const used = /* @__PURE__ */ new Set();
546
+ const records = state.records.filter(
547
+ (record) => options.action !== "remove" || !selected.includes(record)
548
+ );
549
+ const memberships = records.map(
550
+ (record) => selected.includes(record) && options.slides !== void 0 ? options.slides : record.slides
551
+ );
552
+ if (options.action === "add") memberships.push(options.slides);
553
+ for (const members of memberships)
554
+ for (const [i, slide] of members.entries()) {
555
+ if (used.has(slide) || i > 0 && slide !== members[i - 1] + 1)
556
+ fail2("invalid-value", "Section members must be contiguous and nonoverlapping.");
557
+ used.add(slide);
558
+ }
559
+ for (const node of state.list?.children ?? []) {
560
+ if (node.children.some(
561
+ (child) => child.name.namespace !== sectionNamespace2 || child.name.localName !== "sldIdLst"
562
+ ))
563
+ fail2("unsupported-edit", "Unsupported section extension content.");
564
+ }
565
+ }
566
+ const finalCount = state.records.length + (options.action === "add" ? 1 : 0);
567
+ if (options.position !== void 0 && options.position > finalCount - selected.length + (options.action === "add" ? 0 : 1))
568
+ fail2("invalid-value", "Membership position is outside the list.");
569
+ if (options.action !== "add" && !selected.length) {
570
+ if (options.allowEmpty) return source;
571
+ throw new SelectionError("missing-selection");
572
+ }
573
+ if (kind === "shows" && options.action === "remove") {
574
+ const removedIds = new Set(selected.map((record) => Number(record.id)));
575
+ const dangling = () => {
576
+ throw new OfficeError(
577
+ "dangling-reference",
578
+ "Custom show removal would leave an active or unsupported show reference.",
579
+ "validate-intent"
580
+ );
581
+ };
582
+ const checkId = (id) => {
583
+ if (id === void 0 || !id || [...id].some((character) => character < "0" || character > "9") || !Number.isSafeInteger(Number(id)) || Number(id) > 4294967295 || removedIds.has(Number(id)))
584
+ dangling();
585
+ };
586
+ for (const name of reader.names) {
587
+ context.signal?.throwIfAborted();
588
+ if (name === "/[Content_Types].xml") continue;
589
+ const type = types.get(name).toLowerCase();
590
+ if (!type.endsWith("+xml") && !type.endsWith("/xml")) continue;
591
+ const doc = name === main ? xml : parseXmlPart(reader.get(name), context.xmlLimits);
592
+ const nodes = [{ node: doc.root }];
593
+ while (nodes.length) {
594
+ const { node, parent } = nodes.pop();
595
+ if (node.name.namespace === state.d.p && node.name.localName === "custShow" && parent?.name.localName !== "custShowLst")
596
+ checkId(attr2(node, "id"));
597
+ for (const attribute of node.attributes) {
598
+ if (attribute.name.localName !== "action" || !attribute.value.toLowerCase().startsWith("ppaction://customshow"))
599
+ continue;
600
+ let action;
601
+ try {
602
+ action = new URL(attribute.value);
603
+ } catch {
604
+ dangling();
605
+ }
606
+ if (action.hostname !== "customshow" || action.pathname || action.hash || action.username || action.password || action.port)
607
+ dangling();
608
+ const ids = action.searchParams.getAll("id");
609
+ if (ids.length !== 1) dangling();
610
+ action.searchParams.forEach((_value, key) => {
611
+ if (!["id", "return"].includes(key)) dangling();
612
+ });
613
+ checkId(ids[0]);
614
+ }
615
+ nodes.push(...node.children.map((child) => ({ node: child, parent: node })));
616
+ }
617
+ }
618
+ }
619
+ if (options.action === "add") {
620
+ if (!locate2(xml, kind)) {
621
+ if (kind === "shows") {
622
+ const preceding = [
623
+ "sldMasterIdLst",
624
+ "notesMasterIdLst",
625
+ "handoutMasterIdLst",
626
+ "sldIdLst",
627
+ "sldSz",
628
+ "notesSz",
629
+ "smartTags",
630
+ "embeddedFontLst"
631
+ ];
632
+ const following = xml.root.children.findIndex(
633
+ (node) => !preceding.includes(node.name.localName)
634
+ );
635
+ xml = xml.spliceChildren(
636
+ xml.root,
637
+ following < 0 ? xml.root.children.length : following,
638
+ 0,
639
+ [`<p:custShowLst xmlns:p="${state.d.p}"/>`]
640
+ );
641
+ } else {
642
+ let ext = only2(xml.root, "extLst", state.d.p);
643
+ if (!ext) {
644
+ xml = xml.spliceChildren(xml.root, xml.root.children.length, 0, [
645
+ `<p:extLst xmlns:p="${state.d.p}"/>`
646
+ ]);
647
+ ext = only2(xml.root, "extLst", state.d.p);
648
+ }
649
+ xml = xml.spliceChildren(ext, ext.children.length, 0, [
650
+ `<p:ext xmlns:p="${state.d.p}" uri="${sectionExtension2}"><s:sectionLst xmlns:s="${sectionNamespace2}"/></p:ext>`
651
+ ]);
652
+ }
653
+ }
654
+ let number = kind === "shows" ? 0 : 1;
655
+ const idFor = (n) => kind === "shows" ? String(n) : `{00000000-0000-0000-0000-${n.toString(16).toUpperCase().padStart(12, "0")}}`;
656
+ const used = new Set(
657
+ state.records.map(
658
+ (record2) => kind === "shows" ? String(Number(record2.id)) : record2.id.toUpperCase()
659
+ )
660
+ );
661
+ while (used.has(idFor(number))) number++;
662
+ if (number > 4294967295)
663
+ throw new OfficeError(
664
+ "resource-limit",
665
+ "Membership identities exhausted.",
666
+ "validate-intent"
667
+ );
668
+ const list = locate2(xml, kind);
669
+ const element = kind === "shows" ? `<p:custShow xmlns:p="${state.d.p}" name="" id="${idFor(number)}"><p:sldLst/></p:custShow>` : `<s:section xmlns:s="${sectionNamespace2}" name="" id="${idFor(number)}"><s:sldIdLst/></s:section>`;
670
+ xml = xml.spliceChildren(
671
+ list,
672
+ options.position === void 0 ? list.children.length : options.position - 1,
673
+ 0,
674
+ [element]
675
+ );
676
+ const record = { id: idFor(number), name: "", position: 0, slides: [] };
677
+ selected.push(record);
678
+ }
679
+ for (const record of selected) {
680
+ let list = locate2(xml, kind);
681
+ const index = list.children.findIndex((node2) => attr2(node2, "id") === record.id);
682
+ if (options.action === "remove") {
683
+ xml = xml.spliceChildren(list, index, 1, []);
684
+ continue;
685
+ }
686
+ let node = list.children[index];
687
+ if (options.name !== void 0) {
688
+ xml = xml.merge(node, {
689
+ attributes: [{ namespace: "", localName: "name", value: options.name }]
690
+ });
691
+ list = locate2(xml, kind);
692
+ node = list.children[index];
693
+ }
694
+ if (options.slides !== void 0) {
695
+ const members = only2(node, kind === "shows" ? "sldLst" : "sldIdLst", state.ns);
696
+ if (members.attributes.some((a) => a.name.namespace !== "http://www.w3.org/2000/xmlns/") || members.children.some(
697
+ (child) => child.children.length || child.attributes.some(
698
+ (a) => a.name.namespace !== "http://www.w3.org/2000/xmlns/" && !(a.name.localName === "id" && a.name.namespace === (kind === "shows" ? state.d.r : ""))
699
+ )
700
+ ))
701
+ fail2("unsupported-edit", "Unsupported membership entry extension.");
702
+ xml = xml.spliceChildren(
703
+ members,
704
+ 0,
705
+ members.children.length,
706
+ options.slides.map((position) => {
707
+ const member = parseXmlPart(
708
+ new TextEncoder().encode(
709
+ kind === "shows" ? `<p:sld xmlns:p="${state.d.p}" xmlns:r="${state.d.r}" r:id=""/>` : `<s:sldId xmlns:s="${sectionNamespace2}" id=""/>`
710
+ ),
711
+ context.xmlLimits
712
+ );
713
+ const edited = member.merge(member.root, {
714
+ attributes: [
715
+ {
716
+ namespace: kind === "shows" ? state.d.r : "",
717
+ localName: "id",
718
+ value: (kind === "shows" ? state.rels : state.ids)[position - 1]
719
+ }
720
+ ]
721
+ });
722
+ return edited.markup(edited.root);
723
+ })
724
+ );
725
+ }
726
+ }
727
+ if (options.action === "set" && options.position !== void 0) {
728
+ const list = locate2(xml, kind);
729
+ const ids = new Set(selected.map((record) => record.id));
730
+ const moving = list.children.filter((node) => ids.has(attr2(node, "id")));
731
+ const ordered = list.children.filter((node) => !ids.has(attr2(node, "id")));
732
+ ordered.splice(options.position - 1, 0, ...moving);
733
+ xml = xml.reorderChildren(list, ordered);
734
+ }
735
+ const remaining = locate2(xml, kind);
736
+ if (remaining && !remaining.children.length) {
737
+ if (kind === "shows")
738
+ xml = xml.spliceChildren(xml.root, xml.root.children.indexOf(remaining), 1, []);
739
+ else {
740
+ const ext = only2(xml.root, "extLst", state.d.p);
741
+ const index = ext.children.findIndex((node) => node.children.includes(remaining));
742
+ xml = xml.spliceChildren(ext, index, 1, []);
743
+ const remainingExtensions = only2(xml.root, "extLst", state.d.p);
744
+ if (!remainingExtensions.children.length && remainingExtensions.attributes.every(
745
+ (a) => a.name.namespace === "http://www.w3.org/2000/xmlns/"
746
+ ))
747
+ xml = xml.spliceChildren(xml.root, xml.root.children.indexOf(remainingExtensions), 1, []);
748
+ }
749
+ }
750
+ const original = reader.get(main), changed = xml.bytes();
751
+ if (original.length === changed.length && original.every((value, index) => value === changed[index]))
752
+ return source;
753
+ const output = await writePackageArchive(
754
+ reader.names.map((name) => ({
755
+ name: name.slice(1),
756
+ bytes: name === main ? xml.bytes() : reader.get(name)
757
+ })),
758
+ context,
759
+ { compression: "auto", source }
760
+ );
761
+ if (!validatePresentation(await readPackage(output, context), limits).valid)
762
+ fail2("invalid-opc", "Changed memberships fail graph validation.");
763
+ return output;
764
+ }
765
+
766
+ export {
767
+ openRetainedMemberships,
768
+ stageRetainedMemberships,
769
+ readMemberships,
770
+ mutateMemberships
771
+ };