dev-process-kit 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/boards.js +1 -1
- package/dist/chunks/{shared-zDGLGSqj.js → shared-0HXwrPVn.js} +54 -54
- package/dist/chunks/{shared-C1y1ymFB.js → shared-B2F5LY6f.js} +13 -13
- package/dist/chunks/shared-B7MDu9J_.js +6912 -0
- package/dist/chunks/{shared-DFW6nDO8.js → shared-BSEt0fN6.js} +9 -2
- package/dist/chunks/{shared-CpI8ATFw.js → shared-BugVP_yn.js} +2 -2
- package/dist/chunks/shared-C1sWnXGY.js +1 -0
- package/dist/chunks/{shared-DPayIyBW.js → shared-C2_qMOyi.js} +1 -1
- package/dist/chunks/{shared-DVAXtJwE.js → shared-CeNV36-9.js} +134 -28
- package/dist/chunks/{shared-UIN_s3sw.js → shared-CjWMknuE.js} +1 -1
- package/dist/chunks/{shared-tkjGdHLh.js → shared-CxTKp5CX.js} +18 -18
- package/dist/chunks/{shared-DKxWTptq.js → shared-CyOyXHQO.js} +1 -1
- package/dist/chunks/{shared-DIEHJb_n.js → shared-D3Xm9wF8.js} +3 -3
- package/dist/chunks/shared-DCnxYUIB.js +3 -0
- package/dist/chunks/{shared-giADQT1w.js → shared-DE09J93T.js} +494 -226
- package/dist/chunks/{shared-Dp6JBc2T.js → shared-DJCdfkg-.js} +1 -1
- package/dist/chunks/{shared-BOQp0U9U.js → shared-Dxf3BUk6.js} +1055 -224
- package/dist/chunks/{shared-DOAi2-QH.js → shared-qLSu7C5m.js} +10 -10
- package/dist/chunks/{shared-CVBp1_S_.js → shared-tq8QsPTt.js} +2 -2
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sync.js +1 -1
- package/dist/views/delegation-poker.js +1 -1
- package/dist/views/plain.js +1 -1
- package/dist/views/prototype.js +1 -1
- package/dist/views/slides.js +1 -1
- package/dist/views/task-board.js +1 -1
- package/dist/views/usm.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-BTu8ZSVC.js +0 -1
- package/dist/chunks/shared-BjLRqdzA.js +0 -6724
- package/dist/chunks/shared-CJZKj_HI.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{s as C,o as O,v as $,E as Vd,T as Yd,n as Zd,K as le,j as x,c as wt,B as W,w as E,k as D,u as yt,A as Qi,t as Qd,U as Xd,q as z,h as H,l as K,J as $t,V as Jd,g as Xi,R as ec,x as ds,y as Ji,z as er,m as nn,C as tr,W as St,X as nr,Y as tc,a as nc,S as cs,i as sc,d as ps,p as sn,Z as ic}from"./shared-CJZKj_HI.js";const sr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],rc=[["path",{d:"M8 3 4 7l4 4"}],["path",{d:"M4 7h16"}],["path",{d:"m16 21 4-4-4-4"}],["path",{d:"M20 17H4"}]],ir=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],oc=[["path",{d:"m16 3 4 4-4 4"}],["path",{d:"M20 7H4"}],["path",{d:"m8 21-4-4 4-4"}],["path",{d:"M4 17h16"}]],rr=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],ac=[["path",{d:"M5 3h14"}],["path",{d:"m18 13-6-6-6 6"}],["path",{d:"M12 7v14"}]],or=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],lc=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]],dc=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}],["path",{d:"m7 16.5-4.74-2.85"}],["path",{d:"m7 16.5 5-3"}],["path",{d:"M7 16.5v5.17"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}],["path",{d:"m17 16.5-5-3"}],["path",{d:"m17 16.5 4.74-2.85"}],["path",{d:"M17 16.5v5.17"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}],["path",{d:"M12 8 7.26 5.15"}],["path",{d:"m12 8 4.74-2.85"}],["path",{d:"M12 13.5V8"}]],cc=[["path",{d:"M20 6 9 17l-5-5"}]],ar=[["path",{d:"m6 9 6 6 6-6"}]],pc=[["path",{d:"m15 18-6-6 6-6"}]],hc=[["path",{d:"m9 18 6-6-6-6"}]],uc=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"12",r:"10"}]],lr=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]],gc=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]],fc=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 21 12"}]],mc=[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"}]],dr=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]],kc=[["path",{d:"M15 6a9 9 0 0 0-9 9V3"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}]],bc=[["circle",{cx:"12",cy:"18",r:"3"}],["circle",{cx:"6",cy:"6",r:"3"}],["circle",{cx:"18",cy:"6",r:"3"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"}],["path",{d:"M12 12v3"}]],vc=[["circle",{cx:"12",cy:"9",r:"1"}],["circle",{cx:"19",cy:"9",r:"1"}],["circle",{cx:"5",cy:"9",r:"1"}],["circle",{cx:"12",cy:"15",r:"1"}],["circle",{cx:"19",cy:"15",r:"1"}],["circle",{cx:"5",cy:"15",r:"1"}]],xc=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]],wc=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}]],cr=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}]],yc=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1"}]],$c=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]],pr=[["path",{d:"M13 5h8"}],["path",{d:"M13 12h8"}],["path",{d:"M13 19h8"}],["path",{d:"m3 17 2 2 4-4"}],["path",{d:"m3 7 2 2 4-4"}]],Sc=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"}],["path",{d:"M15 5.764v15"}],["path",{d:"M9 3.236v15"}]],Ac=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],Ec=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}],["path",{d:"M7 11h10"}],["path",{d:"M7 15h6"}],["path",{d:"M7 7h8"}]],Cc=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]],Tc=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],Rc=[["path",{d:"M5 12h14"}]],Mc=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"}],["path",{d:"M10 19v-3.96 3.15"}],["path",{d:"M7 19h5"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2"}]],Oc=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]],_c=[["path",{d:"M12 2v20"}],["path",{d:"m15 19-3 3-3-3"}],["path",{d:"m19 9 3 3-3 3"}],["path",{d:"M2 12h20"}],["path",{d:"m5 9-3 3 3 3"}],["path",{d:"m9 5 3-3 3 3"}]],Pc=[["path",{d:"m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18"}],["path",{d:"M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z"}],["path",{d:"m3 3 6.586 6.586"}],["circle",{cx:"11",cy:"11",r:"2"}]],Lc=[["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"}]],zc=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],Ic=[["path",{d:"M2 3h20"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3"}],["path",{d:"m7 21 5-5 5 5"}]],Dc=[["path",{d:"m15 14 5-5-5-5"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13"}]],Nc=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]],qc=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]],Uc=[["path",{d:"M12 18v4"}],["path",{d:"M2 14.499a5.5 5.5 0 0 0 9.591 3.675.6.6 0 0 1 .818.001A5.5 5.5 0 0 0 22 14.5c0-2.29-1.5-4-3-5.5l-5.492-5.312a2 2 0 0 0-3-.02L5 8.999c-1.5 1.5-3 3.2-3 5.5"}]],Hc=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]],Bc=[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}]],jc=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]],Fc=[["path",{d:"M9 14 4 9l5-5"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11"}]],Gc=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Wc=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z"}]],rn=globalThis,hs=rn.ShadowRoot&&(rn.ShadyCSS===void 0||rn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,us=Symbol(),hr=new WeakMap;let ur=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==us)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(hs&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=hr.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&hr.set(n,e))}return e}toString(){return this.cssText}};const on=t=>new ur(typeof t=="string"?t:t+"",void 0,us),P=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]);return new ur(n,t,us)},Kc=(t,e)=>{if(hs)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),i=rn.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=n.cssText,t.appendChild(s)}},gr=hs?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return on(n)})(t):t,{is:Vc,defineProperty:Yc,getOwnPropertyDescriptor:Zc,getOwnPropertyNames:Qc,getOwnPropertySymbols:Xc,getPrototypeOf:Jc}=Object,an=globalThis,fr=an.trustedTypes,ep=fr?fr.emptyScript:"",tp=an.reactiveElementPolyfillSupport,At=(t,e)=>t,gs={toAttribute(t,e){switch(e){case Boolean:t=t?ep:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},mr=(t,e)=>!Vc(t,e),kr={attribute:!0,type:String,converter:gs,reflect:!1,useDefault:!1,hasChanged:mr};Symbol.metadata??=Symbol("metadata"),an.litPropertyMetadata??=new WeakMap;let Ye=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=kr){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,n);i!==void 0&&Yc(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=Zc(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:i,set(o){const a=i?.call(this);r?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??kr}static _$Ei(){if(this.hasOwnProperty(At("elementProperties")))return;const e=Jc(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(At("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(At("properties"))){const n=this.properties,s=[...Qc(n),...Xc(n)];for(const i of s)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,i]of n)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const i=this._$Eu(n,s);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)n.unshift(gr(i))}else e!==void 0&&n.push(gr(e));return n}static _$Eu(e,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Kc(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,s){this._$AK(e,s)}_$ET(e,n){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:gs).toAttribute(n,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,n){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:gs;this._$Em=i;const a=o.fromAttribute(n,r.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,n,s,i=!1,r){if(e!==void 0){const o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??mr)(r,n)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:o}=r,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,r,a)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};Ye.elementStyles=[],Ye.shadowRootOptions={mode:"open"},Ye[At("elementProperties")]=new Map,Ye[At("finalized")]=new Map,tp?.({ReactiveElement:Ye}),(an.reactiveElementVersions??=[]).push("2.1.2");const fs=globalThis,br=t=>t,ln=fs.trustedTypes,vr=ln?ln.createPolicy("lit-html",{createHTML:t=>t}):void 0,xr="$lit$",ke=`lit$${Math.random().toFixed(9).slice(2)}$`,wr="?"+ke,np=`<${wr}>`,Ee=document,Et=()=>Ee.createComment(""),Ct=t=>t===null||typeof t!="object"&&typeof t!="function",ms=Array.isArray,sp=t=>ms(t)||typeof t?.[Symbol.iterator]=="function",ks=`[
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
1
|
+
import{s as C,o as O,v as $,E as Qd,U as Xd,n as Jd,K as le,j as x,c as $t,B as W,w as E,k as D,u as St,A as Ji,t as ec,V as tc,q as z,h as H,l as V,J as At,W as nc,g as er,T as sc,x as cs,y as tr,z as nr,m as rn,C as sr,X as Et,Y as ir,Z as ic,a as rc,S as ps,i as oc,d as hs,p as on,_ as ac}from"./shared-DCnxYUIB.js";const rr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],lc=[["path",{d:"M8 3 4 7l4 4"}],["path",{d:"M4 7h16"}],["path",{d:"m16 21 4-4-4-4"}],["path",{d:"M20 17H4"}]],or=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],dc=[["path",{d:"m16 3 4 4-4 4"}],["path",{d:"M20 7H4"}],["path",{d:"m8 21-4-4 4-4"}],["path",{d:"M4 17h16"}]],ar=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],cc=[["path",{d:"M5 3h14"}],["path",{d:"m18 13-6-6-6 6"}],["path",{d:"M12 7v14"}]],lr=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],pc=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]],hc=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}],["path",{d:"m7 16.5-4.74-2.85"}],["path",{d:"m7 16.5 5-3"}],["path",{d:"M7 16.5v5.17"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}],["path",{d:"m17 16.5-5-3"}],["path",{d:"m17 16.5 4.74-2.85"}],["path",{d:"M17 16.5v5.17"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}],["path",{d:"M12 8 7.26 5.15"}],["path",{d:"m12 8 4.74-2.85"}],["path",{d:"M12 13.5V8"}]],uc=[["path",{d:"M10.5 5H19a2 2 0 0 1 2 2v8.5"}],["path",{d:"M17 11h-.5"}],["path",{d:"M19 19H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2"}],["path",{d:"m2 2 20 20"}],["path",{d:"M7 11h4"}],["path",{d:"M7 15h2.5"}]],gc=[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4"}]],fc=[["path",{d:"M20 6 9 17l-5-5"}]],dr=[["path",{d:"m6 9 6 6 6-6"}]],mc=[["path",{d:"m15 18-6-6 6-6"}]],kc=[["path",{d:"m9 18 6-6-6-6"}]],bc=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"12",r:"10"}]],cr=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]],vc=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]],xc=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 21 12"}]],wc=[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"}]],pr=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]],yc=[["path",{d:"M15 6a9 9 0 0 0-9 9V3"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}]],$c=[["circle",{cx:"12",cy:"18",r:"3"}],["circle",{cx:"6",cy:"6",r:"3"}],["circle",{cx:"18",cy:"6",r:"3"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"}],["path",{d:"M12 12v3"}]],Sc=[["circle",{cx:"12",cy:"9",r:"1"}],["circle",{cx:"19",cy:"9",r:"1"}],["circle",{cx:"5",cy:"9",r:"1"}],["circle",{cx:"12",cy:"15",r:"1"}],["circle",{cx:"19",cy:"15",r:"1"}],["circle",{cx:"5",cy:"15",r:"1"}]],Ac=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]],Ec=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}]],hr=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}]],Cc=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1"}]],Tc=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]],ur=[["path",{d:"M13 5h8"}],["path",{d:"M13 12h8"}],["path",{d:"M13 19h8"}],["path",{d:"m3 17 2 2 4-4"}],["path",{d:"m3 7 2 2 4-4"}]],Rc=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"}],["path",{d:"M15 5.764v15"}],["path",{d:"M9 3.236v15"}]],Mc=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],Oc=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"}]],_c=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}],["path",{d:"M7 11h10"}],["path",{d:"M7 15h6"}],["path",{d:"M7 7h8"}]],Pc=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]],Lc=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],zc=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"}]],Ic=[["path",{d:"M5 12h14"}]],Dc=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"}],["path",{d:"M10 19v-3.96 3.15"}],["path",{d:"M7 19h5"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2"}]],Nc=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]],qc=[["path",{d:"M12 2v20"}],["path",{d:"m15 19-3 3-3-3"}],["path",{d:"m19 9 3 3-3 3"}],["path",{d:"M2 12h20"}],["path",{d:"m5 9-3 3 3 3"}],["path",{d:"m9 5 3-3 3 3"}]],Uc=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M15 3v18"}]],Hc=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"}]],Bc=[["path",{d:"m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18"}],["path",{d:"M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z"}],["path",{d:"m3 3 6.586 6.586"}],["circle",{cx:"11",cy:"11",r:"2"}]],jc=[["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"}]],gr=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]],Fc=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],Gc=[["path",{d:"M2 3h20"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3"}],["path",{d:"m7 21 5-5 5 5"}]],Wc=[["path",{d:"m15 14 5-5-5-5"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13"}]],Vc=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]],Kc=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]],Yc=[["path",{d:"M12 18v4"}],["path",{d:"M2 14.499a5.5 5.5 0 0 0 9.591 3.675.6.6 0 0 1 .818.001A5.5 5.5 0 0 0 22 14.5c0-2.29-1.5-4-3-5.5l-5.492-5.312a2 2 0 0 0-3-.02L5 8.999c-1.5 1.5-3 3.2-3 5.5"}]],Zc=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]],Qc=[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}]],Xc=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]],Jc=[["path",{d:"M9 14 4 9l5-5"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11"}]],ep=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"}],["path",{d:"M16 9a5 5 0 0 1 0 6"}]],tp=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"}],["path",{d:"M16 9a5 5 0 0 1 0 6"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728"}]],np=[["path",{d:"M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z"}],["path",{d:"m16.5 14.5 5-5"}],["path",{d:"m16.5 9.5 5 5"}]],sp=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],ip=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z"}]],an=globalThis,us=an.ShadowRoot&&(an.ShadyCSS===void 0||an.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gs=Symbol(),fr=new WeakMap;let mr=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==gs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(us&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=fr.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&fr.set(n,e))}return e}toString(){return this.cssText}};const ln=t=>new mr(typeof t=="string"?t:t+"",void 0,gs),P=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]);return new mr(n,t,gs)},rp=(t,e)=>{if(us)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),i=an.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=n.cssText,t.appendChild(s)}},kr=us?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return ln(n)})(t):t,{is:op,defineProperty:ap,getOwnPropertyDescriptor:lp,getOwnPropertyNames:dp,getOwnPropertySymbols:cp,getPrototypeOf:pp}=Object,dn=globalThis,br=dn.trustedTypes,hp=br?br.emptyScript:"",up=dn.reactiveElementPolyfillSupport,Ct=(t,e)=>t,fs={toAttribute(t,e){switch(e){case Boolean:t=t?hp:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},vr=(t,e)=>!op(t,e),xr={attribute:!0,type:String,converter:fs,reflect:!1,useDefault:!1,hasChanged:vr};Symbol.metadata??=Symbol("metadata"),dn.litPropertyMetadata??=new WeakMap;let Ze=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=xr){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,n);i!==void 0&&ap(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=lp(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:i,set(o){const a=i?.call(this);r?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??xr}static _$Ei(){if(this.hasOwnProperty(Ct("elementProperties")))return;const e=pp(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ct("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ct("properties"))){const n=this.properties,s=[...dp(n),...cp(n)];for(const i of s)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,i]of n)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const i=this._$Eu(n,s);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)n.unshift(kr(i))}else e!==void 0&&n.push(kr(e));return n}static _$Eu(e,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return rp(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,s){this._$AK(e,s)}_$ET(e,n){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:fs).toAttribute(n,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,n){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:fs;this._$Em=i;const a=o.fromAttribute(n,r.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,n,s,i=!1,r){if(e!==void 0){const o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??vr)(r,n)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:o}=r,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,r,a)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};Ze.elementStyles=[],Ze.shadowRootOptions={mode:"open"},Ze[Ct("elementProperties")]=new Map,Ze[Ct("finalized")]=new Map,up?.({ReactiveElement:Ze}),(dn.reactiveElementVersions??=[]).push("2.1.2");const ms=globalThis,wr=t=>t,cn=ms.trustedTypes,yr=cn?cn.createPolicy("lit-html",{createHTML:t=>t}):void 0,$r="$lit$",be=`lit$${Math.random().toFixed(9).slice(2)}$`,Sr="?"+be,gp=`<${Sr}>`,Ee=document,Tt=()=>Ee.createComment(""),Rt=t=>t===null||typeof t!="object"&&typeof t!="function",ks=Array.isArray,fp=t=>ks(t)||typeof t?.[Symbol.iterator]=="function",bs=`[
|
|
2
|
+
\f\r]`,Mt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ar=/-->/g,Er=/>/g,Ce=RegExp(`>|${bs}(?:([^\\s"'>=/]+)(${bs}*=${bs}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Cr=/'/g,Tr=/"/g,Rr=/^(?:script|style|textarea|title)$/i,Mr=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),m=Mr(1),mp=Mr(2),K=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Or=new WeakMap,Te=Ee.createTreeWalker(Ee,129);function _r(t,e){if(!ks(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return yr!==void 0?yr.createHTML(e):e}const kp=(t,e)=>{const n=t.length-1,s=[];let i,r=e===2?"<svg>":e===3?"<math>":"",o=Mt;for(let a=0;a<n;a++){const l=t[a];let p,h,d=-1,f=0;for(;f<l.length&&(o.lastIndex=f,h=o.exec(l),h!==null);)f=o.lastIndex,o===Mt?h[1]==="!--"?o=Ar:h[1]!==void 0?o=Er:h[2]!==void 0?(Rr.test(h[2])&&(i=RegExp("</"+h[2],"g")),o=Ce):h[3]!==void 0&&(o=Ce):o===Ce?h[0]===">"?(o=i??Mt,d=-1):h[1]===void 0?d=-2:(d=o.lastIndex-h[2].length,p=h[1],o=h[3]===void 0?Ce:h[3]==='"'?Tr:Cr):o===Tr||o===Cr?o=Ce:o===Ar||o===Er?o=Mt:(o=Ce,i=void 0);const c=o===Ce&&t[a+1].startsWith("/>")?" ":"";r+=o===Mt?l+gp:d>=0?(s.push(p),l.slice(0,d)+$r+l.slice(d)+be+c):l+be+(d===-2?a:c)}return[_r(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let vs=class Kd{constructor({strings:e,_$litType$:n},s){let i;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[p,h]=kp(e,n);if(this.el=Kd.createElement(p,s),Te.currentNode=this.el.content,n===2||n===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Te.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith($r)){const f=h[o++],c=i.getAttribute(d).split(be),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:g[2],strings:c,ctor:g[1]==="."?vp:g[1]==="?"?xp:g[1]==="@"?wp:hn}),i.removeAttribute(d)}else d.startsWith(be)&&(l.push({type:6,index:r}),i.removeAttribute(d));if(Rr.test(i.tagName)){const d=i.textContent.split(be),f=d.length-1;if(f>0){i.textContent=cn?cn.emptyScript:"";for(let c=0;c<f;c++)i.append(d[c],Tt()),Te.nextNode(),l.push({type:2,index:++r});i.append(d[f],Tt())}}}else if(i.nodeType===8)if(i.data===Sr)l.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf(be,d+1))!==-1;)l.push({type:7,index:r}),d+=be.length-1}r++}}static createElement(e,n){const s=Ee.createElement("template");return s.innerHTML=e,s}};function Qe(t,e,n=t,s){if(e===K)return e;let i=s!==void 0?n._$Co?.[s]:n._$Cl;const r=Rt(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(t),i._$AT(t,n,s)),s!==void 0?(n._$Co??=[])[s]=i:n._$Cl=i),i!==void 0&&(e=Qe(t,i._$AS(t,e.values),i,s)),e}let bp=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:s}=this._$AD,i=(e?.creationScope??Ee).importNode(n,!0);Te.currentNode=i;let r=Te.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let p;l.type===2?p=new pn(r,r.nextSibling,this,e):l.type===1?p=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(p=new yp(r,this,e)),this._$AV.push(p),l=s[++a]}o!==l?.index&&(r=Te.nextNode(),o++)}return Te.currentNode=Ee,i}p(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}},pn=class Yd{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,i){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=Qe(this,e,n),Rt(e)?e===b||e==null||e===""?(this._$AH!==b&&this._$AR(),this._$AH=b):e!==this._$AH&&e!==K&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):fp(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==b&&Rt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ee.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=vs.createElement(_r(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const r=new bp(i,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Or.get(e.strings);return n===void 0&&Or.set(e.strings,n=new vs(e)),n}k(e){ks(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const r of e)i===n.length?n.push(s=new Yd(this.O(Tt()),this.O(Tt()),this,this.options)):s=n[i],s._$AI(r),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=wr(e).nextSibling;wr(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class hn{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,i,r){this.type=1,this._$AH=b,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=b}_$AI(e,n=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=Qe(this,e,n,0),o=!Rt(e)||e!==this._$AH&&e!==K,o&&(this._$AH=e);else{const a=e;let l,p;for(e=r[0],l=0;l<r.length-1;l++)p=Qe(this,a[s+l],n,l),p===K&&(p=this._$AH[l]),o||=!Rt(p)||p!==this._$AH[l],p===b?e=b:e!==b&&(e+=(p??"")+r[l+1]),this._$AH[l]=p}o&&!i&&this.j(e)}j(e){e===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let vp=class extends hn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===b?void 0:e}},xp=class extends hn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==b)}},wp=class extends hn{constructor(e,n,s,i,r){super(e,n,s,i,r),this.type=5}_$AI(e,n=this){if((e=Qe(this,e,n,0)??b)===K)return;const s=this._$AH,i=e===b&&s!==b||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==b&&(s===b||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class yp{constructor(e,n,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Qe(this,e)}}const $p={I:pn},Sp=ms.litHtmlPolyfillSupport;Sp?.(vs,pn),(ms.litHtmlVersions??=[]).push("3.3.3");const Pr=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const r=n?.renderBefore??null;s._$litPart$=i=new pn(e.insertBefore(Tt(),r),r,void 0,n??{})}return i._$AI(t),i},xs=globalThis;let X=class extends Ze{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Pr(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return K}};X._$litElement$=!0,X.finalized=!0,xs.litElementHydrateSupport?.({LitElement:X});const Ap=xs.litElementPolyfillSupport;Ap?.({LitElement:X}),(xs.litElementVersions??=[]).push("4.2.2");const Lr=(t,e,n,s)=>{if(typeof window>"u")return;const i=Reflect.get(window,"devProcessKit"),r=ws(i)&&i.views.length>0&&e.length===0?{version:t,views:i.views,versionParam:n,entryUrl:i.entryUrl}:{version:t,views:ws(i)?[...new Set([...i.views,...e])]:e,versionParam:n,entryUrl:s};Object.assign(window,{devProcessKit:r})},ws=t=>typeof t=="object"&&t!==null&&typeof Reflect.get(t,"entryUrl")=="string"&&Array.isArray(Reflect.get(t,"views")),zr=()=>{if(typeof window>"u")return null;const t=Reflect.get(window,"devProcessKit");return ws(t)?t.entryUrl:null};class un{#e;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){document.addEventListener("pointerdown",this.#s,!0),document.addEventListener("keydown",this.#t)}hostDisconnected(){document.removeEventListener("pointerdown",this.#s,!0),document.removeEventListener("keydown",this.#t)}#s=e=>{e.button!==0||!this.#e.open()||this.#e.closesOn(e.composedPath())&&this.#e.dismiss()};#t=e=>{e.key!=="Escape"||e.isComposing||e.defaultPrevented||!this.#e.open()||this.#e.ownsEscape(e.composedPath())&&(e.preventDefault(),this.#e.dismiss())}}const Ir=P`
|
|
4
4
|
.dpk-context-menu {
|
|
5
5
|
min-width: 180px;
|
|
6
6
|
}
|
|
@@ -39,7 +39,7 @@ import{s as C,o as O,v as $,E as Vd,T as Yd,n as Zd,K as le,j as x,c as wt,B as
|
|
|
39
39
|
left: 100%;
|
|
40
40
|
z-index: 1;
|
|
41
41
|
}
|
|
42
|
-
`,
|
|
42
|
+
`,Dr=P`
|
|
43
43
|
.dpk-dialog {
|
|
44
44
|
box-sizing: border-box;
|
|
45
45
|
/* One column as wide as the panel: a long label wraps instead of widening it. */
|
|
@@ -218,9 +218,9 @@ import{s as C,o as O,v as $,E as Vd,T as Yd,n as Zd,K as le,j as x,c as wt,B as
|
|
|
218
218
|
.dpk-dialog-footer[hidden] {
|
|
219
219
|
display: none;
|
|
220
220
|
}
|
|
221
|
-
`,zr=(t,e,n)=>n.top<e.top?t+n.top-e.top:n.bottom<=e.bottom?t:t+Math.min(n.bottom-e.bottom,n.top-e.top),Ir=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},ws=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=zr(t.scrollTop,Ir(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},Dr=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=zr(t.scrollLeft,Ir(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},gp=16,fp=(t,e)=>{const n=t.deltaMode===1?gp:t.deltaMode===2?e:1;return{dx:t.deltaX*n,dy:t.deltaY*n}},mp=(t,e)=>{if(e.ctrlKey)return!1;const n=t.scrollHeight>t.clientHeight,s=t.scrollWidth>t.clientWidth;if(!n&&!s)return!1;const{dx:i,dy:r}=fp(e,t.clientHeight),o=Math.min(Math.max(t.scrollTop+r,0),t.scrollHeight-t.clientHeight),a=Math.min(Math.max(t.scrollLeft+i,0),t.scrollWidth-t.clientWidth);return o===t.scrollTop&&a===t.scrollLeft?!1:(t.scrollTop=o,t.scrollLeft=a,!0)},Nr="dev-process-kit:action-writer",kp=O({writer:$(x(),le(/^[A-Za-z0-9_-]+$/)),seq:$(Zd(),Yd(),Vd(0))}),bp=()=>{const t=globalThis.crypto,e=new Uint8Array(8);if(t?.getRandomValues)t.getRandomValues(e);else for(let n=0;n<e.length;n+=1)e[n]=Math.floor(Math.random()*256);return[...e].map(n=>(n%36).toString(36)).join("")},vp=t=>{if(t===null)return null;try{const e=C(kp,JSON.parse(t));return e.success?e.output:null}catch{return null}},xp=t=>{let e=null;return()=>{let n=null;try{n=t===null?null:vp(t.getItem(Nr))}catch{}const s=n!==null&&e!==null&&n.writer===e.writer&&e.seq>n.seq?e:n??e??{writer:bp(),seq:0},i={writer:s.writer,seq:s.seq+1};e=i;try{t?.setItem(Nr,JSON.stringify(i))}catch{}return`${i.writer}:${i.seq}`}},wp=()=>{try{return typeof localStorage>"u"?null:localStorage}catch{return null}};let qr=null;const hn=()=>(qr??=xp(wp()),qr()),_=t=>`${t.type}:${t.id}`,Re=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},un=(t,e)=>typeof t=="string"?Re(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},yp=(t,e)=>t.type===e.type&&t.id===e.id,Ur=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},$p=(t,e)=>{const n=Ur(t),s=new Set(e);if(!s.has(n))return n;for(let i=2;i<1e3;i+=1){const r=`${n}-${i}`;if(!s.has(r))return r}return`${n}-${Math.random().toString(36).slice(2,8)}`},I="comment",Me=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},Hr=O({type:$(x(),E(1)),target:Qi([$(x(),E(1)),Qd]),payload:D(yt()),note:W(x()),id:W($(x(),E(1))),createdAt:W($(x(),E(1)))}),Sp=(t,e)=>{const n=C(Hr,t);if(!n.success)return{ok:!1,issue:Me(n.issues)};const s=n.output,i=un(s.target,e.targetType),r={id:s.id??hn(),type:s.type,target:i,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,r);if(!o.success)return{ok:!1,issue:Me(o.issues)};const a=C(wt,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:Me(a.issues)}},ys=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${_(t.target)}`,Br=(t,e,n)=>{const s=ys(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||i.type!==e.type||ys(i,n)!==s||!Ap(i,e)?[...t,e]:[...t.slice(0,-1),e]},Ap=(t,e)=>yp(t.target,e.target),$s=t=>JSON.stringify(t.map(e=>({id:e.id,type:e.type,target:e.target,payload:e.payload,...e.note===void 0?{}:{note:e.note},createdAt:e.createdAt})),null,2),Oe=new Map,Ep=/^([A-Za-z0-9_-]+):([1-9][0-9]*)$/,Cp=/^([A-Za-z0-9_-]+):([1-9][0-9]*)(?:-([1-9][0-9]*))?$/,Ss=t=>{const e=Ep.exec(t);if(e===null)return null;const n=Number(e[2]);return Number.isSafeInteger(n)?{writer:e[1]??"",seq:n}:null},Tp=t=>{const e=[...t].sort((s,i)=>s[0]-i[0]),n=[];for(const[s,i]of e){const r=n.at(-1);r!==void 0&&s<=r[1]+1?r[1]=Math.max(r[1],i):n.push([s,i])}return n},jr=(t,e,n)=>{const s=new Map(t);return s.set(e,Tp([...t.get(e)??[],...n])),s},Rp=t=>{let e=Oe;for(const n of t.split(",")){const s=n.trim();if(s.length===0)continue;const i=Cp.exec(s);if(i===null)return`"${s}" is not written "writer:from-to"`;const r=Number(i[2]),o=i[3]===void 0?r:Number(i[3]);if(!Number.isSafeInteger(r)||!Number.isSafeInteger(o))return`"${s}" is out of range`;if(o<r)return`"${s}" ends before it starts`;e=jr(e,i[1]??"",[[r,o]])}return e},Mp=t=>[...t.keys()].sort().flatMap(e=>(t.get(e)??[]).map(([n,s])=>n===s?`${e}:${n}`:`${e}:${n}-${s}`)).join(","),As=(t,e)=>{const n=Ss(e);return n===null?!1:(t.get(n.writer)??[]).some(([s,i])=>n.seq>=s&&n.seq<=i)},Op=(t,e)=>{const n=new Map;for(const i of e){const r=Ss(i);r!==null&&n.set(r.writer,Math.max(n.get(r.writer)??0,r.seq))}let s=t;for(const[i,r]of n)s=jr(s,i,[[1,r]]);return s},Rt=Object.freeze({}),gn=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Rt;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[i,r]of n)i.length>0&&r.length>0&&(s[i]=r);return s},Qe=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((i,r)=>i<r?-1:i>r?1:0)){const i=t[s];i!=null&&i!==""&&e.set(s,i)}const n=e.toString();return n.length===0?"":`#${n}`},fn=(t,e,n=[])=>{const s={...t},i=Object.keys(e).map(r=>n.indexOf(r)).filter(r=>r>=0);if(i.length>0)for(const r of n.slice(Math.min(...i)+1))Object.hasOwn(e,r)||delete s[r];for(const[r,o]of Object.entries(e))o==null||o===""?delete s[r]:s[r]=o;return s},Fr="data-dpk-changes",_p=/^[^:\s]+:\S+$/,Pp=z({id:D($(x(),E(1))),title:$(x(),E(1)),body:D(x()),target:D($(x(),le(_p,'target must be written "type:id"'))),navigate:D($(x(),Jd("=",'navigate must be written "key=value"')))}),Lp=H(Pp),zp=$(x(),E(1)),Gr=D(x()),Wr=z({revision:zp,changes:Lp,addressed:Gr}),Ip=z({addressed:Gr,revisions:$(H(Wr),E(1,"list at least one version"))}),Dp=(t,e)=>JSON.stringify([t,e]),Xe=t=>[...t.earlier,t.latest],Np=t=>{const e=t.changes.map((s,i)=>{const r=s.id??String(i);return{key:Dp(t.revision,r),id:r,revision:t.revision,title:s.title,body:s.body??null,target:s.target??null,navigate:s.navigate??null}});return new Set(e.map(s=>s.id)).size!==e.length?`change ids must be unique within version "${t.revision}"`:{revision:t.revision,entries:e}},qp=t=>{const n=typeof t=="object"&&t!==null&&"revisions"in t?C(Ip,t):C(Wr,t);if(!n.success)return{ok:!1,error:Xd(n.issues)};const s=n.output,i=s.addressed===void 0?Oe:Rp(s.addressed);if(typeof i=="string")return{ok:!1,error:`addressed: ${i}`};const r="revisions"in s?s.revisions:[s],o=[];for(const l of r){if(o.some(h=>h.revision===l.revision))return{ok:!1,error:`version "${l.revision}" is listed twice`};const p=Np(l);if(typeof p=="string")return{ok:!1,error:p};o.push(p)}const a=o.pop();return a?{ok:!0,log:{earlier:o,latest:a,addressed:i}}:{ok:!1,error:"list at least one version"}},Up=z({v:K(1),revision:x(),seen:H(x())}),Hp=z({v:K(2),since:x(),seen:$t(x(),H(x()))}),Kr=t=>{const e=C(Hp,t);if(e.success)return e.output;const n=C(Up,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},Es={open:!1,fresh:new Set},Vr=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),Cs=(t,e)=>Xe(t).flatMap(n=>n.entries.filter(Vr(e))),Yr=t=>t.target!==null||t.navigate!==null,Bp=(t,e)=>{const n=Xe(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),i=e===null?[t.latest]:n.slice(Math.max(0,s)),r=new Set(i.flatMap(o=>{const a=new Set(e?.seen[o.revision]??[]);return o.entries.filter(l=>a.has(l.id)).map(l=>l.key)}));return{told:new Set(i.map(o=>o.revision)),seen:r,toasts:t.latest.entries.filter(o=>!r.has(o.key)).map(o=>o.key),list:Es}},Ts=(t,e)=>new Set([...t.seen,...e]),jp=(t,e,n)=>{switch(n.kind){case"open-list":{const s=Cs(t,e),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!Yr(o)).map(o=>o.key);return{...e,seen:Ts(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:Es};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:Ts(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:Es};case"read-all":return{...e,seen:Ts(e,Cs(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},Fp=(t,e)=>Cs(t,e).length,Gp=(t,e)=>{const n=Xe(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(Vr(e))),i=s===-1?n.length-1:s,r=n.slice(i).flatMap(o=>{const a=o.entries.filter(l=>e.seen.has(l.key)).map(l=>l.id);return a.length>0?[[o.revision,a]]:[]});return{v:2,since:n[i]?.revision??t.latest.revision,seen:Object.fromEntries(r)}},Wp=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?gn(t.navigate):t.target!==null?e(Re(t.target)):null,target:t.target},Zr=3,Kp=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:Yr(e),fresh:t.list.fresh.has(e.key)}),Vp=(t,e)=>{const n=Xe(t).map(r=>({revision:r.revision,latest:r===t.latest,cards:r.entries.map(Kp(e))})).reverse(),s=new Map(n.flatMap(r=>r.cards.map(o=>[o.key,o]))),i=e.toasts.flatMap(r=>{const o=s.get(r);return o?[o]:[]});return{unread:Fp(t,e),open:e.list.open,groups:n,toasts:i.slice(0,Zr),waiting:Math.max(0,i.length-Zr)}},Yp=z({revision:Qi([x(),ec()])}),Zp=z({v:K(1),enabled:Xi(),checked:$t(x(),Yp)}),Rs={v:1,enabled:!1,checked:{}},Qr=t=>{const e=C(Zp,t);return e.success?e.output:null},Qp=(t,e)=>e?{...t,enabled:!0}:{...Rs,enabled:!1},Xp=t=>t===null?null:t.latest.revision,Xr=(t,e,n)=>{const s=t.checked[e];if(!s)return"unchecked";if(n===null||s.revision===null)return"checked";const i=Xe(n),r=i.findIndex(l=>l.revision===s.revision);return(r===-1?i:i.slice(r+1)).some(l=>l.entries.some(p=>p.target===e))?"stale":"checked"},Jp=t=>Object.keys(t.checked).length>0,eh=(t,e,n,s)=>{if(n==="checked"){const{[e]:i,...r}=t.checked;return{...t,checked:r}}return{...t,checked:{...t.checked,[e]:{revision:s}}}},_e=t=>t==="light"||t==="dark"?t:null,Jr=t=>t.authored??t.environment,eo=t=>t.preference??Jr(t),th=t=>{const e=eo(t)==="dark"?"light":"dark";return to(t,e)},to=(t,e)=>e===Jr(t)?null:e,Ms="element",no=$(x(),le(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),so=$t(x(),yt()),nh=O({type:K(Ms),id:$(x(),le(/^[^/]+\/.+/,"component references start with a provider id"))}),sh=O({id:$(x(),E(1)),type:no,target:nh,payload:so,note:W(x()),createdAt:$(x(),E(1))}),ih={schema:sh,mode:"sequence",targetType:Ms},rh=z({type:no,target:$(x(),le(/^element:[^/]+\/.+/)),payload:D(so,{})}),io=z({id:$(x(),E(1)),title:$(x(),E(1)),summary:W(x()),tone:W(ds(["create","update","delete","move","meta"])),stale:W(ds(["unsupported-action-type","target-missing","constraint-violated"]))}),Mt=t=>{if(t.type!==Ms)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},ne=t=>t.type!==I&&Mt(t.target)!==null,ro=(t,e)=>t.filter(n=>ne(n)&&Mt(n.target)===e),oh=(t,e)=>t.filter(n=>n.type===I&&Mt(n.target)===e),oo=(t,e)=>{const n=new Map(t.flatMap(s=>ne(s)?[[s.id,Mt(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},ao=H(z({value:$(x(),le(/^element:.+/)),label:$(x(),E(1)),group:W(x())})),ah=O({targets:ao,providers:H(O({id:$(x(),E(1)),results:H(io)}))}),lh=z({target:$(x(),le(/^element:.+/)),body:$(x(),Ji(),E(1))}),lo=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,co=(t,e,n)=>{const s=new Map(e.map(i=>[i.value,i]));return{...t,hasTarget:(i,r)=>t.hasTarget(i,r)||s.has(_(r)),commentTargets:(i,r)=>{const o=t.commentTargets(i,r),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(i,r,o)=>{if(ne(i)){const p=n.get(i.id),h=s.get(_(i.target));return{title:p?.title??i.type,...p?.summary===void 0?{}:{summary:p.summary},tone:p?.tone??"update",targetLabel:h?lo(h):i.target.id}}const a=t.describe(i,r,o),l=i.type==="comment"&&!t.hasTarget(r,i.target)?s.get(_(i.target)):void 0;return l===void 0?a:{...a,targetLabel:lo(l)}},serialize:i=>ne(i)?`${i.type} ${_(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}};let dh=0;class po{#e;#n=`dpk-confirm-dialog-${++dh}`;#s=null;#t=null;#i=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){}hostUpdated(){if(!this.#i)return;const e=this.#r();e&&!e.open&&(e.showModal(),this.#i=!1)}hostDisconnected(){this.#a(!1)}ask(e){return this.#a(!1),this.#s=e,this.#i=!0,this.#e.requestUpdate(),new Promise(n=>{this.#t=n})}render(){if(this.#s===null)return b;const{title:e,body:n,confirmLabel:s,cancelLabel:i,tone:r}=this.#s;return m`
|
|
222
|
-
<dialog class="dpk-confirm-dialog" data-dpk-confirm-dialog=${this.#
|
|
223
|
-
<form method="dialog" class="dpk-confirm-dialog-body">
|
|
221
|
+
`,Nr=(t,e,n)=>n.top<e.top?t+n.top-e.top:n.bottom<=e.bottom?t:t+Math.min(n.bottom-e.bottom,n.top-e.top),qr=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},ys=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=Nr(t.scrollTop,qr(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},Ur=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=Nr(t.scrollLeft,qr(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},Ep=16,Cp=(t,e)=>{const n=t.deltaMode===1?Ep:t.deltaMode===2?e:1;return{dx:t.deltaX*n,dy:t.deltaY*n}},Tp=(t,e)=>{if(e.ctrlKey)return!1;const n=t.scrollHeight>t.clientHeight,s=t.scrollWidth>t.clientWidth;if(!n&&!s)return!1;const{dx:i,dy:r}=Cp(e,t.clientHeight),o=Math.min(Math.max(t.scrollTop+r,0),t.scrollHeight-t.clientHeight),a=Math.min(Math.max(t.scrollLeft+i,0),t.scrollWidth-t.clientWidth);return o===t.scrollTop&&a===t.scrollLeft?!1:(t.scrollTop=o,t.scrollLeft=a,!0)},Hr="dev-process-kit:action-writer",Rp=O({writer:$(x(),le(/^[A-Za-z0-9_-]+$/)),seq:$(Jd(),Xd(),Qd(0))}),Mp=()=>{const t=globalThis.crypto,e=new Uint8Array(8);if(t?.getRandomValues)t.getRandomValues(e);else for(let n=0;n<e.length;n+=1)e[n]=Math.floor(Math.random()*256);return[...e].map(n=>(n%36).toString(36)).join("")},Op=t=>{if(t===null)return null;try{const e=C(Rp,JSON.parse(t));return e.success?e.output:null}catch{return null}},_p=t=>{let e=null;return()=>{let n=null;try{n=t===null?null:Op(t.getItem(Hr))}catch{}const s=n!==null&&e!==null&&n.writer===e.writer&&e.seq>n.seq?e:n??e??{writer:Mp(),seq:0},i={writer:s.writer,seq:s.seq+1};e=i;try{t?.setItem(Hr,JSON.stringify(i))}catch{}return`${i.writer}:${i.seq}`}},Pp=()=>{try{return typeof localStorage>"u"?null:localStorage}catch{return null}};let Br=null;const gn=()=>(Br??=_p(Pp()),Br()),_=t=>`${t.type}:${t.id}`,Re=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},fn=(t,e)=>typeof t=="string"?Re(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Lp=(t,e)=>t.type===e.type&&t.id===e.id,jr=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},zp=(t,e)=>{const n=jr(t),s=new Set(e);if(!s.has(n))return n;for(let i=2;i<1e3;i+=1){const r=`${n}-${i}`;if(!s.has(r))return r}return`${n}-${Math.random().toString(36).slice(2,8)}`},I="comment",Me=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},Fr=O({type:$(x(),E(1)),target:Ji([$(x(),E(1)),ec]),payload:D(St()),note:W(x()),id:W($(x(),E(1))),createdAt:W($(x(),E(1)))}),Ip=(t,e)=>{const n=C(Fr,t);if(!n.success)return{ok:!1,issue:Me(n.issues)};const s=n.output,i=fn(s.target,e.targetType),r={id:s.id??gn(),type:s.type,target:i,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,r);if(!o.success)return{ok:!1,issue:Me(o.issues)};const a=C($t,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:Me(a.issues)}},$s=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${_(t.target)}`,Gr=(t,e,n)=>{const s=$s(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||i.type!==e.type||$s(i,n)!==s||!Dp(i,e)?[...t,e]:[...t.slice(0,-1),e]},Dp=(t,e)=>Lp(t.target,e.target),Ss=t=>JSON.stringify(t.map(e=>({id:e.id,type:e.type,target:e.target,payload:e.payload,...e.note===void 0?{}:{note:e.note},createdAt:e.createdAt})),null,2),Oe=new Map,Np=/^([A-Za-z0-9_-]+):([1-9][0-9]*)$/,qp=/^([A-Za-z0-9_-]+):([1-9][0-9]*)(?:-([1-9][0-9]*))?$/,As=t=>{const e=Np.exec(t);if(e===null)return null;const n=Number(e[2]);return Number.isSafeInteger(n)?{writer:e[1]??"",seq:n}:null},Up=t=>{const e=[...t].sort((s,i)=>s[0]-i[0]),n=[];for(const[s,i]of e){const r=n.at(-1);r!==void 0&&s<=r[1]+1?r[1]=Math.max(r[1],i):n.push([s,i])}return n},Wr=(t,e,n)=>{const s=new Map(t);return s.set(e,Up([...t.get(e)??[],...n])),s},Hp=t=>{let e=Oe;for(const n of t.split(",")){const s=n.trim();if(s.length===0)continue;const i=qp.exec(s);if(i===null)return`"${s}" is not written "writer:from-to"`;const r=Number(i[2]),o=i[3]===void 0?r:Number(i[3]);if(!Number.isSafeInteger(r)||!Number.isSafeInteger(o))return`"${s}" is out of range`;if(o<r)return`"${s}" ends before it starts`;e=Wr(e,i[1]??"",[[r,o]])}return e},Bp=t=>[...t.keys()].sort().flatMap(e=>(t.get(e)??[]).map(([n,s])=>n===s?`${e}:${n}`:`${e}:${n}-${s}`)).join(","),Es=(t,e)=>{const n=As(e);return n===null?!1:(t.get(n.writer)??[]).some(([s,i])=>n.seq>=s&&n.seq<=i)},jp=(t,e)=>{const n=new Map;for(const i of e){const r=As(i);r!==null&&n.set(r.writer,Math.max(n.get(r.writer)??0,r.seq))}let s=t;for(const[i,r]of n)s=Wr(s,i,[[1,r]]);return s},Ot=Object.freeze({}),mn=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Ot;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[i,r]of n)i.length>0&&r.length>0&&(s[i]=r);return s},Xe=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((i,r)=>i<r?-1:i>r?1:0)){const i=t[s];i!=null&&i!==""&&e.set(s,i)}const n=e.toString();return n.length===0?"":`#${n}`},kn=(t,e,n=[])=>{const s={...t},i=Object.keys(e).map(r=>n.indexOf(r)).filter(r=>r>=0);if(i.length>0)for(const r of n.slice(Math.min(...i)+1))Object.hasOwn(e,r)||delete s[r];for(const[r,o]of Object.entries(e))o==null||o===""?delete s[r]:s[r]=o;return s},Vr="data-dpk-changes",Fp=/^[^:\s]+:\S+$/,Gp=z({id:D($(x(),E(1))),title:$(x(),E(1)),body:D(x()),target:D($(x(),le(Fp,'target must be written "type:id"'))),navigate:D($(x(),nc("=",'navigate must be written "key=value"')))}),Wp=H(Gp),Vp=$(x(),E(1)),Kr=D(x()),Yr=z({revision:Vp,changes:Wp,addressed:Kr}),Kp=z({addressed:Kr,revisions:$(H(Yr),E(1,"list at least one version"))}),Yp=(t,e)=>JSON.stringify([t,e]),Je=t=>[...t.earlier,t.latest],Zp=t=>{const e=t.changes.map((s,i)=>{const r=s.id??String(i);return{key:Yp(t.revision,r),id:r,revision:t.revision,title:s.title,body:s.body??null,target:s.target??null,navigate:s.navigate??null}});return new Set(e.map(s=>s.id)).size!==e.length?`change ids must be unique within version "${t.revision}"`:{revision:t.revision,entries:e}},Qp=t=>{const n=typeof t=="object"&&t!==null&&"revisions"in t?C(Kp,t):C(Yr,t);if(!n.success)return{ok:!1,error:tc(n.issues)};const s=n.output,i=s.addressed===void 0?Oe:Hp(s.addressed);if(typeof i=="string")return{ok:!1,error:`addressed: ${i}`};const r="revisions"in s?s.revisions:[s],o=[];for(const l of r){if(o.some(h=>h.revision===l.revision))return{ok:!1,error:`version "${l.revision}" is listed twice`};const p=Zp(l);if(typeof p=="string")return{ok:!1,error:p};o.push(p)}const a=o.pop();return a?{ok:!0,log:{earlier:o,latest:a,addressed:i}}:{ok:!1,error:"list at least one version"}},Xp=z({v:V(1),revision:x(),seen:H(x())}),Jp=z({v:V(2),since:x(),seen:At(x(),H(x()))}),Zr=t=>{const e=C(Jp,t);if(e.success)return e.output;const n=C(Xp,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},Cs={open:!1,fresh:new Set},Qr=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),Ts=(t,e)=>Je(t).flatMap(n=>n.entries.filter(Qr(e))),Xr=t=>t.target!==null||t.navigate!==null,eh=(t,e)=>{const n=Je(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),i=e===null?[t.latest]:n.slice(Math.max(0,s)),r=new Set(i.flatMap(o=>{const a=new Set(e?.seen[o.revision]??[]);return o.entries.filter(l=>a.has(l.id)).map(l=>l.key)}));return{told:new Set(i.map(o=>o.revision)),seen:r,toasts:t.latest.entries.filter(o=>!r.has(o.key)).map(o=>o.key),list:Cs}},Rs=(t,e)=>new Set([...t.seen,...e]),th=(t,e,n)=>{switch(n.kind){case"open-list":{const s=Ts(t,e),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!Xr(o)).map(o=>o.key);return{...e,seen:Rs(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:Cs};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:Rs(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:Cs};case"read-all":return{...e,seen:Rs(e,Ts(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},nh=(t,e)=>Ts(t,e).length,sh=(t,e)=>{const n=Je(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(Qr(e))),i=s===-1?n.length-1:s,r=n.slice(i).flatMap(o=>{const a=o.entries.filter(l=>e.seen.has(l.key)).map(l=>l.id);return a.length>0?[[o.revision,a]]:[]});return{v:2,since:n[i]?.revision??t.latest.revision,seen:Object.fromEntries(r)}},ih=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?mn(t.navigate):t.target!==null?e(Re(t.target)):null,target:t.target},Jr=3,rh=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:Xr(e),fresh:t.list.fresh.has(e.key)}),oh=(t,e)=>{const n=Je(t).map(r=>({revision:r.revision,latest:r===t.latest,cards:r.entries.map(rh(e))})).reverse(),s=new Map(n.flatMap(r=>r.cards.map(o=>[o.key,o]))),i=e.toasts.flatMap(r=>{const o=s.get(r);return o?[o]:[]});return{unread:nh(t,e),open:e.list.open,groups:n,toasts:i.slice(0,Jr),waiting:Math.max(0,i.length-Jr)}},ah=z({revision:Ji([x(),sc()])}),lh=z({v:V(1),enabled:er(),checked:At(x(),ah)}),Ms={v:1,enabled:!1,checked:{}},eo=t=>{const e=C(lh,t);return e.success?e.output:null},dh=(t,e)=>e?{...t,enabled:!0}:{...Ms,enabled:!1},ch=t=>t===null?null:t.latest.revision,to=(t,e,n)=>{const s=t.checked[e];if(!s)return"unchecked";if(n===null||s.revision===null)return"checked";const i=Je(n),r=i.findIndex(l=>l.revision===s.revision);return(r===-1?i:i.slice(r+1)).some(l=>l.entries.some(p=>p.target===e))?"stale":"checked"},ph=t=>Object.keys(t.checked).length>0,hh=(t,e,n,s)=>{if(n==="checked"){const{[e]:i,...r}=t.checked;return{...t,checked:r}}return{...t,checked:{...t.checked,[e]:{revision:s}}}},_e=t=>t==="light"||t==="dark"?t:null,no=t=>t.authored??t.environment,so=t=>t.preference??no(t),uh=t=>{const e=so(t)==="dark"?"light":"dark";return io(t,e)},io=(t,e)=>e===no(t)?null:e,Os="element",ro=$(x(),le(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),oo=At(x(),St()),gh=O({type:V(Os),id:$(x(),le(/^[^/]+\/.+/,"component references start with a provider id"))}),fh=O({id:$(x(),E(1)),type:ro,target:gh,payload:oo,note:W(x()),createdAt:$(x(),E(1))}),mh={schema:fh,mode:"sequence",targetType:Os},kh=z({type:ro,target:$(x(),le(/^element:[^/]+\/.+/)),payload:D(oo,{})}),ao=z({id:$(x(),E(1)),title:$(x(),E(1)),summary:W(x()),tone:W(cs(["create","update","delete","move","meta"])),stale:W(cs(["unsupported-action-type","target-missing","constraint-violated"]))}),_t=t=>{if(t.type!==Os)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},ne=t=>t.type!==I&&_t(t.target)!==null,lo=(t,e)=>t.filter(n=>ne(n)&&_t(n.target)===e),bh=(t,e)=>t.filter(n=>n.type===I&&_t(n.target)===e),co=(t,e)=>{const n=new Map(t.flatMap(s=>ne(s)?[[s.id,_t(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},po=H(z({value:$(x(),le(/^element:.+/)),label:$(x(),E(1)),group:W(x())})),vh=O({targets:po,providers:H(O({id:$(x(),E(1)),results:H(ao)}))}),xh=z({target:$(x(),le(/^element:.+/)),body:$(x(),tr(),E(1))}),ho=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,uo=(t,e,n)=>{const s=new Map(e.map(i=>[i.value,i]));return{...t,hasTarget:(i,r)=>t.hasTarget(i,r)||s.has(_(r)),commentTargets:(i,r)=>{const o=t.commentTargets(i,r),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(i,r,o)=>{if(ne(i)){const p=n.get(i.id),h=s.get(_(i.target));return{title:p?.title??i.type,...p?.summary===void 0?{}:{summary:p.summary},tone:p?.tone??"update",targetLabel:h?ho(h):i.target.id}}const a=t.describe(i,r,o),l=i.type==="comment"&&!t.hasTarget(r,i.target)?s.get(_(i.target)):void 0;return l===void 0?a:{...a,targetLabel:ho(l)}},serialize:i=>ne(i)?`${i.type} ${_(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},wh=t=>typeof t.showModal=="function",Pt=t=>{const e=t.open;return typeof e=="boolean"?e:t.hasAttribute("open")},go=t=>{if(wh(t)){t.showModal();return}t.setAttribute("open","")},_s=t=>{if(typeof t.close=="function"){t.close();return}Pt(t)&&(t.removeAttribute("open"),t.dispatchEvent(new Event("close")))};let yh=0;class fo{#e;#s=`dpk-confirm-dialog-${++yh}`;#t=null;#n=null;#i=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){}hostUpdated(){if(!this.#i)return;const e=this.#r();e&&!Pt(e)&&(go(e),this.#i=!1)}hostDisconnected(){this.#l(!1)}ask(e){return this.#l(!1),this.#t=e,this.#i=!0,this.#e.requestUpdate(),new Promise(n=>{this.#n=n})}render(){if(this.#t===null)return b;const{title:e,body:n,confirmLabel:s,cancelLabel:i,tone:r}=this.#t;return m`
|
|
222
|
+
<dialog class="dpk-confirm-dialog" data-dpk-confirm-dialog=${this.#s} @close=${this.#a}>
|
|
223
|
+
<form method="dialog" class="dpk-confirm-dialog-body" @submit=${this.#o}>
|
|
224
224
|
<h2 class="dpk-confirm-dialog-title">${e}</h2>
|
|
225
225
|
${n?m`<p class="dpk-confirm-dialog-text">${n}</p>`:b}
|
|
226
226
|
<div class="dpk-confirm-dialog-actions">
|
|
@@ -235,9 +235,9 @@ import{s as C,o as O,v as $,E as Vd,T as Yd,n as Zd,K as le,j as x,c as wt,B as
|
|
|
235
235
|
</div>
|
|
236
236
|
</form>
|
|
237
237
|
</dialog>
|
|
238
|
-
`}#r(){return this.#e.renderRoot.querySelector(`dialog[data-dpk-confirm-dialog="${this.#n}"]`)??null}#o=()=>{const e=this.#r();this.#a(e?.returnValue==="confirm")};#a(e){const n=this.#t;this.#t=null,this.#s=null,this.#i=!1,this.#e.requestUpdate(),n?.(e)}}const Je=Math.min,de=Math.max,mn=Math.round,kn=Math.floor,ce=t=>({x:t,y:t}),ch={left:"right",right:"left",bottom:"top",top:"bottom"};function ph(t,e,n){return de(t,Je(e,n))}function Ot(t,e){return typeof t=="function"?t(e):t}function Pe(t){return t.split("-")[0]}function _t(t){return t.split("-")[1]}function ho(t){return t==="x"?"y":"x"}function uo(t){return t==="y"?"height":"width"}function pe(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function go(t){return ho(pe(t))}function hh(t,e,n){n===void 0&&(n=!1);const s=_t(t),i=go(t),r=uo(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=bn(o)),[o,bn(o)]}function uh(t){const e=bn(t);return[Os(t),e,Os(e)]}function Os(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const fo=["left","right"],mo=["right","left"],gh=["top","bottom"],fh=["bottom","top"];function mh(t,e,n){switch(t){case"top":case"bottom":return n?e?mo:fo:e?fo:mo;case"left":case"right":return e?gh:fh;default:return[]}}function kh(t,e,n,s){const i=_t(t);let r=mh(Pe(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Os)))),r}function bn(t){const e=Pe(t);return ch[e]+t.slice(e.length)}function bh(t){var e,n,s,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(i=t.left)!=null?i:0}}function vh(t){return typeof t!="number"?bh(t):{top:t,right:t,bottom:t,left:t}}function vn(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function ko(t,e,n){let{reference:s,floating:i}=t;const r=pe(e),o=go(e),a=uo(o),l=Pe(e),p=r==="y",h=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,f=s[a]/2-i[a]/2;let c;switch(l){case"top":c={x:h,y:s.y-i.height};break;case"bottom":c={x:h,y:s.y+s.height};break;case"right":c={x:s.x+s.width,y:d};break;case"left":c={x:s.x-i.width,y:d};break;default:c={x:s.x,y:s.y}}const g=_t(e);return g&&(c[o]+=f*(g==="end"?1:-1)*(n&&p?-1:1)),c}async function xh(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:c=0}=Ot(e,t),g=vh(c),k=a[f?d==="floating"?"reference":"floating":d],v=vn(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(k)))==null||n?k:k.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:p,rootBoundary:h,strategy:l})),y=d==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),M=await(r.isElement==null?void 0:r.isElement(A))&&await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1},U=vn(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:A,strategy:l}):y);return{top:(v.top-U.top+g.top)/M.y,bottom:(U.bottom-v.bottom+g.bottom)/M.y,left:(v.left-U.left+g.left)/M.x,right:(U.right-v.right+g.right)/M.x}}const wh=50,yh=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:xh},l=await(o.isRTL==null?void 0:o.isRTL(e));let p=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:d}=ko(p,s,l),f=s,c=0;const g={};for(let u=0;u<r.length;u++){const k=r[u];if(!k)continue;const{name:v,fn:y}=k,{x:A,y:M,data:U,reset:L}=await y({x:h,y:d,initialPlacement:s,placement:f,strategy:i,middlewareData:g,rects:p,platform:a,elements:{reference:t,floating:e}});h=A??h,d=M??d,g[v]={...g[v],...U},L&&c<wh&&(c++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(p=L.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):L.rects),{x:h,y:d}=ko(p,f,l)),u=-1)}return{x:h,y:d,placement:f,strategy:i,middlewareData:g}},$h=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:p}=e,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:u=!0,...k}=Ot(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const v=Pe(i),y=pe(a),A=Pe(a)===a,M=await(l.isRTL==null?void 0:l.isRTL(p.floating)),U=f||(A||!u?[bn(a)]:uh(a)),L=g!=="none";!f&&L&&U.push(...kh(a,u,g,M));const G=[a,...U],q=await l.detectOverflow(e,k),ae=[];let te=((s=r.flip)==null?void 0:s.overflows)||[];if(h&&ae.push(q[v]),d){const Se=hh(i,o,M);ae.push(q[Se[0]],q[Se[1]])}if(te=[...te,{placement:i,overflows:ae}],!ae.every(Se=>Se<=0)){var Vi,Yi;const Se=(((Vi=r.flip)==null?void 0:Vi.index)||0)+1,ls=G[Se];if(ls&&(!(d==="alignment"?y!==pe(ls):!1)||te.every(Q=>pe(Q.placement)===y?Q.overflows[0]>0:!0)))return{data:{index:Se,overflows:te},reset:{placement:ls}};let xt=(Yi=te.filter(Ae=>Ae.overflows[0]<=0).sort((Ae,Q)=>Ae.overflows[1]-Q.overflows[1])[0])==null?void 0:Yi.placement;if(!xt)switch(c){case"bestFit":{var Zi;const Ae=(Zi=te.filter(Q=>{if(L){const me=pe(Q.placement);return me===y||me==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(me=>me>0).reduce((me,Kd)=>me+Kd,0)]).sort((Q,me)=>Q[1]-me[1])[0])==null?void 0:Zi[0];Ae&&(xt=Ae);break}case"initialPlacement":xt=a;break}if(i!==xt)return{reset:{placement:xt}}}return{}}}},Sh=new Set(["left","top"]);async function Ah(t,e){const{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=Pe(n),a=_t(n),l=pe(n)==="y",p=Sh.has(o)?-1:1,h=r&&l?-1:1,d=Ot(e,t);let{mainAxis:f,crossAxis:c,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(c=a==="end"?g*-1:g),l?{x:c*h,y:f*p}:{x:f*p,y:c*h}}const Eh=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await Ah(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},Ch=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:A,y:M}=y;return{x:A,y:M}}},...p}=Ot(t,e),h={x:n,y:s},d=await r.detectOverflow(e,p),f=pe(i),c=ho(f);let g=h[c],u=h[f];const k=(y,A)=>ph(A+d[y==="y"?"top":"left"],A,A-d[y==="y"?"bottom":"right"]);o&&(g=k(c,g)),a&&(u=k(f,u));const v=l.fn({...e,[c]:g,[f]:u});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[c]:o,[f]:a}}}}}},Th=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:i,elements:r}=e,{apply:o=()=>{},...a}=Ot(t,e),l=await i.detectOverflow(e,a),p=Pe(n),h=_t(n),d=pe(n)==="y",{width:f,height:c}=s.floating;let g,u;p==="top"||p==="bottom"?(g=p,u=h===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(u=p,g=h==="end"?"top":"bottom");const k=c-l.top-l.bottom,v=f-l.left-l.right,y=Je(c-l[g],k),A=Je(f-l[u],v),M=e.middlewareData.shift,U=!M;let L=y,G=A;M!=null&&M.enabled.x&&(G=v),M!=null&&M.enabled.y&&(L=k),U&&!h&&(d?G=f-2*de(l.left,l.right):L=c-2*de(l.top,l.bottom)),await o({...e,availableWidth:G,availableHeight:L});const q=await i.getDimensions(r.floating);return f!==q.width||c!==q.height?{reset:{rects:!0}}:{}}}};function xn(){return typeof window<"u"}function et(t){return bo(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function he(t){var e;return(e=(bo(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function bo(t){return xn()?t instanceof Node||t instanceof B(t).Node:!1}function se(t){return xn()?t instanceof Element||t instanceof B(t).Element:!1}function be(t){return xn()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function vo(t){return!xn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}function wn(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=ie(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function Rh(t){return/^(table|td|th)$/.test(et(t))}function yn(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Mh=/transform|translate|scale|rotate|perspective|filter/,Oh=/paint|layout|strict|content/,Le=t=>!!t&&t!=="none";let _s;function Ps(t){const e=se(t)?ie(t):t;return Le(e.transform)||Le(e.translate)||Le(e.scale)||Le(e.rotate)||Le(e.perspective)||!Ls()&&(Le(e.backdropFilter)||Le(e.filter))||Mh.test(e.willChange||"")||Oh.test(e.contain||"")}function _h(t){let e=ze(t);for(;be(e)&&!Pt(e);){if(Ps(e))return e;if(yn(e))return null;e=ze(e)}return null}function Ls(){return _s==null&&(_s=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_s}function Pt(t){return/^(html|body|#document)$/.test(et(t))}function ie(t){return B(t).getComputedStyle(t)}function $n(t){return se(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ze(t){if(et(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vo(t)&&t.host||he(t);return vo(e)?e.host:e}function xo(t){const e=ze(t);return Pt(e)?(t.ownerDocument||t).body:be(e)&&wn(e)?e:xo(e)}function Lt(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=xo(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=B(i);if(r){const a=zs(o);return e.concat(o,o.visualViewport||[],wn(i)?i:[],a&&n?Lt(a):[])}else return e.concat(i,Lt(i,[],n))}function zs(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function wo(t){const e=ie(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=be(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=mn(n)!==r||mn(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function Is(t){return se(t)?t:t.contextElement}function tt(t){const e=Is(t);if(!be(e))return ce(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=wo(e);let o=(r?mn(n.width):n.width)/s,a=(r?mn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Ph=ce(0);function yo(t){const e=B(t);return!Ls()||!e.visualViewport?Ph:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Lh(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===B(t)}function Ie(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Is(t);let o=ce(1);e&&(s?se(s)&&(o=tt(s)):o=tt(t));const a=Lh(r,n,s)?yo(r):ce(0);let l=(i.left+a.x)/o.x,p=(i.top+a.y)/o.y,h=i.width/o.x,d=i.height/o.y;if(r&&s){const f=B(r),c=se(s)?B(s):s;let g=f,u=zs(g);for(;u&&c!==g;){const k=tt(u),v=u.getBoundingClientRect(),y=ie(u),A=v.left+(u.clientLeft+parseFloat(y.paddingLeft))*k.x,M=v.top+(u.clientTop+parseFloat(y.paddingTop))*k.y;l*=k.x,p*=k.y,h*=k.x,d*=k.y,l+=A,p+=M,g=B(u),u=zs(g)}}return vn({width:h,height:d,x:l,y:p})}function Sn(t,e){const n=$n(t).scrollLeft;return e?e.left+n:Ie(he(t)).left+n}function $o(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-Sn(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function zh(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=he(s),a=e?yn(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},p=ce(1);const h=ce(0),d=be(s);if((d||!r)&&((et(s)!=="body"||wn(o))&&(l=$n(s)),d)){const c=Ie(s);p=tt(s),h.x=c.x+s.clientLeft,h.y=c.y+s.clientTop}const f=o&&!d&&!r?$o(o,l):ce(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-l.scrollLeft*p.x+h.x+f.x,y:n.y*p.y-l.scrollTop*p.y+h.y+f.y}}function Ih(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Dh(t){const e=$n(t),n=t.ownerDocument.body,s=de(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=de(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+Sn(t);const o=-e.scrollTop;return ie(n).direction==="rtl"&&(r+=de(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const Nh=25;function qh(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=B(t),r=he(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,p=0,h=0;if(o){const f=!Ls()||e==="fixed";s?f||(p=-o.offsetLeft,h=-o.offsetTop):(a=o.width,l=o.height,f&&(p=o.offsetLeft,h=o.offsetTop))}if(Sn(r)<=0){const f=r.ownerDocument,c=f.body,g=getComputedStyle(c),u=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,k=Math.abs(r.clientWidth-c.clientWidth-u),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?k/2:k;v<=Nh&&(a-=v)}return{width:a,height:l,x:p,y:h}}function Uh(t,e){const n=Ie(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=tt(t),o=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,p=s*r.y;return{width:o,height:a,x:l,y:p}}function So(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=qh(t,n,e);else if(e==="document")s=Dh(he(t));else if(se(e))s=Uh(e,n);else{const i=yo(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return vn(s)}function Hh(t,e){const n=e.get(t);if(n)return n;let s=Lt(t,[],!1).filter(a=>se(a)&&et(a)!=="body"),i=null;const r=ie(t).position==="fixed";let o=r?ze(t):t;for(;se(o)&&!Pt(o);){const a=ie(o),l=Ps(o),p=i?i.position:r?"fixed":"";!l&&(p==="fixed"||p==="absolute"&&a.position==="static")?s=s.filter(d=>d!==o):i=a,o=ze(o)}return e.set(t,s),s}function Bh(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?yn(e)?[]:Hh(e,this._c):[].concat(n),s],a=So(e,o[0],i);let l=a.top,p=a.right,h=a.bottom,d=a.left;for(let f=1;f<o.length;f++){const c=So(e,o[f],i);l=de(c.top,l),p=Je(c.right,p),h=Je(c.bottom,h),d=de(c.left,d)}return{width:p-d,height:h-l,x:d,y:l}}function jh(t){const{width:e,height:n}=wo(t);return{width:e,height:n}}function Fh(t,e,n){const s=be(e),i=he(e),r=n==="fixed",o=Ie(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=ce(0);if((s||!r)&&((et(e)!=="body"||wn(i))&&(a=$n(e)),s)){const f=Ie(e,!0,r,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}!s&&i&&(l.x=Sn(i));const p=i&&!s&&!r?$o(i,a):ce(0),h=o.left+a.scrollLeft-l.x-p.x,d=o.top+a.scrollTop-l.y-p.y;return{x:h,y:d,width:o.width,height:o.height}}function Ds(t){return ie(t).position==="static"}function Ao(t,e){if(!be(t)||ie(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return he(t)===n&&(n=n.ownerDocument.body),n}function Eo(t,e){const n=B(t);if(yn(t))return n;if(!be(t)){let i=ze(t);for(;i&&!Pt(i);){if(se(i)&&!Ds(i))return i;i=ze(i)}return n}let s=Ao(t,e);for(;s&&Rh(s)&&Ds(s);)s=Ao(s,e);return s&&Pt(s)&&Ds(s)&&!Ps(s)?n:s||_h(t)||n}const Gh=async function(t){const e=this.getOffsetParent||Eo,n=this.getDimensions,s=await n(t.floating);return{reference:Fh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Wh(t){return ie(t).direction==="rtl"}const Kh={convertOffsetParentRelativeRectToViewportRelativeRect:zh,getDocumentElement:he,getClippingRect:Bh,getOffsetParent:Eo,getElementRects:Gh,getClientRects:Ih,getDimensions:jh,getScale:tt,isElement:se,isRTL:Wh};function Co(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Vh(t,e,n){let s=null,i;const r=he(t);function o(){var h;clearTimeout(i),(h=s)==null||h.disconnect(),s=null}function a(h,d){h===void 0&&(h=!1),d===void 0&&(d=1),o();const f=t.getBoundingClientRect(),{left:c,top:g,width:u,height:k}=f;if(h||e(),!u||!k)return;const v=kn(g),y=kn(r.clientWidth-(c+u)),A=kn(r.clientHeight-(g+k)),M=kn(c),L={rootMargin:-v+"px "+-y+"px "+-A+"px "+-M+"px",threshold:de(0,Je(1,d))||1};let G=!0;function q(ae){const te=ae[0].intersectionRatio;if(!Co(f,t.getBoundingClientRect()))return a();if(te!==d){if(!G)return a();te?a(!1,te):i=setTimeout(()=>{a(!1,1e-7)},1e3)}G=!1}try{s=new IntersectionObserver(q,{...L,root:r.ownerDocument})}catch{s=new IntersectionObserver(q,L)}s.observe(t)}const l=B(t),p=()=>a(n);return l.addEventListener("resize",p),a(!0),()=>{l.removeEventListener("resize",p),o()}}function Yh(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,p=Is(t),h=i||r?[...p?Lt(p):[],...e?Lt(e):[]]:[];h.forEach(v=>{i&&v.addEventListener("scroll",n),r&&v.addEventListener("resize",n)});const d=p&&a?Vh(p,n,r):null;let f=-1,c=null;o&&(c=new ResizeObserver(v=>{let[y]=v;y&&y.target===p&&c&&e&&(c.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var A;(A=c)==null||A.observe(e)})),n()}),p&&!l&&c.observe(p),e&&c.observe(e));let g,u=l?Ie(t):null;l&&k();function k(){const v=Ie(t);u&&!Co(u,v)&&n(),u=v,g=requestAnimationFrame(k)}return n(),()=>{var v;h.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),d?.(),(v=c)==null||v.disconnect(),c=null,l&&cancelAnimationFrame(g)}}const Zh=Eh,Qh=Ch,Xh=$h,Jh=Th,eu=(t,e,n)=>{const s=new Map,i=n??{},r={...Kh,...i.platform,_c:s};return yh(t,e,{...i,platform:r})},To=(t,e)=>({top:e,bottom:e,right:t}),Ns=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,r=0;const o=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`,t.style.inset="auto";const l=Yh(o,t,()=>{const p=++r;eu(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Zh(8),Xh({padding:8,fallbackAxisSideDirection:"end",...s.boundary===void 0?{}:{boundary:s.boundary}}),Qh({padding:8,...s.boundary===void 0?{}:{boundary:s.boundary}}),Jh({padding:8,...s.boundary===void 0?{}:{boundary:s.boundary},apply:({availableWidth:h,availableHeight:d})=>{!i||p!==r||(t.style.width=`${Math.max(0,Math.min(n.width,h))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,d))}px`)}})]}).then(({x:h,y:d})=>{!i||p!==r||!t.isConnected||(t.style.left=`${h}px`,t.style.top=`${d}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},An=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}},En=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},tu=t=>{const{host:e,state:n,target:s,targetElement:i,resetViewElement:r,messages:o}=t,a=[],l=i?.textContent?.trim()??"";return s!==null&&l!==""&&a.push({kind:"item",id:"copy-text",label:o.copyText,run:()=>{En(l)}}),s!==null&&e.definition.hasTarget(n,s)&&a.push({kind:"item",id:"feedback",label:o.feedback,run:()=>e.requestComment(_(s))}),r!==null&&a.push({kind:"item",id:"reset-view",label:o.resetView,run:()=>r.resetView()}),a.length===0?null:{id:"common",entries:a}},qs={open:!1,x:0,y:0,groups:[],openPath:[],activeId:null},nu=(t,e,n)=>({open:n.some(s=>s.entries.length>0),x:t,y:e,groups:n,openPath:[],activeId:null}),su=t=>t.flatMap(e=>e.entries),Us=(t,e)=>t.find(n=>n.id===e),Hs=(t,e)=>{let n=su(t);for(const s of e){const i=Us(n,s);if(i===void 0||i.kind!=="submenu")return n;n=i.items}return n},Ro=t=>t.filter(e=>!(e.kind==="item"&&e.disabled===!0)).map(e=>e.id),Mo=(t,e)=>{const n=Ro(Hs(t.groups,t.openPath));if(n.length===0)return t;const s=t.activeId===null?e===1?-1:n.length:n.indexOf(t.activeId),i=n[(s+e+n.length)%n.length];return i===void 0?t:{...t,activeId:i}},Oo=(t,e)=>{const n=Us(Hs(t.groups,t.openPath),e);if(n===void 0||n.kind!=="submenu")return t;const s=Ro(n.items)[0]??null;return{...t,openPath:[...t.openPath,e],activeId:s}},_o=t=>t.activeId===null?t:Oo(t,t.activeId),iu=t=>{if(t.openPath.length===0)return t;const e=t.openPath[t.openPath.length-1]??null;return{...t,openPath:t.openPath.slice(0,-1),activeId:e}},ru=t=>{const e=Us(Hs(t.groups,t.openPath),t.activeId??"");return e===void 0?{state:t,run:null}:e.kind==="submenu"?{state:_o(t),run:null}:e.disabled===!0?{state:t,run:null}:{state:qs,run:e.run}},Bs=(t,e)=>{const n=[],s=i=>{for(const r of i.querySelectorAll("*"))r.matches(e)&&n.push(r),r.shadowRoot&&s(r.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},Po=(t,e)=>{const n=[];let s=t;for(;s;){const i=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=i instanceof ShadowRoot?i.host:i,!(s instanceof Element)||s===e)break;n.push(s)}return n},nt="data-dpk-target",ou=2800,Lo=48,au=t=>t.getClientRects().length>0,lu=(t,e)=>{const n=Bs(t,`[${nt}]`).filter(r=>(r.getAttribute(nt)??"").split(/\s+/).includes(e)),s=Bs(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(au)??i[0]??null},zo=(t,e)=>{const n=getComputedStyle(t),s=e==="y"?n.overflowY:n.overflowX;return s!=="auto"&&s!=="scroll"?!1:e==="y"?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth},du=(t,e)=>{for(const n of Po(e,t))zo(n,"y")&&ws(n,e,Lo),zo(n,"x")&&Dr(n,e,Lo)},Io="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",De={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Do={outline:"2px solid transparent",outlineOffset:"3px"},cu=t=>t?[{...De},{...De,offset:.85},{...Do}]:[{...De,boxShadow:`0 0 0 0 ${Io}`},{...De,boxShadow:"0 0 0 14px transparent",offset:.3},{...De,boxShadow:`0 0 0 0 ${Io}`,offset:.31},{...De,boxShadow:"0 0 0 14px transparent",offset:.6},{...De,offset:.85},{...Do}],zt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},Cn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},pu=t=>t?[{...zt},{...zt,offset:.85},{...Cn}]:[{...zt},{...Cn,offset:.3},{...zt,offset:.31},{...Cn,offset:.6},{...zt,offset:.61},{...Cn}],hu=t=>{if(typeof t.animate!="function")return;const e=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,n=t instanceof SVGElement&&!(t instanceof SVGSVGElement);t.animate(n?pu(e):cu(e),{duration:ou,easing:"ease-out"})},uu=t=>typeof t=="object"&&t!==null&&"getContextMenuItems"in t&&typeof t.getContextMenuItems=="function",gu=(t,e)=>{const n=[];for(const s of t){if(!uu(s))continue;const i=s.getContextMenuItems(e);i!==null&&n.push(...i)}return n},fu=t=>{for(const e of t)if(e instanceof Element)return e;return null},mu=t=>{for(const e of t){if(!(e instanceof Element))continue;const n=e.getAttribute(nt);if(n!==null&&n.trim()!=="")try{return Re(n)}catch{continue}const s=e.getAttribute("data-dpk-comment");if(s!==null&&s.trim()!=="")try{return Re(s)}catch{continue}}return null},ku=(t,e)=>{for(const n of t)if(n instanceof Element&&typeof Reflect.get(n,e)=="function")return n;return null},bu=t=>{for(const e of t)if(e instanceof Element&&(e.hasAttribute(nt)||e.hasAttribute("data-dpk-comment")))return e;return null},No="dpk-context-menu",qo=(t,e)=>`dpk-settings-option dpk-context-menu-option${e?" is-active":""}${t.kind==="item"&&t.danger===!0?" is-danger":""}`,Uo=(t,e,n,s)=>{const i=n.openPath.length===e&&n.activeId===t.id;if(t.kind==="submenu"){const r=n.openPath[e]===t.id;return m`<div class="dpk-context-menu-submenu-wrap">
|
|
238
|
+
`}#r(){return this.#e.renderRoot.querySelector(`dialog[data-dpk-confirm-dialog="${this.#s}"]`)??null}#o=e=>{e.preventDefault();const n=this.#r(),s=e.submitter;this.#l(s instanceof HTMLButtonElement&&s.value==="confirm"),n&&_s(n)};#a=()=>{const e=this.#r();this.#l(e?.returnValue==="confirm")};#l(e){const n=this.#n;this.#n=null,this.#t=null,this.#i=!1,this.#e.requestUpdate(),n?.(e)}}const et=Math.min,de=Math.max,bn=Math.round,vn=Math.floor,ce=t=>({x:t,y:t}),$h={left:"right",right:"left",bottom:"top",top:"bottom"};function Sh(t,e,n){return de(t,et(e,n))}function Lt(t,e){return typeof t=="function"?t(e):t}function Pe(t){return t.split("-")[0]}function zt(t){return t.split("-")[1]}function mo(t){return t==="x"?"y":"x"}function ko(t){return t==="y"?"height":"width"}function pe(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function bo(t){return mo(pe(t))}function Ah(t,e,n){n===void 0&&(n=!1);const s=zt(t),i=bo(t),r=ko(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=xn(o)),[o,xn(o)]}function Eh(t){const e=xn(t);return[Ps(t),e,Ps(e)]}function Ps(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const vo=["left","right"],xo=["right","left"],Ch=["top","bottom"],Th=["bottom","top"];function Rh(t,e,n){switch(t){case"top":case"bottom":return n?e?xo:vo:e?vo:xo;case"left":case"right":return e?Ch:Th;default:return[]}}function Mh(t,e,n,s){const i=zt(t);let r=Rh(Pe(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Ps)))),r}function xn(t){const e=Pe(t);return $h[e]+t.slice(e.length)}function Oh(t){var e,n,s,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(i=t.left)!=null?i:0}}function _h(t){return typeof t!="number"?Oh(t):{top:t,right:t,bottom:t,left:t}}function wn(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function wo(t,e,n){let{reference:s,floating:i}=t;const r=pe(e),o=bo(e),a=ko(o),l=Pe(e),p=r==="y",h=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,f=s[a]/2-i[a]/2;let c;switch(l){case"top":c={x:h,y:s.y-i.height};break;case"bottom":c={x:h,y:s.y+s.height};break;case"right":c={x:s.x+s.width,y:d};break;case"left":c={x:s.x-i.width,y:d};break;default:c={x:s.x,y:s.y}}const g=zt(e);return g&&(c[o]+=f*(g==="end"?1:-1)*(n&&p?-1:1)),c}async function Ph(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:c=0}=Lt(e,t),g=_h(c),k=a[f?d==="floating"?"reference":"floating":d],v=wn(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(k)))==null||n?k:k.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:p,rootBoundary:h,strategy:l})),y=d==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),M=await(r.isElement==null?void 0:r.isElement(A))&&await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1},U=wn(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:A,strategy:l}):y);return{top:(v.top-U.top+g.top)/M.y,bottom:(U.bottom-v.bottom+g.bottom)/M.y,left:(v.left-U.left+g.left)/M.x,right:(U.right-v.right+g.right)/M.x}}const Lh=50,zh=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:Ph},l=await(o.isRTL==null?void 0:o.isRTL(e));let p=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:d}=wo(p,s,l),f=s,c=0;const g={};for(let u=0;u<r.length;u++){const k=r[u];if(!k)continue;const{name:v,fn:y}=k,{x:A,y:M,data:U,reset:L}=await y({x:h,y:d,initialPlacement:s,placement:f,strategy:i,middlewareData:g,rects:p,platform:a,elements:{reference:t,floating:e}});h=A??h,d=M??d,g[v]={...g[v],...U},L&&c<Lh&&(c++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(p=L.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):L.rects),{x:h,y:d}=wo(p,f,l)),u=-1)}return{x:h,y:d,placement:f,strategy:i,middlewareData:g}},Ih=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:p}=e,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:u=!0,...k}=Lt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const v=Pe(i),y=pe(a),A=Pe(a)===a,M=await(l.isRTL==null?void 0:l.isRTL(p.floating)),U=f||(A||!u?[xn(a)]:Eh(a)),L=g!=="none";!f&&L&&U.push(...Mh(a,u,g,M));const G=[a,...U],q=await l.detectOverflow(e,k),ae=[];let te=((s=r.flip)==null?void 0:s.overflows)||[];if(h&&ae.push(q[v]),d){const Se=Ah(i,o,M);ae.push(q[Se[0]],q[Se[1]])}if(te=[...te,{placement:i,overflows:ae}],!ae.every(Se=>Se<=0)){var Zi,Qi;const Se=(((Zi=r.flip)==null?void 0:Zi.index)||0)+1,ds=G[Se];if(ds&&(!(d==="alignment"?y!==pe(ds):!1)||te.every(Q=>pe(Q.placement)===y?Q.overflows[0]>0:!0)))return{data:{index:Se,overflows:te},reset:{placement:ds}};let yt=(Qi=te.filter(Ae=>Ae.overflows[0]<=0).sort((Ae,Q)=>Ae.overflows[1]-Q.overflows[1])[0])==null?void 0:Qi.placement;if(!yt)switch(c){case"bestFit":{var Xi;const Ae=(Xi=te.filter(Q=>{if(L){const ke=pe(Q.placement);return ke===y||ke==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(ke=>ke>0).reduce((ke,Zd)=>ke+Zd,0)]).sort((Q,ke)=>Q[1]-ke[1])[0])==null?void 0:Xi[0];Ae&&(yt=Ae);break}case"initialPlacement":yt=a;break}if(i!==yt)return{reset:{placement:yt}}}return{}}}},Dh=new Set(["left","top"]);async function Nh(t,e){const{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=Pe(n),a=zt(n),l=pe(n)==="y",p=Dh.has(o)?-1:1,h=r&&l?-1:1,d=Lt(e,t);let{mainAxis:f,crossAxis:c,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(c=a==="end"?g*-1:g),l?{x:c*h,y:f*p}:{x:f*p,y:c*h}}const qh=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await Nh(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},Uh=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:A,y:M}=y;return{x:A,y:M}}},...p}=Lt(t,e),h={x:n,y:s},d=await r.detectOverflow(e,p),f=pe(i),c=mo(f);let g=h[c],u=h[f];const k=(y,A)=>Sh(A+d[y==="y"?"top":"left"],A,A-d[y==="y"?"bottom":"right"]);o&&(g=k(c,g)),a&&(u=k(f,u));const v=l.fn({...e,[c]:g,[f]:u});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[c]:o,[f]:a}}}}}},Hh=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:i,elements:r}=e,{apply:o=()=>{},...a}=Lt(t,e),l=await i.detectOverflow(e,a),p=Pe(n),h=zt(n),d=pe(n)==="y",{width:f,height:c}=s.floating;let g,u;p==="top"||p==="bottom"?(g=p,u=h===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(u=p,g=h==="end"?"top":"bottom");const k=c-l.top-l.bottom,v=f-l.left-l.right,y=et(c-l[g],k),A=et(f-l[u],v),M=e.middlewareData.shift,U=!M;let L=y,G=A;M!=null&&M.enabled.x&&(G=v),M!=null&&M.enabled.y&&(L=k),U&&!h&&(d?G=f-2*de(l.left,l.right):L=c-2*de(l.top,l.bottom)),await o({...e,availableWidth:G,availableHeight:L});const q=await i.getDimensions(r.floating);return f!==q.width||c!==q.height?{reset:{rects:!0}}:{}}}};function yn(){return typeof window<"u"}function tt(t){return yo(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function he(t){var e;return(e=(yo(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function yo(t){return yn()?t instanceof Node||t instanceof B(t).Node:!1}function se(t){return yn()?t instanceof Element||t instanceof B(t).Element:!1}function ve(t){return yn()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function $o(t){return!yn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}function $n(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=ie(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function Bh(t){return/^(table|td|th)$/.test(tt(t))}function Sn(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const jh=/transform|translate|scale|rotate|perspective|filter/,Fh=/paint|layout|strict|content/,Le=t=>!!t&&t!=="none";let Ls;function zs(t){const e=se(t)?ie(t):t;return Le(e.transform)||Le(e.translate)||Le(e.scale)||Le(e.rotate)||Le(e.perspective)||!Is()&&(Le(e.backdropFilter)||Le(e.filter))||jh.test(e.willChange||"")||Fh.test(e.contain||"")}function Gh(t){let e=ze(t);for(;ve(e)&&!It(e);){if(zs(e))return e;if(Sn(e))return null;e=ze(e)}return null}function Is(){return Ls==null&&(Ls=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ls}function It(t){return/^(html|body|#document)$/.test(tt(t))}function ie(t){return B(t).getComputedStyle(t)}function An(t){return se(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ze(t){if(tt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||$o(t)&&t.host||he(t);return $o(e)?e.host:e}function So(t){const e=ze(t);return It(e)?(t.ownerDocument||t).body:ve(e)&&$n(e)?e:So(e)}function Dt(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=So(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=B(i);if(r){const a=Ds(o);return e.concat(o,o.visualViewport||[],$n(i)?i:[],a&&n?Dt(a):[])}else return e.concat(i,Dt(i,[],n))}function Ds(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ao(t){const e=ie(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=ve(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=bn(n)!==r||bn(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function Ns(t){return se(t)?t:t.contextElement}function nt(t){const e=Ns(t);if(!ve(e))return ce(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=Ao(e);let o=(r?bn(n.width):n.width)/s,a=(r?bn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Wh=ce(0);function Eo(t){const e=B(t);return!Is()||!e.visualViewport?Wh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Vh(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===B(t)}function Ie(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Ns(t);let o=ce(1);e&&(s?se(s)&&(o=nt(s)):o=nt(t));const a=Vh(r,n,s)?Eo(r):ce(0);let l=(i.left+a.x)/o.x,p=(i.top+a.y)/o.y,h=i.width/o.x,d=i.height/o.y;if(r&&s){const f=B(r),c=se(s)?B(s):s;let g=f,u=Ds(g);for(;u&&c!==g;){const k=nt(u),v=u.getBoundingClientRect(),y=ie(u),A=v.left+(u.clientLeft+parseFloat(y.paddingLeft))*k.x,M=v.top+(u.clientTop+parseFloat(y.paddingTop))*k.y;l*=k.x,p*=k.y,h*=k.x,d*=k.y,l+=A,p+=M,g=B(u),u=Ds(g)}}return wn({width:h,height:d,x:l,y:p})}function En(t,e){const n=An(t).scrollLeft;return e?e.left+n:Ie(he(t)).left+n}function Co(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-En(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function Kh(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=he(s),a=e?Sn(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},p=ce(1);const h=ce(0),d=ve(s);if((d||!r)&&((tt(s)!=="body"||$n(o))&&(l=An(s)),d)){const c=Ie(s);p=nt(s),h.x=c.x+s.clientLeft,h.y=c.y+s.clientTop}const f=o&&!d&&!r?Co(o,l):ce(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-l.scrollLeft*p.x+h.x+f.x,y:n.y*p.y-l.scrollTop*p.y+h.y+f.y}}function Yh(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Zh(t){const e=An(t),n=t.ownerDocument.body,s=de(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=de(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+En(t);const o=-e.scrollTop;return ie(n).direction==="rtl"&&(r+=de(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const Qh=25;function Xh(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=B(t),r=he(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,p=0,h=0;if(o){const f=!Is()||e==="fixed";s?f||(p=-o.offsetLeft,h=-o.offsetTop):(a=o.width,l=o.height,f&&(p=o.offsetLeft,h=o.offsetTop))}if(En(r)<=0){const f=r.ownerDocument,c=f.body,g=getComputedStyle(c),u=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,k=Math.abs(r.clientWidth-c.clientWidth-u),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?k/2:k;v<=Qh&&(a-=v)}return{width:a,height:l,x:p,y:h}}function Jh(t,e){const n=Ie(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=nt(t),o=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,p=s*r.y;return{width:o,height:a,x:l,y:p}}function To(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=Xh(t,n,e);else if(e==="document")s=Zh(he(t));else if(se(e))s=Jh(e,n);else{const i=Eo(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return wn(s)}function eu(t,e){const n=e.get(t);if(n)return n;let s=Dt(t,[],!1).filter(a=>se(a)&&tt(a)!=="body"),i=null;const r=ie(t).position==="fixed";let o=r?ze(t):t;for(;se(o)&&!It(o);){const a=ie(o),l=zs(o),p=i?i.position:r?"fixed":"";!l&&(p==="fixed"||p==="absolute"&&a.position==="static")?s=s.filter(d=>d!==o):i=a,o=ze(o)}return e.set(t,s),s}function tu(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Sn(e)?[]:eu(e,this._c):[].concat(n),s],a=To(e,o[0],i);let l=a.top,p=a.right,h=a.bottom,d=a.left;for(let f=1;f<o.length;f++){const c=To(e,o[f],i);l=de(c.top,l),p=et(c.right,p),h=et(c.bottom,h),d=de(c.left,d)}return{width:p-d,height:h-l,x:d,y:l}}function nu(t){const{width:e,height:n}=Ao(t);return{width:e,height:n}}function su(t,e,n){const s=ve(e),i=he(e),r=n==="fixed",o=Ie(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=ce(0);if((s||!r)&&((tt(e)!=="body"||$n(i))&&(a=An(e)),s)){const f=Ie(e,!0,r,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}!s&&i&&(l.x=En(i));const p=i&&!s&&!r?Co(i,a):ce(0),h=o.left+a.scrollLeft-l.x-p.x,d=o.top+a.scrollTop-l.y-p.y;return{x:h,y:d,width:o.width,height:o.height}}function qs(t){return ie(t).position==="static"}function Ro(t,e){if(!ve(t)||ie(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return he(t)===n&&(n=n.ownerDocument.body),n}function Mo(t,e){const n=B(t);if(Sn(t))return n;if(!ve(t)){let i=ze(t);for(;i&&!It(i);){if(se(i)&&!qs(i))return i;i=ze(i)}return n}let s=Ro(t,e);for(;s&&Bh(s)&&qs(s);)s=Ro(s,e);return s&&It(s)&&qs(s)&&!zs(s)?n:s||Gh(t)||n}const iu=async function(t){const e=this.getOffsetParent||Mo,n=this.getDimensions,s=await n(t.floating);return{reference:su(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function ru(t){return ie(t).direction==="rtl"}const ou={convertOffsetParentRelativeRectToViewportRelativeRect:Kh,getDocumentElement:he,getClippingRect:tu,getOffsetParent:Mo,getElementRects:iu,getClientRects:Yh,getDimensions:nu,getScale:nt,isElement:se,isRTL:ru};function Oo(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function au(t,e,n){let s=null,i;const r=he(t);function o(){var h;clearTimeout(i),(h=s)==null||h.disconnect(),s=null}function a(h,d){h===void 0&&(h=!1),d===void 0&&(d=1),o();const f=t.getBoundingClientRect(),{left:c,top:g,width:u,height:k}=f;if(h||e(),!u||!k)return;const v=vn(g),y=vn(r.clientWidth-(c+u)),A=vn(r.clientHeight-(g+k)),M=vn(c),L={rootMargin:-v+"px "+-y+"px "+-A+"px "+-M+"px",threshold:de(0,et(1,d))||1};let G=!0;function q(ae){const te=ae[0].intersectionRatio;if(!Oo(f,t.getBoundingClientRect()))return a();if(te!==d){if(!G)return a();te?a(!1,te):i=setTimeout(()=>{a(!1,1e-7)},1e3)}G=!1}try{s=new IntersectionObserver(q,{...L,root:r.ownerDocument})}catch{s=new IntersectionObserver(q,L)}s.observe(t)}const l=B(t),p=()=>a(n);return l.addEventListener("resize",p),a(!0),()=>{l.removeEventListener("resize",p),o()}}function lu(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,p=Ns(t),h=i||r?[...p?Dt(p):[],...e?Dt(e):[]]:[];h.forEach(v=>{i&&v.addEventListener("scroll",n),r&&v.addEventListener("resize",n)});const d=p&&a?au(p,n,r):null;let f=-1,c=null;o&&(c=new ResizeObserver(v=>{let[y]=v;y&&y.target===p&&c&&e&&(c.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var A;(A=c)==null||A.observe(e)})),n()}),p&&!l&&c.observe(p),e&&c.observe(e));let g,u=l?Ie(t):null;l&&k();function k(){const v=Ie(t);u&&!Oo(u,v)&&n(),u=v,g=requestAnimationFrame(k)}return n(),()=>{var v;h.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),d?.(),(v=c)==null||v.disconnect(),c=null,l&&cancelAnimationFrame(g)}}const du=qh,cu=Uh,pu=Ih,hu=Hh,uu=(t,e,n)=>{const s=new Map,i=n??{},r={...ou,...i.platform,_c:s};return zh(t,e,{...i,platform:r})},_o=(t,e)=>({top:e,bottom:e,right:t}),Us=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,r=0;const o=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`,t.style.inset="auto";const l=lu(o,t,()=>{const p=++r;uu(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[du(8),pu({padding:8,fallbackAxisSideDirection:"end",...s.boundary===void 0?{}:{boundary:s.boundary}}),cu({padding:8,...s.boundary===void 0?{}:{boundary:s.boundary}}),hu({padding:8,...s.boundary===void 0?{}:{boundary:s.boundary},apply:({availableWidth:h,availableHeight:d})=>{!i||p!==r||(t.style.width=`${Math.max(0,Math.min(n.width,h))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,d))}px`)}})]}).then(({x:h,y:d})=>{!i||p!==r||!t.isConnected||(t.style.left=`${h}px`,t.style.top=`${d}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},Cn=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}},Tn=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},gu=t=>{const{host:e,state:n,target:s,targetElement:i,resetViewElement:r,messages:o}=t,a=[],l=i?.textContent?.trim()??"";return s!==null&&l!==""&&a.push({kind:"item",id:"copy-text",label:o.copyText,run:()=>{Tn(l)}}),s!==null&&e.definition.hasTarget(n,s)&&a.push({kind:"item",id:"feedback",label:o.feedback,run:()=>e.requestComment(_(s))}),r!==null&&a.push({kind:"item",id:"reset-view",label:o.resetView,run:()=>r.resetView()}),a.length===0?null:{id:"common",entries:a}},Hs={open:!1,x:0,y:0,groups:[],openPath:[],activeId:null},fu=(t,e,n)=>({open:n.some(s=>s.entries.length>0),x:t,y:e,groups:n,openPath:[],activeId:null}),mu=t=>t.flatMap(e=>e.entries),Bs=(t,e)=>t.find(n=>n.id===e),js=(t,e)=>{let n=mu(t);for(const s of e){const i=Bs(n,s);if(i===void 0||i.kind!=="submenu")return n;n=i.items}return n},Po=t=>t.filter(e=>!(e.kind==="item"&&e.disabled===!0)).map(e=>e.id),Lo=(t,e)=>{const n=Po(js(t.groups,t.openPath));if(n.length===0)return t;const s=t.activeId===null?e===1?-1:n.length:n.indexOf(t.activeId),i=n[(s+e+n.length)%n.length];return i===void 0?t:{...t,activeId:i}},zo=(t,e)=>{const n=Bs(js(t.groups,t.openPath),e);if(n===void 0||n.kind!=="submenu")return t;const s=Po(n.items)[0]??null;return{...t,openPath:[...t.openPath,e],activeId:s}},Io=t=>t.activeId===null?t:zo(t,t.activeId),ku=t=>{if(t.openPath.length===0)return t;const e=t.openPath[t.openPath.length-1]??null;return{...t,openPath:t.openPath.slice(0,-1),activeId:e}},bu=t=>{const e=Bs(js(t.groups,t.openPath),t.activeId??"");return e===void 0?{state:t,run:null}:e.kind==="submenu"?{state:Io(t),run:null}:e.disabled===!0?{state:t,run:null}:{state:Hs,run:e.run}},Fs=(t,e)=>{const n=[],s=i=>{for(const r of i.querySelectorAll("*"))r.matches(e)&&n.push(r),r.shadowRoot&&s(r.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},Do=(t,e)=>{const n=[];let s=t;for(;s;){const i=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=i instanceof ShadowRoot?i.host:i,!(s instanceof Element)||s===e)break;n.push(s)}return n},st="data-dpk-target",vu=2800,No=48,xu=t=>t.getClientRects().length>0,wu=(t,e)=>{const n=Fs(t,`[${st}]`).filter(r=>(r.getAttribute(st)??"").split(/\s+/).includes(e)),s=Fs(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(xu)??i[0]??null},qo=(t,e)=>{const n=getComputedStyle(t),s=e==="y"?n.overflowY:n.overflowX;return s!=="auto"&&s!=="scroll"?!1:e==="y"?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth},yu=(t,e)=>{for(const n of Do(e,t))qo(n,"y")&&ys(n,e,No),qo(n,"x")&&Ur(n,e,No)},Uo="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",De={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Ho={outline:"2px solid transparent",outlineOffset:"3px"},$u=t=>t?[{...De},{...De,offset:.85},{...Ho}]:[{...De,boxShadow:`0 0 0 0 ${Uo}`},{...De,boxShadow:"0 0 0 14px transparent",offset:.3},{...De,boxShadow:`0 0 0 0 ${Uo}`,offset:.31},{...De,boxShadow:"0 0 0 14px transparent",offset:.6},{...De,offset:.85},{...Ho}],Nt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},Rn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},Su=t=>t?[{...Nt},{...Nt,offset:.85},{...Rn}]:[{...Nt},{...Rn,offset:.3},{...Nt,offset:.31},{...Rn,offset:.6},{...Nt,offset:.61},{...Rn}],Au=t=>{if(typeof t.animate!="function")return;const e=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,n=t instanceof SVGElement&&!(t instanceof SVGSVGElement);t.animate(n?Su(e):$u(e),{duration:vu,easing:"ease-out"})},Eu=t=>typeof t=="object"&&t!==null&&"getContextMenuItems"in t&&typeof t.getContextMenuItems=="function",Cu=(t,e)=>{const n=[];for(const s of t){if(!Eu(s))continue;const i=s.getContextMenuItems(e);i!==null&&n.push(...i)}return n},Tu=t=>{for(const e of t)if(e instanceof Element)return e;return null},Ru=t=>{for(const e of t){if(!(e instanceof Element))continue;const n=e.getAttribute(st);if(n!==null&&n.trim()!=="")try{return Re(n)}catch{continue}const s=e.getAttribute("data-dpk-comment");if(s!==null&&s.trim()!=="")try{return Re(s)}catch{continue}}return null},Mu=(t,e)=>{for(const n of t)if(n instanceof Element&&typeof Reflect.get(n,e)=="function")return n;return null},Ou=t=>{for(const e of t)if(e instanceof Element&&(e.hasAttribute(st)||e.hasAttribute("data-dpk-comment")))return e;return null},Bo="dpk-context-menu",jo=(t,e)=>`dpk-settings-option dpk-context-menu-option${e?" is-active":""}${t.kind==="item"&&t.danger===!0?" is-danger":""}`,Fo=(t,e,n,s)=>{const i=n.openPath.length===e&&n.activeId===t.id;if(t.kind==="submenu"){const r=n.openPath[e]===t.id;return m`<div class="dpk-context-menu-submenu-wrap">
|
|
239
239
|
<button
|
|
240
|
-
class=${
|
|
240
|
+
class=${jo(t,i)}
|
|
241
241
|
type="button"
|
|
242
242
|
role="menuitem"
|
|
243
243
|
aria-haspopup="menu"
|
|
@@ -248,10 +248,10 @@ import{s as C,o as O,v as $,E as Vd,T as Yd,n as Zd,K as le,j as x,c as wt,B as
|
|
|
248
248
|
<span class="dpk-settings-text"><span class="dpk-settings-name">${t.label}</span></span>
|
|
249
249
|
</button>
|
|
250
250
|
${r?m`<div class="dpk-settings dpk-context-menu-submenu" role="menu">
|
|
251
|
-
${t.items.map(o=>
|
|
251
|
+
${t.items.map(o=>Fo(o,e+1,n,s))}
|
|
252
252
|
</div>`:b}
|
|
253
253
|
</div>`}return m`<button
|
|
254
|
-
class=${
|
|
254
|
+
class=${jo(t,i)}
|
|
255
255
|
type="button"
|
|
256
256
|
role="menuitem"
|
|
257
257
|
?disabled=${t.disabled===!0}
|
|
@@ -259,8 +259,8 @@ import{s as C,o as O,v as $,E as Vd,T as Yd,n as Zd,K as le,j as x,c as wt,B as
|
|
|
259
259
|
@click=${()=>s.onInvoke(t)}
|
|
260
260
|
>
|
|
261
261
|
<span class="dpk-settings-text"><span class="dpk-settings-name">${t.label}</span></span>
|
|
262
|
-
</button>`},
|
|
263
|
-
id=${
|
|
262
|
+
</button>`},_u=(t,e,n)=>{if(!t.open)return b;const s=t.groups.filter(i=>i.entries.length>0);return m`<div
|
|
263
|
+
id=${Bo}
|
|
264
264
|
class="dpk-settings dpk-context-menu"
|
|
265
265
|
popover="manual"
|
|
266
266
|
role="menu"
|
|
@@ -268,20 +268,20 @@ import{s as C,o as O,v as $,E as Vd,T as Yd,n as Zd,K as le,j as x,c as wt,B as
|
|
|
268
268
|
aria-label=${e.menu}
|
|
269
269
|
@keydown=${n.onKeyDown}
|
|
270
270
|
>
|
|
271
|
-
${s.map((i,r)=>m`${r>0?m`<hr class="dpk-context-menu-divider" />`:b}${i.heading===void 0?b:m`<div class="dpk-context-menu-heading">${i.heading}</div>`}${i.entries.map(o=>
|
|
272
|
-
</div>`},xu={width:220,height:420},wu=t=>t.closest('input, textarea, [contenteditable=""], [contenteditable="true"]')!==null;class yu{#e;#n;#s;#t=qs;#i=null;#r=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this),new pn(e,{open:()=>this.#t.open,closesOn:s=>this.#i===null||!s.includes(this.#i),ownsEscape:()=>this.#t.open,dismiss:()=>this.#l()}),this.#s={onHover:s=>this.#d(s),onInvoke:s=>this.#c(s),onKeyDown:s=>this.#u(s)}}hostConnected(){this.#e.addEventListener("contextmenu",this.#h)}hostDisconnected(){this.#e.removeEventListener("contextmenu",this.#h),this.#a()}hostUpdated(){const e=this.#e.shadowRoot?.getElementById(No)??null;if(!this.#t.open||e===null){this.#a();return}(this.#i!==e||this.#r===null||this.#r.x!==this.#t.x||this.#r.y!==this.#t.y)&&(this.#o?.(),An(e),this.#o=Ns(e,To(this.#t.x,this.#t.y),xu,{placement:"right-start"}),this.#i=e,this.#r={x:this.#t.x,y:this.#t.y},e.focus())}render(){return vu(this.#t,this.#n.messages(),this.#s)}#a(){this.#i!==null&&(An(this.#i),this.#o?.(),this.#o=null,this.#i=null,this.#r=null)}#l(){this.#t=qs,this.#e.requestUpdate()}#d(e){this.#t={...this.#t,activeId:e},this.#e.requestUpdate()}#c(e){if(e.kind==="submenu"){this.#t=Oo(this.#t,e.id),this.#e.requestUpdate();return}e.disabled!==!0&&(this.#l(),e.run())}#u=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.#t=Mo(this.#t,1),this.#e.requestUpdate();return;case"ArrowUp":e.preventDefault(),this.#t=Mo(this.#t,-1),this.#e.requestUpdate();return;case"ArrowRight":e.preventDefault(),this.#t=_o(this.#t),this.#e.requestUpdate();return;case"ArrowLeft":e.preventDefault(),this.#t=iu(this.#t),this.#e.requestUpdate();return;case"Enter":case" ":{e.preventDefault();const n=ru(this.#t);this.#t=n.state,this.#e.requestUpdate(),n.run?.();return}case"Escape":e.preventDefault(),this.#l();return;case"Tab":this.#l();return;default:return}};#h=e=>{if(e.defaultPrevented||e.shiftKey)return;const n=e.composedPath(),s=fu(n);if(s!==null&&wu(s))return;e.preventDefault();const i=mu(n),r=gu(n,{clientX:e.clientX,clientY:e.clientY,target:i,origin:s}),o=tu({host:this.#e,state:this.#n.state(),target:i,targetElement:bu(n),resetViewElement:ku(n,"resetView"),messages:this.#n.messages()}),a=o===null?r:[...r,o];this.#t=nu(e.clientX,e.clientY,a),this.#e.requestUpdate()}}const Tn=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},js=["en","ja"],Ho="en",Bo=t=>js.some(e=>e===t),Rn=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Bo(e)?e:Ho},jo=t=>Rn(Tn(t)),Fs="dpk-locale-change",Fo=t=>typeof t=="string"&&Bo(t)?t:null,$u=t=>t.preference??t.authored,Su=(t,e)=>t===e?null:t,Ne=t=>e=>e==="ja"?t.ja:t.en,Go=Ne({en:{menu:"Context menu",copyText:"Copy text",feedback:"Give feedback",reviewComment:"Review comment",resetView:"Reset view",resetPositions:"Reset positions",duplicate:"Duplicate",delete:"Delete"},ja:{menu:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30E1\u30CB\u30E5\u30FC",copyText:"\u30C6\u30AD\u30B9\u30C8\u3092\u30B3\u30D4\u30FC",feedback:"\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3059\u308B",reviewComment:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",resetView:"\u8868\u793A\u3092\u30EA\u30BB\u30C3\u30C8",resetPositions:"\u4F4D\u7F6E\u3092\u30EA\u30BB\u30C3\u30C8",duplicate:"\u8907\u88FD",delete:"\u524A\u9664"}}),Wo=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Ko(t){return typeof Wo.Buffer<"u"&&Wo.Buffer.isBuffer(t)}function Vo(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function Yo(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Zo(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Au="[object RegExp]",Eu="[object String]",Cu="[object Number]",Tu="[object Boolean]",Ru="[object Symbol]",Mu="[object Date]",Ou="[object Map]",_u="[object Set]",Pu="[object Array]",Lu="[object Function]",zu="[object ArrayBuffer]",Gs="[object Object]",Iu="[object Error]",Du="[object DataView]",Nu="[object Uint8Array]",qu="[object Uint8ClampedArray]",Uu="[object Uint16Array]",Hu="[object Uint32Array]",Bu="[object BigUint64Array]",ju="[object Int8Array]",Fu="[object Int16Array]",Gu="[object Int32Array]",Wu="[object BigInt64Array]",Ku="[object Float32Array]",Vu="[object Float64Array]";function Yu(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Zu(t,e,n){return It(t,e,void 0,void 0,void 0,void 0,n)}function It(t,e,n,s,i,r,o){const a=o(t,e,n,s,i,r);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return Dt(t,e,r,o)}return Dt(t,e,r,o)}function Dt(t,e,n,s){if(Object.is(t,e))return!0;let i=Zo(t),r=Zo(e);if(i==="[object Arguments]"&&(i=Gs),r==="[object Arguments]"&&(r=Gs),i!==r)return!1;switch(i){case Eu:return t.toString()===e.toString();case Cu:return Yu(t.valueOf(),e.valueOf());case Tu:case Mu:case Ru:return Object.is(t.valueOf(),e.valueOf());case Au:return t.source===e.source&&t.flags===e.flags;case Lu:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(i){case Ou:if(t.size!==e.size)return!1;for(const[l,p]of t.entries())if(!e.has(l)||!It(p,e.get(l),l,t,e,n,s))return!1;return!0;case _u:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),p=Array.from(e.values());for(let h=0;h<l.length;h++){const d=l[h],f=p.findIndex(c=>It(d,c,void 0,t,e,n,s));if(f===-1)return!1;p.splice(f,1)}return!0}case Pu:case Nu:case qu:case Uu:case Hu:case Bu:case ju:case Fu:case Gu:case Wu:case Ku:case Vu:if(Ko(t)!==Ko(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!It(t[l],e[l],l,t,e,n,s))return!1;return!0;case zu:return t.byteLength!==e.byteLength?!1:Dt(new Uint8Array(t),new Uint8Array(e),n,s);case Du:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Dt(new Uint8Array(t),new Uint8Array(e),n,s);case Iu:return t.name===e.name&&t.message===e.message;case Gs:{if(!(Dt(t.constructor,e.constructor,n,s)||Vo(t)&&Vo(e)))return!1;const l=[...Object.keys(t),...Yo(t)],p=[...Object.keys(e),...Yo(e)];if(l.length!==p.length)return!1;for(let h=0;h<l.length;h++){const d=l[h],f=t[d];if(!Object.hasOwn(e,d))return!1;const c=e[d];if(!It(f,c,d,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Qu(){}function Mn(t,e){return Zu(t,e,Qu)}const Qo=O({id:$(x(),E(1)),type:K(I),target:O({type:$(x(),E(1)),id:$(x(),E(1))}),payload:O({body:$(x(),E(1))}),note:W(x()),createdAt:$(x(),E(1))}),Ws={schema:Qo,mode:"append",targetType:"page"},Xu=O({body:x()}),Nt=t=>{const e=C(Xu,t.payload);return e.success?e.output.body:""},Ks="data-dpk-grill",re="grill",On="answer",qt="data-grill-questions",Ju=W(x()),Xo=t=>{const e=t?.trim();return e===void 0||e===""?void 0:e},eg=t=>{const e=Xo(t);return e===void 0?{}:{questions:e}},st={questions:[],rounds:[]},tg=z({id:tr,label:$(x(),E(1))}),Jo=z({id:tr,ref:D($(x(),E(1))),title:$(x(),E(1)),description:D(x()),note:D(x()),options:D(H(tg),[]),freeText:D(Xi(),!0)}),ea=er("kind",[z({kind:K("option"),optionId:$(x(),E(1))}),z({kind:K("free"),text:x()})]),ta=er("kind",[...ea.options,z({kind:K("clear")})]),ng=z({...Jo.entries,answer:D(ea)}),sg=z({label:D($(x(),E(1))),questions:H(ng)}),ig=z({questions:H(Jo),history:D(H(sg),[])}),na=t=>{const e=new Set;return t.map((n,s)=>{if(e.has(n.id))throw new Error(`duplicate question id: ${n.id}`);e.add(n.id);const i=new Set;for(const r of n.options){if(i.has(r.id))throw new Error(`duplicate option id: ${r.id} in question ${n.id}`);i.add(r.id)}return{...n,ref:n.ref??`Q${s+1}`,description:n.description??null,note:n.note??null}})},sa=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),rg=t=>{const e=t.answer??null;if(e?.kind==="option"&&!t.options.some(n=>n.id===e.optionId))throw new Error(`unknown option id: ${e.optionId} in question ${t.id}`);return{...sa(t),answer:e}},og=t=>{const e=nn(ig,t);return{questions:na(e.questions).map(sa),rounds:e.history.map((n,s)=>({label:n.label??`v${s+1}`,questions:na(n.questions).map(rg)}))}},it=(t,e)=>t.questions.find(n=>n.id===e),Vs=(t,e)=>{const n=it(t,e);return n?`${n.ref} \xB7 ${n.title}`:e},_n=(t,e)=>e?e.kind==="option"?t.options.find(n=>n.id===e.optionId)?.label??"":e.text.trim():"",Pn=(t,e)=>_n(t,e)!=="",ag=t=>{let e="";for(let n=t+1;n>0;n=Math.floor((n-1)/26))e=String.fromCharCode(97+(n-1)%26)+e;return e},ia=(t,e)=>({total:t.questions.length,answered:t.questions.filter(n=>Pn(n,e[n.id])).length}),lg=(t,e,n)=>{const s=t.questions,i=s.findIndex(o=>o.id===n);return(i===-1?s:[...s.slice(i+1),...s.slice(0,i)]).find(o=>!Pn(o,e[o.id]))?.id??null},dg=$(x(),le(/^[A-Za-z0-9_-]+(?:@[A-Za-z0-9_-]+)?$/,"a question id, optionally qualified by its board (`retry@scope`)")),cg=O({id:$(x(),E(1)),type:K(On),target:O({type:K(re),id:dg}),payload:ta,note:W(x()),createdAt:$(x(),E(1))}),pg={schema:cg,mode:"patch",targetType:re},Y=t=>t.type===On&&t.target.type===re,hg=(t,e)=>({type:On,target:{type:re,id:t},payload:e}),ra=t=>{const e=C(ta,t.payload);return e.success?e.output:null},ug=(t,e)=>[...t.filter(n=>!(Y(n)&&n.target.id===e.target.id)),e],oa=(t,e,n)=>{const s=it(t,n.target.id),i=ra(n);if(!s||!i)return null;const r=e[s.id];if(i.kind==="clear"){if(r===void 0)return e;const o={...e};return delete o[s.id],o}return i.kind==="option"&&!s.options.some(o=>o.id===i.optionId)||i.kind==="free"&&!s.freeText?null:r?.kind==="option"&&i.kind==="option"&&r.optionId===i.optionId||r?.kind==="free"&&i.kind==="free"&&r.text===i.text?e:{...e,[s.id]:i}},Ys="page",Zs="app",aa=t=>_(t),la=(t,e,n,s=new Map,i=st)=>{let r=e,o={};const a=[],l=[],p=[],h=[],d=new Map;for(const c of n){if(c.type===I)continue;if(ne(c)){const k=s.get(c.id);k===void 0||k.stale!==void 0?l.push({action:c,reason:k?.stale??"target-missing"}):a.push(c);continue}if(Y(c)){const k=oa(i,o,c);k===null?l.push({action:c,reason:it(i,c.target.id)?"constraint-violated":"target-missing"}):k===o?p.push(c):(o=k,a.push(c));continue}const g=St(t.actions,c.type);if(!g){l.push({action:c,reason:"unsupported-action-type"});continue}const u=t.apply(r,c);if(u===null){l.push({action:c,reason:t.hasTarget(r,c.target)?"constraint-violated":"target-missing"});continue}if(g.mode!=="append"&&Qs(t,r,u)){p.push(c);continue}r=u,a.push(c)}for(const c of n){if(c.type!==I)continue;if(!(c.target.type===Ys||c.target.type===Zs?t.pageTargetExists?.(r,c.target)??!0:t.hasTarget(r,c.target))){l.push({action:c,reason:"target-missing"});continue}h.push(c);const k=aa(c.target);d.set(k,[...d.get(k)??[],c])}const f=new Map(n.map((c,g)=>[c.id,g]));return l.sort((c,g)=>(f.get(c.action.id)??0)-(f.get(g.action.id)??0)),{base:e,state:r,actions:n,applied:a,stale:l,obsolete:p,comments:h,commentsByTarget:d,grill:i,answers:o}},Qs=(t,e,n)=>e===n?!0:t.canonicalState===void 0?Mn(e,n):Mn(t.canonicalState(e),t.canonicalState(n)),da=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},gg=(t,e,n,s)=>{let i=e;const r=s??ca(i).map(o=>o.id);for(const o of[...r].reverse())i=fg(t,i,n,o,s!==void 0)??i;return i},ca=t=>t.applied.filter(e=>!ne(e)&&!Y(e)),fg=(t,e,n,s,i)=>{const r=ca(e),o=r.findIndex(u=>u.id===s),a=r[o];if(a===void 0)return null;const l=r.slice(0,o),p=Xs(t,a),h=!t.hasTarget(e.state,a.target)||/^(?:DELETE|REMOVE)_/.test(a.type),d=p==="sequence"||h,f=[...i&&d?mg(t,e.base,r,o):[],...d?kg(t,l,a):[]],c=new Set,g=f.filter(u=>{const k=u.join(" ");return c.has(k)?!1:(c.add(k),!0)}).sort((u,k)=>k.length-u.length);for(const u of g){const k=bg(t,e,n,u);if(k!==null)return k}return null},mg=(t,e,n,s)=>{const i=[];let r=e;for(const o of n.slice(0,s+1))i.push(r),r=t.apply(r,o)??r;return i.flatMap((o,a)=>Qs(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},kg=(t,e,n)=>{const s=pa(n),i=e.filter(l=>pa(l).some(p=>s.includes(p))),r=Xs(t,n),o=i.filter(l=>Xs(t,l)===r),a=l=>l.map((p,h)=>[...l.slice(h).map(d=>d.id),n.id]);return[...a(i),...a(o),...i.map(l=>[l.id,n.id]),...i.map(l=>[l.id])]},pa=t=>{const n=t.target.type===Ys||t.target.type===Zs?[]:t.target.id.split("."),s=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(i=>typeof i=="string"&&i!==""):[];return[...n,...s]},Xs=(t,e)=>St(t.actions,e.type)?.mode,bg=(t,e,n,s)=>{const i=new Set(e.stale.map(o=>o.action.id)),r=new Set(s);for(;;){const o=n(e.actions.filter(l=>!r.has(l.id))),a=o.stale.filter(l=>!i.has(l.action.id)).map(l=>l.action);if(a.length===0)return Qs(t,o.state,e.state)?o:null;if(a.some(l=>l.type===I||ne(l)||Y(l)))return null;for(const l of a)r.add(l.id)}},vg={en:"English",ja:"\u65E5\u672C\u8A9E"},R=Ne({en:{review:"Review",reviewChanges:"Activity log",reviewComments:"Review comments",settings:"Settings",menu:"Page menu",menuMove:"Move this menu",menuReturn:"Put the menu back in the header",settingsDisplay:"Display",settingsAppearance:"Appearance",settingsTheme:"Theme",themeLight:"Light",themeDark:"Dark",settingsClose:"Close settings",settingsSections:"Settings sections",undoRedo:"Undo / redo",undo:"Undo",redo:"Redo",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",versionLabel:"dev-process-kit version (reloads the page)",versionPinned:"Pinned by the page",versionLatest:t=>`${t} (latest)`,baseDataError:"Could not read the base data (showing an empty page)",pageEmpty:"This page holds no view or board",pageEmptyHint:"A page holds exactly one <dpk-view-*> or <dpk-board-*>.",pageUnavailable:"This page could not show its content",pageUnavailableHint:t=>`No loaded entry defines <${t}>. Load the entry that carries it.`,memo:"Memo",supplements:"Supplements",openSupplements:"Open supplements",closeSupplements:"Close supplements",resizeSupplements:"Resize supplements",resizeSupplementsHint:"Drag, or use the arrow keys, to change the height (double-click to reset)",handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log",grill:"Questions",grillError:"Could not read the questions",grillGroup:"Question",grillProgress:(t,e)=>`${t} of ${e} answered`,grillAnswer:"Answer",grillAnswerFree:"Answer in your own words",grillAnswerClear:"Clear answer",grillQuoted:t=>`\u2192 \u201C${t}\u201D`,grillOpen:t=>`Open question ${t}`,grillFreeText:"Your own answer",grillFreeTextOf:t=>`Your own answer to ${t}`,grillFreeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",grillRoundSelect:"Question round",grillCurrentRound:"Current questions",grillRoundOption:(t,e)=>`${t} (${e})`,grillPastRound:t=>`${t}: earlier questions, read-only`,grillUnanswered:"Not answered",grillNoQuestions:"No questions in this round.",checkMode:"Check Mode",checkModeOn:"Turn off Check Mode",checkModeOff:"Turn on Check Mode",checkModeUnchecked:"Mark as checked",checkModeChecked:"Checked \u2014 click to unmark",checkModeStale:"Changed since you checked it \u2014 click to check again",checkModeConfirmTitle:"Turn off Check Mode?",checkModeConfirmBody:"Every checkmark on this page will be cleared. This only affects what you see; it is never sent to the agent.",checkModeConfirmOk:"Turn off",checkModeConfirmCancel:"Cancel",syncConnecting:"Syncing",syncSynced:"Synced",syncPending:t=>`${t} unsent`,syncOffline:"Offline",syncError:"Sync error",syncStatus:"Sharing",clearSharedTitle:"Clear the shared draft?",clearSharedBody:"Everything you see now disappears, including other people\u2019s changes. What others add while this is open stays.",clearSharedOk:"Clear all",clearSharedCancel:"Cancel"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewChanges:"\u64CD\u4F5C\u30ED\u30B0",reviewComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",settings:"\u8A2D\u5B9A",menu:"\u30DA\u30FC\u30B8\u306E\u30E1\u30CB\u30E5\u30FC",menuMove:"\u3053\u306E\u30E1\u30CB\u30E5\u30FC\u3092\u79FB\u52D5",menuReturn:"\u30E1\u30CB\u30E5\u30FC\u3092\u30D8\u30C3\u30C0\u30FC\u306B\u623B\u3059",settingsDisplay:"\u8868\u793A",settingsAppearance:"\u5916\u89B3",settingsTheme:"\u30C6\u30FC\u30DE",themeLight:"\u30E9\u30A4\u30C8",themeDark:"\u30C0\u30FC\u30AF",settingsClose:"\u8A2D\u5B9A\u3092\u9589\u3058\u308B",settingsSections:"\u8A2D\u5B9A\u306E\u30BB\u30AF\u30B7\u30E7\u30F3",undoRedo:"\u53D6\u308A\u6D88\u3057\u30FB\u3084\u308A\u76F4\u3057",undo:"\u53D6\u308A\u6D88\u3057",redo:"\u3084\u308A\u76F4\u3057",useLightTheme:"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B",useDarkTheme:"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B",language:"\u8A00\u8A9E",versionLabel:"dev-process-kit \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u307E\u3059\uFF09",versionPinned:"\u30DA\u30FC\u30B8\u6307\u5B9A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3",versionLatest:t=>`${t}\uFF08\u6700\u65B0\uFF09`,baseDataError:"base data \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u7A7A\u306E\u30DA\u30FC\u30B8\u3068\u3057\u3066\u8868\u793A\u4E2D\uFF09",pageEmpty:"\u3053\u306E\u30DA\u30FC\u30B8\u306B\u306F view \u3082 board \u3082\u3042\u308A\u307E\u305B\u3093",pageEmptyHint:"\u30DA\u30FC\u30B8\u306B\u306F <dpk-view-*> \u304B <dpk-board-*> \u3092\u3072\u3068\u3064\u7F6E\u304D\u307E\u3059\u3002",pageUnavailable:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u5185\u5BB9\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",pageUnavailableHint:t=>`<${t}> \u3092\u5B9A\u7FA9\u3059\u308B entry \u304C\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u305D\u306E entry \u3092\u8AAD\u307F\u8FBC\u3093\u3067\u304F\u3060\u3055\u3044\u3002`,memo:"\u30E1\u30E2",supplements:"\u88DC\u8DB3\u60C5\u5831",openSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u958B\u304F",closeSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u9589\u3058\u308B",resizeSupplements:"\u88DC\u8DB3\u60C5\u5831\u306E\u9AD8\u3055\u3092\u5909\u3048\u308B",resizeSupplementsHint:"\u30C9\u30E9\u30C3\u30B0\u3001\u307E\u305F\u306F\u77E2\u5370\u30AD\u30FC\u3067\u9AD8\u3055\u3092\u5909\u3048\u308B\uFF08\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u65E2\u5B9A\u306B\u623B\u3059\uFF09",handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grill:"\u8CEA\u554F",grillError:"\u8CEA\u554F\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grillGroup:"\u8CEA\u554F",grillProgress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,grillAnswer:"\u56DE\u7B54",grillAnswerFree:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",grillAnswerClear:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",grillQuoted:t=>`\u2192 \u300C${t}\u300D`,grillOpen:t=>`\u8CEA\u554F ${t} \u3092\u3072\u3089\u304F`,grillFreeText:"\u81EA\u7531\u8A18\u8FF0",grillFreeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,grillFreeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",grillRoundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",grillCurrentRound:"\u73FE\u5728\u306E\u8CEA\u554F",grillRoundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,grillPastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,grillUnanswered:"\u672A\u56DE\u7B54",grillNoQuestions:"\u3053\u306E\u30E9\u30A6\u30F3\u30C9\u306B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002",checkMode:"\u78BA\u8A8D\u30E2\u30FC\u30C9",checkModeOn:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u7D42\u4E86",checkModeOff:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u958B\u59CB",checkModeUnchecked:"\u78BA\u8A8D\u6E08\u307F\u306B\u3059\u308B",checkModeChecked:"\u78BA\u8A8D\u6E08\u307F\uFF08\u30AF\u30EA\u30C3\u30AF\u3067\u89E3\u9664\uFF09",checkModeStale:"\u3053\u306E\u78BA\u8A8D\u5F8C\u306B\u5909\u66F4\u304C\u3042\u308A\u307E\u3059\uFF08\u30AF\u30EA\u30C3\u30AF\u3067\u518D\u78BA\u8A8D\uFF09",checkModeConfirmTitle:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u7D42\u4E86\u3057\u307E\u3059\u304B?",checkModeConfirmBody:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u306F\u3059\u3079\u3066\u6D88\u3048\u307E\u3059\u3002\u8868\u793A\u3060\u3051\u306E\u72B6\u614B\u306A\u306E\u3067\u3001Agent \u306B\u306F\u9001\u3089\u308C\u307E\u305B\u3093\u3002",checkModeConfirmOk:"\u7D42\u4E86\u3059\u308B",checkModeConfirmCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",syncConnecting:"\u540C\u671F\u4E2D",syncSynced:"\u540C\u671F\u6E08\u307F",syncPending:t=>`\u672A\u9001\u4FE1 ${t} \u4EF6`,syncOffline:"\u30AA\u30D5\u30E9\u30A4\u30F3",syncError:"\u30A8\u30E9\u30FC",syncStatus:"\u5171\u6709",clearSharedTitle:"\u5171\u6709\u4E2D\u306E\u30C9\u30E9\u30D5\u30C8\u3092\u3059\u3079\u3066\u6D88\u3057\u307E\u3059\u304B?",clearSharedBody:"\u307B\u304B\u306E\u4EBA\u306E\u5909\u66F4\u3082\u542B\u3081\u3066\u3001\u4ECA\u898B\u3048\u3066\u3044\u308B\u3082\u306E\u304C\u3059\u3079\u3066\u6D88\u3048\u307E\u3059\u3002\u3053\u306E\u78BA\u8A8D\u4E2D\u306B\u307B\u304B\u306E\u4EBA\u304C\u52A0\u3048\u305F\u3082\u306E\u306F\u6B8B\u308A\u307E\u3059\u3002",clearSharedOk:"\u3059\u3079\u3066\u6D88\u3059",clearSharedCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),xg=(t,e,n)=>{const s=ra(n);if(s===null)return{title:n.type,tone:"meta"};if(s.kind==="clear")return{title:t.grillAnswerClear,tone:"delete"};if(s.kind==="option"){const i=it(e,n.target.id)?.options.find(r=>r.id===s.optionId);return{title:t.grillAnswer,tone:"update",summary:t.grillQuoted(i?.label??s.optionId)}}return{title:t.grillAnswerFree,tone:"update",summary:t.grillQuoted(s.text.slice(0,120))}},wg=(t,e)=>{const{grill:n}=e,s=R(e.locale);return{...t,hasTarget:(i,r)=>r.type===re?it(n,r.id)!==void 0:t.hasTarget(i,r),commentTargets:(i,r)=>[...t.commentTargets(i,r),...n.questions.map(o=>({value:_({type:re,id:o.id}),label:Vs(n,o.id),group:s.grillGroup}))],describe:(i,r,o)=>{const a=Vs(n,i.target.id);if(Y(i)){const{title:p,summary:h,tone:d}=xg(s,n,i);return{title:p,tone:d,targetLabel:a,...h===void 0?{}:{summary:h}}}const l=t.describe(i,r,o);return i.target.type===re?{...l,targetLabel:a}:l},serialize:i=>Y(i)?`${i.type} ${_(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},yg=O({v:K(1),template:$(x(),E(1)),actions:H(yt())});class Js{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=C(yg,JSON.parse(s));return!i.success||i.output.template!==n?[]:i.output.actions.flatMap(r=>{const o=C(wt,r);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const i={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(i))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class ei{constructor(){this.store=new Map}load(e,n){return new Js({getItem:s=>this.store.get(s)??null,setItem:(s,i)=>{this.store.set(s,i)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const ti=()=>{try{if(typeof localStorage<"u")return new Js(localStorage)}catch{}return new ei},rt=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,ni=new Set,$g=(t,e)=>ha({self:t,confirmed:[],cursor:void 0,marks:[],seq:0,pending:[]},e),ha=(t,e)=>({...t,pending:e.map(n=>t.pending.find(s=>nr(s.op,n))??{op:n,covers:ni})}),Sg=t=>t.cursor!==void 0,Ut=t=>t.pending.reduce((e,{op:n,covers:s})=>{switch(n.kind){case"append":return e.some(i=>i.action.id===n.action.id)?e:[...e,{action:n.action,author:t.self}];case"remove":return e.filter(i=>i.action.id!==n.id);case"clear":return e.filter(i=>!s.has(i.action.id))}},t.confirmed.map(({entry:e})=>e)),Ag=t=>Ut(t).map(e=>e.action),Ht=(t,e)=>e.author?.id===t.self.id,ua=(t,e)=>t.pending.some(({op:n})=>n.kind==="append"&&n.action.id===e),ga=(t,e,n)=>{const s=t.seq+1,i=e.kind==="snapshot"?Eg(e.entries,s):Cg(t,e.ops,s);return{...t,confirmed:[...i],cursor:e.cursor,marks:[...e.kind==="snapshot"?[]:t.marks,{cursor:e.cursor,seq:s}].slice(-64),seq:s,pending:t.pending.filter(({op:r})=>n.some(o=>nr(o,r)))}},Eg=(t,e)=>{const n=new Set;return t.flatMap(s=>n.has(s.action.id)?[]:(n.add(s.action.id),[{entry:s,seq:e}]))},Cg=(t,e,n)=>e.reduce((s,i)=>{switch(i.kind){case"append":return s.some(({entry:r})=>r.action.id===i.entry.action.id)?s:[...s,{entry:i.entry,seq:n}];case"remove":return s.filter(({entry:r})=>r.action.id!==i.id);case"clear":{const r=t.marks.find(o=>o.cursor===i.upTo)?.seq??n-1;return s.filter(o=>o.seq>r)}}},t.confirmed),Tg=(t,e)=>{const n={kind:"append",action:e};return{log:{...t,pending:[...t.pending,{op:n,covers:ni}]},push:[n]}},fa=(t,e,n)=>{const s=Ut(t).find(o=>o.action.id===e);if(s===void 0)return{log:t,push:[]};if(!Ht(t,s)&&n?.others!==!0)return{log:t,push:[]};const i={kind:"remove",id:e},r=t.pending.filter(o=>!(o.op.kind==="append"&&o.op.action.id===e));return{log:{...t,pending:[...r,{op:i,covers:ni}]},push:[i]}},Rg=t=>t.cursor===void 0?null:{upTo:t.cursor,covers:new Set(t.confirmed.map(({entry:e})=>e.action.id))},Mg=(t,e)=>{const s=Ut(t).filter(r=>Ht(t,r)&&!(e?.covers.has(r.action.id)??!1)).reduce((r,o)=>{const a=fa(r.log,o.action.id);return{log:a.log,push:[...r.push,...a.push]}},{log:t,push:[]});if(e===null)return s;const i={kind:"clear",upTo:e.upTo};return{log:{...s.log,pending:[...s.log.pending,{op:i,covers:e.covers}]},push:[...s.push,i]}},ma=(t,e,n)=>{const s=new Set(e.map(l=>l.id)),i=Ut(t),r=new Set(i.map(l=>l.action.id)),a=i.filter(l=>!s.has(l.action.id)&&Og(t,l,n)).reduce((l,p)=>{const h=fa(l.log,p.action.id,{others:n==="any"});return{log:h.log,push:[...l.push,...h.push]}},{log:t,push:[]});return e.filter(l=>!r.has(l.id)).reduce((l,p)=>{const h=Tg(l.log,p);return{log:h.log,push:[...l.push,...h.push]}},a)},Og=(t,e,n)=>{switch(n){case"pending":return ua(t,e.action.id);case"own":return Ht(t,e);case"any":return!0}};class _g{constructor(e,n,s){this.host=e,this.readAction=n,this.onChange=s,this.#e=$g(e.self,[]),this.#c()}#e;#n=[];#s=[];#t=null;#i=[];#r="connecting";#o;#a=null;#l=0;#d=0;get self(){return this.#e.self}get actions(){return this.#s}get connected(){return Sg(this.#e)}get state(){return{status:this.#r,reason:this.#o,unsent:this.#u().length}}authorOf(e){const n=this.#n.find(s=>s.action.id===e);if(n!==void 0)return n.author??(Ht(this.#e,n)?this.#e.self:void 0)}isOwn(e){const n=this.#n.find(s=>s.action.id===e);return n!==void 0&&Ht(this.#e,n)}isPending(e){return ua(this.#e,e)}preview(e,n){return Ag(ma(this.#e,e,n).log)}change(e,n){this.#h(ma(this.#e,e,n))}clearMark(){return Rg(this.#e)}clear(e){this.#h(Mg(this.#e,e))}close(){this.#d+=1,this.#t?.close(),this.#t=null}reopen(){this.#t===null&&this.#c()}#c(){this.#d+=1;const e=this.#d;this.#a=[];const n=this.host.open({receive:i=>{if(e!==this.#d)return;const r=tc(i,this.readAction);r!==null&&(this.#a===null?this.#k(r):this.#a.push(r))},status:(i,r)=>{if(e!==this.#d)return;const o=this.#a===null?this.#u().length:this.#l;i===this.#r&&r?.reason===this.#o&&o===this.#l||(this.#r=i,this.#o=r?.reason,this.#l=o,this.#a===null&&this.onChange("status"))}});this.#t=n,this.#i.length>0&&n.push(this.#i),this.#i=[],this.#e=ha(this.#e,n.pending),this.#l=n.pending.length;const s=this.#a;this.#a=null;for(const i of s)this.#e=ga(this.#e,i,n.pending);this.#p()}#u(){return this.#t?.pending??this.#i}#h(e){this.#e=e.log,this.#p(),e.push.length!==0&&(this.#t===null?this.#i=[...this.#i,...e.push]:this.#t.push(e.push))}#k(e){this.#e=ga(this.#e,e,this.#u()),this.#p()&&this.onChange("received")}#p(){const e=Ut(this.#e);return Pg(this.#n,e)?!1:(this.#n=e,this.#s=e.map(n=>n.action),!0)}}const Pg=(t,e)=>t.length===e.length&&t.every((n,s)=>{const i=e[s];return i!==void 0&&n.action.id===i.action.id&&n.author?.id===i.author?.id&&n.author?.name===i.author?.name}),ka={redoStack:[]},Lg=(t,e)=>{const n=t.at(-1);return n===void 0?null:{actions:t.slice(0,-1),state:{redoStack:[...e.redoStack,n]}}},zg=(t,e)=>{const n=e.redoStack.at(-1);return n===void 0?null:{actions:[...t,n],state:{redoStack:e.redoStack.slice(0,-1)}}},Ig=()=>ka,Dg=t=>t.length>0,Ng=t=>t.redoStack.length>0,qg=H(yt());class ba{#e;#n;#s={targets:[],providers:[]};#t;#i=new Map;#r;#o;#a;#l;#d;#c=new Set;#u=[];#h=0;#k=ka;#p;#x=[];#A;#v=Oe;constructor(e){if(this.#e=e.definition,this.#A=e.settled??(()=>!1),this.#t=e.grill??{grill:st,locale:"en"},this.#n=this.#w(),this.#r=e.base,this.#d=e.storageKey??rt(e.definition.name),this.#p=e.sync===void 0?null:new _g(e.sync,s=>si(this.definition,[s])[0]??null,s=>this.#U(s)),this.#p!==null){this.#l=null,this.#o=this.#p.actions,this.#f(),this.#a=this.#m(this.#o);return}this.#l=e.storage===void 0?ti():e.storage;const n=e.initialActions??this.#l?.load(this.#d,this.definition.name)??[];this.#o=si(this.definition,n),this.#a=this.#m(this.#o),this.#H()&&this.#_()}get definition(){return this.#n}setComponentSnapshot(e){const n=nn(ah,e);if(!Mn(n,this.#s)){this.#s=n,this.#f(),this.#a=this.#m(this.#o);for(const s of this.#c)s()}}get componentSnapshot(){return this.#s}setTemplate(e){this.#e=e,this.#f(),this.#a=this.#m(this.#o);for(const n of this.#c)n()}setGrill(e){this.#t=e,this.#f(),this.#a=this.#m(this.#o);for(const n of this.#c)n()}setAddressed(e){if(e!==this.#v){if(this.#v=e,this.#p!==null){this.#M(this.#p)&&this.#E();return}this.#o.some(n=>As(e,n.id))&&this.#y(this.#o)}}#f(){this.#i=oo(this.#o,this.#s.providers),this.#n=this.#w()}#w(){return wg(co(this.#e,this.#s.targets,this.#i),this.#t)}#m(e){return la(this.definition,this.#r,e,oo(e,this.#s.providers),this.#t.grill)}get base(){return this.#r}get actions(){return this.#o}get derivation(){return this.#a}get lastIssues(){return this.#u}get prunedCount(){return this.#h}get canUndo(){const e=this.#p;return e!==null?this.#o.some(n=>e.isOwn(n.id)):Dg(this.#o)}get canRedo(){return this.#p!==null?this.#x.length>0:Ng(this.#k)}get sync(){return this.#p?.state??null}authorOf(e){return this.#p?.authorOf(e)}isOwnAction(e){return this.#p?.isOwn(e)??this.#o.some(n=>n.id===e)}close(){this.#p?.close()}reopen(){this.#p?.reopen()}descriptorFor(e,n){return va(this.definition,e,n)}dispatch(e){const n=this.#S(e,this.#a.state);if(!n.ok)return this.#$([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#y(xa(this.#o,n.action,s),{dispatched:[n.action.id]}),{ok:!0,id:n.action.id}):this.#$([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(qg,e);if(!n.success)return this.#$([Me(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let i=this.#o,r=this.#a.state,o=this.#a.answers;const a=[];for(const l of s){const p=this.#S(l,r);if(!p.ok)return this.#$([p.issue]);const h=p.action,d=this.descriptorFor(h.type,h.target);if(!d)return this.#$([{path:"type",message:"unknown action type"}]);if((Y(h)?oa(this.#t.grill,o,h)===null?null:r:h.type==="comment"||ne(h)?h.target.type==="page"||this.definition.hasTarget(r,h.target)?r:null:this.definition.apply(r,h))===null)return this.#$([{path:"target",message:"batch action is not applicable"}]);i=xa(i,h,d);const c=this.#m(i);r=c.state,o=c.answers,a.push(h.id)}return this.#y(i,{dispatched:a}),{ok:!0,ids:a}}#S(e,n){const s=C(Hr,e);if(!s.success)return{ok:!1,issue:Me(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?un(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=Sp(s.output,i);if(!r.ok)return r;const o=this.definition.canonicalTarget?.(n,r.action.target)??r.action.target;return{ok:!0,action:{...r.action,target:o}}}#$(e){return this.#u=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#o.find(a=>a.id===e);if(s?.type!==I)return this.#$([{path:"id",message:`no comment "${e}" in the draft`}]);if(Nt(s)===n)return{ok:!0,id:e};const i=C(Ws.schema,{...s,payload:{body:n}});if(!i.success)return this.#$([Me(i.issues)]);const r=C(wt,i.output);if(!r.success)return this.#$([Me(r.issues)]);const o=r.output;if(this.#p!==null){if(!this.#p.isOwn(e))return this.#$([{path:"id",message:`comment "${e}" is another reader's`}]);const a={...o,id:hn()};return this.#y(this.#o.map(l=>l===s?a:l),{dispatched:[a.id],reach:"own"}),{ok:!0,id:a.id}}return this.#y(this.#o.map(a=>a===s?o:a),{dispatched:[]}),{ok:!0,id:e}}removeAction(e){const n=this.#o.filter(s=>s.id!==e);n.length!==this.#o.length&&this.#y(n,{reach:"any"})}clearActions(){this.prepareClear()()}prepareClear(){const e=this.#p;if(e===null)return()=>{this.#o.length>0&&this.#y([])};const n=e.clearMark();return()=>{e.clear(n),this.#x=[],this.#E()}}replaceActions(e){this.#y(si(this.definition,e),{reach:"any"})}setBase(e){this.#r=e,this.#y(this.#o)}undo(){const e=this.#p;if(e!==null){const s=[...this.#o].reverse().find(i=>e.isOwn(i.id));return s===void 0?!1:(this.#x=[...this.#x,s],this.#y(this.#o.filter(i=>i!==s),{preserveRedo:!0,reach:"own"}),!0)}const n=Lg(this.#o,this.#k);return n===null?!1:(this.#k=n.state,this.#y([...n.actions],{preserveRedo:!0}),!0)}redo(){if(this.#p!==null){const n=this.#x.at(-1);if(n===void 0)return!1;this.#x=this.#x.slice(0,-1);const s={...n,id:hn()};return this.#y([...this.#o,s],{preserveRedo:!0,dispatched:[s.id]}),!0}const e=zg(this.#o,this.#k);return e===null?!1:(this.#k=e.state,this.#y([...e.actions],{preserveRedo:!0}),!0)}subscribe(e){return this.#c.add(e),()=>{this.#c.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#o}}#y(e,n){if(this.#p!==null){this.#C(this.#p,e,n);return}this.#u=[],this.#o=e,this.#f(),this.#a=this.#m(this.#o),this.#H(n?.dispatched),n?.preserveRedo!==!0&&(this.#k=Ig()),this.#_();for(const s of this.#c)s()}#C(e,n,s){this.#u=[];const i=new Set(this.#o.map(a=>a.id)),r=s?.reach??"pending",o=new Set(this.#m(e.preview(n,r)).obsolete.filter(a=>!i.has(a.id)||e.isPending(a.id)).map(a=>a.id));this.#h+=o.size,e.change(n.filter(a=>!o.has(a.id)),r),s?.preserveRedo!==!0&&(this.#x=[]),this.#E()}#U(e){const n=this.#p;if(n===null)return;if(e==="status"){for(const r of this.#c)r();return}const s=new Set(this.#a.stale.map(({action:r})=>r.id));this.#o=n.actions,this.#f(),this.#a=this.#m(this.#o);const i=new Set(this.#a.stale.filter(({action:r})=>r.type!==I&&!s.has(r.id)&&n.isPending(r.id)).map(({action:r})=>r.id));i.size>0&&n.change(this.#o.filter(r=>!i.has(r.id)),"pending"),this.#M(n),this.#E()}#M(e){const n=e.actions.filter(s=>As(this.#v,s.id));return n.length===0?!1:(this.#h+=n.length,e.change(e.actions.filter(s=>!n.includes(s)),"any"),!0)}#E(){this.#p!==null&&(this.#o=this.#p.actions),this.#f(),this.#a=this.#m(this.#o);for(const e of this.#c)e()}#H(e){const n=this.#K(),s=this.#z()||n,i=this.#B()||s,r=gg(this.definition,this.#a,o=>this.#m(o),e);return r===this.#a?i:(this.#h+=this.#o.length-r.actions.length,this.#o=[...r.actions],this.#f(),this.#a=this.#m(this.#o),this.#B(),!0)}#B(){return this.#a.obsolete.length===0?!1:(this.#h+=this.#a.obsolete.length,this.#o=da(this.#a),this.#f(),this.#a=this.#m(this.#o),!0)}#K(){const e=this.#o.filter(n=>!As(this.#v,n.id));return e.length===this.#o.length?!1:(this.#h+=this.#o.length-e.length,this.#o=e,this.#f(),this.#a=this.#m(this.#o),!0)}#z(){if(!this.#A())return!1;const e=new Set(this.#a.stale.filter(({action:n,reason:s})=>s==="target-missing"&&Mt(n.target)===null).map(({action:n})=>n.id));return e.size===0?!1:(this.#h+=e.size,this.#o=this.#o.filter(n=>!e.has(n.id)),this.#f(),this.#a=this.#m(this.#o),!0)}#_(){this.#l?.save(this.#d,this.definition.name,this.#o)}}const va=(t,e,n)=>e==="comment"?Ws:e===On?pg:n!==void 0&&ne({type:e,target:n})?ih:t.actionFor?t.actionFor(e,n):St(t.actions,e),xa=(t,e,n)=>Y(e)?ug(t,e):Br(t,e,n),si=(t,e)=>e.flatMap(n=>{const s=C(wt,n);if(!s.success)return[];const i=s.output,r=va(t,i.type,i.target);if(!r)return[];const o=C(r.schema,i);if(!o.success)return[];const a=C(wt,o.output);return a.success?[a.output]:[]}),Ug='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',Hg=()=>{if(typeof document>"u")return null;let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t instanceof HTMLElement?t:null},Bg=t=>{const e=t.querySelector("[autofocus]");if(e)return e;for(const n of t.querySelectorAll(Ug))if(!(n.hidden||n.closest("[hidden]")!==null))return n;return null},jg=t=>typeof t.showModal=="function",Ln=t=>{const e=t.open;return typeof e=="boolean"?e:t.hasAttribute("open")},Fg=t=>{if(jg(t)){t.showModal();return}t.setAttribute("open","")},wa=t=>{if(typeof t.close=="function"){t.close();return}Ln(t)&&(t.removeAttribute("open"),t.dispatchEvent(new Event("close")))},Gg="dpk-dialog-close";class Wg{constructor(e,n){this.#s=null,this.#t="close",this.handlers={cancel:s=>{s.preventDefault(),this.dismiss("escape")},close:()=>this.#o(),click:s=>{s.target===this.#n.dialog()&&this.dismiss("backdrop")}},this.#i=s=>{if(s.button!==0||!this.#n.open())return;const i=this.#n.dialog();i===null||s.composedPath().includes(i)||this.dismiss("backdrop")},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#t;hostConnected(){document.addEventListener("pointerdown",this.#i,!0)}hostUpdated(){const e=this.#n.dialog();if(e!==null){if(this.#n.open()){Ln(e)||this.#r(e);return}Ln(e)&&wa(e)}}hostDisconnected(){document.removeEventListener("pointerdown",this.#i,!0);const e=this.#n.dialog();e!==null&&Ln(e)&&wa(e),this.#s=null}#i;dismiss(e="close"){this.#t=e,this.#n.dismiss(e)}#r(e){this.#t="close",this.#s=Hg(),Fg(e);const n=Bg(e)??e;n===e&&!e.hasAttribute("tabindex")&&(e.tabIndex=-1),n.focus()}#o(){const e=this.#t,n=this.#s;this.#s=null,this.#n.open()&&this.#n.dismiss(e),n?.isConnected&&n.focus(),this.#e.dispatchEvent(new CustomEvent(Gg,{detail:{reason:e},bubbles:!0,composed:!0}))}}const ya=(t,e="json")=>`\`\`\`${e}
|
|
271
|
+
${s.map((i,r)=>m`${r>0?m`<hr class="dpk-context-menu-divider" />`:b}${i.heading===void 0?b:m`<div class="dpk-context-menu-heading">${i.heading}</div>`}${i.entries.map(o=>Fo(o,0,t,n))}`)}
|
|
272
|
+
</div>`},Pu={width:220,height:420},Lu=t=>t.closest('input, textarea, [contenteditable=""], [contenteditable="true"]')!==null;class zu{#e;#s;#t;#n=Hs;#i=null;#r=null;#o=null;constructor(e,n){this.#e=e,this.#s=n,e.addController(this),new un(e,{open:()=>this.#n.open,closesOn:s=>this.#i===null||!s.includes(this.#i),ownsEscape:()=>this.#n.open,dismiss:()=>this.#l()}),this.#t={onHover:s=>this.#c(s),onInvoke:s=>this.#d(s),onKeyDown:s=>this.#f(s)}}hostConnected(){this.#e.addEventListener("contextmenu",this.#u)}hostDisconnected(){this.#e.removeEventListener("contextmenu",this.#u),this.#a()}hostUpdated(){const e=this.#e.shadowRoot?.getElementById(Bo)??null;if(!this.#n.open||e===null){this.#a();return}(this.#i!==e||this.#r===null||this.#r.x!==this.#n.x||this.#r.y!==this.#n.y)&&(this.#o?.(),Cn(e),this.#o=Us(e,_o(this.#n.x,this.#n.y),Pu,{placement:"right-start"}),this.#i=e,this.#r={x:this.#n.x,y:this.#n.y},e.focus())}render(){return _u(this.#n,this.#s.messages(),this.#t)}#a(){this.#i!==null&&(Cn(this.#i),this.#o?.(),this.#o=null,this.#i=null,this.#r=null)}#l(){this.#n=Hs,this.#e.requestUpdate()}#c(e){this.#n={...this.#n,activeId:e},this.#e.requestUpdate()}#d(e){if(e.kind==="submenu"){this.#n=zo(this.#n,e.id),this.#e.requestUpdate();return}e.disabled!==!0&&(this.#l(),e.run())}#f=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.#n=Lo(this.#n,1),this.#e.requestUpdate();return;case"ArrowUp":e.preventDefault(),this.#n=Lo(this.#n,-1),this.#e.requestUpdate();return;case"ArrowRight":e.preventDefault(),this.#n=Io(this.#n),this.#e.requestUpdate();return;case"ArrowLeft":e.preventDefault(),this.#n=ku(this.#n),this.#e.requestUpdate();return;case"Enter":case" ":{e.preventDefault();const n=bu(this.#n);this.#n=n.state,this.#e.requestUpdate(),n.run?.();return}case"Escape":e.preventDefault(),this.#l();return;case"Tab":this.#l();return;default:return}};#u=e=>{if(e.defaultPrevented||e.shiftKey)return;const n=e.composedPath(),s=Tu(n);if(s!==null&&Lu(s))return;e.preventDefault();const i=Ru(n),r=Cu(n,{clientX:e.clientX,clientY:e.clientY,target:i,origin:s}),o=gu({host:this.#e,state:this.#s.state(),target:i,targetElement:Ou(n),resetViewElement:Mu(n,"resetView"),messages:this.#s.messages()}),a=o===null?r:[...r,o];this.#n=fu(e.clientX,e.clientY,a),this.#e.requestUpdate()}}const Mn=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},Gs=["en","ja"],Go="en",Wo=t=>Gs.some(e=>e===t),On=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Wo(e)?e:Go},Vo=t=>On(Mn(t)),Ws="dpk-locale-change",Ko=t=>typeof t=="string"&&Wo(t)?t:null,Iu=t=>t.preference??t.authored,Du=(t,e)=>t===e?null:t,Ne=t=>e=>e==="ja"?t.ja:t.en,Yo=Ne({en:{menu:"Context menu",copyText:"Copy text",feedback:"Give feedback",reviewComment:"Review comment",resetView:"Reset view",resetPositions:"Reset positions",duplicate:"Duplicate",delete:"Delete"},ja:{menu:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30E1\u30CB\u30E5\u30FC",copyText:"\u30C6\u30AD\u30B9\u30C8\u3092\u30B3\u30D4\u30FC",feedback:"\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3059\u308B",reviewComment:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",resetView:"\u8868\u793A\u3092\u30EA\u30BB\u30C3\u30C8",resetPositions:"\u4F4D\u7F6E\u3092\u30EA\u30BB\u30C3\u30C8",duplicate:"\u8907\u88FD",delete:"\u524A\u9664"}}),Zo=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Qo(t){return typeof Zo.Buffer<"u"&&Zo.Buffer.isBuffer(t)}function Xo(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function Jo(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function ea(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Nu="[object RegExp]",qu="[object String]",Uu="[object Number]",Hu="[object Boolean]",Bu="[object Symbol]",ju="[object Date]",Fu="[object Map]",Gu="[object Set]",Wu="[object Array]",Vu="[object Function]",Ku="[object ArrayBuffer]",Vs="[object Object]",Yu="[object Error]",Zu="[object DataView]",Qu="[object Uint8Array]",Xu="[object Uint8ClampedArray]",Ju="[object Uint16Array]",eg="[object Uint32Array]",tg="[object BigUint64Array]",ng="[object Int8Array]",sg="[object Int16Array]",ig="[object Int32Array]",rg="[object BigInt64Array]",og="[object Float32Array]",ag="[object Float64Array]";function lg(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function dg(t,e,n){return qt(t,e,void 0,void 0,void 0,void 0,n)}function qt(t,e,n,s,i,r,o){const a=o(t,e,n,s,i,r);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return Ut(t,e,r,o)}return Ut(t,e,r,o)}function Ut(t,e,n,s){if(Object.is(t,e))return!0;let i=ea(t),r=ea(e);if(i==="[object Arguments]"&&(i=Vs),r==="[object Arguments]"&&(r=Vs),i!==r)return!1;switch(i){case qu:return t.toString()===e.toString();case Uu:return lg(t.valueOf(),e.valueOf());case Hu:case ju:case Bu:return Object.is(t.valueOf(),e.valueOf());case Nu:return t.source===e.source&&t.flags===e.flags;case Vu:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(i){case Fu:if(t.size!==e.size)return!1;for(const[l,p]of t.entries())if(!e.has(l)||!qt(p,e.get(l),l,t,e,n,s))return!1;return!0;case Gu:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),p=Array.from(e.values());for(let h=0;h<l.length;h++){const d=l[h],f=p.findIndex(c=>qt(d,c,void 0,t,e,n,s));if(f===-1)return!1;p.splice(f,1)}return!0}case Wu:case Qu:case Xu:case Ju:case eg:case tg:case ng:case sg:case ig:case rg:case og:case ag:if(Qo(t)!==Qo(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!qt(t[l],e[l],l,t,e,n,s))return!1;return!0;case Ku:return t.byteLength!==e.byteLength?!1:Ut(new Uint8Array(t),new Uint8Array(e),n,s);case Zu:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Ut(new Uint8Array(t),new Uint8Array(e),n,s);case Yu:return t.name===e.name&&t.message===e.message;case Vs:{if(!(Ut(t.constructor,e.constructor,n,s)||Xo(t)&&Xo(e)))return!1;const l=[...Object.keys(t),...Jo(t)],p=[...Object.keys(e),...Jo(e)];if(l.length!==p.length)return!1;for(let h=0;h<l.length;h++){const d=l[h],f=t[d];if(!Object.hasOwn(e,d))return!1;const c=e[d];if(!qt(f,c,d,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function cg(){}function _n(t,e){return dg(t,e,cg)}const ta=O({id:$(x(),E(1)),type:V(I),target:O({type:$(x(),E(1)),id:$(x(),E(1))}),payload:O({body:$(x(),E(1))}),note:W(x()),createdAt:$(x(),E(1))}),Ks={schema:ta,mode:"append",targetType:"page"},pg=O({body:x()}),Ht=t=>{const e=C(pg,t.payload);return e.success?e.output.body:""},Ys="data-dpk-grill",re="grill",Pn="answer",Bt="data-grill-questions",hg=W(x()),na=t=>{const e=t?.trim();return e===void 0||e===""?void 0:e},ug=t=>{const e=na(t);return e===void 0?{}:{questions:e}},it={questions:[],rounds:[]},gg=z({id:sr,label:$(x(),E(1))}),sa=z({id:sr,ref:D($(x(),E(1))),title:$(x(),E(1)),description:D(x()),note:D(x()),options:D(H(gg),[]),freeText:D(er(),!0)}),ia=nr("kind",[z({kind:V("option"),optionId:$(x(),E(1))}),z({kind:V("free"),text:x()})]),ra=nr("kind",[...ia.options,z({kind:V("clear")})]),fg=z({...sa.entries,answer:D(ia)}),mg=z({label:D($(x(),E(1))),questions:H(fg)}),kg=z({questions:H(sa),history:D(H(mg),[])}),oa=t=>{const e=new Set;return t.map((n,s)=>{if(e.has(n.id))throw new Error(`duplicate question id: ${n.id}`);e.add(n.id);const i=new Set;for(const r of n.options){if(i.has(r.id))throw new Error(`duplicate option id: ${r.id} in question ${n.id}`);i.add(r.id)}return{...n,ref:n.ref??`Q${s+1}`,description:n.description??null,note:n.note??null}})},aa=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),bg=t=>{const e=t.answer??null;if(e?.kind==="option"&&!t.options.some(n=>n.id===e.optionId))throw new Error(`unknown option id: ${e.optionId} in question ${t.id}`);return{...aa(t),answer:e}},vg=t=>{const e=rn(kg,t);return{questions:oa(e.questions).map(aa),rounds:e.history.map((n,s)=>({label:n.label??`v${s+1}`,questions:oa(n.questions).map(bg)}))}},rt=(t,e)=>t.questions.find(n=>n.id===e),Zs=(t,e)=>{const n=rt(t,e);return n?`${n.ref} \xB7 ${n.title}`:e},Ln=(t,e)=>e?e.kind==="option"?t.options.find(n=>n.id===e.optionId)?.label??"":e.text.trim():"",zn=(t,e)=>Ln(t,e)!=="",xg=t=>{let e="";for(let n=t+1;n>0;n=Math.floor((n-1)/26))e=String.fromCharCode(97+(n-1)%26)+e;return e},la=(t,e)=>({total:t.questions.length,answered:t.questions.filter(n=>zn(n,e[n.id])).length}),wg=(t,e,n)=>{const s=t.questions,i=s.findIndex(o=>o.id===n);return(i===-1?s:[...s.slice(i+1),...s.slice(0,i)]).find(o=>!zn(o,e[o.id]))?.id??null},yg=$(x(),le(/^[A-Za-z0-9_-]+(?:@[A-Za-z0-9_-]+)?$/,"a question id, optionally qualified by its board (`retry@scope`)")),$g=O({id:$(x(),E(1)),type:V(Pn),target:O({type:V(re),id:yg}),payload:ra,note:W(x()),createdAt:$(x(),E(1))}),Sg={schema:$g,mode:"patch",targetType:re},Y=t=>t.type===Pn&&t.target.type===re,Ag=(t,e)=>({type:Pn,target:{type:re,id:t},payload:e}),da=t=>{const e=C(ra,t.payload);return e.success?e.output:null},Eg=(t,e)=>[...t.filter(n=>!(Y(n)&&n.target.id===e.target.id)),e],ca=(t,e,n)=>{const s=rt(t,n.target.id),i=da(n);if(!s||!i)return null;const r=e[s.id];if(i.kind==="clear"){if(r===void 0)return e;const o={...e};return delete o[s.id],o}return i.kind==="option"&&!s.options.some(o=>o.id===i.optionId)||i.kind==="free"&&!s.freeText?null:r?.kind==="option"&&i.kind==="option"&&r.optionId===i.optionId||r?.kind==="free"&&i.kind==="free"&&r.text===i.text?e:{...e,[s.id]:i}},Qs="page",Xs="app",pa=t=>_(t),ha=(t,e,n,s=new Map,i=it)=>{let r=e,o={};const a=[],l=[],p=[],h=[],d=new Map;for(const c of n){if(c.type===I)continue;if(ne(c)){const k=s.get(c.id);k===void 0||k.stale!==void 0?l.push({action:c,reason:k?.stale??"target-missing"}):a.push(c);continue}if(Y(c)){const k=ca(i,o,c);k===null?l.push({action:c,reason:rt(i,c.target.id)?"constraint-violated":"target-missing"}):k===o?p.push(c):(o=k,a.push(c));continue}const g=Et(t.actions,c.type);if(!g){l.push({action:c,reason:"unsupported-action-type"});continue}const u=t.apply(r,c);if(u===null){l.push({action:c,reason:t.hasTarget(r,c.target)?"constraint-violated":"target-missing"});continue}if(g.mode!=="append"&&Js(t,r,u)){p.push(c);continue}r=u,a.push(c)}for(const c of n){if(c.type!==I)continue;if(!(c.target.type===Qs||c.target.type===Xs?t.pageTargetExists?.(r,c.target)??!0:t.hasTarget(r,c.target))){l.push({action:c,reason:"target-missing"});continue}h.push(c);const k=pa(c.target);d.set(k,[...d.get(k)??[],c])}const f=new Map(n.map((c,g)=>[c.id,g]));return l.sort((c,g)=>(f.get(c.action.id)??0)-(f.get(g.action.id)??0)),{base:e,state:r,actions:n,applied:a,stale:l,obsolete:p,comments:h,commentsByTarget:d,grill:i,answers:o}},Js=(t,e,n)=>e===n?!0:t.canonicalState===void 0?_n(e,n):_n(t.canonicalState(e),t.canonicalState(n)),ua=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},Cg=(t,e,n,s)=>{let i=e;const r=s??ga(i).map(o=>o.id);for(const o of[...r].reverse())i=Tg(t,i,n,o,s!==void 0)??i;return i},ga=t=>t.applied.filter(e=>!ne(e)&&!Y(e)),Tg=(t,e,n,s,i)=>{const r=ga(e),o=r.findIndex(u=>u.id===s),a=r[o];if(a===void 0)return null;const l=r.slice(0,o),p=ei(t,a),h=!t.hasTarget(e.state,a.target)||/^(?:DELETE|REMOVE)_/.test(a.type),d=p==="sequence"||h,f=[...i&&d?Rg(t,e.base,r,o):[],...d?Mg(t,l,a):[]],c=new Set,g=f.filter(u=>{const k=u.join(" ");return c.has(k)?!1:(c.add(k),!0)}).sort((u,k)=>k.length-u.length);for(const u of g){const k=Og(t,e,n,u);if(k!==null)return k}return null},Rg=(t,e,n,s)=>{const i=[];let r=e;for(const o of n.slice(0,s+1))i.push(r),r=t.apply(r,o)??r;return i.flatMap((o,a)=>Js(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},Mg=(t,e,n)=>{const s=fa(n),i=e.filter(l=>fa(l).some(p=>s.includes(p))),r=ei(t,n),o=i.filter(l=>ei(t,l)===r),a=l=>l.map((p,h)=>[...l.slice(h).map(d=>d.id),n.id]);return[...a(i),...a(o),...i.map(l=>[l.id,n.id]),...i.map(l=>[l.id])]},fa=t=>{const n=t.target.type===Qs||t.target.type===Xs?[]:t.target.id.split("."),s=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(i=>typeof i=="string"&&i!==""):[];return[...n,...s]},ei=(t,e)=>Et(t.actions,e.type)?.mode,Og=(t,e,n,s)=>{const i=new Set(e.stale.map(o=>o.action.id)),r=new Set(s);for(;;){const o=n(e.actions.filter(l=>!r.has(l.id))),a=o.stale.filter(l=>!i.has(l.action.id)).map(l=>l.action);if(a.length===0)return Js(t,o.state,e.state)?o:null;if(a.some(l=>l.type===I||ne(l)||Y(l)))return null;for(const l of a)r.add(l.id)}},_g={en:"English",ja:"\u65E5\u672C\u8A9E"},R=Ne({en:{review:"Review",reviewChanges:"Activity log",reviewComments:"Review comments",settings:"Settings",menu:"Page menu",menuMove:"Move this menu",menuReturn:"Put the menu back in the header",settingsDisplay:"Display",settingsAppearance:"Appearance",settingsTheme:"Theme",themeLight:"Light",themeDark:"Dark",settingsClose:"Close settings",settingsSections:"Settings sections",undoRedo:"Undo / redo",undo:"Undo",redo:"Redo",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",versionLabel:"dev-process-kit version (reloads the page)",versionPinned:"Pinned by the page",versionLatest:t=>`${t} (latest)`,baseDataError:"Could not read the base data (showing an empty page)",pageEmpty:"This page holds no view or board",pageEmptyHint:"A page holds exactly one <dpk-view-*> or <dpk-board-*>.",pageUnavailable:"This page could not show its content",pageUnavailableHint:t=>`No loaded entry defines <${t}>. Load the entry that carries it.`,memo:"Memo",supplements:"Supplements",openSupplements:"Open supplements",closeSupplements:"Close supplements",resizeSupplements:"Resize supplements",resizeSupplementsHint:"Drag, or use the arrow keys, to change the height (double-click to reset)",handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log",grill:"Questions",grillError:"Could not read the questions",grillGroup:"Question",grillProgress:(t,e)=>`${t} of ${e} answered`,grillAnswer:"Answer",grillAnswerFree:"Answer in your own words",grillAnswerClear:"Clear answer",grillQuoted:t=>`\u2192 \u201C${t}\u201D`,grillOpen:t=>`Open question ${t}`,grillFreeText:"Your own answer",grillFreeTextOf:t=>`Your own answer to ${t}`,grillFreeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",grillRoundSelect:"Question round",grillCurrentRound:"Current questions",grillRoundOption:(t,e)=>`${t} (${e})`,grillPastRound:t=>`${t}: earlier questions, read-only`,grillUnanswered:"Not answered",grillNoQuestions:"No questions in this round.",checkMode:"Check Mode",checkModeOn:"Turn off Check Mode",checkModeOff:"Turn on Check Mode",checkModeUnchecked:"Mark as checked",checkModeChecked:"Checked \u2014 click to unmark",checkModeStale:"Changed since you checked it \u2014 click to check again",checkModeConfirmTitle:"Turn off Check Mode?",checkModeConfirmBody:"Every checkmark on this page will be cleared. This only affects what you see; it is never sent to the agent.",checkModeConfirmOk:"Turn off",checkModeConfirmCancel:"Cancel",syncConnecting:"Syncing",syncSynced:"Synced",syncPending:t=>`${t} unsent`,syncOffline:"Offline",syncError:"Sync error",syncStatus:"Sharing",clearSharedTitle:"Clear the shared draft?",clearSharedBody:"Everything you see now disappears, including other people\u2019s changes. What others add while this is open stays.",clearSharedOk:"Clear all",clearSharedCancel:"Cancel"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewChanges:"\u64CD\u4F5C\u30ED\u30B0",reviewComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",settings:"\u8A2D\u5B9A",menu:"\u30DA\u30FC\u30B8\u306E\u30E1\u30CB\u30E5\u30FC",menuMove:"\u3053\u306E\u30E1\u30CB\u30E5\u30FC\u3092\u79FB\u52D5",menuReturn:"\u30E1\u30CB\u30E5\u30FC\u3092\u30D8\u30C3\u30C0\u30FC\u306B\u623B\u3059",settingsDisplay:"\u8868\u793A",settingsAppearance:"\u5916\u89B3",settingsTheme:"\u30C6\u30FC\u30DE",themeLight:"\u30E9\u30A4\u30C8",themeDark:"\u30C0\u30FC\u30AF",settingsClose:"\u8A2D\u5B9A\u3092\u9589\u3058\u308B",settingsSections:"\u8A2D\u5B9A\u306E\u30BB\u30AF\u30B7\u30E7\u30F3",undoRedo:"\u53D6\u308A\u6D88\u3057\u30FB\u3084\u308A\u76F4\u3057",undo:"\u53D6\u308A\u6D88\u3057",redo:"\u3084\u308A\u76F4\u3057",useLightTheme:"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B",useDarkTheme:"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B",language:"\u8A00\u8A9E",versionLabel:"dev-process-kit \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u307E\u3059\uFF09",versionPinned:"\u30DA\u30FC\u30B8\u6307\u5B9A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3",versionLatest:t=>`${t}\uFF08\u6700\u65B0\uFF09`,baseDataError:"base data \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u7A7A\u306E\u30DA\u30FC\u30B8\u3068\u3057\u3066\u8868\u793A\u4E2D\uFF09",pageEmpty:"\u3053\u306E\u30DA\u30FC\u30B8\u306B\u306F view \u3082 board \u3082\u3042\u308A\u307E\u305B\u3093",pageEmptyHint:"\u30DA\u30FC\u30B8\u306B\u306F <dpk-view-*> \u304B <dpk-board-*> \u3092\u3072\u3068\u3064\u7F6E\u304D\u307E\u3059\u3002",pageUnavailable:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u5185\u5BB9\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",pageUnavailableHint:t=>`<${t}> \u3092\u5B9A\u7FA9\u3059\u308B entry \u304C\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u305D\u306E entry \u3092\u8AAD\u307F\u8FBC\u3093\u3067\u304F\u3060\u3055\u3044\u3002`,memo:"\u30E1\u30E2",supplements:"\u88DC\u8DB3\u60C5\u5831",openSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u958B\u304F",closeSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u9589\u3058\u308B",resizeSupplements:"\u88DC\u8DB3\u60C5\u5831\u306E\u9AD8\u3055\u3092\u5909\u3048\u308B",resizeSupplementsHint:"\u30C9\u30E9\u30C3\u30B0\u3001\u307E\u305F\u306F\u77E2\u5370\u30AD\u30FC\u3067\u9AD8\u3055\u3092\u5909\u3048\u308B\uFF08\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u65E2\u5B9A\u306B\u623B\u3059\uFF09",handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grill:"\u8CEA\u554F",grillError:"\u8CEA\u554F\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grillGroup:"\u8CEA\u554F",grillProgress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,grillAnswer:"\u56DE\u7B54",grillAnswerFree:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",grillAnswerClear:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",grillQuoted:t=>`\u2192 \u300C${t}\u300D`,grillOpen:t=>`\u8CEA\u554F ${t} \u3092\u3072\u3089\u304F`,grillFreeText:"\u81EA\u7531\u8A18\u8FF0",grillFreeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,grillFreeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",grillRoundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",grillCurrentRound:"\u73FE\u5728\u306E\u8CEA\u554F",grillRoundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,grillPastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,grillUnanswered:"\u672A\u56DE\u7B54",grillNoQuestions:"\u3053\u306E\u30E9\u30A6\u30F3\u30C9\u306B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002",checkMode:"\u78BA\u8A8D\u30E2\u30FC\u30C9",checkModeOn:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u7D42\u4E86",checkModeOff:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u958B\u59CB",checkModeUnchecked:"\u78BA\u8A8D\u6E08\u307F\u306B\u3059\u308B",checkModeChecked:"\u78BA\u8A8D\u6E08\u307F\uFF08\u30AF\u30EA\u30C3\u30AF\u3067\u89E3\u9664\uFF09",checkModeStale:"\u3053\u306E\u78BA\u8A8D\u5F8C\u306B\u5909\u66F4\u304C\u3042\u308A\u307E\u3059\uFF08\u30AF\u30EA\u30C3\u30AF\u3067\u518D\u78BA\u8A8D\uFF09",checkModeConfirmTitle:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u7D42\u4E86\u3057\u307E\u3059\u304B?",checkModeConfirmBody:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u306F\u3059\u3079\u3066\u6D88\u3048\u307E\u3059\u3002\u8868\u793A\u3060\u3051\u306E\u72B6\u614B\u306A\u306E\u3067\u3001Agent \u306B\u306F\u9001\u3089\u308C\u307E\u305B\u3093\u3002",checkModeConfirmOk:"\u7D42\u4E86\u3059\u308B",checkModeConfirmCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",syncConnecting:"\u540C\u671F\u4E2D",syncSynced:"\u540C\u671F\u6E08\u307F",syncPending:t=>`\u672A\u9001\u4FE1 ${t} \u4EF6`,syncOffline:"\u30AA\u30D5\u30E9\u30A4\u30F3",syncError:"\u30A8\u30E9\u30FC",syncStatus:"\u5171\u6709",clearSharedTitle:"\u5171\u6709\u4E2D\u306E\u30C9\u30E9\u30D5\u30C8\u3092\u3059\u3079\u3066\u6D88\u3057\u307E\u3059\u304B?",clearSharedBody:"\u307B\u304B\u306E\u4EBA\u306E\u5909\u66F4\u3082\u542B\u3081\u3066\u3001\u4ECA\u898B\u3048\u3066\u3044\u308B\u3082\u306E\u304C\u3059\u3079\u3066\u6D88\u3048\u307E\u3059\u3002\u3053\u306E\u78BA\u8A8D\u4E2D\u306B\u307B\u304B\u306E\u4EBA\u304C\u52A0\u3048\u305F\u3082\u306E\u306F\u6B8B\u308A\u307E\u3059\u3002",clearSharedOk:"\u3059\u3079\u3066\u6D88\u3059",clearSharedCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),Pg=(t,e,n)=>{const s=da(n);if(s===null)return{title:n.type,tone:"meta"};if(s.kind==="clear")return{title:t.grillAnswerClear,tone:"delete"};if(s.kind==="option"){const i=rt(e,n.target.id)?.options.find(r=>r.id===s.optionId);return{title:t.grillAnswer,tone:"update",summary:t.grillQuoted(i?.label??s.optionId)}}return{title:t.grillAnswerFree,tone:"update",summary:t.grillQuoted(s.text.slice(0,120))}},Lg=(t,e)=>{const{grill:n}=e,s=R(e.locale);return{...t,hasTarget:(i,r)=>r.type===re?rt(n,r.id)!==void 0:t.hasTarget(i,r),commentTargets:(i,r)=>[...t.commentTargets(i,r),...n.questions.map(o=>({value:_({type:re,id:o.id}),label:Zs(n,o.id),group:s.grillGroup}))],describe:(i,r,o)=>{const a=Zs(n,i.target.id);if(Y(i)){const{title:p,summary:h,tone:d}=Pg(s,n,i);return{title:p,tone:d,targetLabel:a,...h===void 0?{}:{summary:h}}}const l=t.describe(i,r,o);return i.target.type===re?{...l,targetLabel:a}:l},serialize:i=>Y(i)?`${i.type} ${_(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},zg=O({v:V(1),template:$(x(),E(1)),actions:H(St())});class ti{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=C(zg,JSON.parse(s));return!i.success||i.output.template!==n?[]:i.output.actions.flatMap(r=>{const o=C($t,r);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const i={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(i))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class ni{constructor(){this.store=new Map}load(e,n){return new ti({getItem:s=>this.store.get(s)??null,setItem:(s,i)=>{this.store.set(s,i)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const si=()=>{try{if(typeof localStorage<"u")return new ti(localStorage)}catch{}return new ni},ot=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,ii=new Set,Ig=(t,e)=>ma({self:t,confirmed:[],cursor:void 0,marks:[],seq:0,pending:[]},e),ma=(t,e)=>({...t,pending:e.map(n=>t.pending.find(s=>ir(s.op,n))??{op:n,covers:ii})}),Dg=t=>t.cursor!==void 0,jt=t=>t.pending.reduce((e,{op:n,covers:s})=>{switch(n.kind){case"append":return e.some(i=>i.action.id===n.action.id)?e:[...e,{action:n.action,author:t.self}];case"remove":return e.filter(i=>i.action.id!==n.id);case"clear":return e.filter(i=>!s.has(i.action.id))}},t.confirmed.map(({entry:e})=>e)),Ng=t=>jt(t).map(e=>e.action),Ft=(t,e)=>e.author?.id===t.self.id,ka=(t,e)=>t.pending.some(({op:n})=>n.kind==="append"&&n.action.id===e),ba=(t,e,n)=>{const s=t.seq+1,i=e.kind==="snapshot"?qg(e.entries,s):Ug(t,e.ops,s);return{...t,confirmed:[...i],cursor:e.cursor,marks:[...e.kind==="snapshot"?[]:t.marks,{cursor:e.cursor,seq:s}].slice(-64),seq:s,pending:t.pending.filter(({op:r})=>n.some(o=>ir(o,r)))}},qg=(t,e)=>{const n=new Set;return t.flatMap(s=>n.has(s.action.id)?[]:(n.add(s.action.id),[{entry:s,seq:e}]))},Ug=(t,e,n)=>e.reduce((s,i)=>{switch(i.kind){case"append":return s.some(({entry:r})=>r.action.id===i.entry.action.id)?s:[...s,{entry:i.entry,seq:n}];case"remove":return s.filter(({entry:r})=>r.action.id!==i.id);case"clear":{const r=t.marks.find(o=>o.cursor===i.upTo)?.seq??n-1;return s.filter(o=>o.seq>r)}}},t.confirmed),Hg=(t,e)=>{const n={kind:"append",action:e};return{log:{...t,pending:[...t.pending,{op:n,covers:ii}]},push:[n]}},va=(t,e,n)=>{const s=jt(t).find(o=>o.action.id===e);if(s===void 0)return{log:t,push:[]};if(!Ft(t,s)&&n?.others!==!0)return{log:t,push:[]};const i={kind:"remove",id:e},r=t.pending.filter(o=>!(o.op.kind==="append"&&o.op.action.id===e));return{log:{...t,pending:[...r,{op:i,covers:ii}]},push:[i]}},Bg=t=>t.cursor===void 0?null:{upTo:t.cursor,covers:new Set(t.confirmed.map(({entry:e})=>e.action.id))},jg=(t,e)=>{const s=jt(t).filter(r=>Ft(t,r)&&!(e?.covers.has(r.action.id)??!1)).reduce((r,o)=>{const a=va(r.log,o.action.id);return{log:a.log,push:[...r.push,...a.push]}},{log:t,push:[]});if(e===null)return s;const i={kind:"clear",upTo:e.upTo};return{log:{...s.log,pending:[...s.log.pending,{op:i,covers:e.covers}]},push:[...s.push,i]}},xa=(t,e,n)=>{const s=new Set(e.map(l=>l.id)),i=jt(t),r=new Set(i.map(l=>l.action.id)),a=i.filter(l=>!s.has(l.action.id)&&Fg(t,l,n)).reduce((l,p)=>{const h=va(l.log,p.action.id,{others:n==="any"});return{log:h.log,push:[...l.push,...h.push]}},{log:t,push:[]});return e.filter(l=>!r.has(l.id)).reduce((l,p)=>{const h=Hg(l.log,p);return{log:h.log,push:[...l.push,...h.push]}},a)},Fg=(t,e,n)=>{switch(n){case"pending":return ka(t,e.action.id);case"own":return Ft(t,e);case"any":return!0}};class Gg{constructor(e,n,s){this.host=e,this.readAction=n,this.onChange=s,this.#e=Ig(e.self,[]),this.#d()}#e;#s=[];#t=[];#n=null;#i=[];#r="connecting";#o;#a=null;#l=0;#c=0;get self(){return this.#e.self}get actions(){return this.#t}get connected(){return Dg(this.#e)}get state(){return{status:this.#r,reason:this.#o,unsent:this.#f().length}}authorOf(e){const n=this.#s.find(s=>s.action.id===e);if(n!==void 0)return n.author??(Ft(this.#e,n)?this.#e.self:void 0)}isOwn(e){const n=this.#s.find(s=>s.action.id===e);return n!==void 0&&Ft(this.#e,n)}isPending(e){return ka(this.#e,e)}preview(e,n){return Ng(xa(this.#e,e,n).log)}change(e,n){this.#u(xa(this.#e,e,n))}clearMark(){return Bg(this.#e)}clear(e){this.#u(jg(this.#e,e))}close(){this.#c+=1,this.#n?.close(),this.#n=null}reopen(){this.#n===null&&this.#d()}#d(){this.#c+=1;const e=this.#c;this.#a=[];const n=this.host.open({receive:i=>{if(e!==this.#c)return;const r=ic(i,this.readAction);r!==null&&(this.#a===null?this.#k(r):this.#a.push(r))},status:(i,r)=>{if(e!==this.#c)return;const o=this.#a===null?this.#f().length:this.#l;i===this.#r&&r?.reason===this.#o&&o===this.#l||(this.#r=i,this.#o=r?.reason,this.#l=o,this.#a===null&&this.onChange("status"))}});this.#n=n,this.#i.length>0&&n.push(this.#i),this.#i=[],this.#e=ma(this.#e,n.pending),this.#l=n.pending.length;const s=this.#a;this.#a=null;for(const i of s)this.#e=ba(this.#e,i,n.pending);this.#p()}#f(){return this.#n?.pending??this.#i}#u(e){this.#e=e.log,this.#p(),e.push.length!==0&&(this.#n===null?this.#i=[...this.#i,...e.push]:this.#n.push(e.push))}#k(e){this.#e=ba(this.#e,e,this.#f()),this.#p()&&this.onChange("received")}#p(){const e=jt(this.#e);return Wg(this.#s,e)?!1:(this.#s=e,this.#t=e.map(n=>n.action),!0)}}const Wg=(t,e)=>t.length===e.length&&t.every((n,s)=>{const i=e[s];return i!==void 0&&n.action.id===i.action.id&&n.author?.id===i.author?.id&&n.author?.name===i.author?.name}),wa={redoStack:[]},Vg=(t,e)=>{const n=t.at(-1);return n===void 0?null:{actions:t.slice(0,-1),state:{redoStack:[...e.redoStack,n]}}},Kg=(t,e)=>{const n=e.redoStack.at(-1);return n===void 0?null:{actions:[...t,n],state:{redoStack:e.redoStack.slice(0,-1)}}},Yg=()=>wa,Zg=t=>t.length>0,Qg=t=>t.redoStack.length>0,Xg=H(St());class ya{#e;#s;#t={targets:[],providers:[]};#n;#i=new Map;#r;#o;#a;#l;#c;#d=new Set;#f=[];#u=0;#k=wa;#p;#v=[];#A;#x=Oe;constructor(e){if(this.#e=e.definition,this.#A=e.settled??(()=>!1),this.#n=e.grill??{grill:it,locale:"en"},this.#s=this.#y(),this.#r=e.base,this.#c=e.storageKey??ot(e.definition.name),this.#p=e.sync===void 0?null:new Gg(e.sync,s=>ri(this.definition,[s])[0]??null,s=>this.#G(s)),this.#p!==null){this.#l=null,this.#o=this.#p.actions,this.#g(),this.#a=this.#h(this.#o);return}this.#l=e.storage===void 0?si():e.storage;const n=e.initialActions??this.#l?.load(this.#c,this.definition.name)??[];this.#o=ri(this.definition,n),this.#a=this.#h(this.#o),this.#D()&&this.#_()}get definition(){return this.#s}setComponentSnapshot(e){const n=rn(vh,e);if(!_n(n,this.#t)){this.#t=n,this.#g(),this.#a=this.#h(this.#o);for(const s of this.#d)s()}}get componentSnapshot(){return this.#t}setTemplate(e){this.#e=e,this.#g(),this.#a=this.#h(this.#o);for(const n of this.#d)n()}setGrill(e){this.#n=e,this.#g(),this.#a=this.#h(this.#o);for(const n of this.#d)n()}setAddressed(e){if(e!==this.#x){if(this.#x=e,this.#p!==null){this.#L(this.#p)&&this.#C();return}this.#o.some(n=>Es(e,n.id))&&this.#w(this.#o)}}#g(){this.#i=co(this.#o,this.#t.providers),this.#s=this.#y()}#y(){return Lg(uo(this.#e,this.#t.targets,this.#i),this.#n)}#h(e){return ha(this.definition,this.#r,e,co(e,this.#t.providers),this.#n.grill)}get base(){return this.#r}get actions(){return this.#o}get derivation(){return this.#a}get lastIssues(){return this.#f}get prunedCount(){return this.#u}get canUndo(){const e=this.#p;return e!==null?this.#o.some(n=>e.isOwn(n.id)):Zg(this.#o)}get canRedo(){return this.#p!==null?this.#v.length>0:Qg(this.#k)}get sync(){return this.#p?.state??null}authorOf(e){return this.#p?.authorOf(e)}isOwnAction(e){return this.#p?.isOwn(e)??this.#o.some(n=>n.id===e)}close(){this.#p?.close()}reopen(){this.#p?.reopen()}descriptorFor(e,n){return $a(this.definition,e,n)}dispatch(e){const n=this.#S(e,this.#a.state);if(!n.ok)return this.#$([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#w(Sa(this.#o,n.action,s),{dispatched:[n.action.id]}),{ok:!0,id:n.action.id}):this.#$([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(Xg,e);if(!n.success)return this.#$([Me(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let i=this.#o,r=this.#a.state,o=this.#a.answers;const a=[];for(const l of s){const p=this.#S(l,r);if(!p.ok)return this.#$([p.issue]);const h=p.action,d=this.descriptorFor(h.type,h.target);if(!d)return this.#$([{path:"type",message:"unknown action type"}]);if((Y(h)?ca(this.#n.grill,o,h)===null?null:r:h.type==="comment"||ne(h)?h.target.type==="page"||this.definition.hasTarget(r,h.target)?r:null:this.definition.apply(r,h))===null)return this.#$([{path:"target",message:"batch action is not applicable"}]);i=Sa(i,h,d);const c=this.#h(i);r=c.state,o=c.answers,a.push(h.id)}return this.#w(i,{dispatched:a}),{ok:!0,ids:a}}#S(e,n){const s=C(Fr,e);if(!s.success)return{ok:!1,issue:Me(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?fn(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=Ip(s.output,i);if(!r.ok)return r;const o=this.definition.canonicalTarget?.(n,r.action.target)??r.action.target;return{ok:!0,action:{...r.action,target:o}}}#$(e){return this.#f=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#o.find(a=>a.id===e);if(s?.type!==I)return this.#$([{path:"id",message:`no comment "${e}" in the draft`}]);if(Ht(s)===n)return{ok:!0,id:e};const i=C(Ks.schema,{...s,payload:{body:n}});if(!i.success)return this.#$([Me(i.issues)]);const r=C($t,i.output);if(!r.success)return this.#$([Me(r.issues)]);const o=r.output;if(this.#p!==null){if(!this.#p.isOwn(e))return this.#$([{path:"id",message:`comment "${e}" is another reader's`}]);const a={...o,id:gn()};return this.#w(this.#o.map(l=>l===s?a:l),{dispatched:[a.id],reach:"own"}),{ok:!0,id:a.id}}return this.#w(this.#o.map(a=>a===s?o:a),{dispatched:[]}),{ok:!0,id:e}}removeAction(e){const n=this.#o.filter(s=>s.id!==e);n.length!==this.#o.length&&this.#w(n,{reach:"any"})}clearActions(){this.prepareClear()()}prepareClear(){const e=this.#p;if(e===null)return()=>{this.#o.length>0&&this.#w([])};const n=e.clearMark();return()=>{e.clear(n),this.#v=[],this.#C()}}replaceActions(e){this.#w(ri(this.definition,e),{reach:"any"})}setBase(e){this.#r=e,this.#w(this.#o)}undo(){const e=this.#p;if(e!==null){const s=[...this.#o].reverse().find(i=>e.isOwn(i.id));return s===void 0?!1:(this.#v=[...this.#v,s],this.#w(this.#o.filter(i=>i!==s),{preserveRedo:!0,reach:"own"}),!0)}const n=Vg(this.#o,this.#k);return n===null?!1:(this.#k=n.state,this.#w([...n.actions],{preserveRedo:!0}),!0)}redo(){if(this.#p!==null){const n=this.#v.at(-1);if(n===void 0)return!1;this.#v=this.#v.slice(0,-1);const s={...n,id:gn()};return this.#w([...this.#o,s],{preserveRedo:!0,dispatched:[s.id]}),!0}const e=Kg(this.#o,this.#k);return e===null?!1:(this.#k=e.state,this.#w([...e.actions],{preserveRedo:!0}),!0)}subscribe(e){return this.#d.add(e),()=>{this.#d.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#o}}#w(e,n){if(this.#p!==null){this.#E(this.#p,e,n);return}this.#f=[],this.#o=e,this.#g(),this.#a=this.#h(this.#o),this.#D(n?.dispatched),n?.preserveRedo!==!0&&(this.#k=Yg()),this.#_();for(const s of this.#d)s()}#E(e,n,s){this.#f=[];const i=new Set(this.#o.map(a=>a.id)),r=s?.reach??"pending",o=new Set(this.#h(e.preview(n,r)).obsolete.filter(a=>!i.has(a.id)||e.isPending(a.id)).map(a=>a.id));this.#u+=o.size,e.change(n.filter(a=>!o.has(a.id)),r),s?.preserveRedo!==!0&&(this.#v=[]),this.#C()}#G(e){const n=this.#p;if(n===null)return;if(e==="status"){for(const r of this.#d)r();return}const s=new Set(this.#a.stale.map(({action:r})=>r.id));this.#o=n.actions,this.#g(),this.#a=this.#h(this.#o);const i=new Set(this.#a.stale.filter(({action:r})=>r.type!==I&&!s.has(r.id)&&n.isPending(r.id)).map(({action:r})=>r.id));i.size>0&&n.change(this.#o.filter(r=>!i.has(r.id)),"pending"),this.#L(n),this.#C()}#L(e){const n=e.actions.filter(s=>Es(this.#x,s.id));return n.length===0?!1:(this.#u+=n.length,e.change(e.actions.filter(s=>!n.includes(s)),"any"),!0)}#C(){this.#p!==null&&(this.#o=this.#p.actions),this.#g(),this.#a=this.#h(this.#o);for(const e of this.#d)e()}#D(e){const n=this.#W(),s=this.#H()||n,i=this.#U()||s,r=Cg(this.definition,this.#a,o=>this.#h(o),e);return r===this.#a?i:(this.#u+=this.#o.length-r.actions.length,this.#o=[...r.actions],this.#g(),this.#a=this.#h(this.#o),this.#U(),!0)}#U(){return this.#a.obsolete.length===0?!1:(this.#u+=this.#a.obsolete.length,this.#o=ua(this.#a),this.#g(),this.#a=this.#h(this.#o),!0)}#W(){const e=this.#o.filter(n=>!Es(this.#x,n.id));return e.length===this.#o.length?!1:(this.#u+=this.#o.length-e.length,this.#o=e,this.#g(),this.#a=this.#h(this.#o),!0)}#H(){if(!this.#A())return!1;const e=new Set(this.#a.stale.filter(({action:n,reason:s})=>s==="target-missing"&&_t(n.target)===null).map(({action:n})=>n.id));return e.size===0?!1:(this.#u+=e.size,this.#o=this.#o.filter(n=>!e.has(n.id)),this.#g(),this.#a=this.#h(this.#o),!0)}#_(){this.#l?.save(this.#c,this.definition.name,this.#o)}}const $a=(t,e,n)=>e==="comment"?Ks:e===Pn?Sg:n!==void 0&&ne({type:e,target:n})?mh:t.actionFor?t.actionFor(e,n):Et(t.actions,e),Sa=(t,e,n)=>Y(e)?Eg(t,e):Gr(t,e,n),ri=(t,e)=>e.flatMap(n=>{const s=C($t,n);if(!s.success)return[];const i=s.output,r=$a(t,i.type,i.target);if(!r)return[];const o=C(r.schema,i);if(!o.success)return[];const a=C($t,o.output);return a.success?[a.output]:[]}),Jg='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',ef=()=>{if(typeof document>"u")return null;let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t instanceof HTMLElement?t:null},tf=t=>{const e=t.querySelector("[autofocus]");if(e)return e;for(const n of t.querySelectorAll(Jg))if(!(n.hidden||n.closest("[hidden]")!==null))return n;return null},nf="dpk-dialog-close";class sf{constructor(e,n){this.#t=null,this.#n="close",this.handlers={cancel:s=>{s.preventDefault(),this.dismiss("escape")},close:()=>this.#o(),click:s=>{s.target===this.#s.dialog()&&this.dismiss("backdrop")}},this.#i=s=>{if(s.button!==0||!this.#s.open())return;const i=this.#s.dialog();i===null||s.composedPath().includes(i)||this.dismiss("backdrop")},this.#e=e,this.#s=n,e.addController(this)}#e;#s;#t;#n;hostConnected(){document.addEventListener("pointerdown",this.#i,!0)}hostUpdated(){const e=this.#s.dialog();if(e!==null){if(this.#s.open()){Pt(e)||this.#r(e);return}Pt(e)&&_s(e)}}hostDisconnected(){document.removeEventListener("pointerdown",this.#i,!0);const e=this.#s.dialog();e!==null&&Pt(e)&&_s(e),this.#t=null}#i;dismiss(e="close"){this.#n=e,this.#s.dismiss(e)}#r(e){this.#n="close",this.#t=ef(),go(e);const n=tf(e)??e;n===e&&!e.hasAttribute("tabindex")&&(e.tabIndex=-1),n.focus()}#o(){const e=this.#n,n=this.#t;this.#t=null,this.#s.open()&&this.#s.dismiss(e),n?.isConnected&&n.focus(),this.#e.dispatchEvent(new CustomEvent(nf,{detail:{reason:e},bubbles:!0,composed:!0}))}}const Aa=(t,e="json")=>`\`\`\`${e}
|
|
273
273
|
${t}
|
|
274
|
-
\`\`\``,
|
|
275
|
-
> `)}`)}d.push("")}if(h.length>0){d.push(`## Answers (${h.length})`),d.push(""),d.push("The reader answered these questions from the `data-dpk-grill` block. Settle them in the page; when you ask the next round, move them into `history` with the answer as recorded."),d.push("");for(const[f,c]of h.entries()){const g=t.answers[c.id],u=g?.kind==="option"?` (option \`${g.optionId}\`)`:"";d.push(`${f+1}. **${
|
|
274
|
+
\`\`\``,rf=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),In=(t,e,n,s=Oe)=>{const{actions:i,state:r}=t,o=new Set(t.stale.map(f=>f.action.id)),a=i.filter(f=>!o.has(f.id)),l=a.filter(f=>f.type===I),p=a.filter(f=>f.type!==I&&!Y(f)),h=t.grill.questions.filter(f=>zn(f,t.answers[f.id])),d=[];if(d.push(`# Review draft \u2014 ${e.label}`),d.push(""),d.push(`- template: \`${e.name}\``),d.push(`- framework: \`dev-process-kit@${n}\``),d.push(`- navigation: \`${Xe(t.navigation)||"(none)"}\``),d.push(`- pending: ${p.length} change(s), ${l.length} comment(s)`+(h.length>0?`, ${h.length} answer(s)`:"")),t.stale.length>0&&d.push(`- stale (not applicable to the current base): ${t.stale.length}`),d.push(""),d.push("## How to apply"),d.push(""),d.push("These are patches against the base HTML, not a command log. Apply the requested end state to the meaning model, keep the stable ids of surviving concepts, and keep the base JSON free of any draft envelope."),p.some(ne)&&(d.push(""),d.push("Changes targeting `element:<id>/\u2026` belong to the component with that `id` (for example a diagram): apply them to that component's own JSON, following its documented action vocabulary.")),d.push(""),l.length>0){d.push(`## Comments (${l.length})`),d.push("");for(const[f,c]of l.entries()){const g=e.describe(c,r,t.base);d.push(`${f+1}. **${g.targetLabel}** \u2014 \`${_(c.target)}\``),d.push(` > ${Ht(c).replace(/\n/g,`
|
|
275
|
+
> `)}`)}d.push("")}if(h.length>0){d.push(`## Answers (${h.length})`),d.push(""),d.push("The reader answered these questions from the `data-dpk-grill` block. Settle them in the page; when you ask the next round, move them into `history` with the answer as recorded."),d.push("");for(const[f,c]of h.entries()){const g=t.answers[c.id],u=g?.kind==="option"?` (option \`${g.optionId}\`)`:"";d.push(`${f+1}. **${Zs(t.grill,c.id)}** \u2014 \`grill:${c.id}\``),d.push(` > ${Ln(c,g).replace(/\n/g,`
|
|
276
276
|
> `)}${u}`)}d.push("")}if(p.length>0){d.push(`## Requested changes (${p.length})`),d.push("");for(const[f,c]of p.entries()){const g=e.describe(c,r,t.base),u=g.summary?` \u2014 ${g.summary}`:"";d.push(`${f+1}. **${g.title}**${u}`),d.push(` target: \`${_(c.target)}\` (${c.target.type})`),d.push(` \`\`\`json
|
|
277
|
-
${
|
|
277
|
+
${rf(c).replace(/\n/g,`
|
|
278
278
|
`)}
|
|
279
|
-
\`\`\``)}d.push("")}if(p.length===0&&l.length===0&&h.length===0&&(d.push("_No pending draft actions._"),d.push("")),t.stale.length>0){d.push(`## Not applicable to the current base (${t.stale.length})`),d.push(""),d.push("These actions were made against an earlier base and no longer fit it. Do not apply them; mention them if they still matter. The reader can remove them from the review rail."),d.push("");for(const[f,{action:c,reason:g}]of t.stale.entries()){const u=e.describe(c,r,t.base),k=c.type===I?
|
|
280
|
-
`)},
|
|
279
|
+
\`\`\``)}d.push("")}if(p.length===0&&l.length===0&&h.length===0&&(d.push("_No pending draft actions._"),d.push("")),t.stale.length>0){d.push(`## Not applicable to the current base (${t.stale.length})`),d.push(""),d.push("These actions were made against an earlier base and no longer fit it. Do not apply them; mention them if they still matter. The reader can remove them from the review rail."),d.push("");for(const[f,{action:c,reason:g}]of t.stale.entries()){const u=e.describe(c,r,t.base),k=c.type===I?Ht(c):u.title;d.push(`${f+1}. \`${c.type}\` on \`${_(c.target)}\` (${g}) \u2014 ${k}`)}d.push("")}if(i.some(f=>As(f.id)!==null)){const f=Bp(jp(s,i.map(c=>c.id)));d.push("## Change log: addressed"),d.push(""),d.push('When you regenerate the page, set `"addressed"` at the top of its change log (`<script type="application/json" data-dpk-changes>`) to this value, replacing the old one:'),d.push(""),d.push(Aa(f,"text")),d.push(""),d.push("It names every draft action handled so far, this round included, as `writer:from-to` ranges; readers' pages drop what it names. To leave a request for a later round, split its id out of the range (`a1:1-4,a1:6-9` leaves `a1:5`)."),d.push("")}return d.push("## Canonical draft (JSON)"),d.push(""),d.push(Aa(Ss(i))),d.push(""),d.join(`
|
|
280
|
+
`)},of=4096,af="reviews",Ea="Review from the page (dev-process-kit). Apply it to the base data and republish this artifact. Then answer with ArtifactComments `reply` in this thread: the reader sees only this thread, and the page never shows anything written to the database.",lf=t=>new TextEncoder().encode(t).length,df=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),cf=t=>{const e=`${Ea}
|
|
281
281
|
|
|
282
|
-
${
|
|
282
|
+
${df(t)}`;return lf(e)<=of?e:null},pf=t=>`${Ea}
|
|
283
283
|
|
|
284
|
-
The brief is too long for a comment, so it is stored in this artifact's database: read the document \`${t}\` (\`brief\` is the review, \`draft\` the raw draft JSON).`,
|
|
284
|
+
The brief is too long for a comment, so it is stored in this artifact's database: read the document \`${t}\` (\`brief\` is the review, \`draft\` the raw draft JSON).`,hf={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},uf=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?hf[e]:void 0)??"error"},gf={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Ca=(t,e)=>R(e)[gf[t]],ff=()=>({status:{kind:"idle"},request:0}),mf=(t,e)=>{switch(e.kind){case"copy-started":return{status:{kind:"copying"},request:t.request+1};case"send-started":return{status:{kind:"sending"},request:t.request+1};case"copy-finished":return e.request!==t.request||t.status.kind!=="copying"?t:{...t,status:{kind:e.ok?"copied":"copy-failed"}};case"send-finished":return e.request!==t.request||t.status.kind!=="sending"?t:{...t,status:e.outcome.ok?{kind:"sent"}:{kind:"send-failed",reason:e.outcome.reason}};case"settled":return e.request===t.request?{...t,status:{kind:"idle"}}:t}},kf=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=R(t.locale),s=e.status;return{send:t.sendable?{label:s.kind==="sending"?n.handoffSending:s.kind==="sent"?n.handoffSent:n.handoffSend,disabled:s.kind==="sending"}:null,copy:s.kind==="copied"?{label:n.handoffCopied,status:"copied"}:s.kind==="copy-failed"?{label:n.handoffCopyFailed,status:"failed"}:{label:n.handoffCopy,status:"idle"},note:s.kind==="send-failed"?Ca(s.reason,t.locale):null}},xe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Gt=t=>(...e)=>({_$litDirective$:t,values:e});let Dn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,s){this._$Ct=e,this._$AM=n,this._$Ci=s}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};class Nn extends Dn{constructor(e){if(super(e),this.it=b,e.type!==xe.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===b||e==null)return this._t=void 0,this.it=e;if(e===K)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Nn.directiveName="unsafeHTML",Nn.resultType=1;const Ta=Gt(Nn);let oi=class extends Nn{};oi.directiveName="unsafeSVG",oi.resultType=2;const bf=Gt(oi),vf=t=>t.replaceAll("&","&").replaceAll('"',"""),xf=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,i])=>` ${s}="${vf(String(i))}"`).join("")}></${e}>`).join(""),w=t=>{const e=xf(t);return()=>m`<svg
|
|
285
285
|
viewBox="0 0 24 24"
|
|
286
286
|
fill="none"
|
|
287
287
|
stroke="currentColor"
|
|
@@ -291,15 +291,15 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
291
291
|
aria-hidden="true"
|
|
292
292
|
focusable="false"
|
|
293
293
|
>
|
|
294
|
-
${
|
|
295
|
-
</svg>`},
|
|
294
|
+
${bf(e)}
|
|
295
|
+
</svg>`},qe=w(sp),Ra=w(Xc),ai=w(jc),qn=w(Pc),wf=w(_c),yf=w(Vc),Ma=w(cr),$f=w(Kc),Oa=w(Tc),Sf=w(vc),at=w(fc),Un=w(Fc),Af=w(Ic),_a=w(Ac),Pa=w(Sc),La=w(qc),Ef=w(lr),Cf=w(cc),Tf=w(rr);w(or),w(ar);const za=w(mc),Wt=w(kc),Ia=w(dr),Rf=w(Mc),Mf=w(Lc),Of=w(Zc),_f=w(Nc),Da=w(pc),Pf=w(Ec),Lf=w(wc);w(Qc);const zf=w(lc),If=w(Jc),Df=w(Wc),Nf=w(ur),qf=w(gr),Uf=w(Hc),Hf=w(tp),Bf=w(ep),jf=w(np),Ff=w(gc),Gf=w(uc),Wf=w(Oc),Vf=w(zc),Kf=w(Uc),Yf=()=>m`<svg viewBox="0 0 190 125" aria-hidden="true" focusable="false">
|
|
296
296
|
<path
|
|
297
297
|
fill="#7463fa"
|
|
298
298
|
fill-rule="evenodd"
|
|
299
299
|
d="M50 16.1c0 15-.1 16-1.7 15.4-1-.4-4.6-1.2-8.1-1.8C19 26-1.3 45 .3 66.8c1 13 10.4 25.7 22.3 30.1A36 36 0 0 0 57 91.3l3.9-3.5V125h20.9l-.1-13.7c-.2-15.6-1.3-14.2 9-12.3 8.3 1.5 16.9-.6 24.9-6l4.3-3v10h20l.2-13.5.3-13.6 11.4 13.6 11.4 13.5h13.4a48 48 0 0 0 13-.8l-16.1-19.3A245 245 0 0 1 158 60.4c0-.5 6-6.9 13.3-14l15.1-15.2 2-2.2h-26.7l-11 10.8-11 10.7.4-25 .4-25-10.2-.3L120 0v19c0 10.5-.2 19.1-.5 19.1s-2.3-1.3-4.7-2.9a34 34 0 0 0-37.8 0c-3.2 2.2-6 3.8-6 3.8-.2 0-.3-7.8-.1-17.2.2-9.5 0-18.3-.3-19.5C70 0 69.5 0 60 0H50zM31.4 49c-8 1.8-13 8.9-12.1 16.8.6 5 2.9 8.7 7.8 12 2.8 2 4.4 2.3 9 2C45.3 79 51 73.2 51 64.2c0-10.4-9.4-17.7-19.6-15.2m56.1 1.8c-4.1 2.6-6 5-7.5 9.5-2.2 7 1.2 14.7 8 18.2a18 18 0 0 0 16-.7c5.5-3.8 7.4-7.1 7.4-13q-.1-14.6-14.9-15.6c-4.6-.2-6.7.1-9 1.6"
|
|
300
300
|
/>
|
|
301
|
-
</svg>`,
|
|
302
|
-
`)),
|
|
301
|
+
</svg>`,Zf={paper:["#f6f7f9","#0e1014"],"paper-raised":["#ffffff","#171a20"],"paper-sunken":["#eff1f4","#0a0b0e"],"paper-inset":["#e7eaef","#22262e"],ink:["#11141b","#eceef3"],"ink-soft":["#464e5f","#a9b0bd"],"ink-faint":["#788195","#8a92a2"],rule:["rgba(17, 24, 39, 0.08)","rgba(226, 232, 244, 0.08)"],"rule-strong":["rgba(17, 24, 39, 0.13)","rgba(226, 232, 244, 0.14)"],"rule-hover":["rgba(17, 24, 39, 0.24)","rgba(226, 232, 244, 0.26)"],green:["#15894a","#4cc787"],"green-soft":["rgba(21, 137, 74, 0.09)","rgba(76, 199, 135, 0.14)"],amber:["#b27406","#e9ae45"],"amber-soft":["rgba(178, 116, 6, 0.1)","rgba(233, 174, 69, 0.15)"],violet:["#7549d6","#ab90f5"],"violet-soft":["rgba(117, 73, 214, 0.09)","rgba(171, 144, 245, 0.15)"],danger:["#c11d38","#f5707f"],"danger-soft":["rgba(214, 53, 80, 0.09)","rgba(245, 112, 127, 0.14)"],shade:["rgb(17, 24, 39)","rgb(0, 0, 0)"],"shade-1":["rgba(17, 24, 39, 0.06)","rgba(0, 0, 0, 0.32)"],"shade-2":["rgba(17, 24, 39, 0.08)","rgba(0, 0, 0, 0.38)"],"shade-3":["rgba(17, 24, 39, 0.13)","rgba(0, 0, 0, 0.5)"],highlight:["rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.05)"]},Hn=t=>ln(Object.entries(Zf).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
|
|
302
|
+
`)),Na=(t,[e,n])=>({bare:`var(${t}, ${e})`,schemed:`var(${t}, light-dark(${e}, ${n}))`}),lt=Na("--dpk-brand-primary",["#6253d4","#6858e0"]),dt=Na("--dpk-brand-secondary",["#3563d9","#7aa2f7"]),ct=(t,e)=>ln(`
|
|
303
303
|
--dpk-accent: ${t};
|
|
304
304
|
--dpk-accent-strong: color-mix(in oklab, var(--dpk-accent) 80%, black);
|
|
305
305
|
--dpk-accent-bright: color-mix(in oklab, var(--dpk-accent) 88%, white);
|
|
@@ -308,7 +308,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
308
308
|
--dpk-blue: ${e};
|
|
309
309
|
--dpk-blue-strong: color-mix(in oklab, var(--dpk-blue) 80%, black);
|
|
310
310
|
--dpk-blue-soft: color-mix(in srgb, var(--dpk-blue) 9%, transparent);
|
|
311
|
-
`),
|
|
311
|
+
`),qa=P`
|
|
312
312
|
/* A surface appearing where it stands: a popover, a menu, a dialog backdrop. */
|
|
313
313
|
@keyframes dpk-fade-in {
|
|
314
314
|
from {
|
|
@@ -375,11 +375,21 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
375
375
|
background-position: 250% 0;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
`,
|
|
378
|
+
`,Ua=P`
|
|
379
379
|
--dpk-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
380
380
|
--dpk-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
381
381
|
--dpk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
|
|
382
382
|
|
|
383
|
+
/* Type scale. 'md' is standard reading text; controls and dense UI sit at 'sm'. */
|
|
384
|
+
--dpk-text-2xs: 12px;
|
|
385
|
+
--dpk-text-xs: 13px;
|
|
386
|
+
--dpk-text-sm: 14px;
|
|
387
|
+
--dpk-text-md: 16px;
|
|
388
|
+
--dpk-text-lg: 18px;
|
|
389
|
+
--dpk-text-xl: 20px;
|
|
390
|
+
--dpk-text-2xl: 24px;
|
|
391
|
+
--dpk-text-3xl: 30px;
|
|
392
|
+
|
|
383
393
|
/* Shape + elevation scale, so every surface reads as one system. */
|
|
384
394
|
--dpk-radius-xs: 6px;
|
|
385
395
|
--dpk-radius-sm: 8px;
|
|
@@ -410,13 +420,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
410
420
|
/* Working surface behind boards and canvases: a quiet dot lattice. */
|
|
411
421
|
--dpk-dots: radial-gradient(circle at 1px 1px, var(--dpk-rule-strong) 1px, transparent 0) 0 0 / 20px 20px;
|
|
412
422
|
`,pt=P`
|
|
413
|
-
${
|
|
423
|
+
${qa}
|
|
414
424
|
|
|
415
425
|
:host {
|
|
416
426
|
/* Browsers without light-dark() stay light. */
|
|
417
|
-
${
|
|
427
|
+
${Hn(t=>t)}
|
|
418
428
|
${ct(lt.bare,dt.bare)}
|
|
419
|
-
${
|
|
429
|
+
${Ua}
|
|
420
430
|
|
|
421
431
|
color: var(--dpk-ink);
|
|
422
432
|
font-family: var(--dpk-body);
|
|
@@ -429,7 +439,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
429
439
|
|
|
430
440
|
@supports (color: light-dark(#000, #fff)) {
|
|
431
441
|
:host {
|
|
432
|
-
${
|
|
442
|
+
${Hn((t,e)=>`light-dark(${t}, ${e})`)}
|
|
433
443
|
${ct(lt.schemed,dt.schemed)}
|
|
434
444
|
}
|
|
435
445
|
}
|
|
@@ -493,20 +503,20 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
493
503
|
transition-delay: 0ms !important;
|
|
494
504
|
}
|
|
495
505
|
}
|
|
496
|
-
`,
|
|
506
|
+
`,Qf=P`
|
|
497
507
|
:where(:root) {
|
|
498
|
-
${
|
|
508
|
+
${Hn(t=>t)}
|
|
499
509
|
${ct(lt.bare,dt.bare)}
|
|
500
|
-
${
|
|
510
|
+
${Ua}
|
|
501
511
|
}
|
|
502
512
|
|
|
503
513
|
@supports (color: light-dark(#000, #fff)) {
|
|
504
514
|
:where(:root) {
|
|
505
|
-
${
|
|
515
|
+
${Hn((t,e)=>`light-dark(${t}, ${e})`)}
|
|
506
516
|
${ct(lt.schemed,dt.schemed)}
|
|
507
517
|
}
|
|
508
518
|
}
|
|
509
|
-
`,
|
|
519
|
+
`,Xf=P`
|
|
510
520
|
:where([data-dpk-theme]) {
|
|
511
521
|
${ct(lt.bare,dt.bare)}
|
|
512
522
|
}
|
|
@@ -516,7 +526,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
516
526
|
${ct(lt.schemed,dt.schemed)}
|
|
517
527
|
}
|
|
518
528
|
}
|
|
519
|
-
`,
|
|
529
|
+
`,Ha=(t=e=>e)=>ln(`
|
|
520
530
|
${t(".dpk-icon-btn")} {
|
|
521
531
|
position: relative;
|
|
522
532
|
display: inline-flex;
|
|
@@ -627,7 +637,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
627
637
|
/* A count that just appeared lands with a little weight (shared 'dpk-pop'). */
|
|
628
638
|
animation: dpk-pop var(--dpk-dur) var(--dpk-ease-spring);
|
|
629
639
|
}
|
|
630
|
-
`),
|
|
640
|
+
`),li=P`
|
|
631
641
|
.dpk-btn {
|
|
632
642
|
display: inline-flex;
|
|
633
643
|
align-items: center;
|
|
@@ -761,7 +771,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
761
771
|
0 8px 20px -6px color-mix(in srgb, var(--dpk-danger) 65%, transparent);
|
|
762
772
|
}
|
|
763
773
|
|
|
764
|
-
${
|
|
774
|
+
${Ha()}
|
|
765
775
|
|
|
766
776
|
.dpk-input,
|
|
767
777
|
.dpk-textarea,
|
|
@@ -1020,7 +1030,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1020
1030
|
gap: 8px;
|
|
1021
1031
|
margin-top: 4px;
|
|
1022
1032
|
}
|
|
1023
|
-
`,
|
|
1033
|
+
`,Jf=P`
|
|
1024
1034
|
.comment-pop {
|
|
1025
1035
|
box-sizing: border-box;
|
|
1026
1036
|
overflow: auto;
|
|
@@ -1151,7 +1161,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1151
1161
|
align-items: center;
|
|
1152
1162
|
justify-content: flex-end;
|
|
1153
1163
|
}
|
|
1154
|
-
`,
|
|
1164
|
+
`,Ba=P`
|
|
1155
1165
|
.dpk-prose {
|
|
1156
1166
|
overflow-wrap: anywhere;
|
|
1157
1167
|
}
|
|
@@ -1258,7 +1268,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1258
1268
|
.dpk-prose img {
|
|
1259
1269
|
max-width: 100%;
|
|
1260
1270
|
}
|
|
1261
|
-
`;class
|
|
1271
|
+
`;class em extends X{static{this.styles=[pt,P`
|
|
1262
1272
|
:host {
|
|
1263
1273
|
display: grid;
|
|
1264
1274
|
/* One column no wider than the host: a truncated title must not widen
|
|
@@ -1305,7 +1315,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1305
1315
|
<div part="body" class="body"><slot></slot></div>
|
|
1306
1316
|
<div part="footer" class="footer"><slot name="footer"></slot></div>
|
|
1307
1317
|
<slot name="overlay"></slot>
|
|
1308
|
-
`}}const
|
|
1318
|
+
`}}const tm=()=>{customElements.get("dpk-internal-layout-app")||customElements.define("dpk-internal-layout-app",em)};class Vt{#e;#s;#t=Go;constructor(e,n=()=>{}){this.#e=e,this.#s=n,e.addController(this)}get locale(){return this.#t}hostConnected(){this.#t=Vo(this.#e),document.addEventListener(Ws,this.#n)}hostDisconnected(){document.removeEventListener(Ws,this.#n)}#n=()=>{const e=Vo(this.#e);e!==this.#t&&(this.#t=e,this.#s(),this.#e.requestUpdate())}}const di=(t,e)=>({read(n){try{const s=t.getItem(n);return s===null?null:e(JSON.parse(s))}catch{return null}},write(n,s){try{return t.setItem(n,JSON.stringify(s)),!0}catch{return!1}},remove(n){try{t.removeItem(n)}catch{}}}),Z=t=>{const e=new Map;return di({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},ue=t=>{try{if(typeof localStorage<"u")return di(localStorage,t)}catch{}return Z(t)},nm=t=>{try{if(typeof sessionStorage<"u")return di(sessionStorage,t)}catch{}return Z(t)},we={min:180,max:560,step:16,largeStep:64},ja={side:"left",defaultWidth:260},Bn=t=>Math.round(Math.min(we.max,Math.max(we.min,t))),Fa=t=>typeof t=="number"&&Number.isFinite(t)?Bn(t):null,ci=(t,e)=>t==="left"?e:-e,sm=(t,e)=>Bn(t.startWidth+ci(t.side,e-t.startX)),im=(t,e,{key:n,shiftKey:s})=>{const i=s?we.largeStep:we.step;switch(n){case"ArrowLeft":return Bn(t+ci(e,-i));case"ArrowRight":return Bn(t+ci(e,i));case"Home":return we.min;case"End":return we.max;default:return null}},Ga=t=>typeof t=="boolean"?t:null,Ue={inset:10,size:32},rm=t=>t?Ue.inset+Ue.size:0,om=t=>t==="left"?"right":"left",am=(t,e)=>e?{action:"expand",points:om(t)}:{action:"collapse",points:t},pi={width:ja.defaultWidth,resizable:!0,collapsible:!0,narrow:"drawer",persistKey:null},lm=(t,e)=>!e||t.narrow==="keep"?"beside":t.narrow==="stack"?"stack":t.collapsible?"drawer":"beside",dm=t=>`dev-process-kit:sidebar-collapsed:${t}`;class cm{#e;#s;#t=null;#n="";#i=!1;#r=!1;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}hostConnected(){if(this.#t!==null)return;const e=this.#s.persistKey();this.#t=e===null?Z(Ga):ue(Ga),this.#n=dm(e??""),this.#i=this.#t.read(this.#n)??!1}get collapsed(){return this.#i}get drawerOpen(){return this.#r}toggleDrawer(){this.#r=!this.#r,this.#e.requestUpdate()}closeDrawer(){this.#r&&(this.#r=!1,this.#e.requestUpdate())}toggle(){this.set(!this.#i)}set(e){e!==this.#i&&(this.#i=e,this.#i?this.#t?.write(this.#n,!0):this.#t?.remove(this.#n),this.#e.requestUpdate())}}const Wa=Ne({en:{resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar"},ja:{resizeSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u306E\u5E45\u3092\u5909\u66F4",resizeSidebarHint:"\u30C9\u30E9\u30C3\u30B0\u3067\u5E45\u3092\u5909\u66F4\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306B\u623B\u3059",collapseSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u6298\u308A\u305F\u305F\u3080",expandSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u958B\u304F"}}),pm="(max-width: 760px)",hm=()=>typeof matchMedia=="function"?matchMedia(pm):null;class um{#e;#s=null;#t=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#s=hm(),this.#t=this.#s?.matches===!0,this.#s?.addEventListener("change",this.#n)}hostDisconnected(){this.#s?.removeEventListener("change",this.#n),this.#s=null}get narrow(){return this.#t}#n=e=>{this.#t=e.matches,this.#e.requestUpdate()}}const gm=t=>`dev-process-kit:sidebar-width:${t}`,hi={kind:"idle"};class fm{constructor(e,n){this.#t=null,this.#n="",this.#i=null,this.#r=hi,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#r={kind:"dragging",pointerId:s.pointerId,side:this.#s.side(),startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const i=this.#r;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#a(sm(i,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const i=im(this.width,this.#s.side(),s);i!==null&&(s.preventDefault(),this.#a(i),this.#l())},dblclick:()=>{this.#a(this.#s.defaultWidth()),this.#l()}},this.#e=e,this.#s=n,e.addController(this)}#e;#s;#t;#n;#i;#r;hostConnected(){if(this.#t!==null)return;const e=this.#s.persistKey();this.#t=e===null?Z(Fa):ue(Fa),this.#n=gm(e??""),this.#i=this.#t.read(this.#n)}hostDisconnected(){this.#r=hi}get width(){return this.#i??this.#s.defaultWidth()}get dragging(){return this.#r.kind==="dragging"}#o(e){const n=this.#r;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#r=hi,this.#l(),this.#e.requestUpdate())}#a(e){const n=e===this.#s.defaultWidth()?null:e;n!==this.#i&&(this.#i=n,this.#e.requestUpdate())}#l(){this.#i===null?this.#t?.remove(this.#n):this.#t?.write(this.#n,this.#i)}}class Va{constructor(e,n,s){this.side=n,this.layout=s,this.filled=!1,this.width=new fm(e,{persistKey:()=>s().persistKey,side:()=>n,defaultWidth:()=>s().width}),this.fold=new cm(e,{persistKey:()=>s().persistKey})}get drawnWidth(){return this.layout().resizable?this.width.width:this.layout().width}}class mm extends X{static{this.styles=[pt,P`
|
|
1309
1319
|
:host {
|
|
1310
1320
|
display: flex;
|
|
1311
1321
|
min-width: 0;
|
|
@@ -1437,10 +1447,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1437
1447
|
/* Folded: a button floating a little in from the main column's outer edge, big enough to hit. */
|
|
1438
1448
|
.toggle[data-float] {
|
|
1439
1449
|
position: absolute;
|
|
1440
|
-
top: ${
|
|
1450
|
+
top: ${Ue.inset}px;
|
|
1441
1451
|
z-index: 26;
|
|
1442
|
-
width: ${
|
|
1443
|
-
height: ${
|
|
1452
|
+
width: ${Ue.size}px;
|
|
1453
|
+
height: ${Ue.size}px;
|
|
1444
1454
|
margin: 0;
|
|
1445
1455
|
border-radius: var(--dpk-radius, 8px);
|
|
1446
1456
|
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
@@ -1452,11 +1462,11 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1452
1462
|
}
|
|
1453
1463
|
|
|
1454
1464
|
.toggle[data-float='left'] {
|
|
1455
|
-
left: ${
|
|
1465
|
+
left: ${Ue.inset}px;
|
|
1456
1466
|
}
|
|
1457
1467
|
|
|
1458
1468
|
.toggle[data-float='right'] {
|
|
1459
|
-
right: ${
|
|
1469
|
+
right: ${Ue.inset}px;
|
|
1460
1470
|
}
|
|
1461
1471
|
|
|
1462
1472
|
/* An open drawer: the button rides its edge as a round one, ready to close it. */
|
|
@@ -1597,18 +1607,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1597
1607
|
border-bottom: 0;
|
|
1598
1608
|
border-top: 1px solid var(--dpk-rule);
|
|
1599
1609
|
}
|
|
1600
|
-
`]}static{this.properties={left:{attribute:!1},right:{attribute:!1},main:{type:String,reflect:!0}}}#e=new
|
|
1610
|
+
`]}static{this.properties={left:{attribute:!1},right:{attribute:!1},main:{type:String,reflect:!0}}}#e=new Vt(this);#s=new um(this);#t={left:new Va(this,"left",()=>this.left),right:new Va(this,"right",()=>this.right)};#n=!1;#i=null;constructor(){super(),this.left=pi,this.right=pi,this.main=null}connectedCallback(){super.connectedCallback();const e=new Set(Array.from(this.children,n=>n.slot));this.#t.left.filled=e.has("left"),this.#t.right.filled=e.has("right"),this.#n=e.has("rail")}updated(){if(this.#i===null)return;const e=this.#i;this.#i=null,this.renderRoot.querySelector(`.toggle[data-side='${e}']`)?.focus()}#r(e){return lm(e.layout(),this.#s.narrow)}#o(e){return e.layout().collapsible?this.#r(e)==="drawer"?!e.fold.drawerOpen:e.fold.collapsed:!1}foldedOn(e){const n=this.#t[e];return n.filled&&this.#o(n)}toggleFold(e){const n=this.#t[e];n.filled&&this.#a(n)}#a(e){this.#r(e)==="drawer"?e.fold.toggleDrawer():e.fold.toggle(),this.dispatchEvent(new CustomEvent("dpk-sidebar-fold",{bubbles:!0,composed:!0}))}render(){const{left:e,right:n}=this.#t,s=[e,n].filter(a=>a.filled),i=s.some(a=>this.#r(a)==="stack"),o=s.some(a=>this.#r(a)==="drawer"&&!this.#o(a))?m`<div
|
|
1601
1611
|
part="scrim"
|
|
1602
1612
|
class="scrim"
|
|
1603
1613
|
@click=${()=>{e.fold.closeDrawer(),n.fold.closeDrawer()}}
|
|
1604
|
-
></div>`:b;return m`<div part="rail" class="rail" ?hidden=${!this.#
|
|
1605
|
-
<slot name="rail" @slotchange=${this.#
|
|
1614
|
+
></div>`:b;return m`<div part="rail" class="rail" ?hidden=${!this.#n}>
|
|
1615
|
+
<slot name="rail" @slotchange=${this.#v}></slot>
|
|
1606
1616
|
</div>
|
|
1607
1617
|
<div class="body" ?data-stack=${i} ?data-resizing=${e.width.dragging||n.width.dragging}>
|
|
1608
|
-
${this.#
|
|
1618
|
+
${this.#c(e)}${this.#f(e)}
|
|
1609
1619
|
<div part="main" class="main" style=${this.#l()}><slot></slot></div>
|
|
1610
|
-
${this.#
|
|
1611
|
-
</div>`}#l(){return["left","right"].map(e=>`--dpk-fold-clearance-${e}: ${
|
|
1620
|
+
${this.#f(n)}${this.#c(n)} ${o}
|
|
1621
|
+
</div>`}#l(){return["left","right"].map(e=>`--dpk-fold-clearance-${e}: ${rm(this.foldedOn(e))}px;`).join(" ")}#c(e){return m`<div
|
|
1612
1622
|
id=${`sidebar-${e.side}`}
|
|
1613
1623
|
part="sidebar"
|
|
1614
1624
|
class="sidebar"
|
|
@@ -1616,10 +1626,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1616
1626
|
data-arrangement=${this.#r(e)}
|
|
1617
1627
|
?hidden=${!e.filled||this.#o(e)}
|
|
1618
1628
|
style=${`--dpk-sidebar-width: ${e.drawnWidth}px`}
|
|
1619
|
-
@wheel=${this.#
|
|
1629
|
+
@wheel=${this.#d}
|
|
1620
1630
|
>
|
|
1621
1631
|
<slot name=${e.side} @slotchange=${n=>this.#p(e,n)}></slot>
|
|
1622
|
-
</div>`}#
|
|
1632
|
+
</div>`}#d=e=>{e.currentTarget instanceof HTMLElement&&Tp(e.currentTarget,e)&&e.preventDefault()};#f(e){if(!e.filled)return b;const n=e.layout(),s=this.#r(e),i=this.#o(e);if(s==="stack")return i?m`<div part="bar" class="bar" data-side=${e.side}>${this.#u(e,i)}</div>`:b;if(i||s==="drawer")return n.collapsible?this.#u(e,i,!0):b;const o=n.collapsible?this.#u(e,i):b,a=n.resizable?this.#k(e):b;return e.side==="left"?m`${a}${o}`:m`${o}${a}`}#u(e,n,s=!1){const i=Wa(this.#e.locale),r=am(e.side,n),o=r.action==="collapse"?i.collapseSidebar:i.expandSidebar;return m`<button
|
|
1623
1633
|
part="toggle"
|
|
1624
1634
|
class="toggle"
|
|
1625
1635
|
type="button"
|
|
@@ -1633,8 +1643,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1633
1643
|
title=${o}
|
|
1634
1644
|
@click=${()=>{this.#i=e.side,this.#a(e)}}
|
|
1635
1645
|
>
|
|
1636
|
-
${r.points==="left"?
|
|
1637
|
-
</button>`}#k(e){const n=
|
|
1646
|
+
${r.points==="left"?za():Wt()}
|
|
1647
|
+
</button>`}#k(e){const n=Wa(this.#e.locale),s=e.width.handlers;return m`<div
|
|
1638
1648
|
part="resizer"
|
|
1639
1649
|
class="resizer"
|
|
1640
1650
|
role="separator"
|
|
@@ -1644,8 +1654,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1644
1654
|
aria-orientation="vertical"
|
|
1645
1655
|
aria-controls=${`sidebar-${e.side}`}
|
|
1646
1656
|
aria-label=${n.resizeSidebar}
|
|
1647
|
-
aria-valuemin=${
|
|
1648
|
-
aria-valuemax=${
|
|
1657
|
+
aria-valuemin=${we.min}
|
|
1658
|
+
aria-valuemax=${we.max}
|
|
1649
1659
|
aria-valuenow=${e.width.width}
|
|
1650
1660
|
title=${n.resizeSidebarHint}
|
|
1651
1661
|
@pointerdown=${s.pointerdown}
|
|
@@ -1654,42 +1664,42 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1654
1664
|
@pointercancel=${s.pointercancel}
|
|
1655
1665
|
@keydown=${s.keydown}
|
|
1656
1666
|
@dblclick=${s.dblclick}
|
|
1657
|
-
></div>`}#p(e,n){if(!(n.target instanceof HTMLSlotElement))return;const s=n.target.assignedNodes({flatten:!0}).length>0;s!==e.filled&&(e.filled=s,this.requestUpdate())}#
|
|
1667
|
+
></div>`}#p(e,n){if(!(n.target instanceof HTMLSlotElement))return;const s=n.target.assignedNodes({flatten:!0}).length>0;s!==e.filled&&(e.filled=s,this.requestUpdate())}#v=e=>{if(!(e.target instanceof HTMLSlotElement))return;const n=e.target.assignedNodes({flatten:!0}).length>0;n!==this.#n&&(this.#n=n,this.requestUpdate())}}const km=()=>{customElements.get("dpk-internal-layout-sidebar")||customElements.define("dpk-internal-layout-sidebar",mm)},bm=()=>{tm(),km()},jn="@",He=Object.freeze({type:Xs,id:"app"}),ui=/^[A-Za-z0-9_-]+$/,ye=t=>t.type===He.type&&t.id===He.id,Be=t=>{const e=t.id.lastIndexOf(jn);if(e<0)return null;const n=t.id.slice(e+1);return ui.test(n)?{page:n,target:{type:t.type,id:t.id.slice(0,e)}}:null},Ka=(t,e)=>({type:t.type,id:`${t.id}${jn}${e}`}),Ya=(t,e,n)=>{if(ye(t))return t;const s=Be(t);return s!==null&&n.has(s.page)?t:Ka(t,e)},ht=(t,e)=>`${t}${jn}${e}`,Fn="dpk-page",Za="dpk-app",ut="name",gt="data-dpk-draft-page",vm=t=>t.hasAttribute(gt)||t.parentElement?.hasAttribute(gt)===!0,Gn=Symbol.for("dev-process-kit.page-host"),Qa=t=>{const e=t.getAttribute(ut);return e!==null&&ui.test(e)?e:null},xm=t=>Gn in t,Xa=t=>{if(!xm(t))return null;const e=t[Gn];return Sm(e)?e:null},gi=t=>{const e=t.parentElement;return e?.localName===Fn?Qa(e):null},wm=t=>t.parentElement?.localName===Za?Qa(t):null,Ja=t=>{const e=t.parentElement;return e===null||e.localName!==Fn?null:Xa(e)},ym=t=>{const e=t.parentElement;if(e===null||e.localName!==Fn)return null;const n=Reflect.get(e,"delivered");return n instanceof Promise?n:null},$m=t=>{const e=t.parentElement;return e===null||e.localName!==Za?null:Xa(e)},Sm=t=>typeof t=="object"&&t!==null&&"dispatch"in t&&"navigation"in t,ge="page",Wn=t=>`${t}.`,je=(t,e)=>{const n=Wn(e),s={};for(const[i,r]of Object.entries(t))i.startsWith(n)&&(s[i.slice(n.length)]=r);return s},el=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,s])=>[`${Wn(t)}${n}`,s])),Am=(t,e,n,s,i=[])=>{const r={},o={};for(const[h,d]of Object.entries(n)){const f=h.indexOf(".");h===ge||f>0&&s.has(h.slice(0,f))?r[h]=d:o[h]=d}if(Object.keys(o).length===0)return r;const a=je(t,e),l=kn(a,o,i),p={...r};for(const h of Object.keys(a))Object.hasOwn(l,h)||(p[`${Wn(e)}${h}`]=null);for(const[h,d]of Object.entries(l))p[`${Wn(e)}${h}`]=d;return p};class Vn{#e;#s=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#s)e.isConnected||(n(),this.#s.delete(e))}hostDisconnected(){for(const e of this.#s.values())e();this.#s.clear()}open(e,n,s,i){this.#s.get(e)?.(),this.#s.set(e,Us(e,n,s,i))}}const fi=(t,e)=>e===0?-1:Math.min(Math.max(t,0),e-1),Em=(t,e,n)=>n===0?-1:t<0?e>0?0:n-1:(t+e+n)%n,Kn=(t,e)=>t.findIndex(n=>n.value===e),Cm=(t,e,n)=>{const s=e.trim().toLowerCase();if(s===""||t.length===0)return null;for(let i=1;i<=t.length;i+=1){const r=(n+i)%t.length;if(t[r]?.label.toLowerCase().startsWith(s))return r}return null};let Tm=0;const Rm=500;class Kt{#e;#s=`dpk-select-${++Tm}`;#t;#n=!1;#i=-1;#r="";#o;#a=null;constructor(e){this.#e=e,this.#t=new Vn(e),new un(e,{open:()=>this.#n,closesOn:n=>!n.some(s=>s instanceof Element&&s.getAttribute("data-dpk-select")===this.#s),ownsEscape:()=>this.#n,dismiss:()=>this.#p()}),e.addController(this)}hostConnected(){}hostUpdated(){this.#v()}hostDisconnected(){clearTimeout(this.#o)}render(e){this.#a=e;const n=fi(this.#i,e.options.length),i=e.options.find(o=>o.value===e.value)?.label??e.placeholder??"",r=this.#n?e.options[n]:void 0;return m`
|
|
1658
1668
|
<button
|
|
1659
1669
|
type="button"
|
|
1660
1670
|
class="dpk-rich-select ${e.className??""}"
|
|
1661
|
-
data-dpk-select=${this.#
|
|
1671
|
+
data-dpk-select=${this.#s}
|
|
1662
1672
|
?disabled=${e.disabled??!1}
|
|
1663
1673
|
aria-haspopup="listbox"
|
|
1664
|
-
aria-expanded=${this.#
|
|
1674
|
+
aria-expanded=${this.#n?"true":"false"}
|
|
1665
1675
|
aria-controls=${this.#l}
|
|
1666
1676
|
aria-label=${e.ariaLabel}
|
|
1667
|
-
aria-activedescendant=${r?this.#
|
|
1668
|
-
@click=${this.#
|
|
1669
|
-
@keydown=${o=>this.#
|
|
1677
|
+
aria-activedescendant=${r?this.#c(r.value):b}
|
|
1678
|
+
@click=${this.#u}
|
|
1679
|
+
@keydown=${o=>this.#f(o,e)}
|
|
1670
1680
|
@focus=${()=>e.onActivate?.()}
|
|
1671
1681
|
@pointerenter=${()=>e.onActivate?.()}
|
|
1672
1682
|
>
|
|
1673
1683
|
<span class="dpk-rich-select-label">${i}</span>
|
|
1674
|
-
<span class="dpk-rich-select-chevron" aria-hidden="true" data-open=${this.#
|
|
1675
|
-
${
|
|
1684
|
+
<span class="dpk-rich-select-chevron" aria-hidden="true" data-open=${this.#n?"true":"false"}>
|
|
1685
|
+
${Ia()}
|
|
1676
1686
|
</span>
|
|
1677
1687
|
</button>
|
|
1678
|
-
${this.#
|
|
1679
|
-
`}get#l(){return`${this.#
|
|
1688
|
+
${this.#n?this.#d(e,n):b}
|
|
1689
|
+
`}get#l(){return`${this.#s}-listbox`}#c(e){return`${this.#s}-option-${encodeURIComponent(e)}`}#d(e,n){return m`
|
|
1680
1690
|
<div
|
|
1681
1691
|
class="dpk-rich-select-listbox"
|
|
1682
1692
|
popover="manual"
|
|
1683
1693
|
role="listbox"
|
|
1684
1694
|
id=${this.#l}
|
|
1685
|
-
data-dpk-select=${this.#
|
|
1695
|
+
data-dpk-select=${this.#s}
|
|
1686
1696
|
aria-label=${e.ariaLabel}
|
|
1687
1697
|
>
|
|
1688
1698
|
${e.options.map((s,i)=>m`
|
|
1689
1699
|
<div
|
|
1690
1700
|
class="dpk-rich-select-option"
|
|
1691
1701
|
role="option"
|
|
1692
|
-
id=${this.#
|
|
1702
|
+
id=${this.#c(s.value)}
|
|
1693
1703
|
data-value=${s.value}
|
|
1694
1704
|
aria-selected=${s.value===e.value?"true":"false"}
|
|
1695
1705
|
data-active=${i===n?"true":"false"}
|
|
@@ -1701,32 +1711,32 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1701
1711
|
</div>
|
|
1702
1712
|
`)}
|
|
1703
1713
|
</div>
|
|
1704
|
-
`}#
|
|
1714
|
+
`}#f(e,n){if(n.disabled)return;if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();const r=e.key==="ArrowDown"?1:-1;if(this.#n)this.#i=Em(this.#i,r,n.options.length);else{this.#n=!0;const o=Kn(n.options,n.value);this.#i=o>=0?o:fi(r>0?0:n.options.length-1,n.options.length)}this.#e.requestUpdate();return}if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),!this.#n){this.#n=!0,this.#i=Kn(n.options,n.value),this.#e.requestUpdate();return}const r=n.options[fi(this.#i,n.options.length)];r&&this.#k(r.value,n);return}if(e.key==="Tab"||e.ctrlKey||e.metaKey||e.altKey||e.key.length!==1)return;e.preventDefault(),this.#r+=e.key,clearTimeout(this.#o),this.#o=setTimeout(()=>{this.#r=""},Rm);const s=this.#n?this.#i:Kn(n.options,n.value),i=Cm(n.options,this.#r,s);if(i!==null){if(this.#i=i,!this.#n){const r=n.options[i]?.value;r!==void 0&&this.#k(r,n);return}this.#e.requestUpdate()}}#u=()=>{if(this.#a?.disabled)return;if(this.#n){this.#p();return}const e=this.#a;this.#n=!0,this.#i=e?Kn(e.options,e.value):-1,this.#e.requestUpdate()};#k(e,n){this.#p(),e!==n.value&&n.onChange(e)}#p(){this.#n&&(this.#n=!1,this.#i=-1,this.#e.requestUpdate())}#v(){const e=`[data-dpk-select="${this.#s}"]`,n=this.#e.renderRoot.querySelector(`button.dpk-rich-select${e}`),s=this.#e.renderRoot.querySelector(`.dpk-rich-select-listbox${e}`);!n||!s||this.#t.open(s,n,{width:Math.max(n.offsetWidth,160),height:280},{placement:"bottom-start"})}}class Mm{#e;#s=new Map;constructor(e){this.#e=e}get(e){const n=this.#s.get(e);if(n)return n;const s=new Kt(this.#e);return this.#s.set(e,s),s}}const fe="0.4.3",mi=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues(),grill:e.grill,answers:e.answers}},Om=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:n=>{const s=typeof n=="string"?n:_(n);return e.commentsByTarget.get(s)?.length??0},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),navigate:(n,s)=>t.navigate(n,s),hashFor:n=>t.hashFor(n),requestComment:n=>t.requestComment(n)}},tl=(t,e)=>{const n=()=>mi(t);return{version:fe,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,i)=>t.dispatch({type:I,target:s,payload:{body:i}}),editComment:(s,i)=>t.editComment(s,i),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,i)=>t.navigate(s,i),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(fe),exportBrief:()=>t.brief?.(n())??In(n(),t.controller().definition,fe),subscribe:s=>t.subscribe(s)}},_m='the <script type="application/json"> child is empty',Pm='no <script type="application/json"> child found';class Lm{#e;#s;#t=null;#n;constructor(e){this.#e=e}get error(){return this.#t}read(){return this.#o(this.#r()).state}observe(){this.#n===void 0&&(this.#n=new MutationObserver(()=>this.#i()),this.#n.observe(this.#e.host,{childList:!0,subtree:!0,characterData:!0}))}disconnect(){this.#n?.disconnect(),this.#n=void 0}#i(){const e=this.#r();e!==this.#s&&this.#e.onChange(this.#o(e))}#r(){const e=this.#e.script();return e===null?null:e.textContent??""}#o(e){if(this.#s=e,e===null||e.trim().length===0)return this.#e.optional()?this.#t=null:(this.#t=e===null?Pm:_m,console.warn(`[dev-process-kit] ${this.#e.name()} has ${e===null?"no":"an empty"} base JSON; starting from an empty state.`)),{state:this.#e.empty(),error:this.#t};try{const n=this.#e.parse(JSON.parse(e));return this.#t=null,{state:n,error:null}}catch(n){return console.error("[dev-process-kit] invalid base data:",n),this.#t=n instanceof Error?n.message:String(n),{state:this.#e.empty(),error:this.#t}}}}const zm=8e3,Im=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Vr);class Dm{#e;#s;#t=null;#n=null;#i=!1;#r=null;#o=null;#a="";#l=null;#c=new Map;#d=new Set;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}get view(){return this.#t&&this.#r?oh(this.#t,this.#r):null}get log(){return this.#t}get error(){return this.#n}hostConnected(){!this.#u()&&!this.#k()&&this.#A(),document.addEventListener("pointerdown",this.#h,!0),document.addEventListener("keydown",this.#S)}hostUpdate(){!this.#u()&&this.#k()&&this.#x()}hostDisconnected(){this.#x(),document.removeEventListener("pointerdown",this.#h,!0),document.removeEventListener("keydown",this.#S);for(const e of this.#c.values())e.handle!==null&&clearTimeout(e.handle);this.#c.clear()}send(e){!this.#t||!this.#r||(this.#r=th(this.#t,this.#r,e),this.#p(),this.#g(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#r?.list.open?"close-list":"open-list"})}show(e){const n=this.#t?Je(this.#t).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#s.show(n))}pause(e){const n=this.#d.size>0;if(this.#d.add(e),n)return;const s=Date.now();for(const i of this.#c.values())i.handle!==null&&clearTimeout(i.handle),i.handle=null,i.remaining=Math.max(0,i.deadline-s)}resume(e){if(!(!this.#d.delete(e)||this.#d.size>0))for(const[n,s]of this.#c)this.#y(n,s)}#f(){return`${this.#s.storageKey()}:seen-changes`}#u(){return this.#t!==null||this.#n!==null||this.#i}#k(){const e=[...this.#e.children].find(Im);if(!e)return!1;if(this.#s.ignored?.()===!0)return console.warn("[dev-process-kit] a change log inside <dpk-page> is ignored: put it directly under <dpk-app>, qualify its targets with the page (`story:x@demo`) and prefix its navigate keys (`demo.step=\u2026`)."),this.#i=!0,!0;let n;try{n=JSON.parse(e.textContent??"")}catch(i){return this.#v(i instanceof Error?i.message:String(i))}const s=Qp(n);return s.ok?(this.#t=s.log,this.#o=this.#s.persist()?ue(Zr):Z(Zr),this.#r=eh(s.log,this.#o.read(this.#f())),this.#p(),this.#g(),this.#s.read?.(s.log),this.#e.requestUpdate(),!0):this.#v(s.error)}#p(){if(!this.#t||!this.#r)return;const e=sh(this.#t,this.#r),n=JSON.stringify(e);n!==this.#a&&(this.#a=n,this.#o?.write(this.#f(),e))}#v(e){return console.error("[dev-process-kit] invalid change log:",e),this.#n=e,this.#e.requestUpdate(),!0}#A(){this.#l=new MutationObserver(()=>{(this.#u()||this.#k())&&this.#x()}),this.#l.observe(this.#e,{childList:!0})}#x(){this.#l?.disconnect(),this.#l=null}#g(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#c)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#c.delete(n));for(const n of e){if(this.#c.has(n))continue;const s={handle:null,deadline:0,remaining:zm};this.#c.set(n,s),this.#d.size===0&&this.#y(n,s)}}#y(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#h=e=>{!this.#r?.list.open||this.#s.inside(e.composedPath())||this.send({kind:"close-list"})};#S=e=>{e.key!=="Escape"||!this.#r?.list.open||this.send({kind:"close-list"})}}const{I:Nm}=$p,nl=t=>t,qm=t=>t.strings===void 0,sl=()=>document.createComment(""),Yt=(t,e,n)=>{const s=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){const r=s.insertBefore(sl(),i),o=s.insertBefore(sl(),i);n=new Nm(r,o,t,t.options)}else{const r=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(r!==i||a){let l=n._$AA;for(;l!==r;){const p=nl(l).nextSibling;nl(s).insertBefore(l,i),l=p}}}return n},Fe=(t,e,n=t)=>(t._$AI(e,n),t),Um={},ki=(t,e=Um)=>t._$AH=e,Hm=t=>t._$AH,bi=t=>{t._$AR(),t._$AA.remove()},il=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Ge=Gt(class extends Dn{constructor(t){if(super(t),t.type!==xe.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;n===void 0?n=e:e!==void 0&&(s=e);const i=[],r=[];let o=0;for(const a of t)i[o]=s?s(a,o):o,r[o]=n(a,o),o++;return{values:r,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=Hm(t),{values:r,keys:o}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let p,h,d=0,f=i.length-1,c=0,g=r.length-1;for(;d<=f&&c<=g;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(a[d]===o[c])l[c]=Fe(i[d],r[c]),d++,c++;else if(a[f]===o[g])l[g]=Fe(i[f],r[g]),f--,g--;else if(a[d]===o[g])l[g]=Fe(i[d],r[g]),Yt(t,l[g+1],i[d]),d++,g--;else if(a[f]===o[c])l[c]=Fe(i[f],r[c]),Yt(t,i[d],i[f]),f--,c++;else if(p===void 0&&(p=il(o,c,g),h=il(a,d,f)),p.has(a[d]))if(p.has(a[f])){const u=h.get(o[c]),k=u!==void 0?i[u]:null;if(k===null){const v=Yt(t,i[d]);Fe(v,r[c]),l[c]=v}else l[c]=Fe(k,r[c]),Yt(t,i[d],k),i[u]=null;c++}else bi(i[f]),f--;else bi(i[d]),d++;for(;c<=g;){const u=Yt(t,l[g+1]);Fe(u,r[c]),l[c++]=u}for(;d<=f;){const u=i[d++];u!==null&&bi(u)}return this.ut=o,ki(t,l),K}}),Yn="dpk-changes",Bm=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return m`<button
|
|
1705
1715
|
class="dpk-chrome-action dpk-bell"
|
|
1706
1716
|
type="button"
|
|
1707
|
-
aria-controls=${
|
|
1717
|
+
aria-controls=${Yn}
|
|
1708
1718
|
aria-expanded=${t.open?"true":"false"}
|
|
1709
1719
|
aria-label=${s}
|
|
1710
1720
|
data-tooltip=${s}
|
|
1711
1721
|
@click=${n.toggleList}
|
|
1712
1722
|
>
|
|
1713
|
-
${
|
|
1714
|
-
</button>`},
|
|
1723
|
+
${Da()} ${t.unread>0?m`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:b}
|
|
1724
|
+
</button>`},rl=(t,e,n)=>t.jumpable?m`<button class="dpk-btn dpk-btn--accent dpk-notice-show" type="button" @click=${()=>n.show(t.key)}>
|
|
1715
1725
|
${e.changesShow}
|
|
1716
|
-
</button>`:b,
|
|
1726
|
+
</button>`:b,ol=(t,e,n,s)=>s==="list"||t.unread>0?m`<button
|
|
1717
1727
|
class=${s==="list"?"dpk-btn dpk-changes-read-all":"dpk-toast-more dpk-changes-read-all"}
|
|
1718
1728
|
type="button"
|
|
1719
1729
|
aria-disabled=${t.unread>0?"false":"true"}
|
|
1720
1730
|
@click=${n.readAll}
|
|
1721
1731
|
>
|
|
1722
1732
|
${e.changesReadAll}
|
|
1723
|
-
</button>`:b,
|
|
1733
|
+
</button>`:b,jm=(t,e,n)=>m`<section class="dpk-changes-group" data-revision=${t.revision}>
|
|
1724
1734
|
<h3 class="dpk-changes-revision">
|
|
1725
1735
|
<span>${t.revision}</span>
|
|
1726
1736
|
${t.latest?m`<span class="dpk-changes-current">${e.changesCurrent}</span>`:b}
|
|
1727
1737
|
</h3>
|
|
1728
1738
|
<ol class="dpk-changes-list">
|
|
1729
|
-
${
|
|
1739
|
+
${Ge(t.cards,s=>s.key,s=>m`<li
|
|
1730
1740
|
class="dpk-change"
|
|
1731
1741
|
data-key=${s.id}
|
|
1732
1742
|
data-revision=${s.revision}
|
|
@@ -1735,16 +1745,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1735
1745
|
<p class="dpk-change-title">
|
|
1736
1746
|
${s.fresh?m`<span class="dpk-change-new">${e.changesNew}</span>`:b} ${s.title}
|
|
1737
1747
|
</p>
|
|
1738
|
-
${s.body===null?b:m`<p class="dpk-change-body">${s.body}</p>`} ${
|
|
1748
|
+
${s.body===null?b:m`<p class="dpk-change-body">${s.body}</p>`} ${rl(s,e,n)}
|
|
1739
1749
|
</li>`)}
|
|
1740
1750
|
</ol>
|
|
1741
|
-
</section
|
|
1751
|
+
</section>`,Fm=(t,e,n)=>t.open?m`<div id=${Yn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
|
|
1742
1752
|
<div class="dpk-changes-head">
|
|
1743
1753
|
<h2 class="dpk-changes-title">${e.changesTitle}</h2>
|
|
1744
|
-
${
|
|
1754
|
+
${ol(t,e,n,"list")}
|
|
1745
1755
|
</div>
|
|
1746
|
-
${
|
|
1747
|
-
</div>`:b,
|
|
1756
|
+
${Ge(t.groups,s=>s.revision,s=>jm(s,e,n))}
|
|
1757
|
+
</div>`:b,Gm=(t,e,n)=>m`<section
|
|
1748
1758
|
class="dpk-toasts"
|
|
1749
1759
|
aria-live="polite"
|
|
1750
1760
|
aria-label=${e.changes}
|
|
@@ -1753,13 +1763,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1753
1763
|
@focusin=${()=>n.pause("focus")}
|
|
1754
1764
|
@focusout=${()=>n.resume("focus")}
|
|
1755
1765
|
>
|
|
1756
|
-
${
|
|
1757
|
-
<span class="dpk-toast-icon" aria-hidden="true">${
|
|
1766
|
+
${Ge(t.toasts,s=>s.key,s=>m`<div class="dpk-toast" data-key=${s.id}>
|
|
1767
|
+
<span class="dpk-toast-icon" aria-hidden="true">${Da()}</span>
|
|
1758
1768
|
<div class="dpk-toast-text">
|
|
1759
1769
|
<p class="dpk-change-title">${s.title}</p>
|
|
1760
1770
|
${s.body===null?b:m`<p class="dpk-change-body">${s.body}</p>`}
|
|
1761
1771
|
</div>
|
|
1762
|
-
${
|
|
1772
|
+
${rl(s,e,n)}
|
|
1763
1773
|
<button
|
|
1764
1774
|
class="dpk-toast-close"
|
|
1765
1775
|
type="button"
|
|
@@ -1767,16 +1777,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1767
1777
|
title=${e.changesDismiss}
|
|
1768
1778
|
@click=${()=>n.dismiss(s.key)}
|
|
1769
1779
|
>
|
|
1770
|
-
${
|
|
1780
|
+
${qe()}
|
|
1771
1781
|
</button>
|
|
1772
1782
|
</div>`)}
|
|
1773
1783
|
${t.toasts.length+t.waiting>1?m`<div class="dpk-toast-actions">
|
|
1774
1784
|
${t.waiting>0?m`<button class="dpk-toast-more" type="button" @click=${n.openList}>
|
|
1775
1785
|
${e.changesWaiting(t.waiting)} · ${e.changesSeeAll}
|
|
1776
1786
|
</button>`:b}
|
|
1777
|
-
${
|
|
1787
|
+
${ol(t,e,n,"toasts")}
|
|
1778
1788
|
</div>`:b}
|
|
1779
|
-
</section>`;function
|
|
1789
|
+
</section>`;function al(t){return t===null?1:t===void 0?2:0}function ll(t,e){const n=al(t),s=al(e);return n<s?-1:n>s?1:n!==0?0:t<e?-1:t>e?1:0}function Wm(t,e,n){return n==="asc"?ll(t,e):ll(e,t)}function Vm(t,e,n){return t.slice().sort((s,i)=>{const r=n.length;for(let o=0;o<e.length;o++){const a=r>o?n[o]:n[r-1],l=e[o],p=typeof l=="function",h=Wm(p?l(s):s[l],p?l(i):i[l],a);if(h!==0)return h}return 0})}function dl(t,e){return Vm(t,e,["asc"])}function vi(t,e,n){return n==null?Math.min(t,e):Math.min(Math.max(t,e),n)}const Km=5,xi=4,cl=8,Ym=(t,e)=>{const n=e.badgeHeight,s=t.target.right+cl,i=t.target.left-cl,r=[];let o=0,a=s;for(let l=t.widths.length-1;l>=0;l-=1){const p=t.widths[l]??0;a!==s&&a-p<i&&(o+=1,a=s),r[l]={x:a-p,y:t.target.top-n/2-o*(n+xi)},a-=p+Km}return r},pl=(t,e)=>{const n=t.map(()=>[]),s=dl(t.map((r,o)=>({group:r,index:o})).filter(({group:r})=>r.gutter),[({group:r})=>r.target.top]);let i=Number.NEGATIVE_INFINITY;for(const{group:r,index:o}of s){let a=Math.max(r.target.top,i);n[o]=r.widths.map(l=>{const p={x:e.width-l,y:a};return a+=e.badgeHeight+xi,p}),i=a}return{points:n,bottom:i-xi}},Zm=(t,e)=>Math.max(0,pl(t,e).bottom),Qm=(t,e)=>{const n=pl(t,e),s=Math.max(e.height,n.bottom);return t.map((i,r)=>(i.gutter?n.points[r]??[]:Ym(i,e)).map((o,a)=>({x:vi(o.x,0,Math.max(0,e.width-(i.widths[a]??0))),y:vi(o.y,0,Math.max(0,s-e.badgeHeight))})))},hl="data-dpk-badge-gutter",Xm=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","COLGROUP"]),Jm=t=>Xm.has(t.localName.toUpperCase()),ek=t=>t.localName==="slot",ul=t=>t instanceof HTMLElement&&!Jm(t)&&!ek(t),wi=/(auto|scroll|hidden|overlay)/,gl=3,Zn=t=>{const e=t.assignedSlot??null;if(e!==null)return e;const n=t.parentElement??null;if(n!==null)return n;const s=t.parentNode;return s instanceof ShadowRoot?s.host:null},fl=t=>getComputedStyle(t).position!=="static",ml=t=>{const e=getComputedStyle(t);return wi.test(e.overflow)||wi.test(e.overflowX)||wi.test(e.overflowY)},kl=t=>{for(let e=Zn(t);e!==null;e=Zn(e))if(ul(e)&&(fl(e)||ml(e)))return e;return tk(t)},tk=t=>{for(let e=Zn(t);e!==null;e=Zn(e))if(ul(e))return e;return null},Qn=new Map,nk=t=>{const e=Qn.get(t);if(e!==void 0){e.count+=1;return}const n=fl(t)?null:t.style.position;n!==null&&(t.style.position="relative"),Qn.set(t,{count:1,previous:n})},sk=t=>{const e=Qn.get(t);e!==void 0&&(e.count-=1,!(e.count>0)&&(e.previous!==null&&(t.style.position=e.previous),Qn.delete(t)))},bl=(t,e)=>!(t instanceof HTMLElement)||t.offsetParent!==e,ik=(t,e,n)=>{if(t.getClientRects().length===0)return null;if(!n&&t instanceof HTMLElement)return{left:t.offsetLeft,top:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight};const s=t.getBoundingClientRect(),i=e.getBoundingClientRect(),r=e.offsetWidth>0&&i.width>0?i.width/e.offsetWidth:1;return{left:(s.left-i.left)/r-e.clientLeft+e.scrollLeft,top:(s.top-i.top)/r-e.clientTop+e.scrollTop,width:s.width/r,height:s.height/r}},rk=t=>`
|
|
1780
1790
|
.${t} {
|
|
1781
1791
|
position: absolute;
|
|
1782
1792
|
inset: 0;
|
|
@@ -1787,7 +1797,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1787
1797
|
.${t} > [hidden] {
|
|
1788
1798
|
display: none;
|
|
1789
1799
|
}
|
|
1790
|
-
`;class
|
|
1800
|
+
`;class vl{#e;#s=new Map;#t=new Map;#n=null;#i=0;#r=null;#o=!1;#a;constructor(e,n){this.#e=n,e.addController(this)}hostDisconnected(){this.#h(),this.#E(),this.#A()}hostUpdated(){if(!this.#e.active()){this.#h(),this.#E(),this.#A();return}this.#l(),this.#x(),this.#y()}refresh(){if(!this.#e.active()){this.#h(),this.#E(),this.#A();return}this.#l(),this.#x(),this.#y()}#l(){const{spec:e}=this.#e;this.#o=!1;const n=new Set;for(const s of this.#e.bindings()){const i=e.keyOf(s);n.add(i);const r=this.#s.get(i);if(r!==void 0&&r.target===s.target){e.update(r.button,s),r.width=r.button.offsetWidth,r.height=r.button.offsetHeight,r.gutter=e.gutterOf?.(s)??!1,this.#d(r);continue}r!==void 0&&this.#u(r),this.#c(s,i)}for(const[s,i]of this.#s)n.has(s)||this.#u(i);this.#p();for(const s of this.#t.values())s.parent.toggleAttribute(hl,s.records.some(i=>i.gutter));this.#o&&(this.#o=!1,this.#i=gl,this.#$())}#c(e,n){if(!e.target.isConnected)return;const s=kl(e.target);if(s===null)return;const i=this.#f(s),r=this.#e.spec.create(e);this.#e.spec.update(r,e),i.layer.append(r);const o={key:n,target:e.target,button:r,portal:i,width:r.offsetWidth,height:r.offsetHeight,gutter:this.#e.spec.gutterOf?.(e)??!1,measured:bl(e.target,s)};i.records.push(o),this.#s.set(n,o),this.#o=!0}#d(e){const n=e.target;if(!e.measured&&n instanceof HTMLElement&&n.offsetParent===e.portal.parent)return;const s=kl(n);if(s===null||s===e.portal.parent)return;const i=e.portal;e.button.remove();const r=i.records.indexOf(e);r>=0&&i.records.splice(r,1),i.records.length===0&&this.#k(i);const o=this.#f(s);o.layer.append(e.button),e.portal=o,e.measured=bl(n,s),o.records.push(e),this.#o=!0}#f(e){const n=this.#t.get(e);if(n!==void 0)return n;nk(e);const s=document.createElement("div");s.className=this.#e.spec.portalClass;const i=document.createElement("style");i.textContent=`${rk(this.#e.spec.portalClass)}${this.#e.spec.styles}`,s.append(i),e.append(s);const r={parent:e,layer:s,records:[],scrolls:ml(e)};return this.#t.set(e,r),r}#u(e){e.button.remove(),this.#s.delete(e.key);const{portal:n}=e,s=n.records.indexOf(e);s>=0&&n.records.splice(s,1),!(n.records.length>0)&&this.#k(n)}#k(e){e.layer.remove(),e.parent.removeAttribute(hl),e.parent.style.minHeight="",sk(e.parent),this.#t.delete(e.parent)}#p(){if(!(typeof ResizeObserver>"u")){this.#a??=new ResizeObserver(this.#v),this.#a.disconnect();for(const e of this.#t.values()){this.#a.observe(e.parent);for(const n of e.records)this.#a.observe(n.target)}}}#v=()=>{if(this.#e.active()){if([...this.#s.values()].some(e=>!e.target.isConnected)){this.refresh();return}for(const e of this.#s.values())this.#d(e);this.#o&&this.#p(),this.#o=!1,this.#x()}};#A(){this.#a?.disconnect(),this.#E();for(const e of this.#t.values())this.#k(e);this.#t.clear(),this.#s.clear()}#x(){for(const e of this.#t.values())this.#g(e)}#g(e){const n=new Map;for(const p of e.records){const h=n.get(p.target);h===void 0?n.set(p.target,[p]):h.push(p)}const s=[],i=[];for(const[p,h]of n){const d=ik(p,e.parent,h[0]?.measured??!1);for(const f of h)f.button.hidden=d===null;d!==null&&(i.push(h),s.push({target:{left:d.left,top:d.top,right:d.left+d.width,bottom:d.top+d.height},widths:h.map(f=>f.width),gutter:h.some(f=>f.gutter)}))}const r={width:e.scrolls?e.parent.scrollWidth:e.parent.clientWidth,height:e.scrolls?e.parent.scrollHeight:e.parent.clientHeight,badgeHeight:Math.max(0,...e.records.map(p=>p.height))},o=Zm(s,r),a=o>0&&!e.scrolls?`${Math.ceil(o)}px`:"";e.parent.style.minHeight!==a&&(e.parent.style.minHeight=a);const l=Qm(s,{...r,height:Math.max(r.height,o)});i.forEach((p,h)=>{p.forEach((d,f)=>{const c=l[h]?.[f];if(c===void 0)return;const g=`${c.x}px`,u=`${c.y}px`;d.button.style.left!==g&&(d.button.style.left=g),d.button.style.top!==u&&(d.button.style.top=u)})})}#y(){if(![...this.#t.values()].some(n=>n.records.some(s=>s.measured))){this.#h();return}this.#n===null&&(this.#n=requestAnimationFrame(this.#S))}#h(){this.#n!==null&&(cancelAnimationFrame(this.#n),this.#n=null)}#S=()=>{this.#n=null,this.#e.active()&&(this.#x(),this.#n=requestAnimationFrame(this.#S))};#$(){this.#r===null&&(this.#r=requestAnimationFrame(this.#w))}#w=()=>{if(this.#r=null,!(!this.#e.active()||this.#i<=0)){this.#i-=1;for(const e of this.#s.values())this.#d(e);this.#x(),this.#y(),this.#o&&(this.#p(),this.#i=gl),this.#o=!1,this.#i>0&&this.#$()}};#E(){this.#i=0,this.#o=!1,this.#r!==null&&(cancelAnimationFrame(this.#r),this.#r=null)}}const ok="data-dpk-check",ak="off",lk=t=>t.closest(`[${ok}="${ak}"]`)===null,dk=(t,e,n)=>{if(!e.enabled)return[];const s=[];for(const i of Fs(t,`[${st}]`)){const r=i.getAttribute(st);r===null||r===""||!lk(i)||s.push({index:s.length,target:i,ref:r,status:to(e,r,n)})}return s},ck=`
|
|
1791
1801
|
.dpk-check-badge {
|
|
1792
1802
|
position: absolute;
|
|
1793
1803
|
display: inline-flex;
|
|
@@ -1843,13 +1853,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1843
1853
|
transition: none;
|
|
1844
1854
|
}
|
|
1845
1855
|
}
|
|
1846
|
-
`;class Fm extends ml{constructor(e,n){super(e,{active:n.active,bindings:n.bindings,spec:{portalClass:"dpk-check-portal",styles:jm,keyOf:s=>`${s.index}:${s.ref}`,create:s=>{const i=document.createElement("button");return i.type="button",i.className="dpk-check-badge",i.dataset.checkKey=`${s.index}:${s.ref}`,i.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),n.onToggle(i.dataset.checkRef??"")}),i},update:(s,i)=>{const r=n.labelOf(i.status);s.dataset.checkKey=`${i.index}:${i.ref}`,s.dataset.checkRef=i.ref,s.dataset.status=i.status,s.setAttribute("aria-label",r),s.title=r,Mr(i.status==="stale"?Ca():at(),s)}}})}}class Gm{#e;#n;#s=Rs;#t=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#t=this.#n.persist()?ue(Qr):Z(Qr),this.#s=this.#t.read(this.#i())??Rs}hostDisconnected(){}get enabled(){return this.#s.enabled}get state(){return this.#s}setEnabled(e){e!==this.#s.enabled&&(this.#s=Qp(this.#s,e),this.#r(),this.#e.requestUpdate())}statusOf(e){return Xr(this.#s,e,this.#n.log())}toggle(e){const n=this.statusOf(e);this.#s=eh(this.#s,e,n,Xp(this.#n.log())),this.#r(),this.#e.requestUpdate()}#i(){return`${this.#n.storageKey()}:check-mode`}#r(){this.#t?.write(this.#i(),this.#s)}}const wi=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),Wm=t=>wi(t,["use"]),Km=t=>wi(t,["anchorFor","canSendToClaude","sendToClaude"]),Vm=t=>wi(t,["collection"]),kl=async(t,e)=>{try{return await t.use(e)}catch{return null}},Ym=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=Xg(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(Yg).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=Jg(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(i),text:r}),{ok:!0}}catch(o){return{ok:!1,reason:tf(o)}}}}),Zm=async t=>{if(!Wm(t))return null;const[e,n]=await Promise.all([kl(t,"comments"),kl(t,"db")]);return Km(e)?Ym(e,Vm(n)?n:null):null},Qm=()=>Reflect.get(globalThis,"claude");class Xm{#e;#n;#s=null;#t=!1;constructor(e,n=Qm){this.#e=e,this.#n=n,e.addController(this)}get available(){return this.#t}hostConnected(){this.#s??=Zm(this.#n()),this.#i(),window.addEventListener("focus",this.#i)}hostDisconnected(){window.removeEventListener("focus",this.#i)}async send(e){const n=await this.#s;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#i(),s}#i=async()=>{const e=await this.#s,n=e?await e.canSend():!1;n!==this.#t&&(this.#t=n,this.#e.requestUpdate())}}const yi="dev-process-kit:color-scheme",Jm="(prefers-color-scheme: dark)",bl=()=>typeof matchMedia=="function"?matchMedia(Jm):null,vl=()=>_e(document.documentElement.dataset.theme)??(bl()?.matches===!0?"dark":"light");class ek{#e;#n;#s=null;#t=null;#i="light";#r=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n()?ue(_e):Z(_e),this.#t=this.#s.read(yi)),this.#i=vl(),this.#r=bl(),this.#r?.addEventListener("change",this.#d),this.#o=new MutationObserver(this.#d),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#r?.removeEventListener("change",this.#d),this.#r=null,this.#o?.disconnect(),this.#o=null}resolve(e){return eo(this.#l(e))}toggle(e){this.#a(th(this.#l(e)))}pick(e,n){this.#a(to(this.#l(e),n))}#a(e){e!==this.#t&&(this.#t=e,e===null?this.#s?.remove(yi):this.#s?.write(yi,e),this.#e.requestUpdate())}#l(e){return{preference:this.#t,authored:e,environment:this.#i}}#d=()=>{const e=vl();e!==this.#i&&(this.#i=e,this.#e.requestUpdate())}}const tk=(t,e)=>{const n=[],s=i=>{(i===t||i instanceof ShadowRoot)&&e?.(i);for(const r of i.children)r.hasAttribute("data-template")||(("commentTargets"in r||"elementActions"in r||"elementComments"in r)&&n.push(r),s(r),r.shadowRoot&&s(r.shadowRoot))};return s(t),n},xl=(t,e)=>{const n=new Map;for(const s of t)n.set(e(s),(n.get(e(s))??0)+1);return t.filter(s=>n.get(e(s))===1)},wl=(t,e)=>xl(t.filter(n=>e in n&&typeof n.id=="string"&&n.id.length>0),n=>n.id),yl=t=>wl(t,"elementActions"),$l=(t,e)=>{for(const n of yl(t)){const s=ro(e,n.id),i=Reflect.get(n,"elementActions");Array.isArray(i)&&i.length===s.length&&s.every((o,a)=>{const l=i[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},Sl=(t,e)=>{for(const n of wl(t,"elementComments")){const s=oh(e,n.id),i=Reflect.get(n,"elementComments");Array.isArray(i)&&i.length===s.length&&s.every((o,a)=>i[a]===o)||Reflect.set(n,"elementComments",s)}},nk=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(io,n);return s.success?[s.output]:[]}):[]},sk=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(ao,n.commentTargets);s.success&&e.push(...s.output)}return{targets:xl(e,n=>n.value),providers:yl(t).map(n=>({id:n.id,results:nk(n)}))}},Kt={kind:"header"},j={margin:12,default:Kt,fallback:{edge:"right",offset:12}},Al=["top","right","bottom","left"],Zn=t=>t==="top"||t==="bottom"?"horizontal":"vertical",El=t=>t.kind==="header"?"horizontal":Zn(t.dock.edge),ik=(t,e,n)=>t===n?e:{width:e.height,height:e.width},Cl=(t,e,n)=>Zn(t)==="horizontal"?{available:n.width,own:e.width}:{available:n.height,own:e.height},Tl=(t,e,n,s)=>{const{available:i,own:r}=Cl(t,n,s),o=j.margin,a=Math.max(o,i-r-j.margin);return Math.round(Math.min(a,Math.max(o,e)))},Qn=(t,e,n)=>({edge:t.edge,offset:Tl(t.edge,t.offset,e,n)}),Rl=(t,e,n)=>{const{margin:s}=j;switch(t.edge){case"top":return{left:n.left+t.offset,top:n.top+s};case"bottom":return{left:n.left+t.offset,top:n.top+n.height-e.height-s};case"left":return{left:n.left+s,top:n.top+t.offset};case"right":return{left:n.left+n.width-e.width-s,top:n.top+t.offset}}},rk=(t,e)=>{const{margin:n}=j;switch(t.edge){case"top":return[{side:"top",value:e.top+n},{side:"left",value:e.left+t.offset}];case"bottom":return[{side:"bottom",value:n},{side:"left",value:e.left+t.offset}];case"left":return[{side:"left",value:e.left+n},{side:"top",value:e.top+t.offset}];case"right":return[{side:"right",value:n},{side:"top",value:e.top+t.offset}]}},ok=(t,e)=>t.kind==="edge"&&t.dock.edge==="right"&&e>0?e+j.margin:0,ak=t=>Math.max(t.width,t.height),lk=(t,e,n)=>{const s=e===null?"none":e.kind==="header"?"targeted":"offered";return t.kind==="header"?{kind:"room",drop:s,width:n}:{kind:"return",drop:s}},Ml=t=>t.kind==="edge"?t.dock:j.fallback,Ol=(t,e,n,s)=>t.kind==="header"&&e!==null?{left:e.left,top:e.top}:Rl(Ml(t),n,s),dk=(t,e,n)=>t.kind==="header"&&e!==null?[{side:"left",value:e.left},{side:"top",value:e.top}]:rk(Ml(t),n),ck=(t,e,n,s)=>{const i=ik(Zn(t.edge),e,n);return{...Rl(Qn(t,i,s),i,s),...i}},_l=1,pk=(t,e)=>Math.abs(t.left-e.left)<=_l&&Math.abs(t.top-e.top)<=_l,hk=(t,e,n)=>({top:t.top-n.top,right:n.left+n.width-(t.left+e.width),bottom:n.top+n.height-(t.top+e.height),left:t.left-n.left}),uk=(t,e,n)=>{const s=hk(t,e,n);let i="top";for(const r of Al)s[r]<s[i]&&(i=r);return i},gk=(t,e,n)=>{const s=uk(t,e,n),i=Zn(s)==="horizontal"?t.left-n.left:t.top-n.top;return{edge:s,offset:Tl(s,i,e,n)}},Pl=(t,e,n)=>({left:Math.round(t.box.left+e-t.startX),top:Math.round(t.box.top+n-t.startY)}),Ll=(t,e,n,s)=>s&&t.top<n.top?Kt:{kind:"edge",dock:gk(t,e,n)},zl={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"top",ArrowDown:"bottom"},fk=(t,{key:e},n,s)=>{const i=zl[e];if(i!==void 0)return Qn({edge:i,offset:t.offset},n,s);const{available:r,own:o}=Cl(t.edge,n,s),a=Math.max(j.margin,r-o-j.margin);return e==="Home"?{edge:t.edge,offset:j.margin}:e==="End"?{edge:t.edge,offset:a}:null},mk=(t,e,n,s,i)=>{if(t.kind==="header"){const o=zl[e.key];return o===void 0||o==="top"?null:{kind:"edge",dock:Qn({edge:o,offset:j.margin},n,s)}}if(i&&e.key==="ArrowUp"&&t.dock.edge==="top")return Kt;const r=fk(t.dock,e,n,s);return r===null?null:{kind:"edge",dock:r}},Il=t=>{const e=t.getBoundingClientRect();return e.width===0&&e.height===0?null:{left:e.left,top:e.top,width:e.width,height:e.height}},kk=t=>typeof t=="string"&&Al.some(e=>e===t),bk=t=>{if(typeof t!="object"||t===null)return null;const{edge:e,offset:n}=t;return typeof n!="number"||!Number.isFinite(n)||!kk(e)?null:{edge:e,offset:Math.round(n)}},Dl=t=>{if(typeof t!="object"||t===null)return null;const{kind:e,dock:n}=t;if(e==="header")return Kt;const s=bk(e==="edge"?n:t);return s===null?null:{kind:"edge",dock:s}},vk=t=>`dev-process-kit:menu:${t}`,$i=t=>t===null?{width:0,height:0}:{width:t.width,height:t.height},Si={kind:"idle"};class xk{constructor(e,n){this.#s=null,this.#t="",this.#i=null,this.#r=Si,this.#o="none",this.#a=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#e.requestUpdate()),this.#l=null,this.toHeader=()=>{this.#i=Kt,this.#u(),this.#e.requestUpdate()},this.grip={pointerdown:s=>{if(s.button!==0)return;s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId);const i=this.#h(),r=this.#p(i),o=$i(i.rect),a=i.rect===null?Ol(r,i.slot,o,i.area):{left:i.rect.left,top:i.rect.top};this.#r={kind:"dragging",pointerId:s.pointerId,drag:{startX:s.clientX,startY:s.clientY,box:a},size:o,orientation:El(r),box:a},this.#e.requestUpdate()},pointermove:s=>{const i=this.#r;i.kind!=="dragging"||i.pointerId!==s.pointerId||(this.#r={...i,box:Pl(i.drag,s.clientX,s.clientY)},this.#e.requestUpdate())},pointerup:s=>this.#c(s,s),pointercancel:s=>this.#c(s,s),lostpointercapture:s=>this.#c(s,null),keydown:s=>{const i=this.#h(),r=mk(this.#p(i),s,$i(i.rect),i.area,i.slot!==null);r!==null&&(s.preventDefault(),this.#i=r,this.#u(),this.#e.requestUpdate())}},this.#d=()=>{this.#e.requestUpdate()},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#t;#i;#r;#o;#a;#l;hostConnected(){if(this.#s===null){const e=this.#n.persistKey();this.#s=e===null?Z(Dl):ue(Dl),this.#t=vk(e??""),this.#i=this.#s.read(this.#t)??j.default}typeof window<"u"&&window.addEventListener("resize",this.#d)}hostDisconnected(){this.#r=Si,this.#a?.disconnect(),this.#l=null,typeof window<"u"&&window.removeEventListener("resize",this.#d)}hostUpdated(){this.#k(this.#n.surface());const e=this.#h(),n=this.#x(this.#p(e),e);if(e.rect!==null&&n!==null&&pk(e.rect,n)){this.#o="none";return}const s=e.rect===null?"unmeasurable":"misplaced";this.#o!==s&&(this.#o=s,queueMicrotask(()=>this.#e.requestUpdate()))}get placement(){const e=this.#h(),n=this.#p(e),s=this.#r,i=s.kind==="dragging"?Ll(s.box,s.size,e.area,e.slot!==null):null,r=s.kind==="dragging"&&i?.kind==="edge"?ck(i.dock,s.size,s.orientation,e.area):null,o=s.kind==="dragging"?s.size:e.rect,a=o===null?null:ak(o);return{spot:n,box:this.#x(n,e),insets:dk(n,e.slot,e.area),drop:i,ghost:r,slot:lk(n,i,a)}}get dragging(){return this.#r.kind==="dragging"}#d;#c(e,n){const s=this.#r;if(s.kind!=="dragging"||s.pointerId!==e.pointerId)return;this.#r=Si;const i=this.#h(),r=n===null?s.box:Pl(s.drag,n.clientX,n.clientY);this.#i=Ll(r,s.size,i.area,i.slot!==null),this.#u(),this.#e.requestUpdate()}#u(){this.#i!==null&&this.#s?.write(this.#t,this.#i)}#h(){const e=this.#n.surface(),n=this.#n.header();return{rect:e===null?null:Il(e),slot:n===null?null:Il(n),area:this.#n.area()}}#k(e){e!==this.#l&&(this.#l!==null&&this.#a?.unobserve(this.#l),this.#l=e,e!==null&&this.#a?.observe(e,{box:"border-box"}))}#p({rect:e,slot:n,area:s}){const i=this.#i??j.default;if(i.kind==="header"&&n!==null)return i;const r=i.kind==="edge"?i.dock:j.fallback;return{kind:"edge",dock:Qn(r,$i(e),s)}}#x(e,{rect:n,slot:s,area:i}){const r=this.#r;return r.kind==="dragging"?r.box:n===null?null:Ol(e,s,n,i)}}const wk=(t,e,n,s,i)=>{const r=El(e.spot),o=e.box;return m`${$k(e.ghost)}
|
|
1856
|
+
`;class pk extends vl{constructor(e,n){super(e,{active:n.active,bindings:n.bindings,spec:{portalClass:"dpk-check-portal",styles:ck,keyOf:s=>`${s.index}:${s.ref}`,create:s=>{const i=document.createElement("button");return i.type="button",i.className="dpk-check-badge",i.dataset.checkKey=`${s.index}:${s.ref}`,i.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),n.onToggle(i.dataset.checkRef??"")}),i},update:(s,i)=>{const r=n.labelOf(i.status);s.dataset.checkKey=`${i.index}:${i.ref}`,s.dataset.checkRef=i.ref,s.dataset.status=i.status,s.setAttribute("aria-label",r),s.title=r,Pr(i.status==="stale"?Ma():at(),s)}}})}}class hk{#e;#s;#t=Ms;#n=null;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}hostConnected(){this.#n=this.#s.persist()?ue(eo):Z(eo),this.#t=this.#n.read(this.#i())??Ms}hostDisconnected(){}get enabled(){return this.#t.enabled}get state(){return this.#t}setEnabled(e){e!==this.#t.enabled&&(this.#t=dh(this.#t,e),this.#r(),this.#e.requestUpdate())}statusOf(e){return to(this.#t,e,this.#s.log())}toggle(e){const n=this.statusOf(e);this.#t=hh(this.#t,e,n,ch(this.#s.log())),this.#r(),this.#e.requestUpdate()}#i(){return`${this.#s.storageKey()}:check-mode`}#r(){this.#n?.write(this.#i(),this.#t)}}const yi=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),uk=t=>yi(t,["use"]),gk=t=>yi(t,["anchorFor","canSendToClaude","sendToClaude"]),fk=t=>yi(t,["collection"]),xl=async(t,e)=>{try{return await t.use(e)}catch{return null}},mk=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=cf(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(af).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=pf(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(i),text:r}),{ok:!0}}catch(o){return{ok:!1,reason:uf(o)}}}}),kk=async t=>{if(!uk(t))return null;const[e,n]=await Promise.all([xl(t,"comments"),xl(t,"db")]);return gk(e)?mk(e,fk(n)?n:null):null},bk=()=>Reflect.get(globalThis,"claude");class vk{#e;#s;#t=null;#n=!1;constructor(e,n=bk){this.#e=e,this.#s=n,e.addController(this)}get available(){return this.#n}hostConnected(){this.#t??=kk(this.#s()),this.#i(),window.addEventListener("focus",this.#i)}hostDisconnected(){window.removeEventListener("focus",this.#i)}async send(e){const n=await this.#t;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#i(),s}#i=async()=>{const e=await this.#t,n=e?await e.canSend():!1;n!==this.#n&&(this.#n=n,this.#e.requestUpdate())}}const $i="dev-process-kit:color-scheme",xk="(prefers-color-scheme: dark)",wl=()=>typeof matchMedia=="function"?matchMedia(xk):null,yl=()=>_e(document.documentElement.dataset.theme)??(wl()?.matches===!0?"dark":"light");class wk{#e;#s;#t=null;#n=null;#i="light";#r=null;#o=null;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}hostConnected(){this.#t===null&&(this.#t=this.#s()?ue(_e):Z(_e),this.#n=this.#t.read($i)),this.#i=yl(),this.#r=wl(),this.#r?.addEventListener("change",this.#c),this.#o=new MutationObserver(this.#c),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#r?.removeEventListener("change",this.#c),this.#r=null,this.#o?.disconnect(),this.#o=null}resolve(e){return so(this.#l(e))}toggle(e){this.#a(uh(this.#l(e)))}pick(e,n){this.#a(io(this.#l(e),n))}#a(e){e!==this.#n&&(this.#n=e,e===null?this.#t?.remove($i):this.#t?.write($i,e),this.#e.requestUpdate())}#l(e){return{preference:this.#n,authored:e,environment:this.#i}}#c=()=>{const e=yl();e!==this.#i&&(this.#i=e,this.#e.requestUpdate())}}const yk=(t,e)=>{const n=[],s=i=>{(i===t||i instanceof ShadowRoot)&&e?.(i);for(const r of i.children)r.hasAttribute("data-template")||(("commentTargets"in r||"elementActions"in r||"elementComments"in r)&&n.push(r),s(r),r.shadowRoot&&s(r.shadowRoot))};return s(t),n},$l=(t,e)=>{const n=new Map;for(const s of t)n.set(e(s),(n.get(e(s))??0)+1);return t.filter(s=>n.get(e(s))===1)},Sl=(t,e)=>$l(t.filter(n=>e in n&&typeof n.id=="string"&&n.id.length>0),n=>n.id),Al=t=>Sl(t,"elementActions"),El=(t,e)=>{for(const n of Al(t)){const s=lo(e,n.id),i=Reflect.get(n,"elementActions");Array.isArray(i)&&i.length===s.length&&s.every((o,a)=>{const l=i[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},Cl=(t,e)=>{for(const n of Sl(t,"elementComments")){const s=bh(e,n.id),i=Reflect.get(n,"elementComments");Array.isArray(i)&&i.length===s.length&&s.every((o,a)=>i[a]===o)||Reflect.set(n,"elementComments",s)}},$k=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(ao,n);return s.success?[s.output]:[]}):[]},Sk=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(po,n.commentTargets);s.success&&e.push(...s.output)}return{targets:$l(e,n=>n.value),providers:Al(t).map(n=>({id:n.id,results:$k(n)}))}},Zt={kind:"header"},j={margin:12,default:Zt,fallback:{edge:"right",offset:12}},Tl=["top","right","bottom","left"],Xn=t=>t==="top"||t==="bottom"?"horizontal":"vertical",Rl=t=>t.kind==="header"?"horizontal":Xn(t.dock.edge),Ak=(t,e,n)=>t===n?e:{width:e.height,height:e.width},Ml=(t,e,n)=>Xn(t)==="horizontal"?{available:n.width,own:e.width}:{available:n.height,own:e.height},Ol=(t,e,n,s)=>{const{available:i,own:r}=Ml(t,n,s),o=j.margin,a=Math.max(o,i-r-j.margin);return Math.round(Math.min(a,Math.max(o,e)))},Jn=(t,e,n)=>({edge:t.edge,offset:Ol(t.edge,t.offset,e,n)}),_l=(t,e,n)=>{const{margin:s}=j;switch(t.edge){case"top":return{left:n.left+t.offset,top:n.top+s};case"bottom":return{left:n.left+t.offset,top:n.top+n.height-e.height-s};case"left":return{left:n.left+s,top:n.top+t.offset};case"right":return{left:n.left+n.width-e.width-s,top:n.top+t.offset}}},Ek=(t,e)=>{const{margin:n}=j;switch(t.edge){case"top":return[{side:"top",value:e.top+n},{side:"left",value:e.left+t.offset}];case"bottom":return[{side:"bottom",value:n},{side:"left",value:e.left+t.offset}];case"left":return[{side:"left",value:e.left+n},{side:"top",value:e.top+t.offset}];case"right":return[{side:"right",value:n},{side:"top",value:e.top+t.offset}]}},Ck=(t,e)=>t.kind==="edge"&&t.dock.edge==="right"&&e>0?e+j.margin:0,Tk=t=>Math.max(t.width,t.height),Rk=(t,e,n)=>{const s=e===null?"none":e.kind==="header"?"targeted":"offered";return t.kind==="header"?{kind:"room",drop:s,width:n}:{kind:"return",drop:s}},Pl=t=>t.kind==="edge"?t.dock:j.fallback,Ll=(t,e,n,s)=>t.kind==="header"&&e!==null?{left:e.left,top:e.top}:_l(Pl(t),n,s),Mk=(t,e,n)=>t.kind==="header"&&e!==null?[{side:"left",value:e.left},{side:"top",value:e.top}]:Ek(Pl(t),n),Ok=(t,e,n,s)=>{const i=Ak(Xn(t.edge),e,n);return{..._l(Jn(t,i,s),i,s),...i}},zl=1,_k=(t,e)=>Math.abs(t.left-e.left)<=zl&&Math.abs(t.top-e.top)<=zl,Pk=(t,e,n)=>({top:t.top-n.top,right:n.left+n.width-(t.left+e.width),bottom:n.top+n.height-(t.top+e.height),left:t.left-n.left}),Lk=(t,e,n)=>{const s=Pk(t,e,n);let i="top";for(const r of Tl)s[r]<s[i]&&(i=r);return i},zk=(t,e,n)=>{const s=Lk(t,e,n),i=Xn(s)==="horizontal"?t.left-n.left:t.top-n.top;return{edge:s,offset:Ol(s,i,e,n)}},Il=(t,e,n)=>({left:Math.round(t.box.left+e-t.startX),top:Math.round(t.box.top+n-t.startY)}),Dl=(t,e,n,s)=>s&&t.top<n.top?Zt:{kind:"edge",dock:zk(t,e,n)},Nl={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"top",ArrowDown:"bottom"},Ik=(t,{key:e},n,s)=>{const i=Nl[e];if(i!==void 0)return Jn({edge:i,offset:t.offset},n,s);const{available:r,own:o}=Ml(t.edge,n,s),a=Math.max(j.margin,r-o-j.margin);return e==="Home"?{edge:t.edge,offset:j.margin}:e==="End"?{edge:t.edge,offset:a}:null},Dk=(t,e,n,s,i)=>{if(t.kind==="header"){const o=Nl[e.key];return o===void 0||o==="top"?null:{kind:"edge",dock:Jn({edge:o,offset:j.margin},n,s)}}if(i&&e.key==="ArrowUp"&&t.dock.edge==="top")return Zt;const r=Ik(t.dock,e,n,s);return r===null?null:{kind:"edge",dock:r}},ql=t=>{const e=t.getBoundingClientRect();return e.width===0&&e.height===0?null:{left:e.left,top:e.top,width:e.width,height:e.height}},Nk=t=>typeof t=="string"&&Tl.some(e=>e===t),qk=t=>{if(typeof t!="object"||t===null)return null;const{edge:e,offset:n}=t;return typeof n!="number"||!Number.isFinite(n)||!Nk(e)?null:{edge:e,offset:Math.round(n)}},Ul=t=>{if(typeof t!="object"||t===null)return null;const{kind:e,dock:n}=t;if(e==="header")return Zt;const s=qk(e==="edge"?n:t);return s===null?null:{kind:"edge",dock:s}},Uk=t=>`dev-process-kit:menu:${t}`,Si=t=>t===null?{width:0,height:0}:{width:t.width,height:t.height},Ai={kind:"idle"};class Hk{constructor(e,n){this.#t=null,this.#n="",this.#i=null,this.#r=Ai,this.#o="none",this.#a=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#e.requestUpdate()),this.#l=null,this.toHeader=()=>{this.#i=Zt,this.#f(),this.#e.requestUpdate()},this.grip={pointerdown:s=>{if(s.button!==0)return;s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId);const i=this.#u(),r=this.#p(i),o=Si(i.rect),a=i.rect===null?Ll(r,i.slot,o,i.area):{left:i.rect.left,top:i.rect.top};this.#r={kind:"dragging",pointerId:s.pointerId,drag:{startX:s.clientX,startY:s.clientY,box:a},size:o,orientation:Rl(r),box:a},this.#e.requestUpdate()},pointermove:s=>{const i=this.#r;i.kind!=="dragging"||i.pointerId!==s.pointerId||(this.#r={...i,box:Il(i.drag,s.clientX,s.clientY)},this.#e.requestUpdate())},pointerup:s=>this.#d(s,s),pointercancel:s=>this.#d(s,s),lostpointercapture:s=>this.#d(s,null),keydown:s=>{const i=this.#u(),r=Dk(this.#p(i),s,Si(i.rect),i.area,i.slot!==null);r!==null&&(s.preventDefault(),this.#i=r,this.#f(),this.#e.requestUpdate())}},this.#c=()=>{this.#e.requestUpdate()},this.#e=e,this.#s=n,e.addController(this)}#e;#s;#t;#n;#i;#r;#o;#a;#l;hostConnected(){if(this.#t===null){const e=this.#s.persistKey();this.#t=e===null?Z(Ul):ue(Ul),this.#n=Uk(e??""),this.#i=this.#t.read(this.#n)??j.default}typeof window<"u"&&window.addEventListener("resize",this.#c)}hostDisconnected(){this.#r=Ai,this.#a?.disconnect(),this.#l=null,typeof window<"u"&&window.removeEventListener("resize",this.#c)}hostUpdated(){this.#k(this.#s.surface());const e=this.#u(),n=this.#v(this.#p(e),e);if(e.rect!==null&&n!==null&&_k(e.rect,n)){this.#o="none";return}const s=e.rect===null?"unmeasurable":"misplaced";this.#o!==s&&(this.#o=s,queueMicrotask(()=>this.#e.requestUpdate()))}get placement(){const e=this.#u(),n=this.#p(e),s=this.#r,i=s.kind==="dragging"?Dl(s.box,s.size,e.area,e.slot!==null):null,r=s.kind==="dragging"&&i?.kind==="edge"?Ok(i.dock,s.size,s.orientation,e.area):null,o=s.kind==="dragging"?s.size:e.rect,a=o===null?null:Tk(o);return{spot:n,box:this.#v(n,e),insets:Mk(n,e.slot,e.area),drop:i,ghost:r,slot:Rk(n,i,a)}}get dragging(){return this.#r.kind==="dragging"}#c;#d(e,n){const s=this.#r;if(s.kind!=="dragging"||s.pointerId!==e.pointerId)return;this.#r=Ai;const i=this.#u(),r=n===null?s.box:Il(s.drag,n.clientX,n.clientY);this.#i=Dl(r,s.size,i.area,i.slot!==null),this.#f(),this.#e.requestUpdate()}#f(){this.#i!==null&&this.#t?.write(this.#n,this.#i)}#u(){const e=this.#s.surface(),n=this.#s.header();return{rect:e===null?null:ql(e),slot:n===null?null:ql(n),area:this.#s.area()}}#k(e){e!==this.#l&&(this.#l!==null&&this.#a?.unobserve(this.#l),this.#l=e,e!==null&&this.#a?.observe(e,{box:"border-box"}))}#p({rect:e,slot:n,area:s}){const i=this.#i??j.default;if(i.kind==="header"&&n!==null)return i;const r=i.kind==="edge"?i.dock:j.fallback;return{kind:"edge",dock:Jn(r,Si(e),s)}}#v(e,{rect:n,slot:s,area:i}){const r=this.#r;return r.kind==="dragging"?r.box:n===null?null:Ll(e,s,n,i)}}const Bk=(t,e,n,s,i)=>{const r=Rl(e.spot),o=e.box;return m`${Fk(e.ghost)}
|
|
1847
1857
|
<div
|
|
1848
1858
|
class="dpk-floating-menu"
|
|
1849
1859
|
data-edge=${e.spot.kind==="header"?"header":e.spot.dock.edge}
|
|
1850
1860
|
data-orientation=${r}
|
|
1851
1861
|
?data-dragging=${i}
|
|
1852
|
-
style=${o===null?
|
|
1862
|
+
style=${o===null?Gk(e.insets):`left: ${o.left}px; top: ${o.top}px`}
|
|
1853
1863
|
role="group"
|
|
1854
1864
|
aria-label=${t.menu}
|
|
1855
1865
|
>
|
|
@@ -1865,12 +1875,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1865
1875
|
@lostpointercapture=${s.grip.lostpointercapture}
|
|
1866
1876
|
@keydown=${s.grip.keydown}
|
|
1867
1877
|
>
|
|
1868
|
-
${r==="horizontal"?
|
|
1878
|
+
${r==="horizontal"?Pa():_a()}
|
|
1869
1879
|
</button>
|
|
1870
|
-
${n.undoRedo} ${
|
|
1880
|
+
${n.undoRedo} ${Hl(r)}
|
|
1871
1881
|
<div class="dpk-menu-tools">${n.checkMode} ${n.notices}</div>
|
|
1872
|
-
${
|
|
1873
|
-
</div>`},
|
|
1882
|
+
${Hl(r)} ${n.review}
|
|
1883
|
+
</div>`},jk=(t,e,n)=>{const s=e.slot;return s.kind==="return"?m`<button
|
|
1874
1884
|
class="dpk-chrome-action dpk-menu-slot dpk-menu-return"
|
|
1875
1885
|
type="button"
|
|
1876
1886
|
data-drop=${s.drop}
|
|
@@ -1878,17 +1888,17 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1878
1888
|
data-tooltip=${t.menuReturn}
|
|
1879
1889
|
@click=${n.toHeader}
|
|
1880
1890
|
>
|
|
1881
|
-
${
|
|
1891
|
+
${Cf()}
|
|
1882
1892
|
</button>`:m`<div
|
|
1883
1893
|
class="dpk-menu-slot"
|
|
1884
1894
|
data-drop=${s.drop}
|
|
1885
1895
|
style=${s.width===null?"":`width: ${s.width}px`}
|
|
1886
1896
|
aria-hidden="true"
|
|
1887
|
-
></div>`}
|
|
1897
|
+
></div>`},Fk=t=>t===null?b:m`<div
|
|
1888
1898
|
class="dpk-menu-drop"
|
|
1889
1899
|
style="left: ${t.left}px; top: ${t.top}px; width: ${t.width}px; height: ${t.height}px"
|
|
1890
1900
|
aria-hidden="true"
|
|
1891
|
-
></div>`,
|
|
1901
|
+
></div>`,Gk=t=>t.map(({side:e,value:n})=>`${e}: ${n}px`).join("; "),Hl=t=>t==="horizontal"?m`<span class="dpk-menu-separator" role="separator" aria-orientation="vertical"></span>`:m`<span class="dpk-menu-separator" role="separator" aria-orientation="horizontal"></span>`,Bl=P`
|
|
1892
1902
|
.dpk-floating-menu {
|
|
1893
1903
|
position: fixed;
|
|
1894
1904
|
z-index: 50;
|
|
@@ -2046,7 +2056,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2046
2056
|
display: none;
|
|
2047
2057
|
}
|
|
2048
2058
|
}
|
|
2049
|
-
`,
|
|
2059
|
+
`,Wk=t=>{const e=[t];t.shadowRoot&&e.push(t.shadowRoot);for(const n of t.querySelectorAll("*"))n.shadowRoot&&e.push(n.shadowRoot);return e},Vk=(t,e,n,s,i=(r,o)=>[o])=>{if(e.questions.length===0)return[];const r=new Map(e.questions.map(a=>[a.ref,a])),o=[];for(const a of Wk(t))for(const l of a.querySelectorAll(`[${Bt}]`)){const p=l.getAttribute(Bt)??"";for(const h of p.split(/\s+/)){const d=i(l,h).map(f=>r.get(f)).find(f=>f!==void 0);d&&o.push({index:o.length,target:l,questionId:d.id,ref:d.ref,title:d.title,answered:zn(d,n[d.id]),open:d.id===s})}}return o},Kk=`
|
|
2050
2060
|
.dpk-grill-badge {
|
|
2051
2061
|
position: absolute;
|
|
2052
2062
|
display: inline-flex;
|
|
@@ -2103,7 +2113,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2103
2113
|
transition: none;
|
|
2104
2114
|
}
|
|
2105
2115
|
}
|
|
2106
|
-
`,
|
|
2116
|
+
`,jl={childList:!0,subtree:!0,attributes:!0,attributeFilter:[Bt]},Fl="dpk-grill-portal",Yk=t=>((t instanceof Element?t:t?.parentElement??null)?.closest(`.${Fl}`)??null)!==null;class Zk extends vl{#e;#s;#t=null;#n="";constructor(e,n){super(e,{active:n.active,bindings:n.bindings,spec:{portalClass:Fl,styles:Kk,keyOf:s=>`${s.index}:${s.ref}`,create:s=>{const i=document.createElement("button");return i.type="button",i.className="dpk-grill-badge",i.dataset.badge=String(s.index),i.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),n.open(i.dataset.question??"")}),i},update:(s,i)=>{const r=n.labelOf(i);s.dataset.badge=String(i.index),s.dataset.question=i.questionId,s.dataset.answered=String(i.answered),s.setAttribute("aria-pressed",String(i.open)),s.setAttribute("aria-label",r),s.title=`${i.ref} \xB7 ${i.title}`,s.textContent!==i.ref&&(s.textContent=i.ref)},gutterOf:s=>n.gutterOf(s.target)}}),this.#e=e,this.#s=n}hostDisconnected(){super.hostDisconnected(),this.#t?.disconnect(),this.#t=null}hostUpdated(){if(this.#t?.disconnect(),!this.#s.active()){super.hostUpdated();return}const e=this.#i();e!==this.#n&&(this.#n=e,this.#e.requestUpdate()),this.#t??=new MutationObserver(n=>{n.every(s=>Yk(s.target))||(this.#e.requestUpdate(),this.refresh())}),this.#t.observe(this.#e,jl);for(const n of this.#e.querySelectorAll("*"))n.shadowRoot&&this.#t.observe(n.shadowRoot,jl);super.hostUpdated()}#i(){const e=this.#e.shadowRoot?.querySelectorAll(`[${Bt}]`)??[];return Array.from(e,n=>n.getAttribute(Bt)??"").join("|")}}const Ei=(t,e)=>e!==null&&rt(t,e)?e:t.questions[0]?.id??null,Qk=(t,e)=>e!=="current"&&t.rounds[e]!==void 0?e:"current",Gl=(t,e)=>t.options.map((n,s)=>({id:n.id,letter:xg(s),label:n.label,checked:e?.kind==="option"&&e.optionId===n.id})),Xk=(t,e,n)=>{if(e.rounds.length===0)return[];const s=e.rounds.map((i,r)=>({value:String(r),label:t.grillRoundOption(i.label,i.questions.length),selected:n===r}));return[{value:"current",label:t.grillRoundOption(t.grillCurrentRound,e.questions.length),selected:n==="current"},...s.reverse()]},Jk=(t,e,n,s)=>{const i=la(e,n),r=Qk(e,s.round),o=Xk(t,e,r),a=t.grillProgress(i.answered,i.total),l=r==="current"?void 0:e.rounds[r];if(l!==void 0)return{progress:a,rounds:o,view:{kind:"past",note:t.grillPastRound(l.label),questions:l.questions.map(h=>{const d=Ln(h,h.answer);return{id:h.id,ref:h.ref,title:h.title,description:h.description,note:h.note,answered:d!=="",summary:d===""?t.grillUnanswered:d,choices:Gl(h,h.answer),freeText:h.answer?.kind==="free"?h.answer.text:null}})}};const p=Ei(e,s.open);return{progress:a,rounds:o,view:{kind:"current",questions:e.questions.map(h=>{const d=n[h.id],f=Ln(h,d);return{id:h.id,ref:h.ref,title:h.title,description:h.description,note:h.note,open:h.id===p,answered:f!=="",summary:f,choices:Gl(h,d),draft:d?.kind==="free"?d.text:"",freeSelected:d?.kind==="free",allowFreeText:h.freeText}})}}},eb=(t,e,n,s,i)=>m`
|
|
2107
2117
|
<div class="dpk-grill">
|
|
2108
2118
|
<header class="dpk-grill-head">
|
|
2109
2119
|
<h2>${t.grill}</h2>
|
|
@@ -2114,11 +2124,11 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2114
2124
|
</div>`}
|
|
2115
2125
|
<div class="dpk-grill-list">
|
|
2116
2126
|
${e.view.kind==="past"?m`<p class="dpk-grill-round-note">${e.view.note}</p>`:b}
|
|
2117
|
-
${e.view.questions.length===0?m`<p class="dpk-grill-empty">${t.grillNoQuestions}</p>`:e.view.kind==="current"?
|
|
2127
|
+
${e.view.questions.length===0?m`<p class="dpk-grill-empty">${t.grillNoQuestions}</p>`:e.view.kind==="current"?Ge(e.view.questions,r=>r.id,r=>tb(t,r,n)):Ge(e.view.questions,r=>r.id,sb)}
|
|
2118
2128
|
</div>
|
|
2119
2129
|
${s}
|
|
2120
2130
|
</div>
|
|
2121
|
-
`,
|
|
2131
|
+
`,tb=(t,e,n)=>m`
|
|
2122
2132
|
<section
|
|
2123
2133
|
class="dpk-grill-question"
|
|
2124
2134
|
data-question=${e.id}
|
|
@@ -2137,13 +2147,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2137
2147
|
<strong>${e.title}</strong>
|
|
2138
2148
|
${!e.open&&e.answered?m`<span class="dpk-grill-summary">${e.summary}</span>`:b}
|
|
2139
2149
|
</span>
|
|
2140
|
-
<span class="dpk-grill-chevron" aria-hidden="true">${
|
|
2150
|
+
<span class="dpk-grill-chevron" aria-hidden="true">${Wt()}</span>
|
|
2141
2151
|
</button>
|
|
2142
2152
|
${e.open?m`<div class="dpk-grill-body" id=${`dpk-grill-body-${e.id}`}>
|
|
2143
2153
|
${e.description?m`<p class="dpk-grill-description">${e.description}</p>`:b}
|
|
2144
2154
|
${e.note?m`<p class="dpk-grill-note">${e.note}</p>`:b}
|
|
2145
2155
|
<div class="dpk-grill-choices" role="radiogroup" aria-label=${e.title}>
|
|
2146
|
-
${e.choices.map(s=>
|
|
2156
|
+
${e.choices.map(s=>nb(e.id,s,n))}
|
|
2147
2157
|
${e.allowFreeText?m`<label class="dpk-grill-choice" data-free=${String(e.freeSelected)}>
|
|
2148
2158
|
<input
|
|
2149
2159
|
type="radio"
|
|
@@ -2174,7 +2184,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2174
2184
|
</button>`:b}
|
|
2175
2185
|
</div>`:b}
|
|
2176
2186
|
</section>
|
|
2177
|
-
`,
|
|
2187
|
+
`,nb=(t,e,n)=>m`
|
|
2178
2188
|
<label class="dpk-grill-choice" data-choice=${e.id}>
|
|
2179
2189
|
<input
|
|
2180
2190
|
type="radio"
|
|
@@ -2188,7 +2198,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2188
2198
|
<span>${e.label}</span>
|
|
2189
2199
|
</span>
|
|
2190
2200
|
</label>
|
|
2191
|
-
`,
|
|
2201
|
+
`,sb=t=>m`
|
|
2192
2202
|
<details class="dpk-grill-question" data-past data-question=${t.id} data-answered=${String(t.answered)}>
|
|
2193
2203
|
<summary class="dpk-grill-heading">
|
|
2194
2204
|
<span class="dpk-grill-ref">${t.ref}</span>
|
|
@@ -2196,7 +2206,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2196
2206
|
<strong>${t.title}</strong>
|
|
2197
2207
|
<span class="dpk-grill-summary">${t.summary}</span>
|
|
2198
2208
|
</span>
|
|
2199
|
-
<span class="dpk-grill-chevron" aria-hidden="true">${
|
|
2209
|
+
<span class="dpk-grill-chevron" aria-hidden="true">${Wt()}</span>
|
|
2200
2210
|
</summary>
|
|
2201
2211
|
<div class="dpk-grill-body">
|
|
2202
2212
|
${t.description?m`<p class="dpk-grill-description">${t.description}</p>`:b}
|
|
@@ -2210,7 +2220,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2210
2220
|
${t.freeText===null?b:m`<p class="dpk-grill-past-choice" data-checked="true">${t.freeText}</p>`}
|
|
2211
2221
|
</div>
|
|
2212
2222
|
</details>
|
|
2213
|
-
`,
|
|
2223
|
+
`,ib=2400;class rb{#e=ff();#s=null;#t;constructor(e){this.#t=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#r()}async copy(e){this.#n({kind:"copy-started"});const n=this.#e.request,s=await Tn(e()).catch(()=>!1);this.#n({kind:"copy-finished",request:n,ok:s}),this.#i(n)}async send(e){if(this.#e.status.kind==="sending")return;this.#n({kind:"send-started"});const n=this.#e.request,s=await e().catch(()=>({ok:!1,reason:"error"}));this.#n({kind:"send-finished",request:n,outcome:s}),s.ok&&this.#i(n)}#n(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#r(),this.#e=mf(this.#e,e),this.#t.requestUpdate()}#i(e){e===this.#e.request&&(this.#r(),this.#s=setTimeout(()=>{this.#s=null,this.#n({kind:"settled",request:e})},ib))}#r(){this.#s!==null&&clearTimeout(this.#s),this.#s=null}}class ob{#e;#s;#t=null;#n=null;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}hostConnected(){this.#t=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#i())}hostUpdated(){const e=this.#s();if(e===this.#n){e&&this.#i();return}this.#n&&this.#t?.unobserve(this.#n),this.#n=e,e?(this.#t?.observe(e),this.#i()):this.#e.style.removeProperty("--dpk-header-height")}hostDisconnected(){this.#t?.disconnect(),this.#t=null,this.#n=null}#i(){this.#n&&this.#e.style.setProperty("--dpk-header-height",`${this.#n.getBoundingClientRect().height}px`)}}const Ci="dev-process-kit:locale";class ab{#e;#s;#t;#n;#i=null;#r=null;#o;#a;constructor(e,n,s,i){this.#e=e,this.#s=n,this.#t=s,this.#n=i,e.addController(this)}get authored(){if(this.#o===void 0)return On(Mn(this.#e));const e=this.#e.parentNode;return On(this.#o??(e===null?null:Mn(e)))}get locale(){return this.#a??this.#l()}#l(){return Iu({preference:this.#r,authored:this.authored})}hostConnected(){this.#t()&&(this.#i===null&&(this.#i=this.#s()?ue(Ko):Z(Ko),this.#r=this.#i.read(Ci)),this.#o??=this.#e.getAttribute("lang"),this.#c())}pick(e){this.#t()&&(this.#r=Du(e,this.authored),this.#r===null?this.#i?.remove(Ci):this.#i?.write(Ci,this.#r),this.#c(),this.#e.requestUpdate())}#c(){const e=this.#r??this.#o??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#l();if(n===this.#a)return;const s=this.#a===void 0;this.#a=n,this.#n(),(!s||this.#r!==null)&&document.dispatchEvent(new Event(Ws))}}const Wl=()=>mn(typeof location>"u"?"":location.hash),lb=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${Xe(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))},ft=(t,e)=>t instanceof e?t:null;class db{#e;#s=null;#t=0;constructor(e){this.#e=e}get orphans(){return this.#t}route(){const e=this.#e.renderRoot,n=ft(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(n===null)return;this.#s!==n&&(this.#s=n,n.addEventListener("slotchange",this.#n));const s=new Set(Array.from(e.querySelectorAll("slot")).map(r=>r.getAttribute("name")??"")),i=n.assignedElements();for(const r of i){const o=r.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;r.getAttribute("slot")!==a&&s.has(a)&&r.setAttribute("slot",a)}i.length!==this.#t&&(this.#t=i.length,queueMicrotask(()=>this.#e.requestUpdate()))}#n=()=>{queueMicrotask(()=>this.route())}}const Ti=16,cb=(t,e)=>t-e.bottom-Ti,pb=t=>t.top-Ti,hb=(t,e)=>{const n=cb(t,e),s=pb(e),i=n>=s,r=i?n:s;return{placement:i?"bottom-end":"top-end",height:Math.max(0,Math.min(t-2*Ti,r))}},ub=440,Vl=(t,e)=>e!==null&&t.includes(e);class gb{#e;#s=null;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){window.addEventListener("keydown",this.#n),document.addEventListener("pointerdown",this.#i,!0)}hostUpdated(){const e=this.#e.surface(),n=this.#e.open()&&e!==null;if(n!==(this.#s!==null)){if(n){const s=this.#e.anchor()??{top:0,bottom:0,right:window.innerWidth},i=s instanceof Element?s.getBoundingClientRect():s,{placement:r,height:o}=hb(window.innerHeight,i);this.#s=Us(e,s,{width:ub,height:o},{placement:r});return}this.#t(),Cn(e)}}hostDisconnected(){window.removeEventListener("keydown",this.#n),document.removeEventListener("pointerdown",this.#i,!0),this.#t()}#t(){this.#s?.(),this.#s=null}#n=e=>{e.key!=="Escape"||e.defaultPrevented||e.isComposing||!this.#e.open()||this.#e.close()};#i=e=>{if(e.button!==0||!this.#e.open())return;const n=e.composedPath();Vl(n,this.#e.surface())||Vl(n,this.#e.trigger())||this.#e.close()}}const fb=t=>m`
|
|
2214
2224
|
<dialog
|
|
2215
2225
|
id=${t.id??b}
|
|
2216
2226
|
class="dpk-dialog"
|
|
@@ -2234,7 +2244,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2234
2244
|
title=${t.closeLabel}
|
|
2235
2245
|
@click=${()=>t.controller.dismiss("close")}
|
|
2236
2246
|
>
|
|
2237
|
-
${
|
|
2247
|
+
${qe()}
|
|
2238
2248
|
</button>
|
|
2239
2249
|
</header>
|
|
2240
2250
|
${t.nav===void 0?b:t.nav}
|
|
@@ -2243,18 +2253,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2243
2253
|
${t.footer}
|
|
2244
2254
|
</footer>`}
|
|
2245
2255
|
</dialog>
|
|
2246
|
-
`,
|
|
2256
|
+
`,Ri="dpk-settings",Qt="display",mb="appearance",kb=(t,e)=>m`<button
|
|
2247
2257
|
class="dpk-chrome-action dpk-settings-trigger"
|
|
2248
2258
|
type="button"
|
|
2249
|
-
aria-controls=${
|
|
2259
|
+
aria-controls=${Ri}
|
|
2250
2260
|
aria-haspopup="dialog"
|
|
2251
2261
|
aria-expanded=${e.open?"true":"false"}
|
|
2252
2262
|
aria-label=${t.settings}
|
|
2253
2263
|
data-tooltip=${t.settings}
|
|
2254
2264
|
@click=${e.toggle}
|
|
2255
2265
|
>
|
|
2256
|
-
${
|
|
2257
|
-
</button>`,
|
|
2266
|
+
${$f()}
|
|
2267
|
+
</button>`,bb=(t,e,n,s)=>t.length<2?b:m`<nav class="dpk-dialog-nav" part="nav" aria-label=${n}>
|
|
2258
2268
|
${t.map(i=>m`<button
|
|
2259
2269
|
class="dpk-dialog-nav-item"
|
|
2260
2270
|
type="button"
|
|
@@ -2264,12 +2274,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2264
2274
|
>
|
|
2265
2275
|
${i.label}
|
|
2266
2276
|
</button>`)}
|
|
2267
|
-
</nav>`,
|
|
2277
|
+
</nav>`,vb=t=>{const e=xb(t.sections),n=e.find(r=>r.id===t.activeSection)??e[0],s=n?.id??Qt,i=n===void 0?b:n.id===Qt?t.display:n.render();return fb({id:t.id,size:"md",fixedHeight:e.length>1,label:t.label,closeLabel:t.closeLabel,controller:t.controller,nav:bb(e,s,t.sectionsLabel,t.onPick),content:t.open?i:b,footer:t.open?t.footer:void 0})},xb=t=>{const e=new Set,n=[];for(const s of t)e.has(s.id)||(e.add(s.id),n.push(s));return n},wb=(t,e,n)=>m`
|
|
2268
2278
|
<div class="dpk-settings-list" role="group" aria-label=${e.settings}>
|
|
2269
|
-
${t.items.map(s=>
|
|
2279
|
+
${t.items.map(s=>yb(s,n))}
|
|
2270
2280
|
</div>
|
|
2271
2281
|
${t.note===void 0?b:m`<p class="dpk-settings-note">${t.note}</p>`}
|
|
2272
|
-
`,
|
|
2282
|
+
`,yb=(t,e)=>m`<button
|
|
2273
2283
|
class="dpk-settings-option"
|
|
2274
2284
|
type="button"
|
|
2275
2285
|
role="switch"
|
|
@@ -2282,7 +2292,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2282
2292
|
<span class="dpk-settings-name">${t.label}</span>
|
|
2283
2293
|
${t.hint===void 0?b:m`<span class="dpk-settings-hint">${t.hint}</span>`}
|
|
2284
2294
|
</span>
|
|
2285
|
-
</button>`,
|
|
2295
|
+
</button>`,Kl=P`
|
|
2286
2296
|
.dpk-settings-list {
|
|
2287
2297
|
display: grid;
|
|
2288
2298
|
gap: 2px;
|
|
@@ -2344,7 +2354,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2344
2354
|
outline: none;
|
|
2345
2355
|
box-shadow: var(--dpk-focus);
|
|
2346
2356
|
}
|
|
2347
|
-
`,
|
|
2357
|
+
`,Yl=[pt,li,P`
|
|
2348
2358
|
:host {
|
|
2349
2359
|
display: block;
|
|
2350
2360
|
min-height: 100%;
|
|
@@ -3927,7 +3937,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3927
3937
|
order: 1;
|
|
3928
3938
|
}
|
|
3929
3939
|
}
|
|
3930
|
-
`],oe={default:320,min:140,step:24,largeStep:96}
|
|
3940
|
+
`],oe={default:320,min:140,step:24,largeStep:96},$b=160,Zl=800,Mi=t=>Math.max(oe.min,Math.round(t-$b)),mt=(t,e)=>Math.round(Math.min(Mi(e),Math.max(oe.min,t))),Sb=(t,e,n)=>mt(t.startHeight+t.startY-e,n),Ab=(t,{key:e,shiftKey:n},s)=>{const i=n?oe.largeStep:oe.step;switch(e){case"ArrowUp":return mt(t+i,s);case"ArrowDown":return mt(t-i,s);case"Home":return mt(oe.min,s);case"End":return Mi(s);default:return null}},Ql=t=>typeof t=="number"&&Number.isFinite(t)&&t>=oe.min?Math.round(t):null,Eb=()=>typeof window>"u"?Zl:window.innerHeight||document.documentElement.clientHeight||Zl,Cb=t=>`dev-process-kit:supplements-height:${t}`,Oi={kind:"idle"};class Tb{constructor(e,n){this.#t=null,this.#n="",this.#i=null,this.#r=Oi,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#r={kind:"dragging",pointerId:s.pointerId,startY:s.clientY,startHeight:this.height},this.#e.requestUpdate())},pointermove:s=>{const i=this.#r;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#l(Sb(i,s.clientY,this.#d()))},pointerup:s=>this.#a(s),pointercancel:s=>this.#a(s),lostpointercapture:s=>this.#a(s),keydown:s=>{const i=Ab(this.height,s,this.#d());i!==null&&(s.preventDefault(),this.#l(i),this.#c())},dblclick:()=>{this.#l(oe.default),this.#c()}},this.#o=()=>{this.#e.requestUpdate()},this.#e=e,this.#s=n,e.addController(this)}#e;#s;#t;#n;#i;#r;hostConnected(){if(this.#t===null){const e=this.#s.persistKey();this.#t=e===null?Z(Ql):ue(Ql),this.#n=Cb(e??""),this.#i=this.#t.read(this.#n)}typeof window<"u"&&window.addEventListener("resize",this.#o)}hostDisconnected(){this.#r=Oi,typeof window<"u"&&window.removeEventListener("resize",this.#o)}get height(){return mt(this.#i??oe.default,this.#d())}get max(){return Mi(this.#d())}get dragging(){return this.#r.kind==="dragging"}#o;#a(e){const n=this.#r;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#r=Oi,this.#c(),this.#e.requestUpdate())}#l(e){const n=mt(e,this.#d()),s=n===oe.default?null:n;s!==this.#i&&(this.#i=s,this.#e.requestUpdate())}#c(){this.#i===null?this.#t?.remove(this.#n):this.#t?.write(this.#n,this.#i)}#d(){return this.#s.viewportHeight?.()??Eb()}}const _i="supplement",Xl="memo",Rb=(t,e)=>[...t.children].filter(n=>n.getAttribute("slot")===_i).map(n=>{const s=n.getAttribute("data-name")?.trim()??"";return{name:s===""?e:s,element:n}}),Mb=(t,e)=>`.dpk-supplements-body ::slotted(:not(:nth-child(${[...t.children].indexOf(e.element)+1}))) { display: none !important; }`,Ob={selected:null,open:!1},_b=(t,e)=>t.open?e.find(n=>n.element===t.selected)??null:null,Pb=(t,e)=>({selected:e,open:!(t.open&&t.selected===e)}),Lb=(t,e)=>t.open?{...t,open:!1}:{selected:e.some(s=>s.element===t.selected)?t.selected:e[0]?.element??null,open:!0},zb=30,Ib=At(x(),O({base:x(),value:x()})),Jl=t=>{const e=C(Ib,t);return e.success?e.output:null},Db=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),Nb=(t,e,n)=>{const{[e]:s,...i}=t;if(n.value===n.base)return i;const r=Object.entries({...i,[e]:n});return Object.fromEntries(r.slice(Math.max(0,r.length-zb)))},qb=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},Ub=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},Hb=new Set(["text","search","url","email","tel"]),ed=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&Hb.has(t.type)?t:null,Bb=(t,e)=>{const n=[];let s=e.getRootNode();for(;s instanceof ShadowRoot;){if(s.host===t)return n;n.unshift(s.host.localName),s=s.host.getRootNode()}return null},jb=t=>{let e=t;for(;e!==null;){const n=e.getAttribute("data-dpk-text-key");if(n!==null&&n!=="")return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}},Fb=t=>t.composedPath().find(e=>e instanceof Element&&e.hasAttribute("data-dpk-text-discard"))??null,Gb=(t,e)=>{const n=[...e];for(let s=t.parentElement;s!==null;s=s.parentElement){const i=n.filter(r=>s.contains(r));if(i.length>0)return i}return[]},Wb=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),Pi=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(Pi):typeof t=="object"&&t!==null?Object.values(t).flatMap(Pi):[],td=t=>t.replace(/\s+/g," ").trim();class Vb{#e;#s;#t=null;#n="";#i=new WeakMap;#r=new Set;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}hostConnected(){this.#t===null&&(this.#t=this.#s.persist()?nm(Jl):Z(Jl),this.#n=this.#s.storageKey()),this.#e.addEventListener("focusin",this.#l),this.#e.addEventListener("input",this.#c),this.#e.addEventListener("click",this.#a,!0)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#l),this.#e.removeEventListener("input",this.#c),this.#e.removeEventListener("click",this.#a,!0)}settle(e){const n=new Set(e.flatMap(Pi).map(td));this.#o([...this.#r].filter(s=>n.has(td(s.value))))}#o(e){for(const n of e){this.#r.delete(n);const s=this.#i.get(n);s!==void 0&&this.#f(qb(this.#d(),s.id))}}#a=e=>{const n=Fb(e);n!==null&&this.#o(Gb(n,this.#r))};#l=e=>{const n=ed(e.composedPath()[0]);if(n===null||this.#r.has(n))return;const s=Bb(this.#e,n);if(s===null)return;const i=jb(n),r=n.value,o=Db({...i===void 0?{}:{key:i},hosts:s,name:Wb(n),base:r});this.#i.set(n,{id:o,base:r});const a=Ub(this.#d(),o,r);a!==null&&queueMicrotask(()=>{if(n.value===r){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#r.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#c=e=>{const n=ed(e.composedPath()[0]),s=n===null?void 0:this.#i.get(n);if(!(n===null||s===void 0)){for(const i of this.#r)i.isConnected||this.#r.delete(i);this.#r.add(n),this.#f(Nb(this.#d(),s.id,{base:s.base,value:n.value}))}};#d(){return this.#t?.read(this.#n)??{}}#f(e){Object.keys(e).length===0?this.#t?.remove(this.#n):this.#t?.write(this.#n,e)}}const Kb=(t,e,n,s)=>m`<div class="dpk-undo-redo" role="group" aria-label=${n.undoRedo}>
|
|
3931
3941
|
<button
|
|
3932
3942
|
class="dpk-chrome-action dpk-undo"
|
|
3933
3943
|
type="button"
|
|
@@ -3936,7 +3946,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3936
3946
|
data-tooltip=${n.undo}
|
|
3937
3947
|
@click=${s.undo}
|
|
3938
3948
|
>
|
|
3939
|
-
${
|
|
3949
|
+
${If()}
|
|
3940
3950
|
</button>
|
|
3941
3951
|
<button
|
|
3942
3952
|
class="dpk-chrome-action dpk-redo"
|
|
@@ -3946,9 +3956,9 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3946
3956
|
data-tooltip=${n.redo}
|
|
3947
3957
|
@click=${s.redo}
|
|
3948
3958
|
>
|
|
3949
|
-
${
|
|
3959
|
+
${Df()}
|
|
3950
3960
|
</button>
|
|
3951
|
-
</div>`,Tb=t=>{const e=t[0];return e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.isContentEditable:!1},Rb=t=>{const e=t.key.toLowerCase();return(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey&&e==="z"},Mb=t=>{if(!(t.metaKey||t.ctrlKey)||t.altKey)return!1;const e=t.key.toLowerCase();return e==="z"&&t.shiftKey||e==="y"&&!t.shiftKey};class Ob{#e;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){document.addEventListener("keydown",this.#n)}hostDisconnected(){document.removeEventListener("keydown",this.#n)}#n=e=>{e.isComposing||e.defaultPrevented||Tb(e.composedPath())||(Mb(e)?(e.preventDefault(),this.#e.redo()):Rb(e)&&(e.preventDefault(),this.#e.undo()))}}const _b=(t,e)=>{switch(t.status){case"connecting":return e.syncConnecting;case"synced":return e.syncSynced;case"pending":return e.syncPending(t.unsent);case"offline":return e.syncOffline;case"error":return e.syncError}},Pb=O({protocol:K(cs),self:O({id:x(),name:W(x())}),open:sc()}),Jl=(t,e)=>{let n;const s={protocol:cs,storageKey:e.storageKey,template:e.template,connect:i=>{if(n!==void 0)return;const r=C(Pb,i);if(!r.success){console.warn("[dev-process-kit] dpk-sync-request: ignored a host that is not protocol 1",i);return}n={protocol:cs,self:r.output.self,open:o=>i.open(o)}}};return t.dispatchEvent(new CustomEvent(nc,{detail:s,bubbles:!0,composed:!0})),n},Lb=`script[type="application/json"]:not([${Fr}]):not([${Ks}])`,zb=`script[type="application/json"][${Ks}]`,Ib=30,ed={width:360,height:480},Pi="dpk-review",Db=t=>{try{return t.matches(":popover-open")}catch{return!1}},Nb=()=>new Promise(t=>requestAnimationFrame(()=>t())),td=t=>t>0?String(t):null;class as extends X{static{this.styles=[Wl,Pr,Lr,Gl,ql]}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0},settingsOpen:{state:!0},reviewSection:{state:!0}}}#e=st;#n=null;#s=null;#t="current";#i=null;#r=null;#o;#a;#l={open:e=>this.#pe(e),answer:(e,n)=>this.#ze(e,n),next:e=>this.#me(e),pickRound:e=>{this.#t=e,this.#r=null,this.requestUpdate()}};#d=!1;#c=new Bk(this);#u=cb;#h=new ab(this,{persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#se});#k=new ek(this,()=>this.storage!=="off"&&this.storage!=="memory");#p=new Xm(this);#x=new Nk(this);#A=new Eb(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??rt(this.#se)}:unsent-text`});#v=null;#f=new mm(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??rt(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===Kn||n.classList.contains("dpk-bell"))),show:e=>{this.#Be(e)},ignored:()=>this.#g!==null,read:e=>this.#b?.setAddressed(e.addressed??Oe)});#w={toggleList:()=>this.#f.toggleList(),openList:()=>this.#f.send({kind:"open-list"}),show:e=>this.#f.show(e),dismiss:e=>this.#f.send({kind:"close-toast",key:e}),readAll:()=>this.#f.send({kind:"read-all"}),pause:e=>this.#f.pause(e),resume:e=>this.#f.resume(e)};#m=new Gm(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??rt(this.definition.name),log:()=>this.#f.log});#S=new po(this);#$=new Gn(this);#y=new yu(this,{state:()=>this.controller.derivation.state,messages:()=>Go(this.locale)});#C=Vt;#U=new Wg(this,{dialog:()=>this.renderRoot.querySelector(`#${Ti}`),open:()=>this.settingsOpen,dismiss:()=>{this.settingsOpen=!1}});#M={undo:()=>this.controller.undo(),redo:()=>this.controller.redo()};#E=new xk(this,{surface:()=>this.renderRoot.querySelector(".dpk-floating-menu"),header:()=>this.renderRoot.querySelector(".dpk-menu-slot"),area:()=>this.#Oe(),persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#se});constructor(){super(),this.settingsOpen=!1,new Kk(this,{surface:()=>this.renderRoot.querySelector(`#${Pi}`),anchor:()=>this.renderRoot.querySelector(".dpk-floating-menu"),trigger:()=>this.renderRoot.querySelector(".dpk-review-toggles"),open:()=>this.notesOpen,close:()=>{this.notesOpen=!1}}),this.#o=new Rk(this,{active:()=>this.#e.questions.length>0,bindings:()=>this.#g!==null||!this.#b?[]:Ek(this,this.#e,this.derivation.answers,this.notesOpen&&this.reviewSection==="questions"?Ai(this.#e,this.#s):null,(e,n)=>this.grillRefsOf(e,n)),open:e=>this.#pe(e),labelOf:e=>R(this.locale).grillOpen(`${e.ref} \xB7 ${e.title}`),gutterOf:e=>this.contains(e)&&this.#De(e)==="main"}),this.#a=new Fm(this,{active:()=>this.#m.enabled,bindings:()=>this.#g!==null?[]:Bm(this,this.#m.state,this.#f.log),onToggle:e=>this.#m.toggle(e),labelOf:e=>{const n=R(this.locale);return e==="checked"?n.checkModeChecked:e==="stale"?n.checkModeStale:n.checkModeUnchecked}}),new qk(this,()=>this.#g===null?this.renderRoot.querySelector(".dpk-header"):null)}#H=new Gt(this);#B=new Gt(this);#K=new Gt(this);#z=new Uk(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#g===null,()=>{this.#b?.setTemplate(this.definition),this.#b?.setGrill({grill:this.#e,locale:this.locale})});#_;#b;#T=Rt;#j=null;#I=new Set;#P=new um({host:this,name:()=>`<${this.tagName.toLowerCase()}>`,script:()=>this.scriptOf(Lb),parse:e=>this.definition.parseBase(e),empty:()=>this.definition.emptyBase(),optional:()=>Xf(this),onChange:e=>this.#st(e)});#J;#F;#L=[];#ee="";#V;#oe=new Promise(e=>{this.#V=e});#Y;#D=new Promise(e=>{this.#Y=e});#N;#g=null;#Z;#Q=!1;get locale(){return this.#R()?.locale()??this.#z.locale}get definition(){const e=this.locale;return this.#_?.locale!==e&&(this.#_={locale:e,value:this.definitionFor(e)}),this.#_.value}get liveDefinition(){return this.#b?.definition??this.definition}connectedCallback(){Qf(),this.#g=ui(this),this.toggleAttribute("data-dpk-page-content",this.#g!==null),this.#g===null&&!this.#Q&&(this.#Q=!0,new Ob(this,this.#M)),super.connectedCallback(),this.dataset.template=this.definition.name,this.#d||(this.#d=!0,this.notesOpen=this.notes==="on"||this.notes==="open"||this.notes==="comments"||this.notes==="changes"||this.notes==="questions",this.reviewSection=this.notes==="changes"||this.notes==="questions"?this.notes:"comments"),this.#G(),this.#g===null&&this.hashMode!=="off"&&window.addEventListener("hashchange",this.#Ae),this.addEventListener("click",this.#Re),this.addEventListener("dpk-comment-targets-change",this.#O),this.addEventListener("dpk-comment-request",this.#Ee),this.addEventListener("dpk-comment-submit",this.#Ce),this.addEventListener("dpk-element-action",this.#Te),this.#g===null&&this.addEventListener("dpk-board-rendered",this.#ne),this.#F??=new MutationObserver(this.#O),this.#O()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{this.isConnected||this.#b?.close()}),window.removeEventListener("hashchange",this.#Ae),this.removeEventListener("click",this.#Re),this.#P.disconnect(),this.#F?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#O),this.removeEventListener("dpk-comment-request",this.#Ee),this.removeEventListener("dpk-comment-submit",this.#Ce),this.removeEventListener("dpk-element-action",this.#Te),this.removeEventListener("dpk-board-rendered",this.#ne)}#G(e=0){if(this.#b){this.#b.reopen(),this.#te();return}if(this.parentElement?.localName==="dpk-page"&&customElements.get("dpk-page")===void 0){customElements.whenDefined("dpk-page").then(()=>this.#G(e));return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#G(e+1));return}const s=this.pendingStart();if(s!==null){s.then(()=>this.#G(e));return}this.#et()}#te(){this.#J||(this.#J=this.#b?.subscribe(()=>this.#it()))}willUpdate(){const e=this.#R();this.dataset.theme=e?.theme()??this.#k.resolve(_e(this.theme)),e!==null&&this.#b&&this.#Z!==e.locale()&&(this.#Z=e.locale(),this.#b.setTemplate(this.definition))}updated(){this.#lt(),this.#at(),this.#He(),this.#Ie(),this.#ae(),this.#g!==null&&this.dispatchEvent(new Event("dpk-board-rendered",{bubbles:!0,composed:!0}))}#ne=e=>{e.target!==this&&(e.stopPropagation(),this.#o.refresh(),this.#a.refresh())};#ae(){if(this.#g!==null)return;const n=this.renderRoot.querySelector(".dpk-floating-menu")?.getBoundingClientRect().width??0,i=`${ok(this.#E.placement.spot,n)}px`;this.style.getPropertyValue("--dpk-floating-menu-clearance")!==i&&this.style.setProperty("--dpk-floating-menu-clearance",i)}get api(){return this.#N??=this.#Je(),this.#N}get started(){return this.#D}get controller(){if(!this.#b)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#b}get componentSnapshot(){return this.#b?.componentSnapshot??null}get derivation(){return this.controller.derivation}get navigation(){return this.#g===null?this.#T:this.#W()}get board(){return this.#g}get hasOwnSidebar(){return this.renderRoot.querySelector(".dpk-sidebar")!==null}get sidebarFoldSide(){return this.hasOwnSidebar?this.sidebarLayout.side:null}get sidebarFolded(){const e=this.sidebarFoldSide;return e===null?null:this.renderRoot.querySelector("dpk-internal-layout-sidebar")?.foldedOn(e)??null}toggleSidebarFold(){const e=this.sidebarFoldSide;e!==null&&(this.renderRoot.querySelector("dpk-internal-layout-sidebar")?.toggleFold(e),this.requestUpdate())}dispatch(e){if(this.#g!==null)return this.#he(s=>s.dispatch(this.#ye(e)));const n=this.controller.dispatch(e);return n.ok&&this.#A.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#q()),n}dispatchBatch(e){if(this.#g!==null)return this.#he(s=>s.dispatchBatch(e.map(i=>this.#ye(i))));const n=this.controller.dispatchBatch(e);return n.ok&&this.#A.settle(e.flatMap(s=>[s.payload,s.note])),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#q()),n}editComment(e,n){if(this.#g!==null)return this.#he(i=>i.editComment(e,n));const s=this.controller.editComment(e,n);return s.ok&&this.#A.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#q()),s}removeAction(e){this.#g!==null?this.#R()?.removeAction(e):this.controller.removeAction(e)}async#le(){if(this.#g!==null||this.controller.sync===null){this.clearActions();return}const e=this.controller.prepareClear(),n=R(this.locale);await this.#S.ask({title:n.clearSharedTitle,body:n.clearSharedBody,confirmLabel:n.clearSharedOk,cancelLabel:n.clearSharedCancel,tone:"danger"})&&e()}clearActions(){if(this.#g===null){this.controller.clearActions();return}const e=this.#R();for(const n of this.controller.actions)e?.removeAction(n.id)}navigate(e,n={}){if(this.#g!==null){this.#R()?.navigate(this.#$e(e),n);return}const s=Qe(this.#W());this.#T=fn(this.#T,e,this.definition.navigationHierarchy),this.#re(n.replace??!1);const i=Qe(this.#W());this.requestUpdate(),s!==i&&(this.#q(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#T},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#R();if(n!==null)return n.hashFor(this.#$e(e));const s=this.#W();return Qe(this.definition.resolveNavigation(this.derivation.state,fn(s,e,this.definition.navigationHierarchy)))}requestComment(e){if(this.#g!==null){this.#R()?.requestComment(_(this.#we(e,"page")));return}this.#j=typeof e=="string"?e:_(e),this.notesOpen=!0,this.reviewSection="comments",this.requestUpdate()}get settingsSections(){if(!this.#b)return[];const e=this.#ie();return this.#xe(this.renderSettingsSections(e))}openSettings(e=Vt){const n=this.#Qe();if(n===null||n===this){this.#C=e,this.settingsOpen=!0,this.requestUpdate();return}n.openSettings(e)}renderSettingsSections(e){return[]}settingsSwitches(e){const n=this.definition.settings?.(e.state);return n===void 0||n.items.length===0?null:{settings:n,flip:s=>{this.dispatch(s)}}}get settingsTriggerIntents(){return{open:this.settingsOpen,toggle:()=>{if(this.settingsOpen){this.settingsOpen=!1;return}this.openSettings()}}}get canSendToClaude(){return this.#p.available}sendToClaude(){return this.#p.send({brief:this.api.exportBrief(),draft:$s(this.derivation.actions),anchor:this})}renderReviewPanel(e){return m`<dpk-comment-panel
|
|
3961
|
+
</div>`,Yb=t=>{const e=t[0];return e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.isContentEditable:!1},Zb=t=>{const e=t.key.toLowerCase();return(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey&&e==="z"},Qb=t=>{if(!(t.metaKey||t.ctrlKey)||t.altKey)return!1;const e=t.key.toLowerCase();return e==="z"&&t.shiftKey||e==="y"&&!t.shiftKey};class Xb{#e;#s;constructor(e,n){this.#e=n,this.#s=e,e.addController(this)}hostConnected(){document.addEventListener("keydown",this.#t)}hostDisconnected(){document.removeEventListener("keydown",this.#t)}#t=e=>{e.isComposing||e.defaultPrevented||Yb(e.composedPath())||this.#s instanceof Element&&this.#s.closest("[inert]")!==null||(Qb(e)?(e.preventDefault(),this.#e.redo()):Zb(e)&&(e.preventDefault(),this.#e.undo()))}}const Jb=(t,e)=>{switch(t.status){case"connecting":return e.syncConnecting;case"synced":return e.syncSynced;case"pending":return e.syncPending(t.unsent);case"offline":return e.syncOffline;case"error":return e.syncError}},ev=O({protocol:V(ps),self:O({id:x(),name:W(x())}),open:oc()}),nd=(t,e)=>{let n;const s={protocol:ps,storageKey:e.storageKey,template:e.template,connect:i=>{if(n!==void 0)return;const r=C(ev,i);if(!r.success){console.warn("[dev-process-kit] dpk-sync-request: ignored a host that is not protocol 1",i);return}n={protocol:ps,self:r.output.self,open:o=>i.open(o)}}};return t.dispatchEvent(new CustomEvent(rc,{detail:s,bubbles:!0,composed:!0})),n},tv=`script[type="application/json"]:not([${Vr}]):not([${Ys}])`,nv=`script[type="application/json"][${Ys}]`,sv=30,sd={width:360,height:480},Li="dpk-review",iv=t=>{try{return t.matches(":popover-open")}catch{return!1}},rv=()=>new Promise(t=>requestAnimationFrame(()=>t())),id=t=>t>0?String(t):null;class ls extends X{static{this.styles=[Yl,Ir,Dr,Kl,Bl]}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},hash:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0},settingsOpen:{state:!0},reviewSection:{state:!0}}}#e=it;#s=null;#t=null;#n="current";#i=null;#r=null;#o;#a;#l={open:e=>this.#fe(e),answer:(e,n)=>this.#ze(e,n),next:e=>this.#be(e),pickRound:e=>{this.#n=e,this.#r=null,this.requestUpdate()}};#c=!1;#d=new db(this);#f=Ob;#u=new Tb(this,{persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#le});#k=new wk(this,()=>this.storage!=="off"&&this.storage!=="memory");#p=new vk(this);#v=new rb(this);#A=new Vb(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??ot(this.#le)}:unsent-text`});#x=null;#g=new Dm(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??ot(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===Yn||n.classList.contains("dpk-bell"))),show:e=>{this.#Be(e)},ignored:()=>this.#m!==null,read:e=>this.#b?.setAddressed(e.addressed??Oe)});#y={toggleList:()=>this.#g.toggleList(),openList:()=>this.#g.send({kind:"open-list"}),show:e=>this.#g.show(e),dismiss:e=>this.#g.send({kind:"close-toast",key:e}),readAll:()=>this.#g.send({kind:"read-all"}),pause:e=>this.#g.pause(e),resume:e=>this.#g.resume(e)};#h=new hk(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??ot(this.definition.name),log:()=>this.#g.log});#S=new fo(this);#$=new Vn(this);#w=new zu(this,{state:()=>this.controller.derivation.state,messages:()=>Yo(this.locale)});#E=Qt;#G=new sf(this,{dialog:()=>this.renderRoot.querySelector(`#${Ri}`),open:()=>this.settingsOpen,dismiss:()=>{this.settingsOpen=!1}});#L={undo:()=>this.controller.undo(),redo:()=>this.controller.redo()};#C=new Hk(this,{surface:()=>this.renderRoot.querySelector(".dpk-floating-menu"),header:()=>this.renderRoot.querySelector(".dpk-menu-slot"),area:()=>this.#ge(),persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#le});constructor(){super(),this.settingsOpen=!1,new gb(this,{surface:()=>this.renderRoot.querySelector(`#${Li}`),anchor:()=>this.renderRoot.querySelector(".dpk-floating-menu"),trigger:()=>this.renderRoot.querySelector(".dpk-review-toggles"),open:()=>this.notesOpen,close:()=>{this.notesOpen=!1}}),this.#o=new Zk(this,{active:()=>this.#e.questions.length>0,bindings:()=>this.#m!==null||!this.#b?[]:Vk(this,this.#e,this.derivation.answers,this.notesOpen&&this.reviewSection==="questions"?Ei(this.#e,this.#t):null,(e,n)=>this.grillRefsOf(e,n)),open:e=>this.#fe(e),labelOf:e=>R(this.locale).grillOpen(`${e.ref} \xB7 ${e.title}`),gutterOf:e=>this.contains(e)&&this.#De(e)==="main"}),this.#a=new pk(this,{active:()=>this.#h.enabled,bindings:()=>this.#m!==null?[]:dk(this,this.#h.state,this.#g.log),onToggle:e=>this.#h.toggle(e),labelOf:e=>{const n=R(this.locale);return e==="checked"?n.checkModeChecked:e==="stale"?n.checkModeStale:n.checkModeUnchecked}}),new ob(this,()=>this.#m===null?this.renderRoot.querySelector(".dpk-header"):null)}#D=new Kt(this);#U=new Kt(this);#W=new Kt(this);#H=new ab(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#m===null,()=>{this.#b?.setTemplate(this.definition),this.#b?.setGrill({grill:this.#e,locale:this.locale})});#_;#b;#T=Ot;#V=null;#B=new Set;#R=new Lm({host:this,name:()=>`<${this.tagName.toLowerCase()}>`,script:()=>this.scriptOf(tv),parse:e=>this.definition.parseBase(e),empty:()=>this.definition.emptyBase(),optional:()=>this.baseOptional(),onChange:e=>this.#st(e)});#ee;#N;#z=[];#te="";#K;#pe=new Promise(e=>{this.#K=e});#ne;#se=new Promise(e=>{this.#ne=e});#Y;#m=null;#j;#I=!1;get locale(){return this.#O()?.locale()??this.#H.locale}get definition(){const e=this.locale;return this.#_?.locale!==e&&(this.#_={locale:e,value:this.definitionFor(e)}),this.#_.value}get liveDefinition(){return this.#b?.definition??this.definition}connectedCallback(){bm(),this.#m=gi(this),this.toggleAttribute("data-dpk-page-content",this.#m!==null),this.#m===null&&!this.#I&&(this.#I=!0,new Xb(this,this.#L)),super.connectedCallback(),this.dataset.template=this.definition.name,this.#c||(this.#c=!0,this.notesOpen=this.notes==="on"||this.notes==="open"||this.notes==="comments"||this.notes==="changes"||this.notes==="questions",this.reviewSection=this.notes==="changes"||this.notes==="questions"?this.notes:"comments"),this.#M(),this.#m===null&&this.hashMode!=="off"&&window.addEventListener("hashchange",this.#Ce),this.addEventListener("click",this.#Oe),this.addEventListener("dpk-comment-targets-change",this.#P),this.addEventListener("dpk-comment-request",this.#Te),this.addEventListener("dpk-comment-submit",this.#Re),this.addEventListener("dpk-element-action",this.#Me),this.#m===null&&this.addEventListener("dpk-board-rendered",this.#ie),this.#N??=new MutationObserver(this.#P),this.#P()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{this.isConnected||this.#b?.close()}),window.removeEventListener("hashchange",this.#Ce),this.removeEventListener("click",this.#Oe),this.#R.disconnect(),this.#N?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#P),this.removeEventListener("dpk-comment-request",this.#Te),this.removeEventListener("dpk-comment-submit",this.#Re),this.removeEventListener("dpk-element-action",this.#Me),this.removeEventListener("dpk-board-rendered",this.#ie)}#M(e=0){if(this.#b){this.#b.reopen(),this.#Z();return}if(this.parentElement?.localName==="dpk-page"&&customElements.get("dpk-page")===void 0){customElements.whenDefined("dpk-page").then(()=>this.#M(e));return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#M(e+1));return}const s=this.pendingStart();if(s!==null){s.then(()=>this.#M(e));return}this.#et()}#Z(){this.#ee||(this.#ee=this.#b?.subscribe(()=>this.#it()))}willUpdate(){const e=this.#O();this.dataset.theme=e?.theme()??this.#k.resolve(_e(this.theme)),e!==null&&this.#b&&this.#j!==e.locale()&&(this.#j=e.locale(),this.#b.setTemplate(this.definition))}updated(){this.#lt(),this.#at(),this.#He(),this.#Ie(),this.#Q(),this.#m!==null&&this.dispatchEvent(new Event("dpk-board-rendered",{bubbles:!0,composed:!0}))}#ie=e=>{e.target!==this&&(e.stopPropagation(),this.#o.refresh(),this.#a.refresh())};#Q(){if(this.#m!==null)return;const n=this.renderRoot.querySelector(".dpk-floating-menu")?.getBoundingClientRect().width??0,i=`${Ck(this.#C.placement.spot,n)}px`;this.style.getPropertyValue("--dpk-floating-menu-clearance")!==i&&this.style.setProperty("--dpk-floating-menu-clearance",i)}get api(){return this.#Y??=this.#Je(),this.#Y}get started(){return this.#se}get controller(){if(!this.#b)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#b}get componentSnapshot(){return this.#b?.componentSnapshot??null}get derivation(){return this.controller.derivation}get navigation(){return this.#m===null?this.#T:this.#F()}get board(){return this.#m}get hasOwnSidebar(){return this.renderRoot.querySelector(".dpk-sidebar")!==null}get sidebarFoldSide(){return this.hasOwnSidebar?this.sidebarLayout.side:null}get sidebarFolded(){const e=this.sidebarFoldSide;return e===null?null:this.renderRoot.querySelector("dpk-internal-layout-sidebar")?.foldedOn(e)??null}toggleSidebarFold(){const e=this.sidebarFoldSide;e!==null&&(this.renderRoot.querySelector("dpk-internal-layout-sidebar")?.toggleFold(e),this.requestUpdate())}dispatch(e){if(this.#m!==null)return this.#me(s=>s.dispatch(this.#Se(e)));const n=this.controller.dispatch(e);return n.ok&&this.#A.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#q()),n}dispatchBatch(e){if(this.#m!==null)return this.#me(s=>s.dispatchBatch(e.map(i=>this.#Se(i))));const n=this.controller.dispatchBatch(e);return n.ok&&this.#A.settle(e.flatMap(s=>[s.payload,s.note])),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#q()),n}editComment(e,n){if(this.#m!==null)return this.#me(i=>i.editComment(e,n));const s=this.controller.editComment(e,n);return s.ok&&this.#A.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#q()),s}removeAction(e){this.#m!==null?this.#O()?.removeAction(e):this.controller.removeAction(e)}confirm(e){return this.#S.ask(e)}async#he(){if(this.#m!==null||this.controller.sync===null){this.clearActions();return}const e=this.controller.prepareClear(),n=R(this.locale);await this.#S.ask({title:n.clearSharedTitle,body:n.clearSharedBody,confirmLabel:n.clearSharedOk,cancelLabel:n.clearSharedCancel,tone:"danger"})&&e()}clearActions(){if(this.#m===null){this.controller.clearActions();return}const e=this.#O();for(const n of this.controller.actions)e?.removeAction(n.id)}navigate(e,n={}){if(this.#m!==null){this.#O()?.navigate(this.#Ae(e),n);return}const s=Xe(this.#F());this.#T=kn(this.#T,e,this.definition.navigationHierarchy),this.#ce(n.replace??!1);const i=Xe(this.#F());this.requestUpdate(),s!==i&&(this.#q(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#T},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#O();if(n!==null)return n.hashFor(this.#Ae(e));const s=this.#F();return Xe(this.definition.resolveNavigation(this.derivation.state,kn(s,e,this.definition.navigationHierarchy)))}requestComment(e){if(this.#m!==null){this.#O()?.requestComment(_(this.#$e(e,"page")));return}this.#V=typeof e=="string"?e:_(e),this.notesOpen=!0,this.reviewSection="comments",this.requestUpdate()}get settingsSections(){if(!this.#b)return[];const e=this.#de();return this.#ye(this.renderSettingsSections(e))}openSettings(e=Qt){const n=this.#Qe();if(n===null||n===this){this.#E=e,this.settingsOpen=!0,this.requestUpdate();return}n.openSettings(e)}renderSettingsSections(e){return[]}settingsSwitches(e){const n=this.definition.settings?.(e.state);return n===void 0||n.items.length===0?null:{settings:n,flip:s=>{this.dispatch(s)}}}get settingsTriggerIntents(){return{open:this.settingsOpen,toggle:()=>{if(this.settingsOpen){this.settingsOpen=!1;return}this.openSettings()}}}get canSendToClaude(){return this.#p.available}sendToClaude(){return this.#p.send({brief:this.api.exportBrief(),draft:Ss(this.derivation.actions),anchor:this})}renderReviewPanel(e){return m`<dpk-comment-panel
|
|
3952
3962
|
.definition=${this.controller.definition}
|
|
3953
3963
|
.state=${e.state}
|
|
3954
3964
|
.navigation=${e.navigation}
|
|
@@ -3956,18 +3966,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3956
3966
|
.issues=${this.controller.lastIssues}
|
|
3957
3967
|
.exportBrief=${()=>this.api.exportBrief()}
|
|
3958
3968
|
.sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
|
|
3959
|
-
.pendingTarget=${this.#
|
|
3960
|
-
.section=${this.#
|
|
3969
|
+
.pendingTarget=${this.#V}
|
|
3970
|
+
.section=${this.#J==="questions"?null:this.#J}
|
|
3961
3971
|
.onDelete=${n=>this.removeAction(n)}
|
|
3962
3972
|
.onEditComment=${(n,s)=>this.editComment(n,s)}
|
|
3963
|
-
.onClear=${()=>{this.#
|
|
3973
|
+
.onClear=${()=>{this.#he()}}
|
|
3964
3974
|
.authorOf=${this.controller.sync===null?void 0:n=>this.controller.authorOf(n)?.name}
|
|
3965
3975
|
.canEditComment=${this.controller.sync===null?void 0:n=>this.controller.isOwnAction(n)}
|
|
3966
|
-
.onComment=${(n,s)=>{const i=this.dispatch({type:I,target:n,payload:{body:s}});return i.ok&&(this.#
|
|
3967
|
-
></dpk-comment-panel>`}renderChrome(e,n){if(this.#
|
|
3976
|
+
.onComment=${(n,s)=>{const i=this.dispatch({type:I,target:n,payload:{body:s}});return i.ok&&(this.#V=null),i}}
|
|
3977
|
+
></dpk-comment-panel>`}renderChrome(e,n){if(this.#m!==null)return this.#re(n);const s=e.actions.length,{changeCount:i,commentCount:r}=this.reviewCounts(e),o=this.definition.title(e.state),a=R(this.locale);return m`
|
|
3968
3978
|
<dpk-internal-layout-app class="dpk-shell">
|
|
3969
3979
|
<header slot="header" class="dpk-header">
|
|
3970
|
-
<span class="dpk-brand" aria-hidden="true">${
|
|
3980
|
+
<span class="dpk-brand" aria-hidden="true">${Yf()}</span>
|
|
3971
3981
|
${this.renderHeaderLead(e)}
|
|
3972
3982
|
<div class="dpk-title">
|
|
3973
3983
|
<h1 title=${o}>${o}</h1>
|
|
@@ -3977,18 +3987,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3977
3987
|
<slot name="header"></slot>
|
|
3978
3988
|
</div>
|
|
3979
3989
|
${this.#We()}
|
|
3980
|
-
<div class="dpk-header-tools">${this.#
|
|
3981
|
-
${
|
|
3982
|
-
${
|
|
3990
|
+
<div class="dpk-header-tools">${this.#we()} ${this.#Ve()}</div>
|
|
3991
|
+
${kb(a,this.settingsTriggerIntents)}
|
|
3992
|
+
${jk(a,this.#C.placement,{toHeader:this.#C.toHeader})}
|
|
3983
3993
|
</header>
|
|
3984
|
-
${this.#
|
|
3994
|
+
${this.#oe(n)} ${this.#ae(n)}
|
|
3985
3995
|
<div slot="overlay" class="dpk-overlay">
|
|
3986
|
-
${this.#
|
|
3996
|
+
${this.#ue(i,r)} ${this.#Pe(e)}
|
|
3987
3997
|
${this.#je(s)} ${this.#qe()} ${this.#Ue()}
|
|
3988
|
-
${this.#S.render()} ${this.#
|
|
3998
|
+
${this.#S.render()} ${this.#Ke(e)}
|
|
3989
3999
|
</div>
|
|
3990
4000
|
</dpk-internal-layout-app>
|
|
3991
|
-
`}renderHeaderLead(e){return b}#
|
|
4001
|
+
`}renderHeaderLead(e){return b}#re(e){const n=e.header!==void 0&&e.header!==b||this.querySelector(':scope > [slot="header"]')!==null;return m`
|
|
3992
4002
|
<dpk-internal-layout-app class="dpk-shell" data-board>
|
|
3993
4003
|
<div slot="header" class="dpk-board-bar" ?hidden=${!n}>
|
|
3994
4004
|
<div class="dpk-header-slot">
|
|
@@ -3996,9 +4006,9 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3996
4006
|
<slot name="header"></slot>
|
|
3997
4007
|
</div>
|
|
3998
4008
|
</div>
|
|
3999
|
-
${this.#
|
|
4009
|
+
${this.#oe(e)} ${this.#ae(e)}
|
|
4000
4010
|
</dpk-internal-layout-app>
|
|
4001
|
-
`}#
|
|
4011
|
+
`}#ue(e,n){const s=R(this.locale);return Bk(s,this.#C.placement,{undoRedo:Kb(this.controller.canUndo,this.controller.canRedo,s,this.#L),review:this.#_e(e,n),checkMode:this.#Fe(),notices:this.#Ne()},{grip:this.#C.grip},this.#C.dragging)}#ge(){const e=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,s=this.renderRoot.querySelector(".dpk-header"),i=Math.min(s?.getBoundingClientRect().height??0,n);return{left:0,top:i,width:e,height:n-i}}#oe(e){const n=R(this.locale),s=e.sidebarHidden===!0||!e.sidebar&&!this.hasSidebarContent(),i=this.sidebarLayout,r=i.side==="left"?"right":"left",o=this.mainLayout==="fill",a=this.storage==="off"||this.storage==="memory"?null:this.#le,l={[i.side]:{width:i.defaultWidth,resizable:i.resizable!==!1,collapsible:i.collapsible!==!1,narrow:i.narrow??"drawer",persistKey:a},[r]:{...pi,persistKey:a===null?null:`${a}:aside`}};return m`<dpk-internal-layout-sidebar
|
|
4002
4012
|
class="dpk-body"
|
|
4003
4013
|
.left=${l.left}
|
|
4004
4014
|
.right=${l.right}
|
|
@@ -4012,47 +4022,47 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4012
4022
|
${this.hasAsideContent()?m`<div slot=${r} class="dpk-aside"><slot name="aside"></slot></div>`:b}
|
|
4013
4023
|
<main class="dpk-main">
|
|
4014
4024
|
<div class="dpk-main-body" ?data-fill=${o}>
|
|
4015
|
-
${this.#
|
|
4025
|
+
${this.#R.error?m`<div class="dpk-banner" role="alert">
|
|
4016
4026
|
<strong>${n.baseDataError}</strong>
|
|
4017
|
-
<code>${this.#
|
|
4027
|
+
<code>${this.#R.error}</code>
|
|
4018
4028
|
</div>`:b}
|
|
4019
|
-
${this.#
|
|
4029
|
+
${this.#s===null?b:m`<div class="dpk-banner" role="alert">
|
|
4020
4030
|
<strong>${n.grillError}</strong>
|
|
4021
|
-
<code>${this.#
|
|
4031
|
+
<code>${this.#s}</code>
|
|
4022
4032
|
</div>`}
|
|
4023
|
-
${this.#
|
|
4033
|
+
${this.#g.error===null?b:m`<div class="dpk-banner" role="alert">
|
|
4024
4034
|
<strong>${n.changesError}</strong>
|
|
4025
|
-
<code>${this.#
|
|
4035
|
+
<code>${this.#g.error}</code>
|
|
4026
4036
|
</div>`}
|
|
4027
4037
|
${e.main??b}
|
|
4028
4038
|
<slot name="main"></slot>
|
|
4029
|
-
<section class="dpk-orphans" ?hidden=${this.#
|
|
4039
|
+
<section class="dpk-orphans" ?hidden=${this.#d.orphans===0}>
|
|
4030
4040
|
<p class="dpk-label">previews without metadata</p>
|
|
4031
4041
|
<slot name="preview"></slot>
|
|
4032
4042
|
</section>
|
|
4033
4043
|
</div>
|
|
4034
4044
|
${this.#ot(n)}
|
|
4035
4045
|
</main>
|
|
4036
|
-
</dpk-internal-layout-sidebar>`}#
|
|
4046
|
+
</dpk-internal-layout-sidebar>`}#ae(e){return e.footer||this.hasFooterContent()?m`<footer slot="footer" class="dpk-footer">
|
|
4037
4047
|
${e.footer??b}
|
|
4038
4048
|
<slot name="footer"></slot>
|
|
4039
|
-
</footer>`:b}#
|
|
4049
|
+
</footer>`:b}#X(e,n,s,i){const r=this.notesOpen&&this.#J===e;return m`<button
|
|
4040
4050
|
class="dpk-chrome-action dpk-review-toggle"
|
|
4041
4051
|
type="button"
|
|
4042
4052
|
data-section=${e}
|
|
4043
|
-
aria-controls=${
|
|
4053
|
+
aria-controls=${Li}
|
|
4044
4054
|
aria-pressed=${r?"true":"false"}
|
|
4045
4055
|
aria-label=${`${n} (${i??0})`}
|
|
4046
4056
|
data-tooltip=${n}
|
|
4047
4057
|
@click=${()=>{this.notesOpen=!r,this.reviewSection=e}}
|
|
4048
4058
|
>
|
|
4049
4059
|
${s} ${i===null?b:m`<span class="dpk-review-badge">${i}</span>`}
|
|
4050
|
-
</button>`}#_e(e,n){const s=R(this.locale),i=
|
|
4051
|
-
${this.#
|
|
4052
|
-
${this.#
|
|
4053
|
-
${i.total===0?b:this.#
|
|
4054
|
-
</div>`}reviewCounts(e){const n=e.actions.length,s=e.actions.filter(o=>o.type===I).length,i=new Set(this.derivation.stale.map(o=>o.action.id)),r=e.actions.filter(o=>Y(o)&&!i.has(o.id)).length;return{changeCount:n-s-r,commentCount:s}}#Pe(e){const n=R(this.locale),s=this.#
|
|
4055
|
-
id=${
|
|
4060
|
+
</button>`}#_e(e,n){const s=R(this.locale),i=la(this.#e,this.derivation.answers);return m`<div class="dpk-review-toggles" role="group" aria-label=${s.review}>
|
|
4061
|
+
${this.#X("comments",s.reviewComments,qn(),id(n))}
|
|
4062
|
+
${this.#X("changes",s.reviewChanges,yf(),id(e))}
|
|
4063
|
+
${i.total===0?b:this.#X("questions",s.grill,Ma(),`${i.answered}/${i.total}`)}
|
|
4064
|
+
</div>`}reviewCounts(e){const n=e.actions.length,s=e.actions.filter(o=>o.type===I).length,i=new Set(this.derivation.stale.map(o=>o.action.id)),r=e.actions.filter(o=>Y(o)&&!i.has(o.id)).length;return{changeCount:n-s-r,commentCount:s}}#Pe(e){const n=R(this.locale),s=this.#J,i=s==="changes"?n.reviewChanges:s==="questions"?n.grill:n.reviewComments;return m`<div
|
|
4065
|
+
id=${Li}
|
|
4056
4066
|
class="dpk-review"
|
|
4057
4067
|
popover="manual"
|
|
4058
4068
|
role="dialog"
|
|
@@ -4061,15 +4071,15 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4061
4071
|
>
|
|
4062
4072
|
${s==="questions"?this.#Le(e.actions.length):b}
|
|
4063
4073
|
${this.renderReviewPanel(e)}
|
|
4064
|
-
</div>`}get#
|
|
4065
|
-
${this.#
|
|
4066
|
-
</div>`}#
|
|
4074
|
+
</div>`}get#J(){return this.reviewSection==="questions"&&this.#e.questions.length===0?"comments":this.reviewSection}#Le(e){const n=R(this.locale),s=Jk(n,this.#e,this.derivation.answers,{open:this.#t,round:this.#n}),i=this.#ve(e,!1);return eb(n,s,this.#l,i?m`<footer class="dpk-grill-footer">${this.#xe(i)}</footer>`:b,this.#W)}#fe(e){this.notesOpen=!0,this.reviewSection="questions",this.#n="current",this.#t=e,this.#r=null,this.requestUpdate()}#ze(e,n){this.dispatch(Ag(e,n)).ok&&(n.kind==="option"?this.#be(e):n.kind==="free"&&n.text===""&&(this.#i=e))}#be(e){const n=wg(this.#e,this.derivation.answers,e);n!==null&&(this.#t=n,this.requestUpdate())}#Ie(){if(!this.notesOpen||this.#J!=="questions")return;const e=this.#i;this.#i=null,e!==null&&this.renderRoot.querySelector(`[data-free-text="${e}"]`)?.focus();const n=Ei(this.#e,this.#t);if(this.#n!=="current"||n===null||n===this.#r)return;this.#r=n;const s=this.renderRoot.querySelector(`.dpk-grill [data-question="${n}"]`),i=s?.closest(".dpk-grill-list");s&&i&&ys(i,s)}#De(e){const n=this.renderRoot.querySelector(".dpk-sidebar");let s=e;for(;s!==null&&s!==this;){if(s===n)return"sidebar";const i=s.getRootNode();s=s.assignedSlot??s.parentElement??(i instanceof ShadowRoot?i.host:null)}return"main"}#Ne(){const e=this.#g.view;return e?Bm(e,R(this.locale),this.#y):b}#qe(){const e=this.#g.view;return e?Fm(e,R(this.locale),this.#y):b}#Ue(){const e=this.#g.view;return e?Gm(e,R(this.locale),this.#y):b}#He(){const e=this.renderRoot.querySelector(`#${Yn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||iv(e)||this.#$.open(e,n,{width:sd.width,height:Math.min(sd.height,window.innerHeight-96)})}async#Be(e){const n={};this.#x=n;const s=this.derivation.state,i=e.target===null?null:this.definition.canonicalTarget?.(s,Re(e.target))??Re(e.target),r=ih({...e,target:i&&_(i)},a=>this.definition.navigationFor?this.definition.navigationFor(s,a):null);if(!r||(r.navigate&&this.navigate(r.navigate),i===null))return;i.type===re?this.#fe(i.id):this.showTarget(i);const o=_(i);for(let a=0;a<sv;a+=1){if(await this.updateComplete,await rv(),this.#x!==n)return;const l=wu(this,o);if(!(l===null||l.getClientRects().length===0)){yu(this,l),Au(l);return}}}showTarget(e){}#je(e){const n=this.#ve(e,this.notesOpen);if(!n)return b;const s=R(this.locale);return m`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
|
|
4075
|
+
${this.#xe(n)}
|
|
4076
|
+
</div>`}#ve(e,n){return kf({actions:e,railOpen:n,sendable:this.canSendToClaude,locale:this.locale},this.#v.state)}#xe(e){const n=R(this.locale);return m`${e.note?m`<p class="dpk-dock-note" role="alert">${e.note}</p>`:b}
|
|
4067
4077
|
<div class="dpk-dock-actions">
|
|
4068
4078
|
${e.send?m`<button
|
|
4069
4079
|
class="dpk-btn dpk-btn--accent"
|
|
4070
4080
|
type="button"
|
|
4071
4081
|
?disabled=${e.send.disabled}
|
|
4072
|
-
@click=${()=>{this.#
|
|
4082
|
+
@click=${()=>{this.#v.send(()=>this.sendToClaude())}}
|
|
4073
4083
|
>
|
|
4074
4084
|
${e.send.label}
|
|
4075
4085
|
</button>`:b}
|
|
@@ -4078,11 +4088,11 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4078
4088
|
type="button"
|
|
4079
4089
|
data-status=${e.copy.status}
|
|
4080
4090
|
title=${n.handoffCopyTitle}
|
|
4081
|
-
@click=${()=>{this.#
|
|
4091
|
+
@click=${()=>{this.#v.copy(()=>this.api.exportBrief())}}
|
|
4082
4092
|
>
|
|
4083
4093
|
${e.copy.label}
|
|
4084
4094
|
</button>
|
|
4085
|
-
</div>`}#
|
|
4095
|
+
</div>`}#we(e=this.#D){const n=this.locale,s=R(n).language;return e.render({options:Gs.map(i=>({value:i,label:_g[i]})),value:n,onChange:i=>{const r=Gs.find(o=>o===i);r!==void 0&&this.#H.pick(r)},ariaLabel:s,className:"dpk-lang-select"})}#Fe(){const e=this.#h.enabled,n=R(this.locale),s=e?n.checkModeOn:n.checkModeOff;return m`<button
|
|
4086
4096
|
class="dpk-chrome-action dpk-check-toggle"
|
|
4087
4097
|
type="button"
|
|
4088
4098
|
data-active=${e?"true":"false"}
|
|
@@ -4091,25 +4101,25 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4091
4101
|
data-tooltip=${s}
|
|
4092
4102
|
@click=${()=>{this.#Ge()}}
|
|
4093
4103
|
>
|
|
4094
|
-
${
|
|
4095
|
-
</button>`}async#Ge(){if(!this.#
|
|
4104
|
+
${Nf()}
|
|
4105
|
+
</button>`}async#Ge(){if(!this.#h.enabled){this.#h.setEnabled(!0);return}if(!ph(this.#h.state)){this.#h.setEnabled(!1);return}const e=R(this.locale);await this.#S.ask({title:e.checkModeConfirmTitle,body:e.checkModeConfirmBody,confirmLabel:e.checkModeConfirmOk,cancelLabel:e.checkModeConfirmCancel,tone:"danger"})&&this.#h.setEnabled(!1)}#We(){const e=this.controller.sync;if(e===null)return b;const n=Jb(e,R(this.locale));return m`<span
|
|
4096
4106
|
class="dpk-sync-status"
|
|
4097
4107
|
role="status"
|
|
4098
4108
|
data-status=${e.status}
|
|
4099
4109
|
title=${e.reason===void 0?n:`${n}: ${e.reason}`}
|
|
4100
4110
|
>${n}</span
|
|
4101
|
-
>`}#
|
|
4111
|
+
>`}#Ve(){const e=this.dataset.theme==="dark",n=R(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return m`<button
|
|
4102
4112
|
class="dpk-theme-toggle"
|
|
4103
4113
|
type="button"
|
|
4104
4114
|
aria-label=${s}
|
|
4105
4115
|
title=${s}
|
|
4106
4116
|
@click=${()=>this.#k.toggle(_e(this.theme))}
|
|
4107
4117
|
>
|
|
4108
|
-
${e?
|
|
4109
|
-
</button>`}render(){if(!this.#b)return b;const e=this.#
|
|
4118
|
+
${e?Of():_f()}
|
|
4119
|
+
</button>`}render(){if(!this.#b)return b;const e=this.#de();return m`${this.renderChrome(e,this.renderRegions(e))}${this.#Xe()}`}#Ke(e){if(this.#m!==null)return b;const n=R(this.locale),s=this.settingsOpen,i=s?this.settingsSwitches(e):null,r=i===null?b:wb(i.settings,n,i.flip),o=s?[...i===null?[]:[{id:Qt,label:n.settingsDisplay,render:()=>r}],{id:mb,label:n.settingsAppearance,render:()=>this.#Ye()},...this.#ye(this.renderSettingsSections(e))]:[];return vb({id:Ri,open:s,label:n.settings,closeLabel:n.settingsClose,sectionsLabel:n.settingsSections,controller:this.#G,sections:o,activeSection:this.#E,onPick:a=>this.#Ze(a),display:r})}#Ye(){const e=R(this.locale),n=this.#k.resolve(_e(this.theme)),s=[{scheme:"light",label:e.themeLight},{scheme:"dark",label:e.themeDark}],i=(r,o)=>{this.#k.pick(_e(this.theme),r),o&&this.updateComplete.then(()=>{this.renderRoot.querySelector(`[data-theme-choice="${r}"]`)?.focus()})};return m`<div class="dpk-settings-list">
|
|
4110
4120
|
<div class="dpk-settings-row">
|
|
4111
4121
|
<span class="dpk-settings-row-label">${e.language}</span>
|
|
4112
|
-
${this.#
|
|
4122
|
+
${this.#we(this.#U)}
|
|
4113
4123
|
</div>
|
|
4114
4124
|
<div class="dpk-settings-row">
|
|
4115
4125
|
<span class="dpk-settings-row-label">${e.settingsTheme}</span>
|
|
@@ -4131,7 +4141,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4131
4141
|
</button>`)}
|
|
4132
4142
|
</div>
|
|
4133
4143
|
</div>
|
|
4134
|
-
</div>`}#
|
|
4144
|
+
</div>`}#ye(e){return e.map(n=>({id:n.id,label:n.label,render:()=>n.render(this.#de())}))}#Ze(e){this.#E=e,this.requestUpdate()}#Qe(){if(this.#m===null)return this;let e=this.parentNode;for(;e!==null;){if(e instanceof ls&&e.board===null)return e;e=e.parentNode}return null}#Xe(){return this.#w.render()}get sidebarLayout(){return ja}get mainLayout(){return"flow"}hasSidebarContent(){return this.querySelector(':scope > [slot="sidebar"]')!==null}hasAsideContent(){return this.querySelector(':scope > [slot="aside"]')!==null}hasFooterContent(){return this.querySelector(':scope > [slot="footer"]')!==null}context(){return this.#de()}#O(){return this.#m===null?null:Ja(this)}get#le(){return this.#m===null?this.definition.name:`${this.definition.name}@${this.#m}`}#me(e){const n=this.#O();if(n===null)return{ok:!1,issues:[{path:"board",message:"the page is not ready yet"}]};const s=e(n);return this.requestUpdate(),s}#$e(e,n){const s=this.#O(),i=this.#m,r=fn(e,n);return i===null||s===null?r:Ya(r,i,s.pageNames())}#Se(e){const n=this.controller.descriptorFor(e.type)?.targetType??"page";return{...e,target:this.#$e(e.target,n)}}#Ae(e){const n=this.#O(),s=this.#m;return n===null||s===null?e:Am(n.navigation(),s,e,n.pageNames(),this.definition.navigationHierarchy)}#ke(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#pe,navigation:()=>this.#F(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#B.add(e),()=>{this.#B.delete(e)}),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e),brief:e=>this.buildBrief(e)}}#Je(){return tl(this.#ke(),this)}#Ee(){return mi(this.#ke())}#de(){return Om(this.#ke())}#F(){const e=this.#O(),n=this.#m===null?this.#T:je(e?.navigation()??Ot,this.#m);return this.#b?this.definition.resolveNavigation(this.derivation.state,n):n}#et(){const e=this.#R.read(),n=this.#m!==null;this.#e=n?it:this.readGrill(),this.#tt(),this.#T=n||this.hashMode==="off"?Ot:Wl(),this.#j=this.locale;const s=this.storageKey,i=n?void 0:nd(this,{storageKey:s??ot(this.definition.name),template:this.definition.name});this.#b=new ya({definition:this.definition,base:e,storage:n||i!==void 0?null:this.#nt(),grill:{grill:this.#e,locale:this.locale},...typeof s=="string"?{storageKey:s}:{},...i===void 0?{}:{sync:i},settled:()=>!n&&this.#R.error===null&&this.#s===null&&this.draftSettled()}),this.#Z(),n||this.#b.setAddressed(this.#g.log?.addressed??Oe),this.#P(),this.#ce(!0),this.#ne?.();const r=ym(this);r===null?this.#K?.():r.then(()=>this.#K?.()),this.#R.observe(),this.requestUpdate()}#tt(){this.querySelector(`:scope > [slot="${Xl}"]`)!==null&&console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> no longer shows slot="${Xl}"; slot each piece as slot="${_i}" data-name="\u2026" instead.`)}#nt(){return this.storage==="off"?null:this.storage==="memory"?new ni:si()}scriptOf(e){return this.querySelector(e)}baseOptional(){return vm(this)}pendingStart(){return null}draftSettled(){return!0}get hashMode(){return this.hash==="off"?"off":"auto"}buildBrief(e){return In(e,this.controller.definition,fe,this.#g.log?.addressed??Oe)}readGrill(){return this.#s=null,this.parseGrillScript(this.scriptOf(nv))}parseGrillScript(e,n){if(!e?.textContent||e.textContent.trim().length===0)return it;try{return vg(JSON.parse(e.textContent))}catch(s){console.error(`[dev-process-kit] invalid questions${n===void 0?"":` in ${n}`}:`,s);const i=s instanceof Error?s.message:String(s);return this.#s=n===void 0?i:`${n}: ${i}`,it}}refreshGrill(){this.#m!==null||!this.#b||(this.#e=this.readGrill(),this.#b.setGrill({grill:this.#e,locale:this.locale}),this.requestUpdate())}grillRefsOf(e,n){return[n]}#st(e){this.#m===null&&(this.#e=this.readGrill()),this.controller.setGrill({grill:this.#e,locale:this.locale}),this.controller.setBase(e.state),this.requestUpdate()}#q(){const e=this.#Ee();for(const n of this.#B)n(e)}#it(){if(!this.isConnected){this.requestUpdate(),this.#q();return}this.#m===null&&this.#ce(!0),El(this.#z,this.controller.actions),Cl(this.#z,this.controller.actions),queueMicrotask(this.#P),this.requestUpdate(),this.#q(),this.#m===null&&this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#Ee(),bubbles:!0,composed:!0}))}#ce(e){if(this.#m!==null)return;const n=this.#F();this.#T=n,this.hashMode!=="off"&&lb(n,e)}#Ce=()=>{this.#T=Wl(),this.#ce(!0),this.requestUpdate(),this.#q(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#T},bubbles:!0,composed:!0}))};#P=()=>{if(this.#N?.disconnect(),this.#z=yk(this,s=>{this.isConnected&&this.#N?.observe(s,{childList:!0,subtree:!0})}),!this.#b)return;El(this.#z,this.#b.actions),Cl(this.#z,this.#b.actions);const e=Sk(this.#z),n=this.adoptedComponentProviders();this.#b.setComponentSnapshot(n.length===0?e:{targets:e.targets,providers:[...e.providers,...n]}),this.#rt()};adoptedComponentProviders(){return[]}#rt(){if(this.#m===null||!this.#b)return;const e=this.#b.componentSnapshot,n=JSON.stringify([e.targets,e.providers]);n!==this.#te&&(this.#te=n,this.dispatchEvent(new CustomEvent("dpk-comment-targets-change",{bubbles:!0,composed:!0})))}#Te=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#b)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#P(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(i=>i.value===n.target))||this.requestComment(n.target)};#Re=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#b)return;const n=C(xh,e.detail);if(!n.success)return;this.#P();const{target:s,body:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:I,target:s,payload:{body:i}}).ok&&e.preventDefault()};#Me=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#b)return;const n=C(kh,e.detail);if(!n.success)return;this.#P();const{type:s,target:i,payload:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===i))return;this.dispatch({type:s,target:i,payload:r}).ok&&e.preventDefault()};#Oe=e=>{for(const n of e.composedPath()){if(!(n instanceof Element))continue;if(n===this||n.hasAttribute("data-template"))break;const s=n.getAttribute("data-dpk-navigate");if(s!==null){e.preventDefault(),this.navigate(mn(s.includes("=")?s:`step=${s}`));return}const i=n.getAttribute("data-dpk-comment");if(i!==null){e.preventDefault(),this.requestComment(i);return}}};#ot(e){const n=Rb(this,e.memo),s=_b(this.#f,n),i=this.#u,r=a=>{this.#f=a,this.requestUpdate()},o=i.handlers;return m`<div
|
|
4135
4145
|
class="dpk-supplements"
|
|
4136
4146
|
?hidden=${n.length===0}
|
|
4137
4147
|
?data-open=${s!==null}
|
|
@@ -4165,25 +4175,25 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4165
4175
|
aria-expanded=${String(s!==null)}
|
|
4166
4176
|
aria-controls="dpk-supplements-body"
|
|
4167
4177
|
aria-label=${s===null?e.openSupplements:e.closeSupplements}
|
|
4168
|
-
@click=${()=>r(
|
|
4178
|
+
@click=${()=>r(Lb(this.#f,n))}
|
|
4169
4179
|
>
|
|
4170
|
-
${
|
|
4180
|
+
${Wt()}
|
|
4171
4181
|
</button>
|
|
4172
4182
|
${n.map(a=>m`<button
|
|
4173
4183
|
type="button"
|
|
4174
4184
|
class="dpk-supplement-tab"
|
|
4175
4185
|
aria-expanded=${String(a===s)}
|
|
4176
4186
|
aria-controls="dpk-supplements-body"
|
|
4177
|
-
@click=${()=>r(
|
|
4187
|
+
@click=${()=>r(Pb(this.#f,a.element))}
|
|
4178
4188
|
>
|
|
4179
4189
|
${a.name}
|
|
4180
4190
|
</button>`)}
|
|
4181
4191
|
</div>
|
|
4182
4192
|
<div class="dpk-supplements-body" id="dpk-supplements-body" ?hidden=${s===null}>
|
|
4183
|
-
<style .textContent=${s===null?"":
|
|
4184
|
-
<slot name=${
|
|
4193
|
+
<style .textContent=${s===null?"":Mb(this,s)}></style>
|
|
4194
|
+
<slot name=${_i} @slotchange=${()=>this.requestUpdate()}></slot>
|
|
4185
4195
|
</div>
|
|
4186
|
-
</div>`}#at(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#lt(){this.#
|
|
4196
|
+
</div>`}#at(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#lt(){this.#d.route()}}const zi="dpk-page-state",ov=1e3,av=t=>t.localName.startsWith("dpk-view-")||t.localName.startsWith("dpk-board-"),lv=t=>typeof t!="object"||t===null||!("status"in t)?!1:t.status==="ready"||t.status==="empty"?!0:t.status==="unavailable"&&"tag"in t&&typeof t.tag=="string",dv={kind:"view",name:"page",label:"Page",addable:!1,parseBase:()=>({}),emptyBase:()=>({}),actions:{},apply:()=>null,hasTarget:()=>!1,describe:t=>({title:t.type,targetLabel:"",tone:"meta"}),serialize:t=>t.type,resolveNavigation:()=>({}),commentTargets:()=>[],title:()=>""},cv=P`
|
|
4187
4197
|
:host {
|
|
4188
4198
|
display: block;
|
|
4189
4199
|
height: 100%;
|
|
@@ -4221,20 +4231,20 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4221
4231
|
font-family: var(--dpk-mono, ui-monospace, monospace);
|
|
4222
4232
|
font-size: 11px;
|
|
4223
4233
|
}
|
|
4224
|
-
`;class
|
|
4234
|
+
`;class pv extends X{static{this.styles=cv}static{this.properties={name:{type:String},label:{type:String}}}#e=new Vt(this);#s=null;#t=!1;#n=null;#i;#r;#o;#a=new Promise(e=>{this.#o=e});constructor(){super(),this.#i=new Promise(e=>{this.#r=e})}get ready(){return this.#i}get contentState(){return this.#n}get content(){return this.#s}get definition(){return this.#s?.definition??dv}get liveDefinition(){return this.#s?.liveDefinition??this.definition}get api(){if(this.#s===null)throw new Error("<dpk-page> has no view or board content");return this.#s.api}get controller(){if(this.#s===null)throw new Error("<dpk-page> has no view or board content");return this.#s.controller}get componentSnapshot(){return this.#s?.componentSnapshot??null}get delivered(){return this.#a}deliver(){this.#o?.()}get[Gn](){return $m(this)}connectedCallback(){super.connectedCallback(),this.#c()}refreshContent(){this.#s?.requestUpdate?.()}render(){return m`${this.#l()}<slot @slotchange=${()=>this.#c()}></slot>`}#l(){const e=this.#n,n=R(this.#e.locale);return e?.status==="empty"?m`<div class="dpk-page-notice" role="alert">
|
|
4225
4235
|
<strong>${n.pageEmpty}</strong>
|
|
4226
4236
|
<span>${n.pageEmptyHint}</span>
|
|
4227
4237
|
</div>`:e?.status==="unavailable"?m`<div class="dpk-page-notice" role="alert">
|
|
4228
4238
|
<strong>${n.pageUnavailable}</strong>
|
|
4229
4239
|
<code>${n.pageUnavailableHint(e.tag)}</code>
|
|
4230
|
-
</div>`:b}#
|
|
4240
|
+
</div>`:b}#c(){const e=Array.from(this.children).filter(av),n=e[0]??null;if(!(this.#t&&n===this.#s)){if(this.#t=!0,this.#s=n,this.#n=null,n===null){this.name!==null&&console.warn(`[dev-process-kit] <dpk-page name="${this.name}"> holds no view or board`),this.#k({status:"empty"});return}n.localName.startsWith("dpk-board-")&&n.setAttribute("data-dpk-page-content",""),e.length>1&&console.warn(`[dev-process-kit] <dpk-page name="${this.name}"> holds ${e.length} views or boards; only the first is used`),this.#f(n).then(s=>this.#d(n,s)),customElements.whenDefined(n.localName).then(()=>{this.#s!==n||this.#n?.status!=="unavailable"||this.#f(n).then(s=>this.#d(n,s))}),this.requestUpdate()}}#d(e,n){this.#s===e&&(this.#k(n),n.status==="ready"&&(this.requestUpdate(),e.localName.startsWith("dpk-board-")&&requestAnimationFrame(()=>e.resetView?.())))}async#f(e){const n=e.localName;if(!await this.#u(n))return console.error(`[dev-process-kit] <dpk-page name="${this.name}"> holds <${n}>, which no loaded entry defines`),{status:"unavailable",tag:n};const s=e.started??e.ready??e.api?.ready;return s!==void 0&&await s,{status:"ready"}}async#u(e){return customElements.get(e)!==void 0?!0:new Promise(n=>{const s=setTimeout(()=>n(customElements.get(e)!==void 0),ov);customElements.whenDefined(e).then(()=>{clearTimeout(s),n(!0)})})}#k(e){const n=this.#n,s=n===null||n.status!==e.status||e.status==="unavailable"&&n.status==="unavailable"&&n.tag!==e.tag;this.#n=e,this.#r(),s&&this.dispatchEvent(new CustomEvent(zi,{detail:e,bubbles:!0,composed:!0})),this.requestUpdate()}}const rd=(t,e)=>({...t,id:ht(t.id,e),ref:ht(t.ref,e)}),hv=(t,e)=>{const n=Math.max(t.length,...e.map(({grill:s})=>s.rounds.length));return Array.from({length:n},(s,i)=>({label:t[i]?.label??e.map(({grill:o})=>o.rounds[i]?.label).find(o=>o!==void 0)??`v${i+1}`,questions:[...t[i]?.questions??[],...e.flatMap(({page:o,grill:a})=>(a.rounds[i]?.questions??[]).map(l=>rd(l,o)))]}))},uv=(t,e)=>{const n=e.filter(({grill:s})=>s.questions.length>0||s.rounds.length>0);return n.length===0?t:{questions:[...t.questions,...n.flatMap(({page:s,grill:i})=>i.questions.map(r=>rd(r,s)))],rounds:hv(t.rounds,n)}},gv=(t,e)=>e===null||t.includes(jn)?[t]:[ht(t,e),t],fv=t=>{let e=t;for(;e!==null;){const n=gi(e);if(n!==null)return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}return null},es=$(x(),le(ui)),kt={ADD_PAGE:hs("ADD_PAGE","app",O({page:es,kind:cs(["view","board"]),content:$(x(),E(1)),label:$(x(),E(1))}),{mode:"append"}),REMOVE_PAGE:hs("REMOVE_PAGE","app",O({page:es}),{mode:"append"}),RENAME_PAGE:hs("RENAME_PAGE","app",O({page:es,label:$(x(),tr(),E(1))}),{mode:"patch",dedupeKey:t=>{const e=C(O({page:es}),t.payload);return e.success?`RENAME_PAGE|${e.output.page}`:null}})},mv=t=>{const e=on(kt,t);return e===null?null:e.payload.page},kv=(t,e)=>ye(t.target)?mv(t)===e:Be(t.target)?.page===e,bv="## How to apply",vv=(t,e)=>{const n=new Map;for(const s of e){const i=Be(s.target)?.page;if(i===void 0||Y(s))continue;const r=n.get(i)??{changes:0,comments:0};s.type===I?r.comments+=1:r.changes+=1,n.set(i,r)}return[`## Pages (${t.length})`,"","This document is a `<dpk-app>` holding `<dpk-page>` elements. Every target ending in `@<page>` belongs to that page: apply it to its `dpk-view-*` or `dpk-board-*` child, against that content's base JSON and action vocabulary, with the qualifier removed. `app:app` is the whole document.","",'`ADD_PAGE` on `app:app` asks for a new `<dpk-page name="<page>" label="<label>">` whose content is a `<dpk-view-<content>>` or `<dpk-board-<content>>` (the action says which), with its base JSON built from the actions on `@<page>`; `REMOVE_PAGE` asks to take that page out, with everything the draft says about it.',"","A question `grill:<id>@<page>` comes from the `data-dpk-grill` block of that page; one without a qualifier comes from the app's own block. Settle each in the page (or app) it was asked of, writing its id back into that block (`history` included) with the qualifier removed.","",...t.map(s=>{const i=n.get(s.id)??{changes:0,comments:0};return`- \`${s.id}\` \u2014 ${s.label} (\`${s.definition.kind}:${s.definition.name}\`): ${i.changes} change(s), ${i.comments} comment(s)`}),""]},xv=(t,e)=>{const n=t.indexOf(bv),s=`${e.join(`
|
|
4231
4241
|
`)}
|
|
4232
4242
|
`;return n<0?`${t}
|
|
4233
|
-
${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},
|
|
4243
|
+
${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},wv=O({title:D(x())}),yv={schema:ac(),mode:"append",targetType:"unknown"},$v="app",Sv=(t,e)=>{if(!e.has(t))return t;let n=2;for(;e.has(`${t}-${n}`);)n+=1;return`${t}-${n}`},Av=t=>{const e=t.messages,n=(c,g)=>t.catalog().find(u=>u.kind===c&&u.name===g),s=(c,g)=>{const u=c.layout.find(v=>v.id===g);if(u===void 0||!Object.hasOwn(c.pages,g))return;const k=t.pages().find(v=>v.id===g)?.definition??n(u.kind,u.content);return k===void 0?void 0:{id:g,label:u.label,definition:k}},i=c=>c.layout.flatMap(g=>{const u=s(c,g.id);return u===void 0?[]:[u]}),r=(c,g)=>{const u=Be(g);return u===null?null:{...u,spec:s(c,u.page)}},o=(c,g)=>({...c,target:g}),a=(c,g,u)=>({...c,pages:{...c.pages,[g]:u}}),l=(c,g)=>{const u=i(c);return u.find(k=>k.id===g[ge])??u[0]},p=(c,g)=>({title:c.type==="comment"?e.comment:c.type,targetLabel:g,tone:c.type==="comment"?"comment":"meta"}),h=c=>{const g=t.base();return{title:c,layout:g.layout,pages:g.pages}},d=(c,g)=>{const u=on(kt,g);if(u===null)return null;const{page:k}=u.payload,v=c.layout.some(y=>y.id===k);if(u.type==="ADD_PAGE"){const y=n(u.payload.kind,u.payload.content);if(v||y===void 0)return null;const A=y.emptyBase();return{...c,layout:[...c.layout,{id:k,kind:u.payload.kind,content:y.name,label:u.payload.label}],pages:{...c.pages,[k]:A}}}return u.type==="RENAME_PAGE"?v?{...c,layout:c.layout.map(y=>y.id===k?{...y,label:u.payload.label}:y)}:null:v?{...c,layout:c.layout.filter(y=>y.id!==k),pages:Object.fromEntries(Object.entries(c.pages).filter(([y])=>y!==k))}:null},f=c=>{const g=on(kt,c);if(g===null)return p(c,e.wholePage);if(g.type==="ADD_PAGE"){const k=n(g.payload.kind,g.payload.content)?.label??g.payload.content;return{title:e.pageAdded,targetLabel:`${g.payload.label} (${k})`,tone:"create"}}if(g.type==="RENAME_PAGE")return{title:e.pageRenamed,targetLabel:g.payload.label,tone:"update"};const u=t.base().layout.find(k=>k.id===g.payload.page)?.label;return{title:e.pageRemoved,targetLabel:u??g.payload.page,tone:"delete"}};return{kind:"view",name:$v,label:e.label,parseBase:c=>h(rn(wv,c).title??e.untitled),emptyBase:()=>h(e.untitled),get actions(){return Object.fromEntries([...t.pages().flatMap(c=>Object.entries(c.definition.actions)),...Object.entries(kt)])},actionFor:(c,g)=>{if(g===void 0||ye(g))return Et(kt,c);const u=Be(g);if(u===null)return;const k=t.pages().find(v=>v.id===u.page);return k===void 0?yv:Et(k.definition.actions,c)},apply:(c,g)=>{if(ye(g.target))return d(c,g);const u=r(c,g.target);if(u?.spec===void 0)return null;const k=u.spec.definition.apply(c.pages[u.page],o(g,u.target));return k===null?null:a(c,u.page,k)},canonicalState:c=>({...c,pages:Object.fromEntries(Object.entries(c.pages).map(([g,u])=>{const k=s(c,g)?.definition;return[g,k?.canonicalState?k.canonicalState(u):u]}))}),canonicalTarget:(c,g)=>{const u=r(c,g),k=u?.spec?.definition;return u===null||k?.canonicalTarget===void 0?g:Ka(k.canonicalTarget(c.pages[u.page],u.target),u.page)},hasTarget:(c,g)=>{if(ye(g))return!0;const u=r(c,g);return u?.spec===void 0?!1:u.spec.definition.hasTarget(c.pages[u.page],u.target)},pageTargetExists:(c,g)=>ye(g)||r(c,g)?.spec!==void 0,wholeTarget:He,describe:(c,g,u)=>{if(ye(c.target))return c.type==="comment"?p(c,e.wholePage):f(c);const k=r(g,c.target);if(k===null)return p(c,_(c.target));if(k.spec===void 0)return p(c,e.missingPage(k.page));const v=k.spec.definition.describe(o(c,k.target),g.pages[k.page],u?.pages[k.page]);return{...v,targetLabel:`${k.spec.label} \u203A ${v.targetLabel}`}},serialize:c=>{const g=Be(c.target),u=g===null?void 0:t.pages().find(k=>k.id===g.page);return g===null||u===void 0?`${c.type} ${_(c.target)} ${JSON.stringify(c.payload)}`:`${u.definition.serialize(o(c,g.target))} @${g.page}`},resolveNavigation:(c,g)=>{const u=l(c,g),k=u===void 0?{}:{[ge]:u.id};for(const v of i(c)){const y=v.definition.resolveNavigation(c.pages[v.id],je(g,v.id));Object.assign(k,el(v.id,y))}return k},navigationFor:(c,g)=>{const u=r(c,g);if(u?.spec===void 0)return null;const k=u.spec.definition.navigationFor?.(c.pages[u.page],u.target)??null;return{[ge]:u.page,...el(u.page,k??{})}},commentTargets:(c,g)=>[{value:_(He),label:e.wholePage,group:e.pageGroup},...i(c).flatMap(u=>u.definition.commentTargets(c.pages[u.id],je(g,u.id)).map(k=>({value:ht(k.value,u.id),label:k.label,group:k.group===void 0?u.label:`${u.label} \xB7 ${k.group}`})))],currentTarget:(c,g)=>{const u=l(c,g);if(u===void 0)return null;const k=u.definition.currentTarget?.(c.pages[u.id],je(g,u.id));return k==null?{value:ht(`page:${u.definition.name}`,u.id),label:u.label,group:e.pageGroup}:{...k,value:ht(k.value,u.id),label:`${u.label} \u203A ${k.label}`}},title:c=>c.title}},bt=Ne({en:{label:"Document",wholePage:"Whole document",pages:"Pages",pageGroup:"Page",comment:"Comment",missingPage:t=>`Page "${t}" (no longer in the document)`,untitled:"Untitled document",addPage:"Add a page",removePage:t=>`Remove page "${t}"`,removePageConfirmTitle:t=>`Remove page "${t}"?`,removePageConfirmBody:"The changes and comments of the draft on this page go with it.",removePageConfirmOk:"Remove",removePageConfirmCancel:"Cancel",pageAdded:"Page added",pageRemoved:"Page removed",pageRenamed:"Page renamed",renamePage:"Rename",switcher:"Switch page",switcherCount:t=>`Switch page (${t} available)`,pageFallback:t=>`Page ${t}`},ja:{label:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8",wholePage:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5168\u4F53",pages:"\u30DA\u30FC\u30B8",pageGroup:"\u30DA\u30FC\u30B8",comment:"\u30B3\u30E1\u30F3\u30C8",missingPage:t=>`\u30DA\u30FC\u30B8\u300C${t}\u300D\uFF08\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304B\u3089\u7121\u304F\u306A\u308A\u307E\u3057\u305F\uFF09`,untitled:"\u7121\u984C\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8",addPage:"\u30DA\u30FC\u30B8\u3092\u8FFD\u52A0",removePage:t=>`\u30DA\u30FC\u30B8\u300C${t}\u300D\u3092\u524A\u9664`,removePageConfirmTitle:t=>`\u30DA\u30FC\u30B8\u300C${t}\u300D\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F`,removePageConfirmBody:"\u3053\u306E\u30DA\u30FC\u30B8\u3078\u306E\u5909\u66F4\u3068\u30B3\u30E1\u30F3\u30C8\u3082\u4E00\u7DD2\u306B\u6D88\u3048\u307E\u3059\u3002",removePageConfirmOk:"\u524A\u9664",removePageConfirmCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",pageAdded:"\u30DA\u30FC\u30B8\u3092\u8FFD\u52A0",pageRemoved:"\u30DA\u30FC\u30B8\u3092\u524A\u9664",pageRenamed:"\u30DA\u30FC\u30B8\u540D\u3092\u5909\u66F4",renamePage:"\u540D\u524D\u3092\u5909\u66F4",switcher:"\u30DA\u30FC\u30B8\u3092\u5207\u308A\u66FF\u3048",switcherCount:t=>`\u30DA\u30FC\u30B8\u3092\u5207\u308A\u66FF\u3048\uFF08${t}\u4EF6\uFF09`,pageFallback:t=>`\u30DA\u30FC\u30B8${t}`}}),Ev=O({value:x()}),Ii=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(Ev,e.detail);n.success&&t(n.output.value)},Cv=t=>e=>{const n=ft(e.target,HTMLInputElement);n!==null&&t(n.value,n)},Tv=t=>e=>{const n=ft(e.target,HTMLInputElement);n!==null&&t(n.checked)},vt="dpk-page-switcher-menu",Rv=(t,e,n,s,i,r={active:null})=>{const o=r.active===null?s.switcherCount(n):`${r.active} \xB7 ${s.switcherCount(n)}`;return m`<button
|
|
4234
4244
|
class="dpk-chrome-action dpk-page-switcher-trigger"
|
|
4235
4245
|
type="button"
|
|
4236
4246
|
aria-haspopup="menu"
|
|
4237
|
-
aria-controls=${
|
|
4247
|
+
aria-controls=${vt}
|
|
4238
4248
|
aria-expanded=${e?"true":"false"}
|
|
4239
4249
|
aria-label=${o}
|
|
4240
4250
|
data-tooltip=${o}
|
|
@@ -4245,8 +4255,8 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},ev=O({title:D(x())}),tv={schema:ic(),m
|
|
|
4245
4255
|
>
|
|
4246
4256
|
${t()}
|
|
4247
4257
|
${n>1?m`<span class="dpk-page-switcher-count" aria-hidden="true">${n}</span>`:b}
|
|
4248
|
-
</button>`},
|
|
4249
|
-
id=${
|
|
4258
|
+
</button>`},Mv=(t,e,n)=>m`<div
|
|
4259
|
+
id=${vt}
|
|
4250
4260
|
class="dpk-settings dpk-page-switcher-menu"
|
|
4251
4261
|
popover="manual"
|
|
4252
4262
|
role="menu"
|
|
@@ -4280,7 +4290,7 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},ev=O({title:D(x())}),tv={schema:ic(),m
|
|
|
4280
4290
|
><dpk-inline-edit
|
|
4281
4291
|
.value=${s.label}
|
|
4282
4292
|
.label=${s.rename.label}
|
|
4283
|
-
@dpk-commit=${
|
|
4293
|
+
@dpk-commit=${Ii(s.rename.commit)}
|
|
4284
4294
|
></dpk-inline-edit
|
|
4285
4295
|
></span>
|
|
4286
4296
|
</span>
|
|
@@ -4292,10 +4302,69 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},ev=O({title:D(x())}),tv={schema:ic(),m
|
|
|
4292
4302
|
title=${s.remove.label}
|
|
4293
4303
|
@click=${s.remove.activate}
|
|
4294
4304
|
>
|
|
4295
|
-
${
|
|
4305
|
+
${qe()}
|
|
4296
4306
|
</button>`}
|
|
4297
4307
|
</div>`)}
|
|
4298
|
-
</div>`,
|
|
4308
|
+
</div>`,Ov=(t,e,n)=>{const s=n-1;return t==="ArrowDown"?Math.min(s,e+1):t==="ArrowUp"?Math.max(0,e-1):t==="Home"?0:t==="End"?s:null},_v=(t,e)=>m`<div class="dpk-page-tab-item" role="presentation" ?data-selected=${t.selected}>
|
|
4309
|
+
<button
|
|
4310
|
+
class="dpk-page-tab"
|
|
4311
|
+
type="button"
|
|
4312
|
+
role="tab"
|
|
4313
|
+
data-page=${t.id}
|
|
4314
|
+
aria-label=${t.label}
|
|
4315
|
+
aria-selected=${t.selected?"true":"false"}
|
|
4316
|
+
tabindex=${t.selected?0:-1}
|
|
4317
|
+
title=${t.label}
|
|
4318
|
+
@click=${()=>e.select(t.id,{focus:!1})}
|
|
4319
|
+
>
|
|
4320
|
+
<span class="dpk-page-tab-icon" aria-hidden="true">${t.icon()}</span>
|
|
4321
|
+
${t.rename===void 0?m`<span class="dpk-page-tab-label">${t.label}</span>`:b}
|
|
4322
|
+
${t.pending>0?m`<span class="dpk-page-tab-count">${t.pending}</span>`:b}
|
|
4323
|
+
</button>
|
|
4324
|
+
${t.rename===void 0?b:m`<dpk-inline-edit
|
|
4325
|
+
class="dpk-page-tab-label"
|
|
4326
|
+
wrap
|
|
4327
|
+
truncate
|
|
4328
|
+
seamless
|
|
4329
|
+
.value=${t.label}
|
|
4330
|
+
.label=${t.rename.label}
|
|
4331
|
+
@dpk-commit=${Ii(t.rename.commit)}
|
|
4332
|
+
></dpk-inline-edit>`}
|
|
4333
|
+
${t.remove===void 0?b:m`<button
|
|
4334
|
+
class="dpk-page-tab-remove"
|
|
4335
|
+
type="button"
|
|
4336
|
+
data-page=${t.id}
|
|
4337
|
+
aria-label=${t.remove.label}
|
|
4338
|
+
title=${t.remove.label}
|
|
4339
|
+
@click=${t.remove.activate}
|
|
4340
|
+
>
|
|
4341
|
+
${qe()}
|
|
4342
|
+
</button>`}
|
|
4343
|
+
</div>`,Pv=(t,e,n)=>m`<nav
|
|
4344
|
+
class="dpk-page-rail"
|
|
4345
|
+
aria-label=${e.pages}
|
|
4346
|
+
>
|
|
4347
|
+
<div
|
|
4348
|
+
class="dpk-page-tabs"
|
|
4349
|
+
role="tablist"
|
|
4350
|
+
aria-orientation="vertical"
|
|
4351
|
+
@keydown=${s=>{if(!(s.target instanceof Element)||!s.target.matches('[role="tab"]'))return;const i=Ov(s.key,t.findIndex(o=>o.selected),t.length),r=i===null?void 0:t[i];r!==void 0&&(s.preventDefault(),n.select(r.id,{focus:!0}))}}
|
|
4352
|
+
>
|
|
4353
|
+
${t.map(s=>_v(s,n))}
|
|
4354
|
+
</div>
|
|
4355
|
+
${n.add===void 0?b:m`<button
|
|
4356
|
+
class="dpk-page-add"
|
|
4357
|
+
type="button"
|
|
4358
|
+
aria-label=${n.add.label}
|
|
4359
|
+
title=${n.add.label}
|
|
4360
|
+
aria-haspopup="menu"
|
|
4361
|
+
aria-controls=${vt}
|
|
4362
|
+
aria-expanded=${n.add.open?"true":"false"}
|
|
4363
|
+
@click=${n.add.toggle}
|
|
4364
|
+
>
|
|
4365
|
+
${Un()}
|
|
4366
|
+
</button>`}
|
|
4367
|
+
</nav>`,Lv=t=>{try{const e=new URL(t),n=e.pathname.split("/");return n.pop(),n.at(-1)==="views"&&n.pop(),new URL(`${n.join("/")}/`,e)}catch{return null}},od=(t,e)=>{if(e===null)return null;const n=Lv(e);if(n===null)return null;try{return new URL(t,n).href}catch{return null}},ad=(t,e)=>od(`views/${t}.js`,e),ld=t=>od("boards.js",t),dd=t=>t instanceof HTMLElement&&"definition"in t&&"api"in t&&wm(t)!==null,zv=t=>t instanceof HTMLElement&&"settingsSections"in t,Iv=t=>typeof t=="object"&&t!==null&&"name"in t&&"emptyBase"in t,Dv=`:scope > script[type="application/json"][${Ys}]`,cd=(t,e)=>t.flatMap(n=>{if(n.target.type===re)return[];const s=Be(n.target);return s?.page===e?[{...n,target:s.target}]:[]}),Nv=t=>typeof t=="object"&&t!==null&&Object.values(t).every(e=>typeof e=="string"),qv=(t,e)=>{const n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(s=>t[s]===e[s])},Uv=t=>{try{return t.matches(":popover-open")}catch{return!1}},Hv=w(Cc),Bv={width:240,height:420},jv=220,Fv=P`
|
|
4299
4368
|
.dpk-main-body {
|
|
4300
4369
|
animation: none;
|
|
4301
4370
|
}
|
|
@@ -4392,6 +4461,201 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},ev=O({title:D(x())}),tv={schema:ic(),m
|
|
|
4392
4461
|
outline-offset: -2px;
|
|
4393
4462
|
}
|
|
4394
4463
|
|
|
4464
|
+
/* The page shown, with the rail of page-nav="sidebar" before it. */
|
|
4465
|
+
.dpk-app-body {
|
|
4466
|
+
flex: 1 1 0%;
|
|
4467
|
+
display: flex;
|
|
4468
|
+
min-width: 0;
|
|
4469
|
+
min-height: 0;
|
|
4470
|
+
}
|
|
4471
|
+
|
|
4472
|
+
.dpk-page-rail {
|
|
4473
|
+
flex: 0 0 auto;
|
|
4474
|
+
padding: 6px 4px;
|
|
4475
|
+
border-right: 1px solid var(--dpk-rule);
|
|
4476
|
+
background: var(--dpk-paper-sunken);
|
|
4477
|
+
overflow-y: auto;
|
|
4478
|
+
}
|
|
4479
|
+
|
|
4480
|
+
.dpk-page-tabs {
|
|
4481
|
+
display: flex;
|
|
4482
|
+
flex-direction: column;
|
|
4483
|
+
gap: 2px;
|
|
4484
|
+
}
|
|
4485
|
+
|
|
4486
|
+
/* One page of the rail: its tab and, beside it, the controls a tab cannot hold. */
|
|
4487
|
+
.dpk-page-tab-item {
|
|
4488
|
+
position: relative;
|
|
4489
|
+
display: flex;
|
|
4490
|
+
flex-direction: column;
|
|
4491
|
+
align-items: center;
|
|
4492
|
+
width: 56px;
|
|
4493
|
+
border: 1px solid transparent;
|
|
4494
|
+
border-radius: var(--dpk-radius);
|
|
4495
|
+
color: var(--dpk-ink-soft);
|
|
4496
|
+
font: 600 10px / 1.2 var(--dpk-body);
|
|
4497
|
+
text-align: center;
|
|
4498
|
+
transition:
|
|
4499
|
+
background 160ms var(--dpk-ease),
|
|
4500
|
+
color 160ms var(--dpk-ease);
|
|
4501
|
+
}
|
|
4502
|
+
|
|
4503
|
+
.dpk-page-tab {
|
|
4504
|
+
display: flex;
|
|
4505
|
+
flex-direction: column;
|
|
4506
|
+
align-items: center;
|
|
4507
|
+
gap: 3px;
|
|
4508
|
+
width: 100%;
|
|
4509
|
+
padding: 6px 2px 5px;
|
|
4510
|
+
border: 0;
|
|
4511
|
+
border-radius: inherit;
|
|
4512
|
+
background: transparent;
|
|
4513
|
+
color: inherit;
|
|
4514
|
+
font: inherit;
|
|
4515
|
+
cursor: pointer;
|
|
4516
|
+
}
|
|
4517
|
+
|
|
4518
|
+
.dpk-page-tab-icon {
|
|
4519
|
+
display: grid;
|
|
4520
|
+
place-items: center;
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4523
|
+
.dpk-page-tab-icon svg {
|
|
4524
|
+
width: 22px;
|
|
4525
|
+
height: 22px;
|
|
4526
|
+
stroke-width: 1.75;
|
|
4527
|
+
}
|
|
4528
|
+
|
|
4529
|
+
/* A long name keeps to two lines; the tab's title has the whole of it. */
|
|
4530
|
+
.dpk-page-tab-label {
|
|
4531
|
+
display: -webkit-box;
|
|
4532
|
+
max-width: 100%;
|
|
4533
|
+
overflow: hidden;
|
|
4534
|
+
overflow-wrap: anywhere;
|
|
4535
|
+
-webkit-box-orient: vertical;
|
|
4536
|
+
-webkit-line-clamp: 2;
|
|
4537
|
+
}
|
|
4538
|
+
|
|
4539
|
+
/* The page shown is named by an inline edit under its tab, since a button holds no field. */
|
|
4540
|
+
.dpk-page-tab-item[data-selected] .dpk-page-tab {
|
|
4541
|
+
padding-bottom: 3px;
|
|
4542
|
+
}
|
|
4543
|
+
|
|
4544
|
+
dpk-inline-edit.dpk-page-tab-label {
|
|
4545
|
+
display: block;
|
|
4546
|
+
box-sizing: border-box;
|
|
4547
|
+
width: 100%;
|
|
4548
|
+
padding: 0 2px 5px;
|
|
4549
|
+
--dpk-inline-edit-lines: 2;
|
|
4550
|
+
}
|
|
4551
|
+
|
|
4552
|
+
.dpk-page-tab-item:hover {
|
|
4553
|
+
background: var(--dpk-paper-raised);
|
|
4554
|
+
color: var(--dpk-ink);
|
|
4555
|
+
}
|
|
4556
|
+
|
|
4557
|
+
.dpk-page-tab-item[data-selected] {
|
|
4558
|
+
border-color: var(--dpk-rule-strong);
|
|
4559
|
+
background: var(--dpk-paper-raised);
|
|
4560
|
+
color: var(--dpk-accent);
|
|
4561
|
+
box-shadow: var(--dpk-shadow-xs);
|
|
4562
|
+
}
|
|
4563
|
+
|
|
4564
|
+
.dpk-page-tab:focus-visible,
|
|
4565
|
+
.dpk-page-tab-remove:focus-visible,
|
|
4566
|
+
.dpk-page-add:focus-visible {
|
|
4567
|
+
outline: 2px solid var(--dpk-focus);
|
|
4568
|
+
outline-offset: 2px;
|
|
4569
|
+
}
|
|
4570
|
+
|
|
4571
|
+
.dpk-page-tab-count {
|
|
4572
|
+
position: absolute;
|
|
4573
|
+
top: -3px;
|
|
4574
|
+
right: -3px;
|
|
4575
|
+
min-width: 16px;
|
|
4576
|
+
height: 16px;
|
|
4577
|
+
padding: 0 4px;
|
|
4578
|
+
border: 2px solid var(--dpk-paper-sunken);
|
|
4579
|
+
border-radius: 999px;
|
|
4580
|
+
background: var(--dpk-accent);
|
|
4581
|
+
color: var(--dpk-accent-ink);
|
|
4582
|
+
font-size: 9px;
|
|
4583
|
+
line-height: 12px;
|
|
4584
|
+
}
|
|
4585
|
+
|
|
4586
|
+
/* The "×" of a tab shows while the pointer or the focus is on that page. */
|
|
4587
|
+
.dpk-page-tab-remove {
|
|
4588
|
+
position: absolute;
|
|
4589
|
+
top: -4px;
|
|
4590
|
+
left: -4px;
|
|
4591
|
+
display: grid;
|
|
4592
|
+
place-items: center;
|
|
4593
|
+
width: 16px;
|
|
4594
|
+
height: 16px;
|
|
4595
|
+
padding: 0;
|
|
4596
|
+
border: 1px solid var(--dpk-rule-strong);
|
|
4597
|
+
border-radius: 999px;
|
|
4598
|
+
background: var(--dpk-paper-raised);
|
|
4599
|
+
color: var(--dpk-ink-soft);
|
|
4600
|
+
opacity: 0;
|
|
4601
|
+
cursor: pointer;
|
|
4602
|
+
}
|
|
4603
|
+
|
|
4604
|
+
.dpk-page-tab-remove svg {
|
|
4605
|
+
width: 10px;
|
|
4606
|
+
height: 10px;
|
|
4607
|
+
}
|
|
4608
|
+
|
|
4609
|
+
.dpk-page-tab-remove:hover {
|
|
4610
|
+
color: var(--dpk-ink);
|
|
4611
|
+
}
|
|
4612
|
+
|
|
4613
|
+
.dpk-page-tab-item:hover > .dpk-page-tab-remove,
|
|
4614
|
+
.dpk-page-tab-item:focus-within > .dpk-page-tab-remove {
|
|
4615
|
+
opacity: 1;
|
|
4616
|
+
}
|
|
4617
|
+
|
|
4618
|
+
.dpk-page-add {
|
|
4619
|
+
display: grid;
|
|
4620
|
+
place-items: center;
|
|
4621
|
+
width: 58px;
|
|
4622
|
+
height: 32px;
|
|
4623
|
+
margin-top: 6px;
|
|
4624
|
+
padding: 0;
|
|
4625
|
+
border: 1px dashed var(--dpk-rule-strong);
|
|
4626
|
+
border-radius: var(--dpk-radius);
|
|
4627
|
+
background: transparent;
|
|
4628
|
+
color: var(--dpk-ink-soft);
|
|
4629
|
+
cursor: pointer;
|
|
4630
|
+
}
|
|
4631
|
+
|
|
4632
|
+
.dpk-page-add:hover,
|
|
4633
|
+
.dpk-page-add[aria-expanded='true'] {
|
|
4634
|
+
background: var(--dpk-paper-raised);
|
|
4635
|
+
color: var(--dpk-ink);
|
|
4636
|
+
}
|
|
4637
|
+
|
|
4638
|
+
.dpk-page-add svg {
|
|
4639
|
+
width: 16px;
|
|
4640
|
+
height: 16px;
|
|
4641
|
+
}
|
|
4642
|
+
|
|
4643
|
+
/* With a rail, the header's switcher shows only where the rail does not: a
|
|
4644
|
+
phone has no column to spare. */
|
|
4645
|
+
.dpk-page-switcher-narrow {
|
|
4646
|
+
display: none;
|
|
4647
|
+
}
|
|
4648
|
+
|
|
4649
|
+
@media (max-width: 720px) {
|
|
4650
|
+
.dpk-page-rail {
|
|
4651
|
+
display: none;
|
|
4652
|
+
}
|
|
4653
|
+
|
|
4654
|
+
.dpk-page-switcher-narrow {
|
|
4655
|
+
display: contents;
|
|
4656
|
+
}
|
|
4657
|
+
}
|
|
4658
|
+
|
|
4395
4659
|
.dpk-app-pages {
|
|
4396
4660
|
flex: 1 1 0%;
|
|
4397
4661
|
display: grid;
|
|
@@ -4410,15 +4674,18 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},ev=O({title:D(x())}),tv={schema:ic(),m
|
|
|
4410
4674
|
::slotted([hidden]) {
|
|
4411
4675
|
display: none !important;
|
|
4412
4676
|
}
|
|
4413
|
-
`;class
|
|
4414
|
-
${
|
|
4415
|
-
|
|
4416
|
-
`}#F(e,n){return e.findIndex(s=>s.id===n.id)}#L(e,n,s,i){const r=Jn(this.locale);if(this.#u)return i.map(a=>({key:`content:${a.kind}:${a.name}`,label:a.label,icon:a.icon,current:!1,kind:"action",activate:()=>{this.#N(),this.#K(a)}}));const o=e.map((a,l)=>{const p=this.#Q(a,l,s),h=a.id===n?.id;return{key:`page:${a.id}`,label:p,icon:this.#_(a),current:h,activate:()=>{this.#N(),this.navigate({[ye]:a.id})},...h?{rename:{label:r.renamePage,commit:d=>this.#V(a.id,d)}}:{},...e.length>1?{remove:{label:r.removePage(p),activate:()=>this.#te(a.id)}}:{}}});return i.length===0?o:[...o,{key:"add",label:r.addPage,icon:oi,current:!1,kind:"action",activate:()=>{this.#u=!0,this.requestUpdate(),this.#ee()}}]}#ee(){this.updateComplete.then(()=>{this.renderRoot.querySelector(`#${Yt} .dpk-page-switcher-option`)?.focus()})}#V(e,n){this.dispatch({type:"RENAME_PAGE",target:Ue,payload:{page:e,label:n}})}#oe(){this.#D(),!this.#c&&(this.#c=!0,this.requestUpdate())}#Y(){this.#D(),this.#h=setTimeout(()=>this.#N(),xv)}#D(){this.#h!==void 0&&(clearTimeout(this.#h),this.#h=void 0)}#N(){this.#D(),!(!this.#c&&!this.#u)&&(this.#c=!1,this.#u=!1,this.requestUpdate())}renderSettingsSections(e){const n=this.#Z(e);return n===null?[]:n.settingsSections.map(s=>({id:s.id,label:s.label,render:()=>s.render()}))}settingsSwitches(e){const n=this.#I(e.state,e.navigation),s=n===void 0?void 0:this.#g(n.id);if(n===void 0||s===void 0)return null;const i=s.definition.settings?.(e.state.pages[n.id]);return i===void 0||i.items.length===0?null:{settings:i,flip:r=>{s.api.dispatch(r)}}}#g(e){return this.#v().find(n=>this.#w(n)===e)}#Z(e){const n=this.#I(e.state,e.navigation),s=(n===void 0?void 0:this.#g(n.id))?.content??null;return pv(s)?s:null}#Q(e,n,s){const i=this.#z(e);return i!==void 0&&e.label===i.label?n===0?s:Jn(this.locale).pageFallback(n+1):e.label}#G(e){const n=new Set([...this.api.state.layout.map(r=>r.id),...Array.from(this.children,r=>r.getAttribute(ut)??"")]),s=sv(e.name,n);this.dispatch({type:"ADD_PAGE",target:Ue,payload:{page:s,kind:e.kind,content:e.name,label:e.label}}).ok&&this.navigate({[ye]:s})}#te(e){const n=this.controller.actions,s=n.find(r=>{if(!we(r.target))return!1;const o=sn(kt,r);return o?.type==="ADD_PAGE"&&o.payload.page===e}),i=this.#S().layout.some(r=>r.id===e);if(s===void 0||i){this.dispatch({type:"REMOVE_PAGE",target:Ue,payload:{page:e}});return}for(const r of n)Zb(r,e)&&this.removeAction(r.id)}updated(){super.updated(),this.#ne(),this.#ae()}#ne(){const e=this.renderRoot.querySelector(`#${Yt}`),n=this.renderRoot.querySelector(".dpk-page-switcher-trigger");!e||!n||kv(e)||this.#k.open(e,n,vv,{placement:"bottom-end"})}#ae(){if(!this.#e)return;const e=this.api.state.layout,n=new Set(e.map(a=>a.id));this.#y(this.#j())!==this.#t&&this.refreshGrill();for(const a of this.#v())a.hasAttribute(gt)&&!n.has(this.#w(a))&&a.remove();const s=new Set(Array.from(this.children,a=>a.getAttribute(ut)));for(const a of e)s.has(a.id)||this.#le(a);const i=this.controller.actions,r=this.navigation[ye];let o=!1;for(const a of this.#v()){const l=this.#w(a);a.hidden=l!==r||!n.has(l),this.#de(a)&&(this.#i.get(a)!==i&&(this.#i.set(a,i),a.controller.replaceActions(gv(i,l)),o=!0),a.refreshContent(),a.deliver())}o&&this.settingsOpen&&this.requestUpdate()}#le(e){const n="dpk-page",s=`${e.kind==="view"?"dpk-view":"dpk-board"}-${e.content}`;if(customElements.get(n)===void 0||customElements.get(s)===void 0)return;const i=document.createElement(n);i.setAttribute(ut,e.id),i.setAttribute("label",e.label),i.setAttribute(gt,"");const r=document.createElement(s);i.append(r),i.hidden=!0,this.append(i)}#de(e){const n=this.#r.get(e);return n!==void 0?n:(this.#r.set(e,!1),e.ready.then(()=>{const s=e.contentState?.status==="ready";this.#r.set(e,s),s&&this.requestUpdate()}),!1)}}const $v=[{kind:"view",name:"usm",label:"User Story Mapping",icon:w(Sc)},{kind:"view",name:"prototype",label:"UX Prototype",icon:w(Mc),addable:!1},{kind:"view",name:"task-board",label:"Task Context Board",icon:w(cr),addable:!1},{kind:"view",name:"delegation-poker",label:"Delegation Poker",icon:w(Uc),addable:!1},{kind:"view",name:"slides",label:"Slides",icon:w(Ic),addable:!1},{kind:"view",name:"plain",label:"Plain",icon:w(dr),addable:!1},{kind:"board",name:"er-diagram",label:"ER diagram",icon:w(fc),addable:!1},{kind:"board",name:"state-diagram",label:"State diagram",icon:w(uc),addable:!1},{kind:"board",name:"sequence-diagram",label:"Sequence diagram",icon:w(oc),addable:!1},{kind:"board",name:"dependency-graph",label:"Dependency graph",icon:w(kc),addable:!1},{kind:"board",name:"architecture-map",label:"Architecture map",icon:w(dc),addable:!1},{kind:"board",name:"mind-map",label:"Mind map",icon:w(bc),addable:!1},{kind:"board",name:"event-storming",label:"Event Storming",icon:w(Wc)},{kind:"board",name:"example-mapping",label:"Example Mapping",icon:w(pr)},{kind:"board",name:"whiteboard",label:"Whiteboard",icon:w(Pc)},{kind:"board",name:"kanban",label:"Kanban",icon:w(cr)}];class ld extends yv{pageContents(){return $v}}const Sv=()=>{customElements.get("dpk-app")||customElements.define("dpk-app",ld)},dd=Bt(class extends In{constructor(t){if(super(t),t.type!==ve.PROPERTY&&t.type!==ve.ATTRIBUTE&&t.type!==ve.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!bm(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===V||e===b)return e;const n=t.element,s=t.name;if(t.type===ve.PROPERTY){if(e===n[s])return V}else if(t.type===ve.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return V}else if(t.type===ve.ATTRIBUTE&&n.getAttribute(s)===e+"")return V;return mi(t),e}});function zi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ge=zi();function cd(t){Ge=t}var We={exec:()=>null};function bt(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),i=e[s];return i||(i=t(s),e[s]=i),i}}function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(N.caret,"$1"),n=n.replace(i,o),s},getRegex:()=>new RegExp(n,e)};return s}var Av=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),N={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:bt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:bt(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:bt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:bt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:bt(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Qt})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:bt(t=>new RegExp(`^ {0,${t}}>`))},Ev=/^(?:[ \t]*(?:\n|$))+/,Cv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Tv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Rv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ii=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hd=S(pd).replace(/bull/g,Ii).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Mv=S(pd).replace(/bull/g,Ii).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Di=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ov=/^[^\n]+/,Ni=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,_v=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ni).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Pv=S(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ii).getRegex(),Qt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",qi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Lv=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",qi).replace("tag",Qt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ud=t=>S(Di).replace("hr",Zt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qt).getRegex(),zv=ud(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Iv=ud(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Dv=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Iv).getRegex(),Ui={blockquote:Dv,code:Cv,def:_v,fences:Tv,heading:Rv,hr:Zt,html:Lv,lheading:hd,list:Pv,newline:Ev,paragraph:zv,table:We,text:Ov},gd=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qt).getRegex(),Nv={...Ui,lheading:Mv,table:gd,paragraph:S(Di).replace("hr",Zt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qt).getRegex()},qv={...Ui,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:We,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(Di).replace("hr",Zt).replace("heading",` *#{1,6} *[^
|
|
4417
|
-
|
|
4677
|
+
`;class Gv extends ls{static{this.styles=[Yl,Ir,Dr,Kl,Bl,Fv]}static{this.properties={pageNav:{type:String,attribute:"page-nav"}}}#e=!1;#s=!1;#t="";#n="";#i=new WeakMap;#r=new WeakMap;#o=new Map;#a=new Map;#l;#c=null;#d=!1;#f=!1;#u=!1;#k;#p=new Vn(this);constructor(){super(),new un(this,{open:()=>this.#d,closesOn:e=>!e.some(n=>n instanceof Element&&(n.id===vt||n.matches(".dpk-page-switcher-trigger, .dpk-page-add"))),ownsEscape:()=>!0,dismiss:()=>this.#M()})}pageContents(){return[]}baseOptional(){return!0}definitionFor(e){return Av({pages:()=>this.#G(),base:()=>this.#$(),catalog:()=>this.#L(),messages:bt(e)})}connectedCallback(){super.connectedCallback(),this.addEventListener("dpk-comment-targets-change",this.#x),this.addEventListener("dpk-navigate",this.#A),this.addEventListener(zi,this.#v),this.#c=this.navigation,this.api.ready.then(()=>{this.#s=!0,this.#t=this.#E(this.#y()),this.requestUpdate()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dpk-comment-targets-change",this.#x),this.removeEventListener("dpk-navigate",this.#A),this.removeEventListener(zi,this.#v),this.#I()}#v=e=>{if(!(e instanceof CustomEvent)||!lv(e.detail))return;const n=e.target;!(n instanceof HTMLElement)||!dd(n)||n.parentElement!==this||(this.#r.set(n,e.detail.status==="ready"),!(!this.#s||!this.#e)&&(n.hasAttribute(gt)?this.requestUpdate():this.#w()))};#A=e=>{if(e.target!==this||!(e instanceof CustomEvent))return;const n=e.detail;if(typeof n!="object"||n===null||!("navigation"in n))return;const s=n.navigation;if(!Nv(s))return;const i=this.#c;if(this.#c=s,i!==null)for(const r of this.#g()){const o=this.#h(r),a=je(i,o),l=je(s,o);qv(a,l)||(r.content??r).dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:l},bubbles:!0,composed:!0}))}};#x=()=>{this.#s&&this.controller.setTemplate(this.definition)};get[Gn](){if(this.#s)return this.#l??={locale:()=>this.locale,theme:()=>this.dataset.theme,navigation:()=>this.navigation,pageNames:()=>new Set(this.#g().map(e=>this.#h(e))),dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)},this.#l}adoptedComponentProviders(){return this.#g().flatMap(e=>e.componentSnapshot?.providers??[])}#g(){return Array.from(this.children).filter(dd)}#y(){return this.#g().filter(e=>!e.hasAttribute(gt))}#h(e){return e.getAttribute(ut)??""}#S(e){return e.getAttribute("label")??e.definition.label}#$(){const e=this.#y();return{layout:e.map(n=>({id:this.#h(n),kind:n.definition.kind,content:n.definition.name,label:this.#S(n)})),pages:Object.fromEntries(e.map(n=>[this.#h(n),n.contentState?.status==="ready"?n.api.base:{}]))}}#w(){this.#i=new WeakMap,this.controller.setBase({...this.controller.base,...this.#$()}),this.refreshGrill()}#E(e){return e.map(n=>this.#h(n)).join(" ")}#G(){return this.#g().map(e=>({id:this.#h(e),label:this.#S(e),definition:e.liveDefinition??e.definition}))}#L(){const e=this.locale,n=this.#o.get(e);if(n!==void 0)return n;const s=this.pageContents(),i=s.flatMap(({kind:r,name:o})=>{const a=this.#C(r,o,e);return a===void 0?[]:[a]});return i.length===s.length&&this.#o.set(e,i),i}#C(e,n,s){const i=`${e==="view"?"dpk-view":"dpk-board"}-${n}`;if(customElements.get(i)===void 0)return;const r=document.createElement(i);r.setAttribute("lang",s);const o="definition"in r?r.definition:void 0;return Iv(o)?o:void 0}#D(){return this.pageContents().filter(e=>e.addable!==!1&&this.#U(e))}#U(e){const n=`${e.kind==="view"?"dpk-view":"dpk-board"}-${e.name}`;if(customElements.get(n)!==void 0)return!0;const s=zr();return e.kind==="view"?ad(e.name,s)!==null:ld(s)!==null}async#W(e){const n=this.locale,s=this.#C(e.kind,e.name,n);if(s!==void 0)return s;const i=zr(),r=e.kind==="view"?ad(e.name,i):ld(i);if(r===null)return;const o=e.kind==="view"?`view:${e.name}`:"boards";let a=this.#a.get(o);a??=import(r),this.#a.set(o,a);try{await a}catch(l){this.#a.delete(o),console.error(`dev-process-kit: could not load ${e.kind} "${e.name}" from ${r}`,l);return}return await customElements.whenDefined(`${e.kind==="view"?"dpk-view":"dpk-board"}-${e.name}`),this.#C(e.kind,e.name,n)}async#H(e){await this.#W(e)!==void 0&&this.#he(e)}#_(e){return this.#g().find(n=>this.#h(n)===e.id)?.definition??this.#L().find(n=>n.kind===e.kind&&n.name===e.content)}#b(e){return this.pageContents().find(n=>n.kind===e.kind&&n.name===e.content)?.icon??Hv}pendingStart(){return this.#e?null:this.#T().then(()=>{this.#e=!0;for(const e of this.#g())this.#r.set(e,e.contentState?.status==="ready")})}draftSettled(){return this.#e&&this.#y().every(e=>this.#r.get(e)===!0)}#T(){return customElements.whenDefined("dpk-page").then(()=>Promise.all(this.#g().map(e=>e.ready))).then(()=>{})}#V(){this.#s&&this.#T().then(()=>{const e=this.#E(this.#y());e!==this.#t&&(this.#t=e,this.#w())})}scriptOf(e){return this.querySelector(`:scope > ${e}`)}readGrill(){const e=super.readGrill(),n=this.#B();return this.#n=this.#E(n),uv(e,n.map(s=>{const i=this.#h(s);return{page:i,grill:this.parseGrillScript(s.content?.querySelector(Dv)??null,`@${i}`)}}))}#B(){const e=this.#y();if(!this.#s)return e;const n=new Set(this.api.state.layout.map(s=>s.id));return e.filter(s=>n.has(this.#h(s)))}grillRefsOf(e,n){return gv(n,fv(e))}get mainLayout(){return"fill"}buildBrief(e){const n=e.state.layout.flatMap(s=>{const i=this.#_(s);return i===void 0?[]:[{id:s.id,label:s.label,definition:i}]});return xv(super.buildBrief(e),vv(n,e.actions))}#R(e,n){return e.layout.find(s=>s.id===n[ge])}#ee(){return this.pageNav==="none"}renderRegions(e){return{main:m`<div class="dpk-app-body">
|
|
4678
|
+
${this.#z(e)}
|
|
4679
|
+
<div class="dpk-app-pages"><slot @slotchange=${()=>this.#V()}></slot></div>
|
|
4680
|
+
</div>`}}#N(){return this.pageNav==="sidebar"}#z(e){const n=e.state.layout,s=this.#D();if(!this.#N()||n.length===0&&s.length===0)return b;const i=bt(this.locale),r=this.#R(e.state,e.navigation),o=this.definition.title(e.state),a=n.map((l,p)=>{const h=this.#Q(l,p,o),d=l.id===r?.id;return{id:l.id,label:h,icon:this.#b(l),selected:d,pending:cd(e.actions,l.id).length,...d?{rename:{label:i.renamePage,commit:f=>this.#Y(l.id,f)}}:{},...n.length>1?{remove:{label:i.removePage(h),activate:()=>{this.#re(l.id,h)}}}:{}}});return Pv(a,i,{select:(l,{focus:p})=>{this.navigate({[ge]:l}),p&&this.updateComplete.then(()=>this.renderRoot.querySelector(`.dpk-page-tab[data-page="${l}"]`)?.focus())},...s.length===0?{}:{add:{label:i.addPage,open:this.#d&&this.#u,toggle:()=>this.#te()}}})}#te(){if(this.#d){this.#M();return}this.#d=!0,this.#f=!0,this.#u=!0,this.requestUpdate(),this.#se()}renderHeaderLead(e){if(this.#ee())return b;const n=e.state.layout,s=this.#R(e.state,e.navigation);return this.#K(n,s,this.definition.title(e.state),this.#D())}#K(e,n,s,i){if(e.length===0&&i.length===0)return b;const r=bt(this.locale),o={open:()=>this.#m(),scheduleClose:()=>this.#j()},a=Rv(zf,this.#d,e.length,r,o,{active:n===void 0?null:this.#Q(n,this.#pe(e,n),s)});return m`
|
|
4681
|
+
${this.#N()?m`<span class="dpk-page-switcher-narrow">${a}</span>`:a}
|
|
4682
|
+
${this.#d?Mv(this.#ne(e,n,s,i),r,{cancelClose:()=>this.#I(),scheduleClose:()=>this.#j()}):b}
|
|
4683
|
+
`}#pe(e,n){return e.findIndex(s=>s.id===n.id)}#ne(e,n,s,i){const r=bt(this.locale);if(this.#f)return i.map(a=>({key:`content:${a.kind}:${a.name}`,label:a.label,icon:a.icon,current:!1,kind:"action",activate:()=>{this.#M(),this.#H(a)}}));const o=e.map((a,l)=>{const p=this.#Q(a,l,s),h=a.id===n?.id;return{key:`page:${a.id}`,label:p,icon:this.#b(a),current:h,activate:()=>{this.#M(),this.navigate({[ge]:a.id})},...h?{rename:{label:r.renamePage,commit:d=>this.#Y(a.id,d)}}:{},...e.length>1?{remove:{label:r.removePage(p),activate:()=>{this.#re(a.id,p)}}}:{}}});return i.length===0?o:[...o,{key:"add",label:r.addPage,icon:Un,current:!1,kind:"action",activate:()=>{this.#f=!0,this.requestUpdate(),this.#se()}}]}#se(){this.updateComplete.then(()=>{this.renderRoot.querySelector(`#${vt} .dpk-page-switcher-option`)?.focus()})}#Y(e,n){this.dispatch({type:"RENAME_PAGE",target:He,payload:{page:e,label:n}})}#m(){this.#I(),!this.#d&&(this.#d=!0,this.requestUpdate())}#j(){this.#I(),this.#k=setTimeout(()=>this.#M(),jv)}#I(){this.#k!==void 0&&(clearTimeout(this.#k),this.#k=void 0)}#M(){this.#I(),!(!this.#d&&!this.#f)&&(this.#d=!1,this.#f=!1,this.#u=!1,this.requestUpdate())}renderSettingsSections(e){const n=this.#ie(e);return n===null?[]:n.settingsSections.map(s=>({id:s.id,label:s.label,render:()=>s.render()}))}settingsSwitches(e){const n=this.#R(e.state,e.navigation),s=n===void 0?void 0:this.#Z(n.id);if(n===void 0||s===void 0)return null;const i=s.definition.settings?.(e.state.pages[n.id]);return i===void 0||i.items.length===0?null:{settings:i,flip:r=>{s.api.dispatch(r)}}}#Z(e){return this.#g().find(n=>this.#h(n)===e)}#ie(e){const n=this.#R(e.state,e.navigation),s=(n===void 0?void 0:this.#Z(n.id))?.content??null;return zv(s)?s:null}#Q(e,n,s){const i=this.#_(e);return i!==void 0&&e.label===i.label?n===0?s:bt(this.locale).pageFallback(n+1):e.label}#he(e){const n=new Set([...this.api.state.layout.map(r=>r.id),...Array.from(this.children,r=>r.getAttribute(ut)??"")]),s=Sv(e.name,n);this.dispatch({type:"ADD_PAGE",target:He,payload:{page:s,kind:e.kind,content:e.name,label:e.label}}).ok&&this.navigate({[ge]:s})}async#re(e,n){this.#M();const s=bt(this.locale);await this.confirm({title:s.removePageConfirmTitle(n),body:s.removePageConfirmBody,confirmLabel:s.removePageConfirmOk,cancelLabel:s.removePageConfirmCancel,tone:"danger"})&&this.#ue(e)}#ue(e){const n=this.controller.actions,s=n.find(r=>{if(!ye(r.target))return!1;const o=on(kt,r);return o?.type==="ADD_PAGE"&&o.payload.page===e}),i=this.#$().layout.some(r=>r.id===e);if(s===void 0||i){this.dispatch({type:"REMOVE_PAGE",target:He,payload:{page:e}});return}for(const r of n)kv(r,e)&&this.removeAction(r.id)}updated(){super.updated(),this.#ge(),this.#oe()}#ge(){const e=this.renderRoot.querySelector(`#${vt}`),n=this.renderRoot.querySelector(this.#u?".dpk-page-add":".dpk-page-switcher-trigger");!e||!n||Uv(e)||this.#p.open(e,n,Bv,{placement:this.#u?"right-end":"bottom-end"})}#oe(){if(!this.#e)return;const e=this.api.state.layout,n=new Set(e.map(a=>a.id));this.#E(this.#B())!==this.#n&&this.refreshGrill();for(const a of this.#g())a.hasAttribute(gt)&&!n.has(this.#h(a))&&a.remove();const s=new Set(Array.from(this.children,a=>a.getAttribute(ut)));for(const a of e)s.has(a.id)||this.#ae(a);const i=this.controller.actions,r=this.navigation[ge];let o=!1;for(const a of this.#g()){const l=this.#h(a);a.hidden=l!==r||!n.has(l),this.#X(a)&&(this.#i.get(a)!==i&&(this.#i.set(a,i),a.controller.replaceActions(cd(i,l)),o=!0),a.refreshContent(),a.deliver())}o&&this.settingsOpen&&this.requestUpdate()}#ae(e){const n="dpk-page",s=`${e.kind==="view"?"dpk-view":"dpk-board"}-${e.content}`;if(customElements.get(n)===void 0||customElements.get(s)===void 0)return;const i=document.createElement(n);i.setAttribute(ut,e.id),i.setAttribute("label",e.label),i.setAttribute(gt,"");const r=document.createElement(s);i.append(r),i.hidden=!0,this.append(i)}#X(e){const n=this.#r.get(e);return n!==void 0?n:(this.#r.set(e,!1),e.ready.then(()=>{const s=e.contentState?.status==="ready";this.#r.set(e,s),s&&this.requestUpdate()}),!1)}}const Wv=[{kind:"view",name:"usm",label:"User Story Mapping",icon:w(Rc)},{kind:"view",name:"prototype",label:"UX Prototype",icon:w(Dc),addable:!1},{kind:"view",name:"task-board",label:"Task Context Board",icon:w(hr),addable:!1},{kind:"view",name:"delegation-poker",label:"Delegation Poker",icon:w(Yc),addable:!1},{kind:"view",name:"slides",label:"Slides",icon:w(Gc),addable:!1},{kind:"view",name:"plain",label:"Plain",icon:w(pr),addable:!1},{kind:"board",name:"er-diagram",label:"ER diagram",icon:w(xc),addable:!1},{kind:"board",name:"state-diagram",label:"State diagram",icon:w(bc),addable:!1},{kind:"board",name:"sequence-diagram",label:"Sequence diagram",icon:w(dc),addable:!1},{kind:"board",name:"dependency-graph",label:"Dependency graph",icon:w(yc),addable:!1},{kind:"board",name:"architecture-map",label:"Architecture map",icon:w(hc),addable:!1},{kind:"board",name:"mind-map",label:"Mind map",icon:w($c),addable:!1},{kind:"board",name:"event-storming",label:"Event Storming",icon:w(ip)},{kind:"board",name:"example-mapping",label:"Example Mapping",icon:w(ur)},{kind:"board",name:"whiteboard",label:"Whiteboard",icon:w(Bc)},{kind:"board",name:"kanban",label:"Kanban",icon:w(hr)}];class pd extends Gv{pageContents(){return Wv}}const Vv=()=>{customElements.get("dpk-app")||customElements.define("dpk-app",pd)},hd=Gt(class extends Dn{constructor(t){if(super(t),t.type!==xe.PROPERTY&&t.type!==xe.ATTRIBUTE&&t.type!==xe.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!qm(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===K||e===b)return e;const n=t.element,s=t.name;if(t.type===xe.PROPERTY){if(e===n[s])return K}else if(t.type===xe.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return K}else if(t.type===xe.ATTRIBUTE&&n.getAttribute(s)===e+"")return K;return ki(t),e}});function Di(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var We=Di();function ud(t){We=t}var Ve={exec:()=>null};function xt(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),i=e[s];return i||(i=t(s),e[s]=i),i}}function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(N.caret,"$1"),n=n.replace(i,o),s},getRegex:()=>new RegExp(n,e)};return s}var Kv=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),N={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:xt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:xt(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:xt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:xt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:xt(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Jt})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:xt(t=>new RegExp(`^ {0,${t}}>`))},Yv=/^(?:[ \t]*(?:\n|$))+/,Zv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Xt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ni=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fd=S(gd).replace(/bull/g,Ni).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Jv=S(gd).replace(/bull/g,Ni).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ex=/^[^\n]+/,Ui=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,tx=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ui).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),nx=S(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ni).getRegex(),Jt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Hi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sx=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Hi).replace("tag",Jt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),md=t=>S(qi).replace("hr",Xt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex(),ix=md(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),rx=md(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),ox=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rx).getRegex(),Bi={blockquote:ox,code:Zv,def:tx,fences:Qv,heading:Xv,hr:Xt,html:sx,lheading:fd,list:nx,newline:Yv,paragraph:ix,table:Ve,text:ex},kd=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Xt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex(),ax={...Bi,lheading:Jv,table:kd,paragraph:S(qi).replace("hr",Xt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",kd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex()},lx={...Bi,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Hi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ve,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(qi).replace("hr",Xt).replace("heading",` *#{1,6} *[^
|
|
4684
|
+
]`).replace("lheading",fd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},dx=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,cx=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bd=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,px=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,me=/[\p{P}\p{S}]/u,wt=/[\s\p{P}\p{S}]/u,en=/[^\s\p{P}\p{S}]/u,hx=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wt).getRegex(),ux=/[\p{Pi}\p{Ps}"']/u,vd=/(?!~)[\p{P}\p{S}]/u,gx=/(?!~)[\s\p{P}\p{S}]/u,fx=/(?:[^\s\p{P}\p{S}]|~)/u,mx=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Kv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xd=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,kx=S(xd,"u").replace(/punct/g,me).getRegex(),bx=S(xd,"u").replace(/punct/g,vd).getRegex(),vx=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,xx=S(vx,"u").replace(/openQuote/g,ux).replace(/punct/g,me).getRegex(),wd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wx=S(wd,"gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,wt).replace(/punct/g,me).getRegex(),yx=S(wd,"gu").replace(/notPunctSpace/g,fx).replace(/punctSpace/g,gx).replace(/punct/g,vd).getRegex(),$x="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Sx=S($x,"gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,wt).replace(/punct/g,me).getRegex(),Ax=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,wt).replace(/punct/g,me).getRegex(),Ex="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Cx=S(Ex,"gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,wt).replace(/punct/g,me).getRegex(),Tx=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,me).getRegex(),Rx="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Mx=S(Rx,"gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,wt).replace(/punct/g,me).getRegex(),Ox=S(/\\(punct)/,"gu").replace(/punct/g,me).getRegex(),_x=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Px=S(Hi).replace("(?:-->|$)","-->").getRegex(),Lx=S("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Px).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yd=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,ts=S(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",yd).getRegex(),zx=S(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",ts).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ix=S(/^!?\[(label)\]\[(ref)\]/).replace("label",ts).replace("ref",Ui).getRegex(),Dx=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ui).getRegex(),$d=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Nx=S(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",yd).getRegex(),qx=S("reflink|nolink(?!\\()","g").replace("reflink",S(/^!?\[(label)\]\[(ref)\]/).replace("label",Nx).replace("ref",$d).getRegex()).replace("nolink",S(/^!?\[(ref)\](?:\[\])?/).replace("ref",$d).getRegex()).getRegex(),Sd=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ux=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Hx=S(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Ux).getRegex(),ji={_backpedal:Ve,anyPunctuation:Ox,autolink:_x,blockSkip:mx,br:bd,code:cx,del:Ve,delLDelim:Ve,delRDelim:Ve,emStrongLDelim:kx,emStrongRDelimAst:wx,emStrongRDelimUnd:Ax,escape:dx,link:zx,nolink:Dx,punctuation:hx,reflink:Ix,reflinkSearch:qx,tag:Lx,text:px,url:Ve},Bx={...ji,emStrongLDelim:xx,emStrongRDelimAst:Sx,emStrongRDelimUnd:Cx,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",ts).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ts).getRegex()},Fi={...ji,emStrongRDelimAst:yx,emStrongLDelim:bx,delLDelim:Tx,delRDelim:Mx,url:S(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Hx).replace("protocol",Sd).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:S(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",Sd).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},jx={...Fi,br:S(bd).replace("{2,}","*").getRegex(),text:S(Fi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ns={normal:Bi,gfm:ax,pedantic:lx},tn={normal:ji,gfm:Fi,breaks:jx,pedantic:Bx},Fx={"&":"&","<":"<",">":">",'"':""","'":"'"},Ad=t=>Fx[t];function F(t,e){if(e){if(N.escapeTest.test(t))return t.replace(N.escapeReplace,Ad)}else if(N.escapeTestNoEncode.test(t))return t.replace(N.escapeReplaceNoEncode,Ad);return t}function Gx(t){return t.replace(N.numericCharacterReference,(e,n,s)=>{let i=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"\uFFFD":String.fromCodePoint(i)})}function Ed(t){try{t=encodeURI(t).replace(N.percentDecode,"%")}catch{return null}return t}function Cd(t,e){let n=t.replace(N.findPipe,(r,o,a)=>{let l=!1,p=o;for(;--p>=0&&a[p]==="\\";)l=!l;return l?"|":" |"}),s=n.split(N.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(N.slashPipe,"|");return s}function $e(t,e,n){let s=t.length;if(s===0)return"";let i=0;for(;i<s&&t.charAt(s-i-1)===e;)i++;return t.slice(0,s-i)}function Td(t){let e=t.split(`
|
|
4418
4685
|
`),n=e.length-1;for(;n>=0&&N.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
|
|
4419
|
-
`)}function
|
|
4686
|
+
`)}function ss(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function Rd(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function Md(t,e=0){let n=e,s="";for(let i of t)if(i===" "){let r=4-n%4;s+=" ".repeat(r),n+=r}else s+=i,n++;return s}function Od(t,e,n,s,i){let r=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let p=s.state.linkEmitted,h=s.state.inRawBlock;s.state.linkEmitted=!1;let d=s.inlineTokens(a),f=s.state.linkEmitted;if(s.state.linkEmitted=p,s.state.inLink=!1,!l){if(f){s.state.inRawBlock=h;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:r,title:o,text:a,tokens:d}}function Wx(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
|
|
4420
4687
|
`).map(r=>{let o=r.match(n.other.beginningSpace);if(o===null)return r;let[a]=o;return r.slice(Math.min(a.length,i.length))}).join(`
|
|
4421
|
-
`)}function
|
|
4688
|
+
`)}function _d(t,e,n,s){if(!e.includes("<"))return!1;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++;continue}if(e[i]==="`"){let a=s.inline.code.exec(e.slice(i));if(a){i+=a[0].length-1;continue}}if(e[i]!=="<")continue;let r=t.slice(n+i),o=s.inline.tag.exec(r)||s.inline.autolink.exec(r);if(o){if(o[0].length>e.length-i)return!0;i+=o[0].length-1}}return!1}var is=class{options;rules;lexer;constructor(t){this.options=t||We}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:Td(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=Wx(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=$e(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:$e(e[0],`
|
|
4422
4689
|
`),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:$e(e[0],`
|
|
4423
4690
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=$e(e[0],`
|
|
4424
4691
|
`).split(`
|
|
@@ -4435,18 +4702,18 @@ ${A.join(`
|
|
|
4435
4702
|
`+n.join(`
|
|
4436
4703
|
`),u=this.list(g);r[r.length-1]=u,s=s.substring(0,s.length-f.raw.length)+u.raw,i=i.substring(0,i.length-c.raw.length)+u.raw,n=g.substring(r.at(-1).raw.length).split(`
|
|
4437
4704
|
`);continue}}return{type:"blockquote",raw:s,tokens:r,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let r=this.rules.other.listItemRegex(n),o=!1;for(;t;){let l=!1,p="",h="";if(!(e=r.exec(t))||this.rules.block.hr.test(t))break;p=e[0],t=t.substring(p.length);let d=e[2].split(`
|
|
4438
|
-
`,1)[0],f=e[1].length,c=this.options.pedantic?
|
|
4705
|
+
`,1)[0],f=e[1].length,c=this.options.pedantic?Md(d,f):d.replace(this.rules.other.leadingSpaceTab,v=>Md(v,f)),g=t.split(`
|
|
4439
4706
|
`,1)[0],u=!c.trim(),k=0;if(this.options.pedantic?(k=2,h=c.trimStart()):u?k=f+1:(k=c.search(this.rules.other.nonSpaceChar),k=k>4?1:k,h=c.slice(k),k+=f),u&&this.rules.other.blankLine.test(g)&&(p+=g+`
|
|
4440
4707
|
`,t=t.substring(g.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(k),y=this.rules.other.hrRegex(k),A=this.rules.other.fencesBeginRegex(k),M=this.rules.other.headingBeginRegex(k),U=this.rules.other.htmlBeginRegex(k),L=this.rules.other.blockquoteBeginRegex(k);for(;t;){let G=t.split(`
|
|
4441
4708
|
`,1)[0],q;if(g=G,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),q=g):q=g.replace(this.rules.other.leadingSpaceTab,ae=>ae.replace(this.rules.other.tabCharGlobal," ")),A.test(g)||M.test(g)||U.test(g)||L.test(g)||v.test(g)||y.test(g))break;if(q.search(this.rules.other.nonSpaceChar)>=k||!g.trim())h+=`
|
|
4442
4709
|
`+q.slice(k);else{if(u||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(c)||M.test(c)||y.test(c))break;h+=`
|
|
4443
4710
|
`+g}u=!g.trim(),p+=G+`
|
|
4444
|
-
`,t=t.substring(G.length+1),c=q.slice(k)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(o=!0)),i.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),i.raw+=p}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let p=l.tokens.filter(d=>d.type==="space"),h=p.length>0&&p.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=h}for(let l of i.items){let p=l.tokens[0];if(l.task&&(p?.type==="text"||p?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let d={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let p of l.tokens)p.type==="text"&&(p.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=
|
|
4445
|
-
`),href:s,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=
|
|
4711
|
+
`,t=t.substring(G.length+1),c=q.slice(k)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(o=!0)),i.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),i.raw+=p}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let p=l.tokens.filter(d=>d.type==="space"),h=p.length>0&&p.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=h}for(let l of i.items){let p=l.tokens[0];if(l.task&&(p?.type==="text"||p?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let d={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let p of l.tokens)p.type==="text"&&(p.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=Td(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&Rd(e[2],"()")!==-1)return;let n=ss(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:$e(e[0],`
|
|
4712
|
+
`),href:s,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Cd(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
4446
4713
|
`):[],r={type:"table",raw:$e(e[0],`
|
|
4447
|
-
`),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?r.align.push("right"):this.rules.other.tableAlignCenter.test(o)?r.align.push("center"):this.rules.other.tableAlignLeft.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<n.length;o++)r.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:r.align[o]});for(let o of i)r.rows.push(
|
|
4714
|
+
`),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?r.align.push("right"):this.rules.other.tableAlignCenter.test(o)?r.align.push("center"):this.rules.other.tableAlignLeft.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<n.length;o++)r.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:r.align[o]});for(let o of i)r.rows.push(Cd(o,r.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[l]})));return r}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:$e(e[0],`
|
|
4448
4715
|
`),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
4449
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&
|
|
4716
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&_d(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=$e(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=Rd(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],r=o[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),Od(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&_d(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[ss(i)];if(!r){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Od(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=0,p=s[0][0],h=n===p,d=p==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(s=d.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(o=[...r].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(h)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let f=[...s[0]][0].length,c=t.slice(0,i+s.index+f+o);if(Math.min(i,o)%2){let u=c.slice(1,-1);return{type:"em",raw:c,text:u,tokens:this.lexer.inlineTokens(u)}}let g=c.slice(2,-2);return{type:"strong",raw:c,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(s=l.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r||(o=[...r].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let p=[...s[0]][0].length,h=t.slice(0,i+s.index+p+o),d=h.slice(i,-i);return{type:"del",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:Gx(e[0]),escaped:n}}}},J=class Ki{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||We,this.options.tokenizer=this.options.tokenizer||new is,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:N,block:ns.normal,inline:tn.normal};this.options.pedantic?(n.block=ns.pedantic,n.inline=tn.pedantic):this.options.gfm&&(n.block=ns.gfm,this.options.breaks?n.inline=tn.breaks:n.inline=tn.gfm),this.tokenizer.rules=n}static get rules(){return{block:ns,inline:tn}}static lex(e,n){return new Ki(n).lex(e)}static lexInline(e,n){return new Ki(n).inlineTokens(e)}lex(e){e=e.replace(N.carriageReturn,`
|
|
4450
4717
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(N.tabCharGlobal," ").replace(N.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let a=n.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
|
|
4451
4718
|
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
4452
4719
|
`)?"":`
|
|
@@ -4460,7 +4727,7 @@ ${A.join(`
|
|
|
4460
4727
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r),s=o.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
4461
4728
|
`)?"":`
|
|
4462
4729
|
`)+r.raw,a.text+=`
|
|
4463
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,
|
|
4730
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,ss(i.slice(r+1,-1))))&&!(r>1&&this.linkInText(i.slice(1,r-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=p=>{let h=p.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,ss(p.slice(h+1,-1))))return p;if(h>1&&p.charAt(0)!=="!"){let d=p.slice(1,h-1);if(this.linkInText(d))return"["+d.replace(a,l)+"]["+"a".repeat(p.length-h-2)+"]"}return"["+"a".repeat(p.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,p)=>{let h=p?p.length:0;return a.slice(0,h)+"["+"a".repeat(a.length-h-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,r="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!1;let a;if(this.options.extensions?.inline?.some(p=>(a=p.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let p=n.at(-1);a.type==="text"&&p?.type==="text"?(p.raw+=a.raw,p.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let p=1/0,h=e.slice(1),d;this.options.extensions.startInline.forEach(f=>{d=f.call({lexer:this},h),typeof d=="number"&&d>=0&&(p=Math.min(p,d))}),p<1/0&&p>=0&&(l=e.substring(0,p+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),i=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=a.raw,p.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},rs=class{options;parser;constructor(t){this.options=t||We}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(N.notSpaceStart)?.[0],i=t?t.replace(N.endingNewline,"")+`
|
|
4464
4731
|
`:"";return s?'<pre><code class="language-'+F(s)+'">'+(n?i:F(i,!0))+`</code></pre>
|
|
4465
4732
|
`:"<pre><code>"+(n?i:F(i,!0))+`</code></pre>
|
|
4466
4733
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
@@ -4478,8 +4745,8 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
4478
4745
|
`}tablerow({text:t}){return`<tr>
|
|
4479
4746
|
${t}</tr>
|
|
4480
4747
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
4481
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${F(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:i}){let r=i?F(n,!0):this.parser.parseInline(s),o
|
|
4482
|
-
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+F(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ke=new
|
|
4748
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${F(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:i}){let r=i?F(n,!0):this.parser.parseInline(s),o=Ed(t);if(o===null)return r;t=F(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+F(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=Ed(t);if(i===null)return F(n);t=i;let r=`<img src="${F(t)}" alt="${F(n)}"`;return e&&(r+=` title="${F(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:F(t.text)}},Gi=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},ee=class Yi{options;renderer;textRenderer;constructor(e){this.options=e||We,this.options.renderer=this.options.renderer||new rs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Gi}static parse(e,n){return new Yi(n).parse(e)}static parseInline(e,n){return new Yi(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){n+=a||"";continue}}let r=i;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}let o=r;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},nn=class{options;block;constructor(t){this.options=t||We}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?J.lex:J.lexInline}provideParser(t=this.block){return t?ee.parse:ee.parseInline}},Pd=class{defaults=Di();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ee;Renderer=rs;TextRenderer=Gi;Lexer=J;Tokenizer=is;Hooks=nn;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let o=i[r].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new rs(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=n.renderer[o],l=i[o];i[o]=(...p)=>{let h=a.apply(i,p);return h===!1&&(h=l.apply(i,p)),h||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new is(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=n.tokenizer[o],l=i[o];i[o]=(...p)=>{let h=a.apply(i,p);return h===!1&&(h=l.apply(i,p)),h}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new nn;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=n.hooks[o],l=i[o];nn.passThroughHooks.has(r)?i[o]=p=>{if(this.defaults.async&&nn.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await a.call(i,p);return l.call(i,d)})();let h=a.call(i,p);return l.call(i,h)}:i[o]=(...p)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,p);return d===!1&&(d=await l.apply(i,p)),d})();let h=a.apply(i,p);return h===!1&&(h=l.apply(i,p)),h}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return J.lex(t,e??this.defaults)}parser(t,e){return ee.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?J.lex:J.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let p=await(i.hooks?await i.hooks.provideParser(t):t?ee.parse:ee.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(p):p})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?J.lex:J.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?ee.parse:ee.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(t,e){return n=>{if(n.message+=`
|
|
4749
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+F(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ke=new Pd;function T(t,e){return Ke.parse(t,e)}T.options=T.setOptions=function(t){return Ke.setOptions(t),T.defaults=Ke.defaults,ud(T.defaults),T},T.getDefaults=Di,T.defaults=We;function Vx(...t){return Ke.use(...t),T.defaults=Ke.defaults,ud(T.defaults),T}T.use=Vx,T.walkTokens=function(t,e){return Ke.walkTokens(t,e)},T.parseInline=Ke.parseInline,T.Parser=ee,T.parser=ee.parse,T.Renderer=rs,T.TextRenderer=Gi,T.Lexer=J,T.lexer=J.lex,T.Tokenizer=is,T.Hooks=nn,T.parse=T,T.options,T.setOptions,T.walkTokens,T.parseInline,ee.parse,J.lex;const Kx={"&":"&","<":"<",">":">",'"':""","'":"'"},Ye=t=>t.replace(/[&<>"']/g,e=>Kx[e]??e),Yx=new Set(["http","https","mailto"]),Ld=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||Yx.has(n.toLowerCase())},Zx=t=>/^https?:/i.test(t.trim()),Qx=new Pd({gfm:!0,breaks:!0,renderer:{html({text:t}){return Ye(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!Ld(t))return s;const i=e?` title="${Ye(e)}"`:"",r=Zx(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${Ye(t)}"${i}${r}>${s}</a>`},image({href:t,title:e,text:n}){if(!Ld(t))return Ye(n);const s=e?` title="${Ye(e)}"`:"";return`<img src="${Ye(t)}" alt="${Ye(n)}"${s}>`}}}),zd=t=>Qx.parse(t,{async:!1}),Xx=Ne({en:{clickToEdit:"Click to edit",unset:"Not set",edit:"Edit"},ja:{clickToEdit:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6",unset:"\u672A\u8A2D\u5B9A",edit:"\u7DE8\u96C6"}});class Id extends X{static{this.styles=[pt,Ba,P`
|
|
4483
4750
|
:host {
|
|
4484
4751
|
display: inline-block;
|
|
4485
4752
|
max-width: 100%;
|
|
@@ -4524,6 +4791,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
4524
4791
|
font: inherit;
|
|
4525
4792
|
line-height: inherit;
|
|
4526
4793
|
letter-spacing: inherit;
|
|
4794
|
+
text-align: inherit;
|
|
4527
4795
|
color: inherit;
|
|
4528
4796
|
white-space: pre;
|
|
4529
4797
|
overflow-wrap: anywhere;
|
|
@@ -4703,7 +4971,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
4703
4971
|
:host([truncate]:not([wrap]):not([multiline])) .view {
|
|
4704
4972
|
-webkit-line-clamp: 1;
|
|
4705
4973
|
}
|
|
4706
|
-
`]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},truncate:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{type:Boolean,reflect:!0,attribute:"data-editing"},clipped:{type:Boolean,reflect:!0,attribute:"data-clipped"}}}#e="";#
|
|
4974
|
+
`]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},truncate:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{type:Boolean,reflect:!0,attribute:"data-editing"},clipped:{type:Boolean,reflect:!0,attribute:"data-clipped"}}}#e="";#s=0;#t="end";#n=new Vt(this);#i=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#r());connectedCallback(){super.connectedCallback(),this.#s+=1,this.#i?.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect()}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.truncate=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.clipped=!1,this.#e=""}startEditing(){this.#t="end",this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(this.#r(),!this.editing)return;const e=this.renderRoot.querySelector(".field");if(!e)return;const n=this.renderRoot,s=n instanceof ShadowRoot?n.activeElement:document.activeElement,i=this.#t;if(this.#t="end",s!==e&&e.focus(),i==="end"){const r=e.value.length;e.setSelectionRange(r,r)}}#r(){if(!this.truncate||!(this.wrap||this.multiline)){this.clipped&&(this.clipped=!1);return}const e=this.renderRoot.querySelector(".box > .mirror"),n=e!==null&&e.scrollHeight>e.clientHeight+1;n!==this.clipped&&(this.clipped=n)}render(){const e=Xx(this.#n.locale),n=this.placeholder||e.unset,{editing:s}=this,i=s?this.#e:this.value,r=this.label||this.placeholder||e.edit;if(this.markdown&&!s&&i!=="")return m`<span class="box"
|
|
4707
4975
|
><div
|
|
4708
4976
|
class="view dpk-prose"
|
|
4709
4977
|
role="button"
|
|
@@ -4712,7 +4980,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
4712
4980
|
@click=${this.#o}
|
|
4713
4981
|
@keydown=${this.#a}
|
|
4714
4982
|
>
|
|
4715
|
-
${
|
|
4983
|
+
${Ta(zd(i).trim())}
|
|
4716
4984
|
</div></span
|
|
4717
4985
|
>`;const o=i===""?n:i.endsWith(`
|
|
4718
4986
|
`)?`${i}\u200B`:i;return m`<span class="box"
|
|
@@ -4722,16 +4990,16 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
4722
4990
|
?readonly=${!s}
|
|
4723
4991
|
rows="1"
|
|
4724
4992
|
wrap=${this.multiline||this.wrap?"soft":"off"}
|
|
4725
|
-
.value=${
|
|
4993
|
+
.value=${hd(i)}
|
|
4726
4994
|
placeholder=${n}
|
|
4727
4995
|
aria-label=${r}
|
|
4728
4996
|
title=${s?b:e.clickToEdit}
|
|
4729
4997
|
@click=${this.#l}
|
|
4730
|
-
@input=${this.#
|
|
4731
|
-
@keydown=${this.#
|
|
4732
|
-
@blur=${this.#
|
|
4998
|
+
@input=${this.#c}
|
|
4999
|
+
@keydown=${this.#d}
|
|
5000
|
+
@blur=${this.#f}
|
|
4733
5001
|
></textarea>
|
|
4734
|
-
</span>`}#o=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#
|
|
5002
|
+
</span>`}#o=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#t="end",this.#e=this.value,this.editing=!0))};#a=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.#t="end",this.editing=!0)};#l=e=>{e.stopPropagation(),!this.editing&&(this.#t="click",this.#e=this.value,this.editing=!0)};#c=e=>{const n=ft(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#d=e=>{if(!e.isComposing){if(!this.editing){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.#t="end",this.#e=this.value,this.editing=!0);return}if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}if(e.key==="Enter"){if(e.shiftKey&&this.multiline||(e.preventDefault(),e.shiftKey))return;this.#u()}}};#f=e=>{const n=ft(e.currentTarget,HTMLTextAreaElement);if(n===null)return;const s=this.#s,{selectionStart:i,selectionEnd:r}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#s?(n.focus(),n.setSelectionRange(i,r)):this.#u())})};#u=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const Jx=()=>{customElements.get("dpk-inline-edit")||customElements.define("dpk-inline-edit",Id)},Dd=Ne({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What the agent should fix, or what you noticed (handed to the agent as a review comment)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add to review",changesHeading:"Changes",commentsHeading:"Review comments",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",emptyChanges:"No changes yet.",emptyChangesHint:"What you edit, add or move on the page lands here and reaches the agent as a change.",emptyComments:"No review comments yet.",emptyCommentsHint:"Write what the agent should fix. Comments reach the agent with the changes and are not kept on the page.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear all",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to close",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30EC\u30D3\u30E5\u30FC\u306B\u8FFD\u52A0",changesHeading:"\u5909\u66F4",commentsHeading:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",emptyChanges:"\u5909\u66F4\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyChangesHint:"\u30DA\u30FC\u30B8\u4E0A\u3067\u7DE8\u96C6\u30FB\u8FFD\u52A0\u30FB\u79FB\u52D5\u3057\u305F\u5185\u5BB9\u304C\u3053\u3053\u306B\u96C6\u307E\u308A\u3001\u5909\u66F4\u3068\u3057\u3066 Agent \u306B\u6E21\u308A\u307E\u3059\u3002",emptyComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyCommentsHint:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068\u3092\u66F8\u304D\u307E\u3059\u3002\u5909\u66F4\u3068\u4E00\u7DD2\u306B Agent \u306B\u6E21\u308A\u3001\u30DA\u30FC\u30B8\u306B\u306F\u6B8B\u308A\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u3059\u3079\u3066\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u9589\u3058\u308B",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),ew=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Nd=t=>t.kind==="explicit"?{kind:t.resume}:t,qd=(t,e)=>{switch(e.kind){case"input":return{...t,body:e.body};case"attach":return{...t,attachment:{kind:e.current?"current":"page"}};case"clear-target":return{...t,attachment:Nd(t.attachment)};case"edit-start":return{...t,editing:{id:e.id,body:e.body}};case"edit-input":return t.editing?{...t,editing:{...t.editing,body:e.body}}:t;case"edit-cancel":case"edited":return{...t,editing:null};case"target-requested":return{...t,attachment:{kind:"explicit",ref:e.ref,resume:t.attachment.kind==="explicit"?t.attachment.resume:t.attachment.kind}};case"submitted":return{...t,body:"",attachment:Nd(t.attachment),copy:{kind:"idle"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-started":return{...t,copy:{kind:"pending"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-finished":return e.request!==t.copyRequest||t.copy.kind!=="pending"?t:{...t,copy:{kind:e.ok?"copied":"failed"}};case"send-started":return{...t,send:{kind:"pending"},sendRequest:t.sendRequest+1,copy:{kind:"idle"},copyRequest:t.copyRequest+1};case"send-finished":return e.request!==t.sendRequest||t.send.kind!=="pending"?t:{...t,send:e.outcome.ok?{kind:"sent"}:{kind:"failed",reason:e.outcome.reason}}}},tw=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},nw=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},Ud=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Hd=(t,e)=>{const{definition:n,state:s,navigation:i,derivation:r}=t,o=Dd(t.locale),a=n.currentTarget?.(s,i)??null,l=e.attachment,p=l.kind==="explicit"?n.commentTargets(s,i).find(u=>u.value===l.ref):null,h=l.kind==="explicit"?{ref:l.ref,label:p?Ud(p):l.ref}:l.kind==="current"&&a?{ref:a.value,label:Ud(a)}:{ref:_(n.wholeTarget??{type:Qs,id:n.name}),label:o.wholePage},d=new Map(r.stale.map(u=>[u.action.id,u.reason])),f=t.section??"all",g=r.actions.filter(u=>!Y(u)||d.has(u.id)).map(u=>{const k=n.describe(u,s,r.base),v=u.type===I;return{kind:v?"comments":"changes",id:u.id,title:v?o.comment:k.title,targetLabel:k.targetLabel,author:t.authorOf?.(u.id)??null,tone:v?"comment":k.tone,text:{kind:v?"comment":"summary",body:v?Ht(u):k.summary??""},code:v?null:n.serialize(u),stale:d.get(u.id)??null,edit:!v||t.editable!==!0||t.canEdit?.(u.id)===!1?{kind:"none"}:e.editing?.id===u.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}});return{body:e.body,target:h,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,section:f,composer:f!=="changes",groups:["comments","changes"].filter(u=>f==="all"||f===u).map(u=>({kind:u,items:g.filter(k=>k.kind===u)})),hasDraft:r.actions.length>0,issues:t.issues.map(u=>`${u.path?`${u.path}: `:""}${u.message}`),send:t.sendable!==!0?"hidden":r.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Ca(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},sw=[pt,li,P`
|
|
4735
5003
|
:host {
|
|
4736
5004
|
display: flex;
|
|
4737
5005
|
flex-direction: column;
|
|
@@ -5182,15 +5450,15 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5182
5450
|
color: var(--dpk-green);
|
|
5183
5451
|
animation: dpk-pop var(--dpk-dur) var(--dpk-ease-spring);
|
|
5184
5452
|
}
|
|
5185
|
-
`],
|
|
5186
|
-
${s?b:m`<header><h2>${
|
|
5453
|
+
`],iw=t=>{switch(t){case"comment":return qn();case"create":return Un();case"update":return ai();case"delete":return Ra();case"move":return La();default:return Oa()}},rw=(t,e,n,s=!1)=>m`
|
|
5454
|
+
${s?b:m`<header><h2>${ow(t,e.section)}</h2></header>`}
|
|
5187
5455
|
${e.issues.length>0?m`<div class="issues" role="alert">
|
|
5188
5456
|
<strong>${t.rejected}</strong>
|
|
5189
5457
|
<ul>
|
|
5190
5458
|
${e.issues.map(i=>m`<li>${i}</li>`)}
|
|
5191
5459
|
</ul>
|
|
5192
5460
|
</div>`:b}
|
|
5193
|
-
${e.composer?
|
|
5461
|
+
${e.composer?aw(t,e,n):b} ${lw(t,e,n)}
|
|
5194
5462
|
<footer>
|
|
5195
5463
|
${s||e.send==="hidden"?b:m`<button
|
|
5196
5464
|
class="dpk-btn dpk-btn--accent"
|
|
@@ -5221,7 +5489,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5221
5489
|
</div>
|
|
5222
5490
|
${e.flash?m`<span class="flash" role="status">${e.flash}</span>`:b}
|
|
5223
5491
|
</footer>
|
|
5224
|
-
`,
|
|
5492
|
+
`,ow=(t,e)=>e==="changes"?t.changesHeading:e==="comments"?t.commentsHeading:t.heading,aw=(t,e,n)=>m`
|
|
5225
5493
|
<div class="composer">
|
|
5226
5494
|
<textarea
|
|
5227
5495
|
class="dpk-textarea"
|
|
@@ -5233,7 +5501,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5233
5501
|
></textarea>
|
|
5234
5502
|
${e.attachment.kind==="explicit"?m`<div class="row">
|
|
5235
5503
|
<button class="chip" type="button" aria-label=${t.detach} @click=${()=>n({kind:"clear-target"})}>
|
|
5236
|
-
${e.target.label} ${
|
|
5504
|
+
${e.target.label} ${qe()}
|
|
5237
5505
|
</button>
|
|
5238
5506
|
</div>`:e.attachment.kind==="checkbox"?m`<div class="row">
|
|
5239
5507
|
<label class="attach">
|
|
@@ -5257,28 +5525,28 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5257
5525
|
</button>
|
|
5258
5526
|
</div>
|
|
5259
5527
|
</div>
|
|
5260
|
-
`,
|
|
5528
|
+
`,Wi=(t,e)=>m`<div class="empty">
|
|
5261
5529
|
<div class="empty-box">
|
|
5262
|
-
${
|
|
5530
|
+
${qn()}
|
|
5263
5531
|
<p>${t}</p>
|
|
5264
5532
|
<p class="empty-hint">${e}</p>
|
|
5265
5533
|
</div>
|
|
5266
|
-
</div>`,
|
|
5534
|
+
</div>`,Bd=(t,e,n)=>m`<ul
|
|
5267
5535
|
class="list"
|
|
5268
5536
|
>
|
|
5269
|
-
${
|
|
5270
|
-
</ul>`,
|
|
5537
|
+
${Ge(e,s=>s.id,s=>dw(t,s,n))}
|
|
5538
|
+
</ul>`,lw=(t,e,n)=>{const[s]=e.groups;return e.groups.length===1&&s?s.items.length>0?m`<div class="groups">${Bd(t,s.items,n)}</div>`:s.kind==="changes"?Wi(t.emptyChanges,t.emptyChangesHint):Wi(t.emptyComments,t.emptyCommentsHint):e.groups.every(i=>i.items.length===0)?Wi(t.empty,t.emptyHint):m`<div class="groups">
|
|
5271
5539
|
${e.groups.filter(i=>i.items.length>0).map(i=>m`<section class="group" data-kind=${i.kind}>
|
|
5272
5540
|
<h3 class="group-head">
|
|
5273
5541
|
${i.kind==="changes"?t.changesHeading:t.commentsHeading}
|
|
5274
5542
|
<span class="group-count">${i.items.length}</span>
|
|
5275
5543
|
</h3>
|
|
5276
|
-
${
|
|
5544
|
+
${Bd(t,i.items,n)}
|
|
5277
5545
|
</section>`)}
|
|
5278
|
-
</div>`},
|
|
5546
|
+
</div>`},dw=(t,e,n)=>m`
|
|
5279
5547
|
<li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)} data-id=${e.id}>
|
|
5280
5548
|
<div class="item-head">
|
|
5281
|
-
<span class="item-icon">${
|
|
5549
|
+
<span class="item-icon">${iw(e.tone)}</span>
|
|
5282
5550
|
<span class="item-title">${e.title}</span>
|
|
5283
5551
|
${e.stale?m`<span class="stale-badge">${e.stale}</span>`:b}
|
|
5284
5552
|
${e.edit.kind==="available"?m`<button
|
|
@@ -5288,7 +5556,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5288
5556
|
title=${t.editComment}
|
|
5289
5557
|
@click=${()=>n({kind:"edit-start",id:e.id,body:e.text.body})}
|
|
5290
5558
|
>
|
|
5291
|
-
${
|
|
5559
|
+
${ai()}
|
|
5292
5560
|
</button>`:b}
|
|
5293
5561
|
<button
|
|
5294
5562
|
class="dpk-icon-btn"
|
|
@@ -5296,17 +5564,17 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5296
5564
|
aria-label=${t.deleteAction}
|
|
5297
5565
|
@click=${()=>n({kind:"delete",id:e.id})}
|
|
5298
5566
|
>
|
|
5299
|
-
${
|
|
5567
|
+
${qe()}
|
|
5300
5568
|
</button>
|
|
5301
5569
|
</div>
|
|
5302
5570
|
<div class="item-meta">
|
|
5303
5571
|
<span class="item-target">${e.targetLabel}</span>
|
|
5304
5572
|
${e.author===null?b:m`<span class="item-author">${e.author}</span>`}
|
|
5305
5573
|
</div>
|
|
5306
|
-
${e.edit.kind==="editing"?
|
|
5574
|
+
${e.edit.kind==="editing"?cw(t,e.edit,n):e.text.kind==="comment"?m`<p class="item-body">${e.text.body}</p>`:e.text.body?m`<div class="item-summary">${e.text.body}</div>`:b}
|
|
5307
5575
|
${e.code===null?b:m`<code class="item-code">${e.code}</code>`}
|
|
5308
5576
|
</li>
|
|
5309
|
-
`,
|
|
5577
|
+
`,cw=(t,e,n)=>m`
|
|
5310
5578
|
<div class="item-editor">
|
|
5311
5579
|
<textarea
|
|
5312
5580
|
class="dpk-textarea"
|
|
@@ -5335,8 +5603,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5335
5603
|
</button>
|
|
5336
5604
|
</div>
|
|
5337
5605
|
</div>
|
|
5338
|
-
`,
|
|
5339
|
-
.${
|
|
5606
|
+
`,pw=t=>t==="changes"||t==="comments"?t:"all";class jd extends X{static{this.styles=sw}static{this.properties={definition:{attribute:!1},state:{attribute:!1},navigation:{attribute:!1},derivation:{attribute:!1},issues:{attribute:!1},pendingTarget:{attribute:!1},onDelete:{attribute:!1},onClear:{attribute:!1},onComment:{attribute:!1},onEditComment:{attribute:!1},exportBrief:{attribute:!1},authorOf:{attribute:!1},canEditComment:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean},section:{type:String}}}#e=ew();#s=null;#t=new Vt(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null,this.section=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=qd(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const n=this.#s;n&&(this.#s=null,[...this.renderRoot.querySelectorAll(".item")].find(i=>i.dataset.id===n.id)?.querySelector(n.kind==="editor"?".item-editor textarea":".item-edit")?.focus())}#n(){return!this.definition||!this.derivation?null:{definition:this.definition,state:this.state,navigation:this.navigation,derivation:this.derivation,issues:this.issues,sendable:this.sendToClaude!==void 0,editable:this.onEditComment!==void 0,locale:this.#t.locale,section:pw(this.section),...this.authorOf===void 0?{}:{authorOf:this.authorOf},...this.canEditComment===void 0?{}:{canEdit:this.canEditComment}}}render(){const e=this.#n();return e?rw(Dd(this.#t.locale),Hd(e,this.#e),this.#r,this.embedded):b}#i(e){this.#e=qd(this.#e,e),this.requestUpdate()}#r=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#a();return;case"send":this.#o();return;case"edit-start":this.#s={kind:"editor",id:e.id},this.#i(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#s={kind:"edit-button",id:n.id}),this.#i(e);return}case"edit-save":{const n=nw(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#s={kind:"edit-button",id:n.id},this.#i({kind:"edited"});return}case"submit":{const n=this.#n();if(!n||!this.onComment)return;const s=tw(this.#e,Hd(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#i({kind:"submitted"});return}default:this.#i(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#i({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#i({kind:"send-finished",request:n,outcome:s})}async#a(){const e=this.#n();if(!e)return;this.#i({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??In({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,fe),i=await Tn(s);this.isConnected&&this.#i({kind:"copy-finished",request:n,ok:i})}catch{this.isConnected&&this.#i({kind:"copy-finished",request:n,ok:!1})}}}const hw=()=>{customElements.get("dpk-comment-panel")||customElements.define("dpk-comment-panel",jd)},sn="dpk-version",Fd="version",uw=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,os=t=>uw.test(t),gw="https://cdn.jsdelivr.net/npm/dev-process-kit@",Gd="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",Wd=t=>{const e=new URLSearchParams(t),n=e.get(sn)??e.get(Fd);return n!==null&&os(n)?n:null},fw=(t,e)=>{const n=Wd(t);return n===null||n===e?null:n},mw=(t,e)=>{if(!os(t))throw new Error(`not an exact version: ${t}`);if(!/^[a-z0-9-]+(?:\/[a-z0-9-]+)*\.js$/.test(e))throw new Error(`not an entry path: ${e}`);return`${gw}${t}/dist/${e}`},kw=(t,e)=>{const n=new URL(t);return n.searchParams.delete(Fd),e===null?n.searchParams.delete(sn):n.searchParams.set(sn,e),n.href},bw=O({tags:D(At(x(),St()),{}),versions:H(O({version:x()}))}),vw=t=>{const e=rn(bw,t),n=e.tags.latest;return{latest:typeof n=="string"&&os(n)?n:null,versions:e.versions.map(s=>s.version).filter(os)}},xw=t=>{const e=t.published?.versions??[],n=e.includes(t.current)?e:[t.current,...e],s=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...n.map(i=>({value:i,label:i===s&&i!==t.current?t.text.latest(i):i}))]}};let as;const ww=()=>(as??=fetch(Gd).then(async t=>{if(!t.ok)throw new Error(`${Gd} answered ${t.status}`);return vw(await t.json())}),as.catch(()=>{as=void 0}),as),yw=t=>{location.assign(kw(location.href,t))},$w=t=>import(t),Sw=({entry:t,views:e,url:n,register:s,importModule:i=$w})=>{const r=()=>{s(),Lr(fe,e,sn,n)},o=typeof location>"u"?null:fw(location.search,fe);if(o===null){r();return}i(mw(o,t)).then(()=>{Aw()||Cw(o)},a=>{console.error(`dev-process-kit@${o} could not be loaded; running ${fe}`,a),r()})},Aw=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},Vi="dpk-version-fallback",Ew=`
|
|
5607
|
+
.${Vi} {
|
|
5340
5608
|
flex: none;
|
|
5341
5609
|
height: 24px;
|
|
5342
5610
|
margin-left: auto;
|
|
@@ -5354,4 +5622,4 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5354
5622
|
letter-spacing: 0.02em;
|
|
5355
5623
|
cursor: pointer;
|
|
5356
5624
|
}
|
|
5357
|
-
`,
|
|
5625
|
+
`,Cw=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-view-")&&!n.querySelector(`:scope > .${Vi}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:Ew}));for(const n of e)n.append(Tw(n,t))}},Tw=(t,e)=>{const n=R(On(Mn(t))),s=document.createElement("select");s.className=Vi,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const i=o=>{const a=xw({current:e,requested:Wd(location.search)!==null,published:o,text:{pinned:n.versionPinned,latest:n.versionLatest}});s.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),s.value=a.value},r=()=>{ww().then(i,o=>console.warn(o))};return s.addEventListener("pointerenter",r,{once:!0}),s.addEventListener("focus",r,{once:!0}),s.addEventListener("change",()=>yw(s.value===""?null:s.value)),i(null),s};class Vd extends pv{}const Rw=()=>{customElements.get("dpk-page")||customElements.define("dpk-page",Vd)};export{Z as $,Un as A,Ra as B,I as C,ya as D,Ot as E,ua as F,mn as G,Re as H,kn as I,Ss as J,jr as K,_ as L,ni as M,fn as N,pt as O,jd as P,Id as Q,hw as R,Jx as S,Lr as T,sn as U,ls as V,ti as W,pd as X,Vd as Y,uo as Z,Ne as _,Rw as a,dr as a$,ue as a0,Fn as a1,ut as a2,Jf as a3,P as a4,b as a5,mp as a6,X as a7,Vt as a8,gi as a9,lr as aA,Af as aB,Mf as aC,Rf as aD,Pa as aE,Qf as aF,Ha as aG,qf as aH,Uf as aI,Ff as aJ,Gf as aK,Vf as aL,Wf as aM,Kf as aN,wf as aO,jf as aP,Bf as aQ,Hf as aR,Do as aS,at as aT,Sf as aU,fo as aV,ug as aW,Tv as aX,Mm as aY,Ta as aZ,zd as a_,tl as aa,nd as ab,lo as ac,Ja as ad,Ya as ae,Yo as af,m as ag,mi as ah,Vn as ai,Kt as aj,un as ak,Ge as al,Lf as am,Pf as an,ys as ao,hg as ap,Ii as aq,vi as ar,_n as as,na as at,_o as au,Tn as av,Wt as aw,Ia as ax,w as ay,rr as az,Ks as b,gr as b0,Ba as b1,Cn as b2,Gt as b3,Dn as b4,ki as b5,or as b6,ar as b7,hd as b8,za as b9,ft as ba,Xf as bb,qa as bc,dl as bd,Cv as be,cr as bf,pr as bg,Ur as bh,Gr as c,Vv as d,In as e,ta as f,Ht as g,pa as h,li as i,gn as j,zp as k,$s as l,si as m,ot as n,ha as o,Xe as p,Tf as q,Ef as r,Sw as s,qe as t,qn as u,fe as v,_a as w,Oa as x,La as y,ai as z};
|