@panphora/clayjs 1.25.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/dist/all.js +1 -1
  2. package/dist/clay-dom.js +1 -1
  3. package/dist/clay-events.js +1 -1
  4. package/dist/clay-internals.js +1 -1
  5. package/dist/clay-options.js +1 -1
  6. package/dist/clay-router.js +1 -1
  7. package/dist/clay-ui.js +1 -1
  8. package/dist/clay-utils.js +1 -1
  9. package/dist/clay.js +1 -1
  10. package/dist/clay.standalone.js +5570 -4173
  11. package/dist/m/attrs/{save-freeze-MH3AOD56.js → save-freeze-PUYX32AK.js} +1 -1
  12. package/dist/m/{c-BOMQIQ3V.js → c-2EFMJYGJ.js} +1 -1
  13. package/dist/m/c-2EPHRF47.js +1 -0
  14. package/dist/m/{c-JD2VFAYG.js → c-2SUFMUZX.js} +2 -2
  15. package/dist/m/{c-CITLTVQ4.js → c-2TJCFPX4.js} +1 -1
  16. package/dist/m/c-33SS5A4Y.js +1 -0
  17. package/dist/m/{c-V2FPBRO6.js → c-34J5HC7N.js} +1 -1
  18. package/dist/m/c-3F3AADKG.js +1 -0
  19. package/dist/m/{c-TCFVG3I4.js → c-3S3647J6.js} +1 -1
  20. package/dist/m/{c-GY4BREDT.js → c-3S5TNRZA.js} +1 -1
  21. package/dist/m/{c-GDNZEOOZ.js → c-3WX5FABT.js} +1 -1
  22. package/dist/m/{c-AI3H6ETU.js → c-3XGLJAS7.js} +2 -2
  23. package/dist/m/c-42WBOKFM.js +1 -0
  24. package/dist/m/c-47M4QHCK.js +1 -0
  25. package/dist/m/{c-UOUUI265.js → c-4M2T676V.js} +1 -1
  26. package/dist/m/{c-GEAG5XAK.js → c-4TP3UXBT.js} +1 -1
  27. package/dist/m/{c-IESDKFO6.js → c-5ELELG2F.js} +1 -1
  28. package/dist/m/{c-X3V4RWMA.js → c-5ZYLTN3Q.js} +1 -1
  29. package/dist/m/{c-5PZYDWTW.js → c-67TBU56I.js} +1 -1
  30. package/dist/m/{c-WNOLMHI2.js → c-6BGJAJ67.js} +1 -1
  31. package/dist/m/{c-4Q6QIODW.js → c-755ZOHOM.js} +1 -1
  32. package/dist/m/c-7Q4XYDF4.js +1 -0
  33. package/dist/m/c-7RHOMAMR.js +1 -0
  34. package/dist/m/c-A5LASUEZ.js +1 -0
  35. package/dist/m/{c-IL5IVTOG.js → c-ABOBD7F3.js} +1 -1
  36. package/dist/m/c-AQVQKFKB.js +1 -0
  37. package/dist/m/{c-QDVG4NAZ.js → c-ARO6CPMA.js} +1 -1
  38. package/dist/m/{c-ORLPQFNU.js → c-AZM34SPO.js} +1 -1
  39. package/dist/m/{c-XUZMRQ7O.js → c-BCS3AZQZ.js} +1 -1
  40. package/dist/m/c-BOS7GONO.js +1 -0
  41. package/dist/m/{c-SUAC5RSG.js → c-C5UGNOC2.js} +1 -1
  42. package/dist/m/c-C6DXZIXD.js +1 -0
  43. package/dist/m/{c-WSTUCBHV.js → c-CPRGR2II.js} +1 -1
  44. package/dist/m/{c-NICICT4P.js → c-DEYHCYJB.js} +1 -1
  45. package/dist/m/{c-WGQVSKKC.js → c-DYTBSJBI.js} +1 -1
  46. package/dist/m/{c-DT7E76Z2.js → c-DZT6W2NG.js} +1 -1
  47. package/dist/m/{c-O2QZDVZ2.js → c-EEWPNUM2.js} +1 -1
  48. package/dist/m/{c-MFB74XVN.js → c-EHAR4RJJ.js} +2 -2
  49. package/dist/m/c-EHJWIGWN.js +1 -0
  50. package/dist/m/c-EIDZHQHZ.js +1 -0
  51. package/dist/m/{c-V2V5FKXX.js → c-EIUKME3W.js} +1 -1
  52. package/dist/m/c-ELXMSEN5.js +1 -0
  53. package/dist/m/c-EXZOA6XY.js +7 -0
  54. package/dist/m/{c-FKTALXNV.js → c-EYFMAR3M.js} +1 -1
  55. package/dist/m/c-FC5RUFPR.js +1 -0
  56. package/dist/m/{c-FBOO2UY3.js → c-FUN6AKFE.js} +1 -1
  57. package/dist/m/{c-V4B3RUWB.js → c-GFASNR55.js} +1 -1
  58. package/dist/m/{c-XMIDHEKF.js → c-GY36NO7C.js} +1 -1
  59. package/dist/m/{c-UD4VDBGJ.js → c-H3M6UDNV.js} +1 -1
  60. package/dist/m/{c-SFZRY6RT.js → c-H47C6PJZ.js} +1 -1
  61. package/dist/m/{c-MUM53J5J.js → c-H4M2T4A6.js} +1 -1
  62. package/dist/m/{c-U7F66I64.js → c-HYNM5U6B.js} +1 -1
  63. package/dist/m/c-J2YYLEVM.js +1 -0
  64. package/dist/m/c-J2ZW4HMR.js +1 -0
  65. package/dist/m/{c-WCG6AKA7.js → c-JC4RZW4E.js} +1 -1
  66. package/dist/m/c-K2ZHQMPF.js +1 -0
  67. package/dist/m/c-KD2ME5UN.js +2 -0
  68. package/dist/m/{c-Z2OZFX3N.js → c-L6KVXPBO.js} +1 -1
  69. package/dist/m/{c-GO635CRU.js → c-LAKBBJOU.js} +2 -2
  70. package/dist/m/{c-4AE2A2LK.js → c-LETPPG2F.js} +1 -1
  71. package/dist/m/{c-SFYTKRU7.js → c-MKAUC6DB.js} +1 -1
  72. package/dist/m/{c-WDFQ7PBU.js → c-MMEVDN6D.js} +1 -1
  73. package/dist/m/{c-LS7IVQVW.js → c-MMV5JULA.js} +1 -1
  74. package/dist/m/{c-NEQRFC4O.js → c-MVVEIJUU.js} +1 -1
  75. package/dist/m/{c-SXZYVXD6.js → c-N362HNGO.js} +1 -1
  76. package/dist/m/{c-7K4SCQB7.js → c-ND3W7D5U.js} +1 -1
  77. package/dist/m/{c-3E2IK5HU.js → c-NNHNXD6M.js} +1 -1
  78. package/dist/m/{c-D62HRSZK.js → c-NYJ577NL.js} +1 -1
  79. package/dist/m/{c-YFO6ZJLQ.js → c-O3DPFZCE.js} +1 -1
  80. package/dist/m/c-OZOACVUD.js +1 -0
  81. package/dist/m/{c-MV7TEUTD.js → c-OZVK3TFI.js} +1 -1
  82. package/dist/m/{c-ZEA3DCG3.js → c-PWILUN4T.js} +1 -1
  83. package/dist/m/{c-BCWYEG6P.js → c-QA3Q3MDI.js} +1 -1
  84. package/dist/m/{c-XHZIKRCV.js → c-QKOKMQXA.js} +1 -1
  85. package/dist/m/{c-TGIMBAWE.js → c-RBWVF4N5.js} +1 -1
  86. package/dist/m/c-RES2S5Q3.js +1 -0
  87. package/dist/m/c-RFGELYEU.js +2 -0
  88. package/dist/m/c-RGFPLQGV.js +1 -0
  89. package/dist/m/{c-RGAALCDU.js → c-SPOEDIMP.js} +1 -1
  90. package/dist/m/{c-YX2MC7YL.js → c-SRW5OBCF.js} +1 -1
  91. package/dist/m/{c-C6YZNU6E.js → c-SYOA4T7V.js} +1 -1
  92. package/dist/m/c-SYVF6ZMF.js +1 -0
  93. package/dist/m/{c-NADLYVAH.js → c-TJ5PFOJ2.js} +1 -1
  94. package/dist/m/{c-KYTVZT4D.js → c-TKV273YU.js} +1 -1
  95. package/dist/m/c-U35T5NAY.js +1 -0
  96. package/dist/m/{c-PRZNJUYZ.js → c-UEKJWXCB.js} +2 -2
  97. package/dist/m/c-UW6MMZ4V.js +1 -0
  98. package/dist/m/{c-XQTERKQA.js → c-V4DBV5ZV.js} +1 -1
  99. package/dist/m/c-VGG3UR7I.js +1 -0
  100. package/dist/m/c-VU4WEWPH.js +4 -0
  101. package/dist/m/{c-5Q5XBN56.js → c-W7LWCJHD.js} +1 -1
  102. package/dist/m/c-WHMZCRQD.js +6 -0
  103. package/dist/m/{c-WMRJKQ2V.js → c-WHQUZM2V.js} +1 -1
  104. package/dist/m/c-WOJ2RTV4.js +1 -0
  105. package/dist/m/{c-ZJG6C2WL.js → c-WOWGGNCJ.js} +1 -1
  106. package/dist/m/{c-ZORVIXUR.js → c-XHD7XJTE.js} +1 -1
  107. package/dist/m/c-XONFK3WC.js +1 -0
  108. package/dist/m/{c-HGG7M2S3.js → c-Y3J5LDKB.js} +1 -1
  109. package/dist/m/{c-JB5YU57S.js → c-Y3MPVURA.js} +1 -1
  110. package/dist/m/c-Y6HH7LTM.js +1 -0
  111. package/dist/m/{c-52OC3OH3.js → c-YRDKVEGR.js} +1 -1
  112. package/dist/m/c-YYIN4NAF.js +30 -0
  113. package/dist/m/{c-WVCT3ITX.js → c-YZGWSCMT.js} +1 -1
  114. package/dist/m/c-ZFAPQQIB.js +1 -0
  115. package/dist/m/core/{admin-attrs-ZI6K6UGM.js → admin-attrs-43JBA6JB.js} +1 -1
  116. package/dist/m/core/{autosave-BSM2ABJL.js → autosave-HD7Y7UNV.js} +1 -1
  117. package/dist/m/core/{conflict-notice-7EQLDYPA.js → conflict-notice-UNDOD4BL.js} +1 -1
  118. package/dist/m/core/{persist-2SZO3PCE.js → persist-MX3VYVBN.js} +1 -1
  119. package/dist/m/core/{save-K6Q47J2X.js → save-JZ7R4ET2.js} +1 -1
  120. package/dist/m/core/{save-core-U3Z44XBO.js → save-core-I4N6S4ED.js} +1 -1
  121. package/dist/m/core/site-edits-C22O53GS.js +1 -0
  122. package/dist/m/core/{snapshot-PWCHYFL6.js → snapshot-N5MKDGNI.js} +1 -1
  123. package/dist/m/core/{unsaved-warning-2WRZLJH5.js → unsaved-warning-BP6ZY3PG.js} +1 -1
  124. package/dist/m/internals/{index-FSLC4M7J.js → index-3LAVREAU.js} +1 -1
  125. package/dist/m/loader-DCKCZKY6.js +1 -0
  126. package/dist/m/manifest-7954CBE3.js +1 -0
  127. package/dist/m/manifest-edit-93AA79D7.js +1 -0
  128. package/dist/m/manifest.json +1240 -1179
  129. package/dist/m/page/{editor-PKSPJ2XJ.js → editor-UF3CIA6V.js} +5 -5
  130. package/dist/m/plugins/{ai-edit-3LG6MGS3.js → ai-edit-WDV2GLDU.js} +2 -2
  131. package/dist/m/plugins/{cms-T2HLI7JG.js → cms-KG6TCTR3.js} +9 -9
  132. package/dist/m/plugins/{derive-7DR5TUDH.js → derive-R4USHZ7P.js} +1 -1
  133. package/dist/m/plugins/{indicator-CTKX4EY7.js → indicator-OLPZ4WFI.js} +1 -1
  134. package/dist/m/plugins/{live-IFLL6YN5.js → live-DF5YS5AH.js} +1 -1
  135. package/dist/m/plugins/{menu-YJZ3JWBC.js → menu-ESEFQARM.js} +1 -1
  136. package/dist/m/plugins/page-GZSU77JS.js +2 -0
  137. package/dist/m/plugins/{page-view-NMCCU6MF.js → page-view-7MM3FEAR.js} +1 -1
  138. package/dist/m/plugins/{people-6WIWCZEG.js → people-EBWE337I.js} +1 -1
  139. package/dist/m/plugins/quickcrop-UHURKA2F.js +26 -0
  140. package/dist/m/plugins/richclay-MXH2GFAZ.js +549 -0
  141. package/dist/m/plugins/sortable-BAG3MSWS.js +1 -0
  142. package/dist/m/plugins/{source-7LSGOV46.js → source-OYHDXKTB.js} +1 -1
  143. package/dist/m/plugins/undo-KLHAGV75.js +1 -0
  144. package/dist/m/plugins/{upgrade-MMPZUCDM.js → upgrade-SZQJYEQQ.js} +1 -1
  145. package/dist/m/plugins/{visitor-drafts-V5YB7XDH.js → visitor-drafts-ZE6PCAFP.js} +2 -2
  146. package/dist/m/plugins/{visitor-menu-QDV2MYJN.js → visitor-menu-5XY57JQA.js} +1 -1
  147. package/dist/m/plugins/{wire-3YGUO3GE.js → wire-S5ATC4QI.js} +1 -1
  148. package/dist/m/reader-core-AHOAP5DH.js +77 -0
  149. package/dist/m/sync/{live-sync-XMXXZS3G.js → live-sync-RZQSDMZW.js} +1 -1
  150. package/dist/m/ui/index-G7ZJXNMG.js +1 -0
  151. package/dist/m/vendor/{sap-core.vendor-JANUQULT.js → sap-core.vendor-5TWOJYVM.js} +4 -4
  152. package/dist/offline-manifest.json +780 -750
  153. package/dist/server/core.cjs +4245 -2614
  154. package/dist/server/markdown.cjs +1 -0
  155. package/dist/server/markdown.mjs +7 -0
  156. package/docs/guide.md +26 -37
  157. package/entries/clay-data.js +1 -1
  158. package/entries/sap.js +5 -5
  159. package/package.json +6 -2
  160. package/packed-contract.json +3 -0
  161. package/src/attrs/save-freeze.js +1 -1
  162. package/src/core/admin-contenteditable.js +1 -1
  163. package/src/core/admin-inputs.js +1 -1
  164. package/src/core/admin-onclick.js +1 -1
  165. package/src/core/admin-resources.js +5 -2
  166. package/src/core/conflict-notice-ui.js +59 -34
  167. package/src/core/save.js +9 -9
  168. package/src/core/site-edits.js +1 -1
  169. package/src/core/snapshot.js +56 -43
  170. package/src/core/stale-host-notice.js +20 -7
  171. package/src/loader-logic.js +0 -13
  172. package/src/page/boot-pack.js +1 -0
  173. package/src/page/editor.js +10 -4
  174. package/src/page/history-intent.js +111 -4
  175. package/src/page/import-markdown.js +22 -8
  176. package/src/page/save-projection.js +1 -1
  177. package/src/page/ybind/bridge.js +14 -7
  178. package/src/page/ybind/moves.js +437 -3
  179. package/src/page/ybind/origins.js +1 -1
  180. package/src/page/ybind/recovery.js +1 -1
  181. package/src/plugins/page.js +48 -4
  182. package/src/plugins/quickcrop.js +128 -69
  183. package/src/plugins/richclay.js +136 -0
  184. package/src/plugins/sortable.js +25 -9
  185. package/src/plugins/undo.js +169 -7
  186. package/src/recovery/undo.js +14 -7
  187. package/src/server/markdown/index.js +23 -0
  188. package/src/sync/conflicts.js +3 -1
  189. package/src/sync/data-guard-notice.js +137 -18
  190. package/src/sync/live-sync.js +24 -0
  191. package/src/ui/bevel-controls.js +4 -1
  192. package/src/ui/dialogs.js +11 -7
  193. package/src/ui/modal.js +9 -7
  194. package/src/ui/toast.js +67 -32
  195. package/src/ui/vendor-skin.js +9 -4
  196. package/src/vendor/hyper-html-api-data.vendor.js +1 -1
  197. package/src/vendor/hyper-html-api-upgrade.vendor.js +2 -2
  198. package/src/vendor/hyper-undo.vendor.js +1 -1
  199. package/src/vendor/hypercms.vendor.js +7 -7
  200. package/src/vendor/richclay.vendor.js +16 -16
  201. package/src/vendor/sap-core.vendor.js +4 -4
  202. package/tool-generation/context.md +69 -0
  203. package/tool-generation/system.md +1 -1
  204. package/dist/m/c-277QP5ET.js +0 -1
  205. package/dist/m/c-5SZ6KFR5.js +0 -1
  206. package/dist/m/c-CU33V6RW.js +0 -4
  207. package/dist/m/c-CVSWLX3X.js +0 -1
  208. package/dist/m/c-DXPOFLEJ.js +0 -1
  209. package/dist/m/c-EODTTNVA.js +0 -1
  210. package/dist/m/c-ESK4S67I.js +0 -1
  211. package/dist/m/c-FDWR3FL7.js +0 -1
  212. package/dist/m/c-FJDTDGDA.js +0 -1
  213. package/dist/m/c-FYDKYW6E.js +0 -1
  214. package/dist/m/c-HKSLOVU4.js +0 -1
  215. package/dist/m/c-IJHF4IO6.js +0 -1
  216. package/dist/m/c-IUL7PU4P.js +0 -1
  217. package/dist/m/c-JWW6BHWD.js +0 -6
  218. package/dist/m/c-K4M76VPM.js +0 -7
  219. package/dist/m/c-M7ITYKMF.js +0 -1
  220. package/dist/m/c-MR75YPRT.js +0 -1
  221. package/dist/m/c-NFQFV7OP.js +0 -2
  222. package/dist/m/c-NHXOBD6A.js +0 -1
  223. package/dist/m/c-NVU3DORS.js +0 -1
  224. package/dist/m/c-PNZIJFG7.js +0 -1
  225. package/dist/m/c-QWB53KRW.js +0 -1
  226. package/dist/m/c-RHPHMTF2.js +0 -2
  227. package/dist/m/c-RWJ3OSCP.js +0 -1
  228. package/dist/m/c-SEVOS4UE.js +0 -1
  229. package/dist/m/c-SGG6MUXW.js +0 -1
  230. package/dist/m/c-SXNSSHPP.js +0 -1
  231. package/dist/m/c-TFLRT5JX.js +0 -1
  232. package/dist/m/c-TLQINES7.js +0 -30
  233. package/dist/m/c-U65PREMC.js +0 -1
  234. package/dist/m/c-V5L6HWVL.js +0 -1
  235. package/dist/m/c-VMXCX52Q.js +0 -1
  236. package/dist/m/c-YYGUHSZR.js +0 -1
  237. package/dist/m/core/site-edits-CFMF6GHD.js +0 -1
  238. package/dist/m/loader-RC54UV7H.js +0 -1
  239. package/dist/m/manifest-3B84C829.js +0 -1
  240. package/dist/m/manifest-edit-1CB79AD4.js +0 -1
  241. package/dist/m/plugins/page-GTDPYGE4.js +0 -2
  242. package/dist/m/plugins/quickcrop-X5MRIBAP.js +0 -26
  243. package/dist/m/plugins/richclay-L3BZMX4I.js +0 -549
  244. package/dist/m/plugins/sortable-365SRRL3.js +0 -1
  245. package/dist/m/plugins/undo-UES4KS7B.js +0 -1
  246. package/dist/m/reader-core-VR7EL4WV.js +0 -77
  247. package/dist/m/ui/index-MGTWOW2C.js +0 -1
  248. /package/dist/m/{c-QTTJYJMA.js → c-FILLTJA7.js} +0 -0
  249. /package/dist/m/plugins/{quickcrop-X5MRIBAP.js.LEGAL.txt → quickcrop-UHURKA2F.js.LEGAL.txt} +0 -0
  250. /package/dist/m/plugins/{richclay-L3BZMX4I.js.LEGAL.txt → richclay-MXH2GFAZ.js.LEGAL.txt} +0 -0
