@panphora/clayjs 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +173 -59
- package/dist/m/{c-Z32V4MHK.js → c-5FEU5MMY.js} +1 -1
- package/dist/m/{c-D3E4WJ4M.js → c-HDWZEJHM.js} +49 -32
- package/dist/m/{loader-DZZLUBVB.js → loader-ZVPK4ZN3.js} +1 -1
- package/dist/m/{manifest-3AEF5191.js → manifest-5498AFD3.js} +1 -1
- package/dist/m/{manifest-edit-29A26F22.js → manifest-edit-62A5A00F.js} +1 -1
- package/dist/m/manifest.json +33 -33
- package/dist/m/plugins/{derive-FRE5JJQE.js → derive-QVI3LI3A.js} +1 -1
- package/dist/m/plugins/menu-DM2JHPSR.js +1 -0
- package/dist/m/vendor/{sap-core.vendor-RN4ZVY4X.js → sap-core.vendor-OA5SKL7Q.js} +1 -1
- package/dist/offline-manifest.json +51 -51
- package/docs/guide.md +14 -6
- package/entries/sap.js +1 -1
- package/package.json +1 -1
- package/src/plugins/menu/style.js +59 -31
- package/src/plugins/menu.js +131 -28
- package/src/vendor/sap-core.vendor.js +1 -1
- package/dist/m/plugins/menu-KGWKT6CS.js +0 -1
package/dist/m/manifest.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"package": "@panphora/clayjs",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"build": "
|
|
6
|
-
"runtime": "manifest-
|
|
7
|
-
"edit": "manifest-edit-
|
|
4
|
+
"version": "1.21.0",
|
|
5
|
+
"build": "3b25220833c2e0f19108f4690a9d62714f1a490c6b4029b17b3e38bc022ea976",
|
|
6
|
+
"runtime": "manifest-5498AFD3.js",
|
|
7
|
+
"edit": "manifest-edit-62A5A00F.js",
|
|
8
8
|
"entries": {
|
|
9
9
|
"vendor/hljs-css.vendor.js": "c-H4LG442Q.js",
|
|
10
10
|
"vendor/hljs-javascript.vendor.js": "c-VDSS4K3Z.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"page/awareness.js": "c-BTLFLLML.js",
|
|
27
27
|
"recovery/undo.js": "c-NEL7HQW3.js",
|
|
28
28
|
"plugins/upload-ui.js": "c-ANNFZFLN.js",
|
|
29
|
-
"plugins/menu/seo.js": "c-
|
|
29
|
+
"plugins/menu/seo.js": "c-5FEU5MMY.js",
|
|
30
30
|
"plugins/visitor-drafts/prompt-style.js": "c-SGIA4IEQ.js",
|
|
31
31
|
"vendor/marked.vendor.js": "c-XN6MBKI6.js",
|
|
32
32
|
"page/features/import-markdown.js": "c-W3K23S72.js",
|
|
@@ -105,18 +105,18 @@
|
|
|
105
105
|
"ui/index.js": "ui/index-QNIPDHXQ.js",
|
|
106
106
|
"utils/index.js": "utils/index-4TJCVLT7.js",
|
|
107
107
|
"vendor/Sortable.vendor.js": "vendor/Sortable.vendor-A755ITLN.js",
|
|
108
|
-
"vendor/sap-core.vendor.js": "vendor/sap-core.vendor-
|
|
108
|
+
"vendor/sap-core.vendor.js": "vendor/sap-core.vendor-OA5SKL7Q.js",
|
|
109
109
|
"core/host-permission.js": "core/host-permission-6EVJGNPL.js",
|
|
110
110
|
"page/editor.js": "page/editor-EY2WAAGB.js",
|
|
111
111
|
"plugins/bind-text.js": "plugins/bind-text-NX46N5UV.js",
|
|
112
112
|
"plugins/source.js": "plugins/source-CCEUM3OR.js",
|
|
113
|
-
"plugins/derive.js": "plugins/derive-
|
|
113
|
+
"plugins/derive.js": "plugins/derive-QVI3LI3A.js",
|
|
114
114
|
"plugins/upgrade.js": "plugins/upgrade-NW556WJD.js",
|
|
115
115
|
"dom/all.js": "dom/all-APS5ZSKP.js",
|
|
116
116
|
"dom/dom-helpers.js": "dom/dom-helpers-L7OSR6S4.js",
|
|
117
117
|
"events/index.js": "events/index-B6TGDYMG.js",
|
|
118
118
|
"internals/index.js": "internals/index-HDRANDWE.js",
|
|
119
|
-
"plugins/menu.js": "plugins/menu-
|
|
119
|
+
"plugins/menu.js": "plugins/menu-DM2JHPSR.js",
|
|
120
120
|
"plugins/wire.js": "plugins/wire-VRYPY6EJ.js",
|
|
121
121
|
"plugins/message.js": "plugins/message-LQ6EDH4V.js",
|
|
122
122
|
"plugins/like.js": "plugins/like-EV7MTZ56.js",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"core/autosave.js": "core/autosave-VPORYJSE.js",
|
|
149
149
|
"attrs/save-freeze.js": "attrs/save-freeze-MTFVVYV5.js",
|
|
150
150
|
"attrs/onaftersave.js": "attrs/onaftersave-OKSWEJQF.js",
|
|
151
|
-
"loader.js": "loader-
|
|
151
|
+
"loader.js": "loader-ZVPK4ZN3.js",
|
|
152
152
|
"reader-core.js": "reader-core-2GXY7SHY.js",
|
|
153
153
|
"core/is-edit-mode.js": "core/is-edit-mode-GCX6767E.js",
|
|
154
154
|
"core/draft-mode.js": "core/draft-mode-WSQAT67S.js",
|
|
@@ -509,13 +509,13 @@
|
|
|
509
509
|
],
|
|
510
510
|
"dynamicImports": []
|
|
511
511
|
},
|
|
512
|
-
"c-
|
|
513
|
-
"sha256": "
|
|
512
|
+
"c-5FEU5MMY.js": {
|
|
513
|
+
"sha256": "8e898860d9cc1f2bdb23e7d3948cb37eb74e56a28cab7606d11988664487c8fe",
|
|
514
514
|
"bytes": 26008,
|
|
515
515
|
"contentType": "text/javascript; charset=utf-8",
|
|
516
516
|
"imports": [
|
|
517
517
|
"c-HAWFNBYG.js",
|
|
518
|
-
"c-
|
|
518
|
+
"c-HDWZEJHM.js",
|
|
519
519
|
"c-AQLFEATB.js",
|
|
520
520
|
"c-AQYCG7QW.js",
|
|
521
521
|
"c-QY7F6EN6.js",
|
|
@@ -2273,8 +2273,8 @@
|
|
|
2273
2273
|
"imports": [],
|
|
2274
2274
|
"dynamicImports": []
|
|
2275
2275
|
},
|
|
2276
|
-
"vendor/sap-core.vendor-
|
|
2277
|
-
"sha256": "
|
|
2276
|
+
"vendor/sap-core.vendor-OA5SKL7Q.js": {
|
|
2277
|
+
"sha256": "62ef07a9e5c106c82586bd68265df436ddd848190d8a8aa9cfca00fce1d6ac13",
|
|
2278
2278
|
"bytes": 44136,
|
|
2279
2279
|
"contentType": "text/javascript; charset=utf-8",
|
|
2280
2280
|
"imports": [
|
|
@@ -2529,15 +2529,15 @@
|
|
|
2529
2529
|
"c-JOH753EJ.js"
|
|
2530
2530
|
]
|
|
2531
2531
|
},
|
|
2532
|
-
"plugins/derive-
|
|
2533
|
-
"sha256": "
|
|
2532
|
+
"plugins/derive-QVI3LI3A.js": {
|
|
2533
|
+
"sha256": "15b2fe12516a766f8407e2bc8c558bf8e7225e4171f7fd68805c98592934ebc2",
|
|
2534
2534
|
"bytes": 198,
|
|
2535
2535
|
"contentType": "text/javascript; charset=utf-8",
|
|
2536
2536
|
"imports": [
|
|
2537
2537
|
"c-VHNSBD2M.js"
|
|
2538
2538
|
],
|
|
2539
2539
|
"dynamicImports": [
|
|
2540
|
-
"vendor/sap-core.vendor-
|
|
2540
|
+
"vendor/sap-core.vendor-OA5SKL7Q.js"
|
|
2541
2541
|
]
|
|
2542
2542
|
},
|
|
2543
2543
|
"plugins/upgrade-NW556WJD.js": {
|
|
@@ -2624,12 +2624,12 @@
|
|
|
2624
2624
|
],
|
|
2625
2625
|
"dynamicImports": []
|
|
2626
2626
|
},
|
|
2627
|
-
"plugins/menu-
|
|
2628
|
-
"sha256": "
|
|
2629
|
-
"bytes":
|
|
2627
|
+
"plugins/menu-DM2JHPSR.js": {
|
|
2628
|
+
"sha256": "bcf9f2dcf7d8a7ac2459e8aaca616d2cb7a903d7a35e4cf5dc9c7dc7b0eb0a47",
|
|
2629
|
+
"bytes": 29370,
|
|
2630
2630
|
"contentType": "text/javascript; charset=utf-8",
|
|
2631
2631
|
"imports": [
|
|
2632
|
-
"c-
|
|
2632
|
+
"c-HDWZEJHM.js",
|
|
2633
2633
|
"c-AQLFEATB.js",
|
|
2634
2634
|
"c-QY7F6EN6.js",
|
|
2635
2635
|
"c-RVMWGXEJ.js",
|
|
@@ -2651,13 +2651,13 @@
|
|
|
2651
2651
|
"c-FTWGYI5E.js",
|
|
2652
2652
|
"core/save-AOJBDSOK.js",
|
|
2653
2653
|
"c-FSWRGBVQ.js",
|
|
2654
|
-
"c-
|
|
2654
|
+
"c-5FEU5MMY.js",
|
|
2655
2655
|
"core/host-permission-6EVJGNPL.js"
|
|
2656
2656
|
]
|
|
2657
2657
|
},
|
|
2658
|
-
"c-
|
|
2659
|
-
"sha256": "
|
|
2660
|
-
"bytes":
|
|
2658
|
+
"c-HDWZEJHM.js": {
|
|
2659
|
+
"sha256": "0158737e691ef00d807d7a15bcee0ce136aa3ab9746c4bf8d25d9e51ce7f5599",
|
|
2660
|
+
"bytes": 17216,
|
|
2661
2661
|
"contentType": "text/javascript; charset=utf-8",
|
|
2662
2662
|
"imports": [],
|
|
2663
2663
|
"dynamicImports": []
|
|
@@ -3797,8 +3797,8 @@
|
|
|
3797
3797
|
],
|
|
3798
3798
|
"dynamicImports": []
|
|
3799
3799
|
},
|
|
3800
|
-
"loader-
|
|
3801
|
-
"sha256": "
|
|
3800
|
+
"loader-ZVPK4ZN3.js": {
|
|
3801
|
+
"sha256": "627f235bfa90c48e0144785c51314b7d6f9e6d57aad93e78dcdd67c9c21837e6",
|
|
3802
3802
|
"bytes": 18521,
|
|
3803
3803
|
"contentType": "text/javascript; charset=utf-8",
|
|
3804
3804
|
"imports": [
|
|
@@ -3855,7 +3855,7 @@
|
|
|
3855
3855
|
"plugins/quickcrop-BQ5YYFCH.js",
|
|
3856
3856
|
"plugins/upload-TTCQRIM5.js",
|
|
3857
3857
|
"plugins/people-C7TVBBMR.js",
|
|
3858
|
-
"plugins/menu-
|
|
3858
|
+
"plugins/menu-DM2JHPSR.js",
|
|
3859
3859
|
"plugins/wire-VRYPY6EJ.js",
|
|
3860
3860
|
"plugins/message-LQ6EDH4V.js",
|
|
3861
3861
|
"plugins/like-EV7MTZ56.js",
|
|
@@ -3865,7 +3865,7 @@
|
|
|
3865
3865
|
"plugins/visitor-drafts-owner-MZP45XSG.js",
|
|
3866
3866
|
"plugins/bind-text-NX46N5UV.js",
|
|
3867
3867
|
"plugins/source-CCEUM3OR.js",
|
|
3868
|
-
"plugins/derive-
|
|
3868
|
+
"plugins/derive-QVI3LI3A.js",
|
|
3869
3869
|
"plugins/upgrade-NW556WJD.js",
|
|
3870
3870
|
"c-PQ5LK6QE.js",
|
|
3871
3871
|
"c-XN6MBKI6.js",
|
|
@@ -4387,15 +4387,15 @@
|
|
|
4387
4387
|
"imports": [],
|
|
4388
4388
|
"dynamicImports": []
|
|
4389
4389
|
},
|
|
4390
|
-
"manifest-
|
|
4391
|
-
"sha256": "
|
|
4390
|
+
"manifest-5498AFD3.js": {
|
|
4391
|
+
"sha256": "5498afd357f86a2aacbdb1e4527be4a1d94aa9ec98f968b6b2d4b93bc661a347",
|
|
4392
4392
|
"bytes": 9180,
|
|
4393
4393
|
"contentType": "text/javascript; charset=utf-8",
|
|
4394
4394
|
"imports": [],
|
|
4395
4395
|
"dynamicImports": []
|
|
4396
4396
|
},
|
|
4397
|
-
"manifest-edit-
|
|
4398
|
-
"sha256": "
|
|
4397
|
+
"manifest-edit-62A5A00F.js": {
|
|
4398
|
+
"sha256": "62a5a00f95a7beeda32ad82274aa52a43370f58d00bd1dd32cd59744bb74c024",
|
|
4399
4399
|
"bytes": 32503,
|
|
4400
4400
|
"contentType": "text/javascript; charset=utf-8",
|
|
4401
4401
|
"imports": [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../c-VHNSBD2M.js";function n(){let o=window.Sap;return!!(o&&!o.core||window.clay?.loaded?.sap)}var a=n()?null:import("../vendor/sap-core.vendor-
|
|
1
|
+
import"../c-VHNSBD2M.js";function n(){let o=window.Sap;return!!(o&&!o.core||window.clay?.loaded?.sap)}var a=n()?null:import("../vendor/sap-core.vendor-OA5SKL7Q.js").then(()=>{});export{a as ready};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Me,b as ue,c as Re,d as de,e as pe}from"../c-HDWZEJHM.js";import{a as Z}from"../c-AQLFEATB.js";import{b as Le}from"../c-QY7F6EN6.js";import{b as Ne,c as Qe}from"../c-RVMWGXEJ.js";import{d as Se}from"../c-MHI3GYKF.js";import{a as Ae,b as Ce}from"../c-RHMPKZZ7.js";import{a as ke}from"../c-VKEDWYDF.js";import{b as ie,c as ce,f as Ee,g as xe}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var $e='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-45.87 -57.96 100.26 60.98" fill="currentColor" aria-hidden="true" focusable="false"><path fill-rule="evenodd" d="M44.35 -4.56Q40.03 -0.52 34.69 -0.39Q29.34 -0.25 24.81 -0.14Q20.27 -0.02 15.6 0Q10.93 0.02 6.41 0Q1.89 -0.02 -2.79 -0.02Q-7.48 -0.02 -12.11 -0.14Q-16.73 -0.25 -21.64 -0.27Q-26.55 -0.3 -31.72 -2.25Q-36.88 -4.2 -39.87 -9.12Q-42.87 -14.03 -42.8 -19.61Q-42.74 -25.18 -40.43 -29.94Q-38.12 -34.69 -34.82 -38.78Q-31.52 -42.87 -27.25 -45.6Q-22.98 -48.33 -18.35 -50.59Q-13.73 -52.85 -8.7 -53.88Q-3.68 -54.91 1.32 -54.93Q6.32 -54.96 11.44 -54.56Q16.55 -54.16 21.35 -52.2Q26.16 -50.24 30.69 -48.01Q35.22 -45.78 38.99 -42.18Q42.76 -38.59 45.67 -34.37Q48.59 -30.15 49.99 -24.87Q51.39 -19.59 50.04 -14.09Q48.68 -8.6 44.35 -4.56ZM0.66 -30.49C0.5 -28.73 -0.88 -27.42 -2.42 -27.57C-3.96 -27.71 -5.08 -29.25 -4.91 -31.01C-4.75 -32.77 -3.36 -34.08 -1.83 -33.94C-0.29 -33.79 0.83 -32.25 0.66 -30.49ZM13.61 -29.28C13.44 -27.52 12.06 -26.21 10.52 -26.35C8.98 -26.5 7.87 -28.04 8.03 -29.8C8.2 -31.56 9.58 -32.87 11.12 -32.73C12.66 -32.58 13.77 -31.04 13.61 -29.28ZM-1.23 -17.71Q-0.62 -17.35 -0.03 -17.08Q0.56 -16.81 1.15 -16.54Q1.73 -16.28 2.4 -16Q3.07 -15.72 3.87 -15.6Q4.66 -15.48 5.4 -15.55Q6.13 -15.62 6.77 -15.79Q7.41 -15.96 7.97 -16.23Q8.53 -16.5 9 -16.91Q9.46 -17.32 9.73 -17.9Q9.99 -18.47 10.08 -19.12Q10.17 -19.77 10.08 -20.42Q9.99 -21.06 9.45 -21.32Q8.91 -21.58 8.27 -21.38Q7.63 -21.17 6.99 -20.91Q6.36 -20.65 5.7 -20.61Q5.04 -20.56 4.33 -20.73Q3.62 -20.9 2.92 -21.14Q2.23 -21.39 1.54 -21.68Q0.85 -21.97 0.16 -22.27Q-0.52 -22.56 -1.22 -22.79Q-1.92 -23.03 -2.49 -22.61Q-3.05 -22.19 -3.23 -21.5Q-3.4 -20.81 -3.2 -20.09Q-3.01 -19.38 -3.02 -19.15Q-3.02 -18.93 -2.42 -18.5Q-1.83 -18.06 -1.23 -17.71Z"/></svg>';var Pe=new Set(["top-left","top-right","bottom-left","bottom-right"]),Je=4,Te="menu-corner";function et(t,n,f,x){return`${n<x/2?"top":"bottom"}-${t<f/2?"left":"right"}`}function tt(t,n){let[f,x]=t.split("-");if(n==="ArrowUp")f="top";else if(n==="ArrowDown")f="bottom";else if(n==="ArrowLeft")x="left";else if(n==="ArrowRight")x="right";else return null;return`${f}-${x}`}function nt(t){let n=null;try{n=t?t.get(Te):null}catch{}return Pe.has(n)?n:"top-right"}function ot(t){let n=document.createElement("div");n.className="clay-menu-spots",n.setAttribute("clay","editor-ui"),n.setAttribute("aria-hidden","true");for(let f of Pe){let x=document.createElement("span");x.className="clay-menu-spot",x.dataset.to=f,n.append(x)}return t.append(n),n}function Oe({dock:t,container:n=document.body,grip:f,storage:x,onMove:p,onDragStart:$}){function l(r,{remember:m=!0}={}){if(t.dataset.corner=r,m)try{x&&x.set(Te,r)}catch{}p&&p(r)}l(nt(x),{remember:!1}),f.addEventListener("keydown",r=>{let m=tt(t.dataset.corner,r.key);m&&(r.preventDefault(),m!==t.dataset.corner&&l(m))});let o=null;f.addEventListener("pointerdown",r=>{if(r.button!==0||r.isPrimary===!1)return;let m=t.getBoundingClientRect();if(o={id:r.pointerId,x:r.clientX,y:r.clientY,dx:r.clientX-m.left,dy:r.clientY-m.top,w:m.width,h:m.height,moving:!1,spots:null,near:null},f.setPointerCapture)try{f.setPointerCapture(r.pointerId)}catch{}}),f.addEventListener("pointermove",r=>{if(!o||r.pointerId!==o.id)return;if(!o.moving){if(Math.hypot(r.clientX-o.x,r.clientY-o.y)<Je)return;o.moving=!0,t.setAttribute("data-dragging",""),o.spots=ot(n),o.spots.style.setProperty("color-scheme",getComputedStyle(t).colorScheme),$&&$()}let m=r.clientX-o.dx,k=r.clientY-o.dy;Object.assign(t.style,{left:`${m}px`,top:`${k}px`,right:"auto",bottom:"auto"}),o.near=et(m+o.w/2,k+o.h/2,window.innerWidth,window.innerHeight);for(let Q of o.spots.children)Q.toggleAttribute("data-near",Q.dataset.to===o.near)});let y=r=>m=>{if(!o||m.pointerId!==o.id)return;let{moving:k,near:Q,spots:s}=o;if(o=null,!!k){s.remove(),t.removeAttribute("data-dragging");for(let c of["left","top","right","bottom"])t.style.removeProperty(c);r&&Q?l(Q):l(t.dataset.corner,{remember:!1})}};return f.addEventListener("pointerup",y(!0)),f.addEventListener("pointercancel",y(!1)),f.addEventListener("lostpointercapture",y(!1)),{setCorner:l}}var qe=()=>/mac|iphone|ipad|ipod/i.test(navigator.userAgentData&&navigator.userAgentData.platform||navigator.platform||navigator.userAgent||""),at=()=>/Win/.test(navigator.userAgentData&&navigator.userAgentData.platform||navigator.platform||navigator.userAgent||""),De=()=>qe()?"Show in Finder":at()?"Show in Explorer":"Show in folder",te=(t,n)=>qe()?t:n;var ne="menu-resume",rt=5e3,T=()=>window.clay||{},Ie=()=>T().storage&&T().storage.session,fe=t=>{let n=T().editPlugins;return Array.isArray(n)&&n.includes(t)};function Ue(t,n=rt){return new Promise(f=>{let x=Date.now(),p=()=>{let $=t();$||Date.now()-x>=n?f($||null):setTimeout(p,50)};p()})}function Be({addItem:t,note:n,currentMode:f}){let x=new Map;async function p(s,c){if(f()==="edit")return c();let M=Ie();M&&M.set(ne,s);let S;try{S=await T().setMode?.("edit")}catch(P){S={ok:!1,message:P&&P.message}}if(!(S&&S.ok!==!1&&S.reloading)){if(M&&M.remove(ne),!S||S.ok===!1){let P=S?Z(S):"Couldn't switch modes.";P&&n(P);return}return c()}}function $(s,c){return x.set(s,c),()=>p(s,c)}let l={canUndo:!1,canRedo:!1},o=!1;function y(){if(!fe("undo"))return;let s=f()==="edit"&&T().undo;!o&&s&&typeof s.canUndo=="boolean"&&(l={canUndo:s.canUndo,canRedo:!!s.canRedo}),t({id:"clay.undo",pair:[{id:"clay.undo.undo",label:"Undo",keys:te("\u2318Z","Ctrl+Z"),disabled:!(s&&l.canUndo),run:()=>T().undo?.undo()},{id:"clay.undo.redo",label:"Redo",keys:te("\u2318\u21E7Z","Ctrl+Shift+Z"),disabled:!(s&&l.canRedo),run:()=>T().undo?.redo()}]})}document.addEventListener("clay:undo-change",s=>{let c=s.detail||{};o=!0,l={canUndo:!!c.canUndo,canRedo:!!c.canRedo},y()}),document.addEventListener("clay:modechange",y),y(),fe("ai-edit")&&t({id:"clay.ai",label:"Ask AI\u2026",keys:te("\u2318J","Ctrl+J"),run:$("ai",async()=>{let s=await Ue(()=>T().aiEdit);s&&await s.open(document.body)||n("Ask AI isn't available on this page right now.")})}),fe("cms")&&T().cms?.hasRules?.(document)&&t({id:"clay.cms",label:"Open the CMS (Edit content)",run:$("cms",async()=>{let s=await Ue(()=>T().cms),c=null;try{c=s?await s.open():{ok:!1}}catch{c={ok:!1}}c&&c.ok===!1&&n("Couldn't open the CMS. Try again.")})}),t({id:"clay.download",label:"Download a copy",run:async()=>{let s=null;try{if(typeof T().getHTML=="function")s=T().getHTML();else{let c=await fetch(location.href,{cache:"no-store",credentials:"same-origin"});c.ok&&(s=await c.text())}}catch{}typeof s=="string"&&/^https?:$/.test(location.protocol)&&(s=s.replace(/(^|[^\w./:-])\/_\/uploads\//g,`$1${location.origin}/_/uploads/`)),(typeof s!="string"||!await Ce({html:s,name:`${Ae()}.html`}))&&n("Couldn't build the download. Try again.")}});async function r(s){let c=null;try{let M=await fetch(s,{method:"POST",credentials:"same-origin",headers:{"Document-URL":location.href}});if(c=await M.json().catch(()=>null),M.ok&&c?.ok!==!1){typeof c?.href=="string"&&window.open(c.href,"_blank","noopener");return}}catch{}n(typeof c?.message=="string"&&c.message?c.message:"Couldn't do that. Try again.")}let m=(s,c,M)=>{M?.href?t({id:s,label:c,href:M.href}):M?.post&&t({id:s,label:c,run:()=>r(M.post)})};import("../c-ZRXJD4G6.js").then(({hostActions:s})=>s()).then(s=>{m("clay.code","Open the code editor",s.codeEditor),m("clay.duplicate","Duplicate as a new page",s.duplicate),m("clay.export","Export as zip",s.export),m("clay.reveal",De(),s.reveal),m("clay.versions","Version history\u2026",s.versions)}).catch(()=>{});let k=Ie(),Q=k&&k.get(ne);if(Q){k.remove(ne);let s=x.get(Q);s&&f()==="edit"&&s()}return{inEditMode:p,resumable:$,refresh:y}}var st='<svg viewBox="0 0 256 256" aria-hidden="true" focusable="false"><path d="M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128 50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z"/></svg>',lt=3,oe=(t,n,f)=>`${t} ${t===1?n:f}`;function me(t){let n=document.createElement("span");n.className="clay-avatar",n.setAttribute("aria-hidden","true");let f=Ne(t.id);return n.style.setProperty("color",f),n.style.setProperty("border-color",f),n.style.setProperty("background","var(--bevel-surface)"),n.textContent=Qe(t.name),n}function _e({root:t,capsule:n,addItem:f,removeItem:x,closeMenu:p,note:$}){let l={supported:!1,people:[],anonymous:0},o=null,y=null,r=null,m=!1,k=()=>window.clay&&window.clay.people,Q=()=>window.clay&&window.clay.me||null,s=()=>{try{return!!k()?.canRename?.()}catch{return!1}},c=()=>l.people.length+l.anonymous,M=()=>document.documentElement.hasAttribute("clay-menu-roster");function S({restore:C=!0}={}){o&&(o.remove(),o=null,m=!1,r?.setAttribute("aria-expanded","false"),C&&y&&y.isConnected&&y.focus(),y=null)}function P(){let C=Q();if(!C||!C.name)return null;let w=document.createElement("div");w.className="clay-people-me";let A=document.createElement("span");A.className="clay-people-me-label",A.textContent="Your edits are signed as";let N=document.createElement("div");if(N.className="clay-people-me-row",w.append(A,N),m){let h=document.createElement("input");h.className="clay-people-input",h.type="text",h.value=C.name,h.setAttribute("aria-label","Your name"),h.maxLength=120;let g=document.createElement("button");g.type="button",g.className="clay-menu-btn clay-menu-btn-small clay-menu-btn-primary",g.textContent="Save";let i=()=>{try{k().rename(h.value)}catch(a){$(a&&a.code==="not-renamable"?"This name comes from your account, so it can't be changed here.":"Use a name of 1 to 120 characters that isn't an email address."),h.focus();return}m=!1,R(),o?.querySelector(".clay-people-me .clay-menu-btn")?.focus()};g.addEventListener("click",i),h.addEventListener("keydown",a=>{a.key==="Enter"&&(a.preventDefault(),i())}),N.append(h,g),queueMicrotask(()=>{h.isConnected&&(h.focus(),h.select())})}else{let h=document.createElement("span");if(h.className="clay-people-me-name",h.textContent=C.name,N.append(me(C),h),s()){let g=document.createElement("button");g.type="button",g.className="clay-menu-btn clay-menu-btn-small",g.textContent="Change",g.addEventListener("click",()=>{m=!0,R()}),N.append(g)}}return w}function R(){if(!o)return;let C=c();o.textContent="";let w=document.createElement("div");w.className="clay-people-head";let A=document.createElement("h3");A.className="clay-people-title",A.textContent="Who's here";let N=document.createElement("span");N.className="clay-people-sum",N.textContent=oe(C,"person","people");let h=document.createElement("button");if(h.type="button",h.className="clay-people-close",h.setAttribute("aria-label","Close"),h.innerHTML=st,h.addEventListener("click",()=>S()),w.append(A,N,h),o.append(w),l.people.length){let i=document.createElement("ul");i.className="clay-people-list";for(let a of l.people){let v=document.createElement("li");v.className="clay-people-row";let L=document.createElement("span");L.className="clay-people-who";let z=document.createElement("strong");if(z.textContent=a.name,a.you){let K=document.createElement("span");K.textContent="(you)",z.append(K)}L.append(z),v.append(me(a),L),i.append(v)}o.append(i)}if(l.anonymous>0){let i=document.createElement("p");i.className="clay-people-anon",i.textContent=l.anonymous===1?"1 other person is here without a shared name.":`${l.anonymous} others are here without a shared name.`,o.append(i)}let g=P();g&&o.append(g)}function I(C){if(p(),o){S();return}y=C,o=document.createElement("div"),o.className="clay-people",o.setAttribute("role","dialog"),o.setAttribute("aria-label","Who's here"),o.addEventListener("keydown",w=>{w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),m?(m=!1,R(),o.querySelector(".clay-people-me .clay-menu-btn")?.focus()):S())}),R(),t.append(o),r?.setAttribute("aria-expanded",C===r?"true":"false"),o.querySelector(".clay-people-close").focus()}function H(){if(!(M()&&l.supported&&c()>1)){r?.remove(),r=null;return}r||(r=document.createElement("button"),r.type="button",r.className="clay-roster",r.setAttribute("aria-haspopup","dialog"),r.setAttribute("aria-expanded",o?"true":"false"),r.addEventListener("click",()=>I(r)),t.insertBefore(r,n));let w=l.people.slice(0,lt),A=c()-w.length,N=document.createElement("span");N.className="clay-roster-faces";for(let g of w)N.append(me(g));r.textContent="",r.append(N),A>0&&r.append(oe(A,"other","others"));let h=w.map(g=>g.name);r.setAttribute("aria-label",`Who's here: ${h.join(", ")}${A>0?`${h.length?" and ":""}${oe(A,"other","others")}`:""}`)}let O=null;function B(){let C=c();if(l.supported&&(C>1||s())){let w=C>1?`Who's here (${oe(C,"person","people")})`:"Who's here";w!==O&&(O=w,f({id:"clay.people",label:w,run:()=>I(n.querySelector(".clay-menu-goo"))}))}else O!==null&&x("clay.people"),O=null,S({restore:!1});if(H(),o&&!m){let w=t.getRootNode().activeElement,A=w&&o.contains(w)?w.classList[0]:null;R(),A&&o.querySelector(`.${A}`)?.focus()}}return document.addEventListener("click",C=>{o&&!C.composedPath().includes(t)&&S({restore:!1})}),document.addEventListener("clay:people",()=>{m||B()}),import("../c-FTWGYI5E.js").then(({presence:C})=>{C.subscribe(w=>{l=w||l,B()})}).catch(()=>{}),{close:S}}var re="not all",ae="variants-choose",ye="clay.variants.keep",it="Change the page look",ct="Keep one page look",ut='<svg viewBox="0 0 6 10" aria-hidden="true" focusable="false"><rect x="4" width="2" height="2"/><rect x="2" y="2" width="2" height="2"/><rect y="4" width="2" height="2"/><rect x="2" y="6" width="2" height="2"/><rect x="4" y="8" width="2" height="2"/></svg>',dt='<svg viewBox="0 0 6 10" aria-hidden="true" focusable="false"><rect width="2" height="2"/><rect x="2" y="2" width="2" height="2"/><rect x="4" y="4" width="2" height="2"/><rect x="2" y="6" width="2" height="2"/><rect y="8" width="2" height="2"/></svg>',F=()=>[...document.querySelectorAll("head style[clay-variant]")],V=t=>t.getAttribute("clay-variant"),D=()=>F().map(V);function _(){let t=F(),n=t.find(f=>f.getAttribute("media")!==re);return n?V(n):t.length?V(t[0]):null}function He(t,n){let f=window.clay&&window.clay.undo;f&&typeof f.commit=="function"?f.commit(t,n):n(),!document.documentElement.hasAttribute("autosave")&&typeof window.clay?.save=="function"&&window.clay.save()}async function pt(){let t=await import("../core/save-AOJBDSOK.js");for(;!t.baselineSettled();)await new Promise(n=>document.addEventListener("clay:baseline-settled",n,{once:!0}))}function ft(t){let n=t.map(f=>`Variant ${f}`);return n.length<2?n.join(""):`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function Ve({root:t,capsule:n,addItem:f,removeItem:x,note:p,currentMode:$}){let l=null,o=null,y=null,r=null,m=null,k=()=>$()==="edit",Q=()=>l??_(),s=()=>window.clay&&window.clay.storage&&window.clay.storage.session;function c(){let i=_();l!==null&&l===i&&(l=null),y?.remove(),y=null;for(let v of F()){if(!v.sheet)continue;let L=v.getAttribute("media")!==re;v.sheet.disabled=L&&(V(v)!==i||l!==null)}if(l===null)return;let a=F().find(v=>V(v)===l);if(!a)return l=null,c();y=document.createElement("style"),y.setAttribute("clay","editor-ui"),y.dataset.clayVariantPreview=l,y.textContent=a.textContent,a.after(y)}function M(){document.dispatchEvent(new CustomEvent("clay:variant-change",{detail:{active:_(),shown:Q()}}))}function S(i){return k()?D().includes(i)?(o=l=null,He(it,()=>{for(let a of F())V(a)===i?a.removeAttribute("media"):a.getAttribute("media")!==re&&a.setAttribute("media",re)}),A(),{ok:!0}):{ok:!1,code:"unknown-variant"}:{ok:!1,code:"not-editing"}}function P(i){return i!==null&&!D().includes(i)?{ok:!1,code:"unknown-variant"}:(l=i,A(),{ok:!0})}function R(i){o=l=null,He(ct,()=>{for(let a of F())V(a)===i?(a.removeAttribute("clay-variant"),a.removeAttribute("media"),a.sheet&&(a.sheet.disabled=!1)):a.remove()}),A()}function I(){if(!k())return Promise.resolve({ok:!1,code:"not-editing"});let i=_(),a=D().filter(L=>L!==i);if(!a.length)return Promise.resolve({ok:!1,code:"unknown-variant"});let v=`Keep Variant ${i} and delete ${ft(a)}? The switcher goes away. Version history still has them.`;return import("../c-FSWRGBVQ.js").then(L=>L.consent(v)).then(()=>(R(i),{ok:!0}),()=>({ok:!1,code:"cancelled"}))}async function H(){let i=l,a=window.clay;if(i===null||!a||typeof a.setMode!="function")return;s()?.set(ae,i);let v;try{v=await a.setMode("edit")}catch(L){v={ok:!1,message:L&&L.message}}if(!(v&&v.reloading)&&v&&v.ok===!1){s()?.remove(ae);let L=Z(v);L&&p(L)}}async function O(){let i=s(),a=i?.get(ae);a!=null&&(i.remove(ae),!(!k()||!D().includes(a))&&(o=l=a,A(),await pt(),!(o!==a||!g())&&(o=null,k()&&D().includes(a)&&S(a))))}function B(i){let a=D(),v=a[(a.indexOf(Q())+i+a.length)%a.length];k()?S(v):P(v)}function C(){let i=document.createElement("div");i.className="clay-variants",i.setAttribute("role","group"),i.setAttribute("aria-label","Page look"),i.innerHTML=`<button type="button" class="clay-variants-step" data-step="-1" aria-label="Previous look">${ut}</button><span class="clay-variants-name" aria-live="polite"></span><button type="button" class="clay-variants-step" data-step="1" aria-label="Next look">${dt}</button><button type="button" class="clay-menu-btn clay-menu-btn-small clay-menu-btn-primary clay-variants-use" hidden>Use this look</button><button type="button" class="clay-menu-btn clay-menu-btn-small clay-variants-keep" hidden>Keep</button>`;for(let a of i.querySelectorAll(".clay-variants-step"))a.addEventListener("click",()=>B(Number(a.dataset.step)));return i.querySelector(".clay-variants-use").addEventListener("click",H),i.querySelector(".clay-variants-keep").addEventListener("click",()=>I()),i}function w(){let i=D();if(m=N(),i.length<2){r?.remove(),r=null,x(ye);return}r||(r=C()),r.isConnected||t.insertBefore(r,t.querySelector(".clay-roster")??n);let a=Q(),v=r.querySelector(".clay-variants-name");v.textContent=`Variant ${a} `;let L=document.createElement("small");L.textContent=`(${i.indexOf(a)+1}/${i.length})`,v.append(L),r.querySelector(".clay-variants-use").hidden=k()||l===null,r.querySelector(".clay-variants-keep").hidden=!k(),k()?f({id:ye,label:`Keep Variant ${_()}, remove the others\u2026`,run:()=>I()}):x(ye)}function A(){c(),w(),M()}let N=()=>`${D().join(",")}|${_()}|${Q()}`,h=null,g=()=>window.clay?.variants===h;document.addEventListener("clay:modechange",()=>{g()&&(k()?(l=o,O()):o=null,A())}),document.addEventListener("clay:sync-applied",()=>{g()&&A()}),document.addEventListener("clay:undo-change",()=>{g()&&N()!==m&&A()}),h=window.clay.variants={list:()=>{let i=_();return D().map(a=>({name:a,label:`Variant ${a}`,active:a===i}))},get active(){return _()},get shown(){return Q()},preview:P,choose:S,keep:I},D().length>=2&&(k()&&O(),A())}var mt=!0,We="1",j=8,yt='<svg viewBox="0 0 10 10" aria-hidden="true" focusable="false"><path d="M1 0 5 4l4-4 1 1-4 4 4 4-1 1-4-4-4 4-1-1 4-4-4-4z"/></svg>',ht=6e3,bt=12,gt='<svg viewBox="0 0 6 12" aria-hidden="true" focusable="false"><rect width="2" height="2"/><rect x="4" width="2" height="2"/><rect y="5" width="2" height="2"/><rect x="4" y="5" width="2" height="2"/><rect y="10" width="2" height="2"/><rect x="4" y="10" width="2" height="2"/></svg>',Ze=[["clay.undo","clay.cms","clay.ai","clay.code"],["seo","clay.variants.keep","clay.share","clay.people"],["clay.duplicate","clay.download","clay.export","clay.reveal"],["clay.versions"],null,["upgrade"]],wt=new Set(Ze.flat().filter(Boolean)),W=()=>window.clay&&typeof window.clay.mode=="string"?window.clay.mode:xe;function vt(){let t=document.querySelectorAll("[clay-menu-slot]");return t.length>1&&console.warn("[clay] This page has more than one clay-menu-slot. The menu uses the first."),t[0]||null}function Et(){let t=document.querySelector("style[clay-menu-skin]");return t?t.getAttribute("clay-menu-skin")!==We?(console.warn(`[clay] This runtime reads clay-menu-skin="${We}". The menu keeps its default look.`),null):t.textContent:null}function xt(){if(document.querySelector('clay-editor-ui[data-clay-ui="menu"]'))return;let t=vt(),n=!!t,f=n?Et():null,x=n&&t.hasAttribute("no-edit-switch"),p=document.createElement("div");p.className="clay-menu-dock",p.setAttribute("clay","editor-ui"),p.setAttribute("part","dock"),n&&(p.dataset.embedded=""),p.dataset.corner="top-right",p.innerHTML=`<div class="clay-menu" part="capsule" clay="editor-ui"><button type="button" class="clay-menu-grip" aria-label="Move the menu. Drag it, or use the arrow keys to move it to another corner.">${gt}</button><button type="button" class="clay-menu-edit" part="edit" role="switch" aria-checked="false"><span class="clay-menu-track" aria-hidden="true"><span class="clay-menu-thumb"></span></span><span class="clay-menu-label">Edit</span></button><span class="clay-menu-divider" aria-hidden="true"></span><button type="button" class="clay-menu-goo" part="button" aria-haspopup="menu" aria-expanded="false" aria-label="Clay menu">${$e}</button></div><div class="clay-menu-list" part="list" role="menu" aria-label="Clay menu" hidden></div><div class="clay-menu-note" part="note" role="status" hidden></div>`;let $=p.querySelector(".clay-menu-grip"),l=p.querySelector(".clay-menu-edit"),o=p.querySelector(".clay-menu-goo"),y=p.querySelector(".clay-menu-list"),r=p.querySelector(".clay-menu-note"),m=new Map;if(n){$.hidden=!0;let e=t.querySelector("template[clay-menu-icon]");e&&o.replaceChildren(e.content.cloneNode(!0));let u=t.getAttribute("clay-menu-label");u&&(o.setAttribute("aria-label",u),o.title=u,y.setAttribute("aria-label",u)),x&&(l.hidden=!0,p.querySelector(".clay-menu-divider").hidden=!0)}let k=n&&typeof y.showPopover=="function";k&&y.setAttribute("popover","manual");function Q(){let e=o.getBoundingClientRect(),{offsetWidth:u,offsetHeight:d}=y,b=Math.max(j,Math.min(e.right-u,window.innerWidth-u-j)),E=e.bottom+j,U=E+d>window.innerHeight-j?Math.max(j,e.top-d-j):E;y.style.left=`${Math.round(b)}px`,y.style.top=`${Math.round(U)}px`}let s=()=>p.getRootNode().activeElement||null,c=()=>!y.hidden;function M(e){y.hidden=!e,o.setAttribute("aria-expanded",e?"true":"false"),k&&(e?(y.showPopover(),Q()):y.matches(":popover-open")&&y.hidePopover())}let S=()=>[...y.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')];function P(e){let u=S();u.length&&u[(e+u.length)%u.length].focus()}function R(){c()&&M(!1)}let I=null,H=null;function O(){c()||(H?.close({restore:!1}),I?.refresh(),N(),M(!0))}function B(e){let u=e.href&&!e.disabled,d=document.createElement(u?"a":"button");if(u?(d.href=e.href,d.target="_blank",d.rel="noopener"):d.type="button",d.setAttribute("role","menuitem"),d.setAttribute("part",e.quiet?"item quiet":"item"),d.dataset.menuId=e.id,e.badge&&e.id==="upgrade"){let b=document.createElement("span");b.className="clay-menu-upgrade",b.textContent=e.label,d.append(b)}else d.textContent=e.label;if(e.keys){let b=document.createElement("kbd");b.textContent=e.keys,d.append(b)}return e.disabled&&d.setAttribute("aria-disabled","true"),d.addEventListener("click",()=>{e.disabled||(R(),e.run&&e.run({anchor:o}))}),d}function C(e){if(e.text){let u=document.createElement("p");return u.className="clay-menu-version",u.setAttribute("part","text"),u.dataset.menuId=e.id,u.textContent=e.label,u}if(e.pair){let u=document.createElement("div");u.className="clay-menu-pair",u.dataset.menuId=e.id;for(let d of e.pair)u.append(B(d));return u}return e.dismiss?w(e):B(e)}function w(e){let u=document.createElement("div");u.className="clay-menu-row",u.dataset.menuId=e.id;let d=document.createElement("button");return d.type="button",d.setAttribute("role","menuitem"),d.setAttribute("part","dismiss"),d.dataset.menuId=`${e.id}.dismiss`,d.setAttribute("aria-label",e.dismiss.label),d.title=e.dismiss.label,d.innerHTML=yt,d.addEventListener("click",()=>{i(e.id),e.dismiss.run?.()}),u.append(B(e),d),u}function A(){let e=b=>[...m.values()].filter(E=>E.section===b),u=[...m.keys()].filter(b=>!wt.has(b)&&!m.get(b).section),d=Ze.map(b=>(b||u).map(E=>m.get(E)).filter(Boolean));return[e("start"),...d,e("end")].filter(b=>b.length)}function N(){let e=s(),u=e&&y.contains(e)?e.dataset.menuId:null;y.textContent="",A().forEach((E,U)=>{if(U){let q=document.createElement("div");q.className="clay-menu-sep",q.setAttribute("role","separator"),q.setAttribute("part","separator"),y.append(q)}for(let q of E)y.append(C(q))});let d=o.querySelector(".clay-menu-dot"),b=[...m.values()].some(E=>E.badge);if(b&&!d){let E=document.createElement("span");E.className="clay-menu-dot",E.setAttribute("aria-hidden","true"),o.append(E)}else!b&&d&&d.remove();if(u){let E=S().find(U=>U.dataset.menuId===u);E?E.focus():P(0)}}let h=({id:e,label:u,run:d,badge:b,keys:E,disabled:U,href:q})=>({id:e,href:typeof q=="string"?q:"",label:String(u??""),run:typeof d=="function"?d:null,badge:!!b,keys:E?String(E):"",disabled:!!U});function g({id:e,label:u,run:d,badge:b,keys:E,disabled:U,text:q,pair:ve,href:Ge,section:le,quiet:Xe,dismiss:ee}={}){if(!e)return null;let Y=h({id:e,label:u,run:d,badge:b,keys:E,disabled:U,href:Ge});return q&&(Y.text=!0),Array.isArray(ve)&&(Y.pair=ve.map(h)),(le==="start"||le==="end")&&(Y.section=le),Xe&&(Y.quiet=!0),ee&&(Y.dismiss={label:String(ee.label||"Dismiss"),run:typeof ee.run=="function"?ee.run:null}),m.set(e,Y),N(),e}function i(e){m.delete(e)&&N()}function a(e){e&&(r.textContent=e,r.hidden=!1,clearTimeout(v),v=setTimeout(()=>{r.hidden=!0,r.textContent=""},ht))}let v=0,L=!1,z=()=>{p.hidden=!ce&&W()!=="edit"};function K(){l.setAttribute("aria-checked",W()==="edit"?"true":"false"),x&&g({id:"clay.mode",label:W()==="edit"?"View mode":"Edit mode",section:"start",run:()=>l.click()})}K(),document.addEventListener("clay:modechange",K),l.addEventListener("click",async()=>{if(L)return;let e=l.getAttribute("aria-checked"),u=s()===l,d=W()==="edit"?"view":"edit";L=!0,l.setAttribute("aria-busy","true"),l.disabled=!0;let b;try{b=await window.clay?.setMode?.(d)}catch(E){b={ok:!1,message:E&&E.message}}if(!(b&&b.reloading))if(L=!1,l.removeAttribute("aria-busy"),l.disabled=!1,u&&l.isConnected&&!s()&&document.activeElement===document.body&&l.focus(),b&&b.ok===!1){l.setAttribute("aria-checked",e);let E=Z(b);E&&a(E)}else K()}),o.addEventListener("click",()=>{c()?R():O()}),document.addEventListener("click",e=>{c()&&!e.composedPath().includes(p)&&R()}),p.addEventListener("keydown",e=>{if(e.key==="Escape"){if(!c())return;e.preventDefault(),R(),o.focus();return}if(e.target===o&&(e.key==="Enter"||e.key===" ")){e.preventDefault(),c()?R():(O(),P(0));return}if(!c())return;if(e.key==="Enter"&&y.contains(e.target)){e.preventDefault(),e.target.click();return}let u=S();if(!u.length)return;let d=u.indexOf(s());e.key==="ArrowDown"?(e.preventDefault(),P(d<0?0:d+1)):e.key==="ArrowUp"&&(e.preventDefault(),P(d<0?u.length-1:d-1))});let he=document,G=null,X=null;function se(e){p.dataset.corner.startsWith("top")?p.style.top=`${Math.round(e.getBoundingClientRect().bottom)+bt}px`:p.style.removeProperty("top")}let je=()=>{X?se(X):p.style.removeProperty("top")};function be(){if(!p.isConnected)return;let e=he.querySelector(".clay-intro");if(e!==X){if(G&&(G.disconnect(),G=null),X=e,!e){p.style.removeProperty("top");return}typeof ResizeObserver=="function"&&(G=new ResizeObserver(()=>se(e)),G.observe(e)),se(e)}}let J=document.createElement("style");J.id="clay-menu-vars",J.setAttribute("clay","editor-ui"),document.head.append(J);function ge(){let e=p.getBoundingClientRect();J.textContent=`:root { --clay-menu-width: ${Math.ceil(e.width)}px; --clay-menu-height: ${Math.ceil(e.height)}px; }`}let ze=Le({name:"menu",content:p,css:n?[ue,f??de,pe]:[ue,Re,de,pe],parent:t||document.body,attributes:{"clay-mode-toggle":""}});n?(window.addEventListener("resize",R),window.addEventListener("scroll",()=>{k&&c()&&Q()},{capture:!0,passive:!0})):(Oe({dock:p,container:ze.shadow,grip:$,storage:window.clay.storage&&window.clay.storage.local,onMove:je,onDragStart:()=>{R(),H?.close({restore:!1})}}),ge(),typeof ResizeObserver=="function"&&new ResizeObserver(ge).observe(p),new MutationObserver(be).observe(he.body,{childList:!0}),be()),f||Se(p,p.querySelector(".clay-menu"),Me);let we=()=>import("../c-5FEU5MMY.js").then(e=>e.open({returnFocus:o}));if(I=Be({addItem:g,note:a,currentMode:W}),H=_e({root:p,capsule:p.querySelector(".clay-menu"),addItem:g,removeItem:i,closeMenu:R,note:a}),Ve({root:p,capsule:p.querySelector(".clay-menu"),addItem:g,removeItem:i,note:a,currentMode:W}),mt){g({id:"seo",label:"SEO settings\u2026",run:we});let e=window.clay.storage&&window.clay.storage.session;e&&e.get("reopen-seo")===!0&&(e.remove("reopen-seo"),we().catch(()=>{}))}Fe=z,W()!=="edit"&&import("../core/host-permission-6EVJGNPL.js").then(e=>e.checkHostPermission()).catch(()=>{}),window.clay.menu={addItem:g,removeItem:i,open:O,close:R,note:a,embedded:n,button:o},document.dispatchEvent(new CustomEvent("clay:menu-ready"))}var Ke=!1,Fe=null,kt=()=>(ce||Ee)&&!ie;function Ye(){Ke||!kt()||(Ke=!0,xt())}ie||(ke(Ye),document.addEventListener("clay:capabilitychange",()=>{Ye(),Fe?.()}));
|
|
@@ -3,4 +3,4 @@ import"../c-VHNSBD2M.js";var Qn=(()=>{var ue=Object.defineProperty,dt=Object.get
|
|
|
3
3
|
`)),a}error(e,t,r={}){let n=this.block(e,t,r);return this.errors.push(n),n}warn(e,t,r={}){let n=this.block(e,t,r);return this.warnings.push(n),n}report(){return{ok:this.errors.length===0&&!this.halted,app:this.appName,halted:this.halted,haltReason:this.haltReason,errors:this.errors.slice(),warnings:this.warnings.slice()}}};function K(e,t){e&&e.getAttribute("sap-error")!==t&&e.setAttribute("sap-error",t)}function Et(e){e&&e.hasAttribute("sap-error")&&e.removeAttribute("sap-error")}function Se(e,t){let r=null,n=3;for(let a of t){let l=kt(e,a);l<n&&(n=l,r=a)}return r}function kt(e,t){let r=e.length,n=t.length,a=Array.from({length:r+1},(l,o)=>[o,...new Array(n).fill(0)]);for(let l=0;l<=n;l++)a[0][l]=l;for(let l=1;l<=r;l++)for(let o=1;o<=n;o++)a[l][o]=Math.min(a[l-1][o]+1,a[l][o-1]+1,a[l-1][o-1]+(e[l-1]===t[o-1]?0:1));return a[r][n]}var xt=new Set(ce),St={readonly:"readOnly",novalidate:"noValidate"},Nt=0,Ne=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=Ne.get(e);return n||(n=`${t}-${(Nt++).toString(36)}`,Ne.set(e,n)),n}function Lt(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 $e(e,t){if(!e||!t)return null;let r=[...e.querySelectorAll(`template[items="${t}"]`)].find(a=>a.closest("[sap]")===e),n=r&&r.content.firstElementChild;return n&&n.hasAttribute("item")?n:null}function Tt(e){for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(t.hasAttribute("item")&&t.hasAttribute("template"))return t;return $e(e.closest("[sap]"),e.getAttribute("items"))}function Le(e){let t=[];if(!e)return t;for(let r of e.trim().split(/\s+/)){if(!r)continue;let n=r,a,l=n.indexOf("=");l>=0&&(a=n.slice(l+1),n=n.slice(0,l));let o=n.split(":"),f=o[0],u="string",c=!1;for(let p of o.slice(1))p==="num"?u="num":p==="bool"?u="bool":p==="presence"?u="presence":p==="transient"&&(c=!0);let i=f,d=i.startsWith("data-")&&i.length>5?i.slice(5).replace(/-([a-z])/g,(p,k)=>k.toUpperCase()):i;t.push({name:d,attr:i,type:u,default:a,transient:c})}return t}function fe(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 _t(e,t){return t==="bool"?e?"true":"false":e==null?"":String(e)}function Te(e,t){return xt.has(t)&&typeof e[St[t]||t]=="boolean"}function _e(e,t){return t.type==="presence"||t.type!=="num"&&Te(e,t.attr||t.name)}function Ce(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 a=e.getAttribute(r);a==null&&(a=Ce(t)),n[t.name]=fe(a,t.type)}return e.hasAttribute(r)&&e.removeAttribute(r),n[t.name]}function R(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 J(e,t){return Array.isArray(e)?t==null?e:e.map(r=>typeof t=="function"?t(r):r?.[t]):[]}function Re(e,t){return J(e,t).reduce((r,n)=>r+R(n),0)}function Rt(e,t){return Array.isArray(e)?t==null?e.length:e.reduce((r,n)=>r+(t(n)?1:0),0):0}function jt(e,t){let r=J(e,t);return r.length?Re(e,t)/r.length:0}function Mt(e,t){let r=J(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,a)=>String(n)<=String(a)?n:a):0}function Pt(e,t){let r=J(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,a)=>String(n)>=String(a)?n:a):0}function Wt(e,t,r){let n=R(e)===1?t:r??t+"s";return`${e} ${n}`}function Ot(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 j(e){return typeof e=="number"?e:Number(e)}var Q={usd:e=>"$"+j(e).toLocaleString("en-US",{maximumFractionDigits:0}),usd2:e=>"$"+j(e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),pct:e=>Math.round(j(e))+"%",pct1:e=>j(e).toFixed(1)+"%",int:e=>Math.round(j(e)).toLocaleString("en-US"),num:e=>j(e).toLocaleString("en-US"),num2:e=>j(e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),compact:e=>j(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=j(e),r=Math.floor(t/100),n=r%10,a=Math.floor(r/10)%60;return`${Math.floor(r/600)}:${String(a).padStart(2,"0")}.${n}`}},Dt=new Set(["usd","usd2","pct","pct1","int","num","num2","compact","clock"]);function Bt(e,t){if(!e)return t==null?"":String(t);let r=Q[e];if(typeof r!="function"){let n=new Error(`unknown format "${e}"`);throw n.sapCode="E22",n}if(Dt.has(e)){let n=typeof t=="number"?t:Number(t);if(!Number.isFinite(n)){let a=new Error(`format "${e}" received ${typeof t=="string"?`"${t}"`:t}`);throw a.sapCode="E22",a}}return r(t)}var Ft=["state","item","el","root","fmt","num","sum","count","avg","min","max","plural","days"],Z=new Map,je=/\bstate\.([a-z][a-z0-9_]*)/g,Me=/\bitem\.([a-z][a-z0-9_]*)/g;function Ht(e){let t=new Set,r=new Set,n;for(je.lastIndex=0;n=je.exec(e);)t.add(n[1]);for(Me.lastIndex=0;n=Me.exec(e);)r.add(n[1]);return{state:t,item:r}}function M(e,t=!1){let r=(t?"!":"")+e,n=Z.get(r);if(n)return n;Z.size>512&&Z.clear();try{let a=t?`"use strict";
|
|
4
4
|
${e}`:`"use strict"; return (${e});`;n={fn:new Function(...Ft,a),src:e,statement:t,deps:Ht(e),error:null}}catch(a){n={fn:null,src:e,statement:t,deps:{state:new Set,item:new Set},error:a}}return Z.set(r,n),n}function It(e,t,r,n,a){if(e.error)throw e.error;return e.fn(t,r,n,a,Q,R,Re,Rt,jt,Mt,Pt,Wt,Ot)}var U={},G=null,Pe=!0,ee=!1;function zt(){U={}}function qt(e){let t=ee;return G?We(G.takeRecords()):Pe&&Gt(),ee=!!G&&e.getRootNode()===document,t}function Ut(e){ee=e}function Gt(){if(typeof document>"u"||typeof MutationObserver!="function"){Pe=!1;return}G=new MutationObserver(We),G.observe(document,{attributes:!0,childList:!0,subtree:!0})}function We(e){for(let t of e)if(t.type==="attributes")t.target._sapPlan&&(t.target._sapPlan=null);else for(let r of t.addedNodes)r.nodeType===1&&Oe(r)}function Oe(e){e._sapPlan&&(e._sapPlan=null);for(let t=e.firstElementChild;t;t=t.nextElementSibling)Oe(t)}function de(e){if(!ee)return De(e);let t=e._sapPlan;return t&&t.gen===U?t:e._sapPlan=De(e)}function De(e){let t={gen:U,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};for(let r of e.attributes){let n=r.name,a=r.value,l=n.indexOf(":");if(l<0){switch(n){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;break;case"each":t.each=!0;break;case"bind":t.bind=a;break;case"transient":t.transient=!0;break;case"state":t.decls=Le(a);break;case"text":(t.paints||(t.paints=[])).push({kind:"text",fmt:null,entry:M(a)});break;case"show":(t.paints||(t.paints=[])).push({kind:"show",entry:M(a)});break;case"effect":(t.effects||(t.effects=[])).push({entry:M(a,!0)});break;case"invalid":(t.invalids||(t.invalids=[])).push({entry:M(a)});break}continue}let o=n.slice(0,l),f=n.slice(l+1);switch(o){case"calc":(t.calcs||(t.calcs=[])).push({name:f,entry:M(a)});break;case"text":(t.paints||(t.paints=[])).push({kind:"text",fmt:f,entry:M(a)});break;case"attr":(t.paints||(t.paints=[])).push({kind:"attr",arg:f,entry:M(a)});break;case"class":(t.paints||(t.paints=[])).push({kind:"class",arg:f,entry:M(a)});break;case"css":(t.paints||(t.paints=[])).push({kind:"css",arg:f,entry:M(a)});break;case"show-when":case"option":(t.paints||(t.paints=[])).push({kind:"when",match:"show",field:f,values:a.split("|")});break;case"hide-when":(t.paints||(t.paints=[])).push({kind:"when",match:"hide",field:f,values:a.split("|")});break;case"option-not":(t.paints||(t.paints=[])).push({kind:"when",match:"show-not",field:f,values:a.split("|")});break}}return t.boundary=t.scope?"scope":t.items?"items":t.detail?"detail":t.each?"each":null,Yt(t)?Xt():t}var te=null;function Xt(){return(!te||te.gen!==U)&&(te=Object.freeze({gen:U,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})),te}function Yt(e){return!e.inert&&!e.item&&e.boundary===null&&e.bind===null&&!e.transient&&!e.decls&&!e.calcs&&!e.paints&&!e.effects&&!e.invalids}var D=new WeakMap,B=new WeakMap,F=null,P=!1;function Vt(){D=new WeakMap,B=new WeakMap}function Be(e){for(let t of e){let r=t.target.nodeType===1?t.target:t.target.parentElement;for(let n=r;n;n=n.parentElement)B.delete(n);if(t.type==="attributes"){D.delete(t.target);continue}for(let n=r;n;n=n.parentElement)D.delete(n);for(let n of t.addedNodes||[])if(n.nodeType===1){D.delete(n),B.delete(n);for(let a of n.querySelectorAll("*"))D.delete(a),B.delete(a)}}}function Kt(){return P}function Jt(e){return P?B.get(e):void 0}function Qt(e,t){P&&B.set(e,t)}function Zt(e){B.delete(e)}function en(e){let t=P;return!F&&typeof MutationObserver=="function"&&(F=new MutationObserver(Be),F.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),F&&Be(F.takeRecords()),P=!!F&&e.getRootNode()===document,t}function tn(e){P=e}function Fe(e){let t=D.get(e);return t||D.set(e,t={attrs:new Map,hasText:!1,text:""}),t}function nn(e,t){if(!P)return e.getAttribute(t);let r=Fe(e);return r.attrs.has(t)||r.attrs.set(t,e.getAttribute(t)),r.attrs.get(t)}function rn(e){if(!P)return e.textContent;let t=Fe(e);return t.hasText||(t.text=e.textContent,t.hasText=!0),t.text}function He(e){return(e.getAttribute("type")||"text").toLowerCase()}function pe(e){let t=e.tagName;if(t==="INPUT"){let r=He(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 an(e,t=e){let r=e.tagName;if(r==="INPUT"){let n=He(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(`
|
|
5
5
|
`)?`
|
|
6
|
-
`+t.value:t.value;e.textContent!==n&&(e.textContent=n),e.removeAttribute("data-value");return}if(r==="SELECT"){let n=e.options,a=t.options;for(let l=0;l<n.length;l++)a[l]&&a[l].selected?n[l].hasAttribute("selected")||n[l].setAttribute("selected",""):n[l].removeAttribute("selected")}}function Ie(e){e.tagName!=="TEXTAREA"||!e.hasAttribute("data-value")||e!==e.ownerDocument.activeElement&&(e.textContent=e.getAttribute("data-value"),e.removeAttribute("data-value"))}function T(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 on(){let e=T("visitorDrafts");return!!(e&&typeof e.restored=="function"&&e.restored()?.restored)}var ze=["clay:mutation-ready","hyperclay:mutation-ready"],ln=["clay:sync-applied","hyperclay:livesync-applied"],sn=["clay:ready","hyperclay:ready"],un=["clay:route"],cn=["clay:modechange"];function ne(e,t,r){let n=null,a=l=>{n!==null&&n!==l.type||(n=l.type,queueMicrotask(()=>{n=null}),r(l))};for(let l of t)e.addEventListener(l,a);return()=>{for(let l of t)e.removeEventListener(l,a)}}function fn(e){let t=typeof window<"u"&&window.clay&&window.clay.ready;t&&typeof t.then=="function"?t.then(()=>e(),()=>e()):e()}function qe(e){let t=T("region");return!t||typeof t.resolveRegionPolicy!="function"||typeof t.skipForPolicy!="function"?!1:t.skipForPolicy(t.resolveRegionPolicy(e),void 0,["no-save","freeze"])}function Ue(){return typeof window>"u"?null:window.clay?.modeLifecycle||null}function me(e,{transient:t=!1}={}){if(t)return!0;let r=Ue();return typeof r?.canWrite!="function"||T("region")?.resolveRegionPolicy?.(e)?.persist==="none"?!0:r.canWrite()}function dn(e,t){if(typeof t!="function")throw new Error("Sap.batch(label, fn): fn must be a function");let r=T("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 pn(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=T("derived"),n=r&&typeof r.register=="function"?r.register(t):null,a=typeof n=="function"?null:ne(document,ln,t),l=ne(document,un,t),o=null,f=!1,u=()=>{let p=o;o=null,p&&(p[2](),p[3]())},c=()=>{if(f)return!1;let p=T("undo"),k=Ue()?.state?.generation;if(o&&o[0]===p&&o[1]===k)return!0;if(u(),!p||typeof p.on!="function")return!1;let L=p.on("undo",t);if(typeof L!="function")return!1;let _=p.on("redo",t);return typeof _!="function"?(L(),!1):(o=[p,k,L,_],!0)};c();let i=[ze,sn,cn].map(p=>ne(document,p,c)),d=T("ready");return d&&typeof d.then=="function"&&d.then(c,()=>{}),()=>{f=!0,typeof n=="function"&&n(),a&&a(),l();for(let p of i)p();u()}}function Ge(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 mn(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 Xe(e,t){switch(t){case"checkbox":return e.checked;case"radio":return e.checked?e.value:void 0;case"number":return mn(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 hn(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 a of e.options)a.selected=n.has(a.value);break}case"leaf":e.textContent=r==null?"":String(r);break;default:e.value=r==null?"":String(r)}}function Ye(e){if(e.hasAttribute("transient")){e.removeAttribute("value"),e.removeAttribute("checked"),e.removeAttribute("data-value");return}qe(e)||pe(e)}function bn(e){e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function gn(e,t){return Xe(e,t)}function yn(e){let t=Ge(e);return{el:e,kind:t,read(){return Xe(e,t)},write(r,n={}){hn(e,t,r),n.noMirror||Ye(e),n.silent||bn(e)},mirror(){Ye(e)}}}var W=null,re=!1,H=null;function Ve(e){let t=null;return{kind:"hub",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 vn(){let e=null;return{kind:"native",subscribe(t){e=new MutationObserver(n=>t(wn(n)));let r=typeof document<"u"&&document.body||typeof document<"u"&&document.documentElement;r&&e.observe(r,{childList:!0,subtree:!0,attributes:!0,characterData:!0})},suppress(t){let r=T("undo");r&&r.pause&&r.pause();try{return t()}finally{e&&e.takeRecords(),r&&r.resume&&r.resume()}},teardown(){e&&(e.disconnect(),e=null)}}}function wn(e){let t=[];for(let r of e)if(r.type==="attributes"){let n=r.target;n&&n.nodeType===1&&!ae(n)&&t.push({type:"attribute",element:n})}else if(r.type==="characterData"){let n=r.target&&r.target.parentElement;n&&!ae(n)&&t.push({type:"characterData",element:n})}else if(r.type==="childList"){for(let n of r.addedNodes)if(!(n.nodeType!==1||ae(n))&&(t.push({type:"add",element:n}),n.querySelectorAll))for(let a of n.querySelectorAll("*"))ae(a)||t.push({type:"add",element:a});for(let n of r.removedNodes)n.nodeType===1&&t.push({type:"remove",element:n,parent:r.target})}return t}function ae(e){return!!(e.closest&&e.closest("[sap-ignore],[template],[cms-template]"))}function An(e,t){e.pruneDisconnected();let r=new Set,n=!1;for(let a of t){let l=a.type==="remove"?a.parent:a.element,o=l&&e.appFor(l);o&&r.add(o),a.type==="add"&&a.element&&a.element.nodeType===1&&a.element.hasAttribute&&a.element.hasAttribute("sap")&&!(e.isRegistered&&e.isRegistered(a.element))&&(n=!0)}n&&e.remountIfPresent();for(let a of r)a.root.isConnected&&e.schedule(a,"mutation")}function En(e){if(W)return W.suppress(e);let t=T("undo");if(t&&t.pause&&t.resume){t.pause();try{return e()}finally{t.resume()}}return e()}function he(e,t){re=!0,W=e,e.subscribe(r=>An(t,r))}function Ke(e){if(re||typeof window>"u"||typeof document>"u")return;let t=T("Mutation");if(t&&typeof t.onAnyChange=="function"){he(Ve(t),e);return}typeof MutationObserver=="function"&&(he(vn(),e),H=ne(document,ze,function(){let r=T("Mutation");r&&(H(),H=null,W&&W.teardown(),re=!1,he(Ve(r),e))}))}function Je(){if(W)try{W.teardown()}catch{}H&&typeof document<"u"&&H(),W=null,re=!1,H=null}var kn=new Set(ce),oe=Object.freeze([]),O=[],Qe={},Ze={};function xn(e){O.includes(e)||(O.push(e),e.boundary&&Object.assign(Qe,e.boundary),e.paintKinds&&Object.assign(Ze,e.paintKinds))}function et(e,t={}){if(t.breaker){e.diag.error("E26",e.root,{problem:"recompute loop halted after 50 passes; recent triggers: "+(e._breakerRing||[]).join(", ")}),K(e.root,"loop");return}t.full&&(zt(),Vt());let r=qt(e.root);try{En(()=>Sn(e,t))}finally{Ut(r)}e._viewsChanged&&(e._viewsChanged=!1,e.root.dispatchEvent(new CustomEvent("sap:views-updated",{bubbles:!0})))}function Sn(e,t){let r=e.root,n={},a=[],l=[],o=new Set;e.diag.errors=[];let f={root:n,state:n,item:null,ownerEl:r,projection:!1},u=null;function c(s,h,b=!1){let m=h.attr||h.name,g=b?nn(s,m):s.getAttribute(m);return g==null&&(g=Ce(h),l.push({el:s,name:h.name,attr:m,value:_t(fe(g,h.type),h.type)})),fe(g,h.type)}function i(s,h,b,m){let g=h.decls;if(!g)return;let A=!!m.item&&!m.projection&&!m.view;for(let S of g){if(S.transient){u&&(u.pure=!1),b[S.name]=Ct(s,S);continue}if(_e(s,S)){b[S.name]=s.hasAttribute(S.attr);continue}b[S.name]=c(s,S,A)}}function d(s,h,b){let m=h.bind,g=b.item||b.state,A=Ge(s);u&&(A!=="leaf"||h.transient)&&(u.pure=!1),A==="radio"?(m in g||(g[m]=""),s.checked&&(g[m]=s.value)):A==="leaf"&&b.item&&!b.projection&&!b.view?g[m]=rn(s):g[m]=gn(s,A),h.transient&&(s.removeAttribute("value"),s.removeAttribute("checked"))}function p(s,h,b){let m=!1;if(h.paints){m=!0;for(let g of h.paints)g.kind==="when"&&o.add(g.field),a.push({def:g,el:s,ctx:b})}for(let g of O)g.collect&&g.collect(w,s,h,b)!==!1&&(m=!0);u&&m&&(h.calcs&&(u.pure=!1),u.collects.push(s,h))}function k(s,h,b){Object.defineProperty(s,"$key",{value:$t(h,"row"),enumerable:!1}),Object.defineProperty(s,"$index",{value:b,enumerable:!1,configurable:!0}),Object.defineProperty(s,"$el",{value:h,enumerable:!1})}function L(s,h,b){let m=de(s);i(s,m,h,b),s._sapScope=h,!b.projection&&m.bind!=null&&d(s,m,b),p(s,m,b),m.items?le(s,h,b):_(s,h,b)}function _(s,h,b){for(let m=s.firstElementChild;m;m=m.nextElementSibling)z(m,h,b)}function z(s,h,b){let m=de(s);if(!m.inert){if(m.boundary){u&&(u.pure=!1),m.boundary==="scope"?ie(s,h,b):m.boundary==="items"?(p(s,m,b),le(s,h,b)):Qe[m.boundary](w,s,m,h,b);return}!b.projection&&!b.view&&m.bind!=null&&d(s,m,b),p(s,m,b);for(let g=s.firstElementChild;g;g=g.nextElementSibling)z(g,h,b)}}function ie(s,h,b){let m=s.getAttribute("scope"),g={};h[m]=g;let A={root:b.root,state:g,item:null,ownerEl:s,projection:b.projection};L(s,g,A)}function le(s,h,b){u&&(u.pure=!1);let m=s.getAttribute("items"),g=[];h[m]=g,s._sapList=g;let A=!b.projection&&!b.view&&Kt(),S=0;for(let N=s.firstElementChild;N;N=N.nextElementSibling){let E=de(N);if(!E.item||E.template||E.cms)continue;let $=A?Jt(N):void 0;g.push($&&$.plan===E&&Object.isExtensible($.obj)&&se($,N,S,b)||V(N,E,S,b,A)),S++}}function V(s,h,b,m,g){let A={};k(A,s,b);let S={root:m.root,state:m.state,item:A,ownerEl:s,projection:m.projection};if(!g)return L(s,A,S),A;let N=u,E={plan:h,obj:A,fields:null,presence:oe,pending:oe,collects:[],pure:!0},$=l.length,Jn=e.diag.errors.length;u=E;try{L(s,A,S)}finally{u=N}if(!E.pure||e.halted||e.diag.errors.length!==Jn)return A;let ft=[];for(let q of Object.keys(A)){let Ae=A[q];if(Ae!==null&&typeof Ae=="object")return A;ft.push(q,Ae)}if(h.decls)for(let q of h.decls)_e(s,q)&&(E.presence===oe?E.presence=[]:E.presence).push(q.name,q.attr);return l.length>$&&(E.pending=l.slice($)),E.collects.length||(E.collects=oe),E.fields=ft,Qt(s,E),A}function se(s,h,b,m){let g=s.obj;try{g.$index!==b&&Object.defineProperty(g,"$index",{value:b,enumerable:!1,configurable:!0});let N=s.presence;for(let $=0;$<N.length;$+=2)g[N[$]]=h.hasAttribute(N[$+1]);let E=s.fields;for(let $=0;$<E.length;$+=2)g[E[$]]=E[$+1]}catch{return Zt(h),null}h._sapScope=g;let A=s.pending;for(let N=0;N<A.length;N++)l.push(A[N]);let S=s.collects;if(S.length){let N={root:m.root,state:m.state,item:g,ownerEl:h,projection:m.projection};for(let E=0;E<S.length;E+=2)p(S[E],S[E+1],N)}return g}let w={app:e,root:r,rootObj:n,paints:a,stats:{calcs:0,lists:0},resolveDefault:c,collectEl:p,walkScope:_};for(let s of O)s.begin&&s.begin(w);let y=t.cacheReads===!1?null:en(r);try{L(r,n,f)}finally{t.cacheReads!==!1&&tn(y)}if(e.halted)return;for(let s of O)s.afterIntake&&s.afterIntake(w);if(l.length&&o.size)for(let s of l)o.has(s.attr)&&s.el.getAttribute(s.attr)==null&&s.el.setAttribute(s.attr,s.value);for(let s of O)s.compute&&s.compute(w);let v=0;for(let s of O)s.reconcile&&(v+=s.reconcile(w));let x=0,C=v;for(let s of a){let h=$n(s,e);s.ctx.view?C+=h:x+=h}for(let s of O)s.afterPaint&&s.afterPaint(w);e._state=n,e._stats={fields:Object.keys(n).filter(s=>typeof n[s]!="function").length,calcs:w.stats.calcs,paints:a.length,lists:w.stats.lists,writes:x,viewWrites:C},e._viewsChanged=C>0,e._lastPass={trigger:t.trigger||"refresh",writes:x},e._debug&&console.log(`sap pass \xB7 trigger: ${e._lastPass.trigger} \xB7 writes ${x}/${a.length}`)}function Nn(e){return e.kind==="text"?e.fmt?"text:"+e.fmt:"text":e.kind==="attr"?"attr:"+e.arg:e.kind==="class"?"class:"+e.arg:e.kind==="css"?"css:"+e.arg:e.kind==="when"?(e.match==="hide"?"hide-when:":e.match==="show-not"?"option-not:":"show-when:")+e.field:e.kind}function be(e,t,r,n){let a=e;for(;a&&a.nodeType===1;){if(a.hasAttribute&&a.hasAttribute(t)){let l=r.includes(a.getAttribute(t));if(n?!l:l)return!0}a=a.parentElement}return!1}function $n(e,t){let r=e.def,n=e.el,a=Ze[r.kind];if(a)return a(e,t);if(r.kind==="when")return tt(r,n,null);try{let l=It(r.entry,e.ctx.state,e.ctx.item,n,e.ctx.root),o=tt(r,n,l);return Et(n),o}catch(l){return t.diag.error(l.sapCode==="E22"?"E22":"E24",n,{attr:Nn(r),expr:r.entry&&r.entry.src,problem:String(l.message)}),K(n,l.sapCode||"E24"),0}}function tt(e,t,r){switch(e.kind){case"text":{let n=e.fmt!=null?Bt(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=T("optionVisibility");if(n&&n._started)return t._sapWhen&&t.hidden?(t.hidden=!1,t._sapWhen=!1,1):0;let a;e.match==="hide"?a=!be(t,e.field,e.values,!1):e.match==="show-not"?a=be(t,e.field,e.values,!0):a=be(t,e.field,e.values,!1),t._sapWhen=!0;let l=!a;return t.hidden!==l?(t.hidden=l,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 l=0;return t[n]!==!!r&&(t[n]=!!r,l=1),!!r!==t.hasAttribute(n)&&(r?t.setAttribute(n,""):t.removeAttribute(n),l=1),l}if(kn.has(n)){let l=t.hasAttribute(n);return r&&!l?(t.setAttribute(n,""),1):!r&&l?(t.removeAttribute(n),1):0}let a=typeof r=="boolean"?String(r):r==null?"":String(r);return t.getAttribute(n)!==a?(t.setAttribute(n,a),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 Ln=new Set(ce),nt=new Set(["calc","text","attr","class","css","set","move","sort","option","option-not","show-when","hide-when","editmode","viewmode"]),Tn=new Set(["show-when","hide-when","option","option-not"]),_n=/\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/,rt=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"]),ge=[];function Cn(e){ge.includes(e)||ge.push(e)}function Rn(e){return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"}function ye(e){return e.hasAttribute("bind")}function jn(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 a=n.content.firstElementChild;a;a=a.nextElementSibling)r(a);return}t(n);for(let a=n.firstElementChild;a;a=a.nextElementSibling)r(a)}}}function Mn(e,t){let r=!1,n=(o,f,u)=>{t.error(o,f,u),r=!0},a=e.ownerDocument.createTreeWalker(e,4),l;for(;l=a.nextNode();)if(/\{\{.*\}\}/.test(l.nodeValue||"")){n("E02",l.parentElement||e,{problem:"moustaches in text content are not a Sap feature",fix:'move the expression onto the element: text="state.x"'});break}return jn(e,o=>{let f=new Set;for(let c of ge)c(o,n,i=>f.add(i));let u=o.closest&&o.closest("[detail]");for(let c of[...o.attributes]){let i=c.name;if(f.has(i))continue;if(i.includes(":")){let p=i.slice(0,i.indexOf(":"));if(nt.has(p)){if(Tn.has(p)&&_n.test(c.value)){let k=i.slice(i.indexOf(":")+1);t.warn("W04",o,{attr:i,expr:c.value,problem:`${p}: compares the "${k}" attribute against a literal value, not a JS expression`,fix:`use show="${c.value}" for an expression, or a literal like ${p}:${k}="overview"`})}}else{let k=Se(p,[...nt]);t.warn("W03",o,{attr:i,problem:`unknown "${p}:" attribute`,didYouMean:k?`${k}:`:null})}}else if(!rt.has(i)&&!xe.has(i)&&!Ln.has(i)&&!/^(data-|aria-|on)/.test(i)&&!(i in o)){let p=Se(i,[...rt]);p&&t.warn("W03",o,{attr:i,problem:`unknown "${i}" attribute`,didYouMean:p})}i==="attr:hidden"&&t.warn("W03",o,{attr:i,problem:"attr:hidden paints the wrong attribute",fix:'use show="expr"'});let d=ye(o)||i==="attr:selected"&&o.tagName==="OPTION"&&!!o.closest("select[bind]");(i==="attr:value"||i==="attr:checked"||i==="attr:selected")&&d&&n("E30",o,{attr:i,problem:"attr: on a bound control collides with persist ownership",fix:"remove it; bind owns this attribute"}),i==="effect"&&ye(o)&&/\b(value|checked)\s*=[^=]/.test(c.value)&&n("E30",o,{attr:i,expr:c.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"}),(i==="text"||i.startsWith("text:")||i==="show")&&Rn(o)&&(i==="show"||n("E18",o,{attr:i,problem:"paint belongs on output elements, not form controls",fix:"move the paint to an <output> or <span>"}))}if(o.hasAttribute("state")){let c=Le(o.getAttribute("state")),i=new Set;for(let d of c){d.name.includes("-")&&n("E08",o,{attr:"state",problem:`field "${d.name}" is not a valid identifier (the hyphen parses as subtraction)`,fix:`rename to ${d.name.replace(/-/g,"")}`}),i.has(d.name)&&n("E04",o,{attr:"state",problem:`field "${d.name}" is declared twice in one scope`}),i.add(d.name),vt.has(d.attr)&&n("E05",o,{attr:"state",problem:`"${d.name}" is a reserved Sap word`}),xe.has(d.attr)&&n("E06",o,{attr:"state",problem:`"${d.name}" is a global HTML attribute name; pick another field name`}),d.name==="open"&&o.tagName==="DIALOG"&&n("E33",o,{attr:"state",problem:"dialog open is transient",fix:"use showModal() \u2014 declare state= only on <details> or popovers"});let p=Te(o,d.attr);p&&(d.attr==="checked"||d.attr==="selected")&&n("E35",o,{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",o,{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",o,{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(ye(o)){if(o.hasAttribute("-"),o.tagName==="INPUT"){let c=(o.getAttribute("type")||"text").toLowerCase();c==="file"&&n("E32",o,{attr:"bind",problem:"files never serialize into an HTML file",fix:"use no-save + effect instead of bind"}),c==="password"&&!o.hasAttribute("transient")&&n("E31",o,{attr:"bind",problem:"a password must never serialize into a world-readable file",fix:"add transient to the password input"})}else if(o.tagName!=="SELECT"&&o.tagName!=="TEXTAREA"){let c=o.getAttribute("contenteditable");!(c!=null&&c!=="false")&&o.children.length>0&&n("E20",o,{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(o.hasAttribute("transient")&&o.hasAttribute("persist")&&n("E34",o,{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"}),o.tagName==="DIALOG"&&o.hasAttribute("detail")&&!(o.parentElement&&o.parentElement.closest('[clay~="freeze"], [freeze], [save-freeze]'))&&t.warn("W31",o,{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'}),o.hasAttribute("item")&&!o.hasAttribute("template")&&o.parentNode&&o.parentNode.nodeType===1){let c=o.parentElement;(!c||!c.hasAttribute("items"))&&n("E10",o,{problem:"an [item] must be a direct child of an [items] list",fix:'wrap it in a container with items="name"'})}if(o.hasAttribute("items")&&u&&n("E17",o,{attr:"items",problem:"nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)"}),o.hasAttribute("items")){let c=e.querySelector(`[trigger-add="${o.getAttribute("items")}"]`);!Tt(o)&&!$e(e,o.getAttribute("items"))&&Lt(o).length===0&&c&&n("E17",o,{attr:"items",problem:`trigger-add targets items="${o.getAttribute("items")}" but it has no [item template] to clone`})}}),r&&(t.halted=!0,t.haltReason=t.errors[0]?t.errors[0].code:"halt",K(e,t.haltReason)),!r}var at="sap-styles",ot="[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}",ve=new WeakSet;function Pn(e){if(ve.has(e))return;let t=e.defaultView,r=t&&t.CSSStyleSheet;if(r&&"adoptedStyleSheets"in e)try{let n=new r;n.replaceSync(ot),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],ve.add(e);return}catch{}if(!e.getElementById(at)){let n=e.createElement("style");n.id=at,n.textContent=ot,(e.head||e.documentElement).appendChild(n)}ve.add(e)}var Wn=0;function it(){return typeof performance<"u"&&performance.now?performance.now():0}function lt(e){let t=e.id||e.getAttribute("sap")||`app-${Wn++}`,r=new At(t),n={root:e,name:t,diag:r,_state:null,_stats:null,_lastPass:null,_passes:0,_broken:!1,_mountMs:0,_mountWrites:0};if(!Mn(e,r))return n.halted=!0,n;Pn(e.ownerDocument);for(let l of e.querySelectorAll("textarea[data-value]"))Ie(l);let a=it();return et(n,{trigger:"mount",full:!0}),n._mountMs=it()-a,n._mountWrites=n._stats?n._stats.writes:0,n._mountWrites>0&&!on()&&!T("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 st=/^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;function On(e){return`${e.tagName.toLowerCase()}[sap]`}function Dn(e){let t=0;for(let r of e.querySelectorAll("*"))for(let n of r.attributes)if(st.test(n.name)){t++;break}for(let r of e.attributes)if(st.test(r.name)){t++;break}return t}function Bn(e){function t(f){let u=f._stats||{},c=f.root;return{root:On(c),fields:u.fields||0,calcs:u.calcs||0,paints:u.paints||0,actions:Dn(c),lists:(c.hasAttribute("items")?1:0)+c.querySelectorAll("[items]").length,rows:c.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=e.apps().map(t);return{ok:f.every(u=>u.ok),apps:f}}function n(f){let u=t(f);return u.ok?`sap \u2713 ${u.root} \xB7 fields ${u.fields} \xB7 calcs ${u.calcs} \xB7 paints ${u.paints} \xB7 actions ${u.actions} \xB7 lists ${u.lists} \xB7 rows ${u.rows} \xB7 warnings ${u.warnings} \xB7 mount writes ${u.mountWrites} \xB7 ${u.ms}ms`:`sap \u2717 ${u.root} \xB7 errors ${u.errors} \xB7 warnings ${u.warnings} \xB7 ${u.ms}ms`}function a(){for(let f of e.apps()){let u=n(f);f.diag.errors.length||f.halted?console.error(u):console.log(u)}}function l(){let f=[],u=[];for(let c of e.apps())f.push(...c.diag.errors),u.push(...c.diag.warnings);return{ok:f.length===0,errors:f,warnings:u,counts:{errors:f.length,warnings:u.length}}}function o(f){let u=f===void 0?!0:!!f;for(let c of e.apps())c._debug=u;return console.log(`sap debug ${u?"on":"off"} \u2014 per-pass headers will ${u?"":"no longer "}log`),u}return{status:r,report:l,debug:o,greenLine:n,printGreenLines:a,REGISTRY:ke}}var Fn="0.7.0";function Hn({createAccessor:e,installInput:t,debugExtras:r}){let n=new Map,a=[],l=yt(et);function o(y){let v=y;for(;v;){if(v.nodeType===1&&v.hasAttribute&&v.hasAttribute("sap"))return n.get(v)||null;v=v.parentNode&&v.parentNode.host?v.parentNode.host:v.parentElement}return null}function f(){for(let y=a.length-1;y>=0;y--){let v=a[y];v.root.isConnected||(n.delete(v.root),a.splice(y,1))}}function u(y,v){if(y.moveBefore)try{y.moveBefore(v,null);return}catch{}y.appendChild(v)}function c(y,v){let x=v.parentElement;if(x){if(x.moveBefore)try{x.moveBefore(y,v);return}catch{}x.insertBefore(y,v)}}let i={apps:()=>a.slice(),appFor:o,isRegistered:y=>n.has(y),pruneDisconnected:f,schedule:(y,v)=>l.schedule(y,v),runNow:(y,v)=>l.runNow(y,v),moveInto:u,placeBefore:c,remountIfPresent:()=>V()},d=e(i),p=Bn(i),k=r?r(i,p):{},L=!1,_=!1,z=null;function ie(){L||(L=!0,t(i,d,document),z=pn(i))}function le(){let y=T("derived");y&&typeof y.mounted=="function"&&y.mounted()}function V(y=document){if(_)return[];ie(),Ke(i);let v=y.querySelectorAll("[sap]"),x=[];for(let C of v){if(n.has(C))continue;let s=lt(C);n.set(C,s),a.push(s),x.push(s)}for(let C of x){let s=p.greenLine(C);C.diag.errors.length||C.halted?console.error(s):console.log(s)}return le(),x}function se(y){if(_)return null;if(ie(),Ke(i),!y)return V();let v=typeof y=="string"?document.querySelector(y):y;if(!v)return null;if(n.has(v))return n.get(v);let x=lt(v);n.set(v,x),a.push(x);let C=p.greenLine(x);return x.diag.errors.length||x.halted?console.error(C):console.log(C),x}let w=d.Sap;return w.version=Fn,w.refresh=function(){for(let y of a)y.root.isConnected&&l.runNow(y,"refresh")},w.batch=dn,w.status=p.status,w.report=p.report,w.why=k.why,w.debug=p.debug,w.doctor=k.doctor,w.greenLine=p.greenLine,w.formats=Q,w.serializeControlToAttributes=pe,w.finalizeControlForSave=an,w.rehydrateControlFromAttributes=Ie,w.mount=se,w.config=function(y={}){return y.formats&&Object.assign(Q,y.formats),w},w._registry=n,w._reset=function(){n.clear(),a.length=0,Je()},w.unmount=function(){_=!0,n.clear(),a.length=0,Je(),typeof z=="function"&&z()},{Sap:w,mountAll:V,mount:se,runtime:i}}function In(e){if(typeof document>"u")return;let t=()=>fn(()=>e());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function zn(e){let t=[];function r(u){let c=u.target;if(!c||c.nodeType!==1)return;let i=e.appFor(c);if(i){c.hasAttribute("persist")&&!qe(c)&&me(c)&&pe(c);for(let d of t)if(d(c,i))return;e.schedule(i,u.type+" "+(c.id||c.tagName.toLowerCase()))}}function n(u){let c=u.target,i=e.appFor(c);i&&[...c.querySelectorAll("[bind]")].every(d=>me(d))&&setTimeout(()=>{c.querySelectorAll("[bind]").forEach(d=>{d.dispatchEvent(new Event("input",{bubbles:!0})),d.dispatchEvent(new Event("change",{bubbles:!0}))}),e.schedule(i,"reset")},0)}function a(u){let c=e.appFor(u.target);c&&e.schedule(c,"toggle")}function l(u){let c=u.detail||{};for(let i of[c.from,c.to,u.target]){if(!i||i.nodeType!==1)continue;let d=e.appFor(i);d&&e.schedule(d,"sorted")}}function o(u){if(u.key!=="ArrowUp"&&u.key!=="ArrowDown")return;let c=u.target;if(!c||c.nodeType!==1||c.tagName!=="INPUT"||!c.hasAttribute("bind")||!c.hasAttribute("step"))return;let i=(c.getAttribute("type")||"text").toLowerCase();if(i!=="text"&&i!=="tel"&&i!=="search"||!e.appFor(c)||!me(c))return;u.preventDefault();let d=R(c.getAttribute("step"))||1,p=u.key==="ArrowUp"?1:-1,k=R(c.value)+d*(u.shiftKey?10:1)*p,L=c.getAttribute("min"),_=c.getAttribute("max");L!==null&&L!==""&&k<R(L)&&(k=R(L)),_!==null&&_!==""&&k>R(_)&&(k=R(_)),yn(c).write(String(Number(k.toFixed(2))))}function f(u=document){u.addEventListener("reset",n),u.addEventListener("toggle",a,!0),u.addEventListener("input",r),u.addEventListener("change",r),u.addEventListener("clay:sorted",l),u.addEventListener("keydown",o)}return{install:f,addRouter:u=>t.push(u)}}var X="https://clayjs.com/v1/sap.js",qn=/^(calc|set|move|sort):/,Un=new Set(["each","detail","effect","invalid","confirm","trigger-add","trigger-remove","trigger-reset"]);function we(e){return qn.test(e)||Un.has(e)}Cn((e,t)=>{for(let r of e.attributes)we(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 ${X}; the markup stays as it is`})});function I(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 ${X}; the markup stays as it is`}),K(t,"E50"),e.app.halted=!0}xn({name:"core-only",collect(e,t,r){r.calcs&&I(e,t,"calc:"+r.calcs[0].name),r.effects&&I(e,t,"effect"),r.invalids&&I(e,t,"invalid");for(let n of t.attributes)we(n.name)&&(n.name.startsWith("calc:")&&r.calcs||n.name==="effect"&&r.effects||n.name==="invalid"&&r.invalids||I(e,t,n.name));return!1},boundary:{each(e,t){I(e,t,"each")},detail(e,t){I(e,t,"detail")}}});function Gn(){return{Sap:function(){throw new Error(`Sap(el) is full sapjs; load ${X}`)}}}var ut=e=>()=>(console.warn(`Sap.${e} is full sapjs; load ${X}`),null),{Sap:Y,mountAll:ct,mount:Xn,runtime:Yn}=Hn({createAccessor:Gn,debugExtras:()=>({why:ut("why"),doctor:ut("doctor")}),installInput(e,t,r){zn(e).install(r)}});Y.core=!0;var Vn=typeof window<"u"&&window.Sap&&!window.Sap.core;Vn?Y.unmount():In(ct),typeof window<"u"&&!window.Sap&&(window.Sap=Y);var Kn=Y;return gt(Ee)})(),Zn=Qn.default;export{Zn as default};
|
|
6
|
+
`+t.value:t.value;e.textContent!==n&&(e.textContent=n),e.removeAttribute("data-value");return}if(r==="SELECT"){let n=e.options,a=t.options;for(let l=0;l<n.length;l++)a[l]&&a[l].selected?n[l].hasAttribute("selected")||n[l].setAttribute("selected",""):n[l].removeAttribute("selected")}}function Ie(e){e.tagName!=="TEXTAREA"||!e.hasAttribute("data-value")||e!==e.ownerDocument.activeElement&&(e.textContent=e.getAttribute("data-value"),e.removeAttribute("data-value"))}function T(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 on(){let e=T("visitorDrafts");return!!(e&&typeof e.restored=="function"&&e.restored()?.restored)}var ze=["clay:mutation-ready","hyperclay:mutation-ready"],ln=["clay:sync-applied","hyperclay:livesync-applied"],sn=["clay:ready","hyperclay:ready"],un=["clay:route"],cn=["clay:modechange"];function ne(e,t,r){let n=null,a=l=>{n!==null&&n!==l.type||(n=l.type,queueMicrotask(()=>{n=null}),r(l))};for(let l of t)e.addEventListener(l,a);return()=>{for(let l of t)e.removeEventListener(l,a)}}function fn(e){let t=typeof window<"u"&&window.clay&&window.clay.ready;t&&typeof t.then=="function"?t.then(()=>e(),()=>e()):e()}function qe(e){let t=T("region");return!t||typeof t.resolveRegionPolicy!="function"||typeof t.skipForPolicy!="function"?!1:t.skipForPolicy(t.resolveRegionPolicy(e),void 0,["no-save","freeze"])}function Ue(){return typeof window>"u"?null:window.clay?.modeLifecycle||null}function me(e,{transient:t=!1}={}){if(t)return!0;let r=Ue();return typeof r?.canWrite!="function"||T("region")?.resolveRegionPolicy?.(e)?.persist==="none"?!0:r.canWrite()}function dn(e,t){if(typeof t!="function")throw new Error("Sap.batch(label, fn): fn must be a function");let r=T("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 pn(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=T("derived"),n=r&&typeof r.register=="function"?r.register(t):null,a=typeof n=="function"?null:ne(document,ln,t),l=ne(document,un,t),o=null,f=!1,u=()=>{let p=o;o=null,p&&(p[2](),p[3]())},c=()=>{if(f)return!1;let p=T("undo"),k=Ue()?.state?.generation;if(o&&o[0]===p&&o[1]===k)return!0;if(u(),!p||typeof p.on!="function")return!1;let L=p.on("undo",t);if(typeof L!="function")return!1;let _=p.on("redo",t);return typeof _!="function"?(L(),!1):(o=[p,k,L,_],!0)};c();let i=[ze,sn,cn].map(p=>ne(document,p,c)),d=T("ready");return d&&typeof d.then=="function"&&d.then(c,()=>{}),()=>{f=!0,typeof n=="function"&&n(),a&&a(),l();for(let p of i)p();u()}}function Ge(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 mn(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 Xe(e,t){switch(t){case"checkbox":return e.checked;case"radio":return e.checked?e.value:void 0;case"number":return mn(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 hn(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 a of e.options)a.selected=n.has(a.value);break}case"leaf":e.textContent=r==null?"":String(r);break;default:e.value=r==null?"":String(r)}}function Ye(e){if(e.hasAttribute("transient")){e.removeAttribute("value"),e.removeAttribute("checked"),e.removeAttribute("data-value");return}qe(e)||pe(e)}function bn(e){e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function gn(e,t){return Xe(e,t)}function yn(e){let t=Ge(e);return{el:e,kind:t,read(){return Xe(e,t)},write(r,n={}){hn(e,t,r),n.noMirror||Ye(e),n.silent||bn(e)},mirror(){Ye(e)}}}var W=null,re=!1,H=null;function Ve(e){let t=null;return{kind:"hub",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 vn(){let e=null;return{kind:"native",subscribe(t){e=new MutationObserver(n=>t(wn(n)));let r=typeof document<"u"&&document.body||typeof document<"u"&&document.documentElement;r&&e.observe(r,{childList:!0,subtree:!0,attributes:!0,characterData:!0})},suppress(t){let r=T("undo");r&&r.pause&&r.pause();try{return t()}finally{e&&e.takeRecords(),r&&r.resume&&r.resume()}},teardown(){e&&(e.disconnect(),e=null)}}}function wn(e){let t=[];for(let r of e)if(r.type==="attributes"){let n=r.target;n&&n.nodeType===1&&!ae(n)&&t.push({type:"attribute",element:n})}else if(r.type==="characterData"){let n=r.target&&r.target.parentElement;n&&!ae(n)&&t.push({type:"characterData",element:n})}else if(r.type==="childList"){for(let n of r.addedNodes)if(!(n.nodeType!==1||ae(n))&&(t.push({type:"add",element:n}),n.querySelectorAll))for(let a of n.querySelectorAll("*"))ae(a)||t.push({type:"add",element:a});for(let n of r.removedNodes)n.nodeType===1&&t.push({type:"remove",element:n,parent:r.target})}return t}function ae(e){return!!(e.closest&&e.closest("[sap-ignore],[template],[cms-template]"))}function An(e,t){e.pruneDisconnected();let r=new Set,n=!1;for(let a of t){let l=a.type==="remove"?a.parent:a.element,o=l&&e.appFor(l);o&&r.add(o),a.type==="add"&&a.element&&a.element.nodeType===1&&a.element.hasAttribute&&a.element.hasAttribute("sap")&&!(e.isRegistered&&e.isRegistered(a.element))&&(n=!0)}n&&e.remountIfPresent();for(let a of r)a.root.isConnected&&e.schedule(a,"mutation")}function En(e){if(W)return W.suppress(e);let t=T("undo");if(t&&t.pause&&t.resume){t.pause();try{return e()}finally{t.resume()}}return e()}function he(e,t){re=!0,W=e,e.subscribe(r=>An(t,r))}function Ke(e){if(re||typeof window>"u"||typeof document>"u")return;let t=T("Mutation");if(t&&typeof t.onAnyChange=="function"){he(Ve(t),e);return}typeof MutationObserver=="function"&&(he(vn(),e),H=ne(document,ze,function(){let r=T("Mutation");r&&(H(),H=null,W&&W.teardown(),re=!1,he(Ve(r),e))}))}function Je(){if(W)try{W.teardown()}catch{}H&&typeof document<"u"&&H(),W=null,re=!1,H=null}var kn=new Set(ce),oe=Object.freeze([]),O=[],Qe={},Ze={};function xn(e){O.includes(e)||(O.push(e),e.boundary&&Object.assign(Qe,e.boundary),e.paintKinds&&Object.assign(Ze,e.paintKinds))}function et(e,t={}){if(t.breaker){e.diag.error("E26",e.root,{problem:"recompute loop halted after 50 passes; recent triggers: "+(e._breakerRing||[]).join(", ")}),K(e.root,"loop");return}t.full&&(zt(),Vt());let r=qt(e.root);try{En(()=>Sn(e,t))}finally{Ut(r)}e._viewsChanged&&(e._viewsChanged=!1,e.root.dispatchEvent(new CustomEvent("sap:views-updated",{bubbles:!0})))}function Sn(e,t){let r=e.root,n={},a=[],l=[],o=new Set;e.diag.errors=[];let f={root:n,state:n,item:null,ownerEl:r,projection:!1},u=null;function c(s,h,b=!1){let m=h.attr||h.name,g=b?nn(s,m):s.getAttribute(m);return g==null&&(g=Ce(h),l.push({el:s,name:h.name,attr:m,value:_t(fe(g,h.type),h.type)})),fe(g,h.type)}function i(s,h,b,m){let g=h.decls;if(!g)return;let A=!!m.item&&!m.projection&&!m.view;for(let S of g){if(S.transient){u&&(u.pure=!1),b[S.name]=Ct(s,S);continue}if(_e(s,S)){b[S.name]=s.hasAttribute(S.attr);continue}b[S.name]=c(s,S,A)}}function d(s,h,b){let m=h.bind,g=b.item||b.state,A=Ge(s);u&&(A!=="leaf"||h.transient)&&(u.pure=!1),A==="radio"?(m in g||(g[m]=""),s.checked&&(g[m]=s.value)):A==="leaf"&&b.item&&!b.projection&&!b.view?g[m]=rn(s):g[m]=gn(s,A),h.transient&&(s.removeAttribute("value"),s.removeAttribute("checked"))}function p(s,h,b){let m=!1;if(h.paints){m=!0;for(let g of h.paints)g.kind==="when"&&o.add(g.field),a.push({def:g,el:s,ctx:b})}for(let g of O)g.collect&&g.collect(w,s,h,b)!==!1&&(m=!0);u&&m&&(h.calcs&&(u.pure=!1),u.collects.push(s,h))}function k(s,h,b){Object.defineProperty(s,"$key",{value:$t(h,"row"),enumerable:!1}),Object.defineProperty(s,"$index",{value:b,enumerable:!1,configurable:!0}),Object.defineProperty(s,"$el",{value:h,enumerable:!1})}function L(s,h,b){let m=de(s);i(s,m,h,b),s._sapScope=h,!b.projection&&m.bind!=null&&d(s,m,b),p(s,m,b),m.items?le(s,h,b):_(s,h,b)}function _(s,h,b){for(let m=s.firstElementChild;m;m=m.nextElementSibling)z(m,h,b)}function z(s,h,b){let m=de(s);if(!m.inert){if(m.boundary){u&&(u.pure=!1),m.boundary==="scope"?ie(s,h,b):m.boundary==="items"?(p(s,m,b),le(s,h,b)):Qe[m.boundary](w,s,m,h,b);return}!b.projection&&!b.view&&m.bind!=null&&d(s,m,b),p(s,m,b);for(let g=s.firstElementChild;g;g=g.nextElementSibling)z(g,h,b)}}function ie(s,h,b){let m=s.getAttribute("scope"),g={};h[m]=g;let A={root:b.root,state:g,item:null,ownerEl:s,projection:b.projection};L(s,g,A)}function le(s,h,b){u&&(u.pure=!1);let m=s.getAttribute("items"),g=[];h[m]=g,s._sapList=g;let A=!b.projection&&!b.view&&Kt(),S=0;for(let N=s.firstElementChild;N;N=N.nextElementSibling){let E=de(N);if(!E.item||E.template||E.cms)continue;let $=A?Jt(N):void 0;g.push($&&$.plan===E&&Object.isExtensible($.obj)&&se($,N,S,b)||V(N,E,S,b,A)),S++}}function V(s,h,b,m,g){let A={};k(A,s,b);let S={root:m.root,state:m.state,item:A,ownerEl:s,projection:m.projection};if(!g)return L(s,A,S),A;let N=u,E={plan:h,obj:A,fields:null,presence:oe,pending:oe,collects:[],pure:!0},$=l.length,Jn=e.diag.errors.length;u=E;try{L(s,A,S)}finally{u=N}if(!E.pure||e.halted||e.diag.errors.length!==Jn)return A;let ft=[];for(let q of Object.keys(A)){let Ae=A[q];if(Ae!==null&&typeof Ae=="object")return A;ft.push(q,Ae)}if(h.decls)for(let q of h.decls)_e(s,q)&&(E.presence===oe?E.presence=[]:E.presence).push(q.name,q.attr);return l.length>$&&(E.pending=l.slice($)),E.collects.length||(E.collects=oe),E.fields=ft,Qt(s,E),A}function se(s,h,b,m){let g=s.obj;try{g.$index!==b&&Object.defineProperty(g,"$index",{value:b,enumerable:!1,configurable:!0});let N=s.presence;for(let $=0;$<N.length;$+=2)g[N[$]]=h.hasAttribute(N[$+1]);let E=s.fields;for(let $=0;$<E.length;$+=2)g[E[$]]=E[$+1]}catch{return Zt(h),null}h._sapScope=g;let A=s.pending;for(let N=0;N<A.length;N++)l.push(A[N]);let S=s.collects;if(S.length){let N={root:m.root,state:m.state,item:g,ownerEl:h,projection:m.projection};for(let E=0;E<S.length;E+=2)p(S[E],S[E+1],N)}return g}let w={app:e,root:r,rootObj:n,paints:a,stats:{calcs:0,lists:0},resolveDefault:c,collectEl:p,walkScope:_};for(let s of O)s.begin&&s.begin(w);let y=t.cacheReads===!1?null:en(r);try{L(r,n,f)}finally{t.cacheReads!==!1&&tn(y)}if(e.halted)return;for(let s of O)s.afterIntake&&s.afterIntake(w);if(l.length&&o.size)for(let s of l)o.has(s.attr)&&s.el.getAttribute(s.attr)==null&&s.el.setAttribute(s.attr,s.value);for(let s of O)s.compute&&s.compute(w);let v=0;for(let s of O)s.reconcile&&(v+=s.reconcile(w));let x=0,C=v;for(let s of a){let h=$n(s,e);s.ctx.view?C+=h:x+=h}for(let s of O)s.afterPaint&&s.afterPaint(w);e._state=n,e._stats={fields:Object.keys(n).filter(s=>typeof n[s]!="function").length,calcs:w.stats.calcs,paints:a.length,lists:w.stats.lists,writes:x,viewWrites:C},e._viewsChanged=C>0,e._lastPass={trigger:t.trigger||"refresh",writes:x},e._debug&&console.log(`sap pass \xB7 trigger: ${e._lastPass.trigger} \xB7 writes ${x}/${a.length}`)}function Nn(e){return e.kind==="text"?e.fmt?"text:"+e.fmt:"text":e.kind==="attr"?"attr:"+e.arg:e.kind==="class"?"class:"+e.arg:e.kind==="css"?"css:"+e.arg:e.kind==="when"?(e.match==="hide"?"hide-when:":e.match==="show-not"?"option-not:":"show-when:")+e.field:e.kind}function be(e,t,r,n){let a=e;for(;a&&a.nodeType===1;){if(a.hasAttribute&&a.hasAttribute(t)){let l=r.includes(a.getAttribute(t));if(n?!l:l)return!0}a=a.parentElement}return!1}function $n(e,t){let r=e.def,n=e.el,a=Ze[r.kind];if(a)return a(e,t);if(r.kind==="when")return tt(r,n,null);try{let l=It(r.entry,e.ctx.state,e.ctx.item,n,e.ctx.root),o=tt(r,n,l);return Et(n),o}catch(l){return t.diag.error(l.sapCode==="E22"?"E22":"E24",n,{attr:Nn(r),expr:r.entry&&r.entry.src,problem:String(l.message)}),K(n,l.sapCode||"E24"),0}}function tt(e,t,r){switch(e.kind){case"text":{let n=e.fmt!=null?Bt(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=T("optionVisibility");if(n&&n._started)return t._sapWhen&&t.hidden?(t.hidden=!1,t._sapWhen=!1,1):0;let a;e.match==="hide"?a=!be(t,e.field,e.values,!1):e.match==="show-not"?a=be(t,e.field,e.values,!0):a=be(t,e.field,e.values,!1),t._sapWhen=!0;let l=!a;return t.hidden!==l?(t.hidden=l,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 l=0;return t[n]!==!!r&&(t[n]=!!r,l=1),!!r!==t.hasAttribute(n)&&(r?t.setAttribute(n,""):t.removeAttribute(n),l=1),l}if(kn.has(n)){let l=t.hasAttribute(n);return r&&!l?(t.setAttribute(n,""),1):!r&&l?(t.removeAttribute(n),1):0}let a=typeof r=="boolean"?String(r):r==null?"":String(r);return t.getAttribute(n)!==a?(t.setAttribute(n,a),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 Ln=new Set(ce),nt=new Set(["calc","text","attr","class","css","set","move","sort","option","option-not","show-when","hide-when","editmode","viewmode"]),Tn=new Set(["show-when","hide-when","option","option-not"]),_n=/\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/,rt=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"]),ge=[];function Cn(e){ge.includes(e)||ge.push(e)}function Rn(e){return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"}function ye(e){return e.hasAttribute("bind")}function jn(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 a=n.content.firstElementChild;a;a=a.nextElementSibling)r(a);return}t(n);for(let a=n.firstElementChild;a;a=a.nextElementSibling)r(a)}}}function Mn(e,t){let r=!1,n=(o,f,u)=>{t.error(o,f,u),r=!0},a=e.ownerDocument.createTreeWalker(e,4),l;for(;l=a.nextNode();)if(/\{\{.*\}\}/.test(l.nodeValue||"")){n("E02",l.parentElement||e,{problem:"moustaches in text content are not a Sap feature",fix:'move the expression onto the element: text="state.x"'});break}return jn(e,o=>{let f=new Set;for(let c of ge)c(o,n,i=>f.add(i));let u=o.closest&&o.closest("[detail]");for(let c of[...o.attributes]){let i=c.name;if(f.has(i))continue;if(i.includes(":")){let p=i.slice(0,i.indexOf(":"));if(nt.has(p)){if(Tn.has(p)&&_n.test(c.value)){let k=i.slice(i.indexOf(":")+1);t.warn("W04",o,{attr:i,expr:c.value,problem:`${p}: compares the "${k}" attribute against a literal value, not a JS expression`,fix:`use show="${c.value}" for an expression, or a literal like ${p}:${k}="overview"`})}}else{let k=Se(p,[...nt]);t.warn("W03",o,{attr:i,problem:`unknown "${p}:" attribute`,didYouMean:k?`${k}:`:null})}}else if(!rt.has(i)&&!xe.has(i)&&!Ln.has(i)&&!/^(data-|aria-|on)/.test(i)&&!(i in o)){let p=Se(i,[...rt]);p&&t.warn("W03",o,{attr:i,problem:`unknown "${i}" attribute`,didYouMean:p})}i==="attr:hidden"&&t.warn("W03",o,{attr:i,problem:"attr:hidden paints the wrong attribute",fix:'use show="expr"'});let d=ye(o)||i==="attr:selected"&&o.tagName==="OPTION"&&!!o.closest("select[bind]");(i==="attr:value"||i==="attr:checked"||i==="attr:selected")&&d&&n("E30",o,{attr:i,problem:"attr: on a bound control collides with persist ownership",fix:"remove it; bind owns this attribute"}),i==="effect"&&ye(o)&&/\b(value|checked)\s*=[^=]/.test(c.value)&&n("E30",o,{attr:i,expr:c.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"}),(i==="text"||i.startsWith("text:")||i==="show")&&Rn(o)&&(i==="show"||n("E18",o,{attr:i,problem:"paint belongs on output elements, not form controls",fix:"move the paint to an <output> or <span>"}))}if(o.hasAttribute("state")){let c=Le(o.getAttribute("state")),i=new Set;for(let d of c){d.name.includes("-")&&n("E08",o,{attr:"state",problem:`field "${d.name}" is not a valid identifier (the hyphen parses as subtraction)`,fix:`rename to ${d.name.replace(/-/g,"")}`}),i.has(d.name)&&n("E04",o,{attr:"state",problem:`field "${d.name}" is declared twice in one scope`}),i.add(d.name),vt.has(d.attr)&&n("E05",o,{attr:"state",problem:`"${d.name}" is a reserved Sap word`}),xe.has(d.attr)&&n("E06",o,{attr:"state",problem:`"${d.name}" is a global HTML attribute name; pick another field name`}),d.name==="open"&&o.tagName==="DIALOG"&&n("E33",o,{attr:"state",problem:"dialog open is transient",fix:"use showModal() \u2014 declare state= only on <details> or popovers"});let p=Te(o,d.attr);p&&(d.attr==="checked"||d.attr==="selected")&&n("E35",o,{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",o,{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",o,{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(ye(o)){if(o.hasAttribute("-"),o.tagName==="INPUT"){let c=(o.getAttribute("type")||"text").toLowerCase();c==="file"&&n("E32",o,{attr:"bind",problem:"files never serialize into an HTML file",fix:"use no-save + effect instead of bind"}),c==="password"&&!o.hasAttribute("transient")&&n("E31",o,{attr:"bind",problem:"a password must never serialize into a world-readable file",fix:"add transient to the password input"})}else if(o.tagName!=="SELECT"&&o.tagName!=="TEXTAREA"){let c=o.getAttribute("contenteditable");!(c!=null&&c!=="false")&&o.children.length>0&&n("E20",o,{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(o.hasAttribute("transient")&&o.hasAttribute("persist")&&n("E34",o,{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"}),o.tagName==="DIALOG"&&o.hasAttribute("detail")&&!(o.parentElement&&o.parentElement.closest('[clay~="freeze"], [freeze], [save-freeze]'))&&t.warn("W31",o,{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'}),o.hasAttribute("item")&&!o.hasAttribute("template")&&o.parentNode&&o.parentNode.nodeType===1){let c=o.parentElement;(!c||!c.hasAttribute("items"))&&n("E10",o,{problem:"an [item] must be a direct child of an [items] list",fix:'wrap it in a container with items="name"'})}if(o.hasAttribute("items")&&u&&n("E17",o,{attr:"items",problem:"nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)"}),o.hasAttribute("items")){let c=e.querySelector(`[trigger-add="${o.getAttribute("items")}"]`);!Tt(o)&&!$e(e,o.getAttribute("items"))&&Lt(o).length===0&&c&&n("E17",o,{attr:"items",problem:`trigger-add targets items="${o.getAttribute("items")}" but it has no [item template] to clone`})}}),r&&(t.halted=!0,t.haltReason=t.errors[0]?t.errors[0].code:"halt",K(e,t.haltReason)),!r}var at="sap-styles",ot="[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}",ve=new WeakSet;function Pn(e){if(ve.has(e))return;let t=e.defaultView,r=t&&t.CSSStyleSheet;if(r&&"adoptedStyleSheets"in e)try{let n=new r;n.replaceSync(ot),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],ve.add(e);return}catch{}if(!e.getElementById(at)){let n=e.createElement("style");n.id=at,n.textContent=ot,(e.head||e.documentElement).appendChild(n)}ve.add(e)}var Wn=0;function it(){return typeof performance<"u"&&performance.now?performance.now():0}function lt(e){let t=e.id||e.getAttribute("sap")||`app-${Wn++}`,r=new At(t),n={root:e,name:t,diag:r,_state:null,_stats:null,_lastPass:null,_passes:0,_broken:!1,_mountMs:0,_mountWrites:0};if(!Mn(e,r))return n.halted=!0,n;Pn(e.ownerDocument);for(let l of e.querySelectorAll("textarea[data-value]"))Ie(l);let a=it();return et(n,{trigger:"mount",full:!0}),n._mountMs=it()-a,n._mountWrites=n._stats?n._stats.writes:0,n._mountWrites>0&&!on()&&!T("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 st=/^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;function On(e){return`${e.tagName.toLowerCase()}[sap]`}function Dn(e){let t=0;for(let r of e.querySelectorAll("*"))for(let n of r.attributes)if(st.test(n.name)){t++;break}for(let r of e.attributes)if(st.test(r.name)){t++;break}return t}function Bn(e){function t(f){let u=f._stats||{},c=f.root;return{root:On(c),fields:u.fields||0,calcs:u.calcs||0,paints:u.paints||0,actions:Dn(c),lists:(c.hasAttribute("items")?1:0)+c.querySelectorAll("[items]").length,rows:c.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=e.apps().map(t);return{ok:f.every(u=>u.ok),apps:f}}function n(f){let u=t(f);return u.ok?`sap \u2713 ${u.root} \xB7 fields ${u.fields} \xB7 calcs ${u.calcs} \xB7 paints ${u.paints} \xB7 actions ${u.actions} \xB7 lists ${u.lists} \xB7 rows ${u.rows} \xB7 warnings ${u.warnings} \xB7 mount writes ${u.mountWrites} \xB7 ${u.ms}ms`:`sap \u2717 ${u.root} \xB7 errors ${u.errors} \xB7 warnings ${u.warnings} \xB7 ${u.ms}ms`}function a(){for(let f of e.apps()){let u=n(f);f.diag.errors.length||f.halted?console.error(u):console.log(u)}}function l(){let f=[],u=[];for(let c of e.apps())f.push(...c.diag.errors),u.push(...c.diag.warnings);return{ok:f.length===0,errors:f,warnings:u,counts:{errors:f.length,warnings:u.length}}}function o(f){let u=f===void 0?!0:!!f;for(let c of e.apps())c._debug=u;return console.log(`sap debug ${u?"on":"off"} \u2014 per-pass headers will ${u?"":"no longer "}log`),u}return{status:r,report:l,debug:o,greenLine:n,printGreenLines:a,REGISTRY:ke}}var Fn="0.7.1";function Hn({createAccessor:e,installInput:t,debugExtras:r}){let n=new Map,a=[],l=yt(et);function o(y){let v=y;for(;v;){if(v.nodeType===1&&v.hasAttribute&&v.hasAttribute("sap"))return n.get(v)||null;v=v.parentNode&&v.parentNode.host?v.parentNode.host:v.parentElement}return null}function f(){for(let y=a.length-1;y>=0;y--){let v=a[y];v.root.isConnected||(n.delete(v.root),a.splice(y,1))}}function u(y,v){if(y.moveBefore)try{y.moveBefore(v,null);return}catch{}y.appendChild(v)}function c(y,v){let x=v.parentElement;if(x){if(x.moveBefore)try{x.moveBefore(y,v);return}catch{}x.insertBefore(y,v)}}let i={apps:()=>a.slice(),appFor:o,isRegistered:y=>n.has(y),pruneDisconnected:f,schedule:(y,v)=>l.schedule(y,v),runNow:(y,v)=>l.runNow(y,v),moveInto:u,placeBefore:c,remountIfPresent:()=>V()},d=e(i),p=Bn(i),k=r?r(i,p):{},L=!1,_=!1,z=null;function ie(){L||(L=!0,t(i,d,document),z=pn(i))}function le(){let y=T("derived");y&&typeof y.mounted=="function"&&y.mounted()}function V(y=document){if(_)return[];ie(),Ke(i);let v=y.querySelectorAll("[sap]"),x=[];for(let C of v){if(n.has(C))continue;let s=lt(C);n.set(C,s),a.push(s),x.push(s)}for(let C of x){let s=p.greenLine(C);C.diag.errors.length||C.halted?console.error(s):console.log(s)}return le(),x}function se(y){if(_)return null;if(ie(),Ke(i),!y)return V();let v=typeof y=="string"?document.querySelector(y):y;if(!v)return null;if(n.has(v))return n.get(v);let x=lt(v);n.set(v,x),a.push(x);let C=p.greenLine(x);return x.diag.errors.length||x.halted?console.error(C):console.log(C),x}let w=d.Sap;return w.version=Fn,w.refresh=function(){for(let y of a)y.root.isConnected&&l.runNow(y,"refresh")},w.batch=dn,w.status=p.status,w.report=p.report,w.why=k.why,w.debug=p.debug,w.doctor=k.doctor,w.greenLine=p.greenLine,w.formats=Q,w.serializeControlToAttributes=pe,w.finalizeControlForSave=an,w.rehydrateControlFromAttributes=Ie,w.mount=se,w.config=function(y={}){return y.formats&&Object.assign(Q,y.formats),w},w._registry=n,w._reset=function(){n.clear(),a.length=0,Je()},w.unmount=function(){_=!0,n.clear(),a.length=0,Je(),typeof z=="function"&&z()},{Sap:w,mountAll:V,mount:se,runtime:i}}function In(e){if(typeof document>"u")return;let t=()=>fn(()=>e());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function zn(e){let t=[];function r(u){let c=u.target;if(!c||c.nodeType!==1)return;let i=e.appFor(c);if(i){c.hasAttribute("persist")&&!qe(c)&&me(c)&&pe(c);for(let d of t)if(d(c,i))return;e.schedule(i,u.type+" "+(c.id||c.tagName.toLowerCase()))}}function n(u){let c=u.target,i=e.appFor(c);i&&[...c.querySelectorAll("[bind]")].every(d=>me(d))&&setTimeout(()=>{c.querySelectorAll("[bind]").forEach(d=>{d.dispatchEvent(new Event("input",{bubbles:!0})),d.dispatchEvent(new Event("change",{bubbles:!0}))}),e.schedule(i,"reset")},0)}function a(u){let c=e.appFor(u.target);c&&e.schedule(c,"toggle")}function l(u){let c=u.detail||{};for(let i of[c.from,c.to,u.target]){if(!i||i.nodeType!==1)continue;let d=e.appFor(i);d&&e.schedule(d,"sorted")}}function o(u){if(u.key!=="ArrowUp"&&u.key!=="ArrowDown")return;let c=u.target;if(!c||c.nodeType!==1||c.tagName!=="INPUT"||!c.hasAttribute("bind")||!c.hasAttribute("step"))return;let i=(c.getAttribute("type")||"text").toLowerCase();if(i!=="text"&&i!=="tel"&&i!=="search"||!e.appFor(c)||!me(c))return;u.preventDefault();let d=R(c.getAttribute("step"))||1,p=u.key==="ArrowUp"?1:-1,k=R(c.value)+d*(u.shiftKey?10:1)*p,L=c.getAttribute("min"),_=c.getAttribute("max");L!==null&&L!==""&&k<R(L)&&(k=R(L)),_!==null&&_!==""&&k>R(_)&&(k=R(_)),yn(c).write(String(Number(k.toFixed(2))))}function f(u=document){u.addEventListener("reset",n),u.addEventListener("toggle",a,!0),u.addEventListener("input",r),u.addEventListener("change",r),u.addEventListener("clay:sorted",l),u.addEventListener("keydown",o)}return{install:f,addRouter:u=>t.push(u)}}var X="https://clayjs.com/v1/sap.js",qn=/^(calc|set|move|sort):/,Un=new Set(["each","detail","effect","invalid","confirm","trigger-add","trigger-remove","trigger-reset"]);function we(e){return qn.test(e)||Un.has(e)}Cn((e,t)=>{for(let r of e.attributes)we(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 ${X}; the markup stays as it is`})});function I(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 ${X}; the markup stays as it is`}),K(t,"E50"),e.app.halted=!0}xn({name:"core-only",collect(e,t,r){r.calcs&&I(e,t,"calc:"+r.calcs[0].name),r.effects&&I(e,t,"effect"),r.invalids&&I(e,t,"invalid");for(let n of t.attributes)we(n.name)&&(n.name.startsWith("calc:")&&r.calcs||n.name==="effect"&&r.effects||n.name==="invalid"&&r.invalids||I(e,t,n.name));return!1},boundary:{each(e,t){I(e,t,"each")},detail(e,t){I(e,t,"detail")}}});function Gn(){return{Sap:function(){throw new Error(`Sap(el) is full sapjs; load ${X}`)}}}var ut=e=>()=>(console.warn(`Sap.${e} is full sapjs; load ${X}`),null),{Sap:Y,mountAll:ct,mount:Xn,runtime:Yn}=Hn({createAccessor:Gn,debugExtras:()=>({why:ut("why"),doctor:ut("doctor")}),installInput(e,t,r){zn(e).install(r)}});Y.core=!0;var Vn=typeof window<"u"&&window.Sap&&!window.Sap.core;Vn?Y.unmount():In(ct),typeof window<"u"&&!window.Sap&&(window.Sap=Y);var Kn=Y;return gt(Ee)})(),Zn=Qn.default;export{Zn as default};
|