vanilla-breeze 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +25084 -6649
- package/dist/cdn/components/icon-wc.js +4 -4
- package/dist/cdn/components/manifest.json +2 -6
- package/dist/cdn/components/settings-panel.js +1 -1
- package/dist/cdn/components/site-map.js +1 -1
- package/dist/cdn/components/user-story.js +5 -5
- package/dist/cdn/icons/bold.css +17 -0
- package/dist/cdn/icons/bold.json +1 -0
- package/dist/cdn/icons/custom.css +6 -0
- package/dist/cdn/icons/custom.json +1 -0
- package/dist/cdn/icons/lucide.css +1914 -0
- package/dist/cdn/icons/lucide.json +1 -0
- package/dist/cdn/icons/mage.css +17 -0
- package/dist/cdn/icons/mage.json +1 -0
- package/dist/cdn/icons/phosphor.css +17 -0
- package/dist/cdn/icons/phosphor.json +1 -0
- package/dist/cdn/icons/tabler.css +17 -0
- package/dist/cdn/icons/tabler.json +1 -0
- package/dist/cdn/packs/manifest.json +2 -2
- package/dist/cdn/packs/ux-planning.full.css +1 -1
- package/dist/cdn/packs/ux-planning.full.js +146 -147
- package/dist/cdn/themes/8bit.tokens.json +1 -1
- package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
- package/dist/cdn/themes/alpha1999.tokens.json +1 -1
- package/dist/cdn/themes/anthropic.tokens.json +1 -1
- package/dist/cdn/themes/art-deco-dark.tokens.json +1 -1
- package/dist/cdn/themes/art-deco.tokens.json +1 -1
- package/dist/cdn/themes/bauhaus-dark.tokens.json +1 -1
- package/dist/cdn/themes/bauhaus.tokens.json +1 -1
- package/dist/cdn/themes/brutalist-dark.tokens.json +1 -1
- package/dist/cdn/themes/brutalist.tokens.json +1 -1
- package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
- package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
- package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
- package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
- package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
- package/dist/cdn/themes/classic-dark.tokens.json +1 -1
- package/dist/cdn/themes/classic.tokens.json +1 -1
- package/dist/cdn/themes/claymorphism-dark.tokens.json +1 -1
- package/dist/cdn/themes/claymorphism.tokens.json +1 -1
- package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
- package/dist/cdn/themes/clinical.tokens.json +1 -1
- package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
- package/dist/cdn/themes/cottagecore.tokens.json +1 -1
- package/dist/cdn/themes/cyber.tokens.json +1 -1
- package/dist/cdn/themes/dawn-dark.tokens.json +1 -1
- package/dist/cdn/themes/dawn.tokens.json +1 -1
- package/dist/cdn/themes/dracula.tokens.json +1 -1
- package/dist/cdn/themes/dusk.tokens.json +1 -1
- package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
- package/dist/cdn/themes/editorial.tokens.json +1 -1
- package/dist/cdn/themes/financial-dark.tokens.json +1 -1
- package/dist/cdn/themes/financial.tokens.json +1 -1
- package/dist/cdn/themes/genai.tokens.json +1 -1
- package/dist/cdn/themes/glassmorphism-dark.tokens.json +1 -1
- package/dist/cdn/themes/glassmorphism.tokens.json +1 -1
- package/dist/cdn/themes/government-dark.tokens.json +1 -1
- package/dist/cdn/themes/government.tokens.json +1 -1
- package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
- package/dist/cdn/themes/gruvbox.tokens.json +1 -1
- package/dist/cdn/themes/high-noon-dark.tokens.json +1 -1
- package/dist/cdn/themes/high-noon.tokens.json +1 -1
- package/dist/cdn/themes/ibm.tokens.json +1 -1
- package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
- package/dist/cdn/themes/kawaii.tokens.json +1 -1
- package/dist/cdn/themes/magna-dark.tokens.json +1 -1
- package/dist/cdn/themes/magna.tokens.json +1 -1
- package/dist/cdn/themes/mcdonalds.tokens.json +1 -1
- package/dist/cdn/themes/midnight.tokens.json +1 -1
- package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
- package/dist/cdn/themes/minimal.tokens.json +1 -1
- package/dist/cdn/themes/modern-dark.tokens.json +1 -1
- package/dist/cdn/themes/modern.tokens.json +1 -1
- package/dist/cdn/themes/nes-dark.tokens.json +1 -1
- package/dist/cdn/themes/nes.tokens.json +1 -1
- package/dist/cdn/themes/neumorphism-dark.tokens.json +1 -1
- package/dist/cdn/themes/neumorphism.tokens.json +1 -1
- package/dist/cdn/themes/nord-dark.tokens.json +1 -1
- package/dist/cdn/themes/nord.tokens.json +1 -1
- package/dist/cdn/themes/organic-dark.tokens.json +1 -1
- package/dist/cdn/themes/organic.tokens.json +1 -1
- package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
- package/dist/cdn/themes/rose-pine.tokens.json +1 -1
- package/dist/cdn/themes/rough-dark.tokens.json +1 -1
- package/dist/cdn/themes/rough.tokens.json +1 -1
- package/dist/cdn/themes/solarized-dark.tokens.json +1 -1
- package/dist/cdn/themes/solarized.tokens.json +1 -1
- package/dist/cdn/themes/starbucks.tokens.json +1 -1
- package/dist/cdn/themes/startup-dark.tokens.json +1 -1
- package/dist/cdn/themes/startup.tokens.json +1 -1
- package/dist/cdn/themes/super2026-dark.tokens.json +1 -1
- package/dist/cdn/themes/super2026.tokens.json +1 -1
- package/dist/cdn/themes/swiss-dark.tokens.json +1 -1
- package/dist/cdn/themes/swiss.tokens.json +1 -1
- package/dist/cdn/themes/terminal.tokens.json +1 -1
- package/dist/cdn/themes/tokyo-night-dark.tokens.json +1 -1
- package/dist/cdn/themes/tokyo-night.tokens.json +1 -1
- package/dist/cdn/themes/vaporwave-dark.tokens.json +1 -1
- package/dist/cdn/themes/vaporwave.tokens.json +1 -1
- package/dist/cdn/themes/win9x-dark.tokens.json +1 -1
- package/dist/cdn/themes/win9x.tokens.json +1 -1
- package/dist/cdn/vanilla-breeze-core.css +1 -1
- package/dist/cdn/vanilla-breeze-core.js +23 -23
- package/dist/cdn/vanilla-breeze.css +1 -1
- package/dist/cdn/vanilla-breeze.js +161 -161
- package/package.json +3 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var pe=window.matchMedia("(prefers-reduced-motion: reduce)");var St=new Map;function x(c,t,e={}){let r=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:r},a=St.get(c);if(customElements.get(c)){if(!a||a.priority>=r){a&&a.priority===r&&a.impl!==t&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${c}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=r){a.priority===r&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${a.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}St.set(c,s),customElements.define(c,t)}var C=class extends HTMLElement{#e=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,r,s){t.addEventListener(e,r,s),this.#e.push(()=>t.removeEventListener(e,r,s))}setup(){}teardown(){}setState(t,e){this.#t||(this.#t=this.attachInternals());let r=this.#t.states;try{e?r.add(t):r.delete(t)}catch{let s=`--${t}`;e?r.add(s):r.delete(s)}}_adoptInternals(t){this.#t||(this.#t=t)}};var J=class c extends C{#e=null;#t=null;#r=!1;#i=null;setup(){this.setAttribute("role","list"),this.#r=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#o(),this.#n(),this.#f(),this.#s()}teardown(){this.#e&&(this.#e.remove(),this.#e=null),c.#_?.source===this&&(c.#_=null)}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")||"vertical"}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#s(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("aria-grabbed")||t.setAttribute("aria-grabbed","false")}#o(){this.#e=document.createElement("div"),this.#e.setAttribute("role","status"),this.#e.setAttribute("aria-live","polite"),this.#e.setAttribute("aria-atomic","true"),this.#e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);",this.prepend(this.#e)}#a(t){let e=this.#e;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#n(){this.listen(this,"pointerdown",t=>{this.#i=t.target}),this.listen(this,"dragstart",this.#c.bind(this)),this.listen(this,"dragover",this.#d.bind(this)),this.listen(this,"dragleave",this.#b.bind(this)),this.listen(this,"drop",this.#m.bind(this)),this.listen(this,"dragend",this.#u.bind(this))}#c(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let r=e.querySelector("[data-drag-handle]");if(r&&!r.contains(this.#i)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let s=this.#g(e);c.#_={item:e,source:this,originalIndex:s},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#d(t){let e=c.#_;if(!e||(this.group||e.source.group)&&this.group!==e.source.group)return;t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over","");let r=this.orientation==="horizontal"?t.clientX:t.clientY;this.#w(r)}#b(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#A())}#m(t){t.preventDefault(),this.removeAttribute("data-drag-over"),this.#A();let e=c.#_;if(!e)return;let{item:r,source:s,originalIndex:a}=e,i=this.orientation==="horizontal"?t.clientX:t.clientY,o=this.#k(i);if(s===this){this.#p(r,o),this.#x();let n=this.#g(r);this.#l(r),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:r,itemId:r.dataset.id,oldIndex:a,newIndex:n,order:this.sortedOrder}}))}else this.#p(r,o),this.#x(),s.#x(),this.#l(r),this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:r,itemId:r.dataset.id,fromSurface:s,toSurface:this,newIndex:this.#g(r),fromOrder:s.sortedOrder,toOrder:this.sortedOrder}}))}#u(){let t=c.#_;t?.item&&t.item.removeAttribute("data-dragging"),this.removeAttribute("data-drag-over"),this.#A(),c.#_=null,this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#f(){this.listen(this,"keydown",this.#v.bind(this))}#v(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let r=e.getAttribute("aria-grabbed")==="true",s=this.orientation==="horizontal",a=s?"ArrowLeft":"ArrowUp",i=s?"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){if(t.preventDefault(),r){e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#x(),this.#l(e);let l=this.#g(e),d=this.draggableChildren;this.#a(`${this.#y(e)}, dropped at position ${l+1} of ${d.length}`),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,oldIndex:this.#t,newIndex:l,order:this.sortedOrder}})),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#t=null}else{this.#t=this.#g(e),e.setAttribute("aria-grabbed","true"),this.setAttribute("data-reorder-mode","");let l=this.draggableChildren;this.#a(`${this.#y(e)}, grabbed. Position ${this.#t+1} of ${l.length}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}return}if(!r&&(t.key===a||t.key===i)){t.preventDefault();let l=this.draggableChildren,d=l.indexOf(e),p=t.key===a?Math.max(0,d-1):Math.min(l.length-1,d+1);p!==d&&l[p].focus();return}if(r&&(t.key===a||t.key===i)){t.preventDefault();let l=this.draggableChildren,d=l.indexOf(e),p=t.key===a?Math.max(0,d-1):Math.min(l.length-1,d+1);p!==d&&(this.#p(e,p),e.focus(),this.#a(`Position ${p+1} of ${l.length}`));return}let o=s?"ArrowUp":"ArrowLeft",n=s?"ArrowDown":"ArrowRight";if(r&&(t.key===o||t.key===n)){if(t.preventDefault(),!this.group)return;let l=t.key===n?1:-1,d=this.#h(l);if(!d)return;d.appendChild(e),d.#x(),this.#x(),d.#l(e),e.focus();let p=d.getAttribute("aria-label")||"next surface";d.#a(`Moved to ${p}`),d.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,fromSurface:this,toSurface:d,newIndex:d.draggableChildren.indexOf(e),fromOrder:this.sortedOrder,toOrder:d.sortedOrder}})),this.removeAttribute("data-reorder-mode"),d.setAttribute("data-reorder-mode",""),this.#t=null;return}if(r&&t.key==="Escape"){t.preventDefault(),e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#t!=null&&(this.#p(e,this.#t),e.focus()),this.#a("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#t=null;return}!r&&t.key==="Escape"&&(t.preventDefault(),e.blur())}#l(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#h(t){if(!this.group)return null;let e=[...document.querySelectorAll(`drag-surface[group="${this.group}"]`)];if(e.length<2)return null;e.sort((a,i)=>{let o=a.getBoundingClientRect(),n=i.getBoundingClientRect();return o.left-n.left||o.top-n.top});let r=e.indexOf(this);return e[r+t]||null}#y(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#g(t){return this.draggableChildren.indexOf(t)}#p(t,e){let s=this.draggableChildren.filter(a=>a!==t)[e]||null;s?this.insertBefore(t,s):this.appendChild(t)}#x(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#k(t){let e=this.orientation==="horizontal",r=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<r.length;s++){let a=r[s].getBoundingClientRect(),i=e?a.left+a.width/2:a.top+a.height/2;if(t<i)return s}return r.length}#w(t){this.#A();let e=this.orientation==="horizontal",r=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<r.length;s++){let a=r[s].getBoundingClientRect(),i=e?a.left+a.width/2:a.top+a.height/2;if(t<i){r[s].setAttribute("data-drop-target","before");return}}r.length>0&&r[r.length-1].setAttribute("data-drop-target","after")}#A(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#_=null};x("drag-surface",J);var $t=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
font-family: var(--user-persona-font, var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif));
|
|
@@ -294,7 +294,7 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
294
294
|
transition: none !important;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
`;function
|
|
297
|
+
`;function h(c){return String(c).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function z(c){return c.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function L(c){let t=0;for(let r=0;r<c.length;r++)t=c.charCodeAt(r)+((t<<5)-t);return`hsl(${(t%360+360)%360}, 65%, 55%)`}function A(c){return`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${c}</svg>`}var k={user:'<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>',pencil:'<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>',check:'<path d="M20 6 9 17l-5-5"/>',target:'<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/>',alertTriangle:'<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>',messageCircle:'<path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"/>',lightbulb:'<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/>',wrench:'<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"/>',heart:'<path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"/>',mapPin:'<path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/>',checkCircle:'<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',download:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',send:'<path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/>'},Z={says:{label:"Says",icon:k.messageCircle,color:"#3b82f6"},thinks:{label:"Thinks",icon:k.lightbulb,color:"#8b5cf6"},does:{label:"Does",icon:k.wrench,color:"#f59e0b"},feels:{label:"Feels",icon:k.heart,color:"#ef4444"}},q={delighted:{emoji:"\u{1F604}",score:.95,color:"#16a34a"},satisfied:{emoji:"\u{1F60A}",score:.8,color:"#22c55e"},hopeful:{emoji:"\u{1F642}",score:.68,color:"#84cc16"},curious:{emoji:"\u{1F914}",score:.55,color:"#eab308"},neutral:{emoji:"\u{1F610}",score:.5,color:"#94a3b8"},uncertain:{emoji:"\u{1F615}",score:.4,color:"#f97316"},confused:{emoji:"\u{1F635}",score:.3,color:"#fb923c"},frustrated:{emoji:"\u{1F624}",score:.18,color:"#ef4444"},angry:{emoji:"\u{1F620}",score:.05,color:"#dc2626"}};var Ft="https://cdn.jsdelivr.net/gh/faker-js/assets-person-portrait",B=[32,64,128,256,512];function Bt(c){let t=0;for(let e=0;e<c.length;e++)t=c.charCodeAt(e)+((t<<5)-t);return t}function Ht(c){let t=B[0],e=Math.abs(c-t);for(let r=1;r<B.length;r++){let s=Math.abs(c-B[r]);s<e&&(t=B[r],e=s)}return t}function qt(c,t=128){let e=Bt(String(c)),r=(e%100+100)%100,s=(e>>>16&1)===0?"female":"male",a=Ht(t);return`${Ft}/${s}/${a}/${r}.jpg`}function tt(c){let t=0;for(let e=0;e<c.length;e++)t=c.charCodeAt(e)+((t<<5)-t);return t}var Ut=["Sarah Chen","Marcus Johnson","Aisha Patel","James O'Brien","Yuki Tanaka","Elena Rodriguez","David Kim","Fatima Al-Hassan","Lucas Silva","Priya Sharma","Noah Williams","Mei Lin","Carlos Mendez","Amara Osei","Henrik Larsson","Zara Ahmed"],Vt=["Product Manager","UX Designer","Frontend Developer","Data Analyst","Marketing Lead","QA Engineer","DevOps Lead","Content Strategist","Startup Founder","IT Director","Customer Success Lead","Research Scientist"],Qt=["San Francisco, CA","Austin, TX","London, UK","Toronto, CA","Berlin, DE","Tokyo, JP","Sydney, AU","S\xE3o Paulo, BR"],Xt=["I need tools that help me stay organized without slowing me down.","The dashboard is where I live \u2014 it has to be fast and reliable.","I want to understand the data, not fight the interface.","If it takes more than two clicks, I\u2019ll find another way.","Collaboration shouldn\u2019t mean endless notification noise.","I just want it to work the way I expect it to.","Give me the big picture first, then let me drill into details.","Accessibility isn\u2019t a nice-to-have \u2014 it\u2019s how I use the web."],Yt=["Streamline daily workflows","Reduce context-switching","Stay aligned with the team","Make data-driven decisions quickly","Ship features on a predictable cadence","Automate repetitive tasks","Improve onboarding experience","Keep documentation up to date"],Kt=["Too many disconnected tools","Slow page loads break focus","Unclear ownership of tasks","Settings that reset unexpectedly","Notifications that bury important updates","Poor mobile experience","Inconsistent design across features","No offline support"],Wt=["Checks dashboards every morning","Prefers keyboard shortcuts over mouse","Skims docs, reads deeply only when stuck","Shares screenshots in Slack","Batches email to twice a day","Tests features in incognito first","Bookmarks frequently used reports","Uses dark mode exclusively"],et=class extends HTMLElement{static get observedAttributes(){return["role","age","location","avatar","compact","src","data-list-stories","id"]}#e=new Map;#t=null;constructor(){super(),this.attachShadow({mode:"open"})}relatedStories(){if(!this.id)return[];let t=this.getRootNode(),e=t.querySelectorAll?t:document;return Array.from(e.querySelectorAll(`user-story[persona-id="${Gt(this.id)}"]`))}#r(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&!this.getAttribute(e)&&this.#e.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#e.get(t)||""}get data(){return{name:this.personaName,role:this.personaRole||void 0,age:this.age||void 0,location:this.location||void 0,avatar:this.avatar||void 0,quote:this.quote||void 0,bio:this.#e.get("bio")||void 0,goals:this.#e.get("goals")||void 0,frustrations:this.#e.get("frustrations")||void 0,behaviors:this.#e.get("behaviors")||void 0}}set data(t){!t||typeof t!="object"||(this._applyData(t),this.shadowRoot&&this.#n(),this.dispatchEvent(new CustomEvent("user-persona:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){for(let e of["role","age","location","avatar"])t[e]&&this.setAttribute(e,String(t[e]));if(t.name&&!this.querySelector('[slot="name"]')){let e=document.createElement("h2");e.slot="name",e.textContent=String(t.name),this.appendChild(e)}if(t.quote&&!this.querySelector('[slot="quote"]')){let e=document.createElement("p");e.slot="quote",e.textContent=String(t.quote),this.appendChild(e)}for(let e of["bio","goals","frustrations","behaviors"])t[e]&&this.#e.set(e,String(t[e]))}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();this._applyData(r),this.#n()}catch(e){console.warn(`[user-persona] Failed to load src="${t}":`,e)}}connectedCallback(){this.#r(),this.hasAttribute("data-mock")?this.#a():this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#n(),this.#i(),this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent("persona-ready",{bubbles:!0,composed:!0,detail:{name:this.personaName,role:this.personaRole}}))}disconnectedCallback(){this.removeAttribute("data-upgraded"),this.#t?.disconnect(),this.#t=null}#i(){if(!this.hasAttribute("data-list-stories")||!this.id){this.#t?.disconnect(),this.#t=null;return}this.#t||(this.#t=new MutationObserver(()=>this.#s()),this.#t.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["persona-id"]}))}#s(){if(!this.shadowRoot)return;let t=this.shadowRoot.querySelector("[data-stories-section]");t&&(t.outerHTML=this.#o())}#o(){if(!this.hasAttribute("data-list-stories")||!this.id)return"";let t=this.relatedStories();return`
|
|
298
298
|
<section class="section" part="section-stories" data-stories-section>
|
|
299
299
|
<div class="section-header">
|
|
300
300
|
<div class="section-icon stories" aria-hidden="true">
|
|
@@ -303,46 +303,46 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
303
303
|
<span class="section-title">Stories <span class="section-count">${t.length}</span></span>
|
|
304
304
|
</div>
|
|
305
305
|
<div class="section-content">
|
|
306
|
-
${t.length===0?'<p class="empty-stories">No user stories reference this persona yet.</p>':`<ul class="story-list">${t.map(e=>{let
|
|
306
|
+
${t.length===0?'<p class="empty-stories">No user stories reference this persona yet.</p>':`<ul class="story-list">${t.map(e=>{let r=e.id||e.getAttribute("story-id")||"",s=e.querySelector('[slot="action"]')?.textContent?.trim()||e.getAttribute("action")||e.id||"untitled",a=e.getAttribute("priority")||"",i=e.getAttribute("status")||"";return`<li class="story-item" data-priority="${h(a)}" data-status="${h(i)}">${r?`<a href="#${h(r)}">${h(s)}</a>`:`<span>${h(s)}</span>`}${a?`<span class="story-meta">${h(a)}</span>`:""}${i?`<span class="story-meta">${h(i)}</span>`:""}</li>`}).join("")}</ul>`}
|
|
307
307
|
</div>
|
|
308
308
|
</section>
|
|
309
|
-
`}attributeChangedCallback(t,e,
|
|
310
|
-
<style>${
|
|
309
|
+
`}attributeChangedCallback(t,e,r){if(!(e===r||!this.shadowRoot)){if(t==="src"&&this.isConnected){this._loadSrc(r);return}(t==="data-list-stories"||t==="id")&&this.#i(),this.#n()}}get personaName(){return this.querySelector('[slot="name"]')?.textContent?.trim()||this.#e.get("name")||"Unnamed Persona"}get personaRole(){return this.getAttribute("role")||""}get age(){return this.getAttribute("age")||""}get location(){return this.getAttribute("location")||""}get avatar(){return this.getAttribute("avatar")||""}get quote(){return this.querySelector('[slot="quote"]')?.textContent?.trim()||this.#e.get("quote")||""}get compact(){return this.hasAttribute("compact")}#a(){let t=this.dataset.seed||this.dataset.mock||String(Date.now()),e=a=>a[(tt(t+a.length)%a.length+a.length)%a.length],r=(a,i)=>{let o=[];for(let n=0;n<i;n++)o.push(a[(tt(t+n+a.length)%a.length+a.length)%a.length]);return[...new Set(o)]};if(!this.querySelector('[slot="name"]')){let a=document.createElement("h2");a.slot="name",a.textContent=e(Ut),this.appendChild(a)}if(this.getAttribute("role")||this.setAttribute("role",e(Vt)),this.getAttribute("age")||this.setAttribute("age",String(25+(tt(t)%30+30)%30)),this.getAttribute("location")||this.setAttribute("location",e(Qt)),!this.getAttribute("avatar")){let a=this.querySelector('[slot="name"]')?.textContent?.trim()||"Persona";this.setAttribute("avatar",qt(a,256))}if(!this.querySelector('[slot="quote"]')){let a=document.createElement("p");a.slot="quote",a.textContent=e(Xt),this.appendChild(a)}let s=(a,i)=>{if(this.querySelector(`[slot="${a}"]`))return;let o=document.createElement("ul");o.setAttribute("slot",a);for(let n of i){let l=document.createElement("li");l.textContent=n,o.appendChild(l)}this.appendChild(o)};s("goals",r(Yt,3)),s("frustrations",r(Kt,3)),s("behaviors",r(Wt,3))}#n(){let t=this.personaName,e=this.personaRole,r=this.age,s=this.location,a=this.avatar,i=this.quote,o=L(t),n=a?`background:url(${h(a)}) center/cover`:`background:${o}`;this.shadowRoot.innerHTML=`
|
|
310
|
+
<style>${$t}</style>
|
|
311
311
|
|
|
312
312
|
<article class="persona-card" part="card" role="article"
|
|
313
|
-
aria-label="User persona: ${
|
|
313
|
+
aria-label="User persona: ${h(t)}">
|
|
314
314
|
|
|
315
315
|
<header class="persona-header" part="header">
|
|
316
316
|
<div class="avatar" part="avatar" style="${n}"
|
|
317
|
-
role="img" aria-label="Avatar for ${
|
|
318
|
-
${
|
|
317
|
+
role="img" aria-label="Avatar for ${h(t)}">
|
|
318
|
+
${a?"":h(z(t))}
|
|
319
319
|
</div>
|
|
320
320
|
<div class="header-info">
|
|
321
321
|
<div class="persona-name-wrap" part="name">
|
|
322
|
-
<slot name="name"><h2 class="persona-name-fallback">${
|
|
322
|
+
<slot name="name"><h2 class="persona-name-fallback">${h(t)}</h2></slot>
|
|
323
323
|
</div>
|
|
324
|
-
${e?`<p class="persona-role" part="role">${
|
|
324
|
+
${e?`<p class="persona-role" part="role">${h(e)}</p>`:""}
|
|
325
325
|
<div class="persona-meta" part="meta">
|
|
326
|
-
${
|
|
326
|
+
${r?`
|
|
327
327
|
<span class="meta-item">
|
|
328
328
|
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>
|
|
329
|
-
${
|
|
329
|
+
${h(r)} years old
|
|
330
330
|
</span>
|
|
331
331
|
`:""}
|
|
332
|
-
${
|
|
332
|
+
${s?`
|
|
333
333
|
<span class="meta-item">
|
|
334
334
|
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>
|
|
335
|
-
${
|
|
335
|
+
${h(s)}
|
|
336
336
|
</span>
|
|
337
337
|
`:""}
|
|
338
338
|
</div>
|
|
339
339
|
</div>
|
|
340
340
|
</header>
|
|
341
341
|
|
|
342
|
-
${
|
|
342
|
+
${i||this.querySelector('[slot="quote"]')?`
|
|
343
343
|
<div class="persona-quote" part="quote">
|
|
344
344
|
<span class="quote-mark" aria-hidden="true">“</span>
|
|
345
|
-
<div class="quote-text-wrap"><slot name="quote"><p class="quote-text">${
|
|
345
|
+
<div class="quote-text-wrap"><slot name="quote"><p class="quote-text">${h(i)}</p></slot></div>
|
|
346
346
|
</div>
|
|
347
347
|
`:""}
|
|
348
348
|
|
|
@@ -398,7 +398,7 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
398
398
|
${this.#o()}
|
|
399
399
|
</div>
|
|
400
400
|
</article>
|
|
401
|
-
`}};function
|
|
401
|
+
`}};function Gt(c){return typeof CSS<"u"&&CSS.escape?CSS.escape(String(c)):String(c).replace(/["\\]/g,"\\$&")}x("user-persona",et);var rt=`
|
|
402
402
|
:host {
|
|
403
403
|
--_bg: var(--user-story-bg, var(--color-surface, #ffffff));
|
|
404
404
|
--_text: var(--user-story-text, var(--color-text, #1a1a1a));
|
|
@@ -721,41 +721,41 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
721
721
|
:host([detail="compact"]) .slot-fallback {
|
|
722
722
|
display: none;
|
|
723
723
|
}
|
|
724
|
-
`;var
|
|
725
|
-
<style>${
|
|
726
|
-
<article class="story-card story-card--minimal" role="article" aria-label="${
|
|
724
|
+
`;var st=class c extends HTMLElement{static get observedAttributes(){return["persona-id","priority","points","status","epic","story-id","compact","detail","src"]}static PRIORITIES={critical:{label:"Critical",color:"#dc2626",bg:"rgba(220, 38, 38, 0.1)"},high:{label:"High",color:"#ea580c",bg:"rgba(234, 88, 12, 0.1)"},medium:{label:"Medium",color:"#ca8a04",bg:"rgba(202, 138, 4, 0.1)"},low:{label:"Low",color:"#16a34a",bg:"rgba(22, 163, 74, 0.1)"}};static STATUSES={backlog:{label:"Backlog",color:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},"to-do":{label:"To Do",color:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},"in-progress":{label:"In Progress",color:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},review:{label:"Review",color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},done:{label:"Done",color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"}};#e=new Map;#t=null;constructor(){super(),this.attachShadow({mode:"open"})}#r(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&this.#e.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#e.get(t)||""}get data(){return{storyId:this.storyId||void 0,personaId:this.personaId||void 0,priority:this.priority,status:this.status,points:this.points||void 0,epic:this.epic||void 0,detail:this.getAttribute("detail")||void 0,persona:this.persona||void 0,action:this.action||void 0,benefit:this.benefit||void 0,title:this.storyTitle||void 0}}set data(t){!t||typeof t!="object"||(this._applyData(t),this.#r(),this.shadowRoot&&this.#n(),this.dispatchEvent(new CustomEvent("user-story:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){for(let[e,r]of[["storyId","story-id"],["personaId","persona-id"],["priority","priority"],["status","status"],["points","points"],["epic","epic"],["detail","detail"]])t[e]!=null&&this.setAttribute(r,String(t[e]));if(t.persona&&!this.querySelector('[slot="persona"]')){let e=document.createElement("span");e.slot="persona",e.textContent=String(t.persona),this.appendChild(e)}if(t.action&&!this.querySelector('[slot="action"]')){let e=document.createElement("span");e.slot="action",e.textContent=String(t.action),this.appendChild(e)}if(t.benefit&&!this.querySelector('[slot="benefit"]')){let e=document.createElement("span");e.slot="benefit",e.textContent=String(t.benefit),this.appendChild(e)}if(t.title&&!this.querySelector('[slot="title"]')){let e=document.createElement("h3");e.slot="title",e.textContent=String(t.title),this.appendChild(e)}for(let e of["acceptance-criteria","tasks","notes"]){let r=e==="acceptance-criteria"?"acceptanceCriteria":e;if(t[r]&&!this.querySelector(`[slot="${e}"]`))if(Array.isArray(t[r])){let s=document.createElement("ul");s.slot=e;for(let a of t[r]){let i=document.createElement("li");i.textContent=String(a),s.appendChild(i)}this.appendChild(s)}else{let s=document.createElement("p");s.slot=e,s.textContent=String(t[r]),this.appendChild(s)}}}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();this._applyData(r),this.#r(),this.#n()}catch(e){console.warn(`[user-story] Failed to load src="${t}":`,e)}}connectedCallback(){this.#r(),this.storyId&&!this.id&&(this.id=this.storyId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#n(),this.#i(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded"),this.#t?.disconnect(),this.#t=null}attributeChangedCallback(t,e,r){e!==r&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(r):(this.#n(),t==="persona-id"&&this.#i()))}#i(){if(this.#t?.disconnect(),this.#t=null,!this.personaId||this.#s())return;let t=this.getRootNode(),r=(t&&typeof t.getElementById=="function"?t:document).getElementById(this.personaId);!r||r.tagName!=="USER-PERSONA"||(this.#t=new MutationObserver(()=>this.#n()),this.#t.observe(r,{attributes:!0,attributeFilter:["role"]}))}get persona(){return this.#s()||this.#o()||"user"}get personaId(){return this.getAttribute("persona-id")||""}#s(){return this.querySelector('[slot="persona"]')?.textContent?.trim()||this.#e.get("persona")||""}#o(){if(!this.personaId)return"";let t=this.getRootNode(),r=(t&&typeof t.getElementById=="function"?t:document).getElementById(this.personaId);return!r||r.tagName!=="USER-PERSONA"?"":r.getAttribute("role")?.trim()||""}#a(){return/^[aeio]/i.test(this.persona.trim())?"an":"a"}get action(){return this.querySelector('[slot="action"]')?.textContent?.trim()||this.#e.get("action")||""}get benefit(){return this.querySelector('[slot="benefit"]')?.textContent?.trim()||this.#e.get("benefit")||""}get priority(){return this.getAttribute("priority")||"medium"}get points(){return this.getAttribute("points")||""}get status(){return this.getAttribute("status")||"backlog"}get epic(){return this.getAttribute("epic")||""}get storyId(){return this.getAttribute("story-id")||""}get storyTitle(){return this.querySelector('[slot="title"]')?.textContent?.trim()||this.#e.get("title")||""}get _minimalLabel(){if(this.storyTitle)return this.storyTitle;let t=this.action;return t.length>40?t.slice(0,40)+"\u2026":t}get compact(){return this.hasAttribute("compact")}get _detailLevel(){return this.getAttribute("detail")?this.getAttribute("detail"):this.hasAttribute("compact")?"compact":"full"}updateStatus(t){c.STATUSES[t]&&(this.setAttribute("status",t),this.dispatchEvent(new CustomEvent("status-changed",{detail:{status:t,storyId:this.storyId},bubbles:!0,composed:!0})))}updatePriority(t){c.PRIORITIES[t]&&(this.setAttribute("priority",t),this.dispatchEvent(new CustomEvent("priority-changed",{detail:{priority:t,storyId:this.storyId},bubbles:!0,composed:!0})))}showDetail(){let t=`story-dialog-${this.storyId||this.id||"detail"}`,e=document.getElementById(t);e||(e=document.createElement("dialog"),e.id=t,e.setAttribute("data-size","l"),document.body.appendChild(e));let r=document.createElement("form");r.method="dialog";let s=document.createElement("header"),a=document.createElement("h3");a.textContent=this.storyTitle||this.storyId||"Story Detail";let i=document.createElement("button");i.type="submit",i.setAttribute("aria-label","Close"),i.textContent="\xD7",s.appendChild(a),s.appendChild(i);let o=document.createElement("section"),n=document.createElement("user-story");for(let d of this.getAttributeNames())d==="detail"||d==="compact"||d==="data-upgraded"||d==="draggable"||d==="data-id"||d==="data-quadrant"||n.setAttribute(d,this.getAttribute(d)??"");let l=[...this.children].some(d=>d.getAttribute("slot")&&d.tagName!=="DIALOG");n.setAttribute("detail",l?"full":"compact"),n.removeAttribute("id");for(let d of[...this.children])d.tagName!=="DIALOG"&&n.appendChild(d.cloneNode(!0));o.appendChild(n),r.appendChild(s),r.appendChild(o),e.innerHTML="",e.appendChild(r),e.addEventListener("close",()=>{e.innerHTML=""},{once:!0}),e.showModal()}#n(){let t=c.PRIORITIES[this.priority]||c.PRIORITIES.medium,e=c.STATUSES[this.status]||c.STATUSES.backlog,r=this._detailLevel,s=this.storyId?`User story: ${h(this.storyId)}`:"User story";if(this.shadowRoot){if(r==="minimal"){this.shadowRoot.innerHTML=`
|
|
725
|
+
<style>${rt}</style>
|
|
726
|
+
<article class="story-card story-card--minimal" role="article" aria-label="${s}"
|
|
727
727
|
tabindex="0">
|
|
728
728
|
<div class="story-body">
|
|
729
|
-
${this.storyId?`<span class="story-id">${
|
|
729
|
+
${this.storyId?`<span class="story-id">${h(this.storyId)}</span>`:""}
|
|
730
730
|
<div class="story-title-wrap">
|
|
731
|
-
<slot name="title"><span class="story-title-fallback">${
|
|
731
|
+
<slot name="title"><span class="story-title-fallback">${h(this._minimalLabel||"[describe the action]")}</span></slot>
|
|
732
732
|
</div>
|
|
733
733
|
</div>
|
|
734
734
|
</article>
|
|
735
|
-
`;let
|
|
736
|
-
<style>${
|
|
735
|
+
`;let a=this.shadowRoot.querySelector(".story-card--minimal");if(!a)return;a.addEventListener("click",()=>this.showDetail()),a.addEventListener("keydown",i=>{let o=i;(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),this.showDetail())})}else this.shadowRoot.innerHTML=`
|
|
736
|
+
<style>${rt}</style>
|
|
737
737
|
|
|
738
|
-
<article class="story-card story-card--${
|
|
738
|
+
<article class="story-card story-card--${r}" part="card" role="article" aria-label="${s}">
|
|
739
739
|
<header class="story-header" part="header">
|
|
740
740
|
<div class="story-meta">
|
|
741
|
-
${this.storyId?`<span class="story-id" part="id">${
|
|
742
|
-
${this.epic?`<span class="epic-badge" part="epic">${
|
|
741
|
+
${this.storyId?`<span class="story-id" part="id">${h(this.storyId)}</span>`:""}
|
|
742
|
+
${this.epic?`<span class="epic-badge" part="epic">${h(this.epic)}</span>`:""}
|
|
743
743
|
</div>
|
|
744
744
|
<div class="story-badges">
|
|
745
745
|
<span class="priority-badge" part="priority"
|
|
746
746
|
style="color: ${t.color}; background: ${t.bg};"
|
|
747
|
-
>${
|
|
747
|
+
>${h(t.label)}</span>
|
|
748
748
|
<span class="status-badge" part="status"
|
|
749
749
|
style="color: ${e.color}; background: ${e.bg};"
|
|
750
|
-
>${
|
|
751
|
-
${this.points?`<span class="points-badge" part="points">${
|
|
750
|
+
>${h(e.label)}</span>
|
|
751
|
+
${this.points?`<span class="points-badge" part="points">${h(this.points)}</span>`:""}
|
|
752
752
|
</div>
|
|
753
753
|
</header>
|
|
754
754
|
|
|
755
755
|
<div class="story-body" part="body">
|
|
756
756
|
<p class="story-statement" part="statement">
|
|
757
|
-
<span class="keyword">As a</span>
|
|
758
|
-
${this.personaId?`<a class="persona-text persona-text--link" href="#${
|
|
757
|
+
<span class="keyword">As ${this.#a()}</span>
|
|
758
|
+
${this.personaId?`<a class="persona-text persona-text--link" href="#${h(this.personaId)}">${A(k.user)} <slot name="persona"><span>${h(this.#o()||"user")}</span></slot></a>`:'<span class="persona-text"><slot name="persona"><span>user</span></slot></span>'},
|
|
759
759
|
<span class="keyword">I want</span>
|
|
760
760
|
<span class="action-text"><slot name="action"><span>[describe the action]</span></slot></span>${this.benefit||this.querySelector('[slot="benefit"]')?`
|
|
761
761
|
<span class="keyword">so that</span>
|
|
@@ -807,7 +807,7 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
807
807
|
</div>
|
|
808
808
|
</div>
|
|
809
809
|
</article>
|
|
810
|
-
`,
|
|
810
|
+
`,r==="compact"&&this.shadowRoot.querySelectorAll(".section").forEach(i=>{let o=i.querySelector("slot");o&&o.assignedNodes().length===0&&i.setAttribute("data-empty","")});this.dispatchEvent(new CustomEvent("story-ready",{detail:{id:this.storyId,persona:this.persona,action:this.action,benefit:this.benefit,priority:this.priority,status:this.status,points:this.points},bubbles:!0,composed:!0}))}}};x("user-story",st);var H=`
|
|
811
811
|
:host {
|
|
812
812
|
display: block;
|
|
813
813
|
font-family: var(--_font-sans);
|
|
@@ -1105,31 +1105,31 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
1105
1105
|
.journey__grid-wrap { overflow: visible; }
|
|
1106
1106
|
.row-label, .corner { position: relative; }
|
|
1107
1107
|
}
|
|
1108
|
-
`;var
|
|
1109
|
-
<article class="journey${
|
|
1108
|
+
`;var Jt=0;function S(c,t,e="vb-vt"){if(!c?.isConnected||typeof document>"u"||!("startViewTransition"in document)||matchMedia("(prefers-reduced-motion: reduce)").matches)return t(),null;let r=`${e}-${++Jt}`;c.style.viewTransitionName=r;let s=document.startViewTransition(t);return s.finished.finally(()=>{c.style.viewTransitionName===r&&(c.style.viewTransitionName="")}),s}var Zt=[{key:"actions",label:"Actions"},{key:"thoughts",label:"Thoughts"},{key:"touchpoints",label:"Touchpoints"},{key:"painPoints",label:"Pain Points"},{key:"opportunities",label:"Opportunities"}],at=class extends HTMLElement{static get observedAttributes(){return["src","persona","persona-id","story-ids","compact"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"}),this.__phases=null}get phases(){return this.__phases}set phases(t){this.__phases!==t&&(this.__phases=t,this.isConnected&&this._render(),this.dispatchEvent(new CustomEvent("user-journey:phases-changed",{detail:{phases:t,source:"property"},bubbles:!0,composed:!0})))}get data(){return{persona:this.getAttribute("persona")||void 0,personaId:this.getAttribute("persona-id")||void 0,title:this.querySelector('[slot="title"]')?.textContent?.trim()||void 0,summary:this.querySelector('[slot="summary"]')?.textContent?.trim()||void 0,phases:this.__phases||void 0}}set data(t){if(!(!t||typeof t!="object")){if(t.persona&&this.setAttribute("persona",String(t.persona)),t.personaId&&this.setAttribute("persona-id",String(t.personaId)),t.title&&!this.querySelector('[slot="title"]')){let e=document.createElement("h2");e.slot="title",e.textContent=t.title,this.appendChild(e)}if(t.summary&&!this.querySelector('[slot="summary"]')){let e=document.createElement("p");e.slot="summary",e.textContent=t.summary,this.appendChild(e)}t.phases!=null&&(this.__phases=t.phases),this.isConnected&&this._render(),this.dispatchEvent(new CustomEvent("user-journey:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0}))}}#t(){for(let t of this.children){let e=t.getAttribute("slot");e&&this.#e.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#e.get(t)||""}connectedCallback(){this.#t(),this.setAttribute("data-upgraded",""),this.hasAttribute("src")?this._loadSrc(this.getAttribute("src")):this._render()}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t){this.isConnected&&(t==="src"?this._loadSrc(this.getAttribute("src")):this._render())}async _loadSrc(t){if(!t)return;let e=this.shadowRoot;e.innerHTML=`<style>${H}</style><div class="state-msg">Loading\u2026</div>`;try{let r=await fetch(t);if(!r.ok)throw new Error(`HTTP ${r.status}`);let s=await r.json();if(s.persona&&this.setAttribute("persona",s.persona),s.personaId&&this.setAttribute("persona-id",s.personaId),s.title&&!this.querySelector('[slot="title"]')){let a=document.createElement("h2");a.slot="title",a.textContent=s.title,this.appendChild(a)}if(s.summary&&!this.querySelector('[slot="summary"]')){let a=document.createElement("p");a.slot="summary",a.textContent=s.summary,this.appendChild(a)}this.__phases=s.phases||[],this._render()}catch(r){e.innerHTML=`<style>${H}</style><div class="state-msg state-msg--error">Could not load journey: ${h(r.message)}</div>`}}_render(){let t=this._resolve("persona")||"",e=this._resolve("persona-id")||"",r=(this.getAttribute("story-ids")||"").split(",").map(p=>p.trim()).filter(Boolean),s=this.hasAttribute("compact"),a=this.__phases,i=!!this.querySelector('[slot="summary"]')||this.#e.has("summary"),o=this.querySelector('[slot="title"]')?.textContent?.trim()||this.#e.get("title")||"",n=`<style>${H}</style>
|
|
1109
|
+
<article class="journey${s?" journey--compact":""}">
|
|
1110
1110
|
|
|
1111
1111
|
<header class="journey__header">
|
|
1112
1112
|
<div class="journey__header-top">
|
|
1113
1113
|
<div class="journey__chips">
|
|
1114
1114
|
<span class="chip chip--type">Journey Map</span>
|
|
1115
|
-
${
|
|
1115
|
+
${r.map(p=>`<a class="chip chip--story" href="#${p}">${this._label(p)}</a>`).join("")}
|
|
1116
1116
|
</div>
|
|
1117
1117
|
${t?`
|
|
1118
1118
|
<div class="journey__persona">
|
|
1119
|
-
${e?`<a class="persona-ref" href="#${e}">${A(k.user)} ${
|
|
1119
|
+
${e?`<a class="persona-ref" href="#${e}">${A(k.user)} ${h(t)}</a>`:`<span class="persona-ref">${A(k.user)} ${h(t)}</span>`}
|
|
1120
1120
|
</div>`:""}
|
|
1121
1121
|
</div>
|
|
1122
1122
|
<div class="journey__title-wrap">
|
|
1123
1123
|
<slot name="title"><h2 class="journey__title">User Journey</h2></slot>
|
|
1124
1124
|
</div>
|
|
1125
|
-
${
|
|
1125
|
+
${i?'<div class="journey__summary-wrap"><slot name="summary"></slot></div>':""}
|
|
1126
1126
|
</header>
|
|
1127
1127
|
|
|
1128
|
-
${
|
|
1128
|
+
${a&&a.length?this._curve(a)+this._grid(a):`<div class="journey__placeholder">
|
|
1129
1129
|
<p>Add phase data via <code>src</code> (JSON) or set <code>.phases</code> programmatically.</p>
|
|
1130
1130
|
</div>`}
|
|
1131
1131
|
|
|
1132
|
-
</article>`,
|
|
1132
|
+
</article>`,l=this.shadowRoot,d=()=>{l.innerHTML=n};l.querySelector("article")?S(this,d,"uj-vt"):d(),this.dispatchEvent(new CustomEvent("journey-ready",{bubbles:!0,composed:!0,detail:{title:o,persona:t,phaseCount:a?a.length:0}}))}_curve(t){let n=t.length,l=g=>28+(n<2?944/2:g/(n-1)*944),d=g=>14+(1-(q[g.emotion]||q.neutral).score)*72,p=t.map((g,v)=>({x:l(v),y:d(g),ph:g})),u=`M ${p[0].x},${p[0].y}`;for(let g=1;g<p.length;g++){let v=p[g-1],y=p[g],_=(v.x+y.x)/2;u+=` C ${_},${v.y} ${_},${y.y} ${y.x},${y.y}`}let m=`uj-${Math.random().toString(36).slice(2,8)}`,f=p.at(-1);return`
|
|
1133
1133
|
<div class="journey__curve" aria-hidden="true">
|
|
1134
1134
|
<svg viewBox="0 0 1000 100" preserveAspectRatio="none" class="curve-svg">
|
|
1135
1135
|
<defs>
|
|
@@ -1141,37 +1141,37 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
1141
1141
|
<rect x="0" y="0" width="1000" height="${100*.4}" class="zone zone--pos"/>
|
|
1142
1142
|
<rect x="0" y="${100*.4}" width="1000" height="${100*.2}" class="zone zone--neu"/>
|
|
1143
1143
|
<rect x="0" y="${100*.6}" width="1000" height="${100*.4}" class="zone zone--neg"/>
|
|
1144
|
-
${
|
|
1145
|
-
<path d="${
|
|
1146
|
-
<path d="${
|
|
1147
|
-
${
|
|
1144
|
+
${p.map(({x:g})=>`<line x1="${g}" y1="0" x2="${g}" y2="100" class="vline"/>`).join("")}
|
|
1145
|
+
<path d="${u} L ${f.x},100 L ${p[0].x},100 Z" fill="url(#${m})"/>
|
|
1146
|
+
<path d="${u}" fill="none" class="curve-line"/>
|
|
1147
|
+
${p.map(({x:g,y:v,ph:y})=>{let _=q[y.emotion]||q.neutral;return`<circle cx="${g}" cy="${v}" r="5" class="dot" style="fill:${_.color}"/>`}).join("")}
|
|
1148
1148
|
</svg>
|
|
1149
|
-
</div>`}_grid(t){let e=t.map((
|
|
1150
|
-
<th class="phase-head" data-emotion="${
|
|
1151
|
-
style="--ec:${
|
|
1152
|
-
<span class="ph-num">${
|
|
1153
|
-
<span class="ph-name">${
|
|
1154
|
-
<span class="ph-emoji" title="${
|
|
1149
|
+
</div>`}_grid(t){let e=t.map((s,a)=>{let i=q[s.emotion]||q.neutral,o=s.storyIds||[];return`
|
|
1150
|
+
<th class="phase-head" data-emotion="${s.emotion||"neutral"}"
|
|
1151
|
+
style="--ec:${i.color}">
|
|
1152
|
+
<span class="ph-num">${a+1}</span>
|
|
1153
|
+
<span class="ph-name">${h(s.name||"")}</span>
|
|
1154
|
+
<span class="ph-emoji" title="${s.emotion||"neutral"}"><span role="img" aria-label="${h(s.emotion||"neutral")}">${i.emoji}</span></span>
|
|
1155
1155
|
${o.length?`<div class="ph-stories">${o.map(n=>`<a class="chip chip--story" href="#${n}">${this._label(n)}</a>`).join("")}</div>`:""}
|
|
1156
|
-
</th>`}).join(""),
|
|
1157
|
-
${n.map(
|
|
1156
|
+
</th>`}).join(""),r=Zt.map(({key:s,label:a})=>{let i=t.map(o=>{let n=o[s]||[];return n.length?`<td class="data-cell data-cell--${s.toLowerCase()}">
|
|
1157
|
+
${n.map(l=>`<p>${h(l)}</p>`).join("")}
|
|
1158
1158
|
</td>`:'<td class="data-cell data-cell--empty">\u2014</td>'}).join("");return`
|
|
1159
|
-
<tr class="grid-row grid-row--${
|
|
1160
|
-
<th class="row-label">${
|
|
1161
|
-
${
|
|
1159
|
+
<tr class="grid-row grid-row--${s.toLowerCase()}">
|
|
1160
|
+
<th class="row-label">${a}</th>
|
|
1161
|
+
${i}
|
|
1162
1162
|
</tr>`}).join("");return`
|
|
1163
1163
|
<div class="journey__grid-wrap">
|
|
1164
1164
|
<table class="journey__grid"
|
|
1165
|
-
aria-label="${
|
|
1165
|
+
aria-label="${h(this.getAttribute("title")||"User Journey")} \u2014 phase breakdown">
|
|
1166
1166
|
<thead>
|
|
1167
1167
|
<tr>
|
|
1168
1168
|
<th class="corner">Stage</th>
|
|
1169
1169
|
${e}
|
|
1170
1170
|
</tr>
|
|
1171
1171
|
</thead>
|
|
1172
|
-
<tbody>${
|
|
1172
|
+
<tbody>${r}</tbody>
|
|
1173
1173
|
</table>
|
|
1174
|
-
</div>`}_label(t){return t.replace(/^(activity|persona|journey|story|user)-/,"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("user-journey",
|
|
1174
|
+
</div>`}_label(t){return t.replace(/^(activity|persona|journey|story|user)-/,"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("user-journey",at);var U=`
|
|
1175
1175
|
:host {
|
|
1176
1176
|
display: block;
|
|
1177
1177
|
font-family: var(--_font-sans);
|
|
@@ -1684,8 +1684,8 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
1684
1684
|
.state-msg { padding: var(--_space-l); font-size: var(--_font-sm); color: var(--_muted); font-style: italic; }
|
|
1685
1685
|
.state-msg--error { color: var(--color-error-text, var(--color-error, #dc2626)); }
|
|
1686
1686
|
code { font-family: var(--font-mono, Monaco, Menlo, monospace); font-size: 0.88em; }
|
|
1687
|
-
`;var
|
|
1688
|
-
<article class="empathy-map${
|
|
1687
|
+
`;var it=["says","thinks","does","feels"],ot=class extends HTMLElement{static get observedAttributes(){return["persona","persona-id","src","editable","compact"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"}),this.__quadrants=null,this.__goals=null,this.__painPoints=null,this._editingQuadrants=new Set}get quadrants(){return this.__quadrants}set quadrants(t){this.__quadrants=t,this.isConnected&&this._render()}get goals(){return this.__goals}set goals(t){this.__goals=t,this.isConnected&&this._render()}get painPoints(){return this.__painPoints}set painPoints(t){this.__painPoints=t,this.isConnected&&this._render()}#t(){for(let t of this.children){let e=t.getAttribute("slot");e&&this.#e.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#e.get(t)||""}connectedCallback(){this.#t(),this.setAttribute("data-upgraded",""),this.hasAttribute("src")?this._loadSrc(this.getAttribute("src")):this._render()}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t){this.isConnected&&(t==="src"?this._loadSrc(this.getAttribute("src")):this._render())}get data(){let t=this.querySelector('[slot="title"]'),e=this.querySelector('[slot="summary"]');return{persona:this.getAttribute("persona")||void 0,personaId:this.getAttribute("persona-id")||void 0,title:t?.textContent?.trim()||void 0,summary:e?.textContent?.trim()||void 0,quadrants:this.__quadrants||void 0,goals:this.__goals||void 0,painPoints:this.__painPoints||void 0}}set data(t){if(!(!t||typeof t!="object")){if(t.persona&&this.setAttribute("persona",String(t.persona)),t.personaId&&this.setAttribute("persona-id",String(t.personaId)),t.title&&!this.querySelector('[slot="title"]')){let e=document.createElement("h2");e.slot="title",e.textContent=t.title,this.appendChild(e)}if(t.summary&&!this.querySelector('[slot="summary"]')){let e=document.createElement("p");e.slot="summary",e.textContent=t.summary,this.appendChild(e)}t.quadrants!=null&&(this.__quadrants=t.quadrants),t.goals!=null&&(this.__goals=t.goals),t.painPoints!=null&&(this.__painPoints=t.painPoints),this.isConnected&&this._render(),this.dispatchEvent(new CustomEvent("empathy-map:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0}))}}editQuadrant(t){it.includes(t)&&this.hasAttribute("editable")&&this._openEdit(t)}closeQuadrant(t){it.includes(t)&&this._closeEdit(t)}async _loadSrc(t){if(!(!t||!this.shadowRoot)){this.shadowRoot.innerHTML=`<style>${U}</style><div class="state-msg">Loading\u2026</div>`;try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();if(r.persona&&this.setAttribute("persona",r.persona),r.personaId&&this.setAttribute("persona-id",r.personaId),r.title&&!this.querySelector('[slot="title"]')){let s=document.createElement("h2");s.slot="title",s.textContent=r.title,this.appendChild(s)}if(r.summary&&!this.querySelector('[slot="summary"]')){let s=document.createElement("p");s.slot="summary",s.textContent=r.summary,this.appendChild(s)}this.__quadrants=r.quadrants||null,this.__goals=r.goals||null,this.__painPoints=r.painPoints||null,this._render()}catch(e){if(!this.shadowRoot)return;let r=e instanceof Error?e.message:String(e);this.shadowRoot.innerHTML=`<style>${U}</style><div class="state-msg state-msg--error">Could not load empathy map: ${h(r)}</div>`}}}_render(){let t=this._resolve("persona")||"",e=this._resolve("persona-id")||"",r=this.hasAttribute("compact"),s=this.hasAttribute("editable"),a=!!this.querySelector('[slot="title"]')||this.#e.has("title"),i=!!this.querySelector('[slot="summary"]')||this.#e.has("summary"),o=this.__goals?.length||this.querySelector('[slot="goals"]'),n=this.__painPoints?.length||this.querySelector('[slot="pain-points"]'),l=`<style>${U}</style>
|
|
1688
|
+
<article class="empathy-map${r?" empathy-map--compact":""}">
|
|
1689
1689
|
|
|
1690
1690
|
<header class="empathy-map__header">
|
|
1691
1691
|
<div class="empathy-map__header-top">
|
|
@@ -1694,17 +1694,17 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
1694
1694
|
</div>
|
|
1695
1695
|
${t?`
|
|
1696
1696
|
<div class="empathy-map__persona">
|
|
1697
|
-
${e?`<a class="persona-ref" href="#${
|
|
1697
|
+
${e?`<a class="persona-ref" href="#${h(e)}">${A(k.user)} ${h(t)}</a>`:`<span class="persona-ref">${A(k.user)} ${h(t)}</span>`}
|
|
1698
1698
|
</div>`:""}
|
|
1699
1699
|
</div>
|
|
1700
1700
|
<div class="empathy-map__title-wrap">
|
|
1701
1701
|
<slot name="title"><h2 class="empathy-map__title">Empathy Map</h2></slot>
|
|
1702
1702
|
</div>
|
|
1703
|
-
${
|
|
1703
|
+
${i?'<div class="empathy-map__summary-wrap"><slot name="summary"></slot></div>':""}
|
|
1704
1704
|
</header>
|
|
1705
1705
|
|
|
1706
1706
|
<div class="empathy-map__grid">
|
|
1707
|
-
${
|
|
1707
|
+
${it.map(p=>this._renderQuadrant(p,s)).join("")}
|
|
1708
1708
|
</div>
|
|
1709
1709
|
|
|
1710
1710
|
${o||n?`
|
|
@@ -1714,45 +1714,45 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
1714
1714
|
</footer>
|
|
1715
1715
|
`:""}
|
|
1716
1716
|
|
|
1717
|
-
</article>`,
|
|
1717
|
+
</article>`,d=()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=l,s&&this._bindEditListeners())};this.shadowRoot?.querySelector("article")?S(this,d,"em-vt"):d(),this.dispatchEvent(new CustomEvent("empathy-map:ready",{bubbles:!0,composed:!0,detail:{title:this.querySelector('[slot="title"]')?.textContent?.trim()||"Empathy Map",persona:t}}))}_renderQuadrant(t,e){let r=Z[t],s=this.__quadrants?.[t],a=this._editingQuadrants.has(t),i=s&&s.length?t==="feels"?s.map(n=>this._renderEmotion(n)).join(""):s.map(n=>`<p>${h(n)}</p>`).join(""):`<slot name="${t}"><p class="placeholder">Add ${r.label.toLowerCase()} items\u2026</p></slot>`,o=s?.length?s.join(`
|
|
1718
1718
|
`):"";return`
|
|
1719
|
-
<section class="quadrant quadrant--${t}"${
|
|
1719
|
+
<section class="quadrant quadrant--${t}"${a?" data-editing":""}>
|
|
1720
1720
|
<div class="quadrant__inner">
|
|
1721
1721
|
<div class="quadrant__header">
|
|
1722
|
-
<div class="quadrant__icon" aria-hidden="true">${A(
|
|
1723
|
-
<span class="quadrant__label">${
|
|
1722
|
+
<div class="quadrant__icon" aria-hidden="true">${A(r.icon)}</div>
|
|
1723
|
+
<span class="quadrant__label">${r.label}</span>
|
|
1724
1724
|
${e?`<button class="quadrant__edit-btn" data-quadrant="${t}"
|
|
1725
|
-
aria-label="Edit ${
|
|
1725
|
+
aria-label="Edit ${r.label}" title="Edit ${r.label}">${A(k.pencil)}</button>`:""}
|
|
1726
1726
|
</div>
|
|
1727
1727
|
<div class="quadrant__faces">
|
|
1728
|
-
<div class="quadrant__face quadrant__face--front"${
|
|
1728
|
+
<div class="quadrant__face quadrant__face--front"${a?" inert":""}>
|
|
1729
1729
|
<div class="quadrant__content">
|
|
1730
|
-
${
|
|
1730
|
+
${i}
|
|
1731
1731
|
</div>
|
|
1732
1732
|
</div>
|
|
1733
1733
|
${e?`
|
|
1734
|
-
<div class="quadrant__face quadrant__face--back"${
|
|
1734
|
+
<div class="quadrant__face quadrant__face--back"${a?"":" inert"}>
|
|
1735
1735
|
<textarea class="quadrant__editor" data-quadrant="${t}"
|
|
1736
1736
|
placeholder="One item per line\u2026"
|
|
1737
|
-
aria-label="Edit ${
|
|
1737
|
+
aria-label="Edit ${r.label} items">${h(o)}</textarea>
|
|
1738
1738
|
<button class="quadrant__done-btn" data-quadrant="${t}"
|
|
1739
|
-
aria-label="Done editing ${
|
|
1739
|
+
aria-label="Done editing ${r.label}">${A(k.check)} Done</button>
|
|
1740
1740
|
</div>
|
|
1741
1741
|
`:""}
|
|
1742
1742
|
</div>
|
|
1743
1743
|
</div>
|
|
1744
|
-
</section>`}_renderEmotion(t){let e=t.toLowerCase().trim(),
|
|
1744
|
+
</section>`}_renderEmotion(t){let e=t.toLowerCase().trim(),r=q[e];return r?`<span class="emotion-tag" style="--ec:${r.color}"><span role="img" aria-label="${h(t)}">${r.emoji}</span> ${h(t)}</span>`:`<p>${h(t)}</p>`}_renderSummaryRow(t,e,r){let a=(t==="pain-points"?"painPoints":t)==="painPoints"?this.__painPoints:this.__goals,i=a?.length?a.map(o=>`<p>${h(o)}</p>`).join(""):`<slot name="${t}"><p class="placeholder">No ${r.toLowerCase()} specified.</p></slot>`;return`
|
|
1745
1745
|
<div class="summary-row">
|
|
1746
1746
|
<span class="summary-row__icon" aria-hidden="true">${e}</span>
|
|
1747
1747
|
<div class="summary-row__body">
|
|
1748
|
-
<div class="summary-row__label">${
|
|
1749
|
-
<div class="summary-row__content">${
|
|
1748
|
+
<div class="summary-row__label">${r}</div>
|
|
1749
|
+
<div class="summary-row__content">${i}</div>
|
|
1750
1750
|
</div>
|
|
1751
|
-
</div>`}_bindEditListeners(){let t=this.shadowRoot;t&&(t.querySelectorAll(".quadrant__edit-btn").forEach(e=>{e.addEventListener("click",()=>{let
|
|
1752
|
-
`);else{let o=e.querySelector(`slot[name="${t}"]`);if(o){let n=o.assignedElements();if(n.length){let
|
|
1753
|
-
`)}}}
|
|
1754
|
-
`).map(n=>n.trim()).filter(Boolean);this.__quadrants||(this.__quadrants={}),this.__quadrants[t]=a;let o=e.querySelector(".quadrant__content");if(o)if(a.length)o.innerHTML=t==="feels"?a.map(n=>this._renderEmotion(n)).join(""):a.map(n=>`<p>${g(n)}</p>`).join("");else{let n=rt[t];o.innerHTML=`<p class="placeholder">Add ${n.label.toLowerCase()} items\u2026</p>`}}this._editingQuadrants.delete(t),e.removeAttribute("data-editing");let r=e.querySelector(".quadrant__face--front"),i=e.querySelector(".quadrant__face--back");r&&r.removeAttribute("inert"),i&&i.setAttribute("inert",""),this.dispatchEvent(new CustomEvent("empathy-map:update",{bubbles:!0,composed:!0,detail:{quadrant:t,items:this.__quadrants?.[t]||[]}}))}};x("empathy-map",dt);function Y({newItems:c,nodes:t,keyOf:e,renderItem:s,containerFor:r}){let i=[],a=[],o=[],n=new Set;for(let l of c)n.add(e(l));for(let[l,u]of[...t])n.has(l)||(u.remove(),t.delete(l),o.push(l));let d=new Map;for(let l of c){let u=e(l),h=t.get(u)||null,m=r(l,h);d.has(m)||d.set(m,[]),d.get(m)?.push({item:l,key:u,existing:h})}for(let[l,u]of d)for(let h=0;h<u.length;h++){let{item:m,key:f,existing:p}=u[h],b=p;b?(b.parentElement!==l||l.children[h]!==b)&&a.push(f):(b=s(m),t.set(f,b),i.push(f));let y=l.children[h];y!==b&&l.insertBefore(b,y||null)}return{added:i,moved:a,removed:o}}var ut=class c extends C{static QUADRANTS=["quick-wins","big-bets","fill-ins","money-pit"];static LABELS={"quick-wins":"Quick Wins","big-bets":"Big Bets","fill-ins":"Fill-Ins","money-pit":"Money Pit"};static DESCRIPTIONS={"quick-wins":"High impact \xB7 Low effort","big-bets":"High impact \xB7 High effort","fill-ins":"Low impact \xB7 Low effort","money-pit":"Low impact \xB7 High effort"};static#e=0;static get observedAttributes(){return["src","compact","title"]}#s=null;#t={};#i=null;#r="";#o=null;setup(){this.#r=`ie-${++c.#e}`;let t=[...this.querySelectorAll(":scope > [data-quadrant], :scope > [draggable]")],e=document.createElement("div");e.className="ie-wrapper";let s=document.createElement("div");s.className="ie-y-label",s.setAttribute("aria-hidden","true"),s.textContent="Impact \u2191";let r=document.createElement("div");r.style.cssText="display:flex;flex-direction:column;flex:1;min-width:0;";let i=document.createElement("div");i.className="ie-grid",i.setAttribute("role","region"),i.setAttribute("aria-label","Impact-Effort prioritization matrix");let a=document.createElement("div");a.className="ie-x-label",a.setAttribute("aria-hidden","true"),a.textContent="Effort \u2192";for(let l of c.QUADRANTS){let u=document.createElement("section");u.className="ie-quadrant",u.dataset.quadrantZone=l,u.setAttribute("aria-label",`${c.LABELS[l]}: ${c.DESCRIPTIONS[l]}`);let h=document.createElement("header");h.className="ie-quadrant-label",h.innerHTML=`${c.LABELS[l]}<br><span class="ie-quadrant-desc">${c.DESCRIPTIONS[l]}</span>`;let m=document.createElement("drag-surface");m.setAttribute("group",this.#r),m.setAttribute("aria-label",c.LABELS[l]),m.setAttribute("data-layout","stack"),m.setAttribute("data-layout-gap","xs"),u.appendChild(h),u.appendChild(m),i.appendChild(u),this.#t[l]=m}t.forEach((l,u)=>{let h=l,m=h.getAttribute("data-quadrant")||"quick-wins",f=this.#t[m]||this.#t["quick-wins"];h.hasAttribute("draggable")||h.setAttribute("draggable","true"),h.hasAttribute("data-id")||(h.dataset.id=`ie-item-${u}`),f.appendChild(h)});let o=document.createElement("div");o.className="ie-live-region",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic","true");let n=this.getAttribute("title");if(n){let l=document.createElement("h3");l.className="ie-title",l.textContent=n,this.prepend(l)}r.appendChild(i),r.appendChild(a),e.appendChild(s),e.appendChild(r),this.appendChild(e),this.appendChild(o),this.#s=i,this.#i=o,this.#o=e,this.listen(this,"drag-surface:transfer",l=>{let{item:u,fromSurface:h,toSurface:m}=l.detail,f=this.#c(h),p=this.#c(m);!f||!p||(u.setAttribute("data-quadrant",p),this.#p(`Moved ${this.#d(u)} to ${c.LABELS[p]}`),this.dispatchEvent(new CustomEvent("impact-effort:move",{bubbles:!0,detail:{itemId:u.dataset.id,from:f,to:p,item:u}})))});let d=this.getAttribute("src");d&&this.#l(d),this.#u()}teardown(){this.#o&&(this.#o.remove(),this.#o=null),this.#i&&(this.#i.remove(),this.#i=null),this.#s=null,this.#t={},this.#n.clear(),this.#a=[]}#a=[];#n=new Map;get items(){if(this.#a.length)return this.#a;let t=[];for(let[e,s]of Object.entries(this.#t))for(let r of s.querySelectorAll(':scope > [draggable="true"]'))t.push({id:r.getAttribute("data-id")||void 0,quadrant:e,text:r.textContent?.trim()||void 0});return t}set items(t){if(!this.#s)return;let e=Array.isArray(t)?t:[];Y({newItems:e,nodes:this.#n,keyOf:s=>s.id??`${s.quadrant}:${s.text}`,renderItem:s=>{let r=this;if(typeof r.renderItem=="function"){let a=r.renderItem(s);if(a instanceof Element)return a.hasAttribute("draggable")||a.setAttribute("draggable","true"),a.hasAttribute("data-id")||a.setAttribute("data-id",String(s.id??"")),a}let i=document.createElement("article");return i.className="ie-card",i.setAttribute("draggable","true"),s.id&&i.setAttribute("data-id",String(s.id)),i.textContent=s.text||s.id||"",i},containerFor:s=>this.#t[s.quadrant]||this.#t["quick-wins"]}),this.#a=e,this.dispatchEvent(new CustomEvent("impact-effort:items-changed",{detail:{items:e,source:"property"},bubbles:!0}))}attributeChangedCallback(t,e,s){this.hasAttribute("data-upgraded")&&t==="src"&&s&&s!==e&&this.#l(s)}async#l(t){try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();if(!Array.isArray(s))return;let r=()=>{for(let i of c.QUADRANTS){let a=this.#t[i];if(a)for(let o of[...a.querySelectorAll("[draggable]")])o.remove()}s.forEach((i,a)=>{let o=i.quadrant||"quick-wins",n=i.id||`ie-item-${a}`,d;i.persona||i.action||i.storyId?(d=document.createElement("user-story"),d.setAttribute("detail","minimal"),i.storyId&&d.setAttribute("story-id",i.storyId),i.persona&&d.setAttribute("persona",i.persona),i.action&&d.setAttribute("action",i.action),i.benefit&&d.setAttribute("benefit",i.benefit),i.priority&&d.setAttribute("priority",i.priority),i.status&&d.setAttribute("status",i.status),i.points&&d.setAttribute("points",String(i.points))):(d=document.createElement("article"),d.textContent=i.label||i.text||""),d.setAttribute("draggable","true"),d.dataset.id=n,d.dataset.quadrant=o,(this.#t[o]||this.#t["quick-wins"]).appendChild(d)})};this.hasAttribute("data-upgraded")&&this.#s?q(this,r,"ie-vt"):r(),this.#u()}catch(e){console.warn(`[impact-effort] Failed to load src="${t}":`,e)}}#c(t){for(let[e,s]of Object.entries(this.#t))if(s===t)return e;return null}#p(t){let e=this.#i;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#d(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#u(){let t={};for(let e of c.QUADRANTS){let s=this.#t[e];t[e]=s?s.querySelectorAll('[draggable="true"]').length:0}this.dispatchEvent(new CustomEvent("impact-effort:ready",{bubbles:!0,detail:{quadrantCounts:t}}))}};x("impact-effort",ut);var ht=class c extends C{static#e=0;setup(){this.#d=`qg-${++c.#e}`;let t=this.getAttribute("x-label")||"",e=this.getAttribute("y-label")||"",s=this.getAttribute("x-low")||"Low",r=this.getAttribute("x-high")||"High",i=this.getAttribute("y-low")||"Low",a=this.getAttribute("y-high")||"High",o=[this.getAttribute("q1-label")||"Q1",this.getAttribute("q2-label")||"Q2",this.getAttribute("q3-label")||"Q3",this.getAttribute("q4-label")||"Q4"],n=this.hasAttribute("draggable"),d=[...this.querySelectorAll(":scope > [data-quadrant], :scope > [data-x][data-y]")],l=document.createElement("section");l.className="qg-wrapper",l.setAttribute("role","region"),l.setAttribute("aria-label",`${e} \xD7 ${t} quadrant grid`);let u=document.createElement("header");u.className="qg-y-label",u.setAttribute("aria-hidden","true"),u.textContent=`\u2191 ${e}`;let h=document.createElement("aside");h.className="qg-y-scale",h.setAttribute("aria-hidden","true"),h.innerHTML=`<span>${a}</span><span>${i}</span>`;let m=document.createElement("div");m.className="qg-grid";let f=document.createElement("aside");f.className="qg-x-scale",f.setAttribute("aria-hidden","true"),f.innerHTML=`<span>${s}</span><span>${r}</span>`;let p=document.createElement("footer");p.className="qg-x-label",p.setAttribute("aria-hidden","true"),p.textContent=`${t} \u2192`;for(let y=0;y<4;y++){let _=document.createElement("section");_.className="qg-quadrant",_.dataset.quadrantZone=String(y),_.setAttribute("aria-label",o[y]);let v=document.createElement("header");if(v.className="qg-quadrant-label",v.textContent=o[y],_.appendChild(v),n){let w=document.createElement("drag-surface");w.setAttribute("group",this.#d),w.setAttribute("aria-label",o[y]),w.setAttribute("data-layout","stack"),w.setAttribute("data-layout-gap","xs"),_.appendChild(w),this.#u[y]=w}else{let w=document.createElement("ul");w.className="qg-items",_.appendChild(w),this.#m[y]=w}m.appendChild(_),this.#y[y]=_}d.forEach((y,_)=>{let v=y,w=this.#n(v),T=n?this.#u[w]:this.#m[w];if(n&&(v.hasAttribute("draggable")||v.setAttribute("draggable","true")),v.hasAttribute("data-id")||(v.dataset.id=`qg-item-${_}`),v.hasAttribute("data-x")&&v.hasAttribute("data-y")){let E=parseFloat(v.getAttribute("data-x")??""),$=parseFloat(v.getAttribute("data-y")??"");if(Number.isFinite(E)&&Number.isFinite($)){let I=w===0||w===3?(E-.5)*2:E*2,H=w===0||w===1?($-.5)*2:$*2;if(v.style.setProperty("--qg-local-x",I.toFixed(4)),v.style.setProperty("--qg-local-y",H.toFixed(4)),v.classList.add("qg-pinned"),!v.style.getPropertyValue("--qg-pin-hue")){let Kt=v.dataset.id||(v.textContent||"").trim();v.style.setProperty("--qg-pin-hue",`${c.#o(Kt)}deg`)}}}if(n)T.appendChild(v);else{let E=document.createElement("li");E.appendChild(v),T.appendChild(E)}});let b=document.createElement("div");b.className="qg-live-region visually-hidden",b.setAttribute("role","status"),b.setAttribute("aria-live","polite"),l.appendChild(u),l.appendChild(h),l.appendChild(m),l.appendChild(f),l.appendChild(p),this.appendChild(l),this.appendChild(b),this.#h=m,this.#v=b,this.#x=o,n&&this.listen(this,"drag-surface:transfer",this.#a),this.#s()}#s(){if(typeof ResizeObserver>"u")return;let t=e=>{let s=e.offsetWidth,r=e.offsetHeight;s>0&&e.style.setProperty("--qg-pin-half-w",`${s/2}px`),r>0&&e.style.setProperty("--qg-pin-half-h",`${r/2}px`)};this.#f=new ResizeObserver(e=>{for(let s of e)t(s.target);this.#t()});for(let e of this.querySelectorAll(".qg-pinned"))this.#f.observe(e);this.#t()}#t(){this.#g||(this.#g=requestAnimationFrame(()=>{this.#g=0,this.#i()}))}#i(){for(let e of this.querySelectorAll(".qg-pinned")){let s=e;s.classList.remove("qg-clustered"),s.style.removeProperty("--qg-cluster-i"),s.style.removeProperty("--qg-cluster-n"),delete s.dataset.cluster,s.dataset.qgTabbed!==void 0&&(s.removeAttribute("tabindex"),delete s.dataset.qgTabbed)}let t=0;for(let e=0;e<4;e++){let s=this.#y[e];if(!s)continue;let r=[...s.querySelectorAll(".qg-pinned")];if(r.length<2)continue;let i=r.map(l=>l.getBoundingClientRect()),a=Array.from({length:r.length},(l,u)=>u),o=l=>a[l]===l?l:a[l]=o(a[l]),n=(l,u)=>{let h=o(l),m=o(u);h!==m&&(a[h]=m)};for(let l=0;l<r.length;l++)for(let u=l+1;u<r.length;u++)c.#r(i[l],i[u])&&n(l,u);let d=new Map;for(let l=0;l<r.length;l++){let u=o(l);d.has(u)||d.set(u,[]),d.get(u)?.push(l)}for(let l of d.values()){if(l.length<2)continue;let u=`c${++t}`;l.forEach((h,m)=>{let f=r[h];f.classList.add("qg-clustered"),f.dataset.cluster=u,f.style.setProperty("--qg-cluster-i",String(m)),f.style.setProperty("--qg-cluster-n",String(l.length)),!f.hasAttribute("tabindex")&&!f.matches("a, button, [contenteditable]")&&(f.setAttribute("tabindex","0"),f.dataset.qgTabbed="")})}}}teardown(){this.#f?.disconnect(),this.#f=null,this.#g&&cancelAnimationFrame(this.#g),this.#g=0}static#r(t,e){return!(t.right<=e.left||e.right<=t.left||t.bottom<=e.top||e.bottom<=t.top)}static#o(t){let e=5381;for(let s=0;s<t.length;s++)e=(e<<5)+e+t.charCodeAt(s)|0;return(e%360+360)%360}#a=t=>{let{item:e,fromSurface:s,toSurface:r}=t.detail,i=this.#l(s),a=this.#l(r);i==null||a==null||(e.setAttribute("data-quadrant",String(a)),this.#p(`Moved ${this.#c(e)} to ${this.#x[a]}`),this.dispatchEvent(new CustomEvent("quadrant-grid:move",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,from:i,to:a}})))};#n(t){let e=parseInt(t.getAttribute("data-quadrant"),10);if(e>=0&&e<=3)return e;if(t.hasAttribute("data-x")&&t.hasAttribute("data-y")){let s=parseFloat(t.getAttribute("data-x")),r=parseFloat(t.getAttribute("data-y"));return c.quadrantFor(s,r)}return 0}static quadrantFor(t,e){let s=t>=.5,r=e>=.5;return r&&s?0:r&&!s?1:!r&&!s?2:3}#l(t){for(let e=0;e<4;e++)if(this.#u[e]===t)return e;return null}#c(t){return(t.textContent||"").trim().split(`
|
|
1755
|
-
`)[0]||"item"}#
|
|
1751
|
+
</div>`}_bindEditListeners(){let t=this.shadowRoot;t&&(t.querySelectorAll(".quadrant__edit-btn").forEach(e=>{e.addEventListener("click",()=>{let r=e.dataset.quadrant;r&&this._openEdit(r)})}),t.querySelectorAll(".quadrant__done-btn").forEach(e=>{e.addEventListener("click",()=>{let r=e.dataset.quadrant;r&&this._closeEdit(r)})}),t.querySelectorAll(".quadrant__editor").forEach(e=>{let r=e;r.addEventListener("keydown",s=>{let a=s;if(a.key==="Escape"){a.preventDefault();let i=r.dataset.quadrant;i&&this._closeEdit(i)}})}))}_openEdit(t){this._editingQuadrants.add(t);let e=this.shadowRoot?.querySelector(`.quadrant--${t}`);if(!e)return;e.setAttribute("data-editing","");let r=e.querySelector(".quadrant__face--front"),s=e.querySelector(".quadrant__face--back");r&&r.setAttribute("inert",""),s&&s.removeAttribute("inert");let a=e.querySelector(".quadrant__editor");if(a){let i=this.__quadrants?.[t];if(i?.length)a.value=i.join(`
|
|
1752
|
+
`);else{let o=e.querySelector(`slot[name="${t}"]`);if(o){let n=o.assignedElements();if(n.length){let l=[];n.forEach(d=>{let p=d.querySelectorAll("li");p.length?p.forEach(u=>l.push(u.textContent?.trim()??"")):l.push(d.textContent?.trim()??"")}),a.value=l.filter(Boolean).join(`
|
|
1753
|
+
`)}}}a.focus()}}_closeEdit(t){let e=this.shadowRoot?.querySelector(`.quadrant--${t}`);if(!e)return;let r=e.querySelector(".quadrant__editor");if(r){let i=r.value.split(`
|
|
1754
|
+
`).map(n=>n.trim()).filter(Boolean);this.__quadrants||(this.__quadrants={}),this.__quadrants[t]=i;let o=e.querySelector(".quadrant__content");if(o)if(i.length)o.innerHTML=t==="feels"?i.map(n=>this._renderEmotion(n)).join(""):i.map(n=>`<p>${h(n)}</p>`).join("");else{let n=Z[t];o.innerHTML=`<p class="placeholder">Add ${n.label.toLowerCase()} items\u2026</p>`}}this._editingQuadrants.delete(t),e.removeAttribute("data-editing");let s=e.querySelector(".quadrant__face--front"),a=e.querySelector(".quadrant__face--back");s&&s.removeAttribute("inert"),a&&a.setAttribute("inert",""),this.dispatchEvent(new CustomEvent("empathy-map:update",{bubbles:!0,composed:!0,detail:{quadrant:t,items:this.__quadrants?.[t]||[]}}))}};x("empathy-map",ot);function V({newItems:c,nodes:t,keyOf:e,renderItem:r,containerFor:s}){let a=[],i=[],o=[],n=new Set;for(let d of c)n.add(e(d));for(let[d,p]of[...t])n.has(d)||(p.remove(),t.delete(d),o.push(d));let l=new Map;for(let d of c){let p=e(d),u=t.get(p)||null,m=s(d,u);l.has(m)||l.set(m,[]),l.get(m)?.push({item:d,key:p,existing:u})}for(let[d,p]of l)for(let u=0;u<p.length;u++){let{item:m,key:f,existing:g}=p[u],v=g;v?(v.parentElement!==d||d.children[u]!==v)&&i.push(f):(v=r(m),t.set(f,v),a.push(f));let y=d.children[u];y!==v&&d.insertBefore(v,y||null)}return{added:a,moved:i,removed:o}}var nt=class c extends C{static QUADRANTS=["quick-wins","big-bets","fill-ins","money-pit"];static LABELS={"quick-wins":"Quick Wins","big-bets":"Big Bets","fill-ins":"Fill-Ins","money-pit":"Money Pit"};static DESCRIPTIONS={"quick-wins":"High impact \xB7 Low effort","big-bets":"High impact \xB7 High effort","fill-ins":"Low impact \xB7 Low effort","money-pit":"Low impact \xB7 High effort"};static#e=0;static get observedAttributes(){return["src","compact","title"]}#t=null;#r={};#i=null;#s="";#o=null;setup(){this.#s=`ie-${++c.#e}`;let t=[...this.querySelectorAll(":scope > [data-quadrant], :scope > [draggable]")],e=document.createElement("div");e.className="ie-wrapper";let r=document.createElement("div");r.className="ie-y-label",r.setAttribute("aria-hidden","true"),r.textContent="Impact \u2191";let s=document.createElement("div");s.style.cssText="display:flex;flex-direction:column;flex:1;min-width:0;";let a=document.createElement("div");a.className="ie-grid",a.setAttribute("role","region"),a.setAttribute("aria-label","Impact-Effort prioritization matrix");let i=document.createElement("div");i.className="ie-x-label",i.setAttribute("aria-hidden","true"),i.textContent="Effort \u2192";for(let d of c.QUADRANTS){let p=document.createElement("section");p.className="ie-quadrant",p.dataset.quadrantZone=d,p.setAttribute("aria-label",`${c.LABELS[d]}: ${c.DESCRIPTIONS[d]}`);let u=document.createElement("header");u.className="ie-quadrant-label",u.innerHTML=`${c.LABELS[d]}<br><span class="ie-quadrant-desc">${c.DESCRIPTIONS[d]}</span>`;let m=document.createElement("drag-surface");m.setAttribute("group",this.#s),m.setAttribute("aria-label",c.LABELS[d]),m.setAttribute("data-layout","stack"),m.setAttribute("data-layout-gap","xs"),p.appendChild(u),p.appendChild(m),a.appendChild(p),this.#r[d]=m}t.forEach((d,p)=>{let u=d,m=u.getAttribute("data-quadrant")||"quick-wins",f=this.#r[m]||this.#r["quick-wins"];u.hasAttribute("draggable")||u.setAttribute("draggable","true"),u.hasAttribute("data-id")||(u.dataset.id=`ie-item-${p}`),f.appendChild(u)});let o=document.createElement("div");o.className="ie-live-region",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic","true");let n=this.getAttribute("title");if(n){let d=document.createElement("h3");d.className="ie-title",d.textContent=n,this.prepend(d)}s.appendChild(a),s.appendChild(i),e.appendChild(r),e.appendChild(s),this.appendChild(e),this.appendChild(o),this.#t=a,this.#i=o,this.#o=e,this.listen(this,"drag-surface:transfer",d=>{let{item:p,fromSurface:u,toSurface:m}=d.detail,f=this.#d(u),g=this.#d(m);!f||!g||(p.setAttribute("data-quadrant",g),this.#b(`Moved ${this.#m(p)} to ${c.LABELS[g]}`),this.dispatchEvent(new CustomEvent("impact-effort:move",{bubbles:!0,detail:{itemId:p.dataset.id,from:f,to:g,item:p}})))});let l=this.getAttribute("src");l&&this.#c(l),this.#u()}teardown(){this.#o&&(this.#o.remove(),this.#o=null),this.#i&&(this.#i.remove(),this.#i=null),this.#t=null,this.#r={},this.#n.clear(),this.#a=[]}#a=[];#n=new Map;get items(){if(this.#a.length)return this.#a;let t=[];for(let[e,r]of Object.entries(this.#r))for(let s of r.querySelectorAll(':scope > [draggable="true"]'))t.push({id:s.getAttribute("data-id")||void 0,quadrant:e,text:s.textContent?.trim()||void 0});return t}set items(t){if(!this.#t)return;let e=Array.isArray(t)?t:[];V({newItems:e,nodes:this.#n,keyOf:r=>r.id??`${r.quadrant}:${r.text}`,renderItem:r=>{let s=this;if(typeof s.renderItem=="function"){let i=s.renderItem(r);if(i instanceof Element)return i.hasAttribute("draggable")||i.setAttribute("draggable","true"),i.hasAttribute("data-id")||i.setAttribute("data-id",String(r.id??"")),i}let a=document.createElement("article");return a.className="ie-card",a.setAttribute("draggable","true"),r.id&&a.setAttribute("data-id",String(r.id)),a.textContent=r.text||r.id||"",a},containerFor:r=>this.#r[r.quadrant]||this.#r["quick-wins"]}),this.#a=e,this.dispatchEvent(new CustomEvent("impact-effort:items-changed",{detail:{items:e,source:"property"},bubbles:!0}))}attributeChangedCallback(t,e,r){this.hasAttribute("data-upgraded")&&t==="src"&&r&&r!==e&&this.#c(r)}async#c(t){try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();if(!Array.isArray(r))return;let s=()=>{for(let a of c.QUADRANTS){let i=this.#r[a];if(i)for(let o of[...i.querySelectorAll("[draggable]")])o.remove()}r.forEach((a,i)=>{let o=a.quadrant||"quick-wins",n=a.id||`ie-item-${i}`,l;a.persona||a.action||a.storyId?(l=document.createElement("user-story"),l.setAttribute("detail","minimal"),a.storyId&&l.setAttribute("story-id",a.storyId),a.persona&&l.setAttribute("persona",a.persona),a.action&&l.setAttribute("action",a.action),a.benefit&&l.setAttribute("benefit",a.benefit),a.priority&&l.setAttribute("priority",a.priority),a.status&&l.setAttribute("status",a.status),a.points&&l.setAttribute("points",String(a.points))):(l=document.createElement("article"),l.textContent=a.label||a.text||""),l.setAttribute("draggable","true"),l.dataset.id=n,l.dataset.quadrant=o,(this.#r[o]||this.#r["quick-wins"]).appendChild(l)})};this.hasAttribute("data-upgraded")&&this.#t?S(this,s,"ie-vt"):s(),this.#u()}catch(e){console.warn(`[impact-effort] Failed to load src="${t}":`,e)}}#d(t){for(let[e,r]of Object.entries(this.#r))if(r===t)return e;return null}#b(t){let e=this.#i;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#m(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#u(){let t={};for(let e of c.QUADRANTS){let r=this.#r[e];t[e]=r?r.querySelectorAll('[draggable="true"]').length:0}this.dispatchEvent(new CustomEvent("impact-effort:ready",{bubbles:!0,detail:{quadrantCounts:t}}))}};x("impact-effort",nt);var ct=class c extends C{static#e=0;setup(){this.#m=`qg-${++c.#e}`;let t=this.getAttribute("x-label")||"",e=this.getAttribute("y-label")||"",r=this.getAttribute("x-low")||"Low",s=this.getAttribute("x-high")||"High",a=this.getAttribute("y-low")||"Low",i=this.getAttribute("y-high")||"High",o=[this.getAttribute("q1-label")||"Q1",this.getAttribute("q2-label")||"Q2",this.getAttribute("q3-label")||"Q3",this.getAttribute("q4-label")||"Q4"],n=this.hasAttribute("draggable"),l=[...this.querySelectorAll(":scope > [data-quadrant], :scope > [data-x][data-y]")],d=document.createElement("section");d.className="qg-wrapper",d.setAttribute("role","region"),d.setAttribute("aria-label",`${e} \xD7 ${t} quadrant grid`);let p=document.createElement("header");p.className="qg-y-label",p.setAttribute("aria-hidden","true"),p.textContent=`\u2191 ${e}`;let u=document.createElement("aside");u.className="qg-y-scale",u.setAttribute("aria-hidden","true"),u.innerHTML=`<span>${i}</span><span>${a}</span>`;let m=document.createElement("div");m.className="qg-grid";let f=document.createElement("aside");f.className="qg-x-scale",f.setAttribute("aria-hidden","true"),f.innerHTML=`<span>${r}</span><span>${s}</span>`;let g=document.createElement("footer");g.className="qg-x-label",g.setAttribute("aria-hidden","true"),g.textContent=`${t} \u2192`;for(let y=0;y<4;y++){let _=document.createElement("section");_.className="qg-quadrant",_.dataset.quadrantZone=String(y),_.setAttribute("aria-label",o[y]);let b=document.createElement("header");if(b.className="qg-quadrant-label",b.textContent=o[y],_.appendChild(b),n){let w=document.createElement("drag-surface");w.setAttribute("group",this.#m),w.setAttribute("aria-label",o[y]),w.setAttribute("data-layout","stack"),w.setAttribute("data-layout-gap","xs"),_.appendChild(w),this.#u[y]=w}else{let w=document.createElement("ul");w.className="qg-items",_.appendChild(w),this.#f[y]=w}m.appendChild(_),this.#v[y]=_}l.forEach((y,_)=>{let b=y,w=this.#n(b),T=n?this.#u[w]:this.#f[w];if(n&&(b.hasAttribute("draggable")||b.setAttribute("draggable","true")),b.hasAttribute("data-id")||(b.dataset.id=`qg-item-${_}`),b.hasAttribute("data-x")&&b.hasAttribute("data-y")){let E=parseFloat(b.getAttribute("data-x")??""),M=parseFloat(b.getAttribute("data-y")??"");if(Number.isFinite(E)&&Number.isFinite(M)){let $=w===0||w===3?(E-.5)*2:E*2,F=w===0||w===1?(M-.5)*2:M*2;if(b.style.setProperty("--qg-local-x",$.toFixed(4)),b.style.setProperty("--qg-local-y",F.toFixed(4)),b.classList.add("qg-pinned"),!b.style.getPropertyValue("--qg-pin-hue")){let Ot=b.dataset.id||(b.textContent||"").trim();b.style.setProperty("--qg-pin-hue",`${c.#o(Ot)}deg`)}}}if(n)T.appendChild(b);else{let E=document.createElement("li");E.appendChild(b),T.appendChild(E)}});let v=document.createElement("div");v.className="qg-live-region visually-hidden",v.setAttribute("role","status"),v.setAttribute("aria-live","polite"),d.appendChild(p),d.appendChild(u),d.appendChild(m),d.appendChild(f),d.appendChild(g),this.appendChild(d),this.appendChild(v),this.#l=m,this.#h=v,this.#y=o,n&&this.listen(this,"drag-surface:transfer",this.#a),this.#t()}#t(){if(typeof ResizeObserver>"u")return;let t=e=>{let r=e.offsetWidth,s=e.offsetHeight;r>0&&e.style.setProperty("--qg-pin-half-w",`${r/2}px`),s>0&&e.style.setProperty("--qg-pin-half-h",`${s/2}px`)};this.#g=new ResizeObserver(e=>{for(let r of e)t(r.target);this.#r()});for(let e of this.querySelectorAll(".qg-pinned"))this.#g.observe(e);this.#r()}#r(){this.#p||(this.#p=requestAnimationFrame(()=>{this.#p=0,this.#i()}))}#i(){for(let e of this.querySelectorAll(".qg-pinned")){let r=e;r.classList.remove("qg-clustered"),r.style.removeProperty("--qg-cluster-i"),r.style.removeProperty("--qg-cluster-n"),delete r.dataset.cluster,r.dataset.qgTabbed!==void 0&&(r.removeAttribute("tabindex"),delete r.dataset.qgTabbed)}let t=0;for(let e=0;e<4;e++){let r=this.#v[e];if(!r)continue;let s=[...r.querySelectorAll(".qg-pinned")];if(s.length<2)continue;let a=s.map(d=>d.getBoundingClientRect()),i=Array.from({length:s.length},(d,p)=>p),o=d=>i[d]===d?d:i[d]=o(i[d]),n=(d,p)=>{let u=o(d),m=o(p);u!==m&&(i[u]=m)};for(let d=0;d<s.length;d++)for(let p=d+1;p<s.length;p++)c.#s(a[d],a[p])&&n(d,p);let l=new Map;for(let d=0;d<s.length;d++){let p=o(d);l.has(p)||l.set(p,[]),l.get(p)?.push(d)}for(let d of l.values()){if(d.length<2)continue;let p=`c${++t}`;d.forEach((u,m)=>{let f=s[u];f.classList.add("qg-clustered"),f.dataset.cluster=p,f.style.setProperty("--qg-cluster-i",String(m)),f.style.setProperty("--qg-cluster-n",String(d.length)),!f.hasAttribute("tabindex")&&!f.matches("a, button, [contenteditable]")&&(f.setAttribute("tabindex","0"),f.dataset.qgTabbed="")})}}}teardown(){this.#g?.disconnect(),this.#g=null,this.#p&&cancelAnimationFrame(this.#p),this.#p=0}static#s(t,e){return!(t.right<=e.left||e.right<=t.left||t.bottom<=e.top||e.bottom<=t.top)}static#o(t){let e=5381;for(let r=0;r<t.length;r++)e=(e<<5)+e+t.charCodeAt(r)|0;return(e%360+360)%360}#a=t=>{let{item:e,fromSurface:r,toSurface:s}=t.detail,a=this.#c(r),i=this.#c(s);a==null||i==null||(e.setAttribute("data-quadrant",String(i)),this.#b(`Moved ${this.#d(e)} to ${this.#y[i]}`),this.dispatchEvent(new CustomEvent("quadrant-grid:move",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,from:a,to:i}})))};#n(t){let e=parseInt(t.getAttribute("data-quadrant"),10);if(e>=0&&e<=3)return e;if(t.hasAttribute("data-x")&&t.hasAttribute("data-y")){let r=parseFloat(t.getAttribute("data-x")),s=parseFloat(t.getAttribute("data-y"));return c.quadrantFor(r,s)}return 0}static quadrantFor(t,e){let r=t>=.5,s=e>=.5;return s&&r?0:s&&!r?1:!s&&!r?2:3}#c(t){for(let e=0;e<4;e++)if(this.#u[e]===t)return e;return null}#d(t){return(t.textContent||"").trim().split(`
|
|
1755
|
+
`)[0]||"item"}#b(t){this.#h&&(this.#h.textContent=t)}#m="";#u={};#f={};#v={};#l=null;#h=null;#y=[];#g=null;#p=0};x("quadrant-grid",ct);var It=5,dt=class c extends C{setup(){let t=this.querySelector(":scope > template"),e=t?c.#t(t):[];if(this.hasAttribute("src")){this.#e(this.getAttribute("src"));return}this.#r(e)}async#e(t){try{let r=await(await fetch(t)).json();this.#r(Array.isArray(r)?r:[])}catch(e){console.warn("risk-register: failed to load src",t,e),this.#r([])}}static#t(t){let e=[],r=t.content.querySelectorAll("tr");for(let s of r){let a=[...s.children],i=a[0]?.textContent?.trim()||"",o=s.getAttribute("data-id")||i.toLowerCase().replace(/\s+/g,"-")||`risk-${e.length}`;e.push({id:o,title:i,likelihood:parseInt(a[1]?.textContent??"",10)||0,impact:parseInt(a[2]?.textContent??"",10)||0,owner:a[3]?.textContent?.trim()||"",mitigation:a[4]?.textContent?.trim()||""})}return e}#r(t){this.#a=t,[...this.children].forEach(s=>{s.tagName!=="TEMPLATE"&&s.remove()});let e=this.getAttribute("label");if(e){let s=document.createElement("header");s.className="rr-label",s.textContent=e,this.appendChild(s)}let r=document.createElement("div");r.className="rr-layout",r.appendChild(this.#i(t)),r.appendChild(this.#s(t)),this.appendChild(r),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("risk-register:ready",{bubbles:!0,detail:{count:t.length}}))})}#i(t){let e=document.createElement("data-table"),r=document.createElement("table");return r.innerHTML=`
|
|
1756
1756
|
<thead>
|
|
1757
1757
|
<tr>
|
|
1758
1758
|
<th data-sort="string">Title</th>
|
|
@@ -1764,20 +1764,20 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
1764
1764
|
</tr>
|
|
1765
1765
|
</thead>
|
|
1766
1766
|
<tbody>
|
|
1767
|
-
${t.map(
|
|
1768
|
-
<tr data-id="${c.#o(
|
|
1769
|
-
<td>${c.#o(
|
|
1770
|
-
<td>${
|
|
1771
|
-
<td>${
|
|
1767
|
+
${t.map(s=>`
|
|
1768
|
+
<tr data-id="${c.#o(s.id)}">
|
|
1769
|
+
<td>${c.#o(s.title)}</td>
|
|
1770
|
+
<td>${s.likelihood||""}</td>
|
|
1771
|
+
<td>${s.impact||""}</td>
|
|
1772
1772
|
<td></td>
|
|
1773
|
-
<td>${c.#o(
|
|
1774
|
-
<td>${c.#o(
|
|
1773
|
+
<td>${c.#o(s.owner)}</td>
|
|
1774
|
+
<td>${c.#o(s.mitigation)}</td>
|
|
1775
1775
|
</tr>
|
|
1776
1776
|
`).join("")}
|
|
1777
1777
|
</tbody>
|
|
1778
|
-
`,e.appendChild(
|
|
1779
|
-
`)[0].slice(0,60)||"(unnamed)"}#a=null;#n=new Map;#
|
|
1780
|
-
`)[0],d.appendChild(u),d.setAttribute("aria-label",`${u.textContent} \u2014 ${d.dataset.start} to ${d.dataset.end} in ${e}`),d.addEventListener("click",h=>{this.#A||this.dispatchEvent(new CustomEvent("product-roadmap:select",{bubbles:!0,detail:{initiative:t,lane:e,start:d.dataset.start,end:d.dataset.end,status:d.dataset.status||null}}))}),this.#g){let h=document.createElement("span");h.className="rm-bar-handle",h.setAttribute("aria-label","Resize end date"),d.appendChild(h),h.addEventListener("pointerdown",m=>this.#r(m,d,t)),d.addEventListener("pointerdown",m=>{m.target!==h&&this.#i(m,d,t)}),d.addEventListener("dragstart",m=>{m.dataTransfer&&(m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/plain",t.id||d.dataset.sourceId||"")),this.#_=t,this.#C=e}),d.addEventListener("dragend",()=>{this.#_=null,this.#C=null})}return d}#i(t,e,s){if(t.button!==0)return;t.preventDefault();let r=e.parentElement.getBoundingClientRect(),i=t.clientX,a=parseFloat(e.style.getPropertyValue("--rm-x"))||0,o=parseFloat(e.style.getPropertyValue("--rm-w"))||0;this.#A={kind:"move",bar:e,initiative:s,trackRect:r,startX:i,startFraction:a,widthFraction:o},e.setPointerCapture(t.pointerId),e.addEventListener("pointermove",this.#o),e.addEventListener("pointerup",this.#a),e.addEventListener("pointercancel",this.#a)}#r(t,e,s){if(t.button!==0)return;t.preventDefault(),t.stopPropagation();let r=e.parentElement.getBoundingClientRect(),i=t.clientX,a=parseFloat(e.style.getPropertyValue("--rm-x"))||0,o=parseFloat(e.style.getPropertyValue("--rm-w"))||0;this.#A={kind:"resize",bar:e,initiative:s,trackRect:r,startX:i,startFraction:a,widthFraction:o},e.setPointerCapture(t.pointerId),e.addEventListener("pointermove",this.#o),e.addEventListener("pointerup",this.#a),e.addEventListener("pointercancel",this.#a)}#o=t=>{if(!this.#A)return;let{kind:e,bar:s,trackRect:r,startX:i,startFraction:a,widthFraction:o}=this.#A,n=(t.clientX-i)/r.width;if(e==="move"){let d=Math.max(0,Math.min(1-o,a+n));s.style.setProperty("--rm-x",d.toFixed(4))}else if(e==="resize"){let d=Math.max(.02,Math.min(1-a,o+n));s.style.setProperty("--rm-w",d.toFixed(4))}};#a=t=>{if(!this.#A)return;let{kind:e,bar:s,initiative:r}=this.#A;s.releasePointerCapture(t.pointerId),s.removeEventListener("pointermove",this.#o),s.removeEventListener("pointerup",this.#a),s.removeEventListener("pointercancel",this.#a);let i=parseFloat(s.style.getPropertyValue("--rm-x"))||0,a=parseFloat(s.style.getPropertyValue("--rm-w"))||0,o=this.#d(this.#p(i)),n=this.#d(this.#p(i+a));s.dataset.start=c.#y(o),s.dataset.end=c.#y(n);let d=this.#c(o),l=this.#c(n)-d;s.style.setProperty("--rm-x",d.toFixed(4)),s.style.setProperty("--rm-w",l.toFixed(4)),r&&(r.setAttribute("data-start",s.dataset.start??""),r.setAttribute("data-end",s.dataset.end??"")),this.dispatchEvent(new CustomEvent(e==="move"?"product-roadmap:reschedule":"product-roadmap:resize",{bubbles:!0,detail:{initiative:r,lane:s.dataset.lane,start:s.dataset.start,end:s.dataset.end}})),setTimeout(()=>{this.#A=null},0)};#n=t=>{this.#_&&(t.preventDefault(),t.dataTransfer.dropEffect="move")};#l=t=>{if(!this.#_)return;t.preventDefault();let e=t.currentTarget.dataset.lane,s=this.#_,r=this.#C;if(e===r)return;let i=this.#b.find(a=>a.getAttribute("data-lane")===e);i&&i.appendChild(s),this.dispatchEvent(new CustomEvent("product-roadmap:move",{bubbles:!0,detail:{initiative:s,fromLane:r,toLane:e,start:s.getAttribute("data-start"),end:s.getAttribute("data-end")}})),this.#e()};#c(t){if(!this.#h)return 0;let e=t.getTime()-this.#h.getTime();return Math.max(0,Math.min(1,e/this.#x))}#p(t){let e=this.#h??new Date;return new Date(e.getTime()+t*this.#x)}#d(t){if(this.#f==="month")return new Date(t.getFullYear(),t.getMonth(),1);let e=t.getMonth(),s=Math.floor(e/3)*3;return new Date(t.getFullYear(),s,1)}#u(){let t=[],e=this.#h,s=this.#v;if(!e||!s)return t;if(this.#f==="quarter"){let r=this.#d(e);for(;r<s;){let i=new Date(r.getFullYear(),r.getMonth()+3,1),a=this.#c(r<e?e:r),o=this.#c(i>s?s:i),n=Math.floor(r.getMonth()/3)+1;t.push({startFraction:a,endFraction:o,label:`Q${n} ${r.getFullYear()}`}),r=i}}else{let r=new Date(e.getFullYear(),e.getMonth(),1);for(;r<s;){let i=new Date(r.getFullYear(),r.getMonth()+1,1),a=this.#c(r<e?e:r),o=this.#c(i>s?s:i),n=r.toLocaleString(void 0,{month:"short"});t.push({startFraction:a,endFraction:o,label:`${n} ${r.getFullYear()}`}),r=i}}return t}static#m(t,e){if(!t)return null;let s=String(t).match(/^(\d{4})-Q([1-4])$/i);if(s){let a=Number(s[1]),n=(Number(s[2])-1)*3;return e==="end"?new Date(a,n+3,0):new Date(a,n,1)}let r=String(t).match(/^(\d{4})-(\d{2})-(\d{2})/);if(r)return new Date(Number(r[1]),Number(r[2])-1,Number(r[3]));let i=new Date(t);return isNaN(i.getTime())?null:i}static#y(t){let e=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${s}`}#h=null;#v=null;#x=0;#f="quarter";#g=!1;#b=[];#k=null;#A=null;#_=null;#C=null};x("product-roadmap",gt);function jt(c){let t=c;return class extends t{static keyOf(e){return e.id}#e=[];#s=new Map;get items(){return this.#e}set items(e){let s=e||[],r=Y({newItems:s,nodes:this.#s,keyOf:this.constructor.keyOf,renderItem:i=>this._renderItem(i),containerFor:(i,a)=>this._containerFor(i,a)});this.#e=s,this._postRender({...r,items:s}),this._emit("items-changed",{items:s},"api")}_renderItem(e){throw new Error(`${this.constructor.name}: must implement _renderItem(item)`)}_containerFor(e,s){return this}_postRender(e){}_emit(e,s,r="api"){this.dispatchEvent(new CustomEvent(`${this.localName}:${e}`,{detail:{...s,source:r},bubbles:!0}))}_nodeFor(e){return this.#s.get(e)||null}_seedCollection(e,s){this.#e=e,this.#s.clear();for(let[r,i]of s)this.#s.set(r,i)}_setItemsSilently(e){this.#e=e}}}var bt=class c extends jt(C){static get observedAttributes(){return["src","compact","title"]}static keyOf(t){return t.id??t.storyId}static#e=0;#s=null;#t={};#i={};#r=null;#o="";#a=[];#n=null;setup(){this.#o=`kb-${++c.#e}`;let t=[...this.querySelectorAll(":scope > section[data-column]")];this.#a=t.map(i=>{let a=i.getAttribute("data-column")||"",n=i.getAttribute("data-column-label")||""||this.#x(a),d=i.getAttribute("data-wip"),l=d?parseInt(d,10):null,u=i.getAttribute("data-column-color")||null,h=[...i.children];return{id:a,label:n,wip:l,color:u,children:h}});for(let i of t)i.remove();this.#s=document.createElement("div"),this.#s.className="kb-columns",this.#s.setAttribute("role","region"),this.#s.setAttribute("aria-label","Kanban board");let e=0;for(let i of this.#a){let a=document.createElement("section");a.className="kb-column",a.setAttribute("data-column-id",i.id),i.color&&a.setAttribute("data-column-tint",i.color);let o=document.createElement("header");o.className="kb-column-header";let n=document.createElement("h3");n.textContent=i.label;let d=document.createElement("output");if(d.className="kb-count",d.textContent=String(i.children.length),n.appendChild(d),i.wip!==null&&!isNaN(i.wip)){let u=document.createElement("span");u.className="kb-wip",u.textContent=`/ ${i.wip}`,u.setAttribute("aria-label",`WIP limit ${i.wip}`),n.appendChild(u)}o.appendChild(n),a.appendChild(o);let l=document.createElement("drag-surface");if(l.setAttribute("group",this.#o),l.setAttribute("aria-label",`${i.label} items`),l.setAttribute("data-layout","stack"),l.setAttribute("data-layout-gap","xs"),i.children.length>0){for(let u of i.children)u.hasAttribute("draggable")||u.setAttribute("draggable","true"),u.hasAttribute("data-id")||(u.dataset.id=`kb-item-${e}`),l.appendChild(u);e+=i.children.length}else{let u=document.createElement("p");u.className="kb-empty",u.textContent="No items",l.appendChild(u)}a.appendChild(l),this.#s.appendChild(a),this.#t[i.id]=l,this.#i[i.id]=a,i.wip!==null&&i.children.length>i.wip&&a.setAttribute("data-wip-exceeded","")}let s=this.getAttribute("title");if(s){let i=document.createElement("h2");i.className="kb-title",i.textContent=s,this.appendChild(i)}this.appendChild(this.#s),this.#r=document.createElement("div"),this.#r.className="kb-live-region",this.#r.setAttribute("role","status"),this.#r.setAttribute("aria-live","polite"),this.#r.setAttribute("aria-atomic","true"),this.appendChild(this.#r),this.listen(this,"drag-surface:reorder",i=>{let a=i.detail,o=i.target.closest("drag-surface"),n=this.#u(o);n&&(this.#m(n),this.#c("drag"),this.dispatchEvent(new CustomEvent("kanban-board:reorder",{bubbles:!0,detail:{itemId:a.itemId,column:n,oldIndex:a.oldIndex,newIndex:a.newIndex}})))}),this.listen(this,"drag-surface:transfer",i=>{let a=i.detail,o=a.fromSurface,n=a.toSurface,d=this.#u(o),l=this.#u(n);if(!d||!l)return;a.item&&a.item.setAttribute("data-column",l),this.#m(d),this.#m(l);let u=n.querySelector(".kb-empty");if(u&&u.remove(),o.querySelectorAll(':scope > [draggable="true"]').length===0&&!o.querySelector(".kb-empty")){let _=document.createElement("p");_.className="kb-empty",_.textContent="No items",o.appendChild(_)}let m=this.#v(a.item),f=this.#y(d),p=this.#y(l);this.#h(`${m} moved from ${f} to ${p}`),this.#c("drag"),this.dispatchEvent(new CustomEvent("kanban-board:transfer",{bubbles:!0,detail:{itemId:a.itemId,fromColumn:d,toColumn:l,newIndex:a.newIndex,item:a.item}}));let b=n.querySelectorAll(':scope > [draggable="true"]').length,y=this.#a.find(_=>_.id===l);y?.wip!==null&&y?.wip!==void 0&&b>y.wip&&this.dispatchEvent(new CustomEvent("kanban-board:wip-exceeded",{bubbles:!0,detail:{column:l,limit:y.wip,count:b}}))}),this.#l();let r=this.getAttribute("src");if(r){this._loadSrc(r);return}this.dispatchEvent(new CustomEvent("kanban-board:ready",{bubbles:!0,detail:{columnCount:this.#a.length,itemCount:e}}))}#l(){let t=[],e=new Map;for(let[s,r]of Object.entries(this.#t)){let i=r.querySelectorAll(':scope > [draggable="true"]');for(let a of i){let o=a.getAttribute("data-id");o&&(t.push({id:o,column:s}),e.set(o,a))}}this._seedCollection(t,e)}#c(t){let e=[],s=new Map;for(let r of this.items){let i=String(r.id??r.storyId??"");i&&s.set(i,r)}for(let[r,i]of Object.entries(this.#t)){let a=i.querySelectorAll(':scope > [draggable="true"]');for(let o of a){let n=o.getAttribute("data-id");if(!n)continue;let d=s.get(n);e.push(d?{...d,column:r}:{id:n,column:r})}}this._setItemsSilently(e),this._emit("items-changed",{items:e},t)}teardown(){let t=this.querySelector(".kb-title");t&&t.remove(),this.#s&&(this.#s.remove(),this.#s=null),this.#r&&(this.#r.remove(),this.#r=null),this.#t={},this.#i={},this.#a=[]}get columns(){return this.#a.map(t=>({id:t.id,label:t.label,wip:t.wip??void 0,color:t.color??void 0}))}set columns(t){let e=(t||[]).map(a=>({id:a.id,label:a.label||this.#x(a.id),wip:a.wip??null,color:a.color??null,children:[]})),s=this.#s;this.#t={},this.#i={},this.#a=e;let r=this.#d();this.#s=r;let i=()=>{s&&s.remove(),this.appendChild(r)};this.hasAttribute("data-upgraded")&&s?q(this,i,"kb-vt"):i()}get renderItem(){return this.#n}set renderItem(t){this.#n=typeof t=="function"?t:null}_renderItem(t){let e;if(this.#n){let s=this.#n(t);if(!(s instanceof Element))throw new Error("kanban-board: renderItem must return an Element");e=s}else e=this.#p(t);return e.hasAttribute("draggable")||e.setAttribute("draggable","true"),e.hasAttribute("data-id")||e.setAttribute("data-id",String(c.keyOf(t))),e}_containerFor(t,e){let s=this.#t[t.column];if(!s)throw new Error(`kanban-board: no column "${t.column}" \u2014 set .columns first or include item.column matching an existing column id`);let r=s.querySelector(":scope > .kb-empty");return r&&r.remove(),s}_postRender(){for(let t of Object.keys(this.#t)){this.#m(t);let e=this.#t[t],s=e.querySelectorAll(':scope > [draggable="true"]'),r=e.querySelector(":scope > .kb-empty");if(s.length===0&&!r){let i=document.createElement("p");i.className="kb-empty",i.textContent="No items",e.appendChild(i)}else s.length>0&&r&&r.remove()}}#p(t){let e=customElements.get("work-item")?"work-item":"article",s=document.createElement(e);return e==="work-item"?s.data={itemId:t.id??t.storyId,type:t.type,priority:t.priority,status:t.status,estimate:t.estimate!=null?String(t.estimate):void 0,assignee:t.assignee,title:t.title,description:t.description,checklist:t.checklist,notes:t.notes,detail:t.detail}:(s.className="kb-card",s.textContent=t.title||t.label||t.id),s}#d(){let t=document.createElement("div");t.className="kb-columns",t.setAttribute("role","region"),t.setAttribute("aria-label","Kanban board");for(let e of this.#a){let s=document.createElement("section");s.className="kb-column",s.setAttribute("data-column-id",e.id),e.color&&s.setAttribute("data-column-tint",e.color);let r=document.createElement("header");r.className="kb-column-header";let i=document.createElement("h3");i.textContent=e.label;let a=document.createElement("output");if(a.className="kb-count",a.textContent="0",i.appendChild(a),e.wip!=null&&!isNaN(e.wip)){let d=document.createElement("span");d.className="kb-wip",d.textContent=`/ ${e.wip}`,d.setAttribute("aria-label",`WIP limit ${e.wip}`),i.appendChild(d)}r.appendChild(i),s.appendChild(r);let o=document.createElement("drag-surface");o.setAttribute("group",this.#o),o.setAttribute("aria-label",`${e.label} items`),o.setAttribute("data-layout","stack"),o.setAttribute("data-layout-gap","xs");let n=document.createElement("p");n.className="kb-empty",n.textContent="No items",o.appendChild(n),s.appendChild(o),t.appendChild(s),this.#t[e.id]=o,this.#i[e.id]=s}return t}attributeChangedCallback(t,e,s){e===s||!this.isConnected||t==="src"&&this._loadSrc(s)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();for(let i of s.columns||[]){let a=document.createElement("section");a.setAttribute("data-column",i.id),i.label&&a.setAttribute("data-column-label",i.label),i.wip!=null&&a.setAttribute("data-wip",String(i.wip)),i.color&&a.setAttribute("data-column-color",i.color);for(let o of i.items||[]){let n;o.persona||o.action||o.storyId?(n=document.createElement("user-story"),n.setAttribute("detail",o.detail||"minimal"),o.storyId&&n.setAttribute("story-id",o.storyId),o.persona&&n.setAttribute("persona",o.persona),o.action&&n.setAttribute("action",o.action),o.benefit&&n.setAttribute("benefit",o.benefit),o.priority&&n.setAttribute("priority",o.priority),o.status&&n.setAttribute("status",o.status),o.points&&n.setAttribute("points",String(o.points))):(n=document.createElement("article"),n.className="kb-card",n.textContent=o.text||o.label||""),n.setAttribute("draggable","true"),n.dataset.id=o.id||o.storyId||"",a.appendChild(n)}this.appendChild(a)}let r=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};this.hasAttribute("data-upgraded")&&this.#s?q(this,r,"kb-vt"):r()}catch(e){console.warn(`[kanban-board] Failed to load src="${t}":`,e)}}#u(t){if(!t)return null;for(let[e,s]of Object.entries(this.#t))if(s===t)return e;return null}#m(t){let e=this.#t[t],s=this.#i[t];if(!e||!s)return;let r=e.querySelectorAll(':scope > [draggable="true"]').length,i=s.querySelector(".kb-count");i&&(i.textContent=String(r));let a=this.#a.find(o=>o.id===t);a?.wip!==null&&a?.wip!==void 0&&(r>a.wip?s.setAttribute("data-wip-exceeded",""):s.removeAttribute("data-wip-exceeded"))}#y(t){return this.#a.find(s=>s.id===t)?.label||this.#x(t)}#h(t){this.#r&&(this.#r.textContent="",requestAnimationFrame(()=>{this.#r&&(this.#r.textContent=t)}))}#v(t){return t.getAttribute("story-id")||t.getAttribute("data-id")||t.textContent?.trim().slice(0,40)||"item"}#x(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("kanban-board",bt);var vt=class c extends C{static get observedAttributes(){return["src","compact","title"]}static#e=0;#s=null;#t=null;#i={};#r=null;#o="";#a=[];setup(){this.#o=`sm-${++c.#e}`;let t=[...this.querySelectorAll(":scope > section[data-activity]")];this.#a=t.map(i=>{let a=i.getAttribute("data-activity")||"",n=i.getAttribute("data-activity-label")||""||this.#d(a),d=i.getAttribute("data-journey-phase")||null,l=[...i.children];return{id:a,label:n,journeyPhase:d,children:l}});for(let i of t)i.remove();this.#s=document.createElement("div"),this.#s.className="sm-scroll",this.#s.setAttribute("role","region"),this.#s.setAttribute("aria-label","Story map"),this.#s.setAttribute("tabindex","0"),this.#t=document.createElement("div"),this.#t.className="sm-columns";let e=0;for(let i of this.#a){let a=document.createElement("section");a.className="sm-column",a.setAttribute("data-activity-column",i.id);let o=document.createElement("header");o.className="sm-activity-header";let n=document.createElement("h3");n.textContent=i.label;let d=document.createElement("span");d.className="sm-activity-count",d.textContent=String(i.children.length),n.appendChild(d),o.appendChild(n),a.appendChild(o);let l=document.createElement("drag-surface");if(l.setAttribute("group",this.#o),l.setAttribute("aria-label",`${i.label} stories`),l.setAttribute("data-layout","stack"),l.setAttribute("data-layout-gap","xs"),i.children.length>0){for(let u of i.children)l.appendChild(u);e+=i.children.length}else{let u=document.createElement("p");u.className="sm-empty",u.textContent="No stories yet",l.appendChild(u)}a.appendChild(l),this.#t.appendChild(a),this.#i[i.id]=l}let s=this.getAttribute("title");if(s){let i=document.createElement("h2");i.className="sm-title",i.textContent=s,this.appendChild(i)}this.#s.appendChild(this.#t),this.appendChild(this.#s),this.#r=document.createElement("div"),this.#r.className="sm-live-region",this.#r.setAttribute("role","status"),this.#r.setAttribute("aria-live","polite"),this.#r.setAttribute("aria-atomic","true"),this.appendChild(this.#r),this.listen(this,"drag-surface:reorder",i=>{let a=i.detail,o=i.target.closest("drag-surface"),n=this.#n(o);n&&(this.#l(n),this.dispatchEvent(new CustomEvent("story-map:reorder",{bubbles:!0,detail:{itemId:a.itemId,activity:n,oldIndex:a.oldIndex,newIndex:a.newIndex}})))}),this.listen(this,"drag-surface:transfer",i=>{let a=i.detail,o=a.fromSurface,n=a.toSurface,d=this.#n(o),l=this.#n(n);if(!d||!l)return;this.#l(d),this.#l(l);let u=n.querySelector(".sm-empty");if(u&&u.remove(),o.querySelectorAll(':scope > [draggable="true"]').length===0&&!o.querySelector(".sm-empty")){let f=document.createElement("p");f.className="sm-empty",f.textContent="No stories yet",o.appendChild(f)}let m=this.#p(a.item);this.#c(`${m} moved from ${d} to ${l}`),this.dispatchEvent(new CustomEvent("story-map:transfer",{bubbles:!0,detail:{itemId:a.itemId,fromActivity:d,toActivity:l,newIndex:a.newIndex}}))});let r=this.getAttribute("src");if(r){this._loadSrc(r);return}this.dispatchEvent(new CustomEvent("story-map:ready",{bubbles:!0,detail:{activityCount:this.#a.length,storyCount:e}}))}teardown(){this.#s&&(this.#s.remove(),this.#s=null),this.#r&&(this.#r.remove(),this.#r=null),this.#t=null,this.#i={},this.#a=[]}get activities(){return this.#a.map(t=>({id:t.id,label:t.label,journeyPhase:t.journeyPhase||void 0,stories:[...this.#i[t.id]?.querySelectorAll(':scope > [draggable="true"]')||[]].map(e=>({id:e.getAttribute("data-id")||void 0,storyId:e.getAttribute("story-id")||void 0,title:e.querySelector('[slot="title"]')?.textContent?.trim()||void 0}))}))}set activities(t){let e=Array.isArray(t)?t:[];for(;this.firstChild;)this.firstChild.remove();for(let r of e){let i=document.createElement("section");i.setAttribute("data-activity",r.id||""),r.label&&i.setAttribute("data-activity-label",r.label),r.journeyPhase&&i.setAttribute("data-journey-phase",r.journeyPhase);for(let a of r.stories||[]){let o,n=this;if(typeof n.renderStory=="function"){let d=n.renderStory(a);o=d instanceof Element?d:null}o||(customElements.get("user-story")?(o=document.createElement("user-story"),o.data=a):(o=document.createElement("article"),o.className="sm-card",o.textContent=a.title||a.id||"")),o.hasAttribute("draggable")||o.setAttribute("draggable","true"),a.id&&!o.hasAttribute("data-id")&&o.setAttribute("data-id",String(a.id)),i.appendChild(o)}this.appendChild(i)}let s=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};this.hasAttribute("data-upgraded")&&this.#s?q(this,s,"sm-vt"):s(),this.dispatchEvent(new CustomEvent("story-map:activities-changed",{detail:{activities:e,source:"property"},bubbles:!0}))}attributeChangedCallback(t,e,s){e===s||!this.isConnected||t==="src"&&this._loadSrc(s)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();for(let i of s.activities||[]){let a=document.createElement("section");a.setAttribute("data-activity",i.id),a.setAttribute("data-activity-label",i.label||i.id),i.journeyPhase&&a.setAttribute("data-journey-phase",i.journeyPhase);for(let o of i.stories||[]){let n=document.createElement("user-story");n.setAttribute("draggable","true"),n.dataset.id=o.id||o.storyId,(o.storyId||o.id)&&n.setAttribute("story-id",o.storyId||o.id),o.title&&n.setAttribute("title",o.title),o.persona&&n.setAttribute("persona",o.persona),o.action&&n.setAttribute("action",o.action),o.benefit&&n.setAttribute("benefit",o.benefit),o.priority&&n.setAttribute("priority",o.priority),o.status&&n.setAttribute("status",o.status),o.points&&n.setAttribute("points",String(o.points)),n.setAttribute("detail",o.detail||"compact"),a.appendChild(n)}this.appendChild(a)}let r=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};this.hasAttribute("data-upgraded")&&this.#s?q(this,r,"sm-vt"):r()}catch(e){console.warn(`[story-map] Failed to load src="${t}":`,e)}}#n(t){if(!t)return null;for(let[e,s]of Object.entries(this.#i))if(s===t)return e;return null}#l(t){let e=this.#i[t];if(!e)return;let s=e.querySelectorAll(':scope > [draggable="true"]').length,r=e.closest("[data-activity-column]");if(!r)return;let i=r.querySelector(".sm-activity-count");i&&(i.textContent=String(s))}#c(t){this.#r&&(this.#r.textContent="",requestAnimationFrame(()=>{this.#r&&(this.#r.textContent=t)}))}#p(t){return t.getAttribute("story-id")||t.getAttribute("data-id")||t.textContent?.trim().slice(0,40)||"item"}#d(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("story-map",vt);var X=`
|
|
1778
|
+
`,e.appendChild(r),e}#s(t){let e=document.createElement("quadrant-grid");e.setAttribute("x-label","Likelihood"),e.setAttribute("y-label","Impact"),e.setAttribute("x-low","Rare"),e.setAttribute("x-high","Likely"),e.setAttribute("y-low","Minor"),e.setAttribute("y-high","Severe"),e.setAttribute("q1-label","Avoid"),e.setAttribute("q2-label","Plan"),e.setAttribute("q3-label","Accept"),e.setAttribute("q4-label","Mitigate");for(let r of t){if(!r.likelihood||!r.impact)continue;let s=document.createElement("span"),a=Math.min(1,Math.max(0,r.likelihood/It)),i=Math.min(1,Math.max(0,r.impact/It));s.setAttribute("data-x",a.toFixed(3)),s.setAttribute("data-y",i.toFixed(3)),s.setAttribute("data-id",r.id),s.setAttribute("title",`${r.title} \u2014 likelihood ${r.likelihood}, impact ${r.impact}`),s.textContent=r.title,e.appendChild(s)}return e}static#o(t){return String(t??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}#a=[];get rows(){return[...this.#a]}set rows(t){this.#r(Array.isArray(t)?t:[])}};x("risk-register",dt);var lt=class c extends C{setup(){let t=this.getAttribute("rows"),e=this.getAttribute("cols"),r=this.getAttribute("link-attr");return!t||!e||!r?(console.warn("traceability-matrix: requires rows, cols, and link-attr attributes"),!1):(queueMicrotask(()=>this.#e(t,e,r)),!0)}#e(t,e,r){let s=[...document.querySelectorAll(t)].filter(b=>b!==this&&!this.contains(b)),a=[...document.querySelectorAll(e)].filter(b=>b!==this&&!this.contains(b));if(!s.length||!a.length){this.#i();return}let i=this.getAttribute("row-label")||"",o=this.getAttribute("cell-mark")||"\u2713",n=this.hasAttribute("flag-orphans"),l=[],d=new WeakMap,p=new WeakMap;for(let b of s){let w=c.#s(b.getAttribute(r));for(let T of w){let E=a.find(M=>M.id===T);E&&(l.push({rowEl:b,colEl:E}),d.set(b,(d.get(b)||0)+1),p.set(E,(p.get(E)||0)+1))}}let u=document.createElement("data-table"),m=document.createElement("table"),f=document.createElement("thead"),g=document.createElement("tr"),v=document.createElement("th");v.setAttribute("data-sort","string"),v.textContent=i,g.appendChild(v);for(let b of a){let w=document.createElement("th");w.setAttribute("data-sort","number"),w.textContent=c.#o(b),w.dataset.colId=b.id||"",n&&!p.get(b)&&(w.dataset.orphan=""),g.appendChild(w)}f.appendChild(g),m.appendChild(f);let y=document.createElement("tbody");for(let b of s){let w=document.createElement("tr");w.dataset.rowId=b.id||"",n&&!d.get(b)&&(w.dataset.orphan="");let T=document.createElement("th");T.scope="row",T.textContent=c.#o(b),w.appendChild(T);let E=c.#s(b.getAttribute(r));for(let M of a){let $=document.createElement("td"),F=E.includes(M.id);$.setAttribute("data-sort-value",F?"1":"0"),F?($.dataset.linked="",$.textContent=o,$.setAttribute("aria-label","linked")):$.setAttribute("aria-label","not linked"),$.dataset.colId=M.id||"",w.appendChild($)}y.appendChild(w)}m.appendChild(y),u.appendChild(m),[...this.children].forEach(b=>{b.tagName!=="TEMPLATE"&&b.remove()});let _=this.getAttribute("label");if(_){let b=document.createElement("header");b.className="tm-label",b.textContent=_,this.appendChild(b)}this.appendChild(u),this.#a=u,this.#n=new Map(s.map(b=>[b.id,b])),this.#c=new Map(a.map(b=>[b.id,b])),this.listen(u,"click",this.#t),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("traceability-matrix:ready",{bubbles:!0,detail:{rowCount:s.length,colCount:a.length,linkCount:l.length}}))})}#t=t=>{let e=t.target.closest('td, th[scope="row"]');if(!e)return;let r=e.closest("tr");if(!r)return;let s=r.dataset.rowId,a=e.dataset.colId,i=s?this.#n.get(s):null,o=a?this.#c.get(a):null,n=e.hasAttribute("data-state-highlighted");if(this.#r(),n){this.dispatchEvent(new CustomEvent("traceability-matrix:highlight",{bubbles:!0,detail:{rowEl:i,colEl:o,on:!1}}));return}e.setAttribute("data-state-highlighted",""),i&&i.setAttribute("data-state-highlighted",""),o&&o!==i&&o.setAttribute("data-state-highlighted",""),r.setAttribute("data-state-highlighted",""),this.dispatchEvent(new CustomEvent("traceability-matrix:highlight",{bubbles:!0,detail:{rowEl:i,colEl:o,on:!0}}))};#r(){this.#a&&(this.#a.querySelectorAll("[data-state-highlighted]").forEach(t=>t.removeAttribute("data-state-highlighted")),document.querySelectorAll("[data-state-highlighted]").forEach(t=>{(this.#n.has(t.id)||this.#c.has(t.id))&&t.removeAttribute("data-state-highlighted")}))}#i(){[...this.children].forEach(e=>{e.tagName!=="TEMPLATE"&&e.remove()});let t=document.createElement("p");t.className="tm-empty",t.textContent="No matching elements found for this matrix.",this.appendChild(t)}static#s(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}static#o(t){return t.getAttribute("data-matrix-label")||t.id||(t.textContent||"").trim().split(`
|
|
1779
|
+
`)[0].slice(0,60)||"(unnamed)"}#a=null;#n=new Map;#c=new Map};x("traceability-matrix",lt);var te=864e5,pt=class c extends C{setup(){let t=this.getAttribute("start"),e=this.getAttribute("end"),r=parseFloat(this.getAttribute("total")||"");if(!t||!e||!Number.isFinite(r))return console.warn("burndown-chart: requires start, end, and total attributes"),!1;let s=c.#r(t),a=c.#r(e);if(!s||!a||a<s)return console.warn("burndown-chart: start/end dates invalid",t,e),!1;let i=(this.getAttribute("weekends")||"include")!=="exclude",o=this.getAttribute("unit")||"points",n=this.getAttribute("label")||"",l=this.querySelector(":scope > template"),d=l?c.#t(l):[],p=d.filter(g=>g.delta!==0),u=c.#s(s,a),m=c.#o(u,r,i),f=c.#a(u,d);return this.#e({label:n,unit:o,dayLabels:u,actual:f,ideal:m,scopeChanges:p}),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("burndown-chart:ready",{bubbles:!0,detail:{dayCount:u.length,total:r,scopeChanges:p.length}}))}),!0}#e({label:t,unit:e,dayLabels:r,actual:s,ideal:a,scopeChanges:i}){if([...this.children].forEach(p=>{p.tagName!=="TEMPLATE"&&p.remove()}),t){let p=document.createElement("header");p.className="bdc-label",p.textContent=t,this.appendChild(p)}let o=document.createElement("chart-wc");o.setAttribute("data-type","line"),o.setAttribute("data-legend",""),o.setAttribute("data-tooltip",""),o.setAttribute("data-label-x","Day"),o.setAttribute("data-label-y",e);let n={},l={};r.forEach((p,u)=>{n[p]=a[u],s[u]!==null&&(l[p]=s[u])});let d=[{name:"Actual",values:l},{name:"Ideal",values:n}];if(o.setAttribute("data-values",JSON.stringify(d)),this.appendChild(o),i.length){let p=document.createElement("aside");p.className="bdc-scope-changes";let u=document.createElement("h4");u.textContent="Scope changes",p.appendChild(u);let m=document.createElement("ul");for(let f of i){let g=document.createElement("li"),v=f.delta>0?"+":"";g.innerHTML=`<time datetime="${f.date}">${f.date}</time>: <strong>${v}${f.delta} ${e}</strong>`,m.appendChild(g)}p.appendChild(m),this.appendChild(p)}}static#t(t){let e=[],r=t.content.querySelectorAll("tr");for(let s of r){let a=[...s.children],i=a[0]?.textContent?.trim(),o=parseFloat(a[1]?.textContent??""),n=parseFloat(a[2]?.textContent??"0")||0;!i||!Number.isFinite(o)||e.push({date:i,remaining:o,delta:n})}return e}static#r(t){let e=String(t).match(/^(\d{4})-(\d{2})-(\d{2})/);return e?new Date(Number(e[1]),Number(e[2])-1,Number(e[3])):null}static#i(t){let e=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${r}`}static#s(t,e){let r=[];for(let s=t.getTime();s<=e.getTime();s+=te)r.push(c.#i(new Date(s)));return r}static#o(t,e,r){let s=d=>{let p=c.#r(d);if(!p)return!1;let u=p.getDay();return u===0||u===6},a=t.map((d,p)=>({d,i:p,weekend:s(d)})).filter(d=>r||!d.weekend),i=a.length>1?e/(a.length-1):0,o=new Array(t.length).fill(null),n=e,l=0;for(let d=0;d<t.length;d++){let p=s(t[d]);r||!p?(o[d]=Math.max(0,e-i*l),l++,n=o[d]):o[d]=n}return o}static#a(t,e){let r=new Map(e.map(s=>[s.date,s.remaining]));return t.map(s=>r.has(s)?r.get(s):null)}};x("burndown-chart",pt);var ut=class c extends C{setup(){let t=this.getAttribute("start"),e=this.getAttribute("end");if(!t||!e)return console.warn("product-roadmap: start and end attributes required"),!1;let r=c.#f(t,"start"),s=c.#f(e,"end");if(!r||!s||s<=r)return console.warn("product-roadmap: invalid start/end",t,e),!1;this.#l=r,this.#h=s,this.#y=s.getTime()-r.getTime(),this.#g=this.getAttribute("view")==="month"?"month":"quarter",this.#p=this.hasAttribute("editable");let a=[...this.querySelectorAll(":scope > section[data-lane]")];return a.length?(this.#x=a,this.#e(),!0):(console.warn("product-roadmap: no <section data-lane> children found"),!1)}attributeChangedCallback(){this.isConnected&&this.#x.length&&this.#e()}#e(){[...this.children].forEach(s=>{this.#x.includes(s)||s.remove()}),this.#x.forEach(s=>{s.hidden=!0});let t=document.createElement("div");t.className="rm-wrapper";let e=this.#t();t.appendChild(e);let r=document.createElement("div");r.className="rm-lanes";for(let s of this.#x){let a=s.getAttribute("data-lane")||"",i=document.createElement("section");i.className="rm-lane",i.dataset.lane=a;let o=document.createElement("header");o.className="rm-lane-label",o.textContent=a,i.appendChild(o);let n=document.createElement("div");n.className="rm-track",n.dataset.lane=a;let l=[...s.querySelectorAll(":scope > article[data-start][data-end]")];for(let d of l){let p=this.#r(d,a);p&&n.appendChild(p)}this.#p&&(n.addEventListener("dragover",this.#n),n.addEventListener("drop",this.#c)),i.appendChild(n),r.appendChild(i)}if(t.appendChild(r),this.hasAttribute("today-marker")&&this.#l&&this.#h){let s=new Date;if(s>=this.#l&&s<=this.#h){let a=document.createElement("div");a.className="rm-today",a.style.setProperty("--rm-x",this.#d(s).toFixed(4)),a.title=`Today: ${c.#v(s)}`,r.appendChild(a)}}this.appendChild(t),this.#k=t}#t(){let t=document.createElement("header");t.className="rm-axis";let e=this.#u();for(let r of e){let s=document.createElement("div");s.className="rm-tick",s.style.setProperty("--rm-x",r.startFraction.toFixed(4)),s.style.setProperty("--rm-w",(r.endFraction-r.startFraction).toFixed(4)),s.textContent=r.label,t.appendChild(s)}return t}#r(t,e){let r=c.#f(t.getAttribute("data-start"),"start"),s=c.#f(t.getAttribute("data-end"),"end");if(!r||!s||!this.#l||!this.#h)return null;let a=r<this.#l?this.#l:r,i=s>this.#h?this.#h:s;if(a>=i)return null;let o=this.#d(a),n=this.#d(i)-o,l=document.createElement("article");l.className="rm-bar",l.style.setProperty("--rm-x",o.toFixed(4)),l.style.setProperty("--rm-w",n.toFixed(4)),l.dataset.lane=e,l.dataset.start=c.#v(r),l.dataset.end=c.#v(s),t.dataset.status&&(l.dataset.status=t.dataset.status),t.id&&(l.dataset.sourceId=t.id),this.#p&&l.setAttribute("draggable","true");let d=t.querySelector("h1, h2, h3, h4, h5, h6"),p=document.createElement("span");if(p.className="rm-bar-title",p.textContent=d?d.textContent.trim():(t.textContent||"").trim().split(`
|
|
1780
|
+
`)[0],l.appendChild(p),l.setAttribute("aria-label",`${p.textContent} \u2014 ${l.dataset.start} to ${l.dataset.end} in ${e}`),l.addEventListener("click",u=>{this.#w||this.dispatchEvent(new CustomEvent("product-roadmap:select",{bubbles:!0,detail:{initiative:t,lane:e,start:l.dataset.start,end:l.dataset.end,status:l.dataset.status||null}}))}),this.#p){let u=document.createElement("span");u.className="rm-bar-handle",u.setAttribute("aria-label","Resize end date"),l.appendChild(u),u.addEventListener("pointerdown",m=>this.#s(m,l,t)),l.addEventListener("pointerdown",m=>{m.target!==u&&this.#i(m,l,t)}),l.addEventListener("dragstart",m=>{m.dataTransfer&&(m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/plain",t.id||l.dataset.sourceId||"")),this.#A=t,this.#_=e}),l.addEventListener("dragend",()=>{this.#A=null,this.#_=null})}return l}#i(t,e,r){if(t.button!==0)return;t.preventDefault();let s=e.parentElement.getBoundingClientRect(),a=t.clientX,i=parseFloat(e.style.getPropertyValue("--rm-x"))||0,o=parseFloat(e.style.getPropertyValue("--rm-w"))||0;this.#w={kind:"move",bar:e,initiative:r,trackRect:s,startX:a,startFraction:i,widthFraction:o},e.setPointerCapture(t.pointerId),e.addEventListener("pointermove",this.#o),e.addEventListener("pointerup",this.#a),e.addEventListener("pointercancel",this.#a)}#s(t,e,r){if(t.button!==0)return;t.preventDefault(),t.stopPropagation();let s=e.parentElement.getBoundingClientRect(),a=t.clientX,i=parseFloat(e.style.getPropertyValue("--rm-x"))||0,o=parseFloat(e.style.getPropertyValue("--rm-w"))||0;this.#w={kind:"resize",bar:e,initiative:r,trackRect:s,startX:a,startFraction:i,widthFraction:o},e.setPointerCapture(t.pointerId),e.addEventListener("pointermove",this.#o),e.addEventListener("pointerup",this.#a),e.addEventListener("pointercancel",this.#a)}#o=t=>{if(!this.#w)return;let{kind:e,bar:r,trackRect:s,startX:a,startFraction:i,widthFraction:o}=this.#w,n=(t.clientX-a)/s.width;if(e==="move"){let l=Math.max(0,Math.min(1-o,i+n));r.style.setProperty("--rm-x",l.toFixed(4))}else if(e==="resize"){let l=Math.max(.02,Math.min(1-i,o+n));r.style.setProperty("--rm-w",l.toFixed(4))}};#a=t=>{if(!this.#w)return;let{kind:e,bar:r,initiative:s}=this.#w;r.releasePointerCapture(t.pointerId),r.removeEventListener("pointermove",this.#o),r.removeEventListener("pointerup",this.#a),r.removeEventListener("pointercancel",this.#a);let a=parseFloat(r.style.getPropertyValue("--rm-x"))||0,i=parseFloat(r.style.getPropertyValue("--rm-w"))||0,o=this.#m(this.#b(a)),n=this.#m(this.#b(a+i));r.dataset.start=c.#v(o),r.dataset.end=c.#v(n);let l=this.#d(o),d=this.#d(n)-l;r.style.setProperty("--rm-x",l.toFixed(4)),r.style.setProperty("--rm-w",d.toFixed(4)),s&&(s.setAttribute("data-start",r.dataset.start??""),s.setAttribute("data-end",r.dataset.end??"")),this.dispatchEvent(new CustomEvent(e==="move"?"product-roadmap:reschedule":"product-roadmap:resize",{bubbles:!0,detail:{initiative:s,lane:r.dataset.lane,start:r.dataset.start,end:r.dataset.end}})),setTimeout(()=>{this.#w=null},0)};#n=t=>{this.#A&&(t.preventDefault(),t.dataTransfer.dropEffect="move")};#c=t=>{if(!this.#A)return;t.preventDefault();let e=t.currentTarget.dataset.lane,r=this.#A,s=this.#_;if(e===s)return;let a=this.#x.find(i=>i.getAttribute("data-lane")===e);a&&a.appendChild(r),this.dispatchEvent(new CustomEvent("product-roadmap:move",{bubbles:!0,detail:{initiative:r,fromLane:s,toLane:e,start:r.getAttribute("data-start"),end:r.getAttribute("data-end")}})),this.#e()};#d(t){if(!this.#l)return 0;let e=t.getTime()-this.#l.getTime();return Math.max(0,Math.min(1,e/this.#y))}#b(t){let e=this.#l??new Date;return new Date(e.getTime()+t*this.#y)}#m(t){if(this.#g==="month")return new Date(t.getFullYear(),t.getMonth(),1);let e=t.getMonth(),r=Math.floor(e/3)*3;return new Date(t.getFullYear(),r,1)}#u(){let t=[],e=this.#l,r=this.#h;if(!e||!r)return t;if(this.#g==="quarter"){let s=this.#m(e);for(;s<r;){let a=new Date(s.getFullYear(),s.getMonth()+3,1),i=this.#d(s<e?e:s),o=this.#d(a>r?r:a),n=Math.floor(s.getMonth()/3)+1;t.push({startFraction:i,endFraction:o,label:`Q${n} ${s.getFullYear()}`}),s=a}}else{let s=new Date(e.getFullYear(),e.getMonth(),1);for(;s<r;){let a=new Date(s.getFullYear(),s.getMonth()+1,1),i=this.#d(s<e?e:s),o=this.#d(a>r?r:a),n=s.toLocaleString(void 0,{month:"short"});t.push({startFraction:i,endFraction:o,label:`${n} ${s.getFullYear()}`}),s=a}}return t}static#f(t,e){if(!t)return null;let r=String(t).match(/^(\d{4})-Q([1-4])$/i);if(r){let i=Number(r[1]),n=(Number(r[2])-1)*3;return e==="end"?new Date(i,n+3,0):new Date(i,n,1)}let s=String(t).match(/^(\d{4})-(\d{2})-(\d{2})/);if(s)return new Date(Number(s[1]),Number(s[2])-1,Number(s[3]));let a=new Date(t);return isNaN(a.getTime())?null:a}static#v(t){let e=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${r}`}#l=null;#h=null;#y=0;#g="quarter";#p=!1;#x=[];#k=null;#w=null;#A=null;#_=null};x("product-roadmap",ut);function Tt(c){let t=c;return class extends t{static keyOf(e){return e.id}#e=[];#t=new Map;get items(){return this.#e}set items(e){let r=e||[],s=V({newItems:r,nodes:this.#t,keyOf:this.constructor.keyOf,renderItem:a=>this._renderItem(a),containerFor:(a,i)=>this._containerFor(a,i)});this.#e=r,this._postRender({...s,items:r}),this._emit("items-changed",{items:r},"api")}_renderItem(e){throw new Error(`${this.constructor.name}: must implement _renderItem(item)`)}_containerFor(e,r){return this}_postRender(e){}_emit(e,r,s="api"){this.dispatchEvent(new CustomEvent(`${this.localName}:${e}`,{detail:{...r,source:s},bubbles:!0}))}_nodeFor(e){return this.#t.get(e)||null}_seedCollection(e,r){this.#e=e,this.#t.clear();for(let[s,a]of r)this.#t.set(s,a)}_setItemsSilently(e){this.#e=e}}}var ht=class c extends Tt(C){static get observedAttributes(){return["src","compact","title"]}static keyOf(t){return t.id??t.storyId}static#e=0;#t=null;#r={};#i={};#s=null;#o="";#a=[];#n=null;setup(){this.#o=`kb-${++c.#e}`;let t=[...this.querySelectorAll(":scope > section[data-column]")];this.#a=t.map(a=>{let i=a.getAttribute("data-column")||"",n=a.getAttribute("data-column-label")||""||this.#y(i),l=a.getAttribute("data-wip"),d=l?parseInt(l,10):null,p=a.getAttribute("data-column-color")||null,u=[...a.children];return{id:i,label:n,wip:d,color:p,children:u}});for(let a of t)a.remove();this.#t=document.createElement("div"),this.#t.className="kb-columns",this.#t.setAttribute("role","region"),this.#t.setAttribute("aria-label","Kanban board");let e=0;for(let a of this.#a){let i=document.createElement("section");i.className="kb-column",i.setAttribute("data-column-id",a.id),a.color&&i.setAttribute("data-column-tint",a.color);let o=document.createElement("header");o.className="kb-column-header";let n=document.createElement("h3");n.textContent=a.label;let l=document.createElement("output");if(l.className="kb-count",l.textContent=String(a.children.length),n.appendChild(l),a.wip!==null&&!isNaN(a.wip)){let p=document.createElement("span");p.className="kb-wip",p.textContent=`/ ${a.wip}`,p.setAttribute("aria-label",`WIP limit ${a.wip}`),n.appendChild(p)}o.appendChild(n),i.appendChild(o);let d=document.createElement("drag-surface");if(d.setAttribute("group",this.#o),d.setAttribute("aria-label",`${a.label} items`),d.setAttribute("data-layout","stack"),d.setAttribute("data-layout-gap","xs"),a.children.length>0){for(let p of a.children)p.hasAttribute("draggable")||p.setAttribute("draggable","true"),p.hasAttribute("data-id")||(p.dataset.id=`kb-item-${e}`),d.appendChild(p);e+=a.children.length}else{let p=document.createElement("p");p.className="kb-empty",p.textContent="No items",d.appendChild(p)}i.appendChild(d),this.#t.appendChild(i),this.#r[a.id]=d,this.#i[a.id]=i,a.wip!==null&&a.children.length>a.wip&&i.setAttribute("data-wip-exceeded","")}let r=this.getAttribute("title");if(r){let a=document.createElement("h2");a.className="kb-title",a.textContent=r,this.appendChild(a)}this.appendChild(this.#t),this.#s=document.createElement("div"),this.#s.className="kb-live-region",this.#s.setAttribute("role","status"),this.#s.setAttribute("aria-live","polite"),this.#s.setAttribute("aria-atomic","true"),this.appendChild(this.#s),this.listen(this,"drag-surface:reorder",a=>{let i=a.detail,o=a.target.closest("drag-surface"),n=this.#u(o);n&&(this.#f(n),this.#d("drag"),this.dispatchEvent(new CustomEvent("kanban-board:reorder",{bubbles:!0,detail:{itemId:i.itemId,column:n,oldIndex:i.oldIndex,newIndex:i.newIndex}})))}),this.listen(this,"drag-surface:transfer",a=>{let i=a.detail,o=i.fromSurface,n=i.toSurface,l=this.#u(o),d=this.#u(n);if(!l||!d)return;i.item&&i.item.setAttribute("data-column",d),this.#f(l),this.#f(d);let p=n.querySelector(".kb-empty");if(p&&p.remove(),o.querySelectorAll(':scope > [draggable="true"]').length===0&&!o.querySelector(".kb-empty")){let _=document.createElement("p");_.className="kb-empty",_.textContent="No items",o.appendChild(_)}let m=this.#h(i.item),f=this.#v(l),g=this.#v(d);this.#l(`${m} moved from ${f} to ${g}`),this.#d("drag"),this.dispatchEvent(new CustomEvent("kanban-board:transfer",{bubbles:!0,detail:{itemId:i.itemId,fromColumn:l,toColumn:d,newIndex:i.newIndex,item:i.item}}));let v=n.querySelectorAll(':scope > [draggable="true"]').length,y=this.#a.find(_=>_.id===d);y?.wip!==null&&y?.wip!==void 0&&v>y.wip&&this.dispatchEvent(new CustomEvent("kanban-board:wip-exceeded",{bubbles:!0,detail:{column:d,limit:y.wip,count:v}}))}),this.#c();let s=this.getAttribute("src");if(s){this._loadSrc(s);return}this.dispatchEvent(new CustomEvent("kanban-board:ready",{bubbles:!0,detail:{columnCount:this.#a.length,itemCount:e}}))}#c(){let t=[],e=new Map;for(let[r,s]of Object.entries(this.#r)){let a=s.querySelectorAll(':scope > [draggable="true"]');for(let i of a){let o=i.getAttribute("data-id");o&&(t.push({id:o,column:r}),e.set(o,i))}}this._seedCollection(t,e)}#d(t){let e=[],r=new Map;for(let s of this.items){let a=String(s.id??s.storyId??"");a&&r.set(a,s)}for(let[s,a]of Object.entries(this.#r)){let i=a.querySelectorAll(':scope > [draggable="true"]');for(let o of i){let n=o.getAttribute("data-id");if(!n)continue;let l=r.get(n);e.push(l?{...l,column:s}:{id:n,column:s})}}this._setItemsSilently(e),this._emit("items-changed",{items:e},t)}teardown(){let t=this.querySelector(".kb-title");t&&t.remove(),this.#t&&(this.#t.remove(),this.#t=null),this.#s&&(this.#s.remove(),this.#s=null),this.#r={},this.#i={},this.#a=[]}get columns(){return this.#a.map(t=>({id:t.id,label:t.label,wip:t.wip??void 0,color:t.color??void 0}))}set columns(t){let e=(t||[]).map(i=>({id:i.id,label:i.label||this.#y(i.id),wip:i.wip??null,color:i.color??null,children:[]})),r=this.#t;this.#r={},this.#i={},this.#a=e;let s=this.#m();this.#t=s;let a=()=>{r&&r.remove(),this.appendChild(s)};this.hasAttribute("data-upgraded")&&r?S(this,a,"kb-vt"):a()}get renderItem(){return this.#n}set renderItem(t){this.#n=typeof t=="function"?t:null}_renderItem(t){let e;if(this.#n){let r=this.#n(t);if(!(r instanceof Element))throw new Error("kanban-board: renderItem must return an Element");e=r}else e=this.#b(t);return e.hasAttribute("draggable")||e.setAttribute("draggable","true"),e.hasAttribute("data-id")||e.setAttribute("data-id",String(c.keyOf(t))),e}_containerFor(t,e){let r=this.#r[t.column];if(!r)throw new Error(`kanban-board: no column "${t.column}" \u2014 set .columns first or include item.column matching an existing column id`);let s=r.querySelector(":scope > .kb-empty");return s&&s.remove(),r}_postRender(){for(let t of Object.keys(this.#r)){this.#f(t);let e=this.#r[t],r=e.querySelectorAll(':scope > [draggable="true"]'),s=e.querySelector(":scope > .kb-empty");if(r.length===0&&!s){let a=document.createElement("p");a.className="kb-empty",a.textContent="No items",e.appendChild(a)}else r.length>0&&s&&s.remove()}}#b(t){let e=customElements.get("work-item")?"work-item":"article",r=document.createElement(e);return e==="work-item"?r.data={itemId:t.id??t.storyId,type:t.type,priority:t.priority,status:t.status,estimate:t.estimate!=null?String(t.estimate):void 0,assignee:t.assignee,title:t.title,description:t.description,checklist:t.checklist,notes:t.notes,detail:t.detail}:(r.className="kb-card",r.textContent=t.title||t.label||t.id),r}#m(){let t=document.createElement("div");t.className="kb-columns",t.setAttribute("role","region"),t.setAttribute("aria-label","Kanban board");for(let e of this.#a){let r=document.createElement("section");r.className="kb-column",r.setAttribute("data-column-id",e.id),e.color&&r.setAttribute("data-column-tint",e.color);let s=document.createElement("header");s.className="kb-column-header";let a=document.createElement("h3");a.textContent=e.label;let i=document.createElement("output");if(i.className="kb-count",i.textContent="0",a.appendChild(i),e.wip!=null&&!isNaN(e.wip)){let l=document.createElement("span");l.className="kb-wip",l.textContent=`/ ${e.wip}`,l.setAttribute("aria-label",`WIP limit ${e.wip}`),a.appendChild(l)}s.appendChild(a),r.appendChild(s);let o=document.createElement("drag-surface");o.setAttribute("group",this.#o),o.setAttribute("aria-label",`${e.label} items`),o.setAttribute("data-layout","stack"),o.setAttribute("data-layout-gap","xs");let n=document.createElement("p");n.className="kb-empty",n.textContent="No items",o.appendChild(n),r.appendChild(o),t.appendChild(r),this.#r[e.id]=o,this.#i[e.id]=r}return t}attributeChangedCallback(t,e,r){e===r||!this.isConnected||t==="src"&&this._loadSrc(r)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();for(;this.firstChild;)this.firstChild.remove();for(let a of r.columns||[]){let i=document.createElement("section");i.setAttribute("data-column",a.id),a.label&&i.setAttribute("data-column-label",a.label),a.wip!=null&&i.setAttribute("data-wip",String(a.wip)),a.color&&i.setAttribute("data-column-color",a.color);for(let o of a.items||[]){let n;o.persona||o.action||o.storyId?(n=document.createElement("user-story"),n.setAttribute("detail",o.detail||"minimal"),o.storyId&&n.setAttribute("story-id",o.storyId),o.persona&&n.setAttribute("persona",o.persona),o.action&&n.setAttribute("action",o.action),o.benefit&&n.setAttribute("benefit",o.benefit),o.priority&&n.setAttribute("priority",o.priority),o.status&&n.setAttribute("status",o.status),o.points&&n.setAttribute("points",String(o.points))):(n=document.createElement("article"),n.className="kb-card",n.textContent=o.text||o.label||""),n.setAttribute("draggable","true"),n.dataset.id=o.id||o.storyId||"",i.appendChild(n)}this.appendChild(i)}let s=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};this.hasAttribute("data-upgraded")&&this.#t?S(this,s,"kb-vt"):s()}catch(e){console.warn(`[kanban-board] Failed to load src="${t}":`,e)}}#u(t){if(!t)return null;for(let[e,r]of Object.entries(this.#r))if(r===t)return e;return null}#f(t){let e=this.#r[t],r=this.#i[t];if(!e||!r)return;let s=e.querySelectorAll(':scope > [draggable="true"]').length,a=r.querySelector(".kb-count");a&&(a.textContent=String(s));let i=this.#a.find(o=>o.id===t);i?.wip!==null&&i?.wip!==void 0&&(s>i.wip?r.setAttribute("data-wip-exceeded",""):r.removeAttribute("data-wip-exceeded"))}#v(t){return this.#a.find(r=>r.id===t)?.label||this.#y(t)}#l(t){this.#s&&(this.#s.textContent="",requestAnimationFrame(()=>{this.#s&&(this.#s.textContent=t)}))}#h(t){return t.getAttribute("story-id")||t.getAttribute("data-id")||t.textContent?.trim().slice(0,40)||"item"}#y(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("kanban-board",ht);var mt=class c extends C{static get observedAttributes(){return["src","compact","title"]}static#e=0;#t=null;#r=null;#i={};#s=null;#o="";#a=[];setup(){this.#o=`sm-${++c.#e}`;let t=[...this.querySelectorAll(":scope > section[data-activity]")];this.#a=t.map(a=>{let i=a.getAttribute("data-activity")||"",n=a.getAttribute("data-activity-label")||""||this.#m(i),l=a.getAttribute("data-journey-phase")||null,d=[...a.children];return{id:i,label:n,journeyPhase:l,children:d}});for(let a of t)a.remove();this.#t=document.createElement("div"),this.#t.className="sm-scroll",this.#t.setAttribute("role","region"),this.#t.setAttribute("aria-label","Story map"),this.#t.setAttribute("tabindex","0"),this.#r=document.createElement("div"),this.#r.className="sm-columns";let e=0;for(let a of this.#a){let i=document.createElement("section");i.className="sm-column",i.setAttribute("data-activity-column",a.id);let o=document.createElement("header");o.className="sm-activity-header";let n=document.createElement("h3");n.textContent=a.label;let l=document.createElement("span");l.className="sm-activity-count",l.textContent=String(a.children.length),n.appendChild(l),o.appendChild(n),i.appendChild(o);let d=document.createElement("drag-surface");if(d.setAttribute("group",this.#o),d.setAttribute("aria-label",`${a.label} stories`),d.setAttribute("data-layout","stack"),d.setAttribute("data-layout-gap","xs"),a.children.length>0){for(let p of a.children)d.appendChild(p);e+=a.children.length}else{let p=document.createElement("p");p.className="sm-empty",p.textContent="No stories yet",d.appendChild(p)}i.appendChild(d),this.#r.appendChild(i),this.#i[a.id]=d}let r=this.getAttribute("title");if(r){let a=document.createElement("h2");a.className="sm-title",a.textContent=r,this.appendChild(a)}this.#t.appendChild(this.#r),this.appendChild(this.#t),this.#s=document.createElement("div"),this.#s.className="sm-live-region",this.#s.setAttribute("role","status"),this.#s.setAttribute("aria-live","polite"),this.#s.setAttribute("aria-atomic","true"),this.appendChild(this.#s),this.listen(this,"drag-surface:reorder",a=>{let i=a.detail,o=a.target.closest("drag-surface"),n=this.#n(o);n&&(this.#c(n),this.dispatchEvent(new CustomEvent("story-map:reorder",{bubbles:!0,detail:{itemId:i.itemId,activity:n,oldIndex:i.oldIndex,newIndex:i.newIndex}})))}),this.listen(this,"drag-surface:transfer",a=>{let i=a.detail,o=i.fromSurface,n=i.toSurface,l=this.#n(o),d=this.#n(n);if(!l||!d)return;this.#c(l),this.#c(d);let p=n.querySelector(".sm-empty");if(p&&p.remove(),o.querySelectorAll(':scope > [draggable="true"]').length===0&&!o.querySelector(".sm-empty")){let f=document.createElement("p");f.className="sm-empty",f.textContent="No stories yet",o.appendChild(f)}let m=this.#b(i.item);this.#d(`${m} moved from ${l} to ${d}`),this.dispatchEvent(new CustomEvent("story-map:transfer",{bubbles:!0,detail:{itemId:i.itemId,fromActivity:l,toActivity:d,newIndex:i.newIndex}}))});let s=this.getAttribute("src");if(s){this._loadSrc(s);return}this.dispatchEvent(new CustomEvent("story-map:ready",{bubbles:!0,detail:{activityCount:this.#a.length,storyCount:e}}))}teardown(){this.#t&&(this.#t.remove(),this.#t=null),this.#s&&(this.#s.remove(),this.#s=null),this.#r=null,this.#i={},this.#a=[]}get activities(){return this.#a.map(t=>({id:t.id,label:t.label,journeyPhase:t.journeyPhase||void 0,stories:[...this.#i[t.id]?.querySelectorAll(':scope > [draggable="true"]')||[]].map(e=>({id:e.getAttribute("data-id")||void 0,storyId:e.getAttribute("story-id")||void 0,title:e.querySelector('[slot="title"]')?.textContent?.trim()||void 0}))}))}set activities(t){let e=Array.isArray(t)?t:[];for(;this.firstChild;)this.firstChild.remove();for(let s of e){let a=document.createElement("section");a.setAttribute("data-activity",s.id||""),s.label&&a.setAttribute("data-activity-label",s.label),s.journeyPhase&&a.setAttribute("data-journey-phase",s.journeyPhase);for(let i of s.stories||[]){let o,n=this;if(typeof n.renderStory=="function"){let l=n.renderStory(i);o=l instanceof Element?l:null}o||(customElements.get("user-story")?(o=document.createElement("user-story"),o.data=i):(o=document.createElement("article"),o.className="sm-card",o.textContent=i.title||i.id||"")),o.hasAttribute("draggable")||o.setAttribute("draggable","true"),i.id&&!o.hasAttribute("data-id")&&o.setAttribute("data-id",String(i.id)),a.appendChild(o)}this.appendChild(a)}let r=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};this.hasAttribute("data-upgraded")&&this.#t?S(this,r,"sm-vt"):r(),this.dispatchEvent(new CustomEvent("story-map:activities-changed",{detail:{activities:e,source:"property"},bubbles:!0}))}attributeChangedCallback(t,e,r){e===r||!this.isConnected||t==="src"&&this._loadSrc(r)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();for(;this.firstChild;)this.firstChild.remove();for(let a of r.activities||[]){let i=document.createElement("section");i.setAttribute("data-activity",a.id),i.setAttribute("data-activity-label",a.label||a.id),a.journeyPhase&&i.setAttribute("data-journey-phase",a.journeyPhase);for(let o of a.stories||[]){let n=document.createElement("user-story");n.setAttribute("draggable","true"),n.dataset.id=o.id||o.storyId,(o.storyId||o.id)&&n.setAttribute("story-id",o.storyId||o.id),o.title&&n.setAttribute("title",o.title),o.persona&&n.setAttribute("persona",o.persona),o.action&&n.setAttribute("action",o.action),o.benefit&&n.setAttribute("benefit",o.benefit),o.priority&&n.setAttribute("priority",o.priority),o.status&&n.setAttribute("status",o.status),o.points&&n.setAttribute("points",String(o.points)),n.setAttribute("detail",o.detail||"compact"),i.appendChild(n)}this.appendChild(i)}let s=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};this.hasAttribute("data-upgraded")&&this.#t?S(this,s,"sm-vt"):s()}catch(e){console.warn(`[story-map] Failed to load src="${t}":`,e)}}#n(t){if(!t)return null;for(let[e,r]of Object.entries(this.#i))if(r===t)return e;return null}#c(t){let e=this.#i[t];if(!e)return;let r=e.querySelectorAll(':scope > [draggable="true"]').length,s=e.closest("[data-activity-column]");if(!s)return;let a=s.querySelector(".sm-activity-count");a&&(a.textContent=String(r))}#d(t){this.#s&&(this.#s.textContent="",requestAnimationFrame(()=>{this.#s&&(this.#s.textContent=t)}))}#b(t){return t.getAttribute("story-id")||t.getAttribute("data-id")||t.textContent?.trim().slice(0,40)||"item"}#m(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("story-map",mt);var Q=`
|
|
1781
1781
|
:host {
|
|
1782
1782
|
display: block;
|
|
1783
1783
|
position: relative;
|
|
@@ -2225,43 +2225,43 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
2225
2225
|
/* \u2500\u2500 Utility \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
2226
2226
|
.state-msg { padding: var(--_space-l); font-size: var(--_font-sm); color: var(--_muted); font-style: italic; }
|
|
2227
2227
|
.state-msg--error { color: var(--color-error-text, var(--color-error, #dc2626)); }
|
|
2228
|
-
`;function
|
|
2228
|
+
`;function ee(){let c=globalThis.localStorage;if(!c)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return c.getItem(t)},async setRaw(t,e){c.setItem(t,e)},async removeRaw(t){c.removeItem(t)},async keys(t){let e=[];for(let r=0;r<c.length;r++){let s=c.key(r);s&&s.startsWith(t)&&e.push(s)}return e}}}var X=null;function I(){return X||(X=ee()),X}function ft(c,t){if(typeof c!="string"||!c)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${c}:${t}`}function Mt(c){if(typeof c!="string"||!c)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${c}:`}function zt(c){try{let t=JSON.parse(c);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var Y={configure(c={}){X=c.backend??null},async set(c,t,e){let r={data:e,timestamp:Date.now()};await I().setRaw(ft(c,t),JSON.stringify(r))},async get(c,t,e){let r=await I().getRaw(ft(c,t));if(r==null)return null;let s=zt(r);return!s||e?.maxAge!=null&&Date.now()-s.timestamp>e.maxAge?null:s.data},async remove(c,t){await I().removeRaw(ft(c,t))},async list(c){let t=Mt(c),e=await I().keys(t),r=[];for(let s of e){let a=await I().getRaw(s);if(a==null)continue;let i=zt(a);i&&r.push({key:s.slice(t.length),data:i.data,timestamp:i.timestamp})}return r},async clear(c){let t=Mt(c),e=await I().keys(t);for(let r of e)await I().removeRaw(r)},async clearAll(){let c=await I().keys("vb:");for(let t of c)await I().removeRaw(t)},async setMany(c,t){for(let[e,r]of t)await Y.set(c,e,r)}};var bt="[data-copy], [data-copy-target], [data-paste-target]",re="Copied to clipboard",se="Pasted from clipboard",gt=new WeakMap;async function yt(c,t={}){if(c==null||c==="")return!1;let{button:e,announceMessage:r=re,duration:s=1500}=t;try{await navigator.clipboard.writeText(c)}catch{return!1}return Nt({button:e,duration:s,announceMessage:r,eventDetail:{text:c}}),!0}function Nt({button:c,duration:t,announceMessage:e,eventDetail:r,state:s="copied",eventName:a="copy"}){if(c){c.dataset.state=s;let i=gt.get(c);i&&clearTimeout(i),gt.set(c,setTimeout(()=>{delete c.dataset.state,gt.delete(c)},t)),c.dispatchEvent(new CustomEvent(a,{bubbles:!0,detail:r}))}oe(e,c??document.body)}async function ae(c,t={}){let{button:e,announceMessage:r=se,duration:s=1500}=t,a;try{a=await navigator.clipboard.readText()}catch{return null}return c&&("value"in c&&(c instanceof HTMLInputElement||c instanceof HTMLTextAreaElement||c instanceof HTMLSelectElement)?c.value=a:c.textContent=a,c.dispatchEvent(new Event("input",{bubbles:!0}))),Nt({button:e,duration:s,announceMessage:r,eventDetail:{text:a},state:"pasted",eventName:"paste"}),a}function Lt(c=document){c.querySelectorAll(bt).forEach(vt)}function vt(c){c.hasAttribute("data-copy-init")||(c.setAttribute("data-copy-init",""),c.addEventListener("click",()=>{if(c.dataset.pasteTarget){let e=document.querySelector(c.dataset.pasteTarget);if(!e)return;ae(e,{button:c});return}let t=ie(c);t&&yt(t,{button:c})}))}function ie(c){if(c.dataset.copy)return c.dataset.copy;if(c.dataset.copyTarget){let t=document.querySelector(c.dataset.copyTarget);if(!t)return"";let e=c.dataset.copyAttr;return e?t.getAttribute(e)??"":t.textContent??""}return""}function oe(c,t){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.className="visually-hidden",e.textContent=c,t.appendChild(e),setTimeout(()=>e.remove(),1e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Lt()):Lt();var ne=new MutationObserver(c=>{for(let t of c)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let r=e;r.matches(bt)&&vt(r),r.querySelectorAll(bt).forEach(s=>vt(s))}});ne.observe(document.documentElement,{childList:!0,subtree:!0});var P=class{#e=new Map;async load(){return[...this.#e.values()]}async save(t){return t.id||(t.id=crypto.randomUUID()),this.#e.set(t.id,t),t}async update(t,e){let r=this.#e.get(t);if(!r)throw new Error(`Pin ${t} not found`);return Object.assign(r,e),r}async remove(t){this.#e.delete(t)}},K=class{#e;constructor(t="default"){this.#e=t}async#t(){let t=await Y.get("reviews",this.#e);return Array.isArray(t)?t:[]}async#r(t){await Y.set("reviews",this.#e,t)}async load(){return this.#t()}async save(t){t.id||(t.id=crypto.randomUUID());let e=await this.#t();return e.push(t),await this.#r(e),t}async update(t,e){let r=await this.#t(),s=r.findIndex(a=>a.id===t);if(s===-1)throw new Error(`Pin ${t} not found`);return Object.assign(r[s],e),await this.#r(r),r[s]}async remove(t){let e=(await this.#t()).filter(r=>r.id!==t);await this.#r(e)}},W=class{#e;constructor(t){if(!t)throw new Error("RestAdapter requires an endpoint URL");this.#e=t.replace(/\/$/,"")}async load(){let t=await fetch(this.#e);if(!t.ok)throw new Error(`HTTP ${t.status}`);let e=await t.json();return Array.isArray(e)?e:e.pins||[]}async save(t){let e=await fetch(this.#e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}async update(t,e){let r=await fetch(`${this.#e}/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}async remove(t){let e=await fetch(`${this.#e}/${encodeURIComponent(t)}`,{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`)}},xt=class extends HTMLElement{static get observedAttributes(){return["src","editable","adapter","endpoint","storage-key","author","compact","show-resolved"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"}),this.__pins=[],this.__adapter=null,this._activePin=null,this._annotating=!1}get pins(){return this.__pins}set pins(t){let e=Array.isArray(t)?t:[];this.__pins!==e&&(this.__pins=e,this.isConnected&&this._render(),this.dispatchEvent(new CustomEvent("review-surface:pins-changed",{detail:{pins:e,source:"property"},bubbles:!0,composed:!0})))}get adapter(){return this.__adapter}set adapter(t){this.__adapter=t,this.isConnected&&this._loadFromAdapter()}#t(){for(let t of this.children){let e=t.getAttribute("slot");e&&this.#e.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#e.get(t)||""}connectedCallback(){this.#t(),this.setAttribute("data-upgraded",""),this.#r(),this.hasAttribute("src")?this._loadSrc(this.getAttribute("src")):this._loadFromAdapter()}disconnectedCallback(){this.removeAttribute("data-upgraded"),this.removeAttribute("data-annotating")}attributeChangedCallback(t){this.isConnected&&(t==="src"?this._loadSrc(this.getAttribute("src")):t==="adapter"||t==="endpoint"||t==="storage-key"?(this.#r(),this._loadFromAdapter()):this._render())}#r(){if(this.__adapter&&!(this.__adapter instanceof P)&&!(this.__adapter instanceof K)&&!(this.__adapter instanceof W))return;switch(this.getAttribute("adapter")||"memory"){case"local":this.__adapter=new K(this.getAttribute("storage-key")||"default");break;case"rest":try{this.__adapter=new W(this.getAttribute("endpoint")??"")}catch{this.__adapter=new P}break;default:this.__adapter=new P}}async _loadSrc(t){if(!(!t||!this.shadowRoot)){this.shadowRoot.innerHTML=`<style>${Q}</style><div class="state-msg">Loading\u2026</div>`;try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();this.__pins=Array.isArray(r)?r:r.pins||[],this._render()}catch(e){let r=e instanceof Error?e.message:String(e);this.shadowRoot.innerHTML=`<style>${Q}</style><div class="state-msg state-msg--error">Could not load pins: ${h(r)}</div>`}}}async _loadFromAdapter(){if(this.__adapter){try{this.__pins=await this.__adapter.load()}catch{this.__pins=[]}this._render()}}async addPin(t){let e={id:crypto.randomUUID(),x:Math.max(0,Math.min(100,t.x)),y:Math.max(0,Math.min(100,t.y)),text:t.text||"",author:t.author||this.getAttribute("author")||"Anonymous",createdAt:new Date().toISOString(),resolved:!1,resolvedBy:null,resolvedAt:null,replies:[]};return this.__adapter&&await this.__adapter.save(e),this.__pins.push(e),this._render(),this.#c(`Pin ${this.#i().length} added`),this.dispatchEvent(new CustomEvent("review-surface:add",{bubbles:!0,composed:!0,detail:{pin:e}})),e}async removePin(t){let e=this.__pins.find(r=>r.id===t);e&&(this.__adapter&&await this.__adapter.remove(t),this.__pins=this.__pins.filter(r=>r.id!==t),this._activePin===t&&(this._activePin=null),this._render(),this.#c("Pin removed"),this.dispatchEvent(new CustomEvent("review-surface:remove",{bubbles:!0,composed:!0,detail:{pin:e}})))}async resolvePin(t){let e=this.__pins.find(s=>s.id===t);if(!e)return;let r={resolved:!0,resolvedBy:this.getAttribute("author")||"Anonymous",resolvedAt:new Date().toISOString()};this.__adapter&&await this.__adapter.update(t,r),Object.assign(e,r),this._render(),this.#c("Pin resolved"),this.dispatchEvent(new CustomEvent("review-surface:resolve",{bubbles:!0,composed:!0,detail:{pin:e}}))}async unresolvePin(t){let e=this.__pins.find(s=>s.id===t);if(!e)return;let r={resolved:!1,resolvedBy:null,resolvedAt:null};this.__adapter&&await this.__adapter.update(t,r),Object.assign(e,r),this._render(),this.#c("Pin re-opened"),this.dispatchEvent(new CustomEvent("review-surface:update",{bubbles:!0,composed:!0,detail:{pin:e,changes:r}}))}exportPins(){return structuredClone(this.__pins)}importPins(t){this.__pins=Array.isArray(t)?structuredClone(t):[],this._activePin=null,this._render()}#i(){let t=this.hasAttribute("show-resolved");return this.__pins.filter(e=>t||!e.resolved).sort((e,r)=>new Date(e.createdAt??0).getTime()-new Date(r.createdAt??0).getTime())}_render(){if(!this.shadowRoot)return;let t=this.hasAttribute("editable"),e=this.#i(),r=this._activePin?this.__pins.find(s=>s.id===this._activePin):null;this.setAttribute("pin-count",String(e.length)),this.shadowRoot.innerHTML=`<style>${Q}</style>
|
|
2229
2229
|
<div class="rs-container">
|
|
2230
2230
|
<slot></slot>
|
|
2231
2231
|
<div class="rs-overlay" role="img" aria-label="Review annotation surface">
|
|
2232
|
-
${e.map((
|
|
2232
|
+
${e.map((s,a)=>this._renderPin(s,a+1)).join("")}
|
|
2233
2233
|
</div>
|
|
2234
|
-
${
|
|
2234
|
+
${r?this._renderPopover(r,t):""}
|
|
2235
2235
|
</div>
|
|
2236
2236
|
${t?this._renderToolbar(e.length):""}
|
|
2237
|
-
<div class="rs-live" aria-live="polite" aria-atomic="true"></div>`,this._bindListeners(t),this.dispatchEvent(new CustomEvent("review-surface:ready",{bubbles:!0,composed:!0,detail:{pinCount:e.length}}))}_renderPin(t,e){let
|
|
2238
|
-
data-pin-id="${
|
|
2237
|
+
<div class="rs-live" aria-live="polite" aria-atomic="true"></div>`,this._bindListeners(t),this.dispatchEvent(new CustomEvent("review-surface:ready",{bubbles:!0,composed:!0,detail:{pinCount:e.length}}))}_renderPin(t,e){let r=t.text?t.text.slice(0,50):"Empty pin";return`<button class="rs-pin"
|
|
2238
|
+
data-pin-id="${h(t.id)}"
|
|
2239
2239
|
${t.resolved?"data-resolved":""}
|
|
2240
2240
|
${this._activePin===t.id?"data-active":""}
|
|
2241
2241
|
style="left:${t.x}%;top:${t.y}%"
|
|
2242
|
-
aria-label="Pin ${e}: ${
|
|
2242
|
+
aria-label="Pin ${e}: ${h(r)}"
|
|
2243
2243
|
aria-expanded="${this._activePin===t.id}"
|
|
2244
2244
|
aria-haspopup="dialog">
|
|
2245
2245
|
<span class="rs-pin__number">${e}</span>
|
|
2246
|
-
</button>`}_renderPopover(t,e){let
|
|
2246
|
+
</button>`}_renderPopover(t,e){let r=this.#i().findIndex(s=>s.id===t.id)+1;return`<div class="rs-popover" data-open
|
|
2247
2247
|
style="left:${Math.min(t.x,70)}%;top:${t.y}%"
|
|
2248
2248
|
role="dialog"
|
|
2249
|
-
aria-labelledby="rs-popover-title-${
|
|
2249
|
+
aria-labelledby="rs-popover-title-${h(t.id)}">
|
|
2250
2250
|
|
|
2251
2251
|
<div class="rs-popover__header">
|
|
2252
|
-
<span class="rs-popover__title" id="rs-popover-title-${
|
|
2253
|
-
Pin ${
|
|
2252
|
+
<span class="rs-popover__title" id="rs-popover-title-${h(t.id)}">
|
|
2253
|
+
Pin ${r}
|
|
2254
2254
|
${t.resolved?`<span class="rs-resolved-badge">${A(k.checkCircle)} Resolved</span>`:""}
|
|
2255
2255
|
</span>
|
|
2256
2256
|
<div class="rs-popover__actions">
|
|
2257
2257
|
${e&&!t.resolved?`
|
|
2258
|
-
<button class="rs-popover__btn rs-popover__btn--resolve" data-action="resolve" data-pin-id="${
|
|
2258
|
+
<button class="rs-popover__btn rs-popover__btn--resolve" data-action="resolve" data-pin-id="${h(t.id)}"
|
|
2259
2259
|
aria-label="Resolve pin" title="Resolve">${A(k.checkCircle)}</button>`:""}
|
|
2260
2260
|
${e&&t.resolved?`
|
|
2261
|
-
<button class="rs-popover__btn" data-action="unresolve" data-pin-id="${
|
|
2261
|
+
<button class="rs-popover__btn" data-action="unresolve" data-pin-id="${h(t.id)}"
|
|
2262
2262
|
aria-label="Re-open pin" title="Re-open">${A(k.messageCircle)}</button>`:""}
|
|
2263
2263
|
${e?`
|
|
2264
|
-
<button class="rs-popover__btn rs-popover__btn--delete" data-action="delete" data-pin-id="${
|
|
2264
|
+
<button class="rs-popover__btn rs-popover__btn--delete" data-action="delete" data-pin-id="${h(t.id)}"
|
|
2265
2265
|
aria-label="Delete pin" title="Delete">${A(k.x)}</button>`:""}
|
|
2266
2266
|
<button class="rs-popover__btn" data-action="close"
|
|
2267
2267
|
aria-label="Close">${A(k.x)}</button>
|
|
@@ -2270,23 +2270,23 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
2270
2270
|
|
|
2271
2271
|
<div class="rs-comment">
|
|
2272
2272
|
<div class="rs-comment__meta">
|
|
2273
|
-
<span class="rs-comment__avatar" style="background:${
|
|
2274
|
-
<span class="rs-comment__author">${
|
|
2273
|
+
<span class="rs-comment__avatar" style="background:${L(t.author||"Anonymous")}">${z(t.author||"Anonymous")}</span>
|
|
2274
|
+
<span class="rs-comment__author">${h(t.author||"Anonymous")}</span>
|
|
2275
2275
|
<span class="rs-comment__time">${this.#n(t.createdAt)}</span>
|
|
2276
2276
|
</div>
|
|
2277
|
-
<div class="rs-comment__text">${
|
|
2277
|
+
<div class="rs-comment__text">${h(t.text)}</div>
|
|
2278
2278
|
</div>
|
|
2279
2279
|
|
|
2280
2280
|
${t.replies?.length?`
|
|
2281
2281
|
<div class="rs-replies">
|
|
2282
|
-
${t.replies.map(
|
|
2282
|
+
${t.replies.map(s=>`
|
|
2283
2283
|
<div class="rs-reply">
|
|
2284
2284
|
<div class="rs-comment__meta">
|
|
2285
|
-
<span class="rs-comment__avatar" style="background:${
|
|
2286
|
-
<span class="rs-comment__author">${
|
|
2287
|
-
<span class="rs-comment__time">${this.#n(
|
|
2285
|
+
<span class="rs-comment__avatar" style="background:${L(s.author||"Anonymous")}">${z(s.author||"Anonymous")}</span>
|
|
2286
|
+
<span class="rs-comment__author">${h(s.author||"Anonymous")}</span>
|
|
2287
|
+
<span class="rs-comment__time">${this.#n(s.createdAt)}</span>
|
|
2288
2288
|
</div>
|
|
2289
|
-
<div class="rs-comment__text">${
|
|
2289
|
+
<div class="rs-comment__text">${h(s.text)}</div>
|
|
2290
2290
|
</div>
|
|
2291
2291
|
`).join("")}
|
|
2292
2292
|
</div>`:""}
|
|
@@ -2294,8 +2294,8 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
2294
2294
|
${e?`
|
|
2295
2295
|
<div class="rs-input">
|
|
2296
2296
|
<textarea class="rs-input__field" placeholder="Reply\u2026" rows="1"
|
|
2297
|
-
aria-label="Reply to pin ${
|
|
2298
|
-
<button class="rs-input__submit" data-action="reply" data-pin-id="${
|
|
2297
|
+
aria-label="Reply to pin ${r}"></textarea>
|
|
2298
|
+
<button class="rs-input__submit" data-action="reply" data-pin-id="${h(t.id)}"
|
|
2299
2299
|
aria-label="Send reply">${A(k.send)}</button>
|
|
2300
2300
|
</div>`:""}
|
|
2301
2301
|
|
|
@@ -2310,7 +2310,7 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
2310
2310
|
${A(k.download)} Export
|
|
2311
2311
|
</button>
|
|
2312
2312
|
<output class="rs-toolbar__count">${t} pin${t!==1?"s":""}</output>
|
|
2313
|
-
</div>`}_bindListeners(t){let e=this.shadowRoot;if(!e)return;e.querySelectorAll(".rs-pin").forEach(i=>{i.addEventListener("click",a=>{a.stopPropagation();let o=i.dataset.pinId??null;this._activePin=this._activePin===o?null:o,this._render(),this._activePin&&this.dispatchEvent(new CustomEvent("review-surface:select",{bubbles:!0,composed:!0,detail:{pin:this.__pins.find(n=>n.id===o)}}))})});let s=e.querySelector(".rs-overlay");s&&t&&s.addEventListener("click",i=>{if(!this._annotating)return;let a=i;if(a.target?.closest(".rs-pin"))return;let n=s.getBoundingClientRect(),d=(a.clientX-n.left)/n.width*100,l=(a.clientY-n.top)/n.height*100;this.#r(d,l)}),e.querySelectorAll("[data-action]").forEach(i=>{i.addEventListener("click",a=>{a.stopPropagation();let o=i.dataset.action,n=i.dataset.pinId;switch(o){case"close":this._activePin=null,this._render();break;case"resolve":n&&this.resolvePin(n);break;case"unresolve":n&&this.unresolvePin(n);break;case"delete":n&&this.removePin(n);break;case"toggle-mode":this._annotating=!this._annotating,this._annotating?this.setAttribute("data-annotating",""):this.removeAttribute("data-annotating"),this._render(),this.dispatchEvent(new CustomEvent("review-surface:mode",{bubbles:!0,composed:!0,detail:{mode:this._annotating?"annotate":"view"}}));break;case"export":this.#a();break;case"reply":this.#o(n);break}})});let r=e.querySelector(".rs-input__field");r&&r.addEventListener("keydown",i=>{let a=i;if(a.key==="Enter"&&!a.shiftKey){a.preventDefault();let n=e.querySelector('[data-action="reply"]')?.dataset.pinId;n&&this.#o(n)}}),e.addEventListener("keydown",i=>{i.key==="Escape"&&(this._activePin?(this._activePin=null,this._render()):this._annotating&&(this._annotating=!1,this.removeAttribute("data-annotating"),this._render(),this.dispatchEvent(new CustomEvent("review-surface:mode",{bubbles:!0,composed:!0,detail:{mode:"view"}}))))})}async#r(t,e){let s=this.getAttribute("author")||"Anonymous",r=await this.addPin({x:t,y:e,text:"",author:s});this._activePin=r.id,this._render(),requestAnimationFrame(()=>{(this.shadowRoot?.querySelector(".rs-input__field")??null)?.focus()})}async#o(t){let e=this.shadowRoot?.querySelector(".rs-input__field")??null;if(!e)return;let s=e.value.trim();if(!s)return;let r=this.__pins.find(a=>a.id===t);if(!r)return;let i={id:crypto.randomUUID(),text:s,author:this.getAttribute("author")||"Anonymous",createdAt:new Date().toISOString()};r.replies||(r.replies=[]),r.text?(r.replies.push(i),this.__adapter&&await this.__adapter.update(t,{replies:r.replies})):(r.text=s,this.__adapter&&await this.__adapter.update(t,{text:s})),this._render(),this.#l("Reply added"),requestAnimationFrame(()=>{(this.shadowRoot?.querySelector(".rs-input__field")??null)?.focus()}),this.dispatchEvent(new CustomEvent("review-surface:update",{bubbles:!0,composed:!0,detail:{pin:r,changes:{replies:r.replies}}}))}async#a(){let t=JSON.stringify(this.exportPins(),null,2);if(await At(t,{announceMessage:"Pins copied to clipboard"}))return;let s=new Blob([t],{type:"application/json"}),r=URL.createObjectURL(s),i=document.createElement("a");i.href=r,i.download="review-pins.json",i.click(),URL.revokeObjectURL(r),this.#l("Pins exported as file")}#n(t){if(!t)return"";try{let e=new Date(t),r=new Date().getTime()-e.getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);return o<7?`${o}d ago`:e.toLocaleDateString()}catch{return""}}#l(t){let e=this.shadowRoot?.querySelector(".rs-live");e&&(e.textContent=t)}};x("review-surface",Ct);var P=864e5,Et=P*7,Z=P*30,ve=P*91,Vt=P*365;function B(c){return typeof c=="number"?c:new Date(c).getTime()}function ye(c){return c<=Et*3?t=>t.toLocaleDateString(void 0,{month:"short",day:"numeric"}):c<=Z*3?t=>t.toLocaleDateString(void 0,{month:"short",day:"numeric"}):c<=Vt?t=>t.toLocaleDateString(void 0,{month:"short",year:"2-digit"}):t=>t.toLocaleDateString(void 0,{year:"numeric"})}function xe(c){return c<=Et*3?"day":c<=Z*3?"week":c<=Vt?"month":"quarter"}function Ut(c){return String(c).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var kt=class c extends C{static get observedAttributes(){return["src","title","view","show-today","show-progress","show-dependencies","compact"]}#e=null;#s=null;#t=null;#i=[];#r=0;#o=0;#a=0;setup(){let t=this.querySelector(":scope > table");return!t||(this.#i=this.#c(t),this.#i.length===0)?!1:(this.#r=Math.min(...this.#i.map(e=>e.start)),this.#o=Math.max(...this.#i.map(e=>e.end)),this.#a=this.#o-this.#r,this.#a<=0&&(this.#a=P),this.#p(t),this.dispatchEvent(new CustomEvent("gantt-chart:ready",{bubbles:!0,detail:{taskCount:this.#i.length,dateRange:{start:new Date(this.#r).toISOString(),end:new Date(this.#o).toISOString()}}})),!0)}teardown(){this.#t&&(this.#t.remove(),this.#t=null),this.#e&&(this.#e.remove(),this.#e=null),this.#s&&(this.#s.remove(),this.#s=null);let t=this.querySelector("table.gc-sr-only");t&&t.classList.remove("gc-sr-only"),this.#i=[]}static#n=0;attributeChangedCallback(t,e,s){e===s||!this.isConnected||(t==="src"?this._loadSrc(s):this.hasAttribute("data-upgraded")&&this.#l())}#l(){let t=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};if(this.hasAttribute("data-upgraded")&&"startViewTransition"in document&&!matchMedia("(prefers-reduced-motion: reduce)").matches){let e=`gc-vt-${++c.#n}`;this.style.viewTransitionName=e,document.startViewTransition(t).finished.finally(()=>{this.style.viewTransitionName=""})}else t()}get tasks(){return this.#i}set tasks(t){let e=(t||[]).map((s,r)=>({id:s.id??`gc-task-${r}`,name:s.name??`Task ${r+1}`,start:typeof s.start=="number"?s.start:B(s.start),end:typeof s.end=="number"?s.end:s.end!=null?B(s.end):typeof s.start=="number"?s.start:B(s.start),progress:s.progress??0,group:s.group??null,depends:Array.isArray(s.depends)?s.depends:s.depends?String(s.depends).split(",").map(i=>i.trim()):[],status:s.status??null,assignee:s.assignee??null,milestone:!!s.milestone,color:s.color??null,storyIds:s.storyIds??[],itemIds:s.itemIds??[]}));if((this.#e||this.#t||this.#s)&&(this.#t&&(this.#t.remove(),this.#t=null),this.#e&&(this.#e.remove(),this.#e=null),this.#s&&(this.#s.remove(),this.#s=null)),this.#i=e,e.length>0){this.#r=Math.min(...e.map(r=>r.start)),this.#o=Math.max(...e.map(r=>r.end)),this.#a=this.#o-this.#r,this.#a<=0&&(this.#a=P);let s=this.querySelector(":scope > table");s||(s=document.createElement("table"),s.classList.add("gc-sr-only"),this.appendChild(s)),this.#p(s)}this.dispatchEvent(new CustomEvent("gantt-chart:tasks-changed",{detail:{tasks:e,source:"property"},bubbles:!0}))}#c(t){let e=t.querySelectorAll("tbody tr"),s=[];for(let r=0;r<e.length;r++){let i=e[r],a=i.querySelectorAll("time[datetime]");if(a.length<2&&!i.hasAttribute("data-milestone"))continue;let o=a[0]?.getAttribute("datetime"),n=a.length>1?a[1].getAttribute("datetime"):o;if(!o)continue;let d=i.querySelector("progress"),l=d?d.value/(d.max||100):0,u=i.cells[0]?.textContent?.trim()||`Task ${r+1}`;s.push({id:i.dataset.taskId||`gc-task-${r}`,name:u,start:B(o),end:B(n),progress:l,group:i.dataset.group||null,depends:i.dataset.depends?i.dataset.depends.split(",").map(h=>h.trim()):[],status:i.dataset.status||null,assignee:i.dataset.assignee||null,milestone:i.hasAttribute("data-milestone"),color:i.dataset.color||null,storyIds:i.dataset.storyIds?i.dataset.storyIds.split(",").map(h=>h.trim()):[],itemIds:i.dataset.itemIds?i.dataset.itemIds.split(",").map(h=>h.trim()):[]})}return s}#p(t){let e=this.getAttribute("title"),s=this.hasAttribute("show-today"),r=this.hasAttribute("show-progress"),i=this.hasAttribute("show-dependencies");e&&(this.#t=document.createElement("h2"),this.#t.className="gc-title",this.#t.textContent=e,this.insertBefore(this.#t,t)),this.#e=document.createElement("div"),this.#e.className="gc-container",this.#e.setAttribute("role","region"),this.#e.setAttribute("aria-label",`Gantt chart${e?": "+e:""}`);let a=this.#d();this.#e.appendChild(a);let o=document.createElement("div");o.className="gc-body";let n=document.createElement("div");n.className="gc-task-list";let d=document.createElement("div");d.className="gc-bars";let l=this.#m();d.appendChild(l);let u=this.#y();for(let[h,m]of u){if(u.size>1&&h){let f=document.createElement("div");f.className="gc-group-header";let p=document.createElement("span");p.className="gc-group-label",p.textContent=h,f.appendChild(p),n.appendChild(f);let b=document.createElement("div");b.className="gc-group-spacer",d.appendChild(b)}for(let f of m){let p=document.createElement("div");p.className="gc-task-row",p.setAttribute("data-task-id",f.id);let b=document.createElement("span");b.className="gc-task-name",b.textContent=f.name,p.appendChild(b);let y=document.createElement("span");y.className="gc-task-dates",y.textContent=`${new Date(f.start).toLocaleDateString()} to ${new Date(f.end).toLocaleDateString()}`,p.appendChild(y),n.appendChild(p);let _=document.createElement("div");_.className="gc-bar-row",f.milestone?_.appendChild(this.#v(f)):_.appendChild(this.#h(f,r)),d.appendChild(_)}}if(s){let h=this.#x();h&&d.appendChild(h)}i&&requestAnimationFrame(()=>{let h=this.#f(d);h&&d.appendChild(h)}),o.appendChild(n),o.appendChild(d),this.#e.appendChild(o),this.insertBefore(this.#e,t),t.classList.add("gc-sr-only"),this.#s=document.createElement("div"),this.#s.className="gc-sr-only",this.#s.setAttribute("role","status"),this.#s.setAttribute("aria-live","polite"),this.#s.setAttribute("aria-atomic","true"),this.appendChild(this.#s),this.listen(this.#e,"click",h=>{let m=h.target.closest(".gc-bar, .gc-milestone");if(!m)return;let f=m.dataset.taskId,p=this.#i.find(b=>b.id===f);p&&(this.#b(`Selected: ${p.name}`),this.dispatchEvent(new CustomEvent("gantt-chart:task-click",{bubbles:!0,detail:{task:p}})))}),this.listen(this.#e,"keydown",h=>{let m=h;if(m.key==="Enter"||m.key===" "){let f=m.target.closest(".gc-bar, .gc-milestone");f&&(m.preventDefault(),f.click())}})}#d(){let t=document.createElement("div");t.className="gc-timeline-header";let e=document.createElement("div");e.className="gc-timeline-spacer",t.appendChild(e);let s=document.createElement("div");s.className="gc-timeline-dates";let r=this.#u();for(let{position:i,text:a}of r){let o=document.createElement("span");o.className="gc-date-label",o.style.left=`${i}%`,o.textContent=a,s.appendChild(o)}return t.appendChild(s),t}#u(){let t=this.getAttribute("view")||"auto",e=t==="auto"?xe(this.#a):t,s=ye(this.#a),r=[],i;switch(e){case"day":i=P;break;case"week":i=Et;break;case"month":i=Z;break;case"quarter":i=ve;break;default:i=Z}let a=new Date(this.#r);if(e==="week"){let d=a.getDay(),l=d===0?1:d===1?0:8-d;a.setDate(a.getDate()+l)}else if(e==="month")a.setDate(1),a.getTime()<this.#r&&a.setMonth(a.getMonth()+1);else if(e==="quarter"){let d=a.getMonth(),l=Math.ceil((d+1)/3)*3;a.setMonth(l),a.setDate(1)}let o=a.getTime();o>this.#r+i*.5&&r.push({position:0,text:s(new Date(this.#r))});let n=o;for(;n<=this.#o;){let d=(n-this.#r)/this.#a*100;if(d>=0&&d<=100&&r.push({position:d,text:s(new Date(n))}),e==="month"){let l=new Date(n);l.setMonth(l.getMonth()+1),n=l.getTime()}else if(e==="quarter"){let l=new Date(n);l.setMonth(l.getMonth()+3),n=l.getTime()}else n+=i}return r}#m(){let t=document.createElement("div");t.className="gc-grid-lines";let e=this.#u();for(let{position:s}of e){if(s<=0)continue;let r=document.createElement("div");r.className="gc-grid-line",r.style.left=`${s}%`,t.appendChild(r)}return t}#y(){let t=new Map;for(let e of this.#i){let s=e.group||"";t.has(s)||t.set(s,[]),t.get(s)?.push(e)}return t}#h(t,e){let s=(t.start-this.#r)/this.#a*100,r=(t.end-t.start)/this.#a*100,i=document.createElement("div");if(i.className="gc-bar",i.setAttribute("data-task-id",t.id),i.setAttribute("role","img"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",`${Ut(t.name)}: ${new Date(t.start).toLocaleDateString()} to ${new Date(t.end).toLocaleDateString()}`+(t.progress>0?`, ${Math.round(t.progress*100)}% complete`:"")),i.style.left=`${s}%`,i.style.width=`${Math.max(r,.5)}%`,t.status&&i.setAttribute("data-status",t.status),t.color&&i.style.setProperty("--gc-bar-color",t.color),e&&t.progress>0){let a=document.createElement("div");a.className="gc-bar-fill",a.style.width=`${Math.round(t.progress*100)}%`,i.appendChild(a)}if(r>8){let a=document.createElement("span");a.className="gc-bar-label",a.textContent=t.name,i.appendChild(a)}return i}#v(t){let e=(t.start-this.#r)/this.#a*100,s=document.createElement("div");return s.className="gc-milestone",s.setAttribute("data-task-id",t.id),s.setAttribute("role","img"),s.setAttribute("tabindex","0"),s.setAttribute("aria-label",`Milestone: ${Ut(t.name)}, ${new Date(t.start).toLocaleDateString()}`),s.style.left=`${e}%`,t.status&&s.setAttribute("data-status",t.status),t.color&&s.style.setProperty("--gc-bar-color",t.color),s}#x(){let t=Date.now();if(t<this.#r||t>this.#o)return null;let e=(t-this.#r)/this.#a*100,s=document.createElement("div");s.className="gc-today-line",s.style.left=`${e}%`;let r=document.createElement("span");return r.className="gc-today-label",r.textContent="Today",s.appendChild(r),s}#f(t){if(!this.#i.some(n=>n.depends.length>0))return null;let s="http://www.w3.org/2000/svg",r=document.createElementNS(s,"svg");r.setAttribute("class","gc-deps"),r.style.width="100%",r.style.height="100%";let i=document.createElementNS(s,"defs"),a=document.createElementNS(s,"marker");a.setAttribute("id","gc-arrowhead"),a.setAttribute("markerWidth","8"),a.setAttribute("markerHeight","6"),a.setAttribute("refX","8"),a.setAttribute("refY","3"),a.setAttribute("orient","auto");let o=document.createElementNS(s,"polygon");o.setAttribute("points","0 0, 8 3, 0 6"),o.setAttribute("fill","var(--color-text-muted, #666666)"),a.appendChild(o),i.appendChild(a),r.appendChild(i);for(let n of this.#i)for(let d of n.depends){let l=this.#i.find(w=>w.id===d);if(!l)continue;let u=(l.end-this.#r)/this.#a*100,h=(n.start-this.#r)/this.#a*100,m=this.#g(l.id,t),f=this.#g(n.id,t);if(m===-1||f===-1)continue;let p=36,b=m*p+p/2,y=f*p+p/2,_=document.createElementNS(s,"path"),v=u+(h-u)/2;_.setAttribute("d",`M ${u}% ${b} C ${v}% ${b}, ${v}% ${y}, ${h}% ${y}`),_.setAttribute("class","gc-dep-line"),r.appendChild(_)}return r}#g(t,e){let s=e.querySelectorAll(".gc-bar-row");for(let r=0;r<s.length;r++){let i=s[r].querySelector("[data-task-id]");if(i&&i.dataset.taskId===t)return r}return-1}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();let r=document.createElement("table"),i=document.createElement("thead"),a=document.createElement("tr");for(let n of["Task","Start","End","Progress"]){let d=document.createElement("th");d.textContent=n,a.appendChild(d)}i.appendChild(a),r.appendChild(i);let o=document.createElement("tbody");for(let n of s.tasks||[]){let d=document.createElement("tr");n.id&&(d.dataset.taskId=n.id),n.group&&(d.dataset.group=n.group),n.depends&&(d.dataset.depends=Array.isArray(n.depends)?n.depends.join(","):n.depends),n.status&&(d.dataset.status=n.status),n.assignee&&(d.dataset.assignee=n.assignee),n.milestone&&d.setAttribute("data-milestone",""),n.color&&(d.dataset.color=n.color),n.storyIds&&(d.dataset.storyIds=Array.isArray(n.storyIds)?n.storyIds.join(","):n.storyIds),n.itemIds&&(d.dataset.itemIds=Array.isArray(n.itemIds)?n.itemIds.join(","):n.itemIds);let l=document.createElement("td");l.textContent=n.name||"",d.appendChild(l);let u=document.createElement("td"),h=document.createElement("time");h.setAttribute("datetime",n.start),h.textContent=new Date(n.start).toLocaleDateString(void 0,{month:"short",day:"numeric"}),u.appendChild(h),d.appendChild(u);let m=document.createElement("td"),f=document.createElement("time");f.setAttribute("datetime",n.end||n.start),f.textContent=new Date(n.end||n.start).toLocaleDateString(void 0,{month:"short",day:"numeric"}),m.appendChild(f),d.appendChild(m);let p=document.createElement("td"),b=document.createElement("progress");b.value=n.progress||0,b.max=100,b.textContent=`${n.progress||0}%`,p.appendChild(b),d.appendChild(p),o.appendChild(d)}r.appendChild(o),this.appendChild(r),s.title&&this.setAttribute("title",s.title),this.#l()}catch(e){console.warn(`[gantt-chart] Failed to load src="${t}":`,e)}}#b(t){this.#s&&(this.#s.textContent="",requestAnimationFrame(()=>{this.#s&&(this.#s.textContent=t)}))}};x("gantt-chart",kt);var St=class c extends C{static get observedAttributes(){return["src","compact","title","searchable"]}static#e=0;#s=null;#t=null;#i=null;#r=null;#o=null;#a="";#n=null;#l=[];#c=[];#p=new Map;#d=new Map;setup(){this.#a=`gloss-${++c.#e}`;let t=this.querySelector(":scope > dl");if(!t)return!1;let e=[...t.querySelectorAll(":scope > div[data-term-id]")];if(e.length===0)return!1;this.#l=e.map(i=>{let a=i.getAttribute("data-term-id")||"",o=i.getAttribute("data-category")||"Uncategorized",n=i.querySelector("dt"),d=i.querySelector("dd"),l=n?n.textContent.trim():"",u=d?d.textContent.trim():"";return i.id=a,{id:a,term:l,definition:u,category:o,el:i}});let s=new Set;this.#c=[];for(let i of this.#l)s.has(i.category)||(s.add(i.category),this.#c.push(i.category));t.remove(),this.#u();let r=this.getAttribute("src");if(r){this._loadSrc(r);return}return this.dispatchEvent(new CustomEvent("glossary-wc:ready",{bubbles:!0,detail:{termCount:this.#l.length,categories:[...this.#c]}})),!0}get terms(){return this.#l.map(t=>({id:t.id,term:t.term,definition:t.definition,category:t.category}))}set terms(t){let e=Array.isArray(t)?t:[];for(;this.firstChild;)this.firstChild.remove();let s=document.createElement("dl");for(let r of e){let i=document.createElement("div");i.setAttribute("data-term-id",r.id||""),r.category&&i.setAttribute("data-category",r.category);let a=document.createElement("dt");a.textContent=r.term||"";let o=document.createElement("dd");o.textContent=r.definition||"",i.appendChild(a),i.appendChild(o),s.appendChild(i)}this.appendChild(s),this.teardown(),this.removeAttribute("data-upgraded"),this.setup(),this.dispatchEvent(new CustomEvent("glossary-wc:terms-changed",{detail:{terms:e,source:"property"},bubbles:!0}))}teardown(){this.#n&&clearTimeout(this.#n);let t=this.querySelector(".gloss-title");t&&t.remove(),this.#s?.parentElement&&this.#s.parentElement.remove(),this.#t&&this.#t.remove(),this.#o&&this.#o.remove(),this.#r&&this.#r.remove(),this.#s=null,this.#t=null,this.#i=null,this.#r=null,this.#o=null,this.#l=[],this.#c=[],this.#p=new Map,this.#d=new Map}#u(){let t=this.getAttribute("title");if(t){let e=document.createElement("h2");e.className="gloss-title",e.textContent=t,this.#i=document.createElement("output"),this.#i.className="gloss-count",this.#i.textContent=String(this.#l.length),e.appendChild(this.#i),this.appendChild(e)}if(this.hasAttribute("searchable")){let e=document.createElement("div");e.className="gloss-search";let s=document.createElement("input");s.type="search",s.className="gloss-search-input",s.setAttribute("placeholder","Search terms\u2026"),s.setAttribute("aria-label","Search glossary terms"),e.appendChild(s),this.appendChild(e),this.#s=s,this.listen(s,"input",this.#h)}this.#m(),this.#o=document.createElement("div"),this.#o.className="gloss-categories",this.#o.setAttribute("role","region"),this.#o.setAttribute("aria-label","Glossary terms"),this.appendChild(this.#o);for(let e of this.#c){let s=this.#l.filter(r=>r.category===e);this.#y(e,s)}this.#r=document.createElement("div"),this.#r.className="gloss-live-region",this.#r.setAttribute("role","status"),this.#r.setAttribute("aria-live","polite"),this.#r.setAttribute("aria-atomic","true"),this.appendChild(this.#r)}#m(){this.#t=document.createElement("nav"),this.#t.className="gloss-jump-bar",this.#t.setAttribute("aria-label","Alphabet navigation");let t=new Set;for(let e of this.#l){let s=e.term.charAt(0).toUpperCase();/[A-Z]/.test(s)&&t.add(s)}for(let e=65;e<=90;e++){let s=String.fromCharCode(e),r=document.createElement("a");r.textContent=s,r.className="gloss-jump-letter",t.has(s)?(r.href=`#${this.#a}-letter-${s}`,r.setAttribute("data-active","")):(r.setAttribute("aria-disabled","true"),r.setAttribute("tabindex","-1")),this.#t.appendChild(r)}this.appendChild(this.#t)}#y(t,e){let s=document.createElement("section");s.className="gloss-category",s.setAttribute("data-category",t);let r=document.createElement("header");r.className="gloss-category-header";let i=document.createElement("button");i.type="button",i.className="gloss-category-toggle",i.setAttribute("aria-expanded","true"),i.innerHTML=`<span class="gloss-category-label">${g(t)}</span><output class="gloss-category-count">${e.length}</output><span class="gloss-chevron" aria-hidden="true"></span>`,r.appendChild(i),s.appendChild(r),this.#p.set(t,i);let a=document.createElement("dl");a.className="gloss-term-list";let o=[...e].sort((l,u)=>l.term.localeCompare(u.term)),n=[],d="";for(let l of o){let u=l.term.charAt(0).toUpperCase();if(/[A-Z]/.test(u)&&u!==d){d=u;let h=document.createElement("span");h.id=`${this.#a}-letter-${u}`,h.className="gloss-letter-anchor",a.appendChild(h)}l.el.className="gloss-term",l.el.id=l.id,a.appendChild(l.el),n.push(l.el)}this.#d.set(t,n),s.appendChild(a),this.#o?.appendChild(s),this.listen(i,"click",()=>{let l=i.getAttribute("aria-expanded")==="true";i.setAttribute("aria-expanded",String(!l)),a.hidden=l})}#h=t=>{this.#n&&clearTimeout(this.#n),this.#n=setTimeout(()=>{let e=t.target.value.toLowerCase().trim();this.#v(e)},150)};#v(t){let e=0;for(let s of this.#l)t===""||s.term.toLowerCase().includes(t)||s.definition.toLowerCase().includes(t)?(s.el.removeAttribute("hidden"),e++):s.el.setAttribute("hidden","");for(let s of this.#c){let r=this.#d.get(s)||[],i=r[0]?.closest(".gloss-category");if(!i)continue;if(r.some(o=>!o.hasAttribute("hidden"))){i.removeAttribute("hidden");let o=r.filter(d=>!d.hasAttribute("hidden")).length,n=i.querySelector(".gloss-category-count");n&&(n.textContent=String(o))}else i.setAttribute("hidden","")}this.#i&&(this.#i.textContent=t===""?String(this.#l.length):`${e} / ${this.#l.length}`),t!==""&&this.#r&&(this.#r.textContent="",requestAnimationFrame(()=>{this.#r&&(this.#r.textContent=`${e} term${e!==1?"s":""} found`)})),this.dispatchEvent(new CustomEvent("glossary-wc:search",{bubbles:!0,detail:{query:t,matchCount:e}}))}attributeChangedCallback(t,e,s){e===s||!this.isConnected||t==="src"&&this._loadSrc(s)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();let r=document.createElement("dl");for(let i of s.terms||[]){let a=document.createElement("div");a.setAttribute("data-term-id",i.id||""),a.setAttribute("data-category",i.category||"Uncategorized");let o=document.createElement("dt");o.textContent=i.term||"";let n=document.createElement("dd"),d=i.definition||"";if(i.seeAlso&&i.seeAlso.length>0){let l=i.seeAlso.map(u=>`<a href="#${g(u)}">${g(this.#x(u))}</a>`).join(", ");d+=` See also: ${l}.`}n.innerHTML=d,a.appendChild(o),a.appendChild(n),r.appendChild(a)}this.appendChild(r),s.title&&!this.getAttribute("title")&&this.setAttribute("title",s.title),this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}catch(e){console.warn(`[glossary-wc] Failed to load src="${t}":`,e)}}#x(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("glossary-wc",St);var O=`
|
|
2313
|
+
</div>`}_bindListeners(t){let e=this.shadowRoot;if(!e)return;e.querySelectorAll(".rs-pin").forEach(a=>{a.addEventListener("click",i=>{i.stopPropagation();let o=a.dataset.pinId??null;this._activePin=this._activePin===o?null:o,this._render(),this._activePin&&this.dispatchEvent(new CustomEvent("review-surface:select",{bubbles:!0,composed:!0,detail:{pin:this.__pins.find(n=>n.id===o)}}))})});let r=e.querySelector(".rs-overlay");r&&t&&r.addEventListener("click",a=>{if(!this._annotating)return;let i=a;if(i.target?.closest(".rs-pin"))return;let n=r.getBoundingClientRect(),l=(i.clientX-n.left)/n.width*100,d=(i.clientY-n.top)/n.height*100;this.#s(l,d)}),e.querySelectorAll("[data-action]").forEach(a=>{a.addEventListener("click",i=>{i.stopPropagation();let o=a.dataset.action,n=a.dataset.pinId;switch(o){case"close":this._activePin=null,this._render();break;case"resolve":n&&this.resolvePin(n);break;case"unresolve":n&&this.unresolvePin(n);break;case"delete":n&&this.removePin(n);break;case"toggle-mode":this._annotating=!this._annotating,this._annotating?this.setAttribute("data-annotating",""):this.removeAttribute("data-annotating"),this._render(),this.dispatchEvent(new CustomEvent("review-surface:mode",{bubbles:!0,composed:!0,detail:{mode:this._annotating?"annotate":"view"}}));break;case"export":this.#a();break;case"reply":this.#o(n);break}})});let s=e.querySelector(".rs-input__field");s&&s.addEventListener("keydown",a=>{let i=a;if(i.key==="Enter"&&!i.shiftKey){i.preventDefault();let n=e.querySelector('[data-action="reply"]')?.dataset.pinId;n&&this.#o(n)}}),e.addEventListener("keydown",a=>{a.key==="Escape"&&(this._activePin?(this._activePin=null,this._render()):this._annotating&&(this._annotating=!1,this.removeAttribute("data-annotating"),this._render(),this.dispatchEvent(new CustomEvent("review-surface:mode",{bubbles:!0,composed:!0,detail:{mode:"view"}}))))})}async#s(t,e){let r=this.getAttribute("author")||"Anonymous",s=await this.addPin({x:t,y:e,text:"",author:r});this._activePin=s.id,this._render(),requestAnimationFrame(()=>{(this.shadowRoot?.querySelector(".rs-input__field")??null)?.focus()})}async#o(t){let e=this.shadowRoot?.querySelector(".rs-input__field")??null;if(!e)return;let r=e.value.trim();if(!r)return;let s=this.__pins.find(i=>i.id===t);if(!s)return;let a={id:crypto.randomUUID(),text:r,author:this.getAttribute("author")||"Anonymous",createdAt:new Date().toISOString()};s.replies||(s.replies=[]),s.text?(s.replies.push(a),this.__adapter&&await this.__adapter.update(t,{replies:s.replies})):(s.text=r,this.__adapter&&await this.__adapter.update(t,{text:r})),this._render(),this.#c("Reply added"),requestAnimationFrame(()=>{(this.shadowRoot?.querySelector(".rs-input__field")??null)?.focus()}),this.dispatchEvent(new CustomEvent("review-surface:update",{bubbles:!0,composed:!0,detail:{pin:s,changes:{replies:s.replies}}}))}async#a(){let t=JSON.stringify(this.exportPins(),null,2);if(await yt(t,{announceMessage:"Pins copied to clipboard"}))return;let r=new Blob([t],{type:"application/json"}),s=URL.createObjectURL(r),a=document.createElement("a");a.href=s,a.download="review-pins.json",a.click(),URL.revokeObjectURL(s),this.#c("Pins exported as file")}#n(t){if(!t)return"";try{let e=new Date(t),s=new Date().getTime()-e.getTime(),a=Math.floor(s/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;let i=Math.floor(a/60);if(i<24)return`${i}h ago`;let o=Math.floor(i/24);return o<7?`${o}d ago`:e.toLocaleDateString()}catch{return""}}#c(t){let e=this.shadowRoot?.querySelector(".rs-live");e&&(e.textContent=t)}};x("review-surface",xt);var N=864e5,wt=N*7,G=N*30,ce=N*91,Pt=N*365;function j(c){return typeof c=="number"?c:new Date(c).getTime()}function de(c){return c<=wt*3?t=>t.toLocaleDateString(void 0,{month:"short",day:"numeric"}):c<=G*3?t=>t.toLocaleDateString(void 0,{month:"short",day:"numeric"}):c<=Pt?t=>t.toLocaleDateString(void 0,{month:"short",year:"2-digit"}):t=>t.toLocaleDateString(void 0,{year:"numeric"})}function le(c){return c<=wt*3?"day":c<=G*3?"week":c<=Pt?"month":"quarter"}function Dt(c){return String(c).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var _t=class c extends C{static get observedAttributes(){return["src","title","view","show-today","show-progress","show-dependencies","compact"]}#e=null;#t=null;#r=null;#i=[];#s=0;#o=0;#a=0;setup(){let t=this.querySelector(":scope > table");return!t||(this.#i=this.#d(t),this.#i.length===0)?!1:(this.#s=Math.min(...this.#i.map(e=>e.start)),this.#o=Math.max(...this.#i.map(e=>e.end)),this.#a=this.#o-this.#s,this.#a<=0&&(this.#a=N),this.#b(t),this.dispatchEvent(new CustomEvent("gantt-chart:ready",{bubbles:!0,detail:{taskCount:this.#i.length,dateRange:{start:new Date(this.#s).toISOString(),end:new Date(this.#o).toISOString()}}})),!0)}teardown(){this.#r&&(this.#r.remove(),this.#r=null),this.#e&&(this.#e.remove(),this.#e=null),this.#t&&(this.#t.remove(),this.#t=null);let t=this.querySelector("table.gc-sr-only");t&&t.classList.remove("gc-sr-only"),this.#i=[]}static#n=0;attributeChangedCallback(t,e,r){e===r||!this.isConnected||(t==="src"?this._loadSrc(r):this.hasAttribute("data-upgraded")&&this.#c())}#c(){let t=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};if(this.hasAttribute("data-upgraded")&&"startViewTransition"in document&&!matchMedia("(prefers-reduced-motion: reduce)").matches){let e=`gc-vt-${++c.#n}`;this.style.viewTransitionName=e,document.startViewTransition(t).finished.finally(()=>{this.style.viewTransitionName=""})}else t()}get tasks(){return this.#i}set tasks(t){let e=(t||[]).map((r,s)=>({id:r.id??`gc-task-${s}`,name:r.name??`Task ${s+1}`,start:typeof r.start=="number"?r.start:j(r.start),end:typeof r.end=="number"?r.end:r.end!=null?j(r.end):typeof r.start=="number"?r.start:j(r.start),progress:r.progress??0,group:r.group??null,depends:Array.isArray(r.depends)?r.depends:r.depends?String(r.depends).split(",").map(a=>a.trim()):[],status:r.status??null,assignee:r.assignee??null,milestone:!!r.milestone,color:r.color??null,storyIds:r.storyIds??[],itemIds:r.itemIds??[]}));if((this.#e||this.#r||this.#t)&&(this.#r&&(this.#r.remove(),this.#r=null),this.#e&&(this.#e.remove(),this.#e=null),this.#t&&(this.#t.remove(),this.#t=null)),this.#i=e,e.length>0){this.#s=Math.min(...e.map(s=>s.start)),this.#o=Math.max(...e.map(s=>s.end)),this.#a=this.#o-this.#s,this.#a<=0&&(this.#a=N);let r=this.querySelector(":scope > table");r||(r=document.createElement("table"),r.classList.add("gc-sr-only"),this.appendChild(r)),this.#b(r)}this.dispatchEvent(new CustomEvent("gantt-chart:tasks-changed",{detail:{tasks:e,source:"property"},bubbles:!0}))}#d(t){let e=t.querySelectorAll("tbody tr"),r=[];for(let s=0;s<e.length;s++){let a=e[s],i=a.querySelectorAll("time[datetime]");if(i.length<2&&!a.hasAttribute("data-milestone"))continue;let o=i[0]?.getAttribute("datetime"),n=i.length>1?i[1].getAttribute("datetime"):o;if(!o)continue;let l=a.querySelector("progress"),d=l?l.value/(l.max||100):0,p=a.cells[0]?.textContent?.trim()||`Task ${s+1}`;r.push({id:a.dataset.taskId||`gc-task-${s}`,name:p,start:j(o),end:j(n),progress:d,group:a.dataset.group||null,depends:a.dataset.depends?a.dataset.depends.split(",").map(u=>u.trim()):[],status:a.dataset.status||null,assignee:a.dataset.assignee||null,milestone:a.hasAttribute("data-milestone"),color:a.dataset.color||null,storyIds:a.dataset.storyIds?a.dataset.storyIds.split(",").map(u=>u.trim()):[],itemIds:a.dataset.itemIds?a.dataset.itemIds.split(",").map(u=>u.trim()):[]})}return r}#b(t){let e=this.getAttribute("title"),r=this.hasAttribute("show-today"),s=this.hasAttribute("show-progress"),a=this.hasAttribute("show-dependencies");e&&(this.#r=document.createElement("h2"),this.#r.className="gc-title",this.#r.textContent=e,this.insertBefore(this.#r,t)),this.#e=document.createElement("div"),this.#e.className="gc-container",this.#e.setAttribute("role","region"),this.#e.setAttribute("aria-label",`Gantt chart${e?": "+e:""}`);let i=this.#m();this.#e.appendChild(i);let o=document.createElement("div");o.className="gc-body";let n=document.createElement("div");n.className="gc-task-list";let l=document.createElement("div");l.className="gc-bars";let d=this.#f();l.appendChild(d);let p=this.#v();for(let[u,m]of p){if(p.size>1&&u){let f=document.createElement("div");f.className="gc-group-header";let g=document.createElement("span");g.className="gc-group-label",g.textContent=u,f.appendChild(g),n.appendChild(f);let v=document.createElement("div");v.className="gc-group-spacer",l.appendChild(v)}for(let f of m){let g=document.createElement("div");g.className="gc-task-row",g.setAttribute("data-task-id",f.id);let v=document.createElement("span");v.className="gc-task-name",v.textContent=f.name,g.appendChild(v);let y=document.createElement("span");y.className="gc-task-dates",y.textContent=`${new Date(f.start).toLocaleDateString()} to ${new Date(f.end).toLocaleDateString()}`,g.appendChild(y),n.appendChild(g);let _=document.createElement("div");_.className="gc-bar-row",f.milestone?_.appendChild(this.#h(f)):_.appendChild(this.#l(f,s)),l.appendChild(_)}}if(r){let u=this.#y();u&&l.appendChild(u)}a&&requestAnimationFrame(()=>{let u=this.#g(l);u&&l.appendChild(u)}),o.appendChild(n),o.appendChild(l),this.#e.appendChild(o),this.insertBefore(this.#e,t),t.classList.add("gc-sr-only"),this.#t=document.createElement("div"),this.#t.className="gc-sr-only",this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.appendChild(this.#t),this.listen(this.#e,"click",u=>{let m=u.target.closest(".gc-bar, .gc-milestone");if(!m)return;let f=m.dataset.taskId,g=this.#i.find(v=>v.id===f);g&&(this.#x(`Selected: ${g.name}`),this.dispatchEvent(new CustomEvent("gantt-chart:task-click",{bubbles:!0,detail:{task:g}})))}),this.listen(this.#e,"keydown",u=>{let m=u;if(m.key==="Enter"||m.key===" "){let f=m.target.closest(".gc-bar, .gc-milestone");f&&(m.preventDefault(),f.click())}})}#m(){let t=document.createElement("div");t.className="gc-timeline-header";let e=document.createElement("div");e.className="gc-timeline-spacer",t.appendChild(e);let r=document.createElement("div");r.className="gc-timeline-dates";let s=this.#u();for(let{position:a,text:i}of s){let o=document.createElement("span");o.className="gc-date-label",o.style.left=`${a}%`,o.textContent=i,r.appendChild(o)}return t.appendChild(r),t}#u(){let t=this.getAttribute("view")||"auto",e=t==="auto"?le(this.#a):t,r=de(this.#a),s=[],a;switch(e){case"day":a=N;break;case"week":a=wt;break;case"month":a=G;break;case"quarter":a=ce;break;default:a=G}let i=new Date(this.#s);if(e==="week"){let l=i.getDay(),d=l===0?1:l===1?0:8-l;i.setDate(i.getDate()+d)}else if(e==="month")i.setDate(1),i.getTime()<this.#s&&i.setMonth(i.getMonth()+1);else if(e==="quarter"){let l=i.getMonth(),d=Math.ceil((l+1)/3)*3;i.setMonth(d),i.setDate(1)}let o=i.getTime();o>this.#s+a*.5&&s.push({position:0,text:r(new Date(this.#s))});let n=o;for(;n<=this.#o;){let l=(n-this.#s)/this.#a*100;if(l>=0&&l<=100&&s.push({position:l,text:r(new Date(n))}),e==="month"){let d=new Date(n);d.setMonth(d.getMonth()+1),n=d.getTime()}else if(e==="quarter"){let d=new Date(n);d.setMonth(d.getMonth()+3),n=d.getTime()}else n+=a}return s}#f(){let t=document.createElement("div");t.className="gc-grid-lines";let e=this.#u();for(let{position:r}of e){if(r<=0)continue;let s=document.createElement("div");s.className="gc-grid-line",s.style.left=`${r}%`,t.appendChild(s)}return t}#v(){let t=new Map;for(let e of this.#i){let r=e.group||"";t.has(r)||t.set(r,[]),t.get(r)?.push(e)}return t}#l(t,e){let r=(t.start-this.#s)/this.#a*100,s=(t.end-t.start)/this.#a*100,a=document.createElement("div");if(a.className="gc-bar",a.setAttribute("data-task-id",t.id),a.setAttribute("role","img"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",`${Dt(t.name)}: ${new Date(t.start).toLocaleDateString()} to ${new Date(t.end).toLocaleDateString()}`+(t.progress>0?`, ${Math.round(t.progress*100)}% complete`:"")),a.style.left=`${r}%`,a.style.width=`${Math.max(s,.5)}%`,t.status&&a.setAttribute("data-status",t.status),t.color&&a.style.setProperty("--gc-bar-color",t.color),e&&t.progress>0){let i=document.createElement("div");i.className="gc-bar-fill",i.style.width=`${Math.round(t.progress*100)}%`,a.appendChild(i)}if(s>8){let i=document.createElement("span");i.className="gc-bar-label",i.textContent=t.name,a.appendChild(i)}return a}#h(t){let e=(t.start-this.#s)/this.#a*100,r=document.createElement("div");return r.className="gc-milestone",r.setAttribute("data-task-id",t.id),r.setAttribute("role","img"),r.setAttribute("tabindex","0"),r.setAttribute("aria-label",`Milestone: ${Dt(t.name)}, ${new Date(t.start).toLocaleDateString()}`),r.style.left=`${e}%`,t.status&&r.setAttribute("data-status",t.status),t.color&&r.style.setProperty("--gc-bar-color",t.color),r}#y(){let t=Date.now();if(t<this.#s||t>this.#o)return null;let e=(t-this.#s)/this.#a*100,r=document.createElement("div");r.className="gc-today-line",r.style.left=`${e}%`;let s=document.createElement("span");return s.className="gc-today-label",s.textContent="Today",r.appendChild(s),r}#g(t){if(!this.#i.some(n=>n.depends.length>0))return null;let r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg");s.setAttribute("class","gc-deps"),s.style.width="100%",s.style.height="100%";let a=document.createElementNS(r,"defs"),i=document.createElementNS(r,"marker");i.setAttribute("id","gc-arrowhead"),i.setAttribute("markerWidth","8"),i.setAttribute("markerHeight","6"),i.setAttribute("refX","8"),i.setAttribute("refY","3"),i.setAttribute("orient","auto");let o=document.createElementNS(r,"polygon");o.setAttribute("points","0 0, 8 3, 0 6"),o.setAttribute("fill","var(--color-text-muted, #666666)"),i.appendChild(o),a.appendChild(i),s.appendChild(a);for(let n of this.#i)for(let l of n.depends){let d=this.#i.find(w=>w.id===l);if(!d)continue;let p=(d.end-this.#s)/this.#a*100,u=(n.start-this.#s)/this.#a*100,m=this.#p(d.id,t),f=this.#p(n.id,t);if(m===-1||f===-1)continue;let g=36,v=m*g+g/2,y=f*g+g/2,_=document.createElementNS(r,"path"),b=p+(u-p)/2;_.setAttribute("d",`M ${p}% ${v} C ${b}% ${v}, ${b}% ${y}, ${u}% ${y}`),_.setAttribute("class","gc-dep-line"),s.appendChild(_)}return s}#p(t,e){let r=e.querySelectorAll(".gc-bar-row");for(let s=0;s<r.length;s++){let a=r[s].querySelector("[data-task-id]");if(a&&a.dataset.taskId===t)return s}return-1}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();for(;this.firstChild;)this.firstChild.remove();let s=document.createElement("table"),a=document.createElement("thead"),i=document.createElement("tr");for(let n of["Task","Start","End","Progress"]){let l=document.createElement("th");l.textContent=n,i.appendChild(l)}a.appendChild(i),s.appendChild(a);let o=document.createElement("tbody");for(let n of r.tasks||[]){let l=document.createElement("tr");n.id&&(l.dataset.taskId=n.id),n.group&&(l.dataset.group=n.group),n.depends&&(l.dataset.depends=Array.isArray(n.depends)?n.depends.join(","):n.depends),n.status&&(l.dataset.status=n.status),n.assignee&&(l.dataset.assignee=n.assignee),n.milestone&&l.setAttribute("data-milestone",""),n.color&&(l.dataset.color=n.color),n.storyIds&&(l.dataset.storyIds=Array.isArray(n.storyIds)?n.storyIds.join(","):n.storyIds),n.itemIds&&(l.dataset.itemIds=Array.isArray(n.itemIds)?n.itemIds.join(","):n.itemIds);let d=document.createElement("td");d.textContent=n.name||"",l.appendChild(d);let p=document.createElement("td"),u=document.createElement("time");u.setAttribute("datetime",n.start),u.textContent=new Date(n.start).toLocaleDateString(void 0,{month:"short",day:"numeric"}),p.appendChild(u),l.appendChild(p);let m=document.createElement("td"),f=document.createElement("time");f.setAttribute("datetime",n.end||n.start),f.textContent=new Date(n.end||n.start).toLocaleDateString(void 0,{month:"short",day:"numeric"}),m.appendChild(f),l.appendChild(m);let g=document.createElement("td"),v=document.createElement("progress");v.value=n.progress||0,v.max=100,v.textContent=`${n.progress||0}%`,g.appendChild(v),l.appendChild(g),o.appendChild(l)}s.appendChild(o),this.appendChild(s),r.title&&this.setAttribute("title",r.title),this.#c()}catch(e){console.warn(`[gantt-chart] Failed to load src="${t}":`,e)}}#x(t){this.#t&&(this.#t.textContent="",requestAnimationFrame(()=>{this.#t&&(this.#t.textContent=t)}))}};x("gantt-chart",_t);var R=`
|
|
2314
2314
|
:host {
|
|
2315
2315
|
--_bg: var(--work-item-bg, var(--color-surface, #ffffff));
|
|
2316
2316
|
--_text: var(--work-item-text, var(--color-text, #1a1a1a));
|
|
@@ -2673,30 +2673,30 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
2673
2673
|
|
|
2674
2674
|
.state-msg { padding: var(--_space-m); font-size: var(--_font-sm); color: var(--_muted); font-style: italic; }
|
|
2675
2675
|
.state-msg--error { color: var(--color-error-text, var(--color-error, #dc2626)); }
|
|
2676
|
-
`;var
|
|
2676
|
+
`;var jt={task:'<rect x="3" y="3" width="18" height="18" rx="2"/><path d="m9 12 2 2 4-4"/>',bug:'<path d="m8 2 1.88 1.88"/><path d="M14.12 3.88 16 2"/><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"/><path d="M12 20v-9"/><path d="M6.53 9C4.6 8.8 3 7.1 3 5"/><path d="M6 13H2"/><path d="M3 21c0-2.1 1.7-3.9 3.8-4"/><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/><path d="M22 13h-4"/><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"/>',chore:'<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"/>',spike:'<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/>',feature:'<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>'},At={critical:{label:"Critical",color:"#dc2626",bg:"rgba(220, 38, 38, 0.1)"},high:{label:"High",color:"#ea580c",bg:"rgba(234, 88, 12, 0.1)"},medium:{label:"Medium",color:"#ca8a04",bg:"rgba(202, 138, 4, 0.1)"},low:{label:"Low",color:"#16a34a",bg:"rgba(22, 163, 74, 0.1)"}},kt={backlog:{label:"Backlog",color:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},"to-do":{label:"To Do",color:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},"in-progress":{label:"In Progress",color:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},review:{label:"Review",color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},done:{label:"Done",color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},blocked:{label:"Blocked",color:"#dc2626",bg:"rgba(220, 38, 38, 0.1)"}},Ct=class extends HTMLElement{static get observedAttributes(){return["item-id","type","priority","status","estimate","assignee","story-ids","detail","compact","src"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"})}#t(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&this.#e.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#e.get(t)||""}connectedCallback(){this.#t(),this.itemId&&!this.id&&(this.id=this.itemId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#r(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t,e,r){e!==r&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(r):this.#r())}get itemId(){return this.getAttribute("item-id")||""}get itemTitle(){return this.querySelector('[slot="title"]')?.textContent?.trim()||this.#e.get("title")||""}get itemType(){return this.getAttribute("type")||"task"}get priority(){return this.getAttribute("priority")||"medium"}get status(){return this.getAttribute("status")||"backlog"}get estimate(){return this.getAttribute("estimate")||""}get assignee(){return this.getAttribute("assignee")||""}get storyIds(){let t=this.getAttribute("story-ids")||"";return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}get _detailLevel(){return this.getAttribute("detail")?this.getAttribute("detail"):this.hasAttribute("compact")?"compact":"full"}get _minimalLabel(){return this.itemTitle||this.itemId||"Work item"}updateStatus(t){kt[t]&&(this.setAttribute("status",t),this.dispatchEvent(new CustomEvent("work-item:status",{detail:{status:t,itemId:this.itemId},bubbles:!0,composed:!0})))}updatePriority(t){At[t]&&(this.setAttribute("priority",t),this.dispatchEvent(new CustomEvent("work-item:priority",{detail:{priority:t,itemId:this.itemId},bubbles:!0,composed:!0})))}get data(){return{itemId:this.itemId||void 0,type:this.itemType,priority:this.priority,status:this.status,estimate:this.estimate||void 0,assignee:this.assignee||void 0,storyIds:this.storyIds.length?this.storyIds:void 0,detail:this.getAttribute("detail")||void 0,title:this.itemTitle||void 0}}set data(t){!t||typeof t!="object"||(this._applyData(t),this.shadowRoot&&this.#r(),this.dispatchEvent(new CustomEvent("work-item:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){for(let[e,r]of[["itemId","item-id"],["type","type"],["priority","priority"],["status","status"],["estimate","estimate"],["assignee","assignee"],["detail","detail"]])t[e]!=null&&this.setAttribute(r,String(t[e]));if(t.storyIds&&this.setAttribute("story-ids",Array.isArray(t.storyIds)?t.storyIds.join(","):String(t.storyIds)),t.title&&!this.querySelector('[slot="title"]')){let e=document.createElement("h3");e.slot="title",e.textContent=String(t.title),this.appendChild(e)}for(let e of["description","notes"])if(t[e]&&!this.querySelector(`[slot="${e}"]`)){let r=document.createElement("p");r.slot=e,r.textContent=String(t[e]),this.appendChild(r)}if(t.checklist&&!this.querySelector('[slot="checklist"]')){let e=document.createElement("ul");e.slot="checklist";let r=Array.isArray(t.checklist)?t.checklist:[t.checklist];for(let s of r){let a=document.createElement("li");a.textContent=String(s),e.appendChild(a)}this.appendChild(e)}}async _loadSrc(t){if(!t)return;let e=this.shadowRoot;e.innerHTML=`<style>${R}</style><div class="state-msg">Loading\u2026</div>`;try{let r=await fetch(t);if(!r.ok)throw new Error(`HTTP ${r.status}`);let s=await r.json();this._applyData(s),this.#r()}catch(r){e.innerHTML=`<style>${R}</style><div class="state-msg state-msg--error">Could not load: ${h(r.message)}</div>`}}#r(){let t=this.shadowRoot,e=At[this.priority]||At.medium,r=kt[this.status]||kt.backlog,s=this.itemType,a=jt[s]||jt.task,i=this._detailLevel,o=this.itemId?`Work item: ${h(this.itemId)}`:"Work item";if(i==="minimal"){t.innerHTML=`<style>${R}</style>
|
|
2677
2677
|
<article class="wi-card wi-card--minimal" role="article" aria-label="${o}"
|
|
2678
2678
|
tabindex="0">
|
|
2679
2679
|
<div class="wi-body">
|
|
2680
2680
|
<div class="wi-meta">
|
|
2681
|
-
${this.itemId?`<span class="wi-id">${
|
|
2682
|
-
<span class="wi-type" data-type="${
|
|
2681
|
+
${this.itemId?`<span class="wi-id">${h(this.itemId)}</span>`:""}
|
|
2682
|
+
<span class="wi-type" data-type="${h(s)}">${A(a)} ${h(s)}</span>
|
|
2683
2683
|
</div>
|
|
2684
2684
|
<div class="wi-title-wrap">
|
|
2685
|
-
<slot name="title"><span class="wi-title-fallback">${
|
|
2685
|
+
<slot name="title"><span class="wi-title-fallback">${h(this._minimalLabel)}</span></slot>
|
|
2686
2686
|
</div>
|
|
2687
2687
|
</div>
|
|
2688
|
-
</article>`;return}if(t.innerHTML=`<style>${
|
|
2689
|
-
<article class="wi-card wi-card--${
|
|
2688
|
+
</article>`;return}if(t.innerHTML=`<style>${R}</style>
|
|
2689
|
+
<article class="wi-card wi-card--${i}" role="article" aria-label="${o}">
|
|
2690
2690
|
|
|
2691
2691
|
<header class="wi-header">
|
|
2692
2692
|
<div class="wi-meta">
|
|
2693
|
-
${this.itemId?`<span class="wi-id">${
|
|
2694
|
-
<span class="wi-type" data-type="${
|
|
2693
|
+
${this.itemId?`<span class="wi-id">${h(this.itemId)}</span>`:""}
|
|
2694
|
+
<span class="wi-type" data-type="${h(s)}">${A(a)} ${h(s)}</span>
|
|
2695
2695
|
</div>
|
|
2696
2696
|
<div class="wi-badges">
|
|
2697
|
-
<span class="wi-priority" style="color:${e.color};background:${e.bg}">${
|
|
2698
|
-
<span class="wi-status" style="color:${
|
|
2699
|
-
${this.estimate?`<span class="wi-estimate" title="Estimate">${
|
|
2697
|
+
<span class="wi-priority" style="color:${e.color};background:${e.bg}">${h(e.label)}</span>
|
|
2698
|
+
<span class="wi-status" style="color:${r.color};background:${r.bg}">${h(r.label)}</span>
|
|
2699
|
+
${this.estimate?`<span class="wi-estimate" title="Estimate">${h(this.estimate)}</span>`:""}
|
|
2700
2700
|
</div>
|
|
2701
2701
|
</header>
|
|
2702
2702
|
|
|
@@ -2707,13 +2707,13 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
2707
2707
|
|
|
2708
2708
|
${this.assignee?`
|
|
2709
2709
|
<div class="wi-assignee">
|
|
2710
|
-
<span class="wi-assignee__avatar" style="background:${
|
|
2711
|
-
${
|
|
2710
|
+
<span class="wi-assignee__avatar" style="background:${L(this.assignee)}">${z(this.assignee)}</span>
|
|
2711
|
+
${h(this.assignee)}
|
|
2712
2712
|
</div>`:""}
|
|
2713
2713
|
|
|
2714
2714
|
${this.storyIds.length?`
|
|
2715
2715
|
<div class="wi-links">
|
|
2716
|
-
${this.storyIds.map(n=>`<a class="wi-link" href="#${
|
|
2716
|
+
${this.storyIds.map(n=>`<a class="wi-link" href="#${h(n)}">${A('<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M7 7h10"/><path d="M7 12h10"/><path d="M7 17h10"/>')} ${h(n)}</a>`).join("")}
|
|
2717
2717
|
</div>`:""}
|
|
2718
2718
|
</div>
|
|
2719
2719
|
|
|
@@ -2755,7 +2755,7 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
2755
2755
|
</div>
|
|
2756
2756
|
</div>
|
|
2757
2757
|
|
|
2758
|
-
</article>`,a==="compact")for(let n of t.querySelectorAll(".wi-section")){let d=n.querySelector("slot");d&&d.assignedNodes().length===0&&n.setAttribute("data-empty","")}this.dispatchEvent(new CustomEvent("work-item:ready",{detail:{itemId:this.itemId,title:this.itemTitle,type:r,priority:this.priority,status:this.status},bubbles:!0,composed:!0}))}};x("work-item",Tt);var tt={layout:{label:"Layout",cssClass:"sm-badge--layout"},section:{label:"Section",cssClass:"sm-badge--section"},dashboard:{label:"Dashboard",cssClass:"sm-badge--dashboard"},page:{label:"Page",cssClass:"sm-badge--page"},modal:{label:"Modal",cssClass:"sm-badge--modal"},redirect:{label:"Redirect",cssClass:"sm-badge--redirect"}},et={draft:{label:"Draft",cssClass:"sm-status--draft"},ready:{label:"Ready",cssClass:"sm-status--ready"},live:{label:"Live",cssClass:"sm-status--live"},deprecated:{label:"Deprecated",cssClass:"sm-status--deprecated"}},It=class c extends C{static get observedAttributes(){return["src","collapsed","compact","title","data-view","data-orientation","data-detail"]}static#e=0;#s=null;#t=null;#i=null;#r=null;#o=0;#a=0;setup(){c.#e++;let t=this.getAttribute("src");if(t&&!this.querySelector("nav")){this._loadSrc(t);return}let e=this.querySelector(":scope > nav");if(e){if(this.#o=0,this.#a=0,this.#n(e.querySelector("ul"),0),this.dataset.view==="visual"){this.#c(),this.#Z(e),this.dispatchEvent(new CustomEvent("site-map-wc:ready",{bubbles:!0,detail:{nodeCount:this.#o,depth:this.#a}}));return}this.#l(e.querySelector("ul"),0),this.#c(),e.classList.add("sm-tree"),e.setAttribute("role","tree"),e.setAttribute("aria-label",this.getAttribute("title")||"Site map"),this.#s=e,this.hasAttribute("collapsed")&&this.#p(),this.listen(e,"keydown",s=>this.#y(s)),this.listen(e,"click",s=>this.#m(s)),this.dispatchEvent(new CustomEvent("site-map-wc:ready",{bubbles:!0,detail:{nodeCount:this.#o,depth:this.#a}}))}}teardown(){if(this.#i){this.#i.remove(),this.#i=null;let t=this.querySelector("nav");t&&(t.style.display="",t.removeAttribute("aria-hidden"))}this.#t&&(this.#t.remove(),this.#t=null),this.#s&&(this.#s.classList.remove("sm-tree"),this.#s.removeAttribute("role"),this.#s.removeAttribute("aria-label")),this.querySelectorAll(".sm-node-content, .sm-toggle").forEach(t=>t.remove()),this.querySelectorAll('li[role="treeitem"]').forEach(t=>{t.removeAttribute("role"),t.removeAttribute("aria-expanded"),t.removeAttribute("tabindex")}),this.querySelectorAll('ul[role="group"]').forEach(t=>{t.removeAttribute("role"),t.classList.remove("sm-subtree","sm-collapsed")}),this.#s=null,this.#r=null,this.#o=0,this.#a=0}attributeChangedCallback(t,e,s){e===s||!this.isConnected||t==="src"&&this._loadSrc(s)}#n(t,e){if(!t)return;let s=t.querySelectorAll(":scope > li");for(let r of s){this.#o++;let i=e+1;i>this.#a&&(this.#a=i);let a=r.querySelector(":scope > ul");a&&this.#n(a,i)}}#l(t,e){if(!t)return;e>0&&(t.setAttribute("role","group"),t.classList.add("sm-subtree"));let s=[...t.querySelectorAll(":scope > li")];for(let r of s){let i=!!r.querySelector(":scope > ul"),a=r.querySelector(":scope > a"),o=r.getAttribute("data-page-type")||"page",n=r.getAttribute("data-template")||"",d=r.getAttribute("data-status")||"";r.setAttribute("role","treeitem"),r.setAttribute("tabindex","-1");let l=document.createElement("span");if(l.className="sm-node-content",i){r.setAttribute("aria-expanded","true");let h=document.createElement("button");h.className="sm-toggle",h.setAttribute("type","button"),h.setAttribute("aria-hidden","true"),h.setAttribute("tabindex","-1"),h.textContent="\u25BE",l.appendChild(h)}else{let h=document.createElement("span");h.className="sm-leaf-marker",h.setAttribute("aria-hidden","true"),l.appendChild(h)}if(d&&et[d]){let h=document.createElement("span");h.className=`sm-status-dot ${et[d].cssClass}`,h.setAttribute("title",et[d].label),h.setAttribute("aria-label",et[d].label),l.appendChild(h)}if(a&&l.appendChild(a),tt[o]){let h=document.createElement("span");h.className=`sm-badge ${tt[o].cssClass}`,h.textContent=tt[o].label,l.appendChild(h)}if(n){let h=document.createElement("span");h.className="sm-badge sm-badge--template",h.textContent=n,l.appendChild(h)}r.insertBefore(l,r.firstChild);let u=r.querySelector(":scope > ul");u&&this.#l(u,e+1)}}#c(){let t=this.getAttribute("title");if(!t&&this.#o===0)return;if(this.#t=document.createElement("div"),this.#t.className="sm-header",t){let r=document.createElement("h2");r.className="sm-title",r.textContent=t,this.#t.appendChild(r)}let e=document.createElement("span");e.className="sm-summary",e.textContent=`${this.#o} pages \xB7 ${this.#a} levels deep`,this.#t.appendChild(e);let s=document.createElement("button");s.className="sm-toggle-all",s.setAttribute("type","button"),s.textContent="Collapse all",s.addEventListener("click",()=>{this.querySelectorAll('li[aria-expanded="true"]').length>0?(this.#p(),s.textContent="Expand all"):(this.#d(),s.textContent="Collapse all")}),this.#t.appendChild(s),this.insertBefore(this.#t,this.firstChild)}#p(){let t=this.querySelectorAll("li[aria-expanded]");for(let e of t){e.setAttribute("aria-expanded","false");let s=e.querySelector(":scope > ul");s&&s.classList.add("sm-collapsed");let r=e.querySelector(":scope > .sm-node-content > .sm-toggle");r&&(r.textContent="\u25B8")}}#d(){let t=this.querySelectorAll("li[aria-expanded]");for(let e of t){e.setAttribute("aria-expanded","true");let s=e.querySelector(":scope > ul");s&&s.classList.remove("sm-collapsed");let r=e.querySelector(":scope > .sm-node-content > .sm-toggle");r&&(r.textContent="\u25BE")}}#u(t){let e=t.getAttribute("aria-expanded")==="true";t.setAttribute("aria-expanded",e?"false":"true");let s=t.querySelector(":scope > ul");s&&s.classList.toggle("sm-collapsed",e);let r=t.querySelector(":scope > .sm-node-content > .sm-toggle");r&&(r.textContent=e?"\u25B8":"\u25BE")}#m(t){let e=t.target;if(e.closest(".sm-toggle")){t.preventDefault();let i=e.closest('li[role="treeitem"]');i&&this.#u(i);return}let s=e.closest('li[role="treeitem"]');if(!s)return;this.#f(s);let r=e.closest("a");r&&this.dispatchEvent(new CustomEvent("site-map-wc:select",{bubbles:!0,detail:{href:r.getAttribute("href")||"",pageType:s.getAttribute("data-page-type")||"page",template:s.getAttribute("data-template")||""}}))}#y(t){let e=t.target.closest('li[role="treeitem"]');if(!e)return;let s=t.key,r=!1;switch(s){case"ArrowDown":r=!0,this.#v(e);break;case"ArrowUp":r=!0,this.#x(e);break;case"ArrowRight":if(r=!0,e.getAttribute("aria-expanded")==="false")this.#u(e);else if(e.getAttribute("aria-expanded")==="true"){let i=e.querySelector(':scope > ul > li[role="treeitem"]');i&&this.#f(i)}break;case"ArrowLeft":if(r=!0,e.getAttribute("aria-expanded")==="true")this.#u(e);else{let i=e.parentElement?.closest('li[role="treeitem"]');i&&this.#f(i)}break;case"Enter":r=!0,e.hasAttribute("aria-expanded")&&this.#u(e);break;case" ":r=!0;{let i=e.querySelector(":scope > .sm-node-content > a");i&&i.click()}break;case"Home":r=!0;{let i=this.querySelector('li[role="treeitem"]');i&&this.#f(i)}break;case"End":r=!0;{let i=this.#h();i.length&&this.#f(i[i.length-1])}break}r&&(t.preventDefault(),t.stopPropagation())}#h(){let t=[],e=r=>{if(!r)return;let i=[...r.querySelectorAll(':scope > li[role="treeitem"]')];for(let a of i)if(t.push(a),a.getAttribute("aria-expanded")==="true"){let o=a.querySelector(":scope > ul");o&&e(o)}},s=this.querySelector("nav > ul");return e(s),t}#v(t){let e=this.#h(),s=e.indexOf(t);s>=0&&s<e.length-1&&this.#f(e[s+1])}#x(t){let e=this.#h(),s=e.indexOf(t);s>0&&this.#f(e[s-1])}#f(t){this.#r&&this.#r.setAttribute("tabindex","-1"),t.setAttribute("tabindex","0"),t.focus(),this.#r=t}static#g="http://www.w3.org/2000/svg";static#b=150;static#k=70;static#A=30;static#_=50;static#C=20;static#D={layout:{stroke:"#8b5cf6",fill:"#f5f3ff",text:"#6d28d9"},section:{stroke:"#3b82f6",fill:"#eff6ff",text:"#1d4ed8"},dashboard:{stroke:"#22c55e",fill:"#f0fdf4",text:"#15803d"},page:{stroke:"#94a3b8",fill:"#f8fafc",text:"#475569"},modal:{stroke:"#f59e0b",fill:"#fffbeb",text:"#b45309"},redirect:{stroke:"#ef4444",fill:"#fef2f2",text:"#b91c1c"}};static#P={draft:"#94a3b8",ready:"#f59e0b",live:"#22c55e",deprecated:"#ef4444"};#R(t){let e=[];for(let s of t.querySelectorAll(":scope > li")){let r=s.querySelector(":scope > a"),i=s.querySelector(":scope > ul");e.push({label:r?.textContent?.trim()||s.firstChild?.textContent?.trim()||"",href:r?.getAttribute("href")||"",pageType:s.getAttribute("data-page-type")||"page",template:s.getAttribute("data-template")||"",status:s.getAttribute("data-status")||"",children:i?this.#R(i):[],x:0,y:0,subtreeWidth:0,collapsed:!1,childCount:0})}return e}#j(t,e=0){let s=c.#b,r=c.#k,i=c.#A,a=c.#_;for(let o of t)o.childCount=this.#B(o),o.children.length>0&&!o.collapsed?(this.#j(o.children,e+1),o.subtreeWidth=o.children.reduce((n,d)=>n+d.subtreeWidth,0)+i*(o.children.length-1)):o.subtreeWidth=s,o.subtreeWidth=Math.max(o.subtreeWidth,s)}#B(t){let e=0;for(let s of t.children)e+=1+this.#B(s);return e}#O(t,e,s){let r=c.#b,i=c.#k,a=c.#A,o=c.#_,n=e;for(let d of t)d.x=n+(d.subtreeWidth-r)/2,d.y=s,d.children.length>0&&!d.collapsed&&this.#O(d.children,n,s+i+o),n+=d.subtreeWidth+a}#Z(t){t.style.display="none",t.setAttribute("aria-hidden","true");let e=t.querySelector("ul");e&&(this.#w=this.#R(e),this.#$())}#w=null;#E=1;get#M(){return this.dataset.orientation==="horizontal"?"horizontal":"vertical"}get#F(){return Math.min(4,Math.max(0,parseInt(this.dataset.detail||"2",10)))}static#I={zoomIn:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/>',zoomOut:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="8" x2="14" y1="11" y2="11"/>',reset:'<path d="M15 3h6v6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/><path d="M9 21H3v-6"/>',flip:'<path d="M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3"/><path d="M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3"/><path d="M4 12H2"/><path d="M10 12H8"/><path d="M16 12h-2"/><path d="M22 12h-2"/>'};static#H=["Shape","Shape + Title","Full","Full + Status","Wireframe"];static#tt=0;#et(t){let e=this.#i?.querySelector(".sm-visual-scroll"),s=this.#i?.querySelector('svg[role="tree"]'),r={nodeId:null,rectTop:0,rectLeft:0,focusId:this.#q};if(!e||!s)return r;let i=t||this.#q;if(!i)return r;let o=s.querySelector(`[data-node-id="${i}"]`)?.querySelector("rect");if(!o)return r;let n=o.getBoundingClientRect(),d=e.getBoundingClientRect();return r.nodeId=i,r.rectTop=n.top-d.top,r.rectLeft=n.left-d.left,r}#U(t){let e=this.#i?.querySelector(".sm-visual-scroll"),s=this.#i?.querySelector('svg[role="tree"]');if(!(!e||!s)){if(t.nodeId){let i=s.querySelector(`[data-node-id="${t.nodeId}"]`)?.querySelector("rect");if(i){let a=i.getBoundingClientRect(),o=e.getBoundingClientRect(),n=a.top-o.top-t.rectTop,d=a.left-o.left-t.rectLeft;e.scrollTop+=n,e.scrollLeft+=d}}t.focusId&&(this.#S(t.focusId),s.focus({preventScroll:!0}))}}#$(t={}){if(!this.#w)return;let e=this.#et(t.anchorId||null),s=this.#i,r=c.#g,i=c.#b,a=c.#k,o=c.#C,n=this.#M==="horizontal";this.#j(this.#w),this.#O(this.#w,o,o);let d=this.#Q(this.#w),l=d.maxX+i+o,u=d.maxY+a+o;n&&([l,u]=[u,l]),this.#i=document.createElement("div"),this.#i.className="sm-visual",this.#i.setAttribute("tabindex","-1"),this.#i.appendChild(this.#st());let h=document.createElement("div");h.className="sm-visual-scroll";let m=document.createElementNS(r,"svg");m.setAttribute("viewBox",`0 0 ${l} ${u}`),m.setAttribute("width",String(l)),m.setAttribute("height",String(u)),m.setAttribute("role","img"),m.setAttribute("aria-label",`Site map${this.getAttribute("title")?": "+this.getAttribute("title"):""}`);let f=document.createElement("div");if(f.className="sm-visual-zoom",f.style.width=`${Math.round(l*this.#E)}px`,f.style.height=`${Math.round(u*this.#E)}px`,m.style.transform=`scale(${this.#E})`,m.style.transformOrigin="0 0",n){let v=document.createElementNS(r,"g");v.setAttribute("transform",`rotate(90 0 0) translate(0 -${u})`),this.#L(v,this.#w),this.#z(v,this.#w),m.appendChild(v)}else this.#L(m,this.#w),this.#z(m,this.#w);f.appendChild(m),h.appendChild(f),this.#i.appendChild(h);let p=document.createElement("div");p.className="sm-visual-summary";let b=Math.round(this.#E*100);p.textContent=`${this.#o} pages \xB7 ${this.#a} levels \xB7 ${b}%`,this.#i.appendChild(p);let y=this.#i,_=()=>{s&&s.isConnected?s.replaceWith(y):this.appendChild(y)};if(s?.isConnected&&"startViewTransition"in document&&!matchMedia("(prefers-reduced-motion: reduce)").matches){let v=`sm-vt-${++c.#tt}`;s.style.viewTransitionName=v,y.style.viewTransitionName=v;let w=document.startViewTransition(_);w.finished.finally(()=>{y.style.viewTransitionName=""}),w.updateCallbackDone.then(()=>this.#U(e))}else _(),this.#U(e);this.#ot(this.#i,m),this.listen(m,"click",v=>{let w=v.target,T=w.closest("[data-toggle]");if(T){let $=T.getAttribute("data-toggle");$&&this.#K($);return}let E=w.closest("[data-node-id]");if(E){let $=E.getAttribute("data-node-id");$&&this.#S($),this.dispatchEvent(new CustomEvent("site-map-wc:select",{bubbles:!0,detail:{href:E.getAttribute("data-href")||"",pageType:E.getAttribute("data-page-type")||"page",template:E.getAttribute("data-template")||""}}))}}),m.setAttribute("tabindex","0"),m.setAttribute("role","tree"),m.setAttribute("aria-label",`Site map${this.getAttribute("title")?": "+this.getAttribute("title"):""} \u2014 use arrow keys to navigate`),m.addEventListener("keydown",v=>this.#it(v)),requestAnimationFrame(()=>{let v=m.querySelector("[data-node-id]");v&&this.#W(v)})}#st(){let t=document.createElement("div");t.className="sm-vtoolbar",t.setAttribute("role","toolbar"),t.setAttribute("aria-label","Site map controls");let e=m=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${m}</svg>`,s=this.#N(e(c.#I.zoomIn),"Zoom in",()=>{this.#E=Math.min(3,this.#E+.25),this.#$()});t.appendChild(s);let r=this.#N(e(c.#I.zoomOut),"Zoom out",()=>{this.#E=Math.max(.25,this.#E-.25),this.#$()});t.appendChild(r);let i=this.#N(e(c.#I.reset),"Reset zoom",()=>{this.#E=1,this.#$()});t.appendChild(i);let a=document.createElement("span");a.className="sm-vtoolbar-sep",t.appendChild(a);let o=this.#M==="horizontal"?"Vertical":"Horizontal",n=this.#N(e(c.#I.flip),o,()=>{this.dataset.orientation=this.#M==="horizontal"?"vertical":"horizontal",this.#$()});t.appendChild(n),t.appendChild(a.cloneNode());let d=this.#F,l=document.createElement("label");l.className="sm-vtoolbar-detail",l.textContent="Detail ";let u=document.createElement("input");u.type="range",u.min="0",u.max="4",u.value=String(d),u.setAttribute("aria-label","Detail level"),u.className="sm-vtoolbar-slider",l.appendChild(u);let h=document.createElement("span");return h.className="sm-vtoolbar-detail-label",h.textContent=c.#H[d],l.appendChild(h),u.addEventListener("input",()=>{this.dataset.detail=u.value,h.textContent=c.#H[parseInt(u.value,10)],this.#$()}),t.appendChild(l),t}#N(t,e,s){let r=document.createElement("button");return r.type="button",r.className="sm-vtoolbar-btn",r.innerHTML=t,r.setAttribute("aria-label",e),r.setAttribute("title",e),r.addEventListener("click",s),r}#q=null;#V(t,e=""){let s=[];for(let r=0;r<t.length;r++){let i=t[r],a=e?`${e}-${r}`:String(r);s.push(a),i.children.length>0&&!i.collapsed&&s.push(...this.#V(i.children,a))}return s}#rt(t){let e=t.lastIndexOf("-");return e>0?t.slice(0,e):null}#nt(t){let e=this.#T(t,this.#w);return!e||e.collapsed||e.children.length===0?null:`${t}-0`}#S(t){if(!t||!this.#i)return;let e=this.#i.querySelector('svg[role="tree"]');if(!e)return;let s=e.querySelector(`[data-node-id="${t}"]`);if(!s)return;this.#W(s),this.#q=t;let r=s.querySelector("rect"),i=this.#i?.querySelector(".sm-visual-scroll");if(r&&i){let a=r.getBoundingClientRect(),o=i.getBoundingClientRect();(a.left<o.left||a.right>o.right||a.top<o.top||a.bottom>o.bottom)&&r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}#W(t){let e=t.closest("svg");if(!e)return;e.querySelectorAll(".sm-vfocus-ring").forEach(i=>i.remove()),e.querySelectorAll("[data-node-id]").forEach(i=>i.removeAttribute("aria-current"));let s=c.#g,r=t.querySelector("rect");if(r){let i=document.createElementNS(s,"rect");i.setAttribute("x",String(parseFloat(r.getAttribute("x")??"0")-3)),i.setAttribute("y",String(parseFloat(r.getAttribute("y")??"0")-3)),i.setAttribute("width",String(parseFloat(r.getAttribute("width")??"0")+6)),i.setAttribute("height",String(parseFloat(r.getAttribute("height")??"0")+6)),i.setAttribute("rx","11"),i.setAttribute("fill","none"),i.setAttribute("stroke","#3b82f6"),i.setAttribute("stroke-width","2"),i.setAttribute("class","sm-vfocus-ring"),t.parentNode?.insertBefore(i,t)}t.setAttribute("aria-current","true"),this.#q=t.getAttribute("data-node-id")}#it(t){if(!this.#w)return;let e=this.#q||"0",s=!1;switch(t.key){case"ArrowDown":{s=!0;let r=this.#T(e,this.#w);r&&r.children.length>0&&!r.collapsed&&this.#S(`${e}-0`);break}case"ArrowUp":{s=!0;let r=this.#rt(e);r&&this.#S(r);break}case"ArrowRight":{s=!0;let r=this.#Y(e,1);r&&this.#S(r);break}case"ArrowLeft":{s=!0;let r=this.#Y(e,-1);r&&this.#S(r);break}case"Enter":case" ":{s=!0;let r=this.#T(e,this.#w);r&&r.children.length>0&&this.#K(e);break}case"Home":{s=!0,this.#S("0");break}case"End":{s=!0;let r=this.#V(this.#w);r.length&&this.#S(r[r.length-1]);break}}s&&(t.preventDefault(),t.stopPropagation())}#Y(t,e){let s=t.split("-").map(Number),r=s[s.length-1]+e;if(r<0)return null;let i=s.length>1?s.slice(0,-1).join("-"):null,a=i?this.#T(i,this.#w):null,o=a?a.children:this.#w;if(!o||r>=o.length)return null;let n=[...s];return n[n.length-1]=r,n.join("-")}#X=!1;#at={dragging:!1,startX:0,startY:0,scrollLeft:0,scrollTop:0,moved:!1};#ot(t,e){if(e.style.cursor="grab",this.#X)return;this.#X=!0;let s=this.#at;this.listen(this,"pointerdown",r=>{let i=r;if(i.target.closest("button, [data-toggle], .sm-vtoolbar, input"))return;let a=this.querySelector(".sm-visual-scroll");if(!a)return;s.dragging=!0,s.moved=!1,s.startX=i.clientX,s.startY=i.clientY,s.scrollLeft=a.scrollLeft,s.scrollTop=a.scrollTop;let o=this.querySelector('svg[role="tree"]');o&&(o.style.cursor="grabbing")}),this.listen(window,"pointermove",r=>{if(!s.dragging)return;let i=r,a=i.clientX-s.startX,o=i.clientY-s.startY;(Math.abs(a)>3||Math.abs(o)>3)&&(s.moved=!0);let n=this.querySelector(".sm-visual-scroll");n&&(n.scrollLeft=s.scrollLeft-a,n.scrollTop=s.scrollTop-o)}),this.listen(window,"pointerup",()=>{if(!s.dragging)return;s.dragging=!1;let r=this.querySelector('svg[role="tree"]');r&&(r.style.cursor="grab")}),this.listen(this,"click",r=>{s.moved&&(r.stopPropagation(),s.moved=!1)},{capture:!0})}#Q(t){let e=0,s=0;for(let r of t)if(r.x+c.#b>e&&(e=r.x+c.#b),r.y+c.#k>s&&(s=r.y+c.#k),r.children.length>0&&!r.collapsed){let i=this.#Q(r.children);i.maxX>e&&(e=i.maxX),i.maxY>s&&(s=i.maxY)}return{maxX:e,maxY:s}}#L(t,e){let s=c.#g,r=c.#b,i=c.#k,a=c.#_;for(let o of e){if(o.children.length===0||o.collapsed)continue;let n=o.x+r/2,d=o.y+i,l=d+a/2;for(let u of o.children){let h=u.x+r/2,m=u.y,f=document.createElementNS(s,"path");f.setAttribute("d",`M ${n} ${d} L ${n} ${l} L ${h} ${l} L ${h} ${m}`),f.setAttribute("fill","none"),f.setAttribute("stroke","#cbd5e1"),f.setAttribute("stroke-width","1.5"),t.appendChild(f)}this.#L(t,o.children)}}#z(t,e,s=""){let r=c.#g,i=c.#b,a=c.#k,o=this.#F,n=o>=4;for(let d=0;d<e.length;d++){let l=e[d],u=s?`${s}-${d}`:String(d),h=n?{stroke:"#94a3b8",fill:"#ffffff",text:"#475569"}:c.#D[l.pageType]||c.#D.page,m=document.createElementNS(r,"g");m.setAttribute("data-node-id",u),m.setAttribute("data-href",l.href),m.setAttribute("data-page-type",l.pageType),m.setAttribute("data-template",l.template),m.style.cursor="pointer";let f=document.createElementNS(r,"rect");if(f.setAttribute("x",String(l.x)),f.setAttribute("y",String(l.y)),f.setAttribute("width",String(i)),f.setAttribute("height",String(a)),f.setAttribute("rx","8"),f.setAttribute("fill",h.fill),f.setAttribute("stroke",h.stroke),f.setAttribute("stroke-width",n?"1":"2"),(n||l.pageType==="modal")&&f.setAttribute("stroke-dasharray","6 3"),m.appendChild(f),o>=1){let p=document.createElementNS(r,"text");p.setAttribute("x",String(l.x+i/2)),p.setAttribute("y",String(o===1?l.y+a/2+5:l.y+24)),p.setAttribute("text-anchor","middle"),p.setAttribute("font-size","13"),p.setAttribute("font-weight","600"),p.setAttribute("fill",h.text),p.setAttribute("font-family","system-ui, sans-serif"),p.textContent=l.label.length>18?l.label.slice(0,17)+"\u2026":l.label,m.appendChild(p)}if(o>=2){let p=document.createElementNS(r,"text");if(p.setAttribute("x",String(l.x+i/2)),p.setAttribute("y",String(l.y+40)),p.setAttribute("text-anchor","middle"),p.setAttribute("font-size","9"),p.setAttribute("font-weight","700"),p.setAttribute("fill",h.stroke),p.setAttribute("font-family","system-ui, sans-serif"),p.textContent=(tt[l.pageType]?.label||l.pageType).toUpperCase(),m.appendChild(p),l.template){let b=document.createElementNS(r,"text");b.setAttribute("x",String(l.x+i/2)),b.setAttribute("y",String(l.y+54)),b.setAttribute("text-anchor","middle"),b.setAttribute("font-size","9"),b.setAttribute("fill","#94a3b8"),b.setAttribute("font-family","system-ui, sans-serif"),b.textContent=l.template,m.appendChild(b)}}if(o>=3&&l.status&&c.#P[l.status]){let p=document.createElementNS(r,"circle");p.setAttribute("cx",String(l.x+i/2)),p.setAttribute("cy",String(l.y+a-8)),p.setAttribute("r","4"),p.setAttribute("fill",n?"#94a3b8":c.#P[l.status]),m.appendChild(p)}if(n)for(let p=0;p<2;p++){let b=document.createElementNS(r,"line");b.setAttribute("x1",String(l.x+12)),b.setAttribute("x2",String(l.x+i-12)),b.setAttribute("y1",String(l.y+a-22+p*8)),b.setAttribute("y2",String(l.y+a-22+p*8)),b.setAttribute("stroke","#cbd5e1"),b.setAttribute("stroke-width","1"),b.setAttribute("stroke-dasharray","3 2"),m.appendChild(b)}if(l.children.length>0){let p=document.createElementNS(r,"g");p.setAttribute("data-toggle",u),p.style.cursor="pointer";let b=document.createElementNS(r,"circle");b.setAttribute("cx",String(l.x+i/2)),b.setAttribute("cy",String(l.y+a+10)),b.setAttribute("r","10"),b.setAttribute("fill",n?"#fff":"#f1f5f9"),b.setAttribute("stroke","#cbd5e1"),b.setAttribute("stroke-width","1"),p.appendChild(b);let y=document.createElementNS(r,"text");y.setAttribute("x",String(l.x+i/2)),y.setAttribute("y",String(l.y+a+14)),y.setAttribute("text-anchor","middle"),y.setAttribute("font-size","11"),y.setAttribute("font-weight","700"),y.setAttribute("fill","#64748b"),y.setAttribute("font-family","system-ui, sans-serif"),y.textContent=l.collapsed?`+${l.childCount}`:"\u2212",p.appendChild(y),m.appendChild(p)}t.appendChild(m),l.children.length>0&&!l.collapsed&&this.#z(t,l.children,u)}}#K(t){let e=this.#T(t,this.#w);e&&(e.collapsed=!e.collapsed,this.#q||(this.#q=t),this.#$({anchorId:t}))}#T(t,e){if(!e)return null;let s=t.split("-").map(Number),r=e,i=null;for(let a of s){if(!r||a>=r.length)return null;i=r[a],r=i.children}return i}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();s.title&&!this.getAttribute("title")&&this.setAttribute("title",s.title),this._setPages(s.pages||[])}catch(e){console.warn(`[site-map-wc] Failed to load src="${t}":`,e)}}get pages(){let e=this.querySelector(":scope > nav")?.querySelector("ul");return e?this.#G(e):[]}set pages(t){this._setPages(Array.isArray(t)?t:[]),this.dispatchEvent(new CustomEvent("site-map-wc:pages-changed",{detail:{pages:this.pages,source:"property"},bubbles:!0}))}_setPages(t){for(;this.firstChild;)this.firstChild.remove();let e=document.createElement("nav"),s=document.createElement("ul");this.#J(s,t),e.appendChild(s),this.appendChild(e),this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}#G(t){let e=[];for(let s of t.querySelectorAll(":scope > li")){let r=s.querySelector(":scope > a"),i=s.querySelector(":scope > ul"),a={label:r?.textContent?.trim()||"",href:r?.getAttribute("href")||void 0,pageType:s.getAttribute("data-page-type")||void 0,template:s.getAttribute("data-template")||void 0,status:s.getAttribute("data-status")||void 0};i&&(a.children=this.#G(i)),e.push(a)}return e}#J(t,e){for(let s of e){let r=document.createElement("li");s.pageType&&r.setAttribute("data-page-type",s.pageType),s.template&&r.setAttribute("data-template",s.template),s.status&&r.setAttribute("data-status",s.status);let i=document.createElement("a");if(i.href=s.href||"#",i.textContent=s.label||"",r.appendChild(i),s.children&&s.children.length>0){let a=document.createElement("ul");this.#J(a,s.children),r.appendChild(a)}t.appendChild(r)}}};x("site-map-wc",It);var F=`
|
|
2758
|
+
</article>`,i==="compact")for(let n of t.querySelectorAll(".wi-section")){let l=n.querySelector("slot");l&&l.assignedNodes().length===0&&n.setAttribute("data-empty","")}this.dispatchEvent(new CustomEvent("work-item:ready",{detail:{itemId:this.itemId,title:this.itemTitle,type:s,priority:this.priority,status:this.status},bubbles:!0,composed:!0}))}};x("work-item",Ct);var O=`
|
|
2759
2759
|
:host {
|
|
2760
2760
|
--_bg: var(--adr-wc-bg, var(--color-surface, #ffffff));
|
|
2761
2761
|
--_text: var(--adr-wc-text, var(--color-text, #1a1a1a));
|
|
@@ -3081,28 +3081,28 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
3081
3081
|
|
|
3082
3082
|
.state-msg { padding: var(--_space-m); font-size: var(--_font-sm); color: var(--_muted); font-style: italic; }
|
|
3083
3083
|
.state-msg--error { color: var(--color-error-text, var(--color-error, #dc2626)); }
|
|
3084
|
-
`;var
|
|
3085
|
-
<article class="adr-card adr-card--minimal" role="article" aria-label="${
|
|
3084
|
+
`;var Rt={proposed:{label:"Proposed",color:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},accepted:{label:"Accepted",color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},deprecated:{label:"Deprecated",color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},superseded:{label:"Superseded",color:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"}},D={calendar:'<rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><line x1="16" x2="16" y1="2" y2="6"/><line x1="8" x2="8" y1="2" y2="6"/><line x1="3" x2="21" y1="10" y2="10"/>',context:'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" x2="8" y1="13" y2="13"/><line x1="16" x2="8" y1="17" y2="17"/><line x1="10" x2="8" y1="9" y2="9"/>',decision:'<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/>',consequences:'<path d="m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"/><path d="m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"/><path d="M7 21h10"/><path d="M12 3v18"/><path d="M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2"/>',arrowRight:'<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>'},Et=class extends HTMLElement{static get observedAttributes(){return["adr-id","status","supersedes","superseded-by","detail","compact","src"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"})}#t(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&this.#e.set(e,t.textContent.trim())}}connectedCallback(){this.#t(),this.adrId&&!this.id&&(this.id=this.adrId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#r(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t,e,r){e!==r&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(r):this.#r())}get adrId(){return this.getAttribute("adr-id")||""}get status(){return this.getAttribute("status")||"proposed"}get adrTitle(){return this.querySelector('[slot="title"]')?.textContent?.trim()||this.#e.get("title")||""}get adrDate(){let t=this.querySelector('[slot="date"]');return t?.getAttribute("datetime")||t?.textContent?.trim()||this.#e.get("date")||""}get supersedes(){let t=this.getAttribute("supersedes")||"";return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}get supersededBy(){let t=this.getAttribute("superseded-by")||"";return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}get _detailLevel(){return this.getAttribute("detail")?this.getAttribute("detail"):this.hasAttribute("compact")?"compact":"full"}get _minimalLabel(){return this.adrTitle||this.adrId||"ADR"}get data(){return{adrId:this.adrId||void 0,status:this.status,detail:this.getAttribute("detail")||void 0,supersedes:this.supersedes.length?this.supersedes:void 0,supersededBy:this.supersededBy.length?this.supersededBy:void 0,title:this.adrTitle||void 0,date:this.adrDate||void 0}}set data(t){!t||typeof t!="object"||(this._applyData(t),this.#t(),this.shadowRoot&&this.#r(),this.dispatchEvent(new CustomEvent("adr-wc:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){if(t.adrId!=null&&this.setAttribute("adr-id",String(t.adrId)),t.status!=null&&this.setAttribute("status",String(t.status)),t.detail!=null&&this.setAttribute("detail",String(t.detail)),t.supersedes&&this.setAttribute("supersedes",Array.isArray(t.supersedes)?t.supersedes.join(","):String(t.supersedes)),t.supersededBy&&this.setAttribute("superseded-by",Array.isArray(t.supersededBy)?t.supersededBy.join(","):String(t.supersededBy)),t.title&&!this.querySelector('[slot="title"]')){let e=document.createElement("h3");e.slot="title",e.textContent=String(t.title),this.appendChild(e)}if(t.date&&!this.querySelector('[slot="date"]')){let e=document.createElement("time");e.slot="date",e.setAttribute("datetime",String(t.date)),e.textContent=new Date(String(t.date)).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}),this.appendChild(e)}for(let e of["context","decision"])if(t[e]&&!this.querySelector(`[slot="${e}"]`)){let r=document.createElement("p");r.slot=e,r.textContent=String(t[e]),this.appendChild(r)}if(t.consequences&&!this.querySelector('[slot="consequences"]')){let e=document.createElement("ul");e.slot="consequences";let r=Array.isArray(t.consequences)?t.consequences:[t.consequences];for(let s of r){let a=document.createElement("li");a.textContent=String(s),e.appendChild(a)}this.appendChild(e)}}async _loadSrc(t){if(!t)return;let e=this.shadowRoot;e.innerHTML=`<style>${O}</style><div class="state-msg">Loading\u2026</div>`;try{let r=await fetch(t);if(!r.ok)throw new Error(`HTTP ${r.status}`);let s=await r.json();this._applyData(s),this.#t(),this.#r()}catch(r){e.innerHTML=`<style>${O}</style><div class="state-msg state-msg--error">Could not load: ${h(r.message)}</div>`}}#r(){let t=this.shadowRoot,e=Rt[this.status]||Rt.proposed,r=this._detailLevel,s=this.adrId?`ADR: ${h(this.adrId)}`:"Architectural Decision Record",a=!!this.querySelector('[slot="date"]')||this.#e.has("date");if(r==="minimal"){t.innerHTML=`<style>${O}</style>
|
|
3085
|
+
<article class="adr-card adr-card--minimal" role="article" aria-label="${s}"
|
|
3086
3086
|
tabindex="0">
|
|
3087
3087
|
<div class="adr-body">
|
|
3088
3088
|
<div class="adr-meta">
|
|
3089
|
-
${this.adrId?`<span class="adr-id">${
|
|
3090
|
-
<span class="adr-status" style="color:${e.color};background:${e.bg}">${
|
|
3089
|
+
${this.adrId?`<span class="adr-id">${h(this.adrId)}</span>`:""}
|
|
3090
|
+
<span class="adr-status" style="color:${e.color};background:${e.bg}">${h(e.label)}</span>
|
|
3091
3091
|
</div>
|
|
3092
3092
|
<div class="adr-title-wrap">
|
|
3093
|
-
<slot name="title"><span class="adr-title-fallback">${
|
|
3093
|
+
<slot name="title"><span class="adr-title-fallback">${h(this._minimalLabel)}</span></slot>
|
|
3094
3094
|
</div>
|
|
3095
3095
|
</div>
|
|
3096
|
-
</article>`;return}if(t.innerHTML=`<style>${
|
|
3097
|
-
<article class="adr-card adr-card--${
|
|
3096
|
+
</article>`;return}if(t.innerHTML=`<style>${O}</style>
|
|
3097
|
+
<article class="adr-card adr-card--${r}" role="article" aria-label="${s}">
|
|
3098
3098
|
|
|
3099
3099
|
<header class="adr-header">
|
|
3100
3100
|
<div class="adr-meta">
|
|
3101
|
-
${this.adrId?`<span class="adr-id">${
|
|
3102
|
-
${
|
|
3101
|
+
${this.adrId?`<span class="adr-id">${h(this.adrId)}</span>`:""}
|
|
3102
|
+
${a?`<span class="adr-date-wrap">${A(D.calendar)} <slot name="date"></slot></span>`:""}
|
|
3103
3103
|
</div>
|
|
3104
3104
|
<div class="adr-badges">
|
|
3105
|
-
<span class="adr-status" style="color:${e.color};background:${e.bg}">${
|
|
3105
|
+
<span class="adr-status" style="color:${e.color};background:${e.bg}">${h(e.label)}</span>
|
|
3106
3106
|
</div>
|
|
3107
3107
|
</header>
|
|
3108
3108
|
|
|
@@ -3114,20 +3114,20 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
3114
3114
|
${this.supersedes.length?`
|
|
3115
3115
|
<div class="adr-links">
|
|
3116
3116
|
<span class="adr-links-label">Supersedes</span>
|
|
3117
|
-
${this.supersedes.map(
|
|
3117
|
+
${this.supersedes.map(i=>`<a class="adr-link" href="#${h(i)}">${A(D.arrowRight)} ${h(i)}</a>`).join("")}
|
|
3118
3118
|
</div>`:""}
|
|
3119
3119
|
|
|
3120
3120
|
${this.supersededBy.length?`
|
|
3121
3121
|
<div class="adr-links">
|
|
3122
3122
|
<span class="adr-links-label">Superseded by</span>
|
|
3123
|
-
${this.supersededBy.map(
|
|
3123
|
+
${this.supersededBy.map(i=>`<a class="adr-link" href="#${h(i)}">${A(D.arrowRight)} ${h(i)}</a>`).join("")}
|
|
3124
3124
|
</div>`:""}
|
|
3125
3125
|
</div>
|
|
3126
3126
|
|
|
3127
3127
|
<div class="adr-sections">
|
|
3128
3128
|
<div class="adr-section">
|
|
3129
3129
|
<div class="adr-section-header">
|
|
3130
|
-
<div class="adr-section-icon context">${A(
|
|
3130
|
+
<div class="adr-section-icon context">${A(D.context)}</div>
|
|
3131
3131
|
<span class="adr-section-title">Context</span>
|
|
3132
3132
|
</div>
|
|
3133
3133
|
<div class="adr-section-content">
|
|
@@ -3137,7 +3137,7 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
3137
3137
|
|
|
3138
3138
|
<div class="adr-section">
|
|
3139
3139
|
<div class="adr-section-header">
|
|
3140
|
-
<div class="adr-section-icon decision">${A(
|
|
3140
|
+
<div class="adr-section-icon decision">${A(D.decision)}</div>
|
|
3141
3141
|
<span class="adr-section-title">Decision</span>
|
|
3142
3142
|
</div>
|
|
3143
3143
|
<div class="adr-section-content">
|
|
@@ -3147,7 +3147,7 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
3147
3147
|
|
|
3148
3148
|
<div class="adr-section">
|
|
3149
3149
|
<div class="adr-section-header">
|
|
3150
|
-
<div class="adr-section-icon consequences">${A(
|
|
3150
|
+
<div class="adr-section-icon consequences">${A(D.consequences)}</div>
|
|
3151
3151
|
<span class="adr-section-title">Consequences</span>
|
|
3152
3152
|
</div>
|
|
3153
3153
|
<div class="adr-section-content">
|
|
@@ -3156,6 +3156,5 @@ var Ce=window.matchMedia("(prefers-reduced-motion: reduce)");var zt=new Map;func
|
|
|
3156
3156
|
</div>
|
|
3157
3157
|
</div>
|
|
3158
3158
|
|
|
3159
|
-
</article>`,s==="compact")for(let a of t.querySelectorAll(".adr-section")){let o=a.querySelector("slot");o&&o.assignedNodes().length===0&&a.setAttribute("data-empty","")}this.dispatchEvent(new CustomEvent("adr-wc:ready",{detail:{adrId:this.adrId,title:this.adrTitle,status:this.status},bubbles:!0,composed:!0}))}};x("adr-wc",Nt);var Mt=class c extends C{static get observedAttributes(){return["src","title","compact"]}#e=null;#s=null;#t=null;#i=0;#r=[];setup(){let t=this.querySelector(":scope > ol");if(!t)return!1;let e=this.#n(t);if(e.length===0)return!1;this.#r=e,t.style.display="none",t.setAttribute("aria-hidden","true");let s=this.getAttribute("title");s&&(this.#s=document.createElement("h2"),this.#s.className="fd-title",this.#s.textContent=s,this.insertBefore(this.#s,t)),this.#e=document.createElement("div"),this.#e.className="fd-container",this.#e.setAttribute("role","img"),this.#e.setAttribute("aria-label",`Flow diagram${s?": "+s:""}`),this.#i=0,this.#c(e,this.#e);let r=document.createElement("div");return r.className="fd-summary",r.textContent=`${this.#i} step${this.#i!==1?"s":""}`,this.#e.appendChild(r),this.insertBefore(this.#e,t),this.#t=document.createElement("div"),this.#t.className="fd-live",this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.appendChild(this.#t),this.listen(this.#e,"click",i=>{let a=i.target.closest(".fd-node-shape");if(!a)return;let n=a.closest(".fd-node")?.dataset.type||"action",d=a.textContent?.trim()||"";this.#m(`Selected: ${d}`),this.dispatchEvent(new CustomEvent("flow-diagram:select",{bubbles:!0,detail:{type:n,text:d}}))}),this.dispatchEvent(new CustomEvent("flow-diagram:ready",{bubbles:!0,detail:{nodeCount:this.#i}})),!0}teardown(){this.#s&&(this.#s.remove(),this.#s=null),this.#e&&(this.#e.remove(),this.#e=null),this.#t&&(this.#t.remove(),this.#t=null);let t=this.querySelector("ol");t&&(t.style.display="",t.removeAttribute("aria-hidden")),this.#i=0}static#o=0;attributeChangedCallback(t,e,s){e===s||!this.isConnected||(t==="src"?this._loadSrc(s):this.hasAttribute("data-upgraded")&&this.#a())}#a(){let t=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};if(this.hasAttribute("data-upgraded")&&"startViewTransition"in document&&!matchMedia("(prefers-reduced-motion: reduce)").matches){let e=`fd-vt-${++c.#o}`;this.style.viewTransitionName=e,document.startViewTransition(t).finished.finally(()=>{this.style.viewTransitionName=""})}else t()}get steps(){return this.#r}set steps(t){let e=Array.isArray(t)?t:[];this.#r=e,this.#s&&(this.#s.remove(),this.#s=null),this.#e&&(this.#e.remove(),this.#e=null),this.#t&&(this.#t.remove(),this.#t=null);let s=this.querySelector(":scope > ol");if(s||(s=document.createElement("ol"),s.style.display="none",s.setAttribute("aria-hidden","true"),this.appendChild(s)),e.length===0){this.dispatchEvent(new CustomEvent("flow-diagram:steps-changed",{detail:{steps:e,source:"property"},bubbles:!0}));return}let r=this.getAttribute("title");r&&(this.#s=document.createElement("h2"),this.#s.className="fd-title",this.#s.textContent=r,this.insertBefore(this.#s,s)),this.#e=document.createElement("div"),this.#e.className="fd-container",this.#e.setAttribute("role","img"),this.#e.setAttribute("aria-label",`Flow diagram${r?": "+r:""}`),this.#i=0,this.#c(e,this.#e);let i=document.createElement("div");i.className="fd-summary",i.textContent=`${this.#i} step${this.#i!==1?"s":""}`,this.#e.appendChild(i),this.insertBefore(this.#e,s),this.#t=document.createElement("div"),this.#t.className="fd-live",this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.appendChild(this.#t),this.dispatchEvent(new CustomEvent("flow-diagram:steps-changed",{detail:{steps:e,source:"property"},bubbles:!0}))}#n(t){let e=[];for(let s of t.querySelectorAll(":scope > li")){let r=this.#l(s);r&&e.push(r)}return e}#l(t){let e=t.dataset.type||"action",s=t.dataset.annotation||"",r=[],i=t.querySelectorAll(":scope > ol > li[data-branch]");if(i.length>0)for(let o of i){let n=o.dataset.branch||"",d=o.querySelector(":scope > ol"),l=d?this.#n(d):[];r.push({label:n,steps:l})}let a="";for(let o of t.childNodes)(o.nodeType===Node.TEXT_NODE||o.nodeType===Node.ELEMENT_NODE&&o.tagName!=="OL")&&(a+=o.textContent);return a=a.trim(),{type:e,text:a,annotation:s,branches:r}}#c(t,e){for(let s=0;s<t.length;s++){let r=t[s];s>0&&e.appendChild(this.#d());let i=this.#p(r);if(e.appendChild(i),r.branches.length>0){let a=document.createElement("div");a.className="fd-branches",a.setAttribute("data-branch-count",String(r.branches.length));let o=document.createElement("div");o.className="fd-split-line",o.setAttribute("aria-hidden","true"),a.appendChild(o);let n=document.createElement("div");n.className="fd-branch-columns";let d=(50/r.branches.length).toFixed(2);n.style.setProperty("--fd-inset",`${d}%`);for(let l of r.branches){let u=document.createElement("div");u.className="fd-branch",u.appendChild(this.#d());let h=document.createElement("span");h.className="fd-branch-label",h.textContent=l.label,h.setAttribute("data-branch",l.label.toLowerCase()),u.appendChild(h),this.#c(l.steps,u),n.appendChild(u)}a.appendChild(n),e.appendChild(a)}}}#p(t){this.#i++;let e=document.createElement("div");e.className="fd-node",e.dataset.type=t.type;let s=document.createElement("div");if(s.className="fd-node-shape",s.setAttribute("tabindex","0"),s.setAttribute("role","img"),s.setAttribute("aria-label",`${t.type}: ${t.text}`),s.textContent=t.text,e.appendChild(s),t.annotation){let r=document.createElement("div");r.className="fd-annotation",r.textContent=t.annotation,e.appendChild(r)}return e}#d(t){let e=document.createElement("div");e.className="fd-connector",e.setAttribute("aria-hidden","true");let s=document.createElement("div");if(s.className="fd-connector-line",e.appendChild(s),t){let i=document.createElement("span");i.className="fd-connector-label",i.textContent=t,e.appendChild(i)}let r=document.createElement("div");return r.className="fd-connector-arrow",e.appendChild(r),e}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();s.title&&this.setAttribute("title",s.title);let r=document.createElement("ol");this.#u(s.steps||[],r),this.appendChild(r),this.#a()}catch(e){console.warn(`[flow-diagram] Failed to load src="${t}":`,e)}}#u(t,e){for(let s of t){let r=document.createElement("li");if(s.type&&(r.dataset.type=s.type),s.annotation&&(r.dataset.annotation=s.annotation),r.textContent=s.text||"",s.branches&&s.branches.length>0){let i=document.createElement("ol");for(let a of s.branches){let o=document.createElement("li");o.dataset.branch=a.label||"";let n=document.createElement("ol");this.#u(a.steps||[],n),o.appendChild(n),i.appendChild(o)}r.appendChild(i)}e.appendChild(r)}}#m(t){this.#t&&(this.#t.textContent="",requestAnimationFrame(()=>{this.#t&&(this.#t.textContent=t)}))}};x("flow-diagram",Mt);function S(c,t,e){return c.getPropertyValue(t).trim()||e}function L(c,t){if(!t)return t;let e=document.createElement("span");e.style.color=t,e.style.position="absolute",e.style.visibility="hidden",e.style.pointerEvents="none",(c.parentElement||document.body).appendChild(e);let s=getComputedStyle(e).color;if(e.remove(),!s)return t;let r=L,i=r._canvas||(r._canvas=document.createElement("canvas"));i.width=i.height=1;let a=r._ctx||(r._ctx=i.getContext("2d",{willReadFrequently:!0}));a.clearRect(0,0,1,1),a.fillStyle=s,a.fillRect(0,0,1,1);let[o,n,d,l]=a.getImageData(0,0,1,1).data;return l===255?`rgb(${o},${n},${d})`:`rgba(${o},${n},${d},${(l/255).toFixed(3)})`}function we(c){let t=getComputedStyle(c),e=L(c,S(t,"--color-text","#1a1a1a")),s=L(c,S(t,"--color-surface","#ffffff")),r=L(c,S(t,"--color-surface-raised",S(t,"--color-surface","#ffffff"))),i=L(c,S(t,"--color-border","#e0e0e0")),a=L(c,S(t,"--color-primary",S(t,"--color-interactive","#3b82f6"))),o=L(c,S(t,"--color-secondary",S(t,"--color-surface-raised","#f8f9fa"))),n=L(c,S(t,"--color-accent",S(t,"--color-primary","#3b82f6"))),d=L(c,S(t,"--color-text-muted",S(t,"--color-text","#1a1a1a"))),l=S(t,"--font-sans",'system-ui, -apple-system, "Segoe UI", sans-serif'),u=S(t,"--font-size-md","14px"),h=[a,n,o],m={};for(let p=0;p<12;p++)m[`cScale${p}`]=h[p%h.length],m[`cScaleLabel${p}`]=e,m[`cScalePeer${p}`]=i,m[`cScaleInv${p}`]=s;let f={};for(let p=0;p<8;p++)f[`git${p}`]=h[p%h.length],f[`gitInv${p}`]=s,f[`gitBranchLabel${p}`]=e;return{primaryColor:a,primaryBorderColor:i,primaryTextColor:e,nodeTextColor:e,secondaryColor:o,secondaryBorderColor:i,secondaryTextColor:e,tertiaryColor:n,tertiaryBorderColor:i,tertiaryTextColor:e,background:s,mainBkg:s,secondBkg:r,tertiaryBkg:r,lineColor:i,nodeBorder:i,gridColor:i,defaultLinkColor:d,clusterBkg:r,clusterBorder:i,actorBkg:s,actorBorder:i,actorTextColor:e,actorLineColor:i,signalColor:e,signalTextColor:e,labelBoxBkgColor:r,labelBoxBorderColor:i,labelTextColor:e,loopTextColor:e,noteBkgColor:r,noteBorderColor:i,noteTextColor:e,edgeLabelBackground:s,titleColor:e,fontFamily:l,fontSize:u,...m,...f}}function Xt(c,t={}){return{startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:t.themeBase||"base",themeVariables:we(c)}}var _e="https://cdn.jsdelivr.net/npm/mermaid@11.14.0/dist/mermaid.esm.min.mjs",Qt=new Map;function Ae(c){let t=c||typeof window<"u"&&window.VB_MERMAID_URL||_e,e=Qt.get(t);return e||(e=import(t).then(s=>s.default||s),Qt.set(t,e)),e}var Lt=class c extends C{static#e=0;static#s=0;#t=null;#i=null;#r=null;#o=null;#a=null;#n=!1;setup(){this.hasAttribute("type")||this.setAttribute("type","mermaid");let t=this.getAttribute("min-height");t&&(this.style.minBlockSize=t);let e=this.querySelector(":scope > pre");e&&(this.#i=document.createElement("template"),this.#i.appendChild(e.cloneNode(!0)),this.#t=this.#u(e),this.setAttribute("data-rendering",""));let s=this.querySelector(":scope > .dwc-figure");s&&(this.#r=s,this.#n=!0,this.removeAttribute("data-rendering")),this.listen(window,"vb:theme-change",()=>{this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{this.#n&&this.#c()},50)});let r=this.getAttribute("src");r?this.#m(r).then(()=>this.#l()):this.#t&&this.#l()}teardown(){if(this.#o&&(this.#o.disconnect(),this.#o=null),this.#a&&(clearTimeout(this.#a),this.#a=null),this.#r&&(this.#r.remove(),this.#r=null),this.#i){let t=this.#i.content.firstElementChild;t&&!this.querySelector(":scope > pre")&&this.appendChild(t.cloneNode(!0))}this.#n=!1}#l(){if(this.getAttribute("loading")!=="lazy"){this.#c();return}if(!("IntersectionObserver"in window)){this.#c();return}this.#o=new IntersectionObserver(t=>{for(let e of t)if(e.isIntersecting){this.#o?.disconnect(),this.#o=null,this.#c();break}},{rootMargin:"200px"}),this.#o.observe(this)}async#c(){if(!this.#t)return;let t=this.getAttribute("type")||"mermaid";if(t!=="mermaid"){this.#d(new Error(`Unsupported diagram type "${t}". v1 supports "mermaid" only.`));return}try{let e=await Ae(this.dataset.mermaidSrc),s=Xt(this,{themeBase:this.dataset.themeBase||"base"});e.initialize(s);let r=`diagram-wc-${++c.#e}`,{svg:i}=await e.render(r,this.#t);this.#p(i),this.#n=!0,this.removeAttribute("data-rendering"),this.removeAttribute("data-error"),this.querySelector(":scope > .dwc-error")?.remove(),this.dispatchEvent(new CustomEvent("diagram-wc:ready",{bubbles:!0,detail:{svg:i,type:t,source:this.#t}}))}catch(e){this.removeAttribute("data-rendering"),this.#n||this.setAttribute("data-error",""),this.#d(e)}}#p(t){let e=document.createElement("figure");e.className="dwc-figure",e.setAttribute("role","img");let s=this.getAttribute("caption")||`${this.getAttribute("type")||"diagram"} diagram`;e.setAttribute("aria-label",s),e.innerHTML=t;let r=this.getAttribute("caption");if(r){let o=document.createElement("figcaption");o.className="dwc-caption",o.textContent=r,e.appendChild(o)}let i=this.#r,a=()=>{i&&i.isConnected?i.replaceWith(e):this.appendChild(e),this.querySelector(":scope > pre")?.remove(),this.#r=e};if(i?.isConnected&&"startViewTransition"in document&&!matchMedia("(prefers-reduced-motion: reduce)").matches){let o=`dwc-vt-${++c.#s}`;i.style.viewTransitionName=o,e.style.viewTransitionName=o,document.startViewTransition(a).finished.finally(()=>{e.style.viewTransitionName=""})}else a()}#d(t){if(!this.#n){if(!this.querySelector(":scope > pre")&&this.#i){let r=this.#i.content.firstElementChild;r&&this.appendChild(r.cloneNode(!0))}this.#r&&(this.#r.remove(),this.#r=null)}this.querySelector(":scope > .dwc-error")?.remove();let e=document.createElement("p");e.className="dwc-error",e.setAttribute("role","status");let s=(t.message||String(t)).split(`
|
|
3160
|
-
`)[0].slice(0,240);e.textContent=`Diagram syntax error: ${s}`,this.appendChild(e),this.dispatchEvent(new CustomEvent("diagram-wc:error",{bubbles:!0,detail:{error:t,source:this.#t,type:this.getAttribute("type")}}))}#u(t){let e=t.querySelector("code");return(e?e.textContent:t.textContent)||""}async#m(t){try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);this.#t=await e.text()}catch(e){this.#d(e)}}get source(){return this.#t||""}set source(t){let e=String(t||"");e!==this.#t&&(this.#t=e,this.#r&&(this.#r.remove(),this.#r=null),this.querySelector(":scope > .dwc-error")?.remove(),this.dispatchEvent(new CustomEvent("diagram-wc:source-changed",{bubbles:!0,detail:{source:e}})),this.#c())}get svg(){return this.#r?.querySelector("svg")?.outerHTML||""}};x("diagram-wc",Lt);
|
|
3159
|
+
</article>`,r==="compact")for(let i of t.querySelectorAll(".adr-section")){let o=i.querySelector("slot");o&&o.assignedNodes().length===0&&i.setAttribute("data-empty","")}this.dispatchEvent(new CustomEvent("adr-wc:ready",{detail:{adrId:this.adrId,title:this.adrTitle,status:this.status},bubbles:!0,composed:!0}))}};x("adr-wc",Et);
|
|
3161
3160
|
//# sourceMappingURL=ux-planning.full.js.map
|