@panphora/clayjs 1.24.0 → 1.25.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/dist/all.js +1 -1
- package/dist/clay-dom.js +1 -1
- package/dist/clay-events.js +1 -1
- package/dist/clay-internals.js +1 -1
- package/dist/clay-options.js +1 -1
- package/dist/clay-router.js +1 -1
- package/dist/clay-ui.js +1 -1
- package/dist/clay-utils.js +1 -1
- package/dist/clay.js +1 -1
- package/dist/clay.standalone.js +16610 -14400
- package/dist/m/attrs/{refetch-on-save-DPGJJMGN.js → refetch-on-save-5CBFUJUF.js} +1 -1
- package/dist/m/attrs/save-freeze-MH3AOD56.js +1 -0
- package/dist/m/c-277QP5ET.js +1 -0
- package/dist/m/{c-SXGEWPFC.js → c-3E2IK5HU.js} +1 -1
- package/dist/m/{c-A4L7APIU.js → c-4AE2A2LK.js} +1 -1
- package/dist/m/{c-DZPO22O3.js → c-4Q6QIODW.js} +1 -1
- package/dist/m/{c-RO73MKKR.js → c-52OC3OH3.js} +1 -1
- package/dist/m/{c-VNAYHV2J.js → c-5PZYDWTW.js} +1 -1
- package/dist/m/c-5Q5XBN56.js +1 -0
- package/dist/m/c-5SZ6KFR5.js +1 -0
- package/dist/m/{c-ZRGEN6QQ.js → c-AI3H6ETU.js} +2 -2
- package/dist/m/{c-7V6MGMX2.js → c-BCWYEG6P.js} +1 -1
- package/dist/m/{c-A7N5TNSL.js → c-BJ2RRQBQ.js} +1 -1
- package/dist/m/{c-CTGRDT6E.js → c-C6YZNU6E.js} +1 -1
- package/dist/m/{c-DLBX4JCJ.js → c-C7SUMNMI.js} +1 -1
- package/dist/m/c-CITLTVQ4.js +4 -0
- package/dist/m/{c-TWOXQQKV.js → c-CL5LSATX.js} +1 -1
- package/dist/m/c-CU33V6RW.js +4 -0
- package/dist/m/{c-2R4OBWIP.js → c-D62HRSZK.js} +1 -1
- package/dist/m/{c-DD26VXAP.js → c-DT7E76Z2.js} +1 -1
- package/dist/m/{c-54ZZZYUN.js → c-EAV7A6BT.js} +1 -1
- package/dist/m/{c-RBPZNU2D.js → c-EQ5NBOGA.js} +1 -1
- package/dist/m/{c-KQKKIVLW.js → c-FBOO2UY3.js} +1 -1
- package/dist/m/{c-RTSRGGTP.js → c-FJDTDGDA.js} +1 -1
- package/dist/m/{c-MQKSKQHG.js → c-FKTALXNV.js} +1 -1
- package/dist/m/{c-GNIVHLEJ.js → c-GDNZEOOZ.js} +1 -1
- package/dist/m/{c-SUXHUL7U.js → c-GEAG5XAK.js} +1 -1
- package/dist/m/{c-UM7VZDTW.js → c-GY4BREDT.js} +1 -1
- package/dist/m/{c-4PO3YGDC.js → c-HGG7M2S3.js} +1 -1
- package/dist/m/c-HKSLOVU4.js +1 -0
- package/dist/m/{c-KJHVB2KG.js → c-HXGNH6GY.js} +1 -1
- package/dist/m/{c-FLEIU6CG.js → c-IESDKFO6.js} +1 -1
- package/dist/m/{c-SNVDWMM3.js → c-IJHF4IO6.js} +1 -1
- package/dist/m/{c-SGGGCIVD.js → c-IL5IVTOG.js} +1 -1
- package/dist/m/c-JB5YU57S.js +1 -0
- package/dist/m/{c-MP6S4AZU.js → c-JD2VFAYG.js} +2 -2
- package/dist/m/{c-CV4T65JE.js → c-JWW6BHWD.js} +3 -3
- package/dist/m/{c-GM7OA6EJ.js → c-K4M76VPM.js} +1 -1
- package/dist/m/{c-RXTPKCMC.js → c-KU3PX7LL.js} +1 -1
- package/dist/m/{c-2PVGJFI5.js → c-KYTVZT4D.js} +1 -1
- package/dist/m/{c-RJKKRWHW.js → c-M7ITYKMF.js} +1 -1
- package/dist/m/c-MFB74XVN.js +3 -0
- package/dist/m/c-MOP5KBWZ.js +1 -0
- package/dist/m/{c-YB3CDTDZ.js → c-MUM53J5J.js} +1 -1
- package/dist/m/{c-YK2L436K.js → c-MV7TEUTD.js} +1 -1
- package/dist/m/{c-LA2BW7UY.js → c-MZCOGNZL.js} +1 -1
- package/dist/m/{c-YGGO2G2L.js → c-N4GEJMXW.js} +1 -1
- package/dist/m/{c-NQAPWM7O.js → c-NADLYVAH.js} +1 -1
- package/dist/m/{c-RS77ODLY.js → c-NL4I4KNG.js} +1 -1
- package/dist/m/{c-6UPEKW6O.js → c-O2QZDVZ2.js} +1 -1
- package/dist/m/{c-LTSPHVAK.js → c-OBMZASYQ.js} +1 -1
- package/dist/m/{c-LUXAB2XI.js → c-ORLPQFNU.js} +1 -1
- package/dist/m/c-P73XPAOA.js +1 -0
- package/dist/m/{c-PWJSJEJU.js → c-PNZIJFG7.js} +1 -1
- package/dist/m/{c-ZKKAF4UT.js → c-PRZNJUYZ.js} +2 -2
- package/dist/m/{c-Q6VNQDJE.js → c-Q2CB57UG.js} +1 -1
- package/dist/m/{c-TWCXBWS3.js → c-QCDVDZIR.js} +1 -1
- package/dist/m/{c-P5NKFRL4.js → c-QDVG4NAZ.js} +1 -1
- package/dist/m/c-QWB53KRW.js +1 -0
- package/dist/m/{c-GNI7WHKF.js → c-RGAALCDU.js} +1 -1
- package/dist/m/c-RHPHMTF2.js +2 -0
- package/dist/m/{c-BULK5J4M.js → c-RWJ3OSCP.js} +1 -1
- package/dist/m/{c-5FXEKU4Y.js → c-SEVOS4UE.js} +1 -1
- package/dist/m/{c-PMRRMT72.js → c-SFYTKRU7.js} +1 -1
- package/dist/m/{c-47IBJGPQ.js → c-SFZRY6RT.js} +1 -1
- package/dist/m/{c-QENKN7QI.js → c-SGG6MUXW.js} +1 -1
- package/dist/m/c-SMLAJASY.js +1 -0
- package/dist/m/{c-VSEUFJAO.js → c-SUAC5RSG.js} +1 -1
- package/dist/m/{c-6RGEQNVV.js → c-SXZYVXD6.js} +1 -1
- package/dist/m/{c-ZFO5RW6G.js → c-TCFVG3I4.js} +1 -1
- package/dist/m/{c-PZRWZZRO.js → c-TLQINES7.js} +2 -2
- package/dist/m/c-U4TWEIKZ.js +1 -0
- package/dist/m/{c-FZRZPIFS.js → c-U65PREMC.js} +1 -1
- package/dist/m/{c-7YETSAVY.js → c-U7F66I64.js} +1 -1
- package/dist/m/{c-WOELSNWS.js → c-UD4VDBGJ.js} +1 -1
- package/dist/m/{c-VI3BJHCM.js → c-V2FPBRO6.js} +1 -1
- package/dist/m/{c-2OIKXOY6.js → c-V4B3RUWB.js} +1 -1
- package/dist/m/{c-O5ARALMJ.js → c-V5L6HWVL.js} +1 -1
- package/dist/m/c-VMXCX52Q.js +1 -0
- package/dist/m/{c-PVJMJL3P.js → c-VO6RSFCO.js} +1 -1
- package/dist/m/c-WDFQ7PBU.js +1 -0
- package/dist/m/{c-OG6GFSUX.js → c-WGQVSKKC.js} +1 -1
- package/dist/m/c-WSTUCBHV.js +1 -0
- package/dist/m/{c-EY5KDUZF.js → c-WVCT3ITX.js} +1 -1
- package/dist/m/{c-SE3SIY7Y.js → c-X3V4RWMA.js} +1 -1
- package/dist/m/{c-HIX5H5L7.js → c-XHZIKRCV.js} +1 -1
- package/dist/m/{c-2BLVA6IN.js → c-XQTERKQA.js} +1 -1
- package/dist/m/{c-A5ZBFICF.js → c-YFO6ZJLQ.js} +1 -1
- package/dist/m/{c-PD5AKHY3.js → c-YX2MC7YL.js} +1 -1
- package/dist/m/{c-OYHI67B6.js → c-YYGUHSZR.js} +1 -1
- package/dist/m/{c-YYMZWQLR.js → c-Z2OZFX3N.js} +1 -1
- package/dist/m/{c-AT7GLQGV.js → c-ZEA3DCG3.js} +1 -1
- package/dist/m/{c-75N3KG35.js → c-ZJG6C2WL.js} +1 -1
- package/dist/m/{c-FVPNX2GO.js → c-ZORVIXUR.js} +1 -1
- package/dist/m/{c-FV46ZKGX.js → c-ZPI7M5U5.js} +1 -1
- package/dist/m/core/{admin-attrs-5UGMYCKW.js → admin-attrs-ZI6K6UGM.js} +1 -1
- package/dist/m/core/{autosave-4P66VXX7.js → autosave-BSM2ABJL.js} +1 -1
- package/dist/m/core/{conflict-notice-BAR23OWH.js → conflict-notice-7EQLDYPA.js} +1 -1
- package/dist/m/core/draft-mode-M5XNYBMY.js +1 -0
- package/dist/m/core/{host-permission-3HE4CFD6.js → host-permission-5BYP24GC.js} +1 -1
- package/dist/m/core/{is-edit-mode-GK7IFFMT.js → is-edit-mode-73OXKK5H.js} +1 -1
- package/dist/m/core/{persist-AIJGTKKI.js → persist-2SZO3PCE.js} +1 -1
- package/dist/m/core/{recovery-LPB6X72P.js → recovery-VZF7RJZF.js} +1 -1
- package/dist/m/core/{save-FV4ZCKBI.js → save-K6Q47J2X.js} +1 -1
- package/dist/m/core/{save-core-K7XFAWQ4.js → save-core-U3Z44XBO.js} +1 -1
- package/dist/m/core/{site-edits-TEQORBJU.js → site-edits-CFMF6GHD.js} +1 -1
- package/dist/m/core/{snapshot-FJP5IJL3.js → snapshot-PWCHYFL6.js} +1 -1
- package/dist/m/core/unsaved-warning-2WRZLJH5.js +1 -0
- package/dist/m/events/{index-B6TGDYMG.js → index-YKQIBZE5.js} +1 -1
- package/dist/m/internals/index-FSLC4M7J.js +1 -0
- package/dist/m/lib/{cache-bust-NH7VBWHO.js → cache-bust-BL4KUQAJ.js} +1 -1
- package/dist/m/loader-RC54UV7H.js +1 -0
- package/dist/m/manifest-3B84C829.js +1 -0
- package/dist/m/manifest-edit-1CB79AD4.js +1 -0
- package/dist/m/manifest.json +1215 -1129
- package/dist/m/options/{options-55LQHSJ4.js → options-LKIZ7YTG.js} +1 -1
- package/dist/m/page/{editor-KAZDJNND.js → editor-PKSPJ2XJ.js} +2 -2
- package/dist/m/plugins/{ai-edit-CUKQQWJX.js → ai-edit-3LG6MGS3.js} +1 -1
- package/dist/m/plugins/{cms-JANMGPHM.js → cms-T2HLI7JG.js} +16 -16
- package/dist/m/plugins/{demo-JIR7DXJA.js → demo-LMCMBILC.js} +1 -1
- package/dist/m/plugins/{derive-QVI3LI3A.js → derive-7DR5TUDH.js} +1 -1
- package/dist/m/plugins/{indicator-DAKZGAWI.js → indicator-CTKX4EY7.js} +1 -1
- package/dist/m/plugins/{live-UAJGWRNP.js → live-IFLL6YN5.js} +1 -1
- package/dist/m/plugins/{menu-BFJ644YX.js → menu-YJZ3JWBC.js} +1 -1
- package/dist/m/plugins/page-GTDPYGE4.js +2 -0
- package/dist/m/plugins/{page-view-OYN7Z5TS.js → page-view-NMCCU6MF.js} +1 -1
- package/dist/m/plugins/{people-VBDR5Y22.js → people-6WIWCZEG.js} +1 -1
- package/dist/m/plugins/{richclay-CBLZRFB4.js → richclay-L3BZMX4I.js} +3 -3
- package/dist/m/plugins/sortable-365SRRL3.js +1 -0
- package/dist/m/plugins/{source-ZXDD7F6X.js → source-7LSGOV46.js} +1 -1
- package/dist/m/plugins/{undo-5JI5G7CQ.js → undo-UES4KS7B.js} +1 -1
- package/dist/m/plugins/{upgrade-6B6QS3NR.js → upgrade-MMPZUCDM.js} +1 -1
- package/dist/m/plugins/{upload-DNJNW6H3.js → upload-NZET3DNQ.js} +1 -1
- package/dist/m/plugins/visitor-drafts-V5YB7XDH.js +20 -0
- package/dist/m/plugins/{visitor-drafts-owner-VIAZC3CF.js → visitor-drafts-owner-TLECTYWS.js} +1 -1
- package/dist/m/plugins/{visitor-menu-ZHKWIKKY.js → visitor-menu-QDV2MYJN.js} +1 -1
- package/dist/m/plugins/wire-3YGUO3GE.js +1 -0
- package/dist/m/{reader-core-F6RY3V64.js → reader-core-VR7EL4WV.js} +2 -2
- package/dist/m/sync/live-sync-XMXXZS3G.js +1 -0
- package/dist/m/vendor/sap-core.vendor-JANUQULT.js +7 -0
- package/dist/offline-manifest.json +724 -664
- package/docs/guide.md +1 -0
- package/entries/clay-data.js +1 -1
- package/entries/sap.js +6 -5
- package/package.json +2 -2
- package/src/core/draft-mode.js +11 -0
- package/src/core/save-core.js +16 -17
- package/src/core/save.js +1 -1
- package/src/core/unsaved-warning.js +2 -2
- package/src/lib/dirty-gate.js +19 -0
- package/src/lib/idb-error-code.js +20 -0
- package/src/loader.js +2 -0
- package/src/plugins/menu/visitor.js +33 -1
- package/src/plugins/page.js +19 -5
- package/src/plugins/sortable.js +7 -0
- package/src/plugins/visitor-drafts/commit.js +350 -0
- package/src/plugins/visitor-drafts/idb.js +227 -0
- package/src/plugins/visitor-drafts/prompt.js +23 -3
- package/src/plugins/visitor-drafts/recovery-menu.js +118 -0
- package/src/plugins/visitor-drafts/recovery.js +64 -0
- package/src/plugins/visitor-drafts/session.js +393 -0
- package/src/plugins/visitor-drafts/store.js +247 -27
- package/src/plugins/visitor-drafts.js +177 -28
- package/src/sync/live-sync.js +1 -1
- package/src/sync/wire-profile.js +9 -4
- package/src/vendor/hyper-html-api-data.vendor.js +1 -1
- package/src/vendor/hyper-html-api-upgrade.vendor.js +2 -2
- package/src/vendor/hypercms.vendor.js +16 -16
- package/src/vendor/richclay.vendor.js +1 -1
- package/src/vendor/sap-core.vendor.js +6 -5
- package/src/vendor/sap-ownership.vendor.js +181 -11
- package/tool-generation/system.md +1 -1
- package/dist/m/attrs/save-freeze-JZHKRQLR.js +0 -1
- package/dist/m/c-234RSEIW.js +0 -1
- package/dist/m/c-2YIJ6ZA6.js +0 -1
- package/dist/m/c-H2H7TI6O.js +0 -1
- package/dist/m/c-HSNGLIFB.js +0 -3
- package/dist/m/c-JMDKPBMC.js +0 -4
- package/dist/m/c-LO4C4J77.js +0 -1
- package/dist/m/c-N7JPUPGC.js +0 -1
- package/dist/m/c-NEXFVJIT.js +0 -1
- package/dist/m/c-R23UHMXG.js +0 -1
- package/dist/m/c-T527QHOB.js +0 -1
- package/dist/m/c-V2U3F4QX.js +0 -1
- package/dist/m/c-VG5XIN4T.js +0 -1
- package/dist/m/c-YINHPF4V.js +0 -1
- package/dist/m/core/draft-mode-WSQAT67S.js +0 -1
- package/dist/m/core/unsaved-warning-FF63QGKI.js +0 -1
- package/dist/m/internals/index-AX4CG7B2.js +0 -1
- package/dist/m/loader-5IA5OJ3J.js +0 -1
- package/dist/m/manifest-98258645.js +0 -1
- package/dist/m/manifest-edit-ABF56000.js +0 -1
- package/dist/m/plugins/page-ZBIYHGK4.js +0 -2
- package/dist/m/plugins/sortable-HDOQ6GAC.js +0 -1
- package/dist/m/plugins/visitor-drafts-A5FDQ2G7.js +0 -20
- package/dist/m/plugins/wire-XOT7XKJL.js +0 -1
- package/dist/m/sync/live-sync-M2PP2IWY.js +0 -1
- package/dist/m/vendor/sap-core.vendor-OA5SKL7Q.js +0 -6
- /package/dist/m/plugins/{richclay-CBLZRFB4.js.LEGAL.txt → richclay-L3BZMX4I.js.LEGAL.txt} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// GENERATED — do not edit. Vendored from sapjs/dist/sap-core.min.js via sapjs
|
|
2
2
|
// `npm run copy-to-clayjs`. Edit the sapjs source and re-run.
|
|
3
|
-
var SapCoreBundle=(()=>{var
|
|
4
|
-
`+(
|
|
5
|
-
`)),s}error(
|
|
6
|
-
${
|
|
3
|
+
var SapCoreBundle=(()=>{var Ye=Object.defineProperty;var Un=Object.getOwnPropertyDescriptor;var Vn=Object.getOwnPropertyNames;var qn=Object.prototype.hasOwnProperty;var Gn=(e,t)=>{for(var r in t)Ye(e,r,{get:t[r],enumerable:!0})},Yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vn(t))!qn.call(e,o)&&o!==r&&Ye(e,o,{get:()=>t[o],enumerable:!(n=Un(t,o))||n.enumerable});return e};var Xn=e=>Yn(Ye({},"__esModule",{value:!0}),e);var Ur={};Gn(Ur,{FULL_SAPJS:()=>ke,Sap:()=>Se,default:()=>zr,mount:()=>jr,mountAll:()=>zn,needsFullSapjs:()=>At,runtime:()=>Wr});function xt(e){let t=!1,r=new Set,n=[];function o(l){l&&(n.push(l),n.length>8&&n.shift())}function s(l,p,k){if(o(p),k){if(l._broken||l.halted)l._changes=!1;else if(l._changes!==!1){let R=l._changes||(l._changes=[]);for(let L of k)R.push(L)}if(l._inPass)return}if(l._broken){if(p==="mutation")return;m(l)}r.has(l)||(l._trigger=p),r.add(l),!t&&(t=!0,queueMicrotask(i))}function i(){t=!1;for(let l of[...r])r.delete(l)&&g(l,!1,l._trigger)}function g(l,p,k){if(!(l._broken||l.halted)){if(l._passes=(l._passes||0)+1,l._passes>50){l._broken=!0,l._breakerRing=n.slice(),e(l,{breaker:!0});return}l._resetArmed||(l._resetArmed=!0,setTimeout(()=>{l._passes=0,l._resetArmed=!1},0)),e(l,p?{full:!0,cause:k}:{cause:k})}}function b(l,p){o(p),l._broken&&m(l),g(l,!0,p)}function m(l){l._broken=!1,l._passes=0}function d(){let l=t;for(;t;)i();return l}return{schedule:s,runNow:b,flushNow:d}}var Kn={E01:{slug:"foreign-dialect",behavior:"HALT"},E02:{slug:"moustaches-in-text",behavior:"HALT"},E04:{slug:"duplicate-declaration",behavior:"HALT"},E05:{slug:"reserved-name",behavior:"HALT"},E06:{slug:"global-html-name",behavior:"HALT"},E07:{slug:"calc-cycle",behavior:"ERR"},E08:{slug:"expression-syntax",behavior:"HALT"},E10:{slug:"orphan-item",behavior:"HALT"},E12:{slug:"unknown-state-key",behavior:"ERR"},E15:{slug:"write-to-undeclared-key",behavior:"ERR"},E16:{slug:"write-to-computed-field",behavior:"ERR"},E17:{slug:"unresolvable-action-target",behavior:"HALT"},E18:{slug:"paint-on-form-control",behavior:"HALT"},E20:{slug:"bind-on-non-control",behavior:"HALT"},E22:{slug:"format-type",behavior:"ERR"},E24:{slug:"runtime-expression-throw",behavior:"ERR"},E26:{slug:"circuit-breaker",behavior:"HALT"},E30:{slug:"attr-on-bound-control",behavior:"HALT"},E31:{slug:"password-without-transient",behavior:"HALT"},E32:{slug:"file-bind",behavior:"HALT"},E33:{slug:"dialog-state-open",behavior:"HALT"},E34:{slug:"transient-persist-collision",behavior:"HALT"},E35:{slug:"presence-state-misuse",behavior:"HALT"},E40:{slug:"each-not-array",behavior:"ERR"},E41:{slug:"each-bad-key",behavior:"ERR"},E42:{slug:"each-template",behavior:"ERR"},E43:{slug:"bind-in-each-row",behavior:"ERR"},E50:{slug:"needs-full-sapjs",behavior:"HALT"},E52:{slug:"plugin-not-loaded",behavior:"ERR"},W03:{slug:"unknown-colon-attribute",behavior:"WARN"},W04:{slug:"expression-in-when",behavior:"WARN"},W30:{slug:"nonzero-mount-writes",behavior:"WARN"},W31:{slug:"detail-dialog-saved-open",behavior:"WARN"}},ee=["disabled","readonly","required","checked","selected","multiple","open","inert","autofocus","novalidate","hidden"],Xe=new Set(["title","style","hidden","lang","dir","translate","class","id","nonce","autofocus","tabindex","contenteditable","spellcheck","draggable","role","slot","part","name","value","type","itemscope","itemtype","itemid","itemprop","itemref"]),Et=new Set(["sap","scope","items","item","template","bind","calc","text","show","attr","set","trigger","move","sort","detail","each","effect","invalid","confirm","transient","default","persist","sortable","editmode"]);function Jn(e){if(!e||e.nodeType!==1)return"?";if(e.id)return`${e.tagName.toLowerCase()}#${e.id}`;let t=[],r=e,n=0;for(;r&&r.nodeType===1&&n<4;){let o=r.tagName.toLowerCase();if(r.hasAttribute("sap"))o+="[sap]";else if(r.parentElement){let s=0,i=0;for(let g=r.parentElement.firstElementChild;g;g=g.nextElementSibling)g.tagName===r.tagName&&(s++,g===r&&(i=s));s>1&&(o+=`:nth-of-type(${i})`)}if(t.unshift(o),r.hasAttribute("sap"))break;r=r.parentElement,n++}return t.join(" > ")}var Ne=class{constructor(t){this.appName=t,this.errors=[],this.warnings=[],this.halted=!1,this.haltReason=null}block(t,r,n={}){let o=(Kn[t]||{}).slug||"error",s={code:t,slug:o,el:Jn(r),attr:n.attr||null,expr:n.expr||null,key:n.key||null,problem:n.problem||"",didYouMean:n.didYouMean||null,fix:n.fix||null,phase:n.phase||"runtime"},i=[`
|
|
4
|
+
`+(t[0]==="W"?"sap \u26A0 ":"sap \u2717 ")+t+" "+o];return i.push(` at ${s.el}${s.attr?` \u2014 ${s.attr}="${s.expr??""}"`:""}`),s.problem&&i.push(` problem: ${s.problem}`),s.didYouMean&&i.push(` did you mean: ${s.didYouMean}`),s.fix&&i.push(` fix: ${s.fix}`),(t[0]==="W"?console.warn:console.error)(i.join(`
|
|
5
|
+
`)),s}error(t,r,n={}){let o=this.block(t,r,n);return this.errors.push(o),o}warn(t,r,n={}){let o=this.block(t,r,n);return this.warnings.push(o),o}};function D(e,t){e&&e.getAttribute("sap-error")!==t&&e.setAttribute("sap-error",t)}function fe(e){e&&e.hasAttribute("sap-error")&&e.removeAttribute("sap-error")}function Ke(e,t){let r=null,n=3;for(let o of t){let s=Qn(e,o);s<n&&(n=s,r=o)}return r}function Qn(e,t){let r=e.length,n=t.length,o=Array.from({length:r+1},(s,i)=>[i,...new Array(n).fill(0)]);for(let s=0;s<=n;s++)o[0][s]=s;for(let s=1;s<=r;s++)for(let i=1;i<=n;i++)o[s][i]=Math.min(o[s-1][i]+1,o[s][i-1]+1,o[s-1][i-1]+(e[s-1]===t[i-1]?0:1));return o[r][n]}var vt=["sap","item","scope","items","detail","each"],de=new Map,pe=new Map,Te="";function kt(e){for(let[t,r]of Object.entries(e.boundaries||{}))Re(t)&&de.set(t,{name:t,plugin:e.name,opaque:!!r.opaque,on:r.on||null,installed:!1});for(let[t,r]of Object.entries(e.directives||{}))Re(t)&&pe.set(t,{name:t,plugin:e.name,key:r.key,impure:!!r.impure,parse:null});Te=[...de.values()].map(t=>`${t.on||""}[${t.name}]`).join(",")}function Re(e,t){return!vt.includes(e)&&(Nt(e)||t)===t}function St(e,t){for(let r of de.values())r.plugin===e&&(r.installed=!!t);for(let r of pe.values())r.plugin===e&&(r.parse=t&&t[r.name]||null)}function Nt(e){return(de.get(e)||pe.get(e)||{}).plugin}function Tt(e){return pe.get(e)}function Je(e){return!!Nt(e)||pe.has(e.slice(0,e.indexOf(":")+1))}function _e(e){if(!Te)return null;for(let t of de.values())if(!(t.on&&e.localName!==t.on||!e.hasAttribute(t.name)))return vt.some(r=>e.hasAttribute(r))?null:t;return null}function te(e){let t=_e(e);return!!t&&(t.opaque||!t.installed)}function me(e){if(!Te)return null;for(let t=e.parentElement;t;t=t.parentElement)if(t=t.closest(Te),!t||te(t))return t;return null}function ne(e){return te(e)?e:me(e)}function O(e,t){if(!(t(e)===!1||te(e)))for(let r=e.firstElementChild;r;r=r.nextElementSibling)O(r,t)}var Zn=new Set(ee),er={readonly:"readOnly",novalidate:"noValidate"},tr=0,Rt=new WeakMap;function _t(e,t="sap"){let r=e.getAttribute("data-id");if(r)return r;if(e.id)return e.id;let n=Rt.get(e);return n||(n=`${t}-${(tr++).toString(36)}`,Rt.set(e,n)),n}function $t(e){let t=[];for(let r=e.firstElementChild;r;r=r.nextElementSibling)r.hasAttribute("item")&&!r.hasAttribute("template")&&!r.hasAttribute("cms-template")&&t.push(r);return t}function Qe(e,t){if(!e||!t)return null;let r=[...e.querySelectorAll(`template[items="${t}"]`)].find(o=>o.closest("[sap]")===e),n=r&&r.content.firstElementChild;return n&&n.hasAttribute("item")?n:null}function Lt(e){for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(t.hasAttribute("item")&&t.hasAttribute("template"))return t;return Qe(e.closest("[sap]"),e.getAttribute("items"))}function $e(e){let t=[];if(!e)return t;for(let r of e.trim().split(/\s+/)){if(!r)continue;let n=r,o,s=n.indexOf("=");s>=0&&(o=n.slice(s+1),n=n.slice(0,s));let i=n.split(":"),g=i[0],b="string",m=!1;for(let p of i.slice(1))p==="num"?b="num":p==="bool"?b="bool":p==="presence"?b="presence":p==="transient"&&(m=!0);let d=g,l=d.startsWith("data-")&&d.length>5?d.slice(5).replace(/-([a-z])/g,(p,k)=>k.toUpperCase()):d;t.push({name:l,attr:d,type:b,default:o,transient:m})}return t}function Le(e,t){if(t==="num"){if(e==null||e==="")return 0;let r=Number(e);return Number.isNaN(r)?0:r}return t==="bool"?e==="true"||e===""||e==="1":e??""}function Pt(e,t){return t==="bool"?e?"true":"false":e==null?"":String(e)}function Ze(e,t){return Zn.has(t)&&typeof e[er[t]||t]=="boolean"}function et(e,t){return t.type==="presence"||t.type!=="num"&&Ze(e,t.attr||t.name)}function tt(e){return e.default!=null?e.default:e.type==="num"?"0":e.type==="bool"?"false":""}function Ct(e,t){let r=t.attr||t.name,n=e._sapTransient||(e._sapTransient={});if(!(t.name in n)){let o=e.getAttribute(r);o==null&&(o=tt(t)),n[t.name]=Le(o,t.type)}return e.hasAttribute(r)&&e.removeAttribute(r),n[t.name]}function M(e){if(typeof e=="number")return e;if(e==null||e==="")return 0;let t=Number(typeof e=="string"?e.replace(/[$,%\s]/g,""):e);return Number.isNaN(t)?0:t}function Pe(e,t){return Array.isArray(e)?t==null?e:e.map(r=>typeof t=="function"?t(r):r?.[t]):[]}function nt(e,t){return Pe(e,t).reduce((r,n)=>r+M(n),0)}function Ot(e,t){return Array.isArray(e)?t==null?e.length:e.reduce((r,n)=>r+(t(n)?1:0),0):0}function Mt(e,t){let r=Pe(e,t);return r.length?nt(e,t)/r.length:0}function It(e,t){let r=Pe(e,t).filter(n=>n!=null&&n!=="");return r.length?r.every(n=>typeof n=="number"||!Number.isNaN(Number(n)))?Math.min(...r.map(Number)):r.reduce((n,o)=>String(n)<=String(o)?n:o):0}function Dt(e,t){let r=Pe(e,t).filter(n=>n!=null&&n!=="");return r.length?r.every(n=>typeof n=="number"||!Number.isNaN(Number(n)))?Math.max(...r.map(Number)):r.reduce((n,o)=>String(n)>=String(o)?n:o):0}function Ft(e,t,r){let n=M(e)===1?t:r??t+"s";return`${e} ${n}`}function Bt(e,t){let r=new Date(e),n=new Date(t);return Number.isNaN(+r)||Number.isNaN(+n)?0:Math.round((n-r)/864e5)}function W(e){return typeof e=="number"?e:Number(e)}var H={usd:e=>"$"+W(e).toLocaleString("en-US",{maximumFractionDigits:0}),usd2:e=>"$"+W(e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),pct:e=>Math.round(W(e))+"%",pct1:e=>W(e).toFixed(1)+"%",int:e=>Math.round(W(e)).toLocaleString("en-US"),num:e=>W(e).toLocaleString("en-US"),num2:e=>W(e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),compact:e=>W(e).toLocaleString("en-US",{notation:"compact"}),date:e=>{let t=new Date(e);return Number.isNaN(+t)?String(e):t.toLocaleDateString("en-US")},clock:e=>{let t=W(e),r=Math.floor(t/100),n=r%10,o=Math.floor(r/10)%60;return`${Math.floor(r/600)}:${String(o).padStart(2,"0")}.${n}`}},nr=new Set(["usd","usd2","pct","pct1","int","num","num2","compact","clock"]);function jt(e,t){if(!e)return t==null?"":String(t);let r=H[e];if(typeof r!="function"){let n=new Error(`unknown format "${e}"`);throw n.sapCode="E22",n}if(nr.has(e)){let n=typeof t=="number"?t:Number(t);if(!Number.isFinite(n)){let o=new Error(`format "${e}" received ${typeof t=="string"?`"${t}"`:t}`);throw o.sapCode="E22",o}}return r(t)}var rt=["state","item","el","root","fmt","num","sum","count","avg","min","max","plural","days"],he=new Map,ot=[],Wt=[],be=null,Ht=null,rr=/'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[`}](?:\\.|[^`\\])*?(?:`|\$\{)|[{}]/.source;function zt(e,t){ot=Object.keys(e),Wt=Object.values(e);let r=[...t.keys()].filter(n=>st(n)&&!(n in e));Ht=t,be=r.length?new RegExp(`${rr}|\\.{3}|(${r.join("|")})\\s*\\(|[\\w$.]+`,"g"):null,he.clear()}function it(e){return e in globalThis&&globalThis[e]?.nodeType!==1}function st(e){return/^[a-z_]\w*$/i.test(e)&&!rt.includes(e)&&!it(e)}function Ut(e){try{return st(e)&&!!new Function(e,'"use strict"')}catch{return!1}}function ge(e){let t=[],r;if(be)for(be.lastIndex=0;r=be.exec(e);){let[n,o]=r;if(o&&st(o))return Ht.get(o);n[0]==="}"&&!t.pop()?.[1]?be.lastIndex=r.index+1:n.endsWith("{")&&t.push(n)}return null}var or=/\bstate\.([a-z][a-z0-9_]*)/g,ir=/\bitem\.([a-z][a-z0-9_]*)/g;function sr(e){let t=r=>new Set([...(e||"").matchAll(r)].map(n=>n[1]));return{state:t(or),item:t(ir)}}function Ce(e,t=!1){let r=(t?"!":"")+e,n=he.get(r);if(n)return n;he.size>512&&he.clear();try{let o=t?`"use strict";
|
|
6
|
+
${e}`:`"use strict"; return (${e});`;n={fn:ot.length?new Function(...ot,`return function(${rt}){${o}
|
|
7
|
+
}`)(...Wt):new Function(...rt,o),src:e,statement:t,deps:sr(e),error:null,waits:ge(e)}}catch(o){n={fn:null,src:e,statement:t,deps:{state:new Set,item:new Set},error:o,waits:null}}return n.waits||he.set(r,n),n}function Vt(e,t){return ye(e,t.state,t.item,t.el??null,t.root)}function ye(e,t,r,n,o){if(e.error)throw e.error;return e.fn(t,r,n,o,H,M,nt,Ot,Mt,It,Dt,Ft,Bt)}var we={},X=null,Xt=!0,Me=!1;function Ie(){we={}}function Kt(e){let t=Me;return X?at(X.takeRecords()):Xt&&ar(),Me=!!X&&e.getRootNode()===document,t}function Jt(e){Me=e}function Qt(){X&&at(X.takeRecords())}function ar(){if(typeof document>"u"||typeof MutationObserver!="function"){Xt=!1;return}X=new MutationObserver(at),X.observe(document,{attributes:!0,childList:!0,subtree:!0})}function at(e){for(let t of e)if(t.type==="attributes")qt(t.target);else if(t.addedNodes.length&&!(t.target.nodeType===1&&ne(t.target)))for(let r of t.addedNodes)r.nodeType===1&&O(r,qt)}function qt(e){e._sapPlan&&(e._sapPlan=null)}function K(e){if(!Me)return Gt(e);let t=e._sapPlan;return t&&t.gen===we?t:e._sapPlan=Gt(e)}function z(e,t,r){let n=Ce(t,r);return n.waits&&(e.waits=n.waits),n}function Gt(e){let t={gen:we,inert:e.tagName==="TEMPLATE",template:!1,cms:!1,item:!1,scope:!1,items:!1,detail:!1,each:!1,boundary:null,bind:null,transient:!1,decls:null,calcs:null,paints:null,effects:null,invalids:null,waits:null,wants:null,ext:!1,impure:!1};for(let n of e.attributes){let o=n.name,s=n.value,i=o.indexOf(":");if(i<0){switch(o){case"sap-ignore":t.inert=!0;break;case"cms-template":t.inert=!0,t.cms=!0;break;case"template":t.inert=!0,t.template=!0;break;case"item":t.item=!0;break;case"scope":t.scope=!0;break;case"items":t.items=!0;break;case"detail":t.detail=!0,t.waits=ge(s)||t.waits;break;case"each":t.each=!0,t.waits=ge(s)||ge(e.getAttribute("key"))||t.waits;break;case"bind":t.bind=s;break;case"transient":t.transient=!0;break;case"state":t.decls=$e(s);break;case"text":(t.paints||(t.paints=[])).push({kind:"text",fmt:null,entry:z(t,s)});break;case"show":(t.paints||(t.paints=[])).push({kind:"show",entry:z(t,s)});break;case"effect":(t.effects||(t.effects=[])).push({entry:z(t,s,!0)});break;case"invalid":(t.invalids||(t.invalids=[])).push({entry:z(t,s)});break;default:Yt(t,o,"",s)}continue}let g=o.slice(0,i),b=o.slice(i+1);switch(g){case"calc":(t.calcs||(t.calcs=[])).push({name:b,entry:z(t,s)});break;case"text":(t.paints||(t.paints=[])).push({kind:"text",fmt:b,entry:z(t,s)});break;case"attr":(t.paints||(t.paints=[])).push({kind:"attr",arg:b,entry:z(t,s)});break;case"class":(t.paints||(t.paints=[])).push({kind:"class",arg:b,entry:z(t,s)});break;case"css":(t.paints||(t.paints=[])).push({kind:"css",arg:b,entry:z(t,s)});break;case"show-when":case"option":(t.paints||(t.paints=[])).push({kind:"when",match:"show",field:b,values:s.split("|")});break;case"hide-when":(t.paints||(t.paints=[])).push({kind:"when",match:"hide",field:b,values:s.split("|")});break;case"option-not":(t.paints||(t.paints=[])).push({kind:"when",match:"show-not",field:b,values:s.split("|")});break;default:Yt(t,g+":",b,s)}}let r=_e(e);return t.boundary=t.scope?"scope":t.items?"items":t.detail?"detail":t.each?"each":r?r.name:null,r&&!r.installed&&(t.wants||=[]).push(r.plugin),cr(t)?ur():t}function Yt(e,t,r,n){let o=Tt(t);if(!o)return;if(!o.parse){(e.wants||=[]).push(o.plugin);return}let s=o.parse(r,n);s!==void 0&&((e[o.key]||(e[o.key]=[])).push(s),e.ext=!0,o.impure&&(e.impure=!0),s&&s.entry&&s.entry.waits&&(e.waits=s.entry.waits))}var Oe=null;function ur(){return(!Oe||Oe.gen!==we)&&(Oe=Object.freeze({gen:we,inert:!1,template:!1,cms:!1,item:!1,scope:!1,items:!1,detail:!1,each:!1,boundary:null,bind:null,transient:!1,decls:null,calcs:null,paints:null,effects:null,invalids:null,waits:null,wants:null,ext:!1,impure:!1})),Oe}function cr(e){return!e.inert&&!e.item&&e.boundary===null&&e.bind===null&&!e.transient&&!e.decls&&!e.calcs&&!e.paints&&!e.effects&&!e.invalids&&!e.wants&&!e.ext}var oe=new WeakMap,ie=new WeakMap,re=null,q=!1;function en(){oe=new WeakMap,ie=new WeakMap}function Zt(e){for(let t of e){let r=t.target.nodeType===1?t.target:t.target.parentElement;for(let o=r;o;o=o.parentElement)ie.delete(o);if(t.type==="attributes"){oe.delete(t.target);continue}for(let o=r;o;o=o.parentElement)oe.delete(o);let n=t.addedNodes;if(!(!n||!n.length||r&&ne(r)))for(let o of n)o.nodeType===1&&O(o,lr)}}function lr(e){oe.delete(e),ie.delete(e)}function tn(){return q}function nn(e){return q?ie.get(e):void 0}function rn(e,t){q&&ie.set(e,t)}function De(e){ie.delete(e)}function on(e){let t=q;return!re&&typeof MutationObserver=="function"&&(re=new MutationObserver(Zt),re.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),re&&Zt(re.takeRecords()),q=!!re&&e.getRootNode()===document,t}function sn(e){q=e}function an(e){let t=oe.get(e);return t||oe.set(e,t={attrs:new Map,hasText:!1,text:""}),t}function un(e,t){if(!q)return e.getAttribute(t);let r=an(e);return r.attrs.has(t)||r.attrs.set(t,e.getAttribute(t)),r.attrs.get(t)}function cn(e){if(!q)return e.textContent;let t=an(e);return t.hasText||(t.text=e.textContent,t.hasText=!0),t.text}function ln(e){return(e.getAttribute("type")||"text").toLowerCase()}function se(e){let t=e.tagName;if(t==="INPUT"){let r=ln(e);r==="checkbox"||r==="radio"?e.checked?e.setAttribute("checked",""):e.removeAttribute("checked"):e.setAttribute("value",e.value);return}if(t==="TEXTAREA"){e.setAttribute("data-value",e.value);return}if(t==="SELECT"){let r=e.options;for(let n=0;n<r.length;n++)r[n].selected?r[n].setAttribute("selected",""):r[n].removeAttribute("selected")}}function fn(e,t=e){let r=e.tagName;if(r==="INPUT"){let n=ln(e);n==="checkbox"||n==="radio"?t.checked?e.hasAttribute("checked")||e.setAttribute("checked",""):e.removeAttribute("checked"):t.value!==(e.getAttribute("value")??"")&&e.setAttribute("value",t.value);return}if(r==="TEXTAREA"){let n=t.value.startsWith(`
|
|
7
8
|
`)?`
|
|
8
|
-
`+e.value:e.value;t.textContent!==n&&(t.textContent=n),t.removeAttribute("data-value");return}if(r==="SELECT"){let n=t.options,o=e.options;for(let s=0;s<n.length;s++)o[s]&&o[s].selected?n[s].hasAttribute("selected")||n[s].setAttribute("selected",""):n[s].removeAttribute("selected")}}function dt(t){t.tagName!=="TEXTAREA"||!t.hasAttribute("data-value")||t!==t.ownerDocument.activeElement&&(t.textContent=t.getAttribute("data-value"),t.removeAttribute("data-value"))}function T(t){if(typeof window>"u")return null;let e=window.clay,r=window.hyperclay;return t==="consent"?e?.confirm||r?.consent||null:e?.[t]||r?.[t]||null}function Ne(){let t=T("visitorDrafts");return!!(t&&typeof t.restored=="function"&&t.restored()?.restored)}var Lt=["clay:mutation-ready","hyperclay:mutation-ready"],En=["clay:sync-applied","hyperclay:livesync-applied"],xn=["clay:ready","hyperclay:ready"],vn=["clay:route"],Sn=["clay:modechange"];function Q(t,e,r){let n=null,o=s=>{n!==null&&n!==s.type||(n=s.type,queueMicrotask(()=>{n=null}),r(s))};for(let s of e)t.addEventListener(s,o);return()=>{for(let s of e)t.removeEventListener(s,o)}}function Te(t){let e=typeof window<"u"&&window.clay&&window.clay.ready;e&&typeof e.then=="function"?e.then(()=>t(),()=>t()):t()}function pt(t){let e=T("region");return!e||typeof e.resolveRegionPolicy!="function"||typeof e.skipForPolicy!="function"?!1:e.skipForPolicy(e.resolveRegionPolicy(t),void 0,["no-save","freeze"])}function Re(){return typeof window>"u"?null:window.clay?.modeLifecycle||null}function mt(t,{transient:e=!1}={}){if(e)return!0;let r=Re();return typeof r?.canWrite!="function"||T("region")?.resolveRegionPolicy?.(t)?.persist==="none"?!0:r.canWrite()}function Le(t,e){if(typeof e!="function")throw new Error("Sap.batch(label, fn): fn must be a function");let r=T("undo");r&&r.flush&&r.flush();let n=e();if(n&&typeof n.then=="function")throw new Error("Sap.batch fn must be synchronous (it returned a promise)");return r&&r.commitCaptured&&r.commitCaptured(t),n}function _e(t){if(typeof window>"u"||typeof document>"u")return;let e=()=>{let p=!1;for(let v of t.apps())v.root.isConnected?t.runNow(v,"platform"):p=!0;p&&t.pruneDisconnected(),t.remountIfPresent()},r=T("derived"),n=r&&typeof r.register=="function"?r.register(e):null,o=typeof n=="function"?null:Q(document,En,e),s=Q(document,vn,e),i=null,f=!1,c=()=>{let p=i;i=null,p&&(p[2](),p[3]())},l=()=>{if(f)return!1;let p=T("undo"),v=Re()?.state?.generation;if(i&&i[0]===p&&i[1]===v)return!0;if(c(),!p||typeof p.on!="function")return!1;let R=p.on("undo",e);if(typeof R!="function")return!1;let _=p.on("redo",e);return typeof _!="function"?(R(),!1):(i=[p,v,R,_],!0)};l();let a=[Lt,xn,Sn].map(p=>Q(document,p,l)),d=T("ready");return d&&typeof d.then=="function"&&d.then(l,()=>{}),()=>{f=!0,typeof n=="function"&&n(),o&&o(),s();for(let p of a)p();c()}}function _t(t){let e=t.tagName;if(e==="INPUT"){let r=(t.getAttribute("type")||"text").toLowerCase();return r==="checkbox"?"checkbox":r==="radio"?"radio":r==="number"||r==="range"?"number":r==="hidden"?"hidden":"text"}return e==="TEXTAREA"?"text":e==="SELECT"?t.multiple?"select-multiple":"select-one":"leaf"}function kn(t){if(t.validity&&t.validity.badInput)return t.hasAttribute("value")?Number(t.getAttribute("value"))||0:t._sapLastGood??0;if(t.value==="")return 0;let e=Number(t.value);return Number.isNaN(e)?t._sapLastGood??0:(t._sapLastGood=e,e)}function $e(t,e){switch(e){case"checkbox":return t.checked;case"radio":return t.checked?t.value:void 0;case"number":return kn(t);case"select-one":return t.value;case"select-multiple":return[...t.selectedOptions].map(r=>r.value);case"hidden":case"text":return t.value;case"leaf":return t.textContent;default:return t.value}}function Nn(t,e,r){switch(e){case"checkbox":t.checked=!!r;break;case"radio":t.checked=String(t.value)===String(r);break;case"number":case"text":case"hidden":t.value=r==null?"":String(r);break;case"select-one":t.value=r==null?"":String(r);break;case"select-multiple":{let n=new Set((Array.isArray(r)?r:[r]).map(String));for(let o of t.options)o.selected=n.has(o.value);break}case"leaf":t.textContent=r==null?"":String(r);break;default:t.value=r==null?"":String(r)}}function Ce(t){if(t.hasAttribute("transient")){t.removeAttribute("value"),t.removeAttribute("checked"),t.removeAttribute("data-value");return}pt(t)||V(t)}function Tn(t){t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))}function Pe(t,e){return $e(t,e)}function Me(t){let e=_t(t);return{el:t,kind:e,read(){return $e(t,e)},write(r,n={}){Nn(t,e,r),n.noMirror||Ce(t),n.silent||Tn(t)},mirror(){Ce(t)}}}var I=null,bt=!1,Y=null;function Oe(t){let e=null;return{kind:"hub",subscribe(r){let n=t.onAnyChange({debounce:0,require:"observed"},r);typeof n=="function"&&(e=n)},suppress(r){t.pause();try{return r()}finally{t.resume()}},teardown(){if(e){try{e()}catch{}e=null}}}}function Rn(){let t=null;return{kind:"native",subscribe(e){t=new MutationObserver(n=>e(Ln(n)));let r=typeof document<"u"&&document.body||typeof document<"u"&&document.documentElement;r&&t.observe(r,{childList:!0,subtree:!0,attributes:!0,characterData:!0})},suppress(e){let r=T("undo");r&&r.pause&&r.pause();try{return e()}finally{t&&t.takeRecords(),r&&r.resume&&r.resume()}},teardown(){t&&(t.disconnect(),t=null)}}}function Ln(t){let e=[];for(let r of t)if(r.type==="attributes"){let n=r.target;n&&n.nodeType===1&&!ht(n)&&e.push({type:"attribute",element:n})}else if(r.type==="characterData"){let n=r.target&&r.target.parentElement;n&&!ht(n)&&e.push({type:"characterData",element:n})}else if(r.type==="childList"){for(let n of r.addedNodes)if(!(n.nodeType!==1||ht(n))&&(e.push({type:"add",element:n}),n.querySelectorAll))for(let o of n.querySelectorAll("*"))ht(o)||e.push({type:"add",element:o});for(let n of r.removedNodes)n.nodeType===1&&e.push({type:"remove",element:n,parent:r.target})}return e}function ht(t){return!!(t.closest&&t.closest("[sap-ignore],[template],[cms-template]"))}function _n(t,e){t.pruneDisconnected();let r=new Set,n=!1;for(let o of e){let s=o.type==="remove"?o.parent:o.element,i=s&&t.appFor(s);i&&r.add(i),o.type==="add"&&o.element&&o.element.nodeType===1&&o.element.hasAttribute&&o.element.hasAttribute("sap")&&!(t.isRegistered&&t.isRegistered(o.element))&&(n=!0)}n&&t.remountIfPresent();for(let o of r)o.root.isConnected&&t.schedule(o,"mutation")}function De(t){if(I)return I.suppress(t);let e=T("undo");if(e&&e.pause&&e.resume){e.pause();try{return t()}finally{e.resume()}}return t()}function Ct(t,e){bt=!0,I=t,t.subscribe(r=>_n(e,r))}function $t(t){if(bt||typeof window>"u"||typeof document>"u")return;let e=T("Mutation");if(e&&typeof e.onAnyChange=="function"){Ct(Oe(e),t);return}typeof MutationObserver=="function"&&(Ct(Rn(),t),Y=Q(document,Lt,function(){let n=T("Mutation");n&&(Y(),Y=null,I&&I.teardown(),bt=!1,Ct(Oe(n),t))}))}function Pt(){if(I)try{I.teardown()}catch{}Y&&typeof document<"u"&&Y(),I=null,bt=!1,Y=null}var Cn=new Set(z),gt=Object.freeze([]),W=[],We={},Be={};function Fe(t){W.includes(t)||(W.push(t),t.boundary&&Object.assign(We,t.boundary),t.paintKinds&&Object.assign(Be,t.paintKinds))}function yt(t,e={}){if(e.breaker){t.diag.error("E26",t.root,{problem:"recompute loop halted after 50 passes; recent triggers: "+(t._breakerRing||[]).join(", ")}),B(t.root,"loop");return}e.full&&(ue(),me());let r=ce(t.root);try{De(()=>$n(t,e))}finally{le(r)}t._viewsChanged&&(t._viewsChanged=!1,t.root.dispatchEvent(new CustomEvent("sap:views-updated",{bubbles:!0})))}function $n(t,e){let r=t.root,n={},o=[],s=[],i=new Set;t.diag.errors=[];let f={root:n,state:n,item:null,ownerEl:r,projection:!1},c=null;function l(u,h,b=!1){let m=h.attr||h.name,g=b?xe(u,m):u.getAttribute(m);return g==null&&(g=Tt(h),s.push({el:u,name:h.name,attr:m,value:Gt(st(g,h.type),h.type)})),st(g,h.type)}function a(u,h,b,m){let g=h.decls;if(!g)return;let E=!!m.item&&!m.projection&&!m.view;for(let k of g){if(k.transient){c&&(c.pure=!1),b[k.name]=Xt(u,k);continue}if(Nt(u,k)){b[k.name]=u.hasAttribute(k.attr);continue}b[k.name]=l(u,k,E)}}function d(u,h,b){let m=h.bind,g=b.item||b.state,E=_t(u);c&&(E!=="leaf"||h.transient)&&(c.pure=!1),E==="radio"?(m in g||(g[m]=""),u.checked&&(g[m]=u.value)):E==="leaf"&&b.item&&!b.projection&&!b.view?g[m]=ve(u):g[m]=Pe(u,E),h.transient&&(u.removeAttribute("value"),u.removeAttribute("checked"))}function p(u,h,b){let m=!1;if(h.paints){m=!0;for(let g of h.paints)g.kind==="when"&&i.add(g.field),o.push({def:g,el:u,ctx:b})}for(let g of W)g.collect&&g.collect(A,u,h,b)!==!1&&(m=!0);c&&m&&(h.calcs&&(c.pure=!1),c.collects.push(u,h))}function v(u,h,b){Object.defineProperty(u,"$key",{value:qt(h,"row"),enumerable:!1}),Object.defineProperty(u,"$index",{value:b,enumerable:!1,configurable:!0}),Object.defineProperty(u,"$el",{value:h,enumerable:!1})}function R(u,h,b){let m=ft(u);a(u,m,h,b),u._sapScope=h,!b.projection&&m.bind!=null&&d(u,m,b),p(u,m,b),m.items?nt(u,h,b):_(u,h,b)}function _(u,h,b){for(let m=u.firstElementChild;m;m=m.nextElementSibling)$(m,h,b)}function $(u,h,b){let m=ft(u);if(!m.inert){if(m.boundary){c&&(c.pure=!1),m.boundary==="scope"?et(u,h,b):m.boundary==="items"?(p(u,m,b),nt(u,h,b)):We[m.boundary](A,u,m,h,b);return}!b.projection&&!b.view&&m.bind!=null&&d(u,m,b),p(u,m,b);for(let g=u.firstElementChild;g;g=g.nextElementSibling)$(g,h,b)}}function et(u,h,b){let m=u.getAttribute("scope"),g={};h[m]=g;let E={root:b.root,state:g,item:null,ownerEl:u,projection:b.projection};R(u,g,E)}function nt(u,h,b){c&&(c.pure=!1);let m=u.getAttribute("items"),g=[];h[m]=g,u._sapList=g;let E=!b.projection&&!b.view&&he(),k=0;for(let N=u.firstElementChild;N;N=N.nextElementSibling){let x=ft(N);if(!x.item||x.template||x.cms)continue;let L=E?be(N):void 0;g.push(L&&L.plan===x&&Object.isExtensible(L.obj)&&rt(L,N,k,b)||X(N,x,k,b,E)),k++}}function X(u,h,b,m,g){let E={};v(E,u,b);let k={root:m.root,state:m.state,item:E,ownerEl:u,projection:m.projection};if(!g)return R(u,E,k),E;let N=c,x={plan:h,obj:E,fields:null,presence:gt,pending:gt,collects:[],pure:!0},L=s.length,nn=t.diag.errors.length;c=x;try{R(u,E,k)}finally{c=N}if(!x.pure||t.halted||t.diag.errors.length!==nn)return E;let Ft=[];for(let H of Object.keys(E)){let wt=E[H];if(wt!==null&&typeof wt=="object")return E;Ft.push(H,wt)}if(h.decls)for(let H of h.decls)Nt(u,H)&&(x.presence===gt?x.presence=[]:x.presence).push(H.name,H.attr);return s.length>L&&(x.pending=s.slice(L)),x.collects.length||(x.collects=gt),x.fields=Ft,ge(u,x),E}function rt(u,h,b,m){let g=u.obj;try{g.$index!==b&&Object.defineProperty(g,"$index",{value:b,enumerable:!1,configurable:!0});let N=u.presence;for(let L=0;L<N.length;L+=2)g[N[L]]=h.hasAttribute(N[L+1]);let x=u.fields;for(let L=0;L<x.length;L+=2)g[x[L]]=x[L+1]}catch{return ye(h),null}h._sapScope=g;let E=u.pending;for(let N=0;N<E.length;N++)s.push(E[N]);let k=u.collects;if(k.length){let N={root:m.root,state:m.state,item:g,ownerEl:h,projection:m.projection};for(let x=0;x<k.length;x+=2)p(k[x],k[x+1],N)}return g}let A={app:t,root:r,rootObj:n,paints:o,stats:{calcs:0,lists:0},resolveDefault:l,collectEl:p,walkScope:_};for(let u of W)u.begin&&u.begin(A);let w=e.cacheReads===!1?null:we(r);try{R(r,n,f)}finally{e.cacheReads!==!1&&Ae(w)}if(t.halted)return;for(let u of W)u.afterIntake&&u.afterIntake(A);if(s.length&&i.size)for(let u of s)i.has(u.attr)&&u.el.getAttribute(u.attr)==null&&u.el.setAttribute(u.attr,u.value);for(let u of W)u.compute&&u.compute(A);let y=0;for(let u of W)u.reconcile&&(y+=u.reconcile(A));let S=0,C=y;for(let u of o){let h=Mn(u,t);u.ctx.view?C+=h:S+=h}for(let u of W)u.afterPaint&&u.afterPaint(A);t._state=n,t._stats={fields:Object.keys(n).filter(u=>typeof n[u]!="function").length,calcs:A.stats.calcs,paints:o.length,lists:A.stats.lists,writes:S,viewWrites:C},t._viewsChanged=C>0,t._lastPass={trigger:e.trigger||"refresh",writes:S},t._debug&&console.log(`sap pass \xB7 trigger: ${t._lastPass.trigger} \xB7 writes ${S}/${o.length}`)}function Pn(t){return t.kind==="text"?t.fmt?"text:"+t.fmt:"text":t.kind==="attr"?"attr:"+t.arg:t.kind==="class"?"class:"+t.arg:t.kind==="css"?"css:"+t.arg:t.kind==="when"?(t.match==="hide"?"hide-when:":t.match==="show-not"?"option-not:":"show-when:")+t.field:t.kind}function Mt(t,e,r,n){let o=t;for(;o&&o.nodeType===1;){if(o.hasAttribute&&o.hasAttribute(e)){let s=r.includes(o.getAttribute(e));if(n?!s:s)return!0}o=o.parentElement}return!1}function Mn(t,e){let r=t.def,n=t.el,o=Be[r.kind];if(o)return o(t,e);if(r.kind==="when")return Ie(r,n,null);try{let s=ie(r.entry,t.ctx.state,t.ctx.item,n,t.ctx.root),i=Ie(r,n,s);return zt(n),i}catch(s){return e.diag.error(s.sapCode==="E22"?"E22":"E24",n,{attr:Pn(r),expr:r.entry&&r.entry.src,problem:String(s.message)}),B(n,s.sapCode||"E24"),0}}function Ie(t,e,r){switch(t.kind){case"text":{let n=t.fmt!=null?ne(t.fmt,r):r==null?"":String(r);return e.textContent!==n?(e.textContent=n,1):0}case"show":{let n=!r;return e.hidden!==n?(e.hidden=n,1):0}case"when":{let n=T("optionVisibility");if(n&&n._started)return e._sapWhen&&e.hidden?(e.hidden=!1,e._sapWhen=!1,1):0;let o;t.match==="hide"?o=!Mt(e,t.field,t.values,!1):t.match==="show-not"?o=Mt(e,t.field,t.values,!0):o=Mt(e,t.field,t.values,!1),e._sapWhen=!0;let s=!o;return e.hidden!==s?(e.hidden=s,1):0}case"attr":{let n=t.arg;if((n==="checked"||n==="selected")&&typeof e[n]=="boolean"&&!e.hasAttribute("bind")&&!e.closest("select[bind]")){let s=0;return e[n]!==!!r&&(e[n]=!!r,s=1),!!r!==e.hasAttribute(n)&&(r?e.setAttribute(n,""):e.removeAttribute(n),s=1),s}if(Cn.has(n)){let s=e.hasAttribute(n);return r&&!s?(e.setAttribute(n,""),1):!r&&s?(e.removeAttribute(n),1):0}let o=typeof r=="boolean"?String(r):r==null?"":String(r);return e.getAttribute(n)!==o?(e.setAttribute(n,o),1):0}case"class":{let n=!!r;return e.classList.contains(t.arg)!==n?(e.classList.toggle(t.arg,n),1):0}case"css":{let n=r==null?"":String(r);return e.style.getPropertyValue("--"+t.arg)!==n?(e.style.setProperty("--"+t.arg,n),1):0}default:return 0}}var On=new Set(z),je=new Set(["calc","text","attr","class","css","set","move","sort","option","option-not","show-when","hide-when","editmode","viewmode"]),Dn=new Set(["show-when","hide-when","option","option-not"]),In=/\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/,He=new Set(["sap","scope","items","item","template","bind","show","effect","invalid","detail","state","transient","confirm","default","persist","sortable","trigger-add","trigger-remove","trigger-reset","sap-ignore","sap-error","no-save","no-watch","no-undo","no-trigger-autosave","freeze","mutations-ignore","save-remove","save-ignore","save-freeze"]),Dt=[];function ze(t){Dt.includes(t)||Dt.push(t)}function Wn(t){return t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA"}function Ot(t){return t.hasAttribute("bind")}function Bn(t,e){e(t);for(let n=t.firstElementChild;n;n=n.nextElementSibling)r(n);function r(n){if(!n.hasAttribute("sap-ignore")){if(n.tagName==="TEMPLATE"){if(n.hasAttribute("items"))for(let o=n.content.firstElementChild;o;o=o.nextElementSibling)r(o);return}e(n);for(let o=n.firstElementChild;o;o=o.nextElementSibling)r(o)}}}function Ue(t,e){let r=!1,n=(i,f,c)=>{e.error(i,f,c),r=!0},o=t.ownerDocument.createTreeWalker(t,4),s;for(;s=o.nextNode();)if(/\{\{.*\}\}/.test(s.nodeValue||"")){n("E02",s.parentElement||t,{problem:"moustaches in text content are not a Sap feature",fix:'move the expression onto the element: text="state.x"'});break}return Bn(t,i=>{let f=new Set;for(let l of Dt)l(i,n,a=>f.add(a));let c=i.closest&&i.closest("[detail]");for(let l of[...i.attributes]){let a=l.name;if(f.has(a))continue;if(a.includes(":")){let p=a.slice(0,a.indexOf(":"));if(je.has(p)){if(Dn.has(p)&&In.test(l.value)){let v=a.slice(a.indexOf(":")+1);e.warn("W04",i,{attr:a,expr:l.value,problem:`${p}: compares the "${v}" attribute against a literal value, not a JS expression`,fix:`use show="${l.value}" for an expression, or a literal like ${p}:${v}="overview"`})}}else{let v=vt(p,[...je]);e.warn("W03",i,{attr:a,problem:`unknown "${p}:" attribute`,didYouMean:v?`${v}:`:null})}}else if(!He.has(a)&&!xt.has(a)&&!On.has(a)&&!/^(data-|aria-|on)/.test(a)&&!(a in i)){let p=vt(a,[...He]);p&&e.warn("W03",i,{attr:a,problem:`unknown "${a}" attribute`,didYouMean:p})}a==="attr:hidden"&&e.warn("W03",i,{attr:a,problem:"attr:hidden paints the wrong attribute",fix:'use show="expr"'});let d=Ot(i)||a==="attr:selected"&&i.tagName==="OPTION"&&!!i.closest("select[bind]");(a==="attr:value"||a==="attr:checked"||a==="attr:selected")&&d&&n("E30",i,{attr:a,problem:"attr: on a bound control collides with persist ownership",fix:"remove it; bind owns this attribute"}),a==="effect"&&Ot(i)&&/\b(value|checked)\s*=[^=]/.test(l.value)&&n("E30",i,{attr:a,expr:l.value,problem:"effect writes value/checked on a bound control (writes a stale value with no synthetic event)",fix:"write through onclick + Sap(this) instead"}),(a==="text"||a.startsWith("text:")||a==="show")&&Wn(i)&&(a==="show"||n("E18",i,{attr:a,problem:"paint belongs on output elements, not form controls",fix:"move the paint to an <output> or <span>"}))}if(i.hasAttribute("state")){let l=it(i.getAttribute("state")),a=new Set;for(let d of l){d.name.includes("-")&&n("E08",i,{attr:"state",problem:`field "${d.name}" is not a valid identifier (the hyphen parses as subtraction)`,fix:`rename to ${d.name.replace(/-/g,"")}`}),a.has(d.name)&&n("E04",i,{attr:"state",problem:`field "${d.name}" is declared twice in one scope`}),a.add(d.name),Ht.has(d.attr)&&n("E05",i,{attr:"state",problem:`"${d.name}" is a reserved Sap word`}),xt.has(d.attr)&&n("E06",i,{attr:"state",problem:`"${d.name}" is a global HTML attribute name; pick another field name`}),d.name==="open"&&i.tagName==="DIALOG"&&n("E33",i,{attr:"state",problem:"dialog open is transient",fix:"use showModal() \u2014 declare state= only on <details> or popovers"});let p=kt(i,d.attr);p&&(d.attr==="checked"||d.attr==="selected")&&n("E35",i,{attr:"state",problem:`"${d.attr}" on a form control is the control's own state, not a declared field`,fix:'bind the control instead, e.g. <input type="checkbox" bind="done">'}),p&&d.type==="num"&&n("E35",i,{attr:"state",problem:`"${d.attr}" is an HTML boolean attribute; it cannot hold a number`,fix:`declare it bare: state="${d.attr}"`}),d.transient&&(p||d.type==="presence")&&n("E35",i,{attr:"state",problem:`"${d.name}" is carried by attribute presence, which transient would strip`,fix:"declare a separate name:bool:transient field and paint the attribute from it"})}}if(Ot(i)){if(i.hasAttribute("-"),i.tagName==="INPUT"){let l=(i.getAttribute("type")||"text").toLowerCase();l==="file"&&n("E32",i,{attr:"bind",problem:"files never serialize into an HTML file",fix:"use no-save + effect instead of bind"}),l==="password"&&!i.hasAttribute("transient")&&n("E31",i,{attr:"bind",problem:"a password must never serialize into a world-readable file",fix:"add transient to the password input"})}else if(i.tagName!=="SELECT"&&i.tagName!=="TEXTAREA"){let l=i.getAttribute("contenteditable");!(l!=null&&l!=="false")&&i.children.length>0&&n("E20",i,{attr:"bind",problem:"bind on a container element is not a control; a write would overwrite its children",fix:"bind a control (input/select/textarea), a contenteditable, or an empty text leaf"})}}if(i.hasAttribute("transient")&&i.hasAttribute("persist")&&n("E34",i,{problem:"transient and persist are opposite: persist forces the live value into the saved bytes, leaking exactly what transient drops",fix:"remove one \u2014 transient to keep it out of the file, or persist to save it"}),i.tagName==="DIALOG"&&i.hasAttribute("detail")&&!(i.parentElement&&i.parentElement.closest('[clay~="freeze"], [freeze], [save-freeze]'))&&e.warn("W31",i,{attr:"detail",problem:"a detail dialog writes open when it opens, and that attribute would be saved into the file",fix:'wrap the dialog in an element with clay="freeze" (not editor-ui, which removes it from the file), and make its key field transient'}),i.hasAttribute("item")&&!i.hasAttribute("template")&&i.parentNode&&i.parentNode.nodeType===1){let l=i.parentElement;(!l||!l.hasAttribute("items"))&&n("E10",i,{problem:"an [item] must be a direct child of an [items] list",fix:'wrap it in a container with items="name"'})}if(i.hasAttribute("items")&&c&&n("E17",i,{attr:"items",problem:"nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)"}),i.hasAttribute("items")){let l=t.querySelector(`[trigger-add="${i.getAttribute("items")}"]`);!Yt(i)&&!St(t,i.getAttribute("items"))&&Vt(i).length===0&&l&&n("E17",i,{attr:"items",problem:`trigger-add targets items="${i.getAttribute("items")}" but it has no [item template] to clone`})}}),r&&(e.halted=!0,e.haltReason=e.errors[0]?e.errors[0].code:"halt",B(t,e.haltReason)),!r}var qe="sap-styles",Ve="[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}",It=new WeakSet;function Fn(t){if(It.has(t))return;let e=t.defaultView,r=e&&e.CSSStyleSheet;if(r&&"adoptedStyleSheets"in t)try{let n=new r;n.replaceSync(Ve),t.adoptedStyleSheets=[...t.adoptedStyleSheets,n],It.add(t);return}catch{}if(!t.getElementById(qe)){let n=t.createElement("style");n.id=qe,n.textContent=Ve,(t.head||t.documentElement).appendChild(n)}It.add(t)}var jn=0;function Ye(){return typeof performance<"u"&&performance.now?performance.now():0}function Wt(t){let e=t.id||t.getAttribute("sap")||`app-${jn++}`,r=new ot(e),n={root:t,name:e,diag:r,_state:null,_stats:null,_lastPass:null,_passes:0,_broken:!1,_mountMs:0,_mountWrites:0};if(!Ue(t,r))return n.halted=!0,n;Fn(t.ownerDocument);for(let i of t.querySelectorAll("textarea[data-value]"))dt(i);let s=Ye();return yt(n,{trigger:"mount",full:!0}),n._mountMs=Ye()-s,n._mountWrites=n._stats?n._stats.writes:0,n._mountWrites>0&&!Ne()&&!T("derived")&&r.warn("W30",t,{problem:`${n._mountWrites} paint(s) ran at mount; the saved file was out of sync with its declared state`,fix:"re-save once so the file mounts clean (a settled file writes nothing)"}),n}var Ge=/^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;function Hn(t){return`${t.tagName.toLowerCase()}[sap]`}function zn(t){let e=0;for(let r of t.querySelectorAll("*"))for(let n of r.attributes)if(Ge.test(n.name)){e++;break}for(let r of t.attributes)if(Ge.test(r.name)){e++;break}return e}function Xe(t){function e(f){let c=f._stats||{},l=f.root;return{root:Hn(l),fields:c.fields||0,calcs:c.calcs||0,paints:c.paints||0,actions:zn(l),lists:(l.hasAttribute("items")?1:0)+l.querySelectorAll("[items]").length,rows:l.querySelectorAll("[item]:not([template])").length,warnings:f.diag.warnings.length,errors:f.diag.errors.length,mountWrites:f._mountWrites||0,ms:Math.round((f._mountMs||0)*10)/10,passes:f._passes||0,lastPass:f._lastPass||null,ok:f.diag.errors.length===0&&!f.halted}}function r(){let f=t.apps().map(e);return{ok:f.every(c=>c.ok),apps:f}}function n(f){let c=e(f);return c.ok?`sap \u2713 ${c.root} \xB7 fields ${c.fields} \xB7 calcs ${c.calcs} \xB7 paints ${c.paints} \xB7 actions ${c.actions} \xB7 lists ${c.lists} \xB7 rows ${c.rows} \xB7 warnings ${c.warnings} \xB7 mount writes ${c.mountWrites} \xB7 ${c.ms}ms`:`sap \u2717 ${c.root} \xB7 errors ${c.errors} \xB7 warnings ${c.warnings} \xB7 ${c.ms}ms`}function o(){for(let f of t.apps()){let c=n(f);f.diag.errors.length||f.halted?console.error(c):console.log(c)}}function s(){let f=[],c=[];for(let l of t.apps())f.push(...l.diag.errors),c.push(...l.diag.warnings);return{ok:f.length===0,errors:f,warnings:c,counts:{errors:f.length,warnings:c.length}}}function i(f){let c=f===void 0?!0:!!f;for(let l of t.apps())l._debug=c;return console.log(`sap debug ${c?"on":"off"} \u2014 per-pass headers will ${c?"":"no longer "}log`),c}return{status:r,report:s,debug:i,greenLine:n,printGreenLines:o,REGISTRY:Et}}var Ke="0.7.1";function Je({createAccessor:t,installInput:e,debugExtras:r}){let n=new Map,o=[],s=jt(yt);function i(w){let y=w;for(;y;){if(y.nodeType===1&&y.hasAttribute&&y.hasAttribute("sap"))return n.get(y)||null;y=y.parentNode&&y.parentNode.host?y.parentNode.host:y.parentElement}return null}function f(){for(let w=o.length-1;w>=0;w--){let y=o[w];y.root.isConnected||(n.delete(y.root),o.splice(w,1))}}function c(w,y){if(w.moveBefore)try{w.moveBefore(y,null);return}catch{}w.appendChild(y)}function l(w,y){let S=y.parentElement;if(S){if(S.moveBefore)try{S.moveBefore(w,y);return}catch{}S.insertBefore(w,y)}}let a={apps:()=>o.slice(),appFor:i,isRegistered:w=>n.has(w),pruneDisconnected:f,schedule:(w,y)=>s.schedule(w,y),runNow:(w,y)=>s.runNow(w,y),moveInto:c,placeBefore:l,remountIfPresent:()=>X()},d=t(a),p=Xe(a),v=r?r(a,p):{},R=!1,_=!1,$=null;function et(){R||(R=!0,e(a,d,document),$=_e(a))}function nt(){let w=T("derived");w&&typeof w.mounted=="function"&&w.mounted()}function X(w=document){if(_)return[];et(),$t(a);let y=w.querySelectorAll("[sap]"),S=[];for(let C of y){if(n.has(C))continue;let u=Wt(C);n.set(C,u),o.push(u),S.push(u)}for(let C of S){let u=p.greenLine(C);C.diag.errors.length||C.halted?console.error(u):console.log(u)}return nt(),S}function rt(w){if(_)return null;if(et(),$t(a),!w)return X();let y=typeof w=="string"?document.querySelector(w):w;if(!y)return null;if(n.has(y))return n.get(y);let S=Wt(y);n.set(y,S),o.push(S);let C=p.greenLine(S);return S.diag.errors.length||S.halted?console.error(C):console.log(C),S}let A=d.Sap;return A.version=Ke,A.refresh=function(){for(let y of o)y.root.isConnected&&s.runNow(y,"refresh")},A.batch=Le,A.status=p.status,A.report=p.report,A.why=v.why,A.debug=p.debug,A.doctor=v.doctor,A.greenLine=p.greenLine,A.formats=U,A.serializeControlToAttributes=V,A.finalizeControlForSave=ke,A.rehydrateControlFromAttributes=dt,A.mount=rt,A.config=function(y={}){return y.formats&&Object.assign(U,y.formats),A},A._registry=n,A._reset=function(){n.clear(),o.length=0,Pt()},A.unmount=function(){_=!0,n.clear(),o.length=0,Pt(),typeof $=="function"&&$()},{Sap:A,mountAll:X,mount:rt,runtime:a}}function Qe(t){if(typeof document>"u")return;let e=()=>Te(()=>t());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}function Ze(t){let e=[];function r(c){let l=c.target;if(!l||l.nodeType!==1)return;let a=t.appFor(l);if(a){l.hasAttribute("persist")&&!pt(l)&&mt(l)&&V(l);for(let d of e)if(d(l,a))return;t.schedule(a,c.type+" "+(l.id||l.tagName.toLowerCase()))}}function n(c){let l=c.target,a=t.appFor(l);a&&[...l.querySelectorAll("[bind]")].every(d=>mt(d))&&setTimeout(()=>{l.querySelectorAll("[bind]").forEach(d=>{d.dispatchEvent(new Event("input",{bubbles:!0})),d.dispatchEvent(new Event("change",{bubbles:!0}))}),t.schedule(a,"reset")},0)}function o(c){let l=t.appFor(c.target);l&&t.schedule(l,"toggle")}function s(c){let l=c.detail||{};for(let a of[l.from,l.to,c.target]){if(!a||a.nodeType!==1)continue;let d=t.appFor(a);d&&t.schedule(d,"sorted")}}function i(c){if(c.key!=="ArrowUp"&&c.key!=="ArrowDown")return;let l=c.target;if(!l||l.nodeType!==1||l.tagName!=="INPUT"||!l.hasAttribute("bind")||!l.hasAttribute("step"))return;let a=(l.getAttribute("type")||"text").toLowerCase();if(a!=="text"&&a!=="tel"&&a!=="search"||!t.appFor(l)||!mt(l))return;c.preventDefault();let p=P(l.getAttribute("step"))||1,v=c.key==="ArrowUp"?1:-1,R=P(l.value)+p*(c.shiftKey?10:1)*v,_=l.getAttribute("min"),$=l.getAttribute("max");_!==null&&_!==""&&R<P(_)&&(R=P(_)),$!==null&&$!==""&&R>P($)&&(R=P($)),Me(l).write(String(Number(R.toFixed(2))))}function f(c=document){c.addEventListener("reset",n),c.addEventListener("toggle",o,!0),c.addEventListener("input",r),c.addEventListener("change",r),c.addEventListener("clay:sorted",s),c.addEventListener("keydown",i)}return{install:f,addRouter:c=>e.push(c)}}var Z="https://clayjs.com/v1/sap.js",Un=/^(calc|set|move|sort):/,qn=new Set(["each","detail","effect","invalid","confirm","trigger-add","trigger-remove","trigger-reset"]);function Bt(t){return Un.test(t)||qn.has(t)}ze((t,e)=>{for(let r of t.attributes)Bt(r.name)&&e("E50",t,{attr:r.name,expr:r.value,problem:`${r.name} is full sapjs; the sapjs core only paints declared state`,fix:`load ${Z}; the markup stays as it is`})});function G(t,e,r){t.app.diag.error("E50",e,{attr:r,problem:`${r} is full sapjs; the sapjs core only paints declared state`,fix:`load ${Z}; the markup stays as it is`}),B(e,"E50"),t.app.halted=!0}Fe({name:"core-only",collect(t,e,r){r.calcs&&G(t,e,"calc:"+r.calcs[0].name),r.effects&&G(t,e,"effect"),r.invalids&&G(t,e,"invalid");for(let n of e.attributes)Bt(n.name)&&(n.name.startsWith("calc:")&&r.calcs||n.name==="effect"&&r.effects||n.name==="invalid"&&r.invalids||G(t,e,n.name));return!1},boundary:{each(t,e){G(t,e,"each")},detail(t,e){G(t,e,"detail")}}});function Vn(){return{Sap:function(){throw new Error(`Sap(el) is full sapjs; load ${Z}`)}}}var tn=t=>()=>(console.warn(`Sap.${t} is full sapjs; load ${Z}`),null),{Sap:tt,mountAll:en,mount:Yn,runtime:Gn}=Je({createAccessor:Vn,debugExtras:()=>({why:tn("why"),doctor:tn("doctor")}),installInput(t,e,r){Ze(t).install(r)}});tt.core=!0;var Xn=typeof window<"u"&&window.Sap&&!window.Sap.core;Xn?tt.unmount():Qe(en);typeof window<"u"&&!window.Sap&&(window.Sap=tt);var Kn=tt;return cn(Jn);})();
|
|
9
|
+
`+t.value:t.value;e.textContent!==n&&(e.textContent=n),e.removeAttribute("data-value");return}if(r==="SELECT"){let n=e.options,o=t.options;for(let s=0;s<n.length;s++)o[s]&&o[s].selected?n[s].hasAttribute("selected")||n[s].setAttribute("selected",""):n[s].removeAttribute("selected")}}function Fe(e){e.tagName!=="TEXTAREA"||!e.hasAttribute("data-value")||e!==e.ownerDocument.activeElement&&(e.textContent=e.getAttribute("data-value"),e.removeAttribute("data-value"))}function $(e){if(typeof window>"u")return null;let t=window.clay,r=window.hyperclay;return e==="consent"?t?.confirm||r?.consent||null:t?.[e]||r?.[e]||null}function dn(){let e=$("visitorDrafts");return!!(e&&typeof e.restored=="function"&&e.restored()?.restored)}var ut=["clay:mutation-ready","hyperclay:mutation-ready"],fr=["clay:sync-applied","hyperclay:livesync-applied"],dr=["clay:ready","hyperclay:ready"],pr=["clay:route"],mr=["clay:modechange"];function Ae(e,t,r){let n=null,o=s=>{n!==null&&n!==s.type||(n=s.type,queueMicrotask(()=>{n=null}),r(s))};for(let s of t)e.addEventListener(s,o);return()=>{for(let s of t)e.removeEventListener(s,o)}}function pn(e){let t=typeof window<"u"&&window.clay&&window.clay.ready;t&&typeof t.then=="function"?t.then(()=>e(),()=>e()):e()}function Be(e){let t=$("region");return!t||typeof t.resolveRegionPolicy!="function"||typeof t.skipForPolicy!="function"?!1:t.skipForPolicy(t.resolveRegionPolicy(e),void 0,["no-save","freeze"])}function mn(){return typeof window>"u"?null:window.clay?.modeLifecycle||null}function ae(e,{transient:t=!1}={}){if(t)return!0;let r=mn();return typeof r?.canWrite!="function"||$("region")?.resolveRegionPolicy?.(e)?.persist==="none"?!0:r.canWrite()}function hn(e,t){if(typeof t!="function")throw new Error("Sap.batch(label, fn): fn must be a function");let r=$("undo");r&&r.flush&&r.flush();let n=t();if(n&&typeof n.then=="function")throw new Error("Sap.batch fn must be synchronous (it returned a promise)");return r&&r.commitCaptured&&r.commitCaptured(e),n}function bn(e){if(typeof window>"u"||typeof document>"u")return;let t=()=>{let p=!1;for(let k of e.apps())k.root.isConnected?e.runNow(k,"platform"):p=!0;p&&e.pruneDisconnected(),e.remountIfPresent()},r=$("derived"),n=r&&typeof r.register=="function"?r.register(t):null,o=typeof n=="function"?null:Ae(document,fr,t),s=Ae(document,pr,t),i=null,g=!1,b=()=>{let p=i;i=null,p&&(p[2](),p[3]())},m=()=>{if(g)return!1;let p=$("undo"),k=mn()?.state?.generation;if(i&&i[0]===p&&i[1]===k)return!0;if(b(),!p||typeof p.on!="function")return!1;let R=p.on("undo",t);if(typeof R!="function")return!1;let L=p.on("redo",t);return typeof L!="function"?(R(),!1):(i=[p,k,R,L],!0)};m();let d=[ut,dr,mr].map(p=>Ae(document,p,m)),l=$("ready");return l&&typeof l.then=="function"&&l.then(m,()=>{}),()=>{g=!0,typeof n=="function"&&n(),o&&o(),s();for(let p of d)p();b()}}function ct(e){let t=e.tagName;if(t==="INPUT"){let r=(e.getAttribute("type")||"text").toLowerCase();return r==="checkbox"?"checkbox":r==="radio"?"radio":r==="number"||r==="range"?"number":r==="hidden"?"hidden":"text"}return t==="TEXTAREA"?"text":t==="SELECT"?e.multiple?"select-multiple":"select-one":"leaf"}function hr(e){if(e.validity&&e.validity.badInput)return e.hasAttribute("value")?Number(e.getAttribute("value"))||0:e._sapLastGood??0;if(e.value==="")return 0;let t=Number(e.value);return Number.isNaN(t)?e._sapLastGood??0:(e._sapLastGood=t,t)}function yn(e,t){switch(t){case"checkbox":return e.checked;case"radio":return e.checked?e.value:void 0;case"number":return hr(e);case"select-one":return e.value;case"select-multiple":return[...e.selectedOptions].map(r=>r.value);case"hidden":case"text":return e.value;case"leaf":return e.textContent;default:return e.value}}function br(e,t,r){switch(t){case"checkbox":e.checked=!!r;break;case"radio":e.checked=String(e.value)===String(r);break;case"number":case"text":case"hidden":e.value=r==null?"":String(r);break;case"select-one":e.value=r==null?"":String(r);break;case"select-multiple":{let n=new Set((Array.isArray(r)?r:[r]).map(String));for(let o of e.options)o.selected=n.has(o.value);break}case"leaf":e.textContent=r==null?"":String(r);break;default:e.value=r==null?"":String(r)}}function gn(e){if(e.hasAttribute("transient")){e.removeAttribute("value"),e.removeAttribute("checked"),e.removeAttribute("data-value");return}Be(e)||se(e)}function gr(e){e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function wn(e,t){return yn(e,t)}function An(e){let t=ct(e);return{el:e,kind:t,read(){return yn(e,t)},write(r,n={}){br(e,t,r),n.noMirror||gn(e),n.silent||gr(e)},mirror(){gn(e)}}}var yr=[],F=null,je=0,ft=null,We=!1,ue=null;function xn(e){let t=null;return{kind:"hub",flush(){e.pause(),e.resume()},subscribe(r){let n=e.onAnyChange({debounce:0,require:"observed"},r);typeof n=="function"&&(t=n)},suppress(r){e.pause();try{return r()}finally{e.resume()}},teardown(){if(t){try{t()}catch{}t=null}}}}function wr(){let e=null,t=null;function r(){let n=e?e.takeRecords():yr;n.length&&t(En(n))}return{kind:"native",flush:r,subscribe(n){t=n,e=new MutationObserver(s=>n(En(s)));let o=document.body||document.documentElement;o&&e.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0})},suppress(n,o){let s=$("undo");o&&r(),s&&s.pause&&s.pause();try{return n()}finally{e&&e.takeRecords(),s&&s.resume&&s.resume()}},teardown(){e&&(e.disconnect(),e=null)}}}function En(e){let t=[];for(let r of e)if(r.type==="attributes"){let n=r.target;n&&n.nodeType===1&&!xe(n)&&t.push({type:"attribute",element:n,attribute:r.attributeName})}else if(r.type==="characterData"){let n=r.target&&r.target.parentElement;n&&!xe(n)&&t.push({type:"characterData",element:n})}else if(r.type==="childList"){let n=r.target;n.nodeType===1&&[...r.addedNodes,...r.removedNodes].some(s=>s.nodeType===3)&&!xe(n)&&t.push({type:"characterData",element:n});let o=r.addedNodes.length>0&&n.nodeType===1&&ne(n);for(let s of r.addedNodes)s.nodeType!==1||xe(s)||(o?t.push({type:"add",element:s,parent:n}):O(s,i=>{(i===s||!xe(i))&&t.push({type:"add",element:i,parent:n})}));for(let s of r.removedNodes)s.nodeType===1&&t.push({type:"remove",element:s,parent:n})}return t}function xe(e){return!!(e.closest&&e.closest("[sap-ignore],[template],[cms-template]"))}function Ar(e,t){e.pruneDisconnected();let r=new Map,n=!1;for(let o of t){let s=o.type==="remove"?o.parent:o.element,i=s&&e.appFor(s);if(i){let g=r.get(i);g?g.push(o):r.set(i,[o])}o.type==="add"&&o.element&&o.element.nodeType===1&&o.element.hasAttribute&&o.element.hasAttribute("sap")&&!(e.isRegistered&&e.isRegistered(o.element))&&(n=!0)}n&&(ft=e.remountIfPresent,je?queueMicrotask(dt):dt());for(let[o,s]of r)o.root.isConnected&&e.schedule(o,"mutation",s)}function dt(){let e=ft;ft=null,e?.()}function ce(e){if(F){let r=!je++;try{return F.suppress(e,r)}finally{je--}}let t=$("undo");if(t&&t.pause&&t.resume){t.pause();try{return e()}finally{t.resume()}}return e()}function lt(e,t){We=!0,F=e,e.subscribe(r=>Ar(t,r))}function pt(e){if(We||typeof window>"u"||typeof document>"u")return;let t=$("Mutation");if(t&&typeof t.onAnyChange=="function"){lt(xn(t),e);return}typeof MutationObserver=="function"&&(lt(wr(),e),ue=Ae(document,ut,function(){let n=$("Mutation");n&&(ue(),ue=null,F&&F.teardown(),We=!1,lt(xn(n),e))}))}function mt(){if(F)try{F.teardown()}catch{}ue&&typeof document<"u"&&ue(),F=null,We=!1,ue=null}function vn(){je||(F&&F.flush(),dt())}var xr=new Set(ee),Ee=Object.freeze([]),U=[],Sn={},Nn={},ht=null;function He(e){U.includes(e)||(U.push(e),U.sort((t,r)=>(t.order??100)-(r.order??100)),e.boundary&&Object.assign(Sn,e.boundary),e.paintKinds&&Object.assign(Nn,e.paintKinds))}function Tn(e){ht=e}function ze(e,t={}){if(t.breaker){e.diag.error("E26",e.root,{problem:"recompute loop halted after 50 passes; recent triggers: "+(e._breakerRing||[]).join(", ")}),D(e.root,"loop");return}t.full&&(Ie(),en()),e._inPass=!0;let r=Kt(e.root),n=null;try{ce(()=>{n=Er(e,t)})}finally{e._inPass=!1,Jt(r)}ht&&n&&ht(e,n),e._viewsChanged&&(e._viewsChanged=!1,e.root.dispatchEvent(new CustomEvent("sap:views-updated",{bubbles:!0})))}function Er(e,t){let r=e.root,n={},o=[],s=[],i=new Set;e.diag.errors=[];let g=t.full||e._changes===!1?null:e._changes||Ee;e._changes=null;let b=new Set,m=new Map,d=(u,a)=>u.map(c=>m.get(c)?.push(a)??m.set(c,[a])),l={root:n,state:n,item:null,ownerEl:r,projection:!1},p=null;function k(u,a,c=!1){let f=a.attr||a.name,h=c?un(u,f):u.getAttribute(f);return h==null&&(h=tt(a),s.push({el:u,name:a.name,attr:f,value:Pt(Le(h,a.type),a.type)})),Le(h,a.type)}function R(u,a,c,f){let h=a.decls;if(!h)return;let y=!!f.item&&!f.projection&&!f.view;for(let E of h){if(E.transient){p&&(p.pure=!1),c[E.name]=Ct(u,E);continue}if(et(u,E)){c[E.name]=u.hasAttribute(E.attr);continue}c[E.name]=k(u,E,y)}}function L(u,a,c){let f=a.bind,h=c.item||c.state,y=ct(u);p&&(y!=="leaf"||a.transient)&&(p.pure=!1),y==="radio"?(f in h||(h[f]=""),u.checked&&(h[f]=u.value)):y==="leaf"&&c.item&&!c.projection&&!c.view?h[f]=cn(u):h[f]=wn(u,y),a.transient&&(u.removeAttribute("value"),u.removeAttribute("checked"))}function _(u,a,c){let f=!1;if(a.waits&&b.add(a.waits),a.wants&&(d(a.wants,u),f=!0),p&&a.impure&&(p.pure=!1),a.paints){f=!0;for(let h of a.paints)h.kind==="when"&&i.add(h.field),o.push({def:h,el:u,ctx:c})}for(let h of U)h.collect&&h.collect(S,u,a,c)!==!1&&(f=!0);p&&f&&(a.calcs&&(p.pure=!1),p.collects.push(u,a))}function G(u,a,c){Object.defineProperty(u,"$key",{value:_t(a,"row"),enumerable:!1}),Object.defineProperty(u,"$index",{value:c,enumerable:!1,configurable:!0}),Object.defineProperty(u,"$el",{value:a,enumerable:!1})}function B(u,a,c){let f=K(u);R(u,f,a,c),u._sapScope=a,!c.projection&&f.bind!=null&&L(u,f,c),_(u,f,c),f.items?Y(u,a,c):j(u,a,c)}function j(u,a,c){for(let f=u.firstElementChild;f;f=f.nextElementSibling)V(f,a,c)}function V(u,a,c){let f=K(u);if(!f.inert){if(f.boundary){if(p&&(p.pure=!1),f.boundary==="scope")T(u,a,c);else if(f.boundary==="items")_(u,f,c),Y(u,a,c);else if(f.waits)b.add(f.waits);else{let h=Sn[f.boundary];h?h(S,u,f,a,c):f.wants&&d(f.wants,u)}return}!c.projection&&!c.view&&f.bind!=null&&L(u,f,c),_(u,f,c);for(let h=u.firstElementChild;h;h=h.nextElementSibling)V(h,a,c)}}function T(u,a,c){let f=u.getAttribute("scope"),h={};a[f]=h;let y={root:c.root,state:h,item:null,ownerEl:u,projection:c.projection};B(u,h,y)}function Y(u,a,c){p&&(p.pure=!1);let f=u.getAttribute("items"),h=[];a[f]=h,u._sapList=h;let y=!c.projection&&!c.view&&tn(),E=0;for(let N=u.firstElementChild;N;N=N.nextElementSibling){let x=K(N);if(!x.item||x.template||x.cms)continue;let w=y?nn(N):void 0;h.push(w&&w.plan===x&&Object.isExtensible(w.obj)&&A(w,N,E,c)||v(N,x,E,c,y)),E++}}function v(u,a,c,f,h){let y={};G(y,u,c);let E={root:f.root,state:f.state,item:y,ownerEl:u,projection:f.projection};if(!h)return B(u,y,E),y;let N=p,x={plan:a,obj:y,fields:null,presence:Ee,pending:Ee,collects:[],pure:!0},w=s.length,qe=e.diag.errors.length;p=x;try{B(u,y,E)}finally{p=N}if(!x.pure||e.halted||e.diag.errors.length!==qe)return y;let Q=[];for(let Z of Object.keys(y)){let Ge=y[Z];if(Ge!==null&&typeof Ge=="object")return y;Q.push(Z,Ge)}if(a.decls)for(let Z of a.decls)et(u,Z)&&(x.presence===Ee?x.presence=[]:x.presence).push(Z.name,Z.attr);return s.length>w&&(x.pending=s.slice(w)),x.collects.length||(x.collects=Ee),x.fields=Q,rn(u,x),y}function A(u,a,c,f){let h=u.obj;try{h.$index!==c&&Object.defineProperty(h,"$index",{value:c,enumerable:!1,configurable:!0});let N=u.presence;for(let w=0;w<N.length;w+=2)h[N[w]]=a.hasAttribute(N[w+1]);let x=u.fields;for(let w=0;w<x.length;w+=2)h[x[w]]=x[w+1]}catch{return De(a),null}a._sapScope=h;let y=u.pending;for(let N=0;N<y.length;N++)s.push(y[N]);let E=u.collects;if(E.length){let N={root:f.root,state:f.state,item:h,ownerEl:a,projection:f.projection};for(let x=0;x<E.length;x+=2)_(E[x],E[x+1],N)}return h}let S={app:e,root:r,rootObj:n,paints:o,stats:{calcs:0,lists:0},resolveDefault:k,collectEl:_,walkScope:j,changes:g,full:g===null,trigger:t.cause||t.trigger||"refresh",waiting:b,wanted:m};for(let u of U)u.begin&&u.begin(S);let P=t.cacheReads===!1?null:on(r);try{B(r,n,l)}finally{t.cacheReads!==!1&&sn(P)}if(e.halted||b.size)return S;for(let u of U)u.afterIntake&&u.afterIntake(S);if(s.length&&i.size)for(let u of s)i.has(u.attr)&&u.el.getAttribute(u.attr)==null&&u.el.setAttribute(u.attr,u.value);for(let u of U)u.compute&&u.compute(S);let C=0;for(let u of U)u.reconcile&&(C+=u.reconcile(S));let J=0,I=C;for(let u of o){let a=Sr(u,e);u.ctx.view?I+=a:J+=a}for(let u of U)u.afterPaint&&u.afterPaint(S);return e._state=n,e._stats={fields:Object.keys(n).filter(u=>typeof n[u]!="function").length,calcs:S.stats.calcs,paints:o.length,lists:S.stats.lists,writes:J,viewWrites:I},e._viewsChanged=I>0,e._lastPass={trigger:t.trigger||"refresh",writes:J},e._debug&&console.log(`sap pass \xB7 trigger: ${e._lastPass.trigger} \xB7 writes ${J}/${o.length}`),S}function vr(e){let t=e.kind==="text"?e.fmt||null:e.arg;return t==null?e.kind:e.kind+":"+t}function kr(e,t,r,n){let o=e;for(;o&&o.nodeType===1;){if(o.hasAttribute&&o.hasAttribute(t)){let s=r.includes(o.getAttribute(t));if(n?!s:s)return!0}o=o.parentElement}return!1}function Sr(e,t){let r=e.def,n=e.el,o=Nn[r.kind];if(o)return o(e,t);if(r.kind==="when")return kn(r,n,null);try{let s=ye(r.entry,e.ctx.state,e.ctx.item,n,e.ctx.root),i=kn(r,n,s);return fe(n),i}catch(s){return t.diag.error(s.sapCode==="E22"?"E22":"E24",n,{attr:vr(r),expr:r.entry&&r.entry.src,problem:String(s.message)}),D(n,s.sapCode||"E24"),0}}function kn(e,t,r){switch(e.kind){case"text":{let n=e.fmt!=null?jt(e.fmt,r):r==null?"":String(r);return t.textContent!==n?(t.textContent=n,1):0}case"show":{let n=!r;return t.hidden!==n?(t.hidden=n,1):0}case"when":{let n=$("optionVisibility");if(n&&n._started)return t._sapWhen&&t.hidden?(t.hidden=!1,t._sapWhen=!1,1):0;t._sapWhen=!0;let o=kr(t,e.field,e.values,e.match==="show-not")===(e.match==="hide");return t.hidden!==o?(t.hidden=o,1):0}case"attr":{let n=e.arg;if((n==="checked"||n==="selected")&&typeof t[n]=="boolean"&&!t.hasAttribute("bind")&&!t.closest("select[bind]")){let s=0;return t[n]!==!!r&&(t[n]=!!r,s=1),!!r!==t.hasAttribute(n)&&(r?t.setAttribute(n,""):t.removeAttribute(n),s=1),s}if(xr.has(n)){let s=t.hasAttribute(n);return r&&!s?(t.setAttribute(n,""),1):!r&&s?(t.removeAttribute(n),1):0}let o=typeof r=="boolean"?String(r):r==null?"":String(r);return t.getAttribute(n)!==o?(t.setAttribute(n,o),1):0}case"class":{let n=!!r;return t.classList.contains(e.arg)!==n?(t.classList.toggle(e.arg,n),1):0}case"css":{let n=r==null?"":String(r);return t.style.getPropertyValue("--"+e.arg)!==n?(t.style.setProperty("--"+e.arg,n),1):0}default:return 0}}var Nr=new Set(ee),Rn=new Set(["calc","text","attr","class","css","set","move","sort","option","option-not","show-when","hide-when","editmode","viewmode"]),Tr=new Set(["show-when","hide-when","option","option-not"]),Rr=/\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/,_n=new Set(["sap","scope","items","item","template","bind","show","effect","invalid","detail","state","transient","confirm","default","persist","sortable","trigger-add","trigger-remove","trigger-reset","sap-ignore","sap-error","no-save","no-watch","no-undo","no-trigger-autosave","freeze","mutations-ignore","save-remove","save-ignore","save-freeze"]),gt=[];function Ue(e){gt.includes(e)||gt.push(e)}function _r(e){return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"}function bt(e){return e.hasAttribute("bind")}function $r(e,t){t(e);for(let n=e.firstElementChild;n;n=n.nextElementSibling)r(n);function r(n){if(!n.hasAttribute("sap-ignore")){if(n.tagName==="TEMPLATE"){if(n.hasAttribute("items"))for(let o=n.content.firstElementChild;o;o=o.nextElementSibling)r(o);return}if(t(n),!te(n))for(let o=n.firstElementChild;o;o=o.nextElementSibling)r(o)}}}function $n(e,t){let r=!1,n=(i,g,b)=>{t.error(i,g,b),r=!0},o=e.ownerDocument.createTreeWalker(e,5,{acceptNode:i=>i.nodeType===3?1:te(i)||i.hasAttribute("bind")||i.hasAttribute("sap-ignore")?2:3}),s;for(;s=o.nextNode();)if(/\{\{.*\}\}/.test(s.nodeValue||"")){n("E02",s.parentElement||e,{problem:"moustaches in text content are not a Sap feature",fix:'move the expression onto the element: text="state.x"'});break}return $r(e,i=>{let g=new Set;for(let m of gt)m(i,n,d=>g.add(d));let b=i.closest&&i.closest("[detail]");for(let m of[...i.attributes]){let d=m.name;if(g.has(d))continue;if(d.includes(":")){let p=d.slice(0,d.indexOf(":"));if(!Rn.has(p)&&!Je(d)){let k=Ke(p,[...Rn]);t.warn("W03",i,{attr:d,problem:`unknown "${p}:" attribute`,didYouMean:k?`${k}:`:null})}else if(Tr.has(p)&&Rr.test(m.value)){let k=d.slice(d.indexOf(":")+1);t.warn("W04",i,{attr:d,expr:m.value,problem:`${p}: compares the "${k}" attribute against a literal value, not a JS expression`,fix:`use show="${m.value}" for an expression, or a literal like ${p}:${k}="overview"`})}}else if(!_n.has(d)&&!Je(d)&&!Xe.has(d)&&!Nr.has(d)&&!/^(data-|aria-|on)/.test(d)&&!(d in i)){let p=Ke(d,[..._n]);p&&t.warn("W03",i,{attr:d,problem:`unknown "${d}" attribute`,didYouMean:p})}d==="attr:hidden"&&t.warn("W03",i,{attr:d,problem:"attr:hidden paints the wrong attribute",fix:'use show="expr"'});let l=bt(i)||d==="attr:selected"&&i.tagName==="OPTION"&&!!i.closest("select[bind]");(d==="attr:value"||d==="attr:checked"||d==="attr:selected")&&l&&n("E30",i,{attr:d,problem:"attr: on a bound control collides with persist ownership",fix:"remove it; bind owns this attribute"}),d==="effect"&&bt(i)&&/\b(value|checked)\s*=[^=]/.test(m.value)&&n("E30",i,{attr:d,expr:m.value,problem:"effect writes value/checked on a bound control (writes a stale value with no synthetic event)",fix:"write through onclick + Sap(this) instead"}),(d==="text"||d.startsWith("text:")||d==="show")&&_r(i)&&(d==="show"||n("E18",i,{attr:d,problem:"paint belongs on output elements, not form controls",fix:"move the paint to an <output> or <span>"}))}if(i.hasAttribute("state")){let m=$e(i.getAttribute("state")),d=new Set;for(let l of m){l.name.includes("-")&&n("E08",i,{attr:"state",problem:`field "${l.name}" is not a valid identifier (the hyphen parses as subtraction)`,fix:`rename to ${l.name.replace(/-/g,"")}`}),d.has(l.name)&&n("E04",i,{attr:"state",problem:`field "${l.name}" is declared twice in one scope`}),d.add(l.name),Et.has(l.attr)&&n("E05",i,{attr:"state",problem:`"${l.name}" is a reserved Sap word`}),Xe.has(l.attr)&&n("E06",i,{attr:"state",problem:`"${l.name}" is a global HTML attribute name; pick another field name`}),l.name==="open"&&i.tagName==="DIALOG"&&n("E33",i,{attr:"state",problem:"dialog open is transient",fix:"use showModal() \u2014 declare state= only on <details> or popovers"});let p=Ze(i,l.attr);p&&(l.attr==="checked"||l.attr==="selected")&&n("E35",i,{attr:"state",problem:`"${l.attr}" on a form control is the control's own state, not a declared field`,fix:'bind the control instead, e.g. <input type="checkbox" bind="done">'}),p&&l.type==="num"&&n("E35",i,{attr:"state",problem:`"${l.attr}" is an HTML boolean attribute; it cannot hold a number`,fix:`declare it bare: state="${l.attr}"`}),l.transient&&(p||l.type==="presence")&&n("E35",i,{attr:"state",problem:`"${l.name}" is carried by attribute presence, which transient would strip`,fix:"declare a separate name:bool:transient field and paint the attribute from it"})}}if(bt(i)){if(i.hasAttribute("-"),i.tagName==="INPUT"){let m=(i.getAttribute("type")||"text").toLowerCase();m==="file"&&n("E32",i,{attr:"bind",problem:"files never serialize into an HTML file",fix:"use no-save + effect instead of bind"}),m==="password"&&!i.hasAttribute("transient")&&n("E31",i,{attr:"bind",problem:"a password must never serialize into a world-readable file",fix:"add transient to the password input"})}else if(i.tagName!=="SELECT"&&i.tagName!=="TEXTAREA"){let m=i.getAttribute("contenteditable");!(m!=null&&m!=="false")&&i.children.length>0&&n("E20",i,{attr:"bind",problem:"bind on a container element is not a control; a write would overwrite its children",fix:"bind a control (input/select/textarea), a contenteditable, or an empty text leaf"})}}if(i.hasAttribute("transient")&&i.hasAttribute("persist")&&n("E34",i,{problem:"transient and persist are opposite: persist forces the live value into the saved bytes, leaking exactly what transient drops",fix:"remove one \u2014 transient to keep it out of the file, or persist to save it"}),i.tagName==="DIALOG"&&i.hasAttribute("detail")&&!(i.parentElement&&i.parentElement.closest('[clay~="freeze"], [freeze], [save-freeze]'))&&t.warn("W31",i,{attr:"detail",problem:"a detail dialog writes open when it opens, and that attribute would be saved into the file",fix:'wrap the dialog in an element with clay="freeze" (not editor-ui, which removes it from the file), and make its key field transient'}),i.hasAttribute("item")&&!i.hasAttribute("template")&&i.parentNode&&i.parentNode.nodeType===1){let m=i.parentElement;(!m||!m.hasAttribute("items"))&&n("E10",i,{problem:"an [item] must be a direct child of an [items] list",fix:'wrap it in a container with items="name"'})}if(i.hasAttribute("items")&&b&&n("E17",i,{attr:"items",problem:"nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)"}),i.hasAttribute("items")){let m=e.querySelector(`[trigger-add="${i.getAttribute("items")}"]`);!Lt(i)&&!Qe(e,i.getAttribute("items"))&&$t(i).length===0&&m&&n("E17",i,{attr:"items",problem:`trigger-add targets items="${i.getAttribute("items")}" but it has no [item template] to clone`})}}),r&&(t.halted=!0,t.haltReason=t.errors[0]?t.errors[0].code:"halt",D(e,t.haltReason)),!r}var Ln="sap-styles",Pn="[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}",yt=new WeakSet;function Lr(e){if(yt.has(e))return;let t=e.defaultView,r=t&&t.CSSStyleSheet;if(r&&"adoptedStyleSheets"in e)try{let n=new r;n.replaceSync(Pn),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],yt.add(e);return}catch{}if(!e.getElementById(Ln)){let n=e.createElement("style");n.id=Ln,n.textContent=Pn,(e.head||e.documentElement).appendChild(n)}yt.add(e)}var Pr=0;function Cn(){return typeof performance<"u"&&performance.now?performance.now():0}function wt(e){let t=e.id||e.getAttribute("sap")||`app-${Pr++}`,r=new Ne(t),n={root:e,name:t,diag:r,_state:null,_stats:null,_lastPass:null,_passes:0,_broken:!1,_mountMs:0,_mountWrites:0};if(!$n(e,r))return n.halted=!0,n;Lr(e.ownerDocument);for(let i of e.querySelectorAll("textarea[data-value]"))me(i)||Fe(i);let s=Cn();return ze(n,{trigger:"mount",full:!0}),n._mountMs=Cn()-s,n._mountWrites=n._stats?n._stats.writes:0,n._mountWrites>0&&!dn()&&!$("derived")&&r.warn("W30",e,{problem:`${n._mountWrites} paint(s) ran at mount; the saved file was out of sync with its declared state`,fix:"re-save once so the file mounts clean (a settled file writes nothing)"}),n}var Cr=/^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;function Or(e){return`${e.tagName.toLowerCase()}[sap]`}function Mr(e){let t={actions:0,lists:0,rows:0};return O(e,r=>{r.hasAttribute("items")&&t.lists++,r!==e&&r.hasAttribute("item")&&!r.hasAttribute("template")&&t.rows++,[...r.attributes].some(n=>Cr.test(n.name))&&t.actions++}),t}function On(e){function t(i){let g=i._stats||{},b=i.root;return{root:Or(b),fields:g.fields||0,calcs:g.calcs||0,paints:g.paints||0,...Mr(b),warnings:i.diag.warnings.length,errors:i.diag.errors.length,mountWrites:i._mountWrites||0,ms:Math.round((i._mountMs||0)*10)/10,passes:i._passes||0,lastPass:i._lastPass||null,ok:i.diag.errors.length===0&&!i.halted}}function r(){let i=e.apps().map(t);return{ok:i.every(g=>g.ok),apps:i}}function n(i){let g=t(i);return g.ok?`sap \u2713 ${g.root} \xB7 fields ${g.fields} \xB7 calcs ${g.calcs} \xB7 paints ${g.paints} \xB7 actions ${g.actions} \xB7 lists ${g.lists} \xB7 rows ${g.rows} \xB7 warnings ${g.warnings} \xB7 mount writes ${g.mountWrites} \xB7 ${g.ms}ms`:`sap \u2717 ${g.root} \xB7 errors ${g.errors} \xB7 warnings ${g.warnings} \xB7 ${g.ms}ms`}function o(){let i=[],g=[];for(let b of e.apps())i.push(...b.diag.errors),g.push(...b.diag.warnings);return{ok:i.length===0,errors:i,warnings:g,counts:{errors:i.length,warnings:g.length}}}function s(i){let g=i===void 0?!0:!!i;for(let b of e.apps())b._debug=g;return console.log(`sap debug ${g?"on":"off"} \u2014 per-pass headers will ${g?"":"no longer "}log`),g}return{status:r,report:o,debug:s,greenLine:n}}var ve="0.9.0";var Mn={};var Ir=/^(https:\/\/(?:cdn\.jsdelivr\.net\/npm|unpkg\.com)\/@panphora\/sapjs)(?=[@/]|$)/,In=e=>new Promise(t=>setTimeout(t,e)),Dn=e=>e.getAttribute("plugins")?.match(/\S+/g)||[];function Fn(e,t,r){let n=new Map,o=new Map,s=new Map,i=new Map,g=[],b=new Set,m={},d=!1,l,p=globalThis,k=Array.isArray(p.sapPlugins)?p.sapPlugins:p.sapPlugins==null?p.sapPlugins=[]:[],R=p.document?.currentScript?.src||"",L=Ir.exec(R),_=a=>o.get(a)?.api||null,G=a=>Promise.allSettled(a.map(C));function B(){let a=new Map;for(let c of n.values())if(!o.has(c.name))for(let f of c.helpers||[])a.set(f,c.name);zt(m,a),Ie()}function j(a){n.set(a.name,{...n.get(a.name),...a}),kt(a),B()}function V(a){n.has(a.name)||j(a)}function T(a){k.includes(a)||k.push(a),j(a)}function Y(a){for(let c of e.apps())c.root.isConnected&&e.schedule(c,a)}let v=Object.freeze({api:1,version:ve,compile:Ce,run:Vt,runWith:ye,planOf:K,drainPlans:Qt,forgetRow:De,setBeacon:D,clearBeacon:fe,write:ce,schedule(a,c="plugin"){let f=a?.root?a:e.appFor(a);f&&e.schedule(f,c)},appFor:e.appFor,apps:e.apps,capability:$,mayWrite:ae,load:C,plugin:_});function A(a){if(typeof a=="string")return C(a);let{name:c,api:f}=a,h=w=>{throw new Error(`Sap.use: plugin "${c}" ${w}`)};if((typeof c!="string"||f!==1)&&h(`needs a name and plugin API ${1}; it gives API ${f}`),d)return null;if(o.has(c))return _(c);if((a.requires||[]).some(w=>!o.has(w)))return T(a),g.includes(a)||g.push(a),null;let y=a.setup?.(v)||{},E=(w,qe)=>{for(let Q of Array.isArray(a[w])?a[w]:Object.keys(a[w]||{}))(typeof(y[w]||{})[Q]!="function"||qe(Q))&&h(`cannot add "${Q}" to ${w}: the name is taken or not valid, or setup does not supply it`)},N=w=>!Re(w,c);E("helpers",w=>(it(w)&&h(`cannot add "${w}": window.${w} exists; rename the helper`),!Ut(w)||w in m)),E("boundaries",N),E("directives",N);for(let w in y.api)w in t&&h(`cannot add Sap.${w}: the name is taken`);T(a);let x={...y,name:c,order:a.order,boundary:{}};for(let w in a.boundaries)x.boundary[w]=y.boundaries[w];for(let w of a.helpers||[])m[w]=y.helpers[w];for(let w in y.formats)w in H||(H[w]=y.formats[w]);return He(x),y.lint&&Ue(y.lint),Object.assign(t,y.api),o.set(c,x),i.delete(c),St(c,y.directives||!0),B(),ce(()=>b.forEach(fe)),b.clear(),g.splice(0).forEach(S),Y("plugin:"+c),_(c)}function S(a){try{A(a)}catch(c){console.error(c)}}function P(a){if(d||o.has(a))return null;let c=n.get(a)||{},f=I.loader?.(a,c),h=c.url||I.base&&I.base+(c.file||a)+".js";return(f!==void 0?Promise.resolve(f):new Promise((E,N)=>{if(!h)throw new Error(`no address for plugin "${a}": call Sap.use(definition)`);let x=document.createElement("script");x.src=h,x.setAttribute("clay","editor-ui"),x.onload=x.onerror=w=>{x.remove(),w.type==="load"?E():N(new Error("could not load "+h))},document.head.append(x)})).then(E=>{if(d)return;let N=E?.default||E||k.find(x=>x.name===a);if(N?.name&&A(N),!o.has(a))throw new Error(`plugin "${a}" loaded and did not register`)})}function C(a){if(o.has(a))return Promise.resolve(_(a));if(s.has(a))return s.get(a);i.delete(a);let c=Promise.all((n.get(a)?.requires||[]).map(C)).then(()=>P(a));for(let h of I.retryDelays)c=c.catch(()=>In(h).then(()=>P(a)));let f=c.finally(()=>s.delete(a)).then(()=>_(a),h=>{throw i.set(a,h),l||=!p.addEventListener?.("online",()=>I.retry()),Y("plugin-failed:"+a),document.dispatchEvent(new CustomEvent("sap:plugin-failed",{detail:{plugin:a,error:h}})),h});return s.set(a,f),f}function J(a){let c=new Set;for(let f of a.closest?.("[sap]")?[a]:a.querySelectorAll("[sap]")){for(let h of Dn(f.closest("[sap]")))c.add(h);n.size>o.size&&O(f,h=>{let y=K(h);return y.inert?!1:(y.wants?.map(E=>c.add(E)),!!c.add(y.waits))})}return[...c].filter(f=>f&&!o.has(f))}Tn((a,c)=>{for(let f of new Set([...c.wanted.keys(),...c.waiting,...Dn(a.root)])){if(o.has(f))continue;let h=i.get(f);if(!h)C(f).catch(()=>{});else{let y=c.wanted.get(f)?.[0]||a.root;a.diag.error("E52",y,{problem:`the "${f}" plugin did not load: ${h.message}`,fix:"Sap.plugins.retry() tries again"}),b.add(y),ce(()=>D(y,"E52"))}}});let I={api:1,base:L?`${L[1]}@${ve}/dist/sap-plugins/`:/^[^:]+:\//.test(R)?new URL("sap-plugins/",R).href:null,loader:null,retryDelays:[1e3,4e3],declare:V,load:C,ready(a=document,c=3e3){let f=new Set,h=()=>{let E=J(a).filter(N=>!f.has(N)&&f.add(N));return E.length&&G(E).then(h)},y=h();return y?Promise.race([y,In(c)]):null},has:a=>o.has(a),status:()=>({installed:[...o.keys()],loading:[...s.keys()],failed:[...i.keys()]}),retry:a=>G(a?[a]:[...i.keys()])};function u(){let a=[],c=()=>(vn(),r.flushNow()),f=[...o.values()].filter(h=>h.flush);c();for(let h=0;f.length&&h<8;h++){for(let y of f){let E=y.flush();E?.then&&a.push(E)}if(!c())break}return a.length?Promise.all(a).then(u):null}t.use=A,t.plugins=I,t.flush=u;for(let a of Object.values(Mn))V(a);return k.slice().forEach(S),function(){d=!0;for(let c of o.values())c.dispose?.();o.clear(),i.clear()}}function Bn({createAccessor:e,installInput:t,debugExtras:r}){let n=new Map,o=[],s=xt(ze);function i(v){let A=v;for(;A;){if(A.nodeType===1&&A.hasAttribute&&A.hasAttribute("sap"))return n.get(A)||null;A=A.parentNode&&A.parentNode.host?A.parentNode.host:A.parentElement}return null}function g(){for(let v=o.length-1;v>=0;v--){let A=o[v];A.root.isConnected||(n.delete(A.root),o.splice(v,1))}}function b(v,A){if(v.moveBefore)try{v.moveBefore(A,null);return}catch{}v.appendChild(A)}function m(v,A){let S=A.parentElement;if(S){if(S.moveBefore)try{S.moveBefore(v,A);return}catch{}S.insertBefore(v,A)}}let d={apps:()=>o.slice(),appFor:i,isRegistered:v=>n.has(v),pruneDisconnected:g,schedule:s.schedule,runNow:(v,A)=>s.runNow(v,A),moveInto:b,placeBefore:m,remountIfPresent:()=>j()},l=e(d),p=On(d),k=r?r(d,p):{},R=!1,L=!1,_=null;function G(){R||(R=!0,t(d,l,document),_=bn(d))}function B(){let v=$("derived");v&&typeof v.mounted=="function"&&v.mounted()}function j(v=document){if(L)return[];G(),pt(d);let A=v.querySelectorAll("[sap]"),S=[];for(let P of A){if(n.has(P)||me(P))continue;let C=wt(P);n.set(P,C),o.push(C),S.push(C)}for(let P of S){let C=p.greenLine(P);P.diag.errors.length||P.halted?console.error(C):console.log(C)}return B(),S}function V(v){if(L)return null;if(G(),pt(d),!v)return j();let A=typeof v=="string"?document.querySelector(v):v;if(!A)return null;if(n.has(A))return n.get(A);let S=wt(A);n.set(A,S),o.push(S);let P=p.greenLine(S);return S.diag.errors.length||S.halted?console.error(P):console.log(P),S}let T=l.Sap;T.version=ve,T.refresh=function(){for(let A of o.slice())A.root.isConnected&&s.runNow(A,"refresh")},T.batch=hn,T.status=p.status,T.report=p.report,T.why=k.why,T.debug=p.debug,T.doctor=k.doctor,T.greenLine=p.greenLine,T.formats=H,T.serializeControlToAttributes=se,T.finalizeControlForSave=fn,T.rehydrateControlFromAttributes=Fe,T.mount=V,T.config=function(A={}){return A.formats&&Object.assign(H,A.formats),T},T._registry=n,T._reset=function(){n.clear(),o.length=0,mt()},T.unmount=function(){L=!0,n.clear(),o.length=0,mt(),typeof _=="function"&&_(),Y()};let Y=Fn(d,T,s);return{Sap:T,mountAll:j,mount:V,runtime:d}}function jn(e){if(typeof document>"u")return;let t=()=>pn(()=>e());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Wn(e){let t=[];function r(b){let m=b.target;if(!m||m.nodeType!==1)return;let d=e.appFor(m);if(d){m.hasAttribute("persist")&&!Be(m)&&ae(m)&&se(m);for(let l of t)if(l(m,d))return;e.schedule(d,b.type+" "+(m.id||m.tagName.toLowerCase()))}}function n(b){let m=b.target,d=e.appFor(m);d&&[...m.querySelectorAll("[bind]")].every(l=>ae(l))&&setTimeout(()=>{m.querySelectorAll("[bind]").forEach(l=>{l.dispatchEvent(new Event("input",{bubbles:!0})),l.dispatchEvent(new Event("change",{bubbles:!0}))}),e.schedule(d,"reset")},0)}function o(b){let m=e.appFor(b.target);m&&e.schedule(m,"toggle")}function s(b){let m=b.detail||{};for(let d of[m.from,m.to,b.target]){if(!d||d.nodeType!==1)continue;let l=e.appFor(d);l&&e.schedule(l,"sorted")}}function i(b){if(b.key!=="ArrowUp"&&b.key!=="ArrowDown")return;let m=b.target;if(!m||m.nodeType!==1||m.tagName!=="INPUT"||!m.hasAttribute("bind")||!m.hasAttribute("step"))return;let d=(m.getAttribute("type")||"text").toLowerCase();if(d!=="text"&&d!=="tel"&&d!=="search"||!e.appFor(m)||!ae(m))return;b.preventDefault();let p=M(m.getAttribute("step"))||1,k=b.key==="ArrowUp"?1:-1,R=M(m.value)+p*(b.shiftKey?10:1)*k,L=m.getAttribute("min"),_=m.getAttribute("max");L!==null&&L!==""&&R<M(L)&&(R=M(L)),_!==null&&_!==""&&R>M(_)&&(R=M(_)),An(m).write(String(Number(R.toFixed(2))))}function g(b=document){b.addEventListener("reset",n),b.addEventListener("toggle",o,!0),b.addEventListener("input",r),b.addEventListener("change",r),b.addEventListener("clay:sorted",s),b.addEventListener("keydown",i)}return{install:g,addRouter:b=>t.push(b)}}var ke="https://clayjs.com/v1/sap.js",Dr=/^(calc|set|move|sort):/,Fr=new Set(["each","detail","effect","invalid","confirm","trigger-add","trigger-remove","trigger-reset"]);function At(e){return Dr.test(e)||Fr.has(e)}Ue((e,t)=>{for(let r of e.attributes)At(r.name)&&t("E50",e,{attr:r.name,expr:r.value,problem:`${r.name} is full sapjs; the sapjs core only paints declared state`,fix:`load ${ke}; the markup stays as it is`})});function le(e,t,r){e.app.diag.error("E50",t,{attr:r,problem:`${r} is full sapjs; the sapjs core only paints declared state`,fix:`load ${ke}; the markup stays as it is`}),D(t,"E50"),e.app.halted=!0}He({name:"core-only",collect(e,t,r){r.calcs&&le(e,t,"calc:"+r.calcs[0].name),r.effects&&le(e,t,"effect"),r.invalids&&le(e,t,"invalid");for(let n of t.attributes)At(n.name)&&(n.name.startsWith("calc:")&&r.calcs||n.name==="effect"&&r.effects||n.name==="invalid"&&r.invalids||le(e,t,n.name));return!1},boundary:{each(e,t){le(e,t,"each")},detail(e,t){le(e,t,"detail")}}});function Br(){return{Sap:function(){throw new Error(`Sap(el) is full sapjs; load ${ke}`)}}}var Hn=e=>()=>(console.warn(`Sap.${e} is full sapjs; load ${ke}`),null),{Sap:Se,mountAll:zn,mount:jr,runtime:Wr}=Bn({createAccessor:Br,debugExtras:()=>({why:Hn("why"),doctor:Hn("doctor")}),installInput(e,t,r){Wn(e).install(r)}});Se.core=!0;var Hr=typeof window<"u"&&window.Sap&&!window.Sap.core;Hr?Se.unmount():jn(zn);typeof window<"u"&&!window.Sap&&(window.Sap=Se);var zr=Se;return Xn(Ur);})();
|
|
9
10
|
export default SapCoreBundle.default;
|
|
@@ -9,6 +9,18 @@
|
|
|
9
9
|
|
|
10
10
|
export const BEACON = "sap-error";
|
|
11
11
|
|
|
12
|
+
// What a plugin paints inside a boundary of its own, as plain data, so a host knows it
|
|
13
|
+
// before that plugin's code has loaded, and in a tab where it never loads:
|
|
14
|
+
// { plugin, within, select, text?, attrs? }
|
|
15
|
+
// `within` selects the boundary, and `select` the elements under it or the boundary
|
|
16
|
+
// itself. `text: true` says the element's text is painted, and `attrs` names painted
|
|
17
|
+
// attributes. Under a boundary only rules and the error marker say what is painted,
|
|
18
|
+
// because the engine stays out of it: its own directives, sap-ignore and templates mean
|
|
19
|
+
// nothing there. First party rules live in this table, because this is the one file
|
|
20
|
+
// ClayJS vendors. None ships yet. A plugin from anyone else gives the same rules in its
|
|
21
|
+
// definition's `ownership` field, and they count once its file has run.
|
|
22
|
+
export const PLUGIN_RULES = [];
|
|
23
|
+
|
|
12
24
|
const WHEN = /^(show-when|hide-when|option|option-not):/;
|
|
13
25
|
// Identity and the attributes that declare the record itself are never paint
|
|
14
26
|
// output. Form state is, unless a bind or persist owns it.
|
|
@@ -26,6 +38,67 @@ function inert(el) {
|
|
|
26
38
|
return el.localName === "template" || el.hasAttribute("template") || el.hasAttribute("cms-template") || el.hasAttribute("sap-ignore");
|
|
27
39
|
}
|
|
28
40
|
|
|
41
|
+
// An element the engine enters as a scope of its own never starts a plugin boundary.
|
|
42
|
+
const SCOPES = ["sap", "item", "scope", "items", "detail", "each"];
|
|
43
|
+
const NONE = [];
|
|
44
|
+
let known = { rules: NONE, within: "", seen: NONE, counted: 0 };
|
|
45
|
+
|
|
46
|
+
// PLUGIN_RULES, then the rules of every other definition this page has seen, with one
|
|
47
|
+
// selector, `within`, for every boundary a rule names. Built again only when a
|
|
48
|
+
// definition or a rule has arrived.
|
|
49
|
+
function pluginRules() {
|
|
50
|
+
const seen = typeof window !== "undefined" && Array.isArray(window.sapPlugins) ? window.sapPlugins : NONE;
|
|
51
|
+
const counted = seen.length + PLUGIN_RULES.length;
|
|
52
|
+
if (seen === known.seen && counted === known.counted) return known;
|
|
53
|
+
const rules = PLUGIN_RULES.slice();
|
|
54
|
+
for (const def of seen) {
|
|
55
|
+
if (!def || !Array.isArray(def.ownership) || PLUGIN_RULES.some((rule) => rule.plugin === def.name)) continue;
|
|
56
|
+
for (const rule of def.ownership) if (usable(rule)) rules.push({ ...rule, plugin: def.name });
|
|
57
|
+
}
|
|
58
|
+
known = { rules, within: [...new Set(rules.map((rule) => rule.within))].join(","), seen, counted };
|
|
59
|
+
return known;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// A rule from a file this project did not write runs inside a host's dirty check, so
|
|
63
|
+
// one that would throw there is left out.
|
|
64
|
+
function usable(rule) {
|
|
65
|
+
if (!rule || typeof rule.within !== "string" || typeof rule.select !== "string" || (rule.attrs && !Array.isArray(rule.attrs))) return false;
|
|
66
|
+
try {
|
|
67
|
+
const nowhere = document.createDocumentFragment();
|
|
68
|
+
nowhere.querySelector(rule.within);
|
|
69
|
+
nowhere.querySelector(rule.select);
|
|
70
|
+
return true;
|
|
71
|
+
} catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function startsBoundary(el) {
|
|
77
|
+
return !SCOPES.some((name) => el.hasAttribute(name));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// The nearest boundary at or above el that `selector` matches and that sits in an app,
|
|
81
|
+
// or null. `host` continues the walk for a subtree that left the page, as in appOf.
|
|
82
|
+
function boundaryAt(el, selector, host = null) {
|
|
83
|
+
for (let cur = el; cur; cur = cur.parentElement) {
|
|
84
|
+
const found = cur.closest(selector);
|
|
85
|
+
if (!found) break;
|
|
86
|
+
if (startsBoundary(found) && appOf(found, host)) return found;
|
|
87
|
+
cur = found;
|
|
88
|
+
}
|
|
89
|
+
return host && !el.isConnected ? boundaryAt(host, selector) : null;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// The boundary el sits under, not counting el itself.
|
|
93
|
+
function boundaryAbove(el, selector, host = null) {
|
|
94
|
+
const from = el.parentElement || (el.isConnected ? null : host);
|
|
95
|
+
return from ? boundaryAt(from, selector, host) : null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function ruleApplies(rule, el, live, host = null) {
|
|
99
|
+
return (!live || live(rule.plugin)) && el.matches(rule.select) && !!boundaryAt(el, rule.within, host);
|
|
100
|
+
}
|
|
101
|
+
|
|
29
102
|
// The [sap] root an element is painted under, or null when it sits outside every
|
|
30
103
|
// app or inside a subtree the engine never reads. A subtree just removed from the
|
|
31
104
|
// page has no ancestors left to ask; `host`, the element it was removed from,
|
|
@@ -55,9 +128,19 @@ function paintsHidden(el) {
|
|
|
55
128
|
return false;
|
|
56
129
|
}
|
|
57
130
|
|
|
58
|
-
// True when a sapjs paint writes attribute `name` on `el`.
|
|
59
|
-
|
|
131
|
+
// True when a sapjs paint writes attribute `name` on `el`. `live`, when given, is asked
|
|
132
|
+
// with a plugin's name and says whether that plugin's rules count: a host passes it
|
|
133
|
+
// where the question is "will something repaint this", which is only true of a plugin
|
|
134
|
+
// that is installed.
|
|
135
|
+
export function ownsAttr(el, name, host = null, live = null) {
|
|
60
136
|
if (!el || el.nodeType !== 1 || !name) return false;
|
|
137
|
+
const { rules, within } = pluginRules();
|
|
138
|
+
if (rules.length && boundaryAt(el, within, host)) {
|
|
139
|
+
for (const rule of rules) {
|
|
140
|
+
if (rule.attrs && rule.attrs.includes(name) && ruleApplies(rule, el, live, host)) return true;
|
|
141
|
+
}
|
|
142
|
+
if (boundaryAbove(el, within, host)) return name === BEACON;
|
|
143
|
+
}
|
|
61
144
|
if (name === BEACON) return !!appOf(el, host);
|
|
62
145
|
if (NEVER.has(name)) return false;
|
|
63
146
|
if (FORM_STATE.has(name) && recordOwnsFormState(el)) return false;
|
|
@@ -65,16 +148,30 @@ export function ownsAttr(el, name, host = null) {
|
|
|
65
148
|
return el.hasAttribute("attr:" + name) && !declares(el, name) && !!appOf(el, host);
|
|
66
149
|
}
|
|
67
150
|
|
|
151
|
+
const blank = () => ({ attrs: [], classes: [], vars: [], text: false });
|
|
152
|
+
|
|
68
153
|
// Everything a paint writes on `el`: whole attributes, class tokens, --custom
|
|
69
154
|
// properties in style, and whether text owns its children. Null when nothing.
|
|
70
|
-
|
|
71
|
-
|
|
155
|
+
// `live` is the same optional question as in ownsAttr.
|
|
156
|
+
export function paintsOf(el, live = null) {
|
|
157
|
+
if (!el || el.nodeType !== 1) return null;
|
|
158
|
+
const { rules, within } = pluginRules();
|
|
159
|
+
if (!rules.length || !boundaryAt(el, within)) return appOf(el) ? enginePaints(el, null) : null;
|
|
72
160
|
let out = null;
|
|
73
|
-
const
|
|
161
|
+
for (const rule of rules) if (ruleApplies(rule, el, live)) out = addRule(out, rule);
|
|
162
|
+
// With no boundary above it, el is the boundary, and the engine paints on that.
|
|
163
|
+
if (!boundaryAbove(el, within)) return enginePaints(el, out);
|
|
164
|
+
if (el.hasAttribute(BEACON)) (out || (out = blank())).attrs.push(BEACON);
|
|
165
|
+
return out;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// What the engine's own directives paint on el, added to `out`.
|
|
169
|
+
function enginePaints(el, out) {
|
|
170
|
+
const add = (key, v) => ((out || (out = blank()))[key].push(v));
|
|
74
171
|
for (const a of el.attributes) {
|
|
75
172
|
const n = a.name;
|
|
76
173
|
if (n === "text" || n.startsWith("text:")) {
|
|
77
|
-
if (!el.hasAttribute("bind")) (out || (out =
|
|
174
|
+
if (!el.hasAttribute("bind")) (out || (out = blank())).text = true;
|
|
78
175
|
}
|
|
79
176
|
else if (n.startsWith("attr:")) {
|
|
80
177
|
const target = n.slice(5);
|
|
@@ -87,29 +184,102 @@ export function paintsOf(el) {
|
|
|
87
184
|
return out;
|
|
88
185
|
}
|
|
89
186
|
|
|
187
|
+
function addRule(out, rule) {
|
|
188
|
+
out = out || blank();
|
|
189
|
+
if (rule.text) out.text = true;
|
|
190
|
+
for (const name of rule.attrs || NONE) if (!out.attrs.includes(name)) out.attrs.push(name);
|
|
191
|
+
return out;
|
|
192
|
+
}
|
|
193
|
+
|
|
90
194
|
// Calls visit(el, paints) for every painted element under root, in document order.
|
|
91
|
-
|
|
195
|
+
// `live` is the same optional question as in ownsAttr.
|
|
196
|
+
export function eachPainted(root, visit, live = null) {
|
|
92
197
|
if (!root || root.nodeType !== 1 && root.nodeType !== 9) return;
|
|
93
198
|
const apps = root.nodeType === 1 && root.hasAttribute("sap")
|
|
94
199
|
? [root]
|
|
95
200
|
: [...root.querySelectorAll("[sap]")].filter((app) => !app.parentElement || !app.parentElement.closest("[sap]"));
|
|
201
|
+
const known = pluginRules();
|
|
96
202
|
for (const app of apps) {
|
|
203
|
+
// A root handed in from under a boundary is asked element by element.
|
|
204
|
+
if (known.rules.length && !boundaryAbove(app, known.within)) {
|
|
205
|
+
walkPainted(app, known, live, visit);
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
97
208
|
for (const el of [app, ...app.querySelectorAll("*")]) {
|
|
98
|
-
const p = paintsOf(el);
|
|
209
|
+
const p = paintsOf(el, live);
|
|
99
210
|
if (p) visit(el, p);
|
|
100
211
|
}
|
|
101
212
|
}
|
|
102
213
|
}
|
|
103
214
|
|
|
215
|
+
// The same visits as asking paintsOf of el and of every element under it, for an el
|
|
216
|
+
// that is under no boundary. It does not ask paintsOf of an element under a boundary:
|
|
217
|
+
// the boundary is asked for the elements its rules select.
|
|
218
|
+
function walkPainted(el, known, live, visit) {
|
|
219
|
+
if (inert(el)) {
|
|
220
|
+
// A [sap] root in a subtree the engine never reads is an app again.
|
|
221
|
+
let last = null;
|
|
222
|
+
for (const app of el.querySelectorAll("[sap]")) {
|
|
223
|
+
if (last && last.contains(app)) continue;
|
|
224
|
+
walkPainted(app, known, live, visit);
|
|
225
|
+
last = app;
|
|
226
|
+
}
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
const boundary = el.matches(known.within) && startsBoundary(el);
|
|
230
|
+
const p = boundary ? paintsOf(el, live) : enginePaints(el, null);
|
|
231
|
+
if (p) visit(el, p);
|
|
232
|
+
if (boundary) visitBoundary(el, known.rules, live, visit);
|
|
233
|
+
else for (let c = el.firstElementChild; c; c = c.nextElementSibling) walkPainted(c, known, live, visit);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function visitBoundary(top, rules, live, visit) {
|
|
237
|
+
const found = new Map();
|
|
238
|
+
const note = (el, rule) => found.set(el, addRule(found.get(el), rule));
|
|
239
|
+
const selects = ["[" + BEACON + "]"];
|
|
240
|
+
let all = NONE;
|
|
241
|
+
for (const rule of rules) {
|
|
242
|
+
if (live && !live(rule.plugin)) continue;
|
|
243
|
+
selects.push(rule.select);
|
|
244
|
+
if (top.matches(rule.within)) {
|
|
245
|
+
const list = top.querySelectorAll(rule.select);
|
|
246
|
+
for (const el of list) note(el, rule);
|
|
247
|
+
if (list.length > all.length) all = list;
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
// A boundary of another rule, nested in this one.
|
|
251
|
+
for (const inner of top.querySelectorAll(rule.within)) {
|
|
252
|
+
if (!startsBoundary(inner) || !appOf(inner)) continue;
|
|
253
|
+
if (inner.matches(rule.select)) note(inner, rule);
|
|
254
|
+
for (const el of inner.querySelectorAll(rule.select)) note(el, rule);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
// An error marker under a boundary is painted too, whatever the rules select.
|
|
258
|
+
const marked = top.querySelectorAll("[" + BEACON + "]");
|
|
259
|
+
for (const el of marked) {
|
|
260
|
+
const p = found.get(el) || blank();
|
|
261
|
+
p.attrs.push(BEACON);
|
|
262
|
+
found.set(el, p);
|
|
263
|
+
}
|
|
264
|
+
// What one query found is in document order already. When that is not everything
|
|
265
|
+
// found, one more query puts all of it in order.
|
|
266
|
+
if (all.length < found.size) all = top.querySelectorAll(selects.join(","));
|
|
267
|
+
for (const el of all) {
|
|
268
|
+
const p = found.get(el);
|
|
269
|
+
if (p) visit(el, p);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
104
273
|
// Removes every painted value from a detached tree, in place: owned attributes,
|
|
105
274
|
// owned class tokens and --properties, and the children of text paints.
|
|
106
|
-
|
|
275
|
+
// `live` is the same optional question as in ownsAttr.
|
|
276
|
+
export function stripPaints(root, live = null) {
|
|
107
277
|
eachPainted(root, (el, p) => {
|
|
108
278
|
for (const name of p.attrs) if (el.hasAttribute(name)) el.removeAttribute(name);
|
|
109
279
|
for (const token of p.classes) if (el.classList.contains(token)) el.classList.remove(token);
|
|
110
|
-
if (!el.getAttribute("class") && el.hasAttribute("class")
|
|
280
|
+
if (p.classes.length && !el.getAttribute("class") && el.hasAttribute("class")) el.removeAttribute("class");
|
|
111
281
|
for (const v of p.vars) if (el.style.getPropertyValue(v) !== "") el.style.removeProperty(v);
|
|
112
282
|
if (p.vars.length && el.hasAttribute("style") && !el.getAttribute("style").trim()) el.removeAttribute("style");
|
|
113
283
|
if (p.text && el.firstChild) el.replaceChildren();
|
|
114
|
-
});
|
|
284
|
+
}, live);
|
|
115
285
|
}
|
|
@@ -14,7 +14,7 @@ The tool sits inside someone else's page, so it fits that page instead of bringi
|
|
|
14
14
|
- Inherit the page's type and colour: `font: inherit; color: inherit;`, `currentColor` for lines and icons, and the page's custom properties when you know them. Load no fonts.
|
|
15
15
|
- Separate parts with whitespace first, then a hairline, then a tinted area. Never a card inside a card, and never a coloured stripe on one side of a box: not left, right or top.
|
|
16
16
|
- No eyebrow text above a heading. Labels use the body face one step smaller, in sentence case, with no letter spacing.
|
|
17
|
-
- One filled primary button at most. Fields are flat; buttons are the only raised things. One shadow at most per element.
|
|
17
|
+
- One filled primary button at most. Fill it with `CanvasText` and write its label in `Canvas`, or tint it with `color-mix(in srgb, currentColor 12%, transparent)` and keep the inherited text colour. Never fill an element with `currentColor` while changing its `color`: `currentColor` is that element's own text colour, so the label disappears. Fields are flat; buttons are the only raised things. One shadow at most per element.
|
|
18
18
|
- Every control shows a visible focus ring with space around it: `outline: 2px solid currentColor; outline-offset: 2px;` on `:focus-visible`.
|
|
19
19
|
- Checkboxes and radios keep their native behaviour, styled with `accent-color`, 1 to 4 px larger than the default.
|
|
20
20
|
- A styled select uses `appearance: none`, places its arrow as far from the right edge as the text is from the left, and pads the right so text never runs under it.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"../c-YK2L436K.js";import"../c-TWCXBWS3.js";import"../c-LA2BW7UY.js";import"../c-IJUK2GPW.js";import"../c-PWJSJEJU.js";import"../c-XQXZAO7N.js";import"../c-S7LK4KUE.js";import"../c-VG5XIN4T.js";import"../c-2YYDMLNZ.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";export{a as default};
|