@panphora/clayjs 1.19.0 → 1.21.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 (183) 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 +8349 -8125
  11. package/dist/m/attrs/{refetch-on-save-ZUE7PSCI.js → refetch-on-save-DPGJJMGN.js} +1 -1
  12. package/dist/m/attrs/save-freeze-MTFVVYV5.js +1 -0
  13. package/dist/m/{c-DHUCEMXE.js → c-2VB555FG.js} +1 -1
  14. package/dist/m/{c-KGHVFRR3.js → c-3AXJDL2P.js} +1 -1
  15. package/dist/m/{c-FOOE4GML.js → c-3GJ4XARY.js} +1 -1
  16. package/dist/m/c-3TWCKFOP.js +1 -0
  17. package/dist/m/{c-LPCZOYTX.js → c-3YH6JSIL.js} +1 -1
  18. package/dist/m/{c-AIWN4QN4.js → c-44B5ODN7.js} +2 -2
  19. package/dist/m/{c-WQWIRWO3.js → c-5FEU5MMY.js} +1 -1
  20. package/dist/m/{c-S2U6NJU4.js → c-62HZW5DH.js} +1 -1
  21. package/dist/m/{c-ZGDYHKG3.js → c-67ILSNPR.js} +1 -1
  22. package/dist/m/c-67LGZ52V.js +20 -0
  23. package/dist/m/{c-ZRUQ5FSU.js → c-7SXYQCN4.js} +1 -1
  24. package/dist/m/{c-LACAAQFB.js → c-AL4RBJF2.js} +1 -1
  25. package/dist/m/{c-L42OLXWM.js → c-ANNFZFLN.js} +1 -1
  26. package/dist/m/{c-QO4HNGCQ.js → c-B4VYNXTQ.js} +1 -1
  27. package/dist/m/{c-7PRJCA3E.js → c-BJPZCWAV.js} +1 -1
  28. package/dist/m/{c-V52FE5FI.js → c-BTLFLLML.js} +1 -1
  29. package/dist/m/c-C4IIQZGJ.js +1 -0
  30. package/dist/m/{c-5T6NZHNM.js → c-CAWNFER6.js} +1 -1
  31. package/dist/m/c-CSNE5EIF.js +1 -0
  32. package/dist/m/{c-DVYGFTSK.js → c-DDDOKPI6.js} +2 -2
  33. package/dist/m/{c-2RARVIAK.js → c-DHXPDLW6.js} +1 -1
  34. package/dist/m/{c-WCXLG3MV.js → c-E4IBSAQM.js} +1 -1
  35. package/dist/m/{c-IVTRVENZ.js → c-EDSPKYMA.js} +1 -1
  36. package/dist/m/{c-2Y4DOHSY.js → c-EFD6QNTE.js} +1 -1
  37. package/dist/m/{c-7MG5RU63.js → c-EGTIAL6P.js} +1 -1
  38. package/dist/m/{c-FCNAO2MI.js → c-EOCKLMKX.js} +1 -1
  39. package/dist/m/{c-UXFUJEZO.js → c-EOCZ2YVL.js} +1 -1
  40. package/dist/m/{c-K72SY2TL.js → c-EZ7B5AZT.js} +1 -1
  41. package/dist/m/{c-UPD33ZPE.js → c-FDAXZ2PM.js} +1 -1
  42. package/dist/m/{c-P3CK66NT.js → c-FNVQAACK.js} +1 -1
  43. package/dist/m/c-FSWRGBVQ.js +1 -0
  44. package/dist/m/c-FTWGYI5E.js +1 -0
  45. package/dist/m/{c-WKNRJX3C.js → c-GKEATME6.js} +1 -1
  46. package/dist/m/{c-QINHDETP.js → c-GPGYKER7.js} +1 -1
  47. package/dist/m/{c-FWKHM4E7.js → c-GSRLXYWL.js} +1 -1
  48. package/dist/m/{c-B7J4K2AE.js → c-GVPNDIKJ.js} +2 -2
  49. package/dist/m/{c-D3E4WJ4M.js → c-HDWZEJHM.js} +49 -32
  50. package/dist/m/{c-FTQKI7SP.js → c-I2IFKJX2.js} +1 -1
  51. package/dist/m/c-ICMAOOGK.js +1 -0
  52. package/dist/m/{c-HUISJXHF.js → c-J3BXFTZS.js} +1 -1
  53. package/dist/m/{c-BIJALSRD.js → c-JDZDF2QM.js} +1 -1
  54. package/dist/m/{c-UDHIVLYH.js → c-JH5FF4NL.js} +1 -1
  55. package/dist/m/{c-OYRZ7XG2.js → c-JHJR5BQX.js} +1 -1
  56. package/dist/m/{c-V44KWI2L.js → c-JOH753EJ.js} +2 -2
  57. package/dist/m/{c-P3OFYUMA.js → c-JUE7B4OX.js} +1 -1
  58. package/dist/m/c-K76AUL4I.js +7 -0
  59. package/dist/m/{c-ZWIOJGMT.js → c-LA2BW7UY.js} +1 -1
  60. package/dist/m/{c-ICJYHABF.js → c-LDUNOR57.js} +1 -1
  61. package/dist/m/{c-XSZKP646.js → c-LIBE4HPD.js} +1 -1
  62. package/dist/m/c-LPUJXRXW.js +1 -0
  63. package/dist/m/{c-JK3PHE7J.js → c-LQU7TXIH.js} +1 -1
  64. package/dist/m/{c-5ZQV7KC4.js → c-LV5MABYD.js} +1 -1
  65. package/dist/m/{c-GWNC3UGL.js → c-M4FSPNQ2.js} +1 -1
  66. package/dist/m/{c-2KIEGNC4.js → c-MEWUGR4D.js} +1 -1
  67. package/dist/m/c-MIL4B2JQ.js +1 -0
  68. package/dist/m/{c-IVMD3FEM.js → c-N7Y52HJH.js} +1 -1
  69. package/dist/m/{c-O4JMKN6U.js → c-NFR673TL.js} +2 -2
  70. package/dist/m/{c-ZKNBMNN3.js → c-NLZ5AN4L.js} +1 -1
  71. package/dist/m/{c-RRZJWFLE.js → c-OABVRYOT.js} +1 -1
  72. package/dist/m/c-PIVIYLTY.js +1 -0
  73. package/dist/m/{c-L7JL5TL3.js → c-QY7F6EN6.js} +1 -1
  74. package/dist/m/{c-UY4QX42B.js → c-RG6XUZFA.js} +1 -1
  75. package/dist/m/c-RHMPKZZ7.js +1 -0
  76. package/dist/m/{c-TJAXGIRV.js → c-RQRMPZXD.js} +1 -1
  77. package/dist/m/{c-GY422N3Q.js → c-RS77ODLY.js} +1 -1
  78. package/dist/m/{c-BAUBNYXK.js → c-RT3C74GY.js} +1 -1
  79. package/dist/m/{c-CAS3NND4.js → c-S5IEIZCN.js} +1 -1
  80. package/dist/m/{c-HXPHZN7Q.js → c-SBSMJIPC.js} +1 -1
  81. package/dist/m/c-SFKI6OLM.js +2 -0
  82. package/dist/m/{c-4FJTBE6I.js → c-SJPD46ZO.js} +4 -4
  83. package/dist/m/{c-JCP3XDSJ.js → c-SO63UGPQ.js} +1 -1
  84. package/dist/m/{c-PLP4JKFC.js → c-TUGVINJR.js} +1 -1
  85. package/dist/m/{c-Q26MME6N.js → c-TWCXBWS3.js} +1 -1
  86. package/dist/m/{c-GNDL3TKB.js → c-U5X57T4L.js} +1 -1
  87. package/dist/m/{c-ZS4US2XV.js → c-UXEVJ63W.js} +1 -1
  88. package/dist/m/{c-KJJPV77R.js → c-V2J5C5MT.js} +1 -1
  89. package/dist/m/{c-7PYNAULW.js → c-VBLFAQD2.js} +1 -1
  90. package/dist/m/{c-ERQSNR6K.js → c-VQCEOGKH.js} +2 -2
  91. package/dist/m/{c-YVZ2L7CE.js → c-VSPAFOKU.js} +1 -1
  92. package/dist/m/{c-L6FLIUXP.js → c-VY6XRBOW.js} +1 -1
  93. package/dist/m/{c-2KL3BD52.js → c-W23KVGUO.js} +1 -1
  94. package/dist/m/{c-AXGY2WTB.js → c-W3K23S72.js} +1 -1
  95. package/dist/m/c-WFMRX5RZ.js +1 -0
  96. package/dist/m/{c-BWFVSBDF.js → c-WN3MXOLT.js} +1 -1
  97. package/dist/m/{c-MIKZEG5I.js → c-XD5MOROJ.js} +1 -1
  98. package/dist/m/{c-CQQDL6O4.js → c-XQSXKIKM.js} +1 -1
  99. package/dist/m/{c-I4MQHOEY.js → c-Y33LUUIQ.js} +1 -1
  100. package/dist/m/{c-JDARJDOT.js → c-YQUJ74R3.js} +1 -1
  101. package/dist/m/{c-F6G2OGYG.js → c-YSB6JKV2.js} +2 -2
  102. package/dist/m/{c-BHZYSHW4.js → c-ZJLU56DV.js} +1 -1
  103. package/dist/m/{c-DKLS74XB.js → c-ZQXNHZZT.js} +2 -2
  104. package/dist/m/{c-TNEM3RNM.js → c-ZSCBEB7I.js} +1 -1
  105. package/dist/m/core/{admin-attrs-YY7T5FGU.js → admin-attrs-ZG7R5V3E.js} +1 -1
  106. package/dist/m/core/{autosave-RVJPYLRT.js → autosave-VPORYJSE.js} +1 -1
  107. package/dist/m/core/{conflict-notice-2WGT52LH.js → conflict-notice-JMAZLVRX.js} +1 -1
  108. package/dist/m/core/{persist-UKXV5KLA.js → persist-3OPWJKZS.js} +1 -1
  109. package/dist/m/core/{recovery-ZOUOJVIX.js → recovery-DRFZRJED.js} +1 -1
  110. package/dist/m/core/{save-A5JXV6ME.js → save-AOJBDSOK.js} +1 -1
  111. package/dist/m/core/{save-core-MKRPSEEO.js → save-core-IOCMXO5L.js} +1 -1
  112. package/dist/m/core/{snapshot-NU3YM6GR.js → snapshot-O7II2AGG.js} +1 -1
  113. package/dist/m/core/unsaved-warning-U5VUJFOE.js +1 -0
  114. package/dist/m/events/{index-RN2JNGBV.js → index-B6TGDYMG.js} +1 -1
  115. package/dist/m/internals/{index-TGLQINN3.js → index-HDRANDWE.js} +1 -1
  116. package/dist/m/lib/{cache-bust-MUMFXZK6.js → cache-bust-NH7VBWHO.js} +1 -1
  117. package/dist/m/lib/{region-policy-SB2AWVG5.js → region-policy-KWBPROWF.js} +1 -1
  118. package/dist/m/{loader-34YPFKOH.js → loader-ZVPK4ZN3.js} +1 -1
  119. package/dist/m/manifest-5498AFD3.js +1 -0
  120. package/dist/m/manifest-edit-62A5A00F.js +1 -0
  121. package/dist/m/manifest.json +1215 -1171
  122. package/dist/m/options/{options-EJMS3K24.js → options-55LQHSJ4.js} +1 -1
  123. package/dist/m/page/{editor-WRQGHDSG.js → editor-EY2WAAGB.js} +2 -2
  124. package/dist/m/plugins/{ai-edit-X2L2KIEP.js → ai-edit-J5VLSW5I.js} +1 -1
  125. package/dist/m/plugins/{demo-OYO5GCAO.js → demo-42BSYQ7T.js} +1 -1
  126. package/dist/m/plugins/{derive-FRE5JJQE.js → derive-QVI3LI3A.js} +1 -1
  127. package/dist/m/plugins/{live-7C36XEI2.js → live-5EZN2EYP.js} +1 -1
  128. package/dist/m/plugins/menu-DM2JHPSR.js +1 -0
  129. package/dist/m/plugins/{page-BSW6MGDO.js → page-LVW5DWA4.js} +2 -2
  130. package/dist/m/plugins/{page-view-WFZVTPQK.js → page-view-5KQ76IJB.js} +1 -1
  131. package/dist/m/plugins/{sortable-4S6SQC3D.js → sortable-WJZZBM7R.js} +1 -1
  132. package/dist/m/plugins/{source-TJXOIOYY.js → source-CCEUM3OR.js} +1 -1
  133. package/dist/m/plugins/{undo-NLPGCJQY.js → undo-3JEYK5QY.js} +1 -1
  134. package/dist/m/plugins/{upgrade-HSUNDNJD.js → upgrade-NW556WJD.js} +1 -1
  135. package/dist/m/plugins/{upload-NHGJXZK2.js → upload-TTCQRIM5.js} +1 -1
  136. package/dist/m/plugins/{visitor-drafts-BW43DGY3.js → visitor-drafts-2AWNT23K.js} +2 -2
  137. package/dist/m/plugins/{visitor-drafts-owner-7ODQG7JX.js → visitor-drafts-owner-MZP45XSG.js} +1 -1
  138. package/dist/m/plugins/{wire-6OSIL3I7.js → wire-VRYPY6EJ.js} +1 -1
  139. package/dist/m/{reader-core-PLZYLYLT.js → reader-core-2GXY7SHY.js} +2 -2
  140. package/dist/m/sync/{live-sync-UXNI6ZF6.js → live-sync-SKPMFYOO.js} +1 -1
  141. package/dist/m/ui/{index-IVWN2QC4.js → index-QNIPDHXQ.js} +1 -1
  142. package/dist/m/vendor/{sap-core.vendor-RN4ZVY4X.js → sap-core.vendor-OA5SKL7Q.js} +1 -1
  143. package/dist/offline-manifest.json +650 -626
  144. package/docs/guide.md +38 -14
  145. package/entries/sap.js +1 -1
  146. package/package.json +3 -2
  147. package/src/core/conflict-download.js +8 -7
  148. package/src/core/conflict-notice-ui.js +4 -4
  149. package/src/core/copy-content.js +103 -0
  150. package/src/core/download.js +14 -2
  151. package/src/core/save-size-notice.js +2 -2
  152. package/src/core/upgrade-run.js +5 -1
  153. package/src/lib/region-policy.js +1 -1
  154. package/src/page/features/export-html.js +4 -4
  155. package/src/page/features/export-markdown.js +2 -2
  156. package/src/page/recovery-ui.js +2 -2
  157. package/src/page/save-states.js +4 -4
  158. package/src/plugins/menu/actions.js +1 -1
  159. package/src/plugins/menu/style.js +59 -31
  160. package/src/plugins/menu.js +131 -28
  161. package/src/plugins/page.js +4 -4
  162. package/src/plugins/visitor-drafts/prompt.js +12 -12
  163. package/src/plugins/wire.js +3 -1
  164. package/src/vendor/sap-core.vendor.js +1 -1
  165. package/dist/m/attrs/save-freeze-LWGF6XUN.js +0 -1
  166. package/dist/m/c-DCFSEJZG.js +0 -1
  167. package/dist/m/c-EXEDYU4H.js +0 -1
  168. package/dist/m/c-GRXHHFPO.js +0 -1
  169. package/dist/m/c-HT2DKBV2.js +0 -1
  170. package/dist/m/c-MCOOHCSG.js +0 -1
  171. package/dist/m/c-MMXKAX2W.js +0 -1
  172. package/dist/m/c-VE7RKNKZ.js +0 -7
  173. package/dist/m/c-VR2BJ4AN.js +0 -1
  174. package/dist/m/c-WGW764WX.js +0 -1
  175. package/dist/m/c-WNTYKCDG.js +0 -1
  176. package/dist/m/c-YBSS55KU.js +0 -20
  177. package/dist/m/core/unsaved-warning-4ZPEV7BF.js +0 -1
  178. package/dist/m/manifest-0D166F4F.js +0 -1
  179. package/dist/m/manifest-edit-3877153E.js +0 -1
  180. package/dist/m/plugins/menu-MFC4DI5E.js +0 -1
  181. /package/dist/m/{c-QTTJYJMA.js → c-FILLTJA7.js} +0 -0
  182. /package/dist/m/{c-5JLFROUB.js → c-X5LNHET5.js} +0 -0
  183. /package/dist/m/plugins/{people-JCHVPF7P.js → people-C7TVBBMR.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as Ct,b as It,c as At,d as ze,e as Ye,f as Kn,g as Tt,h as Hn,i as qn,j as Pt,l as Rt}from"./c-QIKT6SKM.js";import{a as Et,b as Jn,c as Ro,f as Yo}from"./c-UPD33ZPE.js";import{a as Bn,b as Dn,c as zn,d as it,e as Mt,f as $o}from"./c-DHBRA6DL.js";import{a as Po}from"./c-L3F5ZLIV.js";import{b as Co,c as Io}from"./c-BIJALSRD.js";import"./c-IW6GGOU2.js";import"./c-HAWFNBYG.js";import{a as Re,b as $n,p as Nn,q as Fn,u as Ao,v as To}from"./c-4FJTBE6I.js";import{A as Cn,B as Be,C as ot,D as In,E as An,F as De,G as Tn,H as Pe,I as rt,J as Pn,K as xt,L as Rn,M as st,N as Yn,O as ue,a as Le,b as bt,c as yn,d as vn,f as wn,j as xn,m as Eo,p as Sn,q as On,r as Mn,s as En,t as yt,v as vt,x as wt,z as Oe}from"./c-EXKHPOVC.js";import{a as me,b as pn,d as Me,e as _e,g as xe,h as Ne,i as ye,j as Ee,k as mn,l as Fe,m as nt,n as be,o as hn,p as gn,q as Se,r as Ce,u as bn,v as kn,w as kt}from"./c-L5VFATT6.js";import"./c-CQQDL6O4.js";import"./c-ZGDYHKG3.js";import"./c-W4JCVLAB.js";import"./c-7K4SCQB7.js";import{f as Zt,g as en,i as Qe,j as Ze,k as ut,n as dt,o as et,p as tn,s as pt,t as nn,u as Ae,v as de,w as Te,x as mt,y as on}from"./c-WMRJKQ2V.js";import{g as Ln,o as Ot}from"./c-AIWN4QN4.js";import{F as an,N as ht,Q as gt,R as fn,b as pe,c as rn,e as sn,m as fe,oa as je,p as ln,r as cn,ra as un,sa as dn,ua as tt}from"./c-QIXT3Q7C.js";import{b as Ut}from"./c-L7JL5TL3.js";import{a as jn,b as _n,c as St}from"./c-WCXLG3MV.js";import{a as Xt}from"./c-TCCA5BZN.js";import"./c-3LDGIBMN.js";import{c as Qt}from"./c-57XDY6HC.js";import"./c-OYRZ7XG2.js";import{a as Gt,b as ft}from"./c-QTTJYJMA.js";import"./c-Q26MME6N.js";import{d as Vt,e as Wt}from"./c-ZKNBMNN3.js";import"./c-4ASQPRQL.js";import"./c-GQ6F6IDK.js";import"./c-I2SCCUEW.js";import"./c-5VYOWDTI.js";import"./c-FWKHM4E7.js";import"./c-5JLFROUB.js";import"./c-WYFDLITL.js";import"./c-UGHH4MB3.js";import"./c-ZWIOJGMT.js";import"./c-B7J4K2AE.js";import"./c-ATKAOH23.js";import"./c-EK63G3CG.js";import"./c-NQJRVJ56.js";import"./c-XGH4GS2T.js";import"./c-IJUK2GPW.js";import"./c-3O7OBDCM.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-N7JPUPGC.js";import"./c-7MG5RU63.js";import"./c-XQXZAO7N.js";import"./c-S7LK4KUE.js";import"./c-VG5XIN4T.js";import"./c-2YYDMLNZ.js";import"./c-HA6INT6J.js";import"./c-DCFSEJZG.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var Yt=new Set(["paragraph","heading","list_item","callout","quote","code_block","toggle"]),Je=(e,o)=>je(e)===je(o);function $t(e,o){let n=o.createElement("article");return n.setAttribute("data-page",""),n.innerHTML=dn([{id:e.id,t:"paragraph",c:e.c??"",...e.m?{m:e.m}:{}}],{clean:un(o)}),n}function jo(e,o){let n=new Map(e.map((f,u)=>[f.id,u])),r=new Set(o.map(f=>f.id)),t=new Map,s=0;return o.map(f=>{let u=n.get(f.id);if(u!==void 0)return s=u+1,f;let p={c:f.c??"",m:f.m??null};for(let b=s;b<e.length;b++){let C=e[b];if(!(r.has(C.id)||C.t!==f.t||!Je({c:C.c??"",m:C.m??null},p)))return r.add(C.id),s=b+1,t.set(f.id,C.id),{...f,id:C.id}}return f}).map(f=>t.has(f.parent)?{...f,parent:t.get(f.parent)}:f)}function jt(e,o,n,{doc:r,merge3:t,mergeJson:s}){let a=[],f=jo(e,n),u=new Map(e.map(c=>[c.id,c])),p=new Map(o.map(c=>[c.id,c])),b=new Map(f.map(c=>[c.id,c])),C=o.map(c=>({...c})),M=f.map(c=>({...c})),h=new Map(C.map(c=>[c.id,c])),w=new Map(M.map(c=>[c.id,c]));for(let[c,E]of u){let i=p.get(c),g=b.get(c);if(!i||!g||!Yt.has(E.t)||!Yt.has(i.t)||!Yt.has(g.t))continue;let A={c:E.c??"",m:E.m??null},z={c:i.c??"",m:i.m??null},W={c:g.c??"",m:g.m??null};if(Je(z,A)||Je(W,A)||Je(z,W))continue;if(E.t==="code_block"){for(let P of[h.get(c),w.get(c)])P.c=g.c??"",g.m?P.m=g.m:delete P.m;a.push({id:c,kind:"text",local:i.c??"",remote:g.c??""});continue}let T=t($t(E,r),$t(i,r),$t(g,r));for(let P of T.conflicts)a.push({id:c,kind:"text",local:P.local?.textContent??null,remote:P.remote?.textContent??null});let[U]=tt(T.root,{seed:"",known:new Map});for(let P of[h.get(c),w.get(c)])P.c=U.c,U.m?P.m=U.m:delete P.m}let y=o.map(c=>c.id);for(let[c,E]of u){let i=h.get(c);if(!i||b.has(c)||Je(p.get(c),E))continue;let g=y.indexOf(c)-1;for(;g>=0&&!w.has(y[g]);)g--;let A=g<0?0:M.findIndex(z=>z.id===y[g])+1;M.splice(A,0,{...i}),w.set(c,M[A]),a.push({id:c,kind:"kept-edit"})}let N=s(e,C,M,{onConflict:c=>a.push({kind:"field",path:c.path,local:c.local,remote:c.remote,resolved:c.resolved})}),B=new Set(N.map(c=>c.id)),v=c=>(p.get(c)??u.get(c)??b.get(c))?.parent??null,L=N.map(c=>{let E=c.parent??null;for(;E&&!B.has(E);)E=v(E);return E===(c.parent??null)?c:{...c,parent:E}}),Y=new Map(L.map(c=>[c.id,c.parent??null])),$=c=>{let E=new Set([c]);for(let i=Y.get(c);i;i=Y.get(i)){if(E.has(i))return!0;E.add(i)}return!1};for(let c of L)if($(c.id)){for(let E of[p.get(c.id)?.parent,u.get(c.id)?.parent,null])if(Y.set(c.id,E&&B.has(E)?E:null),!$(c.id))break}return{items:L.map(c=>(c.parent??null)===Y.get(c.id)?c:{...c,parent:Y.get(c.id)}),conflicts:a}}var _o=e=>{try{return Xt(e)}catch{return null}},$e={ok:!0,outcome:"unchanged"},Ke={ok:!1,outcome:"disposed",reason:"adoption-disposed"},He={ok:!1,outcome:"refused",reason:"adoption-refused"},No={ok:!1,outcome:"refused",reason:"adoption-timeout"},Fo={ok:!1,outcome:"error",reason:"adoption-error"},Lo={ok:!0,outcome:"writer-adopts"},Vn=e=>({ok:!0,outcome:"adopted",counts:e}),Wn=1e4;function Bo(e){let o=e.querySelector(Et);return o?{article:o.cloneNode(!0),tags:Jn(e).map(n=>_o(n.textContent))}:null}function Un(e){return new Promise(o=>{if(!e.composing)return o();e.dom.addEventListener("compositionend",()=>setTimeout(()=>o(Un(e)),0),{once:!0})})}function Do({view:e,source:o=null,ready:n=Promise.resolve(),isAdopter:r=()=>!0,idle:t=()=>Un(e),requestCheckpoint:s=()=>{},notice:a=()=>{},snapshot:f=()=>null,mergeTagless:u=!1,seeded:p=!1,writerReady:b=()=>Promise.resolve(),adopted:C=()=>{},hold:M=Vt,release:h=Wt,holdMs:w=Wn,doc:y=document}){let N=o?o.article.innerHTML:null,B=o?o.article:null,v=new Map,L=P=>{let I=P.getAttribute("data-rev");if(!I)return;let K=v.get(I)??[];v.delete(I),v.set(I,K),K.push(P),K.length>10&&K.shift(),v.size>20&&v.delete(v.keys().next().value)};B&&L(B);let Y=Promise.resolve(),$=!1,x,c=new Promise(P=>x=P);async function E(){let P,I=new Promise(K=>{P=setTimeout(()=>K("timeout"),w)});try{return await Promise.race([Promise.resolve(n).then(()=>t()).then(()=>"ready"),c.then(()=>"disposed"),I])}finally{clearTimeout(P)}}function i(P,I,K,j){let{HyperMorph:Q}=Gt(),le=jt(K,I,j,{doc:y,merge3:Q.merge3,mergeJson:Q.mergeJson}),ee=le.conflicts.filter(D=>D.kind==="text"||D.kind==="field"),m=ee.length?f():null,l=Dn(P,le.items,I),k=l&&zn(e.state,l);if(!k)return null;e.dispatch(k),e.dispatch(sn.closeHistory(e.state.tr));let F={edited:l.edited.size,created:l.created.size,deleted:l.deleted.length,moved:l.reordered},{displaced:R}=k.getMeta(Bn);return Object.keys(R).length&&(F.displaced=R),ee.length&&(F.conflicts=ee),m&&(F.copy=m),F}async function g(P){if(u&&!P.tags.length)return A(P);let I=Mt(P.article,P.tags);if(I.kind==="unbased"&&console.warn("page: the article and its data changed together; kept the data"),I.kind!=="adopt")return $e;if(!r())return Lo;M();try{if(await ft(),$)return Ke;if(!r())return He;let K=await E();if(K==="timeout"&&console.warn("page: gave up waiting for the editor; the hand edit was not adopted"),K==="disposed"||$)return Ke;if(K!=="ready")return No;if(!r())return He;let j=ht(e.state.doc),Q=i(j,it(j,y),I.baseItems,I.parsed);return Q?(C(I.A),Vn(Q)):$e}finally{h()}}async function A(P){let I=P.article.getAttribute("data-rev"),K=I&&v.get(I)||[],j=K.at(-1)??B;if(K.slice(0,-1).some(Q=>Q.innerHTML===P.article.innerHTML)||(L(P.article),B=P.article,!j)||j.outerHTML===P.article.outerHTML)return $e;M();try{if(await ft(),$)return Ke;if(!r())return He;if(await b(),$)return Ke;if(!r())return He;if(await E()==="disposed"||$)return Ke;if(!r())return He;let le=ht(e.state.doc),ee=it(le,y),m=new Map(ee.map(F=>[F.id,F])),l=F=>tt(F,{seed:F.getAttribute("data-rev")??"",known:m}),k=i(le,ee,l(j),l(P.article));return k?Vn(k):$e}finally{h()}}async function z(P){try{return await g(P)}catch(I){return console.error("page: adoption failed",I),Fo}}let W=null;function T(P,I=!1){return Y=Y.then(()=>z(P)).then(K=>(I&&(W=K),!K.ok||K.outcome!=="adopted"||(s(),a(K.counts),y.dispatchEvent(new CustomEvent("clay:page-adopted",{detail:K.counts}))),K)),Y}function U(P){let I=P.detail?.html;if($||typeof I!="string")return;let K=Bo(new DOMParser().parseFromString(I,"text/html"));!K||K.article.innerHTML===N||(N=K.article.innerHTML,T(K))}return y.addEventListener("clay:sync-applied",U),o&&!p&&T(o,!0),{idle:async()=>(await Y,W),saved(P){if(!u||typeof P!="string")return;let I=new DOMParser().parseFromString(P,"text/html").querySelector(Et);I&&(L(I),B=I)},dispose(){$=!0,x(),y.removeEventListener("clay:sync-applied",U)}}}var Gn='["text-delete",',Xn=(e,o)=>o instanceof nn&&o._item&&o._item.parent===e.attrs&&typeof o._item.parentSub=="string"?o._item.parentSub:null,Qn=e=>e==="t"||e==="parent",_t=e=>e.content instanceof de&&e.content.embed.b!==void 0,zo=e=>e.content instanceof mt||e.content instanceof Te||e.content instanceof de&&e.content.embed.b===void 0,eo=e=>{let o=new Map;for(let n of e.stops)(o.get(n.client)??o.set(n.client,[]).get(n.client)).push(n);return o},to=(e,o)=>{let n=o.get(e.id.client);if(!n)return!1;let r=e.id.clock,t=r+e.length;return n.some(s=>s.clock<t&&r<s.clock+s.len)},Jo=(e,o)=>{for(let n=e.left;n;n=n.left){if(n.deleted){if(to(n,o))return null;continue}if(_t(n))return n}return null};function no(e,o,n){let r=eo(n),t=new Set,s=new Set,a=o.changed.get(e.tableFields)??new Set;for(let[h,w]of o.changed){if(h===e.flow)continue;if(h===e.attrs){if(!o.local)return null;for(let N of w){let B=e.attrs.get(N);if(!(B instanceof Ae)||B._item.left||B._item.id.clock<(o.beforeState.get(B._item.id.client)??0))return null;s.add(N)}if(s.size>1)return null;continue}if(h===e.tableFields){for(let N of w){let B=e.tableFields.has(N)?On(N,e.tableFields.get(N)):null;if(B===null)return null;t.add(B)}continue}let y=Xn(e,h);if(y!==null){for(let N of w)if(Qn(N))return null;t.add(y);continue}if(h!==e.gone)return null;for(let N of w)if(typeof N!="string"||!N.startsWith(Gn))return null}let f=e.ydoc.store,u=null,p=null,b=!1,C=h=>{if(!(h instanceof on))return!1;if(h.parent===e.gone)return typeof h.parentSub=="string"&&h.parentSub.startsWith(Gn);if(h.parent===e.tableFields)return a.has(h.parentSub);if(h.parent===e.attrs)return s.has(h.parentSub);if(h.parent!==e.flow){let y=Xn(e,h.parent);return y!==null&&(s.has(y)||t.has(y)&&!Qn(h.parentSub))}if(_t(h)){if(h.deleted||!s.has(h.content.embed.b))return!1;p=h}else if(!zo(h))return!1;let w=Jo(h,r);return!w||u&&w!==u?!1:(u=w,h.content instanceof Te&&(b=!0),!0)};for(let[h,w]of o.afterState)for(let y=o.beforeState.get(h)??0;y<w;){let N=et(f,{client:h,clock:y});if(!C(N))return null;y=N.id.clock+N.length}let M=!1;for(let[h,w]of o.deleteSet.clients)for(let{clock:y,len:N}of w)for(let B=y;B<y+N;){let v=et(f,{client:h,clock:B});if(!C(v))return null;M=!0,B=v.id.clock+v.length}return s.size&&!p?null:u||t.size?{marker:u,split:p,deleted:M,formats:b,fields:t,remote:!o.local}:null}var Ko=e=>{for(let o in e)return{...e};return null};function oo(e,o,n,r=null){let t=r?.formats??!0,s=r?.split??null,a=o.visible,f=-1,u=0;for(let i=0;i<a.length;i++){let g=a[i];if(g.brk&&g.brk.client===n.id.client&&g.brk.clock===n.id.clock){f=i;break}u+=g.len}if(f<0)return null;let p=a[f];if(p.implicit||p.atom||p.opaque||p.recovered||p.hide)return null;let b=p.runs.findIndex(i=>i.hole!==void 0);if(b>=0&&t||p.items&&o.copies.has(p.baseId))return null;let C=eo(o),M={...p.fmtIn??{}},h=null,w={...p,runs:[],len:1};p.items&&(w.items=[]);let y=w,N=!1,B=Ye(o.holes,u),v=B+1;for(let i=n.right;i;i=i.right){if(i.deleted){if(to(i,C))return null;continue}if(_t(i)&&(i!==s||y!==w)){N=!0;break}let g=v;i.countable&&(v+=i.length);let A=i.content;if(i===s){let z=A.embed.b,W=e.attrs.get(z)?.get("t")||"paragraph";if(!Object.hasOwn(fe.nodes,W)||!fe.nodes[W].isTextblock)return null;let T=Ko(M);w.fmtOut=T,y={kind:"b",id:z,baseId:z,brk:{client:i.id.client,clock:i.id.clock},implicit:!1,runs:[],len:1,atom:!1,items:null,fmtIn:T,fmtOut:null,t:W,opaque:!1},h=null;continue}if(A instanceof Te){A.value===null?delete M[A.key]:M[A.key]=A.value,h=null;continue}if(A instanceof de){y.runs.push({br:!0}),y.items&&y.items.push({at:g,id:Ee(i.id),client:i.id.client,clock:i.id.clock,length:i.length,kind:"br",text:null,blockId:null,raw:{...M}}),y.len+=1;continue}if(A instanceof mt){if(!h){let z=kn(M,y.t);h={marks:z,mk:bn(z)}}y.runs.push({text:A.str,marks:h.marks,mk:h.mk}),y.items&&y.items.push({at:g,id:Ee(i.id),client:i.id.client,clock:i.id.clock,length:i.length,kind:"text",text:A.str,blockId:null,raw:{...M}}),y.len+=A.str.length}else if(i.countable)return null}let L=p.len;if(b<0){if(!ye(M,p.fmtOut??{}))return null}else{if(!N||y.t!==p.t)return null;L=1;for(let i=0;i<b;i++)L+=p.runs[i].br?1:p.runs[i].text.length}let Y=y===w?[w]:[w,y],$=Y.reduce((i,g)=>i+g.len,0)-L,x=B+L,c=i=>i.at>=x?{...i,at:i.at+$}:i;y.fmtOut=p.fmtOut,b>=0&&(y.runs=y.runs.concat(p.runs.slice(b)),y.len+=p.len-L,y.items&&(y.items=y.items.concat(p.items.filter(i=>i.at>=x).map(c))));let E={...o,visible:a.slice(),tokens:o.tokens+$};if(E.visible.splice(f,1,...Y),$){let i=u+L;E.holes=o.holes.map(g=>g.at>=i?{at:g.at+$,len:g.len}:g),E.hidden=o.hidden.map(g=>g.at>=x?{...g,at:g.at+$,items:g.items.map(c)}:g);for(let g=f+Y.length;g<E.visible.length;g+=1){let A=E.visible[g];A.items?.length&&(E.visible[g]={...A,items:A.items.map(c)})}}return E}var Ho=e=>e.br?`
