dev-process-kit 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/{shared-Dc_FGuLM.js → shared-56aw61Mt.js} +1 -1
  3. package/dist/chunks/{shared-CGPv8MQ7.js → shared-6yS1zZwk.js} +1 -1
  4. package/dist/chunks/{shared-NnvpqsPp.js → shared-B0kk4Png.js} +1 -1
  5. package/dist/chunks/{shared-DjOBIYHF.js → shared-BMyu-cIr.js} +1 -1
  6. package/dist/chunks/{shared-C2gu-y4m.js → shared-BYBLt-RG.js} +2 -13
  7. package/dist/chunks/{shared-BESRsbtm.js → shared-BqyO8tFt.js} +1 -1
  8. package/dist/chunks/{shared-rZQ5j0Kh.js → shared-C1OgX-P6.js} +216 -133
  9. package/dist/chunks/{shared-CmBhMY6X.js → shared-CHPc3-vO.js} +1 -1
  10. package/dist/chunks/shared-CYcKSitA.js +2560 -0
  11. package/dist/chunks/{shared-BFTEmZvI.js → shared-DFT6VIi_.js} +1 -1
  12. package/dist/chunks/{shared-DUEkF1z7.js → shared-DLpKWOi6.js} +1 -1
  13. package/dist/chunks/shared-DewUyNUX.js +2245 -0
  14. package/dist/chunks/{shared-CE1P_7xs.js → shared-DlMlDHZ3.js} +1 -1
  15. package/dist/chunks/shared-sTu0Wlge.js +1 -0
  16. package/dist/chunks/{shared-DD-fi15c.js → shared-wOFcYu2a.js} +1 -1
  17. package/dist/components.js +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/templates/delegation-poker.js +1 -1
  20. package/dist/templates/event-storming.js +1 -1
  21. package/dist/templates/example-mapping.js +1 -1
  22. package/dist/templates/grill.js +1 -1
  23. package/dist/templates/plain.js +1 -1
  24. package/dist/templates/prototype.js +1 -1
  25. package/dist/templates/slides.js +1 -1
  26. package/dist/templates/task-board.js +1 -1
  27. package/dist/templates/usm.js +1 -1
  28. package/dist/templates/whiteboard.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/shared-CTK76mc_.js +0 -2457
  31. package/dist/chunks/shared-wtt8CCP_.js +0 -2073