@@ -0,0 +1,30 @@
1
+ import{a as _t,b as Dt,c as jt,d as Ue,e as je,f as oo,g as Ft,h as ro,i as so,j as Lt,l as Nt}from"./c-DEYHCYJB.js";import{a as $t,b as no,c as Qo,f as Zo}from"./c-LETPPG2F.js";import{a as er}from"./c-6BGJAJ67.js";import{a as Zn,b as eo,e as to,f as pt,g as Pt}from"./c-MMV5JULA.js";import{a as Xo}from"./c-MVVEIJUU.js";import{b as Vo,c as qo}from"./c-OBMZASYQ.js";import"./c-IW6GGOU2.js";import"./c-HAWFNBYG.js";import{a as De,b as Un,p as Gn,q as Xn,s as Wo,v as Uo,w as Go}from"./c-WHMZCRQD.js";import{A as Nn,B as Bn,D as Te,E as zn,F as We,G as ft,H as Kn,I as Jn,J as qe,K as ut,L as Ae,M as dt,N as Hn,O as Yt,P as Vn,Q as Wn,R as mt,S as qn,T as de,a as Ve,b as _e,c as An,d as Yn,e as Rn,g as Pn,k as $n,n as Ho,q as _n,r as Dn,s as jn,t as Fn,u as Ct,w as Tt,y as At,z as Ln}from"./c-LAKBBJOU.js";import{a as be,b as On,d as Ye,e as Ke,g as Me,h as Je,i as xe,j as ne,k as En,l as He,m as ct,n as ye,o as Mn,p as In,q as Ce,r as Re,u as Cn,v as Tn,w as at}from"./c-EIUKME3W.js";import"./c-DZT6W2NG.js";import"./c-SYOA4T7V.js";import"./c-ND3W7D5U.js";import{A as we,B as Be,C as Ee,d as xt,e as Le,f as un,i as dn,j as mn,l as st,m as it,n as St,q as Ot,r as Ne,s as ge,t as pn,w as Et,x as hn,y as $e,z as me}from"./c-WHQUZM2V.js";import{g as Qn,p as Rt}from"./c-3XGLJAS7.js";import{E as Mt,H as It,I as wn,d as ue,fa as ze,g as kn,i as yn,ia as xn,ja as Sn,na as lt,w as vn}from"./c-OH2FPYSY.js";import{b as nn}from"./c-QY7F6EN6.js";import"./c-FSQXFG5T.js";import{b as pe,c as gn,e as bn}from"./c-RETTCOWO.js";import{a as on,b as rn,d as vt}from"./c-JC4RZW4E.js";import{a as an}from"./c-TCCA5BZN.js";import"./c-3LDGIBMN.js";import{c as fn}from"./c-57XDY6HC.js";import"./c-OZVK3TFI.js";import{a as cn,b as wt}from"./c-FILLTJA7.js";import"./c-QCDVDZIR.js";import{e as sn,f as ln}from"./c-FC5RUFPR.js";import"./c-4ASQPRQL.js";import"./c-GQ6F6IDK.js";import"./c-I2SCCUEW.js";import"./c-5VYOWDTI.js";import"./c-P73XPAOA.js";import"./c-ZPI7M5U5.js";import"./c-WYFDLITL.js";import"./c-UGHH4MB3.js";import"./c-MZCOGNZL.js";import"./c-EHAR4RJJ.js";import"./c-LD6UVV5R.js";import"./c-PGSBXHUE.js";import"./c-KU3PX7LL.js";import"./c-EQ5NBOGA.js";import"./c-IJUK2GPW.js";import"./c-C7SUMNMI.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-U4TWEIKZ.js";import"./c-UW6MMZ4V.js";import"./c-XQXZAO7N.js";import"./c-S7LK4KUE.js";import"./c-MOP5KBWZ.js";import"./c-2YYDMLNZ.js";import"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var Bt=new Set(["paragraph","heading","list_item","callout","quote","code_block","toggle"]),Ge=(e,o)=>ze(e)===ze(o);function zt(e,o){let t=o.createElement("article");return t.setAttribute("data-blockeditor",""),t.innerHTML=Sn([{id:e.id,t:"paragraph",c:e.c??"",...e.m?{m:e.m}:{}}],{clean:xn(o)}),t}function tr(e,o){let t=new Map(e.map((c,i)=>[c.id,i])),r=new Set(o.map(c=>c.id)),n=new Map,s=0;return o.map(c=>{let i=t.get(c.id);if(i!==void 0)return s=i+1,c;let a={c:c.c??"",m:c.m??null};for(let p=s;p<e.length;p++){let w=e[p];if(!(r.has(w.id)||w.t!==c.t||!Ge({c:w.c??"",m:w.m??null},a)))return r.add(w.id),s=p+1,n.set(c.id,w.id),{...c,id:w.id}}return c}).map(c=>n.has(c.parent)?{...c,parent:n.get(c.parent)}:c)}function Kt(e,o,t,{doc:r,merge3:n,mergeJson:s}){let l=[],c=tr(e,t),i=new Map(e.map(u=>[u.id,u])),a=new Map(o.map(u=>[u.id,u])),p=new Map(c.map(u=>[u.id,u])),w=o.map(u=>({...u})),x=c.map(u=>({...u})),h=new Map(w.map(u=>[u.id,u])),y=new Map(x.map(u=>[u.id,u]));for(let[u,C]of i){let f=a.get(u),k=p.get(u);if(!f||!k||!Bt.has(C.t)||!Bt.has(f.t)||!Bt.has(k.t))continue;let A={c:C.c??"",m:C.m??null},D={c:f.c??"",m:f.m??null},W={c:k.c??"",m:k.m??null};if(Ge(D,A)||Ge(W,A)||Ge(D,W))continue;if(C.t==="code_block"){for(let $ of[h.get(u),y.get(u)])$.c=k.c??"",k.m?$.m=k.m:delete $.m;l.push({id:u,kind:"text",local:f.c??"",remote:k.c??""});continue}let j=n(zt(C,r),zt(f,r),zt(k,r));for(let $ of j.conflicts)l.push({id:u,kind:"text",local:$.local?.textContent??null,remote:$.remote?.textContent??null});let[X]=lt(j.root,{seed:"",known:new Map});for(let $ of[h.get(u),y.get(u)])$.c=X.c,X.m?$.m=X.m:delete $.m}let v=o.map(u=>u.id);for(let[u,C]of i){let f=h.get(u);if(!f||p.has(u)||Ge(a.get(u),C))continue;let k=v.indexOf(u)-1;for(;k>=0&&!y.has(v[k]);)k--;let A=k<0?0:x.findIndex(D=>D.id===v[k])+1;x.splice(A,0,{...f}),y.set(u,x[A]),l.push({id:u,kind:"kept-edit"})}let _=s(e,w,x,{onConflict:u=>l.push({kind:"field",path:u.path,local:u.local,remote:u.remote,resolved:u.resolved})}),N=new Set(_.map(u=>u.id)),m=u=>(a.get(u)??i.get(u)??p.get(u))?.parent??null,O=_.map(u=>{let C=u.parent??null;for(;C&&!N.has(C);)C=m(C);return C===(u.parent??null)?u:{...u,parent:C}}),Y=new Map(O.map(u=>[u.id,u.parent??null])),I=u=>{let C=new Set([u]);for(let f=Y.get(u);f;f=Y.get(f)){if(C.has(f))return!0;C.add(f)}return!1};for(let u of O)if(I(u.id)){for(let C of[a.get(u.id)?.parent,i.get(u.id)?.parent,null])if(Y.set(u.id,C&&N.has(C)?C:null),!I(u.id))break}return{items:O.map(u=>(u.parent??null)===Y.get(u.id)?u:{...u,parent:Y.get(u.id)}),conflicts:l}}var nr=e=>{try{return an(e)}catch{return null}},Fe={ok:!0,outcome:"unchanged"},Xe={ok:!1,outcome:"disposed",reason:"adoption-disposed"},Qe={ok:!1,outcome:"refused",reason:"adoption-refused"},or={ok:!1,outcome:"refused",reason:"adoption-timeout"},rr={ok:!1,outcome:"error",reason:"adoption-error"},sr={ok:!0,outcome:"writer-adopts"},io=e=>({ok:!0,outcome:"adopted",counts:e}),lo=1e4;function ir(e){let o=e.querySelector($t);return o?{article:o.cloneNode(!0),tags:no(e).map(t=>nr(t.textContent))}:null}function co(e){return new Promise(o=>{if(!e.composing)return o();e.dom.addEventListener("compositionend",()=>setTimeout(()=>o(co(e)),0),{once:!0})})}function lr({view:e,source:o=null,ready:t=Promise.resolve(),isAdopter:r=()=>!0,idle:n=()=>co(e),requestCheckpoint:s=()=>{},notice:l=()=>{},snapshot:c=()=>null,mergeTagless:i=!1,seeded:a=!1,writerReady:p=()=>Promise.resolve(),adopted:w=()=>{},hold:x=sn,release:h=ln,holdMs:y=lo,doc:v=document}){let _=o?o.article.innerHTML:null,N=o?o.article:null,m=new Map,O=$=>{let R=$.getAttribute("data-rev");if(!R)return;let K=m.get(R)??[];m.delete(R),m.set(R,K),K.push($),K.length>10&&K.shift(),m.size>20&&m.delete(m.keys().next().value)};N&&O(N);let Y=Promise.resolve(),I=!1,E,u=new Promise($=>E=$);async function C(){let $,R=new Promise(K=>{$=setTimeout(()=>K("timeout"),y)});try{return await Promise.race([Promise.resolve(t).then(()=>n()).then(()=>"ready"),u.then(()=>"disposed"),R])}finally{clearTimeout($)}}function f($,R,K,L){let{HyperMorph:M}=cn(),q=Kt(K,R,L,{doc:v,merge3:M.merge3,mergeJson:M.mergeJson}),Q=q.conflicts.filter(J=>J.kind==="text"||J.kind==="field"),b=Q.length?c():null,d=eo($,q.items,R),S=d&&to(e.state,d);if(!S)return null;e.dispatch(S),e.dispatch(bn.closeHistory(e.state.tr));let F={edited:d.edited.size,created:d.created.size,deleted:d.deleted.length,moved:d.reordered},{displaced:B}=S.getMeta(Zn);return Object.keys(B).length&&(F.displaced=B),Q.length&&(F.conflicts=Q),b&&(F.copy=b),F}async function k($){if(i&&!$.tags.length)return A($);let R=Pt($.article,$.tags);if(R.kind==="unbased"&&console.warn("page: the article and its data changed together; kept the data"),R.kind!=="adopt")return Fe;if(!r())return sr;x();try{if(await wt(),I)return Xe;if(!r())return Qe;let K=await C();if(K==="timeout"&&console.warn("page: gave up waiting for the editor; the hand edit was not adopted"),K==="disposed"||I)return Xe;if(K!=="ready")return or;if(!r())return Qe;let L=Mt(e.state.doc),M=f(L,pt(L,v),R.baseItems,R.parsed);return M?(w(R.A),io(M)):Fe}finally{h()}}async function A($){let R=$.article.getAttribute("data-rev"),K=R&&m.get(R)||[],L=K.at(-1)??N;if(K.slice(0,-1).some(M=>M.innerHTML===$.article.innerHTML)||(O($.article),N=$.article,!L)||L.outerHTML===$.article.outerHTML)return Fe;x();try{if(await wt(),I)return Xe;if(!r())return Qe;if(await p(),I)return Xe;if(!r())return Qe;if(await C()==="disposed"||I)return Xe;if(!r())return Qe;let q=Mt(e.state.doc),Q=pt(q,v),b=new Map(Q.map(F=>[F.id,F])),d=F=>lt(F,{seed:F.getAttribute("data-rev")??"",known:b}),S=f(q,Q,d(L),d($.article));return S?io(S):Fe}finally{h()}}async function D($){try{return await k($)}catch(R){return console.error("page: adoption failed",R),rr}}let W=null;function j($,R=!1){return Y=Y.then(()=>D($)).then(K=>(R&&(W=K),!K.ok||K.outcome!=="adopted"||(s(),l(K.counts),v.dispatchEvent(new CustomEvent("clay:blockeditor-adopted",{detail:K.counts}))),K)),Y}function X($){let R=$.detail?.html;if(I||typeof R!="string")return;let K=ir(new DOMParser().parseFromString(R,"text/html"));!K||K.article.innerHTML===_||(_=K.article.innerHTML,j(K))}return v.addEventListener("clay:sync-applied",X),o&&!a&&j(o,!0),{idle:async()=>(await Y,W),saved($){if(!i||typeof $!="string")return;let R=new DOMParser().parseFromString($,"text/html").querySelector($t);R&&(O(R),N=R)},dispose(){I=!0,E(),v.removeEventListener("clay:sync-applied",X)}}}var ao='["text-delete",',fo=(e,o)=>o instanceof hn&&o._item&&o._item.parent===e.attrs&&typeof o._item.parentSub=="string"?o._item.parentSub:null,uo=e=>e==="t"||e==="parent",Jt=e=>e.content instanceof me&&e.content.embed.b!==void 0,cr=e=>e.content instanceof Be||e.content instanceof we||e.content instanceof me&&e.content.embed.b===void 0,po=e=>{let o=new Map;for(let t of e.stops)(o.get(t.client)??o.set(t.client,[]).get(t.client)).push(t);return o},ho=(e,o)=>{let t=o.get(e.id.client);if(!t)return!1;let r=e.id.clock,n=r+e.length;return t.some(s=>s.clock<n&&r<s.clock+s.len)},ar=(e,o)=>{for(let t=e.left;t;t=t.left){if(t.deleted){if(ho(t,o))return null;continue}if(Jt(t))return t}return null};function go(e,o,t){let r=po(t),n=new Set,s=new Set,l=o.changed.get(e.tableFields)??new Set;for(let[h,y]of o.changed){if(h===e.flow)continue;if(h===e.attrs){if(!o.local)return null;for(let _ of y){let N=e.attrs.get(_);if(!(N instanceof $e)||N._item.left||N._item.id.clock<(o.beforeState.get(N._item.id.client)??0))return null;s.add(_)}if(s.size>1)return null;continue}if(h===e.tableFields){for(let _ of y){let N=e.tableFields.has(_)?Dn(_,e.tableFields.get(_)):null;if(N===null)return null;n.add(N)}continue}let v=fo(e,h);if(v!==null){for(let _ of y)if(uo(_))return null;n.add(v);continue}if(h!==e.gone)return null;for(let _ of y)if(typeof _!="string"||!_.startsWith(ao))return null}let c=e.ydoc.store,i=null,a=null,p=!1,w=h=>{if(!(h instanceof Ee))return!1;if(h.parent===e.gone)return typeof h.parentSub=="string"&&h.parentSub.startsWith(ao);if(h.parent===e.tableFields)return l.has(h.parentSub);if(h.parent===e.attrs)return s.has(h.parentSub);if(h.parent!==e.flow){let v=fo(e,h.parent);return v!==null&&(s.has(v)||n.has(v)&&!uo(h.parentSub))}if(Jt(h)){if(h.deleted||!s.has(h.content.embed.b))return!1;a=h}else if(!cr(h))return!1;let y=ar(h,r);return!y||i&&y!==i?!1:(i=y,h.content instanceof we&&(p=!0),!0)};for(let[h,y]of o.afterState)for(let v=o.beforeState.get(h)??0;v<y;){let _=ge(c,{client:h,clock:v});if(!w(_))return null;v=_.id.clock+_.length}let x=!1;for(let[h,y]of o.deleteSet.clients)for(let{clock:v,len:_}of y)for(let N=v;N<v+_;){let m=ge(c,{client:h,clock:N});if(!w(m))return null;x=!0,N=m.id.clock+m.length}return s.size&&!a?null:i||n.size?{marker:i,split:a,deleted:x,formats:p,fields:n,remote:!o.local}:null}var fr=e=>{for(let o in e)return{...e};return null};function bo(e,o,t,r=null){let n=r?.formats??!0,s=r?.split??null,l=o.visible,c=-1,i=0;for(let f=0;f<l.length;f++){let k=l[f];if(k.brk&&k.brk.client===t.id.client&&k.brk.clock===t.id.clock){c=f;break}i+=k.len}if(c<0)return null;let a=l[c];if(a.implicit||a.atom||a.opaque||a.recovered||a.hide)return null;let p=a.runs.findIndex(f=>f.hole!==void 0);if(p>=0&&n||a.items&&o.copies.has(a.baseId))return null;let w=po(o),x={...a.fmtIn??{}},h=null,y={...a,runs:[],len:1};a.items&&(y.items=[]);let v=y,_=!1,N=je(o.holes,i),m=N+1;for(let f=t.right;f;f=f.right){if(f.deleted){if(ho(f,w))return null;continue}if(Jt(f)&&(f!==s||v!==y)){_=!0;break}let k=m;f.countable&&(m+=f.length);let A=f.content;if(f===s){let D=A.embed.b,W=e.attrs.get(D)?.get("t")||"paragraph";if(!Object.hasOwn(ue.nodes,W)||!ue.nodes[W].isTextblock)return null;let j=fr(x);y.fmtOut=j,v={kind:"b",id:D,baseId:D,brk:{client:f.id.client,clock:f.id.clock},implicit:!1,runs:[],len:1,atom:!1,items:null,fmtIn:j,fmtOut:null,t:W,opaque:!1},h=null;continue}if(A instanceof we){A.value===null?delete x[A.key]:x[A.key]=A.value,h=null;continue}if(A instanceof me){v.runs.push({br:!0}),v.items&&v.items.push({at:k,id:ne(f.id),client:f.id.client,clock:f.id.clock,length:f.length,kind:"br",text:null,blockId:null,raw:{...x}}),v.len+=1;continue}if(A instanceof Be){if(!h){let D=Tn(x,v.t);h={marks:D,mk:Cn(D)}}v.runs.push({text:A.str,marks:h.marks,mk:h.mk}),v.items&&v.items.push({at:k,id:ne(f.id),client:f.id.client,clock:f.id.clock,length:f.length,kind:"text",text:A.str,blockId:null,raw:{...x}}),v.len+=A.str.length}else if(f.countable)return null}let O=a.len;if(p<0){if(!xe(x,a.fmtOut??{}))return null}else{if(!_||v.t!==a.t)return null;O=1;for(let f=0;f<p;f++)O+=a.runs[f].br?1:a.runs[f].text.length}let Y=v===y?[y]:[y,v],I=Y.reduce((f,k)=>f+k.len,0)-O,E=N+O,u=f=>f.at>=E?{...f,at:f.at+I}:f;v.fmtOut=a.fmtOut,p>=0&&(v.runs=v.runs.concat(a.runs.slice(p)),v.len+=a.len-O,v.items&&(v.items=v.items.concat(a.items.filter(f=>f.at>=E).map(u))));let C={...o,visible:l.slice(),tokens:o.tokens+I};if(C.visible.splice(c,1,...Y),I){let f=i+O;C.holes=o.holes.map(k=>k.at>=f?{at:k.at+I,len:k.len}:k),C.hidden=o.hidden.map(k=>k.at>=E?{...k,at:k.at+I,items:k.items.map(u)}:k);for(let k=c+Y.length;k<C.visible.length;k+=1){let A=C.visible[k];A.items?.length&&(C.visible[k]={...A,items:A.items.map(u)})}}return C}var ur=e=>e.br?`
2
+ `:e.hole!==void 0?{hole:e.hole}:{text:e.text,mk:e.mk},dr=e=>{let o=[];for(let t of e.map(ur)){let r=o[o.length-1];r&&typeof r=="object"&&typeof t=="object"&&r.text!==void 0&&t.text!==void 0&&r.mk===t.mk?o[o.length-1]={text:r.text+t.text,mk:t.mk}:o.push(t)}return o},mo=(e,o)=>{let t=ge(e.ydoc.store,{client:o.client,clock:o.clock});return{client:t.id.client,clock:t.id.clock,len:t.length}},et=(e,o)=>dt({...o,copies:[...o.copies],fences:o.fences.map(t=>mo(e,t)),stops:o.stops.map(t=>mo(e,t)),visible:o.visible.map(t=>({...t,runs:dr(t.runs)}))});var ko=e=>e===!0?{}:e,yo=(e,o)=>xe(ko(e),ko(o));function xo(e,o,t,r){let n=e.attrs.get(o);n||(n=new $e,e.attrs.set(o,n));let s=ue.nodes[t];if(!s){n.get("t")!==t&&n.set("t",t);for(let[a,p]of Object.entries(r??{}))a==="t"||a==="pos"||xe(n.has(a)?n.get(a):void 0,p)||n.set(a,p);return}let l=t==="table"&&n.get("t")==="table"&&!Yt(o),c=t==="board"&&!Yt(o),i=l?jn(e.tableFields,o,Fn(e,o)):c?Tt(e.boardFields,o):null;n.get("t")!==t&&n.set("t",t);for(let a of Me(s)){if(l&&(a==="rows"||a==="cols")||c&&(a==="columns"||a==="cards"))continue;let p=n.has(a)?n.get(a):Je(s,a);xe(p,r[a])||n.set(a,r[a])}l&&Ct(e,o,i,r),c&&At(e,o,i,r)}function vo(e,o){let t=new Map,r=o;for(let n=e.flow._start;n&&r>0;n=n.right){if(n.deleted)continue;let s=n.content;s instanceof we?s.value===null?t.delete(s.key):t.set(s.key,s.value):n.countable&&(r-=n.length)}return t}function mr(e){let o=new Set;for(let[r,n]of e)Re(r)&&n&&o.add(r.split("!")[0]);let t=[];for(let[r,n]of e)!Re(r)&&n!==null&&n!==void 0&&!o.has(r)&&ue.marks[Ce(r)]&&t.push([r,n]);return t}function So(e){let o=new Set;for(let[r,n]of e)Re(r)&&n&&o.add(r.split("!")[0]);let t=[];for(let[r,n]of e)!Re(r)&&n!==null&&n!==void 0&&!o.has(r)&&!ue.marks[Ce(r)]&&t.push([r,n]);return t}function Oo(e,o={}){let t={},r=!1;for(let[n,s]of e)(Re(n)||ue.marks[Ce(n)])&&(t[n]=s);for(let[n,s]of So(e))r=!0,o[Ce(n)]!==void 0&&(t[n]=s);return{attrs:t,opaque:r}}function pr(e,o,t){let r=ye(e),n={},s=mr(o),l=new Set;for(let[i,a]of s){let p=Ce(i),w=t[p];w!==void 0&&yo(w,a)?l.add(p):n[`${i}!${r}`]=!0}for(let[i,a]of So(o)){let p=Ce(i);t[p]!==void 0&&yo(t[p],a)&&l.add(p)}for(let[i,a]of Object.entries(t))l.has(i)||(n[`${i}~${ye(e)}`]=a);let c=Oo(o,t);if(!(!Object.keys(n).length&&!c.opaque))return{...c.attrs,...n}}var Ht=2e3;function hr(e){let o=[],t=[],r=0;for(let n=0;n<e.length;n++)if(t.push(e[n]),r+=1,r>=Ht&&n+1<e.length){let s=e[n];if(s.k==="c"&&He(s.ch.charCodeAt(0)))continue;o.push(t),t=[],r=0}return t.length&&o.push(t),o}function ht(e,o,t,r=s=>s(),n=null){let s=o;for(let l of hr(t))r(()=>{s+=br(e,s,l,n)});return s-o}var gr=(e,o,t)=>{if(!t||!t.length)return null;let r=o,n=e.flow._start;for(;n&&r>0;){if(!n.deleted&&n.countable){if(r<n.length)return null;r-=n.length}n=n.right}for(;n&&(n.deleted||!n.countable);n=n.right)if(n.deleted&&t.some(s=>s.client===n.id.client&&s.clock>=n.id.clock&&s.clock<n.id.clock+n.length))return n;return null},Ie=(e,o,t,r)=>{let n=gr(e,o,t);if(!n)return r();n.deleted=!1;try{return r()}finally{n.deleted=!0,e.flow._searchMarker&&(e.flow._searchMarker.length=0)}};function br(e,o,t,r=null){let n=o,s="",l=null,c=null,i=()=>{if(!s)return;let p=pr(e,vo(e,n),c??{});Ie(e,n,r,()=>e.flow.insert(n,s,p)),n+=s.length,s=""},a=p=>{let w=Oo(vo(e,n)).attrs;Ie(e,n,r,()=>e.flow.insertEmbed(n,p,w)),n+=1};for(let p of t)p.k==="c"?(l!==null&&p.mk!==l&&i(),l=p.mk,c=p.ma,s+=p.ch):p.k==="h"?(i(),l=null,a({br:1})):(i(),l=null,a({b:p.id}),xo(e,p.id,p.t,p.attrs));return i(),n-o}var kr=(e,o,t,r)=>{let n=0;for(let s=e.flow._start;s&&n<r;s=s.right){if(s.deleted||!s.countable)continue;let l=n;if(n+=s.length,n<=t||s.content instanceof me&&s.content.embed?.b!==void 0)continue;let c=Math.max(0,t-l),i=Math.min(s.length,r-l);i<=c||e.gone.set(Jn(s.id.client,s.id.clock+c,o.operationId),{length:i-c,actor:e.ydoc.clientID,sv:o.sv})}};function wo(e,o,t,r=null){for(let n=t.length-1;n>=0;n--){let[s,l]=t[n];if(l<=s)continue;let c=o.physicalRanges(s,l);for(let i=c.length-1;i>=0;i--){let[a,p]=c[i];p<=a||(r&&kr(e,r,a,p),e.flow.delete(a,p-a))}}}function yr(e,o,t){let r=!1;for(let n=e.flow._start;n;n=n.right){let s=ne(n.id);if(s===o){r=!0;continue}if(!r)continue;let l=n.content instanceof me?n.content.embed:null;if(l&&l.b!==void 0&&l.b!==t)return s}return null}function Vt(e,o,t,r,n=null){let{pd:s,map:l,bt:c}=e,i=f=>n===null||n[f],a=0;for(;a<t.length&&a<r.length&&Ue(t[a],r[a])&&i(a);)a++;let p=0;for(;p<t.length-a&&p<r.length-a&&Ue(t[t.length-1-p],r[r.length-1-p])&&i(t.length-1-p);)p++;let w=f=>f&&f.k==="c"?f.ch.charCodeAt(0):-1;a>0&&He(w(t[a-1]))&&(ct(w(t[a]))||ct(w(r[a])))&&a--,p>0&&ct(w(t[t.length-p]))&&(He(w(t[t.length-p-1]))||He(w(r[r.length-p-1])))&&p--;let x=t.slice(a,t.length-p),h=r.slice(a,r.length-p),y=o+a,v=y+x.length,_=x.filter(f=>f.k==="b").map(f=>f.id).join(",");if(!(x.some(f=>f.k==="b")&&_===h.filter(f=>f.k==="b").map(f=>f.id).join(","))){let f=Ve(s.origins);try{for(let j of x){if(j.k!=="b"||!j.brk)continue;let X=f.resolve(j.brk);f.boundaryOf(X)||e.tx(()=>f.recordBoundary(X,{blockId:j.id,kind:"removed"}))}}finally{f.dispose()}let k=new Set;x.forEach((j,X)=>{if(j.k!=="b"||!j.brk)return;let $=y+X,R=$+1;for(;R<c.length&&c[R].k!=="b";)R++;let K=R<=v&&R!==$+1,L=R<c.length?c[R].brk:null;K&&(e.tx(()=>s.gone.set(We(ne(j.brk),e.operationId),{blockId:j.id,end:L?ne(L):null,sv:e.sv})),k.add($))});let A=[],D=y;for(let j=y;j<v;j++)k.has(j)&&(j>D&&A.push([D,j]),D=j+1);v>D&&A.push([D,v]),e.tx(()=>wo(s,l,A,x.some(j=>j.k==="b")?null:e));let W=new Set(h.filter(j=>j.k==="b").map(j=>j.id));for(let j of x)if(!(j.k!=="b"||!j.brk||W.has(j.id)))for(let X of e.copies.get(j.id)??[]){let $=We(X,e.operationId);s.gone.has($)||e.tx(()=>s.gone.set($,{blockId:j.id,end:yr(s,X,j.id),sv:e.sv}))}h.length&&ht(s,l.toPhysical(y,"before"),h,e.tx,e.fences);return}let m=[],O=[],Y=[],I=y,E=0,u=0;for(;E<x.length||u<h.length;){let f=E;for(;f<x.length&&x[f].k!=="b";)f++;let k=u;for(;k<h.length&&h[k].k!=="b";)k++;let A=x.slice(E,f),D=h.slice(u,k);if(A.length&&m.push([I,I+A.length]),D.length&&O.push({at:I,toks:D}),I+=A.length,f<x.length&&(Y.push([x[f],h[k]]),I+=1),E=f+(f<x.length?1:0),u=k+(k<h.length?1:0),f>=x.length&&k>=h.length)break}let C=[...m.map(f=>({at:f[0],d:f})),...O.map(f=>({at:f.at,i:f}))].sort((f,k)=>k.at-f.at||(f.d?-1:1));for(let f of C)f.d?e.tx(()=>wo(s,l,[f.d],e)):ht(s,l.toPhysical(f.at,"before"),f.i.toks,e.tx,e.fences);for(let[f,k]of Y)e.tx(()=>{if(!ue.nodes[k.t])return;let A=e.recovered.get(f.id);if(A){f.t!==k.t&&s.gone.set(qe(A,"t"),k.t);for(let j of Me(ue.nodes[k.t]))xe(f.attrs[j],k.attrs[j])||s.gone.set(qe(A,j),k.attrs[j]);return}let D=f.id,W=s.attrs.get(D);if(W){let j=f.t==="table"&&k.t==="table"&&W.get("t")==="table",X=k.t==="board",$=X?f.t==="board"&&W.get("t")==="board"?f.attrs:Tt(s.boardFields,D):null;f.t!==k.t&&W.set("t",k.t);for(let R of Me(ue.nodes[k.t])){if(j&&(R==="rows"||R==="cols")||X&&(R==="columns"||R==="cards"))continue;let K=W.has(R)?W.get(R):Je(ue.nodes[k.t],R);xe(K,k.attrs[R])||W.set(R,k.attrs[R])}j&&Ct(s,D,f.attrs,k.attrs),X&&At(s,D,$,k.attrs)}else xo(s,D,k.t,k.attrs)})}function Wt(e,o,t,r,n,s){let{pd:l,map:c}=e,i=`${r}~${ye(l)}`,a=ye(l),p=o;for(;p<t;){if(s[p].k!=="c"){p++;continue}let w=p;for(;w<t&&s[w].k==="c";)w++;let x=c.physicalRanges(p,w);if(n!==null)for(let[h,y]of x)l.flow.format(h,y-h,{[i]:n});else{let h=0;for(let y of l.flow.toDelta()){let v=typeof y.insert=="string"?y.insert.length:1;for(let[_,N]of x){if(h>=N)break;let m=Math.max(h,_),O=Math.min(h+v,N);if(O>m&&y.attributes){let Y={};for(let[I,E]of Object.entries(y.attributes))Ce(I)===r&&!Re(I)&&E!==null&&(Y[`${I}!${a}`]=!0);Object.keys(Y).length&&l.flow.format(m,O-m,Y)}}h+=v}}p=w}}var{AddMarkStep:Eo,RemoveMarkStep:vr,AttrStep:wr,ReplaceStep:xr,Mapping:gt}=gn,Mo=(e,o,t)=>{let r=e.resolve(o),n=e.resolve(t);return[r.depth&&r.node(1).type.name==="table"?r.before(1):o,n.depth&&n.node(1).type.name==="table"?n.after(1):t]},Sr=(e,o,t)=>{let r=!1;return e.nodesBetween(o,t,n=>(n.type.name==="table"&&(r=!0),!r&&n.type.name!=="table")),r};function Io(e,o,t,r,n=null,s=!0,l=null,{join:c=!1,open:i=!1}={}){let a=()=>{if(l){let d=l;l=null,d()}},p=[],w=[],x=[];for(let d of o)d.steps.forEach((S,F)=>{p.push(S),w.push(d.docs[F]),x.push(S.getMap())});if(!p.length)return;let h=new gt(x),y=[...st(it(e.ydoc)).entries()].sort((d,S)=>d[0]-S[0]),v=ye(e),_=w[0],N=o[o.length-1].doc,m=t.visible.length===0&&_.childCount===1&&_.firstChild.type.name==="paragraph"?[{id:_.firstChild.attrs.id,implicit:!0,t:"paragraph",len:0}]:t.visible,O=new Map,Y=[];{let d=0;m.forEach(S=>{S.implicit&&Y.push({tok:d,id:S.id,t:S.t}),d+=S.len})}Y.sort((d,S)=>S.tok-d.tok);for(let d of Y)d.alias=Mn(e),O.set(d.id,d.alias);let I=O.size?t.holes.map(d=>({at:d.at+Y.filter(S=>S.tok<d.at).length,len:d.len})):t.holes,E=Ft(t.tokens+O.size,I,e.flow.length+O.size),u=[],C=[];p.forEach((d,S)=>{let F=d instanceof Eo||d instanceof vr;if(F&&!Sr(w[S],d.from,d.to)){C.push({i:S,step:d});return}let B=new gt(x.slice(0,S)).invert(),J=new gt(x.slice(S+1)),U=[];d instanceof wr?U.push([d.pos,d.pos+1,d.pos,d.pos+1]):F?U.push([d.from,d.to,d.from,d.to]):d.getMap().forEach((P,oe,ee,te)=>U.push([P,oe,ee,te]));for(let[P,oe,ee,te]of U){let[Z,ie]=Mo(_,B.map(P,-1),B.map(oe,1)),[re,ot]=Mo(N,J.map(ee,-1),J.map(te,1));u.push({oa:Z,ob:ie,na:re,nb:ot})}}),u.sort((d,S)=>d.oa-S.oa||d.na-S.na);let f=[];for(let d of u){let S=f[f.length-1];S&&(d.oa<=S.ob||d.na<=S.nb)?(S.ob=Math.max(S.ob,d.ob),S.nb=Math.max(S.nb,d.nb)):f.push({...d})}let k=!Y.length&&!C.length&&p.every(d=>d instanceof xr)&&o.every(wn),A=k?null:Dt(_,O,m),D=k?null:Dt(N,O,m),W=k?[]:_t(_,O,m),j=k?[]:_t(N,O,m),X=k?f.map(d=>({r:d,old:jt(_,d.oa,d.ob),next:jt(N,d.na,d.nb)})):null,$=k?X.reduce((d,S)=>d+S.next.end-S.next.start,0):f.reduce((d,S)=>d+(D[S.nb]-D[S.na]),0),R=$>Ht,K=R?d=>e.ydoc.transact(S=>{S.meta.set(Ke,s),a(),d()},be):d=>d(),L={pd:e,map:E,bt:W,tx:K,copies:t.copies,fences:t.fences,sv:y,operationId:v,recovered:new Map(t.visible.filter(d=>d.recovered).map(d=>[d.id,d.sourceKey]))},M=d=>d.filter(S=>S.k==="b").map(S=>`${S.id}|${S.t}|${JSON.stringify(S.attrs)}`).join(`
3
+ `),q=!k&&(C.length>0||M(W)!==M(j)),Q=()=>{for(let F of Y)ht(e,je(t.holes,F.tok),[{k:"b",id:F.alias,t:F.t,attrs:Object.fromEntries(Me(ue.nodes[F.t]).map(B=>[B,Je(ue.nodes[F.t],B)]))}],K);for(let F=f.length-1;F>=0;F--)if(k){let{r:B,old:J,next:U}=X[F],P=J.tokens.map((oe,ee)=>{let te=h.mapResult(B.oa+ee,1),Z=h.mapResult(B.oa+ee+1,-1),ie=te.pos-B.na;return!te.deleted&&!Z.deleted&&Z.pos===te.pos+1&&ie>=0&&ie<U.tokens.length&&Ue(oe,U.tokens[ie])});Vt(L,J.start,J.tokens,U.tokens,P)}else{let B=f[F],J=A[B.oa],U=A[B.ob];Vt(L,J,W.slice(J,U),j.slice(D[B.na],D[B.nb]))}let d=C.length?de(e):null,S=d?{...L,map:Ft(d.tokens,d.holes,e.flow.length)}:null;for(let{i:F,step:B}of C){let J=new gt(x.slice(F+1)),U=D[J.map(B.from,1)],P=D[J.map(B.to,-1)];if(P<=U)continue;let oe=B.mark.type.name,ee=B instanceof Eo?B.mark.attrs&&Object.keys(B.mark.attrs).length?{...B.mark.attrs}:!0:null;if(kn(B.mark)){if(ee===null)continue;let te=yn(B.mark.attrs.entries);K(()=>{for(let[Z,ie]of Object.entries(te))Wt(S,U,P,Z,ie,j)});continue}K(()=>Wt(S,U,P,oe,ee,j))}};c||n?.stopCapturing();let b=n?.captureTimeout;n&&(n.captureTimeout=1/0);try{R?Q():e.ydoc.transact(d=>{d.meta.set(Ke,s),a(),Q()},be)}finally{n&&(n.captureTimeout=b),i||n?.stopCapturing()}r.groups++,r.lastGroup={chunked:R,structural:q,regional:k,span:$}}var ve=e=>({status:"refused",code:e}),kt=e=>{if(!e)return"";let o=[];for(let t of Object.keys(e).sort())o.push(`${t}=${JSON.stringify(e[t])}`);return o.join(`
4
+ `)},Or=(e,o,t)=>{let r=t?t.state.doc:null,s=r&&r.childCount===o.visible.length&&o.visible.every((c,i)=>r.child(i).attrs.id===c.id)?r:De(e,o),l=[];return s.forEach(c=>{c.attrs.id===null||c.attrs.id===void 0||l.push({id:c.attrs.id,parent:c.attrs.parent??null,t:c.type.name})}),l},Er=(e,o)=>{let t=[],r=e.get(o)?.parent??null,n=0;for(;r!=null&&n++<=e.size;)t.push(r),r=e.get(r)?.parent??null;return t},Ro=(e,o,t)=>Er(e,t).includes(o),qt=(e,o,t)=>o===t||Ro(e,t,o),Ut=(e,o,t,r,n)=>{if(o?.recovered){let l=qe(o.sourceKey,r);(e.gone.has(l)?e.gone.get(l):o.fields?.[r]??null)!==n&&e.gone.set(l,n);return}let s=e.attrs.get(t);s||(s=new $e,e.attrs.set(t,s)),s.get(r)!==n&&s.set(r,n)},bt=(e,o,t,r)=>Ut(e,o,t,"parent",r),Mr=8,Co={indent:(e,o)=>o.t==="list_item"&&Number.isInteger(e)&&e>=0&&e<=Mr,open:(e,o)=>o.t==="toggle"&&typeof e=="boolean",parent:(e,o,t)=>e===null||typeof e=="string"&&t.get(e)?.t==="toggle"&&!qt(t,e,o.id)},Ir=(e,o)=>{if(e?.attrs===void 0)return[];if(!e.attrs||typeof e.attrs!="object"||Array.isArray(e.attrs))return null;let t=[];for(let[r,n]of Object.entries(e.attrs)){let s=o.get(r);if(!s||!n||typeof n!="object"||Array.isArray(n))return null;for(let[l,c]of Object.entries(n)){if(!Co[l]||!Co[l](c,s,o))return null;t.push({id:r,field:l,value:c})}}return t},Cr=(e,o)=>{let t=_e(e.flow,0,e.flow.length),r=[],n=0;for(let s of e.flow.toDelta()){let l=s.attributes;if(typeof s.insert=="string")for(let c=0;c<s.insert.length;c++)r.push({ch:s.insert[c],attrs:l,source:o.resolve(t[n++])});else r.push({embed:s.insert,attrs:l,source:o.resolve(t[n++])})}if(n!==t.length)throw new Error(`The flow delta has ${n} units but the document has ${t.length}`);return r},Tr=(e,o,t)=>{let r=new Map;for(let s of o.visible)t.has(s.id)&&s.brk&&r.set(Te(s.brk),s.id);for(let s of t)for(let l of o.copies.get(s)??[])r.set(l,s);let n=[];for(let s=e.flow._start;s;s=s.right){if(s.deleted||!(s.content instanceof me))continue;let l=s.content.embed?.b;if(l===void 0||r.get(Te(s.id))!==l)continue;let c=null;for(let i=s.right;i;i=i.right){if(i.deleted||!(i.content instanceof me))continue;let a=i.content.embed?.b;if(!(a===void 0||a===l)){c=Te(i.id);break}}n.push({key:Te(s.id),blockId:l,end:c})}return n};function Gt({pd:e,view:o,um:t,origins:r,render:n,walked:s=null},l={}){let c=Array.isArray(l?.ids)?[...new Set(l.ids)]:[],i=l?.afterId===void 0?null:l.afterId,a=l?.parent!==void 0,p=s??de(e,r),w=new Set(p.visible.filter(b=>b.opaque).map(b=>b.id)),x=Or(e,p,o),h=new Map(x.map(b=>[b.id,b])),y=x.map(b=>b.id);if(!c.length)return ve("missing-source");for(let b of c)if(!h.has(b))return ve("missing-source");let v=Ir(l,h);if(!v)return ve("invalid-attrs");let _=v.filter(b=>b.field==="parent"),N=new Set(c.filter(b=>!c.some(d=>d!==b&&Ro(h,d,b)))),m=x.filter(b=>c.some(d=>qt(h,b.id,d))),O=new Set(m.map(b=>b.id));if(m.some(b=>w.has(b.id))||v.some(b=>w.has(b.id)))return ve("unsupported-format");let Y=new Map(p.visible.map(b=>[b.id,b]));for(let b of m){let d=Y.get(b.id);if(!d||d.implicit||!d.brk)return ve("missing-source")}let I;if(a)I=l.parent??null;else{let b=new Set(m.filter(d=>N.has(d.id)).map(d=>d.parent));if(b.size!==1)return ve("invalid-parent");I=[...b][0]}if(a&&I!==null){let b=h.get(I);if(!b||b.t!=="toggle")return ve("invalid-parent");if(O.has(I))return ve("cycle")}if(i!==null){if(typeof i!="string"||!h.has(i))return ve("missing-destination");if(O.has(i))return ve("cycle");if(h.get(i).parent!==I)return ve("missing-destination")}let E=x.filter(b=>!O.has(b.id)),u=0;if(i===null){if(I!==null){let b=E.findIndex(S=>S.parent===I),d=E.findIndex(S=>S.id===I);u=b>=0?b:d<0?0:d+1}}else for(u=E.findIndex(b=>b.id===i)+1;u<E.length&&qt(h,E[u].id,i);)u++;let C=[...E.slice(0,u),...m,...E.slice(u)],f=C.length===y.length&&C.every((b,d)=>b.id===y[d]),k=m.filter(b=>N.has(b.id)&&b.parent!==I),A=m.map(b=>b.id);if(f&&!k.length&&!v.length)return{status:"unchanged"};let D=(()=>{let b=o?.state.selection;if(!(b instanceof pe.TextSelection))return null;let d=B=>{let J=o.state.doc.resolve(B);return J.depth?{id:J.node(1).attrs.id,offset:J.parentOffset}:null},S=d(b.anchor),F=d(b.head);return S&&F&&(O.has(S.id)||O.has(F.id))?{anchor:S,head:F}:null})(),W=()=>{if(!D||!o)return;let b=({id:F,offset:B})=>{let J=null;return o.state.doc.forEach((U,P)=>{J===null&&U.attrs.id===F&&(J=P+1+Math.min(B,U.content.size))}),J},d=b(D.anchor),S=b(D.head);d!==null&&S!==null&&o.dispatch(o.state.tr.setSelection(pe.TextSelection.create(o.state.doc,d,S)).setMeta(Ye,!0).setMeta("addToHistory",!1))};if(f)return t?.stopCapturing(),e.ydoc.transact(()=>{if(_.length)for(let b of _)bt(e,Y.get(b.id),b.id,b.value);else for(let b of k)bt(e,Y.get(b.id),b.id,I);for(let b of v)b.field!=="parent"&&Ut(e,Y.get(b.id),b.id,b.field,b.value)},be),t?.stopCapturing(),n(),W(),{status:"moved",ids:A};let j=[...st(it(e.ydoc)).entries()].sort((b,d)=>b[0]-d[0]),X=ye(e),$=Cr(e,r),R=at(p,e.flow.length),K=[],L=0;for(let b of p.visible){if(O.has(b.id)){let d=[];for(let[S,F]of R.physicalRanges(L,L+b.len))for(let B=S;B<F;B++)d.push($[B]);K.push({seg:b,units:d})}L+=b.len}for(let b=0;b<K.length;b++){let d=K[b];if(d.seg.id!==A[b])throw new Error(`Captured ${d.seg.id} where ${A[b]} was expected`);if(!d.units.length||d.units[0].embed===void 0||d.units[0].embed.b!==d.seg.id)throw new Error(`The selected block ${d.seg.id} has no physical marker to copy`)}let M=Tr(e,p,O),q=Ae(e.gone),Q=new Map;for(let b of m){let d=Y.get(b.id);if(!d.recovered)continue;let S=p.removals.filter(J=>J.sourceKey===d.sourceKey),F=Vn(d.sourceKey,S,q),B=q.restores.find(J=>J.key===F?.key)?.baseline??{type:d.t,attrs:d.fields??{}};Q.set(d.sourceKey,{covers:S.map(J=>J.key),baseline:JSON.parse(JSON.stringify(B))})}if(!M.length)throw new Error("The selected blocks have no live physical markers to retire");return t?.stopCapturing(),e.ydoc.transact(()=>{for(let P of M)e.gone.set(We(P.key,X),{blockId:P.blockId,end:P.end,sv:j});let b=de(e,r),d=at(b,e.flow.length),S=b.visible.map(P=>P.id),F=0;if(u>0){let P=S.indexOf(E[u-1].id);F=P<0?0:P+1}let B=0;for(let P=0;P<F;P++)B+=b.visible[P].len;let J=d.toPhysical(B,"before"),U=[];for(let P of K){let oe=J,ee=null,te=null,Z=()=>{ee!==null&&(Ie(e,J,b.fences,()=>e.flow.insert(J,ee,te??void 0)),J+=ee.length,ee=null)};for(let re of P.units)re.ch!==void 0?(ee!==null&&kt(re.attrs)!==kt(te)&&Z(),ee===null&&(ee="",te=re.attrs),ee+=re.ch):(Z(),Ie(e,J,b.fences,()=>e.flow.insertEmbed(J,re.embed,re.attrs)),J+=1);Z();let ie=_e(e.flow,oe,J);if(ie.length!==P.units.length)throw new Error(`Copied ${P.seg.id} as ${ie.length} units instead of ${P.units.length}`);for(let re=1;re<P.units.length;re++)U.push({dest:ie[re],source:P.units[re].source});r.recordBoundary(ie[0],P.seg.recovered?{blockId:P.seg.id,kind:"copy",recoveryOf:P.seg.sourceKey}:{blockId:P.seg.id,kind:"copy"}),P.seg.recovered&&e.gone.set(ft(P.seg.sourceKey,X),Q.get(P.seg.sourceKey)),e.gone.set(Kn(Te(ie[0])),!0)}if(U.length&&r.recordSpans(U),_.length)for(let P of _)bt(e,Y.get(P.id),P.id,P.value);else for(let P of k)bt(e,Y.get(P.id),P.id,I);for(let P of v)P.field!=="parent"&&Ut(e,Y.get(P.id),P.id,P.field,P.value)},be),t?.stopCapturing(),n(),W(),{status:"moved",ids:A}}var Po="blockeditor-move-carry",To=`["${Nn}",`,Ar=`["${Ln}",`,Yr=`["${Bn}",`,$o=(e,o)=>{let t=ut(o);if(!t)return null;let r=null;try{r=ge(e.ydoc.store,t)}catch{return null}return r instanceof Ee&&!r.deleted&&r.parent===e.flow?r:null},Rr=(e,o,t,r,n)=>{let s=0,l=null;for(let a of t.visible){if(a.id===n){l=a;break}s+=a.len}if(!l||l.implicit||l.atom||l.opaque||!l.brk)return null;let c=new Map,i=null;for(let[a,p]of r.physicalRanges(s,s+l.len)){let w=_e(e.flow,a,p);for(let x=0;x<w.length;x++)i===null?i=a:c.set(ne(o.resolve(w[x])),a+x)}return i===null?null:{head:i,places:c}},Pr=(e,o)=>{let t=new Map;for(let r=e.flow._start;r&&r!==o;r=r.right)r.deleted||!(r.content instanceof we)||(r.content.value===null?t.delete(r.content.key):t.set(r.content.key,r.content.value));return t},tt=e=>{let o=un();for(let{client:t,clock:r,len:n}of e)(o.clients.get(t)??o.clients.set(t,[]).get(t)).push({clock:r,len:n});return o},yt=e=>e.content instanceof me&&e.content.embed?.b!==void 0,$r=(e,o,t)=>{let r=[],n=t,s=null;for(;;){let l=o.get(n);if(l!==void 0){s=l;break}r.push(n);let c=null;if(n.origin)try{c=ge(e.ydoc.store,n.origin)}catch{c=null}if(!(c instanceof Ee))break;if(yt(c)){s=c;break}n=c}for(let l of r)o.set(l,s);return s};function _r({pd:e,origins:o,walked:t,placed:r},n,s,l=null,c=!1){let i=t.hidden.filter(m=>n.has(m.key));if(!i.length)return!1;let a=e.ydoc.clientID,p=l!==null||c?Ae(e.gone).textDeletes.filter(m=>m.actor!==a):[],w=new Map,x=new Set,h=[],y=new Map,v=null,_=null;for(let m of i){let O=n.get(m.key),{left:Y,past:I}=O,E=$o(e,m.sourceKey);if(!E)continue;let u=new Map(m.items.map(M=>[M.id,M])),C=[];for(let M=E.right;M&&!(M.countable&&!M.deleted&&!u.has(ne(M.id)));M=M.right)C.push(M);let f=new Set(O.copy?C.filter(M=>!M.deleted&&M.countable&&!yt(M)&&!Y.has(`${ne(M.id)}+${M.length}`)&&$r(e,s,M)===E):[]),k=p.filter(M=>C.some(q=>q.deleted&&q.countable&&q.id.client===M.client&&M.clock<q.id.clock+q.length&&q.id.clock<M.clock+M.length));if(!f.size&&!k.length)continue;let A=O.seen??new Map(m.sv),D=(M,q)=>q>=(A.get(M)??0),W=f.size?Pr(e,E):null,j=null,X=[],$=new Map;for(let M of C){if(!M.countable){W&&M.content instanceof we&&(!M.deleted||xt(I,M.id))&&(M.content.value===null?W.delete(M.content.key):W.set(M.content.key,M.content.value),j=null);continue}let q=M.deleted?null:u.get(ne(M.id)),Q=f.has(M);for(let b=0;b<M.length;b++){let d={client:M.id.client,clock:M.id.clock+b},S=o.resolve(d),F=ne(S);M.deleted&&k.length&&An(k,a,d)?!$.has(F)&&(!O.alive||D(d.client,d.clock)||O.alive.has(ne(d)))&&$.set(F,!1):$.set(F,!0),X.push({it:M,item:q,offset:b,id:d,source:S,key:F,attrs:Q?j??=Object.fromEntries(W):null})}}_??=at(t,e.flow.length);let R=Rr(e,o,t,_,m.blockId);if(!R){for(let M of f)Y.add(`${ne(M.id)}+${M.length}`);continue}if(k.length)for(let[M,q]of R.places)$.get(M)===!1&&!w.has(q)&&w.set(q,null);let K=new Map,L=R.head+1;for(let M of X){let{it:q,item:Q,offset:b,id:d,source:S}=M;if(M.attrs){if(!x.has(ne(d))&&!(v??=Wn(e.flow,t,o))(S.client,S.clock)){x.add(ne(d)),w.set(Q.at+b,O),O.step&&!y.has(O)&&y.set(O,{deleted:[],inserted:[]}),(K.get(L)??K.set(L,[]).get(L)).push(Q.kind==="text"?{ch:q.content.str[b],attrs:M.attrs,source:S}:{embed:q.content.embed,attrs:M.attrs,source:S});continue}Y.add(`${ne(q.id)}+${q.length}`)}let F=R.places.get(M.key);F!==void 0&&(L=F+1)}for(let[M,q]of K)h.push({at:M,units:q,owner:O})}if(!w.size&&!h.length)return!1;let N=[...[...w].map(([m,O])=>({at:m,owner:O})),...h].sort((m,O)=>O.at-m.at||(m.units?1:0)-(O.units?1:0));e.ydoc.transact(m=>{let O=null,Y=()=>{if(!O)return;let I=y.get(O.owner),E=I?new Map([...m.deleteSet.clients].map(([u,C])=>[u,C.length])):null;if(e.flow.delete(O.from,O.to-O.from),I)for(let[u,C]of m.deleteSet.clients)for(let{clock:f,len:k}of C.slice(E.get(u)??0)){let A=ge(e.ydoc.store,{client:u,clock:f});A instanceof Ee&&(A.keep=!0),I.deleted.push({client:u,clock:f,len:k})}O=null};for(let I of N){if(!I.units){O&&I.at===O.from-1&&I.owner===O.owner?O.from=I.at:(Y(),O={from:I.at,to:I.at+1,owner:I.owner});continue}Y();let E=Ne(e.ydoc.store,a),u=I.at,C="",f=null,k=()=>{if(!C)return;let D=C;Ie(e,u,t.fences,()=>e.flow.insert(u,D,{...f})),u+=D.length,C=""};for(let D of I.units){if(D.ch===void 0){k(),Ie(e,u,t.fences,()=>e.flow.insertEmbed(u,{...D.embed},{...D.attrs})),u+=1;continue}C&&kt(D.attrs)!==kt(f)&&k(),f=D.attrs,C+=D.ch}k(),y.get(I.owner)?.inserted.push({client:a,clock:E,len:Ne(e.ydoc.store,a)-E});let A=_e(e.flow,I.at,u);if(A.length!==I.units.length)throw new Error(`Carried ${A.length} units instead of ${I.units.length}`);o.recordSpans(A.map((D,W)=>({dest:D,source:I.units[W].source}))),r.push({ids:A,step:I.owner.step})}Y()},Po);for(let[{step:m},O]of y)m.deletions=Le([m.deletions,tt(O.deleted)]),m.insertions=Le([m.insertions,tt(O.inserted)]);return!0}var Ao=(e,o,t)=>{for(let[r,n]of o.clients)for(let{clock:s,len:l}of n)for(let c=s;c<s+l;){let i=null;try{i=ge(e.ydoc.store,{client:r,clock:c})}catch{break}let a=Math.min(s+l,i.id.clock+i.length);if(i instanceof Ee&&i.parent===e.flow&&i.countable)for(let p=c;p<a;p++)t(i,{client:r,clock:p});c=a}},Dr=(e,o)=>e.some(t=>t.client===o.client&&o.clock>=t.clock&&o.clock<t.clock+t.length),_o=(e,o)=>{try{return ge(e.ydoc.store,o).deleted}catch{return!0}},jr=(e,o,t)=>{let r=[];if(Ao(e,t.insertions,(i,a)=>{i.deleted&&r.push(a)}),!r.length)return;let n=Ae(e.gone).textDeletes,s=new Map;for(let i of r){let a=o.resolve(i),p=s.get(ne(a))??s.set(ne(a),{source:a,follow:!1,redo:[]}).get(ne(a));!p.follow&&!Dr(n,i)&&_o(e,a)&&(p.follow=!0)}Ao(e,t.deletions,(i,a)=>s.get(ne(o.resolve(a)))?.redo.push(a));let l=new Map;for(let i of s.values())!i.follow&&!i.redo.length||(i.lives=[],(l.get(i.source.client)??l.set(i.source.client,[]).get(i.source.client)).push(i));if(!l.size)return;for(let i=e.flow._start;i;i=i.right){if(i.deleted||!i.countable)continue;let a=i.id.clock;for(let p of o.resolveRange(i.id.client,i.id.clock,i.length)){for(let w of l.get(p.client)??[]){let x=w.source.clock-p.clock;x>=0&&x<p.length&&w.lives.push({client:i.id.client,clock:a+x,len:1})}a+=p.length}}let c=[];for(let i of l.values())for(let a of i)if(a.follow&&c.push(...a.lives),!a.lives.length)for(let p of a.redo)c.push({client:p.client,clock:p.clock,len:1});c.length&&(t.insertions=Le([t.insertions,tt(c)]))},Yo=(e,o)=>o!==null&&e.id.client===o.client&&o.clock>=e.id.clock&&o.clock<e.id.clock+e.length,Fr=(e,o)=>{let t;try{t=ge(e.ydoc.store,o[0])}catch{return null}if(t.id.clock!==o[0].clock||!t.origin)return null;let r=[t],n=null;for(let s=t.left;s&&!Yo(s,t.origin);s=s.left)yt(s)&&s.id.client!==e.ydoc.clientID&&!r.some(l=>Yo(l,s.rightOrigin))&&(n=s),r.push(s);return n},Lr=(e,o,t,r)=>{let n=[],s=[];for(let c of r){let i=c.ids.filter(p=>!_o(e,p));if(!i.length)continue;let a=Fr(e,c.ids);a?s.push({group:c,edge:a,live:new Set(i.map(ne))}):n.push(c)}if(!s.length)return r;let l=e.ydoc.clientID;return e.ydoc.transact(()=>{for(let{group:c,edge:i,live:a}of s){let p=new Map,w=[],x=0;for(let m=e.flow._start;m;m=m.right){if(m.content instanceof we){m.deleted||(m.content.value===null?p.delete(m.content.key):p.set(m.content.key,m.content.value));continue}if(!(m.deleted||!m.countable)){for(let O=0;O<m.length;O++){let Y={client:m.id.client,clock:m.id.clock+O};a.has(ne(Y))&&w.push({at:x+O,ch:m.content instanceof Be?m.content.str[O]:void 0,embed:m.content.embed,attrs:Object.fromEntries(p),source:o.resolve(Y)})}x+=m.length}}for(let m=w.length-1;m>=0;m--)e.flow.delete(w[m].at,1);let h=0;for(let m=e.flow._start;m&&m!==i;m=m.right)!m.deleted&&m.countable&&(h+=m.length);let y=h,v=Ne(e.ydoc.store,l),_=[...t.fences,i.id];for(let m of w)m.ch===void 0?Ie(e,h,_,()=>e.flow.insertEmbed(h,{...m.embed},{...m.attrs})):Ie(e,h,_,()=>e.flow.insert(h,m.ch,{...m.attrs})),h+=1;let N=_e(e.flow,y,h);if(N.length!==w.length)throw new Error(`Moved ${N.length} carried units instead of ${w.length}`);o.recordSpans(N.map((m,O)=>({dest:m,source:w[O].source}))),c.step&&(c.step.insertions=Le([c.step.insertions,tt([{client:l,clock:v,len:Ne(e.ydoc.store,l)-v}])])),n.push({ids:N,step:c.step})}},Po),n},Nr=(e,o)=>{let t=e.ydoc.store;for(let[r,n]of o.insertions.clients)for(let{clock:s,len:l}of n)for(let c=s;c<s+l;){let i;try{i=ge(t,{client:r,clock:c})}catch{break}let a=i;for(;a instanceof Ee&&a.redone;)try{a=ge(t,a.redone)}catch{break}if(a instanceof Ee&&!a.deleted)return!0;c=i.id.clock+i.length}for(let[r,n]of o.deletions.clients)for(let{clock:s}of n)if(!xt(o.insertions,{client:r,clock:s}))return!0;return!1},Br=(e,o)=>{let t=new Set;for(let r=$o(e,o)?.right??null;r;r=r.right)if(!(!r.countable||r.deleted)){if(yt(r))break;for(let n=0;n<r.length;n++)t.add(ne({client:r.id.client,clock:r.id.clock+n}))}return t};function Do({pd:e,origins:o,um:t,walked:r}){let n=new Map,s=new Map,l=new WeakMap,c=null,i=[],a=(p=null,w=!1)=>n.size>0&&_r({pd:e,origins:o,walked:r(),placed:i},n,l,p,w);return{note(p){let w=[...p.changed.get(e.gone)??[]].filter(y=>typeof y=="string");if(!w.some(y=>y.startsWith(To)))return;let x=new Set,h=tt([...p.deleteSet.clients].flatMap(([y,v])=>v.map(({clock:_,len:N})=>({client:y,clock:_,len:N}))));for(let y of w){let v=y.startsWith(To);if(!(!v&&!y.startsWith(Ar))){if(e.gone.has(y)===v){n.delete(y),v||s.set(y,{seen:p.afterState,alive:Br(e,JSON.parse(y)[1])});continue}x.add(y),n.set(y,{copy:v,left:new Set,past:h,seen:null,alive:null,step:null,...v?null:s.get(y)})}}x.size&&(c=x)},replay(p){let w=p==="undo"?t.undoStack:t.redoStack;for(let v=w.length-1;v>=0&&(jr(e,o,w[v]),!Nr(e,w[v]));v--);let x=p==="undo"?t.redoStack:t.undoStack,h=x.length;if(c=null,t[p]()===null)return!1;let y=c;if(c=null,y&&x.length>h)for(let v of y)n.get(v).step=x[x.length-1];return a(y),!0},received(p){if(!n.size&&!i.length)return;let w=!1,x=!1;for(let h of p)if(!h.local){w=!0;for(let y of h.changed.get(e.gone)??[])typeof y=="string"&&y.startsWith(Yr)&&(x=!0)}w&&(a(null,x),i.length&&(i=Lr(e,o,r(),i)))}}}var Xt=e=>{let o=[];return e.forEach(t=>o.push([t.type.name,JSON.stringify(Object.fromEntries(Me(t.type).map(r=>[r,t.attrs[r]]))),t.isTextblock||t.type.name==="table"?JSON.stringify(t.content.toJSON()):null])),JSON.stringify(o)};function zr(e,o){if(e.childCount!==o.childCount)return!1;for(let t=0;t<e.childCount;t++){let r=e.child(t),n=o.child(t);if(r!==n&&(r.type!==n.type||Me(r.type).some(s=>!xe(r.attrs[s],n.attrs[s]))||(r.isTextblock||r.type.name==="table")&&!r.content.eq(n.content)))return!1}return!0}var Kr=e=>{let o=[];return e.forEach((t,r)=>{t.type.name==="opaque_block"&&o.push([r,r+t.nodeSize])}),o},Jr=(e,o)=>{let t=typeof e.from=="number"?e.from:typeof e.pos=="number"?e.pos:null;if(t===null)return!1;let r=typeof e.to=="number"?e.to:t+1;return o.some(([n,s])=>t<s&&r>n)},nt=(e,o)=>{let t=e.resolve(o);return t.depth&&t.node(1).type.name==="table"?[t.before(1),t.after(1)]:null};function jo(e,o){let t=e.content.findDiffStart(o.content);if(t===null)return null;let{a:r,b:n}=e.content.findDiffEnd(o.content),s=t-Math.min(r,n);s>0&&(r+=s,n+=s);let l=(c,i)=>{let a=c.resolve(t);return a.parent.isTextblock&&a.sameParent(c.resolve(i))};return(nt(e,t)||nt(e,r))&&!(l(e,r)&&l(o,n))?(t=nt(e,t)?.[0]??t,r=nt(e,r)?.[1]??r,n=nt(o,n)?.[1]??n,{start:t,endA:r,endB:n,tables:!0}):{start:t,endA:r,endB:n}}function Qt(e,o=null){let t=new Map;o?.forEach(i=>{i.attrs.id&&t.set(i.attrs.id,i)});let r=[];e.forEach(i=>r.push(i));let n=r.map(i=>({id:i.attrs.id,pos:t.get(i.attrs.id)?.attrs.pos??i.attrs.pos})),s=It(n,"b"),l=!1,c=r.map((i,a)=>{let p=s[a]?.pos??n[a].pos,w=i.content;if(i.type.name==="table"){let y=[];i.forEach(m=>y.push(m));let v=y.map(m=>({id:m.attrs.id,pos:m.attrs.pos})),_=It(v,"r"),N=y.map((m,O)=>{let Y=_[O]?.pos??v[O].pos;return Y===m.attrs.pos?m:m.type.create({...m.attrs,pos:Y},m.content,m.marks)});N.some((m,O)=>m!==y[O])&&(w=N)}if(p===i.attrs.pos&&w===i.content)return i;l=!0;let x={...i.attrs,pos:p},h=t.get(i.attrs.id);return h&&w===i.content&&h.hasMarkup(i.type,x,i.marks)&&h.content.eq(w)?h:i.type.create(x,w,i.marks)});return l?e.type.create(e.attrs,c):e}var Fo=e=>{let o=new Set,t=null;for(let r=0;r<e.childCount;r++){let{id:n,pos:s}=e.child(r).attrs;if(!n||o.has(n)||!vn(s)||t!==null&&t>=s)return!1;o.add(n),t=s}return!0},Hr=(e,o)=>{for(let t in e.attrs)if(t!=="pos"&&e.attrs[t]!==o.attrs[t])return!1;return!0};function Vr(e,o){if(e.childCount!==o.childCount||!Fo(e))return!1;for(let t=0;t<e.childCount;t++){let r=e.child(t),n=o.child(t);if(r===n)continue;if(!(r.type===n.type&&r.marks===n.marks&&Hr(r,n))&&!r.hasMarkup(n.type,{...n.attrs,pos:r.attrs.pos},n.marks)||!r.content.eq(n.content)||r.type.name==="table"&&!Fo(r))return!1}return!0}var No=e=>{if(e&&typeof e=="object"){for(let o of Object.keys(e))No(e[o]);Object.freeze(e)}return e},Lo=e=>No(JSON.parse(JSON.stringify(e))),Wr=(e,o)=>{let t=En(o),r=0;for(let n=e.flow._start;n;n=n.right){if(n.id.client===t.client&&n.id.clock===t.clock)return n.deleted?r:r+n.length;!n.deleted&&n.countable&&(r+=n.length)}return r},qr=(e,o)=>{let t=null;for(let r=e.flow._start;r;r=r.right)r.id.client!==e.ydoc.clientID||!(r.content instanceof me)||r.content.embed?.b!==o||(!t||r.id.clock>t.clock)&&(t=r.id);return t};function Bo({pd:e,onNotice:o=()=>{},ownedTokens:t=[],authorToken:r=null,stats:n={groups:0,mismatch:0,renders:0,first:null},captureTimeout:s=500}){let l=null,c=null,i=0,a=-1,p=null,w=0,x=new WeakMap,h=Ve(e.origins);c=de(e,h);let y=new pn([e.flow,e.attrs,e.gone,e.tableFields,e.boardFields],{trackedOrigins:new Set([be]),captureTimeout:s,captureTransaction:g=>g.meta.get(Ke)!==!1,deleteFilter:g=>{if(g.parent!==e.flow||!(g.content instanceof me))return!0;let T=h.resolve(g.id);return T.client!==g.id.client||T.clock!==g.id.clock||h.boundaryOf(g.id)?.kind!=="copy"}}),v=Yn(e,y,h,g=>Ae(g).textDeletes),_=new Set,N=new Set(r?[...t,r]:t),m=r?()=>{let g=zn(e.ydoc.clientID);e.origins.get(g)!==r&&e.origins.set(g,r)}:null,O=new Set,Y=new Set,I=0,E=null,u=null,C=g=>{let T=new Set;for(let H of g.blocks)for(let G of H.runs){if(!G.displaced)continue;let V=ut(G.source)?.client===e.ydoc.clientID;G.author&&(V||N.has(G.author))?T.add(G.author):V&&T.add(null)}if(!T.size)return null;let z=[...T].filter(Boolean).sort();return{kind:"recovered-change",source:g.source,revision:g.revision,blockId:g.blockId,author:z[0]??null,authors:z}},f=g=>{let T=g.list.filter(H=>H.recoverable).map(H=>Lo(H)),z=Lo(T.map(H=>C(H)).filter(H=>H&&!O.has(`${H.source}\0${H.revision}`)));return Object.freeze({recoverable:Object.freeze(T),notices:Object.freeze(z)})},k=(g,T)=>{if(JSON.stringify(f(mt(e,{index:h,walked:T})))===JSON.stringify(g)){n.provedRecoveries=(n.provedRecoveries??0)+1;return}throw n.walkMismatch=(n.walkMismatch??0)+1,new Error("Recovery snapshot built from the displacing sources diverged from a full reduction")},A=()=>{if(E&&E.version===I)return E.snapshot;let g=a===i?c:void 0,T=f(qn(e,{index:h,walked:g}));return n.proveWalks&&k(T,g),E={version:I,snapshot:T},T},D=g=>dt({recoverable:g.recoverable.map(T=>[T.source,T.revision]),notices:g.notices}),W=()=>{I++;let g=A();for(let z of g.notices){let H=`${z.source}\0${z.revision}`;_.has(H)||(_.add(H),o(z))}if(!Y.size){u=null;return}let T=D(g);if(T!==u){u=T;for(let z of[...Y])z(g)}},j=g=>{c=g,a=i,p=null,w=0},X=()=>a===i?c:null,$=g=>{let T=et(e,g),z=et(e,de(e));if(T===z){n.provedWalks=(n.provedWalks??0)+1;return}throw n.walkMismatch=(n.walkMismatch??0)+1,new Error(`Incremental walk diverged from the full walk:
5
+ ${T}
6
+ ---
7
+ ${z}`)},R=g=>JSON.stringify([g.removals,g.restores,g.textDeletes,[...g.copyActive],[...g.attrs].map(([T,z])=>[T,[...z]])]),K=()=>{if(R(Ae(e.gone))===R(Ae(e.gone,{kept:!1}))){n.provedIntents=(n.provedIntents??0)+1;return}throw n.walkMismatch=(n.walkMismatch??0)+1,new Error("Removal records kept across writes diverged from a fresh parse of the gone map")},L=g=>{K();let T=Ve(e.origins),z;try{z=et(e,de(e,{resolve:T.resolve,boundaryOf:T.boundaryOf}))}finally{T.dispose()}let H=et(e,g);if(H===z){n.provedIndexWalks=(n.provedIndexWalks??0)+1;return}throw n.walkMismatch=(n.walkMismatch??0)+1,new Error(`A walk with the kept origin index diverged from one with a fresh index:
8
+ ${H}
9
+ ---
10
+ ${z}`)},M=()=>{if(JSON.stringify(f(mt(e,{index:h,walked:c})))!==JSON.stringify(A()))throw n.walkMismatch=(n.walkMismatch??0)+1,new Error("Recovery snapshot kept across an incremental walk diverged from a fresh one")},q=()=>{let g=w===1?p:null,T=g?g.marker?bo(e,c,g.marker,g):c:null;if(!T){let z=de(e,h);return n.proveWalks&&L(z),j(z),null}if(g.fields.size)for(let z of T.visible)g.fields.has(z.baseId)&&x.delete(z);return n.incrementalWalks=(n.incrementalWalks??0)+1,n.proveWalks&&$(T),j(T),g},Q=g=>{if(g.childCount===c.visible.length)for(let T=0;T<g.childCount;T++)x.has(c.visible[T])||x.set(c.visible[T],g.child(T))},b=(g,T)=>{if(g.childCount!==c.visible.length)return;let z=jo(g,T);if(!z)return;let H=g.resolve(z.start).index(0),G=Math.min(g.childCount-1,g.resolve(z.endA).index(0));for(let V=H;V<=G;V++)x.delete(c.visible[V])},d=()=>{let g=q();return!g||g.deleted||g.fields.size||g.remote&&c.hidden.length?W():n.proveWalks&&M(),De(e,c,x)},S=null,F=null,B=!1,J=!1,U=(g=!1,T=null)=>{n.renders++;let z=S;S=null;let H=Qt(T??d(),l.state.doc),G=jo(l.state.doc,H);if(!G){Q(l.state.doc);return}let V=l.state.tr.replace(G.start,G.endA,H.slice(G.start,G.endB)).setMeta(Ye,!0).setMeta("addToHistory",!1);if(g&&V.setMeta("yundo",!0),g&&l.state.doc.textContent!==H.textContent&&document.activeElement?.closest?.('[contenteditable]:not([contenteditable="false"])'))V.setSelection(pe.Selection.near(V.doc.resolve(Math.min(G.endB,V.doc.content.size)),-1));else if(z){let fe=ce=>ce>=0&&c.holes.some(ae=>ce>=oo(c.holes,ae.at)&&ce<je(c.holes,ae.at)),le=(ce,ae)=>{let Oe=null;return V.doc.forEach((Pe,rt)=>{Oe===null&&Pe.attrs.id===ce&&Pe.isTextblock&&(Oe=rt+1+Math.min(ae,Pe.content.size))}),Oe},se=ce=>{let ae=Ot(ce.right,e.ydoc);if(!ae)return null;let Oe=so(V.doc,c.holes,c.tokens,ae.index,c.visible);if(!ce.block)return Oe;let Pe=V.doc.resolve(Oe);if(Pe.depth&&Pe.node(1).attrs.id===ce.block.id)return Oe;let rt=ce.left?Ot(ce.left,e.ydoc):null;return!fe(ae.index)&&!(rt&&fe(rt.index-1))?Oe:le(ce.block.id,ce.block.offset)??Oe},he=se(z.anchor),ke=se(z.head);he!==null&&ke!==null&&V.setSelection(pe.TextSelection.create(V.doc,he,ke))}else if(G.tables&&l.state.selection instanceof pe.TextSelection){let fe=Lt(l.state.doc,l.state.selection.anchor),le=Lt(l.state.doc,l.state.selection.head),se=fe&&Nt(V.doc,fe),he=le&&Nt(V.doc,le);se!=null&&he!==null&&he!==void 0&&V.setSelection(pe.TextSelection.create(V.doc,se,he))}l.dispatch(V),Q(l.state.doc)},P=new WeakMap,oe=new WeakSet,ee=g=>{if(g.changed.size||g.deleteSet.clients.size)return!1;for(let[T,z]of g.afterState)if((g.beforeState.get(T)??0)!==z)return!1;return!0},te=g=>{P.set(g,i),i++},Z=Do({pd:e,origins:h,um:y,walked:()=>X()??de(e,h)}),ie=g=>{if(ee(g)){oe.add(g),a===P.get(g)&&i===a+1&&(a=i);return}g.origin===y&&Z.note(g),w++,p=w===1?go(e,g,c):null},re=g=>{if(B&&!J&&g.origin===be&&(y.stopCapturing(),B=!1),!l||g.origin===be||g.origin===y||S)return;let T=l.state.selection;if(!(T instanceof pe.TextSelection)||[T.$anchor,T.$head].some(H=>H.depth&&H.node(1).type.name==="table"))return;let z=H=>{let G=ro(l.state.doc,c.holes,H.pos,c.visible);return{right:St(e.flow,G),left:G>0?St(e.flow,G,-1):null,block:H.depth?{id:H.node(1).attrs.id,offset:H.parentOffset}:null}};S={anchor:z(T.$anchor),head:z(T.$head)}},ot=g=>{g.origin!==be&&!ee(g)&&(F=null,B=!1)},tn=(g,T)=>{let z=!1,H=!1,G=!1;for(let V of T)oe.has(V)||(z=!0,V.origin===be?H=!0:V.origin===y&&(G=!0));if(!z){S=null;return}if(!l){W(),Z.received(T);return}if(H){S=null;return}U(G),Z.received(T)},Ko=(g,T)=>{let z=Gt({pd:e,view:l,um:y,origins:h,render:U,walked:X()},T);if(z.status!=="moved")return z.status==="refused"&&(n.moveRefusals=(n.moveRefusals??0)+1),z;let H=g.selection;if(H instanceof pe.TextSelection)return z;let G=l.state.doc,V=null,fe=null;if(G.forEach((he,ke)=>{T.ids.includes(he.attrs.id)&&(V===null&&(V=ke),fe=ke+he.nodeSize)}),V===null)return z;let le=H instanceof pe.NodeSelection?pe.NodeSelection.create(G,V):H.anchor<=H.head?new Rt(G.resolve(V),G.resolve(fe)):new Rt(G.resolve(fe),G.resolve(V)),se=l.state.tr.setSelection(le).setMeta(Ye,!0).setMeta("addToHistory",!1);return l.dispatch(g.scrolledIntoView?se.scrollIntoView():se),z},Jo=Un({pd:e,um:y,origins:h,render:()=>l?U():d()});return e.ydoc.on("beforeTransaction",te),e.ydoc.on("beforeTransaction",re),e.ydoc.on("afterTransaction",ie),e.ydoc.on("afterTransaction",ot),e.ydoc.on("afterAllTransactions",tn),{pd:e,stats:n,render:U,um:y,board:Jo,attach(g){l=g,j(de(e,h))},dispose(){e.ydoc.off("beforeTransaction",te),e.ydoc.off("beforeTransaction",re),e.ydoc.off("afterTransaction",ie),e.ydoc.off("afterTransaction",ot),e.ydoc.off("afterAllTransactions",tn),v(),h.dispose(),y.destroy(),Y.clear(),l=null},get walk(){return c},get recoverable(){return A().recoverable},get notices(){return A().notices},subscribeRecovery(g){if(typeof g!="function")throw new TypeError("subscribeRecovery needs a listener");Y.add(g);let T=A();return u===null&&(u=D(T)),g(T),()=>{Y.delete(g)}},dismiss(g,T){O.add(`${g}\0${T}`),W()},dispatch(g){let T=g.getMeta(Qn);if(T)return Ko(g,T);let z=Kr(l.state.doc);if(z.length&&g.steps.some(ae=>Jr(ae,z)))return{status:"refused",code:"unsupported-format"};let{state:H,transactions:G}=l.state.applyTransaction(g),V=G.filter(ae=>ae.docChanged&&!ae.getMeta(Ye));if(l.updateState(H),!V.length){G.some(ae=>ae.selectionSet&&!ae.getMeta(Ye))&&(F=null,B&&(y.stopCapturing(),B=!1));return}a!==i?q():n.reusedWalks=(n.reusedWalks??0)+1;let fe=G.every(ae=>ae.getMeta("addToHistory")!==!1),le=m;m=null;let se=fe?Xn(V,l):null,he=B&&Gn(F,se);F=!he&&se?.breakAfter&&!se.text.trim()?{...se,breakAfter:!1}:se,J=he;try{Io(e,V,c,n,y,fe,le,{join:he,open:se!==null})}finally{J=!1}B=se!==null;let ke=l.state.doc;b(V[0].before,ke);let ce=d();if(!zr(ce,ke))n.mismatch++,n.first??={before:Xt(V[0].before),pm:Xt(ke),y:Xt(ce)};else if(Vr(ke,ce)){n.renders++,S=null,Q(ke);return}U(!1,ce)},restore(g,T){let z=de(e,h),H=mt(e,{index:h,walked:z}).sources.get(g),G=z.visible.find(le=>le.sourceKey===g||le.brk&&Te(le.brk)===g);if(G)return{status:"resolved",id:G.id};if(!H||H.revision!==T)return{status:"stale",notice:A().notices.find(se=>se.source===g)??null};let V=`${Hn}${g}`;y.stopCapturing();let fe=null;if(e.ydoc.transact(()=>{e.gone.set(ft(g,ye(e)),{covers:H.removals.map(le=>le.key),baseline:{type:H.type,attrs:JSON.parse(JSON.stringify(H.attrs))}}),e.flow.insertEmbed(Wr(e,g),{b:V}),fe=qr(e,V),h.recordBoundary(fe,{blockId:V,kind:"restore",recoveryOf:g})},be),y.stopCapturing(),U(),!c.visible.some(le=>le.sourceKey===g&&le.id===V))throw new Error(`Restore did not project ${V}`);return{status:"restored",id:V}},moveBlocks(g){return Gt({pd:e,view:l,um:y,origins:h,render:U,walked:X()},g)},undo(){return Z.replay("undo")},redo(){return Z.replay("redo")}}}function zo({changed:e=()=>{}}={}){let o=[],t=()=>{let r=o.filter(Boolean);if(!r.length)return null;let n=r.length===1?r[0]:Et(r);return o=o.map(()=>null),o[o.length-1]=n,n};return{local(r){let n=r.slice(),s=0;for(;o[s];s++)n=Et([o[s],n]),o[s]=null;o[s]=n,e()},pending(){return o.some(Boolean)},accepted(r){let n=t();if(!n)return!0;let s=!1;try{s=Rn(Pn(r),n)}catch{}return s?(o=[],e(),!0):!1}}}function Ur({store:e,ydoc:o=new dn,onNotice:t=()=>{},ownedTokens:r=[],authorToken:n=null,setTimer:s=setTimeout,clearTimer:l=clearTimeout,compact:c,captureTimeout:i=500,checkpointWithin:a=()=>{},requestCheckpoint:p=null,requestExitCheckpoint:w=null,registerUnsavedState:x=null,onStopped:h=()=>{},journal:y=null,exitClosed:v=()=>!1,stats:_={groups:0,mismatch:0,renders:0,first:null}}){for(let[,L]of fn(e.value.y))mn(o,$n(L),On);let N=In(o),m=y||null,O=()=>{},Y=zo({changed:()=>O()}),I=_n({store:e,ydoc:o,setTimer:s,clearTimer:l,compact:c,onStopped:L=>{if(L!=="blockeditor-full"&&L!=="compaction-failed"){h(L);return}Promise.resolve(p?.({timeoutMs:1e4})).catch(()=>{}).finally(()=>h(L))},onLocalUpdate:Y.local,journal:{local:L=>m?.local(L),dependency:L=>m?.dependency(L)}}),E=Bo({pd:N,onNotice:t,ownedTokens:r,authorToken:n,stats:_,captureTimeout:i}),u=new Set,C=!1,f=!1,k=x?.({id:"page:live",isPending:()=>v()&&Y.pending()||e.pending.length>0||I.pending||I.reconcilePending||!!(m&&m.pending()>(m.failure?1:0)),flush:R}),A=()=>{k?.changed(),!f&&(f=!0,Promise.resolve().then(()=>{if(f=!1,!C)for(let L of[...u])L.check()}))};O=A;let D=e.onLocal(()=>{a(1500),A()}),W=e.onRebase(A),j=e.onConfirm(()=>{m?.acknowledged(),A()});m&&(m.onChange=A);let X=()=>Y.pending()||e.pending.length>0||I.pending||I.reconcilePending||!!(m&&m.pending()>(m.failure?1:0));function $({permit:L,deadline:M,keepalive:q,signal:Q,timeoutMs:b}){let d=Math.min(M??1/0,Date.now()+b),S=()=>Q?.aborted||Date.now()>=d;return new Promise(F=>{let B=!1,J=null,U=null,P={check(){U?.()},finish(Z){B||(B=!0,u.delete(P),l(J),Q?.removeEventListener("abort",oe),F(Z))}},oe=()=>P.finish({ok:!1,code:"timeout"}),ee=Z=>new Promise(ie=>{let re=()=>{l(J),U=null,ie()};J=s(re,Z),U=re}),te=async()=>{if(I.settle(),Y.pending()&&w){let Z=await w({permit:L,deadline:d,signal:Q,keepalive:q,needsSave:()=>Y.pending()});if(B)return;if(!Z?.ok){P.finish(Z?.ok===!1?Z:{ok:!1,code:"checkpoint-failed"});return}}for(;!B;){if(!X()){P.finish({ok:!0});return}if(S()){P.finish({ok:!1,code:"timeout"});return}await ee(50)}};u.add(P),Q?.addEventListener("abort",oe,{once:!0}),te().catch(Z=>P.finish({ok:!1,code:"flush-failed",message:Z?.message||String(Z)}))})}function R({permit:L=null,deadline:M=null,keepalive:q=!1,signal:Q=null,timeoutMs:b=1e4}={}){return C?Promise.resolve({ok:!1,code:"disposed"}):L?$({permit:L,deadline:M,keepalive:q,signal:Q,timeoutMs:b}):new Promise(d=>{let S=Date.now()+b,F=!1,B=!1,J=!1,U=null,P={check:ee,finish:oe};function oe(te){F||(F=!0,u.delete(P),l(U),d(te))}function ee(){if(!(F||B||J)){B=!0;try{if(I.settle(),e.pending.length&&(a(0),e.pending.length))return;if(J=!0,!p){oe({ok:!0});return}Promise.resolve().then(()=>{if(!F)return p({timeoutMs:Math.max(0,S-Date.now())})}).then(oe,te=>oe({ok:!1,code:"checkpoint-failed",message:te?.message||String(te)}))}catch(te){oe({ok:!1,code:"flush-failed",message:te?.message||String(te)})}finally{B=!1}}}u.add(P),U=s(()=>oe({ok:!1,code:"timeout"}),b),ee()})}return{ydoc:o,pd:N,provider:I,bridge:E,stats:_,flush:R,awareness:{generation:()=>Number.isSafeInteger(e.value?.g)&&e.value.g>=0?e.value.g:0,map:()=>({pd:N,w:E.walk})},get journal(){return m},filePending:()=>Y.pending(),acceptFile:L=>Y.accepted(L),doc:()=>Qt(De(N,de(N))),attach:L=>E.attach(L),dispatch:L=>E.dispatch(L),moveBlocks:L=>E.moveBlocks(L),board:E.board,undo:()=>E.undo(),redo:()=>E.redo(),restore:(L,M)=>E.restore(L,M),get recoverable(){return E.recoverable},get notices(){return E.notices},subscribeRecovery:L=>E.subscribeRecovery(L),dismiss:(L,M)=>E.dismiss(L,M),dispose(){if(!C){C=!0,D(),W(),j(),k?.dispose(),m?.close(),Promise.resolve(m?.channel?.flush?.()).catch(()=>{});for(let L of[...u])L.finish({ok:!1,code:"disposed"});E.dispose(),I.dispose()}}}}var Zt="Some text you typed was kept aside when its block moved or was removed.",Gr=`
11
+ :host { font: inherit !important; color: inherit !important; }
12
+ .blockeditor-recover-root { display: contents; }
13
+ .blockeditor-recover { position: fixed; right: 16px; bottom: 16px; z-index: 20; min-height: 36px; padding: 0 14px; font: inherit; font-size: 14px; color: var(--blockeditor-ink); background: var(--blockeditor-pop-bg); border: 1px solid var(--blockeditor-chrome-line-rest); border-radius: 999px; cursor: pointer; }
14
+ .blockeditor-recover[hidden], .blockeditor-recover-panel[hidden] { display: none; }
15
+ .blockeditor-recover-panel { position: fixed; right: 16px; bottom: 64px; z-index: 21; width: min(380px, calc(100vw - 32px)); max-height: 60vh; overflow-y: auto; color: var(--blockeditor-ink); background: var(--blockeditor-pop-bg); border: 1px solid var(--blockeditor-chrome-line-rest); border-radius: var(--blockeditor-chrome-radius); padding: 8px; box-sizing: border-box; }
16
+ .blockeditor-recover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 8px; font-weight: 600; }
17
+ .blockeditor-recover-note { margin: 0 6px 8px; font-size: 13px; opacity: .72; }
18
+ .blockeditor-recover-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; min-height: 44px; padding: 8px 6px; border-top: 1px solid var(--blockeditor-chrome-line-rest); }
19
+ .blockeditor-recover-row.is-target { outline: 2px solid var(--blockeditor-accent, currentColor); outline-offset: -2px; }
20
+ .blockeditor-recover-meta { grid-column: 1; font-size: 12px; opacity: .72; }
21
+ .blockeditor-recover-text { grid-column: 1; overflow-wrap: anywhere; }
22
+ .blockeditor-recover-text mark { background: var(--blockeditor-mark-bg, rgba(255, 214, 102, .45)); color: inherit; border-radius: 2px; }
23
+ .blockeditor-recover-row button, .blockeditor-recover-head button { grid-column: 2; grid-row: 1 / span 2; min-height: 36px; padding: 0 12px; font: inherit; font-size: 14px; color: inherit; background: transparent; border: 1px solid var(--blockeditor-chrome-line-rest); border-radius: var(--blockeditor-chrome-radius); cursor: pointer; }
24
+ @media (max-width: 560px) {
25
+ .blockeditor-recover { top: 12px; bottom: auto; min-height: 44px; }
26
+ .blockeditor-recover-panel { left: 0; right: 0; bottom: 0; width: 100%; max-height: 70vh; border-radius: var(--blockeditor-chrome-radius) var(--blockeditor-chrome-radius) 0 0; }
27
+ .blockeditor-recover-row button, .blockeditor-recover-head button { min-height: 44px; }
28
+ }
29
+ `,Xr={heading:"Heading",list_item:"List item",toggle:"Toggle",quote:"Quote",code_block:"Code",callout:"Callout",table:"Table",image:"Image"},en=280,Se=(e,o,t,r={})=>{let n=e.createElement(o);t&&(n.className=t);for(let[s,l]of Object.entries(r))n.setAttribute(s,l);return n};function Qr(e,o){let t=Se(e,"div","blockeditor-recover-text"),r=0;for(let n of o.blocks){for(let s of n.runs){if(s.kind!=="text"||r>=en)continue;let l=s.text.slice(0,en-r);r+=l.length,t.append(s.displaced?Object.assign(e.createElement("mark"),{textContent:l}):e.createTextNode(l))}r<en&&n!==o.blocks[o.blocks.length-1]&&t.append(e.createTextNode(" / "))}return t.textContent||(t.textContent="(no text)"),t}function Zr(e){let o=new Set;for(let t of e.blocks)for(let r of t.runs)r.displaced&&o.add(r.author??null);return[...o]}function es(e,o){let t=null;return e.state.doc.forEach((r,n)=>{t===null&&r.attrs.id===o&&(t=r.isTextblock?n+1:n)}),t===null?!1:(e.dispatch(e.state.tr.setSelection(pe.Selection.near(e.state.doc.resolve(t))).scrollIntoView()),e.focus(),!0)}function ts({binding:e,mount:o,ownTokens:t=[],onRestored:r=()=>{},onStale:n=()=>{}}){let s=o.ownerDocument,l=new Set(t.filter(Boolean)),c=Se(s,"button","blockeditor-recover",{type:"button","aria-haspopup":"dialog","aria-expanded":"false"}),i=Se(s,"div","blockeditor-recover-panel",{role:"dialog","aria-label":"Recover changes"});c.hidden=!0,i.hidden=!0;let a=Se(s,"div","blockeditor-recover-root");a.append(c,i);let p=nn({name:"blockeditor-recover",content:a,css:[Gr],parent:o}),w={recoverable:[],notices:[]},x=null,h="",y=E=>E.some(u=>l.has(u))?E.length>1?"You and others":"You":E.some(u=>u!==null)?"Another editor":"An earlier edit",v=()=>{i.hidden=!0,x=null,c.setAttribute("aria-expanded","false")},_=E=>{let u;try{u=e.restore(E.source,E.revision)}catch(C){return console.error("[clay] Restore failed:",C),on("This change could not be restored.","error"),{status:"failed"}}return u.status==="restored"||u.status==="resolved"?r(u.id):u.status==="stale"&&n(u),u},N=()=>{i.replaceChildren();let E=Se(s,"div","blockeditor-recover-head");E.append(s.createTextNode("Recover changes"));let u=Se(s,"button","",{type:"button"});u.textContent="Close",u.addEventListener("click",()=>{v(),c.focus()}),E.append(u);let C=Se(s,"p","blockeditor-recover-note");C.textContent="Text typed while its block was moved or removed. Restore puts it back as a new block.",i.append(E,C);for(let f of w.recoverable){let k=Se(s,"div","blockeditor-recover-row",{"data-source":f.source});f.source===x&&k.classList.add("is-target");let A=Se(s,"div","blockeditor-recover-meta");A.textContent=`${Xr[f.type]??"Paragraph"} \xB7 ${y(Zr(f))}`;let D=Se(s,"button","",{type:"button"});D.textContent="Restore",D.addEventListener("click",()=>_(f)),k.append(A,Qr(s,f),D),i.append(k)}},m=(E=null)=>{if(!w.recoverable.length)return;x=E,i.hidden=!1,c.setAttribute("aria-expanded","true"),N();let u=[...i.querySelectorAll(".blockeditor-recover-row")];(u.find(f=>f.dataset.source===E)??u[0])?.querySelector("button")?.focus()},O=E=>{let u=E.map(C=>`${C.source}\0${C.revision}`).join(`
30
+ `);if(u!==h){if(h=u,!E.length){vt(Zt);return}rn(Zt,"warning",{actions:[{label:"Review",onClick:()=>m(E[0].source)},{label:"Dismiss",onClick:()=>{for(let C of E)e.dismiss(C.source,C.revision)}}]})}},Y=E=>{w=E;let u=E.recoverable.length;c.hidden=u===0,c.textContent=`Recover changes (${u})`,u?i.hidden||N():v(),O(E.notices)};c.addEventListener("click",()=>i.hidden?m():v()),i.addEventListener("keydown",E=>{E.key==="Escape"&&(E.stopPropagation(),v(),c.focus())});let I=e.subscribeRecovery(Y);return{open:m,close:v,restore:_,get count(){return w.recoverable.length},destroy(){I(),vt(Zt),p.remove()}}}import("./page/editor-UF3CIA6V.js").catch(()=>null);export{lo as ADOPTION_TIMEOUT_MS,Zo as acceptedPageState,Xo as blocksFromYValue,ze as canon,Pt as classifyFile,qo as createFeatureLoader,Wo as createHistoryBridge,ts as createRecoverList,Ur as createYPageBinding,es as focusBlock,Go as heldSlashRange,Uo as holdSlashRange,lr as installAdoption,Kt as mergePageModels,Vo as observeDocumentTitle,pt as readBack,Qo as renderFromTags,er as seedPageFromArticle,Ho as yValueOf};
@@ -1 +1 @@
1
- import{a as w}from"./c-MJ7GVE46.js";import{b as m,c as v}from"./c-U65PREMC.js";import"./c-VKEDWYDF.js";import{m as f,o as y}from"./c-C7SUMNMI.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-U4TWEIKZ.js";import"./c-PNZIJFG7.js";import"./c-XQXZAO7N.js";import"./c-S7LK4KUE.js";import"./c-MOP5KBWZ.js";import"./c-2YYDMLNZ.js";import"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var L="script[editmode\\:resource]";function d(e=document){let t=[...e.querySelectorAll(L)];return{reversible:t.length===0,scripts:t}}function R(e=document){return{enable(){m(e)},quiesce(){},resume(){},dispose(){v()}}}function g(e=document){return{id:"clay:resources",order:100,prepare(){let{reversible:t}=d(e);if(!t)throw Object.assign(new Error("clay.modeLifecycle: an editmode:resource script cannot be re-run"),{code:"unsupported-plugin"});return R(e)}}}var b=!1,S=()=>{let e=new Set;for(let t of f()){if(typeof t?.then=="function")continue;let n=t?.id;if(typeof n!="string"||typeof t?.prepare!="function"||e.has(n))return!1;e.add(n)}return!0},j=e=>[...e?.edit?.core??[],...e?.edit?.plugins??[],...e?.edit?.late??[],...e?.view?.plugins??[],...e?.view?.late??[]];function A(e){return[...new Set(j(e))].filter(t=>w(t)===null)}function T(e){return S()&&A(e).length===0&&d().reversible}function _(){b||(b=!0,y(g()))}var l=()=>Object.assign(new Error("clay.modeLifecycle: the import was cancelled"),{name:"AbortError",code:"aborted"}),O=15e3,E=(e,t)=>Object.assign(new Error(`clayjs: ${e}`),{code:t}),q=(e,t)=>new Promise((n,s)=>{if(t?.aborted)return s(l());let o=()=>s(l());t?.addEventListener?.("abort",o),Promise.resolve(e).then(i=>{t?.removeEventListener?.("abort",o),n(i)},i=>{t?.removeEventListener?.("abort",o),s(i)})}),h=e=>!e?.represented||e.represented.bytes===null,P=e=>e&&(e.liveSync??e.default??e)||null;async function k(e,t={}){let n=t.signal,s={signal:n,deadline:O},o=e?.loaded?.["plugins/page-view.js"];if(o?.ready){await q(o.acquired,n);let a=await o.prepareHandoff(s);if(h(a))throw E("the reader has no file to hand over","not-acquired");return a}let i=P(e?.loaded?.["sync/live-sync.js"]);if(i&&!i.isDestroyed&&i.lane==="saved"){let a=await i.prepareHandoff(s);if(h(a))throw E("the reader has no file to hand over","not-acquired");return a}return null}function I(e,t=null){let n=e?.loaded?.["plugins/page-view.js"],s=Array.isArray(e?.view?.plugins)?e.view.plugins.includes("sync/live-sync.js"):!!e?.loaded?.["sync/live-sync.js"];if(n&&((n.restart??n.start)({sync:s,represented:t}),!s))return;let o=P(e?.loaded?.["sync/live-sync.js"]);if(o)return o.start(o.currentFile,{lane:"saved",represented:t})}async function V(e,t,{signal:n}={}){let s=e.inflight||=new Map,o=[],i=()=>{if(n?.aborted)throw l()},a=e.loadEditHints?.();if(a)try{await a}catch{}let u=r=>{if(!s.has(r)){let c=Promise.resolve().then(()=>e.modules[r]()).catch(x=>{throw s.delete(r),x});s.set(r,c)}return s.get(r)};for(let r of t.core??[]){if(e.loaded[r])continue;i();let c=await u(r);e.loaded[r]=c,c.install?.()}e.attachEditCore(e.loaded);for(let r of t.plugins??[]){if(e.loaded[r])continue;i();let c=await u(r);e.loaded[r]=c,e.attach(r,c),o.push(r)}let p=(t.late??[]).filter(r=>!e.loaded[r]);if(p.length){i();try{await e.late}catch{}for(let r of p){if(e.loaded[r])continue;i();let c=await u(r);e.loaded[r]=c,e.attach(r,c),o.push(r)}}return o}export{V as importPlan,T as liveAllowed,_ as openResources,k as prepareReader,I as startReader,A as unsupportedPaths};
1
+ import{a as w}from"./c-MJ7GVE46.js";import{b as m,c as v}from"./c-WOJ2RTV4.js";import"./c-VKEDWYDF.js";import{m as f,o as y}from"./c-C7SUMNMI.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-U4TWEIKZ.js";import"./c-UW6MMZ4V.js";import"./c-XQXZAO7N.js";import"./c-S7LK4KUE.js";import"./c-MOP5KBWZ.js";import"./c-2YYDMLNZ.js";import"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var L="script[editmode\\:resource]";function d(e=document){let t=[...e.querySelectorAll(L)];return{reversible:t.length===0,scripts:t}}function R(e=document){return{enable(){m(e)},quiesce(){},resume(){},dispose(){v()}}}function g(e=document){return{id:"clay:resources",order:100,prepare(){let{reversible:t}=d(e);if(!t)throw Object.assign(new Error("clay.modeLifecycle: an editmode:resource script cannot be re-run"),{code:"unsupported-plugin"});return R(e)}}}var b=!1,S=()=>{let e=new Set;for(let t of f()){if(typeof t?.then=="function")continue;let n=t?.id;if(typeof n!="string"||typeof t?.prepare!="function"||e.has(n))return!1;e.add(n)}return!0},j=e=>[...e?.edit?.core??[],...e?.edit?.plugins??[],...e?.edit?.late??[],...e?.view?.plugins??[],...e?.view?.late??[]];function A(e){return[...new Set(j(e))].filter(t=>w(t)===null)}function T(e){return S()&&A(e).length===0&&d().reversible}function _(){b||(b=!0,y(g()))}var l=()=>Object.assign(new Error("clay.modeLifecycle: the import was cancelled"),{name:"AbortError",code:"aborted"}),O=15e3,E=(e,t)=>Object.assign(new Error(`clayjs: ${e}`),{code:t}),q=(e,t)=>new Promise((n,s)=>{if(t?.aborted)return s(l());let o=()=>s(l());t?.addEventListener?.("abort",o),Promise.resolve(e).then(i=>{t?.removeEventListener?.("abort",o),n(i)},i=>{t?.removeEventListener?.("abort",o),s(i)})}),h=e=>!e?.represented||e.represented.bytes===null,P=e=>e&&(e.liveSync??e.default??e)||null;async function k(e,t={}){let n=t.signal,s={signal:n,deadline:O},o=e?.loaded?.["plugins/page-view.js"];if(o?.ready){await q(o.acquired,n);let a=await o.prepareHandoff(s);if(h(a))throw E("the reader has no file to hand over","not-acquired");return a}let i=P(e?.loaded?.["sync/live-sync.js"]);if(i&&!i.isDestroyed&&i.lane==="saved"){let a=await i.prepareHandoff(s);if(h(a))throw E("the reader has no file to hand over","not-acquired");return a}return null}function I(e,t=null){let n=e?.loaded?.["plugins/page-view.js"],s=Array.isArray(e?.view?.plugins)?e.view.plugins.includes("sync/live-sync.js"):!!e?.loaded?.["sync/live-sync.js"];if(n&&((n.restart??n.start)({sync:s,represented:t}),!s))return;let o=P(e?.loaded?.["sync/live-sync.js"]);if(o)return o.start(o.currentFile,{lane:"saved",represented:t})}async function V(e,t,{signal:n}={}){let s=e.inflight||=new Map,o=[],i=()=>{if(n?.aborted)throw l()},a=e.loadEditHints?.();if(a)try{await a}catch{}let u=r=>{if(!s.has(r)){let c=Promise.resolve().then(()=>e.modules[r]()).catch(x=>{throw s.delete(r),x});s.set(r,c)}return s.get(r)};for(let r of t.core??[]){if(e.loaded[r])continue;i();let c=await u(r);e.loaded[r]=c,c.install?.()}e.attachEditCore(e.loaded);for(let r of t.plugins??[]){if(e.loaded[r])continue;i();let c=await u(r);e.loaded[r]=c,e.attach(r,c),o.push(r)}let p=(t.late??[]).filter(r=>!e.loaded[r]);if(p.length){i();try{await e.late}catch{}for(let r of p){if(e.loaded[r])continue;i();let c=await u(r);e.loaded[r]=c,e.attach(r,c),o.push(r)}}return o}export{V as importPlan,T as liveAllowed,_ as openResources,k as prepareReader,I as startReader,A as unsupportedPaths};
@@ -0,0 +1 @@
1
+ import{a as ce,b as Qe,c as ue,e as fe,f as pe,g as nt}from"./c-ARO6CPMA.js";import{a as Ze,b as et,c as de,d as tt}from"./c-LZJPNR2W.js";import{a as A,b as J}from"./c-FILLTJA7.js";import{b as Ke}from"./c-5VYOWDTI.js";import{b as oe,c as ae,d as b,f as he,g as Ve,h as Xe}from"./c-P73XPAOA.js";import{a as q}from"./c-MZCOGNZL.js";import{a as Ge}from"./c-LD6UVV5R.js";import{a as ze,f as We,g as Ye,h as Je}from"./c-PGSBXHUE.js";import{a as se,b as $e,c as P,d as re,e as le,h as je}from"./c-KU3PX7LL.js";import{e as Ue}from"./c-EQ5NBOGA.js";import{d as Pe}from"./c-IJUK2GPW.js";import{f as $,j as te}from"./c-C7SUMNMI.js";import{a as Le}from"./c-BPF2NSPV.js";import{E as Y,F as Ne,H as T,I as Oe,b as D,j as ie,o as W,t as M,z as Be}from"./c-UW6MMZ4V.js";import{a as Re,b as qe,c as Me,e as j,g as z,h as ne}from"./c-MOP5KBWZ.js";import{m as Ie,n as Te}from"./c-HA6INT6J.js";import{a as He,b as Fe,l as Ce,m as Ae}from"./c-ICMAOOGK.js";function it(s){let e=new WeakMap,t=0,i=r=>e.get(r)||null,n=r=>{let l=e.get(r);return l||(l=`${s}:${++t}`,e.set(r,l)),l};return{idOf:i,ensure:n,adopt:(r,l)=>{r&&typeof l=="string"&&l&&e.set(r,l)},exportMap:(r,l)=>{let o={},a=[],h=[],c=(d,_)=>{let g=l(d);g&&(o[_]=n(g));let E=d.children;a.push(E.length),h.push(d.tagName.toLowerCase());for(let f=0;f<E.length;f++)c(E[f],_===""?String(f):`${_}.${f}`)};return c(r,""),o["~"]=a.join(","),o["^"]=h.join(","),o}}}function st(s,e){let t=new WeakMap;if(!s||!e||typeof e!="object"||Array.isArray(e))return t;let i=e["~"],n=typeof i=="string"?i.split(",").map(Number):null,r=n&&typeof e["^"]=="string"?e["^"].split(","):null,l=d=>Number.isInteger(d)&&d>=0,o=0,a=!1,h=d=>{let _=d;for(;_>0;){let g=n[o++];if(o>n.length||!l(g))return!1;_+=g-1}return!0},c=(d,_)=>{if(a)return;if(n){let f=o++,u=n[f];if(f>=n.length||!l(u)){a=!0;return}let S=!r||r[f]===d.tagName.toLowerCase();if(!S||u!==d.children.length){let k=S&&e[_];typeof k=="string"&&k&&t.set(d,k),h(u)||(a=!0);return}}let g=e[_];typeof g=="string"&&g&&t.set(d,g);let E=d.children;for(let f=0;f<E.length;f++)c(E[f],_===""?String(f):`${_}.${f}`)};return c(s,""),t}function St(s){return e=>{for(let t of s){let i=t(e);if(typeof i=="string"&&i!=="")return i}return null}}var Ot=St([s=>s.getAttribute("data-id"),s=>s.getAttribute("id")]);var Et=/^blockeditor(\.[0-9]+)?$/,rt=s=>[...s.querySelectorAll('script[merge][clay~="live"]')].filter(e=>Et.test(e.getAttribute("merge")));function lt(s,e,t){if(!s.html.includes("data-blockeditor"))return s;let i=u=>W(new DOMParser().parseFromString(u,"text/html")),n=i(s.html),r=n.querySelector("article[data-blockeditor]");if(!r)return s;let l=i(e),o=l.querySelector("article[data-blockeditor]");if(!o)return null;let a=st(n.documentElement,s.identityMap),h=(u,S)=>{let k=n.importNode(S,!0),x=a.get(u);return x&&a.set(k,x),u.replaceWith(k),k},c=h(r,o),d=new Map(rt(n).map(u=>[u.getAttribute("merge"),u]));for(let u of rt(l)){let S=u.getAttribute("merge"),k=d.get(S);k?h(k,u):c.before(n.importNode(u,!0)),d.delete(S)}for(let u of d.values())u.remove();let _=n.querySelector("head > title"),g=l.querySelector("head > title");_&&g?h(_,g):g?n.head.append(n.importNode(g,!0)):_?.remove();let E=n.documentElement,f=t.exportMap(E,u=>{let S=a.get(u);return S?(t.adopt(u,S),u):null});return{...s,html:T(E),identityMap:f}}var wt={"merge-tokens":"tokens","merge-max":"max"};function ot(s,e){if(!e.startsWith("data-")||e==="data-id"||!s?.closest)return null;for(let[t,i]of Object.entries(wt)){let n=s.closest(`[${t}]`);if(n&&n.getAttribute(t).split(/\s+/).includes(e))return i}return null}var m=null,at=null,B=new Map;function V(){return at??=Promise.all([import("./c-O3DPFZCE.js"),import("./c-EJTGYSLN.js")]).then(([s,e])=>{m={...s,beginLineageCapture:e.beginLineageCapture};for(let t of[...B.keys()])B.set(t,s.registerContext(t));return m}),at}var ht=()=>m,I={get size(){return m?m.conflicts.size:0},list(){return m?m.conflicts.list():[]},get(s){return m?m.conflicts.get(s):null},acknowledge(s,e={}){if(m)return m.conflicts.acknowledge(s,e);if(!Array.isArray(s))throw new TypeError("clay.conflicts.acknowledge needs an array of ids");return{removedIds:[],remainingIds:[]}},claim(s,e={}){if(m)return m.conflicts.claim(s,e);if(!e.owner)throw new TypeError("clay.conflicts.claim needs an owner");return{release(){}}},registerContext(s){if(m)return m.conflicts.registerContext(s);if(typeof s!="function")throw new TypeError("clay.conflicts.registerContext needs a resolver function");return B.set(s,null),()=>{let e=B.get(s);B.delete(s),e&&e()}},contextFor(s,e){return m?m.conflicts.contextFor(s,e):null},recoveryOf(s){return m?m.conflicts.recoveryOf(s):null},hasPendingApply(){return m?m.conflicts.hasPendingApply():!1}};var y=null,_e=null;function R(){return _e??=new Promise(s=>setTimeout(s,0)).then(()=>import("./c-HYNM5U6B.js")).then(s=>y=s).catch(s=>{throw _e=null,s}),_e}var ve=null,ge=null;function kt(){return ge??=import("./c-SMLAJASY.js").then(s=>ve=s.presence).catch(s=>{throw ge=null,s}),ge}var ft=te().phase==="entering";$&&!ft&&R().catch(()=>{});$&&V().catch(()=>{});var L=null,ye=null,Q=[];function pt(s){L.presence.update(s),L.editingMarker.update(s)}function bt(){return ye??=Promise.all([import("./c-WOWGGNCJ.js"),import("./c-EEWPNUM2.js")]).then(([s,e])=>{L={presence:s.presence,editingMarker:e.editingMarker};let t=Q;Q=[];for(let i of t)pt(i);return L}).catch(s=>{throw ye=null,s}),ye}function xt(s){if(L){pt(s);return}Q.push(s),bt().catch(()=>{})}var dt=Object.freeze({bytes:null,etag:null,seq:null}),Dt=()=>({msg:"Not in edit mode",msgType:"skipped",code:null,etag:null}),_t=["[editor-ui]",'[clay~="editor-ui"]',"[save-ignore]","[snapshot-remove]","[no-snapshot]","[no-save]","[save-remove]","[freeze] *","[save-freeze] *",'[clay~="no-save"]','[clay~="no-snapshot"]','[clay~="freeze"] *',Ce,He].join(","),gt='[clay~="freeze"], [freeze], [save-freeze]';function X(s){for(let e of s.querySelectorAll(gt))e.replaceChildren();return z()&&Me(s),s}function ut(s){if(s==null)return s;let e=typeof s=="string"?new DOMParser().parseFromString(s,"text/html"):s;return ie(e),W(e),X(e),e}var It=[Ae,'[clay~="no-watch"]',"[no-watch]","[mutations-ignore]"].join(","),Tt="[data-richclay], [richclay], [editable], [clay-editable]";function Lt(){let s=Array.from(document.querySelectorAll(Tt),e=>[e,e.innerHTML]);return()=>{for(let[e,t]of s)e.isConnected&&e.innerHTML!==t&&e.dispatchEvent(new CustomEvent("clay:external-write"))}}var Ht=(s,e,t)=>Ie(s,e,t)||Fe.test(e.toLowerCase()),yt=s=>s.getAttribute("data-id")||s.getAttribute("id")||null;function Ft(s){let e=new Map,t=n=>{if(n.matches(_t))return;let r=yt(n);r&&e.set(r,(e.get(r)||0)+1);let l=n.localName==="template"&&n.content?n.content.children:n.children;for(let o of l)t(o)},i=s.nodeType===9?[s.documentElement]:s.nodeType===11?s.children:[s];for(let n of i)n&&n.nodeType===1&&t(n);return e}var Ct=s=>e=>{let t=yt(e);if(!t)return null;let i=e.getRootNode(),n=s.get(i);return n||s.set(i,n=Ft(i)),n.get(t)===1?t:null},me=s=>!!s&&typeof s=="object"&&!Array.isArray(s);function At(s){return typeof s!="string"||s===""?null:new DOMParser().parseFromString(s,"text/html").documentElement?.getAttribute("documentetag")||null}function Rt(s,e){e!=="live"||!s||!y||(y.enableContentEditable(s),y.enableOnClick(s),y.enableAdminInputs(s),y.enableAdminResources(s))}function qt(){let{forComparison:s,forDirty:e}=Be({flushUndo:!1});return[s,e]}var Mt=1024*1024;function Pt(s,e,t,i,n){let r={sender:t,identityMap:i,...n?{etag:n}:{}};return e.length<Mt?JSON.stringify({[s.snapshotKey]:e,...r}):new Blob([`{${JSON.stringify(s.snapshotKey)}:`,JSON.stringify(e),`,${JSON.stringify(r).slice(1)}`],{type:"application/json"})}var Se=class{constructor(){this.sse=null,this.currentFile=null,this.lastHtml=null,this._diskBase=null,this._diskBaseTicket=0,this._agreeSeq=0,this._saveTicket=0,this._peerBaseTicket=0,this._acceptedSaveTicket=0,this._morphTicket=0,this.clientId=this.generateClientId(),this.resumeId=null,this._savedSnapshot?.abort?.abort(),this._savedSnapshot=null,this._sendInFlight=!1,this._queuedSend=null,this._profile=null,this._profilePromise=null,this._sharedData=!1,this._sharedSync=!1,this._workerFeatures=["live-data"],this._liveData=!1,this._editing=null,this._presenceLease=null,this._presenceQuiesced=!1,this._ready=null,this._startGen=0,this.isPaused=!1,this.isDestroyed=!1,this.debug=!1,this._lane=$?"live":"saved",this._laneChosen=!1,this._snapshotHandler=null,this._hiddenHandler=null,this.lastSeenSeq=0,this._pendingHtml=null,this._pendingSeq=null,this._pendingIdentityMap=null,this._pendingEtag=null,this._pendingBy=null,this._morphInFlight=!1,this._rafHandle=null,this._represented=dt,this._handoff=null,this._handoffHeld=!1,this._pendingExternal=null,this._lastExternalSeq=0,this._saveEpoch=0,this._saveSavedHandler=null,this._saveConflictHandler=null,this._settledHandler=null,this._lastIdentityMap=null,this._applyGen=0,this._holdRetryPeer=null,this._holdRetryExt=null,this._servedFetchId=0,this._startupRetry=null,this._engineRetry=null,this._heldLive=!1,this._heldExt=!1,this.identity=it(this.clientId),this.onConnect=null,this.onDisconnect=null,this.onUpdate=null,this.onError=null,this.onNotification=null}get unresolvedConflicts(){return I.list().filter(e=>e.kind!=="apply-incomplete")}_log(e,t=null){if(!this.debug)return;let i=`[LiveSync ${new Date().toISOString()}]`;t!==null?console.log(i,e,t):console.log(i,e)}generateClientId(){return Math.random().toString(36).slice(2,11)+Date.now().toString(36)}generateResumeId(){try{let e=new Uint8Array(16);return(globalThis.crypto||window.crypto).getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}catch{return Math.random().toString(36).slice(2)+Date.now().toString(36)}}_seedBases(){if(b())return;let e=M({flushUndo:!1});this._setPeerBase(T(e),this.identity.exportMap(e,D),this._ticket()),this._setDiskBase(Y({emitForSync:!1}).forSave,this._ticket())}get lane(){return this._lane}set lane(e){this._lane=e,this._laneChosen=!0}start(e=null,{lane:t,represented:i}={}){if(this.isDestroyed=!1,(this.sse||this._snapshotHandler)&&this.cleanup(),this.currentFile=e||this.detectCurrentFile(),!this.currentFile){console.warn("[LiveSync] No file detected");return}let n=te().mode==="edit"?"live":"saved",r=this.lane==="live";this._lane=t||(this._laneChosen?this._lane:n),this.lastHtml=null,this._lastIdentityMap=null,this._peerBaseTicket=this._ticket(),this._diskBase=null,this._diskBaseTicket=this._ticket(),this._saveTicket=0,this._savedSnapshot?.abort?.abort(),this._savedSnapshot=null,this._applyGen++,this.lastSeenSeq=0,this._lastExternalSeq=0,this._represented=i?Object.freeze({bytes:i.bytes??null,etag:i.etag??null,seq:i.seq??null}):dt,this._acquireEmptySaved=r&&this.lane==="saved"&&this._represented.bytes===null,this._pendingExternal=null,this.resumeId=this.generateResumeId(),this.lane==="live"&&this._seedBases(),this.lane==="live"&&V().catch(()=>{}),console.log(`[LiveSync] Starting for: ${this.currentFile} (lane=${this.lane})`);let l=++this._startGen;if(this.lane==="live"&&!(y&&y.baselineSettled())){let o=this._applyGen,a=this._morphTicket,h=this._saveEpoch,c=this.lastHtml,d=this._diskBaseTicket,_=this._diskBase!==null;this._settledHandler=()=>{if(this._settledHandler=null,!(this.isDestroyed||this._startGen!==l)&&!Pe()&&!b()&&this._saveTicket===0&&this._morphTicket===a){if(c!==null&&this._applyGen===o&&this._saveEpoch===h&&this.lastHtml===c){let g=M({flushUndo:!1});this._setPeerBase(T(g),this.identity.exportMap(g,D),this._ticket())}_&&this._diskBaseTicket===d&&this._setDiskBase(Y({emitForSync:!1}).forSave,this._ticket())}},document.addEventListener("clay:baseline-settled",this._settledHandler,{once:!0})}this._ready=Promise.all([this.lane==="live"?R():null,this._resolveProfile()]).then(()=>{this.isDestroyed||this._startGen!==l||this.connect()}),this.lane==="live"&&(this.listenForSnapshots(),kt().then(o=>this._startPresence(o,l),()=>{}),this._saveSavedHandler=o=>{this._saveEpoch++;let a=this._saveTicket||this._ticket();this._saveTicket=0,a>this._acceptedSaveTicket&&(this._acceptedSaveTicket=a);let h=y?y.getLastSavedBytes():null;h!=null&&this._setDiskBase(h,a),this._relayCommit(o?.detail?.captureId,h)},document.addEventListener("clay:save-saved",this._saveSavedHandler),this._saveConflictHandler=o=>{let a=o.detail&&o.detail.etag;a&&queueMicrotask(()=>{this.isDestroyed||a===se()&&(y?.conflictResolvedBySync(a),this._saveAfterMerge(b(),!1))})},document.addEventListener("clay:save-conflict",this._saveConflictHandler))}cleanup(){if(this.sse&&(this.sse.close(),this.sse=null),de(),Q=[],L&&(L.presence.clear(),L.editingMarker.clear()),this._editing&&(this._editing.stop(),this._editing=null),this._presenceLease){let e=this._presenceLease;this._presenceLease=null,typeof e.stop=="function"?e.stop():e.detach()}this._lastRoster=null,this._snapshotHandler&&(document.removeEventListener("clay:snapshot-ready",this._snapshotHandler),this._snapshotHandler=null),this._saveSavedHandler&&(document.removeEventListener("clay:save-saved",this._saveSavedHandler),this._saveSavedHandler=null),this._saveConflictHandler&&(document.removeEventListener("clay:save-conflict",this._saveConflictHandler),this._saveConflictHandler=null),this._settledHandler&&(document.removeEventListener("clay:baseline-settled",this._settledHandler),this._settledHandler=null),this._hiddenHandler&&(document.removeEventListener("visibilitychange",this._hiddenHandler),document.removeEventListener("clay:workspace-background",this._hiddenHandler),this._hiddenHandler=null),this._queuedSend=null,this._rafHandle!=null&&(this._cancelFrame(this._rafHandle),this._rafHandle=null),this._pendingHtml=null,this._pendingSeq=null,this._pendingIdentityMap=null,this._pendingBy=null,this._pendingExternal=null,this._handoff=null,this._handoffHeld=!1,clearTimeout(this._holdRetryPeer),clearTimeout(this._holdRetryExt),this._holdRetryPeer=null,this._holdRetryExt=null,clearTimeout(this._startupRetry),this._startupRetry=null,clearTimeout(this._engineRetry),this._engineRetry=null,this._servedFetchId++}detectCurrentFile(){let e=window.location.pathname;if(e==="/")return"index.html";e=e.replace(/^\//,"");let t=e.match(/^(.*?\.html(?:clay)?)/);return t?t[1]:e}_resolveProfile(){return this._profilePromise||(this._profilePromise=nt().then(e=>(this._sharedData=e.sharedData,this._sharedSync=e.sharedSync,this._liveData=e.liveData,this._workerFeatures=e.workerFeatures,this._profile=e.profile,this._log(`Wire profile: ${e.profile.name}`),e.profile))),this._profilePromise}_setHeld(e,t,i){let n=e==="live"?"_heldLive":"_heldExt";this[n]!==t&&(this[n]=t,!t&&!this._heldLive&&!this._heldExt&&je({fresh:!0,clearIfMissing:!1}),document.dispatchEvent(new CustomEvent(t?"clay:sync-held":"clay:sync-resumed",{detail:{lane:e,el:i||null}})))}_applyEtagFrame(e){return typeof e.etag!="string"||typeof e.html=="string"?!1:(this._log("Dropping a stamp that arrived with no document: nothing proves this tab holds those bytes"),!0)}connect(){if(this.isDestroyed)return;let t=(this._profile||pe.legacy).streamPath(window.location.href,this.lane,this.resumeId,this.clientId,1);this._hiddenHandler||(this._hiddenHandler=()=>{this._rafHandle==null||!ce()||(this._cancelFrame(this._rafHandle),this._rafHandle=null,this._scheduleNextFrame())},document.addEventListener("visibilitychange",this._hiddenHandler),document.addEventListener("clay:workspace-background",this._hiddenHandler)),this.sse=new Qe(new URL(t,window.location.origin).href,{shared:this._sharedSync,sharedData:this._sharedData,workerFeatures:this._workerFeatures,documentURL:window.location.href,lane:this.lane,clientId:this.clientId,keepAliveWhenHidden:this.lane!=="live"?!1:this._liveData?!0:"shared",startupCheck:!!Le}),this._acquireEmptySaved&&(this._acquireEmptySaved=!1,this._fetchServedDocument(void 0,{repair:!0})),this.sse.onopen=()=>{console.log("[LiveSync] Connected"),this._editing&&this._editing.reconnected(),ve&&ve.reconnect(),this.onConnect&&this.onConnect()},this.sse.addEventListener("open",()=>et({clientId:this.clientId,lane:this.lane})),this.sse.addEventListener("error",()=>de());for(let i of Ze)this.sse.addEventListener(i,n=>{let r;try{r=JSON.parse(n.data)}catch{return}tt(i,r)});this.sse.addEventListener("cursor",i=>{let n;try{n=JSON.parse(i.data)}catch{return}if(!n||n.resync!==!0&&n.startup!==!0)return;let r=n.resync===!0,l=n.startup===!0&&!r;console.log(r?"[LiveSync] Server could not replay everything; refetching the document":"[LiveSync] Checking the served document against the version this tab was served"),this._fetchServedDocument(typeof n.seq=="number"?n.seq:void 0,{repair:r,startup:l})}),this.sse.addEventListener("presence",i=>{let n;try{n=JSON.parse(i.data)}catch{return}xt(n),this._lastRoster=n,this._editing&&this._editing.roster(n)}),this.sse.onmessage=i=>{let n=JSON.parse(i.data),{seq:r}=n;if(typeof r=="number"&&r<=this.lastSeenSeq){this._log(`Dropping stale message: seq=${r}, lastSeen=${this.lastSeenSeq}`);return}if(typeof r=="number"&&(this.lastSeenSeq=r),n.type==="notification"){if(this._maybeAcceptExternalChange(n))return;this.handleNotification(n);return}if(n.error){console.error("[LiveSync] Server error:",n.error),this.onError&&this.onError(new Error(n.error));return}if(this._applyEtagFrame(n))return;let{html:l,sender:o,identityMap:a}=n;if(o===this.clientId){this._log("Ignoring own message (sender matches clientId)");return}if(typeof l!="string"){console.error("[LiveSync] Received invalid html, ignoring");return}let h=typeof n.etag=="string"&&n.etag?n.etag:null;if(this.lane==="live"&&!h&&$e()){this._log(`Dropping an unstamped live frame on a stamping host (seq=${r})`);return}if(this.lane==="saved"&&l===this._represented.bytes){this._represented=Object.freeze({bytes:l,etag:h||null,seq:r??null}),P(h);return}if(h&&l===this.lastHtml){this._log(`Taking the stamp from a peer save of content already applied (seq=${r})`),P(h),y&&y.isSaveConflicted()&&(y.conflictResolvedBySync(h),this._saveAfterMerge(b(),!1));return}this._log(`Received update from: ${o} (my clientId: ${this.clientId}, seq=${r})`),this.applyUpdate(l,r,a,h,n.by),this.onUpdate&&this.onUpdate({html:l,sender:o,seq:r,identityMap:a,etag:h})},this.sse.onerror=()=>{this.sse.readyState===EventSource.CONNECTING?console.log("[LiveSync] Reconnecting..."):this.sse.readyState===EventSource.CLOSED&&(console.log("[LiveSync] Connection closed"),this.onError&&this.onError(new Error("Connection closed"))),this.onDisconnect&&this.onDisconnect()}}listenForSnapshots(){this._snapshotHandler=e=>{if(!e.detail||e.detail.forSave!==!0)return;this._saveTicket=this._ticket();let{documentElement:t}=e.detail;if(!t)return;this._log("snapshot-ready received, preparing to send");let i=this.identity.exportMap(t,D);this._savedSnapshot?.abort?.abort();let n={html:null,steps:null,copy:null,abort:null,identityMap:i,ticket:this._saveTicket,captureId:e.detail.captureId??null};if(e.detail.sliced){n.copy=Oe(t),n.abort=new AbortController;let{signal:r}=n.abort;Promise.all([import("./c-L6KVXPBO.js"),import("./c-ZWBI4HYK.js")]).then(([{serializeForSyncSteps:l},{runSliced:o}])=>{if(r.aborted||typeof n.html=="string")return;let a=(function*(){let h=yield*l(n.copy);n.html=h,n.steps=null})();return n.steps=a,o(a,{signal:r})}).catch(()=>{})}else n.html=T(t);this._savedSnapshot=n},document.addEventListener("clay:snapshot-ready",this._snapshotHandler)}_enqueueSend(e,t,i=null){if(!this._profile){this._queuedSend={html:e,identityMap:t,etag:i},this._resolveProfile().then(()=>this._flushQueuedSend());return}if(this._sendInFlight){this._queuedSend={html:e,identityMap:t,etag:i};return}this._postUpdate(e,t,i)}_flushQueuedSend(){if(this.isDestroyed||this._sendInFlight)return;let e=this._queuedSend;e&&(this._queuedSend=null,this._postUpdate(e.html,e.identityMap,e.etag))}_relayCommit(e=null,t=null){if(this.isDestroyed)return;let i=se(),n=this._savedSnapshot;if(n&&(n.captureId??null)!==(e??null)){this._log("Skipping send - snapshot belongs to a different capture");return}let r=n;if(this._savedSnapshot=null,r?.copy&&typeof r.html!="string")if(r.abort?.abort(),r.steps)for(let c=r.steps.next();!c.done;c=r.steps.next());else r.html=T(r.copy);if(!r||typeof r.html!="string")return;let l=r;if(typeof t=="string"){try{l=lt(r,t,this.identity)}catch(c){this._log(`Skipping send - page relay failed: ${c&&c.message}`);return}if(!l){this._log("Skipping send - accepted capture has no page article");return}}let o=Bt(e)??t,a=typeof o=="string"?We(o):0;l={...l,html:Nt(Ye(l.html,Math.max(Je(),a)),o)};let h=!i&&l.html===this.lastHtml;if(this._setPeerBase(l.html,l.identityMap,l.ticket),h){this._log("Skipping send - HTML unchanged");return}this._enqueueSend(l.html,l.identityMap,i||null)}_postUpdate(e,t,i=null,n=0){this._log(`Sending update (HTML length: ${e.length})`),this._sendInFlight=!0;let r=!1,l=this._profile||pe.legacy;fetch(new URL(l.relayPath,window.location.origin).href,{method:"POST",headers:{"Content-Type":"application/json",[l.documentHeader]:window.location.href,[ze]:String(1)},body:Pt(l,e,this.clientId,t,i)}).then(o=>{o.ok||(console.warn("[LiveSync] Save returned status:",o.status),r=o.status>=500||o.status===408||o.status===429)}).catch(o=>{console.error("[LiveSync] Save failed:",o),this.onError&&this.onError(o),r=!0}).finally(()=>{this._sendInFlight=!1;let o=this._queuedSend;if(this._queuedSend=null,o){this._postUpdate(o.html,o.identityMap,o.etag);return}!r||!i||n>=3||this.isDestroyed||(this._sendInFlight=!0,setTimeout(()=>{if(this._sendInFlight=!1,this.isDestroyed)return;let a=this._queuedSend;this._queuedSend=null,a?this._postUpdate(a.html,a.identityMap,a.etag):this._postUpdate(e,t,i,n+1)},500*2**n))})}_startPresence(e,t){return this.isDestroyed||this._startGen!==t||this._presenceLease?null:e.connect({send:i=>this._postPresence(i)}).then(i=>this.isDestroyed||this._startGen!==t?(typeof i?.stop=="function"?i.stop():i?.detach(),null):(this._presenceLease=i||null,Ue("presence-editing")),()=>!1).then(i=>{if(!(!i||this.isDestroyed||this._startGen!==t||this._editing))return R().then(n=>{this.isDestroyed||this._startGen!==t||this._editing||(this._editing=new n.EditingSender({}),this._presenceQuiesced?this._editing.stop():(this._editing.start(),this._editing.roster(this._lastRoster)))})})}_postPresence(e){let t=new URL("/_/presence",window.location.origin);return t.searchParams.set("client-id",this.clientId),fetch(t.href,{method:"POST",headers:{"Content-Type":"application/json","Document-URL":window.location.href},body:JSON.stringify(e)}).then(i=>i.ok,()=>!1)}_maybeAcceptExternalChange(e){if(this.lane!=="live")return!1;let t=e.data;return t&&t.kind==="external-change"?(typeof t.html=="string"?this._enqueueExternal(t.html,e.seq,t.etag,t.by):this._fetchExternalChange(e.seq),!0):typeof e.msg=="string"&&e.msg.endsWith("changed on disk outside this tab")?(this._fetchExternalChange(e.seq),!0):!1}_enqueueExternal(e,t,i,n){if(typeof t=="number"){if(t<=this._lastExternalSeq){this._log(`Dropping replayed external change: seq=${t}`);return}this._lastExternalSeq=t}this._pendingExternal={html:e,seq:t,saveEpoch:this._saveEpoch,etag:typeof i=="string"&&i?i:null,by:n??null},this._scheduleNextFrame()}_fetchExternalChange(e){if(typeof e=="number"){if(e<=this._lastExternalSeq)return;this._lastExternalSeq=e}this._fetchServedDocument(e)}_fetchServedDocument(e,{attempt:t=0,repair:i=!1,startup:n=!1}={}){if(n&&(this._morphInFlight||this._pendingHtml!=null||this._pendingExternal!=null)){this._retryStartup(t);return}let r=this._saveEpoch,l=this._startGen,o=this.lastSeenSeq,a=this._applyGen,h=++this._servedFetchId;i&&typeof e!="number"&&(e=this._lastExternalSeq),fetch(new URL(window.location.href),{cache:"no-store"}).then(c=>c.ok?c.text():null).then(c=>{if(this.isDestroyed||c==null||this._startGen!==l)return;let d=At(c),_=n||i&&!!d;if(_){if(h!==this._servedFetchId){i&&this._retryStartup(t+1,{repair:i,startup:n},typeof e=="number"?Math.max(e,this._lastExternalSeq):e);return}if(r!==this._saveEpoch||o!==this.lastSeenSeq||a!==this._applyGen||this._morphInFlight||this._pendingHtml!=null||this._pendingExternal!=null){this._retryStartup(t+1,{repair:i,startup:n},e);return}if(d){if(d===re()){(i||n)&&this.lane==="saved"&&(this._represented=Object.freeze({bytes:c,etag:d,seq:e??null}));return}}else if(!i)return}else if(typeof e=="number"&&e<this._lastExternalSeq){i&&t<3&&this._fetchServedDocument(this._lastExternalSeq,{attempt:t+1,repair:i,startup:n});return}else if(this._saveEpoch>r){t<3&&(console.log("[LiveSync] Refetching external change: own save landed mid-fetch"),this._fetchServedDocument(e,{attempt:t+1,repair:i,startup:n}));return}this._pendingExternal={html:c,seq:e,saveEpoch:r,etag:d,by:null,fetchOptions:{repair:i,startup:n,attempt:t,versionCheck:_},startGen:l,seenSeq:o,applyGen:a,fetchId:h},this._scheduleNextFrame()}).catch(c=>{this._log("External-change fetch failed",c),typeof e=="number"&&this._lastExternalSeq===e&&(this._lastExternalSeq=e-1)})}_retryStartup(e=0,t={startup:!0},i){this.isDestroyed||e>3||(clearTimeout(this._startupRetry),this._startupRetry=setTimeout(()=>{if(this._startupRetry=null,!this.isDestroyed){if(this._morphInFlight||this._pendingHtml!=null||this._pendingExternal!=null){this._retryStartup(e,t,i);return}this._fetchServedDocument(i,{...t,attempt:e})}},16))}applyUpdate(e,t,i,n,r){this.isDestroyed||(this._pendingHtml=e,this._pendingSeq=t,this._pendingIdentityMap=i,this._pendingEtag=n??null,this._pendingBy=r??null,this._scheduleNextFrame())}prepareHandoff(e={}){return this._handoff?Promise.resolve(this._handoff):this.isDestroyed?Promise.reject(new Error("LiveSync: stopped")):(this._handoffHeld=!0,this._rafHandle!=null&&(this._cancelFrame(this._rafHandle),this._rafHandle=null),import("./c-NYJ577NL.js").then(({engineHandoff:t})=>t(this,e)).then(t=>this._handoff=t))}_scheduleNextFrame(){this.isDestroyed||this._handoffHeld||this._rafHandle==null&&(this._morphInFlight||(this._rafHandle=this._requestFrame(()=>this._runPending())))}async _runPending(){if(this._rafHandle=null,this.isDestroyed)return;if(!A()){this._morphInFlight=!0;try{await J()}catch(r){this._log("Merge engine failed to load",r),this._engineRetry=setTimeout(()=>this._scheduleNextFrame(),2e3);return}finally{this._morphInFlight=!1}if(this.isDestroyed)return}let e=this._pendingExternal,t=e?.fetchOptions||null,i=!!(t?.startup||t?.versionCheck),n=!1;if(e!=null&&(i&&this._pendingHtml!=null?n=!1:this._pendingHtml==null?n=!0:n=!(typeof e.seq=="number"&&typeof this._pendingSeq=="number"&&this._pendingSeq<e.seq)),n)if(this._pendingExternal=null,typeof e.seq=="number"&&e.seq<this._lastExternalSeq)i&&t?.repair?this._retryStartup((t.attempt||0)+1,t,this._lastExternalSeq):this._log("Dropping superseded external change at drain");else if(i&&e.startGen!==this._startGen)this._log("Dropping superseded startup check at drain");else if(i&&e.fetchId!==this._servedFetchId)t?.repair?this._retryStartup((t.attempt||0)+1,t,this._lastExternalSeq):this._log("Dropping superseded startup check at drain");else if(i&&(e.saveEpoch!==this._saveEpoch||e.seenSeq!==this.lastSeenSeq||e.applyGen!==this._applyGen))this._retryStartup((t.attempt||0)+1,t,e.seq);else if(i&&e.etag!=null&&e.etag===re())this._log("Startup check found the same version: nothing to apply");else if(!i&&e.saveEpoch!==this._saveEpoch)console.log("[LiveSync] Refetching external change: own save landed after queue"),this._fetchServedDocument(e.seq,t||{});else{this._morphInFlight=!0;try{await this._doApplyExternal(e.html,e.seq,e.etag,e.by,t)}catch(r){console.error("[LiveSync] applyExternal failed:",r)}finally{this._morphInFlight=!1}}else{let r=this._pendingHtml,l=this._pendingSeq,o=this._pendingIdentityMap,a=this._pendingEtag,h=this._pendingBy;if(this._pendingHtml=null,this._pendingSeq=null,this._pendingIdentityMap=null,this._pendingEtag=null,this._pendingBy=null,r==null)return;this._morphInFlight=!0;try{await this._doApplyUpdate(r,l,o,a,h)}catch(c){console.error("[LiveSync] applyUpdate failed:",c)}finally{this._morphInFlight=!1}}!this.isDestroyed&&(this._pendingHtml!=null||this._pendingExternal!=null)&&this._scheduleNextFrame()}_ticket(){return++this._agreeSeq}_setDiskBase(e,t){t<=this._diskBaseTicket||(this._diskBase=e,this._diskBaseTicket=t)}_setPeerBase(e,t,i){return i<this._peerBaseTicket?!1:(this._peerBaseTicket=i,this.lastHtml=e,this._lastIdentityMap=t&&typeof t=="object"&&!Array.isArray(t)?t:null,!0)}_requestFrame(e){if(ce()){if(typeof MessageChannel=="function"){let n=new MessageChannel,r=!0;return n.port1.onmessage=()=>{n.port1.close(),r&&e()},n.port2.postMessage(null),{cancel:()=>{r=!1,n.port1.close()}}}let i=setTimeout(e,0);return{cancel:()=>clearTimeout(i)}}if(typeof window<"u"&&typeof window.requestAnimationFrame=="function"){let i=window.requestAnimationFrame(e);return{cancel:()=>window.cancelAnimationFrame?.(i)}}let t=setTimeout(e,16);return{cancel:()=>clearTimeout(t)}}_cancelFrame(e){e?.cancel?.()}async _mergeIncoming(e,t,{base:i,baseIdentityMap:n=null,captureLocal:r,synthetic:l,source:o="peer",seq:a=null,etag:h=null,extra:c={}}){A()||await J();let{beginApply:d,completeApply:_,failApply:g,beginLineageCapture:E}=ht()||await V(),f,u=p=>{f=E(I.list());let v=Lt();try{let w=A().HyperMorph.mergeDocument({...p,lineage:f.lineage});return f.returned(),w}catch(w){throw f.invalidate(I.list()),f.finish(I.list()),w}finally{v()}},S=this.identity,k=Te,x=Ct(new WeakMap),N=p=>me(p)?{first:x,map:p,then:x}:x,O=l?p=>x(p)||S.idOf(D(p)||p)||null:x,H=e,we=new Map;if(me(t)){H=new DOMParser().parseFromString(e,"text/html"),ie(H);let p=A().HyperMorph.importMap(H.documentElement,t);for(let v of H.querySelectorAll("[data-id], [id]")){let w=x(v),De=w&&p.get(v);De&&we.set(w,De)}}H=ut(H);let Z={live:document,remote:H,ignore:p=>p.matches(_t),opaque:p=>p.matches(gt)||z()&&qe(p),remoteWins:p=>p.matches(It),ignoreAttribute:(p,v,w)=>Ht(p,v,w)||z()&&Re(w||p,v),attributeMerge:ot,protectFocusedValue:!0,restoreFocus:document.activeElement?.localName!=="clay-editor-ui",keepLiveOnly:o==="peer",scripts:{mergeTags:A().mergeTagRecognizers},hooks:{beforeAttributeUpdated:k},...c},ke=this.lane==="live"&&b(),be=he(),G,ee=null,C=null;if(i==null)G=u({...Z,base:null,local:{root:X(r()),toLive:D},identity:{local:O,remote:N(t)}});else if(ke){let p=r(),v=p.cloneNode(!0);ee=X(p),C=d({source:o,seq:a,etag:h,root:ee,recoveryRoot:v,domain:o==="disk"?"save":"sync"});try{G=u({...Z,base:ut(i),local:{root:ee,toLive:D},identity:{base:N(n),local:O,remote:N(t)}})}catch(w){throw g(C,w),w}}else{let p=X(r()),v=p.ownerDocument;v.documentElement!==p&&v.replaceChild(p,v.documentElement),G=u({...Z,base:v,local:{root:p,toLive:D},fastPath:!0,identity:{base:O,local:O,remote:N(t)}})}let U=this._ticket();this._morphTicket=U;let F;try{F=await G}catch(p){f.invalidate(I.list());try{C&&g(C,p,{ticket:U})}finally{f.finish(I.list())}throw p}let mt=he().gen!==be.gen,xe;try{f.prepareComplete(F,I.list()),xe=C?_(C,F.conflicts,{ticket:U}):[]}finally{f.finish(I.list())}this.lane==="live"&&F.localDiverged?Ve():ke&&!F.localDiverged&&Xe(be);let vt=new Set(me(t)?Object.values(t):[]);for(let[p,v]of F.identities){let w=vt.has(v)?v:we.get(v);w&&S.adopt(p,w)}return{report:F,ticket:U,typedDuringWait:mt,conflictIds:xe}}_saveAfterMerge(e,t){(e||t)&&Ke()&&(y?y.savePageThrottled():Dt())}async _doApplyUpdate(e,t,i,n,r=null){if(ue(e)){await fe();return}this.lane==="live"&&!y&&await R(),this._log("applyUpdate - pausing mutations and morphing"),this.isPaused=!0;let l=window.scrollX,o=window.scrollY;q.pause(),oe();let a=!1,h=!1,c=!1;try{if(this.lane==="live"&&b()&&this.lastHtml===null){console.log("[LiveSync] Holding incoming update: unsaved local edits and no baseline to merge against"),this._setHeld("live",!0,null);let f=this._saveEpoch,u=this.lastSeenSeq;clearTimeout(this._holdRetryPeer),this._holdRetryPeer=setTimeout(()=>{this._holdRetryPeer=null,!(this.isDestroyed||this._pendingHtml!=null)&&this._saveEpoch===f&&this.lastSeenSeq===u&&(this._pendingHtml=e,this._pendingSeq=t,this._pendingIdentityMap=i,this._pendingBy=r,this._scheduleNextFrame())},3e3);return}this._setHeld("live",!1);let{report:d,ticket:_,typedDuringWait:g,conflictIds:E}=await this._mergeIncoming(e,i,{base:this.lastHtml,baseIdentityMap:this._lastIdentityMap,captureLocal:()=>M({flushUndo:!1}),synthetic:!0,source:"peer",seq:t,etag:n});if(a=d.localDiverged,h=g,ne(),window.scrollTo(l,o),this._setPeerBase(e,i,_),this._applyGen++,this._acceptedSaveTicket>_||(typeof n=="string"&&n?(P(n),c=!0):le()),this.lane==="live"&&!a&&!b()){let{forSave:f,forComparison:u,forDirty:S}=Y({emitForSync:!1,flushUndo:!1});y.setLastSavedBaselines(u,S),this._setDiskBase(f,this._ticket())}this.lane==="saved"&&(this._represented=Object.freeze({bytes:e,etag:n||null,seq:t??null})),document.dispatchEvent(new CustomEvent("clay:sync-applied",{detail:{seq:t,source:this.lane==="saved"?"disk":"peer",lane:this.lane,by:r||null,html:e,report:d,unresolved:this.unresolvedConflicts,conflictIds:E}}))}finally{this._log("applyUpdate - morph complete, resuming mutations"),q.resume(),ae(),await new Promise(d=>setTimeout(d,0)),this.isPaused=!1}c&&y?.conflictResolvedBySync(n),this._saveAfterMerge(a,h)}async _doApplyExternal(e,t,i=null,n=null,r=null){if(ue(e)){await fe();return}this.lane==="live"&&!y&&await R();let l=this._diskBase;this._log(`applyExternal - external disk change (seq=${t})`),this.isPaused=!0;let o=window.scrollX,a=window.scrollY;q.pause(),oe();let h=!1,c=!1,d=!1;try{if(this.lane==="live"&&b()&&this._diskBase===null){if(console.log("[LiveSync] Holding external change: unsaved local edits and no baseline to merge against"),this._setHeld("external",!0,null),r?.startup||r?.versionCheck){clearTimeout(this._holdRetryExt),this._holdRetryExt=setTimeout(()=>{if(this._holdRetryExt=null,this.isDestroyed)return;let S=typeof t=="number"?Math.max(t,this._lastExternalSeq):t;this._retryStartup(0,r,S)},3e3);return}let u=this._saveEpoch;clearTimeout(this._holdRetryExt),this._holdRetryExt=setTimeout(()=>{this._holdRetryExt=null,!(this.isDestroyed||this._pendingExternal!=null)&&(this._pendingExternal={html:e,seq:t,saveEpoch:u,etag:i,by:n},this._scheduleNextFrame())},3e3);return}this._setHeld("external",!1);let{report:_,ticket:g,typedDuringWait:E,conflictIds:f}=await this._mergeIncoming(e,null,{base:this._diskBase,captureLocal:()=>Ne().saveClone,synthetic:!1,source:"disk",seq:t,etag:i,extra:{beforeApply:u=>Rt(u.documentElement,this.lane)}});if(h=_.localDiverged,c=E,ne(),this._setDiskBase(e,g),window.scrollTo(o,a),this._acceptedSaveTicket>g||(typeof i=="string"&&i?(P(i),d=!0):le()),this.lane==="live"&&!h&&!b()){y.setLastSavedBaselines(...qt()),y.setUnsavedChanges(!1);let u=M({flushUndo:!1});this._setPeerBase(T(u),this.identity.exportMap(u,D),g),this._applyGen++}this.lane==="saved"&&(this._represented=Object.freeze({bytes:e,etag:i||null,seq:t??null})),document.dispatchEvent(new CustomEvent("clay:sync-applied",{detail:{seq:t,source:"disk",etag:typeof i=="string"&&i?i:null,by:n||null,html:e,report:_,conflictIds:f,unresolved:this.unresolvedConflicts}}))}finally{this._log("applyExternal - morph complete, resuming mutations"),q.resume(),ae(),await new Promise(_=>setTimeout(_,0)),this.isPaused=!1}d&&y?.conflictResolvedBySync(i),this._saveAfterMerge(h,c),l!=null&&j(l)===j(e)&&y&&y.schedulePaintHeal(()=>this._diskBase==null?null:j(this._diskBase))}handleNotification({msgType:e,msg:t,action:i,persistent:n,data:r}){this._log(`Notification received: ${e} - ${t}`),e==="data-loss"||(n&&window.toastPersistent?window.toastPersistent(t,e):window.toast?window.toast(t,e):console.log(`[LiveSync] Notification: ${t}`)),document.dispatchEvent(new CustomEvent("clay:notification",{detail:{msgType:e,msg:t,action:i,persistent:n,data:r}})),this.onNotification&&this.onNotification({msgType:e,msg:t,action:i,persistent:n,data:r})}stop(){this.cleanup(),this.isDestroyed=!0,console.log("[LiveSync] Stopped")}editParticipant(){return R().then(e=>e.syncParticipant(this))}},K=null;Ge((s,e)=>{K=typeof s=="string"?{html:s,captureId:e?.captureId??null}:null});var Bt=s=>K&&(K.captureId??null)===(s??null)?K.html:null;function Nt(s,e){if(typeof e!="string"||e===s)return s;let t=i=>new DOMParser().parseFromString(i,"text/html").documentElement;return t(s).isEqualNode(t(e))?e:s}var Ee=new Se;typeof window<"u"&&!ft&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Ee.start()):Ee.start());var vn=(s,e,t)=>J().then(({morph:i})=>i(s,e,t));var Sn=Ee;export{I as a,_t as b,It as c,Se as d,Ee as e,vn as f,Sn as g};
@@ -1 +1 @@
1
- import{a as b,b as C,c as O,d as L,e as R,f as A,g as S,h as T,i as I}from"../c-IJHF4IO6.js";import{a as l,b as u,c,d as f}from"../c-U65PREMC.js";import{a as d,b as E,c as m,d as p}from"../c-FJDTDGDA.js";import"../c-QCDVDZIR.js";import"../c-VKEDWYDF.js";import{a}from"../c-MZCOGNZL.js";import"../c-IJUK2GPW.js";import{f as s}from"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import"../c-PNZIJFG7.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var N=[d,R,A,b,l].join(", "),x=[E,S,C,u],o=null,n=null,i=!1,D=t=>{let e=t.parentNode||t;for(let q of x)q(e)};function r(){i=!0,!n&&(n=a.onAddElement({selectorFilter:N,require:"observed",pausable:!1,debounce:0},t=>{i&&t.forEach(({element:e})=>D(e))}))}function k(){i=!1,n&&(n(),n=null)}function h(){return o||(p(),I(),L(),f(),o={selector:N},s&&r(),o)}h();function w(t=document){return{enable(){for(let e of x)e(t);r()},quiesce(){i=!1},resume(){i=!0},dispose(){k(),m(),T(),O(),c()}}}function y(){return{id:"clay:controls",order:110,prepare(t={}){let e=w();return t.initial!==!0?e:{enable:()=>r(),quiesce:()=>e.quiesce(),resume:()=>e.resume(),dispose:()=>e.dispose()}}}}var F=h;export{w as controlsLease,F as default,h as init,h as install,y as modeParticipant};
1
+ import{a as b,b as C,c as O,d as L,e as R,f as A,g as S,h as T,i as I}from"../c-U35T5NAY.js";import{a as l,b as u,c,d as f}from"../c-WOJ2RTV4.js";import{a as d,b as E,c as m,d as p}from"../c-RGFPLQGV.js";import"../c-QCDVDZIR.js";import"../c-VKEDWYDF.js";import{a}from"../c-MZCOGNZL.js";import"../c-IJUK2GPW.js";import{f as s}from"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import"../c-UW6MMZ4V.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var N=[d,R,A,b,l].join(", "),x=[E,S,C,u],o=null,n=null,i=!1,D=t=>{let e=t.parentNode||t;for(let q of x)q(e)};function r(){i=!0,!n&&(n=a.onAddElement({selectorFilter:N,require:"observed",pausable:!1,debounce:0},t=>{i&&t.forEach(({element:e})=>D(e))}))}function k(){i=!1,n&&(n(),n=null)}function h(){return o||(p(),I(),L(),f(),o={selector:N},s&&r(),o)}h();function w(t=document){return{enable(){for(let e of x)e(t);r()},quiesce(){i=!1},resume(){i=!0},dispose(){k(),m(),T(),O(),c()}}}function y(){return{id:"clay:controls",order:110,prepare(t={}){let e=w();return t.initial!==!0?e:{enable:()=>r(),quiesce:()=>e.quiesce(),resume:()=>e.resume(),dispose:()=>e.dispose()}}}}var F=h;export{w as controlsLease,F as default,h as init,h as install,y as modeParticipant};
@@ -1 +1 @@
1
- import{R as e,h as i}from"../c-VMXCX52Q.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import{a as p}from"../c-5VYOWDTI.js";import"../c-P73XPAOA.js";import"../c-ZPI7M5U5.js";import{a as f,b as m}from"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import{a as d}from"../c-MZCOGNZL.js";import"../c-MFB74XVN.js";import"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import{c}from"../c-IJUK2GPW.js";import{f as a}from"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import"../c-PNZIJFG7.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import{s as n,v as o}from"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function y(){d.onAnyChange({debounce:0,omitChangeDetails:!0,require:"autosave"},()=>{i()&&e.noteActivity()})}function A(){document.addEventListener("input",t=>{t.target.closest(f)&&(t.isTrusted&&!o(n(t.target),"dirty")&&c(),i()&&e.noteActivity())},!0)}function g(){let t=v=>{if(!e.pending())return;let r=v.target;if(!r||typeof r.closest!="function")return;let s=r.closest("input, textarea, select, [contenteditable]");s&&(o(n(s),"dirty")||i()&&e.noteActivity())};document.addEventListener("input",t,!0),document.addEventListener("compositionupdate",t,!0)}var l=!1;function u(){l||document.documentElement.matches(m)&&a&&(l=!0,p(!0),y(),A(),g())}u();var C=u;function L(){return{id:"clay:autosave",order:20,prepare(t={}){return t.initial===!0?{enable(){},quiesce(){},resume(){},dispose(){}}:{enable:u,quiesce(){},resume(){},dispose(){}}}}}export{C as default,u as init,L as modeParticipant};
1
+ import{R as e,h as i}from"../c-FC5RUFPR.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import{a as p}from"../c-5VYOWDTI.js";import"../c-P73XPAOA.js";import"../c-ZPI7M5U5.js";import{a as f,b as m}from"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import{a as d}from"../c-MZCOGNZL.js";import"../c-EHAR4RJJ.js";import"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import{c}from"../c-IJUK2GPW.js";import{f as a}from"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import"../c-UW6MMZ4V.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import{s as n,v as o}from"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function y(){d.onAnyChange({debounce:0,omitChangeDetails:!0,require:"autosave"},()=>{i()&&e.noteActivity()})}function A(){document.addEventListener("input",t=>{t.target.closest(f)&&(t.isTrusted&&!o(n(t.target),"dirty")&&c(),i()&&e.noteActivity())},!0)}function g(){let t=v=>{if(!e.pending())return;let r=v.target;if(!r||typeof r.closest!="function")return;let s=r.closest("input, textarea, select, [contenteditable]");s&&(o(n(s),"dirty")||i()&&e.noteActivity())};document.addEventListener("input",t,!0),document.addEventListener("compositionupdate",t,!0)}var l=!1;function u(){l||document.documentElement.matches(m)&&a&&(l=!0,p(!0),y(),A(),g())}u();var C=u;function L(){return{id:"clay:autosave",order:20,prepare(t={}){return t.initial===!0?{enable(){},quiesce(){},resume(){},dispose(){}}:{enable:u,quiesce(){},resume(){},dispose(){}}}}}export{C as default,u as init,L as modeParticipant};
@@ -1 +1 @@
1
- import{a as m}from"../c-VKEDWYDF.js";import{r as h}from"../c-VMXCX52Q.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-P73XPAOA.js";import"../c-ZPI7M5U5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-MZCOGNZL.js";import"../c-MFB74XVN.js";import"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import{d as g}from"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import{f as p}from"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import{b as f}from"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import"../c-PNZIJFG7.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var s=()=>window.clay?.conflicts||null,o=!1,r=null,l=null;function e(t){o||(o=!0,v(),import("../c-K4M76VPM.js").then(n=>{r=n,n.start(t)},n=>{console.error("clayjs: the conflict notice could not be downloaded; it will try again on the next conflict",n),o=!1,u()}))}function u(){l||=new AbortController;let{signal:t}=l;document.addEventListener("clay:sync-conflicts-changed",w,{signal:t}),document.addEventListener("clay:save-conflict",b,{signal:t}),document.addEventListener("clay:document-upgraded",k,{signal:t}),document.addEventListener("clay:undo-kept",x,{signal:t})}function v(){l?.abort(),l=null}function w(t){s()?.size&&e(t)}function b(t){e(t)}function k(t){e(t)}function x(t){t?.detail?.ok===!0&&e(t)}var C="conflicts",L="undo",y=t=>f.local.get(t)?.count>0;function D(){y(L)&&e(null),y(C)&&import("../c-OIDRZKAF.js").then(t=>{!o&&t.pendingConflicts()>0&&e(null)},()=>{})}function N(){let t=(s()?.list?.()??[]).filter(n=>!n.claimedBy).map(n=>n.id);return t.length?t:h()?["save"]:[]}var a=null,i=0;function E(){let t=++i;g().then(n=>{let c=n.extensions.includes("data-guard-v1")?n.document?.dataGuard?.href:null;return t!==i||typeof c!="string"||!c?null:import("../c-CVSWLX3X.js").then(d=>{t===i&&(a=d,d.start({href:c}))})}).catch(n=>{console.error("clayjs: the data-loss notice could not start; it will try again on the next open",n)})}function j(){i++,a?.stop(),a=null}function A(){return{id:"clay:conflict-notice",order:960,prepare(t={}){return{enable(){t.initial!==!0&&(!r&&!o&&u(),E())},quiesce(){let n=N();if(n.length)throw Object.assign(new Error("clay.conflict-notice: a conflict here is still unresolved"),{code:"conflict",pending:n})},resume(){},dispose(){v(),o=!1,r?.stop?.(),r=null,j()}}}}}m(()=>{p&&(s()?.size?e(null):(u(),D()),E())});export{A as conflictNoticeParticipant,A as modeParticipant};
1
+ import{a as m}from"../c-VKEDWYDF.js";import{r as h}from"../c-FC5RUFPR.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-P73XPAOA.js";import"../c-ZPI7M5U5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-MZCOGNZL.js";import"../c-EHAR4RJJ.js";import"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import{d as g}from"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import{f as p}from"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import{b as f}from"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import"../c-UW6MMZ4V.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var s=()=>window.clay?.conflicts||null,o=!1,r=null,l=null;function e(t){o||(o=!0,v(),import("../c-EXZOA6XY.js").then(n=>{r=n,n.start(t)},n=>{console.error("clayjs: the conflict notice could not be downloaded; it will try again on the next conflict",n),o=!1,u()}))}function u(){l||=new AbortController;let{signal:t}=l;document.addEventListener("clay:sync-conflicts-changed",w,{signal:t}),document.addEventListener("clay:save-conflict",b,{signal:t}),document.addEventListener("clay:document-upgraded",k,{signal:t}),document.addEventListener("clay:undo-kept",x,{signal:t})}function v(){l?.abort(),l=null}function w(t){s()?.size&&e(t)}function b(t){e(t)}function k(t){e(t)}function x(t){t?.detail?.ok===!0&&e(t)}var C="conflicts",L="undo",y=t=>f.local.get(t)?.count>0;function D(){y(L)&&e(null),y(C)&&import("../c-OIDRZKAF.js").then(t=>{!o&&t.pendingConflicts()>0&&e(null)},()=>{})}function N(){let t=(s()?.list?.()??[]).filter(n=>!n.claimedBy).map(n=>n.id);return t.length?t:h()?["save"]:[]}var a=null,i=0;function E(){let t=++i;g().then(n=>{let c=n.extensions.includes("data-guard-v1")?n.document?.dataGuard?.href:null;return t!==i||typeof c!="string"||!c?null:import("../c-AQVQKFKB.js").then(d=>{t===i&&(a=d,d.start({href:c}))})}).catch(n=>{console.error("clayjs: the data-loss notice could not start; it will try again on the next open",n)})}function j(){i++,a?.stop(),a=null}function A(){return{id:"clay:conflict-notice",order:960,prepare(t={}){return{enable(){t.initial!==!0&&(!r&&!o&&u(),E())},quiesce(){let n=N();if(n.length)throw Object.assign(new Error("clay.conflict-notice: a conflict here is still unresolved"),{code:"conflict",pending:n})},resume(){},dispose(){v(),o=!1,r?.stop?.(),r=null,j()}}}}}m(()=>{p&&(s()?.size?e(null):(u(),D()),E())});export{A as conflictNoticeParticipant,A as modeParticipant};
@@ -1,3 +1,3 @@
1
- import{a as h}from"../c-WYFDLITL.js";import{f as m}from"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import{k as b}from"../c-PNZIJFG7.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function v(t){return(t.getAttribute("type")||"text").toLowerCase()}function d(t){let n=t.tagName;if(n==="INPUT"){let i=v(t);i==="checkbox"||i==="radio"?t.checked?t.setAttribute("checked",""):t.removeAttribute("checked"):t.setAttribute("value",t.value);return}if(n==="TEXTAREA"){t.setAttribute("data-value",t.value);return}if(n==="SELECT"){let i=t.options;for(let o=0;o<i.length;o++)i[o].selected?i[o].setAttribute("selected",""):i[o].removeAttribute("selected")}}function y(t,n=t){let i=t.tagName;if(i==="INPUT"){let o=v(t);o==="checkbox"||o==="radio"?n.checked?t.hasAttribute("checked")||t.setAttribute("checked",""):t.removeAttribute("checked"):n.value!==(t.getAttribute("value")??"")&&t.setAttribute("value",n.value);return}if(i==="TEXTAREA"){let o=n.value.startsWith(`
1
+ import{a as h}from"../c-WYFDLITL.js";import{f as m}from"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import{k as b}from"../c-UW6MMZ4V.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function v(t){return(t.getAttribute("type")||"text").toLowerCase()}function d(t){let n=t.tagName;if(n==="INPUT"){let i=v(t);i==="checkbox"||i==="radio"?t.checked?t.setAttribute("checked",""):t.removeAttribute("checked"):t.setAttribute("value",t.value);return}if(n==="TEXTAREA"){t.setAttribute("data-value",t.value);return}if(n==="SELECT"){let i=t.options;for(let o=0;o<i.length;o++)i[o].selected?i[o].setAttribute("selected",""):i[o].removeAttribute("selected")}}function y(t,n=t){let i=t.tagName;if(i==="INPUT"){let o=v(t);o==="checkbox"||o==="radio"?n.checked?t.hasAttribute("checked")||t.setAttribute("checked",""):t.removeAttribute("checked"):n.value!==(t.getAttribute("value")??"")&&t.setAttribute("value",n.value);return}if(i==="TEXTAREA"){let o=n.value.startsWith(`
2
2
  `)?`
3
3
  `+n.value:n.value;t.textContent!==o&&(t.textContent=o),t.removeAttribute("data-value");return}if(i==="SELECT"){let o=t.options,u=n.options;for(let s=0;s<o.length;s++)u[s]&&u[s].selected?o[s].hasAttribute("selected")||o[s].setAttribute("selected",""):o[s].removeAttribute("selected")}}function E(t=h){let n=`input${t}:not([type="password"]):not([type="hidden"]):not([type="file"])`,i=`textarea${t}`,o=`select${t}`,u=a=>{if(!m)return;let e=a.target;(e.matches(n)&&e.type!=="checkbox"&&e.type!=="radio"||e.matches(i))&&d(e)};document.addEventListener("input",u,!0);let s=a=>{if(!m)return;let e=a.target;if((e.matches(n)&&(e.type==="checkbox"||e.type==="radio")||e.matches(o))&&(d(e),e.type==="radio"&&e.name)){let c=e.form?[...e.form.elements]:[...document.getElementsByName(e.name)];for(let r of c)r!==e&&r.type==="radio"&&r.name===e.name&&r.form===e.form&&r.matches(n)&&d(r)}};document.addEventListener("change",s,!0);let x=[{target:document,type:"input",handler:u,options:!0},{target:document,type:"change",handler:s,options:!0}];return b((a,e)=>{let c=r=>{a.querySelectorAll(r).forEach(f=>{let A=e.original(f);A&&y(f,A)})};c(n),c(i);for(let r of a.querySelectorAll(o))if(e.original(r))for(let l of r.options){let f=e.original(l);f&&f.selected?l.hasAttribute("selected")||l.setAttribute("selected",""):l.removeAttribute("selected")}}),{stop(){for(let{target:a,type:e,handler:c,options:r}of x.splice(0))a.removeEventListener(e,c,r)}}}var p=null;function T(){return p||(p=E(h),p)}T();export{E as default,T as init,T as install};
@@ -1 +1 @@
1
- import{A as C,B as D,C as E,D as F,E as G,F as H,G as I,H as J,I as K,J as L,K as M,L as N,M as O,N as P,O as Q,P as R,Q as S,R as T,S as U,T as V,U as W,V as X,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"../c-VMXCX52Q.js";import{a as e}from"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-P73XPAOA.js";import"../c-ZPI7M5U5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-MZCOGNZL.js";import{b as c,c as d}from"../c-MFB74XVN.js";import"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import{K as b,r as a}from"../c-PNZIJFG7.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{e as SLICED_SAVE_MIN_BYTES,m as acceptedReceipt,a as addDocumentTransform,n as adoptEntryBaseline,i as autosaveIsSuspended,T as autosaveScheduler,M as baselineSettled,f as claimFailure,y as closeSavePermit,u as conflictResolvedBySync,N as currentPaintSignature,X as default,I as flushSave,D as getLastSavedBytes,B as getLastSavedContents,C as getLastSavedDirty,b as getPageContents,z as getUnsavedChanges,p as holdAllSaves,W as init,V as initHyperclaySaveButton,U as initSaveKeyboardShortcut,d as inspectSaveSize,t as isSaveConflicted,o as modeParticipant,x as openSavePermit,q as releaseAllSaves,R as releaseBootSettle,K as replacePageWith,h as resumeAutosave,v as saveGeneration,s as saveHoldReason,c as saveLimits,J as saveOverwritingConflict,G as savePage,H as savePageForce,L as savePageSoon,S as savePageThrottled,l as saveSession,j as savesAdmitted,r as savesHeld,O as schedulePaintHeal,k as sessionParked,E as setLastSavedBaselines,F as setLastSavedContents,w as setSaveGeneration,A as setUnsavedChanges,Q as styleAdoptionPending,P as styleAdoptionsSettled,g as suspendAutosave};
1
+ import{A as C,B as D,C as E,D as F,E as G,F as H,G as I,H as J,I as K,J as L,K as M,L as N,M as O,N as P,O as Q,P as R,Q as S,R as T,S as U,T as V,U as W,V as X,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"../c-FC5RUFPR.js";import{a as e}from"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-P73XPAOA.js";import"../c-ZPI7M5U5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-MZCOGNZL.js";import{b as c,c as d}from"../c-EHAR4RJJ.js";import"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import{K as b,r as a}from"../c-UW6MMZ4V.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{e as SLICED_SAVE_MIN_BYTES,m as acceptedReceipt,a as addDocumentTransform,n as adoptEntryBaseline,i as autosaveIsSuspended,T as autosaveScheduler,M as baselineSettled,f as claimFailure,y as closeSavePermit,u as conflictResolvedBySync,N as currentPaintSignature,X as default,I as flushSave,D as getLastSavedBytes,B as getLastSavedContents,C as getLastSavedDirty,b as getPageContents,z as getUnsavedChanges,p as holdAllSaves,W as init,V as initHyperclaySaveButton,U as initSaveKeyboardShortcut,d as inspectSaveSize,t as isSaveConflicted,o as modeParticipant,x as openSavePermit,q as releaseAllSaves,R as releaseBootSettle,K as replacePageWith,h as resumeAutosave,v as saveGeneration,s as saveHoldReason,c as saveLimits,J as saveOverwritingConflict,G as savePage,H as savePageForce,L as savePageSoon,S as savePageThrottled,l as saveSession,j as savesAdmitted,r as savesHeld,O as schedulePaintHeal,k as sessionParked,E as setLastSavedBaselines,F as setLastSavedContents,w as setSaveGeneration,A as setUnsavedChanges,Q as styleAdoptionPending,P as styleAdoptionsSettled,g as suspendAutosave};
@@ -1 +1 @@
1
- import{d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as v,t as w,u as x,v as y,w as z,x as A,y as B}from"../c-MFB74XVN.js";import{a as d}from"../c-LD6UVV5R.js";import{b as e,h as f}from"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import{K as c,k as a,r as b}from"../c-PNZIJFG7.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{e as PAGE_FORMAT_META,b as addDocumentTransform,h as addSaveHeaderSource,v as buildSaveRequest,s as claimDocumentOperation,B as exitSave,c as getPageContents,j as isSaveInProgress,m as keepaliveHeld,f as knownPageFormatFloor,q as mintSaveId,d as onSaveAccepted,n as onSaveAttempt,o as onSaveOutcome,a as onSnapshot,u as operationKind,t as releaseDocumentOperation,l as releaseSaveLane,z as replacePageWith,k as reserveSaveLane,r as resetSaveAttempts,x as saveCapturedHtml,y as saveConversion,p as saveFateIsUnknown,w as saveHtml,A as setExitSave,g as setSaveHeader,i as withKeepalive};
1
+ import{d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as v,t as w,u as x,v as y,w as z,x as A,y as B}from"../c-EHAR4RJJ.js";import{a as d}from"../c-LD6UVV5R.js";import{b as e,h as f}from"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import{K as c,k as a,r as b}from"../c-UW6MMZ4V.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{e as PAGE_FORMAT_META,b as addDocumentTransform,h as addSaveHeaderSource,v as buildSaveRequest,s as claimDocumentOperation,B as exitSave,c as getPageContents,j as isSaveInProgress,m as keepaliveHeld,f as knownPageFormatFloor,q as mintSaveId,d as onSaveAccepted,n as onSaveAttempt,o as onSaveOutcome,a as onSnapshot,u as operationKind,t as releaseDocumentOperation,l as releaseSaveLane,z as replacePageWith,k as reserveSaveLane,r as resetSaveAttempts,x as saveCapturedHtml,y as saveConversion,p as saveFateIsUnknown,w as saveHtml,A as setExitSave,g as setSaveHeader,i as withKeepalive};
@@ -0,0 +1 @@
1
+ import{Q as b,z as E}from"../c-FC5RUFPR.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-P73XPAOA.js";import"../c-ZPI7M5U5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import{a as y}from"../c-MZCOGNZL.js";import{e as S}from"../c-EHAR4RJJ.js";import{a as v}from"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import"../c-UW6MMZ4V.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var T="Site-Data",M='script[data-rules-name~="api"]',R=/(?:^|[{,])\s*["']?site["']?\s*:/,h={html:null,now:null,keys:[]},l=null,i=null,u=h,g=null,m=new Set,f=new Map;function k(){let t=E();if(typeof t!="string"||!t)return!1;if(t===g)return!0;let e=d(w(t));if(!i)i=e;else for(let[n,o]of Object.entries(e)){if(m.has(n))continue;let s=f.get(n);i[n]=s&&s.sent===o?s.value:o}return f.clear(),g=t,u=h,!0}function j(t){let e=l.engine.findRulesIn(t,"api")?.rules?.site;return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function d(t){let e=j(t);if(!e)return{};let n=l.extractData(t,{site:e}).site??{};return Object.fromEntries(Object.entries(n).map(([o,s])=>[o,JSON.stringify(s)]))}var w=t=>new DOMParser().parseFromString(t,"text/html").documentElement;function O(t){if(u.html!==t){let e=d(w(t));u={html:t,now:e,keys:Object.keys(e).filter(n=>e[n]!==i[n])}}return u}function x(t){return!l||typeof t!="string"||!k()?null:{[T]:`keys=${O(t).keys.map(encodeURIComponent).join(",")}`}}function H(t,e,n){let o=document.documentElement,s=j(o),c=d(o),p=[];for(let[r,A]of Object.entries(t)){if(n.has(r)||!s||!Object.hasOwn(s,r)||c[r]!==e[r])continue;let C=new Map([...o.querySelectorAll("[data-richclay], [richclay], [editable], [clay-editable]")].map(a=>[a,a.innerHTML]));y.pause();try{l.applyData(o,{site:{[r]:A}},{site:{[r]:s[r]}}),i[r]=d(o)[r],f.set(r,{sent:e[r],value:i[r]}),p.push(r)}catch(a){console.error(`clayjs: the shared value "${r}" could not be refreshed on this page`,a)}finally{y.resume()}for(let[a,D]of C)a.isConnected&&a.innerHTML!==D&&a.dispatchEvent(new CustomEvent("clay:external-write"))}return p.length&&b(),p}function L(t,e){if(!l||!k())return;f.clear();let n=O(t).now,o=new Set((e?.refused??[]).filter(c=>c.code!=="stale").map(c=>c.key));for(let c of Object.keys(n))o.has(c)?m.add(c):(i[c]=n[c],m.delete(c));if(u=h,!e)return;let s=e.current?H(e.current,n,o):[];document.dispatchEvent(new CustomEvent("clay:site-data",{detail:{written:e.written??[],refused:e.refused??[],applied:s}}))}var U=R.test(document.querySelector(M)?.textContent??"")?(()=>{let t=import("../c-VGG3UR7I.js");return S(x),v((e,n)=>L(e,n.siteData??null)),t.then(e=>{l=e}).catch(e=>console.error("clayjs: shared site edits are not tracked on this page",e))})():Promise.resolve();export{T as SITE_DATA_HEADER,U as ready};
@@ -1 +1 @@
1
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../c-PNZIJFG7.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{r as addDocumentTransform,d as attachCaptureArtifact,j as canonicalizeReceived,g as captureArtifact,J as captureBodyForSync,x as captureForComparison,z as captureForComparisonAndDirty,y as captureForDirtyCheck,F as captureForMerge,G as captureForSave,E as captureForSaveAndComparison,f as capturePageState,M as captureRecoveryPage,u as captureSaveClone,t as captureSnapshot,s as clonePreventingOnclone,C as completeSaveCapture,I as copyCaptureClone,c as currentCaptureContext,a as currentCaptureId,K as getPageContents,n as noscriptBlocks,o as noscriptsAsText,k as onSnapshot,b as originalSnapshotNode,v as prepareForCompare,A as prepareSaveCapture,B as readCapturePageState,h as releaseCaptureArtifact,D as releaseSaveCapture,q as runSaveRenderer,m as serializeClone,w as serializeForCompare,H as serializeForSync,L as serializeRecoveryClone,e as setCapturePageState,i as setCloneCanonicalizer,l as setSaveRenderer,p as swapNoscriptMarkers};
1
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../c-UW6MMZ4V.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{r as addDocumentTransform,d as attachCaptureArtifact,j as canonicalizeReceived,g as captureArtifact,J as captureBodyForSync,x as captureForComparison,z as captureForComparisonAndDirty,y as captureForDirtyCheck,F as captureForMerge,G as captureForSave,E as captureForSaveAndComparison,f as capturePageState,M as captureRecoveryPage,u as captureSaveClone,t as captureSnapshot,s as clonePreventingOnclone,C as completeSaveCapture,I as copyCaptureClone,c as currentCaptureContext,a as currentCaptureId,K as getPageContents,n as noscriptBlocks,o as noscriptsAsText,k as onSnapshot,b as originalSnapshotNode,v as prepareForCompare,A as prepareSaveCapture,B as readCapturePageState,h as releaseCaptureArtifact,D as releaseSaveCapture,q as runSaveRenderer,m as serializeClone,w as serializeForCompare,H as serializeForSync,L as serializeRecoveryClone,e as setCapturePageState,i as setCloneCanonicalizer,l as setSaveRenderer,p as swapNoscriptMarkers};
@@ -1 +1 @@
1
- import{a,b,c}from"../c-VMXCX52Q.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-P73XPAOA.js";import"../c-ZPI7M5U5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-MZCOGNZL.js";import"../c-MFB74XVN.js";import"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import"../c-PNZIJFG7.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{c as bytesUnsaved,b as hasUnsavedChanges,a as reloadAfterDiscard};
1
+ import{a,b,c}from"../c-FC5RUFPR.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-P73XPAOA.js";import"../c-ZPI7M5U5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-MZCOGNZL.js";import"../c-EHAR4RJJ.js";import"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import"../c-UW6MMZ4V.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{c as bytesUnsaved,b as hasUnsavedChanges,a as reloadAfterDiscard};
@@ -1 +1 @@
1
- import{g as t,t as n,w as i}from"../c-MFB74XVN.js";import"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import{G as o,r as a,t as e}from"../c-PNZIJFG7.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import{w as r}from"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var s=window.clay=window.clay||{};s.internals={captureSnapshot:e,captureForSave:o,addDocumentTransform:a,region:r,save:{saveHtml:n,replacePageWith:i,isSaveInProgress:t}};var l=s.internals;export{l as default};
1
+ import{g as t,t as n,w as i}from"../c-EHAR4RJJ.js";import"../c-LD6UVV5R.js";import"../c-PGSBXHUE.js";import"../c-KU3PX7LL.js";import"../c-EQ5NBOGA.js";import"../c-IJUK2GPW.js";import"../c-C7SUMNMI.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-U4TWEIKZ.js";import{G as o,r as a,t as e}from"../c-UW6MMZ4V.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-MOP5KBWZ.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import{w as r}from"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var s=window.clay=window.clay||{};s.internals={captureSnapshot:e,captureForSave:o,addDocumentTransform:a,region:r,save:{saveHtml:n,replacePageWith:i,isSaveInProgress:t}};var l=s.internals;export{l as default};
@@ -0,0 +1 @@
1
+ import{a as X}from"./c-NL4I4KNG.js";import"./c-7SWMYKAI.js";import{f as V}from"./c-46XYM55L.js";import{b as J}from"./c-FILLTJA7.js";import{a as $}from"./c-VKEDWYDF.js";import"./c-UGHH4MB3.js";import"./c-MZCOGNZL.js";import"./c-IJUK2GPW.js";import{b as z}from"./c-CYWLPPUS.js";import{i as W}from"./c-MOP5KBWZ.js";import{a as F}from"./c-2YYDMLNZ.js";import{c as H,l as G}from"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var K={always:["lib/mutation.js","core/preserve-authored.js","core/edit-mode.js","core/mode-key.js","core/stale-host-notice.js","core/page-data.js"],editOnly:["core/snapshot.js","core/persist.js","core/admin-attrs.js","core/save-core.js","core/save.js","core/conflict-notice.js","core/recovery.js","core/unsaved-warning.js","core/autosave.js","attrs/save-freeze.js","attrs/onaftersave.js","attrs/refetch-on-save.js","attrs/add-from.js","lib/cache-bust.js"]},O={richclay:{path:"plugins/richclay.js",editOnly:!0,default:!0},indicator:{path:"plugins/indicator.js",editOnly:!0,default:!1},sync:{path:"sync/live-sync.js",editOnly:!1,default:!1},live:{path:"plugins/live.js",editOnly:!1,default:!1},blockeditor:{path:"plugins/page.js",editOnly:!0,default:!1},"blockeditor-view":{path:"plugins/page-view.js",editOnly:!1,default:!1,internal:!0},sortable:{path:"plugins/sortable.js",editOnly:!0,default:!1},undo:{path:"plugins/undo.js",editOnly:!0,default:!1},unsent:{path:"plugins/unsent.js",editOnly:!0,default:!1},cms:{path:"plugins/cms.js",editOnly:!1,default:!1},quickcrop:{path:"plugins/quickcrop.js",editOnly:!1,default:!1},upload:{path:"plugins/upload.js",editOnly:!0,default:!1},people:{path:"plugins/people.js",editOnly:!1,default:!1},menu:{path:"plugins/menu.js",editOnly:!1,default:!1},wire:{path:"plugins/wire.js",editOnly:!1,default:!1},message:{path:"plugins/message.js",editOnly:!1,default:!1},like:{path:"plugins/like.js",editOnly:!1,default:!1},"ai-edit":{path:"plugins/ai-edit.js",editOnly:!0,default:!1},demo:{path:"plugins/demo.js",editOnly:!1,default:!1},source:{path:"plugins/source.js",editOnly:!0,default:!0},"visitor-drafts":{path:"plugins/visitor-drafts.js",ownerPath:"plugins/visitor-drafts-owner.js",editOnly:!1,default:!1},"visitor-menu":{path:"plugins/visitor-menu.js",editOnly:!0,draft:!0},"bind-text":{path:"plugins/bind-text.js",editOnly:!0,default:!1},derive:{path:"plugins/derive.js",editOnly:!1,default:!1},upgrade:{path:"plugins/upgrade.js",editOnly:!1,default:!1}},S={"core/is-edit-mode.js":()=>import("./core/is-edit-mode-73OXKK5H.js"),"core/draft-mode.js":()=>import("./core/draft-mode-M5XNYBMY.js"),"lib/region-policy.js":()=>import("./lib/region-policy-KWBPROWF.js"),"lib/mutation.js":()=>import("./reader-core-AHOAP5DH.js").then(t=>t.core["lib/mutation.js"]),"core/edit-mode.js":()=>import("./reader-core-AHOAP5DH.js").then(t=>t.core["core/edit-mode.js"]),"core/mode-key.js":()=>import("./reader-core-AHOAP5DH.js").then(t=>t.core["core/mode-key.js"]),"core/stale-host-notice.js":()=>import("./reader-core-AHOAP5DH.js").then(t=>t.core["core/stale-host-notice.js"]),"core/page-data.js":()=>import("./reader-core-AHOAP5DH.js").then(t=>t.core["core/page-data.js"]),"core/preserve-authored.js":()=>import("./reader-core-AHOAP5DH.js").then(t=>t.core["core/preserve-authored.js"]),"core/snapshot.js":()=>import("./core/snapshot-N5MKDGNI.js"),"core/save-core.js":()=>import("./core/save-core-I4N6S4ED.js"),"core/save.js":()=>import("./core/save-JZ7R4ET2.js"),"core/site-edits.js":()=>import("./core/site-edits-C22O53GS.js"),"core/conflict-notice.js":()=>import("./core/conflict-notice-UNDOD4BL.js"),"core/recovery.js":()=>import("./core/recovery-VZF7RJZF.js"),"core/unsaved-warning.js":()=>import("./core/unsaved-warning-BP6ZY3PG.js"),"core/persist.js":()=>import("./core/persist-MX3VYVBN.js"),"core/admin-attrs.js":()=>import("./core/admin-attrs-43JBA6JB.js"),"core/autosave.js":()=>import("./core/autosave-HD7Y7UNV.js"),"attrs/save-freeze.js":()=>import("./attrs/save-freeze-PUYX32AK.js"),"attrs/onaftersave.js":()=>import("./attrs/onaftersave-OKSWEJQF.js"),"attrs/refetch-on-save.js":()=>import("./attrs/refetch-on-save-5CBFUJUF.js"),"attrs/add-from.js":()=>import("./attrs/add-from-T5LJXFFI.js"),"lib/cache-bust.js":()=>import("./lib/cache-bust-BL4KUQAJ.js"),"plugins/richclay.js":()=>import("./plugins/richclay-MXH2GFAZ.js"),"plugins/indicator.js":()=>import("./plugins/indicator-OLPZ4WFI.js"),"sync/live-sync.js":()=>import("./sync/live-sync-RZQSDMZW.js"),"plugins/live.js":()=>import("./plugins/live-DF5YS5AH.js"),"plugins/page.js":()=>import("./plugins/page-GZSU77JS.js"),"plugins/page-view.js":()=>import("./plugins/page-view-7MM3FEAR.js"),"plugins/sortable.js":()=>import("./plugins/sortable-BAG3MSWS.js"),"plugins/undo.js":()=>import("./plugins/undo-KLHAGV75.js"),"plugins/unsent.js":()=>import("./plugins/unsent-OA4RGBUT.js"),"plugins/cms.js":()=>import("./plugins/cms-KG6TCTR3.js"),"plugins/quickcrop.js":()=>import("./plugins/quickcrop-UHURKA2F.js"),"plugins/upload.js":()=>import("./plugins/upload-NZET3DNQ.js"),"plugins/people.js":()=>import("./plugins/people-EBWE337I.js"),"plugins/menu.js":()=>import("./plugins/menu-ESEFQARM.js"),"plugins/wire.js":()=>import("./plugins/wire-S5ATC4QI.js"),"plugins/message.js":()=>import("./plugins/message-LQ6EDH4V.js"),"plugins/like.js":()=>import("./plugins/like-EV7MTZ56.js"),"plugins/ai-edit.js":()=>import("./plugins/ai-edit-WDV2GLDU.js"),"plugins/demo.js":()=>import("./plugins/demo-LMCMBILC.js"),"plugins/visitor-drafts.js":()=>import("./plugins/visitor-drafts-ZE6PCAFP.js"),"plugins/visitor-drafts-owner.js":()=>import("./plugins/visitor-drafts-owner-TLECTYWS.js"),"plugins/visitor-menu.js":()=>import("./plugins/visitor-menu-5XY57JQA.js"),"plugins/bind-text.js":()=>import("./plugins/bind-text-NX46N5UV.js"),"plugins/source.js":()=>import("./plugins/source-OYHDXKTB.js"),"plugins/derive.js":()=>import("./plugins/derive-R4USHZ7P.js"),"plugins/upgrade.js":()=>import("./plugins/upgrade-SZQJYEQQ.js")},re=["visitor-drafts","visitor-menu","richclay","indicator","sortable","undo","unsent","quickcrop","upload","people","menu","upgrade","cms","blockeditor-view","sync","live","blockeditor","message","like","wire","ai-edit","demo","derive","bind-text","source"],ae={cms:["quickcrop","upload","menu"],"ai-edit":["wire"],blockeditor:["live","sync","upload","wire","ai-edit"]},ce={blockeditor:["richclay"]},le=new Set(["source","sortable","menu","upgrade"]),ue=new Set(["wire","ai-edit"]);function Q(t,e,o,s){let u=t.get(e);if(u)for(let i of u.split(",")){let r=i.trim();if(r){if(!O[r]||O[r].internal){console.warn(`clayjs: unknown plugin "${r}"`);continue}s(o,r)}}}var de=["sync","live","blockeditor","upload","quickcrop","cms","people","menu","upgrade","wire","ai-edit","demo","source"],pe="core/site-edits.js",fe=["attrs/refetch-on-save.js","core/conflict-notice.js"],me="https://hyperclay.com/templates/";function P(t,e,{isDraftMode:o=!1,hasSap:s=!1,hasVariants:u=!1,hasSite:i=!1,canEdit:r=!1,templateSource:h=null}={}){let d=[...K.always];e&&d.push(...K.editOnly),e&&!o&&i&&d.splice(d.indexOf("core/save.js")+1,0,pe);let p=new Set;Q(t,"plugins",p,(a,c)=>a.add(c));let y=new Set;Q(t,"exclude",y,(a,c)=>a.add(c));let n=new Set(p);for(let[a,c]of Object.entries(O))c.default&&n.add(a);s&&n.add("derive"),u&&(e||r)&&n.add("menu"),!e&&!o&&n.has("blockeditor")&&n.add("blockeditor-view");for(let a of[...n])if(!y.has(a)&&!(O[a].editOnly&&!e))for(let c of ae[a]||[])n.add(c);y.has("wire")&&n.delete("ai-edit");for(let a of y)n.delete(a);if(o){let a=n.has("blockeditor");for(let c of de)a&&(c==="blockeditor"||c==="live")||n.delete(c);for(let c of fe){let j=d.indexOf(c);j>-1&&d.splice(j,1)}n.add("visitor-drafts")}!o&&r&&!y.has("upgrade")&&h&&h.startsWith(me)&&n.add("upgrade");for(let[a,c]of Object.entries(ce))if(n.has(a))for(let j of c)p.has(j)||n.delete(j);let g=[],w=[];for(let a of re){if(!n.has(a))continue;let c=O[a];if(c.editOnly&&!e||c.draft&&!o)continue;(le.has(a)||ue.has(a)&&n.has("blockeditor")?w:g).push(c.ownerPath&&!o?c.ownerPath:c.path)}return{core:d,plugins:g,late:w}}var I="data-deleted-at",R=(t,e)=>window.clay?.undo?.commit?window.clay.undo.commit(t,e):e(),Y=(t,e)=>t.dispatchEvent(new CustomEvent(e,{bubbles:!0})),_=Object.assign((t,{at:e=new Date().toISOString()}={})=>(R("Move to Trash",()=>t.setAttribute(I,e)),Y(t,"clay:trashed"),{undo:()=>_.restore(t)}),{is:t=>!!t.getAttribute(I),restore(t){R("Restore",()=>t.removeAttribute(I)),Y(t,"clay:restored")},purge(t){R("Delete forever",()=>t.remove())}});var Z=50,ge=1e3,he='[clay~="no-snapshot"], [no-snapshot], [snapshot-remove]',L=0,ye=t=>{let e=t.nodeType===1?t:t.parentElement;if(!e)return"a detached node";let o=e.localName;return e.id?o+="#"+e.id:e.classList.length&&(o+="."+[...e.classList].slice(0,2).join(".")),"<"+o+">"};function je(t){let e=window.clay?.region?.resolveRegionPolicy;if(!e)return null;let o=s=>!!s&&!s.closest(he)&&e(s).dirtyTracked;for(let s of t){if(s.type==="attributes"&&G(s.attributeName,s.target))continue;let u=s.target.nodeType===1?s.target:s.target.parentElement;if(o(u)&&!(s.type==="childList"&&![...s.addedNodes,...s.removedNodes].some(i=>i.nodeType!==1||o(i))))return s.target}return null}function q(t){let e=window.clay,o=e.Mutation,s=new Set,u=(m,f)=>{s.has(m)||(s.add(m),console.warn("clay.effect: "+f))},i=!1,r=!1,h=0,d=0;L&&e.isEditMode&&console.warn("clay.effect: an effect was created inside another effect, so a new one starts on every run. Create effects once, in clay.start.");let p=()=>{let m=Date.now();m-h>ge&&(h=m,d=0),++d>Z&&u("loop",`this effect ran more than ${Z} times in a second. Something keeps changing the document, often a timer or async callback the effect started.`)},y=()=>{if(i=!1,r)return;let m=null;o.pause(),L++;try{e.isEditMode===!0&&(p(),s.has("saved")||(m=new MutationObserver(()=>{}),m.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0})));let f=t();f&&typeof f.then=="function"&&(j(),console.error("clay.effect: fn returned a promise. It must be synchronous, so this effect was stopped."))}catch(f){console.error("clay.effect:",f)}finally{L--,o.resume();let f=m?m.takeRecords():[];if(m?.disconnect(),f.length){let E=je(f);E&&u("saved",`this effect changed ${ye(E)}, which is saved with the file. Effect writes never mark the page unsaved, so a merge can leave it dirty with no save scheduled. Draw derived values inside clay="no-dirty" or clay="editor-ui".`)}}},n=()=>{i||r||(i=!0,queueMicrotask(y))},g=["undo","redo"],w=()=>{for(let m of g)e.undo?.on?.(m,n)},a=m=>{m.detail?.applied?.length&&n()},c=o.onAnyChange({debounce:0,require:"observed"},n);document.addEventListener("clay:sync-applied",n),document.addEventListener("clay:site-data",a),document.addEventListener("clay:modechange",w),w();let j=()=>{r=!0,c(),document.removeEventListener("clay:sync-applied",n),document.removeEventListener("clay:site-data",a),document.removeEventListener("clay:modechange",w);for(let m of g)e.undo?.off?.(m,n)};return n(),j}Object.defineProperty(q,"running",{get:()=>L>0});var ve={overtype:()=>import("./c-PQ5LK6QE.js"),marked:()=>import("./c-XN6MBKI6.js"),highlight:()=>import("./c-33JJ6CBX.js"),"highlight/bash":()=>import("./c-KI7M4AY3.js"),"highlight/css":()=>import("./c-H4LG442Q.js"),"highlight/javascript":()=>import("./c-VDSS4K3Z.js"),"highlight/json":()=>import("./c-NRPJEVJS.js"),"highlight/python":()=>import("./c-5YIHJ3TJ.js"),"highlight/xml":()=>import("./c-WN5AY3OZ.js"),uimotion:()=>import("./c-B5CS55WR.js")};function we(t){let e=new Map;function o(s){return Object.hasOwn(t,s)?(e.has(s)||e.set(s,t[s]().catch(u=>{throw e.delete(s),u})),e.get(s)):Promise.reject(new Error(`clay.assets: no asset named "${s}"`))}return{load:o,names:()=>Object.keys(t)}}var ee=we(ve);function M(t,e){if(!t||!e)return t;let o={...e,...t};for(let s of["entries","imports","bootImports"])o[s]={...e[s],...t[s]};return o}var be="plugins/page.js";function T(t,e,{isEditMode:o=!1,isDraftMode:s=!1,hasSapJs:u=!1}={},i=document){if(!t?.entries)return 0;let r=[...e];for(let n of e)for(let g of t.bootImports?.[n]??[])u&&g==="vendor/sap-core.vendor.js"||r.push(g);o&&!s&&r.push(...t.editBootImports??[]),o&&!s&&e.includes(be)&&r.push(...t.editorBootImports??[]);let h=new Set,d=n=>{if(!(!n||h.has(n))){h.add(n);for(let g of t.imports?.[n]??[])d(g)}};for(let n of r)d(t.entries[n]);let p=new Set([...i.querySelectorAll('link[rel="modulepreload"]')].map(n=>n.href)),y=0;for(let n of h){let g=new URL(n,t.base).href;if(p.has(g))continue;let w=i.createElement("link");w.rel="modulepreload",w.href=g,w.setAttribute("clay","no-save"),i.head.append(w),y++}return y}var k=Object.fromEntries(Object.entries(O).flatMap(([t,e])=>e.ownerPath?[[e.path,t],[e.ownerPath,t]]:[[e.path,t]])),v={},te=new Set;function oe(t){te.has(t)||(te.add(t),document.dispatchEvent(new CustomEvent("clay:plugin-ready",{detail:{plugin:k[t]}})))}var Oe=(t,e,o,s)=>()=>t().then(u=>(T(M(e,u),[...o.core,...o.plugins,...o.late],{isEditMode:!0,hasSapJs:s}),u));function Se(){return new Promise(t=>$(t))}function A(){let t=document.querySelector('meta[name="hyper-source"]');return t?t.getAttribute("content"):null}async function Ve(t,e,o,s=null,u=null,i=null){V(),(await S["core/draft-mode.js"]()).noteBootParams(e),await Se();let h=await S["core/is-edit-mode.js"](),{isEditMode:d,isDraftMode:p,isOwner:y,siteVisibility:n,canEdit:g}=h;d&&!p&&import("./core/host-permission-5BYP24GC.js").then(l=>l.checkHostPermission()).catch(()=>{}),window.__hyperclayEditMode=d;let w=await S["lib/region-policy.js"](),a=!!document.querySelector("[sap]"),c=document.querySelectorAll("head style[clay-variant]").length>=2,j=/(?:^|[{,])\s*["']?site["']?\s*:/.test(document.querySelector('script[data-rules-name~="api"]')?.textContent??""),m=!!document.querySelector('script[src*="sap.js"]');F.holdSettle=a&&d;let f=P(e,d,{isDraftMode:p,hasSap:a,hasVariants:c,hasSite:j,canEdit:g,templateSource:A()});f.plugins.includes("plugins/demo.js")&&h.commitModeFacts({destination:"demo"}),T(M(s,u),[...f.core,...f.plugins],{isEditMode:d,isDraftMode:p,hasSapJs:m}),(d||p)&&!u&&i&&i().then(l=>T(M(s,l),[...f.core,...f.plugins],{isEditMode:d,isDraftMode:p,hasSapJs:m})).catch(()=>{});let E,ne=new Promise(l=>{E=l}),ie={sync:f.plugins.includes("sync/live-sync.js")};for(let l of f.core)v[l]=await S[l](),v[l].install?.();if(Pe(v,{isDraftMode:p,isOwner:y,siteVisibility:n},w),se(v),document.documentElement.getAttribute("clay-mode-switch")==="live"){let l=P(e,!0,{isDraftMode:p,hasSap:a,hasVariants:c,hasSite:j,canEdit:g,templateSource:A()});v["core/edit-mode.js"].noteLiveSwitch({edit:l,view:P(e,!1,{isDraftMode:p,hasSap:a,hasVariants:c,hasSite:j,canEdit:g,templateSource:A()}),loaded:v,modules:S,attach:(b,x)=>{U(b,x);let D=k[b],C=window.clay.plugins;D&&Array.isArray(C)&&!C.includes(D)&&(window.clay.plugins=Object.freeze([...C,D]))},attachEditCore:se,announce:oe,loadEditHints:i?Oe(i,s,l,m):null,late:ne})}await v["core/edit-mode.js"].activateInitialMode(),window.clay.plugins=Object.freeze([...f.plugins,...f.late].map(l=>k[l]));let B=d?f:P(e,!0,{isDraftMode:p,hasSap:a,hasVariants:c,hasSite:j,canEdit:g,templateSource:A()});window.clay.editPlugins=Object.freeze([...B.plugins,...B.late].map(l=>k[l]));for(let l of f.plugins){let b;try{b=await S[l]()}catch(x){console.error(`clayjs: plugin "${l}" failed to load, continuing without it:`,x);continue}v[l]=b,l==="plugins/visitor-drafts.js"&&await b.restoring,l==="plugins/page-view.js"&&b.start(ie),U(l,b,v)}await Promise.allSettled(f.plugins.map(l=>v[l]?.ready).filter(Boolean)),a&&ke(v),Le(h),o(window.clay),document.dispatchEvent(new CustomEvent("clay:ready",{detail:{clay:window.clay}})),f.late.length?Ee(f.late,h).then(E,E):E()}var N=(t,e)=>O[k[t]]?.editOnly&&!e.startsAtImport();async function Ee(t,e){try{await window.clay.blockeditor?.ready}catch{}for(let o of t)if(!N(o,e))try{let s=await S[o]();if(N(o,e)||(v[o]=s,U(o,s,v),await s.ready,N(o,e)))continue;oe(o)}catch(s){console.error(`clayjs: plugin "${o}" failed to load, continuing without it:`,s),document.dispatchEvent(new CustomEvent("clay:plugin-failed",{detail:{plugin:k[o]}}))}}function ke(t){let e=t["core/save.js"],o=null;try{o=e?e.currentPaintSignature():null}catch(s){console.error("clayjs: could not read the page's painted values:",s)}try{window.Sap&&typeof window.Sap.mount=="function"&&window.Sap.mount()}catch(s){console.error("clayjs: the derive engine failed to mount:",s)}finally{e?.releaseBootSettle()}e&&o!=null&&e.schedulePaintHeal(o)}function Pe(t,{isDraftMode:e,isOwner:o,siteVisibility:s},u){let i=window.clay,r=t["lib/mutation.js"],h=t["core/edit-mode.js"];Object.assign(i,{toggleEditMode:h.toggleEditMode,setMode:h.setMode,modeLifecycle:h.modeLifecycle,isDraftMode:e,isOwner:o,siteVisibility:s,Mutation:r.default,region:u.windowRegionShape});for(let p of["mode","isEditMode","canEdit"])Object.defineProperty(i,p,{get:()=>h[p],enumerable:!0,configurable:!0});i.assets=ee;let d=t["core/page-data.js"];i.readData=d.readData,i.writeData=d.writeData,i.ephemeral=H,i.storage=z,i.host={get versions(){return import("./c-Q2CB57UG.js").then(p=>p.hostVersions())}},i.trash=_,i.derived=W,i.effect=q,i.style=X,i.morph=(p,y,n)=>J().then(({morph:g})=>g(p,y,n))}function se(t){let e=window.clay,o=t["core/save.js"];if(o){let r=o.savePage||o.default;r.force=o.savePageForce,r.overwrite=o.saveOverwritingConflict,r.flush=o.flushSave,r.soon=o.savePageSoon,r.limits=o.saveLimits,r.inspect=o.inspectSaveSize,e.save!==r&&typeof e.save?.replace=="function"&&(r.replace=e.save.replace),e.save!==r&&(e.save=r)}e.hasUnsavedChanges=t["core/unsaved-warning.js"]?.hasUnsavedChanges??e.hasUnsavedChanges??(()=>!1);let s=t["core/snapshot.js"];s&&(e.getHTML||(e.getHTML=s.getPageContents),e.addDocumentTransform||(e.addDocumentTransform=s.addDocumentTransform),e.onSnapshot||(e.onSnapshot=s.onSnapshot));let u=t["lib/cache-bust.js"];u&&!e.cacheBust&&(e.cacheBust=u.default);let i=t["core/recovery.js"];i&&!e.recovery&&(e.recovery=i.recovery)}function U(t,e,o=v){let s=window.clay;t==="plugins/undo.js"?s.undo=e.undo||e.default:t==="plugins/unsent.js"?s.unsent=e.unsent:t==="sync/live-sync.js"?(s.morph=e.morph,s.conflicts=e.conflicts,o["core/page-data.js"].setPageDataLiveSync(e.liveSync)):t==="plugins/live.js"?s.live=e.live:t==="plugins/page.js"?s.blockeditor=e.page:t==="plugins/upgrade.js"?(s.save=s.save||{},s.save.replace=e.replace):t==="plugins/cms.js"?s.cms=e.cms||e.default:t==="plugins/upload.js"?s.upload=e.upload||e.default:t==="plugins/people.js"?(s.people=e.people,s.author=e.author,Object.defineProperty(s,"me",{get:e.currentMe,configurable:!0,enumerable:!0})):t==="plugins/message.js"?s.message=e.message:t==="plugins/like.js"?s.like=e.like:t==="plugins/wire.js"?s.wire=e.wire||e.default:t==="plugins/ai-edit.js"?s.aiEdit=e.aiEdit||e.default:t==="plugins/demo.js"?s.demo=e.demo:t==="plugins/richclay.js"?s.RichClay=e.RichClay||e.default:t==="plugins/quickcrop.js"?s.quickcrop=e.quickcrop||e.default:t==="plugins/sortable.js"?s.sortable=e.sortable:t==="plugins/source.js"?s.source=e.source||e.default:t==="plugins/visitor-drafts.js"||t==="plugins/visitor-drafts-owner.js"?s.visitorDrafts=e.visitorDrafts:t==="plugins/bind-text.js"&&(s.bindText=e.bindText)}function Le(t){t.isEditMode||document.addEventListener("click",e=>{e.target.closest?.("[trigger-save]")&&(t.isEditMode||(console.info("clayjs: you're not the owner of this page; changes stay local"),document.dispatchEvent(new CustomEvent("clay:view-save-attempt"))))})}export{Ve as boot,ke as mountDerivedEngine};
@@ -0,0 +1 @@
1
+ export default {"version":"1.26.0","entries":{"events/index.js":"events/index-YKQIBZE5.js","internals/index.js":"internals/index-3LAVREAU.js","options/options.js":"options/options-LKIZ7YTG.js","route/route.js":"route/route-62CHXL5B.js","ui/index.js":"ui/index-G7ZJXNMG.js","utils/index.js":"utils/index-4TJCVLT7.js","vendor/sap-core.vendor.js":"vendor/sap-core.vendor-5TWOJYVM.js","plugins/visitor-drafts-owner.js":"plugins/visitor-drafts-owner-TLECTYWS.js","plugins/derive.js":"plugins/derive-R4USHZ7P.js","plugins/upgrade.js":"plugins/upgrade-SZQJYEQQ.js","dom/all.js":"dom/all-APS5ZSKP.js","dom/dom-helpers.js":"dom/dom-helpers-L7OSR6S4.js","plugins/people.js":"plugins/people-EBWE337I.js","plugins/menu.js":"plugins/menu-ESEFQARM.js","plugins/wire.js":"plugins/wire-S5ATC4QI.js","plugins/message.js":"plugins/message-LQ6EDH4V.js","plugins/like.js":"plugins/like-EV7MTZ56.js","plugins/demo.js":"plugins/demo-LMCMBILC.js","plugins/visitor-drafts.js":"plugins/visitor-drafts-ZE6PCAFP.js","plugins/page-view.js":"plugins/page-view-7MM3FEAR.js","plugins/cms.js":"plugins/cms-KG6TCTR3.js","plugins/quickcrop.js":"plugins/quickcrop-UHURKA2F.js","sync/live-sync.js":"sync/live-sync-RZQSDMZW.js","plugins/live.js":"plugins/live-DF5YS5AH.js","loader.js":"loader-DCKCZKY6.js","reader-core.js":"reader-core-AHOAP5DH.js","lib/mutation.js":"reader-core-AHOAP5DH.js","core/preserve-authored.js":"reader-core-AHOAP5DH.js","core/edit-mode.js":"reader-core-AHOAP5DH.js","core/mode-key.js":"reader-core-AHOAP5DH.js","core/stale-host-notice.js":"reader-core-AHOAP5DH.js","core/page-data.js":"reader-core-AHOAP5DH.js"},"imports":{"events/index-YKQIBZE5.js":["c-MZCOGNZL.js","c-IJUK2GPW.js","c-MOP5KBWZ.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-MZCOGNZL.js":["c-IJUK2GPW.js","c-MOP5KBWZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-MOP5KBWZ.js":["c-2YYDMLNZ.js"],"c-HA6INT6J.js":["c-WRBKEJD4.js"],"c-ICMAOOGK.js":["c-WRBKEJD4.js"],"internals/index-3LAVREAU.js":["c-EHAR4RJJ.js","c-LD6UVV5R.js","c-PGSBXHUE.js","c-KU3PX7LL.js","c-EQ5NBOGA.js","c-IJUK2GPW.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-UW6MMZ4V.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-MOP5KBWZ.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-EHAR4RJJ.js":["c-LD6UVV5R.js","c-PGSBXHUE.js","c-KU3PX7LL.js","c-EQ5NBOGA.js","c-IJUK2GPW.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-U4TWEIKZ.js","c-UW6MMZ4V.js"],"c-KU3PX7LL.js":["c-EQ5NBOGA.js","c-C7SUMNMI.js","c-BPF2NSPV.js"],"c-EQ5NBOGA.js":["c-C7SUMNMI.js","c-BPF2NSPV.js"],"c-C7SUMNMI.js":["c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js"],"c-BPF2NSPV.js":["c-HA6INT6J.js"],"c-UW6MMZ4V.js":["c-XQXZAO7N.js","c-S7LK4KUE.js","c-MOP5KBWZ.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"c-XQXZAO7N.js":["c-WRBKEJD4.js"],"options/options-LKIZ7YTG.js":["c-7SWMYKAI.js","c-MZCOGNZL.js","c-IJUK2GPW.js","c-MOP5KBWZ.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"route/route-62CHXL5B.js":["c-VHNSBD2M.js"],"ui/index-G7ZJXNMG.js":["c-K2ZHQMPF.js","c-4M2T676V.js","c-EIDZHQHZ.js","c-UL2YUY52.js","c-QY7F6EN6.js","c-OZOACVUD.js","c-QHWJ5ZIJ.js","c-J2ZW4HMR.js","c-A5LASUEZ.js","c-4JZDZFF6.js","c-5RZNFTWD.js","c-PKCCHJ5X.js","c-5KXDKC5G.js","c-46XYM55L.js","c-NUHP2XDB.js","c-VKEDWYDF.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-K2ZHQMPF.js":["c-4M2T676V.js","c-EIDZHQHZ.js","c-UL2YUY52.js","c-QHWJ5ZIJ.js","c-J2ZW4HMR.js","c-5RZNFTWD.js","c-VKEDWYDF.js"],"c-4M2T676V.js":["c-OZOACVUD.js","c-QHWJ5ZIJ.js","c-J2ZW4HMR.js","c-NUHP2XDB.js"],"c-OZOACVUD.js":["c-J2ZW4HMR.js","c-A5LASUEZ.js","c-5RZNFTWD.js","c-PKCCHJ5X.js","c-NUHP2XDB.js"],"c-J2ZW4HMR.js":["c-A5LASUEZ.js","c-5RZNFTWD.js","c-NUHP2XDB.js"],"c-QHWJ5ZIJ.js":["c-4JZDZFF6.js","c-46XYM55L.js"],"c-EIDZHQHZ.js":["c-QY7F6EN6.js","c-QHWJ5ZIJ.js","c-J2ZW4HMR.js","c-A5LASUEZ.js","c-5RZNFTWD.js","c-PKCCHJ5X.js","c-NUHP2XDB.js"],"c-QY7F6EN6.js":["c-ICMAOOGK.js"],"utils/index-4TJCVLT7.js":["c-UL2YUY52.js","c-GQ6F6IDK.js","c-P7KNDG34.js","c-VHNSBD2M.js"],"vendor/sap-core.vendor-5TWOJYVM.js":["c-VHNSBD2M.js"],"plugins/visitor-drafts-owner-TLECTYWS.js":["c-OKEGUICD.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/derive-R4USHZ7P.js":["c-VHNSBD2M.js"],"plugins/upgrade-SZQJYEQQ.js":["c-3G2DGZUP.js","c-VHNSBD2M.js"],"dom/all-APS5ZSKP.js":["c-VHNSBD2M.js"],"dom/dom-helpers-L7OSR6S4.js":["c-XQXZAO7N.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/people-EBWE337I.js":["c-RVMWGXEJ.js","c-EQ5NBOGA.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/menu-ESEFQARM.js":["c-QTEUO2K6.js","c-X6MOYATI.js","c-DIKR7H57.js","c-AQLFEATB.js","c-CUMXGHVD.js","c-RVMWGXEJ.js","c-QY7F6EN6.js","c-RHMPKZZ7.js","c-PKCCHJ5X.js","c-VKEDWYDF.js","c-EQ5NBOGA.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-X6MOYATI.js":["c-DIKR7H57.js"],"c-DIKR7H57.js":["c-QY7F6EN6.js"],"plugins/wire-S5ATC4QI.js":["c-C5UGNOC2.js","c-EQ5NBOGA.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-C5UGNOC2.js":["c-EQ5NBOGA.js","c-C7SUMNMI.js","c-BPF2NSPV.js"],"plugins/message-LQ6EDH4V.js":["c-VHNSBD2M.js"],"plugins/like-EV7MTZ56.js":["c-VHNSBD2M.js"],"plugins/demo-LMCMBILC.js":["c-JAX2667S.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/visitor-drafts-ZE6PCAFP.js":["c-Y6F2FORL.js","c-Y6HH7LTM.js","c-OKEGUICD.js","c-QY7F6EN6.js","c-FC5RUFPR.js","c-4ASQPRQL.js","c-GQ6F6IDK.js","c-I2SCCUEW.js","c-5VYOWDTI.js","c-P73XPAOA.js","c-ZPI7M5U5.js","c-WYFDLITL.js","c-UGHH4MB3.js","c-MZCOGNZL.js","c-EHAR4RJJ.js","c-LD6UVV5R.js","c-PGSBXHUE.js","c-KU3PX7LL.js","c-EQ5NBOGA.js","c-IJUK2GPW.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-UW6MMZ4V.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-MOP5KBWZ.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-FC5RUFPR.js":["c-4ASQPRQL.js","c-GQ6F6IDK.js","c-I2SCCUEW.js","c-5VYOWDTI.js","c-P73XPAOA.js","c-ZPI7M5U5.js","c-UGHH4MB3.js","c-MZCOGNZL.js","c-EHAR4RJJ.js","c-PGSBXHUE.js","c-KU3PX7LL.js","c-IJUK2GPW.js","c-C7SUMNMI.js","c-U4TWEIKZ.js","c-UW6MMZ4V.js","c-MOP5KBWZ.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"c-P73XPAOA.js":["c-WYFDLITL.js","c-MZCOGNZL.js","c-C7SUMNMI.js","c-U4TWEIKZ.js","c-ICMAOOGK.js"],"c-ZPI7M5U5.js":["c-C7SUMNMI.js"],"plugins/page-view-7MM3FEAR.js":["c-L4WQSC27.js","c-ARO6CPMA.js","c-EQ5NBOGA.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-ARO6CPMA.js":["c-EQ5NBOGA.js","c-C7SUMNMI.js"],"plugins/cms-KG6TCTR3.js":["c-JAX2667S.js","c-KD2ME5UN.js","c-J2ZW4HMR.js","c-A5LASUEZ.js","c-4JZDZFF6.js","c-5RZNFTWD.js","c-PKCCHJ5X.js","c-NUHP2XDB.js","c-VHNSBD2M.js"],"c-KD2ME5UN.js":["c-J2ZW4HMR.js","c-4JZDZFF6.js"],"plugins/quickcrop-UHURKA2F.js":["c-OZOACVUD.js","c-QHWJ5ZIJ.js","c-KD2ME5UN.js","c-J2ZW4HMR.js","c-A5LASUEZ.js","c-4JZDZFF6.js","c-5RZNFTWD.js","c-PKCCHJ5X.js","c-46XYM55L.js","c-NUHP2XDB.js","c-VHNSBD2M.js"],"sync/live-sync-RZQSDMZW.js":["c-ZFAPQQIB.js","c-ARO6CPMA.js","c-LZJPNR2W.js","c-FILLTJA7.js","c-5VYOWDTI.js","c-P73XPAOA.js","c-WYFDLITL.js","c-MZCOGNZL.js","c-LD6UVV5R.js","c-PGSBXHUE.js","c-KU3PX7LL.js","c-EQ5NBOGA.js","c-IJUK2GPW.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-UW6MMZ4V.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-MOP5KBWZ.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-ZFAPQQIB.js":["c-ARO6CPMA.js","c-LZJPNR2W.js","c-FILLTJA7.js","c-5VYOWDTI.js","c-P73XPAOA.js","c-MZCOGNZL.js","c-LD6UVV5R.js","c-PGSBXHUE.js","c-KU3PX7LL.js","c-EQ5NBOGA.js","c-IJUK2GPW.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-UW6MMZ4V.js","c-MOP5KBWZ.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"plugins/live-DF5YS5AH.js":["c-SRW5OBCF.js","c-JKZJIUIP.js","c-TCCA5BZN.js","c-3LDGIBMN.js","c-57XDY6HC.js","c-LZJPNR2W.js","c-FC5RUFPR.js","c-4ASQPRQL.js","c-GQ6F6IDK.js","c-I2SCCUEW.js","c-5VYOWDTI.js","c-P73XPAOA.js","c-ZPI7M5U5.js","c-WYFDLITL.js","c-UGHH4MB3.js","c-MZCOGNZL.js","c-EHAR4RJJ.js","c-LD6UVV5R.js","c-PGSBXHUE.js","c-KU3PX7LL.js","c-EQ5NBOGA.js","c-IJUK2GPW.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-UW6MMZ4V.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-MOP5KBWZ.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-SRW5OBCF.js":["c-JKZJIUIP.js","c-TCCA5BZN.js","c-3LDGIBMN.js","c-57XDY6HC.js","c-LZJPNR2W.js","c-FC5RUFPR.js","c-I2SCCUEW.js","c-EHAR4RJJ.js","c-LD6UVV5R.js","c-PGSBXHUE.js","c-KU3PX7LL.js","c-EQ5NBOGA.js","c-C7SUMNMI.js","c-UW6MMZ4V.js"],"loader-DCKCZKY6.js":["c-NL4I4KNG.js","c-7SWMYKAI.js","c-46XYM55L.js","c-FILLTJA7.js","c-VKEDWYDF.js","c-UGHH4MB3.js","c-MZCOGNZL.js","c-IJUK2GPW.js","c-CYWLPPUS.js","c-MOP5KBWZ.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-NL4I4KNG.js":["c-7SWMYKAI.js","c-UGHH4MB3.js","c-MZCOGNZL.js"],"reader-core-AHOAP5DH.js":["c-NUHP2XDB.js","c-QCDVDZIR.js","c-VKEDWYDF.js","c-MZCOGNZL.js","c-EQ5NBOGA.js","c-IJUK2GPW.js","c-C7SUMNMI.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-U4TWEIKZ.js","c-MOP5KBWZ.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-QCDVDZIR.js":["c-MZCOGNZL.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-VHNSBD2M.js"]},"bootImports":{"plugins/derive.js":["vendor/sap-core.vendor.js"]}};