1
+ import{a as Ct,b as It,c as At,d as ze,e as Ye,f as Kn,g as Tt,h as Hn,i as qn,j as Pt,l as Rt}from"./c-QIKT6SKM.js";import{a as Et,b as Jn,c as Ro,f as Yo}from"./c-FDAXZ2PM.js";import{a as Bn,b as Dn,c as zn,d as it,e as Mt,f as $o}from"./c-DHBRA6DL.js";import{a as Po}from"./c-L3F5ZLIV.js";import{b as Co,c as Io}from"./c-JDZDF2QM.js";import"./c-IW6GGOU2.js";import"./c-HAWFNBYG.js";import{a as Re,b as $n,p as Nn,q as Fn,u as Ao,v as To}from"./c-SJPD46ZO.js";import{A as Cn,B as Be,C as ot,D as In,E as An,F as De,G as Tn,H as Pe,I as rt,J as Pn,K as xt,L as Rn,M as st,N as Yn,O as ue,a as Le,b as bt,c as yn,d as vn,f as wn,j as xn,m as Eo,p as Sn,q as On,r as Mn,s as En,t as yt,v as vt,x as wt,z as Oe}from"./c-EXKHPOVC.js";import{a as me,b as pn,d as Me,e as _e,g as xe,h as Ne,i as ye,j as Ee,k as mn,l as Fe,m as nt,n as be,o as hn,p as gn,q as Se,r as Ce,u as bn,v as kn,w as kt}from"./c-L5VFATT6.js";import"./c-XQSXKIKM.js";import"./c-67ILSNPR.js";import"./c-W4JCVLAB.js";import"./c-7K4SCQB7.js";import{f as Zt,g as en,i as Qe,j as Ze,k as ut,n as dt,o as et,p as tn,s as pt,t as nn,u as Ae,v as de,w as Te,x as mt,y as on}from"./c-WMRJKQ2V.js";import{g as Ln,o as Ot}from"./c-44B5ODN7.js";import{F as an,N as ht,Q as gt,R as fn,b as pe,c as rn,e as sn,m as fe,oa as je,p as ln,r as cn,ra as un,sa as dn,ua as tt}from"./c-QIXT3Q7C.js";import{b as Ut}from"./c-QY7F6EN6.js";import{a as jn,b as _n,c as St}from"./c-E4IBSAQM.js";import{a as Xt}from"./c-TCCA5BZN.js";import"./c-3LDGIBMN.js";import{c as Qt}from"./c-57XDY6HC.js";import"./c-JHJR5BQX.js";import{a as Gt,b as ft}from"./c-FILLTJA7.js";import"./c-TWCXBWS3.js";import{d as Vt,e as Wt}from"./c-NLZ5AN4L.js";import"./c-4ASQPRQL.js";import"./c-GQ6F6IDK.js";import"./c-I2SCCUEW.js";import"./c-5VYOWDTI.js";import"./c-GSRLXYWL.js";import"./c-X5LNHET5.js";import"./c-WYFDLITL.js";import"./c-UGHH4MB3.js";import"./c-LA2BW7UY.js";import"./c-GVPNDIKJ.js";import"./c-ATKAOH23.js";import"./c-EK63G3CG.js";import"./c-NQJRVJ56.js";import"./c-XGH4GS2T.js";import"./c-IJUK2GPW.js";import"./c-3O7OBDCM.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-N7JPUPGC.js";import"./c-EGTIAL6P.js";import"./c-XQXZAO7N.js";import"./c-S7LK4KUE.js";import"./c-VG5XIN4T.js";import"./c-2YYDMLNZ.js";import"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var Yt=new Set(["paragraph","heading","list_item","callout","quote","code_block","toggle"]),Je=(e,o)=>je(e)===je(o);function $t(e,o){let n=o.createElement("article");return n.setAttribute("data-page",""),n.innerHTML=dn([{id:e.id,t:"paragraph",c:e.c??"",...e.m?{m:e.m}:{}}],{clean:un(o)}),n}function jo(e,o){let n=new Map(e.map((f,u)=>[f.id,u])),r=new Set(o.map(f=>f.id)),t=new Map,s=0;return o.map(f=>{let u=n.get(f.id);if(u!==void 0)return s=u+1,f;let p={c:f.c??"",m:f.m??null};for(let b=s;b<e.length;b++){let C=e[b];if(!(r.has(C.id)||C.t!==f.t||!Je({c:C.c??"",m:C.m??null},p)))return r.add(C.id),s=b+1,t.set(f.id,C.id),{...f,id:C.id}}return f}).map(f=>t.has(f.parent)?{...f,parent:t.get(f.parent)}:f)}function jt(e,o,n,{doc:r,merge3:t,mergeJson:s}){let a=[],f=jo(e,n),u=new Map(e.map(c=>[c.id,c])),p=new Map(o.map(c=>[c.id,c])),b=new Map(f.map(c=>[c.id,c])),C=o.map(c=>({...c})),M=f.map(c=>({...c})),h=new Map(C.map(c=>[c.id,c])),w=new Map(M.map(c=>[c.id,c]));for(let[c,E]of u){let i=p.get(c),g=b.get(c);if(!i||!g||!Yt.has(E.t)||!Yt.has(i.t)||!Yt.has(g.t))continue;let A={c:E.c??"",m:E.m??null},z={c:i.c??"",m:i.m??null},W={c:g.c??"",m:g.m??null};if(Je(z,A)||Je(W,A)||Je(z,W))continue;if(E.t==="code_block"){for(let P of[h.get(c),w.get(c)])P.c=g.c??"",g.m?P.m=g.m:delete P.m;a.push({id:c,kind:"text",local:i.c??"",remote:g.c??""});continue}let T=t($t(E,r),$t(i,r),$t(g,r));for(let P of T.conflicts)a.push({id:c,kind:"text",local:P.local?.textContent??null,remote:P.remote?.textContent??null});let[U]=tt(T.root,{seed:"",known:new Map});for(let P of[h.get(c),w.get(c)])P.c=U.c,U.m?P.m=U.m:delete P.m}let y=o.map(c=>c.id);for(let[c,E]of u){let i=h.get(c);if(!i||b.has(c)||Je(p.get(c),E))continue;let g=y.indexOf(c)-1;for(;g>=0&&!w.has(y[g]);)g--;let A=g<0?0:M.findIndex(z=>z.id===y[g])+1;M.splice(A,0,{...i}),w.set(c,M[A]),a.push({id:c,kind:"kept-edit"})}let N=s(e,C,M,{onConflict:c=>a.push({kind:"field",path:c.path,local:c.local,remote:c.remote,resolved:c.resolved})}),B=new Set(N.map(c=>c.id)),v=c=>(p.get(c)??u.get(c)??b.get(c))?.parent??null,L=N.map(c=>{let E=c.parent??null;for(;E&&!B.has(E);)E=v(E);return E===(c.parent??null)?c:{...c,parent:E}}),Y=new Map(L.map(c=>[c.id,c.parent??null])),$=c=>{let E=new Set([c]);for(let i=Y.get(c);i;i=Y.get(i)){if(E.has(i))return!0;E.add(i)}return!1};for(let c of L)if($(c.id)){for(let E of[p.get(c.id)?.parent,u.get(c.id)?.parent,null])if(Y.set(c.id,E&&B.has(E)?E:null),!$(c.id))break}return{items:L.map(c=>(c.parent??null)===Y.get(c.id)?c:{...c,parent:Y.get(c.id)}),conflicts:a}}var _o=e=>{try{return Xt(e)}catch{return null}},$e={ok:!0,outcome:"unchanged"},Ke={ok:!1,outcome:"disposed",reason:"adoption-disposed"},He={ok:!1,outcome:"refused",reason:"adoption-refused"},No={ok:!1,outcome:"refused",reason:"adoption-timeout"},Fo={ok:!1,outcome:"error",reason:"adoption-error"},Lo={ok:!0,outcome:"writer-adopts"},Vn=e=>({ok:!0,outcome:"adopted",counts:e}),Wn=1e4;function Bo(e){let o=e.querySelector(Et);return o?{article:o.cloneNode(!0),tags:Jn(e).map(n=>_o(n.textContent))}:null}function Un(e){return new Promise(o=>{if(!e.composing)return o();e.dom.addEventListener("compositionend",()=>setTimeout(()=>o(Un(e)),0),{once:!0})})}function Do({view:e,source:o=null,ready:n=Promise.resolve(),isAdopter:r=()=>!0,idle:t=()=>Un(e),requestCheckpoint:s=()=>{},notice:a=()=>{},snapshot:f=()=>null,mergeTagless:u=!1,seeded:p=!1,writerReady:b=()=>Promise.resolve(),adopted:C=()=>{},hold:M=Vt,release:h=Wt,holdMs:w=Wn,doc:y=document}){let N=o?o.article.innerHTML:null,B=o?o.article:null,v=new Map,L=P=>{let I=P.getAttribute("data-rev");if(!I)return;let K=v.get(I)??[];v.delete(I),v.set(I,K),K.push(P),K.length>10&&K.shift(),v.size>20&&v.delete(v.keys().next().value)};B&&L(B);let Y=Promise.resolve(),$=!1,x,c=new Promise(P=>x=P);async function E(){let P,I=new Promise(K=>{P=setTimeout(()=>K("timeout"),w)});try{return await Promise.race([Promise.resolve(n).then(()=>t()).then(()=>"ready"),c.then(()=>"disposed"),I])}finally{clearTimeout(P)}}function i(P,I,K,j){let{HyperMorph:Q}=Gt(),le=jt(K,I,j,{doc:y,merge3:Q.merge3,mergeJson:Q.mergeJson}),ee=le.conflicts.filter(D=>D.kind==="text"||D.kind==="field"),m=ee.length?f():null,l=Dn(P,le.items,I),k=l&&zn(e.state,l);if(!k)return null;e.dispatch(k),e.dispatch(sn.closeHistory(e.state.tr));let F={edited:l.edited.size,created:l.created.size,deleted:l.deleted.length,moved:l.reordered},{displaced:R}=k.getMeta(Bn);return Object.keys(R).length&&(F.displaced=R),ee.length&&(F.conflicts=ee),m&&(F.copy=m),F}async function g(P){if(u&&!P.tags.length)return A(P);let I=Mt(P.article,P.tags);if(I.kind==="unbased"&&console.warn("page: the article and its data changed together; kept the data"),I.kind!=="adopt")return $e;if(!r())return Lo;M();try{if(await ft(),$)return Ke;if(!r())return He;let K=await E();if(K==="timeout"&&console.warn("page: gave up waiting for the editor; the hand edit was not adopted"),K==="disposed"||$)return Ke;if(K!=="ready")return No;if(!r())return He;let j=ht(e.state.doc),Q=i(j,it(j,y),I.baseItems,I.parsed);return Q?(C(I.A),Vn(Q)):$e}finally{h()}}async function A(P){let I=P.article.getAttribute("data-rev"),K=I&&v.get(I)||[],j=K.at(-1)??B;if(K.slice(0,-1).some(Q=>Q.innerHTML===P.article.innerHTML)||(L(P.article),B=P.article,!j)||j.outerHTML===P.article.outerHTML)return $e;M();try{if(await ft(),$)return Ke;if(!r())return He;if(await b(),$)return Ke;if(!r())return He;if(await E()==="disposed"||$)return Ke;if(!r())return He;let le=ht(e.state.doc),ee=it(le,y),m=new Map(ee.map(F=>[F.id,F])),l=F=>tt(F,{seed:F.getAttribute("data-rev")??"",known:m}),k=i(le,ee,l(j),l(P.article));return k?Vn(k):$e}finally{h()}}async function z(P){try{return await g(P)}catch(I){return console.error("page: adoption failed",I),Fo}}let W=null;function T(P,I=!1){return Y=Y.then(()=>z(P)).then(K=>(I&&(W=K),!K.ok||K.outcome!=="adopted"||(s(),a(K.counts),y.dispatchEvent(new CustomEvent("clay:page-adopted",{detail:K.counts}))),K)),Y}function U(P){let I=P.detail?.html;if($||typeof I!="string")return;let K=Bo(new DOMParser().parseFromString(I,"text/html"));!K||K.article.innerHTML===N||(N=K.article.innerHTML,T(K))}return y.addEventListener("clay:sync-applied",U),o&&!p&&T(o,!0),{idle:async()=>(await Y,W),saved(P){if(!u||typeof P!="string")return;let I=new DOMParser().parseFromString(P,"text/html").querySelector(Et);I&&(L(I),B=I)},dispose(){$=!0,x(),y.removeEventListener("clay:sync-applied",U)}}}var Gn='["text-delete",',Xn=(e,o)=>o instanceof nn&&o._item&&o._item.parent===e.attrs&&typeof o._item.parentSub=="string"?o._item.parentSub:null,Qn=e=>e==="t"||e==="parent",_t=e=>e.content instanceof de&&e.content.embed.b!==void 0,zo=e=>e.content instanceof mt||e.content instanceof Te||e.content instanceof de&&e.content.embed.b===void 0,eo=e=>{let o=new Map;for(let n of e.stops)(o.get(n.client)??o.set(n.client,[]).get(n.client)).push(n);return o},to=(e,o)=>{let n=o.get(e.id.client);if(!n)return!1;let r=e.id.clock,t=r+e.length;return n.some(s=>s.clock<t&&r<s.clock+s.len)},Jo=(e,o)=>{for(let n=e.left;n;n=n.left){if(n.deleted){if(to(n,o))return null;continue}if(_t(n))return n}return null};function no(e,o,n){let r=eo(n),t=new Set,s=new Set,a=o.changed.get(e.tableFields)??new Set;for(let[h,w]of o.changed){if(h===e.flow)continue;if(h===e.attrs){if(!o.local)return null;for(let N of w){let B=e.attrs.get(N);if(!(B instanceof Ae)||B._item.left||B._item.id.clock<(o.beforeState.get(B._item.id.client)??0))return null;s.add(N)}if(s.size>1)return null;continue}if(h===e.tableFields){for(let N of w){let B=e.tableFields.has(N)?On(N,e.tableFields.get(N)):null;if(B===null)return null;t.add(B)}continue}let y=Xn(e,h);if(y!==null){for(let N of w)if(Qn(N))return null;t.add(y);continue}if(h!==e.gone)return null;for(let N of w)if(typeof N!="string"||!N.startsWith(Gn))return null}let f=e.ydoc.store,u=null,p=null,b=!1,C=h=>{if(!(h instanceof on))return!1;if(h.parent===e.gone)return typeof h.parentSub=="string"&&h.parentSub.startsWith(Gn);if(h.parent===e.tableFields)return a.has(h.parentSub);if(h.parent===e.attrs)return s.has(h.parentSub);if(h.parent!==e.flow){let y=Xn(e,h.parent);return y!==null&&(s.has(y)||t.has(y)&&!Qn(h.parentSub))}if(_t(h)){if(h.deleted||!s.has(h.content.embed.b))return!1;p=h}else if(!zo(h))return!1;let w=Jo(h,r);return!w||u&&w!==u?!1:(u=w,h.content instanceof Te&&(b=!0),!0)};for(let[h,w]of o.afterState)for(let y=o.beforeState.get(h)??0;y<w;){let N=et(f,{client:h,clock:y});if(!C(N))return null;y=N.id.clock+N.length}let M=!1;for(let[h,w]of o.deleteSet.clients)for(let{clock:y,len:N}of w)for(let B=y;B<y+N;){let v=et(f,{client:h,clock:B});if(!C(v))return null;M=!0,B=v.id.clock+v.length}return s.size&&!p?null:u||t.size?{marker:u,split:p,deleted:M,formats:b,fields:t,remote:!o.local}:null}var Ko=e=>{for(let o in e)return{...e};return null};function oo(e,o,n,r=null){let t=r?.formats??!0,s=r?.split??null,a=o.visible,f=-1,u=0;for(let i=0;i<a.length;i++){let g=a[i];if(g.brk&&g.brk.client===n.id.client&&g.brk.clock===n.id.clock){f=i;break}u+=g.len}if(f<0)return null;let p=a[f];if(p.implicit||p.atom||p.opaque||p.recovered||p.hide)return null;let b=p.runs.findIndex(i=>i.hole!==void 0);if(b>=0&&t||p.items&&o.copies.has(p.baseId))return null;let C=eo(o),M={...p.fmtIn??{}},h=null,w={...p,runs:[],len:1};p.items&&(w.items=[]);let y=w,N=!1,B=Ye(o.holes,u),v=B+1;for(let i=n.right;i;i=i.right){if(i.deleted){if(to(i,C))return null;continue}if(_t(i)&&(i!==s||y!==w)){N=!0;break}let g=v;i.countable&&(v+=i.length);let A=i.content;if(i===s){let z=A.embed.b,W=e.attrs.get(z)?.get("t")||"paragraph";if(!Object.hasOwn(fe.nodes,W)||!fe.nodes[W].isTextblock)return null;let T=Ko(M);w.fmtOut=T,y={kind:"b",id:z,baseId:z,brk:{client:i.id.client,clock:i.id.clock},implicit:!1,runs:[],len:1,atom:!1,items:null,fmtIn:T,fmtOut:null,t:W,opaque:!1},h=null;continue}if(A instanceof Te){A.value===null?delete M[A.key]:M[A.key]=A.value,h=null;continue}if(A instanceof de){y.runs.push({br:!0}),y.items&&y.items.push({at:g,id:Ee(i.id),client:i.id.client,clock:i.id.clock,length:i.length,kind:"br",text:null,blockId:null,raw:{...M}}),y.len+=1;continue}if(A instanceof mt){if(!h){let z=kn(M,y.t);h={marks:z,mk:bn(z)}}y.runs.push({text:A.str,marks:h.marks,mk:h.mk}),y.items&&y.items.push({at:g,id:Ee(i.id),client:i.id.client,clock:i.id.clock,length:i.length,kind:"text",text:A.str,blockId:null,raw:{...M}}),y.len+=A.str.length}else if(i.countable)return null}let L=p.len;if(b<0){if(!ye(M,p.fmtOut??{}))return null}else{if(!N||y.t!==p.t)return null;L=1;for(let i=0;i<b;i++)L+=p.runs[i].br?1:p.runs[i].text.length}let Y=y===w?[w]:[w,y],$=Y.reduce((i,g)=>i+g.len,0)-L,x=B+L,c=i=>i.at>=x?{...i,at:i.at+$}:i;y.fmtOut=p.fmtOut,b>=0&&(y.runs=y.runs.concat(p.runs.slice(b)),y.len+=p.len-L,y.items&&(y.items=y.items.concat(p.items.filter(i=>i.at>=x).map(c))));let E={...o,visible:a.slice(),tokens:o.tokens+$};if(E.visible.splice(f,1,...Y),$){let i=u+L;E.holes=o.holes.map(g=>g.at>=i?{at:g.at+$,len:g.len}:g),E.hidden=o.hidden.map(g=>g.at>=x?{...g,at:g.at+$,items:g.items.map(c)}:g);for(let g=f+Y.length;g<E.visible.length;g+=1){let A=E.visible[g];A.items?.length&&(E.visible[g]={...A,items:A.items.map(c)})}}return E}var Ho=e=>e.br?`
2
2
  `:e.hole!==void 0?{hole:e.hole}:{text:e.text,mk:e.mk},qo=e=>{let o=[];for(let n of e.map(Ho)){let r=o[o.length-1];r&&typeof r=="object"&&typeof n=="object"&&r.text!==void 0&&n.text!==void 0&&r.mk===n.mk?o[o.length-1]={text:r.text+n.text,mk:n.mk}:o.push(n)}return o},Zn=(e,o)=>{let n=et(e.ydoc.store,{client:o.client,clock:o.clock});return{client:n.id.client,clock:n.id.clock,len:n.length}},Ve=(e,o)=>rt({...o,copies:[...o.copies],fences:o.fences.map(n=>Zn(e,n)),stops:o.stops.map(n=>Zn(e,n)),visible:o.visible.map(n=>({...n,runs:qo(n.runs)}))});var ro=e=>e===!0?{}:e,so=(e,o)=>ye(ro(e),ro(o));function co(e,o,n,r){let t=e.attrs.get(o);t||(t=new Ae,e.attrs.set(o,t));let s=fe.nodes[n];if(!s){t.get("t")!==n&&t.set("t",n);for(let[p,b]of Object.entries(r??{}))p==="t"||p==="pos"||ye(t.has(p)?t.get(p):void 0,b)||t.set(p,b);return}let a=n==="table"&&t.get("t")==="table"&&!xt(o),f=n==="board"&&!xt(o),u=a?Mn(e.tableFields,o,En(e,o)):f?vt(e.boardFields,o):null;t.get("t")!==n&&t.set("t",n);for(let p of xe(s)){if(a&&(p==="rows"||p==="cols")||f&&(p==="columns"||p==="cards"))continue;let b=t.has(p)?t.get(p):Ne(s,p);ye(b,r[p])||t.set(p,r[p])}a&&yt(e,o,u,r),f&&wt(e,o,u,r)}function io(e,o){let n=new Map,r=o;for(let t=e.flow._start;t&&r>0;t=t.right){if(t.deleted)continue;let s=t.content;s instanceof Te?s.value===null?n.delete(s.key):n.set(s.key,s.value):t.countable&&(r-=t.length)}return n}function Vo(e){let o=new Set;for(let[r,t]of e)Ce(r)&&t&&o.add(r.split("!")[0]);let n=[];for(let[r,t]of e)!Ce(r)&&t!==null&&t!==void 0&&!o.has(r)&&fe.marks[Se(r)]&&n.push([r,t]);return n}function ao(e){let o=new Set;for(let[r,t]of e)Ce(r)&&t&&o.add(r.split("!")[0]);let n=[];for(let[r,t]of e)!Ce(r)&&t!==null&&t!==void 0&&!o.has(r)&&!fe.marks[Se(r)]&&n.push([r,t]);return n}function fo(e,o={}){let n={},r=!1;for(let[t,s]of e)(Ce(t)||fe.marks[Se(t)])&&(n[t]=s);for(let[t,s]of ao(e))r=!0,o[Se(t)]!==void 0&&(n[t]=s);return{attrs:n,opaque:r}}function Wo(e,o,n){let r=be(e),t={},s=Vo(o),a=new Set;for(let[u,p]of s){let b=Se(u),C=n[b];C!==void 0&&so(C,p)?a.add(b):t[`${u}!${r}`]=!0}for(let[u,p]of ao(o)){let b=Se(u);n[b]!==void 0&&so(n[b],p)&&a.add(b)}for(let[u,p]of Object.entries(n))a.has(u)||(t[`${u}~${be(e)}`]=p);let f=fo(o,n);if(!(!Object.keys(t).length&&!f.opaque))return{...f.attrs,...t}}var Nt=2e3;function Uo(e){let o=[],n=[],r=0;for(let t=0;t<e.length;t++)if(n.push(e[t]),r+=1,r>=Nt&&t+1<e.length){let s=e[t];if(s.k==="c"&&Fe(s.ch.charCodeAt(0)))continue;o.push(n),n=[],r=0}return n.length&&o.push(n),o}function lt(e,o,n,r=s=>s(),t=null){let s=o;for(let a of Uo(n))r(()=>{s+=Xo(e,s,a,t)});return s-o}var Go=(e,o,n)=>{if(!n||!n.length)return null;let r=o,t=e.flow._start;for(;t&&r>0;){if(!t.deleted&&t.countable){if(r<t.length)return null;r-=t.length}t=t.right}for(;t&&(t.deleted||!t.countable);t=t.right)if(t.deleted&&n.some(s=>s.client===t.id.client&&s.clock>=t.id.clock&&s.clock<t.id.clock+t.length))return t;return null},We=(e,o,n,r)=>{let t=Go(e,o,n);if(!t)return r();t.deleted=!1;try{return r()}finally{t.deleted=!0,e.flow._searchMarker&&(e.flow._searchMarker.length=0)}};function Xo(e,o,n,r=null){let t=o,s="",a=null,f=null,u=()=>{if(!s)return;let b=Wo(e,io(e,t),f??{});We(e,t,r,()=>e.flow.insert(t,s,b)),t+=s.length,s=""},p=b=>{let C=fo(io(e,t)).attrs;We(e,t,r,()=>e.flow.insertEmbed(t,b,C)),t+=1};for(let b of n)b.k==="c"?(a!==null&&b.mk!==a&&u(),a=b.mk,f=b.ma,s+=b.ch):b.k==="h"?(u(),a=null,p({br:1})):(u(),a=null,p({b:b.id}),co(e,b.id,b.t,b.attrs));return u(),t-o}var Qo=(e,o,n,r)=>{let t=0;for(let s=e.flow._start;s&&t<r;s=s.right){if(s.deleted||!s.countable)continue;let a=t;if(t+=s.length,t<=n||s.content instanceof de&&s.content.embed?.b!==void 0)continue;let f=Math.max(0,n-a),u=Math.min(s.length,r-a);u<=f||e.gone.set(An(s.id.client,s.id.clock+f,o.operationId),{length:u-f,actor:e.ydoc.clientID,sv:o.sv})}};function lo(e,o,n,r=null){for(let t=n.length-1;t>=0;t--){let[s,a]=n[t];if(a<=s)continue;let f=o.physicalRanges(s,a);for(let u=f.length-1;u>=0;u--){let[p,b]=f[u];b<=p||(r&&Qo(e,r,p,b),e.flow.delete(p,b-p))}}}function Zo(e,o,n){let r=!1;for(let t=e.flow._start;t;t=t.right){let s=Ee(t.id);if(s===o){r=!0;continue}if(!r)continue;let a=t.content instanceof de?t.content.embed:null;if(a&&a.b!==void 0&&a.b!==n)return s}return null}function Ft(e,o,n,r,t=null){let{pd:s,map:a,bt:f}=e,u=i=>t===null||t[i],p=0;for(;p<n.length&&p<r.length&&ze(n[p],r[p])&&u(p);)p++;let b=0;for(;b<n.length-p&&b<r.length-p&&ze(n[n.length-1-b],r[r.length-1-b])&&u(n.length-1-b);)b++;let C=i=>i&&i.k==="c"?i.ch.charCodeAt(0):-1;p>0&&Fe(C(n[p-1]))&&(nt(C(n[p]))||nt(C(r[p])))&&p--,b>0&&nt(C(n[n.length-b]))&&(Fe(C(n[n.length-b-1]))||Fe(C(r[r.length-b-1])))&&b--;let M=n.slice(p,n.length-b),h=r.slice(p,r.length-b),w=o+p,y=w+M.length,N=M.filter(i=>i.k==="b").map(i=>i.id).join(",");if(!(M.some(i=>i.k==="b")&&N===h.filter(i=>i.k==="b").map(i=>i.id).join(","))){let i=Le(s.origins);try{for(let T of M){if(T.k!=="b"||!T.brk)continue;let U=i.resolve(T.brk);i.boundaryOf(U)||e.tx(()=>i.recordBoundary(U,{blockId:T.id,kind:"removed"}))}}finally{i.dispose()}let g=new Set;M.forEach((T,U)=>{if(T.k!=="b"||!T.brk)return;let P=w+U,I=P+1;for(;I<f.length&&f[I].k!=="b";)I++;let K=I<=y&&I!==P+1,j=I<f.length?f[I].brk:null;K&&(e.tx(()=>s.gone.set(Be(Ee(T.brk),e.operationId),{blockId:T.id,end:j?Ee(j):null,sv:e.sv})),g.add(P))});let A=[],z=w;for(let T=w;T<y;T++)g.has(T)&&(T>z&&A.push([z,T]),z=T+1);y>z&&A.push([z,y]),e.tx(()=>lo(s,a,A,M.some(T=>T.k==="b")?null:e));let W=new Set(h.filter(T=>T.k==="b").map(T=>T.id));for(let T of M)if(!(T.k!=="b"||!T.brk||W.has(T.id)))for(let U of e.copies.get(T.id)??[]){let P=Be(U,e.operationId);s.gone.has(P)||e.tx(()=>s.gone.set(P,{blockId:T.id,end:Zo(s,U,T.id),sv:e.sv}))}h.length&&lt(s,a.toPhysical(w,"before"),h,e.tx,e.fences);return}let v=[],L=[],Y=[],$=w,x=0,c=0;for(;x<M.length||c<h.length;){let i=x;for(;i<M.length&&M[i].k!=="b";)i++;let g=c;for(;g<h.length&&h[g].k!=="b";)g++;let A=M.slice(x,i),z=h.slice(c,g);if(A.length&&v.push([$,$+A.length]),z.length&&L.push({at:$,toks:z}),$+=A.length,i<M.length&&(Y.push([M[i],h[g]]),$+=1),x=i+(i<M.length?1:0),c=g+(g<h.length?1:0),i>=M.length&&g>=h.length)break}let E=[...v.map(i=>({at:i[0],d:i})),...L.map(i=>({at:i.at,i}))].sort((i,g)=>g.at-i.at||(i.d?-1:1));for(let i of E)i.d?e.tx(()=>lo(s,a,[i.d],e)):lt(s,a.toPhysical(i.at,"before"),i.i.toks,e.tx,e.fences);for(let[i,g]of Y)e.tx(()=>{if(!fe.nodes[g.t])return;let A=e.recovered.get(i.id);if(A){i.t!==g.t&&s.gone.set(De(A,"t"),g.t);for(let T of xe(fe.nodes[g.t]))ye(i.attrs[T],g.attrs[T])||s.gone.set(De(A,T),g.attrs[T]);return}let z=i.id,W=s.attrs.get(z);if(W){let T=i.t==="table"&&g.t==="table"&&W.get("t")==="table",U=g.t==="board",P=U?i.t==="board"&&W.get("t")==="board"?i.attrs:vt(s.boardFields,z):null;i.t!==g.t&&W.set("t",g.t);for(let I of xe(fe.nodes[g.t])){if(T&&(I==="rows"||I==="cols")||U&&(I==="columns"||I==="cards"))continue;let K=W.has(I)?W.get(I):Ne(fe.nodes[g.t],I);ye(K,g.attrs[I])||W.set(I,g.attrs[I])}T&&yt(s,z,i.attrs,g.attrs),U&&wt(s,z,P,g.attrs)}else co(s,z,g.t,g.attrs)})}function Lt(e,o,n,r,t,s){let{pd:a,map:f}=e,u=`${r}~${be(a)}`,p=be(a),b=o;for(;b<n;){if(s[b].k!=="c"){b++;continue}let C=b;for(;C<n&&s[C].k==="c";)C++;let M=f.physicalRanges(b,C);if(t!==null)for(let[h,w]of M)a.flow.format(h,w-h,{[u]:t});else{let h=0;for(let w of a.flow.toDelta()){let y=typeof w.insert=="string"?w.insert.length:1;for(let[N,B]of M){if(h>=B)break;let v=Math.max(h,N),L=Math.min(h+y,B);if(L>v&&w.attributes){let Y={};for(let[$,x]of Object.entries(w.attributes))Se($)===r&&!Ce($)&&x!==null&&(Y[`${$}!${p}`]=!0);Object.keys(Y).length&&a.flow.format(v,L-v,Y)}}h+=y}}b=C}}var{AddMarkStep:uo,RemoveMarkStep:er,AttrStep:tr,ReplaceStep:nr,Mapping:ct}=rn,po=(e,o,n)=>{let r=e.resolve(o),t=e.resolve(n);return[r.depth&&r.node(1).type.name==="table"?r.before(1):o,t.depth&&t.node(1).type.name==="table"?t.after(1):n]},or=(e,o,n)=>{let r=!1;return e.nodesBetween(o,n,t=>(t.type.name==="table"&&(r=!0),!r&&t.type.name!=="table")),r};function mo(e,o,n,r,t=null,s=!0,a=null,{join:f=!1,open:u=!1}={}){let p=()=>{if(a){let l=a;a=null,l()}},b=[],C=[],M=[];for(let l of o)l.steps.forEach((k,F)=>{b.push(k),C.push(l.docs[F]),M.push(k.getMap())});if(!b.length)return;let h=new ct(M),w=[...Qe(Ze(e.ydoc)).entries()].sort((l,k)=>l[0]-k[0]),y=be(e),N=C[0],B=o[o.length-1].doc,v=n.visible.length===0&&N.childCount===1&&N.firstChild.type.name==="paragraph"?[{id:N.firstChild.attrs.id,implicit:!0,t:"paragraph",len:0}]:n.visible,L=new Map,Y=[];{let l=0;v.forEach(k=>{k.implicit&&Y.push({tok:l,id:k.id,t:k.t}),l+=k.len})}Y.sort((l,k)=>k.tok-l.tok);for(let l of Y)l.alias=hn(e),L.set(l.id,l.alias);let $=L.size?n.holes.map(l=>({at:l.at+Y.filter(k=>k.tok<l.at).length,len:l.len})):n.holes,x=Tt(n.tokens+L.size,$,e.flow.length+L.size),c=[],E=[];b.forEach((l,k)=>{let F=l instanceof uo||l instanceof er;if(F&&!or(C[k],l.from,l.to)){E.push({i:k,step:l});return}let R=new ct(M.slice(0,k)).invert(),D=new ct(M.slice(k+1)),q=[];l instanceof tr?q.push([l.pos,l.pos+1,l.pos,l.pos+1]):F?q.push([l.from,l.to,l.from,l.to]):l.getMap().forEach((O,te,X,G)=>q.push([O,te,X,G]));for(let[O,te,X,G]of q){let[Z,oe]=po(N,R.map(O,-1),R.map(te,1)),[ne,Ge]=po(B,D.map(X,-1),D.map(G,1));c.push({oa:Z,ob:oe,na:ne,nb:Ge})}}),c.sort((l,k)=>l.oa-k.oa||l.na-k.na);let i=[];for(let l of c){let k=i[i.length-1];k&&(l.oa<=k.ob||l.na<=k.nb)?(k.ob=Math.max(k.ob,l.ob),k.nb=Math.max(k.nb,l.nb)):i.push({...l})}let g=!Y.length&&!E.length&&b.every(l=>l instanceof nr)&&o.every(fn),A=g?null:It(N,L,v),z=g?null:It(B,L,v),W=g?[]:Ct(N,L,v),T=g?[]:Ct(B,L,v),U=g?i.map(l=>({r:l,old:At(N,l.oa,l.ob),next:At(B,l.na,l.nb)})):null,P=g?U.reduce((l,k)=>l+k.next.end-k.next.start,0):i.reduce((l,k)=>l+(z[k.nb]-z[k.na]),0),I=P>Nt,K=I?l=>e.ydoc.transact(k=>{k.meta.set(_e,s),p(),l()},me):l=>l(),j={pd:e,map:x,bt:W,tx:K,copies:n.copies,fences:n.fences,sv:w,operationId:y,recovered:new Map(n.visible.filter(l=>l.recovered).map(l=>[l.id,l.sourceKey]))},Q=l=>l.filter(k=>k.k==="b").map(k=>`${k.id}|${k.t}|${JSON.stringify(k.attrs)}`).join(`