@@ -1,2457 +0,0 @@
1
- import{aj as x,aO as Ir,ae as C,aA as R,aB as g,ah as u,af as z,ai as ce,ad as Pr,aP as Qe,aQ as _r,ag as Y,ak as E,as as Rr,p as b,au as m,v as ue,az as te,P as Dr,e as Cr,a0 as Or,h as et,N as Ae,V as U,U as Mr,R as y,a4 as d,a3 as c,aR as Ie,aS as Pe,aF as _e,a5 as Lr,z as Re,aE as tt,l as Nr,A as rt,aT as O,aU as zr,aV as Vr,J as it,aW as Yr,ac as Ur,ab as Wr,a2 as Br,T as nt,a1 as Hr,aX as Gr,a9 as Fr,C as jr,aY as qr}from"./shared-rZQ5j0Kh.js";import{p as Kr,r as Xr,c as Zr}from"./shared-Dc_FGuLM.js";import{i as ot}from"./shared-DjOBIYHF.js";const Jr=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]],Qr=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}]],ei=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21"}]],ti=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]],ri=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]],ii=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}],["path",{d:"M12 18h.01"}]],ni=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18"}]],oi=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}],["circle",{cx:"12",cy:"7",r:"4"}]],st=["browser","native","mail","plain"],at=["mobile","tablet","desktop","fluid"],K=e=>"screen"in e,si=C({from:g(u()),to:g(u()),cc:g(u()),subject:g(u()),date:g(u())}),ai={id:R,kind:z(ce(st),"browser"),viewport:z(ce(at),"fluid"),label:g(u()),url:g(u()),mail:g(si)},De=x(C(ai),Ir(e=>e.mail===void 0||e.kind==="mail",'a preview `mail` envelope needs `"kind": "mail"`')),dt=Rr([C({screen:R,preview:g(R)}),C({material:De})]),di=C({id:R,name:x(u(),E(1)),description:g(u()),actor:g(x(u(),E(1))),situation:g(x(u(),E(1))),panes:z(Y(dt),[])}),pi=C({id:R,name:x(u(),E(1)),description:g(u()),actor:g(x(u(),E(1))),steps:z(Y(di),[])}),li=C({id:R,name:x(u(),E(1)),description:g(u()),actor:g(x(u(),E(1))),stories:z(Y(pi),[])}),ci=C({id:R,title:x(u(),E(1)),description:g(u()),previews:z(Y(De),[])}),ui=C({id:R,name:x(u(),E(1)),description:g(u()),actor:g(x(u(),E(1))),screens:z(Y(ci),[])}),pt=C({title:g(u()),baseUrl:g(u()),apps:z(Y(ui),[]),activities:z(Y(li),[])}),lt=e=>e.flatMap(t=>K(t)?[]:[t.material]),hi=e=>{const t=new Set,r=s=>{for(const a of s){if(t.has(a.id))return`duplicate preview id "${a.id}": preview ids are global, they name a light DOM slot`;t.add(a.id)}return null},i=new Set,n=new Set;for(const s of e.apps){if(i.has(s.id))return`duplicate app id "${s.id}"`;i.add(s.id);for(const a of s.screens){if(n.has(a.id))return`duplicate screen id "${a.id}": screen ids are global`;n.add(a.id);const p=r(a.previews);if(p!==null)return p}}const o=new Set;for(const s of e.activities){if(o.has(s.id))return`duplicate activity id "${s.id}"`;o.add(s.id);const a=new Set;for(const p of s.stories){if(a.has(p.id))return`duplicate story id "${p.id}" in activity "${s.id}"`;a.add(p.id);const l=new Set;for(const w of p.steps){if(l.has(w.id))return`duplicate step id "${w.id}" in story "${p.id}"`;l.add(w.id);const h=r(lt(w.panes));if(h!==null)return h}}}return null},ct=(e,t)=>{const r=new Map;for(const i of t.panes){if(!K(i))continue;const n=e(i.screen);if(n===void 0)return`unknown screen "${i.screen}" on step "${t.id}": declare it under \`apps[].screens\``;if(i.preview!==void 0&&!n.includes(i.preview))return`preview "${i.preview}" on step "${t.id}" is not a rendition of screen "${i.screen}"`;const o=r.get(i.screen)??[];if(o.length>0&&(i.preview===void 0||o.includes(i.preview)||o.includes(void 0)))return`screen "${i.screen}" is shown twice on step "${t.id}": give each pane a different \`preview\``;r.set(i.screen,[...o,i.preview])}return null},vi=e=>{const t=new Map(e.apps.flatMap(r=>r.screens.map(i=>[i.id,i.previews.map(n=>n.id)])));for(const r of e.activities.flatMap(i=>i.stories.flatMap(n=>n.steps))){const i=ct(n=>t.get(n),r);if(i!==null)return i}return null},gi=(e,t)=>ct(r=>M(e,r)?.screen.previews.map(i=>i.id),t),re="ui",ut=e=>{const t=e.text?.replaceAll('"',"'");return`${e.previewId}/${e.selector}${t===void 0?"":` "${t}"`}`},Ce=e=>{const t=e.indexOf("/");if(t<=0)return;const r=e.slice(0,t);if(!_r(R,r))return;const i=e.slice(t+1),n=/ "([^"]*)"$/.exec(i),o=(n?i.slice(0,n.index):i).trim();if(o!=="")return n?.[1]===void 0?{previewId:r,selector:o}:{previewId:r,selector:o,text:n[1]}},ht=e=>{const t=Pr(pt,e),r=hi(t)??vi(t);if(r!==null)throw new Error(r);return t},vt=()=>({apps:[],activities:[]}),W=e=>e.apps.flatMap(t=>t.screens.map(r=>({app:t,screen:r}))),M=(e,t)=>{if(t!==void 0)return W(e).find(r=>r.screen.id===t)},he=(e,t)=>t.panes.flatMap(r=>{const i=K(r)?M(e,r.screen):void 0;return i?[i]:[]}),X=e=>lt(e.panes),fi=(e,t)=>e.panes.some(r=>K(r)&&r.screen===t),L=(e,t)=>{if(t!==void 0)return e.activities.find(r=>r.id===t)},D=(e,t)=>`${e}.${t}`,$=(e,t)=>{if(t===void 0)return;const r=Qe(t,2);if(r){const[n,o]=r;if(n===void 0||o===void 0)return;const s=e.activities.find(p=>p.id===n),a=s?.stories.find(p=>p.id===o);return s&&a?{activity:s,story:a}:void 0}if(t.includes("."))return;const i=e.activities.flatMap(n=>n.stories.filter(o=>o.id===t).map(o=>({activity:n,story:o})));return i.length===1?i[0]:void 0},gt=e=>{const t=e.lastIndexOf(".");return t>=0?e.slice(t+1):e},ie=e=>`${e.activity.id}.${e.story.id}.${e.step.id}`,ve=(e,t,r)=>`${e.id}.${t.id}.${r.id}`,k=(e,t)=>{if(t===void 0)return;const r=Qe(t,3);if(r){const[n,o,s]=r;if(n===void 0||o===void 0||s===void 0)return;const a=e.activities.find(h=>h.id===n),p=a?.stories.find(h=>h.id===o),l=p?p.steps.findIndex(h=>h.id===s):-1,w=p&&l>=0?p.steps[l]:void 0;return a&&p&&w?{activity:a,story:p,step:w,stepIndex:l}:void 0}if(t.includes("."))return;const i=B(e).filter(n=>n.step.id===t);return i.length===1?i[0]:void 0},A=(e,t)=>{if(t!==void 0){for(const r of W(e)){const i=r.screen.previews.find(n=>n.id===t);if(i)return{owner:{kind:"screen",...r},preview:i}}for(const r of B(e)){const i=X(r.step).find(n=>n.id===t);if(i)return{owner:{kind:"step",...r},preview:i}}}},B=e=>e.activities.flatMap(t=>t.stories.flatMap(r=>r.steps.map((i,n)=>({activity:t,story:r,step:i,stepIndex:n})))),ft=e=>B(e).map(t=>t.step.id),f={SET_ACTIVITY_NAME:b("SET_ACTIVITY_NAME","activity",m({name:x(u(),E(1))})),SET_ACTIVITY_DESCRIPTION:b("SET_ACTIVITY_DESCRIPTION","activity",m({description:u()})),SET_STORY_NAME:b("SET_STORY_NAME","story",m({name:x(u(),E(1))})),SET_STORY_DESCRIPTION:b("SET_STORY_DESCRIPTION","story",m({description:u()})),SET_STEP_NAME:b("SET_STEP_NAME","step",m({name:x(u(),E(1))})),SET_STEP_DESCRIPTION:b("SET_STEP_DESCRIPTION","step",m({description:u()})),SET_PREVIEW_KIND:b("SET_PREVIEW_KIND","preview",m({kind:ce(st)})),SET_PREVIEW_VIEWPORT:b("SET_PREVIEW_VIEWPORT","preview",m({viewport:ce(at)})),SET_PREVIEW_LABEL:b("SET_PREVIEW_LABEL","preview",m({label:u()})),REORDER_ACTIVITY:b("REORDER_ACTIVITY","activity",m({after:te(u())}),{mode:"sequence"}),REORDER_STORY:b("REORDER_STORY","story",m({after:te(u())}),{mode:"sequence"}),REORDER_STEP:b("REORDER_STEP","step",m({after:te(u())}),{mode:"sequence"}),MOVE_STORY:b("MOVE_STORY","story",m({toActivity:x(u(),E(1)),after:te(u())}),{mode:"sequence"}),MOVE_STEP:b("MOVE_STEP","step",m({toStory:x(u(),E(1)),after:te(u())}),{mode:"sequence"}),ADD_ACTIVITY:b("ADD_ACTIVITY","page",m({id:R,name:x(u(),E(1)),description:g(u())}),{dedupeKey:ue}),ADD_STORY:b("ADD_STORY","activity",m({id:R,name:x(u(),E(1)),description:g(u())}),{dedupeKey:ue}),ADD_STEP:b("ADD_STEP","story",m({id:R,name:x(u(),E(1)),description:g(u()),panes:g(Y(dt))}),{dedupeKey:ue}),ADD_PREVIEW:b("ADD_PREVIEW","step",De,{dedupeKey:ue}),DELETE_ACTIVITY:b("DELETE_ACTIVITY","activity",m({})),DELETE_STORY:b("DELETE_STORY","story",m({})),DELETE_STEP:b("DELETE_STEP","step",m({})),DELETE_PREVIEW:b("DELETE_PREVIEW","preview",m({}))},ne={setActivityName:(e,t)=>({type:"SET_ACTIVITY_NAME",target:{type:"activity",id:e},payload:{name:t}}),setActivityDescription:(e,t)=>({type:"SET_ACTIVITY_DESCRIPTION",target:{type:"activity",id:e},payload:{description:t}}),setStoryName:(e,t)=>({type:"SET_STORY_NAME",target:{type:"story",id:e},payload:{name:t}}),setStoryDescription:(e,t)=>({type:"SET_STORY_DESCRIPTION",target:{type:"story",id:e},payload:{description:t}}),setStepName:(e,t)=>({type:"SET_STEP_NAME",target:{type:"step",id:e},payload:{name:t}}),setStepDescription:(e,t)=>({type:"SET_STEP_DESCRIPTION",target:{type:"step",id:e},payload:{description:t}}),setPreviewViewport:(e,t)=>({type:"SET_PREVIEW_VIEWPORT",target:{type:"preview",id:e},payload:{viewport:t}}),setPreviewKind:(e,t)=>({type:"SET_PREVIEW_KIND",target:{type:"preview",id:e},payload:{kind:t}}),setPreviewLabel:(e,t)=>({type:"SET_PREVIEW_LABEL",target:{type:"preview",id:e},payload:{label:t}}),reorderActivity:(e,t)=>({type:"REORDER_ACTIVITY",target:{type:"activity",id:e},payload:{after:t}}),reorderStory:(e,t)=>({type:"REORDER_STORY",target:{type:"story",id:e},payload:{after:t}}),reorderStep:(e,t)=>({type:"REORDER_STEP",target:{type:"step",id:e},payload:{after:t}}),moveStep:(e,t,r)=>({type:"MOVE_STEP",target:{type:"step",id:e},payload:{toStory:t,after:r}}),moveStory:(e,t,r)=>({type:"MOVE_STORY",target:{type:"story",id:e},payload:{toActivity:t,after:r}}),addActivity:(e,t,r)=>({type:"ADD_ACTIVITY",target:{type:"page",id:"prototype"},payload:{id:e,name:t,...r===void 0?{}:{description:r}}}),addStory:(e,t,r,i)=>({type:"ADD_STORY",target:{type:"activity",id:e},payload:{id:t,name:r,...i===void 0?{}:{description:i}}}),addStep:(e,t,r,i)=>({type:"ADD_STEP",target:{type:"story",id:e},payload:{id:t,name:r,...i===void 0?{}:{panes:i}}}),addPreview:(e,t)=>({type:"ADD_PREVIEW",target:{type:"step",id:e},payload:{...t}}),deleteActivity:e=>({type:"DELETE_ACTIVITY",target:{type:"activity",id:e},payload:{}}),deleteStory:e=>({type:"DELETE_STORY",target:{type:"story",id:e},payload:{}}),deleteStep:e=>({type:"DELETE_STEP",target:{type:"step",id:e},payload:{}}),deletePreview:e=>({type:"DELETE_PREVIEW",target:{type:"preview",id:e},payload:{}})},wt=(e,t)=>{const r=Dr(f,t);if(r===null)return null;const i=r.target.id;switch(r.type){case"SET_ACTIVITY_NAME":return H(e,i,n=>({...n,name:r.payload.name}));case"SET_ACTIVITY_DESCRIPTION":return H(e,i,n=>({...n,description:r.payload.description}));case"SET_STORY_NAME":return G(e,i,n=>({...n,name:r.payload.name}));case"SET_STORY_DESCRIPTION":return G(e,i,n=>({...n,description:r.payload.description}));case"SET_STEP_NAME":return ge(e,i,n=>({...n,name:r.payload.name}));case"SET_STEP_DESCRIPTION":return ge(e,i,n=>({...n,description:r.payload.description}));case"SET_PREVIEW_KIND":return Me(e,i,n=>({...n,kind:r.payload.kind}));case"SET_PREVIEW_VIEWPORT":return Me(e,i,n=>({...n,viewport:r.payload.viewport}));case"SET_PREVIEW_LABEL":return Me(e,i,n=>({...n,label:r.payload.label}));case"REORDER_ACTIVITY":{const{after:n}=r.payload,o=oe(e.activities,i,n);return o===null?null:{...e,activities:o}}case"REORDER_STORY":{const{after:n}=r.payload,o=$(e,i);if(!o)return null;const s=n===null?null:$(e,n);if(n!==null&&(!s||s.activity!==o.activity))return null;const a=oe(o.activity.stories,o.story.id,s?.story.id??null);return a===null?null:H(e,o.activity.id,p=>({...p,stories:a}))}case"REORDER_STEP":{const{after:n}=r.payload,o=k(e,i);if(!o)return null;const s=n===null?null:k(e,n);if(n!==null&&(!s||s.story!==o.story))return null;const a=oe(o.story.steps,o.step.id,s?.step.id??null);return a===null?null:G(e,D(o.activity.id,o.story.id),p=>({...p,steps:a}))}case"MOVE_STORY":{const{toActivity:n,after:o}=r.payload,s=$(e,i);if(!s)return null;const a=e.activities.find(h=>h.id===n);if(!a)return null;const p=o===null?null:$(e,o);if(o!==null&&(!p||p.activity!==a))return null;const l=p?.story.id??null;if(s.activity.id===n){const h=oe(s.activity.stories,s.story.id,l);return h===null?null:H(e,n,v=>({...v,stories:h}))}if(a.stories.some(h=>h.id===s.story.id))return null;const w=Le(a.stories,s.story,l);return Oe(e,h=>h.id===s.activity.id?{...h,stories:h.stories.filter(v=>v.id!==gt(i))}:h.id===n?{...h,stories:w}:h)}case"MOVE_STEP":{const{toStory:n,after:o}=r.payload,s=k(e,i);if(!s)return null;const a=$(e,n);if(!a)return null;const p=o===null?null:k(e,o);if(o!==null&&(!p||p.story!==a.story))return null;const l=p?.step.id??null;if(s.story===a.story){const h=oe(s.story.steps,s.step.id,l);return h===null?null:G(e,n,v=>({...v,steps:h}))}if(a.story.steps.some(h=>h.id===s.step.id))return null;const w=Le(a.story.steps,s.step,l);return Oe(e,h=>({...h,stories:h.stories.map(v=>v===s.story?{...v,steps:v.steps.filter(I=>I.id!==gt(i))}:v===a.story?{...v,steps:w}:v)}))}case"ADD_ACTIVITY":{const n=r.payload;if(e.activities.some(s=>s.id===n.id))return e;const o={id:n.id,name:n.name,...n.description===void 0?{}:{description:n.description},stories:[]};return{...e,activities:[...e.activities,o]}}case"ADD_STORY":{const n=r.payload,o=e.activities.find(a=>a.id===i);if(!o)return null;if(o.stories.some(a=>a.id===n.id))return e;const s={id:n.id,name:n.name,...n.description===void 0?{}:{description:n.description},steps:[]};return H(e,i,a=>({...a,stories:[...a.stories,s]}))}case"ADD_STEP":{const n=r.payload,o=$(e,i)?.story;if(!o)return null;if(o.steps.some(p=>p.id===n.id))return e;const s=n.panes??[],a={id:n.id,name:n.name,...n.description===void 0?{}:{description:n.description},panes:s};return wi(e,a)?G(e,i,p=>({...p,steps:[...p.steps,a]})):null}case"ADD_PREVIEW":{const n=r.payload,o=k(e,i)?.step;return o?X(o).some(s=>s.id===n.id)?e:A(e,n.id)?null:ge(e,i,s=>({...s,panes:[...s.panes,{material:n}]})):null}case"DELETE_ACTIVITY":{const n=i;return e.activities.some(o=>o.id===n)?{...e,activities:e.activities.filter(o=>o.id!==n)}:null}case"DELETE_STORY":{const n=$(e,i);return n?H(e,n.activity.id,o=>({...o,stories:o.stories.filter(s=>s.id!==n.story.id)})):null}case"DELETE_STEP":{const n=k(e,i);return n?G(e,D(n.activity.id,n.story.id),o=>({...o,steps:o.steps.filter(s=>s.id!==n.step.id)})):null}case"DELETE_PREVIEW":{const n=A(e,i);return n?bt(e,n.owner,o=>o.filter(s=>s.id!==n.preview.id)):null}default:return Cr(r)}},Oe=(e,t)=>({...e,activities:e.activities.map(t)}),H=(e,t,r)=>{const i=t;return e.activities.some(n=>n.id===i)?Oe(e,n=>n.id===i?r(n):n):null},G=(e,t,r)=>{const i=$(e,t);if(!i)return null;const n=i.story.id;return H(e,i.activity.id,o=>({...o,stories:o.stories.map(s=>s.id===n?r(s):s)}))},ge=(e,t,r)=>{const i=k(e,t);if(!i)return null;const n=i.step.id;return G(e,D(i.activity.id,i.story.id),o=>({...o,steps:o.steps.map(s=>s.id===n?r(s):s)}))},Me=(e,t,r)=>{const i=A(e,t);if(!i)return null;const n=i.preview.id;return bt(e,i.owner,o=>o.map(s=>s.id===n?r(s):s))},wi=(e,t)=>{const r=X(t).map(i=>i.id);return gi(e,t)===null&&new Set(r).size===r.length&&!r.some(i=>A(e,i))},bt=(e,t,r)=>{if(t.kind==="step")return ge(e,ie(t),n=>{const o=new Map(r([...X(n)]).map(s=>[s.id,s]));return{...n,panes:n.panes.flatMap(s=>{if(K(s))return[s];const a=o.get(s.material.id);return a?[{material:a}]:[]})}});const i=t.screen.id;return{...e,apps:e.apps.map(n=>n.id===t.app.id?{...n,screens:n.screens.map(o=>o.id===i?{...o,previews:r(o.previews)}:o)}:n)}},oe=(e,t,r)=>{const i=e.findIndex(s=>s.id===t);if(i<0||r!==null&&!e.some(s=>s.id===r))return null;if(t===r)return[...e];const n=e[i];if(n===void 0)return null;const o=e.filter(s=>s.id!==t);return Le(o,n,r)},Le=(e,t,r)=>{const i=[...e],n=r===null?-1:i.findIndex(o=>o.id===r);return i.splice(n+1,0,t),i},mt={"iphone-se":"iPhone SE","iphone-16":"iPhone 16","iphone-16-pro-max":"iPhone 16 Pro Max","pixel-7":"Pixel 7","galaxy-s24":"Galaxy S24","ipad-mini":"iPad mini","ipad-air-11":'iPad Air 11"',"ipad-pro-11":'iPad Pro 11"',"ipad-pro-13":'iPad Pro 13"'},bi={"laptop-13":'13" laptop',"laptop-15":'15" laptop',"full-hd":"Full HD","monitor-27":'27" monitor',ultrawide:"Ultrawide"},mi={"laptop-13":"13 \u30A4\u30F3\u30C1 \u30CE\u30FC\u30C8","laptop-15":"15 \u30A4\u30F3\u30C1 \u30CE\u30FC\u30C8","full-hd":"\u30D5\u30EB HD","monitor-27":"27 \u30A4\u30F3\u30C1 \u30E2\u30CB\u30BF\u30FC",ultrawide:"\u30A6\u30EB\u30C8\u30E9\u30EF\u30A4\u30C9"},fe=Or({en:{renameActivity:"Rename Activity",updateActivityDescription:"Update Activity description",renameStory:"Rename UserStory",updateStoryDescription:"Update UserStory description",renameStep:"Rename Step",updateStepDescription:"Update Step description",changePreviewKind:"Change Preview kind",changePreviewViewport:"Change Preview viewport",changePreviewLabel:"Change Preview label",moveStory:"Move UserStory",moveStep:"Move Step",deleteTitle:"Delete",reorderTitle:e=>`Reorder ${e}`,addTitle:e=>`Add ${e}`,toFront:"\u2192 To the front",afterName:e=>`\u2192 Right after "${e}"`,unknownTarget:"(unknown target)",activityGroup:"Activity",storyGroup:"UserStory",stepGroup:"Step",screenGroup:"Screen",openInApp:"Open this screen in the app view",previewGroup:"Preview",pageGroup:"Page",uiGroup:"UI",targetLabel:(e,t)=>`${e} \xB7 ${t}`,targetMissing:(e,t)=>`${e} \xB7 ${t} (missing)`,noActivityBefore:"There are no Activities yet. Add ",noActivityAfter:" to the base JSON, or ask the agent.",deleteStepAria:"Delete step",addStepButton:"+ Step",stepNameLabel:"Step name",descriptionLabel:"Description",descriptionPlaceholder:"What happens in this Step (click to edit)",newStepName:"New step",viewLabel:"View",viewScenario:"Scenario",viewApp:"App",viewScenarioHint:"Follow one user story step by step",viewAppHint:"Use the UI as one app, whatever the scenario",appScreens:"Screens",appScreensHint:"Pick a screen to start from, then move around through the UI itself.",appSelectLabel:"App",appOutsideBrowser:"Outside the browser",noStepBefore:"There are no Steps yet. A Prototype has the meaning structure ",noStepAfter:" \u2014 one Step is one moment of the story: the screen the user is on and what they have at hand. Add a Step to the base JSON, and its screen will appear here.",noScreens:"This product has no screens yet. Declare its apps and their screens under apps[].screens in the base JSON, and they will appear here.",noPreviewMetadata:"No preview metadata \u2014 ask the agent to add it.",storyWithoutSteps:"This UserStory has no Steps yet, so there is no screen to show. Add one with + Step, or ask the agent to prototype it.",pageActor:e=>`Used by ${e}`,maximize:"Maximize",restore:"Restore size",maximizeHint:"Show the preview alone across the tab \xB7 Esc to restore",situation:"Situation",uiComment:"Comment on UI",uiCommentHint:"Click any part of the preview to comment on it \xB7 Esc to finish",uiCommentPin:(e,t)=>`Comment ${e}: ${t}`,mailFrom:"From",mailTo:"To",mailCc:"Cc",mailDate:"Date",demo:"Demo",demoHint:"Use the app in a browser across the tab, with nothing else on screen \xB7 Esc to finish",exitDemo:"Exit demo",browserBack:"Back",browserForward:"Forward",browserReload:"Reload",browserAddress:"Address",browserTabs:"Tabs",newTab:"New tab",closeTab:"Close tab",browserProfile:e=>`Profile: ${e}`,browserGuest:"Guest",newTabShortcuts:"Pages of this app",unreachableTitle:"This site can\u2019t be reached",unreachableBody:"No page of the prototype has this address.",device:"Device",deviceHint:"The window the app runs in: a page taller than it scrolls inside, as on the device",deviceName:e=>mt[e]??bi[e]??e,deviceZoom:e=>`Shown at ${e}% to fit`},ja:{renameActivity:"Activity \u540D\u3092\u5909\u66F4",updateActivityDescription:"Activity \u306E\u8AAC\u660E\u3092\u66F4\u65B0",renameStory:"UserStory \u540D\u3092\u5909\u66F4",updateStoryDescription:"UserStory \u306E\u8AAC\u660E\u3092\u66F4\u65B0",renameStep:"Step \u540D\u3092\u5909\u66F4",updateStepDescription:"Step \u306E\u8AAC\u660E\u3092\u66F4\u65B0",changePreviewKind:"Preview \u306E\u7A2E\u5225\u3092\u5909\u66F4",changePreviewViewport:"Preview \u306E\u30D3\u30E5\u30FC\u30DD\u30FC\u30C8\u3092\u5909\u66F4",changePreviewLabel:"Preview \u306E\u30E9\u30D9\u30EB\u3092\u5909\u66F4",moveStory:"UserStory \u3092\u79FB\u52D5",moveStep:"Step \u3092\u79FB\u52D5",deleteTitle:"\u524A\u9664",reorderTitle:e=>`${e} \u306E\u9806\u5E8F\u3092\u5909\u66F4`,addTitle:e=>`${e} \u3092\u8FFD\u52A0`,toFront:"\u2192 \u5148\u982D\u3078",afterName:e=>`\u2192 "${e}" \u306E\u76F4\u5F8C\u3078`,unknownTarget:"(unknown target)",activityGroup:"Activity",storyGroup:"UserStory",stepGroup:"Step",screenGroup:"\u753B\u9762",openInApp:"\u3053\u306E\u753B\u9762\u3092\u30A2\u30D7\u30EA\u30D3\u30E5\u30FC\u3067\u958B\u304F",previewGroup:"Preview",pageGroup:"Page",uiGroup:"UI",targetLabel:(e,t)=>`${e} \xB7 ${t}`,targetMissing:(e,t)=>`${e} \xB7 ${t} (missing)`,noActivityBefore:"Activity \u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002base JSON \u306E ",noActivityAfter:" \u3092\u8FFD\u52A0\u3059\u308B\u304B\u3001Agent \u306B\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",deleteStepAria:"\u30B9\u30C6\u30C3\u30D7\u3092\u524A\u9664",addStepButton:"+ Step",stepNameLabel:"Step \u540D",descriptionLabel:"\u8AAC\u660E",descriptionPlaceholder:"\u3053\u306E Step \u3067\u4F55\u304C\u8D77\u304D\u308B\u304B\uFF08\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6\uFF09",newStepName:"\u65B0\u3057\u3044\u30B9\u30C6\u30C3\u30D7",viewLabel:"\u8868\u793A",viewScenario:"\u30B7\u30CA\u30EA\u30AA",viewApp:"\u30A2\u30D7\u30EA",viewScenarioHint:"\u30E6\u30FC\u30B6\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC\u306B\u6CBF\u3063\u3066 Step \u3092\u9806\u306B\u305F\u3069\u308B",viewAppHint:"\u30B7\u30CA\u30EA\u30AA\u306B\u95A2\u4FC2\u306A\u304F\u3001UI \u3092 1 \u3064\u306E\u30A2\u30D7\u30EA\u3068\u3057\u3066\u89E6\u308B",appScreens:"\u753B\u9762",appScreensHint:"\u8D77\u70B9\u306B\u3059\u308B\u753B\u9762\u3092\u9078\u3073\u3001\u3042\u3068\u306F UI \u306E\u30EA\u30F3\u30AF\u3067\u79FB\u52D5\u3057\u307E\u3059\u3002",appSelectLabel:"\u30A2\u30D7\u30EA",appOutsideBrowser:"\u30D6\u30E9\u30A6\u30B6\u4EE5\u5916",noStepBefore:"Step \u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002Prototype \u306F ",noStepAfter:" \u306E\u610F\u5473\u69CB\u9020\u3092\u6301\u3061\u30011 Step = \u30B7\u30CA\u30EA\u30AA\u306E 1 \u5834\u9762\uFF08\u30E6\u30FC\u30B6\u30FC\u304C\u3044\u308B\u753B\u9762\u3068\u3001\u624B\u5143\u306B\u3042\u308B\u3082\u306E\uFF09\u3067\u3059\u3002base JSON \u306B Step \u3092\u8FFD\u52A0\u3059\u308B\u3068\u3001\u3053\u3053\u306B\u305D\u306E\u753B\u9762\u304C\u73FE\u308C\u307E\u3059\u3002",noScreens:"\u3053\u306E\u30D7\u30ED\u30C0\u30AF\u30C8\u306B\u306F\u307E\u3060\u753B\u9762\u304C\u3042\u308A\u307E\u305B\u3093\u3002base JSON \u306E apps[].screens \u306B\u30A2\u30D7\u30EA\u3068\u753B\u9762\u3092\u5BA3\u8A00\u3059\u308B\u3068\u3001\u3053\u3053\u306B\u73FE\u308C\u307E\u3059\u3002",noPreviewMetadata:"preview metadata \u304C\u3042\u308A\u307E\u305B\u3093 \u2014 \u8FFD\u52A0\u306F Agent \u306B\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044",storyWithoutSteps:"\u3053\u306E UserStory \u306B\u306F\u307E\u3060 Step \u304C\u306A\u304F\u3001\u898B\u305B\u308B\u753B\u9762\u304C\u3042\u308A\u307E\u305B\u3093\u3002+ Step \u3067\u8FFD\u52A0\u3059\u308B\u304B\u3001Agent \u306B\u30D7\u30ED\u30C8\u30BF\u30A4\u30D7\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",pageActor:e=>`\u5229\u7528\u8005: ${e}`,maximize:"\u6700\u5927\u5316",restore:"\u5143\u306E\u30B5\u30A4\u30BA\u306B\u623B\u3059",maximizeHint:"\u30D7\u30EC\u30D3\u30E5\u30FC\u3060\u3051\u3092\u30BF\u30D6\u3044\u3063\u3071\u3044\u306B\u8868\u793A \xB7 Esc \u3067\u623B\u308B",situation:"\u72B6\u6CC1",uiComment:"UI \u306B\u30B3\u30E1\u30F3\u30C8",uiCommentHint:"\u30D7\u30EC\u30D3\u30E5\u30FC\u306E\u8981\u7D20\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30B3\u30E1\u30F3\u30C8 \xB7 Esc \u3067\u7D42\u4E86",uiCommentPin:(e,t)=>`\u30B3\u30E1\u30F3\u30C8 ${e}: ${t}`,mailFrom:"\u5DEE\u51FA\u4EBA",mailTo:"\u5B9B\u5148",mailCc:"Cc",mailDate:"\u65E5\u6642",demo:"\u30C7\u30E2",demoHint:"\u307B\u304B\u306B\u4F55\u3082\u51FA\u3055\u305A\u3001\u30BF\u30D6\u3044\u3063\u3071\u3044\u306E\u30D6\u30E9\u30A6\u30B6\u3067\u30A2\u30D7\u30EA\u3092\u89E6\u308B \xB7 Esc \u3067\u7D42\u4E86",exitDemo:"\u30C7\u30E2\u3092\u7D42\u4E86",browserBack:"\u623B\u308B",browserForward:"\u9032\u3080",browserReload:"\u518D\u8AAD\u307F\u8FBC\u307F",browserAddress:"\u30A2\u30C9\u30EC\u30B9",browserTabs:"\u30BF\u30D6",newTab:"\u65B0\u3057\u3044\u30BF\u30D6",closeTab:"\u30BF\u30D6\u3092\u9589\u3058\u308B",browserProfile:e=>`\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB: ${e}`,browserGuest:"\u30B2\u30B9\u30C8",newTabShortcuts:"\u3053\u306E\u30A2\u30D7\u30EA\u306E\u30DA\u30FC\u30B8",unreachableTitle:"\u3053\u306E\u30B5\u30A4\u30C8\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093",unreachableBody:"\u30D7\u30ED\u30C8\u30BF\u30A4\u30D7\u306B\u3053\u306E\u30A2\u30C9\u30EC\u30B9\u306E\u30DA\u30FC\u30B8\u306F\u3042\u308A\u307E\u305B\u3093\u3002",device:"\u30C7\u30D0\u30A4\u30B9",deviceHint:"\u30A2\u30D7\u30EA\u3092\u52D5\u304B\u3059\u753B\u9762\u306E\u5927\u304D\u3055\u3002\u53CE\u307E\u3089\u306A\u3044\u30DA\u30FC\u30B8\u306F\u5B9F\u6A5F\u3068\u540C\u3058\u304F\u753B\u9762\u306E\u4E2D\u3067\u30B9\u30AF\u30ED\u30FC\u30EB\u3059\u308B",deviceName:e=>mt[e]??mi[e]??e,deviceZoom:e=>`\u53CE\u307E\u308B\u3088\u3046 ${e}% \u3067\u8868\u793A`}}),yi=["scenario","app"],N="view",se=e=>e[N]==="app"?"app":"scenario",yt=e=>({[N]:e==="app"?"app":null}),ae=(e,t)=>e===void 0?`\u2192 "${t}"`:`"${e}" \u2192 "${t}"`,ki=e=>({SET_ACTIVITY_NAME:(t,r)=>({title:e.renameActivity,tone:"update",body:ae(L(r,t.target.id)?.name,y(f.SET_ACTIVITY_NAME,t).name)}),SET_ACTIVITY_DESCRIPTION:(t,r)=>({title:e.updateActivityDescription,tone:"update",body:Ne(L(r,t.target.id)?.description,y(f.SET_ACTIVITY_DESCRIPTION,t).description)}),SET_STORY_NAME:(t,r)=>({title:e.renameStory,tone:"update",body:ae($(r,t.target.id)?.story.name,y(f.SET_STORY_NAME,t).name)}),SET_STORY_DESCRIPTION:(t,r)=>({title:e.updateStoryDescription,tone:"update",body:Ne($(r,t.target.id)?.story.description,y(f.SET_STORY_DESCRIPTION,t).description)}),SET_STEP_NAME:(t,r)=>({title:e.renameStep,tone:"update",body:ae(k(r,t.target.id)?.step.name,y(f.SET_STEP_NAME,t).name)}),SET_STEP_DESCRIPTION:(t,r)=>({title:e.updateStepDescription,tone:"update",body:Ne(k(r,t.target.id)?.step.description,y(f.SET_STEP_DESCRIPTION,t).description)}),SET_PREVIEW_KIND:(t,r)=>({title:e.changePreviewKind,tone:"update",body:ae(A(r,t.target.id)?.preview.kind,y(f.SET_PREVIEW_KIND,t).kind)}),SET_PREVIEW_VIEWPORT:(t,r)=>({title:e.changePreviewViewport,tone:"update",body:ae(A(r,t.target.id)?.preview.viewport,y(f.SET_PREVIEW_VIEWPORT,t).viewport)}),SET_PREVIEW_LABEL:t=>({title:e.changePreviewLabel,tone:"update",body:`\u2192 "${y(f.SET_PREVIEW_LABEL,t).label}"`}),REORDER_ACTIVITY:t=>ze(e,e.activityGroup,y(f.REORDER_ACTIVITY,t).after),REORDER_STORY:t=>ze(e,e.storyGroup,y(f.REORDER_STORY,t).after),REORDER_STEP:t=>ze(e,e.stepGroup,y(f.REORDER_STEP,t).after),MOVE_STORY:(t,r)=>({title:e.moveStory,tone:"move",body:`\u2192 ${L(r,y(f.MOVE_STORY,t).toActivity)?.name??y(f.MOVE_STORY,t).toActivity}`}),MOVE_STEP:(t,r)=>({title:e.moveStep,tone:"move",body:`\u2192 ${$(r,y(f.MOVE_STEP,t).toStory)?.story.name??y(f.MOVE_STEP,t).toStory}`}),ADD_ACTIVITY:t=>we(e,e.activityGroup,y(f.ADD_ACTIVITY,t).name),ADD_STORY:t=>we(e,e.storyGroup,y(f.ADD_STORY,t).name),ADD_STEP:t=>we(e,e.stepGroup,y(f.ADD_STEP,t).name),ADD_PREVIEW:t=>we(e,e.previewGroup,y(f.ADD_PREVIEW,t).label??y(f.ADD_PREVIEW,t).id),DELETE_ACTIVITY:(t,r)=>be(e,L(r,t.target.id)?.name),DELETE_STORY:(t,r)=>be(e,$(r,t.target.id)?.story.name),DELETE_STEP:(t,r)=>be(e,k(r,t.target.id)?.step.name),DELETE_PREVIEW:(t,r)=>be(e,A(r,t.target.id)?.preview.label)}),Ne=(e,t)=>{const r=t.length>90?`${t.slice(0,90)}\u2026`:t;return e===void 0||e===""?`\u2192 "${r}"`:`"${xi(e)}" \u2192 "${r}"`},xi=e=>e.length>60?`${e.slice(0,60)}\u2026`:e,ze=(e,t,r)=>({title:e.reorderTitle(t),tone:"move",body:r===null?e.toFront:e.afterName(r)}),we=(e,t,r)=>({title:e.addTitle(t),tone:"create",body:`+ "${r}"`}),be=(e,t)=>({title:e.deleteTitle,tone:"delete",body:t===void 0?e.unknownTarget:`\u2212 "${t}"`}),kt=(e,t,r,i)=>{const n=ki(e),o=Object.hasOwn(n,t.type)?n[t.type]:void 0,s=o?o(t,i??r):{title:t.type,tone:"meta"};return{title:s.title,targetLabel:$t(e,r,t.target),tone:s.tone,...s.body===void 0?{}:{summary:s.body}}},xt=e=>`${e.type} ${U(e.target)} ${JSON.stringify(e.payload)}`,$t=(e,t,r)=>{switch(r.type){case"activity":{const i=L(t,r.id);return i?e.targetLabel(e.activityGroup,i.name):e.targetMissing(e.activityGroup,r.id)}case"story":{const i=$(t,r.id)?.story;return i?e.targetLabel(e.storyGroup,i.name):e.targetMissing(e.storyGroup,r.id)}case"step":{const i=k(t,r.id)?.step;return i?e.targetLabel(e.stepGroup,i.name):e.targetMissing(e.stepGroup,r.id)}case"screen":{const i=M(t,r.id)?.screen;return i?e.targetLabel(e.screenGroup,i.title):e.targetMissing(e.screenGroup,r.id)}case"preview":{const i=A(t,r.id)?.preview;return i?e.targetLabel(e.previewGroup,i.label??i.id):e.targetMissing(e.previewGroup,r.id)}case"page":return e.targetLabel(e.pageGroup,Ue(t));case re:{const i=Ce(r.id),n=i?A(t,i.previewId)?.preview:void 0;return i&&n?e.targetLabel(e.uiGroup,Et(n,i)):e.targetMissing(e.uiGroup,r.id)}default:return e.targetLabel(r.type,r.id)}},Et=(e,t)=>{const r=t.text===void 0?t.selector:`"${t.text}"`;return`${e.label??e.id} \u203A ${r}`},St=(e,t)=>{const r=[];for(const i of e){if(i.target.type!==re)continue;const n=Ce(i.target.id);!n||!t.includes(n.previewId)||r.push({id:i.id,previewId:n.previewId,selector:n.selector,number:r.length+1,body:et(i)})}return r},Tt=(e,t)=>St(e,t).length,$i=/^[a-z][a-z0-9+.-]*:/i,Ei=e=>{const t=e.baseUrl?.trim(),r=Mr(e.title??"");return`${(t?t.startsWith("http")?t:`https://${t}`:`https://${r==="item"?"page":r}.example.com`).replace(/\/+$/,"")}/`},me=(e,t)=>{const r=Ei(e);if(!t.url)return`${r}${t.id}`;if($i.test(t.url))return t.url;try{return decodeURI(new URL(t.url,r).href)}catch{return t.url}},Si=e=>{switch(e.type){case"activity":return{[N]:null,activity:e.id};case"story":return{[N]:null,activity:null,story:e.id};case"step":return{[N]:null,activity:null,story:null,step:e.id};case"screen":return{screen:e.id};default:return null}},At=(e,t)=>{const r=e.kind==="screen"?[{type:"screen",id:e.screen.id}]:[{type:"activity",id:e.activity.id},{type:"story",id:D(e.activity.id,e.story.id)},...e.kind==="step"?[{type:"step",id:ie(e)}]:[]];for(const i of t?.panes??[])i.kind==="screen"&&r.push({type:"screen",id:i.screen.screen.id});return[...new Set(r.map(U))].join(" ")},Ve=",",It=e=>e.preview?.split(Ve)??[],Ti=(e,t)=>e.kind===t.kind&&e.viewport===t.viewport,Pt=(e,t,r)=>{const i=t.find(o=>r.includes(o.id));if(i)return i;const n=r.flatMap(o=>A(e,o)?.preview??[]);return t.find(o=>n.some(s=>Ti(o,s)))??t[0]},_t=(e,t,r,i)=>{const n=t.screen.previews,o=r===void 0?Pt(e,n,It(i)):n.find(a=>a.id===r);if(!o)return;const s=r===void 0&&n.length>1;return{kind:"screen",screen:t,preview:o,pinned:r!==void 0,tabs:s?n:[]}},Rt=e=>({layout:e.length>1?"side-by-side":"single",panes:e,shown:e.map(t=>t.preview)}),Dt=(e,t,r)=>t.panes.flatMap(i=>{if(!K(i))return[{kind:"material",preview:i.material}];const n=M(e,i.screen),o=n&&_t(e,n,i.preview,r);return o?[o]:[]}),Ye=(e,t,r)=>{if(t.kind==="screen"){const i=_t(e,t,void 0,r);return Rt(i?[i]:[])}return Rt(Dt(e,t.step,r))},Ai=(e,t)=>e.panes.flatMap(r=>r.kind!=="screen"||r.tabs.length===0?[]:[r.tabs.some(i=>i.id===t)?t:r.preview.id]).join(Ve),Ii=(e,t)=>[...X(t),...he(e,t).flatMap(r=>r.screen.previews)],Pi=["activity","story","step","screen","preview"],_i=(e,t,r)=>{switch(t){case"activity":return L(e,r)!==void 0;case"story":return $(e,r)!==void 0||e.activities.some(i=>i.stories.some(n=>n.id===r));case"step":return k(e,r)!==void 0||B(e).some(i=>i.step.id===r);case"screen":return M(e,r)!==void 0;case"preview":return A(e,r)!==void 0;default:return!1}},Ri=(e,t)=>{let r;if(t.navigate!==null)r=t.navigate.includes("=")?t.navigate:`step=${t.navigate}`;else{const o=t.href?.trim()??"";if(o===""||o==="#"||o.toLowerCase().startsWith("javascript:"))return"no-destination";if(!o.startsWith("#"))return null;r=o}const i=Ae(r),n=Pi.filter(o=>i[o]!==void 0);return n.length===0?t.navigate===null?null:"unknown-target":n.every(o=>_i(e,o,i[o]??""))?null:"unknown-target"},Di=(e,t)=>{const r=t.mail??{},i=[{label:e.mailFrom,value:r.from},{label:e.mailTo,value:r.to},{label:e.mailCc,value:r.cc},{label:e.mailDate,value:r.date}].flatMap(s=>s.value===void 0||s.value.trim()===""?[]:[{label:s.label,value:s.value}]),n=r.from?.replace(/<[^>]*>/g,"").replace(/["']/g,"").trim()||r.from?.trim(),o=n?Array.from(n)[0]?.toUpperCase():void 0;return{...r.subject===void 0||r.subject.trim()===""?{}:{subject:r.subject},...n?{sender:n}:{},...o===void 0?{}:{initial:o},rows:i}},Ct=(e,t)=>{const r=[];for(const i of t.activities){r.push({value:U({type:"activity",id:i.id}),label:i.name,group:e.activityGroup});for(const n of i.stories){r.push({value:U({type:"story",id:D(i.id,n.id)}),label:`${i.name} \u203A ${n.name}`,group:e.storyGroup});for(const o of n.steps)r.push({value:U({type:"step",id:ve(i,n,o)}),label:`${n.name} \u203A ${o.name}`,group:e.stepGroup})}}for(const{app:i,screen:n}of W(t))r.push({value:U({type:"screen",id:n.id}),label:`${i.name} \u203A ${n.title}`,group:e.screenGroup});return r},Ci=(e,t,r)=>{const i=Z(t,r);if(i?.kind==="screen"){const{screen:n}=i;return{value:U({type:"screen",id:n.id}),label:n.title,group:e.screenGroup}}return i?.kind!=="step"?null:{value:U({type:"step",id:ie(i)}),label:i.step.name,group:e.stepGroup}},Z=(e,t)=>{if(se(t)==="app"){const o=M(e,t.screen);return o?{kind:"screen",...o}:void 0}const r=k(e,t.step);if(r)return{kind:"step",...r};const i=L(e,t.activity),n=i?.stories.find(o=>o.id===t.story||D(i.id,o.id)===t.story);return i&&n?{kind:"story",activity:i,story:n}:void 0},Ot=(e,t)=>{const r=(p,l)=>l===void 0?{title:p}:{actor:l,title:p};if(t.kind==="screen")return r(t.screen.title,t.app.actor);const{activity:i,story:n,step:o}=t,s=he(e,o),a=s.length===1?s[0]:void 0;return r(a?.screen.title??o.name,o.actor??n.actor??i.actor??a?.app.actor)},Oi=(e,t)=>{const r=t.actor??e.actor;return r===void 0?{title:t.name}:{actor:r,title:t.name}},Ue=e=>e.title??"UX Prototype",Mt=(e,t)=>(t?e.preview=t:delete e.preview,e),Mi=(e,t,r)=>{if(!t)return;const i=Dt(e,t,r).flatMap(n=>n.kind==="screen"&&!n.pinned?[n.preview.id]:[]);return i.length===0?void 0:i.join(Ve)},Lt=(e,t)=>{const r=()=>{if(t.step===void 0&&t.story===void 0)return;const o=Nt(e,{...t,[N]:""}),s=k(e,o.step);return s&&he(e,s.step)[0]},i=M(e,t.screen)??r()??W(e)[0],n={...t,[N]:"app"};for(const o of["activity","story","step"])delete n[o];return i?n.screen=i.screen.id:delete n.screen,Mt(n,i&&Pt(e,i.screen.previews,It(t))?.id)},Li=(e,t,r)=>{const i=s=>fi(s.step,t);if(r&&i(r))return r;const n=r?.story.steps??[],o=s=>{const a=n[s];return r&&a?{...r,step:a,stepIndex:s}:void 0};for(let s=(r?.stepIndex??0)+1;s<n.length;s+=1){const a=o(s);if(a&&i(a))return a}for(let s=(r?.stepIndex??0)-1;s>=0;s-=1){const a=o(s);if(a&&i(a))return a}return B(e).find(i)},Nt=(e,t)=>{const r=L(e,t.activity),i=t.story,n=r?.stories.find(V=>V.id===i||D(r.id,V.id)===i),o=n&&r?{activity:r,story:n}:$(e,i),s=t.step,p=(o&&s?k(e,`${D(o.activity.id,o.story.id)}.${s}`):void 0)??k(e,s),l=t.screen,w=l===void 0?void 0:Li(e,l,p);if(l!==void 0&&!w&&M(e,l))return Lt(e,{...t,[N]:"app"});const h=w??p,v=h?.activity??o?.activity??r??e.activities[0],I=h?.story??(o&&o.activity===v?o.story:void 0)??v?.stories[0],P=h?.step??I?.steps[0],S={...t};return delete S.screen,v?S.activity=v.id:delete S.activity,I&&v?S.story=$(e,I.id)?I.id:D(v.id,I.id):delete S.story,P&&I&&v?S.step=k(e,P.id)?P.id:ve(v,I,P):delete S.step,delete S[N],Mt(S,Mi(e,P,t))},Ni=["activity","story","step","screen"],ye=(e,t)=>se(t)==="app"?Lt(e,t):Nt(e,t),zi=(e,t)=>{const r=t.screen.previews.find(o=>o.kind==="browser");if(!r)return;let i;try{i=new URL(me(e,r),"https://page.example.com")}catch{return}const n=i.pathname.split("/").filter(o=>o!=="").map(o=>{try{return decodeURIComponent(o)}catch{return o}});return{origin:i.origin,segments:n}},zt=()=>({screens:[],children:new Map}),We=(e,t,r)=>{const[i,...n]=e.children.entries();if(e.screens.length===0&&i&&n.length===0&&r!=="/"){const[o,s]=i;return We(s,`${t}/${o}`,`${r}/${o}`)}return{segment:t,path:r,screens:e.screens,children:[...e.children.entries()].map(([o,s])=>We(s,`/${o}`,`${r==="/"?"":r}/${o}`))}},Vi=e=>{const t=new Map;for(const[r,i]of e){const n=t.get(i.origin)??zt();t.set(i.origin,n);let o=n;for(const s of i.segments){const a=o.children.get(s)??zt();o.children.set(s,a),o=a}o.screens.push(r)}return[...t.entries()].map(([r,i])=>({origin:r,root:We(i,"/","/")}))},Yi=(e,t)=>{const r=t.screens.map(o=>({app:t,screen:o})),i=[],n=[];for(const o of r){const s=zi(e,o);s?i.push([o,s]):n.push(o)}return{app:t,screens:r,trees:Vi(i),others:n}},Vt=e=>e.apps.map(t=>Yi(e,t)).filter(t=>t.screens.length>0),Yt=(e,t)=>t?.kind!=="screen"?e[0]:e.find(r=>r.app.id===t.app.id)??e[0],Ui=(e,t)=>{switch(t.type){case"activity":return L(e,t.id)!==void 0;case"story":return $(e,t.id)!==void 0;case"step":return k(e,t.id)!==void 0;case"screen":return M(e,t.id)!==void 0;case"preview":return A(e,t.id)!==void 0;case"page":return!0;case re:{const r=Ce(t.id);return r!==void 0&&A(e,r.previewId)!==void 0}default:return!1}},Ut=e=>{const t=fe(e);return{name:"prototype",label:"UX Prototype",parseBase:ht,emptyBase:vt,actions:f,apply:wt,hasTarget:Ui,canonicalTarget:(r,i)=>{if(i.type==="step"){const n=k(r,i.id);return n?{...i,id:ie(n)}:i}if(i.type==="story"){const n=$(r,i.id);return n?{...i,id:D(n.activity.id,n.story.id)}:i}if(i.type==="preview"){const n=A(r,i.id);return n?{...i,id:n.preview.id}:i}return i},describe:(r,i,n)=>kt(t,r,i,n),serialize:xt,resolveNavigation:ye,navigationHierarchy:Ni,navigationFor:(r,i)=>Si(i),commentTargets:(r,i)=>Ct(t,r),currentTarget:(r,i)=>Ci(t,r,i),title:Ue}},Wi=(e,t)=>{const r=t.flatMap(i=>{const n=Math.max(i.left,e.left)-e.left,o=Math.max(i.top,e.top)-e.top,s=Math.min(i.right,e.right)-e.left-n,a=Math.min(i.bottom,e.bottom)-e.top-o;return s>0&&a>0?[`M${n} ${o}h${s}v${a}h-${s}Z`]:[]});return r.length===0?"none":`path(evenodd, 'M0 0H${e.width}V${e.height}H0Z ${r.join(" ")}')`},ke="data-dpk-modal",Bi=e=>{try{return e.matches(":modal")}catch{return!1}},Wt=e=>{e.setAttribute(ke,""),e.open||e.show()},Bt=e=>{Object.hasOwn(e,"showModal")||Object.defineProperty(e,"showModal",{configurable:!0,value:()=>Wt(e)})},Ht=(e,t)=>{if(!Bi(t))return;const r=i=>{i.target===t&&(i.stopImmediatePropagation(),e.removeEventListener("close",r,!0))};e.addEventListener("close",r,!0),t.close(),Wt(t)},Hi='a, button, input, select, textarea, label, summary, [role="button"], [role="link"], [role="tab"]',Gt=/^-?[A-Za-z_][\w-]*$/,Ft=40,Gi=(e,t)=>{const r=e.closest(Hi);return r!==null&&r!==t&&t.contains(r)?r:e},xe=e=>{const t=e.replace(/\s+/g," ").trim();if(t==="")return;const r=Array.from(t);return r.length>Ft?`${r.slice(0,Ft).join("")}\u2026`:t},Fi=e=>{const t=e.getAttribute("aria-label")??e.getAttribute("title");if(t)return xe(t);const r=e.tagName.toLowerCase();return xe(r==="input"||r==="textarea"||r==="select"?e.getAttribute("placeholder")??e.getAttribute("name")??"":r==="img"?e.getAttribute("alt")??"":e.textContent??"")},ji=e=>{const t=e.getAttribute("id");if(t&&Gt.test(t))return`#${t}`;const r=e.tagName.toLowerCase(),i=Array.from(e.classList).filter(a=>Gt.test(a)).slice(0,2).map(a=>`.${a}`).join(""),n=e.parentElement,o=n?Array.from(n.children).filter(a=>a.tagName===e.tagName):[],s=o.length>1?`:nth-of-type(${o.indexOf(e)+1})`:"";return`${r}${i}${s}`},qi=(e,t,r)=>{try{const i=e.querySelectorAll(t);return i.length===1&&i[0]===r}catch{return!1}},Ki=(e,t)=>{const r=[];let i=e;for(;i!==null&&i!==t;){const o=ji(i);if(r.unshift(o),o.startsWith("#")||qi(t,r.join(" > "),e))break;i=i.parentElement}const n=Fi(e);return{selector:r.length===0?":scope":r.join(" > "),tag:e.tagName.toLowerCase(),...n===void 0?{}:{text:n}}},Xi=(e,t)=>{if(t===":scope")return e;try{return e.querySelector(t)}catch{return null}},Zi=["screen","preview"],de=e=>JSON.stringify(Zi.map(t=>e[t]??null)),jt=(e,t)=>e?.kind==="page"&&de(e.page)===t,$e=e=>`tab-${e}`,Ji=e=>({tabs:[{id:$e(1),history:[{kind:"page",page:e}],index:0}],activeId:$e(1),seen:de(e),nextId:2}),Qi={id:"",history:[],index:0},J=e=>e.tabs.find(t=>t.id===e.activeId)??e.tabs[0]??Qi,pe=e=>{const t=J(e);return t.history[t.index]},en=e=>J(e).index>0,tn=e=>{const t=J(e);return t.index<t.history.length-1},qt=(e,t)=>({...e,tabs:e.tabs.map(r=>r.id===e.activeId?t(r):r)}),Be=(e,t)=>qt(e,r=>({...r,history:[...r.history.slice(0,r.index+1),t],index:r.index+1})),Ee=e=>{const t=pe(e);return t?.kind==="page"?{...e,seen:de(t.page)}:e},Kt=(e,t)=>{const r=J(e),i=r.index+t;return i<0||i>=r.history.length?e:Ee(qt(e,n=>({...n,index:i})))},Xt=(e,t,r)=>{const i=$e(e.nextId),n=e.tabs.findIndex(o=>o.id===e.activeId)+1;return Ee({...e,tabs:[...e.tabs.slice(0,n),{id:i,history:[t],index:0},...e.tabs.slice(n)],activeId:r?e.activeId:i,nextId:e.nextId+1})},rn=(e,t)=>{const r=e.tabs.findIndex(o=>o.id===t);if(r<0)return e;if(e.tabs.length===1){const o=$e(e.nextId);return{...e,tabs:[{id:o,history:[{kind:"new-tab"}],index:0}],activeId:o,nextId:e.nextId+1}}const i=e.tabs.filter(o=>o.id!==t);if(t!==e.activeId)return{...e,tabs:i};const n=i[r]??i[r-1];return Ee({...e,tabs:i,activeId:n?.id??e.activeId})},nn=(e,t)=>{const r=t===null?null:de(t);if(r===e.seen)return e;const i={...e,seen:r};return t===null||r===null||jt(pe(e),r)?i:Be(i,{kind:"page",page:t})},on=(e,t)=>{const r=de(t);return jt(pe(e),r)?e.seen===r?e:{...e,seen:r}:Be({...e,seen:r},{kind:"page",page:t})},Zt=(e,t)=>{switch(t.kind){case"observe":return nn(e,t.page);case"visit":return on(e,t.page);case"back":return Kt(e,-1);case"forward":return Kt(e,1);case"open-tab":return Xt(e,t.entry,t.background);case"new-tab":return Xt(e,{kind:"new-tab"},!1);case"unreachable":return Be(e,{kind:"unreachable",url:t.url});case"activate":return e.tabs.some(r=>r.id===t.id)&&t.id!==e.activeId?Ee({...e,activeId:t.id}):e;case"close-tab":return rn(e,t.id);default:return e}},Jt=(e,t)=>{const r=ye(e,t),i=Z(e,r);if(i?.kind!=="screen")return null;const[n]=Ye(e,i,r).shown;return n?.kind!=="browser"?null:{screen:i.screen.id,preview:n.id}},Se=(e,t)=>{const r=Z(e,ye(e,{[N]:"app",...t}));return r?.kind==="screen"?r:void 0},Qt=(e,t)=>{const r=e.trim();if(r==="")return null;try{return r.startsWith("/")?new URL(r,t):new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(r)?r:`https://${r}`)}catch{return null}},er=e=>`${e.origin}${e.pathname.replace(/\/+$/,"")}`,sn=(e,t,r)=>{const i=Qt(t,r);if(i===null)return null;const n=er(i);for(const{screen:o}of W(e))for(const s of o.previews){if(s.kind!=="browser")continue;const a=Qt(me(e,s),r);if(a!==null&&er(a)===n)return{screen:o.id,preview:s.id}}return null},tr=e=>{try{return new URL(e).host||e}catch{return e}},an=(e,t,r)=>t===void 0||t.kind==="new-tab"?r.newTab:t.kind==="unreachable"?tr(t.url):Se(e,t.page)?.screen.title??r.newTab,rr=(e,t)=>{if(t===void 0||t.kind==="new-tab")return"";if(t.kind==="unreachable")return t.url;const r=Se(e,t.page)?.screen.previews.find(i=>i.id===t.page.preview);return r===void 0?"":me(e,r)},ir=e=>{const t=J(e);for(let r=t.index;r>=0;r-=1){const i=t.history[r];if(i?.kind==="page")return i.page}for(const r of e.tabs){const i=r.history[r.index];if(i?.kind==="page")return i.page}},dn=(e,t)=>t===void 0?void 0:Se(e,t)?.app.actor,nr=(e,t,r,i=null)=>{const n=J(t),o=n.history[n.index],s=dn(e,ir(t)??i??void 0);return{tabs:t.tabs.map(a=>({id:a.id,title:an(e,a.history[a.index],r),url:rr(e,a.history[a.index]),active:a.id===n.id})),entry:o,url:rr(e,o),canBack:en(t),canForward:tn(t),...s===void 0?{}:{profile:s}}},pn=e=>ir(e)??null,ln=(e,t)=>{const r=t===null?void 0:Se(e,t),i=Yt(Vt(e),r),n=[],o=(s,a)=>{for(const{screen:p}of a.screens){const l=p.previews.find(w=>w.kind==="browser");l!==void 0&&n.push({title:p.title,url:`${s}${a.path==="/"?"":a.path}`,page:{screen:p.id,preview:l.id}})}for(const p of a.children)o(s,p)};for(const s of i?.trees??[])o(tr(s.origin),s.root);return n},T=(e,t,r,i)=>({id:t,deviceClass:e,width:r,height:i}),or=[T("phone","iphone-se",375,667),T("phone","iphone-16",393,852),T("phone","iphone-16-pro-max",440,956),T("phone","pixel-7",412,915),T("phone","galaxy-s24",360,780),T("tablet","ipad-mini",744,1133),T("tablet","ipad-air-11",820,1180),T("tablet","ipad-pro-11",834,1194),T("tablet","ipad-pro-13",1024,1366),T("desktop","laptop-13",1280,800),T("desktop","laptop-15",1440,900),T("desktop","full-hd",1920,1080),T("desktop","monitor-27",2560,1440),T("desktop","ultrawide",3440,1440)],cn={phone:T("phone","iphone-16",393,852),tablet:T("tablet","ipad-pro-11",834,1194),desktop:T("desktop","laptop-13",1280,800)},sr=e=>e==="mobile"?"phone":e==="tablet"?"tablet":"desktop",un=e=>e!=="plain",ar=e=>or.filter(t=>t.deviceClass===e),hn=(e,t)=>{const r=sr(e),i=t[r];return ar(r).find(n=>n.id===i)??cn[r]},vn=(e,t)=>{const r=or.find(i=>i.id===t);return r===void 0||e[r.deviceClass]===t?e:{...e,[r.deviceClass]:t}},gn=(e,t)=>`${e.deviceName(t.id)} \xB7 ${t.width}\xD7${t.height}`,fn=(e,t)=>{const r=[1,t.width/e.width];t.height!==void 0&&r.push(t.height/e.height);const i=Math.min(...r);return!Number.isFinite(i)||i<=0?1:Math.max(.1,Math.floor(i*100)/100)},dr=(e,t)=>{const{state:r,navigation:i}=e,n=Z(r,i),o=se(i);return d`
2
- <div class="nav">
3
- ${mn(e,t,o)}
4
- ${o==="app"?yn(e,t,n):n!==void 0&&n.kind!=="screen"?$n(e,t,n):d`<p class="nav-empty">${t.noActivityBefore}<code>activities</code>${t.noActivityAfter}</p>`}
5
- </div>
6
- `},wn={scenario:"viewScenario",app:"viewApp"},bn={scenario:"viewScenarioHint",app:"viewAppHint"},mn=(e,t,r)=>d`<nav class="view-switch" aria-label=${t.viewLabel}>
7
- ${yi.map(i=>d`<a
8
- class="view-option"
9
- href=${e.hashFor(yt(i))}
10
- title=${t[bn[i]]}
11
- aria-current=${i===r?"page":c}
12
- data-view=${i}
13
- >${t[wn[i]]}</a
14
- >`)}
15
- </nav>`,yn=(e,t,r)=>{const i=r?.kind==="screen"?r:void 0,n=Vt(e.state),o=Yt(n,r),s={context:e,currentId:i?.screen.id},a=o?.others??[];return d`
16
- ${n.length>1&&o?kn(e,t,n,o):c}
17
- ${n.length===1&&o?.app.description?d`<p class="app-description">${o.app.description}</p>`:c}
18
- <div class="steps-head">
19
- <span class="dpk-label">${t.appScreens}</span>
20
- <span class="dpk-label">${o?.screens.length??0}</span>
21
- </div>
22
- <p class="app-hint">${t.appScreensHint}</p>
23
- ${o?.trees.map(p=>d`<section class="app-tree">
24
- <h3 class="app-origin">${xn(p.origin)}</h3>
25
- <ul class="tree">
26
- ${pr(s,p.root,0)}
27
- </ul>
28
- </section>`)}
29
- ${a.length===0?c:d`<section class="app-group">
30
- ${(o?.trees.length??0)>0?d`<h3 class="app-group-heading">${t.appOutsideBrowser}</h3>`:c}
31
- <ul class="steps app-screens">
32
- ${a.map(p=>{const l=lr(s,p);return d`<li class="step-row" data-current=${String(l)}>
33
- <a class="step-link" href=${ur(e,p)} aria-current=${l?"page":c}>
34
- <span class="step-name">${p.screen.title}</span>
35
- ${hr(e,p)}
36
- </a>
37
- </li>`})}
38
- </ul>
39
- </section>`}
40
- ${i?.screen.description?d`<div class="detail">
41
- <div class="screen-description dpk-prose">${Ie(Pe(i.screen.description))}</div>
42
- </div>`:c}
43
- `},kn=(e,t,r,i)=>d`<div class="field">
44
- <span class="dpk-label">${t.appSelectLabel}</span>
45
- <select
46
- class="dpk-select"
47
- aria-label=${t.appSelectLabel}
48
- @change=${_e(n=>{const o=r[Number(n)]?.screens[0];o&&e.navigate(cr(o))})}
49
- >
50
- ${r.map((n,o)=>d`<option value=${String(o)} ?selected=${n===i}>${n.app.name}</option>`)}
51
- </select>
52
- ${i.app.description?d`<p class="app-description">${i.app.description}</p>`:c}
53
- </div>`,pr=(e,t,r)=>d`<li
54
- class="tree-node"
55
- >
56
- ${t.screens.length===0&&r===0?c:t.screens.length===0?d`<div class="tree-row" data-depth=${String(r)} data-current="false">
57
- <span class="tree-link" title=${t.path}><code class="tree-path">${t.segment}</code></span>
58
- </div>`:t.screens.map(i=>{const n=lr(e,i);return d`<div class="tree-row" data-depth=${String(r)} data-current=${String(n)}>
59
- <a
60
- class="tree-link"
61
- href=${ur(e.context,i)}
62
- title=${t.path}
63
- aria-current=${n?"page":c}
64
- >
65
- <code class="tree-path">${t.segment}</code>
66
- <span class="tree-title">${i.screen.title}</span>
67
- ${hr(e.context,i)}
68
- </a>
69
- </div>`})}
70
- ${t.children.length>0?d`<ul class="tree">
71
- ${t.children.map(i=>pr(e,i,r+1))}
72
- </ul>`:c}
73
- </li>`,lr=(e,t)=>t.screen.id===e.currentId,cr=e=>({screen:e.screen.id,preview:null}),ur=(e,t)=>e.hashFor(cr(t)),hr=(e,t)=>{const r=e.commentCount({type:"screen",id:t.screen.id})+Tt(e.comments,t.screen.previews.map(i=>i.id));return r>0?d`<span class="step-note">${r}</span>`:c},xn=e=>e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""),$n=(e,t,r)=>{const{state:i}=e,{activity:n,story:o}=r,s=o.steps,a=r.kind==="step"?r.step:void 0,p=r.kind==="step"?ie(r):void 0;return d`
74
- <div class="field">
75
- <span class="dpk-label">Activity</span>
76
- <select
77
- class="dpk-select"
78
- aria-label="Activity"
79
- @change=${_e(l=>e.navigate({activity:l,story:null,step:null}))}
80
- >
81
- ${i.activities.map(l=>d`<option value=${l.id} ?selected=${l.id===n.id}>${l.name}</option>`)}
82
- </select>
83
- </div>
84
- <div class="field">
85
- <span class="dpk-label">User Story</span>
86
- <select
87
- class="dpk-select"
88
- aria-label="User Story"
89
- @change=${_e(l=>e.navigate({activity:n.id,story:l,step:null}))}
90
- >
91
- ${n.stories.map(l=>d`<option value=${l.id} ?selected=${l.id===o.id}>${l.name}</option>`)}
92
- </select>
93
- </div>
94
- <div class="steps-head">
95
- <span class="dpk-label">Step</span>
96
- <span class="dpk-label">${s.length}</span>
97
- </div>
98
- <ol class="steps">
99
- ${Lr(s,l=>ve(n,o,l),(l,w)=>{const h=ve(n,o,l),v=e.commentCount({type:"step",id:h})+Tt(e.comments,Ii(i,l).map(I=>I.id));return d`
100
- <li class="step-row" data-current=${String(l.id===a?.id)}>
101
- <a class="step-link" href=${e.hashFor({activity:n.id,story:o.id,step:l.id})}>
102
- <span class="step-index">${String(w+1).padStart(2,"0")}</span>
103
- <span class="step-name">${l.name}</span>
104
- ${v>0?d`<span class="step-note">${v}</span>`:c}
105
- </a>
106
- <span class="row-tools">
107
- <button
108
- class="dpk-icon-btn"
109
- type="button"
110
- aria-label=${t.deleteStepAria}
111
- @click=${()=>e.dispatch(ne.deleteStep(h))}
112
- >
113
- ${Re()}
114
- </button>
115
- </span>
116
- </li>
117
- `})}
118
- </ol>
119
- <button class="dpk-btn" type="button" @click=${()=>Sn(e,t,D(n.id,o.id))}>
120
- ${t.addStepButton}
121
- </button>
122
- ${a?ot(p,d`<div class="detail">
123
- <div class="detail-row">
124
- <span class="dpk-label">${t.stepNameLabel}</span>
125
- <span class="detail-value">
126
- <dpk-component-inline-edit
127
- .value=${a.name}
128
- .label=${t.stepNameLabel}
129
- @dpk-commit=${tt(l=>e.dispatch(ne.setStepName(p??a.id,l)))}
130
- ></dpk-component-inline-edit>
131
- </span>
132
- </div>
133
- <div class="detail-row">
134
- <span class="dpk-label">${t.descriptionLabel}</span>
135
- <span class="detail-value">
136
- <dpk-component-inline-edit
137
- multiline
138
- markdown
139
- .value=${a.description??""}
140
- .placeholder=${t.descriptionPlaceholder}
141
- .label=${t.descriptionLabel}
142
- @dpk-commit=${tt(l=>e.dispatch(ne.setStepDescription(p??a.id,l)))}
143
- ></dpk-component-inline-edit>
144
- </span>
145
- </div>
146
- ${En(e,t,a)}
147
- </div>`):c}
148
- `},En=(e,t,r)=>{const i=he(e.state,r);return i.length===0?c:d`<div class="detail-row">
149
- <span class="dpk-label">${t.screenGroup}</span>
150
- <span class="detail-value">
151
- ${i.map(({app:n,screen:o})=>d`<div class="step-screen-entry">
152
- <a
153
- class="step-screen"
154
- href=${e.hashFor({...yt("app"),screen:o.id})}
155
- title=${t.openInApp}
156
- >${n.name} › ${o.title}</a
157
- >
158
- ${o.description?d`<div class="screen-description dpk-prose">
159
- ${Ie(Pe(o.description))}
160
- </div>`:c}
161
- </div>`)}
162
- </span>
163
- </div>`},Sn=(e,t,r)=>{const i=Nr("new-step",ft(e.state));e.dispatch(ne.addStep(r,i,t.newStepName)).ok&&e.navigate({story:r,step:i})},vr=(e,t,r="bar")=>{const i=t.mode.kind!=="off";return d`<button
164
- class=${`${r==="demo"?"demo-control":i?"dpk-btn dpk-btn--accent":"dpk-btn"} ui-comment-toggle`}
165
- type="button"
166
- aria-pressed=${i?"true":"false"}
167
- title=${e.uiCommentHint}
168
- @click=${()=>t.send({kind:"toggle"})}
169
- >
170
- ${rt()} ${e.uiComment}
171
- </button>`},Tn=(e,t)=>t.mode.kind==="off"?c:d`<p class="ui-comment-hint" role="status">${rt()} ${e.uiCommentHint}</p>`,An=(e,t)=>t.mode.kind==="off"?c:d`<div class="ui-layer" aria-hidden="true">
172
- <div class="ui-catcher"></div>
173
- <div class="ui-box ui-hover" hidden></div>
174
- <div class="ui-box ui-picked" hidden></div>
175
- ${t.pins.map(r=>d`<span
176
- class="ui-pin"
177
- hidden
178
- data-preview=${r.previewId}
179
- data-selector=${r.selector}
180
- title=${e.uiCommentPin(r.number,r.body)}
181
- >${r.number}</span
182
- >`)}
183
- </div>`,In=e=>{const t=e.mode;if(t.kind!=="composing")return c;const r=Kr(t.body,e.notes,{key:`ui:${t.target.previewId}/${t.target.selector}`,...e.targetLabel===void 0?{}:{label:e.targetLabel}});return d`${ot(`${t.target.previewId}/${t.target.selector}`,Xr(e.composer,r,i=>{i.kind==="input"?e.send({kind:"input",body:i.body}):i.kind==="comment"?e.submit(i.body):e.send({kind:"dismiss"})}))}`},gr=(e,t)=>d`<div class="demo-controls">
184
- ${vr(e,t.uiComment,"demo")}
185
- <button class="demo-control demo-exit" type="button" title=${e.exitDemo} @click=${t.onExit}>
186
- ${Re()} ${e.exitDemo} <kbd>Esc</kbd>
187
- </button>
188
- </div>`,fr={mobile:"390px",tablet:"834px",desktop:"1180px",fluid:"100%"},wr={mobile:"620px",tablet:"640px",desktop:"520px",fluid:"420px"},Pn={browser:0,native:22,mail:0,plain:0},br=(e,t,r)=>{const i=`--frame-width:${fr[t]};--frame-min-height:${wr[t]}`;if(r?.kind!=="device")return i;const n=Pn[e];return`${i};--device-width:${r.width+n}px;--device-height:${r.height+n}px;zoom:${r.zoom}`},_n=O(zr),Rn=O(Vr),Dn=O(ri),Cn=O(Qr),He=O(Jr),On=(e,t,r)=>{const i=t.length-1;if(e==="ArrowRight")return t[r===i?0:r+1];if(e==="ArrowLeft")return t[r===0?i:r-1];if(e==="Home")return t[0];if(e==="End")return t[i]},Mn=(e,t)=>{const{view:r,send:i}=t,n=o=>s=>{const a=r.tabs[o],p=s.key==="Enter"||s.key===" "?a:On(s.key,r.tabs,o);p!==void 0&&(s.preventDefault(),i({kind:"activate",id:p.id,focus:!0}))};return d`<div class="browser-tabs">
189
- <div class="browser-tab-list" role="tablist" aria-label=${e.browserTabs}>
190
- ${r.tabs.map((o,s)=>d`<div
191
- class="browser-tab"
192
- role="tab"
193
- tabindex=${o.active?"0":"-1"}
194
- aria-selected=${o.active?"true":"false"}
195
- title=${o.title}
196
- @click=${()=>i({kind:"activate",id:o.id})}
197
- @keydown=${n(s)}
198
- >
199
- <span class="browser-favicon">${He()}</span>
200
- <span class="browser-tab-title">${o.title}</span>
201
- ${mr(e,t,o.id)}
202
- </div>`)}
203
- </div>
204
- <button
205
- class="browser-new-tab"
206
- type="button"
207
- aria-label=${e.newTab}
208
- title=${e.newTab}
209
- @click=${()=>i({kind:"new-tab"})}
210
- >
211
- ${it()}
212
- </button>
213
- ${t.demo===void 0?c:gr(e,t.demo)}
214
- </div>`},mr=(e,t,r)=>d`<button
215
- class="browser-tab-close"
216
- type="button"
217
- aria-label=${e.closeTab}
218
- title=${e.closeTab}
219
- @click=${i=>{i.stopPropagation(),t.send({kind:"close-tab",id:r})}}
220
- >
221
- ${Re()}
222
- </button>`,Ln={back:_n,forward:Rn,reload:Dn},Q=(e,t,r)=>{const{view:i,send:n}=t,o={back:e.browserBack,forward:e.browserForward,reload:e.browserReload}[r],s={back:!i.canBack,forward:!i.canForward,reload:i.entry?.kind!=="page"}[r];return d`<button
223
- class=${`browser-nav browser-${r}`}
224
- type="button"
225
- aria-label=${o}
226
- title=${o}
227
- ?disabled=${s}
228
- @click=${()=>n({kind:r})}
229
- >
230
- ${Ln[r]()}
231
- </button>`},Nn=(e,t,r)=>{const{view:i,send:n}=t,o=i.profile??e.browserGuest;return d`<div class="browser-toolbar">
232
- ${r?c:d`${Q(e,t,"back")} ${Q(e,t,"forward")} ${Q(e,t,"reload")}`}
233
- <form
234
- class="browser-address-form"
235
- @submit=${s=>{s.preventDefault();const a=s.currentTarget,p=a instanceof HTMLFormElement?a.querySelector("input"):null;!p||p.value.trim()===""||(p.blur(),n({kind:"address",input:p.value}))}}
236
- >
237
- <span class="browser-lock">${i.entry?.kind==="page"?Cn():He()}</span>
238
- <input
239
- class="browser-address"
240
- type="text"
241
- aria-label=${e.browserAddress}
242
- spellcheck="false"
243
- autocomplete="off"
244
- .value=${Yr(i.url)}
245
- @focus=${s=>{s.currentTarget instanceof HTMLInputElement&&s.currentTarget.select()}}
246
- @keydown=${s=>{if(s.key!=="Escape")return;s.preventDefault();const a=s.currentTarget;a instanceof HTMLInputElement&&(a.value=i.url,a.blur())}}
247
- />
248
- </form>
249
- <span class="browser-profile" title=${e.browserProfile(o)}>
250
- <span class="browser-avatar" aria-hidden="true">${Array.from(o)[0]??""}</span>
251
- ${r?c:d`<span class="browser-profile-name">${o}</span>`}
252
- </span>
253
- </div>`},zn=(e,t)=>{const{view:r,send:i}=t;return d`<div class="browser-bottom">
254
- ${Q(e,t,"back")} ${Q(e,t,"forward")}
255
- <button
256
- class="browser-nav browser-new-tab"
257
- type="button"
258
- aria-label=${e.newTab}
259
- title=${e.newTab}
260
- @click=${()=>i({kind:"new-tab"})}
261
- >
262
- ${it()}
263
- </button>
264
- <button
265
- class="browser-nav browser-tab-count"
266
- type="button"
267
- aria-label=${e.browserTabs}
268
- title=${e.browserTabs}
269
- aria-expanded=${t.switcher?"true":"false"}
270
- @click=${()=>i({kind:"switcher",open:!t.switcher})}
271
- >
272
- <span class="browser-tab-count-box">${r.tabs.length}</span>
273
- </button>
274
- ${Q(e,t,"reload")}
275
- </div>`},Vn=(e,t)=>{const{view:r,send:i}=t;return d`<div class="browser-switcher" role="dialog" aria-label=${e.browserTabs}>
276
- ${r.tabs.map(n=>d`<div class="browser-card" aria-current=${n.active?"true":c}>
277
- <button class="browser-card-open" type="button" @click=${()=>i({kind:"activate",id:n.id})}>
278
- <span class="browser-favicon">${He()}</span>
279
- <span class="browser-card-title">${n.title}</span>
280
- <span class="browser-card-url">${n.url}</span>
281
- </button>
282
- ${mr(e,t,n.id)}
283
- </div>`)}
284
- </div>`},Yn=(e,t,r)=>d`<div class="browser-newtab">
285
- <p class="browser-newtab-label">${t.newTabShortcuts}</p>
286
- <div class="browser-shortcuts">
287
- ${r.shortcuts.map(i=>d`<a
288
- class="browser-shortcut"
289
- href=${e.hashFor(i.page)}
290
- @click=${n=>{n.preventDefault(),r.send({kind:"visit",page:i.page})}}
291
- >
292
- <span class="browser-shortcut-icon" aria-hidden="true">${Array.from(i.title)[0]??""}</span>
293
- <span class="browser-shortcut-title">${i.title}</span>
294
- <span class="browser-shortcut-url">${i.url}</span>
295
- </a>`)}
296
- </div>
297
- </div>`,Un=(e,t)=>d`<div class="browser-unreachable" role="alert">
298
- <h3>${e.unreachableTitle}</h3>
299
- <p>${e.unreachableBody}</p>
300
- <code>${t}</code>
301
- </div>`,Wn=(e,t,r)=>{const{view:i,preview:n,viewport:o}=r,s=i.entry,a=o==="mobile";return d`<figure
302
- class="frame browser"
303
- data-kind="browser"
304
- data-viewport=${o}
305
- ?data-loading=${r.loading}
306
- ?data-empty=${n!==void 0&&!r.hasContent}
307
- data-window=${r.window.kind}
308
- style=${br("browser",o,r.window)}
309
- >
310
- ${a?c:Mn(t,r)} ${Nn(t,r,a)}
311
- <div class="browser-progress" aria-hidden="true"></div>
312
- <div class="viewport">
313
- ${a&&r.switcher?Vn(t,r):c}
314
- ${s?.kind==="unreachable"?Un(t,s.url):n===void 0?Yn(e,t,r):d`<slot name=${`preview:${n.id}`}></slot> ${r.hasContent?c:d`<div class="frame-placeholder">
315
- <span class="dpk-label">light dom preview</span>
316
- <code>&lt;div slot="preview" data-preview-id="${n.id}"&gt;</code>
317
- </div>`}`}
318
- </div>
319
- ${a?zn(t,r):c}
320
- </figure>`},yr=(e,t,r)=>{const{state:i,navigation:n}=e,o=Z(i,n),s=o===void 0||o.kind==="story"?void 0:o,a=se(n)==="app",p=$r(i,[]);if(o?.kind==="story"){const{activity:_,story:Te}=o;return d`
321
- <div class="stage">
322
- <section class="stage-story" data-dpk-target=${At(o,null)}>
323
- ${kr(t,Oi(_,Te))}
324
- ${Te.description?d`<div class="story-description dpk-prose">${Ie(Pe(Te.description))}</div>`:c}
325
- <p class="stage-empty">${t.storyWithoutSteps}</p>
326
- </section>
327
- ${p}
328
- </div>
329
- `}if(!s)return d`
330
- <div class="stage">
331
- ${a?d`<p class="stage-empty">${t.noScreens}</p>`:d`<p class="stage-empty">
332
- ${t.noStepBefore}<strong>Activity › UserStory › Step</strong>${t.noStepAfter}
333
- </p>`}
334
- ${p}
335
- </div>
336
- `;const l=Ye(i,s,n),{layout:w,panes:h,shown:v}=l,[I]=w==="single"?h:[],P=r.uiComment,S=r.lift,V=S?.mode==="demo",F=r.browser,je=F!==null&&F.view.entry?.kind!=="page"?[]:v,[j]=je,le=(j??v[0])?.viewport??"desktop",qe=V&&F!==null&&le!=="mobile",Ke={onExit:r.onToggleDemo,uiComment:P},Ar=j??v[0],Xe=F!==null?"browser":Ar?.kind??"browser",Ze=V&&Xe==="browser"&&sr(le)==="desktop",q=r.devices,ee=q===null||Ze||!un(Xe)?null:hn(le,q.choice),Je=ee!==null&&q!==null?{kind:"device",width:ee.width,height:ee.height,zoom:q.zoom}:Ze?{kind:"fill"}:null;return d`
337
- ${S===null?c:d`<div class="stage-placeholder" style=${`height:${S.height}px`}></div>`}
338
- <div
339
- class=${S===null?"stage":V?"stage is-demo":"stage is-maximized"}
340
- data-ui-comment=${P.mode.kind}
341
- popover=${S===null?c:"manual"}
342
- @wheel=${S===null?c:{handleEvent:r.onLiftedWheel,passive:!1}}
343
- >
344
- ${V?qe?c:gr(t,Ke):d`<div class="stage-bar">
345
- ${kr(t,Ot(i,s))}
346
- <div class="stage-tools">
347
- ${I?.kind==="screen"&&I.tabs.length>0?xr(e,l,I):c}
348
- ${ee!==null&&q!==null?qn(t,ee,q):c}
349
- ${v.length>0?vr(t,P):c}
350
- ${v.length===0?c:a?Kn(t,r.onToggleDemo):Xn(t,S!==null,r.onToggleMaximize)}
351
- </div>
352
- </div>`}
353
- ${s.kind==="step"&&s.step.situation!==void 0?Fn(t,s.step.situation):c}
354
- ${V?c:Tn(t,P)}
355
- <div
356
- class="canvas"
357
- data-layout=${w}
358
- data-dpk-target=${At(s,l)}
359
- @click=${{handleEvent:r.canvasEvents.click,capture:!0}}
360
- @pointermove=${{handleEvent:r.canvasEvents.pointermove,capture:!0}}
361
- @pointerleave=${r.canvasEvents.pointerleave}
362
- @wheel=${{handleEvent:r.canvasEvents.wheel,passive:!1}}
363
- @scroll=${{handleEvent:r.canvasEvents.scroll,capture:!0}}
364
- >
365
- ${F!==null?Wn(e,t,{...F,...j===void 0?{}:{preview:j},...qe?{demo:Ke}:{},hasContent:j===void 0||r.hasPreviewContent(j.id),viewport:le,window:Je??{kind:"fill"}}):w==="side-by-side"?d`<div class="panes">
366
- ${h.map(_=>d`<div class="pane" data-viewport=${_.preview.viewport} data-pane=${_.kind}>
367
- ${jn(e,l,_)}
368
- ${Ge(e,t,_.preview,r.hasPreviewContent(_.preview.id))}
369
- </div>`)}
370
- </div>`:v.map(_=>Ge(e,t,_,r.hasPreviewContent(_.id),Je))}
371
- ${v.length===0?d`<p class="dpk-label">${t.noPreviewMetadata}</p>`:c}
372
- ${An(t,P)}
373
- </div>
374
- ${In(P)}
375
- ${$r(i,je.map(_=>_.id))}
376
- </div>
377
- `},Bn=O(oi),Hn=O(ti),Gn={phone:O(ii),tablet:O(ni),desktop:O(ei)},kr=(e,t)=>d`<div class="page-head">
378
- ${t.actor===void 0?c:d`<span class="page-actor" role="note" aria-label=${e.pageActor(t.actor)} title=${t.actor}>
379
- ${Bn()} <span class="page-actor-name">${t.actor}</span>
380
- </span>`}
381
- <h2 class="page-title">${t.title}</h2>
382
- </div>`,Fn=(e,t)=>d`<aside class="situation">
383
- <span class="situation-label">${e.situation}</span>
384
- <p class="situation-text">${t}</p>
385
- </aside>`,xr=(e,t,r)=>d`<div class="tabs" role="tablist">
386
- ${r.tabs.map(i=>{const n=i.id===r.preview.id;return d`<a
387
- class="tab"
388
- role="tab"
389
- data-current=${String(n)}
390
- aria-selected=${n?"true":"false"}
391
- href=${e.hashFor({preview:Ai(t,i.id)})}
392
- >${i.label??i.viewport}</a
393
- >`})}
394
- </div>`,jn=(e,t,r)=>r.kind==="material"?r.preview.label===void 0?c:d`<span class="pane-label" title=${r.preview.label}>${r.preview.label}</span>`:d`<div class="pane-head">
395
- <span class="pane-label" title=${r.screen.screen.title}>${r.screen.screen.title}</span>
396
- ${r.tabs.length>0?xr(e,t,r):c}
397
- </div>`,qn=(e,t,r)=>{const i=Math.round(r.zoom*100);return d`<span class="device-pick" title=${e.deviceHint}>
398
- ${Gn[t.deviceClass]()}
399
- <select
400
- class="device-select"
401
- aria-label=${e.device}
402
- @change=${n=>{n.currentTarget instanceof HTMLSelectElement&&r.onPick(n.currentTarget.value)}}
403
- >
404
- ${ar(t.deviceClass).map(n=>d`<option value=${n.id} ?selected=${n.id===t.id}>
405
- ${gn(e,n)}
406
- </option>`)}
407
- </select>
408
- ${i<100?d`<span class="device-zoom" title=${e.deviceZoom(i)}>${i}%</span>`:c}
409
- </span>`},Kn=(e,t)=>d`<button class="dpk-btn stage-demo" type="button" title=${e.demoHint} @click=${t}>
410
- ${Hn()} ${e.demo}
411
- </button>`,Xn=(e,t,r)=>d`<button
412
- class="dpk-btn stage-maximize"
413
- type="button"
414
- aria-pressed=${t?"true":"false"}
415
- title=${e.maximizeHint}
416
- @click=${r}
417
- >
418
- ${t?d`${Ur()} ${e.restore}`:d`${Wr()} ${e.maximize}`}
419
- </button>`,Ge=(e,t,r,i,n=null)=>d`
420
- <figure
421
- class="frame"
422
- data-kind=${r.kind}
423
- data-viewport=${r.viewport}
424
- data-window=${n?.kind??c}
425
- ?data-empty=${!i}
426
- style=${br(r.kind,r.viewport,n)}
427
- >
428
- ${r.kind==="browser"?d`<div class="chrome">
429
- <span class="dots"><i></i><i></i><i></i></span>
430
- <span class="url">${me(e.state,r)}</span>
431
- </div>`:r.kind==="mail"?Zn(Di(t,r)):c}
432
- <div class="viewport">
433
- ${r.kind==="native"?Jn():c}
434
- <slot name=${`preview:${r.id}`}></slot>
435
- ${i?c:d`<div class="frame-placeholder">
436
- <span class="dpk-label">light dom preview</span>
437
- <code>&lt;div slot="preview" data-preview-id="${r.id}"&gt;</code>
438
- </div>`}
439
- </div>
440
- </figure>
441
- `,Zn=e=>d`<header class="mail-head">
442
- ${e.subject===void 0?c:d`<h3 class="mail-subject">${e.subject}</h3>`}
443
- <div class="mail-envelope">
444
- ${e.initial===void 0?c:d`<span class="mail-avatar" aria-hidden="true">${e.initial}</span>`}
445
- <dl class="mail-meta">
446
- ${e.rows.map(t=>d`<div class="mail-row">
447
- <dt>${t.label}</dt>
448
- <dd>${t.value}</dd>
449
- </div>`)}
450
- </dl>
451
- </div>
452
- </header>`,Jn=()=>d`<div class="status-bar">
453
- <span class="status-time">9:41</span>
454
- <span class="punch-hole" aria-hidden="true"></span>
455
- <svg class="status-wifi" viewBox="0 0 16 12" aria-hidden="true">
456
- <path d="M8 9.2a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z" />
457
- <path
458
- d="M4.7 7.4a4.8 4.8 0 0 1 6.6 0"
459
- fill="none"
460
- stroke="currentColor"
461
- stroke-width="1.5"
462
- stroke-linecap="round"
463
- />
464
- <path
465
- d="M2.1 4.7a8.4 8.4 0 0 1 11.8 0"
466
- fill="none"
467
- stroke="currentColor"
468
- stroke-width="1.5"
469
- stroke-linecap="round"
470
- />
471
- </svg>
472
- </div>`,$r=(e,t)=>{const i=[...W(e).flatMap(n=>n.screen.previews),...B(e).flatMap(n=>X(n.step))].filter(n=>!t.includes(n.id));return i.length===0?d`${c}`:d`<div class="parked" aria-hidden="true">
473
- ${i.map(n=>d`<slot name=${`preview:${n.id}`}></slot>`)}
474
- </div>`},Qn=Br`
475
- :host {
476
- --dpk-prototype-accent: var(--dpk-blue);
477
- }
478
-
479
- /*
480
- * The sidebar and the main column scroll on their own, with the memo pinned
481
- * to the bottom of the main column, only inside a bounded shell. A page that
482
- * gives the host no height would grow the shell to its longest column and
483
- * scroll the whole document, carrying the memo off screen; the viewport
484
- * height is the fallback. A host with a height still wins: the shell's own
485
- * min/max-height pin it to that.
486
- */
487
- .dpk-shell {
488
- height: 100dvh;
489
- }
490
-
491
- /* ---------------------------------------------------------------- sidebar */
492
-
493
- .nav {
494
- display: grid;
495
- gap: 14px;
496
- align-content: start;
497
- min-width: 188px;
498
- }
499
-
500
- .field {
501
- display: grid;
502
- gap: 5px;
503
- }
504
-
505
- /* Scenario or app: a segmented control at the top of the sidebar. */
506
- .view-switch {
507
- display: flex;
508
- gap: 3px;
509
- padding: 3px;
510
- border: 1px solid var(--dpk-rule);
511
- border-radius: var(--dpk-radius);
512
- background: var(--dpk-paper-inset);
513
- box-shadow: inset 0 1px 2px var(--dpk-shade-1);
514
- }
515
-
516
- .view-option {
517
- flex: 1 1 0;
518
- padding: 6px 9px;
519
- border: 1px solid transparent;
520
- border-radius: var(--dpk-radius-sm);
521
- color: var(--dpk-ink-soft);
522
- font-size: 12px;
523
- font-weight: 500;
524
- text-align: center;
525
- text-decoration: none;
526
- transition:
527
- background 140ms var(--dpk-ease),
528
- color 140ms var(--dpk-ease),
529
- box-shadow 140ms var(--dpk-ease);
530
- }
531
-
532
- .view-option:hover {
533
- color: var(--dpk-ink);
534
- }
535
-
536
- .view-option[aria-current='page'] {
537
- background: var(--dpk-paper-raised);
538
- color: var(--dpk-ink);
539
- font-weight: 600;
540
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
541
- }
542
-
543
- .view-option:focus-visible {
544
- outline: none;
545
- box-shadow: var(--dpk-focus);
546
- }
547
-
548
- .app-hint {
549
- margin: -6px 0 0;
550
- font-size: 11.5px;
551
- line-height: 1.55;
552
- color: var(--dpk-ink-faint);
553
- }
554
-
555
- .app-group {
556
- display: grid;
557
- gap: 4px;
558
- }
559
-
560
- .app-group-heading {
561
- margin: 0;
562
- padding-left: 9px;
563
- font-size: 11px;
564
- font-weight: 600;
565
- color: var(--dpk-ink-soft);
566
- }
567
-
568
- .app-description {
569
- margin: 2px 0 0;
570
- font-size: 11.5px;
571
- line-height: 1.5;
572
- color: var(--dpk-ink-faint);
573
- }
574
-
575
- .step-screen {
576
- color: var(--dpk-ink);
577
- font-size: 12.5px;
578
- font-weight: 550;
579
- }
580
-
581
- .screen-description {
582
- font-size: 12.5px;
583
- line-height: 1.6;
584
- color: var(--dpk-ink);
585
- }
586
-
587
- .app-tree {
588
- display: grid;
589
- gap: 4px;
590
- }
591
-
592
- .app-origin {
593
- margin: 0;
594
- padding-left: 9px;
595
- font-family: var(--dpk-mono);
596
- font-size: 10.5px;
597
- font-weight: 500;
598
- color: var(--dpk-ink-faint);
599
- overflow-wrap: anywhere;
600
- }
601
-
602
- .tree {
603
- list-style: none;
604
- margin: 0;
605
- padding: 0;
606
- display: grid;
607
- gap: 2px;
608
- }
609
-
610
- /* A path below another one is indented under it, with a guide line. */
611
- .tree .tree {
612
- margin-left: 14px;
613
- padding-left: 6px;
614
- border-left: 1px solid var(--dpk-rule);
615
- }
616
-
617
- .tree-node {
618
- display: grid;
619
- gap: 2px;
620
- }
621
-
622
- .tree-row {
623
- position: relative;
624
- border-radius: var(--dpk-radius-sm);
625
- transition: background 140ms ease;
626
- }
627
-
628
- .tree-row:has(a):hover {
629
- background: var(--dpk-paper-inset);
630
- }
631
-
632
- .tree-row[data-current='true'] {
633
- background: linear-gradient(
634
- 180deg,
635
- color-mix(in srgb, var(--dpk-prototype-accent) 10%, var(--dpk-paper-raised)),
636
- color-mix(in srgb, var(--dpk-prototype-accent) 5%, var(--dpk-paper-raised))
637
- );
638
- box-shadow:
639
- inset 0 0 0 1px color-mix(in srgb, var(--dpk-prototype-accent) 22%, transparent),
640
- var(--dpk-shadow-xs);
641
- }
642
-
643
- .tree-link {
644
- display: flex;
645
- align-items: baseline;
646
- flex-wrap: wrap;
647
- gap: 2px 8px;
648
- padding: 6px 4px 6px 9px;
649
- text-decoration: none;
650
- color: var(--dpk-ink-soft);
651
- font-size: 12.5px;
652
- }
653
-
654
- .tree-path {
655
- font-family: var(--dpk-mono);
656
- font-size: 11.5px;
657
- color: var(--dpk-ink);
658
- overflow-wrap: anywhere;
659
- }
660
-
661
- span.tree-link .tree-path {
662
- color: var(--dpk-ink-faint);
663
- }
664
-
665
- .tree-title {
666
- min-width: 0;
667
- color: var(--dpk-ink-soft);
668
- }
669
-
670
- .tree-row[data-current='true'] .tree-path,
671
- .tree-row[data-current='true'] .tree-title {
672
- color: var(--dpk-ink);
673
- font-weight: 550;
674
- }
675
-
676
- .tree-link .step-note {
677
- align-self: center;
678
- }
679
-
680
- .tree-link:focus-visible {
681
- outline: none;
682
- border-radius: var(--dpk-radius-sm);
683
- box-shadow: var(--dpk-focus);
684
- }
685
-
686
- .steps.app-screens {
687
- max-height: none;
688
- }
689
-
690
- .steps-head {
691
- display: flex;
692
- align-items: baseline;
693
- justify-content: space-between;
694
- padding-bottom: 5px;
695
- border-bottom: 1px solid var(--dpk-rule);
696
- }
697
-
698
- .steps {
699
- list-style: none;
700
- margin: 0;
701
- padding: 0;
702
- display: grid;
703
- /* A row is no wider than the list: a long step name ends in an ellipsis. */
704
- grid-template-columns: minmax(0, 1fr);
705
- gap: 2px;
706
- max-height: 38vh;
707
- overflow: auto;
708
- }
709
-
710
- .step-row {
711
- position: relative;
712
- display: flex;
713
- align-items: center;
714
- gap: 4px;
715
- padding: 0 4px 0 9px;
716
- border-radius: var(--dpk-radius-sm);
717
- transition:
718
- background 140ms ease,
719
- box-shadow 140ms ease;
720
- }
721
-
722
- .step-row:hover {
723
- background: var(--dpk-paper-inset);
724
- }
725
-
726
- .step-row[data-current='true'] {
727
- background: linear-gradient(
728
- 180deg,
729
- color-mix(in srgb, var(--dpk-prototype-accent) 10%, var(--dpk-paper-raised)),
730
- color-mix(in srgb, var(--dpk-prototype-accent) 5%, var(--dpk-paper-raised))
731
- );
732
- box-shadow:
733
- inset 0 0 0 1px color-mix(in srgb, var(--dpk-prototype-accent) 22%, transparent),
734
- var(--dpk-shadow-xs);
735
- }
736
-
737
- .step-row[data-current='true']::before {
738
- content: '';
739
- position: absolute;
740
- left: 0;
741
- top: 8px;
742
- bottom: 8px;
743
- width: 3px;
744
- border-radius: var(--dpk-radius-xs);
745
- background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
746
- box-shadow: 0 0 8px color-mix(in srgb, var(--dpk-prototype-accent) 45%, transparent);
747
- }
748
-
749
- .step-link {
750
- display: flex;
751
- flex: 1;
752
- min-width: 0;
753
- align-items: center;
754
- gap: 7px;
755
- padding: 7px 0;
756
- text-decoration: none;
757
- color: var(--dpk-ink-soft);
758
- font-size: 12.5px;
759
- font-weight: 460;
760
- }
761
-
762
- .step-row[data-current='true'] .step-link {
763
- color: var(--dpk-ink);
764
- font-weight: 550;
765
- }
766
-
767
- .step-index {
768
- flex: 0 0 auto;
769
- min-width: 17px;
770
- padding: 1px 4px;
771
- border-radius: var(--dpk-radius-xs);
772
- background: var(--dpk-paper-inset);
773
- font-family: var(--dpk-mono);
774
- font-size: 9.5px;
775
- font-variant-numeric: tabular-nums;
776
- text-align: center;
777
- color: var(--dpk-ink-faint);
778
- transition:
779
- background 140ms ease,
780
- color 140ms ease;
781
- }
782
-
783
- .step-row[data-current='true'] .step-index {
784
- background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
785
- color: #fff;
786
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
787
- }
788
-
789
- .step-name {
790
- min-width: 0;
791
- overflow: hidden;
792
- white-space: nowrap;
793
- text-overflow: ellipsis;
794
- }
795
-
796
- .step-note {
797
- margin-left: auto;
798
- min-width: 16px;
799
- padding: 1px 5px;
800
- border-radius: 999px;
801
- background: var(--dpk-accent);
802
- color: var(--dpk-accent-ink);
803
- font-family: var(--dpk-mono);
804
- font-size: 9px;
805
- font-variant-numeric: tabular-nums;
806
- text-align: center;
807
- }
808
-
809
- .row-tools {
810
- display: flex;
811
- gap: 0;
812
- opacity: 0;
813
- transition: opacity 120ms ease;
814
- }
815
-
816
- .step-row:hover .row-tools,
817
- .step-row[data-current='true'] .row-tools {
818
- opacity: 1;
819
- }
820
-
821
- .detail {
822
- display: grid;
823
- /* As wide as the panel, not as a description's widest table or code line: those scroll. */
824
- grid-template-columns: minmax(0, 1fr);
825
- gap: 12px;
826
- padding: 12px 12px 14px;
827
- border: 1px solid var(--dpk-rule);
828
- border-radius: var(--dpk-radius);
829
- background: var(--dpk-paper-raised);
830
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
831
- }
832
-
833
- .detail-row {
834
- display: grid;
835
- grid-template-columns: minmax(0, 1fr);
836
- gap: 4px;
837
- }
838
-
839
- .detail-value {
840
- font-size: 12.5px;
841
- color: var(--dpk-ink-soft);
842
- }
843
-
844
- .nav-empty {
845
- font-size: 12px;
846
- line-height: 1.6;
847
- color: var(--dpk-ink-faint);
848
- }
849
-
850
- /* ------------------------------------------------------------------ stage */
851
-
852
- .stage {
853
- display: grid;
854
- /* One column no wider than the main area: a wide row of panes scrolls inside the canvas. */
855
- grid-template-columns: minmax(0, 1fr);
856
- gap: 14px;
857
- width: 100%;
858
- min-width: 0;
859
- }
860
-
861
- /* A tighter top than the shell's leaves the preview more of the main column. */
862
- .dpk-main-body {
863
- padding-top: 12px;
864
- }
865
-
866
- .stage-bar {
867
- display: flex;
868
- align-items: center;
869
- justify-content: space-between;
870
- gap: 10px 16px;
871
- min-width: 0;
872
- flex-wrap: wrap;
873
- }
874
-
875
- /*
876
- * The page head and its tools stick to the top of the main column, so they
877
- * stay in reach while a tall preview scrolls under them; the situation and
878
- * the canvas scroll on. The bar spans the column edge to edge (cancelling
879
- * the body's padding) on a frosted ground the content passes beneath. Above
880
- * the UI-comment layer, below the memo, which opens over everything.
881
- */
882
- .stage:not(.is-maximized) > .stage-bar {
883
- position: sticky;
884
- top: 0;
885
- z-index: 5;
886
- margin: -12px -24px 0;
887
- padding: 10px 24px;
888
- border-bottom: 1px solid var(--dpk-rule);
889
- background: color-mix(in srgb, var(--dpk-paper-raised) 92%, transparent);
890
- backdrop-filter: saturate(1.6) blur(14px);
891
- }
892
-
893
- /* ------------------------------------------------------------- page head */
894
-
895
- .page-head {
896
- display: flex;
897
- align-items: center;
898
- gap: 12px;
899
- min-width: 0;
900
- animation: dpk-page-head-in 260ms var(--dpk-ease) backwards;
901
- }
902
-
903
- @keyframes dpk-page-head-in {
904
- from {
905
- opacity: 0;
906
- transform: translateY(4px);
907
- }
908
- }
909
-
910
- .page-actor {
911
- display: inline-flex;
912
- /* A long role name gives way to the title first, down to a recognizable stub. */
913
- flex: 0 1000 auto;
914
- min-width: 72px;
915
- align-items: center;
916
- gap: 6px;
917
- height: 26px;
918
- padding: 0 11px 0 8px;
919
- border-radius: 999px;
920
- background: linear-gradient(
921
- 180deg,
922
- color-mix(in srgb, var(--dpk-blue) 16%, var(--dpk-paper-raised)),
923
- color-mix(in srgb, var(--dpk-blue) 9%, var(--dpk-paper-raised))
924
- );
925
- box-shadow:
926
- var(--dpk-bevel),
927
- inset 0 0 0 1px color-mix(in srgb, var(--dpk-blue) 32%, transparent),
928
- var(--dpk-shadow-xs);
929
- color: var(--dpk-blue);
930
- font-size: 12px;
931
- font-weight: 650;
932
- letter-spacing: 0.01em;
933
- white-space: nowrap;
934
- max-width: 280px;
935
- }
936
-
937
- .page-actor-name {
938
- min-width: 0;
939
- overflow: hidden;
940
- text-overflow: ellipsis;
941
- }
942
-
943
- .page-actor svg {
944
- flex: none;
945
- width: 13px;
946
- height: 13px;
947
- opacity: 0.9;
948
- }
949
-
950
- .page-title {
951
- margin: 0;
952
- min-width: 0;
953
- overflow: hidden;
954
- font-size: 19px;
955
- font-weight: 700;
956
- line-height: 1.3;
957
- letter-spacing: -0.02em;
958
- color: var(--dpk-ink);
959
- text-overflow: ellipsis;
960
- white-space: nowrap;
961
- }
962
-
963
- /* Wraps on a phone rather than pushing the last tools off the screen. */
964
- .stage-tools {
965
- display: flex;
966
- flex-wrap: wrap;
967
- justify-content: flex-end;
968
- align-items: center;
969
- gap: 8px;
970
- min-width: 0;
971
- margin-left: auto;
972
- }
973
-
974
- .stage-maximize svg,
975
- .stage-demo svg {
976
- width: 13px;
977
- height: 13px;
978
- }
979
-
980
- .stage-demo {
981
- display: inline-flex;
982
- align-items: center;
983
- gap: 6px;
984
- }
985
-
986
- /* The app view's device: a pill like the rendition tabs, with the zoom it is drawn at. */
987
- .device-pick {
988
- position: relative;
989
- display: inline-flex;
990
- align-items: center;
991
- gap: 6px;
992
- height: 32px;
993
- padding: 0 6px 0 10px;
994
- box-sizing: border-box;
995
- border: 1px solid var(--dpk-rule);
996
- border-radius: 999px;
997
- background: var(--dpk-paper-sunken);
998
- box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
999
- color: var(--dpk-ink-soft);
1000
- }
1001
-
1002
- .device-pick:focus-within {
1003
- box-shadow: var(--dpk-focus);
1004
- }
1005
-
1006
- .device-pick svg {
1007
- flex: none;
1008
- width: 14px;
1009
- height: 14px;
1010
- }
1011
-
1012
- .device-select {
1013
- min-width: 0;
1014
- padding: 0 18px 0 0;
1015
- border: 0;
1016
- outline: none;
1017
- background: transparent
1018
- url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23878e9e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>")
1019
- no-repeat right 2px center;
1020
- appearance: none;
1021
- /* As wide as the device shown, not the longest name in the list. */
1022
- field-sizing: content;
1023
- color: var(--dpk-ink);
1024
- font: 600 12px/1 var(--dpk-body);
1025
- cursor: pointer;
1026
- }
1027
-
1028
- .device-zoom {
1029
- padding: 3px 7px;
1030
- border-radius: 999px;
1031
- background: var(--dpk-paper-raised);
1032
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
1033
- font: 600 10.5px/1 var(--dpk-mono);
1034
- font-variant-numeric: tabular-nums;
1035
- color: var(--dpk-ink-soft);
1036
- }
1037
-
1038
- .tabs {
1039
- display: inline-flex;
1040
- gap: 2px;
1041
- padding: 3px;
1042
- border: 1px solid var(--dpk-rule);
1043
- border-radius: 999px;
1044
- background: var(--dpk-paper-sunken);
1045
- box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
1046
- }
1047
-
1048
- .tab {
1049
- padding: 4px 14px;
1050
- border-radius: 999px;
1051
- font-size: 12px;
1052
- font-weight: 500;
1053
- text-decoration: none;
1054
- color: var(--dpk-ink-soft);
1055
- white-space: nowrap;
1056
- transition:
1057
- background 120ms ease,
1058
- color 120ms ease;
1059
- }
1060
-
1061
- .tab:hover {
1062
- color: var(--dpk-ink);
1063
- background: var(--dpk-paper-raised);
1064
- }
1065
-
1066
- .tab[data-current='true'] {
1067
- background: var(--dpk-paper-raised);
1068
- color: var(--dpk-ink);
1069
- font-weight: 600;
1070
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
1071
- }
1072
-
1073
- .stage-empty {
1074
- max-width: 62ch;
1075
- padding: 16px 18px;
1076
- border: 1px dashed var(--dpk-rule-strong);
1077
- border-radius: var(--dpk-radius-lg);
1078
- background: var(--dpk-paper-sunken);
1079
- font-size: 13px;
1080
- line-height: 1.7;
1081
- color: var(--dpk-ink-soft);
1082
- }
1083
-
1084
- /* A story that has no steps yet: its heading, what it is for, and why no frame. */
1085
- .stage-story {
1086
- display: grid;
1087
- gap: 12px;
1088
- justify-items: start;
1089
- }
1090
-
1091
- .story-description {
1092
- max-width: 62ch;
1093
- margin: 0;
1094
- font-size: 14px;
1095
- line-height: 1.7;
1096
- color: var(--dpk-ink);
1097
- }
1098
-
1099
- /* -------------------------------------------------------------- situation */
1100
-
1101
- /*
1102
- * What is going on around the previews: a stage direction, read before them.
1103
- * The band spans the stage at any width (a maximized stage too); only the
1104
- * text keeps a readable line length.
1105
- */
1106
- .situation {
1107
- display: flex;
1108
- align-items: baseline;
1109
- gap: 10px;
1110
- margin: -4px 0 -2px;
1111
- padding: 8px 14px 8px 10px;
1112
- border: 1px solid color-mix(in srgb, var(--dpk-prototype-accent) 16%, var(--dpk-rule));
1113
- border-radius: var(--dpk-radius);
1114
- background: color-mix(in srgb, var(--dpk-prototype-accent) 5%, var(--dpk-paper-raised));
1115
- box-shadow: var(--dpk-bevel);
1116
- }
1117
-
1118
- .situation-label {
1119
- flex: none;
1120
- padding: 2px 8px;
1121
- border-radius: 999px;
1122
- background: color-mix(in srgb, var(--dpk-prototype-accent) 13%, transparent);
1123
- font-size: 10.5px;
1124
- font-weight: 650;
1125
- letter-spacing: 0.06em;
1126
- color: var(--dpk-prototype-accent);
1127
- }
1128
-
1129
- .situation-text {
1130
- max-width: 90ch;
1131
- margin: 0;
1132
- min-width: 0;
1133
- font-size: 13px;
1134
- line-height: 1.65;
1135
- color: var(--dpk-ink);
1136
- white-space: pre-line;
1137
- overflow-wrap: anywhere;
1138
- }
1139
-
1140
- /* ----------------------------------------------------------------- canvas */
1141
-
1142
- /*
1143
- * The work surface the frame sits on: a quiet dot lattice that reads as a
1144
- * canvas rather than empty page background, giving the frame somewhere to
1145
- * cast its shadow.
1146
- */
1147
- .canvas {
1148
- display: flex;
1149
- justify-content: center;
1150
- padding: 30px;
1151
- border: 1px solid var(--dpk-rule);
1152
- border-radius: var(--dpk-radius-xl);
1153
- background: var(--dpk-dots), var(--dpk-paper-sunken);
1154
- box-shadow: inset 0 1px 3px var(--dpk-shade-1);
1155
- }
1156
-
1157
- /* ---------------------------------------------------------- comment on UI */
1158
-
1159
- .ui-comment-toggle svg,
1160
- .ui-comment-hint svg {
1161
- width: 14px;
1162
- height: 14px;
1163
- }
1164
-
1165
- .ui-comment-toggle {
1166
- display: inline-flex;
1167
- align-items: center;
1168
- gap: 6px;
1169
- }
1170
-
1171
- .ui-comment-hint {
1172
- display: flex;
1173
- align-items: center;
1174
- gap: 8px;
1175
- margin: -4px 0 -2px;
1176
- padding: 7px 12px;
1177
- border-radius: var(--dpk-radius);
1178
- background: var(--dpk-accent-soft);
1179
- color: var(--dpk-accent-strong, var(--dpk-accent));
1180
- font-size: 12.5px;
1181
- font-weight: 550;
1182
- }
1183
-
1184
- .canvas {
1185
- position: relative;
1186
- }
1187
-
1188
- .stage:not([data-ui-comment='off']) .canvas ::slotted(*) {
1189
- cursor: crosshair;
1190
- }
1191
-
1192
- /* Sized to the canvas's scroll area by the element; the boxes and pins show through. */
1193
- .ui-catcher {
1194
- position: absolute;
1195
- top: 0;
1196
- left: 0;
1197
- z-index: 4;
1198
- cursor: crosshair;
1199
- }
1200
-
1201
- /* Positioned against the canvas by the element, which measures the author's markup. */
1202
- .ui-layer {
1203
- display: contents;
1204
- }
1205
-
1206
- .ui-box {
1207
- position: absolute;
1208
- z-index: 2;
1209
- box-sizing: border-box;
1210
- border-radius: 4px;
1211
- pointer-events: none;
1212
- }
1213
-
1214
- .ui-hover {
1215
- outline: 2px solid var(--dpk-accent);
1216
- outline-offset: 1px;
1217
- background: color-mix(in srgb, var(--dpk-accent) 8%, transparent);
1218
- }
1219
-
1220
- .ui-picked {
1221
- outline: 2px solid var(--dpk-accent);
1222
- outline-offset: 2px;
1223
- background: color-mix(in srgb, var(--dpk-accent) 14%, transparent);
1224
- box-shadow: 0 0 0 6px color-mix(in srgb, var(--dpk-accent) 18%, transparent);
1225
- }
1226
-
1227
- .ui-pin {
1228
- position: absolute;
1229
- z-index: 3;
1230
- display: grid;
1231
- place-items: center;
1232
- min-width: 20px;
1233
- height: 20px;
1234
- padding: 0 5px;
1235
- box-sizing: border-box;
1236
- transform: translate(-50%, -50%);
1237
- border: 2px solid var(--dpk-paper-raised);
1238
- border-radius: 999px 999px 999px 2px;
1239
- background: var(--dpk-accent);
1240
- color: var(--dpk-accent-ink);
1241
- box-shadow: var(--dpk-shadow-sm);
1242
- font-family: var(--dpk-mono);
1243
- font-size: 10px;
1244
- font-weight: 700;
1245
- pointer-events: none;
1246
- }
1247
-
1248
- .ui-box[hidden],
1249
- .ui-pin[hidden] {
1250
- display: none;
1251
- }
1252
-
1253
- /*
1254
- * Side by side: what the user sees together, in one row. A fixed viewport
1255
- * keeps its width as long as the row allows it, a fluid one takes the rest;
1256
- * a row wider than the canvas scrolls sideways instead of squeezing a device.
1257
- */
1258
- .panes {
1259
- display: flex;
1260
- align-items: flex-start;
1261
- justify-content: safe center;
1262
- gap: 28px;
1263
- width: 100%;
1264
- min-width: 0;
1265
- overflow-x: auto;
1266
- padding-bottom: 4px;
1267
- }
1268
-
1269
- /*
1270
- * A row wider than the stage fades out at the edge it scrolls toward, so the
1271
- * panes past it read as a scroll away rather than cut off. The scroll timeline
1272
- * is inactive while the row fits, which leaves it unmasked.
1273
- */
1274
- @supports (animation-timeline: scroll()) {
1275
- .panes {
1276
- animation: panes-edge linear both;
1277
- animation-timeline: scroll(self inline);
1278
- }
1279
-
1280
- @keyframes panes-edge {
1281
- 0% {
1282
- mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
1283
- }
1284
- 2%,
1285
- 98% {
1286
- mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
1287
- }
1288
- 100% {
1289
- mask-image: linear-gradient(90deg, transparent, #000 40px);
1290
- }
1291
- }
1292
- }
1293
-
1294
- /* A device shrinks at most to a width its layout still reads at, then the row scrolls. */
1295
- .pane {
1296
- display: grid;
1297
- /* The pane's width is the device's: a long label never widens it. */
1298
- grid-template-columns: minmax(0, 1fr);
1299
- gap: 8px;
1300
- flex: 0 1 var(--pane-width);
1301
- min-width: min(var(--pane-width), 720px);
1302
- }
1303
-
1304
- .pane[data-viewport='mobile'] {
1305
- --pane-width: 390px;
1306
- }
1307
-
1308
- .pane[data-viewport='tablet'] {
1309
- --pane-width: 834px;
1310
- }
1311
-
1312
- .pane[data-viewport='desktop'] {
1313
- --pane-width: 1180px;
1314
- }
1315
-
1316
- .pane[data-viewport='fluid'] {
1317
- flex: 1 1 0;
1318
- min-width: 240px;
1319
- }
1320
-
1321
- .pane .frame {
1322
- width: 100%;
1323
- }
1324
-
1325
- .pane-head {
1326
- display: flex;
1327
- flex-wrap: wrap;
1328
- align-items: center;
1329
- justify-content: space-between;
1330
- gap: 8px;
1331
- }
1332
-
1333
- .pane-head .tabs {
1334
- padding: 2px;
1335
- }
1336
-
1337
- .pane-head .tab {
1338
- padding: 3px 11px;
1339
- font-size: 11.5px;
1340
- }
1341
-
1342
- /* One line over the pane; hovering names the whole label. */
1343
- .pane-label {
1344
- justify-self: start;
1345
- min-width: 0;
1346
- max-width: 100%;
1347
- overflow: hidden;
1348
- text-overflow: ellipsis;
1349
- white-space: nowrap;
1350
- padding: 2px 9px;
1351
- border-radius: 999px;
1352
- background: var(--dpk-paper-raised);
1353
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
1354
- font-size: 11.5px;
1355
- font-weight: 600;
1356
- color: var(--dpk-ink-soft);
1357
- }
1358
-
1359
- /*
1360
- * Maximized: the stage covers the tab — the page head, the tabs and the canvas
1361
- * alone. It is also a manual popover in the top layer, so the UA popover box
1362
- * (fit-content, margin, border, padding, colors) is reset here. The canvas
1363
- * scrolls instead of the page, and a browser preview is at least as tall as
1364
- * the tab allows; a phone keeps its device shape. Whatever sits above the
1365
- * canvas (the situation, the comment-on-UI hint) keeps its own height, and the
1366
- * canvas takes the rest.
1367
- */
1368
- .stage.is-maximized {
1369
- position: fixed;
1370
- inset: 0;
1371
- z-index: 2147483000;
1372
- display: flex;
1373
- flex-direction: column;
1374
- width: auto;
1375
- height: auto;
1376
- max-width: none;
1377
- max-height: none;
1378
- margin: 0;
1379
- padding: 16px 20px 20px;
1380
- border: 0;
1381
- color: var(--dpk-ink);
1382
- background: var(--dpk-paper);
1383
- overflow: hidden;
1384
- }
1385
-
1386
- .stage.is-maximized > * {
1387
- flex: none;
1388
- }
1389
-
1390
- .canvas:has(> .frame[data-window='device']) {
1391
- align-items: flex-start;
1392
- /* A device wider than the stage is drawn smaller to fit it, so it never widens the page. */
1393
- min-width: 0;
1394
- contain: inline-size;
1395
- }
1396
-
1397
- .stage.is-maximized > .canvas {
1398
- flex: 1 1 0;
1399
- min-height: 0;
1400
- align-items: flex-start;
1401
- overflow: auto;
1402
- overscroll-behavior: contain;
1403
- }
1404
-
1405
- .stage.is-maximized .frame:not([data-kind='native'], [data-kind='plain']) {
1406
- display: flex;
1407
- flex-direction: column;
1408
- min-height: 100%;
1409
- }
1410
-
1411
- .stage.is-maximized .frame:not([data-kind='native'], [data-kind='plain']) .viewport {
1412
- flex: 1 0 auto;
1413
- }
1414
-
1415
- /*
1416
- * Demo: the app view's browser alone across the tab, as if the reader were
1417
- * using the app — no title, no tools, no canvas around it. The browser fills
1418
- * the tab and its page scrolls inside the viewport; a phone stays phone wide.
1419
- */
1420
- .stage.is-demo {
1421
- position: fixed;
1422
- inset: 0;
1423
- z-index: 2147483000;
1424
- display: flex;
1425
- flex-direction: column;
1426
- width: auto;
1427
- height: auto;
1428
- max-width: none;
1429
- max-height: none;
1430
- margin: 0;
1431
- padding: 0;
1432
- border: 0;
1433
- color: var(--dpk-ink);
1434
- background: var(--dpk-paper-sunken);
1435
- overflow: hidden;
1436
- }
1437
-
1438
- .stage.is-demo > .canvas {
1439
- flex: 1 1 0;
1440
- min-height: 0;
1441
- padding: 0;
1442
- border: 0;
1443
- border-radius: 0;
1444
- background: var(--dpk-dots), var(--dpk-paper-sunken);
1445
- box-shadow: none;
1446
- overflow: auto;
1447
- overscroll-behavior: contain;
1448
- }
1449
-
1450
- .stage.is-demo .frame[data-window='fill'] {
1451
- width: 100%;
1452
- height: 100%;
1453
- border: 0;
1454
- border-radius: 0;
1455
- box-shadow: none;
1456
- }
1457
-
1458
- /* A device keeps its size, in the middle of the tab (the element leaves 24px around it). */
1459
- .stage.is-demo > .canvas > .frame[data-window='device'] {
1460
- margin: auto;
1461
- }
1462
-
1463
- .stage.is-demo > .canvas > .frame:not([data-window]) {
1464
- margin: 24px auto;
1465
- }
1466
-
1467
- /*
1468
- * The demo's controls (commenting on the UI, the way out). Over a phone or a
1469
- * frame outside the browser, they float at the top right.
1470
- */
1471
- .demo-controls {
1472
- position: absolute;
1473
- top: 12px;
1474
- right: 16px;
1475
- z-index: 3;
1476
- display: flex;
1477
- align-items: center;
1478
- gap: 6px;
1479
- }
1480
-
1481
- .demo-control {
1482
- display: inline-flex;
1483
- align-items: center;
1484
- gap: 6px;
1485
- height: 30px;
1486
- padding: 0 10px;
1487
- border: 1px solid var(--dpk-rule-strong);
1488
- border-radius: 999px;
1489
- background: color-mix(in srgb, var(--dpk-paper-raised) 82%, transparent);
1490
- backdrop-filter: blur(10px);
1491
- box-shadow: var(--dpk-shadow);
1492
- color: var(--dpk-ink-soft);
1493
- font: 600 12px/1 var(--dpk-body);
1494
- cursor: pointer;
1495
- opacity: 0.55;
1496
- transition:
1497
- opacity 160ms var(--dpk-ease),
1498
- color 160ms var(--dpk-ease);
1499
- }
1500
-
1501
- .demo-exit {
1502
- padding-right: 8px;
1503
- }
1504
-
1505
- .demo-control:hover,
1506
- .demo-control:focus-visible {
1507
- opacity: 1;
1508
- color: var(--dpk-ink);
1509
- }
1510
-
1511
- .demo-control:focus-visible {
1512
- outline: none;
1513
- box-shadow: var(--dpk-focus), var(--dpk-shadow);
1514
- }
1515
-
1516
- /* Commenting stays in sight: a click on the app now picks an element instead of using it. */
1517
- .demo-control[aria-pressed='true'] {
1518
- opacity: 1;
1519
- border-color: var(--dpk-accent-strong);
1520
- background: var(--dpk-accent);
1521
- color: var(--dpk-accent-ink);
1522
- }
1523
-
1524
- .demo-control svg {
1525
- width: 12px;
1526
- height: 12px;
1527
- }
1528
-
1529
- /* A desktop browser has them at the free end of the tab strip, like window controls. */
1530
- .browser-tabs .demo-controls {
1531
- position: static;
1532
- flex: none;
1533
- align-self: center;
1534
- margin: 0 0 3px auto;
1535
- }
1536
-
1537
- .browser-tabs .demo-control {
1538
- height: 26px;
1539
- }
1540
-
1541
- .browser-tabs .demo-control:not([aria-pressed='true']) {
1542
- opacity: 0.85;
1543
- }
1544
-
1545
- .demo-exit kbd {
1546
- padding: 2px 5px;
1547
- border: 1px solid var(--dpk-rule-strong);
1548
- border-radius: var(--dpk-radius-xs);
1549
- background: var(--dpk-paper-sunken);
1550
- font: 600 10px/1 var(--dpk-mono);
1551
- }
1552
-
1553
- /* ------------------------------------------------------------------ frame */
1554
-
1555
- .frame {
1556
- width: min(var(--frame-width), 100%);
1557
- max-width: 100%;
1558
- margin: 0;
1559
- border: 1px solid var(--dpk-rule);
1560
- border-radius: var(--dpk-radius-lg);
1561
- background: var(--dpk-paper-raised);
1562
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
1563
- overflow: hidden;
1564
- /* However high the mock stacks its own layers, they stay under what the stage draws over the frame. */
1565
- isolation: isolate;
1566
- transition: box-shadow 200ms var(--dpk-ease);
1567
- }
1568
-
1569
- .chrome {
1570
- display: flex;
1571
- align-items: center;
1572
- gap: 8px;
1573
- padding: 8px 14px;
1574
- background: linear-gradient(
1575
- 180deg,
1576
- color-mix(in srgb, var(--dpk-paper-raised) 88%, transparent),
1577
- color-mix(in srgb, var(--dpk-paper-inset) 88%, transparent)
1578
- );
1579
- backdrop-filter: blur(10px);
1580
- border-bottom: 1px solid var(--dpk-rule);
1581
- box-shadow: inset 0 1px 0 var(--dpk-highlight);
1582
- }
1583
-
1584
- .dots {
1585
- display: inline-flex;
1586
- gap: 5px;
1587
- }
1588
-
1589
- .dots i {
1590
- width: 10px;
1591
- height: 10px;
1592
- border-radius: 50%;
1593
- background: var(--dpk-rule-strong);
1594
- }
1595
-
1596
- .dots i:nth-child(1) {
1597
- background: #ff5f57;
1598
- }
1599
-
1600
- .dots i:nth-child(2) {
1601
- background: #febc2e;
1602
- }
1603
-
1604
- .dots i:nth-child(3) {
1605
- background: #28c840;
1606
- }
1607
-
1608
- .chrome .url {
1609
- flex: 1;
1610
- min-width: 0;
1611
- padding: 4px 14px;
1612
- border: 1px solid var(--dpk-rule);
1613
- border-radius: var(--dpk-radius-sm);
1614
- background: var(--dpk-paper-raised);
1615
- box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
1616
- font-family: var(--dpk-mono);
1617
- font-size: 10.5px;
1618
- color: var(--dpk-ink-faint);
1619
- overflow: hidden;
1620
- white-space: nowrap;
1621
- text-overflow: ellipsis;
1622
- }
1623
-
1624
- /*
1625
- * Native previews are recognised by their device shape: a slim bezel, a status
1626
- * bar with a punch-hole camera, and a home indicator. No address bar.
1627
- */
1628
- .frame[data-kind='native'] {
1629
- padding: 10px;
1630
- border-color: #22262e;
1631
- border-radius: 28px;
1632
- background: linear-gradient(160deg, #2e3440, #1a1d24);
1633
- box-shadow:
1634
- var(--dpk-shadow-lg),
1635
- inset 0 1px 0 rgba(255, 255, 255, 0.06);
1636
- }
1637
-
1638
- .frame[data-kind='native'] .viewport {
1639
- overflow: hidden;
1640
- border-radius: 18px;
1641
- }
1642
-
1643
- /* A phone is portrait: derive the screen height from its width (~1:2.05)
1644
- instead of reusing the browser preview heights. */
1645
- .frame[data-kind='native'][data-viewport='mobile'] .viewport {
1646
- min-height: calc((var(--frame-width, 390px) - 16px) * 2.05);
1647
- }
1648
-
1649
- /*
1650
- * A mail preview reads as one opened message in a mail client: the subject,
1651
- * the sender's avatar and the envelope rows, then the body (the light DOM).
1652
- */
1653
- .mail-head {
1654
- display: grid;
1655
- gap: 12px;
1656
- padding: 18px 22px 14px;
1657
- border-bottom: 1px solid #e3e6ec;
1658
- background: #fff;
1659
- color: #1f2430;
1660
- color-scheme: light;
1661
- }
1662
-
1663
- .mail-subject {
1664
- margin: 0;
1665
- font-size: 18px;
1666
- font-weight: 650;
1667
- line-height: 1.35;
1668
- letter-spacing: -0.01em;
1669
- }
1670
-
1671
- .mail-envelope {
1672
- display: flex;
1673
- align-items: flex-start;
1674
- gap: 12px;
1675
- min-width: 0;
1676
- }
1677
-
1678
- .mail-avatar {
1679
- display: inline-grid;
1680
- flex: none;
1681
- place-items: center;
1682
- width: 34px;
1683
- height: 34px;
1684
- border-radius: 50%;
1685
- background: linear-gradient(160deg, #6b8af5, #3f5fd8);
1686
- color: #fff;
1687
- font-size: 14px;
1688
- font-weight: 650;
1689
- }
1690
-
1691
- .mail-meta {
1692
- display: grid;
1693
- gap: 2px;
1694
- min-width: 0;
1695
- margin: 0;
1696
- font-size: 12px;
1697
- line-height: 1.5;
1698
- }
1699
-
1700
- .mail-row {
1701
- display: flex;
1702
- gap: 8px;
1703
- min-width: 0;
1704
- }
1705
-
1706
- .mail-row dt {
1707
- flex: none;
1708
- min-width: 3.5em;
1709
- color: #7a8294;
1710
- }
1711
-
1712
- .mail-row dd {
1713
- min-width: 0;
1714
- margin: 0;
1715
- overflow-wrap: anywhere;
1716
- color: #1f2430;
1717
- }
1718
-
1719
- .mail-row:first-child dd {
1720
- font-weight: 600;
1721
- }
1722
-
1723
- /*
1724
- * A plain preview is not a screen: no chrome, no bezel, no frame of its own.
1725
- * The light DOM draws the whole object (a memo, a FAX, a paper form) and the
1726
- * canvas is its desk, so it is as tall as its content.
1727
- */
1728
- .frame[data-kind='plain'] {
1729
- border: none;
1730
- border-radius: 0;
1731
- background: transparent;
1732
- box-shadow: none;
1733
- overflow: visible;
1734
- }
1735
-
1736
- .frame[data-kind='plain'] .viewport {
1737
- min-height: 0;
1738
- background: transparent;
1739
- }
1740
-
1741
- .frame[data-kind='plain'][data-empty] .viewport {
1742
- min-height: 180px;
1743
- }
1744
-
1745
- .status-bar {
1746
- position: relative;
1747
- display: flex;
1748
- flex: 0 0 auto;
1749
- align-items: center;
1750
- justify-content: space-between;
1751
- height: 30px;
1752
- padding: 0 12px;
1753
- background: #0c0e13;
1754
- color: #e9edf4;
1755
- font-size: 11.5px;
1756
- font-weight: 550;
1757
- font-variant-numeric: tabular-nums;
1758
- }
1759
-
1760
- .status-time {
1761
- letter-spacing: 0.02em;
1762
- }
1763
-
1764
- .punch-hole {
1765
- position: absolute;
1766
- top: 50%;
1767
- left: 50%;
1768
- width: 10px;
1769
- height: 10px;
1770
- transform: translate(-50%, -50%);
1771
- border-radius: 50%;
1772
- background: #04060a;
1773
- box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
1774
- }
1775
-
1776
- .status-wifi {
1777
- width: 15px;
1778
- height: 12px;
1779
- fill: currentColor;
1780
- color: #e9edf4;
1781
- }
1782
-
1783
- /* Home indicator. */
1784
- .frame[data-kind='native'] .viewport::after {
1785
- content: '';
1786
- position: absolute;
1787
- bottom: 8px;
1788
- left: 50%;
1789
- width: 88px;
1790
- height: 4px;
1791
- transform: translateX(-50%);
1792
- border-radius: 999px;
1793
- background: rgba(138, 146, 160, 0.55);
1794
- }
1795
-
1796
- /*
1797
- * The preview is never scrolled on its own: it shows everything it contains and
1798
- * the page scrolls as a whole. The flex column keeps a short mock filling
1799
- * the frame's minimum height without pinning a maximum.
1800
- */
1801
- .viewport {
1802
- position: relative;
1803
- contain: layout;
1804
- display: flex;
1805
- flex-direction: column;
1806
- width: 100%;
1807
- min-height: var(--frame-min-height, 480px);
1808
- /* A preview is the product's screen, not the kit's chrome: it stays light in a dark theme. */
1809
- color-scheme: light;
1810
- background: #fff;
1811
- /* …and so does its ink: the kit's dark-theme text color would be invisible on it. */
1812
- color: #1f2430;
1813
- }
1814
-
1815
- /*
1816
- * The author's wrapper becomes the frame's filling layer: a one-cell grid makes
1817
- * its height definite, so a mock that asks for height:100% fills the frame
1818
- * instead of collapsing to its content.
1819
- */
1820
- /*
1821
- * The author's wrapper is a stretch row: a mock fills a short frame and grows
1822
- * the frame when its own content is taller. Stretching (rather than a
1823
- * percentage height) is what makes the fill reliable.
1824
- */
1825
- /* Only the viewport carries the minimum height; the wrapper grows to fill it. */
1826
- .viewport ::slotted(*) {
1827
- display: grid;
1828
- flex: 1 0 auto;
1829
- min-width: 0;
1830
- }
1831
-
1832
- /*
1833
- * The app view is a simulation: a screen runs in a window of a fixed size (a
1834
- * device's screen, or the whole demo) and what does not fit scrolls inside
1835
- * the author's wrapper, the way the real page scrolls under the device's own
1836
- * chrome — the status bar, the address bar and a phone browser's bottom bar
1837
- * stay where they are. The viewport contains layout, so a mock's
1838
- * fixed position element (a tab bar, a modal) stays on the device screen.
1839
- */
1840
- .frame[data-window] {
1841
- display: flex;
1842
- flex: none;
1843
- flex-direction: column;
1844
- box-sizing: border-box;
1845
- max-width: none;
1846
- }
1847
-
1848
- .frame[data-window='device'] {
1849
- width: var(--device-width);
1850
- height: var(--device-height);
1851
- }
1852
-
1853
- .frame[data-kind][data-window] .viewport {
1854
- flex: 1 1 0;
1855
- min-height: 0;
1856
- overflow: hidden;
1857
- }
1858
-
1859
- .frame[data-window] .viewport ::slotted(*) {
1860
- flex: 1 1 0;
1861
- min-height: 0;
1862
- overflow: auto;
1863
- overscroll-behavior: contain;
1864
- }
1865
-
1866
- .frame-placeholder {
1867
- position: absolute;
1868
- inset: 12px;
1869
- display: grid;
1870
- align-content: center;
1871
- justify-items: center;
1872
- gap: 8px;
1873
- padding: 12px;
1874
- text-align: center;
1875
- color: var(--dpk-ink-faint);
1876
- border: 1px dashed var(--dpk-rule-strong);
1877
- border-radius: var(--dpk-radius);
1878
- background: var(--dpk-dots), var(--dpk-paper-sunken);
1879
- }
1880
-
1881
- .frame-placeholder code {
1882
- padding: 3px 7px;
1883
- border: 1px solid var(--dpk-rule);
1884
- border-radius: var(--dpk-radius-xs);
1885
- background: var(--dpk-paper-raised);
1886
- font-family: var(--dpk-mono);
1887
- font-size: 10px;
1888
- }
1889
-
1890
- /* ---------------------------------------------------------------- browser */
1891
-
1892
- /*
1893
- * The app view's browser: a tab strip on a darker band, the active tab merged
1894
- * into the toolbar below it, round navigation buttons, a pill address bar and
1895
- * the profile of the user the window belongs to.
1896
- */
1897
- .frame.browser {
1898
- display: flex;
1899
- flex-direction: column;
1900
- --browser-band: var(--dpk-paper-inset);
1901
- --browser-bar: var(--dpk-paper-raised);
1902
- }
1903
-
1904
- .browser-tabs {
1905
- display: flex;
1906
- align-items: flex-end;
1907
- gap: 4px;
1908
- min-width: 0;
1909
- padding: 7px 10px 0;
1910
- background: var(--browser-band);
1911
- }
1912
-
1913
- .browser-tab-list {
1914
- display: flex;
1915
- flex: 0 1 auto;
1916
- align-items: flex-end;
1917
- gap: 2px;
1918
- min-width: 0;
1919
- }
1920
-
1921
- .browser-tab {
1922
- position: relative;
1923
- display: flex;
1924
- flex: 0 1 220px;
1925
- align-items: center;
1926
- gap: 8px;
1927
- min-width: 64px;
1928
- height: 32px;
1929
- padding: 0 8px 0 12px;
1930
- border-radius: 9px 9px 0 0;
1931
- color: var(--dpk-ink-soft);
1932
- font-size: 12px;
1933
- cursor: default;
1934
- user-select: none;
1935
- transition: background 140ms var(--dpk-ease);
1936
- }
1937
-
1938
- .browser-tab:not([aria-selected='true']):hover {
1939
- background: color-mix(in srgb, var(--browser-bar) 55%, transparent);
1940
- }
1941
-
1942
- /* A thin rule between two inactive tabs, as in Chrome. */
1943
- .browser-tab:not([aria-selected='true']) + .browser-tab:not([aria-selected='true'])::before {
1944
- content: '';
1945
- position: absolute;
1946
- left: -2px;
1947
- top: 9px;
1948
- bottom: 9px;
1949
- width: 1px;
1950
- background: var(--dpk-rule-strong);
1951
- }
1952
-
1953
- .browser-tab[aria-selected='true'] {
1954
- background: var(--browser-bar);
1955
- color: var(--dpk-ink);
1956
- box-shadow: 0 -1px 0 var(--dpk-rule);
1957
- }
1958
-
1959
- .browser-tab:focus-visible {
1960
- outline: none;
1961
- box-shadow: var(--dpk-focus);
1962
- }
1963
-
1964
- .browser-favicon {
1965
- display: inline-flex;
1966
- flex: none;
1967
- color: var(--dpk-ink-faint);
1968
- }
1969
-
1970
- .browser-favicon svg {
1971
- width: 14px;
1972
- height: 14px;
1973
- }
1974
-
1975
- .browser-tab-title {
1976
- flex: 1;
1977
- min-width: 0;
1978
- overflow: hidden;
1979
- white-space: nowrap;
1980
- text-overflow: ellipsis;
1981
- }
1982
-
1983
- .browser-tab-close,
1984
- .browser-new-tab,
1985
- .browser-nav {
1986
- display: inline-grid;
1987
- flex: none;
1988
- place-items: center;
1989
- padding: 0;
1990
- border: 0;
1991
- border-radius: 50%;
1992
- background: transparent;
1993
- color: var(--dpk-ink-soft);
1994
- cursor: pointer;
1995
- transition:
1996
- background 140ms var(--dpk-ease),
1997
- color 140ms var(--dpk-ease);
1998
- }
1999
-
2000
- .browser-tab-close {
2001
- width: 18px;
2002
- height: 18px;
2003
- }
2004
-
2005
- .browser-tab-close svg {
2006
- width: 10px;
2007
- height: 10px;
2008
- }
2009
-
2010
- .browser-new-tab {
2011
- width: 26px;
2012
- height: 26px;
2013
- margin-bottom: 3px;
2014
- }
2015
-
2016
- .browser-new-tab svg {
2017
- width: 14px;
2018
- height: 14px;
2019
- }
2020
-
2021
- .browser-tab-close:hover,
2022
- .browser-new-tab:hover,
2023
- .browser-nav:not(:disabled):hover {
2024
- background: color-mix(in srgb, var(--dpk-ink) 9%, transparent);
2025
- color: var(--dpk-ink);
2026
- }
2027
-
2028
- .browser-tab-close:focus-visible,
2029
- .browser-new-tab:focus-visible,
2030
- .browser-nav:focus-visible {
2031
- outline: none;
2032
- box-shadow: var(--dpk-focus);
2033
- }
2034
-
2035
- .browser-toolbar {
2036
- display: flex;
2037
- align-items: center;
2038
- gap: 4px;
2039
- min-width: 0;
2040
- padding: 6px 10px;
2041
- background: var(--browser-bar);
2042
- border-bottom: 1px solid var(--dpk-rule);
2043
- }
2044
-
2045
- .browser-nav {
2046
- width: 30px;
2047
- height: 30px;
2048
- }
2049
-
2050
- .browser-nav svg {
2051
- width: 15px;
2052
- height: 15px;
2053
- }
2054
-
2055
- .browser-nav:disabled {
2056
- color: var(--dpk-ink-faint);
2057
- opacity: 0.5;
2058
- cursor: default;
2059
- }
2060
-
2061
- .browser-address-form {
2062
- position: relative;
2063
- display: flex;
2064
- flex: 1;
2065
- align-items: center;
2066
- min-width: 0;
2067
- margin: 0 4px;
2068
- }
2069
-
2070
- .browser-lock {
2071
- position: absolute;
2072
- left: 12px;
2073
- display: inline-flex;
2074
- color: var(--dpk-ink-faint);
2075
- pointer-events: none;
2076
- }
2077
-
2078
- .browser-lock svg {
2079
- width: 13px;
2080
- height: 13px;
2081
- }
2082
-
2083
- .browser-address {
2084
- width: 100%;
2085
- min-width: 0;
2086
- height: 30px;
2087
- padding: 0 14px 0 33px;
2088
- border: 1px solid transparent;
2089
- border-radius: 999px;
2090
- background: var(--dpk-paper-sunken);
2091
- color: var(--dpk-ink);
2092
- font: 13px/1 var(--dpk-body);
2093
- text-overflow: ellipsis;
2094
- transition:
2095
- background 140ms var(--dpk-ease),
2096
- border-color 140ms var(--dpk-ease);
2097
- }
2098
-
2099
- .browser-address:hover {
2100
- background: var(--dpk-paper-inset);
2101
- }
2102
-
2103
- .browser-address:focus {
2104
- outline: none;
2105
- border-color: var(--dpk-blue);
2106
- background: var(--browser-bar);
2107
- box-shadow: 0 0 0 1px var(--dpk-blue);
2108
- }
2109
-
2110
- .browser-profile {
2111
- display: inline-flex;
2112
- flex: none;
2113
- align-items: center;
2114
- gap: 6px;
2115
- max-width: 160px;
2116
- height: 28px;
2117
- padding: 0 10px 0 3px;
2118
- border-radius: 999px;
2119
- background: var(--dpk-blue-soft);
2120
- color: var(--dpk-blue-strong, var(--dpk-blue));
2121
- font-size: 12px;
2122
- font-weight: 600;
2123
- }
2124
-
2125
- .browser-avatar {
2126
- display: inline-grid;
2127
- flex: none;
2128
- place-items: center;
2129
- width: 22px;
2130
- height: 22px;
2131
- border-radius: 50%;
2132
- background: var(--dpk-blue);
2133
- color: #fff;
2134
- font-size: 11px;
2135
- font-weight: 700;
2136
- }
2137
-
2138
- .browser-profile-name {
2139
- min-width: 0;
2140
- overflow: hidden;
2141
- white-space: nowrap;
2142
- text-overflow: ellipsis;
2143
- }
2144
-
2145
- /* The bar a reload draws under the toolbar while the page comes back. */
2146
- .browser-progress {
2147
- position: relative;
2148
- height: 2px;
2149
- margin-top: -2px;
2150
- overflow: hidden;
2151
- pointer-events: none;
2152
- }
2153
-
2154
- .browser[data-loading] .browser-progress::after {
2155
- content: '';
2156
- position: absolute;
2157
- inset: 0;
2158
- background: var(--dpk-blue);
2159
- transform-origin: left;
2160
- animation: dpk-browser-load 360ms var(--dpk-ease) forwards;
2161
- }
2162
-
2163
- @keyframes dpk-browser-load {
2164
- from {
2165
- transform: scaleX(0.08);
2166
- }
2167
- to {
2168
- transform: scaleX(1);
2169
- }
2170
- }
2171
-
2172
- .browser .viewport {
2173
- transition: opacity 160ms var(--dpk-ease);
2174
- }
2175
-
2176
- .browser[data-loading] .viewport {
2177
- opacity: 0.45;
2178
- }
2179
-
2180
- /* The new tab page: the pages of the app the reader is in, as tiles. */
2181
- .browser-newtab {
2182
- display: grid;
2183
- flex: 1;
2184
- align-content: start;
2185
- justify-items: center;
2186
- gap: 18px;
2187
- padding: 72px 24px 40px;
2188
- background: #f8f9fb;
2189
- color: #3c4250;
2190
- }
2191
-
2192
- .browser-newtab-label {
2193
- margin: 0;
2194
- font-size: 13px;
2195
- font-weight: 600;
2196
- color: #6b7282;
2197
- }
2198
-
2199
- .browser-shortcuts {
2200
- display: grid;
2201
- grid-template-columns: repeat(auto-fill, 112px);
2202
- justify-content: center;
2203
- gap: 8px;
2204
- width: min(100%, 600px);
2205
- }
2206
-
2207
- .browser-shortcut {
2208
- display: grid;
2209
- justify-items: center;
2210
- gap: 6px;
2211
- padding: 14px 8px 12px;
2212
- border-radius: 12px;
2213
- color: inherit;
2214
- text-align: center;
2215
- text-decoration: none;
2216
- transition: background 140ms var(--dpk-ease);
2217
- }
2218
-
2219
- .browser-shortcut:hover,
2220
- .browser-shortcut:focus-visible {
2221
- outline: none;
2222
- background: #eceef2;
2223
- }
2224
-
2225
- .browser-shortcut-icon {
2226
- display: grid;
2227
- place-items: center;
2228
- width: 44px;
2229
- height: 44px;
2230
- border-radius: 50%;
2231
- background: #e3e7ee;
2232
- color: #3563d9;
2233
- font-size: 17px;
2234
- font-weight: 700;
2235
- }
2236
-
2237
- .browser-shortcut-title,
2238
- .browser-shortcut-url {
2239
- max-width: 100%;
2240
- overflow: hidden;
2241
- white-space: nowrap;
2242
- text-overflow: ellipsis;
2243
- }
2244
-
2245
- .browser-shortcut-title {
2246
- font-size: 12.5px;
2247
- font-weight: 600;
2248
- }
2249
-
2250
- .browser-shortcut-url {
2251
- font-size: 10.5px;
2252
- color: #8a91a0;
2253
- }
2254
-
2255
- .browser-unreachable {
2256
- display: grid;
2257
- flex: 1;
2258
- align-content: start;
2259
- gap: 10px;
2260
- padding: 88px max(24px, 12%) 40px;
2261
- background: #fff;
2262
- color: #3c4250;
2263
- }
2264
-
2265
- .browser-unreachable::before {
2266
- content: '';
2267
- width: 40px;
2268
- height: 40px;
2269
- margin-bottom: 8px;
2270
- border-radius: 10px;
2271
- background:
2272
- linear-gradient(135deg, transparent 46%, #9aa1ae 46% 54%, transparent 54%),
2273
- linear-gradient(45deg, transparent 46%, #9aa1ae 46% 54%, transparent 54%), #eceef2;
2274
- }
2275
-
2276
- .browser-unreachable h3 {
2277
- margin: 0;
2278
- font-size: 20px;
2279
- font-weight: 600;
2280
- color: #1f2430;
2281
- }
2282
-
2283
- .browser-unreachable p {
2284
- margin: 0;
2285
- font-size: 13.5px;
2286
- line-height: 1.6;
2287
- }
2288
-
2289
- .browser-unreachable code {
2290
- justify-self: start;
2291
- max-width: 100%;
2292
- overflow-wrap: anywhere;
2293
- font-family: var(--dpk-mono);
2294
- font-size: 12px;
2295
- color: #6b7282;
2296
- }
2297
-
2298
- /*
2299
- * A phone browser: the address and the avatar on top, the controls and the
2300
- * tab count in a bar under the page, the tabs as cards over the page.
2301
- */
2302
- .browser[data-viewport='mobile'] .browser-toolbar {
2303
- gap: 8px;
2304
- padding: 8px 10px;
2305
- }
2306
-
2307
- .browser[data-viewport='mobile'] .browser-profile {
2308
- padding-right: 3px;
2309
- }
2310
-
2311
- .browser[data-viewport='mobile'] .browser-shortcuts {
2312
- grid-template-columns: repeat(auto-fill, 96px);
2313
- }
2314
-
2315
- .browser-bottom {
2316
- display: flex;
2317
- align-items: center;
2318
- justify-content: space-around;
2319
- padding: 6px 8px 10px;
2320
- border-top: 1px solid var(--dpk-rule);
2321
- background: var(--browser-bar);
2322
- }
2323
-
2324
- .browser-bottom .browser-new-tab {
2325
- width: 30px;
2326
- height: 30px;
2327
- margin: 0;
2328
- }
2329
-
2330
- .browser-tab-count-box {
2331
- display: inline-grid;
2332
- place-items: center;
2333
- min-width: 17px;
2334
- height: 17px;
2335
- padding: 0 3px;
2336
- border: 1.5px solid currentColor;
2337
- border-radius: 4px;
2338
- font: 700 10px/1 var(--dpk-body);
2339
- }
2340
-
2341
- .browser-tab-count[aria-expanded='true'] {
2342
- background: color-mix(in srgb, var(--dpk-ink) 9%, transparent);
2343
- color: var(--dpk-ink);
2344
- }
2345
-
2346
- .browser-switcher {
2347
- position: absolute;
2348
- inset: 0;
2349
- z-index: 2;
2350
- display: grid;
2351
- grid-template-columns: repeat(2, minmax(0, 1fr));
2352
- align-content: start;
2353
- gap: 10px;
2354
- padding: 12px;
2355
- color-scheme: normal;
2356
- background: var(--browser-band);
2357
- overflow: auto;
2358
- }
2359
-
2360
- .browser-card {
2361
- position: relative;
2362
- border: 1px solid var(--dpk-rule-strong);
2363
- border-radius: 12px;
2364
- background: var(--browser-bar);
2365
- box-shadow: var(--dpk-shadow);
2366
- }
2367
-
2368
- .browser-card[aria-current='true'] {
2369
- border-color: var(--dpk-blue);
2370
- box-shadow: 0 0 0 1px var(--dpk-blue);
2371
- }
2372
-
2373
- .browser-card-open {
2374
- display: grid;
2375
- grid-template-columns: auto minmax(0, 1fr);
2376
- align-items: center;
2377
- gap: 4px 6px;
2378
- width: 100%;
2379
- min-height: 84px;
2380
- padding: 10px 30px 10px 10px;
2381
- border: 0;
2382
- border-radius: inherit;
2383
- background: transparent;
2384
- color: var(--dpk-ink);
2385
- font: 600 12px/1.3 var(--dpk-body);
2386
- text-align: left;
2387
- align-content: start;
2388
- cursor: pointer;
2389
- }
2390
-
2391
- .browser-card-open:focus-visible {
2392
- outline: none;
2393
- box-shadow: var(--dpk-focus);
2394
- }
2395
-
2396
- .browser-card-title,
2397
- .browser-card-url {
2398
- min-width: 0;
2399
- overflow: hidden;
2400
- white-space: nowrap;
2401
- text-overflow: ellipsis;
2402
- }
2403
-
2404
- .browser-card-url {
2405
- grid-column: 1 / -1;
2406
- color: var(--dpk-ink-faint);
2407
- font: 400 11px/1.3 var(--dpk-mono);
2408
- }
2409
-
2410
- .browser-card .browser-tab-close {
2411
- position: absolute;
2412
- top: 8px;
2413
- right: 8px;
2414
- }
2415
-
2416
- .parked {
2417
- display: none;
2418
- }
2419
- `,eo=`
2420
- /*
2421
- * The wrapper is a stretch grid (see \`.viewport ::slotted(*)\`): one child
2422
- * fills the frame, but several would share the extra height as gaps between
2423
- * them, so they stack from the top instead (a \`<style>\` or \`<script>\` beside
2424
- * the one child draws nothing and does not count). A shadow tree cannot see a
2425
- * slotted element's children, hence the document rule; \`:where\` lets the
2426
- * author's own \`align-content\` win.
2427
- */
2428
- :where(
2429
- dpk-template-prototype
2430
- > [data-preview-id]:has(> :not(style, script, template, link) ~ :not(style, script, template, link))
2431
- ) {
2432
- align-content: start;
2433
- }
2434
-
2435
- dpk-template-prototype > [data-preview-id]:has(dialog[${ke}][open]) {
2436
- position: relative;
2437
- }
2438
-
2439
- dpk-template-prototype > [data-preview-id]:has(dialog[${ke}][open])::after {
2440
- content: '';
2441
- position: absolute;
2442
- inset: 0;
2443
- z-index: 1;
2444
- background: color-mix(in srgb, var(--dpk-ink, #111827) 38%, transparent);
2445
- }
2446
-
2447
- dpk-template-prototype > [data-preview-id] dialog[${ke}][open] {
2448
- position: absolute;
2449
- inset: 0;
2450
- z-index: 2;
2451
- max-width: calc(100% - 32px);
2452
- max-height: calc(100% - 32px);
2453
- margin: auto;
2454
- }
2455
- `,Fe={kind:"off"},to=(e,t)=>{switch(t.kind){case"toggle":return e.kind==="off"?{kind:"picking"}:Fe;case"exit":return Fe;case"pick":return e.kind==="off"?e:{kind:"composing",target:t.target,body:e.kind==="composing"?e.body:""};case"input":return e.kind==="composing"?{...e,body:t.body}:e;case"dismiss":case"submitted":return e.kind==="off"?e:{kind:"picking"};default:return e}},ro={width:300,height:300},io=360,Er="dpk-template-prototype-document-styles",no=24,oo=()=>{if(document.getElementById(Er)!==null)return;const e=Object.assign(document.createElement("style"),{id:Er,textContent:eo});document.head.append(e)},so=(e,t,r)=>{const i=getComputedStyle(e),n=/auto|scroll/.test(i.overflowX)&&e.scrollWidth>e.clientWidth,o=/auto|scroll/.test(i.overflowY)&&e.scrollHeight>e.clientHeight,s=t<0?e.scrollLeft>0:t>0&&e.scrollLeft+e.clientWidth<e.scrollWidth-1,a=r<0?e.scrollTop>0:r>0&&e.scrollTop+e.clientHeight<e.scrollHeight-1;return n&&s||o&&a},ao=e=>{if(e.assignedSlot!==null)return e.assignedSlot;if(e.parentElement!==null)return e.parentElement;const t=e.getRootNode();return t instanceof ShadowRoot?t.host:null};class Sr extends nt{static{this.styles=[nt.styles,Hr,Gr,Qn]}#e=Fe;#u=!1;#s=null;#o=[];#C=new Fr(this);#y=!1;#t=null;#r=null;#k=!1;#p=!1;#h=!1;#i=null;#v=null;#g={};#f=1;#l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#P());#a=null;definitionFor(t){return Ut(t)}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.#T),window.addEventListener("resize",this.#w),this.addEventListener("toggle",this.#_,!0),this.addEventListener("click",this.#c,!0),this.addEventListener("auxclick",this.#c,!0),oo()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("keydown",this.#T),window.removeEventListener("resize",this.#w),this.removeEventListener("toggle",this.#_,!0),this.removeEventListener("click",this.#c,!0),this.removeEventListener("auxclick",this.#c,!0),this.#l?.disconnect(),this.#a=null,this.#D()}renderRegions(t){const r=fe(this.locale),i=Z(t.state,t.navigation),n=se(t.navigation)==="app";this.#t!==null&&this.#t.mode==="demo"!==n&&this.#R();const o=n?this.#j(t,r):null;return this.#k=o!==null,this.#o=i!==void 0&&i.kind!=="story"&&(o===null||o.view.entry?.kind==="page")?Ye(t.state,i,t.navigation).shown.map(s=>s.id):[],this.#i!==null&&this.#i.page!==this.#o.join(" ")&&this.#D(),{sidebar:dr(t,r),main:yr(t,r,{hasPreviewContent:s=>this.#Q(s),lift:this.#t,onToggleMaximize:()=>this.#m(this.#t===null?"maximized":null),onToggleDemo:()=>this.#m(this.#t===null?"demo":null),onLiftedWheel:this.#F,browser:o===null?null:{...o,loading:this.#i!==null},devices:n?{choice:this.#g,zoom:this.#f,onPick:s=>{this.#g=vn(this.#g,s),this.requestUpdate()}}:null,uiComment:this.#O(t),canvasEvents:{click:this.#N,pointermove:this.#z,pointerleave:this.#V,wheel:this.#Y,scroll:this.#w}})}}updated(){super.updated(),this.#H(),this.#W(),this.#U(),this.#P();const t=this.#e;if(t.kind==="composing"&&!this.#o.includes(t.target.previewId)){this.#d({kind:"dismiss"});return}this.#G(),this.#h&&(this.#h=!1,this.renderRoot.querySelector('.browser-tab[aria-selected="true"]')?.focus()),this.#A();const r=t.kind==="composing"&&!this.#u;if(this.#u=t.kind==="composing",t.kind!=="composing"||this.#s===null)return;const i=this.renderRoot.querySelector(".comment-pop");i&&(this.#C.open(i,this.#s,ro,{placement:"right-start"}),r&&i.querySelector("textarea")?.focus({preventScroll:!0}))}#O(t){const r=this.#e,i=r.kind==="composing"?r.target:void 0,n=i?A(t.state,i.previewId)?.preview:void 0,o=i?ut(i):void 0;return{mode:r,pins:r.kind==="off"?[]:St(t.comments,this.#o),...i&&n?{targetLabel:Et(n,i)}:{},notes:t.comments.filter(s=>s.target.type===re&&s.target.id===o).map(s=>et(s)),composer:Zr(this.locale),send:s=>this.#d(s),submit:s=>this.#M(s)}}#d(t){const r=to(this.#e,t);r!==this.#e&&(this.#e=r,r.kind!=="composing"&&(this.#s=null),this.requestUpdate())}#M(t){const r=this.#e;if(r.kind!=="composing")return;this.dispatch({type:jr,target:{type:re,id:ut(r.target)},payload:{body:t}}).ok&&this.#d({kind:"submitted"})}#x(t){const r=t.composedPath(),i=r[0];if(i instanceof Element&&i.classList.contains("ui-catcher"))return this.#L(t.clientX,t.clientY);const n=r.find(o=>o instanceof Element&&o.parentElement===this&&o.hasAttribute("data-preview-id"));return!n||!(i instanceof Element)||!n.contains(i)?null:this.#E(i,n)}#L(t,r){const i=this.#$(t,r);return i===null?null:this.#E(i.element,i.wrapper)}#$(t,r){if(typeof document.elementsFromPoint!="function")return null;const i=this.#S();for(const n of document.elementsFromPoint(t,r)){const o=i.find(s=>s.contains(n));if(o!==void 0)return{element:n,wrapper:o}}return null}#E(t,r){const i=r.getAttribute("data-preview-id");if(!i)return null;const n=Gi(t,r),o=Ki(n,r);return{element:n,target:{previewId:i,selector:o.selector,...o.text===void 0?{}:{text:o.text}}}}#S(){return Array.from(this.children).filter(t=>{const r=t.getAttribute("data-preview-id");return r!==null&&this.#o.includes(r)})}#N=t=>{if(this.#e.kind==="off")return;const r=this.#x(t);r&&(t.preventDefault(),t.stopPropagation(),this.#s=r.element,this.#d({kind:"pick",target:r.target}))};#z=t=>{if(this.#e.kind==="off")return;const r=this.#x(t);this.#b(".ui-hover",r?.element??null)};#V=()=>{this.#b(".ui-hover",null)};#Y=t=>{const r=t.composedPath()[0];if(!(r instanceof Element)||!r.classList.contains("ui-catcher"))return;const i=this.renderRoot.querySelector(".canvas");let n=this.#$(t.clientX,t.clientY)?.element??null;for(;n!==null&&n!==i;){if(so(n,t.deltaX,t.deltaY)){t.preventDefault(),n.scrollBy({left:t.deltaX,top:t.deltaY});return}n=ao(n)}};#T=t=>{t.key!=="Escape"||t.defaultPrevented||(this.#e.kind!=="off"?this.#d({kind:"exit"}):this.#m(null))};#w=()=>{this.#e.kind!=="off"&&this.#A()};#A(){if(this.#e.kind==="off")return;this.#b(".ui-picked",this.#s);const t=this.renderRoot.querySelector(".canvas");if(!t)return;const r=this.renderRoot.querySelector(".ui-catcher");if(r){r.style.width=`${t.scrollWidth}px`,r.style.height=`${t.scrollHeight}px`;const i=[...this.renderRoot.querySelectorAll(".demo-controls")].map(n=>n.getBoundingClientRect());r.style.clipPath=Wi(r.getBoundingClientRect(),i)}for(const i of this.renderRoot.querySelectorAll(".ui-pin")){const n=this.#B(i.dataset.preview??""),s=(n?Xi(n,i.dataset.selector??""):null)?.getBoundingClientRect();if(!s||s.width===0&&s.height===0){i.hidden=!0;continue}const a=this.#I(t);i.hidden=!1,i.style.left=`${s.right-a.left}px`,i.style.top=`${s.top-a.top}px`}}#b(t,r){const i=this.renderRoot.querySelector(t),n=this.renderRoot.querySelector(".canvas");if(!i||!n)return;const o=r?.getBoundingClientRect();if(!o){i.hidden=!0;return}const s=this.#I(n);i.hidden=!1,i.style.left=`${o.left-s.left}px`,i.style.top=`${o.top-s.top}px`,i.style.width=`${o.width}px`,i.style.height=`${o.height}px`}#I(t){const r=t.getBoundingClientRect();return{left:r.left+t.clientLeft-t.scrollLeft,top:r.top+t.clientTop-t.scrollTop}}#U(){const t=this.renderRoot.querySelector(".canvas");t===this.#a||this.#l===null||(this.#a!==null&&this.#l.unobserve(this.#a),this.#a=t,t!==null&&this.#l.observe(t))}#P(){const t=this.renderRoot.querySelector('.frame[data-window="device"]'),r=t?.closest(".canvas");if(!t||!(r instanceof HTMLElement))return;const i=getComputedStyle(t),n={width:parseFloat(i.getPropertyValue("--device-width")),height:parseFloat(i.getPropertyValue("--device-height"))},o=getComputedStyle(r),s=r.clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight),a=this.#t?.mode==="demo",p=a?no*2:0,l=fn(n,{width:s-p,...a?{height:r.clientHeight-p}:{}});l!==this.#f&&(this.#f=l,this.requestUpdate())}#W(){for(const t of this.querySelectorAll(":scope > [data-preview-id]"))for(const r of t.querySelectorAll("dialog"))Bt(r),Ht(this,r)}#_=t=>{const r=t.target;!(r instanceof HTMLDialogElement)||!r.open||Array.from(this.children).some(i=>i.hasAttribute("data-preview-id")&&i.contains(r))&&(Bt(r),Ht(this,r))};#B(t){return Array.from(this.children).find(r=>r.getAttribute("data-preview-id")===t)}#H(){if(this.#y||this.renderRoot.querySelector(".stage")===null)return;this.#y=!0;const t=this.derivation.state,r=[];for(const i of Array.from(this.children)){const n=i.getAttribute("data-preview-id");if(n!==null)for(const o of i.querySelectorAll("a, [data-dpk-navigate]")){const s=Ri(t,{href:o.getAttribute("href"),navigate:o.getAttribute("data-dpk-navigate")});if(s===null)continue;const a=(o.textContent??"").replace(/\s+/g," ").trim().slice(0,40),p=o.getAttribute("data-dpk-navigate")??o.getAttribute("href")??"(no href)";r.push(` ${n}: <${o.tagName.toLowerCase()}> "${a}" \u2192 ${p} (${s})`)}}r.length!==0&&console.warn(`[dev-process-kit] <dpk-template-prototype>: ${r.length} link(s) in the previews lead nowhere. Point each at the screen it opens (data-dpk-navigate="screen=\u2026"); a link that only moves the scenario on can name a step (data-dpk-navigate="step=\u2026") or a user story (data-dpk-navigate="story=\u2026"):
2456
- `+r.join(`
2457
- `))}#m(t){if(t===(this.#t?.mode??null))return;const r=this.renderRoot.querySelector(".stage"),i=this.#t?.height??r?.offsetHeight??0;this.#R(),t!==null&&(this.#t={mode:t,height:i}),t!==null&&this.#e.kind==="composing"&&(qr(this.renderRoot.querySelector(".comment-pop")),this.#u=!1),this.requestUpdate()}#R(){this.#t=null,this.#v=null}#G(){const t=this.renderRoot.querySelector(".stage");if(!(this.#t===null||!t||typeof t.showPopover!="function")&&t!==this.#v){this.#v=t;try{t.showPopover()}catch{}}}#F=t=>{const r=this.renderRoot.querySelector(".canvas");(r===null||!t.composedPath().includes(r))&&t.preventDefault()};#j(t,r){const i=Jt(t.state,t.navigation);this.#r=this.#r===null?i===null?null:Ji(i):Zt(this.#r,{kind:"observe",page:i});const n=this.#r;if(n===null)return null;const o=pe(n),s=o?.kind!=="page"&&n.seen!==null;if(i===null&&!s)return null;const a=pn(n)??i;return{view:nr(t.state,n,r,a),shortcuts:o?.kind==="new-tab"?ln(t.state,a):[],switcher:this.#p,send:p=>this.#K(p)}}#n(t){if(this.#r===null)return;const r=Zt(this.#r,t);if(r===this.#r)return;this.#r=r;const i=pe(r);i?.kind==="page"&&this.#q(i.page),this.requestUpdate()}#q(t){this.navigate({screen:t.screen??null,preview:t.preview??null})}#K(t){switch(t.kind){case"reload":this.#Z();return;case"address":this.#X(t.input);return;case"back":case"forward":case"new-tab":this.#p=!1,this.#n({kind:t.kind});return;case"switcher":this.#p=t.open,this.requestUpdate();return;case"activate":this.#p=!1,this.#h=t.focus===!0,this.#n({kind:"activate",id:t.id}),this.requestUpdate();return;case"close-tab":this.#n({kind:t.kind,id:t.id});return;case"visit":this.#n({kind:"visit",page:t.page});return;default:return}}#X(t){const r=this.#r;if(r===null)return;const i=this.derivation.state,n=nr(i,r,fe(this.locale)).url||"https://page.example.com/",o=sn(i,t,n);if(o!==null){this.#n({kind:"visit",page:o});return}const s=t.trim(),a=s.startsWith("/")?new URL(s,n).href:/^[a-z][a-z0-9+.-]*:\/\//i.test(s)?s:`https://${s}`;this.#n({kind:"unreachable",url:a})}#Z(){if(this.#i!==null)return;const t=setTimeout(()=>{this.#i=null;for(const r of this.#S()){for(const i of r.querySelectorAll("form"))i.reset();for(const i of r.querySelectorAll("dialog"))i.close();r.scrollTop=0,r.dispatchEvent(new CustomEvent("dpk-reload",{bubbles:!0}))}this.renderRoot.querySelector(".browser .viewport")?.scrollTo?.({top:0}),this.requestUpdate()},io);this.#i={page:this.#o.join(" "),timer:t},this.requestUpdate()}#D(){this.#i!==null&&(clearTimeout(this.#i.timer),this.#i=null)}#c=t=>{if(!this.#k||this.#e.kind!=="off"||this.#r===null||t.type==="auxclick"&&t.button!==1)return;const r=this.#J(t);if(r===null)return;const i=t.metaKey||t.ctrlKey||t.button===1;if(!r.blank&&!i)return;t.preventDefault(),t.stopPropagation();const n=Jt(this.derivation.state,Ae(this.hashFor(r.patch)));if(n===null){i||this.navigate(r.patch);return}this.#n({kind:"open-tab",entry:{kind:"page",page:n},background:i})};#J(t){const r=t.composedPath();if(!r.some(n=>n instanceof Element&&n.parentElement===this&&n.hasAttribute("data-preview-id")))return null;for(const n of r){if(!(n instanceof Element)||n===this)break;const o=n.getAttribute("data-dpk-navigate"),s=n instanceof HTMLAnchorElement?n.getAttribute("href"):null,a=o??(s?.startsWith("#")?s:null);if(a===null)continue;const p=o!==null&&!o.includes("=")?`step=${o}`:a;return{patch:{...Ae(p)},blank:n.getAttribute("target")==="_blank"}}return null}#Q(t){return Array.from(this.querySelectorAll("[data-preview-id]")).some(r=>r.getAttribute("data-preview-id")===t)}}const Tr=()=>{customElements.get("dpk-template-prototype")||customElements.define("dpk-template-prototype",Sr)},po=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplatePrototype:Sr,VIEWPORT_MIN_HEIGHT:wr,VIEWPORT_WIDTH:fr,allScreens:W,allStepIds:ft,applyPrototypeAction:wt,definePrototypeElement:Tr,describePrototypeAction:kt,emptyPrototypeBase:vt,findActivity:L,findPreview:A,findScreen:M,findStep:k,findStory:$,flattenSteps:B,parsePrototypeBase:ht,prototypeAction:ne,prototypeActions:f,prototypeBaseSchema:pt,prototypeCommentTargets:Ct,prototypeDefinitionFor:Ut,prototypeMessages:fe,prototypePageHeading:Ot,prototypeTargetLabel:$t,prototypeTitle:Ue,renderFrame:Ge,renderNav:dr,renderStage:yr,resolvePrototypeNavigation:ye,serializePrototypeAction:xt},Symbol.toStringTag,{value:"Module"}));export{Tr as d,po as i};