@panphora/clayjs 1.15.2 → 1.17.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.
- package/README.md +4 -5
- package/THIRD-PARTY-NOTICES.md +16 -0
- package/compat/highlight-11.9.0.min.js +1213 -0
- package/compat/highlight-LICENSE +29 -0
- package/compat/journal-assets.lock.json +22 -0
- package/compat/overtype-2.6.1.min.js +116 -0
- package/compat/overtype-LICENSE +21 -0
- package/dist/all.js +90 -0
- package/dist/clay-dom.js +84 -0
- package/dist/clay-events.js +103 -0
- package/dist/clay-internals.js +85 -0
- package/dist/clay-options.js +93 -0
- package/dist/clay-router.js +98 -0
- package/dist/clay-ui.js +95 -0
- package/dist/clay-utils.js +84 -0
- package/dist/clay.js +146 -0
- package/dist/clay.standalone.js +84291 -57611
- package/dist/m/attrs/add-from-T5LJXFFI.js +1 -0
- package/dist/m/attrs/onaftersave-OKSWEJQF.js +1 -0
- package/dist/m/attrs/refetch-on-save-ZUE7PSCI.js +1 -0
- package/dist/m/attrs/save-freeze-MYNVXREN.js +1 -0
- package/dist/m/c-2AZDZWCK.js +1 -0
- package/dist/m/c-2SPVQSHC.js +1 -0
- package/dist/m/c-2YYDMLNZ.js +1 -0
- package/dist/m/c-336SGU5W.js +1 -0
- package/dist/m/c-33JJ6CBX.js +2 -0
- package/dist/m/c-3GJ4SDE2.js +1 -0
- package/dist/m/c-3H6BZDNJ.js +6 -0
- package/dist/m/c-3OWDMNJR.js +2 -0
- package/dist/m/c-3RUU4TPX.js +91 -0
- package/dist/m/c-3XIRD4NU.js +1 -0
- package/dist/m/c-46XYM55L.js +1 -0
- package/dist/m/c-4DFEJ2PO.js +3 -0
- package/dist/m/c-4JZDZFF6.js +1 -0
- package/dist/m/c-4L3BTFRK.js +1 -0
- package/dist/m/c-4Q2XTQ2N.js +2 -0
- package/dist/m/c-4WKFKEKF.js +1 -0
- package/dist/m/c-56QRZTZH.js +1 -0
- package/dist/m/c-5J4E7O4Y.js +4 -0
- package/dist/m/c-5LKDWQTL.js +19 -0
- package/dist/m/c-5QWQ7A5L.js +1 -0
- package/dist/m/c-5RJFTLSF.js +1 -0
- package/dist/m/c-5V3MOVJT.js +1 -0
- package/dist/m/c-5VYOWDTI.js +1 -0
- package/dist/m/c-5YIHJ3TJ.js +1 -0
- package/dist/m/c-6AZOGAPE.js +1 -0
- package/dist/m/c-6CRUUXOX.js +5 -0
- package/dist/m/c-6HMB24EV.js +1 -0
- package/dist/m/c-6KEVEQ7L.js +1 -0
- package/dist/m/c-6NC5I2TV.js +1 -0
- package/dist/m/c-74MGYWZF.js +1 -0
- package/dist/m/c-7DJDKPGL.js +1 -0
- package/dist/m/c-7OLLJPWP.js +1 -0
- package/dist/m/c-7SWMYKAI.js +1 -0
- package/dist/m/c-A3E3NIMC.js +1 -0
- package/dist/m/c-A7LS5UZW.js +1 -0
- package/dist/m/c-AMSNPOCX.js +1 -0
- package/dist/m/c-AQLFEATB.js +1 -0
- package/dist/m/c-B3JM5ZXC.js +1 -0
- package/dist/m/c-BBVGTQG7.js +1 -0
- package/dist/m/c-BPF2NSPV.js +1 -0
- package/dist/m/c-BQ6LOBEE.js +1 -0
- package/dist/m/c-BTDI4Y23.js +1 -0
- package/dist/m/c-BWFVSBDF.js +1 -0
- package/dist/m/c-BYTKL6UX.js +1 -0
- package/dist/m/c-CFHW5AMY.js +6 -0
- package/dist/m/c-CJ3A7ZKE.js +1 -0
- package/dist/m/c-CQHPGKX2.js +1 -0
- package/dist/m/c-CYWLPPUS.js +1 -0
- package/dist/m/c-CZUSOB7V.js +1 -0
- package/dist/m/c-DCFSEJZG.js +1 -0
- package/dist/m/c-DCXOXBF3.js +1 -0
- package/dist/m/c-DFS4XZJV.js +2 -0
- package/dist/m/c-DNENWY4O.js +1 -0
- package/dist/m/c-DNZ5IFM6.js +1 -0
- package/dist/m/c-E4LIR5X5.js +1 -0
- package/dist/m/c-EJTGYSLN.js +1 -0
- package/dist/m/c-EVCQ3BKA.js +1 -0
- package/dist/m/c-EZU56NQV.js +34 -0
- package/dist/m/c-FDNHHZY5.js +1 -0
- package/dist/m/c-FILLTJA7.js +1 -0
- package/dist/m/c-FRLHSY7E.js +1 -0
- package/dist/m/c-FROJUZMV.js +1 -0
- package/dist/m/c-G2JPKCTP.js +1 -0
- package/dist/m/c-GB6TU7WV.js +1 -0
- package/dist/m/c-GFJJEBTU.js +1 -0
- package/dist/m/c-GJAEGGXY.js +1 -0
- package/dist/m/c-GOWBDM6J.js +1 -0
- package/dist/m/c-GQ6F6IDK.js +1 -0
- package/dist/m/c-GSFIGKOP.js +1 -0
- package/dist/m/c-GY422N3Q.js +1 -0
- package/dist/m/c-H4LG442Q.js +1 -0
- package/dist/m/c-HA6INT6J.js +1 -0
- package/dist/m/c-HAWFNBYG.js +1 -0
- package/dist/m/c-HDDEEL77.js +1 -0
- package/dist/m/c-HFKUVACH.js +1 -0
- package/dist/m/c-HHDFCNHV.js +1 -0
- package/dist/m/c-HPURYVZS.js +2 -0
- package/dist/m/c-I2ZATQCD.js +2 -0
- package/dist/m/c-IEM4NTCS.js +1 -0
- package/dist/m/c-IJUK2GPW.js +1 -0
- package/dist/m/c-IW6GGOU2.js +1 -0
- package/dist/m/c-JAX2667S.js +6 -0
- package/dist/m/c-JDCX26UP.js +25 -0
- package/dist/m/c-JRKY44DK.js +1 -0
- package/dist/m/c-JU3NK25H.js +1 -0
- package/dist/m/c-KAU6E43D.js +1 -0
- package/dist/m/c-KBS3UV6B.js +1 -0
- package/dist/m/c-KGVGROZT.js +1 -0
- package/dist/m/c-KI7M4AY3.js +1 -0
- package/dist/m/c-KIPQJX4B.js +1 -0
- package/dist/m/c-KQ6TYJAP.js +135 -0
- package/dist/m/c-KU3ZFADW.js +1 -0
- package/dist/m/c-L4WQSC27.js +1 -0
- package/dist/m/c-LFPHCXY3.js +1 -0
- package/dist/m/c-LRPUO2MX.js +1 -0
- package/dist/m/c-LWLBHLVC.js +3 -0
- package/dist/m/c-LZJPNR2W.js +1 -0
- package/dist/m/c-M2L47S2X.js +7 -0
- package/dist/m/c-MFP2ZWD4.js +1 -0
- package/dist/m/c-MKSQ4Y57.js +1 -0
- package/dist/m/c-MTQHWQC3.js +1 -0
- package/dist/m/c-N326R2JD.js +1 -0
- package/dist/m/c-N7JPUPGC.js +1 -0
- package/dist/m/c-NRPJEVJS.js +1 -0
- package/dist/m/c-NUFFJVVJ.js +1 -0
- package/dist/m/c-NUHP2XDB.js +1 -0
- package/dist/m/c-NUHSPT5P.js +1 -0
- package/dist/m/c-O72HVYSA.js +1 -0
- package/dist/m/c-OCSZ4QGN.js +1 -0
- package/dist/m/c-OIBUTDXI.js +1 -0
- package/dist/m/c-OIDRZKAF.js +1 -0
- package/dist/m/c-OW5QIGG3.js +1 -0
- package/dist/m/c-P7KNDG34.js +1 -0
- package/dist/m/c-PGRCK73F.js +1 -0
- package/dist/m/c-PQ5LK6QE.js +993 -0
- package/dist/m/c-PS5ARVWR.js +9 -0
- package/dist/m/c-PZ4XEPUP.js +2 -0
- package/dist/m/c-Q622NS2Y.js +1 -0
- package/dist/m/c-Q7NQD65V.js +1 -0
- package/dist/m/c-QH63LQOS.js +1 -0
- package/dist/m/c-QHIWXHRO.js +1 -0
- package/dist/m/c-QHWJ5ZIJ.js +1 -0
- package/dist/m/c-QICP2YR5.js +1 -0
- package/dist/m/c-QJ4OM3G6.js +1 -0
- package/dist/m/c-QNKREOL6.js +1 -0
- package/dist/m/c-R3L7ZJGB.js +2 -0
- package/dist/m/c-R7IWVINQ.js +1 -0
- package/dist/m/c-RM7J7BV2.js +1 -0
- package/dist/m/c-RSMOODDU.js +1 -0
- package/dist/m/c-RVMWGXEJ.js +1 -0
- package/dist/m/c-RYUXUUBX.js +1 -0
- package/dist/m/c-S4ZEH46B.js +9 -0
- package/dist/m/c-S7H2DRCB.js +1 -0
- package/dist/m/c-S7LK4KUE.js +1 -0
- package/dist/m/c-SDAXDM2D.js +1 -0
- package/dist/m/c-SGIA4IEQ.js +188 -0
- package/dist/m/c-SMBZG5X4.js +1 -0
- package/dist/m/c-SMGU7RT3.js +235 -0
- package/dist/m/c-SPIORRYS.js +1 -0
- package/dist/m/c-SWLRT66R.js +1 -0
- package/dist/m/c-SZGYW5HT.js +1 -0
- package/dist/m/c-TCCA5BZN.js +2 -0
- package/dist/m/c-TCJTVAFN.js +1 -0
- package/dist/m/c-TJ6WOJL3.js +67 -0
- package/dist/m/c-TQEMVJCS.js +1 -0
- package/dist/m/c-TRS6TM6O.js +1 -0
- package/dist/m/c-TYLXX4NF.js +21 -0
- package/dist/m/c-U62OB4BT.js +1 -0
- package/dist/m/c-U6YWUAR3.js +8 -0
- package/dist/m/c-UDCSU5G5.js +2 -0
- package/dist/m/c-UDUUJPFZ.js +1 -0
- package/dist/m/c-UGHH4MB3.js +1 -0
- package/dist/m/c-UL2YUY52.js +1 -0
- package/dist/m/c-VAK7SG37.js +1 -0
- package/dist/m/c-VDSS4K3Z.js +1 -0
- package/dist/m/c-VE6ZMYMC.js +1 -0
- package/dist/m/c-VG5XIN4T.js +1 -0
- package/dist/m/c-VHM5XQHK.js +1 -0
- package/dist/m/c-VHNSBD2M.js +1 -0
- package/dist/m/c-VI5RMSVY.js +1 -0
- package/dist/m/c-VKEDWYDF.js +1 -0
- package/dist/m/c-VRZN56XY.js +1 -0
- package/dist/m/c-W5MCHEGA.js +1 -0
- package/dist/m/c-WDC5GVKU.js +1 -0
- package/dist/m/c-WN5AY3OZ.js +1 -0
- package/dist/m/c-WNYBLIOZ.js +1 -0
- package/dist/m/c-WRBKEJD4.js +1 -0
- package/dist/m/c-WWXIDH4O.js +28 -0
- package/dist/m/c-WYFDLITL.js +1 -0
- package/dist/m/c-XCNTK76U.js +1 -0
- package/dist/m/c-XMS6DPBR.js +1 -0
- package/dist/m/c-XN6MBKI6.js +67 -0
- package/dist/m/c-XPELB6E5.js +1 -0
- package/dist/m/c-XQXZAO7N.js +1 -0
- package/dist/m/c-Y5HBBIQ4.js +1 -0
- package/dist/m/c-ZE46QDIH.js +1 -0
- package/dist/m/c-ZUCOKOHT.js +1 -0
- package/dist/m/c-ZVPVXTJF.js +4 -0
- package/dist/m/c-ZVRKXKM7.js +1 -0
- package/dist/m/c-ZWIOJGMT.js +1 -0
- package/dist/m/core/admin-attrs-QHOKPJ7W.js +1 -0
- package/dist/m/core/autosave-HRYGUWV6.js +1 -0
- package/dist/m/core/conflict-notice-6MROJN2L.js +1 -0
- package/dist/m/core/draft-mode-WSQAT67S.js +1 -0
- package/dist/m/core/host-permission-FNXVEFNE.js +1 -0
- package/dist/m/core/is-edit-mode-KTWA3O5N.js +1 -0
- package/dist/m/core/persist-JFYRHMRJ.js +3 -0
- package/dist/m/core/recovery-FLTCC2OC.js +1 -0
- package/dist/m/core/save-HQZ4S667.js +1 -0
- package/dist/m/core/save-core-KGQWFUNH.js +1 -0
- package/dist/m/core/snapshot-EGQZNT45.js +1 -0
- package/dist/m/core/unsaved-warning-IDJLD66H.js +1 -0
- package/dist/m/dom/all-APS5ZSKP.js +1 -0
- package/dist/m/dom/dom-helpers-L7OSR6S4.js +1 -0
- package/dist/m/events/index-RN2JNGBV.js +1 -0
- package/dist/m/internals/index-PVXGPUDA.js +1 -0
- package/dist/m/lib/cache-bust-MUMFXZK6.js +1 -0
- package/dist/m/lib/region-policy-SB2AWVG5.js +1 -0
- package/dist/m/loader-S4I7GKXR.js +1 -0
- package/dist/m/manifest-4C419D67.js +1 -0
- package/dist/m/manifest-edit-B077F288.js +1 -0
- package/dist/m/manifest.json +3988 -0
- package/dist/m/options/options-EJMS3K24.js +1 -0
- package/dist/m/page/editor-NNJA4OKD.js +202 -0
- package/dist/m/plugins/ai-edit-QN4PMMNL.js +6 -0
- package/dist/m/plugins/bind-text-NX46N5UV.js +1 -0
- package/dist/m/plugins/cms-HP3LSTPN.js +2293 -0
- package/dist/m/plugins/demo-RM5IR6AO.js +1 -0
- package/dist/m/plugins/derive-UAAA4V4S.js +1 -0
- package/dist/m/plugins/indicator-URDBBOQO.js +1 -0
- package/dist/m/plugins/live-HFWD4OIH.js +1 -0
- package/dist/m/plugins/menu-3HIEQSI6.js +138 -0
- package/dist/m/plugins/message-LQ6EDH4V.js +1 -0
- package/dist/m/plugins/page-JOKB6XPR.js +2 -0
- package/dist/m/plugins/page-view-NXOJHNW6.js +1 -0
- package/dist/m/plugins/people-SGPJKANK.js +1 -0
- package/dist/m/plugins/quickcrop-QNY3PKLD.js +26 -0
- package/dist/m/plugins/quickcrop-QNY3PKLD.js.LEGAL.txt +7 -0
- package/dist/m/plugins/richclay-NRQDSWX6.js +517 -0
- package/dist/m/plugins/richclay-NRQDSWX6.js.LEGAL.txt +1 -0
- package/dist/m/plugins/sortable-GWT4PWDV.js +1 -0
- package/dist/m/plugins/source-4ZRSAIYM.js +1 -0
- package/dist/m/plugins/undo-VDA5P7FH.js +1 -0
- package/dist/m/plugins/unsent-HJFLQJ2O.js +1 -0
- package/dist/m/plugins/upgrade-W7FG5VFG.js +1 -0
- package/dist/m/plugins/upload-WLYKK6TL.js +1 -0
- package/dist/m/plugins/visitor-drafts-LIDY7NH6.js +21 -0
- package/dist/m/plugins/visitor-drafts-owner-ZXCKBZE7.js +1 -0
- package/dist/m/plugins/wire-4N6GYAF6.js +1 -0
- package/dist/m/reader-core-DXYCURFF.js +68 -0
- package/dist/m/route/route-KOCZSEGN.js +1 -0
- package/dist/m/sync/live-sync-J7VMYTKS.js +1 -0
- package/dist/m/ui/index-3JLVI27O.js +1 -0
- package/dist/m/utils/index-4TJCVLT7.js +1 -0
- package/dist/m/vendor/Sortable.vendor-A755ITLN.js +3 -0
- package/dist/m/vendor/Sortable.vendor-A755ITLN.js.LEGAL.txt +1 -0
- package/dist/m/vendor/sap-core.vendor-A7BMUYZT.js +6 -0
- package/dist/offline-manifest.json +4034 -0
- package/dist/page/themes/light-1.css +430 -0
- package/dist/server/core.cjs +23748 -22855
- package/dist/server/offline-runtime.cjs +4954 -0
- package/dist/server/offline-runtime.mjs +4923 -0
- package/dist/server/rooms.mjs +9 -0
- package/docs/guide.md +1078 -669
- package/entries/all.js +2 -0
- package/entries/clay-data.js +1 -1
- package/entries/clay-dom.js +2 -0
- package/entries/clay-events.js +2 -0
- package/entries/clay-internals.js +2 -0
- package/entries/clay-options.js +2 -0
- package/entries/clay-router.js +2 -0
- package/entries/clay-ui.js +2 -0
- package/entries/clay-utils.js +2 -0
- package/entries/clay.js +2 -0
- package/entries/sap.js +6 -6
- package/fonts/ibm-plex-mono-LICENSE +93 -0
- package/fonts/ibm-plex-mono-latin-300-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-400-italic.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-LICENSE +93 -0
- package/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/fonts/ibm-plex.css +71 -0
- package/fonts/inter-LICENSE +93 -0
- package/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
- package/fonts/inter-greek-wght-normal.woff2 +0 -0
- package/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
- package/fonts/inter.css +62 -0
- package/fonts/newsreader-LICENSE +93 -0
- package/fonts/newsreader-latin-ext-opsz-normal.woff2 +0 -0
- package/fonts/newsreader-latin-opsz-normal.woff2 +0 -0
- package/fonts/newsreader-vietnamese-opsz-normal.woff2 +0 -0
- package/fonts/newsreader.css +26 -0
- package/fonts/work-sans-LICENSE +93 -0
- package/fonts/work-sans-latin-wght-normal.woff2 +0 -0
- package/fonts/work-sans.css +8 -0
- package/package.json +20 -3
- package/packed-contract.json +1 -0
- package/src/attrs/add-from.js +27 -4
- package/src/attrs/save-freeze.js +7 -52
- package/src/core/admin-attrs.js +119 -12
- package/src/core/admin-contenteditable.js +12 -10
- package/src/core/admin-inputs.js +14 -15
- package/src/core/admin-onclick.js +2 -0
- package/src/core/autosave.js +74 -21
- package/src/core/boot-phase.js +2 -1
- package/src/core/conflict-download.js +19 -23
- package/src/core/conflict-notice-ui.js +1173 -0
- package/src/core/conflict-notice.js +140 -697
- package/src/core/download.js +32 -0
- package/src/core/edit-mode.js +147 -14
- package/src/core/etag.js +30 -12
- package/src/core/host-meta.js +90 -8
- package/src/core/host-permission.js +29 -0
- package/src/core/is-edit-mode.js +145 -12
- package/src/core/mode-key.js +125 -0
- package/src/core/mode-lifecycle.js +544 -0
- package/src/core/mode-receipt.js +30 -0
- package/src/core/mode-refusal.js +13 -0
- package/src/core/mode-resources.js +52 -0
- package/src/core/mode-support.js +82 -0
- package/src/core/mode-switch.js +259 -0
- package/src/core/mode-transition.js +112 -0
- package/src/core/page-data-write.js +305 -0
- package/src/core/page-data.js +26 -227
- package/src/core/page-format-wire.js +4 -0
- package/src/core/page-format.js +58 -0
- package/src/core/persist.js +37 -9
- package/src/core/preserve-authored.js +114 -0
- package/src/core/recovery.js +772 -0
- package/src/core/runtime-url.js +105 -0
- package/src/core/save-core.js +113 -12
- package/src/core/save-replace.js +72 -0
- package/src/core/save-size-notice.js +134 -0
- package/src/core/save-size.js +140 -0
- package/src/core/save.js +806 -119
- package/src/core/snapshot.js +159 -11
- package/src/core/source-map.js +157 -9
- package/src/core/unsaved-warning.js +14 -4
- package/src/core/upgrade-run.js +408 -0
- package/src/core/version.js +18 -0
- package/src/lib/assets.js +30 -0
- package/src/lib/autosave-debug-gate.js +50 -0
- package/src/lib/autosave-scheduler.js +140 -0
- package/src/lib/boot-imports.js +8 -0
- package/src/lib/derived.js +3 -1
- package/src/lib/dirty-gate.js +15 -0
- package/src/lib/doc-storage.js +33 -0
- package/src/lib/effect.js +9 -4
- package/src/lib/mutation.js +4 -2
- package/src/lib/offline-runtime.js +226 -0
- package/src/lib/preload.js +48 -0
- package/src/lib/root-attrs.js +1 -1
- package/src/lib/trash.js +18 -0
- package/src/lib/undo/capture-move.js +152 -0
- package/src/live/local-channel.js +61 -0
- package/src/live/local-lane.js +60 -9
- package/src/live/server-lane.js +6 -3
- package/src/loader-logic.js +76 -15
- package/src/loader.js +218 -30
- package/src/page/adopt-boot.js +76 -22
- package/src/page/adopt.js +25 -4
- package/src/page/awareness.js +230 -0
- package/src/page/blocks.js +113 -6
- package/src/page/blocksel.js +20 -4
- package/src/page/board-face.js +13 -0
- package/src/page/board-panel.js +5 -17
- package/src/page/board-style.js +2 -13
- package/src/page/board-view.js +1 -11
- package/src/page/board-views.js +3 -0
- package/src/page/board.js +2 -2
- package/src/page/boot-pack.js +26 -0
- package/src/page/boot.js +237 -0
- package/src/page/chart-tables.js +11 -0
- package/src/page/chart.js +6 -10
- package/src/page/checklist.js +1 -1
- package/src/page/checkpoint-proof.js +289 -0
- package/src/page/chrome.js +431 -63
- package/src/page/csv-import.js +17 -2
- package/src/page/document-title-dom.js +52 -0
- package/src/page/document-title-runtime.js +90 -0
- package/src/page/document-title.js +12 -0
- package/src/page/drag.js +48 -13
- package/src/page/drop.js +2 -1
- package/src/page/editor.js +399 -90
- package/src/page/emoji-data.js +162 -0
- package/src/page/feature-loader.js +72 -0
- package/src/page/features/board.js +21 -0
- package/src/page/features/chart.js +11 -0
- package/src/page/features/code.js +13 -0
- package/src/page/features/dates.js +180 -0
- package/src/page/features/emoji.js +187 -0
- package/src/page/features/media.js +290 -0
- package/src/page/features/mentions.js +188 -0
- package/src/page/features/registry.js +28 -0
- package/src/page/features/table.js +383 -0
- package/src/page/{tool-view.js → features/tool.js} +33 -2
- package/src/page/format-codec.js +215 -0
- package/src/page/format-command.js +9 -0
- package/src/page/format-gate.js +179 -0
- package/src/page/format-host.js +54 -0
- package/src/page/format-level.js +157 -0
- package/src/page/format-native-commands.js +142 -0
- package/src/page/format-native.js +42 -0
- package/src/page/highlight-slot.js +23 -0
- package/src/page/highlight.js +30 -16
- package/src/page/history-intent.js +78 -0
- package/src/page/inline.js +45 -28
- package/src/page/items.js +67 -14
- package/src/page/link.js +1 -0
- package/src/page/markdown.js +112 -3
- package/src/page/media-views.js +3 -0
- package/src/page/media.js +33 -245
- package/src/page/mention-picker.js +99 -0
- package/src/page/merge.js +1 -1
- package/src/page/outline-cache.js +11 -0
- package/src/page/placeholder.js +27 -7
- package/src/page/projection.js +240 -51
- package/src/page/reader-patch.js +306 -0
- package/src/page/recover.js +1 -1
- package/src/page/rich/page-tool.js +1 -4
- package/src/page/runtime-owner.js +27 -0
- package/src/page/save-projection.js +46 -4
- package/src/page/save-states.js +1 -1
- package/src/page/schema.js +47 -0
- package/src/page/table-rect-key.js +3 -0
- package/src/page/table-select.js +4 -3
- package/src/page/table-style.js +1 -1
- package/src/page/table-views.js +3 -0
- package/src/page/table.js +8 -293
- package/src/page/themes/content.css +25 -1
- package/src/page/themes/light-1.css +163 -2
- package/src/page/themes/light-1.source.css +269 -0
- package/src/page/tool-capability.js +3 -0
- package/src/page/tool-views.js +3 -0
- package/src/page/view-hooks.js +32 -0
- package/src/page/view.js +390 -107
- package/src/page/ybind/awareness.js +172 -0
- package/src/page/ybind/binding.js +40 -5
- package/src/page/ybind/bridge.js +50 -47
- package/src/page/ybind/decode.js +52 -19
- package/src/page/ybind/doc.js +27 -2
- package/src/page/ybind/group.js +12 -3
- package/src/page/ybind/index.js +2 -0
- package/src/page/ybind/lineage.js +71 -0
- package/src/page/ybind/marks.js +26 -1
- package/src/page/ybind/migrate.js +48 -13
- package/src/page/ybind/moves.js +32 -21
- package/src/page/ybind/positions.js +50 -0
- package/src/page/ybind/provider.js +97 -24
- package/src/page/ybind/recovery-proof.js +191 -0
- package/src/page/ybind/recovery-replay.js +488 -0
- package/src/page/ybind/tokens.js +15 -6
- package/src/page/ybind/walk.js +10 -3
- package/src/page/ybind/writer.js +48 -4
- package/src/plugins/ai-edit.js +167 -32
- package/src/plugins/bind-text.js +218 -0
- package/src/plugins/cms.js +93 -0
- package/src/plugins/indicator.js +57 -5
- package/src/plugins/live.js +319 -35
- package/src/plugins/menu/claygoo.svg.js +1 -0
- package/src/plugins/menu/seo-head.js +323 -0
- package/src/plugins/menu/seo.js +849 -0
- package/src/plugins/menu.js +425 -0
- package/src/plugins/page-view.js +131 -0
- package/src/plugins/page.js +1131 -270
- package/src/plugins/people.js +158 -31
- package/src/plugins/richclay.js +119 -9
- package/src/plugins/sortable.js +370 -60
- package/src/plugins/source.js +189 -366
- package/src/plugins/undo.js +289 -19
- package/src/plugins/unsent.js +132 -0
- package/src/plugins/upgrade-run.js +1 -0
- package/src/plugins/upgrade.js +210 -0
- package/src/plugins/upload-task.js +571 -0
- package/src/plugins/upload-ui.js +265 -0
- package/src/plugins/upload.js +34 -153
- package/src/plugins/visitor-drafts/inert.js +32 -0
- package/src/plugins/visitor-drafts/intro.js +2 -1
- package/src/plugins/visitor-drafts/owner-chip.js +3 -0
- package/src/plugins/visitor-drafts/prompt.js +2 -2
- package/src/plugins/visitor-drafts-owner.js +85 -0
- package/src/plugins/visitor-drafts.js +31 -42
- package/src/plugins/wire.js +82 -1
- package/src/reader-core.js +26 -0
- package/src/recovery/conflicts.js +287 -0
- package/src/recovery/identity.js +154 -0
- package/src/recovery/store.js +792 -0
- package/src/recovery/undo.js +257 -0
- package/src/server/checkpoint/index.js +68 -4
- package/src/server/offline-runtime/index.js +214 -0
- package/src/server/rooms/index.js +2 -1
- package/src/server/rooms/live-data-rooms.js +2 -2
- package/src/server/rooms/page-admission.js +33 -0
- package/src/server/rooms/page-lineage.js +56 -0
- package/src/server/rooms/page-rebase.js +11 -5
- package/src/server/rooms/page-state.js +2 -0
- package/src/server/rooms/page-write-admission.js +9 -3
- package/src/source/session.js +705 -0
- package/src/sync/conflict-revert.js +5 -4
- package/src/sync/conflicts-edit.js +119 -0
- package/src/sync/conflicts-facade.js +49 -0
- package/src/sync/conflicts.js +99 -1
- package/src/sync/editing-marker.js +37 -6
- package/src/sync/editing-sender.js +8 -1
- package/src/sync/live-sync-edit.js +63 -0
- package/src/sync/live-sync.js +364 -119
- package/src/sync/local-presence.js +187 -0
- package/src/sync/merge-declarations.js +10 -0
- package/src/sync/merge-engine.js +12 -0
- package/src/sync/presence-store.js +412 -0
- package/src/sync/presence-target.js +243 -0
- package/src/sync/presence.js +72 -41
- package/src/sync/saved-handoff.js +200 -0
- package/src/sync/saved-stream.js +544 -0
- package/src/sync/version-guard.js +92 -0
- package/src/sync/wire-profile.js +81 -0
- package/src/ui/bevel-controls.js +2 -8
- package/src/ui/page-scheme.js +7 -0
- package/src/ui/skins/cms.js +1 -1
- package/src/ui/theme-config.js +150 -0
- package/src/ui/theme.js +6 -138
- package/src/ui/toast-lazy.js +11 -0
- package/src/vendor/LICENSES-optional.md +253 -0
- package/src/vendor/highlight.vendor.js +3 -0
- package/src/vendor/hljs-bash.vendor.js +2 -0
- package/src/vendor/hljs-css.vendor.js +2 -0
- package/src/vendor/hljs-javascript.vendor.js +2 -0
- package/src/vendor/hljs-json.vendor.js +2 -0
- package/src/vendor/hljs-python.vendor.js +2 -0
- package/src/vendor/hljs-xml.vendor.js +2 -0
- package/src/vendor/hyper-html-api-data.vendor.js +1 -1
- package/src/vendor/hyper-html-api-upgrade.vendor.js +5 -0
- package/src/vendor/hyper-morph-identity.vendor.js +2 -0
- package/src/vendor/hyper-morph-json.vendor.js +3 -0
- package/src/vendor/hyper-morph.vendor.js +6 -6
- package/src/vendor/hyper-undo.vendor.js +1 -1
- package/src/vendor/hypercms.vendor.js +169 -84
- package/src/vendor/marked.vendor.js +68 -0
- package/src/vendor/overtype.vendor.js +994 -0
- package/src/vendor/richclay.vendor.js +17 -17
- package/src/vendor/sap-core.vendor.js +5 -5
- package/src/vendor/sap-ownership.vendor.js +11 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=":is([persist], [clay-persist])",t=":is([autosave], [clay-autosave])";export{s as a,t as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d}from"./c-ZWIOJGMT.js";import{b as A,k as c}from"./c-HA6INT6J.js";import{i as s}from"./c-DCFSEJZG.js";import{a as g}from"./c-VHNSBD2M.js";var L={};g(L,{CONTROLLED_SELECTOR:()=>m,authoredAttr:()=>b,canonicalContentEditable:()=>T,canonicalContentEditableValue:()=>E,captureAll:()=>h,captureAuthored:()=>u,captureFrozen:()=>p,frozenOriginal:()=>y,restoreAuthoredOrder:()=>v});var m="[editmode\\:contenteditable], [editmode\\:onclick], [viewmode\\:disabled], [viewmode\\:readonly]",l=new WeakMap,f=new WeakMap;function u(e){let t=l.get(e);if(!t){let r=e.getAttributeNames(),n={};for(let i of r)n[i]=e.getAttribute(i);t={order:r,values:n},l.set(e,t)}return t}function b(e,t){if(!e)return null;let{values:r}=u(e);return t in r?r[t]:null}function v(e){let t=l.get(e);if(!t)return;let r=e.getAttributeNames(),n=[...t.order.filter(o=>r.includes(o)),...r.filter(o=>!t.order.includes(o))];if(n.every((o,a)=>o===r[a]))return;let i=n.map(o=>[o,e.getAttribute(o)]);for(let o of r)e.removeAttribute(o);for(let[o,a]of i)e.setAttribute(o,a)}function E(e){return e.getAttribute("contenteditable")??e.getAttribute("inert-contenteditable")??b(e,"inert-contenteditable")??b(e,"contenteditable")??"true"}function T(e){e.setAttribute("inert-contenteditable",E(e)),e.removeAttribute("contenteditable")}function x(e){let t=e.innerHTML;if(!e.querySelector(`[${c}]`)&&!t.includes("ephemeral")&&!t.includes("<dialog"))return t;let r=e.cloneNode(!0);for(let n of r.querySelectorAll(`[${c}]`))n.removeAttribute(c);for(let n of r.children)A(n);return r.innerHTML}function p(e){f.has(e)||f.set(e,x(e))}function y(e){return f.get(e)}function h(){for(let e of document.querySelectorAll(m))u(e);for(let e of document.querySelectorAll(s))p(e)}h();d.onAddElement({selectorFilter:m,require:"observed",pausable:!1,debounce:0},e=>{e.forEach(({element:t})=>u(t))});d.onAddElement({selectorFilter:s,require:"observed",pausable:!1,debounce:0},e=>{e.forEach(({element:t})=>p(t))});export{u as a,b,v as c,T as d,y as e,h as f,L as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as f}from"./c-PZ4XEPUP.js";import{a as d,b as p}from"./c-MFP2ZWD4.js";import{y,z as i}from"./c-SPIORRYS.js";function m(e=new Date){let t=r=>String(r).padStart(2,"0");return`${e.getFullYear()}${t(e.getMonth()+1)}${t(e.getDate())}-${t(e.getHours())}${t(e.getMinutes())}${t(e.getSeconds())}`}function g(e,t){let n=`<script type="application/json" id="clay-lost-edits" clay="no-save">${JSON.stringify(t).replace(/</g,"\\u003c")}<\/script>`,s=e.lastIndexOf("</body>");return s>=0?e.slice(0,s)+n+e.slice(s):e+n}function k(e,{refused:t=!1}={}){let r=window.clay?.conflicts||null,n=[],s=new Set;for(let o of e){let a=r?.recoveryOf(o.id);a&&!s.has(a.id)&&(s.add(a.id),n.push(a))}n.sort((o,a)=>(o.ticket||0)-(a.ticket||0));let u=o=>y(o.recoveryRoot??o.root,{prepared:o.domain==="save"}),c,l;t||!n.length?(c=i(),l=n):(c=u(n[n.length-1]),l=n.slice(0,-1));let h=e.map(o=>{if(o.kind==="apply-incomplete")return{id:o.id,kind:"apply-incomplete",name:"Sync update that did not finish",error:o.error??null};let{id:a,name:w,kind:$,yours:S,now:O,sentence:b}=f(o);return{id:a,name:w,kind:$,yours:S,now:O,sentence:b}}),v={format:"clay-lost-edits",version:1,savedAt:new Date().toISOString(),page:location.href,refused:!!t,edits:h,earlierPages:l.map(o=>({applyId:o.id,source:o.source,html:u(o)}))};return{html:g(c,v),name:`${d()}-${t?"my-version":"my-copy"}-${m()}.html`}}function A({html:e=null,edits:t=[]}={}){try{let r=typeof e=="string"?e:i(),n={format:"clay-lost-edits",version:1,savedAt:new Date().toISOString(),page:location.href,refused:!1,edits:Array.isArray(t)?t:[],earlierPages:[]};return p({html:g(r,n),name:`${d()}-my-copy-${m()}.html`})}catch(r){return console.error("clayjs: could not build the download",r),!1}}function D(e,{refused:t=!1}={}){try{let{html:r,name:n}=k(e,{refused:t});return p({html:r,name:n})}catch(r){return console.error("clayjs: could not build the download",r),!1}}export{A as a,D as b};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import"./c-VHNSBD2M.js";var Ae=Object.defineProperty,_e=(n,e,t)=>e in n?Ae(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,g=(n,e,t)=>_e(n,typeof e!="symbol"?e+"":e,t);function J(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _=J();function fe(n){_=n}var z={exec:()=>null};function L(n){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),r=e[s];return r||(r=n(s),e[s]=r),r}}function u(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(m.caret,"$1"),t=t.replace(r,a),s},getRegex:()=>new RegExp(t,e)};return s}var Pe=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),m={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:L(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:L(n=>new RegExp(`^ {0,${n}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:L(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:L(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:L(n=>new RegExp(`^ {0,${n}}(?:</?(?:${D})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:L(n=>new RegExp(`^ {0,${n}}>`))},Le=/^(?:[ \t]*(?:\n|$))+/,Ee=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ie=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Z=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ce=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,K=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,de=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xe=u(de).replace(/bull/g,K).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Be=u(de).replace(/bull/g,K).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),V=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,qe=/^[^\n]+/,Y=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ve=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Y).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ze=u(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,K).getRegex(),D="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ee=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,De=u("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ee).replace("tag",D).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be=n=>u(V).replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",n).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),Qe=be(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Oe=be(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Me=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Oe).getRegex(),te={blockquote:Me,code:Ee,def:ve,fences:Ie,heading:Ce,hr:Z,html:De,lheading:xe,list:Ze,newline:Le,paragraph:Qe,table:z,text:qe},ie=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),je={...te,lheading:Be,table:ie,paragraph:u(V).replace("hr",Z).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ie).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex()},Ne={...te,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:z,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(V).replace("hr",Z).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",xe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},He=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ge=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,me=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Fe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,R=/[\p{P}\p{S}]/u,E=/[\s\p{P}\p{S}]/u,Q=/[^\s\p{P}\p{S}]/u,Xe=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,E).getRegex(),Ue=/[\p{Pi}\p{Ps}"']/u,we=/(?!~)[\p{P}\p{S}]/u,We=/(?!~)[\s\p{P}\p{S}]/u,Je=/(?:[^\s\p{P}\p{S}]|~)/u,Ke=u(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Pe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Se=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ve=u(Se,"u").replace(/punct/g,R).getRegex(),Ye=u(Se,"u").replace(/punct/g,we).getRegex(),et=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,tt=u(et,"u").replace(/openQuote/g,Ue).replace(/punct/g,R).getRegex(),$e="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",nt=u($e,"gu").replace(/notPunctSpace/g,Q).replace(/punctSpace/g,E).replace(/punct/g,R).getRegex(),rt=u($e,"gu").replace(/notPunctSpace/g,Je).replace(/punctSpace/g,We).replace(/punct/g,we).getRegex(),st="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",it=u(st,"gu").replace(/notPunctSpace/g,Q).replace(/punctSpace/g,E).replace(/punct/g,R).getRegex(),lt=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Q).replace(/punctSpace/g,E).replace(/punct/g,R).getRegex(),at="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",ot=u(at,"gu").replace(/notPunctSpace/g,Q).replace(/punctSpace/g,E).replace(/punct/g,R).getRegex(),ct=u(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,R).getRegex(),ht="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",pt=u(ht,"gu").replace(/notPunctSpace/g,Q).replace(/punctSpace/g,E).replace(/punct/g,R).getRegex(),ut=u(/\\(punct)/,"gu").replace(/punct/g,R).getRegex(),gt=u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),kt=u(ee).replace("(?:-->|$)","-->").getRegex(),ft=u("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",kt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ye=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,j=u(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",ye).getRegex(),dt=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",j).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xt=u(/^!?\[(label)\]\[(ref)\]/).replace("label",j).replace("ref",Y).getRegex(),bt=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",Y).getRegex(),le=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,mt=u(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",ye).getRegex(),wt=u("reflink|nolink(?!\\()","g").replace("reflink",u(/^!?\[(label)\]\[(ref)\]/).replace("label",mt).replace("ref",le).getRegex()).replace("nolink",u(/^!?\[(ref)\](?:\[\])?/).replace("ref",le).getRegex()).getRegex(),ae=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,St=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,$t=u(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,St).getRegex(),ne={_backpedal:z,anyPunctuation:ut,autolink:gt,blockSkip:Ke,br:me,code:Ge,del:z,delLDelim:z,delRDelim:z,emStrongLDelim:Ve,emStrongRDelimAst:nt,emStrongRDelimUnd:lt,escape:He,link:dt,nolink:bt,punctuation:Xe,reflink:xt,reflinkSearch:wt,tag:ft,text:Fe,url:z},yt={...ne,emStrongLDelim:tt,emStrongRDelimAst:it,emStrongRDelimUnd:ot,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",j).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",j).getRegex()},X={...ne,emStrongRDelimAst:rt,emStrongLDelim:Ye,delLDelim:ct,delRDelim:pt,url:u(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",$t).replace("protocol",ae).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:u(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",ae).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Rt={...X,br:u(me).replace("{2,}","*").getRegex(),text:u(X.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},O={normal:te,gfm:je,pedantic:Ne},q={normal:ne,gfm:X,breaks:Rt,pedantic:yt},Tt={"&":"&","<":"<",">":">",'"':""","'":"'"},oe=n=>Tt[n];function S(n,e){if(e){if(m.escapeTest.test(n))return n.replace(m.escapeReplace,oe)}else if(m.escapeTestNoEncode.test(n))return n.replace(m.escapeReplaceNoEncode,oe);return n}function zt(n){return n.replace(m.numericCharacterReference,(e,t,s)=>{let r=t===void 0?Number.parseInt(s,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":String.fromCodePoint(r)})}function ce(n){try{n=encodeURI(n).replace(m.percentDecode,"%")}catch{return null}return n}function he(n,e){let t=n.replace(m.findPipe,(i,a,l)=>{let c=!1,o=a;for(;--o>=0&&l[o]==="\\";)c=!c;return c?"|":" |"}),s=t.split(m.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(m.slashPipe,"|");return s}function T(n,e,t){let s=n.length;if(s===0)return"";let r=0;for(;r<s;){let i=n.charAt(s-r-1);if(i===e&&!t)r++;else if(i!==e&&t)r++;else break}return n.slice(0,s-r)}function pe(n){let e=n.split(`
|
|
3
|
+
`),t=e.length-1;for(;t>=0&&m.blankLine.test(e[t]);)t--;return e.length-t<=2?n:e.slice(0,t+1).join(`
|
|
4
|
+
`)}function N(n){return n.trim().toLowerCase().toUpperCase().toLowerCase()}function At(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function ue(n,e=0){let t=e,s="";for(let r of n)if(r===" "){let i=4-t%4;s+=" ".repeat(i),t+=i}else s+=r,t++;return s}function ge(n,e,t,s,r){let i=e.href,a=e.title||null,l=n[1].replace(r.other.outputLinkReplace,"$1"),c=n[0].charAt(0)==="!";s.state.inLink=!0;let o=s.state.linkEmitted,h=s.state.inRawBlock;s.state.linkEmitted=!1;let p=s.inlineTokens(l),b=s.state.linkEmitted;if(s.state.linkEmitted=o,s.state.inLink=!1,!c){if(b){s.state.inRawBlock=h;return}s.state.linkEmitted=!0}return{type:c?"image":"link",raw:t,href:i,title:a,text:l,tokens:p}}function _t(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
5
|
+
`).map(i=>{let a=i.match(t.other.beginningSpace);if(a===null)return i;let[l]=a;return i.slice(Math.min(l.length,r.length))}).join(`
|
|
6
|
+
`)}function ke(n,e,t,s){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let l=s.inline.code.exec(e.slice(r));if(l){r+=l[0].length-1;continue}}if(e[r]!=="<")continue;let i=n.slice(t+r),a=s.inline.tag.exec(i)||s.inline.autolink.exec(i);if(a){if(a[0].length>e.length-r)return!0;r+=a[0].length-1}}return!1}var H=class{constructor(n){g(this,"options"),g(this,"rules"),g(this,"lexer"),this.options=n||_}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=this.options.pedantic?e[0]:pe(e[0]),s=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:s}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],s=_t(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=T(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(t=s.trim())}return{type:"heading",raw:T(e[0],`
|
|
7
|
+
`),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:T(e[0],`
|
|
8
|
+
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=T(e[0],`
|
|
9
|
+
`).split(`
|
|
10
|
+
`),s="",r="",i=[];for(;t.length>0;){let a=!1,l=[],c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))l.push(t[c]),a=!0;else if(!a)l.push(t[c]);else break;t=t.slice(c);let o=l.join(`
|
|
11
|
+
`),h=o.replace(this.rules.other.blockquoteSetextReplace,`
|
|
12
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
13
|
+
${o}`:o,r=r?`${r}
|
|
14
|
+
${h}`:h;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,i,!0),this.lexer.state.top=p,t.length===0)break;let b=i.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let x=b,f=t.join(`
|
|
15
|
+
`),w=x.raw+`
|
|
16
|
+
`+f.replace(this.rules.other.blockquoteSetextReplace2,""),d=this.blockquote(w);i[i.length-1]=d;let P=w.substring(d.raw.length).replace(/^\n/,""),I=P?P.split(`
|
|
17
|
+
`).length:0,C=I?t.slice(0,-I):t;C.length>0&&(s=`${s}
|
|
18
|
+
${C.join(`
|
|
19
|
+
`)}`),r=r.substring(0,r.length-x.text.length)+d.text;break}else if(b?.type==="list"){let x=b,f=x.raw+`
|
|
20
|
+
`+t.join(`
|
|
21
|
+
`),w=this.list(f);i[i.length-1]=w,s=s.substring(0,s.length-b.raw.length)+w.raw,r=r.substring(0,r.length-x.raw.length)+w.raw,t=f.substring(i.at(-1).raw.length).split(`
|
|
22
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim(),s=t.length>1,r={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let i=this.rules.other.listItemRegex(t),a=!1;for(;n;){let c=!1,o="",h="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;o=e[0],n=n.substring(o.length);let p=e[2].split(`
|
|
23
|
+
`,1)[0],b=e[1].length,x=this.options.pedantic?ue(p,b):p.replace(this.rules.other.leadingSpaceTab,P=>ue(P,b)),f=n.split(`
|
|
24
|
+
`,1)[0],w=!x.trim(),d=0;if(this.options.pedantic?(d=2,h=x.trimStart()):w?d=b+1:(d=x.search(this.rules.other.nonSpaceChar),d=d>4?1:d,h=x.slice(d),d+=b),w&&this.rules.other.blankLine.test(f)&&(o+=f+`
|
|
25
|
+
`,n=n.substring(f.length+1),c=!0),!c){let P=this.rules.other.nextBulletRegex(d),I=this.rules.other.hrRegex(d),C=this.rules.other.fencesBeginRegex(d),se=this.rules.other.headingBeginRegex(d),Re=this.rules.other.htmlBeginRegex(d),Te=this.rules.other.blockquoteBeginRegex(d);for(;n;){let F=n.split(`
|
|
26
|
+
`,1)[0],B;if(f=F,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),B=f):B=f.replace(this.rules.other.leadingSpaceTab,ze=>ze.replace(this.rules.other.tabCharGlobal," ")),C.test(f)||se.test(f)||Re.test(f)||Te.test(f)||P.test(f)||I.test(f))break;if(B.search(this.rules.other.nonSpaceChar)>=d||!f.trim())h+=`
|
|
27
|
+
`+B.slice(d);else{if(w||x.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(x)||se.test(x)||I.test(x))break;h+=`
|
|
28
|
+
`+f}w=!f.trim(),o+=F+`
|
|
29
|
+
`,n=n.substring(F.length+1),x=B.slice(d)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(o)&&(a=!0)),r.items.push({type:"list_item",raw:o,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),r.raw+=o}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c of r.items)if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),!r.loose){let o=c.tokens.filter(p=>p.type==="space"),h=o.length>0&&o.some(p=>this.rules.other.anyLine.test(p.raw));r.loose=h}for(let c of r.items){let o=c.tokens[0];if(c.task&&(o?.type==="text"||o?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),o.raw=o.raw.replace(this.rules.other.listReplaceTask,""),o.text=o.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(c.raw);if(h){let p={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};c.checked=p.checked,r.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=p.raw+c.tokens[0].raw,c.tokens[0].text=p.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(p)):c.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):c.tokens.unshift(p)}}else c.task&&(c.task=!1)}if(r.loose)for(let c of r.items){c.loose=!0;for(let o of c.tokens)o.type==="text"&&(o.type="paragraph")}return r}}html(n){let e=this.rules.block.html.exec(n);if(e){let t=pe(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=N(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:T(e[0],`
|
|
30
|
+
`),href:s,title:r}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=he(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
31
|
+
`):[],i={type:"table",raw:T(e[0],`
|
|
32
|
+
`),header:[],align:[],rows:[]};if(t.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<t.length;a++)i.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:i.align[a]});for(let a of r)i.rows.push(he(a,i.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[c]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let t=e[1].trim();return{type:"heading",raw:T(e[0],`
|
|
33
|
+
`),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
34
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&ke(n,e[1],t,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let a=T(s.slice(0,-1),"\\");if((s.length-a.length)%2===0)return}else{let a=At(e[2],"()");if(a===-2)return;if(a>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],i=a[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?r=r.slice(1):r=r.slice(1,-1)),ge(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let s=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&ke(n,t[1],s,this.rules))return;let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[N(r)];if(!i){let a=t[0].charAt(0);return{type:"text",raw:a,text:a}}return ge(t,i,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,i,a,l=r,c=0,o=s[0][0],h=t===o,p=o==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*n.length+r);(s=p.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(a=[...i].length,s[3]||s[4]){l+=a;continue}else if(s[5]||s[6]){if(r%3&&!((r+a)%3)){c+=a;continue}if(h)break}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let b=[...s[0]][0].length,x=n.slice(0,r+s.index+b+a);if(Math.min(r,a)%2){let w=x.slice(1,-1);return{type:"em",raw:x,text:w,tokens:this.lexer.inlineTokens(w)}}let f=x.slice(2,-2);return{type:"strong",raw:x,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let s=this.rules.inline.delLDelim.exec(n);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,i,a,l=r,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*n.length+r);(s=c.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(a=[...i].length,a!==r))continue;if(s[3]||s[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let o=[...s[0]][0].length,h=n.slice(0,r+s.index+o+a),p=h.slice(r,-r);return{type:"del",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,autolink:!0,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,autolink:!0,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:t?e[0]:zt(e[0]),escaped:t}}}},$=class U{constructor(e){g(this,"tokens"),g(this,"options"),g(this,"state"),g(this,"inlineQueue"),g(this,"tokenizer"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_,this.options.tokenizer=this.options.tokenizer||new H,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:m,block:O.normal,inline:q.normal};this.options.pedantic?(t.block=O.pedantic,t.inline=q.pedantic):this.options.gfm&&(t.block=O.gfm,this.options.breaks?t.inline=q.breaks:t.inline=q.gfm),this.tokenizer.rules=t}static get rules(){return{block:O,inline:q}}static lex(e,t){return new U(t).lex(e)}static lexInline(e,t){return new U(t).inlineTokens(e)}lex(e){e=e.replace(m.carriageReturn,`
|
|
35
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(m.tabCharGlobal," ").replace(m.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(l=>(i=l.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let l=t.at(-1);i.raw.length===1&&l!==void 0?l.raw+=`
|
|
36
|
+
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let l=t.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
37
|
+
`)?"":`
|
|
38
|
+
`)+i.raw,l.text+=`
|
|
39
|
+
`+i.text,this.inlineQueue.at(-1).src=l.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let l=t.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
40
|
+
`)?"":`
|
|
41
|
+
`)+i.raw,l.text+=`
|
|
42
|
+
`+i.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let l=1/0,c=e.slice(1),o;this.options.extensions.startBlock.forEach(h=>{o=h.call({lexer:this},c),typeof o=="number"&&o>=0&&(l=Math.min(l,o))}),l<1/0&&l>=0&&(a=e.substring(0,l+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let l=t.at(-1);s&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
43
|
+
`)?"":`
|
|
44
|
+
`)+i.raw,l.text+=`
|
|
45
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(i),s=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let l=t.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
46
|
+
`)?"":`
|
|
47
|
+
`)+i.raw,l.text+=`
|
|
48
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=s[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,N(r.slice(i+1,-1))))&&!(i>1&&this.linkInText(r.slice(1,i-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e;if(this.tokens.links&&e.includes("[")){let l=this.tokenizer.rules.inline.reflinkSearch,c=o=>{let h=o.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,N(o.slice(h+1,-1))))return o;if(h>1&&o.charAt(0)!=="!"){let p=o.slice(1,h-1);if(this.linkInText(p))return"["+p.replace(l,c)+"]["+"a".repeat(o.length-h-2)+"]"}return"["+"a".repeat(o.length-2)+"]"};s=s.replace(l,c)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,l=>"+".repeat(l.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(l,c,o)=>{let h=o?o.length:0;return l.slice(0,h)+"["+"a".repeat(l.length-h-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let r=!1,i="",a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let l;if(this.options.extensions?.inline?.some(o=>(l=o.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let o=t.at(-1);l.type==="text"&&o?.type==="text"?(o.raw+=l.raw,o.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,s,i)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e,s,i)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let c=e;if(this.options.extensions?.startInline){let o=1/0,h=e.slice(1),p;this.options.extensions.startInline.forEach(b=>{p=b.call({lexer:this},h),typeof p=="number"&&p>=0&&(o=Math.min(o,p))}),o<1/0&&o>=0&&(c=e.substring(0,o+1))}if(l=this.tokenizer.inlineText(c)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(i=l.raw.slice(-1)),r=!0;let o=t.at(-1);o?.type==="text"?(o.raw+=l.raw,o.text+=l.text):t.push(l);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},G=class{constructor(n){g(this,"options"),g(this,"parser"),this.options=n||_}space(n){return""}code({text:n,lang:e,escaped:t}){let s=(e||"").match(m.notSpaceStart)?.[0],r=n?n.replace(m.endingNewline,"")+`
|
|
49
|
+
`:"";return s?'<pre><code class="language-'+S(s)+'">'+(t?r:S(r,!0))+`</code></pre>
|
|
50
|
+
`:"<pre><code>"+(t?r:S(r,!0))+`</code></pre>
|
|
51
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
52
|
+
${this.parser.parse(n)}</blockquote>
|
|
53
|
+
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
54
|
+
`}hr(n){return`<hr>
|
|
55
|
+
`}list(n){let e=n.ordered,t=n.start,s="";for(let a=0;a<n.items.length;a++){let l=n.items[a];s+=this.listitem(l)}let r=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+r+i+`>
|
|
56
|
+
`+s+"</"+r+`>
|
|
57
|
+
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
58
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
59
|
+
`}table(n){let e="",t="";for(let r=0;r<n.header.length;r++)t+=this.tablecell(n.header[r]);e+=this.tablerow({text:t});let s="";for(let r=0;r<n.rows.length;r++){let i=n.rows[r];t="";for(let a=0;a<i.length;a++)t+=this.tablecell(i[a]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
60
|
+
<thead>
|
|
61
|
+
`+e+`</thead>
|
|
62
|
+
`+s+`</table>
|
|
63
|
+
`}tablerow({text:n}){return`<tr>
|
|
64
|
+
${n}</tr>
|
|
65
|
+
`}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
|
66
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${S(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,text:t,tokens:s,autolink:r}){let i=r?S(t,!0):this.parser.parseInline(s),a=ce(n);if(a===null)return i;n=S(a,r);let l='<a href="'+n+'"';return e&&(l+=' title="'+S(e)+'"'),l+=">"+i+"</a>",l}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let r=ce(n);if(r===null)return S(t);n=r;let i=`<img src="${S(n)}" alt="${S(t)}"`;return e&&(i+=` title="${S(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:S(n.text)}},re=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},y=class W{constructor(e){g(this,"options"),g(this,"renderer"),g(this,"textRenderer"),this.options=e||_,this.options.renderer=this.options.renderer||new G,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new re}static parse(e,t){return new W(t).parse(e)}static parseInline(e,t){return new W(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let a=r,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(a.type)){t+=l||"";continue}}let i=r;switch(i.type){case"space":{t+=this.renderer.space(i);break}case"hr":{t+=this.renderer.hr(i);break}case"heading":{t+=this.renderer.heading(i);break}case"code":{t+=this.renderer.code(i);break}case"table":{t+=this.renderer.table(i);break}case"blockquote":{t+=this.renderer.blockquote(i);break}case"list":{t+=this.renderer.list(i);break}case"checkbox":{t+=this.renderer.checkbox(i);break}case"html":{t+=this.renderer.html(i);break}case"def":{t+=this.renderer.def(i);break}case"paragraph":{t+=this.renderer.paragraph(i);break}case"text":{t+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}let a=i;switch(a.type){case"escape":{s+=t.text(a);break}case"html":{s+=t.html(a);break}case"link":{s+=t.link(a);break}case"image":{s+=t.image(a);break}case"checkbox":{s+=t.checkbox(a);break}case"strong":{s+=t.strong(a);break}case"em":{s+=t.em(a);break}case"codespan":{s+=t.codespan(a);break}case"br":{s+=t.br(a);break}case"del":{s+=t.del(a);break}case"text":{s+=t.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},M,v=(M=class{constructor(n){g(this,"options"),g(this,"block"),this.options=n||_}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?$.lex:$.lexInline}provideParser(n=this.block){return n?y.parse:y.parseInline}},g(M,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),g(M,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),M),Pt=class{constructor(...n){g(this,"defaults",J()),g(this,"options",this.setOptions),g(this,"parse",this.parseMarkdown(!0)),g(this,"parseInline",this.parseMarkdown(!1)),g(this,"Parser",y),g(this,"Renderer",G),g(this,"TextRenderer",re),g(this,"Lexer",$),g(this,"Tokenizer",H),g(this,"Hooks",v),this.use(...n)}walkTokens(n,e){let t=[];for(let s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let i of r.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let a of i)t=t.concat(this.walkTokens(a.tokens,e));break}case"list":{let r=s;t=t.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let a=r[i].flat(1/0);t=t.concat(this.walkTokens(a,e))}):r.tokens&&(t=t.concat(this.walkTokens(r.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),t.renderer){let r=this.defaults.renderer||new G(this.defaults);for(let i in t.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,l=t.renderer[a],c=r[a];r[a]=(...o)=>{let h=l.apply(r,o);return h===!1&&(h=c.apply(r,o)),h||""}}s.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new H(this.defaults);for(let i in t.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,l=t.tokenizer[a],c=r[a];r[a]=(...o)=>{let h=l.apply(r,o);return h===!1&&(h=c.apply(r,o)),h}}s.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new v;for(let i in t.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,l=t.hooks[a],c=r[a];v.passThroughHooks.has(i)?r[a]=o=>{if(this.defaults.async&&v.passThroughHooksRespectAsync.has(i))return(async()=>{let p=await l.call(r,o);return c.call(r,p)})();let h=l.call(r,o);return c.call(r,h)}:r[a]=(...o)=>{if(this.defaults.async)return(async()=>{let p=await l.apply(r,o);return p===!1&&(p=await c.apply(r,o)),p})();let h=l.apply(r,o);return h===!1&&(h=c.apply(r,o)),h}}s.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return $.lex(n,e??this.defaults)}parser(n,e){return y.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let s={...t},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=n),r.async)return(async()=>{let a=r.hooks?await r.hooks.preprocess(e):e,l=await(r.hooks?await r.hooks.provideLexer(n):n?$.lex:$.lexInline)(a,r),c=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(c,r.walkTokens));let o=await(r.hooks?await r.hooks.provideParser(n):n?y.parse:y.parseInline)(c,r);return r.hooks?await r.hooks.postprocess(o):o})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let a=(r.hooks?r.hooks.provideLexer(n):n?$.lex:$.lexInline)(e,r);r.hooks&&(a=r.hooks.processAllTokens(a)),r.walkTokens&&this.walkTokens(a,r.walkTokens);let l=(r.hooks?r.hooks.provideParser(n):n?y.parse:y.parseInline)(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return i(a)}}}onError(n,e){return t=>{if(t.message+=`
|
|
67
|
+
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+S(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},A=new Pt;function k(n,e){return A.parse(n,e)}k.options=k.setOptions=function(n){return A.setOptions(n),k.defaults=A.defaults,fe(k.defaults),k};k.getDefaults=J;k.defaults=_;function Lt(...n){return A.use(...n),k.defaults=A.defaults,fe(k.defaults),k}k.use=Lt;k.walkTokens=function(n,e){return A.walkTokens(n,e)};k.parseInline=A.parseInline;k.Parser=y;k.parser=y.parse;k.Renderer=G;k.TextRenderer=re;k.Lexer=$;k.lexer=$.lex;k.Tokenizer=H;k.Hooks=v;k.parse=k;var Et=k.options,It=k.setOptions,Ct=k.walkTokens,Bt=k.parseInline,qt=y.parse,vt=$.lex;export{Pt as Marked};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./c-JAX2667S.js";import"./c-VHNSBD2M.js";var a=[{match:e=>e.hasAttribute("data-rules-name"),identity:e=>{let t=(e.getAttribute("data-rules-name")||"").split(/\s+/).filter(Boolean).sort().join(" ");return t?"rules:"+(e.getAttribute("data-rules-version")||"")+":"+t:null},parse:r.parseRulesRelaxed}],n=a;export{n as default,a as mergeTagRecognizers};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C,c as p,d as E,e as c,f as w}from"./c-WRBKEJD4.js";var S=/:(?:focus(?:-within|-visible)?|hover|active|visited|defined)\b/i;function P(e,t){if(!/^(INPUT|TEXTAREA|SELECT|OPTION)$/.test(e.tagName||""))return;let i=(e.getAttribute?.("type")||"").toLowerCase();"value"in e&&"value"in t&&e.tagName!=="OPTION"&&i!=="checkbox"&&i!=="radio"&&i!=="file"&&(t.value=e.value),e.tagName==="INPUT"&&(i==="checkbox"||i==="radio")&&(t.checked=e.checked),e.tagName==="OPTION"&&(t.selected=e.selected),"indeterminate"in e&&"indeterminate"in t&&(t.indeterminate=e.indeterminate)}function g(e,t,i,o){if(o)return!!e.closest?.(t);let r=e;for(;r?.nodeType===1;){if(r.matches(t))return!0;if(r===i)break;r=r.parentElement}return!1}function N(e,t,i,o,r,s){return(s?w(e,t):g(e,i,r,!1))||!!(o&&(s&&e!==r?e.matches(o):g(e,o,r,s)))}function A(e,t){let i=C[t];return i.tokens.some(o=>E(e,o))||i.bundles.some(o=>p(e,o))}var I=new Set(["INPUT","TEXTAREA","SELECT","OPTION"]);function v(e,t,i,o){if(e.nodeType===1&&o(e)){i.dropped.push(t);return}i.cloneToLive.set(t,e),i.liveToClone.set(e,t);let r=e,s=t;if(e.nodeType===1){if(I.has(e.tagName)&&i.controls.push(e,t),e.tagName==="TEMPLATE"){for(;t.firstChild;)t.removeChild(t.firstChild);r=e.content,s=t.content,i.cloneToLive.set(s,r),i.liveToClone.set(r,s)}}else if(e.nodeType!==11)return;let a=s.firstChild;for(let T=r.firstChild;T&&a;T=T.nextSibling)v(T,a,i,o),a=a.nextSibling}function M(e,{capability:t="data",exclude:i=null,inherit:o=!0,provenance:r=null}={}){if(!e)throw new TypeError("createContentView requires a DOM context");let s=e.nodeType===9?e:e.ownerDocument;if(!s?.implementation?.createHTMLDocument)throw new TypeError("createContentView requires an HTML DOM implementation");let a=s.implementation.createHTMLDocument(""),T=r||new WeakMap,d=new WeakMap,m=e.nodeType===9?e.documentElement:e;i&&a.documentElement.matches(i);let h=c(t),O=o?n=>A(n,t)||!!(i&&n.matches(i)):n=>N(n,t,h,i,m,!1),l=null;if(m.nodeType!==1||!N(m,t,h,i,m,o)){l=a.importNode(m,!0);let n={cloneToLive:T,liveToClone:d,dropped:[],controls:[]};v(m,l,n,O);for(let f of n.dropped)f.remove();for(let f=0;f<n.controls.length;f+=2)P(n.controls[f],n.controls[f+1])}e.nodeType===9&&l&&(a.replaceChild(l,a.documentElement),d.set(e,a),T.set(a,e));let L=n=>{if(S.test(n))throw new Error(`Filtered content queries do not support stateful selector: ${n}`)};return{root:l,document:a,capability:t,selector:c(t),cloneToLive:T,liveToClone:d,original(n){return T.get(n)||null},cloneOf(n){return d.get(n)||null},query(n,f=l){return L(n),Array.from(f.querySelectorAll(n),u=>T.get(u)||u)},text(n=l){return(n===l?l:d.get(n))?.textContent||""},html(n=l){return(n===l?l:d.get(n))?.innerHTML??""},clone(n=l){let f=n===l?l:d.get(n);return f?a.importNode(f,!0):null}}}function D(e,t){return M(e,t).root}export{M as a,D as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as A,e as I}from"./c-VRZN56XY.js";import{e as b,i as T}from"./c-OW5QIGG3.js";import{c as M}from"./c-BPF2NSPV.js";var B=15e3,P=12e4,K=15e3,V=4e3,W=5e3,U=50,y=new Set(["sent","acked"]),R=new Set(["done","error","cancelled"]),j="wire",i=new Map,k=new Set,f=null,g=null,D=0,h=null;function Q(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`page-${Date.now()}-${Math.random().toString(16).slice(2)}`}function H(e){return new URL(e,window.location.origin).href}function N(){let e=M();return typeof e=="string"&&e!==""?e:null}function w(e){return{id:e.id,type:e.type,state:e.state,helper:e.helper,text:e.text,result:e.result,error:e.error,errorCode:e.errorCode,errorDetails:e.errorDetails,errorSource:e.errorSource,startedAt:e.startedAt}}function m(e,t){let n=w(e);for(let r of k)try{r(n,t||null)}catch(s){console.error("clay.wire: a listener threw",s)}document.dispatchEvent(new CustomEvent("clay:wire-state",{detail:n}))}function Y(e,t){e.state!==t&&(e.state=t,m(e))}function v(e,t,n,{cancelFirst:r=!1,errorCode:s=null}={}){clearTimeout(e.timer),e.timer=setTimeout(()=>{e.timer=null,r&&z(e),l(e,"error",n,{errorCode:s,errorSource:"client"})},t)}function q(e){clearTimeout(e.timer),e.timer=null}function Z(){if(!(i.size<=U))for(let[e,t]of i){if(i.size<=U)break;!y.has(t.state)&&t.state!=="landing"&&i.delete(e)}}function ee(){if(g)return g;let e=N(),t=`/_/wire/subscribe?page-url=${encodeURIComponent(window.location.href)}`+(e?`&token=${encodeURIComponent(e)}`:"");return f=new EventSource(H(t)),f.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{return}te(r)},f.onerror=()=>{},g=new Promise(n=>{let r=!1,s=()=>{r||(r=!0,n())};f.onopen=s,setTimeout(s,2e3)}),g}function L(){for(let e of i.values())if(y.has(e.state))return;f&&(f.close(),f=null,g=null)}function te(e){if(!e||typeof e.id!="string")return;let t=i.get(e.id);if(!(!t||!y.has(t.state)))switch(e.type){case"wire/ack":e.payload?.mode==="jsonl"&&Number.isFinite(e.payload.budgetMs)&&e.payload.budgetMs>0?(t.structured=!0,v(t,e.payload.budgetMs+K,"the helper did not finish within its execution budget",{cancelFirst:!0,errorCode:"helper_timeout"})):v(t,P,"the agent stopped responding"),Y(t,"acked");break;case"wire/status":t.structured||v(t,P,"the agent stopped responding"),t.text=typeof e.text=="string"?e.text:"",t.state="acked",ne(t,e),m(t,e);break;case"wire/done":t.result=Object.prototype.hasOwnProperty.call(e,"payload")?e.payload:null,t.document==="edit"?ae(t):l(t,"done",null);break;case"wire/error":re(t,e);break;default:break}}function ne(e,t){if(!e.onStatus||typeof t.text!="string")return;let n={text:t.text};t.payload&&typeof t.payload=="object"&&Object.prototype.hasOwnProperty.call(t.payload,"progress")&&(n.progress=t.payload.progress);try{e.onStatus(n)}catch(r){console.error("clay.wire: an onStatus listener threw",r)}}function re(e,t){let n=t.payload,r=n&&typeof n=="object"&&!Array.isArray(n)&&(n.source==="application"||n.source==="host")&&typeof n.code=="string"&&n.code,s=typeof t.text=="string"&&t.text?t.text:"the handler reported an error";if(!r){l(e,"error",s);return}let a=n.source==="host"&&n.code==="helper_cancelled"?"cancelled":"error";l(e,a,s,{errorCode:n.code,errorDetails:Object.prototype.hasOwnProperty.call(n,"details")?n.details:null,errorSource:n.source})}function oe(){h||(h=e=>{if(e.detail?.source!=="peer"){for(let t of i.values())if(t.state==="landing"){l(t,"done",null);return}}},document.addEventListener("clay:sync-applied",h))}function se(){D>0||!h||(document.removeEventListener("clay:sync-applied",h),h=null)}function ae(e){R.has(e.state)||e.state==="landing"||(q(e),e.state="landing",D++,oe(),e.landingTimer=setTimeout(()=>{l(e,"done",null)},V),m(e),L())}function l(e,t,n,r={}){if(R.has(e.state))return;let s=e.state==="landing";if(q(e),clearTimeout(e.landingTimer),e.landingTimer=null,e.abort?.abort(),s&&(D--,se()),e.error=n,Object.prototype.hasOwnProperty.call(r,"errorCode")&&(e.errorCode=r.errorCode),Object.prototype.hasOwnProperty.call(r,"errorDetails")&&(e.errorDetails=r.errorDetails),Object.prototype.hasOwnProperty.call(r,"errorSource")&&(e.errorSource=r.errorSource),e.state=t,e.signal&&e.signalHandler&&(e.signal.removeEventListener("abort",e.signalHandler),e.signalHandler=null),ue(e),m(e),L(),Z(),e.settle){let a=e.settle;e.settle=null,a(w(e))}}var C=0,$=null,E=null;function ie(){return E||(E=import("./core/save-HQZ4S667.js")),E}async function le(e){if(!b||e.holdsSave)return;let t=await ie();e.state==="sent"&&($=t,e.holdsSave=!0,!(C++>0)&&t.suspendAutosave())}function ue(e){e.holdsSave&&(e.holdsSave=!1,!(--C>0)&&(C=0,$?.resumeAutosave()))}var c=null,de=()=>!c||c.admitted,ce=(e,t,n)=>Object.assign(new Error(`clay.wire: ${e}`),{code:t,pending:n});function O(e){return e.document!=="edit"||e.generation===T().generation&&de()?!0:(l(e,"error","the page changed mode before this request went out",{errorCode:"stale-document",errorSource:"client"}),!1)}function _e(){return{id:"clay:wire",order:900,prepare(e={}){let t={admitted:e.initial===!0};return c=t,{enable(){c===t&&(t.admitted=!0)},quiesce(){if(c!==t)return;t.admitted=!1;let n=[...i.values()].filter(r=>r.document==="edit"&&(r.holdsSave||y.has(r.state))).map(r=>r.id);if(n.length)throw ce("a request on this page has not settled","pending-input",n)},resume(){c===t&&(t.admitted=!0)},dispose(){c===t&&(c=null)}}}}}function fe(e,t){return new Promise(n=>{let r=!1,s=()=>{r||(r=!0,document.removeEventListener(e,s),n())};document.addEventListener(e,s),setTimeout(s,t)})}async function pe(){if(!b)return;let e=window.clay;if(!e||typeof e.save!="function")return;let{isSaveInProgress:t}=await import("./core/save-core-KGQWFUNH.js"),{savesHeld:n,saveHoldReason:r}=await import("./core/save-HQZ4S667.js");if(n())throw new Error(r());let s=Date.now()+W;for(let a=0;a<3;a++){t()&&await fe("clay:save-saved",Math.max(0,s-Date.now()));let u=await e.save();if(u?.ok||u?.msgType==="skipped"&&!t())return;if(u?.msgType==="error"||u?.msgType==="unknown")throw new Error(`could not save this page first: ${u.msg||u.msgType}`);if(Date.now()>=s)break}throw new Error("could not save this page before sending")}async function F(e,t){let n={"Content-Type":"application/json","Page-URL":window.location.href},r=N();r&&(n["Save-Token"]=r);let s=await fetch(H("/_/wire/send"),{method:"POST",headers:n,body:JSON.stringify(e),signal:t}),a=null;try{a=await s.json()}catch{a=null}return{ok:s.ok,status:s.status,reply:a}}function he(e,t={}){let n=typeof t.id=="string"&&t.id?t.id:Q(),r=typeof t.type=="string"&&t.type?t.type:"wire/request",s=Object.prototype.hasOwnProperty.call(t,"helper"),a=s&&typeof t.helper=="string"&&t.helper?t.helper:null,u=t.document===void 0?a?"none":"edit":t.document;if(s&&!a)return _(n,r,null,"helper must be a nonempty string","invalid_helper");if(u!=="edit"&&u!=="none")return _(n,r,a,'document must be "edit" or "none"',"invalid_document");if(i.has(n))return _(n,r,a,"a request with this id is already on the wire","duplicate_request");let o={id:n,type:r,state:"sent",helper:a,document:u,structured:!1,onStatus:typeof t.onStatus=="function"?t.onStatus:null,text:"",result:null,error:null,errorCode:null,errorDetails:null,errorSource:null,startedAt:Date.now(),timer:null,landingTimer:null,abort:typeof AbortController=="function"?new AbortController:null,holdsSave:!1,generation:T().generation,settle:null,signal:t.signal&&typeof t.signal.addEventListener=="function"?t.signal:null,signalHandler:null};return o.done=new Promise(d=>{o.settle=d}),i.set(n,o),m(o),o.signal&&(o.signalHandler=()=>x(n),o.signal.addEventListener("abort",o.signalHandler,{once:!0}),o.signal.aborted&&o.signalHandler()),(async()=>{if(o.state!=="sent")return;if(o.helper){let X=await I(j);if(o.state!=="sent")return;if(!X){l(o,"error","this host does not support named wire helpers",{errorCode:"helper_protocol_unsupported",errorSource:"client"});return}}if(!O(o)||o.document==="edit"&&(await le(o),o.state!=="sent"||!O(o)||(await pe(),o.state!=="sent")||!O(o)))return;if(await ee(),o.state!=="sent"){L();return}v(o,B,"the agent never answered",o.helper?{cancelFirst:!0,errorCode:"ack_timeout"}:void 0);let d={type:o.type,id:o.id,text:t.text,payload:e};o.helper&&(d.helper=o.helper),(o.helper||t.document!==void 0)&&(d.document=o.document);let{ok:G,status:J,reply:S}=await F(d,o.abort?.signal);if(o.state!=="sent")return;if(!G){l(o,"error",`the wire refused this request (${J})`);return}let p=S&&S.refused;if(p&&typeof p.code=="string"&&p.code){l(o,"error",p.message||"the handler refused this request",{errorCode:p.code,errorSource:p.source==="application"?"application":"host",errorDetails:null});return}(!S||S.delivered===0)&&l(o,"error","no agent is attached to this file")})().catch(d=>{l(o,"error",d&&d.message?d.message:String(d))}),{id:n,get state(){return o.state},done:o.done,cancel:()=>x(n)}}function _(e,t,n,r,s){let a={id:e,type:t,state:"error",helper:n,text:"",result:null,error:r,errorCode:s,errorDetails:null,errorSource:"client",startedAt:Date.now()};return{id:e,get state(){return a.state},done:Promise.resolve(w(a)),cancel:()=>!1}}function x(e){let t=i.get(e);return!t||!y.has(t.state)?!1:(z(t),l(t,"cancelled",null),!0)}function z(e){F({type:"wire/cancel",id:e.id}).catch(()=>{})}function ye(e){let t=i.get(e);return t?w(t):void 0}function ge(){return[...i.values()].map(w)}function we(){for(let e of i.values())if(y.has(e.state))return!0;return!1}function me(e){return typeof e!="function"?()=>{}:(k.add(e),()=>k.delete(e))}async function Se(){let e=await A({fresh:!0});if(!e.extensions.includes(j))return[];let t=e.document?.helpers;return Array.isArray(t)?t.filter(n=>n&&typeof n.name=="string"&&["ready","denied","unavailable"].includes(n.state)).map(({name:n,state:r})=>({name:n,state:r})):[]}var ve={send:he,cancel:x,get:ye,list:ge,isBusy:we,on:me,helpers:Se},ke=ve;export{_e as a,ve as b,ke as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"./c-VAK7SG37.js";import"./c-VHNSBD2M.js";export{c as FONT_MONO,b as FONT_SANS,f as GLYPHS,h as MEDIA,g as RULES,d as SHADOW,a as SOURCE_SHA256,e as TOKENS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as b,g as h,j as p,l as E,n as m}from"./c-OIBUTDXI.js";import{a as w}from"./c-4JZDZFF6.js";import{e as s,f as d,g as x}from"./c-VAK7SG37.js";import{b as o}from"./c-NUHP2XDB.js";var g={success:{edge:s.teal,icon:d.toastSuccess},error:{edge:s.ox,icon:d.toastWarning},warning:{edge:s.brass,icon:d.toastWarning},info:{edge:s.brass,icon:d.toastInfo}},$=d.toastClose,M=["opacity:0","transform:translateX(24px)"];function P(){return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches?"none":"opacity .5s ease-in-out, transform .5s ease-in-out"}function A(){let e=document.querySelector("[data-clay-toasts]");if(e)return e;let t=p("div",["position:fixed","top:18px","right:18px","z-index:9999","display:flex","flex-direction:column","align-items:flex-end","gap:10px","width:min(330px, calc(100vw - 36px))","pointer-events:none"]);return t.setAttribute("data-clay-toasts",""),t.setAttribute("aria-live","polite"),document.body.append(t),t}function L(e,t,{detail:n="",actions:r=[]}={}){let c=g[t],i=E("div",["display:flex","align-items:flex-start",...x.toast,"width:100%",`border-inline-start:3px solid ${c.edge}`,"cursor:pointer","pointer-events:auto",`color-scheme:${w()}`,...M,`transition:${P()}`]);i.setAttribute("data-clay-toast",t);let l=p("div",["flex:1 1 auto","min-width:0","display:flex","flex-direction:column","gap:8px"]),f=p("div",["display:flex","align-items:flex-start","gap:8px"]),v=m("span",["display:inline-grid","flex:none","padding-top:1px",`color:${c.edge}`]);v.innerHTML=c.icon,b(v.firstElementChild,16);let k=m("span",["flex:1 1 auto","min-width:120px",...x.toastTitle,"overflow-wrap:anywhere"],e);if(f.append(v,k),l.append(f),n&&l.append(m("span",["display:block",`color:${s.muted}`,"overflow-wrap:anywhere"],n)),r.length){let y=p("div",["display:flex","flex-wrap:wrap","gap:8px"]);for(let{label:T,onClick:C}of r)y.append(h(T,{small:!0,variant:"quiet",onClick:C}));l.append(y)}return i.append(l),i}function D(e){let t=p("button",["flex:none","display:inline-grid","place-items:center",...x.toastClose,"cursor:pointer"]);t.type="button",t.setAttribute("aria-label","Dismiss"),t.title="Dismiss",t.innerHTML=$,b(t.firstElementChild,14);let n=r=>{o(t,"color",r?s.ink:s.muted),o(t,"background",r?s.sunk:"transparent")};return t.addEventListener("pointerenter",()=>n(!0)),t.addEventListener("pointerleave",()=>n(!1)),t.addEventListener("focus",()=>{n(!0),o(t,"outline",`2px solid ${s.brass}`),o(t,"outline-offset","1px")}),t.addEventListener("blur",()=>{n(!1),o(t,"outline","none")}),t.addEventListener("click",e),t}function S(e){A().append(e),setTimeout(()=>{o(e,"opacity","1"),o(e,"transform","none")},10)}function u(e,t){o(e,"opacity","0"),o(e,"transform","translateX(24px)"),setTimeout(()=>{e.remove(),t?.()},500)}function H(e,t="success"){let n=L(e,g[t]?t:"success");n.addEventListener("click",()=>u(n)),S(n),setTimeout(()=>u(n),6600)}var a=new Map;function B(e,t="warning",{detail:n="",actions:r=[]}={}){let c=a.get(e);c&&(u(c),a.delete(e));let i=L(e,g[t]?t:"warning",{detail:n,actions:r});o(i,"cursor","default");let l=D(f=>{f.stopPropagation(),u(i,()=>{a.get(e)===i&&a.delete(e)})});i.append(l),a.set(e,i),S(i)}function q(e){let t=a.get(e);t&&(a.delete(e),u(t))}var W=H;export{B as a,q as b,W as c};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as ie}from"./c-S7H2DRCB.js";import{g as ke}from"./c-LWLBHLVC.js";import"./c-SDAXDM2D.js";import"./c-TQEMVJCS.js";import{a as xe}from"./c-DCXOXBF3.js";import"./c-VRZN56XY.js";import"./c-IJUK2GPW.js";import"./c-OW5QIGG3.js";import"./c-BPF2NSPV.js";import"./c-P7KNDG34.js";import"./c-CYWLPPUS.js";import"./c-N7JPUPGC.js";import{b as Y,c as we,d as ve,l as se,o as Te}from"./c-SPIORRYS.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 ue=new Set(["script","style","xmp","iframe","noembed","noframes","plaintext","noscript"]),Me=new Set(["textarea","title"]),Se=e=>ue.has(e)?"raw":Me.has(e)?"rcdata":"normal",ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Le="http://www.w3.org/1999/xhtml",ct=e=>e.replace(/&/g,"&").replace(/ /g," ").replace(/</g,"<").replace(/>/g,">"),Ne=e=>e.replace(/&/g,"&").replace(/ /g," ").replace(/"/g,""");function ne(e){let t=new Map,n=ie(e,{sourceCodeLocationInfo:!0,onParseError:r=>t.set(r.code,(t.get(r.code)||0)+1)});return je(e,n,t)}function je(e,t,n){let r=t.childNodes.find(l=>l.nodeName==="html"),s=t.childNodes.filter(l=>l!==r).map(l=>l.nodeName==="#documentType"?{kind:"doctype",name:l.name||"",publicId:l.publicId||"",systemId:l.systemId||""}:{kind:l.nodeName==="#comment"?"comment":l.nodeName,value:l.data}),o=r?Fe(r,null,e):null;return o&&Pe(o,e),{src:e,doc:t,outside:s,root:o,parseErrors:n,relocated:o?le(o):null,movedIn:o?le(o,"movedIn"):null,tailOwner:o?De(o):null}}function Fe(e,t,n){let r=e.sourceCodeLocation||null,s=e.nodeName==="#text"?"text":e.nodeName==="#comment"?"comment":"element",o={node:e,parent:t,live:null,kind:s,children:[],from:r?r.startOffset:-1,to:r?r.endOffset:-1};if(s==="text")return o.value=e.value,o;if(s==="comment")return o.value=e.data,o;o.tag=e.tagName,o.located=!!(r&&r.startTag),o.openFrom=o.located?r.startTag.startOffset:-1,o.openTo=o.located?r.startTag.endOffset:-1,o.closeFrom=r&&r.endTag?r.endTag.startOffset:o.located?o.to:-1,o.closeTo=r&&r.endTag?r.endTag.endOffset:o.located?o.to:-1,o.endTagged=!!(r&&r.endTag),o.located&&(o.to<o.openTo&&(o.to=o.openTo),o.closeFrom<o.openTo&&(o.closeFrom=o.closeTo=o.openTo)),o.attrs=[];let l=o.located&&r.startTag.attrs||r&&r.attrs||{};for(let a of e.attrs){let m=a.prefix?a.prefix+":"+a.name:a.name,p=l[m.toLowerCase()];o.attrs.push({name:m,key:m.toLowerCase(),value:a.value,from:p?p.startOffset:-1,to:p?p.endOffset:-1})}let g=e.nodeName==="template"&&e.content?e.content.childNodes:e.childNodes;for(let a of g)a.nodeName!=="#documentType"&&o.children.push(Fe(a,o,n));if(!o.located){let a=o.children.filter(h=>h.from>=0),m=a.length?Math.min(...a.map(h=>h.from)):-1,p=a.length?Math.max(...a.map(h=>h.to)):-1;o.openFrom=o.openTo=m,o.closeFrom=o.closeTo=p,o.from=m,o.to=p}return o}function Pe(e,t,n=1/0){if(e.kind!=="element")return;for(let o of e.children){if(o.from>=n&&!(o.kind==="text"&&!/\S/.test(o.value))&&(e.movedIn=!0),o.from>=0&&e.located){let l=Math.max(e.openTo,Math.min(o.to,e.closeFrom)),g=Math.min(Math.max(o.from,e.openTo),l);if(g!==o.from||l!==o.to){if(o.kind==="text"&&!ue.has(e.tag)&&!Me.has(e.tag)){let a=t.slice(l,o.to).replace(/<!--[\s\S]*?-->|<[^>]*>/g,"").replace(/\r\n?/g,`
|
|
2
|
+
`);a&&!/\S/.test(a)&&o.value.endsWith(a)&&(o.outsideTail=a)}o.clamped=!0,o.from=g,o.to=l}}o.kind==="element"&&o.located&&!o.endTagged&&o.closeFrom>o.to&&(o.closeFrom=o.closeTo=o.to)}let r=e.located?e.openTo:-1;for(let o of e.children)if(!(o.from<0)){if(o.from<r){e.outOfOrder=!0;break}r=o.to}let s=e.located&&e.endTagged?Math.min(n,e.closeTo):n;for(let o of e.children)Pe(o,t,s)}function le(e,t="outOfOrder"){if(e[t])return e.tag;for(let n of e.children){if(n.kind!=="element")continue;let r=le(n,t);if(r)return r}return null}function De(e){if(e.outsideTail)return e;for(let t of e.children||[]){let n=De(t);if(n)return n}return null}function G(e,t){if(!e.root)return"source has no <html> element";if(e.root.openFrom<0)return"source has no content inside <html>";if(e.relocated)return"the parser moved content out of <"+e.relocated+">, so source order and tree order disagree";if(e.movedIn)return"the parser moved content written after the end of <"+e.movedIn+"> back inside it, so source order and tree order disagree";let n=ft(t),r=e.outside.map(ut);if(n.length!==r.length)return"outside <html>: "+JSON.stringify(r)+" vs live "+JSON.stringify(n);for(let s=0;s<n.length;s++)if(n[s]!==r[s])return"outside <html>: "+r[s]+" vs live "+n[s];return null}function ut(e){return e.kind==="doctype"?"doctype:"+e.name+"|"+e.publicId+"|"+e.systemId:e.kind+":"+e.value}function ft(e){let t=[];for(let n of e.childNodes)n.nodeType===10?t.push("doctype:"+n.name+"|"+n.publicId+"|"+n.systemId):n.nodeType===8?t.push("comment:"+n.data):n.nodeType!==1&&t.push("#"+n.nodeType+":"+(n.data||""));return t}var re="\0",Be={align:0,hashKey:0};function Oe(e,t){for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e>>>0}function ee(e){Be.hashKey++;let t=2166136261,n=5381;for(let r of e)t=Oe(t,r),n=(Math.imul(n,33)^Oe(t^2654435769,r))>>>0;return t.toString(36)+"."+n.toString(36)}function X(e){let t=e.nodeType===1&&e.tagName==="TEMPLATE"&&e.content?e.content.childNodes:e.childNodes,n=[];for(let r of t)(r.nodeType===1||r.nodeType===3||r.nodeType===8)&&n.push(r);return n}var Ue=e=>Array.from(e.attributes,t=>t.name.toLowerCase()+"="+t.value).sort().join(re),Je=e=>e.attrs.map(t=>t.key+"="+t.value).sort().join(re);function fe(e,t){let n;if(e.nodeType===3)n={tag:"#text",shallow:"t:"+e.data,content:"t:"+e.data,deep:"t:"+e.data};else if(e.nodeType===8)n={tag:"#comment",shallow:"c:"+e.data,content:"c:"+e.data,deep:"c:"+e.data};else{let r=X(e).map(o=>fe(o,t)),s="e:"+e.localName+"|"+Ue(e);n={tag:e.localName,shallow:s,content:"e:"+e.localName+"|"+ee(r.map(o=>o.content)),deep:s+"|"+ee(r.map(o=>o.deep))}}return t.set(e,n),n}function _e(e){if(e.kind==="text")return e.keys={tag:"#text",shallow:"t:"+e.value,content:"t:"+e.value,deep:"t:"+e.value};if(e.kind==="comment")return e.keys={tag:"#comment",shallow:"c:"+e.value,content:"c:"+e.value,deep:"c:"+e.value};let t=e.children.map(_e),n="e:"+e.tag+"|"+Je(e);return e.keys={tag:e.tag,shallow:n,content:"e:"+e.tag+"|"+ee(t.map(r=>r.content)),deep:n+"|"+ee(t.map(r=>r.deep))}}var Ee=["deep","content","shallow","tag"],dt=4096;function pt(e,t){Be.align++;let n=[],r=e.map((h,w)=>w),s=t.map((h,w)=>w);m(r,s,0);let o=new Set(n.map(h=>h[0])),l=new Set(n.map(h=>h[1])),g=r.filter(h=>!o.has(h)),a=s.filter(h=>!l.has(h));return g.length&&a.length&&m(g,a,0),n.sort((h,w)=>h[0]-w[0]),n;function m(h,w,k){let f=0,y=h.length,v=0,S=w.length;if(f>=y||v>=S)return;if(k>=Ee.length)return p(h,w);let L=Ee[k];for(;f<y&&v<S&&e[h[f]][L]===t[w[v]][L];)n.push([h[f],w[v]]),f++,v++;for(;f<y&&v<S&&e[h[y-1]][L]===t[w[S-1]][L];)y--,S--,n.push([h[y],w[S]]);if(f>=y||v>=S)return;let F=new Map,$=new Map;for(let I=f;I<y;I++){let b=e[h[I]][L];F.set(b,F.has(b)?-1:I)}for(let I=v;I<S;I++){let b=t[w[I]][L];$.set(b,$.has(b)?-1:I)}let K=[];for(let I=f;I<y;I++){let b=e[h[I]][L];if(F.get(b)===I){let P=$.get(b);P!==void 0&&P>=0&&K.push([I,P])}}let q=mt(K);if(!q.length){if((y-f)*(S-v)<=dt){let I=ht(e,t,h,w,f,y,v,S,L);if(I.length){let b=f,P=v;for(let[z,V]of I)n.push([h[z],w[V]]),m(h.slice(b,z),w.slice(P,V),k+1),b=z+1,P=V+1;m(h.slice(b,y),w.slice(P,S),k+1);return}}return m(h.slice(f,y),w.slice(v,S),k+1)}let Q=f,W=v;for(let[I,b]of q)n.push([h[I],w[b]]),m(h.slice(Q,I),w.slice(W,b),k),Q=I+1,W=b+1;m(h.slice(Q,y),w.slice(W,S),k)}function p(h,w){let k=new Map,f=new Map;for(let y of h){let v=e[y].tag;k.has(v)||k.set(v,[]),k.get(v).push(y)}for(let y of w){let v=t[y].tag;f.has(v)||f.set(v,[]),f.get(v).push(y)}for(let[y,v]of k){let S=f.get(y);S&&S.length===v.length&&y!=="#text"&&y!=="#comment"&&v.forEach((L,F)=>n.push([L,S[F]]))}}}function mt(e){let t=[],n=[],r=new Array(e.length).fill(-1);for(let l=0;l<e.length;l++){let g=e[l][1],a=0,m=t.length;for(;a<m;){let p=a+m>>1;t[p]<g?a=p+1:m=p}t[a]=g,n[a]=l,r[l]=a>0?n[a-1]:-1}let s=[],o=n.length?n[n.length-1]:-1;for(;o>=0;)s.push(e[o]),o=r[o];return s.reverse()}function ht(e,t,n,r,s,o,l,g,a){let m=o-s,p=g-l,h=(v,S)=>e[n[s+v]][a]===t[r[l+S]][a],w=Array.from({length:m+1},()=>new Uint16Array(p+1));for(let v=m-1;v>=0;v--)for(let S=p-1;S>=0;S--)w[v][S]=h(v,S)?w[v+1][S+1]+1:Math.max(w[v+1][S],w[v][S+1]);let k=[],f=0,y=0;for(;f<m&&y<p;)h(f,y)?(k.push([s+f,l+y]),f++,y++):w[f+1][y]>=w[f][y+1]?f++:y++;return k}function Ie(e){return e.nodeType===3?"#text "+JSON.stringify(e.data.slice(0,40)):e.nodeType===8?"#comment":"<"+e.localName+Array.from(e.attributes,t=>" "+t.name+'="'+t.value.slice(0,30)+'"').join("")+">"}function Ce(e){return e.kind==="text"?"#text "+JSON.stringify(e.value.slice(0,40)):e.kind==="comment"?"#comment":"<"+e.tag+e.attrs.map(t=>" "+t.name+'="'+t.value.slice(0,30)+'"').join("")+">"}function $e(e,t,n=r=>r){let r=new WeakMap,s=new Map;fe(e,s),_e(t.root);let o={paired:0,unmatchedLive:[],unmatchedSource:[],attrDiffs:[],textDiffs:0,unresolved:0},l={};return t.gen=l,qe(e,t.root,r,s,o,"html",n,l),{map:r,stats:o}}function qe(e,t,n,r,s,o,l,g){let a=l(e);if(a?(n.set(a,t),t.gen=g,s.paired++):s.unresolved++,t.kind!=="element"){e.data!==t.value&&s.textDiffs++;return}Ue(e)!==Je(t)&&s.attrDiffs.push({path:o,live:Ie(e),source:Ce(t)});let m=X(e),p=t.children,h=pt(m.map(f=>r.get(f)),p.map(f=>f.keys)),w=new Set,k=new Set;for(let[f,y]of h)w.add(f),k.add(y),qe(m[f],p[y],n,r,s,o+">"+(m[f].nodeType===1?m[f].localName:"#")+"["+f+"]",l,g);for(let f=0;f<m.length;f++)w.has(f)||s.unmatchedLive.push({path:o,node:Ie(m[f])});for(let f=0;f<p.length;f++)k.has(f)||s.unmatchedSource.push({path:o,node:Ce(p[f])})}function Qe(e,t,n=r=>r){if(!t.root)return null;let r=[],s=We(e,t.root,n,r);if(s<0)return null;let o=new WeakMap,l={};t.gen=l;let g=0;for(let[a,m]of r)a&&(o.set(a,m),m.gen=l,g++);return{map:o,stats:{paired:g,unmatchedLive:[],unmatchedSource:[],attrDiffs:[],textDiffs:0,unresolved:s}}}function We(e,t,n,r){if(t.kind==="text"){if(e.nodeType!==3||e.data!==t.value)return-1}else if(t.kind==="comment"){if(e.nodeType!==8||e.data!==t.value)return-1}else if(e.nodeType!==1||e.localName!==t.tag||e.namespaceURI!==t.node.namespaceURI||gt(e)!==yt(t.node))return-1;let s=n(e);r.push([s,t]);let o=s?0:1;if(t.kind!=="element")return o;let l=wt(e),g=t.children;if(l.length!==g.length)return-1;for(let a=0;a<l.length;a++){let m=We(l[a],g[a],n,r);if(m<0)return-1;o+=m}return o}var ze=e=>JSON.stringify(e),gt=e=>Array.from(e.attributes,t=>ze([t.namespaceURI||"",t.name,t.value])).sort().join(re),yt=e=>e.attrs.map(t=>ze([t.namespace||"",t.prefix?t.prefix+":"+t.name:t.name,t.value])).sort().join(re);function wt(e){let t=e.nodeType===1&&e.tagName==="TEMPLATE"&&e.content?e.content.childNodes:e.childNodes,n=[];for(let r of t)(r.nodeType===1||r.nodeType===3||r.nodeType===8)&&n.push(r);return n}function Ve(e,t,n){let r=t.get(e);if(!r||r.gen!==n.gen||r.from<0||r.to<0||r.kind==="element"&&r.located&&n.src.slice(r.openFrom,r.openFrom+r.tag.length+1).toLowerCase()!=="<"+r.tag.toLowerCase())return null;let s=vt(n),o=Tt(s,r.from);return{from:r.from,to:r.to,line:o+1,column:r.from-s[o]+1}}function vt(e){if(!e.lineStarts){let t=[0];for(let n=0;n<e.src.length;n++)e.src.charCodeAt(n)===10&&t.push(n+1);e.lineStarts=t}return e.lineStarts}function Tt(e,t){let n=0,r=e.length-1;for(;n<r;){let s=n+r+1>>1;e[s]<=t?n=s:r=s-1}return n}function He(e,t,n,r,s={}){let o=()=>typeof performance<"u"?performance.now():Date.now(),l=o(),g=n.src,a=[],m=0,p=(c,d)=>{if(!(c>=0&&d>c))return;let u=a.length>m?a[a.length-1]:null;u&&u.text===void 0&&u.to===c?u.to=d:a.push({from:c,to:d})},h=c=>{c&&a.push({text:c})},w=0,k=c=>{if(w)return null;let d=r(c),u=d?t.get(d):null;return u&&u.gen===n.gen?u:null},f=null,y=-1,v=!1,S=n.root;if(p(0,S.openFrom),I(e,S),p(S.closeTo,g.length),n.tailOwner&&y>=0&&!v){for(let c=y;c<a.length;c++)a[c]={text:$(F(a[c]))};f&&f.tail&&a.splice(f.at,0,{text:f.tail})}return{text:a.map(F).join(""),ms:o()-l};function F(c){return c.text!==void 0?c.text:g.slice(c.from,c.to)}function $(c){return c.split(/(<!--[\s\S]*?-->|<[^>]*>)/).map((d,u)=>u%2?d:d.replace(/[\t\n\f\r ]+/g,"")).join("")}function K(){y=a.length,m=a.length,v=!!f&&f.whole&&/^(?:<\/[^>]*>)*$/.test(a.slice(f.at).map(F).join(""))}function q(c,d){if(c.nodeType===3)return W(c,d);if(c.nodeType===8)return Q(c);if(c.nodeType===1){if(s.print&&s.print.has(c)){w++;try{I(c,null)}finally{w--}}else I(c,k(c));c.localName==="body"&&c.parentNode===e&&K()}}function Q(c){let d=k(c);d&&d.kind==="comment"&&d.value===c.data&&d.from>=0&&!s.breakText?p(d.from,d.to):h("<!--"+c.data+"-->")}function W(c,d){let u=k(c),x=c.data;s.corrupt==="drop-first-text"&&!s.corrupted&&x.trim()&&(s.corrupted=!0,x=x.slice(1));let T=u&&u.parent&&Se(u.parent.tag)===Se(d);if(u&&u.kind==="text"&&u.value===x&&u.from>=0&&!s.breakText&&T){p(u.from,u.to),s.doubleCopied!==void 0&&x===s.doubleCopied&&p(u.from,u.to),u.outsideTail&&(f={at:a.length,tail:u.outsideTail,whole:!0},m=a.length);return}let R=null;if(u&&u.kind==="text"&&u.outsideTail){let A=x.endsWith(u.outsideTail);A&&(x=x.slice(0,x.length-u.outsideTail.length)),R={tail:A?u.outsideTail:"",whole:A}}h(ue.has(d)?x:ct(x)),R&&(f={at:a.length,...R},m=a.length)}function I(c,d){let u=c.localName,x=ae.has(u)&&c.namespaceURI===Le,T=d&&d.kind==="element"&&!s.breakTags?d:null;if(T&&!T.located){if(c.attributes.length===0){if(T.openFrom>=0){H(c,T,u);return}X(c).length&&H(c,null,u);return}if(h(b(c)),x)return;H(c,T.openFrom>=0?T:null,u),h("</"+u+">");return}if(!T){if(h(b(c)),x)return;H(c,null,u),h("</"+u+">");return}z(c,T),!x&&(H(c,T,u),p(T.closeFrom,T.closeTo))}function b(c){let d="<"+c.localName;for(let u of c.attributes)d+=" "+u.name+(u.value===""?"":'="'+Ne(u.value)+'"');return d+">"}function P(c,d){let u=c.attributes;if(u.length!==d.attrs.length)return!1;for(let x=0;x<u.length;x++){let T=d.attrs[x];if(T.from<0||u[x].value!==T.value||u[x].name.toLowerCase()!==T.key)return!1}return!0}function z(c,d){if(P(c,d)){p(d.openFrom,d.openTo);return}let u=new Map;for(let E of c.attributes)u.set(E.name.toLowerCase(),E);let x=new Set,T=d.openFrom;for(let E of d.attrs){if(E.from<0){let J=u.get(E.key);J&&J.value===E.value&&x.add(E.key);continue}let M=u.get(E.key);if(x.add(E.key),!M){p(T,V(T,E.from)),T=E.to;continue}if(M.value===E.value){p(T,E.to),T=E.to;continue}p(T,E.from),h(st(g.slice(E.from,E.to),M.value)),T=E.to}let R=d.openTo-1,A=d.attrs.reduce((E,M)=>M.to>E?M.to:E,d.openFrom);g[R-1]==="/"&&R-1>=A&&R--,p(T,R);for(let E of c.attributes)x.has(E.name.toLowerCase())||h(" "+E.name+(E.value===""?"":'="'+Ne(E.value)+'"'));p(R,d.openTo)}function V(c,d){let u=d;for(;u>c&&/[ \t\n\r\f]/.test(g[u-1]);)u--;return u}function st(c,d){let u=c.indexOf("="),x=(u<0?c:c.slice(0,u)).trimEnd(),T=u<0?"":c.slice(u+1).trim(),R=T[0]==="'"?"'":T[0]==='"'?'"':"",A=d.replace(/&/g,"&").replace(/ /g," ");return R==="'"&&!d.includes("'")?x+"='"+A+"'":R===""&&T!==""&&d!==""&&!/[\s"'=<>`]/.test(d)?x+"="+A:x+'="'+A.replace(/"/g,""")+'"'}function it(c){if(c.nodeType!==1||w||s.print&&s.print.has(c))return null;let d=k(c);return d&&d.kind==="element"&&d.located&&!d.endTagged&&!ae.has(d.tag)&&!s.breakTags?d:null}function oe(c){let d=it(c);if(!d)return null;let u=X(c);return((u.length?oe(u[u.length-1]):null)||[]).concat(d.tag)}function H(c,d,u){let x=X(c),T=null,R=(C,N)=>{T&&!(N>=0&&T.j>=0&&N===T.j+1)&&h(T.tags.map(O=>"</"+O+">").join("")),T=null};if(!d){for(let C of x){R(-1,-1),q(C,u);let N=oe(C);N&&(T={tags:N,j:-1})}return}let A=d.children,E=new Map(A.map((C,N)=>[C,N])),M=x.map(C=>{let N=k(C);return N&&N.parent===d&&N.from>=0?E.get(N):-1}),J=new Set;if(!s.breakText&&!s.breakTags){let C=new Set(M),N=new Map;A.forEach((O,j)=>{C.has(j)||O.from<0||!O.keys||(N.has(O.keys.deep)||N.set(O.keys.deep,[]),N.get(O.keys.deep).push(j))}),N.size&&x.forEach((O,j)=>{if(M[j]>=0||k(O))return;let D=N.get(fe(O,new Map).deep);D&&D.length&&(M[j]=D.shift(),J.add(j))})}let me=(C,N)=>{if(!J.has(N))return q(C,u);let O=A[M[N]];p(O.from,O.to),O.outsideTail&&(f={at:a.length,tail:O.outsideTail,whole:!0},m=a.length)},at=(C,N)=>{if(!J.has(N))return oe(C);let O=A[M[N]];return O.kind==="element"&&O.located&&!O.endTagged&&!ae.has(O.tag)?[O.tag]:null},lt=new Set(xt(M)),B=d.openTo,he=-1,ge=C=>{for(let N=he+1;N<C;N++){let O=A[N];O.from<0||(p(B,O.from),B=Math.max(B,O.to))}};for(let C=0;C<x.length;C++){let N=x[C],O=at(N,C);if(lt.has(C)){let D=M[C],ye=A[D];R(C,D),ge(D),p(B,ye.from),me(N,C),B=Math.max(B,ye.to),he=D,T=O?{tags:O,j:D}:null;continue}let j=k(N);R(C,j&&j.parent===d?E.get(j):-1),me(N,C),T=O?{tags:O,j:-1}:null}ge(A.length),p(B,d.closeFrom)}}function xt(e){let t=[],n=[],r=new Array(e.length).fill(-1);for(let l=0;l<e.length;l++){let g=e[l];if(g<0)continue;let a=0,m=t.length;for(;a<m;){let p=a+m>>1;t[p]<g?a=p+1:m=p}t[a]=g,n[a]=l,r[l]=a>0?n[a-1]:-1}let s=[],o=n.length?n[n.length-1]:-1;for(;o>=0;)s.push(o),o=r[o];return s.reverse()}function Xe(e,t,n,r=null,s=null){return Ke(e,t,n,r,s,!1)}function Ge(e,t,n,r=null,s=null){return Ke(e,t,n,r,s,!0)}function Ke(e,t,n,r,s,o){let l=new DOMParser,g=l.parseFromString(e,"text/html"),a=Re(g),m=Re(n);if(a.join(`
|
|
3
|
+
`)!==m.join(`
|
|
4
|
+
`))return{ok:!1,diff:"document: outside <html> "+JSON.stringify(a)+" vs live "+JSON.stringify(m)};let p=null,h=null;if(r&&(p=[],h=te(g.documentElement,r,"html",p),!h)){let y=be(e,s,o);return y.diff?{ok:!1,diff:y.diff}:o?Ae({ok:!0,diff:null,oracle:"clone"},y,e,n):{ok:!0,diff:null,oracle:"clone"}}let w=l.parseFromString(t,"text/html"),k=te(g.documentElement,w.documentElement,"html"),f=k?null:be(e,s,o);return k?r?{ok:!1,diff:k,at:p}:{ok:!1,diff:k}:f.diff?{ok:!1,diff:f.diff}:o?Ae({ok:!0,diff:null,oracle:"today"},f,e,n):{ok:!0,diff:null,oracle:"today"}}function Ye(e,t){let n=e;for(let r of t){let s=ce(n);if(r>=s.length)return null;n=s[r]}return n}function be(e,t,n){if(!t)return{diff:null};let r=new Map,s=ie(e,n?{sourceCodeLocationInfo:!0,onParseError:o=>r.set(o.code,(r.get(o.code)||0)+1)}:{onParseError:o=>r.set(o.code,(r.get(o.code)||0)+1)});for(let[o,l]of r){let g=t.get(o)||0;if(l>g)return{diff:`the render introduced parse errors the source does not have: ${o} ${g} -> ${l}`}}return n?{diff:null,doc:s,parseErrors:r}:{diff:null}}function Ae(e,t,n,r){if(!t.doc)return e;let s=je(n,t.doc,t.parseErrors);return G(s,r)||(e.model=s),e}function Re(e){let t=[];for(let n of e.childNodes)n.nodeType===10?t.push("doctype "+n.name+"|"+n.publicId+"|"+n.systemId):n.nodeType===8?t.push("comment "+n.data):n.nodeType!==1&&t.push("node"+n.nodeType+" "+(n.data||""));return t}function kt(e,t,n){let r=new DOMParser,s=o=>{let l=Array.from(o.childNodes);return l.length&&l.every(g=>g.nodeType===3)?l.map(g=>g.data).join(""):o.innerHTML};return te(r.parseFromString(e.innerHTML,"text/html").body,r.parseFromString(s(t),"text/html").body,n+">#noscript")}function ce(e){let t=e.localName==="template"&&e.content?e.content.childNodes:e.childNodes,n=[];for(let r=0;r<t.length;r++){let s=t[r];(s.nodeType===1||s.nodeType===3||s.nodeType===8)&&n.push(s)}return n}var Z=e=>Array.from(e.attributes,t=>(t.namespaceURI||"")+" "+t.name+"="+JSON.stringify(t.value)).sort().join("; ");function St(e,t){let n=e.attributes,r=t.attributes;if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++){let o=n[s],l=r[s];if(o.name!==l.name||o.value!==l.value||o.namespaceURI!==l.namespaceURI)return!1}return!0}function te(e,t,n,r=[]){if(e.nodeType!==t.nodeType)return n+": node type "+e.nodeType+" vs "+t.nodeType;if(e.nodeType===3||e.nodeType===8)return e.data===t.data?null:n+": text "+JSON.stringify(e.data.slice(0,60))+" vs "+JSON.stringify(t.data.slice(0,60));if(e.localName!==t.localName||e.namespaceURI!==t.namespaceURI)return n+": tag "+e.localName+" vs "+t.localName;if(!St(e,t)&&Z(e)!==Z(t))return n+": attrs "+Z(e)+" vs "+Z(t);if(e.localName==="noscript"&&e.namespaceURI===Le)return kt(e,t,n);let s=ce(e),o=ce(t);if(s.length!==o.length)return n+": "+s.length+" vs "+o.length+" children";for(let l=0;l<s.length;l++){r.push(l);let g=te(s[l],o[l],n+">"+(s[l].localName||"#")+"["+l+"]",r);if(g)return g;r.pop()}return null}var i={installed:!1,refused:null,session:0,model:null,map:null,stats:null,saves:0,reprints:0,lastReprint:null,partialReprints:0,lastPartialReprint:null,lastOutcome:null,lastRenderMs:null,lastBytes:null,timing:{fetch:null,model:null,pair:null,refresh:null},refreshes:0,repairs:0,refreshQueued:!1,pendingBytes:null,refetch:!1,adoptions:0},Nt=2,_=()=>typeof performance<"u"?performance.now():Date.now(),Ze='<script type="application/json" id="clay-runtime-map"',et=e=>e.includes(Ze)||e.includes("/_/clayjs/");async function tt(e){let t=await fetch(e,{cache:"no-store",redirect:"manual",credentials:"same-origin",headers:{"Clay-Source":"1"}});if(!t.ok)throw new Error(`source fetch: status ${t.status}`);if(t.redirected||t.type==="opaqueredirect")throw new Error("source fetch: redirected");let n=(t.headers.get("content-type")||"").toLowerCase();if(!n.startsWith("text/html"))throw new Error(`source fetch: content-type ${n||"missing"}`);let r=await t.text();if(r.includes(Ze))throw new Error("source fetch: projected response");return r}function pe(e){let t=Te({flushUndo:!1,authored:!1});return $e(t,e,Y)}function Ot(e){let t=e.doc&&e.doc.childNodes.find(r=>r.nodeName==="html"),n=t&&Array.isArray(t.attrs)?t.attrs.find(r=>r.name==="documentetag"):null;return n&&n.value?n.value:null}function Et(e){let t=e&&e.represented&&e.represented.etag;if(t)return t;let n=xe();return n||e===null&&document.documentElement.getAttribute("documentetag")||null}function It(e,t){let n=Ot(e),r=Et(t);return!n||!r||n===r?null:`source refused: the fetch answered version ${n} while this page holds ${r}`}function nt(e,t=null,n=0,r=!0,s=null){let o=i.session,l=_(),g=i.adoptions;i.refused=null;let a=s?s():null,m=a&&typeof a.bytes=="string"&&!et(a.bytes)?a.bytes:null;return(m!==null?Promise.resolve(m):tt(e)).then(p=>{if(o!==i.session)return null;let h=_(),w=ne(p),k=G(w,document);if(k)throw new Error(`source refused: ${k}`);let f=It(w,t);if(f)throw new Error(f);if(i.adoptions!==g){if(n<Nt)return nt(e,t,n+1,r,s);throw new Error("source refused: a save replaced the file while the fetch was in flight")}let y=_(),{map:v,stats:S}=pe(w),L=_();return i.model=w,i.map=v,i.stats=S,i.timing={fetch:h-l,model:y-h,pair:L-y,refresh:null},i.installed=!0,r&&se(Ct),ot()}).catch(p=>(o!==i.session||(i.refused=String(p&&p.message?p.message:p),console.info(`clayjs: source map off (${i.refused}); saves use the full serialization`)),null))}function Ct(e,t,n={}){if(!i.installed)return t;U(),i.lastOutcome=null;let r=we(),s=!!r&&!r.authoredHandlers,o=new Set,l=null;for(let g=0;g<=At;g++){let a;try{a=He(e,i.map,i.model,Y,{...n,print:o})}catch(p){return de("render threw: "+(p&&p.message?p.message:p),t)}let m=s?Ge(a.text,t,document,e,i.model.parseErrors):Xe(a.text,t,document,e,i.model.parseErrors);if(m.ok)return i.lastRenderMs=a.ms,i.lastBytes=a.text.length,i.lastOutcome=o.size?{text:a.text,scope:"partial",reason:l,printed:o.size}:{text:a.text,scope:null},m.model&&bt(m.model,a.text,e,r),a.text;if(l===null&&(l=m.diff),!m.at||!Rt(e,Ye(e,m.at),o))return de(l,t)}return de(l,t)}function bt(e,t,n,r){let s=Qe(n,e,Y);s&&ve({captureId:r.captureId,html:t,source:{model:e,map:s.map,stats:s.stats,repairGeneration:i.repairs,outcome:i.lastOutcome}})}var At=8;function Rt(e,t,n){let r=t&&t.nodeType===1?t:t&&t.parentNode;for(let s=r;s&&s!==e;s=s.parentNode)if(n.has(s)){n.delete(s),r=s.parentNode;break}return!r||r.nodeType!==1||r===e?!1:(n.add(r),!0)}function de(e,t){return i.lastOutcome={text:t,scope:"full",reason:e},t}function Mt(e){i.reprints++,i.lastReprint=e,console.warn("clayjs: source map did not verify, saving the full serialization instead:",e),document.dispatchEvent(new CustomEvent("clay:save-reprinted",{detail:{reason:e,scope:"full"}}))}function Lt(e,t){i.partialReprints++,i.lastPartialReprint=e,console.info(`clayjs: source map printed ${t} element(s) in full to match the page:`,e),document.dispatchEvent(new CustomEvent("clay:save-reprinted",{detail:{reason:e,scope:"partial",printed:t}}))}function jt(e,t){i.adoptions++,i.installed&&(Pt(e,t&&t.artifact?t.artifact.source.outcome:null),!Ft(e,t)&&(i.pendingBytes=e,rt()))}function Ft(e,t){let n=t&&t.artifact;return!n||!n.source||n.html!==e||t.captureId===null||t.captureId===void 0||n.captureId!==t.captureId||n.source.repairGeneration!==i.repairs||i.refreshQueued||i.pendingBytes!==null?!1:(i.model=n.source.model,i.map=n.source.map,i.stats=n.source.stats,!0)}function Pt(e,t=null){let n=i.lastOutcome&&i.lastOutcome.text===e?i.lastOutcome:t;!n||n.text!==e||(i.lastOutcome===n&&(i.lastOutcome=null),i.saves++,n.scope==="full"?Mt(n.reason):n.scope==="partial"&&Lt(n.reason,n.printed))}function Dt(e){let t=e&&e.detail;t&&t.source==="disk"&&typeof t.html=="string"&&i.adoptions++,i.installed&&(t&&t.source==="disk"&&typeof t.html=="string"&&(et(t.html)?i.refetch=!0:i.pendingBytes=t.html),rt())}function rt(){i.refreshQueued||(i.refreshQueued=!0,typeof requestIdleCallback=="function"?requestIdleCallback(U,{timeout:2e3}):setTimeout(U,0))}function U(){if(!i.refreshQueued||(i.refreshQueued=!1,!i.installed))return;let e=i.pendingBytes;i.pendingBytes=null;let t=i.refetch&&e===null;t&&(i.refetch=!1),i.repairs++;let n=_(),r=i.model;if(e!==null)try{let s=ne(e),o=G(s,document);if(o)throw new Error(o);r=s}catch(s){console.warn("clayjs: source map kept the previous model, the accepted bytes did not model:",s)}try{let{map:s,stats:o}=pe(r);i.model=r,i.map=s,i.stats=o,i.refreshes++,i.timing.refresh=_()-n}catch(s){console.warn("clayjs: source map could not re-pair, continuing on the previous map:",s)}t&&Bt()}function Bt(){let e=i.repairs,t=i.adoptions;tt(window.location.href).then(n=>{let r=ne(n),s=G(r,document);if(s)throw new Error(s);return r}).then(n=>{if(!(i.repairs!==e||i.adoptions!==t))try{i.repairs++,i.adoptions++;let{map:r,stats:s}=pe(n);i.model=n,i.map=r,i.stats=s,i.refreshes++}catch(r){console.warn("clayjs: source map could not re-pair, continuing on the previous map:",r)}}).catch(n=>{console.warn("clayjs: source map kept the previous model, the accepted bytes did not model:",n)})}function ot(){let e=i.stats;return{installed:i.installed,refused:i.refused,sourceBytes:i.model?i.model.src.length:null,paired:e?e.paired:0,unresolved:e?e.unresolved:0,unmatchedLive:e?e.unmatchedLive.length:0,unmatchedSource:e?e.unmatchedSource.length:0,attrDiffs:e?e.attrDiffs.length:0,saves:i.saves,reprints:i.reprints,lastReprint:i.lastReprint,partialReprints:i.partialReprints,lastPartialReprint:i.lastPartialReprint,lastRenderMs:i.lastRenderMs,lastBytes:i.lastBytes,refreshes:i.refreshes,timing:i.timing}}function zt(){return U(),i.model?i.model.src:null}function Vt(e){return U(),i.installed&&e?Ve(e,i.map,i.model):null}function Ht(){return U(),i.stats?{live:i.stats.unmatchedLive.slice(0,50),source:i.stats.unmatchedSource.slice(0,50)}:null}function Xt(){return U(),ot()}var Gt=()=>i.installed;function Kt(){Ut()}function Ut(){i.session++,i.installed=!1,i.refreshQueued=!1,i.pendingBytes=null,i.refetch=!1,se(null)}function Yt({context:e=null,latest:t=null}={}){return nt(window.location.href,e,0,!0,t)}ke(jt);document.addEventListener("clay:sync-applied",Dt);export{jt as adoptAccepted,Gt as installed,Vt as locateLive,Kt as release,Ct as renderSave,Yt as start,Xt as stats,zt as text,Ht as unpaired};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./c-FROJUZMV.js";import{a as Z}from"./c-R7IWVINQ.js";import{e as D,f as F,g as J}from"./c-JRKY44DK.js";import{d as $,e as v,f as B,h as Q,l as X}from"./c-4DFEJ2PO.js";import{a as O,b as H,f as G,g as P,h as K,i as q,q as T,r as E,y as W}from"./c-6CRUUXOX.js";import"./c-WWXIDH4O.js";import{c as k}from"./c-5V3MOVJT.js";import"./c-HA6INT6J.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";function A(e){let n=new Set;for(let[,t]of k(e?.y??{}))try{for(let o of q(T(H(t))).keys())n.add(o)}catch{}return n}function ce(e,n){let t=A(e),o=A(n);if(!t.size||!o.size||[...o].some(r=>t.has(r)))return!0;let i=new Map(k(e?.y??{}));return k(n?.y??{}).some(([r,c])=>i.get(r)===c)}function ee(e,n){return!e||!n||!e.generation||!n.generation?!1:e.generation===n.generation&&e.baseDigest===n.baseDigest}async function ne(e,n){let t=n instanceof Uint8Array?n:new Uint8Array(0);return{generation:e,baseDigest:await v(t),baseVector:t.length?T(t):new Uint8Array(0)}}function te(e,n){let t=A(e),o=A(n);return!t.size||!o.size?!1:ce(e,n)}var le="page.yjs",ue=1,de=64,fe=1024*1024,pe=e=>E(e),j=class extends Error{constructor(n,t){super(t),this.name="PageReplayError",this.code=n}},l=(e,n)=>{throw new j(e,n)},h=e=>typeof e=="string"?e:JSON.stringify(e),M=e=>e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):null,ge=(e,n)=>h(e)===h(n);function C(e){let n=e.map(M).filter(t=>t&&t.length);return n.length?n.length===1?n[0].slice():E(n):new Uint8Array(0)}function ie({capsule:e,batches:n=[]}={}){(!e||e.kind!=="binary"||!e.payload)&&l("invalid-capsule","Replay needs a binary capsule"),e.version!==void 0&&e.version!==1&&l("unknown-version",`Unknown page recovery capsule version: ${e.version}`);let t=[e.payload.dependencies],o=[e.payload.owned],i=new Set;for(let r of n){if((!r||r.kind!=="binary-batch"||!r.payload)&&l("invalid-batch","Replay reads binary batches only"),r.capsuleId!==void 0&&!ge(r.capsuleId,e.id)&&l("foreign-batch","A batch belongs to another capsule"),r.id!==void 0){if(i.has(h(r.id)))continue;i.add(h(r.id))}r.origin==="dependency"?t.push(r.payload):o.push(r.payload)}return{id:e.id,context:e.context??null,revision:e.revision??0,acknowledged:e.acknowledged??null,base:C([e.payload.base]),dependencies:C(t),owned:C(o)}}function he({capsule:e,batches:n=[]}={}){let t=ie({capsule:e,batches:n}),o=new G;try{for(let i of[t.base,t.dependencies,t.owned])i.length&&P(o,i,W);return(o.store.pendingStructs||o.store.pendingDs)&&l("unresolved-update","The capsule's updates are missing a prerequisite"),{v:1,g:0,y:{seed:O(K(o))}}}finally{o.destroy()}}function De({capsule:e,batches:n=[]}={}){return Z(he({capsule:e,batches:n}))}function ye({capsule:e,batches:n=[],current:t}={}){let o=ie({capsule:e,batches:n});o.context?.authority||l("missing-identity","A capsule with no authority is never replayed"),t?.context?.authority||l("missing-identity","Replay needs the page's own authority"),J(o.context.authority,t.context.authority)||l("foreign-authority","This journal belongs to another document or account"),ee(o.context.lineage,t.context.lineage)||l("foreign-generation","This journal belongs to another generation of this page");let i=B(t.state);o.base.length&&!$(i,o.base)&&l("missing-base","The page no longer contains the journal's base"),o.owned.length||l("nothing-owned","This capsule owns no local work");let r=C([o.base,o.dependencies,o.owned]);return te(t.state,{v:1,g:0,y:{seed:O(r)}})||l("foreign-lineage","This journal shares no ancestry with this page"),o}function me(e=[]){let n=new Map,t=new Map;for(let o of e||[]){if(!o||o.supported===!1)continue;if(o.kind==="binary"){n.set(h(o.id),o);continue}if(o.kind!=="binary-batch"||o.capsuleId===void 0)continue;let i=h(o.capsuleId),r=t.get(i)??[];r.push(o),t.set(i,r)}return[...n.entries()].map(([o,i])=>({capsule:i,batches:t.get(o)??[]}))}function we(e,n){for(let t of[n.base,n.dependencies,n.owned])t&&t.length&&P(e,t,X)}function be({records:e=[],current:n,into:t}={}){let o=[],i=[];for(let r of me(e)){let c;try{c=ye({capsule:r.capsule,batches:r.batches,current:n})}catch(u){if(u?.code==="nothing-owned")continue;i.push({capsule:r.capsule,code:u?.code??"invalid-capsule",message:u?.message??"This journal cannot be replayed"});continue}we(t,c),o.push({id:r.capsule.id,revision:c.revision,owned:c.owned.length})}return{replayed:o,review:i}}async function xe({authority:e,generation:n=null,base:t=null,formatFloor:o=0}={}){let i=M(t)??new Uint8Array(0),r=typeof n=="string"&&n?n:await v(i);return{authority:e,lineage:await ne(r,i),formatFloor:o}}function ke({meta:e=null,location:n=globalThis.location,root:t=globalThis.document?.documentElement}={}){let o=n?.origin??"";if(!o)return null;let i=D(t)?.identity??F(n?.pathname??"/").identity;if(!i)return null;let r=e?.document?.people,c=r&&typeof r=="object"?r.me?.id??null:i;return c?{host:o,documentId:i,principalId:c}:null}var oe=e=>typeof e=="string"?e:JSON.stringify(e),Fe=e=>B(e),re=new WeakMap;function ve(e){if(!e)return null;let n=re.get(e);if(n)return n;let t=e.register({channel:le,version:ue,validateCheckpoint:Q,merge:pe});return re.set(e,t),t}function Ae({channel:e,key:n,context:t,base:o=null,onChange:i=()=>{}}){let r=new Map,c=[],u=new Set,b=M(o)??new Uint8Array(0),d=null,f=null,y=0,S=0,U=!1,m=null,w=!1,g={channel:e,key:n,onChange:i,context:()=>se,local:s=>R(s,"local"),dependency:s=>{U&&R(s,"dependency")},records:()=>[...r.values()],names:Y,pending:()=>u.size+(f?1:0),get failure(){return f},retire:N,compact:z,acknowledged:()=>w||!d||!r.size||typeof e.markAcknowledged!="function"?Promise.resolve(null):Promise.resolve(e.markAcknowledged({records:Y(),authority:d.authority})).catch(()=>null),close:()=>{w=!0,c.length=0}},se=Promise.resolve().then(()=>typeof t=="function"?t(b):t).catch(()=>null).then(s=>{if(d=s&&s.authority?s:null,!d)return w=!0,f="unavailable",c.length=0,g.onChange(),null;for(let a of c.splice(0))a(d);return d});function N(s){for(let a of s||[])r.delete(oe(a?.id))}function Y(){return[...r.values()].map(({id:s,revision:a})=>({id:s,revision:a}))}function z(){if(m||w||!r.size||typeof e.compact!="function")return m;let s=Y();return m=Promise.resolve().then(()=>e.compact({records:s})).then(a=>(a?.ok&&(N(a.retired),y=Math.max(0,y-(a.retired?.length??0)),y||(S=0)),a)).catch(()=>null).then(a=>(m=null,g.onChange(),a)),m}function L(s,a,x,V){let _;try{_=e.append({key:n,context:s,update:a,origin:x,base:V?b:null})}catch{f="error",g.onChange();return}let I={};u.add(I),Promise.resolve(_).then(p=>{if(u.delete(I),!p||p.ok!==!0){f=p?.code??"error",g.onChange();return}f=null,p.skipped||(r.set(oe(p.id),{id:p.id,revision:p.revision,update:a,context:s}),y+=1,S+=a.byteLength),g.onChange(),(y>=de||S>=fe)&&z()},()=>{u.delete(I),f="error",g.onChange()})}function R(s,a){if(w||!s||!s.byteLength||typeof e.append!="function")return;let x=!U;U=!0,d?L(d,s,a,x):c.push(V=>L(V,s,a,x))}return g}function Je({meta:e=null,service:n=null,base:t=null,onChange:o=()=>{},location:i,root:r}={}){let c=ke({meta:e,location:i,root:r});if(!c)return null;let u=ve(n);if(!u)return null;let b=e?.document?.pageState?.generation??null,d=Array.isArray(e?.extensions)&&e.extensions.includes("page-format-v1")?1:0;return Ae({channel:u,key:[c.host,c.documentId].join(":"),context:f=>xe({authority:c,generation:b,base:f,formatFloor:d}),base:t,onChange:o})}async function He({journal:e,state:n,into:t}={}){if(!e)return{replayed:[],review:[]};let o=await e.context();if(!o)return{replayed:[],review:[]};let i=await e.channel.list();return i?.ok?be({records:i.records,current:{context:o,state:n},into:t}):{replayed:[],review:[]}}export{de as COMPACT_BATCHES,fe as COMPACT_BYTES,le as PAGE_CHANNEL,ue as PAGE_CHANNEL_VERSION,j as PageReplayError,ie as accumulateCapsule,ye as admitCapsule,we as applyCapsule,me as capsulesOf,Ae as createPageJournal,Fe as journalBase,pe as mergePageUpdates,Je as openPageJournal,ke as pageAuthority,ve as pageChannel,xe as pageJournalContext,De as reconstructPage,He as replayInto,be as replayJournals,he as replayPageValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as O,c as N}from"./c-IJUK2GPW.js";import{f as v}from"./c-VG5XIN4T.js";import{a as y,h as k,j as C,k as R}from"./c-HA6INT6J.js";import{b as E,s as g,t as _,u as S,v as m}from"./c-DCFSEJZG.js";import{g as w}from"./c-WRBKEJD4.js";import{a as M}from"./c-VHNSBD2M.js";var L={};M(L,{default:()=>B});var P=document.createElement("div"),x=new Set(k);function T(e){if(e.type!=="attributes")return!1;let t=e.attributeName;return t===R||y(t,e.target)?!0:e.target===document.documentElement&&(x.has(t)||t.startsWith(C))}function A(e){return e.some(T)?e.filter(t=>!T(t)):e}var V={_callbacks:{anyChange:[],addOrRemove:[],addElement:[],removeElement:[],attribute:[]},_observing:!1,_pauseDepth:0,_hasNonPausable:!1,debug:!1,_rawSubscribers:[],_deferredChangeRecords:null,_deferredChangeScheduled:!1,pause(){this._pauseDepth===0&&this._deliverBeforePause(),this._pauseDepth++,typeof window<"u"&&window.clay?.undo?.pause&&window.clay.undo.pause(),this._log("Paused",this._pauseDepth)},_deliverBeforePause(){if(!this._observer)return;let e=this._observer.takeRecords();e.length&&this._onRecords(e)},dropQueued(){this._observer&&this._drainBrowserQueue(this)},resume(){this._pauseDepth!==0&&(this._pauseDepth--,this._pauseDepth===0&&this._observer&&this._drainBrowserQueue(this),typeof window<"u"&&window.clay?.undo?.resume&&window.clay.undo.resume(),this._log("Resumed",this._pauseDepth))},_log(e,t=null,s="log"){if(!this.debug)return;let i=`[Mutation ${new Date().toISOString()}]`;t?console[s](i,e,t):console[s](i,e)},_notify(e,t,s=!1){this._log(`Notifying ${this._callbacks[e].length} callbacks of type "${e}"`,{changes:t});for(let r of this._callbacks[e]){if(s&&r.pausable!==!1)continue;let{fn:i,debounce:u=0,maxWait:l=0,selectorFilter:n,omitChangeDetails:c,require:h,skip:d}=r,f=t.filter(o=>{if(h!=="observed"&&v(o))return!1;let a=m(this._policyForChange(o),h,d);if(!o.policyTransition)return!a;let b=m(o.previousPolicy,h,d);return!(a&&b)});if(!f.length){this._log("No changes passed the region policy, skipping callback");continue}if(n&&(this._log("Applying selector filter",{selectorFilter:n}),f=f.filter(o=>{if(typeof n=="string"){let a=o.element.matches?.(n)||!1;return this._log(`Selector "${n}" match:`,{element:o.element,matches:a}),a}if(typeof n=="function"){let a=n(o.element);return this._log("Custom filter match:",{element:o.element,matches:a}),a}return!1}),this._log("Changes after filtering:",{filteredChanges:f})),!f.length){this._log("No changes passed the filter, skipping callback");continue}if(u===0)try{c?i():i(f)}catch(o){this._log("Error in callback execution:",o,"error"),console.error("Error in Mutation callback:",o)}else{r.timeout&&(clearTimeout(r.timeout),r.timeout=null),r.firstPendingAt||(r.firstPendingAt=Date.now());let o=l>0?Math.max(0,Math.min(u,l-(Date.now()-r.firstPendingAt))):u;c?r.timeout=setTimeout(()=>{r.timeout=null,r.firstPendingAt=null;try{this._log("Executing debounced callback (no details)"),i()}catch(a){this._log("Error in callback execution:",a,"error"),console.error("Error in Mutation callback:",a)}},o):(r.pendingChanges||(r.pendingChanges=[]),r.pendingChanges.push(...f),r.timeout=setTimeout(()=>{let a=r.pendingChanges;r.pendingChanges=null,r.timeout=null,r.firstPendingAt=null;try{this._log("Executing debounced callback with changes:",{changes:a}),a&&a.length>0&&i(a)}catch(b){this._log("Error in callback execution:",b,"error"),console.error("Error in Mutation callback:",b)}},o))}}},_policyForChange(e){if(e.__policy)return e.__policy;let t=e.element,s=g(t);return e.parent&&t&&t.isConnected===!1&&(s=S(s,g(e.parent))),e.__policy=s,s},_onRecords(e){let t=A(e);t.length&&(this._fanOutRaw(t),this._handleMutations(t))},_fanOutRaw(e){if(!(!this._rawSubscribers.length||!e.length))for(let t of this._rawSubscribers)try{t.cb(e)}catch(s){this._log("Error in raw subscriber callback:",s,"error"),console.error("Error in Mutation raw subscriber:",s)}},_drainBrowserQueue(e){let t=A(this._observer?this._observer.takeRecords():[]),s=!!e&&this._rawSubscribers.indexOf(e)!==-1;if(t.length){for(let r of this._rawSubscribers)r!==e&&(r.buffer.push(...t),this._scheduleBufferFlush(r));s?this._deferChangeLane(t):this._hasNonPausable&&this._processMutations(t,!0)}if(s){let r=e.buffer;return e.buffer=[],r.length?r.concat(t):t}return t},_scheduleBufferFlush(e){e._flushScheduled||(e._flushScheduled=!0,queueMicrotask(()=>{if(e._flushScheduled=!1,!e.buffer.length)return;let t=e.buffer;e.buffer=[];try{e.cb(t)}catch(s){this._log("Error in raw subscriber flush:",s,"error"),console.error("Error in Mutation raw subscriber:",s)}}))},_deferChangeLane(e){this._deferredChangeRecords||(this._deferredChangeRecords=[]),this._deferredChangeRecords.push(...e),!this._deferredChangeScheduled&&(this._deferredChangeScheduled=!0,queueMicrotask(()=>{this._deferredChangeScheduled=!1;let t=this._deferredChangeRecords;this._deferredChangeRecords=null,t&&t.length&&this._handleMutations(t)}))},subscribeRaw(e){let t={cb:e,buffer:[],_flushScheduled:!1};return this._rawSubscribers.push(t),this._startObserving(),{drain:()=>this._drainBrowserQueue(t),unsubscribe:()=>{let s=this._rawSubscribers.indexOf(t);s!==-1&&this._rawSubscribers.splice(s,1)}}},createObserver(e){let t=null;return{observe:s=>{if(s!==document.body)throw new Error("Mutation.createObserver only supports observing document.body");this._startObserving(),t||(t=this.subscribeRaw(e))},disconnect:()=>{t&&(t.unsubscribe(),t=null)},takeRecords:()=>t?t.drain():[]}},_handleMutations(e){if(this._pauseDepth>0){if(!this._hasNonPausable){this._log(`Skipping ${e.length} mutations (paused)`);return}this._processMutations(e,!0);return}this._processMutations(e,!1)},_processMutations(e,t=!1){let s=[],r={add:[],remove:[],attribute:[],characterData:[]};for(let i of e){let u=i.type==="attributes"&&w(i.attributeName);if(!(!u&&_(i.target))&&!(i.type==="attributes"&&i.attributeName&&E.test(i.attributeName.toLowerCase()))){if(i.type==="characterData"){this._log("Processing characterData mutation",{element:i.target.parentElement,oldValue:i.oldValue,newValue:i.target.textContent});let l={type:"characterData",element:i.target.parentElement??P,oldValue:i.oldValue,newValue:i.target.textContent};s.push(l),r.characterData.push(l)}if(i.type==="childList"){this._log("Processing childList mutation",{addedNodes:i.addedNodes,removedNodes:i.removedNodes});for(let n of i.addedNodes)if(n.nodeType===1&&!_(n)){let c=[n,...n.querySelectorAll("*")];this._log(`Processing ${c.length} added nodes`,{addedNodes:c});for(let h of c){let d={type:"add",element:h,parent:i.target,previousSibling:i.previousSibling,nextSibling:i.nextSibling};s.push(d),r.add.push(d)}}for(let n of i.removedNodes)if(n.nodeType===1&&!_(n)){let c=[n,...n.querySelectorAll("*")];this._log(`Processing ${c.length} removed nodes`,{removedNodes:c});for(let h of c){let d={type:"remove",element:h,parent:i.target,previousSibling:i.previousSibling,nextSibling:i.nextSibling};s.push(d),r.remove.push(d)}}let l=!1;for(let n of i.addedNodes)if(n.nodeType===3){l=!0;break}if(!l){for(let n of i.removedNodes)if(n.nodeType===3){l=!0;break}}if(l&&i.target.nodeType===1){let n={type:"characterData",element:i.target,oldValue:void 0,newValue:i.target.textContent};s.push(n),r.characterData.push(n)}}if(i.type==="attributes"){this._log("Processing attribute mutation",{element:i.target,attribute:i.attributeName,oldValue:i.oldValue,newValue:i.target.getAttribute(i.attributeName)});let l={type:"attribute",element:i.target,attribute:i.attributeName,oldValue:i.oldValue,newValue:i.target.getAttribute(i.attributeName),policyTransition:u,previousPolicy:u?F(i):null};s.push(l),r.attribute.push(l)}}}if(s.length){if(this._log("Processing collected changes",{total:s.length,byType:{add:r.add.length,remove:r.remove.length,attribute:r.attribute.length}}),!t&&O()){for(let u of s)if(!v(u)&&!m(this._policyForChange(u),"dirty")){N();break}}this._notify("anyChange",s,t);let i=[...r.add,...r.remove];i.length&&this._notify("addOrRemove",i,t),r.add.length&&this._notify("addElement",r.add,t),r.remove.length&&this._notify("removeElement",r.remove,t),r.attribute.length&&this._notify("attribute",r.attribute,t)}},_observer:null,_initializeObserver(){this._observer||(this._log("Initializing MutationObserver"),this._observer=new MutationObserver(this._onRecords.bind(this)))},_addCallback(e,t={},s){this._log("Adding callback",{type:e,options:t}),t.debug&&(this.debug=!0);let r={fn:s,debounce:t.debounce||0,maxWait:t.maxWait||0,selectorFilter:t.selectorFilter,omitChangeDetails:t.omitChangeDetails,require:t.require,skip:t.skip,pausable:t.pausable!==!1,timeout:null,pendingChanges:null,firstPendingAt:null};return this._callbacks[e].push(r),this._recomputeHasNonPausable(),this._log(`Added callback to ${e}. Total callbacks:`,{[e]:this._callbacks[e].length}),this._startObserving(),()=>{this._log("Removing callback",{type:e});let i=this._callbacks[e].indexOf(r);i!==-1&&(clearTimeout(r.timeout),r.pendingChanges=null,this._callbacks[e].splice(i,1),this._recomputeHasNonPausable(),this._log(`Removed callback from ${e}. Remaining callbacks:`,{[e]:this._callbacks[e].length}))}},_recomputeHasNonPausable(){this._hasNonPausable=Object.values(this._callbacks).some(e=>e.some(t=>t.pausable===!1))},_startObserving(){if(this._observing){this._log("Already observing, skipping initialization");return}this._log("Starting observation"),this._initializeObserver(),this._observer.observe(document.documentElement,{childList:!0,attributes:!0,subtree:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),this._observing=!0,this._log("Observation started")},onAnyChange(e={},t){return this._addCallback("anyChange",e,t)},onAddOrRemove(e={},t){return this._addCallback("addOrRemove",e,t)},onAddElement(e={},t){return this._addCallback("addElement",e,t)},onRemoveElement(e={},t){return this._addCallback("removeElement",e,t)},onAttribute(e={},t){return this._addCallback("attribute",e,t)},ensureObserving(){this._startObserving()}},D=typeof window<"u"&&window.__clayMutation,p=D||V;if(typeof window<"u"&&!D){window.__clayMutation=p,window.clay=window.clay||{},window.clay.Mutation=p;try{document.dispatchEvent(new CustomEvent("clay:mutation-ready",{detail:{Mutation:p}}))}catch{}}var B=p;function F(e){let t=e.target,s=t.cloneNode(!1),r=s;for(;t.parentElement;){t=t.parentElement;let i=t.cloneNode(!1);i.appendChild(s),s=i}return e.oldValue==null?r.removeAttribute(e.attributeName):r.setAttribute(e.attributeName,e.oldValue),g(r)}export{B as a,L as b};
|
|
@@ -0,0 +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-NUFFJVVJ.js";import{a as l,b as u,c,d as f}from"../c-RYUXUUBX.js";import{a as d,b as E,c as m,d as p}from"../c-HHDFCNHV.js";import"../c-XCNTK76U.js";import"../c-VKEDWYDF.js";import{a}from"../c-ZWIOJGMT.js";import"../c-IJUK2GPW.js";import{e as s}from"../c-OW5QIGG3.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-SPIORRYS.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as e,g as i}from"../c-TCJTVAFN.js";import"../c-GQ6F6IDK.js";import"../c-2SPVQSHC.js";import{a as p}from"../c-5VYOWDTI.js";import"../c-QJ4OM3G6.js";import"../c-MKSQ4Y57.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-LWLBHLVC.js";import"../c-SDAXDM2D.js";import"../c-TQEMVJCS.js";import"../c-DCXOXBF3.js";import"../c-VRZN56XY.js";import{c}from"../c-IJUK2GPW.js";import{e as a}from"../c-OW5QIGG3.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-SPIORRYS.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"../c-VKEDWYDF.js";import{q as u}from"../c-TCJTVAFN.js";import"../c-GQ6F6IDK.js";import"../c-2SPVQSHC.js";import"../c-5VYOWDTI.js";import"../c-QJ4OM3G6.js";import"../c-MKSQ4Y57.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-ZWIOJGMT.js";import"../c-LWLBHLVC.js";import"../c-SDAXDM2D.js";import"../c-TQEMVJCS.js";import"../c-DCXOXBF3.js";import"../c-VRZN56XY.js";import"../c-IJUK2GPW.js";import{e as d}from"../c-OW5QIGG3.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import{b as a}from"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-SPIORRYS.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-M2L47S2X.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"../c-N7JPUPGC.js";import"../c-VHNSBD2M.js";export{a as DRAFT_ATTR,b as DRAFT_PLUGIN,e as draftEligible,d as draftSlot,k as draftStoreFailed,g as draftTransport,i as flushDraft,c as noteBootParams,h as setDraftFlush,j as setDraftStoreFailed,f as setDraftTransport};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,b as n,c as m,d as r}from"../c-VRZN56XY.js";import{d as l}from"../c-OW5QIGG3.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";var e=null,u=0;async function p({fresh:f=!1}={}){let o=location.pathname,t=await r({fresh:f});if(location.pathname!==o||n(t)!==o&&(t=await r({fresh:!0}),location.pathname!==o||n(t)!==o))return e;let a=s(t);if(a==="failed"||a==="ok"&&!t.document)return e;let i=a==="ok"?t.document.writable:void 0,c=m(t);return c<u||(u=c,e=typeof i=="boolean"?i:null,l(e)),e}export{p as checkHostPermission};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n}from"../c-OW5QIGG3.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 canEdit,g as commitModeFacts,a as isDraftMode,d as isEditMode,f as isOwner,e as mode,h as modeState,c as noteHostWritable,j as noteParticipantForget,k as peekModeParticipants,m as registerModeParticipant,n as siteVisibility,i as startsAtImport,l as takeModeParticipants};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as h}from"../c-WYFDLITL.js";import{e as m}from"../c-OW5QIGG3.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{k as b}from"../c-SPIORRYS.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(`
|
|
2
|
+
`)?`
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"../c-MKSQ4Y57.js";import"../c-OW5QIGG3.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{c as createRecovery,a as noteRecoveryCapture,b as noteRecoverySettled,d as recovery};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as B,B as C,C as D,D as E,E as F,F as G,G as H,H as I,I as J,J as K,K as L,L as M,M as N,N as O,O as P,P as Q,Q as R,R as S,S as T,T as U,U as V,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p,p as q,q as r,r as s,s as t,t as u,u as v,v as w,w as x,x as y,y as z,z as A}from"../c-TCJTVAFN.js";import"../c-GQ6F6IDK.js";import"../c-2SPVQSHC.js";import"../c-5VYOWDTI.js";import"../c-QJ4OM3G6.js";import"../c-MKSQ4Y57.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-ZWIOJGMT.js";import{b as c,c as d}from"../c-LWLBHLVC.js";import"../c-SDAXDM2D.js";import"../c-TQEMVJCS.js";import"../c-DCXOXBF3.js";import"../c-VRZN56XY.js";import"../c-IJUK2GPW.js";import"../c-OW5QIGG3.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{m as a,x as b}from"../c-SPIORRYS.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{k as acceptedReceipt,a as addDocumentTransform,l as adoptEntryBaseline,g as autosaveIsSuspended,R as autosaveScheduler,K as baselineSettled,w as closeSavePermit,s as conflictResolvedBySync,L as currentPaintSignature,V as default,G as flushSave,B as getLastSavedBytes,z as getLastSavedContents,A as getLastSavedDirty,b as getPageContents,x as getUnsavedChanges,n as holdAllSaves,U as init,T as initHyperclaySaveButton,S as initSaveKeyboardShortcut,d as inspectSaveSize,r as isSaveConflicted,m as modeParticipant,v as openSavePermit,o as releaseAllSaves,P as releaseBootSettle,I as replacePageWith,f as resumeAutosave,t as saveGeneration,q as saveHoldReason,c as saveLimits,H as saveOverwritingConflict,E as savePage,F as savePageForce,J as savePageSoon,Q as savePageThrottled,j as saveSession,h as savesAdmitted,p as savesHeld,M as schedulePaintHeal,i as sessionParked,C as setLastSavedBaselines,D as setLastSavedContents,u as setSaveGeneration,y as setUnsavedChanges,O as styleAdoptionPending,N as styleAdoptionsSettled,e as suspendAutosave};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"../c-LWLBHLVC.js";import"../c-SDAXDM2D.js";import"../c-TQEMVJCS.js";import"../c-DCXOXBF3.js";import"../c-VRZN56XY.js";import"../c-IJUK2GPW.js";import"../c-OW5QIGG3.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{k as a,m as b,x as c}from"../c-SPIORRYS.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{b as addDocumentTransform,p as buildSaveRequest,m as claimDocumentOperation,c as getPageContents,f as isSaveInProgress,k as mintSaveId,g as onSaveAccepted,h as onSaveAttempt,i as onSaveOutcome,a as onSnapshot,o as operationKind,n as releaseDocumentOperation,t as replacePageWith,l as resetSaveAttempts,r as saveCapturedHtml,s as saveConversion,j as saveFateIsUnknown,q as saveHtml,d as setSaveHeader,e as withKeepalive};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{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-SPIORRYS.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{m as addDocumentTransform,d as attachCaptureArtifact,j as canonicalizeReceived,g as captureArtifact,w as captureBodyForSync,p as captureForComparison,r as captureForComparisonAndDirty,q as captureForDirtyCheck,t as captureForMerge,u as captureForSave,s as captureForSaveAndComparison,f as capturePageState,z as captureRecoveryPage,o as captureSaveClone,n as captureSnapshot,c as currentCaptureContext,a as currentCaptureId,x as getPageContents,k as onSnapshot,b as originalSnapshotNode,h as releaseCaptureArtifact,v as serializeForSync,y as serializeRecoveryClone,e as setCapturePageState,i as setCloneCanonicalizer,l as setSaveRenderer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"../c-TCJTVAFN.js";import"../c-GQ6F6IDK.js";import"../c-2SPVQSHC.js";import"../c-5VYOWDTI.js";import"../c-QJ4OM3G6.js";import"../c-MKSQ4Y57.js";import"../c-WYFDLITL.js";import"../c-UGHH4MB3.js";import"../c-ZWIOJGMT.js";import"../c-LWLBHLVC.js";import"../c-SDAXDM2D.js";import"../c-TQEMVJCS.js";import"../c-DCXOXBF3.js";import"../c-VRZN56XY.js";import"../c-IJUK2GPW.js";import"../c-OW5QIGG3.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-SPIORRYS.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{c as bytesUnsaved,b as hasUnsavedChanges,a as reloadAfterDiscard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../c-VHNSBD2M.js";var g=t=>Array.isArray(t)?t.length===0?!0:t.every(r=>r instanceof Element||r instanceof Node||r instanceof Document):!1,P=(t,r,n)=>({get(f,o){if(o==="length")return t.length;if(o===Symbol.iterator)return t[Symbol.iterator].bind(t);if(typeof o=="symbol")return;if(!isNaN(o))return t[o];if(o in Array.prototype){let e=Array.prototype[o];return(...c)=>{let i=e.apply(t,c);return Array.isArray(i)?g(i)?u(i,r,n):i:(i instanceof Element,i)}}if(o.startsWith("on"))return(e,c)=>{let i=o.slice(2);if(e&&typeof e=="object")return Object.entries(e).forEach(([h,E])=>{t.forEach(l=>{l.addEventListener(i,b=>{let y=b.target.closest(h);y&&l.contains(y)&&E.call(y,b)})})}),u(t,r,n);if(c){let h=e,E=c;t.forEach(l=>{l.addEventListener(i,b=>{let y=b.target.closest(h);y&&l.contains(y)&&E.call(y,b)})})}else{let h=e;t.forEach(E=>E.addEventListener(i,h))}return u(t,r,n)};if(r[o]){let e=r[o];if(typeof e=="function")return u(e(t),r,n);if(typeof e=="object"){if(e.value)return u(e.value(t),r,n);if(e.properties)return j(t,e.properties,r,n)}return e}if(n[o]){let e=n[o];return(...c)=>{let i=e.apply(u(t,r,n),c);return i instanceof Array&&g(i)?u(i,r,n):i}}let s=t[0];if(!s){if(["style","classList","dataset"].includes(o))return A([],o,r,n);let e=Object.getOwnPropertyDescriptor(Element.prototype,o)||Object.getOwnPropertyDescriptor(Node.prototype,o);return e?.get?A([],o,r,n):typeof e?.value=="function"?(...c)=>u([],r,n):void 0}return typeof s[o]=="function"?(...e)=>{let c=t.map(i=>i[o](...e));return c[0]instanceof Element?u(c.filter(Boolean),r,n):c[0]===void 0?u(t,r,n):c}:["style","classList","dataset"].includes(o)?A(t,o,r,n):t.map(e=>e[o])},set(f,o,s){return typeof s=="function"?t.forEach(a=>{a[o]=s(a)}):t.forEach(a=>{a[o]=s}),!0}}),j=(t,r,n,f)=>new Proxy({},{get(o,s){if(r[s]){let a=r[s];return typeof a=="function"?u(a(t),n,f):a}}}),A=(t,r,n,f)=>new Proxy({},{get(o,s){let a=t[0];return a?typeof a[r][s]=="function"?(...c)=>(t.forEach(i=>i[r][s](...c)),u(t,n,f)):t.map(c=>c[r][s]):(...c)=>u(t,n,f)},set(o,s,a){return typeof a=="function"?t.forEach(e=>{e[r][s]=a(e)}):t.forEach(e=>{e[r][s]=a}),!0}}),d={plugins:{},methods:{}},u=(t,r=d.plugins,n=d.methods)=>new Proxy(t,P(t,r,n)),w=t=>{if(t instanceof Element||t instanceof Document)return[t];if(Array.isArray(t)){if(t.every(r=>r instanceof Element||r instanceof Document))return t;throw new TypeError("All array elements must be DOM Elements or Document")}if(typeof t=="string")return Array.from(document.querySelectorAll(t));throw new TypeError("Input must be a selector string, Element, Document, or Array of Elements")},q={methods:{eq(t){if(typeof t!="number")throw new TypeError("eq() requires a number as an argument");let r=t<0?this.length+t:t;return this[r]?[this[r]]:[]},at(t){if(typeof t!="number")throw new TypeError("at() requires a number as an argument");let r=t<0?this.length+t:t;return this[r]},prop(t){if(typeof t!="object"||t===null)throw new TypeError("prop() requires an object of properties");return Object.entries(t).forEach(([r,n])=>{this.forEach(f=>{f[r]=n})}),this},css(t){if(typeof t!="object"||t===null)throw new TypeError("css() requires an object of styles");return Object.entries(t).forEach(([r,n])=>{this.forEach(f=>{f.style[r]=n})}),this},pluck(t){return this.map(r=>r.getAttribute(t))},unique(){return[...new Set(this)]},sortBy(t){if(typeof t=="string"){let r=t;t=n=>n.getAttribute(r)}return[...this].sort((r,n)=>{let f=t(r),o=t(n);return f<o?-1:f>o?1:0})}}},m=new Proxy(function(t,r){if(arguments.length===2){let f;if(typeof r=="string"?f=Array.from(document.querySelectorAll(r)):f=w(r),typeof t=="string"){let a=f.flatMap(e=>{let c=e.matches?.(t)?[e]:[],i=Array.from(e.querySelectorAll(t));return[...c,...i]});return u(a)}let s=w(t).filter(a=>f.some(e=>e.contains(a)));return u(s)}let n=w(t);return u(n)},{get(t,r){if(r==="use")return function(f){if(!f||typeof f!="object")throw new TypeError('Plugin must be an object with "properties" or "methods"');return f.properties&&Object.assign(d.plugins,f.properties),f.methods&&Object.assign(d.methods,f.methods),this};if(r===Symbol.iterator)return;if(r in t)return t[r];let n=Array.from(document.querySelectorAll(`[${r}], .${r}`));return u(n)}});m.use(q);var v=m;export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h,b as m}from"../c-XQXZAO7N.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";function a(i,r,o=e=>e){let e=new Set;function t(s){if(!s||e.has(s))return null;let f=[s],c=new Set;for(;f.length>0;){let u=f.shift();if(!(!u||c.has(u)||e.has(u))){if(e.add(u),c.add(u),u.matches(r))return u;f.push(...u.children)}}return null}function n(s,f){let c=s[f];for(;c;){let u=t(c);if(u)return u;c=c[f]}return null}let l=i;for(;l;){if(!e.has(l)&&(e.add(l),l.matches(r)))return o(l);for(let f of l.children){let c=t(f);if(c)return o(c)}let s=n(l,"previousElementSibling")||n(l,"nextElementSibling");if(s)return o(s);l=l.parentElement}return null}var d=(...i)=>r=>i.reduce((o,e)=>e(o),r);function g(){window.clay=window.clay||{},window.clay.dom=Object.assign(window.clay.dom||{},{createContentView:h,cleanContentClone:m}),!HTMLElement.prototype.hasOwnProperty("nearest")&&(Object.defineProperty(HTMLElement.prototype,"el",{configurable:!0,get:function(){let i=this,r={get(o,e){return a(i,`[${e}], .${e}`)}};return new Proxy({},r)}}),Object.defineProperty(HTMLElement.prototype,"nearest",{configurable:!0,get:function(){let i=this,r={get(o,e){return a(i,`[${e}], .${e}`)}};return new Proxy({},r)}}),Object.defineProperty(HTMLElement.prototype,"val",{configurable:!0,get:function(){let i=this,r=e=>e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA",o={get(e,t){return a(i,`[${t}], .${t}`,n=>r(n)?n.value:n.getAttribute(t))},set(e,t,n){let l=a(i,`[${t}], .${t}`);return l&&(r(l)?l.value=n:l.setAttribute(t,n)),!0}};return new Proxy({},o)}}),Object.defineProperty(HTMLElement.prototype,"text",{configurable:!0,get:function(){let i=this,r={get(o,e){return a(i,`[${e}], .${e}`,t=>t.innerText)},set(o,e,t){let n=a(i,`[${e}], .${e}`);return n&&(n.innerText=t),!0}};return new Proxy({},r)}}),Object.defineProperty(HTMLElement.prototype,"exec",{configurable:!0,get:function(){let i=this,r={get(o,e){return function(){let t=a(i,`[${e}], .${e}`);if(t){let n=t.getAttribute(e);if(n)return new Function(n).call(t)}}}};return new Proxy({},r)}}),Element.prototype.cycle=function(i=1,r){let o=r.replace(/:/g,"\\:"),e=d(()=>document.querySelectorAll(`[${o}]`),t=>Array.from(t).map(n=>({element:n,value:n.textContent.trim()})),t=>[...new Map(t.map(n=>[n.value,n])).values()],t=>t.sort((n,l)=>n.value.localeCompare(l.value)),t=>t[(t.findIndex(n=>n.value===this.textContent.trim())+i+t.length)%t.length],t=>t.element)();e&&this.replaceWith(e.cloneNode(!0))},Element.prototype.cycleAttr=function(i=1,r,o){o=o||r;let e=o.replace(/:/g,"\\:"),t=d(()=>document.querySelectorAll(`[${e}]`),n=>[...new Set(Array.from(n).map(l=>l.getAttribute(o)))],n=>n.sort(),n=>n[(n.indexOf(this.getAttribute(r))+i+n.length)%n.length])();t&&this.setAttribute(r,t)},Element.prototype.show=function(){return this.style.display="",this},Element.prototype.hide=function(){return this.style.display="none",this})}g();var x=g;export{m as cleanContentClone,h as createContentView,x as default,g as init};
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as t,q as n,t as i}from"../c-LWLBHLVC.js";import"../c-SDAXDM2D.js";import"../c-TQEMVJCS.js";import"../c-DCXOXBF3.js";import"../c-VRZN56XY.js";import"../c-IJUK2GPW.js";import"../c-OW5QIGG3.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import{m as a,n as e,u as o}from"../c-SPIORRYS.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};
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as H}from"./c-46XYM55L.js";import{a as $}from"./c-GY422N3Q.js";import"./c-7SWMYKAI.js";import{b as G}from"./c-FILLTJA7.js";import{a as F}from"./c-VKEDWYDF.js";import"./c-UGHH4MB3.js";import"./c-ZWIOJGMT.js";import"./c-IJUK2GPW.js";import{b as N}from"./c-CYWLPPUS.js";import{i as B}from"./c-VG5XIN4T.js";import{a as U}from"./c-2YYDMLNZ.js";import{c as _,l as q}from"./c-HA6INT6J.js";import"./c-DCFSEJZG.js";import"./c-WRBKEJD4.js";import"./c-VHNSBD2M.js";var W={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"]},v={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},"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}},w={"core/is-edit-mode.js":()=>import("./core/is-edit-mode-KTWA3O5N.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-DXYCURFF.js").then(t=>t.core["lib/mutation.js"]),"core/edit-mode.js":()=>import("./reader-core-DXYCURFF.js").then(t=>t.core["core/edit-mode.js"]),"core/mode-key.js":()=>import("./reader-core-DXYCURFF.js").then(t=>t.core["core/mode-key.js"]),"core/stale-host-notice.js":()=>import("./reader-core-DXYCURFF.js").then(t=>t.core["core/stale-host-notice.js"]),"core/page-data.js":()=>import("./reader-core-DXYCURFF.js").then(t=>t.core["core/page-data.js"]),"core/preserve-authored.js":()=>import("./reader-core-DXYCURFF.js").then(t=>t.core["core/preserve-authored.js"]),"core/snapshot.js":()=>import("./core/snapshot-EGQZNT45.js"),"core/save-core.js":()=>import("./core/save-core-KGQWFUNH.js"),"core/save.js":()=>import("./core/save-HQZ4S667.js"),"core/conflict-notice.js":()=>import("./core/conflict-notice-6MROJN2L.js"),"core/recovery.js":()=>import("./core/recovery-FLTCC2OC.js"),"core/unsaved-warning.js":()=>import("./core/unsaved-warning-IDJLD66H.js"),"core/persist.js":()=>import("./core/persist-JFYRHMRJ.js"),"core/admin-attrs.js":()=>import("./core/admin-attrs-QHOKPJ7W.js"),"core/autosave.js":()=>import("./core/autosave-HRYGUWV6.js"),"attrs/save-freeze.js":()=>import("./attrs/save-freeze-MYNVXREN.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-NRQDSWX6.js"),"plugins/indicator.js":()=>import("./plugins/indicator-URDBBOQO.js"),"sync/live-sync.js":()=>import("./sync/live-sync-J7VMYTKS.js"),"plugins/live.js":()=>import("./plugins/live-HFWD4OIH.js"),"plugins/page.js":()=>import("./plugins/page-JOKB6XPR.js"),"plugins/page-view.js":()=>import("./plugins/page-view-NXOJHNW6.js"),"plugins/sortable.js":()=>import("./plugins/sortable-GWT4PWDV.js"),"plugins/undo.js":()=>import("./plugins/undo-VDA5P7FH.js"),"plugins/unsent.js":()=>import("./plugins/unsent-HJFLQJ2O.js"),"plugins/cms.js":()=>import("./plugins/cms-HP3LSTPN.js"),"plugins/quickcrop.js":()=>import("./plugins/quickcrop-QNY3PKLD.js"),"plugins/upload.js":()=>import("./plugins/upload-WLYKK6TL.js"),"plugins/people.js":()=>import("./plugins/people-SGPJKANK.js"),"plugins/menu.js":()=>import("./plugins/menu-3HIEQSI6.js"),"plugins/wire.js":()=>import("./plugins/wire-4N6GYAF6.js"),"plugins/message.js":()=>import("./plugins/message-LQ6EDH4V.js"),"plugins/ai-edit.js":()=>import("./plugins/ai-edit-QN4PMMNL.js"),"plugins/demo.js":()=>import("./plugins/demo-RM5IR6AO.js"),"plugins/visitor-drafts.js":()=>import("./plugins/visitor-drafts-LIDY7NH6.js"),"plugins/visitor-drafts-owner.js":()=>import("./plugins/visitor-drafts-owner-ZXCKBZE7.js"),"plugins/bind-text.js":()=>import("./plugins/bind-text-NX46N5UV.js"),"plugins/source.js":()=>import("./plugins/source-4ZRSAIYM.js"),"plugins/derive.js":()=>import("./plugins/derive-UAAA4V4S.js"),"plugins/upgrade.js":()=>import("./plugins/upgrade-W7FG5VFG.js")},te=["visitor-drafts","richclay","indicator","sortable","undo","unsent","quickcrop","upload","people","menu","upgrade","cms","page-view","sync","live","page","message","wire","ai-edit","demo","derive","bind-text","source"],se={cms:["quickcrop","upload"],"ai-edit":["wire"],page:["live","sync","upload"]},oe={page:["richclay"]},ne=new Set(["source","sortable","menu","upgrade"]);function z(t,e,o,s){let d=t.get(e);if(d)for(let i of d.split(",")){let a=i.trim();if(a){if(!v[a]||v[a].internal){console.warn(`clayjs: unknown plugin "${a}"`);continue}s(o,a)}}}var ie=["sync","live","page","upload","quickcrop","cms","people","menu","upgrade","wire","ai-edit","demo","source"],re=["attrs/refetch-on-save.js","core/conflict-notice.js"],ae="https://hyperclay.com/templates/";function E(t,e,{isDraftMode:o=!1,hasSap:s=!1,canEdit:d=!1,templateSource:i=null}={}){let a=[...W.always];e&&a.push(...W.editOnly);let g=new Set;z(t,"plugins",g,(n,l)=>n.add(l));let p=new Set;z(t,"exclude",p,(n,l)=>n.add(l));let r=new Set(g);for(let[n,l]of Object.entries(v))l.default&&r.add(n);s&&r.add("derive"),p.has("wire")&&r.delete("ai-edit"),!e&&!o&&r.has("page")&&r.add("page-view");for(let n of[...r])if(!p.has(n)&&!(v[n].editOnly&&!e))for(let l of se[n]||[])r.add(l);for(let n of p)r.delete(n);if(o){for(let n of ie)r.delete(n);for(let n of re){let l=a.indexOf(n);l>-1&&a.splice(l,1)}r.add("visitor-drafts")}!o&&d&&!p.has("upgrade")&&i&&i.startsWith(ae)&&r.add("upgrade");for(let[n,l]of Object.entries(oe))if(r.has(n))for(let j of l)g.has(j)||r.delete(j);let y=[],u=[];for(let n of te){if(!r.has(n))continue;let l=v[n];l.editOnly&&!e||(ne.has(n)?u:y).push(l.ownerPath&&!o?l.ownerPath:l.path)}return{core:a,plugins:y,late:u}}var D="data-deleted-at",T=(t,e)=>window.clay?.undo?.commit?window.clay.undo.commit(t,e):e(),V=(t,e)=>t.dispatchEvent(new CustomEvent(e,{bubbles:!0})),x=Object.assign((t,{at:e=new Date().toISOString()}={})=>(T("Move to Trash",()=>t.setAttribute(D,e)),V(t,"clay:trashed"),{undo:()=>x.restore(t)}),{is:t=>!!t.getAttribute(D),restore(t){T("Restore",()=>t.removeAttribute(D)),V(t,"clay:restored")},purge(t){T("Delete forever",()=>t.remove())}});var J=50,ce=1e3,le='[clay~="no-snapshot"], [no-snapshot], [snapshot-remove]',P=0,ue=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 de(t){let e=window.clay?.region?.resolveRegionPolicy;if(!e)return null;let o=s=>!!s&&!s.closest(le)&&e(s).dirtyTracked;for(let s of t){if(s.type==="attributes"&&q(s.attributeName,s.target))continue;let d=s.target.nodeType===1?s.target:s.target.parentElement;if(o(d)&&!(s.type==="childList"&&![...s.addedNodes,...s.removedNodes].some(i=>i.nodeType!==1||o(i))))return s.target}return null}function A(t){let e=window.clay,o=e.Mutation,s=new Set,d=(c,m)=>{s.has(c)||(s.add(c),console.warn("clay.effect: "+m))},i=!1,a=!1,g=0,p=0;P&&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 r=()=>{let c=Date.now();c-g>ce&&(g=c,p=0),++p>J&&d("loop",`this effect ran more than ${J} times in a second. Something keeps changing the document, often a timer or async callback the effect started.`)},y=()=>{if(i=!1,a)return;let c=null;o.pause(),P++;try{e.isEditMode===!0&&(r(),s.has("saved")||(c=new MutationObserver(()=>{}),c.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0})));let m=t();m&&typeof m.then=="function"&&(b(),console.error("clay.effect: fn returned a promise. It must be synchronous, so this effect was stopped."))}catch(m){console.error("clay.effect:",m)}finally{P--,o.resume();let m=c?c.takeRecords():[];if(c?.disconnect(),m.length){let O=de(m);O&&d("saved",`this effect changed ${ue(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".`)}}},u=()=>{i||a||(i=!0,queueMicrotask(y))},n=["undo","redo"],l=()=>{for(let c of n)e.undo?.on?.(c,u)},j=o.onAnyChange({debounce:0,require:"observed"},u);document.addEventListener("clay:sync-applied",u),document.addEventListener("clay:modechange",l),l();let b=()=>{a=!0,j(),document.removeEventListener("clay:sync-applied",u),document.removeEventListener("clay:modechange",l);for(let c of n)e.undo?.off?.(c,u)};return u(),b}Object.defineProperty(A,"running",{get:()=>P>0});var pe={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")};function fe(t){let e=new Map;function o(s){return Object.hasOwn(t,s)?(e.has(s)||e.set(s,t[s]().catch(d=>{throw e.delete(s),d})),e.get(s)):Promise.reject(new Error(`clay.assets: no asset named "${s}"`))}return{load:o,names:()=>Object.keys(t)}}var X=fe(pe);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 ge="plugins/page.js";function M(t,e,{isEditMode:o=!1,isDraftMode:s=!1,hasSapJs:d=!1}={},i=document){if(!t?.entries)return 0;let a=[...e];for(let u of e)for(let n of t.bootImports?.[u]??[])d&&n==="vendor/sap-core.vendor.js"||a.push(n);o&&!s&&a.push(...t.editBootImports??[]),o&&!s&&e.includes(ge)&&a.push(...t.editorBootImports??[]);let g=new Set,p=u=>{if(!(!u||g.has(u))){g.add(u);for(let n of t.imports?.[u]??[])p(n)}};for(let u of a)p(t.entries[u]);let r=new Set([...i.querySelectorAll('link[rel="modulepreload"]')].map(u=>u.href)),y=0;for(let u of g){let n=new URL(u,t.base).href;if(r.has(n))continue;let l=i.createElement("link");l.rel="modulepreload",l.href=n,l.setAttribute("clay","no-save"),i.head.append(l),y++}return y}var k=Object.fromEntries(Object.entries(v).flatMap(([t,e])=>e.ownerPath?[[e.path,t],[e.ownerPath,t]]:[[e.path,t]])),h={},K=new Set;function Y(t){K.has(t)||(K.add(t),document.dispatchEvent(new CustomEvent("clay:plugin-ready",{detail:{plugin:k[t]}})))}var me=(t,e,o,s)=>()=>t().then(d=>(M(L(e,d),[...o.core,...o.plugins,...o.late],{isEditMode:!0,hasSapJs:s}),d));function he(){return new Promise(t=>F(t))}function C(){let t=document.querySelector('meta[name="hyper-source"]');return t?t.getAttribute("content"):null}async function Be(t,e,o,s=null,d=null,i=null){H(),(await w["core/draft-mode.js"]()).noteBootParams(e),await he();let g=await w["core/is-edit-mode.js"](),{isEditMode:p,isDraftMode:r,isOwner:y,siteVisibility:u,canEdit:n}=g;p&&!r&&import("./core/host-permission-FNXVEFNE.js").then(f=>f.checkHostPermission()).catch(()=>{}),window.__hyperclayEditMode=p;let l=await w["lib/region-policy.js"](),j=!!document.querySelector("[sap]"),b=!!document.querySelector('script[src*="sap.js"]');U.holdSettle=j&&p;let c=E(e,p,{isDraftMode:r,hasSap:j,canEdit:n,templateSource:C()});c.plugins.includes("plugins/demo.js")&&g.commitModeFacts({destination:"demo"}),M(L(s,d),[...c.core,...c.plugins],{isEditMode:p,isDraftMode:r,hasSapJs:b}),(p||r)&&!d&&i&&i().then(f=>M(L(s,f),[...c.core,...c.plugins],{isEditMode:p,isDraftMode:r,hasSapJs:b})).catch(()=>{});let m,O=new Promise(f=>{m=f}),Z={sync:c.plugins.includes("sync/live-sync.js")};for(let f of c.core)h[f]=await w[f](),h[f].install?.();if(ve(h,{isDraftMode:r,isOwner:y,siteVisibility:u},l),Q(h),document.documentElement.getAttribute("clay-mode-switch")==="live"){let f=E(e,!0,{isDraftMode:r,hasSap:j,canEdit:n,templateSource:C()});h["core/edit-mode.js"].noteLiveSwitch({edit:f,view:E(e,!1,{isDraftMode:r,hasSap:j,canEdit:n,templateSource:C()}),loaded:h,modules:w,attach:I,attachEditCore:Q,announce:Y,loadEditHints:i?me(i,s,f,b):null,late:O})}await h["core/edit-mode.js"].activateInitialMode(),window.clay.plugins=Object.freeze([...c.plugins,...c.late].map(f=>k[f]));for(let f of c.plugins){let S;try{S=await w[f]()}catch(ee){console.error(`clayjs: plugin "${f}" failed to load, continuing without it:`,ee);continue}h[f]=S,f==="plugins/page-view.js"&&S.start(Z),I(f,S,h)}await Promise.allSettled(c.plugins.map(f=>h[f]?.ready).filter(Boolean)),j&&je(h),we(g),o(window.clay),document.dispatchEvent(new CustomEvent("clay:ready",{detail:{clay:window.clay}})),c.late.length?ye(c.late,g).then(m,m):m()}var R=(t,e)=>v[k[t]]?.editOnly&&!e.startsAtImport();async function ye(t,e){try{await window.clay.page?.ready}catch{}for(let o of t)if(!R(o,e))try{let s=await w[o]();if(R(o,e)||(h[o]=s,I(o,s,h),await s.ready,R(o,e)))continue;Y(o)}catch(s){console.error(`clayjs: plugin "${o}" failed to load, continuing without it:`,s),document.dispatchEvent(new CustomEvent("clay:plugin-failed",{detail:{plugin:k[o]}}))}}function je(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 ve(t,{isDraftMode:e,isOwner:o,siteVisibility:s},d){let i=window.clay,a=t["lib/mutation.js"],g=t["core/edit-mode.js"];Object.assign(i,{toggleEditMode:g.toggleEditMode,setMode:g.setMode,modeLifecycle:g.modeLifecycle,isDraftMode:e,isOwner:o,siteVisibility:s,Mutation:a.default,region:d.windowRegionShape});for(let r of["mode","isEditMode","canEdit"])Object.defineProperty(i,r,{get:()=>g[r],enumerable:!0,configurable:!0});i.assets=X;let p=t["core/page-data.js"];i.readData=p.readData,i.writeData=p.writeData,i.ephemeral=_,i.storage=N,i.host={get versions(){return import("./c-6AZOGAPE.js").then(r=>r.hostVersions())}},i.trash=x,i.derived=B,i.effect=A,i.style=$,i.morph=(r,y,u)=>G().then(({morph:n})=>n(r,y,u))}function Q(t){let e=window.clay,o=t["core/save.js"];if(o){let a=o.savePage||o.default;a.force=o.savePageForce,a.overwrite=o.saveOverwritingConflict,a.flush=o.flushSave,a.soon=o.savePageSoon,a.limits=o.saveLimits,a.inspect=o.inspectSaveSize,e.save!==a&&typeof e.save?.replace=="function"&&(a.replace=e.save.replace),e.save!==a&&(e.save=a)}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 d=t["lib/cache-bust.js"];d&&!e.cacheBust&&(e.cacheBust=d.default);let i=t["core/recovery.js"];i&&!e.recovery&&(e.recovery=i.recovery)}function I(t,e,o=h){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/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 we(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{Be as boot,je as mountDerivedEngine};
|