3
3
  `),le=!g&&(E.length>0||Q(W)!==Q(T)),ee=()=>{for(let F of Y)lt(e,Ye(n.holes,F.tok),[{k:"b",id:F.alias,t:F.t,attrs:Object.fromEntries(xe(fe.nodes[F.t]).map(R=>[R,Ne(fe.nodes[F.t],R)]))}],K);for(let F=i.length-1;F>=0;F--)if(g){let{r:R,old:D,next:q}=U[F],O=D.tokens.map((te,X)=>{let G=h.mapResult(R.oa+X,1),Z=h.mapResult(R.oa+X+1,-1),oe=G.pos-R.na;return!G.deleted&&!Z.deleted&&Z.pos===G.pos+1&&oe>=0&&oe<q.tokens.length&&ze(te,q.tokens[oe])});Ft(j,D.start,D.tokens,q.tokens,O)}else{let R=i[F],D=A[R.oa],q=A[R.ob];Ft(j,D,W.slice(D,q),T.slice(z[R.na],z[R.nb]))}let l=E.length?ue(e):null,k=l?{...j,map:Tt(l.tokens,l.holes,e.flow.length)}:null;for(let{i:F,step:R}of E){let D=new ct(M.slice(F+1)),q=z[D.map(R.from,1)],O=z[D.map(R.to,-1)];if(O<=q)continue;let te=R.mark.type.name,X=R instanceof uo?R.mark.attrs&&Object.keys(R.mark.attrs).length?{...R.mark.attrs}:!0:null;if(ln(R.mark)){if(X===null)continue;let G=cn(R.mark.attrs.entries);K(()=>{for(let[Z,oe]of Object.entries(G))Lt(k,q,O,Z,oe,T)});continue}K(()=>Lt(k,q,O,te,X,T))}};f||t?.stopCapturing();let m=t?.captureTimeout;t&&(t.captureTimeout=1/0);try{I?ee():e.ydoc.transact(l=>{l.meta.set(_e,s),p(),ee()},me)}finally{t&&(t.captureTimeout=m),u||t?.stopCapturing()}r.groups++,r.lastGroup={chunked:I,structural:le,regional:g,span:P}}var ke=e=>({status:"refused",code:e}),ho=e=>{if(!e)return"";let o=[];for(let n of Object.keys(e).sort())o.push(`${n}=${JSON.stringify(e[n])}`);return o.join(`
4
4
  `)},rr=(e,o,n)=>{let r=n?n.state.doc:null,s=r&&r.childCount===o.visible.length&&o.visible.every((f,u)=>r.child(u).attrs.id===f.id)?r:Re(e,o),a=[];return s.forEach(f=>{f.attrs.id===null||f.attrs.id===void 0||a.push({id:f.attrs.id,parent:f.attrs.parent??null,t:f.type.name})}),a},sr=(e,o)=>{let n=[],r=e.get(o)?.parent??null,t=0;for(;r!=null&&t++<=e.size;)n.push(r),r=e.get(r)?.parent??null;return n},bo=(e,o,n)=>sr(e,n).includes(o),Bt=(e,o,n)=>o===n||bo(e,n,o),Dt=(e,o,n,r,t)=>{if(o?.recovered){let a=De(o.sourceKey,r);(e.gone.has(a)?e.gone.get(a):o.fields?.[r]??null)!==t&&e.gone.set(a,t);return}let s=e.attrs.get(n);s||(s=new Ae,e.attrs.set(n,s)),s.get(r)!==t&&s.set(r,t)},at=(e,o,n,r)=>Dt(e,o,n,"parent",r),ir=8,go={indent:(e,o)=>o.t==="list_item"&&Number.isInteger(e)&&e>=0&&e<=ir,open:(e,o)=>o.t==="toggle"&&typeof e=="boolean",parent:(e,o,n)=>e===null||typeof e=="string"&&n.get(e)?.t==="toggle"&&!Bt(n,e,o.id)},lr=(e,o)=>{if(e?.attrs===void 0)return[];if(!e.attrs||typeof e.attrs!="object"||Array.isArray(e.attrs))return null;let n=[];for(let[r,t]of Object.entries(e.attrs)){let s=o.get(r);if(!s||!t||typeof t!="object"||Array.isArray(t))return null;for(let[a,f]of Object.entries(t)){if(!go[a]||!go[a](f,s,o))return null;n.push({id:r,field:a,value:f})}}return n},cr=(e,o)=>{let n=bt(e.flow,0,e.flow.length),r=[],t=0;for(let s of e.flow.toDelta()){let a=s.attributes;if(typeof s.insert=="string")for(let f=0;f<s.insert.length;f++)r.push({ch:s.insert[f],attrs:a,source:o.resolve(n[t++])});else r.push({embed:s.insert,attrs:a,source:o.resolve(n[t++])})}if(t!==n.length)throw new Error(`The flow delta has ${t} units but the document has ${n.length}`);return r},ar=(e,o,n)=>{let r=new Map;for(let s of o.visible)n.has(s.id)&&s.brk&&r.set(Oe(s.brk),s.id);for(let s of n)for(let a of o.copies.get(s)??[])r.set(a,s);let t=[];for(let s=e.flow._start;s;s=s.right){if(s.deleted||!(s.content instanceof de))continue;let a=s.content.embed?.b;if(a===void 0||r.get(Oe(s.id))!==a)continue;let f=null;for(let u=s.right;u;u=u.right){if(u.deleted||!(u.content instanceof de))continue;let p=u.content.embed?.b;if(!(p===void 0||p===a)){f=Oe(u.id);break}}t.push({key:Oe(s.id),blockId:a,end:f})}return t};function zt({pd:e,view:o,um:n,origins:r,render:t,walked:s=null},a={}){let f=Array.isArray(a?.ids)?[...new Set(a.ids)]:[],u=a?.afterId===void 0?null:a.afterId,p=a?.parent!==void 0,b=s??ue(e,r),C=new Set(b.visible.filter(m=>m.opaque).map(m=>m.id)),M=rr(e,b,o),h=new Map(M.map(m=>[m.id,m])),w=M.map(m=>m.id);if(!f.length)return ke("missing-source");for(let m of f)if(!h.has(m))return ke("missing-source");let y=lr(a,h);if(!y)return ke("invalid-attrs");let N=y.filter(m=>m.field==="parent"),B=new Set(f.filter(m=>!f.some(l=>l!==m&&bo(h,l,m)))),v=M.filter(m=>f.some(l=>Bt(h,m.id,l))),L=new Set(v.map(m=>m.id));if(v.some(m=>C.has(m.id))||y.some(m=>C.has(m.id)))return ke("unsupported-format");let Y=new Map(b.visible.map(m=>[m.id,m]));for(let m of v){let l=Y.get(m.id);if(!l||l.implicit||!l.brk)return ke("missing-source")}let $;if(p)$=a.parent??null;else{let m=new Set(v.filter(l=>B.has(l.id)).map(l=>l.parent));if(m.size!==1)return ke("invalid-parent");$=[...m][0]}if(p&&$!==null){let m=h.get($);if(!m||m.t!=="toggle")return ke("invalid-parent");if(L.has($))return ke("cycle")}if(u!==null){if(typeof u!="string"||!h.has(u))return ke("missing-destination");if(L.has(u))return ke("cycle");if(h.get(u).parent!==$)return ke("missing-destination")}let x=M.filter(m=>!L.has(m.id)),c=0;if(u===null){if($!==null){let m=x.findIndex(k=>k.parent===$),l=x.findIndex(k=>k.id===$);c=m>=0?m:l<0?0:l+1}}else for(c=x.findIndex(m=>m.id===u)+1;c<x.length&&Bt(h,x[c].id,u);)c++;let E=[...x.slice(0,c),...v,...x.slice(c)],i=E.length===w.length&&E.every((m,l)=>m.id===w[l]),g=v.filter(m=>B.has(m.id)&&m.parent!==$),A=v.map(m=>m.id);if(i&&!g.length&&!y.length)return{status:"unchanged"};let z=(()=>{let m=o?.state.selection;if(!(m instanceof pe.TextSelection))return null;let l=R=>{let D=o.state.doc.resolve(R);return D.depth?{id:D.node(1).attrs.id,offset:D.parentOffset}:null},k=l(m.anchor),F=l(m.head);return k&&F&&(L.has(k.id)||L.has(F.id))?{anchor:k,head:F}:null})(),W=()=>{if(!z||!o)return;let m=({id:F,offset:R})=>{let D=null;return o.state.doc.forEach((q,O)=>{D===null&&q.attrs.id===F&&(D=O+1+Math.min(R,q.content.size))}),D},l=m(z.anchor),k=m(z.head);l!==null&&k!==null&&o.dispatch(o.state.tr.setSelection(pe.TextSelection.create(o.state.doc,l,k)).setMeta(Me,!0).setMeta("addToHistory",!1))};if(i)return n?.stopCapturing(),e.ydoc.transact(()=>{if(N.length)for(let m of N)at(e,Y.get(m.id),m.id,m.value);else for(let m of g)at(e,Y.get(m.id),m.id,$);for(let m of y)m.field!=="parent"&&Dt(e,Y.get(m.id),m.id,m.field,m.value)},me),n?.stopCapturing(),t(),W(),{status:"moved",ids:A};let T=[...Qe(Ze(e.ydoc)).entries()].sort((m,l)=>m[0]-l[0]),U=be(e),P=cr(e,r),I=kt(b,e.flow.length),K=[],j=0;for(let m of b.visible){if(L.has(m.id)){let l=[];for(let[k,F]of I.physicalRanges(j,j+m.len))for(let R=k;R<F;R++)l.push(P[R]);K.push({seg:m,units:l})}j+=m.len}for(let m=0;m<K.length;m++){let l=K[m];if(l.seg.id!==A[m])throw new Error(`Captured ${l.seg.id} where ${A[m]} was expected`);if(!l.units.length||l.units[0].embed===void 0||l.units[0].embed.b!==l.seg.id)throw new Error(`The selected block ${l.seg.id} has no physical marker to copy`)}let Q=ar(e,b,L),le=Pe(e.gone),ee=new Map;for(let m of v){let l=Y.get(m.id);if(!l.recovered)continue;let k=b.removals.filter(D=>D.sourceKey===l.sourceKey),F=Rn(l.sourceKey,k,le),R=le.restores.find(D=>D.key===F?.key)?.baseline??{type:l.t,attrs:l.fields??{}};ee.set(l.sourceKey,{covers:k.map(D=>D.key),baseline:JSON.parse(JSON.stringify(R))})}if(!Q.length)throw new Error("The selected blocks have no live physical markers to retire");return n?.stopCapturing(),e.ydoc.transact(()=>{for(let O of Q)e.gone.set(Be(O.key,U),{blockId:O.blockId,end:O.end,sv:T});let m=ue(e,r),l=kt(m,e.flow.length),k=m.visible.map(O=>O.id),F=0;if(c>0){let O=k.indexOf(x[c-1].id);F=O<0?0:O+1}let R=0;for(let O=0;O<F;O++)R+=m.visible[O].len;let D=l.toPhysical(R,"before"),q=[];for(let O of K){let te=D,X=null,G=null,Z=()=>{X!==null&&(We(e,D,m.fences,()=>e.flow.insert(D,X,G??void 0)),D+=X.length,X=null)};for(let ne of O.units)ne.ch!==void 0?(X!==null&&ho(ne.attrs)!==ho(G)&&Z(),X===null&&(X="",G=ne.attrs),X+=ne.ch):(Z(),We(e,D,m.fences,()=>e.flow.insertEmbed(D,ne.embed,ne.attrs)),D+=1);Z();let oe=bt(e.flow,te,D);if(oe.length!==O.units.length)throw new Error(`Copied ${O.seg.id} as ${oe.length} units instead of ${O.units.length}`);for(let ne=1;ne<O.units.length;ne++)q.push({dest:oe[ne],source:O.units[ne].source});r.recordBoundary(oe[0],O.seg.recovered?{blockId:O.seg.id,kind:"copy",recoveryOf:O.seg.sourceKey}:{blockId:O.seg.id,kind:"copy"}),O.seg.recovered&&e.gone.set(ot(O.seg.sourceKey,U),ee.get(O.seg.sourceKey)),e.gone.set(In(Oe(oe[0])),!0)}if(q.length&&r.recordSpans(q),N.length)for(let O of N)at(e,Y.get(O.id),O.id,O.value);else for(let O of g)at(e,Y.get(O.id),O.id,$);for(let O of y)O.field!=="parent"&&Dt(e,Y.get(O.id),O.id,O.field,O.value)},me),n?.stopCapturing(),t(),W(),{status:"moved",ids:A}}var Jt=e=>{let o=[];return e.forEach(n=>o.push([n.type.name,JSON.stringify(Object.fromEntries(xe(n.type).map(r=>[r,n.attrs[r]]))),n.isTextblock||n.type.name==="table"?JSON.stringify(n.content.toJSON()):null])),JSON.stringify(o)};function fr(e,o){if(e.childCount!==o.childCount)return!1;for(let n=0;n<e.childCount;n++){let r=e.child(n),t=o.child(n);if(r!==t&&(r.type!==t.type||xe(r.type).some(s=>!ye(r.attrs[s],t.attrs[s]))||(r.isTextblock||r.type.name==="table")&&!r.content.eq(t.content)))return!1}return!0}var ur=e=>{let o=[];return e.forEach((n,r)=>{n.type.name==="opaque_block"&&o.push([r,r+n.nodeSize])}),o},dr=(e,o)=>{let n=typeof e.from=="number"?e.from:typeof e.pos=="number"?e.pos:null;if(n===null)return!1;let r=typeof e.to=="number"?e.to:n+1;return o.some(([t,s])=>n<s&&r>t)},Ue=(e,o)=>{let n=e.resolve(o);return n.depth&&n.node(1).type.name==="table"?[n.before(1),n.after(1)]:null};function ko(e,o){let n=e.content.findDiffStart(o.content);if(n===null)return null;let{a:r,b:t}=e.content.findDiffEnd(o.content),s=n-Math.min(r,t);s>0&&(r+=s,t+=s);let a=(f,u)=>{let p=f.resolve(n);return p.parent.isTextblock&&p.sameParent(f.resolve(u))};return(Ue(e,n)||Ue(e,r))&&!(a(e,r)&&a(o,t))?(n=Ue(e,n)?.[0]??n,r=Ue(e,r)?.[1]??r,t=Ue(o,t)?.[1]??t,{start:n,endA:r,endB:t,tables:!0}):{start:n,endA:r,endB:t}}function Kt(e,o=null){let n=new Map;o?.forEach(u=>{u.attrs.id&&n.set(u.attrs.id,u)});let r=[];e.forEach(u=>r.push(u));let t=r.map(u=>({id:u.attrs.id,pos:n.get(u.attrs.id)?.attrs.pos??u.attrs.pos})),s=gt(t,"b"),a=!1,f=r.map((u,p)=>{let b=s[p]?.pos??t[p].pos,C=u.content;if(u.type.name==="table"){let w=[];u.forEach(v=>w.push(v));let y=w.map(v=>({id:v.attrs.id,pos:v.attrs.pos})),N=gt(y,"r"),B=w.map((v,L)=>{let Y=N[L]?.pos??y[L].pos;return Y===v.attrs.pos?v:v.type.create({...v.attrs,pos:Y},v.content,v.marks)});B.some((v,L)=>v!==w[L])&&(C=B)}if(b===u.attrs.pos&&C===u.content)return u;a=!0;let M={...u.attrs,pos:b},h=n.get(u.attrs.id);return h&&C===u.content&&h.hasMarkup(u.type,M,u.marks)&&h.content.eq(C)?h:u.type.create(M,C,u.marks)});return a?e.type.create(e.attrs,f):e}var yo=e=>{let o=new Set,n=null;for(let r=0;r<e.childCount;r++){let{id:t,pos:s}=e.child(r).attrs;if(!t||o.has(t)||!an(s)||n!==null&&n>=s)return!1;o.add(t),n=s}return!0},pr=(e,o)=>{for(let n in e.attrs)if(n!=="pos"&&e.attrs[n]!==o.attrs[n])return!1;return!0};function mr(e,o){if(e.childCount!==o.childCount||!yo(e))return!1;for(let n=0;n<e.childCount;n++){let r=e.child(n),t=o.child(n);if(r===t)continue;if(!(r.type===t.type&&r.marks===t.marks&&pr(r,t))&&!r.hasMarkup(t.type,{...t.attrs,pos:r.attrs.pos},t.marks)||!r.content.eq(t.content)||r.type.name==="table"&&!yo(r))return!1}return!0}var wo=e=>{if(e&&typeof e=="object"){for(let o of Object.keys(e))wo(e[o]);Object.freeze(e)}return e},vo=e=>wo(JSON.parse(JSON.stringify(e))),hr=(e,o)=>{let n=mn(o),r=0;for(let t=e.flow._start;t;t=t.right){if(t.id.client===n.client&&t.id.clock===n.clock)return t.deleted?r:r+t.length;!t.deleted&&t.countable&&(r+=t.length)}return r},gr=(e,o)=>{let n=null;for(let r=e.flow._start;r;r=r.right)r.id.client!==e.ydoc.clientID||!(r.content instanceof de)||r.content.embed?.b!==o||(!n||r.id.clock>n.clock)&&(n=r.id);return n};function xo({pd:e,onNotice:o=()=>{},ownedTokens:n=[],authorToken:r=null,stats:t={groups:0,mismatch:0,renders:0,first:null},captureTimeout:s=500}){let a=null,f=null,u=0,p=-1,b=null,C=0,M=new WeakMap,h=Le(e.origins);f=ue(e,h);let w=new tn([e.flow,e.attrs,e.gone,e.tableFields,e.boardFields],{trackedOrigins:new Set([me]),captureTimeout:s,captureTransaction:d=>d.meta.get(_e)!==!1,deleteFilter:d=>{if(d.parent!==e.flow||!(d.content instanceof de))return!0;let S=h.resolve(d.id);return S.client!==d.id.client||S.clock!==d.id.clock||h.boundaryOf(d.id)?.kind!=="copy"}}),y=yn(e,w,h,d=>Pe(d).textDeletes),N=new Set,B=new Set(r?[...n,r]:n),v=r?()=>{let d=Cn(e.ydoc.clientID);e.origins.get(d)!==r&&e.origins.set(d,r)}:null,L=new Set,Y=new Set,$=0,x=null,c=null,E=d=>{let S=new Set;for(let J of d.blocks)for(let V of J.runs){if(!V.displaced)continue;let H=Tn(V.source)?.client===e.ydoc.clientID;V.author&&(H||B.has(V.author))?S.add(V.author):H&&S.add(null)}if(!S.size)return null;let _=[...S].filter(Boolean).sort();return{kind:"recovered-change",source:d.source,revision:d.revision,blockId:d.blockId,author:_[0]??null,authors:_}},i=d=>{let S=d.list.filter(J=>J.recoverable).map(J=>vo(J)),_=vo(S.map(J=>E(J)).filter(J=>J&&!L.has(`${J.source}\0${J.revision}`)));return Object.freeze({recoverable:Object.freeze(S),notices:Object.freeze(_)})},g=(d,S)=>{if(JSON.stringify(i(st(e,{index:h,walked:S})))===JSON.stringify(d)){t.provedRecoveries=(t.provedRecoveries??0)+1;return}throw t.walkMismatch=(t.walkMismatch??0)+1,new Error("Recovery snapshot built from the displacing sources diverged from a full reduction")},A=()=>{if(x&&x.version===$)return x.snapshot;let d=p===u?f:void 0,S=i(Yn(e,{index:h,walked:d}));return t.proveWalks&&g(S,d),x={version:$,snapshot:S},S},z=d=>rt({recoverable:d.recoverable.map(S=>[S.source,S.revision]),notices:d.notices}),W=()=>{$++;let d=A();for(let _ of d.notices){let J=`${_.source}\0${_.revision}`;N.has(J)||(N.add(J),o(_))}if(!Y.size){c=null;return}let S=z(d);if(S!==c){c=S;for(let _ of[...Y])_(d)}},T=d=>{f=d,p=u,b=null,C=0},U=()=>p===u?f:null,P=d=>{let S=Ve(e,d),_=Ve(e,ue(e));if(S===_){t.provedWalks=(t.provedWalks??0)+1;return}throw t.walkMismatch=(t.walkMismatch??0)+1,new Error(`Incremental walk diverged from the full walk:
@@ -27,4 +27,4 @@ ${_}`)},Q=()=>{if(JSON.stringify(i(st(e,{index:h,walked:f})))!==JSON.stringify(A
27
27
  .page-recover-row button, .page-recover-head button { min-height: 44px; }
28
28
  }
29
29
  `,yr={heading:"Heading",list_item:"List item",toggle:"Toggle",quote:"Quote",code_block:"Code",callout:"Callout",table:"Table",image:"Image"},qt=280,ve=(e,o,n,r={})=>{let t=e.createElement(o);n&&(t.className=n);for(let[s,a]of Object.entries(r))t.setAttribute(s,a);return t};function vr(e,o){let n=ve(e,"div","page-recover-text"),r=0;for(let t of o.blocks){for(let s of t.runs){if(s.kind!=="text"||r>=qt)continue;let a=s.text.slice(0,qt-r);r+=a.length,n.append(s.displaced?Object.assign(e.createElement("mark"),{textContent:a}):e.createTextNode(a))}r<qt&&t!==o.blocks[o.blocks.length-1]&&n.append(e.createTextNode(" / "))}return n.textContent||(n.textContent="(no text)"),n}function wr(e){let o=new Set;for(let n of e.blocks)for(let r of n.runs)r.displaced&&o.add(r.author??null);return[...o]}function xr(e,o){let n=null;return e.state.doc.forEach((r,t)=>{n===null&&r.attrs.id===o&&(n=r.isTextblock?t+1:t)}),n===null?!1:(e.dispatch(e.state.tr.setSelection(pe.Selection.near(e.state.doc.resolve(n))).scrollIntoView()),e.focus(),!0)}function Sr({binding:e,mount:o,ownTokens:n=[],onRestored:r=()=>{},onStale:t=()=>{}}){let s=o.ownerDocument,a=new Set(n.filter(Boolean)),f=ve(s,"button","page-recover",{type:"button","aria-haspopup":"dialog","aria-expanded":"false"}),u=ve(s,"div","page-recover-panel",{role:"dialog","aria-label":"Recover changes"});f.hidden=!0,u.hidden=!0;let p=ve(s,"div","page-recover-root");p.append(f,u);let b=Ut({name:"page-recover",content:p,css:[kr],parent:o}),C={recoverable:[],notices:[]},M=null,h="",w=x=>x.some(c=>a.has(c))?x.length>1?"You and others":"You":x.some(c=>c!==null)?"Another editor":"An earlier edit",y=()=>{u.hidden=!0,M=null,f.setAttribute("aria-expanded","false")},N=x=>{let c;try{c=e.restore(x.source,x.revision)}catch(E){return console.error("[clay] Restore failed:",E),jn("This change could not be restored.","error"),{status:"failed"}}return c.status==="restored"||c.status==="resolved"?r(c.id):c.status==="stale"&&t(c),c},B=()=>{u.replaceChildren();let x=ve(s,"div","page-recover-head");x.append(s.createTextNode("Recover changes"));let c=ve(s,"button","",{type:"button"});c.textContent="Close",c.addEventListener("click",()=>{y(),f.focus()}),x.append(c);let E=ve(s,"p","page-recover-note");E.textContent="Text typed while its block was moved or removed. Restore puts it back as a new block.",u.append(x,E);for(let i of C.recoverable){let g=ve(s,"div","page-recover-row",{"data-source":i.source});i.source===M&&g.classList.add("is-target");let A=ve(s,"div","page-recover-meta");A.textContent=`${yr[i.type]??"Paragraph"} \xB7 ${w(wr(i))}`;let z=ve(s,"button","",{type:"button"});z.textContent="Restore",z.addEventListener("click",()=>N(i)),g.append(A,vr(s,i),z),u.append(g)}},v=(x=null)=>{if(!C.recoverable.length)return;M=x,u.hidden=!1,f.setAttribute("aria-expanded","true"),B();let c=[...u.querySelectorAll(".page-recover-row")];(c.find(i=>i.dataset.source===x)??c[0])?.querySelector("button")?.focus()},L=x=>{let c=x.map(E=>`${E.source}\0${E.revision}`).join(`
30
- `);if(c!==h){if(h=c,!x.length){St(Ht);return}_n(Ht,"warning",{actions:[{label:"Review",onClick:()=>v(x[0].source)},{label:"Dismiss",onClick:()=>{for(let E of x)e.dismiss(E.source,E.revision)}}]})}},Y=x=>{C=x;let c=x.recoverable.length;f.hidden=c===0,f.textContent=`Recover changes (${c})`,c?u.hidden||B():y(),L(x.notices)};f.addEventListener("click",()=>u.hidden?v():y()),u.addEventListener("keydown",x=>{x.key==="Escape"&&(x.stopPropagation(),y(),f.focus())});let $=e.subscribeRecovery(Y);return{open:v,close:y,restore:N,get count(){return C.recoverable.length},destroy(){$(),St(Ht),b.remove()}}}import("./page/editor-WRQGHDSG.js").catch(()=>null);export{Wn as ADOPTION_TIMEOUT_MS,Yo as acceptedPageState,Po as blocksFromYValue,je as canon,Mt as classifyFile,Io as createFeatureLoader,Sr as createRecoverList,br as createYPageBinding,xr as focusBlock,To as heldSlashRange,Ao as holdSlashRange,Do as installAdoption,jt as mergePageModels,Co as observeDocumentTitle,it as readBack,Ro as renderFromTags,$o as seedPageFromArticle,Eo as yValueOf};
30
+ `);if(c!==h){if(h=c,!x.length){St(Ht);return}_n(Ht,"warning",{actions:[{label:"Review",onClick:()=>v(x[0].source)},{label:"Dismiss",onClick:()=>{for(let E of x)e.dismiss(E.source,E.revision)}}]})}},Y=x=>{C=x;let c=x.recoverable.length;f.hidden=c===0,f.textContent=`Recover changes (${c})`,c?u.hidden||B():y(),L(x.notices)};f.addEventListener("click",()=>u.hidden?v():y()),u.addEventListener("keydown",x=>{x.key==="Escape"&&(x.stopPropagation(),y(),f.focus())});let $=e.subscribeRecovery(Y);return{open:v,close:y,restore:N,get count(){return C.recoverable.length},destroy(){$(),St(Ht),b.remove()}}}import("./page/editor-EY2WAAGB.js").catch(()=>null);export{Wn as ADOPTION_TIMEOUT_MS,Yo as acceptedPageState,Po as blocksFromYValue,je as canon,Mt as classifyFile,Io as createFeatureLoader,Sr as createRecoverList,br as createYPageBinding,xr as focusBlock,To as heldSlashRange,Ao as holdSlashRange,Do as installAdoption,jt as mergePageModels,Co as observeDocumentTitle,it as readBack,Ro as renderFromTags,$o as seedPageFromArticle,Eo as yValueOf};
@@ -1 +1 @@
1
- import{f as d}from"./c-TJAXGIRV.js";import"./c-BWFVSBDF.js";import{b as f,c as m}from"./c-RVMWGXEJ.js";import{b as o,c as r}from"./c-NUHP2XDB.js";import{e as c}from"./c-XGH4GS2T.js";import"./c-3O7OBDCM.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-N7JPUPGC.js";import"./c-HA6INT6J.js";import"./c-DCFSEJZG.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var x=30,b=6,e=null,u=null;function O(){return u??=Promise.all([import("./c-2ZZBC45O.js"),import("./c-ZE46QDIH.js")]).then(([n,t])=>e={pageScheme:n.pageScheme,paintLook:n.paintLook,RUNTIME_ONLY:n.RUNTIME_ONLY,TOKENS:t.TOKENS,SHADOW:t.SHADOW,FONT:`600 11px/1 ${t.FONT_MONO}`,LABEL_FONT:`500 11px/1.4 ${t.FONT_MONO}`}).catch(n=>{throw u=null,n}),u}var N=()=>O().then(()=>!0,()=>!1),a=["all:initial","color-scheme:inherit","direction:ltr","unicode-bidi:isolate"],T="#FFFCF6";function l(n){return n.setAttribute("clay",e.RUNTIME_ONLY),n}function E(n){return{people:n.people.map(i=>({id:i.id,name:i.name,you:i.you})),anonymous:n.anonymous}}var h=class{constructor(){this.roster={people:[],anonymous:0},this.root=null,this.stack=null,this.count=null,this.tip=null,this._gate=null}supported(){return this._gate||(this._gate=Promise.all([c("presence"),c("record-awareness-v1"),c("page-awareness-v1")]).then(([t,i,s])=>(d.setCapabilities({supported:t,recordAwareness:i,pageAwareness:s}),t===!0),()=>!1)),this._gate}async update(t){let i=E(d.receive(t)),s=this.root&&JSON.stringify(i)===JSON.stringify(this.roster);if(this.roster=i,!!await this.supported()){if(s){e.paintLook(this.root);return}await this.render()}}clear(){d.clear(),this.roster={people:[],anonymous:0},this.root&&(this.root.remove(),this.root=null,this.stack=null,this.count=null,this.tip=null)}async render(){let{people:t,anonymous:i}=this.roster;if(t.length+i<=1||window.clay?.menu){this.hide();return}if(await N()&&this.build()){this.hideTip(),this.stack.textContent="";for(let s of t)this.stack.appendChild(this.avatar(s));this.stack.firstElementChild&&o(this.stack.firstElementChild,"margin-left","0"),i>0?(this.count.textContent=`+${i} viewing`,o(this.count,"display","inline-block")):(this.count.textContent="",o(this.count,"display","none")),o(this.root,"display","flex"),e.paintLook(this.root)}}hide(){this.root&&(this.hideTip(),this.stack.textContent="",this.count.textContent="",o(this.root,"display","none"))}build(){return this.root?!0:typeof document>"u"||!document.body?!1:(this.root=l(r("div",[...a,`color-scheme:${e.pageScheme()}`,"position:fixed","top:calc(12px + env(safe-area-inset-top,0px))","right:calc(12px + env(safe-area-inset-right,0px))","z-index:2147483000","display:flex","align-items:center","gap:8px","max-width:calc(100vw - 24px)",`font:${e.LABEL_FONT}`,`color:${e.TOKENS.ink}`,"pointer-events:none"])),this.root.setAttribute("data-clay-presence",""),this.count=l(r("span",[...a,"box-sizing:border-box","flex:none","white-space:nowrap","padding:3px 8px","border-radius:0",`background:${e.TOKENS.surface}`,`color:${e.TOKENS.muted}`,`border:1px solid ${e.TOKENS["line-2"]}`,`font:${e.LABEL_FONT}`,"letter-spacing:.02em",`box-shadow:${e.SHADOW}`,"display:none","pointer-events:none"])),this.count.setAttribute("data-clay-presence-count",""),this.stack=l(r("div",[...a,"display:flex","align-items:center","flex:none","pointer-events:none"])),this.tip=l(r("span",[...a,"position:absolute","top:100%","right:0","margin-top:6px","box-sizing:border-box","white-space:nowrap","pointer-events:none","padding:5px 9px","border-radius:0",`background:${e.TOKENS.ink}`,`color:${e.TOKENS.ground}`,`font:${e.LABEL_FONT}`,"letter-spacing:.02em",`box-shadow:${e.SHADOW}`,"display:none"])),this.tip.setAttribute("data-clay-presence-tip",""),this.root.append(this.stack,this.count,this.tip),document.body.appendChild(this.root),!0)}avatar(t){let i=f(t.id),s=[`background-color:${T}`,`color:${i}`,`border-color:${i}`],p=l(r("div",[...a,"box-sizing:border-box","flex:none",`width:${x}px`,`height:${x}px`,"border-radius:0","display:flex","align-items:center","justify-content:center",`font:${e.FONT}`,"letter-spacing:.02em",`margin-left:-${b}px`,"border-width:2px","border-style:solid","background-image:none",`box-shadow:${e.SHADOW}`,"user-select:none","cursor:default","pointer-events:auto",...s],m(t.name)));p.setAttribute("data-clay-presence-avatar","");let g=t.you?`${t.name} (you)`:t.name;return p.addEventListener("mouseenter",()=>this.showTip(g)),p.addEventListener("mouseleave",()=>this.hideTip()),p}showTip(t){this.tip&&(this.tip.textContent=t,o(this.tip,"display","block"))}hideTip(){this.tip&&(this.tip.textContent="",o(this.tip,"display","none"))}},y=new h;typeof document<"u"&&document.addEventListener("clay:menu-ready",()=>y.render());var v=y;export{h as Presence,v as default,y as presence};
1
+ import{f as d}from"./c-RQRMPZXD.js";import"./c-WN3MXOLT.js";import{b as f,c as m}from"./c-RVMWGXEJ.js";import{b as o,c as r}from"./c-NUHP2XDB.js";import{e as c}from"./c-XGH4GS2T.js";import"./c-3O7OBDCM.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-N7JPUPGC.js";import"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var x=30,b=6,e=null,u=null;function O(){return u??=Promise.all([import("./c-2ZZBC45O.js"),import("./c-ZE46QDIH.js")]).then(([n,t])=>e={pageScheme:n.pageScheme,paintLook:n.paintLook,RUNTIME_ONLY:n.RUNTIME_ONLY,TOKENS:t.TOKENS,SHADOW:t.SHADOW,FONT:`600 11px/1 ${t.FONT_MONO}`,LABEL_FONT:`500 11px/1.4 ${t.FONT_MONO}`}).catch(n=>{throw u=null,n}),u}var N=()=>O().then(()=>!0,()=>!1),a=["all:initial","color-scheme:inherit","direction:ltr","unicode-bidi:isolate"],T="#FFFCF6";function l(n){return n.setAttribute("clay",e.RUNTIME_ONLY),n}function E(n){return{people:n.people.map(i=>({id:i.id,name:i.name,you:i.you})),anonymous:n.anonymous}}var h=class{constructor(){this.roster={people:[],anonymous:0},this.root=null,this.stack=null,this.count=null,this.tip=null,this._gate=null}supported(){return this._gate||(this._gate=Promise.all([c("presence"),c("record-awareness-v1"),c("page-awareness-v1")]).then(([t,i,s])=>(d.setCapabilities({supported:t,recordAwareness:i,pageAwareness:s}),t===!0),()=>!1)),this._gate}async update(t){let i=E(d.receive(t)),s=this.root&&JSON.stringify(i)===JSON.stringify(this.roster);if(this.roster=i,!!await this.supported()){if(s){e.paintLook(this.root);return}await this.render()}}clear(){d.clear(),this.roster={people:[],anonymous:0},this.root&&(this.root.remove(),this.root=null,this.stack=null,this.count=null,this.tip=null)}async render(){let{people:t,anonymous:i}=this.roster;if(t.length+i<=1||window.clay?.menu){this.hide();return}if(await N()&&this.build()){this.hideTip(),this.stack.textContent="";for(let s of t)this.stack.appendChild(this.avatar(s));this.stack.firstElementChild&&o(this.stack.firstElementChild,"margin-left","0"),i>0?(this.count.textContent=`+${i} viewing`,o(this.count,"display","inline-block")):(this.count.textContent="",o(this.count,"display","none")),o(this.root,"display","flex"),e.paintLook(this.root)}}hide(){this.root&&(this.hideTip(),this.stack.textContent="",this.count.textContent="",o(this.root,"display","none"))}build(){return this.root?!0:typeof document>"u"||!document.body?!1:(this.root=l(r("div",[...a,`color-scheme:${e.pageScheme()}`,"position:fixed","top:calc(12px + env(safe-area-inset-top,0px))","right:calc(12px + env(safe-area-inset-right,0px))","z-index:2147483000","display:flex","align-items:center","gap:8px","max-width:calc(100vw - 24px)",`font:${e.LABEL_FONT}`,`color:${e.TOKENS.ink}`,"pointer-events:none"])),this.root.setAttribute("data-clay-presence",""),this.count=l(r("span",[...a,"box-sizing:border-box","flex:none","white-space:nowrap","padding:3px 8px","border-radius:0",`background:${e.TOKENS.surface}`,`color:${e.TOKENS.muted}`,`border:1px solid ${e.TOKENS["line-2"]}`,`font:${e.LABEL_FONT}`,"letter-spacing:.02em",`box-shadow:${e.SHADOW}`,"display:none","pointer-events:none"])),this.count.setAttribute("data-clay-presence-count",""),this.stack=l(r("div",[...a,"display:flex","align-items:center","flex:none","pointer-events:none"])),this.tip=l(r("span",[...a,"position:absolute","top:100%","right:0","margin-top:6px","box-sizing:border-box","white-space:nowrap","pointer-events:none","padding:5px 9px","border-radius:0",`background:${e.TOKENS.ink}`,`color:${e.TOKENS.ground}`,`font:${e.LABEL_FONT}`,"letter-spacing:.02em",`box-shadow:${e.SHADOW}`,"display:none"])),this.tip.setAttribute("data-clay-presence-tip",""),this.root.append(this.stack,this.count,this.tip),document.body.appendChild(this.root),!0)}avatar(t){let i=f(t.id),s=[`background-color:${T}`,`color:${i}`,`border-color:${i}`],p=l(r("div",[...a,"box-sizing:border-box","flex:none",`width:${x}px`,`height:${x}px`,"border-radius:0","display:flex","align-items:center","justify-content:center",`font:${e.FONT}`,"letter-spacing:.02em",`margin-left:-${b}px`,"border-width:2px","border-style:solid","background-image:none",`box-shadow:${e.SHADOW}`,"user-select:none","cursor:default","pointer-events:auto",...s],m(t.name)));p.setAttribute("data-clay-presence-avatar","");let g=t.you?`${t.name} (you)`:t.name;return p.addEventListener("mouseenter",()=>this.showTip(g)),p.addEventListener("mouseleave",()=>this.hideTip()),p}showTip(t){this.tip&&(this.tip.textContent=t,o(this.tip,"display","block"))}hideTip(){this.tip&&(this.tip.textContent="",o(this.tip,"display","none"))}},y=new h;typeof document<"u"&&document.addEventListener("clay:menu-ready",()=>y.render());var v=y;export{h as Presence,v as default,y as presence};
@@ -1,4 +1,4 @@
1
- import{b as N}from"./c-HAWFNBYG.js";import{N as q,na as U,ra as D,sa as j}from"./c-QIXT3Q7C.js";import{b as O}from"./c-L7JL5TL3.js";import{a as M,b as I}from"./c-MCOOHCSG.js";import"./c-DCFSEJZG.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var E=class extends Error{constructor(t,o){super(o),this.name="PageExportError",this.code=t}},z=(e,t)=>{throw new E(e,t)},_=/^data:image\/(?:png|jpe?g|gif|webp);/i,G=/^(?:javascript|vbscript|data):/i,V=/^https?:\/\//i,Y=/^\/(?!\/)/,H=e=>String(e??"").trim().replace(/[\u0000-\u0020]/g,""),K=e=>_.test(e)||!G.test(e);function J(e){let t=H(e);if(!t||t.startsWith("#"))return null;if(_.test(t))return{url:t,inline:!0};if(/^\/\//.test(t))return{url:`https:${t}`,inline:!1};if(Y.test(t)||V.test(t))return{url:t,inline:!1}}var Q={img:"image",iframe:"embed",embed:"embed",object:"embed",video:"embed",audio:"embed",source:"embed",track:"embed"},Z={object:"data"},ee=/<(?:img|svg|video|audio|canvas|iframe|table)\b/i,te=/<(?:meta|style|img|br|hr|input)\b[^>]*>/gi,S=e=>e.closest?.("[data-id]")?.getAttribute("data-id")||null,re=(e,t)=>t?`${e} in block ${t}`:e;function oe(e){let t=[],o=new Set,i=(r,c,l)=>{let s=J(c);if(s===void 0&&z("unsafe-url",`The ${re(r,l)} points at ${String(c).trim().slice(0,120)}, which a reading copy cannot carry`),!s)return;let f=`${r}\0${s.url}`;o.has(f)||(o.add(f),t.push({kind:r,url:s.url,blockId:l??null,inline:s.inline}))};for(let r of e.querySelectorAll("*")){let c=r.tagName.toLowerCase(),l=Q[c];if(l&&i(l,r.getAttribute(Z[c]??"src"),S(r)),c==="img"||c==="source")for(let s of String(r.getAttribute("srcset")??"").split(","))i("image",s.trim().split(/\s+/)[0],S(r))}for(let r of e.querySelectorAll('[data-type="file"]'))i("attachment",r.getAttribute("data-src"),S(r)),i("attachment",r.querySelector("a[href]")?.getAttribute("href"),S(r));for(let r of e.querySelectorAll('figure[data-type="chart"]')){let c=S(r),l=`chart\0${c??""}`;o.has(l)||(o.add(l),t.push({kind:"chart",url:null,blockId:c??null,inline:!0}))}return t}function ne(e){for(let t of[...e.querySelectorAll("script, style, link, meta, base")])t.remove();for(let t of e.querySelectorAll("*"))for(let{name:o,value:i}of[...t.attributes]){let r=o.toLowerCase();if(r.startsWith("on")||r==="clay"||r==="merge"||r==="live"||r==="srcdoc"||r.startsWith("data-clay")||r.startsWith("clay-")){t.removeAttribute(o);continue}/^(href|src|action|formaction|poster|data-src|xlink:href)$/.test(r)&&!K(H(i))&&t.removeAttribute(o)}}function ae(e){for(let t of e.querySelectorAll('nav[data-type="toc"]'))for(let o of[...t.querySelectorAll("a")])o.replaceWith(o.ownerDocument.createTextNode(o.textContent))}var ie=e=>e.map(t=>t.t==="toggle"?{...t,open:!0}:t),se=(e,t)=>{let o=t.fallback(String(e??""));return ee.test(o)||o.replace(te,"").replace(/<[^>]+>/g,"").trim()!==""},le=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),ce=`:root { color-scheme: light dark; }
1
+ import{b as N}from"./c-HAWFNBYG.js";import{N as q,na as U,ra as D,sa as j}from"./c-QIXT3Q7C.js";import{b as O}from"./c-QY7F6EN6.js";import{a as M,b as I}from"./c-RHMPKZZ7.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var E=class extends Error{constructor(t,o){super(o),this.name="PageExportError",this.code=t}},z=(e,t)=>{throw new E(e,t)},_=/^data:image\/(?:png|jpe?g|gif|webp);/i,G=/^(?:javascript|vbscript|data):/i,V=/^https?:\/\//i,Y=/^\/(?!\/)/,H=e=>String(e??"").trim().replace(/[\u0000-\u0020]/g,""),K=e=>_.test(e)||!G.test(e);function J(e){let t=H(e);if(!t||t.startsWith("#"))return null;if(_.test(t))return{url:t,inline:!0};if(/^\/\//.test(t))return{url:`https:${t}`,inline:!1};if(Y.test(t)||V.test(t))return{url:t,inline:!1}}var Q={img:"image",iframe:"embed",embed:"embed",object:"embed",video:"embed",audio:"embed",source:"embed",track:"embed"},Z={object:"data"},ee=/<(?:img|svg|video|audio|canvas|iframe|table)\b/i,te=/<(?:meta|style|img|br|hr|input)\b[^>]*>/gi,S=e=>e.closest?.("[data-id]")?.getAttribute("data-id")||null,re=(e,t)=>t?`${e} in block ${t}`:e;function oe(e){let t=[],o=new Set,i=(r,c,l)=>{let s=J(c);if(s===void 0&&z("unsafe-url",`The ${re(r,l)} points at ${String(c).trim().slice(0,120)}, which a reading copy cannot carry`),!s)return;let f=`${r}\0${s.url}`;o.has(f)||(o.add(f),t.push({kind:r,url:s.url,blockId:l??null,inline:s.inline}))};for(let r of e.querySelectorAll("*")){let c=r.tagName.toLowerCase(),l=Q[c];if(l&&i(l,r.getAttribute(Z[c]??"src"),S(r)),c==="img"||c==="source")for(let s of String(r.getAttribute("srcset")??"").split(","))i("image",s.trim().split(/\s+/)[0],S(r))}for(let r of e.querySelectorAll('[data-type="file"]'))i("attachment",r.getAttribute("data-src"),S(r)),i("attachment",r.querySelector("a[href]")?.getAttribute("href"),S(r));for(let r of e.querySelectorAll('figure[data-type="chart"]')){let c=S(r),l=`chart\0${c??""}`;o.has(l)||(o.add(l),t.push({kind:"chart",url:null,blockId:c??null,inline:!0}))}return t}function ne(e){for(let t of[...e.querySelectorAll("script, style, link, meta, base")])t.remove();for(let t of e.querySelectorAll("*"))for(let{name:o,value:i}of[...t.attributes]){let r=o.toLowerCase();if(r.startsWith("on")||r==="clay"||r==="merge"||r==="live"||r==="srcdoc"||r.startsWith("data-clay")||r.startsWith("clay-")){t.removeAttribute(o);continue}/^(href|src|action|formaction|poster|data-src|xlink:href)$/.test(r)&&!K(H(i))&&t.removeAttribute(o)}}function ae(e){for(let t of e.querySelectorAll('nav[data-type="toc"]'))for(let o of[...t.querySelectorAll("a")])o.replaceWith(o.ownerDocument.createTextNode(o.textContent))}var ie=e=>e.map(t=>t.t==="toggle"?{...t,open:!0}:t),se=(e,t)=>{let o=t.fallback(String(e??""));return ee.test(o)||o.replace(te,"").replace(/<[^>]+>/g,"").trim()!==""},le=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),ce=`:root { color-scheme: light dark; }
2
2
  body { margin: 0; background: #ffffff; color: #37352f; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.6; }
3
3
  article[data-page] { max-width: 46rem; margin: 0 auto; padding: 3rem 1.25rem 6rem; }
4
4
  article[data-page] > * { margin: 0.7em 0; }
@@ -69,4 +69,4 @@ ${i.documentElement.outerHTML}`}var Se=[..."src srcset poster data data-src xlin
69
69
  .page-export-btn{border:0;padding:4px 8px;border-radius:6px;background:none;color:inherit;font:inherit;cursor:pointer}
70
70
  .page-export-btn:hover{background:var(--page-pop-hover)}
71
71
  .page-export-panel[data-state="loss"] .page-export-title{color:var(--page-danger, #9E3B2F)}
72
- `;function Be({view:e=null,download:t=I,fetch:o=null,now:i=()=>new Date}={}){if(!e)return{run:()=>({ok:!1,code:"not-editing"}),dispose(){}};let r=e.dom.ownerDocument,c=null,l=!1,s=(n,a,d,b)=>{a.addEventListener(d,b),n.listen.push([a,d,b])},f=(n,a)=>{let d=r.createElement("button");return d.type="button",d.className="page-export-btn",d.dataset.act=n,d.textContent=a,d};function u(){let n=c;if(n){c=null;for(let[a,d,b]of n.listen)a.removeEventListener(d,b);n.abort?.abort(),n.ui?.remove()}}function m(n){let a=n.panel??(n.panel=r.createElement("aside"));a.className="page-export-panel",a.dataset.state=n.ready?"ready":"loss",a.setAttribute("contenteditable","false"),a.setAttribute("role","dialog"),a.setAttribute("aria-modal","false"),a.setAttribute("aria-labelledby","page-export-title"),a.dataset.at=n.at.toISOString(),a.setAttribute("tabindex","-1"),a.textContent="";let d=r.createElement("p");d.className="page-export-title",d.id="page-export-title";let b=n.ready?"Reading copy":"This page cannot be a reading copy yet";d.textContent=n.title?`${b}: ${n.title}`:b;let $=r.createElement("p");$.className="page-export-when";let k=`${n.at.toLocaleString()} \xB7 ${n.embedded} ${n.embedded===1?"resource":"resources"} inside the file`;if($.textContent=k,a.append(d,$),n.losses.length){let T=r.createElement("ul");T.className="page-export-losses";for(let X of n.losses){let R=r.createElement("li");R.textContent=X.message,T.append(R)}a.append(T)}let h=r.createElement("div");h.className="page-export-acts",n.ready?h.append(f("download","Download"),f("close","Close")):h.append(f("retry","Try again"),f("close","Close")),a.append(h);let p=h.firstChild;n.ui||(n.ui=O({name:"page-export",content:a,css:[Me],parent:e.dom.parentElement??r.body})),(n.ready?p:a).focus?.()}function x(n){s(n,n.panel,"click",a=>{let d=a.target.closest?.("[data-act]");d&&(a.preventDefault(),d.dataset.act==="close"?u():d.dataset.act==="download"?g(n):d.dataset.act==="retry"&&w().catch(b=>console.error("clayjs: the reading copy could not be made",b)))}),s(n,r,"keydown",a=>{a.key!=="Escape"||c!==n||(a.preventDefault(),a.stopPropagation(),u())},!0)}function g(n){if(!n.ready||l)return{ok:!1,code:"not-editing"};let a=t({html:n.ready.html,name:n.ready.name});return u(),{ok:a===!0,downloaded:a===!0}}async function w(){if(l||e.isDestroyed)return{ok:!1,code:"not-editing"};u();let n={at:i(),title:"",panel:null,listen:[],abort:new AbortController,losses:[],embedded:0,ready:null},a=q(e.state.doc),d=U(a),b=r.baseURI,$;try{$=B(d,{fallbackOf:p=>typeof a[p]?.artifact?.fallbackHtml=="string"?a[p].artifact.fallbackHtml:"",doc:r})}catch(p){if(!(p instanceof E))throw p;return n.title=null,n.losses=[{code:p.code,message:p.message}],c=n,m(n),x(n),{ok:!1,code:p.code,message:p.message}}n.title=$.title||"Untitled",c=n;let k=o??globalThis.fetch,h=await W($.html,{resources:$.resources,base:b,fetch:k,signal:n.abort.signal});if(l||e.isDestroyed||c!==n)return{ok:!1,code:"not-editing"};n.embedded=h.embedded,n.losses=h.losses.slice();for(let p of h.remote??[])n.losses.push({code:"remote-reference",message:`The ${p.tag} in the reading copy still points at ${String(p.value).slice(0,120)}`});return n.losses.length||(n.ready={html:h.html,name:Re(n.title)}),m(n),x(n),n.ready?{ok:!0,title:n.title,name:n.ready.name,embedded:n.embedded}:{ok:!1,code:"resource-losses",losses:n.losses}}return{run:w,dispose(){l=!0,u()}}}export{Be as createFeature};
72
+ `;function Be({view:e=null,download:t=I,fetch:o=null,now:i=()=>new Date}={}){if(!e)return{run:()=>({ok:!1,code:"not-editing"}),dispose(){}};let r=e.dom.ownerDocument,c=null,l=!1,s=(n,a,d,b)=>{a.addEventListener(d,b),n.listen.push([a,d,b])},f=(n,a)=>{let d=r.createElement("button");return d.type="button",d.className="page-export-btn",d.dataset.act=n,d.textContent=a,d};function u(){let n=c;if(n){c=null;for(let[a,d,b]of n.listen)a.removeEventListener(d,b);n.abort?.abort(),n.ui?.remove()}}function m(n){let a=n.panel??(n.panel=r.createElement("aside"));a.className="page-export-panel",a.dataset.state=n.ready?"ready":"loss",a.setAttribute("contenteditable","false"),a.setAttribute("role","dialog"),a.setAttribute("aria-modal","false"),a.setAttribute("aria-labelledby","page-export-title"),a.dataset.at=n.at.toISOString(),a.setAttribute("tabindex","-1"),a.textContent="";let d=r.createElement("p");d.className="page-export-title",d.id="page-export-title";let b=n.ready?"Reading copy":"This page cannot be a reading copy yet";d.textContent=n.title?`${b}: ${n.title}`:b;let $=r.createElement("p");$.className="page-export-when";let k=`${n.at.toLocaleString()} \xB7 ${n.embedded} ${n.embedded===1?"resource":"resources"} inside the file`;if($.textContent=k,a.append(d,$),n.losses.length){let T=r.createElement("ul");T.className="page-export-losses";for(let X of n.losses){let R=r.createElement("li");R.textContent=X.message,T.append(R)}a.append(T)}let h=r.createElement("div");h.className="page-export-acts",n.ready?h.append(f("download","Download"),f("close","Close")):h.append(f("retry","Try again"),f("close","Close")),a.append(h);let p=h.firstChild;n.ui||(n.ui=O({name:"page-export",content:a,css:[Me],parent:e.dom.parentElement??r.body})),(n.ready?p:a).focus?.()}function x(n){s(n,n.panel,"click",async a=>{let d=a.target.closest?.("[data-act]");d&&(a.preventDefault(),d.dataset.act==="close"?u():d.dataset.act==="download"?await g(n):d.dataset.act==="retry"&&w().catch(b=>console.error("clayjs: the reading copy could not be made",b)))}),s(n,r,"keydown",a=>{a.key!=="Escape"||c!==n||(a.preventDefault(),a.stopPropagation(),u())},!0)}async function g(n){if(!n.ready||l)return{ok:!1,code:"not-editing"};let a=await t({html:n.ready.html,name:n.ready.name});return u(),{ok:a===!0,downloaded:a===!0}}async function w(){if(l||e.isDestroyed)return{ok:!1,code:"not-editing"};u();let n={at:i(),title:"",panel:null,listen:[],abort:new AbortController,losses:[],embedded:0,ready:null},a=q(e.state.doc),d=U(a),b=r.baseURI,$;try{$=B(d,{fallbackOf:p=>typeof a[p]?.artifact?.fallbackHtml=="string"?a[p].artifact.fallbackHtml:"",doc:r})}catch(p){if(!(p instanceof E))throw p;return n.title=null,n.losses=[{code:p.code,message:p.message}],c=n,m(n),x(n),{ok:!1,code:p.code,message:p.message}}n.title=$.title||"Untitled",c=n;let k=o??globalThis.fetch,h=await W($.html,{resources:$.resources,base:b,fetch:k,signal:n.abort.signal});if(l||e.isDestroyed||c!==n)return{ok:!1,code:"not-editing"};n.embedded=h.embedded,n.losses=h.losses.slice();for(let p of h.remote??[])n.losses.push({code:"remote-reference",message:`The ${p.tag} in the reading copy still points at ${String(p.value).slice(0,120)}`});return n.losses.length||(n.ready={html:h.html,name:Re(n.title)}),m(n),x(n),n.ready?{ok:!0,title:n.title,name:n.ready.name,embedded:n.embedded}:{ok:!1,code:"resource-losses",losses:n.losses}}return{run:w,dispose(){l=!0,u()}}}export{Be as createFeature};
@@ -1 +1 @@
1
- import{a as r}from"./c-VKEDWYDF.js";import{f as o}from"./c-3O7OBDCM.js";import{q as c}from"./c-7MG5RU63.js";var l="[editmode\\:resource]:is(style, link, script)",u='[editmode\\:resource]:is(style, link, script)[type^="inert/"]',i="inert/";function s(e){let t=e.getAttribute("type");return t&&t.startsWith(i)?!1:(e.setAttribute("type",i+(t||"")),!0)}function m(e){let t=e.getAttribute("type").slice(i.length);t?e.setAttribute("type",t):e.removeAttribute("type")}function d(){c(e=>{e.querySelectorAll(l).forEach(s)})}function f(){o&&r(()=>{a()})}function a(e=document){let t=(e.ownerDocument||e)===document;e.querySelectorAll(u).forEach(n=>{m(n),t&&n.replaceWith(n.cloneNode(!0))})}function R(){document.querySelectorAll(l).forEach(e=>{s(e)&&e.replaceWith(e.cloneNode(!0))})}function b(){d(),f()}export{l as a,a as b,R as c,b as d};
1
+ import{a as r}from"./c-VKEDWYDF.js";import{f as o}from"./c-3O7OBDCM.js";import{q as c}from"./c-EGTIAL6P.js";var l="[editmode\\:resource]:is(style, link, script)",u='[editmode\\:resource]:is(style, link, script)[type^="inert/"]',i="inert/";function s(e){let t=e.getAttribute("type");return t&&t.startsWith(i)?!1:(e.setAttribute("type",i+(t||"")),!0)}function m(e){let t=e.getAttribute("type").slice(i.length);t?e.setAttribute("type",t):e.removeAttribute("type")}function d(){c(e=>{e.querySelectorAll(l).forEach(s)})}function f(){o&&r(()=>{a()})}function a(e=document){let t=(e.ownerDocument||e)===document;e.querySelectorAll(u).forEach(n=>{m(n),t&&n.replaceWith(n.cloneNode(!0))})}function R(){document.querySelectorAll(l).forEach(e=>{s(e)&&e.replaceWith(e.cloneNode(!0))})}function b(){d(),f()}export{l as a,a as b,R as c,b as d};
@@ -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-IVMD3FEM.js";import{a as l,b as u,c,d as f}from"../c-TNEM3RNM.js";import{a as d,b as E,c as m,d as p}from"../c-PLP4JKFC.js";import"../c-Q26MME6N.js";import"../c-VKEDWYDF.js";import{a}from"../c-ZWIOJGMT.js";import"../c-IJUK2GPW.js";import{f as s}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-7MG5RU63.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-DCFSEJZG.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-N7Y52HJH.js";import{a as l,b as u,c,d as f}from"../c-ZSCBEB7I.js";import{a as d,b as E,c as m,d as p}from"../c-TUGVINJR.js";import"../c-TWCXBWS3.js";import"../c-VKEDWYDF.js";import{a}from"../c-LA2BW7UY.js";import"../c-IJUK2GPW.js";import{f as s}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.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{Q as e,g as i}from"../c-ZKNBMNN3.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import{a as p}from"../c-5VYOWDTI.js";import"../c-FWKHM4E7.js";import"../c-5JLFROUB.js";import{a as f,b as m}from"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import{a as d}from"../c-ZWIOJGMT.js";import"../c-B7J4K2AE.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import{c}from"../c-IJUK2GPW.js";import{f as a}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-7MG5RU63.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import{s as n,v as o}from"../c-DCFSEJZG.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{Q as e,g as i}from"../c-NLZ5AN4L.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import{a as p}from"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import{a as f,b as m}from"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import{a as d}from"../c-LA2BW7UY.js";import"../c-GVPNDIKJ.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import{c}from"../c-IJUK2GPW.js";import{f as a}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.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 s}from"../c-VKEDWYDF.js";import{q as u}from"../c-ZKNBMNN3.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-FWKHM4E7.js";import"../c-5JLFROUB.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-ZWIOJGMT.js";import"../c-B7J4K2AE.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import{f as d}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import{b as a}from"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-7MG5RU63.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-DCFSEJZG.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var c=()=>window.clay?.conflicts||null,o=!1,i=null,r=null;function e(n){o||(o=!0,m(),import("../c-VE7RKNKZ.js").then(t=>{i=t,t.start(n)},t=>{console.error("clayjs: the conflict notice could not be downloaded; it will try again on the next conflict",t),o=!1,l()}))}function l(){r||=new AbortController;let{signal:n}=r;document.addEventListener("clay:sync-conflicts-changed",p,{signal:n}),document.addEventListener("clay:save-conflict",g,{signal:n}),document.addEventListener("clay:document-upgraded",h,{signal:n}),document.addEventListener("clay:undo-kept",y,{signal:n})}function m(){r?.abort(),r=null}function p(n){c()?.size&&e(n)}function g(n){e(n)}function h(n){e(n)}function y(n){n?.detail?.ok===!0&&e(n)}var v="conflicts",E="undo",f=n=>a.local.get(n)?.count>0;function w(){f(E)&&e(null),f(v)&&import("../c-OIDRZKAF.js").then(n=>{!o&&n.pendingConflicts()>0&&e(null)},()=>{})}function b(){let n=(c()?.list?.()??[]).filter(t=>!t.claimedBy).map(t=>t.id);return n.length?n:u()?["save"]:[]}function x(){return{id:"clay:conflict-notice",order:960,prepare(n={}){return{enable(){n.initial!==!0&&!i&&!o&&l()},quiesce(){let t=b();if(t.length)throw Object.assign(new Error("clay.conflict-notice: a conflict here is still unresolved"),{code:"conflict",pending:t})},resume(){},dispose(){m(),o=!1,i?.stop?.(),i=null}}}}}s(()=>{d&&(c()?.size?e(null):(l(),w()))});export{x as conflictNoticeParticipant,x as modeParticipant};
1
+ import{a as s}from"../c-VKEDWYDF.js";import{q as u}from"../c-NLZ5AN4L.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-LA2BW7UY.js";import"../c-GVPNDIKJ.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import{f as d}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import{b as a}from"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var c=()=>window.clay?.conflicts||null,o=!1,i=null,r=null;function e(n){o||(o=!0,m(),import("../c-K76AUL4I.js").then(t=>{i=t,t.start(n)},t=>{console.error("clayjs: the conflict notice could not be downloaded; it will try again on the next conflict",t),o=!1,l()}))}function l(){r||=new AbortController;let{signal:n}=r;document.addEventListener("clay:sync-conflicts-changed",p,{signal:n}),document.addEventListener("clay:save-conflict",g,{signal:n}),document.addEventListener("clay:document-upgraded",h,{signal:n}),document.addEventListener("clay:undo-kept",y,{signal:n})}function m(){r?.abort(),r=null}function p(n){c()?.size&&e(n)}function g(n){e(n)}function h(n){e(n)}function y(n){n?.detail?.ok===!0&&e(n)}var v="conflicts",E="undo",f=n=>a.local.get(n)?.count>0;function w(){f(E)&&e(null),f(v)&&import("../c-OIDRZKAF.js").then(n=>{!o&&n.pendingConflicts()>0&&e(null)},()=>{})}function b(){let n=(c()?.list?.()??[]).filter(t=>!t.claimedBy).map(t=>t.id);return n.length?n:u()?["save"]:[]}function x(){return{id:"clay:conflict-notice",order:960,prepare(n={}){return{enable(){n.initial!==!0&&!i&&!o&&l()},quiesce(){let t=b();if(t.length)throw Object.assign(new Error("clay.conflict-notice: a conflict here is still unresolved"),{code:"conflict",pending:t})},resume(){},dispose(){m(),o=!1,i?.stop?.(),i=null}}}}}s(()=>{d&&(c()?.size?e(null):(l(),w()))});export{x as conflictNoticeParticipant,x as modeParticipant};
@@ -1,3 +1,3 @@
1
- import{a as h}from"../c-WYFDLITL.js";import{f as m}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{k as b}from"../c-7MG5RU63.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-DCFSEJZG.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-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{k as b}from"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.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,b,c,d,e,f}from"../c-5JLFROUB.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-HA6INT6J.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{b as beginRecoveryCapture,e as createRecovery,c as finishRecoveryCapture,a as noteRecoveryCapture,d as noteRecoverySettled,f as recovery};
1
+ import{a,b,c,d,e,f}from"../c-X5LNHET5.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-HA6INT6J.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{b as beginRecoveryCapture,e as createRecovery,c as finishRecoveryCapture,a as noteRecoveryCapture,d as noteRecoverySettled,f as recovery};
@@ -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,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-ZKNBMNN3.js";import{a as e}from"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-FWKHM4E7.js";import"../c-5JLFROUB.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-ZWIOJGMT.js";import{b as c,c as d}from"../c-B7J4K2AE.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{J as b,q as a}from"../c-7MG5RU63.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-DCFSEJZG.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{e as SLICED_SAVE_MIN_BYTES,l as acceptedReceipt,a as addDocumentTransform,m as adoptEntryBaseline,h as autosaveIsSuspended,S as autosaveScheduler,L as baselineSettled,x as closeSavePermit,t as conflictResolvedBySync,M as currentPaintSignature,W as default,H as flushSave,C as getLastSavedBytes,A as getLastSavedContents,B as getLastSavedDirty,b as getPageContents,y as getUnsavedChanges,o as holdAllSaves,V as init,U as initHyperclaySaveButton,T as initSaveKeyboardShortcut,d as inspectSaveSize,s as isSaveConflicted,n as modeParticipant,w as openSavePermit,p as releaseAllSaves,Q as releaseBootSettle,J as replacePageWith,g as resumeAutosave,u as saveGeneration,r as saveHoldReason,c as saveLimits,I as saveOverwritingConflict,F as savePage,G as savePageForce,K as savePageSoon,R as savePageThrottled,k as saveSession,i as savesAdmitted,q as savesHeld,N as schedulePaintHeal,j as sessionParked,D as setLastSavedBaselines,E as setLastSavedContents,v as setSaveGeneration,z as setUnsavedChanges,P as styleAdoptionPending,O as styleAdoptionsSettled,f 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,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-NLZ5AN4L.js";import{a as e}from"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-LA2BW7UY.js";import{b as c,c as d}from"../c-GVPNDIKJ.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{J as b,q as a}from"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.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,l as acceptedReceipt,a as addDocumentTransform,m as adoptEntryBaseline,h as autosaveIsSuspended,S as autosaveScheduler,L as baselineSettled,x as closeSavePermit,t as conflictResolvedBySync,M as currentPaintSignature,W as default,H as flushSave,C as getLastSavedBytes,A as getLastSavedContents,B as getLastSavedDirty,b as getPageContents,y as getUnsavedChanges,o as holdAllSaves,V as init,U as initHyperclaySaveButton,T as initSaveKeyboardShortcut,d as inspectSaveSize,s as isSaveConflicted,n as modeParticipant,w as openSavePermit,p as releaseAllSaves,Q as releaseBootSettle,J as replacePageWith,g as resumeAutosave,u as saveGeneration,r as saveHoldReason,c as saveLimits,I as saveOverwritingConflict,F as savePage,G as savePageForce,K as savePageSoon,R as savePageThrottled,k as saveSession,i as savesAdmitted,q as savesHeld,N as schedulePaintHeal,j as sessionParked,D as setLastSavedBaselines,E as setLastSavedContents,v as setSaveGeneration,z as setUnsavedChanges,P as styleAdoptionPending,O as styleAdoptionsSettled,f 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}from"../c-B7J4K2AE.js";import{a as d}from"../c-ATKAOH23.js";import{b as e,h as f}from"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{J as c,k as a,q as b}from"../c-7MG5RU63.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-DCFSEJZG.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{e as PAGE_FORMAT_META,b as addDocumentTransform,u as buildSaveRequest,r as claimDocumentOperation,A as exitSave,c as getPageContents,i as isSaveInProgress,l as keepaliveHeld,f as knownPageFormatFloor,p as mintSaveId,d as onSaveAccepted,m as onSaveAttempt,n as onSaveOutcome,a as onSnapshot,t as operationKind,s as releaseDocumentOperation,k as releaseSaveLane,y as replacePageWith,j as reserveSaveLane,q as resetSaveAttempts,w as saveCapturedHtml,x as saveConversion,o as saveFateIsUnknown,v as saveHtml,z as setExitSave,g as setSaveHeader,h 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}from"../c-GVPNDIKJ.js";import{a as d}from"../c-ATKAOH23.js";import{b as e,h as f}from"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{J as c,k as a,q as b}from"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.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,u as buildSaveRequest,r as claimDocumentOperation,A as exitSave,c as getPageContents,i as isSaveInProgress,l as keepaliveHeld,f as knownPageFormatFloor,p as mintSaveId,d as onSaveAccepted,m as onSaveAttempt,n as onSaveOutcome,a as onSnapshot,t as operationKind,s as releaseDocumentOperation,k as releaseSaveLane,y as replacePageWith,j as reserveSaveLane,q as resetSaveAttempts,w as saveCapturedHtml,x as saveConversion,o as saveFateIsUnknown,v as saveHtml,z as setExitSave,g as setSaveHeader,h as withKeepalive};
@@ -1 +1 @@
1
- import{A,B,C,D,E,F,G,H,I,J,K,L,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-7MG5RU63.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-DCFSEJZG.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{q as addDocumentTransform,d as attachCaptureArtifact,j as canonicalizeReceived,g as captureArtifact,I as captureBodyForSync,w as captureForComparison,y as captureForComparisonAndDirty,x as captureForDirtyCheck,E as captureForMerge,F as captureForSave,D as captureForSaveAndComparison,f as capturePageState,L as captureRecoveryPage,t as captureSaveClone,s as captureSnapshot,r as clonePreventingOnclone,B as completeSaveCapture,H as copyCaptureClone,c as currentCaptureContext,a as currentCaptureId,J as getPageContents,n as noscriptBlocks,k as onSnapshot,b as originalSnapshotNode,u as prepareForCompare,z as prepareSaveCapture,A as readCapturePageState,h as releaseCaptureArtifact,C as releaseSaveCapture,p as runSaveRenderer,m as serializeClone,v as serializeForCompare,G as serializeForSync,K as serializeRecoveryClone,e as setCapturePageState,i as setCloneCanonicalizer,l as setSaveRenderer,o as swapNoscriptMarkers};
1
+ import{A,B,C,D,E,F,G,H,I,J,K,L,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-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{q as addDocumentTransform,d as attachCaptureArtifact,j as canonicalizeReceived,g as captureArtifact,I as captureBodyForSync,w as captureForComparison,y as captureForComparisonAndDirty,x as captureForDirtyCheck,E as captureForMerge,F as captureForSave,D as captureForSaveAndComparison,f as capturePageState,L as captureRecoveryPage,t as captureSaveClone,s as captureSnapshot,r as clonePreventingOnclone,B as completeSaveCapture,H as copyCaptureClone,c as currentCaptureContext,a as currentCaptureId,J as getPageContents,n as noscriptBlocks,k as onSnapshot,b as originalSnapshotNode,u as prepareForCompare,z as prepareSaveCapture,A as readCapturePageState,h as releaseCaptureArtifact,C as releaseSaveCapture,p as runSaveRenderer,m as serializeClone,v as serializeForCompare,G as serializeForSync,K as serializeRecoveryClone,e as setCapturePageState,i as setCloneCanonicalizer,l as setSaveRenderer,o as swapNoscriptMarkers};
@@ -0,0 +1 @@
1
+ import{a,b,c}from"../c-NLZ5AN4L.js";import"../c-4ASQPRQL.js";import"../c-GQ6F6IDK.js";import"../c-I2SCCUEW.js";import"../c-5VYOWDTI.js";import"../c-GSRLXYWL.js";import"../c-X5LNHET5.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-LA2BW7UY.js";import"../c-GVPNDIKJ.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.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{a as r}from"../c-ZWIOJGMT.js";import"../c-IJUK2GPW.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-DCFSEJZG.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function l(){document.addEventListener("click",function(o){document.querySelectorAll("[onclickaway]").forEach(t=>{let e=o.target;do{if(e===t)return;e=e.parentNode}while(e);new Function(t.getAttribute("onclickaway")).call(t)})})}function u(){document.addEventListener("click",function(o){let n=o.target.closest("[onclickchildren]");if(n&&o.target!==n){let t=o.composedPath().find(e=>e.parentNode===n);new Function(n.getAttribute("onclickchildren")).call(t)}})}function d(){if(Node.prototype.__hyperclayOnclone)return;let o=Node.prototype.cloneNode;Node.prototype.__hyperclayOnclone=o,Node.prototype.cloneNode=function(t){let e=o.call(this,t);return e.nodeType===Node.ELEMENT_NODE&&(window.__preventOnclone||(n(e),e.querySelectorAll("[onclone]").forEach(n)),t&&(e.tagName==="TEXTAREA"?[e]:e.querySelectorAll("textarea[data-value]")).forEach(i=>{let a=i.getAttribute("data-value");a!==null&&(i.textContent=a,i.removeAttribute("data-value"))})),e};function n(t){let e=t.getAttribute("onclone");if(e)try{new Function(e).call(t)}catch(c){console.error("Error executing onclone:",c)}}}async function h(o){try{let n=o.getAttribute("onmutation");if(!n)return;await new Function(`return (async function() { ${n} })`)().call(o)}catch(n){console.error("Error in onmutation execution:",n)}}function s(){r.onAnyChange({require:"observed"},o=>{let n=new Set;for(let t of o){let e=t.type==="add"||t.type==="remove"?t.parent:t.element;for(;e&&e.nodeType===1;)e.hasAttribute("onmutation")&&n.add(e),e=e.parentElement}n.forEach(h)})}function f(){let o=async n=>{try{let t=n.getAttribute("onglobalmutation")||n.getAttribute("onpagemutation");await new Function(`return (async function() { ${t} })`)().call(n)}catch(t){console.error("Error in onglobalmutation/onpagemutation execution:",t)}};r.onAnyChange({debounce:200,omitChangeDetails:!0,require:"observed"},()=>{document.querySelectorAll("[onglobalmutation], [onpagemutation]").forEach(o)})}function g(o){document.readyState==="complete"?o():window.addEventListener("load",o)}var p=g;function m(){let o=async n=>{try{let t=n.getAttribute("onrender");await new Function(`return (async function() { ${t} })`)().call(n)}catch(t){console.error("Error in onrender execution:",t)}};p(()=>{document.querySelectorAll("[onrender]").forEach(o)}),r.onAddElement({selectorFilter:"[onrender]",debounce:200,require:"observed",pausable:!1},n=>{n.forEach(({element:t})=>o(t))})}function y(){l(),u(),d(),s(),f(),m()}y();var $=y;export{$ as default,y as init};
1
+ import{a as r}from"../c-LA2BW7UY.js";import"../c-IJUK2GPW.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function l(){document.addEventListener("click",function(o){document.querySelectorAll("[onclickaway]").forEach(t=>{let e=o.target;do{if(e===t)return;e=e.parentNode}while(e);new Function(t.getAttribute("onclickaway")).call(t)})})}function u(){document.addEventListener("click",function(o){let n=o.target.closest("[onclickchildren]");if(n&&o.target!==n){let t=o.composedPath().find(e=>e.parentNode===n);new Function(n.getAttribute("onclickchildren")).call(t)}})}function d(){if(Node.prototype.__hyperclayOnclone)return;let o=Node.prototype.cloneNode;Node.prototype.__hyperclayOnclone=o,Node.prototype.cloneNode=function(t){let e=o.call(this,t);return e.nodeType===Node.ELEMENT_NODE&&(window.__preventOnclone||(n(e),e.querySelectorAll("[onclone]").forEach(n)),t&&(e.tagName==="TEXTAREA"?[e]:e.querySelectorAll("textarea[data-value]")).forEach(i=>{let a=i.getAttribute("data-value");a!==null&&(i.textContent=a,i.removeAttribute("data-value"))})),e};function n(t){let e=t.getAttribute("onclone");if(e)try{new Function(e).call(t)}catch(c){console.error("Error executing onclone:",c)}}}async function h(o){try{let n=o.getAttribute("onmutation");if(!n)return;await new Function(`return (async function() { ${n} })`)().call(o)}catch(n){console.error("Error in onmutation execution:",n)}}function s(){r.onAnyChange({require:"observed"},o=>{let n=new Set;for(let t of o){let e=t.type==="add"||t.type==="remove"?t.parent:t.element;for(;e&&e.nodeType===1;)e.hasAttribute("onmutation")&&n.add(e),e=e.parentElement}n.forEach(h)})}function f(){let o=async n=>{try{let t=n.getAttribute("onglobalmutation")||n.getAttribute("onpagemutation");await new Function(`return (async function() { ${t} })`)().call(n)}catch(t){console.error("Error in onglobalmutation/onpagemutation execution:",t)}};r.onAnyChange({debounce:200,omitChangeDetails:!0,require:"observed"},()=>{document.querySelectorAll("[onglobalmutation], [onpagemutation]").forEach(o)})}function g(o){document.readyState==="complete"?o():window.addEventListener("load",o)}var p=g;function m(){let o=async n=>{try{let t=n.getAttribute("onrender");await new Function(`return (async function() { ${t} })`)().call(n)}catch(t){console.error("Error in onrender execution:",t)}};p(()=>{document.querySelectorAll("[onrender]").forEach(o)}),r.onAddElement({selectorFilter:"[onrender]",debounce:200,require:"observed",pausable:!1},n=>{n.forEach(({element:t})=>o(t))})}function y(){l(),u(),d(),s(),f(),m()}y();var $=y;export{$ as default,y as init};
@@ -1 +1 @@
1
- import{f as t,s as n,v as i}from"../c-B7J4K2AE.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{F as o,q as a,s as e}from"../c-7MG5RU63.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import{w as r}from"../c-DCFSEJZG.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{f as t,s as n,v as i}from"../c-GVPNDIKJ.js";import"../c-ATKAOH23.js";import"../c-EK63G3CG.js";import"../c-NQJRVJ56.js";import"../c-XGH4GS2T.js";import"../c-IJUK2GPW.js";import"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{F as o,q as a,s as e}from"../c-EGTIAL6P.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.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 +1 @@
1
- import{a as e}from"../c-ZWIOJGMT.js";import"../c-IJUK2GPW.js";import{a,b as n}from"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-DCFSEJZG.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function u(t){let r=a(t);if(!r)return;let o=new URL(t.getAttribute(r),location.href);o.searchParams.set("v",Date.now()),e.pause();try{n(t,r,o.href)}finally{e.resume()}}var s=u;export{s as default};
1
+ import{a as e}from"../c-LA2BW7UY.js";import"../c-IJUK2GPW.js";import{a,b as n}from"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function u(t){let r=a(t);if(!r)return;let o=new URL(t.getAttribute(r),location.href);o.searchParams.set("v",Date.now()),e.pause();try{n(t,r,o.href)}finally{e.resume()}}var s=u;export{s as default};
@@ -1 +1 @@
1
- import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u}from"../c-DCFSEJZG.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{f as FREEZE_SELECTOR,i as LIVE_SELECTOR,m as NO_DATA_SELECTOR,j as NO_DIRTY_SELECTOR,h as NO_TRIGGER_AUTOSAVE_SELECTOR,a as PERSIST,b as REGION_ATTRS,l as SNAPSHOT_REMOVE_SELECTOR,g as STRIP_FROM_COMPARISON,k as STRIP_FROM_DIRTY_CHECK,e as STRIP_FROM_SAVE,c as TOKENS,d as addRegionToken,o as isDataExcluded,q as isInert,n as isSnapshotRemoved,t as regionShape,p as resolveRegionPolicy,s as skipForPolicy,r as strictestPolicy,u as windowRegionShape};
1
+ import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u}from"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{f as FREEZE_SELECTOR,i as LIVE_SELECTOR,m as NO_DATA_SELECTOR,j as NO_DIRTY_SELECTOR,h as NO_TRIGGER_AUTOSAVE_SELECTOR,a as PERSIST,b as REGION_ATTRS,l as SNAPSHOT_REMOVE_SELECTOR,g as STRIP_FROM_COMPARISON,k as STRIP_FROM_DIRTY_CHECK,e as STRIP_FROM_SAVE,c as TOKENS,d as addRegionToken,o as isDataExcluded,q as isInert,n as isSnapshotRemoved,t as regionShape,p as resolveRegionPolicy,s as skipForPolicy,r as strictestPolicy,u as windowRegionShape};
@@ -1 +1 @@
1
- import{f as W}from"./c-46XYM55L.js";import{a as J}from"./c-GY422N3Q.js";import"./c-7SWMYKAI.js";import{b as V}from"./c-QTTJYJMA.js";import{a as $}from"./c-VKEDWYDF.js";import"./c-UGHH4MB3.js";import"./c-ZWIOJGMT.js";import"./c-IJUK2GPW.js";import{b as F}from"./c-CYWLPPUS.js";import{i as H}from"./c-VG5XIN4T.js";import{a as G}from"./c-2YYDMLNZ.js";import{c as B,l as z}from"./c-HA6INT6J.js";import"./c-DCFSEJZG.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var X={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"]},w={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},page:{path:"plugins/page.js",editOnly:!0,default:!1},"page-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},"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}},b={"core/is-edit-mode.js":()=>import("./core/is-edit-mode-GCX6767E.js"),"core/draft-mode.js":()=>import("./core/draft-mode-WSQAT67S.js"),"lib/region-policy.js":()=>import("./lib/region-policy-SB2AWVG5.js"),"lib/mutation.js":()=>import("./reader-core-PLZYLYLT.js").then(t=>t.core["lib/mutation.js"]),"core/edit-mode.js":()=>import("./reader-core-PLZYLYLT.js").then(t=>t.core["core/edit-mode.js"]),"core/mode-key.js":()=>import("./reader-core-PLZYLYLT.js").then(t=>t.core["core/mode-key.js"]),"core/stale-host-notice.js":()=>import("./reader-core-PLZYLYLT.js").then(t=>t.core["core/stale-host-notice.js"]),"core/page-data.js":()=>import("./reader-core-PLZYLYLT.js").then(t=>t.core["core/page-data.js"]),"core/preserve-authored.js":()=>import("./reader-core-PLZYLYLT.js").then(t=>t.core["core/preserve-authored.js"]),"core/snapshot.js":()=>import("./core/snapshot-NU3YM6GR.js"),"core/save-core.js":()=>import("./core/save-core-MKRPSEEO.js"),"core/save.js":()=>import("./core/save-A5JXV6ME.js"),"core/conflict-notice.js":()=>import("./core/conflict-notice-2WGT52LH.js"),"core/recovery.js":()=>import("./core/recovery-ZOUOJVIX.js"),"core/unsaved-warning.js":()=>import("./core/unsaved-warning-4ZPEV7BF.js"),"core/persist.js":()=>import("./core/persist-UKXV5KLA.js"),"core/admin-attrs.js":()=>import("./core/admin-attrs-YY7T5FGU.js"),"core/autosave.js":()=>import("./core/autosave-RVJPYLRT.js"),"attrs/save-freeze.js":()=>import("./attrs/save-freeze-LWGF6XUN.js"),"attrs/onaftersave.js":()=>import("./attrs/onaftersave-OKSWEJQF.js"),"attrs/refetch-on-save.js":()=>import("./attrs/refetch-on-save-ZUE7PSCI.js"),"attrs/add-from.js":()=>import("./attrs/add-from-T5LJXFFI.js"),"lib/cache-bust.js":()=>import("./lib/cache-bust-MUMFXZK6.js"),"plugins/richclay.js":()=>import("./plugins/richclay-KLGETK77.js"),"plugins/indicator.js":()=>import("./plugins/indicator-4VDXWYTD.js"),"sync/live-sync.js":()=>import("./sync/live-sync-UXNI6ZF6.js"),"plugins/live.js":()=>import("./plugins/live-7C36XEI2.js"),"plugins/page.js":()=>import("./plugins/page-BSW6MGDO.js"),"plugins/page-view.js":()=>import("./plugins/page-view-WFZVTPQK.js"),"plugins/sortable.js":()=>import("./plugins/sortable-4S6SQC3D.js"),"plugins/undo.js":()=>import("./plugins/undo-NLPGCJQY.js"),"plugins/unsent.js":()=>import("./plugins/unsent-OA4RGBUT.js"),"plugins/cms.js":()=>import("./plugins/cms-LRAOZHT7.js"),"plugins/quickcrop.js":()=>import("./plugins/quickcrop-BQ5YYFCH.js"),"plugins/upload.js":()=>import("./plugins/upload-NHGJXZK2.js"),"plugins/people.js":()=>import("./plugins/people-JCHVPF7P.js"),"plugins/menu.js":()=>import("./plugins/menu-MFC4DI5E.js"),"plugins/wire.js":()=>import("./plugins/wire-6OSIL3I7.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-X2L2KIEP.js"),"plugins/demo.js":()=>import("./plugins/demo-OYO5GCAO.js"),"plugins/visitor-drafts.js":()=>import("./plugins/visitor-drafts-BW43DGY3.js"),"plugins/visitor-drafts-owner.js":()=>import("./plugins/visitor-drafts-owner-7ODQG7JX.js"),"plugins/bind-text.js":()=>import("./plugins/bind-text-NX46N5UV.js"),"plugins/source.js":()=>import("./plugins/source-TJXOIOYY.js"),"plugins/derive.js":()=>import("./plugins/derive-FRE5JJQE.js"),"plugins/upgrade.js":()=>import("./plugins/upgrade-HSUNDNJD.js")},ie=["visitor-drafts","richclay","indicator","sortable","undo","unsent","quickcrop","upload","people","menu","upgrade","cms","page-view","sync","live","page","message","like","wire","ai-edit","demo","derive","bind-text","source"],re={cms:["quickcrop","upload"],"ai-edit":["wire"],page:["live","sync","upload"]},ae={page:["richclay"]},ce=new Set(["source","sortable","menu","upgrade"]);function K(t,e,o,s){let u=t.get(e);if(u)for(let n of u.split(",")){let r=n.trim();if(r){if(!w[r]||w[r].internal){console.warn(`clayjs: unknown plugin "${r}"`);continue}s(o,r)}}}var le=["sync","live","page","upload","quickcrop","cms","people","menu","upgrade","wire","ai-edit","demo","source"],ue=["attrs/refetch-on-save.js","core/conflict-notice.js"],de="https://hyperclay.com/templates/";function P(t,e,{isDraftMode:o=!1,hasSap:s=!1,hasVariants:u=!1,canEdit:n=!1,templateSource:r=null}={}){let g=[...X.always];e&&g.push(...X.editOnly);let m=new Set;K(t,"plugins",m,(i,l)=>i.add(l));let a=new Set;K(t,"exclude",a,(i,l)=>i.add(l));let d=new Set(m);for(let[i,l]of Object.entries(w))l.default&&d.add(i);s&&d.add("derive"),u&&(e||n)&&d.add("menu"),a.has("wire")&&d.delete("ai-edit"),!e&&!o&&d.has("page")&&d.add("page-view");for(let i of[...d])if(!a.has(i)&&!(w[i].editOnly&&!e))for(let l of re[i]||[])d.add(l);for(let i of a)d.delete(i);if(o){for(let i of le)d.delete(i);for(let i of ue){let l=g.indexOf(i);l>-1&&g.splice(l,1)}d.add("visitor-drafts")}!o&&n&&!a.has("upgrade")&&r&&r.startsWith(de)&&d.add("upgrade");for(let[i,l]of Object.entries(ae))if(d.has(i))for(let v of l)m.has(v)||d.delete(v);let c=[],h=[];for(let i of ie){if(!d.has(i))continue;let l=w[i];l.editOnly&&!e||(ce.has(i)?h:c).push(l.ownerPath&&!o?l.ownerPath:l.path)}return{core:g,plugins:c,late:h}}var C="data-deleted-at",R=(t,e)=>window.clay?.undo?.commit?window.clay.undo.commit(t,e):e(),Q=(t,e)=>t.dispatchEvent(new CustomEvent(e,{bubbles:!0})),I=Object.assign((t,{at:e=new Date().toISOString()}={})=>(R("Move to Trash",()=>t.setAttribute(C,e)),Q(t,"clay:trashed"),{undo:()=>I.restore(t)}),{is:t=>!!t.getAttribute(C),restore(t){R("Restore",()=>t.removeAttribute(C)),Q(t,"clay:restored")},purge(t){R("Delete forever",()=>t.remove())}});var Y=50,pe=1e3,fe='[clay~="no-snapshot"], [no-snapshot], [snapshot-remove]',k=0,ge=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 me(t){let e=window.clay?.region?.resolveRegionPolicy;if(!e)return null;let o=s=>!!s&&!s.closest(fe)&&e(s).dirtyTracked;for(let s of t){if(s.type==="attributes"&&z(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(n=>n.nodeType!==1||o(n))))return s.target}return null}function _(t){let e=window.clay,o=e.Mutation,s=new Set,u=(y,p)=>{s.has(y)||(s.add(y),console.warn("clay.effect: "+p))},n=!1,r=!1,g=0,m=0;k&&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 a=()=>{let y=Date.now();y-g>pe&&(g=y,m=0),++m>Y&&u("loop",`this effect ran more than ${Y} times in a second. Something keeps changing the document, often a timer or async callback the effect started.`)},d=()=>{if(n=!1,r)return;let y=null;o.pause(),k++;try{e.isEditMode===!0&&(a(),s.has("saved")||(y=new MutationObserver(()=>{}),y.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0})));let p=t();p&&typeof p.then=="function"&&(v(),console.error("clay.effect: fn returned a promise. It must be synchronous, so this effect was stopped."))}catch(p){console.error("clay.effect:",p)}finally{k--,o.resume();let p=y?y.takeRecords():[];if(y?.disconnect(),p.length){let O=me(p);O&&u("saved",`this effect changed ${ge(O)}, 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".`)}}},c=()=>{n||r||(n=!0,queueMicrotask(d))},h=["undo","redo"],i=()=>{for(let y of h)e.undo?.on?.(y,c)},l=o.onAnyChange({debounce:0,require:"observed"},c);document.addEventListener("clay:sync-applied",c),document.addEventListener("clay:modechange",i),i();let v=()=>{r=!0,l(),document.removeEventListener("clay:sync-applied",c),document.removeEventListener("clay:modechange",i);for(let y of h)e.undo?.off?.(y,c)};return c(),v}Object.defineProperty(_,"running",{get:()=>k>0});var he={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 ye(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 Z=ye(he);function L(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 je="plugins/page.js";function M(t,e,{isEditMode:o=!1,isDraftMode:s=!1,hasSapJs:u=!1}={},n=document){if(!t?.entries)return 0;let r=[...e];for(let c of e)for(let h of t.bootImports?.[c]??[])u&&h==="vendor/sap-core.vendor.js"||r.push(h);o&&!s&&r.push(...t.editBootImports??[]),o&&!s&&e.includes(je)&&r.push(...t.editorBootImports??[]);let g=new Set,m=c=>{if(!(!c||g.has(c))){g.add(c);for(let h of t.imports?.[c]??[])m(h)}};for(let c of r)m(t.entries[c]);let a=new Set([...n.querySelectorAll('link[rel="modulepreload"]')].map(c=>c.href)),d=0;for(let c of g){let h=new URL(c,t.base).href;if(a.has(h))continue;let i=n.createElement("link");i.rel="modulepreload",i.href=h,i.setAttribute("clay","no-save"),n.head.append(i),d++}return d}var E=Object.fromEntries(Object.entries(w).flatMap(([t,e])=>e.ownerPath?[[e.path,t],[e.ownerPath,t]]:[[e.path,t]])),j={},ee=new Set;function se(t){ee.has(t)||(ee.add(t),document.dispatchEvent(new CustomEvent("clay:plugin-ready",{detail:{plugin:E[t]}})))}var ve=(t,e,o,s)=>()=>t().then(u=>(M(L(e,u),[...o.core,...o.plugins,...o.late],{isEditMode:!0,hasSapJs:s}),u));function we(){return new Promise(t=>$(t))}function A(){let t=document.querySelector('meta[name="hyper-source"]');return t?t.getAttribute("content"):null}async function He(t,e,o,s=null,u=null,n=null){W(),(await b["core/draft-mode.js"]()).noteBootParams(e),await we();let g=await b["core/is-edit-mode.js"](),{isEditMode:m,isDraftMode:a,isOwner:d,siteVisibility:c,canEdit:h}=g;m&&!a&&import("./core/host-permission-6EVJGNPL.js").then(f=>f.checkHostPermission()).catch(()=>{}),window.__hyperclayEditMode=m;let i=await b["lib/region-policy.js"](),l=!!document.querySelector("[sap]"),v=document.querySelectorAll("head style[clay-variant]").length>=2,y=!!document.querySelector('script[src*="sap.js"]');G.holdSettle=l&&m;let p=P(e,m,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()});p.plugins.includes("plugins/demo.js")&&g.commitModeFacts({destination:"demo"}),M(L(s,u),[...p.core,...p.plugins],{isEditMode:m,isDraftMode:a,hasSapJs:y}),(m||a)&&!u&&n&&n().then(f=>M(L(s,f),[...p.core,...p.plugins],{isEditMode:m,isDraftMode:a,hasSapJs:y})).catch(()=>{});let O,oe=new Promise(f=>{O=f}),ne={sync:p.plugins.includes("sync/live-sync.js")};for(let f of p.core)j[f]=await b[f](),j[f].install?.();if(Se(j,{isDraftMode:a,isOwner:d,siteVisibility:c},i),te(j),document.documentElement.getAttribute("clay-mode-switch")==="live"){let f=P(e,!0,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()});j["core/edit-mode.js"].noteLiveSwitch({edit:f,view:P(e,!1,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()}),loaded:j,modules:b,attach:(S,D)=>{N(S,D);let T=E[S],x=window.clay.plugins;T&&Array.isArray(x)&&!x.includes(T)&&(window.clay.plugins=Object.freeze([...x,T]))},attachEditCore:te,announce:se,loadEditHints:n?ve(n,s,f,y):null,late:oe})}await j["core/edit-mode.js"].activateInitialMode(),window.clay.plugins=Object.freeze([...p.plugins,...p.late].map(f=>E[f]));let U=m?p:P(e,!0,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()});window.clay.editPlugins=Object.freeze([...U.plugins,...U.late].map(f=>E[f]));for(let f of p.plugins){let S;try{S=await b[f]()}catch(D){console.error(`clayjs: plugin "${f}" failed to load, continuing without it:`,D);continue}j[f]=S,f==="plugins/page-view.js"&&S.start(ne),N(f,S,j)}await Promise.allSettled(p.plugins.map(f=>j[f]?.ready).filter(Boolean)),l&&Oe(j),Ee(g),o(window.clay),document.dispatchEvent(new CustomEvent("clay:ready",{detail:{clay:window.clay}})),p.late.length?be(p.late,g).then(O,O):O()}var q=(t,e)=>w[E[t]]?.editOnly&&!e.startsAtImport();async function be(t,e){try{await window.clay.page?.ready}catch{}for(let o of t)if(!q(o,e))try{let s=await b[o]();if(q(o,e)||(j[o]=s,N(o,s,j),await s.ready,q(o,e)))continue;se(o)}catch(s){console.error(`clayjs: plugin "${o}" failed to load, continuing without it:`,s),document.dispatchEvent(new CustomEvent("clay:plugin-failed",{detail:{plugin:E[o]}}))}}function Oe(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 Se(t,{isDraftMode:e,isOwner:o,siteVisibility:s},u){let n=window.clay,r=t["lib/mutation.js"],g=t["core/edit-mode.js"];Object.assign(n,{toggleEditMode:g.toggleEditMode,setMode:g.setMode,modeLifecycle:g.modeLifecycle,isDraftMode:e,isOwner:o,siteVisibility:s,Mutation:r.default,region:u.windowRegionShape});for(let a of["mode","isEditMode","canEdit"])Object.defineProperty(n,a,{get:()=>g[a],enumerable:!0,configurable:!0});n.assets=Z;let m=t["core/page-data.js"];n.readData=m.readData,n.writeData=m.writeData,n.ephemeral=B,n.storage=F,n.host={get versions(){return import("./c-ZRXJD4G6.js").then(a=>a.hostVersions())}},n.trash=I,n.derived=H,n.effect=_,n.style=J,n.morph=(a,d,c)=>V().then(({morph:h})=>h(a,d,c))}function te(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 n=t["core/recovery.js"];n&&!e.recovery&&(e.recovery=n.recovery)}function N(t,e,o=j){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.page=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 Ee(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{He as boot,Oe as mountDerivedEngine};
1
+ import{f as W}from"./c-46XYM55L.js";import{a as J}from"./c-RS77ODLY.js";import"./c-7SWMYKAI.js";import{b as V}from"./c-FILLTJA7.js";import{a as $}from"./c-VKEDWYDF.js";import"./c-UGHH4MB3.js";import"./c-LA2BW7UY.js";import"./c-IJUK2GPW.js";import{b as F}from"./c-CYWLPPUS.js";import{i as H}from"./c-VG5XIN4T.js";import{a as G}from"./c-2YYDMLNZ.js";import{c as B,l as z}from"./c-HA6INT6J.js";import"./c-ICMAOOGK.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var X={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"]},w={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},page:{path:"plugins/page.js",editOnly:!0,default:!1},"page-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},"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}},b={"core/is-edit-mode.js":()=>import("./core/is-edit-mode-GCX6767E.js"),"core/draft-mode.js":()=>import("./core/draft-mode-WSQAT67S.js"),"lib/region-policy.js":()=>import("./lib/region-policy-KWBPROWF.js"),"lib/mutation.js":()=>import("./reader-core-2GXY7SHY.js").then(t=>t.core["lib/mutation.js"]),"core/edit-mode.js":()=>import("./reader-core-2GXY7SHY.js").then(t=>t.core["core/edit-mode.js"]),"core/mode-key.js":()=>import("./reader-core-2GXY7SHY.js").then(t=>t.core["core/mode-key.js"]),"core/stale-host-notice.js":()=>import("./reader-core-2GXY7SHY.js").then(t=>t.core["core/stale-host-notice.js"]),"core/page-data.js":()=>import("./reader-core-2GXY7SHY.js").then(t=>t.core["core/page-data.js"]),"core/preserve-authored.js":()=>import("./reader-core-2GXY7SHY.js").then(t=>t.core["core/preserve-authored.js"]),"core/snapshot.js":()=>import("./core/snapshot-O7II2AGG.js"),"core/save-core.js":()=>import("./core/save-core-IOCMXO5L.js"),"core/save.js":()=>import("./core/save-AOJBDSOK.js"),"core/conflict-notice.js":()=>import("./core/conflict-notice-JMAZLVRX.js"),"core/recovery.js":()=>import("./core/recovery-DRFZRJED.js"),"core/unsaved-warning.js":()=>import("./core/unsaved-warning-U5VUJFOE.js"),"core/persist.js":()=>import("./core/persist-3OPWJKZS.js"),"core/admin-attrs.js":()=>import("./core/admin-attrs-ZG7R5V3E.js"),"core/autosave.js":()=>import("./core/autosave-VPORYJSE.js"),"attrs/save-freeze.js":()=>import("./attrs/save-freeze-MTFVVYV5.js"),"attrs/onaftersave.js":()=>import("./attrs/onaftersave-OKSWEJQF.js"),"attrs/refetch-on-save.js":()=>import("./attrs/refetch-on-save-DPGJJMGN.js"),"attrs/add-from.js":()=>import("./attrs/add-from-T5LJXFFI.js"),"lib/cache-bust.js":()=>import("./lib/cache-bust-NH7VBWHO.js"),"plugins/richclay.js":()=>import("./plugins/richclay-KLGETK77.js"),"plugins/indicator.js":()=>import("./plugins/indicator-4VDXWYTD.js"),"sync/live-sync.js":()=>import("./sync/live-sync-SKPMFYOO.js"),"plugins/live.js":()=>import("./plugins/live-5EZN2EYP.js"),"plugins/page.js":()=>import("./plugins/page-LVW5DWA4.js"),"plugins/page-view.js":()=>import("./plugins/page-view-5KQ76IJB.js"),"plugins/sortable.js":()=>import("./plugins/sortable-WJZZBM7R.js"),"plugins/undo.js":()=>import("./plugins/undo-3JEYK5QY.js"),"plugins/unsent.js":()=>import("./plugins/unsent-OA4RGBUT.js"),"plugins/cms.js":()=>import("./plugins/cms-LRAOZHT7.js"),"plugins/quickcrop.js":()=>import("./plugins/quickcrop-BQ5YYFCH.js"),"plugins/upload.js":()=>import("./plugins/upload-TTCQRIM5.js"),"plugins/people.js":()=>import("./plugins/people-C7TVBBMR.js"),"plugins/menu.js":()=>import("./plugins/menu-DM2JHPSR.js"),"plugins/wire.js":()=>import("./plugins/wire-VRYPY6EJ.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-J5VLSW5I.js"),"plugins/demo.js":()=>import("./plugins/demo-42BSYQ7T.js"),"plugins/visitor-drafts.js":()=>import("./plugins/visitor-drafts-2AWNT23K.js"),"plugins/visitor-drafts-owner.js":()=>import("./plugins/visitor-drafts-owner-MZP45XSG.js"),"plugins/bind-text.js":()=>import("./plugins/bind-text-NX46N5UV.js"),"plugins/source.js":()=>import("./plugins/source-CCEUM3OR.js"),"plugins/derive.js":()=>import("./plugins/derive-QVI3LI3A.js"),"plugins/upgrade.js":()=>import("./plugins/upgrade-NW556WJD.js")},ie=["visitor-drafts","richclay","indicator","sortable","undo","unsent","quickcrop","upload","people","menu","upgrade","cms","page-view","sync","live","page","message","like","wire","ai-edit","demo","derive","bind-text","source"],re={cms:["quickcrop","upload"],"ai-edit":["wire"],page:["live","sync","upload"]},ae={page:["richclay"]},ce=new Set(["source","sortable","menu","upgrade"]);function K(t,e,o,s){let u=t.get(e);if(u)for(let n of u.split(",")){let r=n.trim();if(r){if(!w[r]||w[r].internal){console.warn(`clayjs: unknown plugin "${r}"`);continue}s(o,r)}}}var le=["sync","live","page","upload","quickcrop","cms","people","menu","upgrade","wire","ai-edit","demo","source"],ue=["attrs/refetch-on-save.js","core/conflict-notice.js"],de="https://hyperclay.com/templates/";function P(t,e,{isDraftMode:o=!1,hasSap:s=!1,hasVariants:u=!1,canEdit:n=!1,templateSource:r=null}={}){let g=[...X.always];e&&g.push(...X.editOnly);let m=new Set;K(t,"plugins",m,(i,l)=>i.add(l));let a=new Set;K(t,"exclude",a,(i,l)=>i.add(l));let d=new Set(m);for(let[i,l]of Object.entries(w))l.default&&d.add(i);s&&d.add("derive"),u&&(e||n)&&d.add("menu"),a.has("wire")&&d.delete("ai-edit"),!e&&!o&&d.has("page")&&d.add("page-view");for(let i of[...d])if(!a.has(i)&&!(w[i].editOnly&&!e))for(let l of re[i]||[])d.add(l);for(let i of a)d.delete(i);if(o){for(let i of le)d.delete(i);for(let i of ue){let l=g.indexOf(i);l>-1&&g.splice(l,1)}d.add("visitor-drafts")}!o&&n&&!a.has("upgrade")&&r&&r.startsWith(de)&&d.add("upgrade");for(let[i,l]of Object.entries(ae))if(d.has(i))for(let v of l)m.has(v)||d.delete(v);let c=[],h=[];for(let i of ie){if(!d.has(i))continue;let l=w[i];l.editOnly&&!e||(ce.has(i)?h:c).push(l.ownerPath&&!o?l.ownerPath:l.path)}return{core:g,plugins:c,late:h}}var C="data-deleted-at",R=(t,e)=>window.clay?.undo?.commit?window.clay.undo.commit(t,e):e(),Q=(t,e)=>t.dispatchEvent(new CustomEvent(e,{bubbles:!0})),I=Object.assign((t,{at:e=new Date().toISOString()}={})=>(R("Move to Trash",()=>t.setAttribute(C,e)),Q(t,"clay:trashed"),{undo:()=>I.restore(t)}),{is:t=>!!t.getAttribute(C),restore(t){R("Restore",()=>t.removeAttribute(C)),Q(t,"clay:restored")},purge(t){R("Delete forever",()=>t.remove())}});var Y=50,pe=1e3,fe='[clay~="no-snapshot"], [no-snapshot], [snapshot-remove]',k=0,ge=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 me(t){let e=window.clay?.region?.resolveRegionPolicy;if(!e)return null;let o=s=>!!s&&!s.closest(fe)&&e(s).dirtyTracked;for(let s of t){if(s.type==="attributes"&&z(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(n=>n.nodeType!==1||o(n))))return s.target}return null}function _(t){let e=window.clay,o=e.Mutation,s=new Set,u=(y,p)=>{s.has(y)||(s.add(y),console.warn("clay.effect: "+p))},n=!1,r=!1,g=0,m=0;k&&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 a=()=>{let y=Date.now();y-g>pe&&(g=y,m=0),++m>Y&&u("loop",`this effect ran more than ${Y} times in a second. Something keeps changing the document, often a timer or async callback the effect started.`)},d=()=>{if(n=!1,r)return;let y=null;o.pause(),k++;try{e.isEditMode===!0&&(a(),s.has("saved")||(y=new MutationObserver(()=>{}),y.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0})));let p=t();p&&typeof p.then=="function"&&(v(),console.error("clay.effect: fn returned a promise. It must be synchronous, so this effect was stopped."))}catch(p){console.error("clay.effect:",p)}finally{k--,o.resume();let p=y?y.takeRecords():[];if(y?.disconnect(),p.length){let O=me(p);O&&u("saved",`this effect changed ${ge(O)}, 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".`)}}},c=()=>{n||r||(n=!0,queueMicrotask(d))},h=["undo","redo"],i=()=>{for(let y of h)e.undo?.on?.(y,c)},l=o.onAnyChange({debounce:0,require:"observed"},c);document.addEventListener("clay:sync-applied",c),document.addEventListener("clay:modechange",i),i();let v=()=>{r=!0,l(),document.removeEventListener("clay:sync-applied",c),document.removeEventListener("clay:modechange",i);for(let y of h)e.undo?.off?.(y,c)};return c(),v}Object.defineProperty(_,"running",{get:()=>k>0});var he={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 ye(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 Z=ye(he);function L(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 je="plugins/page.js";function M(t,e,{isEditMode:o=!1,isDraftMode:s=!1,hasSapJs:u=!1}={},n=document){if(!t?.entries)return 0;let r=[...e];for(let c of e)for(let h of t.bootImports?.[c]??[])u&&h==="vendor/sap-core.vendor.js"||r.push(h);o&&!s&&r.push(...t.editBootImports??[]),o&&!s&&e.includes(je)&&r.push(...t.editorBootImports??[]);let g=new Set,m=c=>{if(!(!c||g.has(c))){g.add(c);for(let h of t.imports?.[c]??[])m(h)}};for(let c of r)m(t.entries[c]);let a=new Set([...n.querySelectorAll('link[rel="modulepreload"]')].map(c=>c.href)),d=0;for(let c of g){let h=new URL(c,t.base).href;if(a.has(h))continue;let i=n.createElement("link");i.rel="modulepreload",i.href=h,i.setAttribute("clay","no-save"),n.head.append(i),d++}return d}var E=Object.fromEntries(Object.entries(w).flatMap(([t,e])=>e.ownerPath?[[e.path,t],[e.ownerPath,t]]:[[e.path,t]])),j={},ee=new Set;function se(t){ee.has(t)||(ee.add(t),document.dispatchEvent(new CustomEvent("clay:plugin-ready",{detail:{plugin:E[t]}})))}var ve=(t,e,o,s)=>()=>t().then(u=>(M(L(e,u),[...o.core,...o.plugins,...o.late],{isEditMode:!0,hasSapJs:s}),u));function we(){return new Promise(t=>$(t))}function A(){let t=document.querySelector('meta[name="hyper-source"]');return t?t.getAttribute("content"):null}async function He(t,e,o,s=null,u=null,n=null){W(),(await b["core/draft-mode.js"]()).noteBootParams(e),await we();let g=await b["core/is-edit-mode.js"](),{isEditMode:m,isDraftMode:a,isOwner:d,siteVisibility:c,canEdit:h}=g;m&&!a&&import("./core/host-permission-6EVJGNPL.js").then(f=>f.checkHostPermission()).catch(()=>{}),window.__hyperclayEditMode=m;let i=await b["lib/region-policy.js"](),l=!!document.querySelector("[sap]"),v=document.querySelectorAll("head style[clay-variant]").length>=2,y=!!document.querySelector('script[src*="sap.js"]');G.holdSettle=l&&m;let p=P(e,m,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()});p.plugins.includes("plugins/demo.js")&&g.commitModeFacts({destination:"demo"}),M(L(s,u),[...p.core,...p.plugins],{isEditMode:m,isDraftMode:a,hasSapJs:y}),(m||a)&&!u&&n&&n().then(f=>M(L(s,f),[...p.core,...p.plugins],{isEditMode:m,isDraftMode:a,hasSapJs:y})).catch(()=>{});let O,oe=new Promise(f=>{O=f}),ne={sync:p.plugins.includes("sync/live-sync.js")};for(let f of p.core)j[f]=await b[f](),j[f].install?.();if(Se(j,{isDraftMode:a,isOwner:d,siteVisibility:c},i),te(j),document.documentElement.getAttribute("clay-mode-switch")==="live"){let f=P(e,!0,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()});j["core/edit-mode.js"].noteLiveSwitch({edit:f,view:P(e,!1,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()}),loaded:j,modules:b,attach:(S,D)=>{N(S,D);let T=E[S],x=window.clay.plugins;T&&Array.isArray(x)&&!x.includes(T)&&(window.clay.plugins=Object.freeze([...x,T]))},attachEditCore:te,announce:se,loadEditHints:n?ve(n,s,f,y):null,late:oe})}await j["core/edit-mode.js"].activateInitialMode(),window.clay.plugins=Object.freeze([...p.plugins,...p.late].map(f=>E[f]));let U=m?p:P(e,!0,{isDraftMode:a,hasSap:l,hasVariants:v,canEdit:h,templateSource:A()});window.clay.editPlugins=Object.freeze([...U.plugins,...U.late].map(f=>E[f]));for(let f of p.plugins){let S;try{S=await b[f]()}catch(D){console.error(`clayjs: plugin "${f}" failed to load, continuing without it:`,D);continue}j[f]=S,f==="plugins/page-view.js"&&S.start(ne),N(f,S,j)}await Promise.allSettled(p.plugins.map(f=>j[f]?.ready).filter(Boolean)),l&&Oe(j),Ee(g),o(window.clay),document.dispatchEvent(new CustomEvent("clay:ready",{detail:{clay:window.clay}})),p.late.length?be(p.late,g).then(O,O):O()}var q=(t,e)=>w[E[t]]?.editOnly&&!e.startsAtImport();async function be(t,e){try{await window.clay.page?.ready}catch{}for(let o of t)if(!q(o,e))try{let s=await b[o]();if(q(o,e)||(j[o]=s,N(o,s,j),await s.ready,q(o,e)))continue;se(o)}catch(s){console.error(`clayjs: plugin "${o}" failed to load, continuing without it:`,s),document.dispatchEvent(new CustomEvent("clay:plugin-failed",{detail:{plugin:E[o]}}))}}function Oe(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 Se(t,{isDraftMode:e,isOwner:o,siteVisibility:s},u){let n=window.clay,r=t["lib/mutation.js"],g=t["core/edit-mode.js"];Object.assign(n,{toggleEditMode:g.toggleEditMode,setMode:g.setMode,modeLifecycle:g.modeLifecycle,isDraftMode:e,isOwner:o,siteVisibility:s,Mutation:r.default,region:u.windowRegionShape});for(let a of["mode","isEditMode","canEdit"])Object.defineProperty(n,a,{get:()=>g[a],enumerable:!0,configurable:!0});n.assets=Z;let m=t["core/page-data.js"];n.readData=m.readData,n.writeData=m.writeData,n.ephemeral=B,n.storage=F,n.host={get versions(){return import("./c-ZRXJD4G6.js").then(a=>a.hostVersions())}},n.trash=I,n.derived=H,n.effect=_,n.style=J,n.morph=(a,d,c)=>V().then(({morph:h})=>h(a,d,c))}function te(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 n=t["core/recovery.js"];n&&!e.recovery&&(e.recovery=n.recovery)}function N(t,e,o=j){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.page=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 Ee(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{He as boot,Oe as mountDerivedEngine};
@@ -0,0 +1 @@
1
+ export default {"version":"1.21.0","entries":{"options/options.js":"options/options-55LQHSJ4.js","route/route.js":"route/route-62CHXL5B.js","ui/index.js":"ui/index-QNIPDHXQ.js","utils/index.js":"utils/index-4TJCVLT7.js","vendor/sap-core.vendor.js":"vendor/sap-core.vendor-OA5SKL7Q.js","plugins/derive.js":"plugins/derive-QVI3LI3A.js","plugins/upgrade.js":"plugins/upgrade-NW556WJD.js","dom/all.js":"dom/all-APS5ZSKP.js","dom/dom-helpers.js":"dom/dom-helpers-L7OSR6S4.js","events/index.js":"events/index-B6TGDYMG.js","internals/index.js":"internals/index-HDRANDWE.js","plugins/menu.js":"plugins/menu-DM2JHPSR.js","plugins/wire.js":"plugins/wire-VRYPY6EJ.js","plugins/message.js":"plugins/message-LQ6EDH4V.js","plugins/like.js":"plugins/like-EV7MTZ56.js","plugins/demo.js":"plugins/demo-42BSYQ7T.js","plugins/visitor-drafts.js":"plugins/visitor-drafts-2AWNT23K.js","plugins/visitor-drafts-owner.js":"plugins/visitor-drafts-owner-MZP45XSG.js","plugins/page-view.js":"plugins/page-view-5KQ76IJB.js","plugins/cms.js":"plugins/cms-LRAOZHT7.js","plugins/quickcrop.js":"plugins/quickcrop-BQ5YYFCH.js","plugins/people.js":"plugins/people-C7TVBBMR.js","sync/live-sync.js":"sync/live-sync-SKPMFYOO.js","plugins/live.js":"plugins/live-5EZN2EYP.js","loader.js":"loader-ZVPK4ZN3.js","reader-core.js":"reader-core-2GXY7SHY.js","lib/mutation.js":"reader-core-2GXY7SHY.js","core/preserve-authored.js":"reader-core-2GXY7SHY.js","core/edit-mode.js":"reader-core-2GXY7SHY.js","core/mode-key.js":"reader-core-2GXY7SHY.js","core/stale-host-notice.js":"reader-core-2GXY7SHY.js","core/page-data.js":"reader-core-2GXY7SHY.js"},"imports":{"options/options-55LQHSJ4.js":["c-7SWMYKAI.js","c-LA2BW7UY.js","c-IJUK2GPW.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-LA2BW7UY.js":["c-IJUK2GPW.js","c-VG5XIN4T.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-VG5XIN4T.js":["c-2YYDMLNZ.js"],"c-HA6INT6J.js":["c-WRBKEJD4.js"],"c-ICMAOOGK.js":["c-WRBKEJD4.js"],"route/route-62CHXL5B.js":["c-VHNSBD2M.js"],"ui/index-QNIPDHXQ.js":["c-W23KVGUO.js","c-BRLCTNMC.js","c-QHWJ5ZIJ.js","c-RG6XUZFA.js","c-UL2YUY52.js","c-QY7F6EN6.js","c-CJFDLD43.js","c-BJ7YQ5QZ.js","c-4JZDZFF6.js","c-VAK7SG37.js","c-MHI3GYKF.js","c-2AZDZWCK.js","c-46XYM55L.js","c-NUHP2XDB.js","c-VKEDWYDF.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-W23KVGUO.js":["c-BRLCTNMC.js","c-QHWJ5ZIJ.js","c-RG6XUZFA.js","c-UL2YUY52.js","c-BJ7YQ5QZ.js","c-VAK7SG37.js","c-VKEDWYDF.js"],"c-BRLCTNMC.js":["c-QHWJ5ZIJ.js","c-CJFDLD43.js","c-BJ7YQ5QZ.js","c-NUHP2XDB.js"],"c-QHWJ5ZIJ.js":["c-4JZDZFF6.js","c-46XYM55L.js"],"c-CJFDLD43.js":["c-BJ7YQ5QZ.js","c-VAK7SG37.js","c-MHI3GYKF.js","c-NUHP2XDB.js"],"c-BJ7YQ5QZ.js":["c-VAK7SG37.js","c-NUHP2XDB.js"],"c-RG6XUZFA.js":["c-QY7F6EN6.js","c-BJ7YQ5QZ.js","c-VAK7SG37.js","c-MHI3GYKF.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-OA5SKL7Q.js":["c-VHNSBD2M.js"],"plugins/derive-QVI3LI3A.js":["c-VHNSBD2M.js"],"plugins/upgrade-NW556WJD.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"],"c-XQXZAO7N.js":["c-WRBKEJD4.js"],"events/index-B6TGDYMG.js":["c-LA2BW7UY.js","c-IJUK2GPW.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"internals/index-HDRANDWE.js":["c-GVPNDIKJ.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-GVPNDIKJ.js":["c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-N7JPUPGC.js","c-EGTIAL6P.js"],"c-NQJRVJ56.js":["c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js"],"c-XGH4GS2T.js":["c-3O7OBDCM.js","c-BPF2NSPV.js"],"c-3O7OBDCM.js":["c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js"],"c-BPF2NSPV.js":["c-HA6INT6J.js"],"c-EGTIAL6P.js":["c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"plugins/menu-DM2JHPSR.js":["c-HDWZEJHM.js","c-AQLFEATB.js","c-QY7F6EN6.js","c-RVMWGXEJ.js","c-MHI3GYKF.js","c-RHMPKZZ7.js","c-VKEDWYDF.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/wire-VRYPY6EJ.js":["c-I2IFKJX2.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-I2IFKJX2.js":["c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js"],"plugins/message-LQ6EDH4V.js":["c-VHNSBD2M.js"],"plugins/like-EV7MTZ56.js":["c-VHNSBD2M.js"],"plugins/demo-42BSYQ7T.js":["c-JAX2667S.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/visitor-drafts-2AWNT23K.js":["c-Y6F2FORL.js","c-QY7F6EN6.js","c-MTQHWQC3.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/visitor-drafts-owner-MZP45XSG.js":["c-MTQHWQC3.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"plugins/page-view-5KQ76IJB.js":["c-DHXPDLW6.js","c-L4WQSC27.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-DHXPDLW6.js":["c-XGH4GS2T.js","c-3O7OBDCM.js"],"plugins/cms-LRAOZHT7.js":["c-JAX2667S.js","c-OJYM642Q.js","c-BJ7YQ5QZ.js","c-4JZDZFF6.js","c-VAK7SG37.js","c-MHI3GYKF.js","c-NUHP2XDB.js","c-VHNSBD2M.js"],"c-OJYM642Q.js":["c-BJ7YQ5QZ.js","c-4JZDZFF6.js"],"plugins/quickcrop-BQ5YYFCH.js":["c-CJFDLD43.js","c-OJYM642Q.js","c-BJ7YQ5QZ.js","c-4JZDZFF6.js","c-VAK7SG37.js","c-MHI3GYKF.js","c-NUHP2XDB.js","c-VHNSBD2M.js"],"plugins/people-C7TVBBMR.js":["c-RVMWGXEJ.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-HA6INT6J.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"sync/live-sync-SKPMFYOO.js":["c-AL4RBJF2.js","c-DHXPDLW6.js","c-LZJPNR2W.js","c-FILLTJA7.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-WYFDLITL.js","c-LA2BW7UY.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-AL4RBJF2.js":["c-DHXPDLW6.js","c-LZJPNR2W.js","c-FILLTJA7.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-LA2BW7UY.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-EGTIAL6P.js","c-VG5XIN4T.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"c-GSRLXYWL.js":["c-WYFDLITL.js","c-LA2BW7UY.js","c-3O7OBDCM.js","c-ICMAOOGK.js"],"plugins/live-5EZN2EYP.js":["c-UXEVJ63W.js","c-JKZJIUIP.js","c-TCCA5BZN.js","c-3LDGIBMN.js","c-57XDY6HC.js","c-LZJPNR2W.js","c-NLZ5AN4L.js","c-4ASQPRQL.js","c-GQ6F6IDK.js","c-I2SCCUEW.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-X5LNHET5.js","c-WYFDLITL.js","c-UGHH4MB3.js","c-LA2BW7UY.js","c-GVPNDIKJ.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-XQXZAO7N.js","c-S7LK4KUE.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-UXEVJ63W.js":["c-JKZJIUIP.js","c-TCCA5BZN.js","c-3LDGIBMN.js","c-57XDY6HC.js","c-LZJPNR2W.js","c-NLZ5AN4L.js","c-I2SCCUEW.js","c-GVPNDIKJ.js","c-ATKAOH23.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-XGH4GS2T.js","c-3O7OBDCM.js","c-EGTIAL6P.js"],"c-NLZ5AN4L.js":["c-4ASQPRQL.js","c-GQ6F6IDK.js","c-I2SCCUEW.js","c-5VYOWDTI.js","c-GSRLXYWL.js","c-X5LNHET5.js","c-UGHH4MB3.js","c-LA2BW7UY.js","c-GVPNDIKJ.js","c-EK63G3CG.js","c-NQJRVJ56.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-N7JPUPGC.js","c-EGTIAL6P.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js"],"c-X5LNHET5.js":["c-3O7OBDCM.js"],"loader-ZVPK4ZN3.js":["c-46XYM55L.js","c-RS77ODLY.js","c-7SWMYKAI.js","c-FILLTJA7.js","c-VKEDWYDF.js","c-UGHH4MB3.js","c-LA2BW7UY.js","c-IJUK2GPW.js","c-CYWLPPUS.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-RS77ODLY.js":["c-7SWMYKAI.js","c-UGHH4MB3.js","c-LA2BW7UY.js"],"reader-core-2GXY7SHY.js":["c-NUHP2XDB.js","c-TWCXBWS3.js","c-VKEDWYDF.js","c-LA2BW7UY.js","c-XGH4GS2T.js","c-IJUK2GPW.js","c-3O7OBDCM.js","c-BPF2NSPV.js","c-P7KNDG34.js","c-CYWLPPUS.js","c-N7JPUPGC.js","c-VG5XIN4T.js","c-2YYDMLNZ.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-WRBKEJD4.js","c-VHNSBD2M.js"],"c-TWCXBWS3.js":["c-LA2BW7UY.js","c-HA6INT6J.js","c-ICMAOOGK.js","c-VHNSBD2M.js"]},"bootImports":{"plugins/derive.js":["vendor/sap-core.vendor.js"]}};